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-19 04:33 pm (UTC)(link)

That's the target audience from the very beginning. Observing that the majority of Google engineers are mediocre, Rob Pike slapped together a language that matches their level. That involved "no parameterized types" and "no closures". Josh Bloch was strongly insisting on "no closures" in Java, but they were still introduced. So there was a business need to invent a language dumber than Java.

chaource: (Default)

[personal profile] chaource 2024-06-20 09:59 am (UTC)(link)
How come google engineers are mediocre? Don’t they all pass stringent tests and interviews?
juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-06-20 10:59 am (UTC)(link)

This is a total puzzle to me. I rarely met the people that would pass the tests I did. More, most of the people I interviewed were very good. OTOH, I remember, one interviewee just refused to write any code during the interview. They still hired him. Later I found that he writes a pretty decent code (and there was no doubt about his IQ). But the majority...

[personal profile] aklepatc 2024-06-21 09:52 pm (UTC)(link)
Wow! This is quite interesting.

I can't immediately and confidently agree that it is bad though... Something to think about.

[personal profile] aklepatc 2024-06-22 12:59 pm (UTC)(link)
Agree on all points.

I somehow thought that maybe this behavior was documented well enough and they wanted to enforce a particular workflow different from what you describe. I cannot tell you what this different workflow might be though.

So, yes, you are right and what they are doing does look both dumb and even a bit evil.
Edited (Clarification ) 2024-06-22 13:02 (UTC)

[personal profile] aklepatc 2024-06-21 03:22 am (UTC)(link)
AFAIU Go had honest closures from the very beginning. Java also has them (by now)?

Both modern Java and modern Go have parameterized types.

What am I missing?
Edited (Clarification, fixing typo) 2024-06-21 03:25 (UTC)
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).

[personal profile] aklepatc 2024-06-21 03:30 am (UTC)(link)
I've never been clever
Because need it never.
(c)

:)
Edited (Punctuation ) 2024-06-21 03:30 (UTC)