r/Clojure • • Mar 08 '15

Pixie: stunningly good

http://blog.goodstuff.im/pixie
74 Upvotes

16 comments sorted by

6

u/spotter Mar 09 '15

Nice note, could use less of "bashing JVM for Clojure's sins".

Pixie looks awesome.

3

u/yogthos Mar 09 '15

I really don't see the JVM as a negative for the kinds of applications Clojure is typically used for either.

6

u/simtel20 Mar 10 '15

I think you've got that backwards: It's hard to use clojure for problems that the jvm doesn't handle well already. E.g. until 1.7 you had to do a ffi call to make a directory, so you'll probably see code in the past avoiding doing anything that may have to make a directory on the filesystem.

Clojure could be very good for expressing some problems but the presence of the JVM makes it impossible - e.g. if you need to fork+exec then it is terrible because you need to specify the heap up-front, and are more likely to get a fork failed because the OS virtual memory system can't allocate an additional X MB (where -Xms < X < -Xmx (non-deterministic!) even if it's just in order to vfork+exec something trivially small. With something like pixie, you could create a launcher where your use of memory is small and constrained, and fork+exec as you please because the parent doesn't have to have the same heap requirements as the children.

That's just one example. Anything that handles DNS is another. You have to become a JVM domain expert to use anything hosted on the JVM, and that anything systems-ish will be excluded by default, and will only work with way more effort than other runtimes (cough go cough) in spite of how much nicer the language is.

3

u/yogthos Mar 10 '15

Sure, the JVM definitely influenced the domains where Clojure is used. There have been a few previous attempts at making Clojure versions that are independent of the JVM, but Pixie looks like the first really viable one. I'm definitely excited to see where it goes. ;)

7

u/[deleted] Mar 10 '15

Indeed. I can also definitely see it as a "I'd like to write a Clojure CLI app, but the startup is killing me, so I'll use Pixie instead" kind of deal.

7

u/fullouterjoin Mar 09 '15

You mean like, "Clojure startup time is predominately a Clojure problem, not a JVM problem" kinda thing?

7

u/spotter Mar 09 '15

Yes, it's something that is caused by Clojure and should be fixed in Clojure. I also found that my stuff runs OK with memory set far lower than 2G mentioned in the article, but did not want to pit heresay against heresay.

2

u/joequin Mar 10 '15

And, java doesn't need 128 MB of ram for hello world. I can do most project Euler problems in java with 40MB of ram without any performance penalty. I can go even lower, but then it gets slower. Not slow, but slower.

6

u/agumonkey Mar 09 '15

Link to the actual language project https://github.com/pixie-lang/pixie

A Lisp written in RPython

  • Immutable datastructures

  • Protocols first implementation

  • Transducers at-the-bottom (most primitives are based off of reduce)

  • A "good enough" JIT (implemented, tuning still a WIP, but not bad performance today)

  • Easy FFI

  • Pattern matching (TODO)

1

u/inushi Mar 09 '15

It looks fun, but if I'm reading the GitHub page correctly it has its own VM and doesn't use the Python VM. I assume this means it cannot inter-operate with existing Python libraries.

Is my assumption right?

2

u/yogthos Mar 10 '15

RPython is just the implementation language. Pixie itself has no relation to Python or its VM.

1

u/pxpxy Mar 10 '15

If you want a python lisp check out hylang

2

u/kraakf Mar 09 '15

Looks great - thanks for sharing!

2

u/joequin Mar 10 '15 edited Mar 10 '15

I'm not familiar with rpython. Does it have the GIL preventing concurrent threads?

4

u/[deleted] Mar 10 '15

rpython is the language he wrote the interpreter in. It's basically a stripped down python for writing VMs in, originally made for PyPy. It doesn't necessarily suffer from Python's limitations because it's only tangentially related.

0

u/hhh6897 Mar 11 '15

I love the python,lisp,clojure, I willing to dev my pet project with Pixie as well. but the only reason hold me back is , how can I trust the reliability of RPython ?