News for hackers. Stuff that matters.
Re:Why I Switched from Python to Clojure (2016) by o10449366 on Sunday March 24, 2019 @03:07PM (#19478110)
I notice this was written in 2016, but I wonder if the author's opinion has changed since dataclasses have been implemented in Python.
Re:Why I Switched from Python to Clojure (2016) by benatkin on Sunday March 24, 2019 @03:49PM (#19478378)
Python's async support also seems to be getting better. There's a flask clone called Quart (http://pgjones.gitlab.io/quart/) and an async postgres client (https://github.com/MagicStack/asyncpg). It works very similar to JavaScript, with async and await keywords. I think it should provide speed and comfort especially if you're a regular JavaScript user.
Re:Why I Switched from Python to Clojure (2016) by Waterluvian on Sunday March 24, 2019 @04:38PM (#19478610)
I wrote a pretty substantial experiment using asyncio for 100k websocket client connections across a massive theoretical fleet of robots. It's not open source but the general result was that I used to hate async in Python and now I love it.

The syntax makes blending sync and async easy. And the cooperative multitasking paradigm is very easy to reason about. No locks!

Re:Why I Switched from Python to Clojure (2016) by simple_phrases on Sunday March 24, 2019 @06:41PM (#19479185)
If you did a write-up or went into more detail about your experience, I'd read it.

Big fan of Python and am heavily invested in its ecosystem, but I currently prefer async programming in modern JavaScript compared to Python.

Did you make use of third-party async libraries?

Re:Why I Switched from Python to Clojure (2016) by Waterluvian on Sunday March 24, 2019 @06:48PM (#19479217)
I'm going to ask my boss to open source it and then do a write up.
Re:Why I Switched from Python to Clojure (2016) by j88439h84 on Sunday March 24, 2019 @07:21PM (#19479331)
Python is even better since it has http://trio.rtfd.org which provides structured concurrency.
Re:Why I Switched from Python to Clojure (2016) by Scarbutt on Sunday March 24, 2019 @04:57PM (#19478735)
The author switched to kotlin from clojure, kotlin's interop with java is leagues ahead of clojure.
Re:Why I Switched from Python to Clojure (2016) by Per_Bothner on Sunday March 24, 2019 @05:49PM (#19478987)
May I suggest Kawa (https://www.gnu.org/software/kawa) if you're open to Lisp-style syntax (Kawa is a Scheme dialect)? Kawa has great Java interoperability, Java-like performance (with the help of optional type declarations), a nice REPL, full documentation, maturity (continuous development since 1996), and many neat features. It doesn't require special tools or workflow. (I do suggest using the git version, as it is overdue for a release.)
Re:Why I Switched from Python to Clojure (2016) by bradcypert on Monday March 25, 2019 @09:46AM (#19482340)
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) by iLemming on Monday March 25, 2019 @02:09AM (#19480616)
Kotlin simply is an attempt to fix Scala problems, which in itself is an attempt to fix Java problems. Clojure by design - simply doesn't have those problems.
Re:Why I Switched from Python to Clojure (2016) by nattmat on Monday March 25, 2019 @02:27AM (#19480656)
What Scala problems does Kotlin attempt to fix?
Re:Why I Switched from Python to Clojure (2016) by iLemming on Monday March 25, 2019 @02:42AM (#19480706)
Let's not go into the rabbit hole of "Scala has no problems"
Re:Why I Switched from Python to Clojure (2016) by nattmat on Monday March 25, 2019 @02:54AM (#19480732)
Not my intention. But yours was a bold claim, and I wanted to hear your thoughts.

I do not agree with you. Scala is a mostly functional language, and Kotlin is mostly imperative. How is that fixing Scala? They are two different languages, and Kotlin being newer, is inspired by, among others, Scala.

Re:Why I Switched from Python to Clojure (2016) by Elrac on Monday March 25, 2019 @04:16AM (#19480972)
I don't think that was nattmatt's intention. It sounded like a genuine interested question to me, and I for one would also love to hear someone expound on this topic.
Re:Why I Switched from Python to Clojure (2016) by zeroDivisible on Sunday March 24, 2019 @05:27PM (#19478878)
I do not have experience with Kotlin and it's interop with Java. Do you maybe have examples or articles which you'd recommend on the subject?
Re:Why I Switched from Python to Clojure (2016) by Scarbutt on Monday March 25, 2019 @12:01AM (#19480230)
Re:Why I Switched from Python to Clojure (2016) by fulafel on Monday March 25, 2019 @02:19AM (#19480640)
It sounds like he is doing Android, where indeed Kotlin is strong, and an officially supported language too.
Re:Why I Switched from Python to Clojure (2016) by bradcypert on Monday March 25, 2019 @09:47AM (#19482345)
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) by bradcypert on Monday March 25, 2019 @09:43AM (#19482319)
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 :)