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

Optimization: static conditionals should modify code #14

Closed
velipso opened this issue Jan 5, 2017 · 3 comments
Closed

Optimization: static conditionals should modify code #14

velipso opened this issue Jan 5, 2017 · 3 comments

Comments

@velipso
Copy link
Owner

velipso commented Jan 5, 2017

Something like this:

if 1
    say 'hi'
end

Should transform to:

do
    say 'hi'
end

I would just do this now, but there is additional complexity dealing with elseif and else.

@velipso
Copy link
Owner Author

velipso commented Jan 5, 2017

The hard part about this is that I can't remove the code quickly. I still have to evaluate it at compile-time for correctness. That's very annoying, since correctness is done during code generation.

@velipso velipso changed the title Optimization: static conditionals should propagate Optimization: static conditionals should modify code Jan 6, 2017
@velipso
Copy link
Owner Author

velipso commented Apr 5, 2017

Also, goto needs to be taken into account:

if nil
    label:
    say 'hi'
end
goto label

@velipso velipso added the wontfix label Aug 2, 2017
@velipso
Copy link
Owner Author

velipso commented Aug 2, 2017

Skipping this, too complicated, and not convinced this is actually useful for small scripts in the first place.

@velipso velipso closed this as completed Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant