Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cl-cc-javascript

CI License: MIT Documentation

The JavaScript frontend for cl-cc: a lexer, a parser, and the runtime helpers that let cl-cc compile and execute JavaScript on its own VM. It targets SBCL. This is a plugin frontend, not a standalone JavaScript engine — it emits cl-cc AST nodes directly, so if you want an ESTree-shaped tree this is the wrong library.

Full documentation is published at https://nerima-lisp.github.io/cl-cc-javascript/. The source for that site lives in docs/src/.

Quick Start

(asdf:load-system "cl-cc-javascript")

(let* ((result  (cl-cc:compile-string "console.log(1 + 1);"
                                      :target :vm :language :javascript))
       (program (cl-cc/compile:compilation-result-program result)))
  (cl-cc/vm:run-compiled program))
;; prints: 2

Loading the system is all the setup there is: its last two components self-register with cl-cc/bootstrap, which is what makes :language :javascript available.

Install

# flake.nix
inputs.cl-cc-javascript = {
  url = "github:nerima-lisp/cl-cc-javascript";
  inputs.nixpkgs.follows = "nixpkgs";
};

Consumers inside this org normally pin a release tag rather than follow the default branch. cl-cc-javascript has no tag yet, so there is nothing to pin to; pin one as soon as the first tag exists.

Documentation

Development

nix develop          # SBCL with every CL_CC_JAVASCRIPT_*_ROOT already set
nix run .#test       # run the test suite
nix flake check      # compile + tests + formatting + docs, the same gate CI uses
nix fmt              # format Nix sources (treefmt)

Tests live in t/ and run under cl-weave, the org's test framework. Outside Nix, the sibling checkouts are located by the CL_CC_JAVASCRIPT_*_ROOT environment variables, falling back to sibling directories next to this repository — see scripts/dependency-roots.lisp.

Contributing

See the org-wide CONTRIBUTING guide and the package standard.

Support

See SUPPORT.

License

MIT. See LICENSE.

About

JavaScript backend for the cl-cc Common Lisp compiler

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages