HNHacker News
TopNewBestAskShowJobs

FBMachine

49 karma · joined January 23, 2019

submissionscomments
FBMachine··on Show HN: Bon – programming language designed for simplicity, performance, safety
For those who had questions about how memory is to be managed, the documentation for that work is being tracked here:

https://github.com/FBMachine/bon/blob/auto_mem/docs/ch02-01-...

Thanks for all of the feedback!

FBMachine··on Show HN: Bon – programming language designed for simplicity, performance, safety
Yeah, 'class' in Bon defines a typeclass. While I plan on adding x.norm() as syntactic sugar for norm(x), typeclasses in general are a bit more flexible. For example, while you can use it for polymorphic operator overloading [0], you can also overload a function by changing the types of multiple parameters [1] (as in multiple dispatch).

[0] https://github.com/FBMachine/bon/blob/master/examples/equali...

[1] https://github.com/FBMachine/bon/blob/master/examples/multip...

FBMachine··on Show HN: Bon – programming language designed for simplicity, performance, safety
Thanks for checking it out. They are currently implemented similarly to OCaml, so yes they are linked lists.

This was purely for simplicity (they can be implemented in a couple of lines of code with algebraic data types). Simplicity of implementation is certainly not my priority, just a short term drive, so it will be revisited in the near future.

Thanks!

FBMachine··on Show HN: Bon – programming language designed for simplicity, performance, safety
Hi Charles,

That's a fair comment. I will say however that the references to performance are more an attempt to keep it in mind from the beginning, rather than being an assertion at this point. I only began working on it shortly after my mom passed away last month (it's dedicated and named after her), so at this stage I'm mostly goal setting and rapidly prototyping.

I hope you can take time to give it another look when its further along. Thanks!

FBMachine··on Show HN: Bon – programming language designed for simplicity, performance, safety
Thanks, I really appreciate it!
FBMachine··on Show HN: Bon – programming language designed for simplicity, performance, safety
I wouldn't call it an extension, but I did use the tutorial to quickly prototype from. There are still some remnants left in the code, but I don't expect much if any to be left in the near future.
FBMachine··on Show HN: Bon – programming language designed for simplicity, performance, safety
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!