Live data from Hacker News

Clojure Scripting on Node.js

github.com

11–20 of 35 posts

Re: Clojure Scripting on Node.js

#11
post #4

What is this? What is Clojure and why do you need it in node?

Author here. Nbb is a scripting environment for Clojure running on Node.js. Clojure is a Lisp that emphasises functional and data oriented programming. Scripts are executed using an interpreter, so there is no build/compile step necessary, which is convenient for small applications.

If you're more curious, check out the README which has a list of videos and articles on this.

Re: Clojure Scripting on Node.js

#13

If anyone is interested in mixing other languages in node, check out this silly little library I threw together: https://www.npmjs.com/package/polyglot-tag Embed any scripting language in a Node.js template literal!

This is actually really nifty. However can you change it to be asynchronous instead? Right now the polyglot runs synchronously.

What about the stdout/stderr... It ultimately has to give you back a child process. Could there be a spawn version that gives you the child process too?

Re: Clojure Scripting on Node.js

#14

If anyone is interested in mixing other languages in node, check out this silly little library I threw together: https://www.npmjs.com/package/polyglot-tag Embed any scripting language in a Node.js template literal!

This is actually really nifty. However can you change it to be asynchronous instead? Right now the polyglot runs synchronously. What about the stdout/stderr... It ultimately has to give you back a child process. Could there be a spawn version that gives you the child process too?

Ha ha you mean like this: https://www.npmjs.com/package/pipe-tag

Re: Clojure Scripting on Node.js

#15
post #10
post #7

Earlier quoted context omitted.

Clojure is a lisp on the jvm. javascript compilers exist because people wanted to use clojure in web related projects.

It's not a javascript compiler as Clojure is a hosted language.

clojurescript absolutely compiles to javascript, as per the official docs:

https://clojure.org/about/clojurescript

Re: Clojure Scripting on Node.js

#17
post #10
post #7

Earlier quoted context omitted.

Clojure is a lisp on the jvm. javascript compilers exist because people wanted to use clojure in web related projects.

It's not a javascript compiler as Clojure is a hosted language.

Nbb isn't a compiler, but a Clojure interpreter. Clojure is a hosted language, but can be compiled or interpreted. The ClojureScript compiler compiles Clojure to JavaScript, but nbb only interprets Clojure.

Re: Clojure Scripting on Node.js

#19
post #18

Author here. Ask me anything on nbb.

What's the difference between this and Clojurescript?

The main difference is that nbb lets you execute a .cljs file straight away, without a compilation step. As such, it doesn't need any JVM tooling. You can create an AWS Lambda with only a couple of lines of code:

https://blog.michielborkent.nl/aws-lambda-nbb.html

Re: Clojure Scripting on Node.js

#20
post #18

Earlier quoted context omitted.

What's the difference between this and Clojurescript?

The main difference is that nbb lets you execute a .cljs file straight away, without a compilation step. As such, it doesn't need any JVM tooling. You can create an AWS Lambda with only a couple of lines of code: https://blog.michielborkent.nl/aws-lambda-nbb.html

What are the language differences. What's missing in SCI's subset? Just Java stuff like deftype?
Post reply on HN