flofriday / Moose

🐐 A new fun programming language
MIT License
6 stars 1 forks source link

Interpreter segfaults with recursion. #14

Closed flofriday closed 1 year ago

flofriday commented 2 years ago

This code segfaults on my machine.

func recTill(n: Int) {
    if n <= 0 {
        return        
    }

    recTill(n-1)
}

recTill(10000)

So, I don't quite know why it does this, if this just how Swift handles recursion? I didn't even know Swift code can segfault, thats just such an ungraceful way.

flofriday commented 1 year ago

I don't think we can solve this, all I could find on the internet is that this is just how stackoverflows are handled.