Giter Club home page Giter Club logo

cl2js's Introduction

cl2js

License: MIT

A command-line utility to convert Common Lisp to JavaScript with Parenscript.

System Requirements

Our build script for Unix and build.bat for Windows script will download and install Parenscript, cl-portable and cl-yautils automatically. Hence, you don't need to manage dependency by yourself.

Build

Unix

Compile and package cl2js with SBCL:

$ ./scripts/package

or

$ ./scripts/package sbcl

Alternatively, compile and package cl2js with Clozure CL:

$ ./scripts/package ccl

Uncompress cl2js.tar.gz to some path and add path\to\cl2js\bin to PATH variable. Keep the structure of cl2js directory intact.

Windows

Compile and package cl2js with SBCL:

> .\scripts\package.bat

or

> .\scripts\package.bat sbcl

Alternatively, compile and package cl2js with Clozure CL:

> .\scripts\package.bat ccl

Uncompress cl2js.zip to some path and add path\to\cl2js\bin to PATH variable. Keep the structure of cl2js directory intact.

Java Platform

You may also run jcl2js on Unix or jcl2js.bat on Windows as-is.

To use jcl2js, add the local path of this repo to PATH variable.

Usage

cl2js

Note: It's cl2js.exe on Windows.

Assume source.lisp is a valid Parenscript source.

Compile source.lisp to output.js:

$ cl2js source.lisp > output.js

Later, run output.js with Node.js:

$ node output.js

Run source.lisp with Node.js on-the-fly:

$ cl2js source.lisp | node

jcl2js

Note: It's jcl2js.bat on Windows.

On first run, jcl2js will install Parenscript automatically for you:

$ jcl2js

Later, run jcl2js to compile source.lisp:

$ jcl2js source.lisp > output.js

Known Issues or Bugs

  • Armed Bear CL starts too slowly to be useful as a scripting language

Note

The version of Armed Bear CL bundled in this repo is 1.8.0.

See Also

burtonsamograd/sigil

Copyright

Copyright (c) 2020 Michelle Chen. Licensed under MIT

cl2js's People

Contributors

cwchentw avatar opensourcedoc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

tluyben

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.