A simplified model of Fil-C (corsix.org)

by aw1621107 136 comments 208 points
Read article View on HN

136 comments

[−] hsaliak 27d ago
I made https://github.com/hsaliak/filc-bazel-template bazel target for people who may want to use these two together to make hermetic builds with it.
[−] avadodin 27d ago
It could be a fun exercise to add invisicaps to something like chibicc/slimcc.

It leaves room for experimentation with reference counting and variations on the invisible capability system which could provide memory savings at the expense of some extra indirection.

[−] quotemstr 26d ago
Fil-C is not memory safe under data races. The capability and pointer values tear under assignment, which means that if you get the wrong thread interleaving, you can access an object through a wrong pointer, causing arbitrary program misbehavior.

This limitation would be fine if Fil-C proponents (including its author) didn't try to shout down anyone pointing out this limitation.

[−] cyberax 26d ago
It is, because it uses atomic ops. It is one of the main sources of overhead, unfortunately.
[−] teo_zero 27d ago
Could anyone understand what this sentence means?

> Upon freeing an unreachable AllocationRecord, call filc_free on it.

I think the intention was to say: before freeing an unreachable AR, free the memory pointed to by its visible_bytes and invisible_bytes fields.

[−] whatsakandr 27d ago
Fil-C is one of the most underrated projects I've ever seen. All this "rewrite it in rust for safety" just sounds stupid when you can compile your C program completely memory safe.
[−] vzaliva 27d ago
This is yet another variant of the "fat pointers" technique, which has been implemented and rejected many times due to either insufficient security guarantees, inability to cross non-fat ABI boundaries, or the overhead it introduces.