ark-lang / ark

A compiled systems programming language written in Go using the LLVM framework
https://ark-lang.github.io/
MIT License
682 stars 47 forks source link

Compiler infinitely looping in codegen #724

Closed felixangell closed 8 years ago

felixangell commented 8 years ago

Either that or it hangs, haven't really looked into it. Here's the commit. Basically I accidentally wrote a recursive function, and it's stuck in codegen.

kiljacken commented 8 years ago

Recursive generic function. I know where it probably happens but I'm not sure I have the willpower to handle more generic issues currently lol

On Wed, Mar 2, 2016, 22:39 Felix Angell notifications@github.com wrote:

Either that or it hangs, haven't really looked into it. Here's the commit https://github.com/ark-lang/ark/commit/524330fe5a7f9e73569ff20b2c50170592b89bc7. Basically I accidentally wrote a recursive function, and it's stuck in codegen.

— Reply to this email directly or view it on GitHub https://github.com/ark-lang/ark/issues/724.

kiljacken commented 8 years ago

As of 3d064e7 one part of this has been fixed. The rest is a problem with the name mangling. I honestly do not get the interaction between TypeParameter, GenericContext and the mangling, so I'm hoping @MovingtoMars might see something I do not.

kiljacken commented 8 years ago

18:53:28 kiljacken: i think it's when the type parameter somehow doesn't resolve in the generic context 18:53:34 kiljacken: and then it just returns the old parameter 18:53:53 kiljacken: and then it tries mangling that, fails to resolve, etc

kiljacken commented 8 years ago

Happens here: https://github.com/ark-lang/ark/blob/a39a6c5b2c55ece10b8085faf97c0b7f7a0c8b3a/src/ast/mangle.go#L96