Fler ➚ is the working name for a yet-nonexistent general-purpose linearly-typed programming language. It comes from the Romanian word fler meaning something like perceptiveness. I don’t necessarily think it has much to do with the subject-at-hand, but I needed a name and this word was once word of the day ➚.
Fler isn’t unique in any one way – instead, it tries to be a well-thought-out combination of things:
Like Austral, Fler will have the option of linear types alongside regular “free” types.
// This doesn't work
thing := allocate_thing()
perform_calculations(thing)
perform_additional_calculations(thing) // Error: thing was moved out.
// Neither does this
thing := allocate_thing()
thing := perform_calculations(thing)
thing := perform_additional_calculations(thing)
// Error: thing left the scope
// This does though
thing := allocate_thing()
thing := perform_calculations(thing)
thing := perform_additional_calculations(thing)
destroy_thing(thing)
This trivially prevents use-after-frees and double-frees, at the expense of forcing hierarchical memory management. Rust ➚ uses references and explicit lifetimes to ease this restriction, but Fler won’t have them because they’re quite difficult to reason about. Instead, Fler will have second-class references that can be passed down, but not up, the stack. This forces references to also be hierarchical, but that’s fine.
More interesting memory management can be done in userland, where strongly-typed index types should be enough. This is also very common in Rust.
The remaining question is around concurrency. Rust does complicated things to make this possible, but I’m leaning towards Go-like channel-based communication.