Live data from Hacker News

Why I Switched from Python to Clojure (2016)

bradcypert.com

131–140 of 200 posts

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

#131

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've talked to them a little bit about Eta and it sounds like there are some concerns about the stability/maturity of the JVM FFI interface, among other things.

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

#132

Earlier quoted context omitted.

The fundamental problem with S-expressions is that they are intended for (1950s) machine readability and human ergonomics takes a back seat.

sure, because Sure, because this (taken from React's JSX example page): Scores ; is more readable than this: [dashboard-unit {:data-index 2} [:h1 "Scores"] [scoreboard {:class-name "results" :scores game-scores]] Please tell me more about Lisp readability.

I genuinely can't tell if you're being sarcastic.

The JSX looks immediately intelligible to me because I'm used to looking at HTML. The Clojure looks unfamiliar but it's not so strange that I can't imagine it feeling just as natural a way to represent the same data structure. It would just take a little while to get used to.

The major issue I suppose is that this example is supposed to render to XML, which is closer to JSX than Clojure. But by that standard Vue (or XSLT) is even closer.

I've done a little professional work in Clojure and wasn't a huge fan, but it didn't seem particularly bad (syntactically). It just seemed like something you had to get used to.

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

#133

My impression of Python is that it's a Fisher Price Little Tikes coupe with a few GE90 jet turbine hardpoints mounted on it. It's a very simple language. Literally when things get made to be complex Guido says do it the simple way, because when unbreakable things break it's just that much harder to fix. This makes it very easy to debug, very easy to fix/patch, very easy to onboard new/junior developers in, and very e…

Are you implying Clojure is not simple? Have you ever watched Rich Hickey's "Simple made easy" talk? If you haven't, I highly recommend it. Disclaimer: It's not about Clojure.

I haven’t watched it, but I have heard about it. In contrast to the simplicity of a programming language in the happy path, I’m talking more about simplicity in the case where things break. For example, Python doesn’t implement tail call optimization in part to eliminate stack trace collapses. On the other hand, many reasons my current tool stops working is due to the underlying configuration of the JVM. Configuration management is a leading problem in distributed systems, and a fairly significant one given how it took down both Google and Facebook in two days. Clojure is a lisp on the JVM; I doubt it matters how pretty you write your code if you don’t say allocate enough memory on the heap for the process, and if it implements tail call recursion when that happens you may get an incomplete stack trace.

This is more speculation, but I do hope it gives some insights into why you may choose one paradigm for a problem over another. Overall I’d say break your problem domain into subdomains and choose the best paradigm for each.

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

#134
post #119

Earlier quoted context omitted.

I agree. Within the data science community I often see the question of "R versus Python" and it always makes me think of the Old El Paso commercial: ¿por qué no los dos? I know choosing the right tools for the task can have serious long-term implications on the project, team, or organization level, but individually I get the impression that people worry too much about which language is best when, in reality, many of…

For us, the answer to "R vs Python" is "Spark" since eventually you get to dara sizes where just R and Python don't really work.

> where just R and Python don't really work.

From the Spark website: "Write applications quickly in Java, Scala, Python, R, and SQL".

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

#135
post #57

Earlier quoted context omitted.

> You will shoot yourself in the foot less often with Lisp parens than you might with Python whitespace. I'm not letting that stand ;-) In my experience Python's whitespace generally removes sources of scope/block errors compared to parenthesis and curly-based languages > unless you have a Python plugin that has block movement shortcuts Not sure what this means. The only support I need in an editor is the ability to…

> It's visually obvious when code is correctly indented Not always, in my experience. I’ve lost many hours to debugging only to realise some piece of code was misindented. It doesn’t happen often and usually when code is being moved around, but when it does, its been painful.

The worst I have seen is: There is a merge commit (fixing conflicts) and then, a "if" condition get accidentally de-indented (compared to what it should be), and now this bug is completely invisible and the code will run just fine... (until you figure out what's going on)

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

#136
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…

> F#/dotnet was painful as a linux dev.

Which part made made it painful the most?

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

#137
post #129

Earlier quoted context omitted.

sure, because Sure, because this (taken from React's JSX example page): Scores ; is more readable than this: [dashboard-unit {:data-index 2} [:h1 "Scores"] [scoreboard {:class-name "results" :scores game-scores]] Please tell me more about Lisp readability.

For someone familiar with HTML/XML, so any developer in the last 30 years, yes it is. Your point being? I like the ideas behind clojure, I really do. I even wrote a non-trivial personal project with it. However, coming back to that code after two months was basically like the plot of Memento. I ended up rewriting it in JavaScript instead.

My point being is: people often complain about readability of Clojure and Lisps in general without even giving it a heartfelt attempt. They complain about parentheses (which becomes a non-issue within literally hours after learning structured editing idioms). It's a matter of familiarity.

Some prefer semicolons and other "visual garbage" in their code, I like minimalism and structure.

No other language can retain readability on different screens like Clojure can. Even reading it in a narrow screen of a mobile phone - it would wrap, but still retain its readability. Good luck trying that with literally any other (non-lispy) language.

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

#138

Earlier quoted context omitted.

sure, because Sure, because this (taken from React's JSX example page): Scores ; is more readable than this: [dashboard-unit {:data-index 2} [:h1 "Scores"] [scoreboard {:class-name "results" :scores game-scores]] Please tell me more about Lisp readability.

I genuinely can't tell if you're being sarcastic. The JSX looks immediately intelligible to me because I'm used to looking at HTML. The Clojure looks unfamiliar but it's not so strange that I can't imagine it feeling just as natural a way to represent the same data structure. It would just take a little while to get used to. The major issue I suppose is that this example is supposed to render to XML, which is closer…

> The Clojure looks unfamiliar

That's my point. It is simply "unfamiliar" to majority of developers who have never tried Lisps. And a lot of people throw baseless claims it to be "less readable" without even given it a try.

A few years ago plain English to me was "unreadable". But I have learned the language. And look, today I can even make comments on HN. I guess it's a good thing I haven't dismissed the language because I was unfamiliar with it.

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

#139
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…

rails/Django -> luminous Flask -> pedestal/clojupture Relay -> fulcro Pandas -> clojure.core, specter Keras -> mxnext/neanderthal

I don't think luminous really compares to rails/django. Luminus is more like a great starting point, with some boilerplate and glue between libraries, while rails/django is way more batteries included.

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

#140

I don't have a horse in this race but I find it interesting that in my career I've seen a lot of bad code but the worst clusterfucks I've met where all in Clojure while the community seems to be chock full of purists and in general people that takes craftmanship seriously at least at face value. ¯\_(ツ)_/¯

I guess we would have to believe your empirical observations and ignore the facts: - Clojure has been noted as the most payed language in dev surveys of the past few years - Again, different surveys (e.g.: stackoverflow, state of javascript) shown that Clojurists overall are more experienced devs. This kinda makes sense - usually people try Clojure out of curiosity and not for dogmatic reasons and not for the points…

you don't have to believe a damn thing, it's just my experience.
Post reply on HN