The thing which I am personally salty about is that they weren't there to begin with, and that the language wasn't built with them in mind.
569 karma · joined November 28, 2022
The thing which I am personally salty about is that they weren't there to begin with, and that the language wasn't built with them in mind.
I think Go is a perfectly fine language, and I respect the goal to stay clear of complexity, but when looking at any particular Go feature, then it's easier to explain the decision with "They are used to thinking in terms of C-idioms." than with any particular brilliance or awareness of PL-theory.
I also vehemently disagree with them, and I think that the way code is factually written in practice is on my side: People who propose sum types commonly refer to the Option<T> or Result<S,E> types in Rust. These are types which are almost exclusively used as return types.
Interface types are the opposite. They're used as input types, and almost never to distinguish between a concrete, finite list of alternatives. They are used to describe a contract, to ensure that an input type fulfills a minimal set of requirements, while keeping the API open enough that other people can define their own instances.
The fact that Go in fact does not use interface types for its error handling is a pretty good argument in favor of that, I'd say.
The thing is, at this point it doesn't matter, sadly. Adding sum-types to the language now would be unsatisfying. You would really need proper integration as the primary tool for error handling in the standard library (and the ecosystem), and that's unlikely to happen, even less likely than a Go 2.0.
EDIT: Just to make it clear, I think not wanting to add sum types to the language is understandable at this point. The real shame is that they were not in the language from the beginning.
Go also has some really weird stuff in it, such as named return values.
Frankly, the lack of sum types hurts the most. The language would just be a lot better with a unifying Result type in the library. And don't give me any of that "oh, they tried to keep the language simple!" stuff.
Intuitively, sum types are laughably simple. Everyone understands "It's one of these possible values, so you need to check which one it is and then handle that situation." They are more simple than enums on a conceptual level! Sum types are just not how C-programmers think about the world.
You'll get more out of reading the Wikipedia article on queueing theory and on M/M/1 queues.
In idiomatically written Rust you will never obtain an exception/panic (unless there is a bug), and exceptions are not used for control flow. This is not the case in Java or C++ or many other languages.
Otherwise it all just works immediately, no issues at all.
It sounds like you're just hoping for either a dynamically typed language (eg. Python) or for a language which is fully type-inferred (eg. Haskell). Which way is it?
Sometimes "showing the code" is not enough. Show me the benchmark.
The car touchscreen doesn't work since you need to operate buttons without directly looking at them, purely by tactile feel.
This is not a problem touchscreens we're able to fix so far, and I don't think this will change any time soon since there's just not enough ways for a touchscreen to provide this level of tactile feedback.
(Speaking with love as an i3/Sway person.)
UB is used for performance optimizations, yes, but all of these difficult to diagnose UB issues and bugs happen because C++ makes it laughably easy to write incorrect code, and (as shown by Rust) this is by no means a requirement for fast code.
Currently 50% of my anxiety when it comes to my bot is related to database matters. There's no type checking so I gotta be careful when writing them, and stuff might blow up weirdly at runtime. Refactoring tables is also a major pain, or at least was until I (sort of) figured out a 'routine' of how to do it.
It's doable, and I assume that teaching myself some basic SQL and using it in production was a great learning experience, but once I'd reached the point where I was inventing database migration tooling from first principles and considering how to implement that, I realized that I probably just want to look at SQLAlchemy again.
Helix has much better default keybinds, it has a lot of stuff built into it which would require extensions in Vim, and it has a much smoother learning curve (partially due to better keybinds, and partially due to the fact that it will show you which options exist when you eg. press `g`).
As an example: Moving to the start or end of a line is just `gh` and `gl`, which makes a lot more sense than Vim's keybinds. It's still going to take a while to get used to modal editing, but if you don't care about learning vim specifically, then I think that it's an improvement in every single regard.
My personal favorite feature is the multi-cursor editing, especially when coupled with the `s` key.
Even just guidelines on the entire compilation step would be appreciated, or knowledge on how some fairly standard examples of demos were compiled, and which tools were used.
As an aside, I really like that I can grep source files for a keyword such as `fn ` and get a good idea of how many functions I am defining, and where they are. This gets especially powerful with multi-cursor editing.
https://youtu.be/rHIkrotSwcc?t=1192
At 26:50 he gets into how this relates to ABI, and how 'fixing' some of this would require a pretty severe ABI change, as well as destructive move semantics, which would require a severe change to how C++ works.
I frankly don't understand C++ well enough to fully judge about all of this, but everything he says seems entirely solid, and showcases how unique_ptr is in fact not zero-cost, and can in fact be a significant performance trade-off when you really need that extra bit of performance.
> Rust occasionally forces my hand considerably harder (e.g. RC<RefCell<..>> vs std::shared_ptr<>)) in the direction of performance compromise. How so? Is RC<RefCell<T>> more expensive than std::shared_ptr<T>?
As far as I know the community is (was?) still a bit divided on async, mainly because it's rough around the edges, and makes for bad compiler errors.
I wouldn't be surprised if 15+ years later people will think of async as "Probably great for its time, but there are better concurrency paradigms which we should shift to." similar to the shift from inheritance to composition.
Like, we're talking some amount of genuine brain damage damage which he's just stuck with now.
Twitter was also just not a good place for him at all. Some people just get sucked into that sort of stuff, even though it's terrible for their public image, and even though there is so much more they could be doing. Anyone remember how people made fun of eg. Richard Dawkins and Neil deGrasse Tyson for being obnoxiously atheistic on Twitter? Yeah, it's a bit like that.
Anyway, when it comes to Hyperrogue's flaws: 1. The menu is incredibly weird and difficult to navigate. I know a few people who never even knew that certain options existed, since they were hidden a few menu options in. I sometimes have to search for stuff if I didn't start the game in a while.
2. Sometimes there are areas which are rather monotonous and easy, and where you'll be tempted to just 'race' through the area by using scrolling as your main movement method. This works great, until it doesn't, because RNG decides to spawn two enemies in the worst possible locations and you're suddenly locked into a game over. Misclicks can also result in an instant game over, and they happen now and then. In theory it'd be possible to just take things slowly all the time, but this can quickly get really boring when covering large distances. The princess quest is a good example: Very cool idea, but the actual quest gets very tedious. Because of the nature of the area you have to play slowly, but it can be a long, long distance until you actually reach the princess.
tl;dr: Dying with 100+ treasures in Hyperrogue is frustrating since it can happen out of nowhere, and avoiding it would force you to play incredibly carefully and slowly, and/or to avoid some of the more interesting/dangerous lands. If you die you have to start over from scratch, but the game imo doesn't really benefit much from that, and it just forces you to redo the early areas of the game, which isn't that compelling, since the gameplay in these areas is always going to be the same.
Don't get me wrong, I'm glad that it exists and hope that it inspires some more hyperbolic games (and makes it easier for other people to get started), but game-wise it's incredibly thin, and doesn't have much (if anything) going for it apart from some hyperbolic geometry (which makes some things slightly weird or quirky).
Hyperrogue is much more of a game. It's arguably not a great game (it has a bunch of oddities, and I'd argue some pretty severe flaws), but it does much, much more with the concept, and some of the worlds are genuinely quite compelling.