Live data from Hacker News

Pixie: A sweet Clojure-ish language

blog.goodstuff.im

1–10 of 109 posts

Re: Pixie: A sweet Clojure-ish language

#5
post #4

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

parentheses, at least in my exp, just fade away after a while.. there's core.typed which is static typing for clojure [0]

[0] https://github.com/clojure/core.typed

Re: Pixie: A sweet Clojure-ish language

#6
post #5
post #4

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

parentheses, at least in my exp, just fade away after a while.. there's core.typed which is static typing for clojure [0] [0] https://github.com/clojure/core.typed

Thank you for the link. I will look into the core.typed.

Re: Pixie: A sweet Clojure-ish language

#7
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 can't get on any other platform (in particular for the enterprise). Given that Clojure has been gaining a lot of ground in these large companies it seems like a missed opportunity.

Re: Pixie: A sweet Clojure-ish language

#8
post #4

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

If you truly have been shunning Lisps because of parentheses I can only tell you that it will start to make sense once you see that they're just lists and that the fact that everything (including your code) is some variation of a list means that you are now (sometimes in the background) able to modify everything as if it was a list.

S-expressions are uniform in that they all look the same way. This means you have one form for literally everything in the program and you will have no problem parsing that form. It makes reading, mentally parsing and editing easier because everything is neatly delimited by parentheses.

In terms of readability, do you have any particular difficulties parsing the following code?

    (define (sum/recursive lst [sum 0])
      (if (null? lst)
          sum
          (sum/recursive (rest lst)
                         (+ sum (first lst)))))
We are defining a function, sum/recursive, that will take a list and return the sum of all the numbers in that list.

We use a default value of 0 for a function parameter called sum to store the sum. When the input list is empty ('(null? lst)' returns true) we return that variable. There is no return keyword, we just specify that variable and it will be returned.

If the list isn't empty, we apply sum/recursive on the rest of the list and as a second parameter we add the first number in the list to the already accumulated sum ('(+ sum (first lst))'). Using matching parens in your editor will make it obvious when you have matched the right amount of parens.

It should be noted that Racket, this Lisp variant, uses '[]' as well to delimit certain parts, for readability.

Re: Pixie: A sweet Clojure-ish language

#9
post #5
post #4

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

parentheses, at least in my exp, just fade away after a while.. there's core.typed which is static typing for clojure [0] [0] https://github.com/clojure/core.typed

Also Prismatic's schema. It achieves some of the same goals for why you would want strong typing:

https://github.com/Prismatic/schema

Re: Pixie: A sweet Clojure-ish language

#10
post #4

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

Time.

With Clojure/Lisp languages you are basically starting from the beginning. Most of the approaches you would take to constructing your applications don't work. It just takes a lot of practice for you to recognise patterns and then both the typing and parentheses will seem natural.

Post reply on HN