I thought brackets ( eg '[' or ']' ) are Clojure syntactic sugar. I don't recall much use of them in Common Lisp (or Scheme), though I'm happy to be shown the error of my ways.
AFAIK, you are correct. In Clojure, square brackets are used for vector literals. Furthermore, Clojure uses vectors in some places (e.g. parameter lists in function definitions) that most Lisps use regular lists in order to help make those things more visually distinct.
Pixie (1) is a Clojure-like language that is written in rpython and is run via pypy (python jit), the advantages being fast startups (Clojure compile some libraries on startup which doesn't make it very suitable for writing CLI). This particular article is about running Pixie on the Raspberry Pi, check the Pixie language page to learn more about Pixie itself.
Pixie does not require the JVM.
> In what way is this clojure inspired? is it a brackety/syntax thing?
Have you looked at the article? It shows an example (that uses brackets and indeed looks like Clojure/lisp syntax).
Well, yes briefly (it lead to the question by saying it was clojure inspired), but I didn't have time to delve fully into the minutiae, as am at work and for some reason they keep expecting me to do stuff /shrugs/
It's mostly in syntax and the naming of functions. Our current though process is that we'll default to Clojure syntax/semantics where possible, but if the language will be faster or more flexible without a given aspect of Clojure's design we're pretty quick to adopt it.
This is interesting. I've had success in the past at running Hy [1] (a Lisp running on Python) on a Raspberry Pi as well. This could be a nice, speedier alternative, however you lose the Python ecosystem.
I tried to get the JIT to work on ARM a couple of months back. Since the author explicitly turned off the JIT, I suppose there's still work to be done...
The jit works, it's just that RPython's support for cross compilation is weak, and it requires a fair amount of memory to compile.
The gist of it all is that compiling pixie with a JIT for ARM requires an ARM machine with at least 1GB of RAM. I've gotten it to compile with a JIT on my Raspberry Pi 2, but it's a bit tricky.
Once the interpreter is compiled it only takes about 10MB of ram to run, so my long term goals are to release pre-built binaries.
There doesn't seem to be a homebrew package for Pixie yet on OS X. I made a quick Brewfile (http://brew.sh) but was bitten by pixie needing to find its standard libraries in a specific location.
I should look again because the project looks like a way to use Clojure style syntax for quick one off scripts instead of making an uberjar.
Cool, I wanted to use Clojure on the Raspberry Pi, but the startup time is very slow, due more to loading the core Clojure libraries than the JVM.
It makes writing a Clojure web server really impractical on the Pi. I considered using clojurescript for the server, but ended up just going back to node for my project.
Out of curiosity, why did startup time matter for a webserver? Webservers seem to be the canonical example of long running processes where startup time doesn't matter.
Also, why not clourescript on node? Seems like the best of both worlds.
Let's say you have a widget that you want to control via a web interface. A Pi is an easy way to interface between the web and lower level hardware (via GPIO). Startup time is the time from when you plug in power for your widget until you can control your widget from the web.
23 comments
[ 2.2 ms ] story [ 61.9 ms ] threadPixie runs over -RPython- PyPi.
(The bracket "thing" is not a Clojure feature, it is lisp)
[1]: https://github.com/pixie-lang/pixie#features
Pixie does not require the JVM.
> In what way is this clojure inspired? is it a brackety/syntax thing?
Have you looked at the article? It shows an example (that uses brackets and indeed looks like Clojure/lisp syntax).
[1]: https://github.com/pixie-lang/pixie
Well, yes briefly (it lead to the question by saying it was clojure inspired), but I didn't have time to delve fully into the minutiae, as am at work and for some reason they keep expecting me to do stuff /shrugs/
It's mostly in syntax and the naming of functions. Our current though process is that we'll default to Clojure syntax/semantics where possible, but if the language will be faster or more flexible without a given aspect of Clojure's design we're pretty quick to adopt it.
[1] http://hylang.org
The gist of it all is that compiling pixie with a JIT for ARM requires an ARM machine with at least 1GB of RAM. I've gotten it to compile with a JIT on my Raspberry Pi 2, but it's a bit tricky.
Once the interpreter is compiled it only takes about 10MB of ram to run, so my long term goals are to release pre-built binaries.
I should look again because the project looks like a way to use Clojure style syntax for quick one off scripts instead of making an uberjar.
It makes writing a Clojure web server really impractical on the Pi. I considered using clojurescript for the server, but ended up just going back to node for my project.
Also, why not clourescript on node? Seems like the best of both worlds.
time ./pixie-vm ./examples/hello-world.pxi Hello, World!
real 0m1.167s user 0m1.160s sys 0m0.000s