I'm glad this is back. A version of this existed in the ancient past and helped encourage me to try Clojure which ended up being by far the most impactful decision in my professional life. It went away for a while for reasons I'm unclear on. I use Clojure nearly daily at my job and at home. Sometimes it's standard Clojure, sometimes it's the excellent Babashka flavor which I use as a make-like task runner and Zsh-lik…
As a side note, I'm always amazed by people who can use a highly expressive language (Clojure, Rust, even TS) but switch to Go when they feel like it (especially pre-1.18). To me, switching to a less expressive language is painful and infuriating. I remember having to switch from Python to Java 5, and how everything started to take 3 to 5 times longer code to express. Maybe the key thing is to only write small things…
Try Clojure
271–280 of 404 posts
Re: Try Clojure
#272The problem I see with clojure, isn't it missing autocompletes? You work with JVM/typescript libraries, but your editor isn't smart enough to pull types from those into clojure. That slows you down tremendously.
No. When working with JVM/typescript libraries you have their autocomplete information. If you need method autocomplete scoped to a type you can use the `..` macro for more concise call syntax: (ns my-project.core (:import (java.util ArrayList Collections))) (defn example [] (let [list (ArrayList.)] ; ArrayList constructor can be autocompleted (.. list (add "Hello") ; The .add method on ArrayLists will be autocomplet…
Re: Try Clojure
#273the best reason to learn clojure is reagent[1], by far the best way to use react. shadow-cljs[2] makes using npm libraries easy. i’ve settled on go backends and reagent frontends as my default setup[3]. 1. https://reagent-project.github.io/ 2. https://github.com/thheller/shadow-cljs 3. https://github.com/nathants/aws-gocljs
Does your setup do code splitting, SSG? I can't really be shipping a blank html file in 2024, destroys SEO. Otherwise am interested in trying.
this setup is a single go binary that serves a single pre-gzipped html file from a lambda.
that html file contains inlined js, that is a reagent app.
there is also a favicon. total of 3 files in the lambda zip.
you desired setup is certainly possible though. you’d probably want clojure on the backend though, so you could more easily do SSG.
Re: Try Clojure
#274Earlier quoted context omitted.
I must use PyTorch for ML, but badly wish I could use TypeScript instead. Its type system demolishes anything else I've used. Writing anything from SPI communications, to server logic, to rich GUIs is a breeze. Then I work in Python and have to fight `Any`s, ambiguous arguments, more verbose code, and bizarrely slow run times. It makes me sad.
While I agree with you, Python is getting better in this regard, as is mypy. Making historical interfaces well-typed is another kettle of fish. For instance, Python's range() is actually two overrides with incompatible signatures. I bet PyTorch has more of such examples.
Re: Try Clojure
#275> 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
#276Earlier quoted context omitted.
As a side note, I'm always amazed by people who can use a highly expressive language (Clojure, Rust, even TS) but switch to Go when they feel like it (especially pre-1.18). To me, switching to a less expressive language is painful and infuriating. I remember having to switch from Python to Java 5, and how everything started to take 3 to 5 times longer code to express. Maybe the key thing is to only write small things…
Development in Go will always be more painful for some people than in Clojure or TS, because the language is intentionally hostile to abstraction, so you're thinking in higher level concepts, but you implement them in more steps than necessary. The program can never reflect the shape of the problem, because it will be riddled with "glue code" that implements the obvious dull steps that you abstract away when reasonin…
Re: Try Clojure
#277Earlier quoted context omitted.
Your understanding is correct. JVM startup accounts for a small portion of Clojure's startup time.[1] Most of the overhead is in compiling and loading clojure.core. Efforts have been made to remedy this issue[2] (e.g. direct linking, ahead-of-time compilation, ...), but this doesn't remove the fact that clojure.core is huge and virtually any Clojure program will be importing more than just clojure.core, so there is s…
Well, it's still partially the JVM at play. For example, if your application has big classes, and many classes, the JVM will be slow to start. This is what is happening here. Clojure is like a large-ish Java project, it has big classes, and many of them, with static initializers, that need loading at the start, and the JVM does all that slowly. In some sense it's Clojure's fault for having an implementation that caus…
So it is indeeed a Clojure issue, not a JVM one.
Re: Try Clojure
#278The problem I see with clojure, isn't it missing autocompletes? You work with JVM/typescript libraries, but your editor isn't smart enough to pull types from those into clojure. That slows you down tremendously.
Re: Try Clojure
#279Earlier quoted context omitted.
No. When working with JVM/typescript libraries you have their autocomplete information. If you need method autocomplete scoped to a type you can use the `..` macro for more concise call syntax: (ns my-project.core (:import (java.util ArrayList Collections))) (defn example [] (let [list (ArrayList.)] ; ArrayList constructor can be autocompleted (.. list (add "Hello") ; The .add method on ArrayLists will be autocomplet…
That's cool, I had no idea. In clojure itself I suppose you eval code and then get autocompeletes from the repl output? -- I mean for stuff with no types
Re: Try Clojure
#280Earlier quoted context omitted.
Oh, interesting. Yeah, that's even better for an onboarding tutorial. I didn't know it existed (used Clojure for 6 years a long time ago). Cool: https://shaunlebron.github.io/parinfer/ I always thought that the surrounding tooling (having to learn how to edit parens productively, using nrepl/cider, maybe even emacs... with evil-mode of course) to be both the worst and then eventually the best parts of Clojure.
I'm one of those mainstream devs (who also did Clojure for 6 years, coincidentally) who never got into emacs, and always just used the Cursive IDE plugin for IntelliJ and its Parinfer editing mode. I know I probably didn't unlock true god mode of productivity, but it worked fine for me.