Live data from Hacker News

Six years of professional Clojure development

falkoriemenschneider.de

41–50 of 209 posts

Re: Six years of professional Clojure development

#41
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.

Your comment prompted me to google for those tools once more. One that I did not know about before is Eclipse Memory Analyzer. The screenshots[1] look promising, especially "Path to GC Roots". I didn't know that was possible. Is there something comparable for .NET?

[1]: https://www.eclipse.org/mat/about/screenshots.php>

EDIT: A bit more googling and I found https://memprofiler.com/> for .NET which seems to have a similar feature, called "Instance Graph".

Re: Six years of professional Clojure development

#42
post #29

Earlier quoted context omitted.

Both of you miss the most obvious difference between Clojure and all mainstream languages: it's a lisp. I've had so many programmers look at code I write and proclaim: "wow that looks impossible because of the parenthesis" and that would never touch anything like it because it seems so different. Some people do take the time to learn how it works, but many just have a knee-jerk reaction to it and then forget about th…

It’s just like C or JS but the first paren goes to the left of the function name.

With function calls, yes.

What makes it different is that syntactic constructs are also expressed with the same syntax and there is no special syntax, so control flow constructs use a syntax similar to function calls.

This is particularly exuberant in Arc where what in many languages would be:

    if        () {
      
    } else if () {
      
    } else if () {
      
    } else {
      
    }
Would instead be:

    (if
       
       
       
      )
Note the complete lack of syntax beyond a keyword having 7 arguments in order, which many find nonconsecutive to reading, and also error prone as accidentally making a typo can completely change the meaning of the program.

It is thus that most Lisps have somewhat more redundant syntax:

    (cond
      [ ]
      [ ]
      [ ]
      (else    ))
Personally, I wouldn't mind that a mandatory `->` be required in between the conditions and the expression to further guard against accidental typos. I find that redundancy in syntax guards against accidental mistakes, though I have nothing against the parentheses and in fact favor them.

Re: Six years of professional Clojure development

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

Typed Racket actually has a rather marvelous type system.

The following is fine therein and statically type checks:

    (let ([x (if (condition) "string" (list "a list"))])
      (if (string? x)
        (string-length? x)
        (length? x)))
By process of elimination, because the type of the variable is `(U string? (List-of string?))`, the type checker can prove that if `(string? x)~ be false, the type of `x` must be `list?`, and that `(length x)` succeeds.

Re: Six years of professional Clojure development

#45

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'd argue that because of the lightweightness of Lisp syntax compared to C-like languages, Lisp languages are easier to read. But then I'm a professional Clojure developer who used to do Golang, JavaScript and some other languages, but since couple of years ago only do Clojure and ClojureScript development, so I'm obviously biased.

But then Python is probably the worst example to compare Lisps to, as Python sees whitespace as a significant character that can affect if the program can run or not.

Re: Six years of professional Clojure development

#46

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?

Is there? I'm not convinced.

I think a lot of the readability issues come from lisp syntax being unfamiliar, not from some intrinsic impenetrability.

And then even more from being associated with functional programming, also unfamiliar to a lot of people.

Look at common lisp nested for loop[0]. Are they really that hard to read?

And then there's the minimalism of lisp syntax. Once you know how to call a function and the few data literals (list, vectors, set, ...), you know 90+% of the syntax.

Compare with python, where you also need to learn class syntax, annotation syntax, for loops, if, while, comprehensions, etc.

And the list keeps growing, there's new features being added continuously. In lisp, if the language introduces a new construct, it's still going to be just symbols in between two parenthesis.

[0] https://lispcookbook.github.io/cl-cookbook/iteration.html#lo...

Re: Six years of professional Clojure development

#48

Lost me at "the promise of purity". Nobody wants to deal with high priests, just get the job done!

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.

Re: Six years of professional Clojure development

#49

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.

Both of you miss the most obvious difference between Clojure and all mainstream languages: it's a lisp. I've had so many programmers look at code I write and proclaim: "wow that looks impossible because of the parenthesis" and that would never touch anything like it because it seems so different. Some people do take the time to learn how it works, but many just have a knee-jerk reaction to it and then forget about th…

I have a theory: it's because Blurp progammers learn to equate parentheses with complex (mathematical) expressions. The view of many parentheses at once must trigger an acceleration of their heart pulse.

Re: Six years of professional Clojure development

#50

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…

Is there something for clojure that TypeScript is for JavaScript?
Post reply on HN