https://github.com/somecho/cljs-compiler-compiler
Exposing the CLJS compiler to JS
https://github.com/somecho/cljs-compiler-compiler
cljs clojurescript
Last synced: 2 months ago
JSON representation
Exposing the CLJS compiler to JS
- Host: GitHub
- URL: https://github.com/somecho/cljs-compiler-compiler
- Owner: somecho
- License: other
- Created: 2023-05-18T14:17:40.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T18:41:55.000Z (over 2 years ago)
- Last Synced: 2025-03-26T03:29:34.684Z (9 months ago)
- Topics: cljs, clojurescript
- Language: JavaScript
- Homepage:
- Size: 857 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CLJS Compiler Compiler
A compiler to compile CLJS's compiler...
## Seriously now
After reading David Nolen write about [compiling ClojureScript in the
browser](http://swannodette.github.io/2015/07/29/clojurescript-17/), I wanted
to try it out myself. Unfortunately, the article is from 2015 and he covered the
topic only from a high level.
This project is to expose `cljs/compile-str` to be callable from JS. Inspired by
the [Klipse project](https://github.com/viebel/klipse).
## Usage
```sh
git clone https://github.com/somecho/cljs-compiler-compiler
cd cljs-compiler-compiler
lein cljsbuild once
```
There will now be a `cljs.js` file in `/js`. You can then add this as a script
to your html document.
Alternatively, a [prebuilt JS script](./js/cljs.js) is already packaged in this repo.
```js
cljs.compile("(+ 1 1)")
// returns '((1 + 1))\n'
```