HigherOrderCO / Bend

A massively parallel, high-level programming language
https://higherorderco.com
Apache License 2.0
17.37k stars 429 forks source link

Questions regarding keywords #376

Open janroden opened 5 months ago

janroden commented 5 months ago

This looks like a really cool project!

I just read through the guide, and really liked the writing style :)

At a few points, I was curious, would love to learn more about:

Bending is the opposite of folding. Whatever fold consumes, bend creates. The idea is that, by defining an initial state and a halting condition, we can "grow" a recursive structure, layer by layer, until the condition is met.

Here I was wondering why bend was chosen as a keyword? Given the above explanation, wouldn't something like spread, unfold, or grow be more intuitive then? Or are there other use cases not covered in the guide, where bend makes more sense as a keyword? Or is there some history from other languages?

case Shape/Circle:

Was curious why / was chosen for these kinds of namespaces / variants, instead of e.g. the :: like in Rust? Since normally / is used for division?

Bend comes with 3 built-in numeric types: u24, i24, f24. That's quite small, we admit. Soon, we'll have larger types.

Is there already a plan for how other types, e.g. u32, will be indicated? Will there be something like Rust-like type annotations?

Thank you! I'm looking forward to where this project is going :)

developedby commented 5 months ago
janroden commented 5 months ago

Thanks a lot for the detailed explanations! :-)

Maybe adding your explanation of fork to the guide, where it's first used, would make it a bit clearer?

Kesanov commented 5 months ago

I also vote for enum similar to rust enum. But prefer data instead of object similar to python and kotlin dataclass.

Object and Type are extremely abstract keywords that suggest nothing about actual functionality. Even worse, type is also technically incorrect use of the term.

developedby commented 5 months ago

I'll leave this issue open as a task to improve the initial explanation of 'fork'