Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
wasmperson
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
wasmperson
2mo ago
This reminds me of all the confused comments that pop up whenever someone calls plain HTML with forms and links a "REST API." "But APIs are for programs! People visiting websites aren't programs." https:/&#x
32.
▲
by
wasmperson
2mo ago
> Exceptions are a mechanism for resumable error-handling. Rust's `catch_unwind` function is a last-ditch mechanism for failure isolation Tomayto Tomahto. > I have seen many Rust programs in my day, and not a single one has ever
33.
▲
by
wasmperson
2mo ago
> When you're updating 23 if-statements because you had to add support for some new business workflow, you'll wish you had a conceptual entity that encapsulated the operations on the type of workflows so you just had to impleme
34.
▲
by
wasmperson
2mo ago
> I consider Clean Code to be in the category of books/styles that is helpful for early developers who need some structure Clean Code is unhelpful to beginners too, though: misuse of industry-standard terms, shunning of comments in
35.
▲
by
wasmperson
2mo ago
Yes the support is still there, although official MS documentation no longer mentions it. Some of those headers rather flagrantly violate C's strict aliasing rules, which I suspect is the reason MSVC never implemented type-based alias
36.
▲
by
wasmperson
3mo ago
One good example of DoD which isn't CPU-cache-related is relational databases. When designing a CRUD application, the Data-Oriented way of doing it is to figure out what data you will be storing and how to organize that data to minimi
37.
▲
by
wasmperson
3mo ago
I feel like DoD is one of those things that only makes sense after you already believe in it. There's a sort of KISS epiphany that you have to go through which I don't think the commonly available info on DoD helps you to reach.
38.
▲
by
wasmperson
3mo ago
It's hard for me to think of a definition of "exception" which doesn't include Rust's panics: use std::panic::catch_unwind; fn throws_exception(){ panic!("hello"); } fn main(){ match
39.
▲
by
wasmperson
3mo ago
Now it's your example that's too simple. I can't present a counter-example that wouldn't look totally different: if you avoid the indexing operator then trivially incorrect code like that becomes unrepresentable. It&
40.
▲
by
wasmperson
3mo ago
The worst part about rust not having exceptions is that it actually does have exceptions, you just shouldn't use them. All the downsides and none of the benefits: https://smallcultfollowing.com/babysteps/blog&#x
41.
▲
by
wasmperson
3mo ago
The way I see it, as far as memory safety is concerned that's just framing. Both Fil-C and Rust have a boundary below which the unsafe lives. If Fil-C is only safer than rust when you don't pass the `-F unsafe_code` argument to
42.
▲
by
wasmperson
3mo ago
Yes, rust didn't invent the concept of an iterator, and is thus not the only language which offers a solution to statically avoid bounds checks. Feel free to give a more "interesting" case you believe rust wouldn't be a
43.
▲
by
wasmperson
3mo ago
This isn't entirely true. Rust's indexing operator performs a dynamic check but the language and stdlib have a number of ways to access array elements without indexing, which is effectively a form of static checking. For example
44.
▲
by
wasmperson
3mo ago
> For example you can call mmap in Fil-C and it is still guaranteed to be memory safe, while in Rust you can easily violate memory safety by calling mmap. That's the thing, though. Your Fil-C code isn't calling mmap, it's
45.
▲
by
wasmperson
3mo ago
He claims that all syscalls are safe because they're implemented by his custom libc, but that libc then calls out to the system libc, where the system calls are unsafe. He then claims that this is unlike rust, where making a syscall i
46.
▲
by
wasmperson
3mo ago
> Its their time to spend as they see fit. I'm complaining on these developers' behalf, not bemoaning them doing what they were more or less forced to do. If glibc decided tomorrow to remove the `malloc` function from their li
47.
▲
by
wasmperson
3mo ago
> If you're curious, and you too aren't in love with the "Modern frontend" philosophy I'm also going to hesitantly mention sveltekit. From the outside it looks like yet another JS front-end framework but having
48.
▲
by
wasmperson
3mo ago
Sure Wayland works fine. What you're not seeing is the hours and hours of volunteer labor wasted to get it to that point. Time that could have been spent working on features users actually cared about, now wasted "adding wayla
49.
▲
by
wasmperson
3mo ago
I indeed did not know about this. There seem to be some caveats: https://anubis.techaro.lol/docs/admin/configuration/challeng... I guess for the meta refresh challenge it's less "proof of work"
50.
▲
by
wasmperson
3mo ago
It's somewhat interesting to see the FSF's approach to this. From what I understand they can't really use something like anubis since they want their websites to be accessible without javascript: https://www.gnu.o
51.
▲
by
wasmperson
3mo ago
> but then product introduces a business rule where some fields need to be hidden when another option is selected somewhere function initWidget(root){ // Or a bunch of calls to document.createElement, whatever you want.
52.
▲
by
wasmperson
3mo ago
Agreed. IME the main reason to choose arena allocators is for correctness, not speed. They make similar time/space tradeoffs to garbage collectors in that they grant higher allocation throughput in exchange for more memory usage. The
53.
▲
by
wasmperson
3mo ago
Thinking of it as a "stopping condition" is backwards, that part of the loop is called the invariant: https://en.wikipedia.org/wiki/Loop_invariant You should think of it as the condition that's true for
54.
▲
by
wasmperson
3mo ago
> without having to do any sudo commands or expose anything new to the network. Again I'm not understanding the distinction. I don't need to run sudo commands to install a web server, and depending on your definition of "
55.
▲
by
wasmperson
3mo ago
> it requires exposing a port to the internet or using some SSH port forwarding tool This sentence is bizarre to me. Your SSH-based solution also requires exposing a port to the internet and installing a special tool (on both server a
56.
▲
by
wasmperson
4mo ago
In gamedev, "optimistic updates" are called "client-side prediction," and are a standard part of multiplayer games. IMO it's somewhat risky to apply the technique to web-apps, since each network request typically c
57.
▲
by
wasmperson
4mo ago
Your perspective on this may be distorted due to your personal involvement. Do you believe MSVC++ or Turbo C++ would still have existed without Zortech C++ arriving first? Because if so then I don't think you can really take credit f
58.
▲
by
wasmperson
5mo ago
It matters in single-pass compilers. You can't allocate a variable in a register if its address is ever taken, but by the time a single-pass compiler knows that information it has already spit out all of the assembly for the function.
59.
▲
by
wasmperson
5mo ago
> This article is about async/await. It is not. It tries to address async/await part-way through, but it does so without the context of 10 years of successful async/await usage in javascript, the language it's critic
60.
▲
by
wasmperson
5mo ago
IMO the function coloring problem was solved with async/await. This article was posted before Javascript's async/await syntax cleaned up that ecosystem, so the author is only guessing when they say it doesn't fix the is
More ›