← All projects
Project record1 mention
Originally shared on Hacker News

Porting Ruby to Fil-C

This project ports the Ruby programming language to Fil-C. Ruby's codebase uses a `typedef uintptr_t VALUE` that can hold a heap pointer, a tagged Ruby value, or any integer fitting in uintptr_t, while Fil-C doesn't allow pointers to be carried as integers without losing their capabilities. Since VALUE variables are also used for integer and bit math, the port requires a nontrivial patch to Ruby and is about 70% complete.

Last shared
01 / The problem

What it addresses

Fil-C doesn't allow pointers to be carried as integers (doing so makes pointers lose their capabilities), but Ruby's uintptr_t VALUE type conflates heap pointers, tagged values, and integers, so changing it isn't as simple as switching to a pointer type.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Porting Ruby to Fil-C

    This project ports the Ruby programming language to Fil-C. Ruby's codebase uses a `typedef uintptr_t VALUE` that can hold a heap pointer, a tagged Ruby value, or any integer fitting in uintptr_t, while Fil-C doesn't allow pointers to be carried as integers without losing their capabilities. Since VALUE variables are also used for integer and bit math, the port requires a nontrivial patch to Ruby and is about 70% complete.

    Problem: Fil-C doesn't allow pointers to be carried as integers (doing so makes pointers lose their capabilities), but Ruby's uintptr_t VALUE type conflates heap pointers, tagged values, and integers, so changing it isn't as simple as switching to a pointer type.

    Posted by @pizlonator · Original source ↗

    Source text · @pizlonator · · Source ↗

    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`