contratos
contratos
Last updated 6 months ago by allnulled .
WTFPL · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install contratos 
SYNC missed versions from official npm registry.

contratos

Programming language to create and bind packages, classes and processes.

Index

  1. The idea
  2. Playground
  3. Installation
  4. Get started
  5. Examples
  6. Issues
  7. License

The idea

The idea of this language is that you create easily the contracts of 3 onthologies in which you should be able to wrap any software project:

  • package: any type of software module
  • class: a function that creates objects
  • process: a function

It is too simple, but this is the idea, to keep it simple, at least firstly.

Playground

You can play freely with it at:

There, you can use suggestions to find out the syntax of the language instead of continue reading.

Installation

$ npm install -g contratos

Get started

CLI usage

Write a simple contratos script (simple.cnt):

package package1
class ClassOne
process process1

Then compile it from the console:

$ contratos compile simple.cnt

A simple.cnt.json will be created representing the ast of your script. And that is all.

API usage

Syntax examples

These examples demonstrate all the available options per each idea: package, class and process.

A package

package package1
 file "somefile.txt"

A process

process process1
  file "x"
  uses classes Class1, Class2
  uses processes process1, process2
  that receives parameter1, parameter2
  that modifies parameter1, Class1.property
  that returns output

A class

class A
  file "class-a"
  extends AncestorOfA
  implements MutationOfA1, MutationOfA2
  uses packages package1, package2, package3
  uses classes Class1, Class2, Class3
  uses processes process1, process2, process3
  has 
    static property property1 set to 100
    property property2 set to 200
    static method method1
      uses packages package1
      uses classes Class1, Class2
      uses processes process1, process2
      that receives parameter1, parameter2
      that modifies parameter1, Class1.property
      that returns output
    method method2
      uses packages package1
      uses classes Class1, Class2
      uses processes process1, process2
      that receives parameter1, parameter2
      that modifies parameter1, Class1.property
      that returns output
    described as a custom description.

Issues

Please, send your issues and suggestions at the page of issues in the Github project, here.

License

This project is under WTFPL or do What The Fuck you want to Public License, so do what you want with it.

Current Tags

  • 0.0.1                                ...           latest (6 months ago)

1 Versions

  • 0.0.1                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (8)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |