Hacker News new | ask | show | jobs
by FBMachine 2697 days ago
Hi Chris, thanks for checking it out. The first code push for Bon was today, so many things are of course rough around the edges.

Memory will be garbage collected, though I am aiming for zero-cost as much as possible. At the moment it just leaks memory like a sieve as I work out the semantics.

You can indeed import standard c library calls by using a cdef. You can find examples in the stdlib, e.g.:

cdef sqrt(x:float) -> float

Thanks again for taking a look!

3 comments

I am happy you posted early when things are still fluid.

A fast scripting language that is not a PITA, and not tied to a proprietary ecosystem, could carve out a place.

But please ensure that something like destructors remain possible and uncrippled. There are so many more kinds of resources to manage than memory, and we are beginning to accumulate many kinds of memory, too. When you have a solution for general resource management, memory management itself becomes a trivium, or gets locally tunable.

What is "zero-cost" garbage collection?
I've seen both Rust's lifetimes/borrow-checker and Objective-C/Swift's automatic reference counting described as "zero cost" (since the bulk of the work is done at compile time).
Rust's borrow checker is zero-cost because it's not doing runtime analysis. But it's not a garbage collector, unless you're using Steve Klabnik's "static garbage collector" terminology [1]. Reference counting is definitely not zero cost. It reduces GC runtime latency for most workloads, but not to zero, and it does so at the cost of reduced bandwidth.

1: https://words.steveklabnik.com/borrow-checking-escape-analys...

For interesting ideas in compile-time automatic memory management be sure to check out Wouter van Oortmerssen's approach as well:

https://lobste.rs/s/lp0lou/rust_programming_language_seven_r...