Live data from Hacker News

Why I'm Productive in Clojure

yogthos.net

61–70 of 99 posts

Re: Why I'm Productive in Clojure

#61
post #14
post #7

My biggest problem with Clojure (specifically ClojureScript) is that it's too workflow opinionated. Nearly all Clojure devs use 1 of 2 text editors. Nearly everyone uses Leiningen. Nearly everyone uses some sort of auto-builder. Nearly everyone uses hot-swapping. Clojure wasn't even optimized for this workflow, it's just the only one that works. So as much as I love the language I keep going away from it because I pr…

Java has Maven, Scala has SBT, Clojure has Leiningen. That's not so bad. I use all three languages, and the appropriate tool for the language. I don't use hot-swapping for anything. For IDEs, in Clojure, you have the choice of Vim, Emacs, Cursive (for IntelliJ), Light Table, and Counterclockwise (for Eclipse), and more. All of them are good, pick your favorite.

Java and Scala are both pretty usable with Maven or SBT (my own Java projects use SBT now). Clojure is pretty much limited to Leiningen. (And, personally, I find working with Leiningen to be a huge drag.)

Re: Why I'm Productive in Clojure

#62
post #26

Earlier quoted context omitted.

Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? The java world is a mess here. Leiningen is pretty great, no need to fragment the community. As far as editors go, I'm perplexed. You can use nearly any editor, why do you perceive the need to use one of these 2?

> Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? I want multiple workflows . A single build tool can accommodate that, but Leiningen can't/doesn't. For example, let's say I have a compiler called mycc. I can build something like this: mycc main.c -o main I might then combine it with an file watcher utility like entr find . -name '*.c' | entr…

I don't really understand the problem, but FWIW I use vim and its Clojure support is fantastic.

Re: Why I'm Productive in Clojure

#63
post #3
post #2

> What matters to me in a language is whether I can use it without thinking about it. I love this statement. It reminds me of the what it feels to be good at mathematics (not my words): "Your intuitive thinking about a problem is productive and usefully structured, wasting little time on being aimlessly puzzled." from http://www.quora.com/Mathematics/What-is-it-like-to-understa... The author also says more about math…

> Any language that lets you spend your brainpower on the essence of the problem is a tremendous advantage and joy. This unlocks creativity and productivity. For some reason the only language that let me reach this level is Python. I tried Clojure and Common Lisp, but for some reason I could never be as efficient as I wanted with them, which I think is a shame because in some ways I think the Lisps are superior to Py…

I was big on Python side back in the early 2000's, on the Perl vs Python for system administration tasks.

Maybe because of the experience in using scripting languages on the server side for a late 90's .COM startup in terms of performance, I never could convince myself to use Python other than for shell scripting on steroids.

I always looked for other languages in terms of tooling support, IDE support and support for native compilation on their toolchains (JIT or AOT).

Re: Why I'm Productive in Clojure

#64

Earlier quoted context omitted.

I learned Clojure from the book Clojure Programming ( http://smile.amazon.com/Clojure-Programming-Chas-Emerick/dp/... ). Once the book gets past the basics, it starts giving lots of concrete examples for how to solve real problems idiomatically in Clojure.

Yea but I am looking for actually field reports from people solving hard concurrency problems out in the wild with Clojure. I am yet to see one.

Storm (https://storm.incubator.apache.org/) is a great example of Clojure used to solve concurrency problems in the wild.

Re: Why I'm Productive in Clojure

#65
post #26

Earlier quoted context omitted.

Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? The java world is a mess here. Leiningen is pretty great, no need to fragment the community. As far as editors go, I'm perplexed. You can use nearly any editor, why do you perceive the need to use one of these 2?

> Well, people do use these tools, but honestly, do you really want a language with multiple build tools / package managers? I want multiple workflows . A single build tool can accommodate that, but Leiningen can't/doesn't. For example, let's say I have a compiler called mycc. I can build something like this: mycc main.c -o main I might then combine it with an file watcher utility like entr find . -name '*.c' | entr…

Right now I'm using a combination of leiningen, guard, livereload, compass and a shell script to handle my specific build workflow.

I'm confused as to why you think leiningen has to do it all.

I'm also not sure what you mean by auto rebuilder (for clojurescript I use the auto feature of cljsbuild ...). My workflow starts with starting a REPL.

Also, I use vim very happily, many people use Cursive happily. But the reason there seem to be fewer editors in use is that REPL integration is so useful that only those editors with good REPL features end up being used. Clojure's ecosystem isn't stopping anyone from using other editors, those editors just haven't implemented a specific feature that is extraordinarily useful when writing Clojure.

I may have misunderstood you but it seems like you are seeing problems that don't exist because the solutions look different than what you expect.

Re: Why I'm Productive in Clojure

#66

Earlier quoted context omitted.

Has your friend used core.typed[0]? I haven't really, but I've wondered if it might be the perfect balance for people who really miss their type system. [0]: https://github.com/clojure/core.typed

core.typed is super cool, but I don't think it's liable to impress anybody who is used to Haskell or OCaml. Java, perhaps.

On the contrary, I came from Haskell-land and was impressed by Typed Clojure, at least in that it is capable of representing some things that are not easily represented in Haskell types. For example, union and intersection types can be pretty powerful. They can have easy variadic functions, and the occurrence typing is sweet -- after a runtime null check, it will remove the `Nil` type from a type union within the if-branch, or a runtime collection-empty check will modify the type in the subsequent branch to no longer include a case for a possibly-empty sequence.

On the other hand, Typed Clojure does not offer nearly the cohesive experience one gets from Haskell, nor do the types guide optimizations etc. Type checking is really a lint step rather than a build step. And almost all existing Clojure code is still dynamically typed, so you can't usually infer how to use a lib based on its type signatures (since it doesn't have them), which I love being able to do in hs.

Re: Why I'm Productive in Clojure

#67
post #64

Earlier quoted context omitted.

Yea but I am looking for actually field reports from people solving hard concurrency problems out in the wild with Clojure. I am yet to see one.

Storm ( https://storm.incubator.apache.org/ ) is a great example of Clojure used to solve concurrency problems in the wild.

Sorry pardon my ignorance but that seems like parallization not concurrency. I would like examples of things like pmap being used in the wild.

Re: Why I'm Productive in Clojure

#68
post #61
post #14

Earlier quoted context omitted.

Java has Maven, Scala has SBT, Clojure has Leiningen. That's not so bad. I use all three languages, and the appropriate tool for the language. I don't use hot-swapping for anything. For IDEs, in Clojure, you have the choice of Vim, Emacs, Cursive (for IntelliJ), Light Table, and Counterclockwise (for Eclipse), and more. All of them are good, pick your favorite.

Java and Scala are both pretty usable with Maven or SBT (my own Java projects use SBT now). Clojure is pretty much limited to Leiningen. (And, personally, I find working with Leiningen to be a huge drag.)

Personally I find leiningen a breath of fresh air after working with Maven (and Ivy, then ant before it). But you can certainly use Maven with Clojure if you'd prefer.

Re: Why I'm Productive in Clojure

#69

REPL-driven development is wonderful. I'm not a Clojure user (yet), but I write a lot of Scheme. My programs are living creatures that adapt and evolve as they are running. It's refreshing to see that Clojure is seeing real use in the industry. Gives me hope that I can get paid to work with a language I really enjoy some day.

I'm a bit curious about your comment. Do you mean during development you run your code on a REPL and change portions of it , or do you mean you run code in Production in a REPL and change portions of it as it's running?

I'm interested to know your setup in either of those cases. The one inconvenience I have about REPL based development is that I need to copy over an expression from my editor into the REPL and if I make any changes in the REPL, like fix a typo, I need to make sure to copy it back to my editor.I guess this may be because I don't use Emacs and have an editor and REPL in one.

Re: Why I'm Productive in Clojure

#70

Earlier quoted context omitted.

I use Clojure a lot, and did more Python in the past. Whenever I come back to Python, I am frustrated by being unable to remember what's a plain old function and what's a method, and the differences defining functions vs classes and methods etc.. In Clojure I know it's always (except for interop) just functions on values. Some functions dispatch to an implementation based on the type of the value, as is the case with…

In general, Python method is just combination of function object and pointer to "self" namespace.

I'd like to know if it's done differently in other languages. In my view, methods are curried function over self with a '.' syntactic shortcut.
Post reply on HN