Post AYa40dbd9naCuhVpxo by loke@functional.cafe
(DIR) More posts by loke@functional.cafe
(DIR) Post #AYa3mRMdsIiGtNjRQW by galdor@emacs.ch
2023-08-10T07:26:10Z
0 likes, 0 repeats
Go 1.21 introducing min and max is good. Go devs finally realizez that "c := max(a,b)" is better than:c := aif b > a {c = b}If we're luck in a couple years they'll finally understand why so many have been asking for the conditional ternary operator. One can dream.
(DIR) Post #AYa40dbd9naCuhVpxo by loke@functional.cafe
2023-08-10T07:28:42Z
0 likes, 0 repeats
@galdor I'm always surprised when if-statements are not expressions in a modern language.
(DIR) Post #AYa6zK9uH8OGAjbt32 by louis@emacs.ch
2023-08-10T08:02:04Z
0 likes, 0 repeats
@galdor The ternary operator is "too brilliant" to understand for mediocre programmers, which is for whom Go was made for:"They’re not capable of understanding a brilliant language but we want to use them to build good software." (Rob Pike)While Go is a great tool to build good software fast, it doesn't offer opportunities to grow as a programmer.
(DIR) Post #AYa8TzK9t7AYUBah8K by sqrtminusone@emacs.ch
2023-08-10T08:18:49Z
0 likes, 0 repeats
@louis @galdor What opportunities do you have in mind? Do you mean some abstractions or patterns that are unavailable in Go or...?Besides, the road to Perl is paved with good intentions
(DIR) Post #AYaBN8COnDXzqWNpZo by chris@s.the-brannons.com
2023-08-10T08:46:37.576948Z
0 likes, 0 repeats
@louis @galdor I've been called elitist and so forthover the years. It's true. I am. I'm an elitist gatekeeper and proud of it.But I'm an elitist who believes in the ability of people to be empowered.An elitist with an unbridled faith in humans and their abilities,who realizes that he's nothing or no one special.The Pike quote just drips with another kind of elitism, a harmful paternalistickind. "They aren't capable of understanding", A.K.A, I know what's best forthem. Essentially, what Pike is saying here, and he actually says it, is thathe wants to *use people as means to an end*. It's a very sick attitude.If you unpack that quote and strip it of all the "nice" phrasing, what youhave is essentially: "I built Go to exploit dumb keyboard monkeys".I'm not a Go programmer, but I don't hate it. It's readable. Peopledo some really awesome stuff with it. Rock on. Not dissing it here, onlydissing paternalistic Pike.
(DIR) Post #AYaBN9KEbZPRL73bQe by galdor@emacs.ch
2023-08-10T08:51:13Z
0 likes, 0 repeats
@chris @louis I fully agree: I believe that we should always strive to do better and help others to do the same.But it's no secret that Google, like all other big tech companies, had to grow fast. And that means sacrificing quality because you need the numbers.
(DIR) Post #AYaI2ksEVOE7OLBL3w by louis@emacs.ch
2023-08-10T10:05:56Z
0 likes, 0 repeats
@sqrtminusone What I mean specifically is that you look at your 100 lines of mostly imperative Go code and think, how can I make that better and more expressive? Just to realize that in Go there is rarely such an opportunity, compared to many other languages, that allow you to learn more advanced functional concepts and abstraction patterns over time. It took the Go devs 14 years to release a generic min/max function and slice/maps utility functions like Contains. I probably wrote thousands of rudimentary, ugly for loops because those did not exist.@galdor
(DIR) Post #AYaW1VgyrZ01NMDero by a13cui@emacs.ch
2023-08-10T12:42:36Z
0 likes, 0 repeats
@louis @sqrtminusone @galdor I'd argue that adding too many new syntax features to "make it more expressive" is also bad and ugly (e.g. Rust or C++)
(DIR) Post #AYaWi1yVE9HRf2gs9A by louis@emacs.ch
2023-08-10T12:50:14Z
0 likes, 0 repeats
@a13cui There is a middle ground, and in my opinion that is the #V language. It has a version of Go-like syntax that is as easy to comprehend but has all the "missing" features you would miss in Go. https://vlang.io/I'm not in favour of the V lang, nor do I recommend if for any serious use, but for other reasons.@sqrtminusone @galdor
(DIR) Post #AYaWrbwarchJp8Mjdg by a13cui@emacs.ch
2023-08-10T12:52:02Z
0 likes, 0 repeats
@louis if you're willing to go into superior better syntax territory, there's also Nim
(DIR) Post #AYaX9unHWGe7UvjpCa by louis@emacs.ch
2023-08-10T12:55:18Z
0 likes, 0 repeats
@a13cui Actually a few months ago, when the Go telemetry shitshow happend, Nim was my choice #1 as a replacement. However, the library ecosystem is dire for serious web backend and database development. That was the reason I abondoned it.That was, of course, before I decided to shred my head with Common Lisp 🙂
(DIR) Post #AYaXCGWfgu6tTh5ca8 by a13cui@emacs.ch
2023-08-10T12:55:46Z
0 likes, 0 repeats
@louis ironically, I am using Common Lisp at this very moment for my Tcl LSP :blobcat3c:
(DIR) Post #AYaXUl78hgDLYexvWq by louis@emacs.ch
2023-08-10T12:59:04Z
0 likes, 0 repeats
@a13cui Sooner or later, everyone will see the light 🤣
(DIR) Post #AYaXZEjKXALsZJxq0u by a13cui@emacs.ch
2023-08-10T12:59:55Z
0 likes, 0 repeats
@louis or stay forever in Darkness.js
(DIR) Post #AYaf7izFFJhtvungPo by sqrtminusone@emacs.ch
2023-08-10T14:24:33Z
0 likes, 0 repeats
@louis @galdor @a13cui To be honest, I'm sceptical about defining "superiority" on the set of isomorphic code representations of reasonable code.Of course, there's the space of bad code, e.g. long hard-to-understand poorly-documented (take any) functions, spagetti code, WET, unreadable constructs such as nested ternaries, etc., etc... And better programmers sample that space less, but it's substantial, even in more minimal languages.I.e. I doubt you can write "better" code, you can write the code that is less bad perhaps.Conversely, I'm in love with #elisp, so I know I can write the same iteration construct with mapcar & co, cl-loop, threading macros, seq-*, dash functions, dolist, cl-do, cl-reduce & the rest of cl-*, hmm, what else... And I don't feel like I've grown much because of that 🙂By the way, it's kinda the same with the aforementioned darkness.js, with its counless _.chain(libraries) besides the built-in loop expressions, .map / .reduce / whatever, .forEach... A Scheme with C syntax indeed.And next to the above, there's the space of memory/compute inefficient code... From my work with students, I often find it harder to explain that this code is O(n!) while it should be O(n^2).Besides, there are principles of single responsibility, separation of concerns, which are mostly language-independent. And architectural decisions....maybe I'll change something in this stream of consciousness if I manage to work in the field for the next 20 years 🤷