6502/JSLisp

do you have plan to support node.js?

Closed this issue · 2 comments

I think run this compiler on node's REPL or use node script maybe more convenient, no need to setup a web server.

It's DONE!!!

JsLisp provides the ability to deploy a compiled program that contains only the code that can possibly be executed explicitly from its main function, leaving the code for all unused functions, macros and the compiler itself out.

Also the produced Javascript code is minimized and this provides a smaller download size, a faster startup and some protection of the source code.

The easiest way to use the deploy function is to invoke JsLisp from node command line program:
node jslisp.js deploy.lisp myprogram.lisp > myprogram.js

6502 commented

On Tue, Feb 5, 2013 at 4:32 AM, hufengtao notifications@github.com wrote:

It's DONE!!!

JsLisp provides the ability to deploy a compiled program that contains
only the code that can possibly be executed explicitly from its main
function, leaving the code for all unused functions, macros and the
compiler itself out.

Also the produced Javascript code is minimized and this provides a smaller
download size, a faster startup and some protection of the source code.

The easiest way to use the deploy function is to invoke JsLisp from node
command line program:
node jslisp.js deploy.lisp myprogram.lisp > myprogram.js

Yes. There are both deploy.lisp and deploy-html.lisp (that generates
instead a self-contained HTML5 file including everything that can be
reached from the #'main call).

For example typing "node jslisp.js deploy-html.lisp examples/demos.lisp >
demos.html" you will get a self contained minified HTML/js file that
implements several JsLisp demos (self-contained is only about the code...
some of the demos require pictures that will be still downloaded from img
tags).

Note however that this currently doesn't work if your code requires the
compiler at runtime, so basically it's not possible to use
tree-shaking/deploying to create a stand-alone REPL.

In the past I've created a self-contained REPL (not requiring a web
server...) I'll add this version for who wants to play with JsLisp without
being online.

Sorry for the late reply but it's a couple of weeks I've beed very very
busy.

Andrea