Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement nested scopes #8

Open
c3d opened this issue Feb 7, 2020 · 1 comment
Open

Implement nested scopes #8

c3d opened this issue Feb 7, 2020 · 1 comment

Comments

@c3d
Copy link
Owner

c3d commented Feb 7, 2020

The documentation now describes scoping rules which are currently, for the most part, not implemented.

The Tao3D compiler was notoriously bad at scoping, sometimes leaking definitions in the enclosing scope in order to workaround limitations with the LLVM code generation used at the time. Nesting should now be possible, although some special care must be taken with respect to how variables from the enclosing context are accessed by the inner context. I believe that LLVM should be supporting that since the dialect of C / C++ that GNU support does support nested functions, but I have not studied yet how this is represented at the LLVM IR level yet.

Symbol lookup is presently relatively well scoped, but additional testing is needed. Nested scope might even be working correctly in the interpreter.

@c3d c3d added this to In progress in Language update Feb 7, 2020
@fnune
Copy link

fnune commented Sep 7, 2020

I'm trying to make some progress with the problem of implementing nested scopes in my own programming language as a learning project. If you're interested in joining the discussion, here it is: fnune/vampa#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Language update
  
In progress
Development

No branches or pull requests

2 participants