HN user

reycharles

279 karma
Posts1
Comments118
View on HN

In an electric car? Really? I don't know too much about electric cars, but it's my impression that gears and transmissions are completely unnecessary in an electric car. Please correct me if I am wrong.

The README has this text:

For example, if you are using a recent version of OpenSSH, you may wish to explore using the ServerAliveInterval and ServerAliveCountMax options to have the SSH client exit if it finds itself no longer connected to the server. In many ways this may be a better solution than the monitoring port.

I helped build a tar-backed filesystem for MirageOS[0]. It is definitely easiest to make it append-only. I did add in-place renaming, updates (of file content), pre-allocating a file and removing the last file.

We also scan the filesystem on boot and keep a mapping in-memory of file names to file metadata and block offsets, and update this memory representation when modifying the on-disk tar filesystem. If you have a lot of small files this is maybe not a great idea as you will be storing most in memory, though.

For the purpose we had in mind it worked fine: A content addressable mirror of package archives. The archives exist somewhere on the web and the package file has a link to the archive and a checksum. We can then download the package and store it by the checksum. This gives integrity that the tar filesystem does not offer. Removing the last file works great if you only have one download job. Otherwise if a download fails and it is not the latest file you can rename it to `failed/<hash>-<random>` and do garbage collection in the filesystem at a later point.

[0] https://github.com/mirage/ocaml-tar/blob/main/mirage/tar_mir...

Update: interestingly, this was motivated after trying to use a (mostly) LittleFS-compatible filesystem which unfortunately didn't work very well for us at the time (bugs, poor performance).

A big difference in my opinion is that projects like Mirage does not try to reimplement the same hardware drivers as the host system and instead implements much simpler drivers for virtual hardware.

For example, how do you write to a block device? You make a hypercall with a "handle", offset into the block device, the number of blocks to write and a pointer to memory to be written. There's no pretending it's a spinny disk with sectors and heads or what have you.

https://github.com/Solo5/solo5/blob/bf29b8af11feec9dbc2e74cc...

Try OCaml 8 years ago

No, Reason's actual name is Reason. The Reason ML name is similar to Go's "golang" name -- to work around the SEO nightmare the choice of the name really is. Your comment is otherwise correct in that Reason is an alternative syntax for good 'ole OCaml.

Also I think the name 'sum type' is bad.

The intuition is that for each types A and B with number of elemnts |A| and |B| the sum type A+B has number of elements |A|+|B|.

I find that the problem with the ternary operator isn't the operator itself per se, but the concrete syntax. If you could write it

    result = if boolean_flag
        then do_this()
        else do_that();
then I'm sure no one would find it as bad as they do now. The way you formatted the ternary with line-breaks helps a lot, too, I think!