GithubHelp home page GithubHelp logo

sophiebits / lljs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mbebenita/lljs

0.0 2.0 0.0 1.39 MB

LLJS: Low-Level JavaScript

Home Page: http://lljs.org

License: Other

JavaScript 100.00%

lljs's Introduction

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.

Try It Online

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 (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 module then run:

export NODE_PATH=src/
mocha --compilers ljs:ljc

from the root LLJS directory.

lljs's People

Contributors

disnet avatar jankeromnes avatar mbebenita avatar syg avatar

Watchers

 avatar  avatar

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.