News for hackers. Stuff that matters.
Re:Fast JavaScriptCore Desktop ClojureScript REPL by mfikes on Thursday July 16, 2015 @02:00PM (#9898849)
Author here. Willing to answer questions.
Re:Fast JavaScriptCore Desktop ClojureScript REPL by hellofunk on Thursday July 16, 2015 @02:04PM (#9898878)
Cool. Can you explain exactly what the phrases "ClojureScript apps that bootstrap themselves" or "bootstrapped ClojureScript runtime" mean?
Re:Fast JavaScriptCore Desktop ClojureScript REPL by mfikes on Thursday July 16, 2015 @02:17PM (#9898964)
Bootstrapped ClojureScript refers to the idea that ClojureScript can compile itself. Evidently Lisp was the first and ClojureScript was probably the most recent to accomplish this: https://en.wikipedia.org/wiki/Self-hosting

But then there is also the concept that a ClojureScript app which is going to make use of a REPL needs to do some additional work to bootstrap the ClojureScript runtime. Normally when you ship a ClojureScript app you would employ Google Closure to concatenate everything into a single file which is loaded and evaluated. But if you want to work with individual files (one per Clojure namespace, which is important when you are working with a REPL), you need to avoid that and you need to set up things to use Google Closure's dependency management system (CLOSURE_IMPORT_SCRIPT, etc.). I have a blog post which attempts to explain the different meaning of "bootstrap" in this context: http://blog.fikesfarm.com/posts/2015-03-05-ambly-app-bootstr...

Re:Fast JavaScriptCore Desktop ClojureScript REPL by hellofunk on Thursday July 16, 2015 @03:00PM (#9899233)
My God, it's turtles, I mean ClojureScript, all the way down!

This is really cool stuff. You've turned iOS into a classical lisp machine.

Re:Fast JavaScriptCore Desktop ClojureScript REPL by AlwaysBCoding on Thursday July 16, 2015 @03:06PM (#9899263)
I've been using the Reagent library for all my web UI's and it's simply incredible. I desparately want to translate this same workflow to iOS.

I'm a huge fan of React Native, but it's just not the same writing it in Javascript vs. using ClojureScript/Reagent. With the Javascript React Native workflow you're still forced to include npm modules to do basic enumerations, and the technical debt added to your codebase because of JSX is really painful.

Since Reagent components turn into React functions it seems like you should be able to write React Native apps in ClojureScript/Reagent and solve all these problems. I just don't even know how to start setting that up. Can I just use the regular CLJS compiler to save a javascript file and run it on the iPhone? Is there a tutorial or really simple example of the clojurescript to react-native workflow somewhere that you know of? If you wanted to learn more about this stuff where would you recommend starting?

Re:Fast JavaScriptCore Desktop ClojureScript REPL by mfikes on Thursday July 16, 2015 @03:33PM (#9899399)
From a tutorial / example perspective, there's this: https://github.com/omcljs/ambly/wiki/ClojureScript-React-Nat...

The general state of things is covered here: http://blog.fikesfarm.com/posts/2015-07-06-clojurescript-wit...

Re:Fast JavaScriptCore Desktop ClojureScript REPL by currentoor on Thursday July 16, 2015 @02:38PM (#9899092)
Hi Mike! Great work!

So when do you think we'll be able to make a solid app using React Native and cljs on iOS? What's the biggest impediment for being able to do that now?

Re:Fast JavaScriptCore Desktop ClojureScript REPL by mfikes on Thursday July 16, 2015 @04:16PM (#9899646)
I actually suspect that you can make a solid app with ClojureScript _today_, QTTT being the thing that makes me think this is so. https://github.com/mfikes/qttt#react-native-port Also, Facebook has shipped apps based on React Native.

The aspect that is rough is the ClojureScript tooling. This post attempts to cover where we are with tooling: http://blog.fikesfarm.com/posts/2015-07-06-clojurescript-wit...

Re:Fast JavaScriptCore Desktop ClojureScript REPL by casperc on Thursday July 16, 2015 @03:41PM (#9899440)
So how much work is it to add another compile target than JS, now that Clojurescript is bootstrapped?
Re:Fast JavaScriptCore Desktop ClojureScript REPL by mfikes on Thursday July 16, 2015 @04:19PM (#9899658)
Just me thinking off the top of my head: I doubt ClojureScript's ability to compile itself helps with that, but I've never pondered that before. Hmm.

I think Fogus's post is still relevant: http://blog.fogus.me/2012/04/25/the-clojurescript-compilatio...