terralang / std

A repository to store code implementing common features, algorithms, and datastructures that are generally useful to terra code
MIT License
21 stars 7 forks source link

What should a standard library include? #2

Open capr opened 5 years ago

capr commented 5 years ago

I think there needs to be a "tier-0" lib that all other libs would depend upon. This is the lib that defines a common (preferably flat) vocabulary of the most basic tools. Unfortunately, getting two people to agree upon what exactly those tools are and what names to give them is usually very hard. OTOH, I find that not having this vocabulary makes writing any code very tedious as one has to reinvent all these little wheels all the time.

Here's my own "tier-0" stdlib: https://github.com/luapower/low/blob/master/low.t -- it contains symbols for both Lua and Terra runtimes (some names even overlap, like assert() and print()). We could maybe use it as a starting point to decide what we want to include? I have one for Lua too, just for comparison: https://luapower.com/glue

Possible stuff that comes to mind as tire-1 libs:

aiverson commented 5 years ago

I think we should also have

Longer term, a nice library of recursion schemes and monadic tools would be helpful, but that is difficult to make immediately.