sassa_nf ([personal profile] sassa_nf) wrote2024-06-19 05:21 pm

A language for not clever people

http://go.dev/ref/mem#advice
Don't be clever.

Who do they think they are?
juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-06-21 11:40 am (UTC)(link)

Yes, I heard about Go types having parameters now. The fight in Java was hilarious.

[personal profile] aklepatc 2024-06-21 09:59 pm (UTC)(link)
Guess, I was looking for a way to politely disagree with your comment.

AFAIU you introduced 2 examples of not-so-clever programming languages for not-so-clever programmers. You gave 2 specific reasons as to why you consider these languages dumb (away with politeness, lol).

These 2 specific reasons look incorrect to me. It doesn't necessarily negate the whole point. But it certainly makes it somewhat questionable...
Edited (Clarification ) 2024-06-21 22:02 (UTC)
juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-06-21 11:45 pm (UTC)(link)

Well, my judgment regarding Go was based on what I saw and heard 10 years ago. Now it's all just impressions and opinions of other people. Java... too little, too late. Still not there.

But I'd rather listen to your specific arguments.

[personal profile] aklepatc 2024-06-22 01:41 am (UTC)(link)
I am not qualified to compare Go to the "smart languages" (Scala, Haskel, etc.). This is b/c I don't really know any smart languages. My reference points are Go, Python, C/C++. And Java to a lesser degree.

Go has honest closures, duck typing ("old Python" style), interesting (and very useful for the right sort of problems) concurrency features built into the language.

Admittedly subjective: minimalistic, orthogonal features, thoughtful standard library.

Anecdotally, it eats much less memory than JVM based languages. This last thing is at least partially due to Go being "value based language", C/C++ style. This is compare to Java, Python (and JavaScript?) that are "reference based languages". Also I could talk about Go being more "cache friendly" here... It is somewhat more on the implementation side of things not 100% language design though.
Edited (Clarification ) 2024-06-22 02:09 (UTC)
juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-06-22 11:44 am (UTC)(link)

Oh, then yes, between Python and Go, for production I'd definitely choose Go.

[personal profile] aklepatc 2024-06-23 01:47 am (UTC)(link)
BTW if memory serves, Python closures are not "honest".

Specifically, you can read anything from the outer/enclosing scope but you cannot write to it unless you "cast some magic spell" (local or global keyword, I forgot).