Skip to content

2016 002 Addition of COMPILER_META module

John Reppy edited this page May 3, 2017 · 3 revisions

Proposal 2016-06

Addition of COMPILER_META module

Author: Matt Rice
Managing editor: Some Editor
Last revised: September 6, 2016
Status: proposed
Discussion: issue #18


Synopsis

signature COMPILER_META

structure CompilerMeta :> COMPILER_META

[Provide Smackage a means to query basis implementation]

This module provides a means for writing a portable program which smackage to write a portable program which ensures its provides/requires mechanism extends beyond whole libraries and covers modules as well

Interface

type module_info = {
         name : string option,
         optional : bool,
         module_group : string,
         standard : string,
         implemented : bool
       }

val compilerName    : string
val compilerVersion : string
val basisModules    : module_info list

Description

  • type module
    Is a record containing information about the modules that come with the compiler, their name, and the group they belong to; e.g., Posix, Unix. If a module's name is NONE and the module group is implemented all modules in the group must be implemented.

  • compilerName
    Contains the compiler name in a vendor specific format.

  • compilerVersion
    Contains the compiler version in a vendor specific

  • basisModules
    A list containing module information as implemented by the compiler.

Discussion

Modules that the compiler implements are not limited to the modules defined by the basis. Definers of modules should specify their unique string that exists in the definedBy field

Possible alternatives are requiring a smackage file rather than generating one from a portable program. I could not tell if smackage could handle libraries such as the basis which define optional modules. Extending it is perhaps necessary.

Impact

Adding this module will not affect existing code.

Rationale

Operating systems such as Genode, have had success by defining an OS API Implementing that API on Posix platforms, even though the eventual target platform is very different. This allows developers of applications to target an API, run it on POSIX, or a subset of POSIX.

Such emerging standards are caught in a catch-22, this attempts to allow such emerging standards a route to success where upon defining an API compiler vendors can choose to implement it and application vendors can query for availability.

At the same time dealing with the existing problem of querying implementation status of optional components within the basis.


History

  • [2016-09-6] Proposed

Clone this wiki locally