• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mbebenita/LLJS: LLJS: Low-Level JavaScript

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

mbebenita/LLJS

开源软件地址:

https://github.com/mbebenita/LLJS

开源编程语言:

JavaScript 98.9%

开源软件介绍:

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 (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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap