planck

Planck ClojureScript REPL
mfikes 2016-06-20T03:36:56.000054Z

If anyone here has experience distributing software to Ubuntu via PPA / Launchpad, let me know. I’ve been working to get Planck set up for Ubuntu and there’s a lot of complexity to “get right.”

tord 2016-06-20T13:40:00.000056Z

Just for fun, I tried to compile Planck 2.0 alpha on a Raspberry Pi. I never expected it to work. Compilation took forever, but amazingly, everything appears to work perfectly! Thanks, @mfikes and @hey_lu! 👍

mfikes 2016-06-20T13:44:59.000057Z

@tord: In theory, if you first do make bundle-and-build on a regular computer, and then transfer the tree to a smaller computer (say, even without Java), you should be able to do a make clean and make build on that box with the result being that it will compile all of the C code natively for that platform.

mfikes 2016-06-20T13:46:00.000058Z

In other words, there is a phase where it produces bundle.c which involves the Java-based ClojureScript compiler. Once done, you can independently compile the resulting C anywhere in theory.

mfikes 2016-06-20T13:47:00.000059Z

@tord One thing you’ll need to share with us is the time produced by time planck -e '(map inc [1 2 3])’ on that Raspberry Pi 🙂

tord 2016-06-20T13:49:46.000061Z

This is on the fastest model, the Raspberry Pi 3. I can test on a Raspberry 2 as well, if that's of interest.

mfikes 2016-06-20T13:53:05.000062Z

@tord Wow. About 4 seconds. You could compare the same on that Pi against Clojure with time java -jar ~/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar -e '(map inc [1 2 3])’

mfikes 2016-06-20T13:56:06.000065Z

@tord Not much slower… (typically you get around a factor of 2). Perhaps there is some bottleneck both share. (Loading stuff off the filesystem, or somesuch.) That’s interesting nonetheless. You’re the first to have tried Planck on a Raspberry Pi, AFAIK 🙂

mfikes 2016-06-20T13:57:51.000066Z

That feels roughly like what happens with Replete on some slightly older iOS devices—it takes a few seconds before you can actually eval. I suppose with Planck on the Raspberry Pi, it launches and gives you a prompt, but then there is a race between how fast you can type the first form, and whether you will see blocking after hitting return.

tord 2016-06-20T13:59:02.000067Z

Yes, that seems to be the case.

mfikes 2016-06-20T13:59:38.000068Z

This makes me dream that there might be a lot of kids with inexpensive Raspberry Pi devices that could be given the binary you just built, and could actually learn some ClojureScript with it. 🙂

tord 2016-06-20T14:00:24.000069Z

Yes, would be nice. It makes me much more tempted to try to find something useful to do with my Pi, too. So far, it has mostly just been collecting dust. :simple_smile:

tord 2016-06-20T14:00:50.000070Z

6.7 seconds on the older Raspberry Pi 2, by the way.

mfikes 2016-06-20T14:01:36.000071Z

Wow. Slow, but definitely usable.

tord 2016-06-20T14:01:54.000072Z

Once it's started up, it seems quite fast.

mfikes 2016-06-20T14:03:25.000073Z

Yes. The slowness is really the phase where it loads the ClojureScript runtime into JavaScriptCore. If there is a way to, say dump an image of the memory of the process after startup, and then launch that instead it might be instant. (I’ve never really tried to do that on OS X, but perhaps Linux has some support for things like that—I have no clue.)

tord 2016-06-20T14:03:54.000074Z

Oops, it seems there is a problem:

tord 2016-06-20T14:04:17.000075Z

I started typing a simple recursive factorial function at the REPL, and got this:

tord 2016-06-20T14:05:53.000077Z

Works fine if I keep the input to a single line.

mfikes 2016-06-20T14:06:30.000078Z

@tord I suspect that is a bug in the part that temporarily moves the cursor to show you opening parens, etc. If you do planck -d it turns all of that off.

tord 2016-06-20T14:07:14.000079Z

You are right.