Live data from Hacker News

Try Clojure

tryclojure.org

151–160 of 404 posts

Re: Try Clojure

#151
> unlike full-JVM Clojure it has a very fast startup time

I can't believe that after all these years Java still didn't fix their startup time.

Re: Try Clojure

#152
I have to admit, several years ago, a colleague of mine advised me if not to try Clojure but at least to read the "History of Clojure": https://dl.acm.org/doi/pdf/10.1145/3386321, which I never did. But one day I decided to watch Rich Hickey - Greatest Hits https://changelog.com/posts/rich-hickeys-greatest-hits... I then read the "History of Clojure", and then jumped into learning it. This is probably one of the most fun languages to build with and one of the most beautiful ones. If not syntax-wise, rather in a way it allows you to express your thoughts via good design and composition that so nicely tickles your brain. If you are still searching for that one shiny tool, and none of them clicks, maybe try Clojure. It's one of the most concise and yet powerful languages I've seen.

Re: Try Clojure

#153

Earlier quoted context omitted.

Programming without immutability is so painful to me, no matter how many functional features a language adds.

It's painful for the compiler too, it has to turn the parents imperative code into SSA (essentially A-normal form) so it can optimise it!

You guys can make all the baloney claims about this you want.

The day that Haskell stops being 10x slower than languages providing mutable data is the day we can start to seriously entertain your claims.

Re: Try Clojure

#154

Maybe online "learn lisp" repls should implement paredit keybindings in their editor and have a short section on how to manipulate s-expressions. Because you're gonna have to learn it to use the language, but it also helps people understand from the start that "oh, so using the language isn't actually complete shit". Instead, this fact always seems glossed over, and because of it anyone who spends 60 seconds writing…

I use Helix [0] myself, which has tree-sitter based commands for moving + selecting up/down/forward/back by expressions. These are built-in and require no configuration.

It's surprisingly excellent! Sure, the "language" of paredit features more powerful text manipulation that just simple movement... but combined with the new "jumping" in the latest Helix release [1], it makes for a very impressive keyboard-based navigation system.

[0]: https://helix-editor.com [1]: https://helix-editor.com/news/release-24-03-highlights/

Re: Try Clojure

#155
post #116

Clojure looks productive. What frameworks libraries do people use to build web apps? Like, replacement for Django view layer and ORM (not looking to debate orms thanks)?

This is my goto:

webserver: ring-jetty9-adapter[0]

routing: reitit[1]

html templates: hiccup[2]

never used an ORM, but happily used HugSQL for making composable queries[3].

[0]https://github.com/sunng87/ring-jetty9-adapter [1]https://github.com/metosin/reitit [2]https://github.com/weavejester/hiccup [3]https://www.hugsql.org/

Re: Try Clojure

#156

> unlike full-JVM Clojure it has a very fast startup time I can't believe that after all these years Java still didn't fix their startup time.

My understanding is that this isn’t really a JVM thing, but I might be wrong.

Re: Try Clojure

#157

Earlier quoted context omitted.

Programming without immutability is so painful to me, no matter how many functional features a language adds.

In my experience jumping from a Clojure shop to a large Java shop a few years ago, the benefits of persistent data structures are overstated. Mutable collections are just as good for 99% of use cases. And they're a lot faster (in single threaded code) and occasionally mutation makes things easier. The selling point of Clojure is that persistent data structures prevent several classes of bugs (unintended mutation, loc…

This is like saying "the benefits of functional programming are overstated". If you are happy with mutable collections, you've happy with mutable variables, pervasive side effects and essentially the status quo. Many of us are not happy with the level of software quality out there and the status quo, Rich Hickey included.

Re: Try Clojure

#158

> unlike full-JVM Clojure it has a very fast startup time I can't believe that after all these years Java still didn't fix their startup time.

When you get into REPL-driven development, the JVM startup time (which is often under a second for me anyways) is a total non-issue. You don't continuously restart your program to see changes or run tests. You can refresh all your state instantly without exiting.

But before Babashka, that was indeed a barrier to using Clojure in shell scripts. Now we have it all!

Re: Try Clojure

#159
post #83

Earlier quoted context omitted.

And when you're ready to take the fun to the web, look no further than Biff: https://biffweb.com

I recently went through most of the Biff tutorial but found it seemed to be missing some parts later on that had me scratching my head. It was otherwise a very enjoyable experience and Biff seems like a great way to get a "batteries included" starting point for web (similar to something like Rails or Django, though maybe not as comprehensive as either of those).

Mind sharing the parts of the tutorial you had trouble with, if you remember?

Re: Try Clojure

#160
post #91

Is there a version of Clojure that compiles to LLVM or something? Sort of like what Scala-native was supposed to be (but never materialized). I like functional programming but I can't abide the Java ecosystem in 2024, it's just too archaic for my taste.

the top comment as of writing this reply points to https://babashka.org/ , but it's GraalVM instead of LLVM (which shouldn't really bother you)

Babashka scripts are interpreted, the babashka binary itself is compiled with GraalVM.

But: you can also build regular Clojure programs using GraalVM and create a fast-starting binary.

Post reply on HN