buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.16k stars 32 forks source link

Functional helpers #110

Closed giann closed 10 months ago

giann commented 1 year ago

Not a fan of this but, provided those are written in zig, they could offer a much faster way of doing stuff over lists and maps. This requires a buzz_api helper which runs a buzz function. So running a VM loop in that helper.

[int] mylist = [1, 2, 3];

mylist.forEach(fun (int el) -> print(el));

mylist.map(<str>, fun (int el) -> "{e}");

| etc.