Live data from Hacker News

Why I Switched from Python to Clojure (2016)

bradcypert.com

171–180 of 200 posts

Re: Why I Switched from Python to Clojure (2016)

#171

Earlier quoted context omitted.

Clojure generally has pretty good library support: the JVM has several high-quality web application servers: Jetty, Netty, Tomcat, Glassfish, etc. And, being a Lisp, Clojure can wrap these with a nice interface. The same is true in other areas: you have very nice access to the entire JVM ecosystem and really-well designed interop with the host language's concepts so, to a large degree, you never run into a situation…

Curious if your coworkers have looked Eta, a Haskell on the JVM? Also curious how your Haskellers and Clojurers are peaceably coexisting? (I ask this lightly but still curious :)

I was unaware of this and have been playing with Elm and Haskell in my spare time! Neat to know that there's a Haskell like language on the JVM! Will have to check it out :)

Re: Why I Switched from Python to Clojure (2016)

#172
post #106

Earlier quoted context omitted.

The only one I miss in Python that is not in any other package is matplotlib. Is there any clojure alternatives?

I've only very briefly used it and am by no means an expert, but perhaps Incanter?[1] Specifically the Plotting section on the Data Sorcery page[2] has more information. [1] http://incanter.org/ [2] https://data-sorcery.org/contents/

Incanter is a fantastic toolkit. A great suggestion!

Re: Why I Switched from Python to Clojure (2016)

#173
post #43

I can, and do, appreciate opinions on languages themselves. But my decision to continue using Python over Clojure is much less about the language's syntax and more about the available libraries. How do Clojure web frameworks compare to Django/Flask? What would I use instead of Pandas for data analysis? Are there keras-like deep learning tools? Switching languages based on a comparison of idiosyncrasies between the tw…

I'd argue that the JVM is a good move from python. There are a number of rich frame works on the JVM with great tooling. Also if you use PyCharm switching IDEs is easy with Intellij. I switched from python -> F# -> Kotlin. I do agree the language is part of the battle. The other is tooling, and libraries. F#/dotnet was painful as a linux dev. The JVM works on almost any platform with great tooling. For Libraries. I h…

was F# painful pre-dotnet core? Have you tried it since? I ran into issues with F# and Mono a few years back and haven't tried since core came out.

Re: Why I Switched from Python to Clojure (2016)

#174
post #121

Earlier quoted context omitted.

Clojure works on the JVM so you have native access to all of the Java ecosystem. With that in mind I'd say the libraries are actually better for Clojure with the exception of data analysis. I don't think there's a language out there that has as many data libraries as Python (like Pandas).

I really don't understand this point about just using Java libraries in Clojure. Why not just use Java? Wouldn't the experience of writing Clojure that fits the Java library's model be horrible?

The main points being:

1. If you need it, and there's not a Clojure alternative, you don't have to write your own. 2. If you have any proprietary .jars or anything like that, you can leverage those services, models, etc when building an existing Clojure app. This is mainly a transition-type thing, in my experience. "Well, we could try Clojure but then we cant reuse any of our existing models." Not entirely true. However, you probably will want to change those from mutable classes pretty quickly :)

Re: Why I Switched from Python to Clojure (2016)

#175
post #89

Sometimes I read these pieces and I wonder how much of the joy of the new language is just having become a better programmer in the meantime.

Blog Post Author Here:

You're definitely right. I had a run in with PolyML in College and I was absolutely terrified of any functional language (nearly failed the class, in fact). Before deciding to switch from Python to Clojure, I had used Clojure briefly a few years before and hated it (was writing mostly Groovy at the time).

After some time to grow, I had started caring about different principles in the languages that I used. I had been ruined by mutable state too many times; I got tired of not knowing how to get the number of wheels on your instance of the car class, I got tired of so many things. Clojure was/is a wonderful reprieve from all of these things, but truth be told, I do still struggle with it from time to time. Or at least, it feels like I do.

Re: Why I Switched from Python to Clojure (2016)

#176
post #4

I have considered multiple times switching from Python to other alternatives. However, I instantly discard any language with a Lisp-like syntax. I just cannot work with it. Being a Haskell hobbyist, I would like Python to be statically type and have better support for pure functional programming, but Python has the libraries that I need.

Blog Post Author Here:

It's really not that bad! Here are some insights into the parens!

1. I've converted Java code over to Clojure and found that it has less parens per file.

2. They're still there, they're just in a different place. `System.out.println("")` vs `(println "")`

3. There are some great tools to help with the Parens. If you're using Intellij, Pareninfer and Rainbow parens are two extremely helpful tools.

Re: Why I Switched from Python to Clojure (2016)

#177

I notice this was written in 2016, but I wonder if the author's opinion has changed since dataclasses have been implemented in Python.

Blog Post Author Here:

My opinion has not change as I've never looked back ;)

I've found a fun little home in the JVM, but I'll definitely check out data classes in Python! That seems pretty cool :)

Re: Why I Switched from Python to Clojure (2016)

#178

I notice this was written in 2016, but I wonder if the author's opinion has changed since dataclasses have been implemented in Python.

The author switched to kotlin from clojure, kotlin's interop with java is leagues ahead of clojure.

Blog Post Author Here:

I write Clojure, Kotlin, and Scala all on a pretty regular basis. Truthfully, I do write less Clojure now than at the time I wrote this post, but that's predominantly because my current interest (and salary) are centered around Kotlin + Android.

I still write Clojure quite a far amount, but I don't blog about it as much as I'm not "exploring" the language as much. Sometimes, I'll find or create something cool and share it, but most likely that'll be Kotlin/Android related right now.

Re: Why I Switched from Python to Clojure (2016)

#179

Earlier quoted context omitted.

The author switched to kotlin from clojure, kotlin's interop with java is leagues ahead of clojure.

It sounds like he is doing Android, where indeed Kotlin is strong, and an officially supported language too.

Blog Post Author Here:

That's correct! I did not want to give up Clojure or Scala for Android however! I tried writing an app in both and it was miserable, so I went back to Java. And then I thought -- well, hang on, I'm definitely not going to write this in Java if there's a less-verbose alternative. So I forced myself to learn Kotlin and actually like it quite a bit. In a few ways, it reminds me of when I first worked with Groovy.

Re: Why I Switched from Python to Clojure (2016)

#180
post #114
post #103

"Why I Switched from Python to [Shiny Newer Language]" seems to be the thing on HN this week.

The really hilarious part about this one is that it’s from 2016, and the author seem to have since switched from Clojure to Kotlin. I think it’s still interesting to read about people switching. I mean, I’ll never understand why people prefer functional languages to OOP. I think it’s just so much easier to maintain OOP in the long run, and you can frankly build most of the advantages of functional languages within OO…

I write Clojure, Kotlin, and Scala all on a pretty regular basis. Truthfully, I do write less Clojure now than at the time I wrote this post, but that's predominantly because my current interest (and salary) are centered around Kotlin + Android.

I still write Clojure quite a far amount, but I don't blog about it as much as I'm not "exploring" the language as much. Sometimes, I'll find or create something cool and share it, but most likely that'll be Kotlin/Android related right now.

Post reply on HN