Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/allnulled/contratos
Contratos is a programming language to type contracts between classes, processes and packages.
https://github.com/allnulled/contratos
Last synced: 1 day ago
JSON representation
Contratos is a programming language to type contracts between classes, processes and packages.
- Host: GitHub
- URL: https://github.com/allnulled/contratos
- Owner: allnulled
- Created: 2019-11-18T14:31:56.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-14T00:38:50.000Z (over 4 years ago)
- Last Synced: 2024-11-14T16:48:04.149Z (3 days ago)
- Language: JavaScript
- Homepage: https://allnulled.github.io/contratos
- Size: 348 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# contratos
Programming language to create and bind packages, classes and processes.
## Index
1. [The idea](#the_idea)
2. [Playground](#playground)
3. [Installation](#installation)
4. [Get started](#get_started)
5. [Examples](#examples)
6. [Issues](#issues)
7. [License](#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 functionIt is too simple, but this is the idea, to keep it simple, at least firstly.
## Playground
You can play freely with it at:
- [`https://allnulled.github.io/contratos`](https://allnulled.github.io/contratos)
*There, you can use suggestions to find out the syntax of the language instead of continue reading.*
## Installation
```sh
$ 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:
```sh
$ 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](https://github.com/allnulled/contratos/issues).
## License
This project is under [**WTFPL** or **do What The Fuck you want to Public License**](https://es.wikipedia.org/wiki/WTFPL), so do what you want with it.