Recent submissions

Comment · 11 months ago
Comment · 1 year ago
As I understand it this is precisely why in Haskell and OCaml standard libraries we get lots of things like

  map : (a -> b) -> a list -> b list
instead of

  map : a list -> (a -> b) -> b list

The main argument (data to be operated on) is positioned last, after the others which are more like parameters that tune the function. It's to allow chaining these things up left to right like Unix pipes:

  map f l |> filter g |> ...
Comment · 1 year ago
I see.

My understanding is that Rust doesn't have _automatic_ reference counting as in Swift only because it has an alternative (move), which requires the programmer to specify their intent. The principle is nevertheless the same: ensure every time a reference is copied the ref count is incremented, free only when ref count is zero, and we get temporal memory safety.

Comment · 1 year ago
I was actually talking about automatic reference counting. I think both Rc and Arc count as automatic reference counting? It's just that the term (which was apparently coined by Apple?) is not commonly used outside Apple's languages.

I'm not familiar with Swift though so my understanding could be incorrect.

Comment · 1 year ago
The point about Rust is to avoid any extra runtime cost by statically enforcing a set of rules (borrow checking) on reference use that are sufficient to guarantee memory safety. It also has ARC but it's reserved only for cases where those rules are too restrictive.
Comment · 1 year ago
I think I saw them sharing it on Reddit earlier
Comment · 1 year ago
I'd love to learn more about how AMT works. How would a doubly linked list work in this language for example?

Does the conversion happen during run-time? Isn't that going to be super expensive?

Comment · 1 year ago
There are different types of harmonicas. For 10-hole/blues harmonicas bending is a fairly common technique. It's less common or easy to do on other types of harmonicas, eg chromatic harmonicas. Maybe you tried one of those as a kid.
Comment · 1 year ago
What are some safety guarantees for CSS?
Comment · 1 year ago
> It forces functions to be memory pure (pure with respect to memory), even if they aren't.

What if the unsafe code is not supposed to be pure but mutates some memory? For example, does this allow implementing a doubly-linked list?

Comment · 1 year ago
I own a Kindle Oasis 2. Amazon stopped software updates for it so I just jailbroke it and loaded KOReader. It's way better than the official software, probably the most feature-rich and customisable document viewer I've ever seen. I regret not installing it earlier.
Comment · 1 year ago
I wouldn't call it an entirely new distro. It's just an Fedora image bundled with the necessary changes to create the UX. It doesn't provide its own software repositories. It's more like an unofficial Fedora Spin.
Comment · 1 year ago
It seems to me that the part about unsafe operations is pretty much still unspecified. It's currently just a short paragraph saying it may cause undefined behaviour and a list of high-level descriptions of those unsafe operations. But what's the exact semantics of those operations? When is it undefined?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton