Better HN
topnewbestaskshowjobs
Log inSign up

FBMachine

49 karma · joined Jan 23, 2019 (7y ago) · 8 submissions

Submissions

comment 7y ago · link · parent

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!

comment 7y ago · link · parent

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...

comment 7y ago · link · parent

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!

comment 7y ago · link · parent

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!

comment 7y ago · link · parent

Thanks, I really appreciate it!

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

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!

8.

Show HN: Bon – programming language designed for simplicity, performance, safety(github.com ↗)

99 points · by FBMachine · 7y ago · 35 comments