Live data from Hacker News

Six years of professional Clojure development

falkoriemenschneider.de

71–80 of 209 posts

Re: Six years of professional Clojure development

#71
post #10
post #3

Earlier quoted context omitted.

Unfortunately, despite consistently hearing about how enjoyable Clojure is, I think many people are turned off by the JVM. This is probably also the problem with Scala, which is apparently also enjoyable to use.

JVM and .NET are the top runtimes with best in game GC implementatios, JIT compilers, JIT code cache, and monitoring tools for production code. In fact plenty of them, given that there are multiple implementation to choose from. Meanwhile other languages keep playing catchup and having to rewrite extensions in C.

The runtimes themselves may be great, but the tooling is bloated and uncomfortable.

Every time I use Clojure, I am reminded how much I hate using Java. The error messages alone are enough to turn me away. So is having to set up a whole Leiningen project just to get started.

A Clojure without Java would be very attractive to me.

Re: Six years of professional Clojure development

#72

Earlier quoted context omitted.

That's... exactly the point of that section. You should continue reading the part right after the section title you mentioned.

Well, no not really. They started with the conclusion that being a clojure geek is cool and then try to post justify it. Good programming practice isn't a language feature its a programmer feature.

> Good programming practice isn't a language feature its a programmer feature.

I'll enjoy reading your production-grade brainfuck code.

A language's built-ins and idioms greatly influence what you say and how you say it. If your mother tongue doesn't have words to describe any emotions you'll have a hard time explaining them. You're talking only about the other side of the coin. Yes, people can write terrible clojure code, you need to be a good programmer to write good code. But please consider rewriting this bash one-liner in pure C (or assembly)

    grep FOO */* | wc -l
Having a language to express your domain concisely is essential in reducing code complexity, time-to-market, bugs etc.

Re: Six years of professional Clojure development

#73
post #6

Nice article. Sadly a lot of people won't even try clojure since it is dynamic typed. I see their point but nevertheless clojure does something really well here. As the author obserserves designing around some core data structures results in high code reuse. A library like spec is also way better in encoding business requirements than all the mainstream language typesystems e.g. a number in business context has mostl…

Can we have a REPL-driven language that's statically typed? My hope is yes, in that it's just that the work hasn't been put in yet to create to create the equivalent of Typescript for Clojure or Lua that compiles down to the actual, extensible language. I always wish that it would become unnecessary to have to choose between stability and extensibility when selecting a programming language. Having a Clojure with stat…

Scala for example is statically typed and had a REPL from day 1.

However, when using a language with a great typesystem, the need for a REPL is just much less. You mostly don't need to try things out because the types guide you. Therefore these languages might have a REPL and it might be useful, but REPL-driven is not really necessary.

> I always wish that it would become unnecessary to have to choose between stability and extensibility

Stability, extensibility, low language-complexity. Pick 2.

Re: Six years of professional Clojure development

#74

Earlier quoted context omitted.

Yes, I do blame them for this because if you spend 10 minutes, any programmer can learn "some crazy lisp expressions" because they are not that crazy. This knee-jerk reaction you're having is exactly the ones I'm talking about :)

So you're saying there's absolutely no loss of readability in something like Lisp opposed to Python?

I'm sympathetic to the parents that it's not as bad as people say, but I'd definitely agree with you that syntax at least to me provides a lot of value. Of course, too much syntax is a problem in the other direction.

Re: Six years of professional Clojure development

#75

Why is everyone making a big deal out of dynamic nature of Clojure as the main factor to not consider it in enterprise project ? As if no dynamic language has ever succeeded in creating enterprise application which runs 24X7 !!! If you don't like maps use clojure records If you don't want free floating initiation or ambiguous variables and arguments to function in code, use type hints. Type hints may not be exact alt…

The soft real-time interests me. Are there ways to avoid garbage as with java to minimize GC driven latency.

It's very much possible, now more than ever. New JDKs provide more efficient version of garbage collector like epsilon for example. CMS can also do the job if you know few tricks. You don't have to be a big nerd to understand them. Documentation is pretty helpful.

In my application I was able to get latency for http/rest services less than 15ms which also hit database more than once. Ofcourse it's very subjective to the business use case and networking infrastructure. YMMV

If you really want me to pin point the issue, as far as GC on JVM heap is concerned only major difference with other language implementation was that I had to use around 1GB of extra RAM.

All i am saying is that, start with idiomatic clojure. If that's not performant enough for you use case, start optimizing the code.

Re: Six years of professional Clojure development

#76

Earlier quoted context omitted.

Can we have a REPL-driven language that's statically typed? My hope is yes, in that it's just that the work hasn't been put in yet to create to create the equivalent of Typescript for Clojure or Lua that compiles down to the actual, extensible language. I always wish that it would become unnecessary to have to choose between stability and extensibility when selecting a programming language. Having a Clojure with stat…

Scala for example is statically typed and had a REPL from day 1. However, when using a language with a great typesystem, the need for a REPL is just much less. You mostly don't need to try things out because the types guide you. Therefore these languages might have a REPL and it might be useful, but REPL-driven is not really necessary. > I always wish that it would become unnecessary to have to choose between stabili…

I'd argue Clojure has all 3

Stability - one of Clojure's core tenets.

Low language complexity - not much more than EDN and everything is an expression, plus a few extras like destructuring. Certainly simpler than any other language I have used.

Extensibility - again, one of Clojure's strong points with macros.

As for "Type systems removing the value of a repl" again, I disagree. Repl driven development is as much about exploring the problem than it is writing code.

Re: Six years of professional Clojure development

#77

Clojure is the most enjoyable language I've ever used and I love the interactive development. I haven't written code in any other language that even comes close. Unfortunately I am too lazy and careless to use Clojure in any serious capacity though. I really need a Haskell or Rust compiler to remind me of all my silly mistakes. I can't be trusted to get to the same level of confidence through unit tests or linting or…

- Clojure without clj-kondo

- PHP without phpstan/psalm/phan

All bad ideas, modern tooling can detect errors in your code before you finish your code expression, but you do need to go out of your way to setup it up

Most people do not and then complain about types instead of talking about static analysis

If you are ever coding Clojure you should be following this: https://github.com/clj-kondo/clj-kondo/blob/master/doc/edito...

Re: Six years of professional Clojure development

#78
post #26

Earlier quoted context omitted.

I don't think it's about it's dynamicism but more about it being functional. Plenty of super popular dynamic languages out there. I think that's also what keeps elixir from becoming something more mainstream, most people come from OOP and are used to thinking about programming that way.

I really like Clojure, it's the language that finally made FP "click" for me. It was my go to for hobby/side projects for quite a while. Dynamic typing is why I eventually switched. Haskell scratches the same itches that Clojure did, but the compiler and type system are immensely helpful, and keep saving me from tripping over my own feet.

Common Lisp is my go-to language, but I also like Haskell and Clojure. To me, Haskell is a Lisp, and supports REPL driven development.

Re: Six years of professional Clojure development

#79
post #77

Clojure is the most enjoyable language I've ever used and I love the interactive development. I haven't written code in any other language that even comes close. Unfortunately I am too lazy and careless to use Clojure in any serious capacity though. I really need a Haskell or Rust compiler to remind me of all my silly mistakes. I can't be trusted to get to the same level of confidence through unit tests or linting or…

- Clojure without clj-kondo - PHP without phpstan/psalm/phan All bad ideas, modern tooling can detect errors in your code before you finish your code expression, but you do need to go out of your way to setup it up Most people do not and then complain about types instead of talking about static analysis If you are ever coding Clojure you should be following this: https://github.com/clj-kondo/clj-kondo/blob/master/doc…

I use kondo already, and while it's a nice tool it doesn't solve my problems.

Re: Six years of professional Clojure development

#80
post #54

Earlier quoted context omitted.

What is mutable by default in Clojure? Nothing. You need to explicitly declare mutable variables with a special notation. Are you talking about the underlying VM? Yes, the Java API are mutable, not surprise here, it's not Haskell. Imperative? What is imperative by default in Clojure? Nothing. It's one of the least imperative Lisp, favoring functional constructs all over the place unlike Common Lisp or even Scheme. Bl…

> What is mutable by default in Clojure? Nothing. All data in Clojure inherits from java.lang.Object. I get what you’re saying, but in real life commercial projects, especially when you use libraries and Java classes, the code ends up with a lot of mutable things. You can never know if any function you call does mutate something without keeping all definitions in your head, and with 20+ people on the project, this is…

Thank you for these comments they are super interesting to me as a relatively new Clojure programmer.

Can I ask two related questions -

1. Reading between the lines it sounds like the mutability issue arises from interop, both in the core code and any dependencies that wrap Java?

2. If yes, curious why did the folks involved did not write native Clojure libraries to eliminate the (worst?) blocking dependencies (or patch the Clojure wrapper libs)?

I ask 2 because my understanding is interop was partly a bootstrap strategy for the language and there was always (I think?) an assumption that the native Clojure library ecosystem would grow and make interop less necessary. Is that not happening enough?

Post reply on HN