Live data from Hacker News

Pixie: A sweet Clojure-ish language

blog.goodstuff.im

41–50 of 109 posts

Re: Pixie: A sweet Clojure-ish language

#41

I want to see a clojure clone embedded as a Go scripting language. The immutability means that the interpreter would be mostly threadsafe, and thus would support goroutines well.

Well the closest I've found is https://github.com/zhemao/glisp which is similar syntactically, but doesn't have immutability.

Re: Pixie: A sweet Clojure-ish language

#42
post #29

This seems like bit of a short sighted move not that I disagree with it. Project Jigsaw which will be a big part of Java 9 aims to make the JVM more modular which will reduce the memory footprint substantially. Personally I would like to see a version of Clojure that targets this JVM specifically and abandons backwards compatibility. Leaving the JVM means you abandon the decade of libraries many of which you simply c…

It can call into C libraries so there is a whole other ecosystem available to it.

Which is nice. And it could definitely open up new avenues for them.

But for example one of the areas that Clojure has been doing well in is the enterprise big data space which is dominated by the JVM based Hadoop ecosystem. Likewise many companies feel comfortable bringing in Clojure because they can leverage their existing Java libraries.

My point was that getting rid of the JVM loses a lot of what made Clojure actually successful.

Re: Pixie: A sweet Clojure-ish language

#43
post #39

Earlier quoted context omitted.

Sounds like you needed Schema, which can ensure the shape and contents of a map as :pre and :post assertions in every function you annotate, then be turned off for production use. https://github.com/Prismatic/schema That's why I come back to Clojure every time, if I need anything, it's available as a library. Need better typesafety? Just add in what you need with a macro or two. (Schema is not much more than that). T…

I agree with most of what you said, but > Lastly, types only give you a single dimension of safety. Dependent types can express a huge number of things, and are often limited only by your ability to describe what exactly you want.

Absolutely right, I was just comparing with the dominant Java or Python.

Dependent typing is some cool stuff, I'd love to see more of it.

Re: Pixie: A sweet Clojure-ish language

#44
post #36

Earlier quoted context omitted.

Sounds like you needed Schema, which can ensure the shape and contents of a map as :pre and :post assertions in every function you annotate, then be turned off for production use. https://github.com/Prismatic/schema That's why I come back to Clojure every time, if I need anything, it's available as a library. Need better typesafety? Just add in what you need with a macro or two. (Schema is not much more than that). T…

Oh, god, thanks for reminding me about the whole agent/atom/ref hell - another reason I'd rather erase the whole Clojure experience from my brain altogether...

[deleted]

Re: Pixie: A sweet Clojure-ish language

#45
post #36

Earlier quoted context omitted.

Sounds like you needed Schema, which can ensure the shape and contents of a map as :pre and :post assertions in every function you annotate, then be turned off for production use. https://github.com/Prismatic/schema That's why I come back to Clojure every time, if I need anything, it's available as a library. Need better typesafety? Just add in what you need with a macro or two. (Schema is not much more than that). T…

Oh, god, thanks for reminding me about the whole agent/atom/ref hell - another reason I'd rather erase the whole Clojure experience from my brain altogether...

Agree to disagree. I do not enjoy the impossible to prove defensive coding around threads and callbacks. The core.async library made threading in Clojure for me to now be simple and pleasant compared to difficult to test mutexes and deadlocks.

Re: Pixie: A sweet Clojure-ish language

#46
post #41

I want to see a clojure clone embedded as a Go scripting language. The immutability means that the interpreter would be mostly threadsafe, and thus would support goroutines well.

Well the closest I've found is https://github.com/zhemao/glisp which is similar syntactically, but doesn't have immutability.

otto + clojurescript would probably work, but would lack many features + thread safety.

Re: Pixie: A sweet Clojure-ish language

#47
post #40

> And the JVM has the slowest startup time of any runtime I've ever encountered. Blame Clojure not the JVM. https://nicholaskariniemi.github.io/2014/02/11/jvm-slow-star... Besides if 0.04s is still too slow, there are quite a few (commercial) AOT compilers to native code available. However, Pixie does look quite cool. What I am missing in Clojure is the ability to take advantage of type metadata to compile it AOT to…

It's unclear what machine and JVM configuration they're using. Using the JVM 1.8 (java version "1.8.0_20") on a 2010 MBP (2.4GHz i5) I get ~190ms (180~200) for their program.

By comparison, on the same machine using an equivalent program

- Lua 5.2.3 takes 20ms

- CPython 2.7.5 takes 40~45ms

- MRI 2.0.0p481 and CPython 3.4.3 clock in at 55~60ms

- Pypy 2.5.0 takes 85~95ms

Re: Pixie: A sweet Clojure-ish language

#48

Earlier quoted context omitted.

Lisp's super power (homoiconicity) comes at a trade-off of reduced discriminability. A good syntax highlighter and well-indented code (like you provided) reverses this effect considerably, but imho, it still takes a lot of getting used to for beginners. In any case, the bigger part of the being productive in a codebase is to figure out how it encodes the domain, what idioms and patterns are favoured etc. So sometimes…

I disagree with regard to Clojure. IME, the fact that it's a lisp doesn't seem as hard for noobs to grasp as immutability by default, or pickup up the functional programming mindset. We usually go for folks who use Emacs, so they may already have an indoctrination. When you compare Clojure to other lisps, I think you'd agree it's more discriminable, given the plethora of literals that dont use parenthesis: vectors [1…

I've used clojure for some weekend hacking and have found that the biggest challenge is feeling like my code is non-optimal. I can get stuff to work and could build real stuff in clojure, but I hesitate because I feel that it's not necessarily idiomatic.

I guess I need a clojure mentor for the first non-trivial project. There really isn't that much idiomatic web-related code out there to read, and with clojure there is also quite a lot of variation in how systems get designed (b/c of the power and expressiveness available).

This is not an excuse, just noting the factor that has turned out to slow me down. If i had more leisure time I'd just power through and build stuff until I arrived (through trial and error) at my own sense of best-practices / design tradeoffs. That has yet to happen but will someday.

Re: Pixie: A sweet Clojure-ish language

#49
post #4

Dynamic typing and parentheses are what keep me away from Clojure or Lisp like languages. How can I get over them?

There aren't many languages that have radically fewer parentheses than Clojure / LISP. Clojure: (defn blub-extra [a b] (blub (inc a) (inc b))) 8 parens + 2 brackets Scala: def blubExtra(a: Int, b: Int): Int { blub(inc(a), inc(b)) } 8 parens + 2 braces Java: Integer blubExtra(Integer a, Integer b) { return blub(inc(a), inc(b)); } 8 parens + 2 braces Ruby: def blubExtra(a, b) blub(inc(a), inc(b)) end 8 parens Python: d…

as someone already pointed out on twitter:

F#:

let blubExtra a b = blub (inc a) (inc b)

4 parens.

Re: Pixie: A sweet Clojure-ish language

#50
post #40

> And the JVM has the slowest startup time of any runtime I've ever encountered. Blame Clojure not the JVM. https://nicholaskariniemi.github.io/2014/02/11/jvm-slow-star... Besides if 0.04s is still too slow, there are quite a few (commercial) AOT compilers to native code available. However, Pixie does look quite cool. What I am missing in Clojure is the ability to take advantage of type metadata to compile it AOT to…

.04 is user time. The elapsed time was .12 - this is how long you have to wait. Still it's a fair point: 120ms is noticeable but not painful.
Post reply on HN