Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/batiste/cokescript
CokeScript is a whitespace sensitive language that compile to JavaScript
https://github.com/batiste/cokescript
Last synced: 5 days ago
JSON representation
CokeScript is a whitespace sensitive language that compile to JavaScript
- Host: GitHub
- URL: https://github.com/batiste/cokescript
- Owner: batiste
- Created: 2015-01-21T15:42:31.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-09-01T21:23:20.000Z (about 2 years ago)
- Last Synced: 2024-10-31T17:38:57.404Z (12 days ago)
- Language: JavaScript
- Size: 1.03 MB
- Stars: 42
- Watchers: 4
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CokeScript
CokeScript is a whitespace sensitive language inspired by Python and Ruby that compile to JavaScript. This project is still at an early stage. The CokeScript compiler is written in CokeScript.
How does it compare against CoffeeScript:
- Scoping is not broken (https://donatstudios.com/CoffeeScript-Madness)
- Multiline string don't necessitate backslashes
- Virtual Dom support within the language
- The source code of the language is rather simple and short
- [Language specification](/doc/spec.md)
- [Interactive demo](http://batiste.github.io/CokeScript)![Style matters](https://raw.githubusercontent.com/batiste/CokeScript/master/css/eg-coke.png)
## Examples
- Consuming a REST API, build with webpack https://github.com/batiste/cokescript-pets
- Simple frontend consuming a CRUD REST API https://github.com/batiste/cokescript-frontend## Atom support
- Syntax highlighting for Atom https://atom.io/packages/language-cokescript
- A linter for Atom https://atom.io/packages/linter-cokescript## API
### Import CokeScript
or
var cokescript = require('cokescript');
## Usage
### cokescript.generateModule(input)
Return object of form
{
ast: Abstract syntax trees,
code: JavaScript code,
ns: Namespace of the module
}### cokescript.generateExports(keys)
Return a commonJs module export statement with the keys provided. If none are provided
the module level keys of the last compiled module will be used.## Command line tool
$ lib/coke.js
Usage of the coke command
coke
Options
-m or --commonjs generate a commonJs module
-o or --output write the output to a single file
-e or --execute execute the generated javascript
-g or --glob select all files matched by a glob expression
-c or --convert convert each input file to JavaScript
### Grammar parserCokeScript use EPEG.js https://github.com/batiste/EPEG.js/