Some superstitious people would say, don't tempt fate by saying that out loud!
It is by far the most pleasant language I've ever used, I feel at home writing it, and it improves the quality of my work.
Very familiar. Be sure to diversify. (Ex Smalltalker here.)
And yeah, like I said elsewhere I know my way around Python quite well and it's impossible to write a lot of Clojure and not know Java too. If both of those end up dying along with Clojure down the line then I'll be in a bad spot. :)
Very true. Coming from a Ex Perl programmer.
Though Perl is still around and you can solve problems using it for everyday work. But you will hard pressed to find a job that requires you writing or maintaining Perl code.
Clojure is the language that I have always wanted to learn, but the benefits never seemed very apparent. I'm hoping your response will make them clear.
You can watch him live-code the game 2048 in the screencast where he introduces DevCards[0]. Notice that the video came out 4 years ago!
One thing that really drew me to Clojure is that it seems to be a nexus of really good ideas that have trickled out into the larger community. If Clojure was where all the smart kids ate their lunch, maybe if I ate lunch with them too (so to speak), some of their smarts might rub off on me :)
This is a provincial take. That is, “do everything I need to” is strongly limited by what a person currently knows. If you don’t have at least moderate amounts of experience with alternative ways of thinking, it’s impossible to know what you are missing. There are many things which are needlessly complex, slow, brittle, unproductive, ... in any particular programming environment, and javascript is one of the more limiting choices IMO.
Ideally, students would be exposed to a broad range of approaches and tools in school to build a strong foundation, but in practice this often doesn’t happen, and the folks I know who reliably build the best systems are the ones who spend a decent fraction of their time learning new tools and ideas throughout their careers, many entirely self taught.
So there are lots of places where it doesn't make any sense at all or it's just a very, very poor choice for a particular task.
There is a big world of computing outside of apps and websites.
Clojure is a locus of things I really, really like and I have no reason to change despite the recent FUD around it. Namely: Lispiness, dynamic typing, functional programing, immutability, lean pragmatic design, and it runs on the JVM. I haven't seen anything that compares to it in these regards that also has the community support that Clojure has (great projects like Leiningen, Lacinia, and so on).
I've tried Haskell but felt I was fighting the compiler due to the static typing (I hate static typing). It also felt like it was designed for eggheads and not people like me just doing a job. Scala feels like it doesn't know what it wants to be when it grows up. Elixir and Erlang are neat but I haven't had a chance to really try them out, but Elixir's choice to emulate Ruby-like syntax is unfortunate.
That said, I do have a high degree of proficiency with Python, which shares dynamic typing and kinda-functional programming with Clojure. Python was my language of choice for years before I finally gave Clojure a try, and I haven't really looked back. The poor handling of the Python 3 switch really soured me to Python.
I also did a good chunk of Go, but the static typing and syntax weirdness just killed it for me. Amusingly, Go seems to have a similar "ivory tower" approach to language design to Clojure - which indicates that type of management isn't really a problem for me.
Of the languages that I've enjoyed, I've spent the most time in Go. I've kind of just hitched my wagon to it, regardless of whether I like it or not.
Of the languages you mention, Elixir seems to me like the closest experience to Clojure. Of this list:
"Lispiness, dynamic typing, functional programing, immutability, lean pragmatic design, and it runs on the JVM."
Only missing "Lispiness" and "runs on the JVM".
As for "Ruby-like" syntax, this sounds like people not trying Lisp because "too many parentheses".
It'd be hard to give up my precious parentheses though.
Yeah, that's the "Lispiness".
Elixir does have macros, but I still don't think any macro system is as powerful or user friendly without S-expressions.
It's kind of the last step of a language becoming just another Lisp.
I personally prefer Racket because of the ease with which you can use it to hack on itself. Macros are no stranger to LISPs, but Racket goes beyond by having the entire system around it built to accommodate language design and modification.
Want to use dynamic typing? Just use #lang racket. Want to use static type checking? Use #lang typed/racket. Reactive programming is there with #lang frtime. And that's before we even consider things like Scribble.
As an aside, I totally agree with you on Elixir. Erlang is wonderful for what it's built for. Elixir's choice to use Ruby syntax, however, ruins Elixir for me -- and it's not because I hate Ruby. I actually like Ruby a fair deal. Instead, it's because using Ruby syntax makes it more difficult (for me) to truly and fully think in the paradigm. Erlang/Elixir are nothing like Ruby. Making the syntax Ruby-like just obfuscates what's actually going on in the system. (I find similar issues whenever I try to program using imperative chunks in, say, F# or Scala.) Just my two cents.
That said, the JVM is a huge part of why I like Clojure. Because of the mountains of corporate code written in Java there is an insane amount of pretty high quality (if extremely object oriented) code available for it. I can find a library for basically any third party tool I'd want to use and if someone hasn't written a Clojure wrapper for it yet I can whip one up pretty quickly most of the time.
EDIT: Oh, but just getting started:
- How to Design Programs 2nd edition (new to programming or structured reasoning about programs)
- Racket Guide (new to Racket)
- Racket Docs (for reference)
The docs are pretty great, but IMO there’s an opportunity for people to blog about production use cases.
Also, I dream of something like R’s tidyverse being written for Racket... maybe by me, but ideally by someone smarter and better.
I'll check out serverracket!
But Racket... oh, Racket. Every time I get to write Racket, I feel like it’s the past, present, and future.
I do like some of the immutable collection abstractions in Clojure, and I like that there’s always a library in Java that’ll allow me to mostly still write Clojure. But Racket is definitely my language sweet spot.
The issue with dynamically typed FP is that FP is essentially about functions as mathematical objects, and there's really nothing mathematical about dynamic typing. Primarily, static types act as a proof, and because we're talking functions in the mathematical sense, you can actually reason about your program in the normal way.
Haskell is for eggheads though. What I really like is Rust, which feels like you're using Haskell and C at the same time. It's both powerfully low level and powerfully high level, and extremely pragmatic.
All that said, it sounds like you're super passionate about clojure, and I hope no one rips it out of your hands. I know what it's like to play the language wars games, and I wish you and all our fellow brethren the best of luck.
[1] https://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hi...
Repl driven development (100x productivity boost, especially with immutability, fp and expression oriented language)
Focus on data and data transformations (without classes, types and other clutter including syntax)
Concurrency (from simple state management with atoms to CSP and STM)
Libraries (this is where JVM really shines)
Unfortunately I couldn’t find anything even close to Clojure.
Regarding the benefits, for me it's the practical benefits of interactive development and the simplicity of everything in the Clojure ecosystem, which allow me to focus.
Of course, I would encourage everyone to be open to alternatives to Clojure!
> Wouldn't the same be said by most programmers with a high degree of proficiency with a language?
Perhaps for some, but not for me. Clojure is by far my favorite language, despite not being one that I'm most proficient in -- maybe not even my top 5 right now.
> What sets Clojure apart from Haskell or Scala or Elixir or Erlang?
For one thing, I've never written a (non-trivial) program in any of those other languages. :-)
Based on just what I've heard: Elixir and Erlang sound like good languages, and they're next on my list to learn, and I might well feel the same about them. For Scala, the one thing I've heard consistently is that it's incredibly complex, which is the opposite of one of the main reasons I like Clojure, so it's unlikely I would feel the same about it.
> Do you have a high degree of proficiency with something else?
Yes, I've earned money for writing assembly, C, C++, Java, C#, Python, Ruby, Tcl, Common Lisp, Objective-C, Swift, JavaScript, and probably a couple others I'm forgetting at the moment. Even after a couple years in those other languages, when I felt I was getting pretty good, I never felt like any of them were a great model of computation.
> Clojure is the language that I have always wanted to learn, but the benefits never seemed very apparent. I'm hoping your response will make them clear.
Writing a program in a language like C# or Swift or Python, to me, means taking 100 random pieces of kit (which look like the inside of Anders'/Chris's/Guido's head) and being creative enough to find a way to assemble them into something that works like I want today. None of them ever matches the problem space very well, so I have to pick how to compromise the design, and guess what axis of flexibility I'll want in the future. Next week when my requirements change, I learn that I often picked wrong, so now I have to redo part of it. The syntax is complex. Managing state is complex. Decomposing problems into reusable pieces is hard. Developing a new version of a program usually means rewriting methods I've already written (for new features, additional genericity, etc), and I personally find that frustrating. I want to finish things, once. I like it when languages let me extend built-in types with methods I think they ought to have had in the first place, but I'm also annoyed that I have to write these at all.
When I first tried Clojure, almost everything felt natural right away. The syntax is pretty simple -- just complex enough, beyond classic Lisp, to make common data structures (list/array/dict/set) easy to type. Learning Clojure mostly consisted of learning their new names for functions -- either functions I already knew, or which I guessed would probably exist (and always did). Remarkably, I usually find that the easiest way to solve any given problem in Clojure happens to result in functions which are already generic and composable and reusable. Once written, I very rarely have to touch a Clojure function again, either for correctness or modularity. (The obvious exception is the front-end, which is a thin simple layer that is easy to change.)
I can pretty much guess how I think something ought to work in Clojure, and it does. The work is not figuring out how to map my problem to the syntax of the language (and then having to maintain that state and those invariants), but simply writing some simple functions (map data to data) to transform the format I have to the format I need.
And I am glad Clojure has a lot of such fanatic proponents.
I say "died" but I know that people still write in Scala and Groovy, but how many new projects are you seeing in those languages?
At one point I set out to find work doing Clojure, but not much turned up in my locale. I did one professional project at a former company and only got the green light for using Clojure because it was basically a throw-away in a couple years when a new business process was coming in anyways.
Good luck to you, but it's not a niche I would want to be in. You have to mold yourself to the market, not the other way around (usually).
F# and Clojure are notably ranked as the highest paid languages for the past 2-3 years in a row. Trust me - market is shifting towards FP and Clojure one of the best choices.