Comment by pizlonator

1 day ago

Porting Ruby to Fil-C

It's very interesting because the Ruby codebase uses a `typedef uintptr_t VALUE` type to mean any of the following:

- A pointer to the heap

- A Ruby tagged value (which may be a pointer to the heap)

- Any integer value that fits in `uintptr_t`

Fil-C doesn't allow you to carry around pointers using integers, in the sense that when you do that, the pointers lose their capabilities.

But in Ruby's case, it's not as simple as changing the typedef to a pointer type, since `VALUE` variables often end up being used for integer math (including bit math, shifts, etc).

So, it's going to take a nontrivial patch to Ruby to get it to work in Fil-C. I think I'm about 70% of the way through (I started Friday afternoon).