Code Monkey home page Code Monkey logo

cml-compiler's Introduction

CML - Conceptual Modeling Language

This repository contains the source code for the CML compiler.

Branches

Master

Build Status

Pre-requisites

Homebrew / Linuxbrew

One of the following is required to install the CML compiler:

Please report an issue if you cannot get the CML compiler installed using Homebrew or Linuxbrew.

Java 8

The only pre-requisite to run the CML compiler is Java 8.

The cml command should just work after installation if Java 8 is available on the environment.

Please report an issue, otherwise.

Quick, Two-Step Install with Homebrew / Linuxbrew

$ brew tap cmlang/cml # To make the CML compiler packages available.
$ brew install cml-compiler # To install the latest release.

Release Notes

To read the release notes of a specific version, please go to: https://github.com/cmlang/cml-releases/tree/master/cml-compiler

Look for the files ending with '.zip.notes.md'. For example: cml-compiler-1.0.zip.notes.md

Release Versioning

The release version format is YEAR.MONTH.DAY-CHANNEL, where:

  • YEAR/MONTH/DAY: the year/month/day the version was released.
  • CHANNEL: which channel the release was published in: -- gold: backward-compatible, high-quality releases; low-risk upgrade. -- alpha: development releases; no quality/compatibility guarantees; high-risk upgrade.

Either release channel may include bug fixes and new features.

Installing Specific Version with Homebrew / Linuxbrew

Finding Packages

Before you can install the CML compiler, please run:

$ brew tap cmlang/cml

After that, the CML compiler packages will be available to be installed.

Finding Versions

To find the versions of the CML compiler available to install:

$ brew update # To fetch all available versions.
$ brew search cml-compiler # To list available versions.

To read the release notes of a specific version, please go to (look for the '.zip.notes.md' files): https://github.com/cmlang/cml-releases/tree/master/cml-compiler

The Very Latest

If you'd like to always have the latest version of the CML compiler, regardless of the channel where it was released:

$ brew update # To fetch all available versions.
$ brew install cml-compiler

Later on, to upgrade to the latest version:

$ brew update # To fetch all available versions.
$ brew upgrade cml-compiler

You may get a new gold version (and thus backward-compatible/high-quality version), but you may also get an alpha release.

Specific Channel

If you'd like to get the latest release of a specific channel:

$ brew update # To fetch all available versions.
$ brew install cml-compiler-CHANNEL # where CHANNEL = alpha or gold

Once you've installed it, you can upgrade to the latest release of the channel with:

$ brew update # To fetch all available versions.
$ brew upgrade cml-compiler-CHANNEL # where CHANNEL = alpha or gold

Specific Day Version

You can also get the release of a specific day:

$ brew update # To fetch all available versions.
$ brew install [email protected]

Specific Year Version

You can even get the latest release of a specific year:

$ brew update # To fetch all available versions.
$ brew install cml-compiler@YEAR

If you've installed the current year, you can upgrade to the latest release of the current year with:

$ brew update # To fetch all available versions.
$ brew upgrade cml-compiler@CURRENT_YEAR

Contributing / Development

For information on helping us to develop CML, go to: CONTRIBUTING.md

cml-compiler's People

Contributors

quenio avatar

Watchers

 avatar James Cloos avatar

cml-compiler's Issues

CML Modules

When developing a single application with just a few targets, having a single directory to maintain all the code is fine. But once one needs to develop more than one application and share code among them, it is necessary to separate the common code. Also, some applications cover different domains, and it may be beneficial to separate the code for each domain.

In order to allow that, CML supports modules. Each module is a directory containing three sub-directories:

  • source: where the CML resides.
  • templates: optional directory containing templates for code generation.
  • targets: created by the compiler to contain the each target sub-directory, which in turn contains the code generated for a given target.

Under the CML source directory, the module will be defined by a module block. If a module needs to reference source in other modules, then an import statement should define the name of the other modules. The compiler will then compile the imported modules before compiling the current module.

In order for the compiler to find the other modules, they must be in a directory with the module's name under the same directory where the current module is located.

CML modules have no versions as they are maintained in the same code repository with the other modules they import. However, one can package a module as a library, which will have a version and the same name as the module. This library in turn can be published into a public (or company-wide) CML library site in order to be shared with other developers.

A module can also import a library, but its version must be specified along with its name. If a import statemement does not specify a version, it is assumed it is a module located in the same code repository; not a published library.

Acceptance criteria:

  • Targets have a name (used to determine which target to generate) and a type (used to determine which templates to use for code generation).
  • Calling the cml command compiles the module in the current dir. Only argument is the target name.
  • A module declaration defines which modules to import. All top-level declarations (except for modules themselves) are elements of the module whose source directory they reside in.
  • The imported modules are also loaded into the model.
  • A concept may specialize concepts of another module.
  • A type declaration may reference a type from another module.
    -- [ ] Transitive dependencies for concepts are necessary.
  • Errors are reported for:
    -- module name not matching the module's directory name.
    -- ancestor not defined in current module, or in imported modules.
    -- concept in type declaration not defined in current module, or in imported modules.
  • Move the base templates into a base module.
  • A task can use a constructor from an imported module.
    -- [ ] An error is reported if two imported modules have constructors with the same name.
    -- [ ] Transitive dependency is not allowed for constructors.
  • A module may use a task declared in an imported module.
  • A template can import templates from another module by specifying the module's name in the import statement.
    -- An error is reported if the module declaration does not have the module in the import path of the template. (That means there is no transitive dependencies for template imports.)
  • A constructor may choose whether the concepts of imported modules should be generated as well.
  • A module may use concepts defined in the base module.

CML Libraries

When one wants to share a module with other developers, the module can be packaged as a library and published into a public (or organization-wide) library repository.

A CML library is just a packaged, read-only module with a version. Any CML module can import a library by specifying the module name and a version.

A version has the format: revision[.accretion][.fix]

Where:

  • revision is the number of a library release incompatible with any previous releases with a lower revision number.
  • accretion is the number of a library revision compatible with any previous accretion number of the same revision.
  • fix is the number of a library accretion that fixes an issue in a previous library accretion.

Compatible versions do not break the library's interfaces but only add new features. Fixes cannot change the library's interfaces at all. The rules should be enforced by the compiler when packaging and publishing (that is, releasing) new versions of a library.

Bidirectional Associations

Properties are a simple way to define one-directional associations. However, sometimes it is necessary to specify that two one-directional associations should be bound into a single bi-directional association, so that changes in one are reflected in the other.

Acceptance Criteria:

  • Code generated in Java that implements the semantics of a bi-directional association.
  • Same for code generated in Python.
  • Required for CMLC target only.
  • NTH: the POJ target.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.