Live data from Hacker News

Clojure will affect the way you think about programming

eli.thegreenplace.net

31–40 of 226 posts

Re: Clojure will affect the way you think about programming

#31
post #11
post #4

I just saw an article recently about core.async and the "go" macro, which seems to effectively give you goroutines in Clojure. I'd be very tempted to use it for that reason alone. I love Go's concurrency, but it can be a little on the verbose side. Good for some projects, but not all of them.

Go is verbose ? I'm surprised to hear that, to be honest. Can you say what it's verbose in comparison to? What production language/framework has terser concurrency with the same expressiveness?

I didn't mean the concurrency, just the language in general. And verbosity isn't always a bad thing. I can dive into pretty much any Go codebase and get a good idea of how it works pretty quickly, and that's been a pretty unique experience for me.

Re: Clojure will affect the way you think about programming

#32
post #26

If "expanding your brain" is really what we want to optimize, why not learn Haskell? Or for that matter, why not learn something even more strongly typed, like Agda or Idris? Or even a theorem prover like Lean? Most of the reasons the author presents would either be expanded in one of those languages, or is immaterial to the goal of maximizing learning. After reading the article I have no more reason to consider lear…

One huge difference is the workflow you have in Clojure. REPL driven development is an experience unique to Lisps. When you're working with Clojure, any code can be run in the context of the live app straight from the editor as you write it. This is an amazing experience and very mind expanding in what a development process can look like.

Also, anybody who wants to try FP style programming, but isn't interested in static typing is much better off with Clojure. Type systems in languages like Haskell and Idris add a lot of complexity and mental overhead that's not present in a dynamic language.

Re: Clojure will affect the way you think about programming

#33

I'm an EE who is getting more and more interested in software development and computation in general. I've been reading Paul Graham and Peter Norvig and decided to learn Scheme. Any thoughts on Scheme vs. Clojure for learning?

Clojure is definitely more practical, being much more widely used in production and running on the JVM (which provides access to a huge array of Java libs).

Scheme is simpler though, and probably more approachable for a beginner. The hosted nature of Clojure means you'll need a decent understanding of the underlying JVM to understand errors--the first time you get a stack trace you're going to seriously question your choice. Also Clojure's syntax is more complicated (but really, not at all complicated compared to Java, C#, Python, etc.).

You should be able to pick up Clojure pretty quickly if you're already familiar with Scheme, the programming style is pretty similar.

Re: Clojure will affect the way you think about programming

#34
post #17

I have to say after diving into ClojureScript I came away thinking differently about a number of things - state management, how to program functionally when you are more constrained than in more permissive languages. It was a real learning experience.

my view is the opposite, ClojureScript is more permissive than Javascript :/

Re: Clojure will affect the way you think about programming

#35
post #32
post #26

If "expanding your brain" is really what we want to optimize, why not learn Haskell? Or for that matter, why not learn something even more strongly typed, like Agda or Idris? Or even a theorem prover like Lean? Most of the reasons the author presents would either be expanded in one of those languages, or is immaterial to the goal of maximizing learning. After reading the article I have no more reason to consider lear…

One huge difference is the workflow you have in Clojure. REPL driven development is an experience unique to Lisps. When you're working with Clojure, any code can be run in the context of the live app straight from the editor as you write it. This is an amazing experience and very mind expanding in what a development process can look like. Also, anybody who wants to try FP style programming, but isn't interested in st…

Is there something about clj's repl that makes it any different from ghci's?

Re: Clojure will affect the way you think about programming

#36
post #24
post #18

Earlier quoted context omitted.

It's also very pragmatic, and probably most used functional languages in the industry at this point.

wish that were true, but i doubt it. scala, prolog and erlang are all higher on tiobe index.

I personally don't view Scala as a FP language, it's a FP/OO hybrid. It's not opinionated in that regard, and a lot of code in it is written in traditional OO style or a mix of the two.

Erlang is another widely used functional language, but it's not very widely used outside the telecom niche. Clojure has the advantage of running on the JVM, and makes it easy to target a much wider range of domains.

Re: Clojure will affect the way you think about programming

#37
post #26

If "expanding your brain" is really what we want to optimize, why not learn Haskell? Or for that matter, why not learn something even more strongly typed, like Agda or Idris? Or even a theorem prover like Lean? Most of the reasons the author presents would either be expanded in one of those languages, or is immaterial to the goal of maximizing learning. After reading the article I have no more reason to consider lear…

Absolutely agree. However there is a "perfect language" for every programmer to learn, depending on their background and spare bandwidth. For many programmers the jump from their primary language to Haskell or others is too high, not only in terms of complexity but also utility. Several colleagues of mine are picking up new languages right now and a common criteria is they want to build something tangible/useful within a limited time. Having access to the JVM and third party libraries they already know is certainly a plus.

Re: Clojure will affect the way you think about programming

#38
post #20

Clojure is the language where LISP clicked for me. Can't recommend it enough, it's got all of it - immutable datastructures, convenient data literals, simple and composable concurrency primitives, very thin interface to host VM. Just put enough effort to get beyond that "omg parenthesis" barrier and it will be a delight. It's like that Half-life joke: there are two kinds of people, those that finished Half-life many…

I've learned to love the parentheses, because they embody what is so nice about lisps (and particularly Clojure)--inside the parentheses is a little nugget of functionality that generally stands on its own. No syntactic tricks, the only "trick" is the macro system, but it's so straightforward that I'm not sure I'd call it a "trick".

The other immediate barrier is when Clojure barfs an ugly stack trace. I've heard that 1.9 will address that with core.spec, but I haven't explored it yet.

Re: Clojure will affect the way you think about programming

#39
post #4

I just saw an article recently about core.async and the "go" macro, which seems to effectively give you goroutines in Clojure. I'd be very tempted to use it for that reason alone. I love Go's concurrency, but it can be a little on the verbose side. Good for some projects, but not all of them.

If you are curious about core.async and want to learn more you can have a look at the post I wrote on it-- [http://abhirag.in/articles/batman_clojure.html]. I wrote it while trying to learn it myself so not the most advanced resource but I hope somebody finds it helpful :) Note -- The page is kinda resource intensive because it contains a running clojurescript interpreter for interactive code snippets.

Re: Clojure will affect the way you think about programming

#40
post #26

If "expanding your brain" is really what we want to optimize, why not learn Haskell? Or for that matter, why not learn something even more strongly typed, like Agda or Idris? Or even a theorem prover like Lean? Most of the reasons the author presents would either be expanded in one of those languages, or is immaterial to the goal of maximizing learning. After reading the article I have no more reason to consider lear…

They're not lisps, and do not have proper macros.
Post reply on HN