jmeaster30 / ocean

A C-like programming language (get it like sea-like like an ocean lol)
GNU General Public License v3.0
0 stars 0 forks source link

Variable arguments?? #87

Open jmeaster30 opened 11 months ago

jmeaster30 commented 11 months ago

Currently you can only get a limited number of arguments in a function at a time but I can imagine some functions that would need a variable number of arguments

jmeaster30 commented 11 months ago

I think this may require only having one stack between function calls instead of creating a new stack for each call. This would allow us to consume as much of the stack as a function needs and can even have functions that add more than one thing to a stack at a time.

This may also give a small speed up since we don't have to clone the execution context to make it a parent of the next one. It just becomes a stack of instruction pointers and everything exists in a single execution context.

I want to get some code analysis like stack overflow issues check though and this might make it more difficult