Live data from Hacker News

My thoughts after using Clojure for about a month

acdw.net

161–170 of 204 posts

Re: My thoughts after using Clojure for about a month

#161

Earlier quoted context omitted.

Clojure was explicitly designed to be dynamic. It’s a feature, not a bug. https://clojure.org/about/dynamic Until you get better at not making mistakes that the training wheels of a static type system “protect” you from, lean into the REPL as a means to build up small correct expressions into larger ones.

"Until you get better" is such an arrogant take. It's not just about skill. It's about maintainability, ease of refactor, and modeling invariants in your code in a way that they can be checked by the machine (the compiler) without every single developer having to maintain them in their head. Clojure even knows this is an issue and many people use `spec` to sort of retrofit static typing. Dynamic typing was, is and al…

I too agree that "until you get better" isn't a good take. To err is human, and even the most experienced developers make mistakes.

That said, you don't get static typing for free. As with many things it's a trade-off: you catch some errors at compile time in exchange for working within the confines of the type system. The ultimate hope is that the time you spend fiddling with types is going to be less than the time you spend debugging type errors.

> There is nothing you can do with dynamic typing that you cannot do with a sufficiently powerful static type system - and it doesn't have to be something absurd like Haskell's. You basically just need structural typing and type inference and some type-level programming constructs.

Haskell doesn't have a complex type system for no reason; it's necessary to encompass everything it wishes to do, and even then it's not as flexible as a dynamically typed language.

For instance, how would you statically type Clojure's `assoc` function? It's not at all trivial if you want to retain the type information of the keys and values.

Re: My thoughts after using Clojure for about a month

#162

Earlier quoted context omitted.

Indeed. The incredibly clumsy way we choose to edit source code has baffled me since I was first acquainted with parinfer. Having to keep the source in the shape of a valid AST almost entirely manually is really annoying.

Syntax-directed editors were all the rage in the late 70s early 80s...and a huge failure, because they were a lot more annoying than any text editor has a chance of ever being. It's one of those things that, like visual programming, is absolutely and obviously The Right Thing™ until you try to implement it and use it. That said, we have made progress in both areas, and maybe we will figure them out in the future.

[deleted]

Re: My thoughts after using Clojure for about a month

#163

Earlier quoted context omitted.

if there isn't any jobs for it it probably doesn't have the appeal or communicate economic value

The question is appeal to whom . Large employers want you to learn popular languages so that you're a commodity in a liquid market. But that's not a signal of economic value; it's the reverse. It's saying "I'm entirely replaceable." What you can predict is that those employers for whom clojure (or any other minority language) is either acceptable or preferred are deciding that they don't want commodity, low-margin em…

its not large employers only. you need a steady stream and large enough pool of candidates for any size of a business.

if you limit yourself to a tiny almost invisible slice you are betting your business on finding candidates and relying on that small pool of talent. employees come and go and you would have to deal with this issue constantly.

Re: My thoughts after using Clojure for about a month

#164

Earlier quoted context omitted.

if there isn't any jobs for it it probably doesn't have the appeal or communicate economic value

Jobs and market have a huge factor of 1. politics 2. synergy Almost the only reason that python is popular and people do everything with it is synergy. The only reason that javascript is eating the world and any web dev has to know it, and people do everything with it is synergy. A big reason for C# to have popularity is because it's for Microsoft (politics). These are just some examples. Being used doesn't mean anyt…

you forgot the other side of the market which are the employers who have a business to run and they cannot limit their hiring to a small talent pool because advocates for that esoteric language said its da bomb.

Re: My thoughts after using Clojure for about a month

#166
post #38

Once you learn Clojure's syntax and semantics, you're no longer bound to the JVM. There's ClojureScript (JS), ClojureCLR, ClojureDart, jank (C++), Basilisp (Python), babashka (SCI), and many others. This means that, if you don't know Java or don't like the JVM, you can likely use Clojure wherever you already feel most comfortable. For the most part, any Clojure code which doesn't use host interop will work on all dia…

> babashka (SCI) Correct me if I'm wrong, but isn't babashka's "host"... um.. "native", for lack of a better word? It's compiled with Graal VM native, no? Yes, there is SCI (Small Clojure Interpreter) in the middle, but that's beside the point, no? https://github.com/babashka/babashka https://github.com/babashka/sci

Babashka's interop is with Java, since Babashka uses a Graal-compiled version of the JVM. It's still the JVM, just baked down.

This is different from interop with the native world. It's different from the host runtime actually being native, rather than a baked down version of a whole VM.

Graal's native images blur the line between the JVM and native, I would not say Babashka has a native runtime. Perhaps borkdude would disagree. Might be an interesting discussion.

Re: My thoughts after using Clojure for about a month

#167

Earlier quoted context omitted.

> you have no clue of my stance on AI and are extrapolating a bit too much apologies, but maybe next time try to elaborate more on sweeping statements like "syntax doesn't matter", because in current context my assumption for why you would say that is not all that outrageous. > Syntax does not matter simply because it's an extremely leaky abstraction of the runtime below, is my point. that would be the reason why syn…

> that would be the reason why syntax does matter, wouldn't it? nobody wants leaky abstractions! Well I thought we were describing our current reality, not our _desired_ one? Yes nobody wants leaky abstractions and yes they are everywhere. Syntax matters insofar as to discourage bad habits, is what I'd refine from my previous statements. Most programmers go for the default so defaults and syntax that steers you the r…

> That being said, has Akka started making full use of JVM's new green threads? Has Java itself started introducing immutability and STM / share-nothing as first-class citizens?

Amazing how it doesn't even cross your mind that there are trade-offs to those choices. Green threads are awesome, but guess what, they come at a cost. Same for share-nothing semantics.

> Has anybody rolled up their sleeves and said "Alright, BEAM VM's reign is over, I am making the same or better runtime as them in Java / Clojure!"?

You are again presupposing the BEAM has an absolute superiority over the JVM. "Better runtime" makes no sense on its own. Better is always relative to something. Better for whom? For what?

I'd bet that you work on a traditional CRUD enterprise software, and that IO(the database) is the real bottleneck of your app. In that case, sure, the BEAM is a solid choice(so is Python, Ruby and PHP nowadays). But let's please not pretend that is all there is to software engineering.

Re: My thoughts after using Clojure for about a month

#168
post #152

Earlier quoted context omitted.

Indeed. The incredibly clumsy way we choose to edit source code has baffled me since I was first acquainted with parinfer. Having to keep the source in the shape of a valid AST almost entirely manually is really annoying.

This is borderline silly, though. It is clumsy to start. But so is walking. As is running. Have you seen people start out on bicycles? What about writing? Talking? That is to say, all things start out clumsy. And people that are good at it, no longer feel that it is clumsy. Which is why a lot of people that have been working with this for any time just don't think of this much.

Such a strange attitude.

If a tool is clumsy, we try to improve it, that has been the case since the first stone artifacts created a million years ago.

Do you think that the (sort of) tree-based affordances that most modern code editors do support, like autoindentation and brace pairing/enclosing, are silly too? What about some slightly more advanced features, like the AST-based "extend selection" and "move statement up/down" features in JetBrains IDEs?

Or do you think that the status quo just somehow happens to be exactly right and going any further would be silly?

Re: My thoughts after using Clojure for about a month

#169
post #152

Earlier quoted context omitted.

This is borderline silly, though. It is clumsy to start. But so is walking. As is running. Have you seen people start out on bicycles? What about writing? Talking? That is to say, all things start out clumsy. And people that are good at it, no longer feel that it is clumsy. Which is why a lot of people that have been working with this for any time just don't think of this much.

Such a strange attitude. If a tool is clumsy, we try to improve it, that has been the case since the first stone artifacts created a million years ago. Do you think that the (sort of) tree-based affordances that most modern code editors do support, like autoindentation and brace pairing/enclosing, are silly too? What about some slightly more advanced features, like the AST-based "extend selection" and "move statement…

It would be silly strictly for how strongly worded it is. I should also say that there is nothing wrong with being silly. Someone may actually come up with something some day that meaningfully changes us here.

That is, I am not disagreeing that it can be a little bit clunky. But, a lot of the power that experienced users have in reading code is specifically that they have built a bit of automaticity in reading it. That is, the clunky aspects of fixing it is something you pretty much have to do. You just build speed at automatically doing it rapidly.

So, the status quo is to use the helper functions that you want to use. But usually after you get the experience in the clunky phase.

Re: My thoughts after using Clojure for about a month

#170

Earlier quoted context omitted.

> that would be the reason why syntax does matter, wouldn't it? nobody wants leaky abstractions! Well I thought we were describing our current reality, not our _desired_ one? Yes nobody wants leaky abstractions and yes they are everywhere. Syntax matters insofar as to discourage bad habits, is what I'd refine from my previous statements. Most programmers go for the default so defaults and syntax that steers you the r…

> That being said, has Akka started making full use of JVM's new green threads? Has Java itself started introducing immutability and STM / share-nothing as first-class citizens? Amazing how it doesn't even cross your mind that there are trade-offs to those choices. Green threads are awesome, but guess what, they come at a cost. Same for share-nothing semantics. > Has anybody rolled up their sleeves and said "Alright,…

Any good reason for your rude tone? If we are going to invoke the what crossed somebody's mind trope, I'd lead with that when talking to you -- did it cross your mind to speak calmly and not assume something "did not cross" somebody's mind?

RE: your other similarly rude comment, I have not "appealed to authority" anywhere. I said that I have used multiple PLs / runtimes and made an informed choice... for me. I don't intend to add "...for me" after each sentence. It's redundant and obviously implied when it comes to tech because obviously people have made well-working prod systems with combinations of bash and Perl ages ago. So obviously people can make nearly everything work.

If you don't intend to discuss out of position of curiosity but want to jump on people then I am not interested.

Post reply on HN