├── README.md
├── build.boot
├── resources
│ ├── index.html
├── src
│ └── cljs
│ ├── sample
│ │ ├── core.cljs
│ └── main.cljs.edn
└── test
└── cljs
└── sample
└── core_test.cljs ├── README.md
├── build.boot
├── resources
│ ├── index.html
├── src
│ └── cljs
│ ├── sample
│ │ ├── core.cljs
│ └── main.cljs.edn
└── test
└── cljs
└── sample
└── core_test.cljsI'm sure everybody knows this, but here's "hello world" on the command line using GCC in e.g. Linux:
$ echo -e '#include <stdio.h>\nint main(void) { printf("hello, world!\\n"); return 0; }' > hello.c && gcc -o hello hello.c && ./hello
The most complicated thing here is probably the bash quoting/escaping (which explains the double backslash inside printf()'s arguments).The above command line spawns two processes, one of which is a full C compiler, and it runs in 3 milliseconds on my embarassingly old home laptop (Core-I5 M480 at 2.7 GHz).
I'm not trying to be the old fart claiming that everything was better back in the day, but this (to me) almost makes C seem as approachable as BASIC on the old 8-bit machines, when looking at the relative complexity.
java -cp cljs.jar clojure.main -e '(require (quote [cljs.build.api :as b])) (b/build (quote [(ns foo) (js/console.log "Hello world!")]) {:optimizations :advanced})'
But I'm not sure this is actually telling us anything.I am heavily thinking of implementing a language that is inspired by Clojure, but native to the JS land. It would use npm, Mori for data structures and browserify (if not on Node.js) under the hood for requiring libraries. Basically a transpiler from Lisp style code to JS, with better data structures.
Provide all the features of lein-ring, lein-figwheel, and lein-cljsbuild with a simpler setup and no clojure neccessary in a clojurescript project.
Serving compiled clojurescript, reloading cljs and css, with a browser repl, is really simple in boot. The boot tools work together better than the leiningen tools do.
If you look at the Tenzing template's build.boot, which doesn't have a lot going on, you'll see how straightforward the meat of it is, without ending up with other JVMs.
https://github.com/martinklepsch/tenzing/blob/master/resourc...
lein new tenzing some-project
emacs some-project/build.boot
M-x cider-jack-in
// switch to repl:
(boot (dev))
M-x cider-replicate-connection
// switch to new repl
(start-repl)
That's it. The first repl gives you feedback on the dev server and reloading. The second repl gives you a browser repl. Cider has also levelled up, such that when the browser repl connects it gets picked up by nrepl and just works. All of this with one JVM... and no Clojure sources in your ClojureScript only application.I stress again that the template really doesn't do a heck of a lot and the build.boot, the filesystem layout, and the way boot works is really the whole of the story. I wish Boot were better documented/marketted, so I could've switched to it long ago.