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

Duduplicate character literal variables and RT_USE_LOOKUP_TABLE lookup table #128

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

laurenthuberdeau
Copy link
Collaborator

Context

Fixes #86

Deduplicating character literal variables achieves 3 things:

  • Smaller and easier to read code (going from 7278 LOC to 7190 LOC in pnut-sh.sh).
  • Faster bootstrapping because less code needs to be generated.
  • Reduces the number of variables in the environment, speeding up execution on certain shells.

The text concatenation code was interspersed with
other things in sh.c, and having it in its own
file makes the code cleaner.
In the next commit, the sh-runtime will use the
codegen context so it needs to be placed after its
declaration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duduplicate character literal variables and RT_USE_LOOKUP_TABLE lookup table
1 participant