I'm happy with TypeScript, Go, and Rust. Don't feel like learning anything else.
> If you want everything to be familiar, you'll never learn anything new. - Rich Hickey
191–200 of 404 posts
I'm happy with TypeScript, Go, and Rust. Don't feel like learning anything else.
> If you want everything to be familiar, you'll never learn anything new. - Rich Hickey
I love clojure, but it's really lost a lot of the momentum it had as many imperative languages have adopted parts of functional programming (and much for the better) over the last many years. On the other side I've felt a lot of the ecosystem work that was done has a more "timeless" quality. Coupled with java interop I haven't ever felt wanting when I do reach for it for some hobby projects I keep up with. One thing…
Should have maintained a python interoperable runtime. Less and less people use JVM languages for things like web apps, data eng, data science, ML, etc.
Earlier quoted context omitted.
This is a good starting point if you want to get a web app going quickly: https://biffweb.com It uses XTDB by default but you can switch to Postgres: https://biffweb.com/p/how-to-use-postgres-with-biff/ People don't really use ORMs in Clojure, they just write SQL directly and abstract the details from consumers using functions. That said, HoneySQL is a common alternative to writing SQL that makes it a lot less painfu…
Biff looks neat, thanks! I mainly just don't want to write raw sql/mappers to structures for simple queries. Looks like most sql libraries with clojure can just return maps so that's neat.
(ns rads.sql-example
(:require [next.jdbc :as jdbc]
[honey.sql :as sql]
[clojure.string :as str]))
;; DB Table: posts
;; +----+-------+
;; | id | title |
;; +----+-------+
;; | 1 | hello |
;; +----+-------+
(def ds (jdbc/get-datasource (System/getenv "DATABASE_URL")))
(defn row->post [row]
;; This is your optional mapping layer (a plain function that takes a map).
;; You can hide DB details here.
(update row :title str/capitalize))
(defn get-posts [ds]
;; Write a SQL query using Clojure data structures.
(let [query {:select [:*] :from [:posts]}]
;; Run the query.
(->> (jdbc/execute! ds (sql/format query))
;; Convert each raw DB map to a "post" map
(map row->post))))
(println (get-posts ds))
;; => [{:id 1, :title "Hello"}]Earlier quoted context omitted.
Biff looks neat, thanks! I mainly just don't want to write raw sql/mappers to structures for simple queries. Looks like most sql libraries with clojure can just return maps so that's neat.
Here's a quick example of how DB access generally looks in production: (ns rads.sql-example (:require [next.jdbc :as jdbc] [honey.sql :as sql] [clojure.string :as str])) ;; DB Table: posts ;; +----+-------+ ;; | id | title | ;; +----+-------+ ;; | 1 | hello | ;; +----+-------+ (def ds (jdbc/get-datasource (System/getenv "DATABASE_URL"))) (defn row->post [row] ;; This is your optional mapping layer (a plain function t…
Earlier quoted context omitted.
Here's a quick example of how DB access generally looks in production: (ns rads.sql-example (:require [next.jdbc :as jdbc] [honey.sql :as sql] [clojure.string :as str])) ;; DB Table: posts ;; +----+-------+ ;; | id | title | ;; +----+-------+ ;; | 1 | hello | ;; +----+-------+ (def ds (jdbc/get-datasource (System/getenv "DATABASE_URL"))) (defn row->post [row] ;; This is your optional mapping layer (a plain function t…
You would abstract away the jdbc/execute part though, right? otherwise that's terribly unproductive compared to django etc.
Edit: Not trying to dismiss your concerns, by the way. In Clojure you can often get away with doing less than you might think so I'm genuinely curious about the critique.
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.
Earlier quoted context omitted.
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.
There's nothing baloney about SSA form. I'm sorry to say it, but C is just not close to the metal any more. Even if you are able to hand optimise something so it works well on one architecture, it likely won't be optimal for another. As for Haskell, it does pretty well being 100 times faster than Python with 100 times less the number of people working on it.
The fact is that you Haskell people only talk about the optimizations that can sometimes open on immutable data in specific circumstances. What you generally ignore is the optimizations that immutable data permanently locks you out of with no recourse.
As with most things programming, immutability should be considered a tool, not a rule.
I know many people will have problems with this post, but I am posting as information for clorjure-ophiles. Not reasons, but personal reasons why I don't do Clojure and will not try it. 1. When I read about Clojure (repeatedly) I like it. I am especially interested in transducers. I even built a half baked transducer engine in JavaScript using generators. There is clearly something here of value here. Any system that…
Running on the JVM is one of the best things about Clojure. The JVM is an impressive piece of engineering where uncounted bajillions of man-hours were invested into making a good and performant VM with modern GC. I've been using Clojure heavily for the last 9 years or so and I can't see any reasons to dislike the JVM. Also, I barely ever touch any Java. You don't need to.
This means that you really don't need Java in order to use Clojure.
Coming from a C++ background, I used to dislike the JVM out of principle just like yourself, especially since it needs to run on my local machine and it uses so much memory and is slow to start up.
However, once your app is started, you're in the REPL and that's the only time you need to start your app.. You can keep developing for days without restarting your app once.
Once I finished developing my app and I deploy it to a server, I'm kind of happy it runs on the JVM - that thing is super tuned, very fast and runs on a myriad of hardware platforms.. I don't have to spend one minute thinking about those details.
So while the JVM is somewhat inconvenient on the dev machine, it helps a lot when you deploy it to production.
Things became a lot simpler when I stopped worrying about it and just used the language for its power and beauty.
> 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.
That said, there are alternative runtimes that have different tradeoffs. For example, Babashka is a runtime for Clojure that uses GraalVM instead of the JVM as the foundation. Babashka scripts have about a 10ms startup time on my M1 MacBook Air.
Earlier 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…
Then a week later, the squinty mole discovers the code is dead; not called at all. There is no slice and no variable.