Live data from Hacker News

Try Clojure – An interactive tutorial in the browser

tryclojure.org

31–40 of 96 posts

Re: Try Clojure – An interactive tutorial in the browser

#31
post #13
post #11

For the site author, thanks for this tool! Clojure has changed the way I program and I've been using it for 6 years now. Anything to help more people get into Clojure is much appreciated, especially if it's REPL-oriented. For some feedback, you might consider using Let's Encrypt for setting up free TLS certs, or hosting on Github Pages to get it automatically. With just HTTP, my browser (and many others) will show a…

Thanks! https://tryclojure.org/ is working correctly. I'm figuring out why Netlify is not redirecting automatically.

For the record, http:// is redirecting to https:// for me currently.

  $ date -u
  Tue 22 Feb 2022 09:12:56 UTC

Re: Try Clojure – An interactive tutorial in the browser

#32

I would love to work with clojure. I thought there were opportunities for to work on a clojure project in my previous company. But I was told that no one likes to work on these products hence why they moving away from clojure and rewriting everything in java or scala. I wish I could tell you exactly why they hated it, I never got an answer. Speaking to some of the individuals, they thought it came down to tooling, no…

The tooling is actually great, but kind of hard to discover if you're a beginner. The clojure.org website isn't very beginner-friendly, unfortunately. Types... I find most people missing static type checking are really reliant on a certain way of programming which isn't applicable to Clojure, e.g. write code, look for red squiggly lines, fix type signatures, compile, wait, fix the bugs the compiler tells you about. C…

That mirrors some of my experience of Java vs a repl heavy Python habit, BUT — this misses the experience of diving into and reading unfamiliar or new codebases. For me, this is where the chunky type system and regularity of even the worst maintained Java codebases really shines.

Re: Try Clojure – An interactive tutorial in the browser

#34

I started playing around with Clojure back in 2014 by implementing a rudimentary polyglot persistent news feed microservice. That microservice used Ring which sits on top of Jetty. I blogged about that implementation at https://glennengstrand.info/software/architecture/oss/clojur... which is my personal blog. Last year, I re-evaluated Clojure with a feature identical microservice. This time, I integrated with Donkey…

> It is hard for Clojure to compete with other tech stacks, primarily because each method call in Clojure goes through Java reflection which is pretty slow.

That's not true. Clojure functions calling each other do not use reflection. It is only when interoping with Java, and trying to call a Java member method of an object that reflection might be used if there are multiple concrete implementation of the method and the compiler can't find the right one at compile time. In which case, you can provide a type hint to tell it which one you want.

Re: Try Clojure – An interactive tutorial in the browser

#37
post #2

Do I need to have a somewhat decent knowledge of Java to plunge into Clojure right away?

There are some things that you eventually want to learn. One of them is the underlying data types. For example if you use Clojure on the JVM you are dealing with Java strings, if you use a JavaScript runtime with ClojureScript, then you get JavaScript strings.

The tutorial showcased here runs on ClojureScript for example.

So:

(reverse "abc")

Becomes:

("c" "b" "a")

In ClojureScript. But in Clojure it becomes:

(\c \b \a)

Since Java has a character type but JavaScript doesn't.

It's little things like this that. The benefit here is superb interop, but in turn you aren't as isolated from the host language as you would be in another language.

Re: Try Clojure – An interactive tutorial in the browser

#40

I started playing around with Clojure back in 2014 by implementing a rudimentary polyglot persistent news feed microservice. That microservice used Ring which sits on top of Jetty. I blogged about that implementation at https://glennengstrand.info/software/architecture/oss/clojur... which is my personal blog. Last year, I re-evaluated Clojure with a feature identical microservice. This time, I integrated with Donkey…

Like others said, Clojure does not reflect on every call.

A good resource if you really want to push the perf limit http://clojure-goes-fast.com

Post reply on HN