Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
whytevuhuni
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
91.
▲
by
whytevuhuni
1y ago
I like your response the most among your siblings. A couple more points, based on how the bumpalo crate does it: - If you don't really need destructors, then it's fine to just not call them. This works for things like strings, lis
92.
▲
by
whytevuhuni
1y ago
It would be a wholesale move from one of the easiest programming languages to start on, to one of the hardest languages to start on. Most programmers I've met were beginners, and they need something easier to work with until they can j
93.
▲
by
whytevuhuni
1y ago
I've used this for a toy game I was once working on [1], and it works pretty well for a while, but the problem is that sometimes the OS decides that your dlclose will be a no-op. I haven't ever found a way to force the OS to unl
94.
▲
by
whytevuhuni
1y ago
The idea of Rust is not that it is 100% safe, but rather that it is able to encapsulate unsafety and divide the program in two parts: - unsafe code plus modules that support it (the "trusted base") - all the rest Rust's promi
95.
▲
by
whytevuhuni
1y ago
That's a good point, Ask HN would've made a lot more sense here.
96.
▲
by
whytevuhuni
1y ago
I’m genuinely curious now, what made you so convinced that it would be completely statically linked?
97.
▲
by
whytevuhuni
1y ago
I don't think it's speculation though, since this rye-init init system clearly doesn't even exist anywhere (let alone as an Arch package), and building something that could replace SystemD is an absolutely herculean task. R
98.
▲
by
whytevuhuni
1y ago
Do you regret the expended effort? Does it feel wasted, or does it feel useful?
99.
▲
by
whytevuhuni
1y ago
What's that have to do with Rust though? Rust takes it straight from C: https://godbolt.org/z/Ysb6M66h4 And because it has been used like that in C for decades, the dictionary definition takes a backseat to the no
100.
▲
by
whytevuhuni
1y ago
Not quite, you also need to keep pointer non-nullness, alignment and aliasing safety in Rust, which is very pervasive in Rust (all shared/mutable references) but very rare in C (the 'restricted' keyword). In Rust, it's n
101.
▲
by
whytevuhuni
1y ago
I see it does what you're saying on the "else" branch, but that just returns the previous string unmodified, which makes sense. The more important one is the "if" branch though. Looking at your Godbolt example'
102.
▲
by
whytevuhuni
1y ago
I tried to get some sort of proof based on Godbolt, to see if it generates any memcpy's, but I couldn't manage to do that after quite a few tries. :( It's really difficult to understand this given how much I know about Ada, s
103.
▲
by
whytevuhuni
1y ago
From the documentation you linked, it seems slicing creates a brand new String, which is more like std::string than std::string_view. In other words, it allocates and copies all of the string's characters (although it might allocate on
104.
▲
by
whytevuhuni
1y ago
Thank you! I assume 'Access types are not memory-safe, right? Is there a SPARK equivalent which still does not copy (i.e. it only references) that is memory safe? To be more specific, how would one implement something like a "Get_
105.
▲
by
whytevuhuni
1y ago
But doesn't this copy the entirety of that slice? That's not what I meant, I was referring to a shared reference, akin to &str in Rust or std::string_view in C++.
106.
▲
by
whytevuhuni
1y ago
I don't know Ada / SPARK, and I've been trying to figure this out. Based on the hallucinations I got from ChatGPT, it seems Ada itself is nowhere near as powerful as Rust in safety, while Ada with SPARK disallows some things
107.
▲
by
whytevuhuni
1y ago
This is generally unsafe, so to make it safe there needs to be something that restricts what kind of things you can read and write. For example, if your structure contains a reference, and you read an instance of that from disk, then you no
108.
▲
by
whytevuhuni
1y ago
> But genuinely, why are you so strident about using the term if you clearly have a more precise understanding of what you want to communicate? Because, up until I've read your comment, I've seen the term used with my definitio
109.
▲
by
whytevuhuni
1y ago
A systems language does not imply anything about scale and reliability. By your definition, Java would be a systems language, while C and assembly would not be. A systems language is one that not only allows direct low-level access to hardw
110.
▲
by
whytevuhuni
1y ago
> Gödel's Incompleteness Theorem proves we'll never have Artificial General Intelligence. What is your definition of AGI? Is natural general intelligence something you think brains are physically capable of, or is some non-phys
111.
▲
by
whytevuhuni
1y ago
Of note, bootstrapping was already possible [0] based on mrustc, and based on the source [1] it seems that's what is currently being used. This would allow bootstrapping on other architectures though, and without the suuuper-long incre
112.
▲
by
whytevuhuni
1y ago
Wow, you're right. Apparently this was Rust in 2010-06-23: io fn starve_main(chan[int] alive) { log "signalling main"; alive <| 1; log "starving main"; let int i = 0; while (tr
113.
▲
by
whytevuhuni
1y ago
Imagine trying to make some sort of MP3 player using an MCU. You’d be able to use MicroPython for the controls, but for decoding you won’t be able to get away with it, and you’ll need something like C/C++/Rust.
114.
▲
by
whytevuhuni
1y ago
Yeah, I've hit the enum variant type issue myself (e.g. a function guaranteed to return one of the variants), but in practice it hasn't been that big of an issue. There's also std::mem::discriminant [1] which helps a bit. W
115.
▲
by
whytevuhuni
1y ago
static VARIABLE: Foo = bar(); // May or may not be evaluated at compile time Under what circumstances would this not be evaluated at compile time? As far as I know the initializer must be const. Unlike C++, Rust does n
116.
▲
by
whytevuhuni
1y ago
Yeah, I think that would be ideal if possible, although often that requires most of the state to be in Rust, and exposing proper bindings to every bit of that state is quite an undertaking.
117.
▲
by
whytevuhuni
1y ago
It depends on the kind of game you’re making. If it’s a really logic-intensive game like Factorio (C++), or RollerCoaster Tycoon (Assembly), then I don’t think you can get away with something like Unity. For simpler things that have a lot o
118.
▲
by
whytevuhuni
1y ago
I would keep lifetime generics, but remove traits and type generics (and therefore the really complex trait bounds, most of the GAT/RPITIT shenanigans, etc). I feel like that would remove most of the complexity, while leaving a mostly
119.
▲
by
whytevuhuni
1y ago
This is obviously a troll comment, but it made me curious. I'm familiar with Plan 9, and I know about the interesting mount namespace shenanigans you can pull off with it, but does it actually have anything that would help with async?
120.
▲
by
whytevuhuni
1y ago
How does it loop, if at all? Does it just restart at the end after it falls out of `main()`? This is definitely something I'd like to try. Gotta figure out where to run the server... maybe a good time to figure out how to do custom Hom
More ›