Live data from Hacker News

Why I like Clojure

sulami.github.io

141–150 of 155 posts

Re: Why I like Clojure

#141

I love the language. I’ve never found a language where I found the learning curve so shallow for being able to do so much. That said, I do find myself pining for the ability to easily compile a static executable (maybe with a small embedded runtime). Some time ago there was an attempt to port Clojure to Gambit Scheme, but that appears to have fizzled. More recently, I’ve seen Ferret, which compiles a subset of Clojur…

Why not Chicken Scheme? It compiles down to C.

Oh, definitely Chicken as well. The library story with Chicken is also pretty decent.

Re: Why I like Clojure

#142
post #55

Earlier quoted context omitted.

Chapter 2 of Clojure for the Brave and True will get you an Emacs environment set up with minimal effort!

I just went through this chapter. Some of the packages are out of date and the environment does not work correctly. I'm still trying to figure out how to get emacs to connect to the repl.

Hmmm, interesting. Set mine up no problem on a Mac about 9 months ago, but I suppose I might have gotten lucky.

Re: Why I like Clojure

#143
post #93

Earlier quoted context omitted.

The situation in Node and Go is better by the fact that these ecosystems have extensive documentation related to web security.

That's the many eyes thing but I don't see how it's unique to Clojure's culture which was my point. Node only got to that point through plenty of failure and last time I used Go it didn't seem much different than Clojure. The only reason I'm not using Clojure is the lack of types but that's another issue.

> The only reason I'm not using Clojure is the lack of types

Have you tried Clojure.spec? Have you tried generative testing where you generate data based on given Spec? Have you tried using Specs for form validation? Have you seen how Specs can be shared between Clojure and Clojurescript? Basically between two completely different platforms. Even vanilla nodejs cannot do that, even though the code is running on the same [JS] platform.

Re: Why I like Clojure

#144
post #45

Clojure Help: This is super apropos since I am JUST learning Clojure via the Clojure Koans. Any tips from clojurists on getting the repl (and readline) working fluently? I'm using Leiningen but it's not responding as I'd expect. I would think this would all set up more effortlessly. Tips on getting a new Clojure setup working would be appreciated.

I recommend emacs, try braveclojure.com - it's a pain to set up properly but well worth it.

As an avid Emacsen, I would usually recommend Clojure-mode and CIDER only if you are already familiar with Emacs. Learning both - Clojure and Emacs can be really frustrating and may potentially become a "deal-breaking" impediment. Almost every [popular] editor/IDE today supports Clojure (not many mainstream langs can proudly say so)

Re: Why I like Clojure

#145

> homoiconicity, meaning code can be represented as a data structure inside the same language > generating strings and passing them into eval like for example in Python Python has become a pinata for language enthusiasts? Python lets you pin a decorator on a function, get the AST (a data structure AFAIK), manipulate it in a sane fashion in Python, compile it, return the result. No string munching eval require I'm all…

> I'm all for Lisp but this just isn't convincing

Nothing will convince you until you give it a heartfelt try. The joy from using Clojure is a real thing. Unfortunately, there are not too many languages out there you can say the same thing about (including Python). Clojure is not absolutely frustration-free PL, but it maintains a good balance between "fun" and "profit".

Re: Why I like Clojure

#146

> While OO seems to be out, and FP the new hotness Funny that. While I prefer FP, and did since I've learned Python, my teachers are really hot about OO, even pushing us to use it in Python projects. (Looking at projects from previous years, they mostly seemed to use Java. Then also because of browser integration and obviously because of the OO UML Project links ?)

I don't know if you have noticed, but FP is not "new" anymore. Almost every programming language today either has some FP-flavored features or keeps adding them. And there are plenty of good reasons why many [smart] programmers think that OOP has failed.

Complex static type systems on the other hand - are kinda "new kid on the block". And if we are not careful that may become a "new OOP" - doctrine so complex and convoluted that could become an impediment in building software. I know, static type systems are cool and all but it's easy to get from something elegant and simple like Elm into say Haskell, Idris, Agda etc. and into the weeds of homotopy type theory.

Re: Why I like Clojure

#147
post #133

Earlier quoted context omitted.

That’s a fair description of the syntax, but Clojure is more than just syntax.

whats the key piece missing for you then? because my friend was definitely very keen on the "no syntax" bit

REPL. homoiconicity makes "real" REPL possible. Anyone who hasn't tried Lisp would say: "a lot of other [non-lispy] languages have REPLs". But only after trying Lisp REPL you can truly experience why is it so special. It is extremely liberating to be able to evaluate any part of your [running] program, anytime, [almost] without any preceding ceremony. Even famous Jupyter Notebooks fall short in comparison.

Re: Why I like Clojure

#148
post #58

Earlier quoted context omitted.

Please provide link as I need one. Ammonite is not it though.

I use jupyter notebook for Scala. I like having the same repl software for multiple languages. The kernel I use (almond) is based on Ammonite, but I believe there are others out there.

Please don't try to compare Clojure REPL (or any Lisp REPL) with jupyter notebooks or something similar. The latter are mere "interactive environments" compared to "real" Lisp REPL. You have to actually try Clojure REPL and see what makes it so special.

Re: Why I like Clojure

#149
post #54

It is a good language. Python is easier for quick code.

I disagree. It's the matter of familiarity. Clojure is extremely productive and the best PL I have tried (out of many) to quickly build prototypes.

Whenever I have a requirement to solve a problem in a different language (e.g. interview challenge, etc.) I would still do it first in Clojure and then convert it to whatever language is required. Yes, I have to do the same work twice, but even then - I am still faster doing it that way.

Re: Why I like Clojure

#150

> Clojure is explicitly designed as a hosted language, which I think was a very good move. I’m not personally a fan of a VM such as JVM. Sure you get some easy benefits, but now you have two things that need tuning. Two things that need periodic updating. Personally the total encapsulation of first-class static linking (such as Golang) is my preferred future. It must be first class and baked into the language in its…

You're missing the point. Because Clojure is hosted you basically can share code between JVM and Javascript. It is extremely nice when you actually can do that. Even in NodeJS, essentially running on different implementations of the same platform - that is hard. As it turns out - not so hard in Clojure.

Now, imagine also having access to thousand of libraries written for JVM and Nodejs and Browsers? There are attempts to port Clojure to other ecosystems, making it possible to use them there. What if someday you can write Clojure code that can be shared between say Rust runtime, NodeJS and a browser? Wouldn't be that cool?

Post reply on HN