Live data from Hacker News

Try Clojure

tryclojure.org

391–400 of 404 posts

Re: Try Clojure

#391
post #376

Earlier quoted context omitted.

I don't like how this issue is constantly dismissed out of hand. It very obviously is actually a massive glaring issue which severely limits what clojure can reasonably be used for. Nobody would ever accept a 1 second startup time for CLI applications that we use all the time like git, kubectl, npm, docker, etc.

npm, docker, kubectl honestly, you are splitting hairs. I plan to run a process for hours, I think 40 ms delays are something I can live with. git- I take more time to write the commit message to worry about 40 ms. I mean sure optimise code to run it fast. But its not something that a human notices.

40ms? Clojure Hello World startup time is like 600ms and up. Yes sometimes you run npm and kubectl for hours but most of my usage is just running individual commands that take less than a second.

Re: Try Clojure

#392

Earlier quoted context omitted.

There is not a batteries included framework a-la Django or Rails for Clojure. I would argue that is one of the biggest pitfalls to the language/ecosystem. If you are building a web application, you will need to invent the entire thing yourself. There are micro frameworks and tools that exist standalone to deal with HTTP, DB ORM, etc... but that will be an exercise left to the reader. Some will say this is a good thin…

The closest to this (MVC framework with all features including migrations, API building, auth...) is Xiana https://github.com/Flexiana/framework/

This framework looks like an absolute nightmare to use.

Re: Try Clojure

#393

Earlier quoted context omitted.

> Do you think learning Clojure would get me something in addition to that For me, the biggest benefit is that it's hosted. Learning only Clojure, I can easily today write for JVM, .NET, JavaScript, Flutter, or shell scripts. Even when I need to write Lua, I'd usually pick Fennel. It's not Clojure but feels very similar. There are libs that can give you Python or R interop from Clojure. There are projects to target G…

>For me, the biggest benefit is that it's hosted...I can easily today write for JVM, .NET, JavaScript, Flutter, or shell scripts. Isn't CL better for this? You are not bound to some VM and you can produce native binaries.

I can't really say. I know you can (for example) use LispWorks to write CL for mobile, targeting both - Android and iOS, but I think there would be greater friction to keep it cross-platform, each platform's nuances would have to be handled differently, it's not going to be very unified codebase (I think).

Re: Try Clojure

#394

Earlier quoted context omitted.

The number of parentheses is the same, they're just in a different place. Isn't it tiring to type so many semi-colons and commas all the time?

I think it's tiring because before every expression I have to type a (. It's not tiring to type semi-colors and commas because they are very well positioned on the keyboard and I don't have to reach out in the same way as I need to for the parenthesis. Plus, there are not a lot of semi-colons and commas in JS and Python.

Replace in Python with 4-space / tab indentation.

Re: Try Clojure

#395
post #190

> unlike full-JVM Clojure it has a very fast startup time I can't believe that after all these years Java still didn't fix their startup time.

The JVM cold-starts, loads a Hello, World program from a compressed JAR, runs it and shuts down in 40ms. But Clojure compiles quite a bit of Clojure code generating hundreds if not thousands of classes and then loads them before starting up the Clojure program. Still, there's ongoing work on the JVM (Project Leyden [1]) to speed up both startup and warmup even of such programs by caching more state. [1]: E.g. see htt…

[deleted]

Re: Try Clojure

#396
post #197

Earlier quoted context omitted.

I believe that your interpretation of what’s actually happening is what’s baloney. The fact is that you Haskell people only talk about the optimizations that can sometimes open on immutable data in specific circumstances. What you generally ignore is the optimizations that immutable data permanently locks you out of with no recourse. As with most things programming, immutability should be considered a tool, not a rul…

> I believe that your interpretation of what’s actually happening is what’s baloney. I'm actually quoting Prof Andrew Appel of Princeton: https://www.cs.princeton.edu/~appel/papers/ssafun.pdf You seem to think that functional programming and in-place updates are mutually exclusive. This is not the case, e.g. Haskell supports mutation as a tracked and controlled side-effect. It can even give static guarantees that a f…

I don’t really care which functional programming advocate you’re quoting. They’re all liars when they make these claims.

You can say SSA, static guarantees, internal mutability, blah blah blah all you want. When third party, not specifically chosen anecdotes to make FP look good, measurements stack up to the claims, we can have a better conversation.

It’s not looking good though, cause these claims of “actually, Haskell is faster than C because compiler magic” have been going on since well before stable Haskell like 15 years ago, and they’ve been lies for just as long.

Re: Try Clojure

#397
post #390

Earlier quoted context omitted.

Yeah, it always annoys me to have to pass an initial argument. The idea of identities is built into Lisps and seems conspicuously missing from other languages and I don't know why. In Python and JS people have to write stuff like `lambda x: x` over and over again. The identity function is surely special enough to get its own name.

This does not involve an identity function? It's just a textbook monoid: an operation on two elements which produces another (+ or *), with a "neutral" element provided (0 or 1).

I know this isn't the identity function, but it's the same idea and a feeling I get when using Lisps that the language is kind of "complete". Including the identity function and having built in 0-ary functions where it makes sense are examples of this.

Re: Try Clojure

#398
post #81

[flagged]

What a bizarre critique of LISP, which allows you to arbitrary define symbols to mean literally anything.

That's the laziest excuse ever, I want good defaults, and maintainers somewhat receptive to criticism.

"Technically you can configure our product to do what you want" is a great way to have shitty defaults and to ignore all criticism you don't want to heed.

Also this is not a lisp critique, it's a clojure criticism. I get that lisp is simple, ancient and set in stone. Clojure or whatever layer on top of it should be defining this basic stuff on top of lisp.

Are we expected to build a 3rd layer of lisp on top of lisp? And then what pass the burden to our users and let them define a 4th layer of what they actually want?

We need opinionated developers who choose a set of values or industry or application, not indecisive devs who want to support every user.

Re: Try Clojure

#399

Earlier quoted context omitted.

What a bizarre critique of LISP, which allows you to arbitrary define symbols to mean literally anything.

That's the laziest excuse ever, I want good defaults, and maintainers somewhat receptive to criticism. "Technically you can configure our product to do what you want" is a great way to have shitty defaults and to ignore all criticism you don't want to heed. Also this is not a lisp critique, it's a clojure criticism. I get that lisp is simple, ancient and set in stone. Clojure or whatever layer on top of it should be…

What is your example of a bad default in Clojure, and what should it actually be?

Is it the stuff in your grandparent comment? That there should be some binding for x out of the box so that (x 1 2) does something rather than error out?

A lot of mainstream languages use * for multiplication, so that would just be inconsistent.

I also don't agree with your strange requirements where you propose that the character ÷ (U+00F7 division symbol) be used for division, whereas for multiplication you are proposing the plain lower case x letter from ASCII (U+0078).

What you want to pair with ÷ is the actual multiplication symbol × (U+00D7).

Separately from that inconsistency, it's probably a bad idea to introduce one-letter like x into the standard library of a language, particularly one that is Lisp-1 (one namespace for functions and variables).

Those math symbols ÷ and × are both hard to type (does not appear on keyboards and not supported nicely by common input methods) and easily confused for x.

> We need opinionated developers

Okay: Programming languages should stick to ASCII, get off my lawn.

Supporting Unicode in identifiers is fine: give that to the application programmers to use in their programs, if they are so inclined, but for Pete's sake, keep it out of the language and libraries.

(Some Lisp authors disagree; for instance, there is support for lambda being written using the actual Greek symbol in some Lisps.)

Re: Try Clojure

#400
post #79

I'm glad this is back. A version of this existed in the ancient past and helped encourage me to try Clojure which ended up being by far the most impactful decision in my professional life. It went away for a while for reasons I'm unclear on. I use Clojure nearly daily at my job and at home. Sometimes it's standard Clojure, sometimes it's the excellent Babashka flavor which I use as a make-like task runner and Zsh-lik…

As a side note, I'm always amazed by people who can use a highly expressive language (Clojure, Rust, even TS) but switch to Go when they feel like it (especially pre-1.18). To me, switching to a less expressive language is painful and infuriating. I remember having to switch from Python to Java 5, and how everything started to take 3 to 5 times longer code to express. Maybe the key thing is to only write small things…

It's like looking at two very different people and realizing you are attracted by both: each one has their quirks and perks, so you like both.

Might still end up marrying only one though!

Post reply on HN