Live data from Hacker News

Clojure 1.9 is now available

blog.cognitect.com

41–50 of 121 posts

Re: Clojure 1.9 is now available

#41

Earlier quoted context omitted.

Associative data structures (maps / dicts) are super first-class in Clojure, in a way that they aren't in other Lisp-1's (at least from what I remember of dabbling in Racket). There's a literal syntax for them. Keywords are functions that you can call with a map as an argument. You can destructure them in `let` bindings. And so on. In my opinion, this turns out to be a pretty major win. Code is still data, it's just…

> Hash tables in vanilla Common Lisp are a nightmare I seriously disagree with such a statement. Also, i feel confused that a lisp being a Lisp-2 could be an "issue". Separate namespaces for functions, symbols, classes, labels and so on is great, because they dramatically simplify naming things, which is one very important task for writing clean, readable, maintenable code.

After using a Lisp for awhile I've come to feel that privileged symbols improves ability to mentally acquire some code.

It was an okay learning journey, but it left me hungering for an easier FP language, and it also solidified my intuition that simple is both easy and hard at the same time, and Lisp is simple.

Re: Clojure 1.9 is now available

#42
Is clojure.spec a replacement for static typing? I ask because I've taken a look at clojure in the past and generally like what I see, but after moving from JavaScript to TypeScript at work I don't think I can ever return to a dynamically typed language again. Types are just priceless when refactoring, integrating someone else's code with your own or just exploring new libraries or APIs.

Re: Clojure 1.9 is now available

#43
post #42

Is clojure.spec a replacement for static typing? I ask because I've taken a look at clojure in the past and generally like what I see, but after moving from JavaScript to TypeScript at work I don't think I can ever return to a dynamically typed language again. Types are just priceless when refactoring, integrating someone else's code with your own or just exploring new libraries or APIs.

It addresses similar problems as static typing, yes, but it's not a compile time check. Instead, it's an optional runtime check. The idea is to use it during testing and development, and have it be disabled during production.

Re: Clojure 1.9 is now available

#44
post #42

Is clojure.spec a replacement for static typing? I ask because I've taken a look at clojure in the past and generally like what I see, but after moving from JavaScript to TypeScript at work I don't think I can ever return to a dynamically typed language again. Types are just priceless when refactoring, integrating someone else's code with your own or just exploring new libraries or APIs.

As with many things in life, it's a tradeoff, not a replacement :) Specs don't run at compile-time (except for macros), but they are more flexible than static types. Apart from runtime instrumentation, they can be used to validate or destructure complicated data (read from the wire or disk, for example), and they can generate tests automatically.

Re: Clojure 1.9 is now available

#45
post #31

Earlier quoted context omitted.

I agree, but it does take a while to figure out that leiningen exist And then you learn that not everyone use leiningen ... and things become a bit more confusing than necessary for some people, especially beginners

Sorry but this whole conversation is a stretch. Anyone who looks into Clojure finds out about Leiningen. The official clojure.org even mentions it. No it's more than a stretch, it's rationalizing.

As I mentioned at length in my prior answer, this was not the primary driver.

Re: Clojure 1.9 is now available

#46
post #40

Earlier quoted context omitted.

The API is still subject to change (alpha) but those changes are not expected to be dramatic at this point.

Why are all the relevant changes for a point release alpha? Why do you reckon this isn’t 1.9-alpha?

There are also many changes in the language itself (see https://github.com/clojure/clojure/blob/master/changes.md), none of which are alpha.

The things that are really the new big drivers are pieces that are not inside the language (other than a few spec integration points). Those things are significant pieces of work that are imminently usable now, but not quite final yet. In the interest of getting this work into more hands, we made a new release of the language with those parts marked as alpha.

The modularized spec allows us to continue releasing new versions (and for you to use them) with Clojure 1.9.0. Eventually spec will leave alpha and we will consider that a finalized part of the language. Similarly, tools.deps is still evolving as we work on it but the tools should remain fairly stable.

Re: Clojure 1.9 is now available

#47
post #42

Is clojure.spec a replacement for static typing? I ask because I've taken a look at clojure in the past and generally like what I see, but after moving from JavaScript to TypeScript at work I don't think I can ever return to a dynamically typed language again. Types are just priceless when refactoring, integrating someone else's code with your own or just exploring new libraries or APIs.

In addition to the sibling comments: worth noting that spec offers you a-la-carte typing - typing when/where/how you please. This is very different from the experience of having to constantly satisfy a compiler.

Generally I decide to 'spec' a tiny percent of my code - just the most critical one, or APIs with complex method signatures, etc.

When doing so, if the spec'd function used N other functions, one could argue that those N functions are also being implicitly checked.

Re: Clojure 1.9 is now available

#48
post #2

Can anyone sell me on why I should use clojure over say, any of the other nice Lisp-1s, given that I don't care about java.

Do you develop in JavaScript either front or back?

Not when I can avoid it ;) My real work is HPC, but I'm looking at this from a hobby perspective.

Re: Clojure 1.9 is now available

#49

Why focus on command line tools? There's already Leiningen which does an amazing job, and Boot for the few use-cases Leiningen doesn't take care of. Creating another CLI seems very strange.

Well, for the first time since the langauge was created you can now do `brew install clojure`, and then `clj` on the commandline and get a repl. I would have loved something that painless when I was learning Clojure.

Not only this, but also things like `clj myscript.clj` are, I think, useful to beginners.

Re: Clojure 1.9 is now available

#50
post #42

Is clojure.spec a replacement for static typing? I ask because I've taken a look at clojure in the past and generally like what I see, but after moving from JavaScript to TypeScript at work I don't think I can ever return to a dynamically typed language again. Types are just priceless when refactoring, integrating someone else's code with your own or just exploring new libraries or APIs.

in addition to type validtion it offers a neat tool for advanced destructuring. Here's a question I asked on reddit regarding that with a good response and examples https://www.reddit.com/r/Clojure/comments/7eb4ct/are_the_res...
Post reply on HN