Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mbebenita/LLJS
LLJS: Low-Level JavaScript
https://github.com/mbebenita/LLJS
Last synced: 4 months ago
JSON representation
LLJS: Low-Level JavaScript
- Host: GitHub
- URL: https://github.com/mbebenita/LLJS
- Owner: mbebenita
- License: other
- Created: 2012-02-06T18:52:37.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2020-03-11T17:38:19.000Z (almost 5 years ago)
- Last Synced: 2024-10-15T09:41:25.024Z (4 months ago)
- Language: JavaScript
- Homepage: http://lljs.org
- Size: 1.41 MB
- Stars: 1,176
- Watchers: 68
- Forks: 119
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
LLJS
====LLJS is a typed dialect of JavaScript that offers a
C-like type system with manual memory management. It compiles to JavaScript
and lets you write memory-efficient and GC pause-free code less painfully, in
short, LLJS is the bastard child of JavaScript and C. LLJS is early research
prototype work, so don't expect anything rock solid just yet. The research
goal here is to explore low-level statically typed features in a high-level
dynamically typed language. Think of it as inline assembly in C, or the
unsafe keyword in C#. It's not pretty, but it gets the job done.Usage
=====For users of node.js, `bin/ljc` is provided.
For users of SpiderMonkey `js` shell, the compiler can be invoked with:
$ js ljc.js
in the src/ directory.
Memcheck
========If you would like to compile with support for [memory checking](http://disnetdev.com/blog/2012/07/18/memory-checking-in-low-level-javascript/) (detects
leaks, accesses of unallocated and undefined memory locations, and
double frees) then compile with the -m flag:$ bin/ljc -m -o myscript.js myscript.ljs
And add the following code to the end of your program run to report
any memory errors:let m = require('memory');
// for SpiderMonkey do
// let m = load('memory.js')
console.log(m.memcheck.report());The memory checker uses Proxies so if you use node.js you need to
enable it with:$ node --harmony-proxies myscript.js
Testing
=======To run the tests install the [Mocha](http://visionmedia.github.com/mocha/) module then run:
export NODE_PATH=src/
mocha --compilers ljs:ljcfrom the root LLJS directory.