Giter VIP home page Giter VIP logo

jscl's Introduction

JSCL Build Status

JSCL is a Common Lisp to Javascript compiler, which is bootstrapped from Common Lisp and executed from the browser.

Getting Started

You can try a demo here. But if you want to hack JSCL, you will have to download the repository

git clone https://github.com/jscl-project/jscl.git

load jscl.lisp in your Lisp, and call the bootstrap function to compile the implementation itself:

(jscl:bootstrap)

It will generate a jscl.js file in the top of the source tree. Now you can open jscl.html in your browser and use it.

Status

JSCL is and will be a subset of Common Lisp. Of course it is far from complete, but it supports partially most common special operators, functions and macros. In particular:

  • Multiple values

  • Explicit control tranfers tagbody and go

  • Static and dynamic non local exit catch, throw; block, return-from.

  • Lexical and special variables. However, declare expressions are missing, but you can proclaim special variables.

  • Optional and keyword arguments

  • SETF places

  • Packages

  • Others

The compiler is very verbose, some simple optimizations or minification could help to deal with it.

Most of the above features are incomplete. The major features that are still missing are:

Feel free to hack it yourself

jscl's People

Contributors

abeaumont avatar billstclair avatar brpocock avatar davazp avatar diogoalexandrefranco avatar eudoxia0 avatar ferada avatar henryirvine avatar jnjcc avatar kengruven avatar kidd avatar kingcons avatar maxwellhansen avatar mishoo avatar nikodemus avatar orodley avatar puercopop avatar rayslava avatar samebchase avatar stylewarning avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

adventuring

jscl's Issues

Review CHAR-CODE-LIMIT

The current value happens to match SBCL's (#x110000) but this may not interoperate nicely with JavaScript

CLOSE DEFCLASS

Follow-up to #23

Implement DEFCLASS and use a variant on DEFSTRUCT storage for class objects.

type inference / form THE

The form THE is not actually supported, only discarded with a warning.

src/compiler/compiler.lisp: (warn "discarding THE ~a" value-type) ; XXX perhaps one day

Wrap XHR as file I/O

Implementation of file I/O using XHR. Should probably be packaged up in some way to avoid harming Node.JS builds / allow Node.JS users to implement some alternative form.

Suggests that maybe a features flag for browser v. node builds might be useful?

This may involve extending the stream-handling code in some ways, as I suspect JSCL is not really running full-on Gray Streams yet.

more FORMAT; some minimal bits

At the very least. print-radix support so #\U+xxxx escapes can be created in the new character code.

For now, “punting” to wiser souls on recursive {} () [] code though.

Probably: ~4,'0x ~36r ~5d ~5a ~va … as a baseline.

CLOS-like wrapper “good enough” for simple dispatch

Calling this “CLOSE” for now, does not seem to be any major obstacle to (long-term) on-boarding SB-PCL and using metaclass auto-wrappers for the prototype-based Javascript classes, but in the immediate future, this will make conditions and streams (at least) bearable.

Reduce read-once variable aliases

Generated code frequently contains sequences like:

var x = 'foo';
var y = x;

… which then never again references x. It seems that there is an opportunity to reduce some of this copying within the code-generation process.

FBOUNDP is probably broken

Symbols' function-values return the “special value” unboundFunction or unboundSetFFunction, so the tests in compiler.lisp will probably never work because they won't return undefined.

Either these tests need to be lowered to JavaScript in the prelude, or the unbound values can be lifted up to be accessible from compiler and we can rewrite the fdefinition and symbol-function in pseudo-Lisp right there, as well.

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.