jils

0.7.4 • Public • Published

Jils#

It's a lisp-style parser for javascript and a little set of functions and macros.

The current state of the project is toy-interpreter so please do not even mind into using this for production.

Installation###

The easiest way to install it is with npm:

npm install [-g] jils

But you can just clone the repo with:

git clone https://github.com/pabloPXL/jils.git

Provides##

A command-line repl.###

You can use it by just entering jils -i (-i is for interactive) on your terminal if jils was installed with npm in global mode [-g].

Or you can find the launcher script under bin/jils when installed locally or cloned the repo.

A browser console.###

You can find it under client/index.html. Please note that the console uses the client-side distribution of jils (all packed in one file), so if you make any change on the code, you will have to rebuild the distribution by triggering the script build-dist.sh located in the root of the project.

Examples##

A little echo server

(def net (require net))

(def server 
    (net.createServer 
	  (fn (socket) (do
    	  (socket.write "Echo server\r\n")
	      (socket.pipe socket)))))

(server.listen 1337)
(console.log 'echo server listening on 1337')

A little http server.

(def http (require http))

(def server (http.createServer
    (fn (req res) (do
        (res.writeHead 200
            (obj :Content-type text/plain))
        (res.end 'Hello world')))))

(server.listen 3000)
(console.log 'http server listening to 3000')

They are located also under examples on the root of the project.

You can run them with the command line tool or using node jils.js [filename, filename, ...].

More to come soon.

TO-DO's##

  • Generate javascript code from the syntax tree (see lib/parse.js#parse)
  • Write millions of tests
  • Extend the standard library (very poor ATM)
  • Expand macros on parsing-time, not on run-time (and stop using hacky function attributes -> '__macro')

Docs##

There is a full-code documentation located in docs under the root of the project.

Happy Hacking!###

Readme

Keywords

none

Package Sidebar

Install

npm i jils

Weekly Downloads

40

Version

0.7.4

License

none

Last publish

Collaborators

  • pw