-
Notifications
You must be signed in to change notification settings - Fork 137
GSoC 2025 - Macro support for teal #1040
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shrinks teal/precompiled/default_env.lua
from 189928 to 100747 bytes.
Compilation times for `tl check hello.tl`
(where `hello.tl` is `print("hello")`,
i.e. measuring compiler baseline overhead)
* master: 21.1 ms
* original precompiler: 15.9 ms
* revised precompiler: 13.9 ms
It was getting unwieldy. Move the more involved logic to an `extras/make.sh` Bash script, which I tried to make as readable as possible.
They are now plain .d.tl files, and in `new_env` (which is currently the "manual" environment builder), they are loaded using the standard require_module mechanism, same as the other predefined_modules (or any other uses of `require` by Teal code, really!) Of course, `environment.default` now uses the precompiled one. And yes, this is an experiment in the direction of perhaps someday providing a precompiled type definition facility for all modules, aiming to speed up compilations. This has the difficulty that the Teal environment currently relies on globally unique numeric typeids. We'd have to switch to a name-based system with a linking step. (The standard library can get away with this because it is always the first module on an empty environment, so I can reliably start my typeid count from 1.)
Also, we can now run the Makefile bootstrapping using the Teal binary, like so: ``` extras/binary.sh make STABLE_TL=_binary/build/tl ```
Useful for development.
Mega commit because I fully messed up my local git and so I had to re-clone and just copy my files over. Failing tests are mostly with the new comment retention which need to be added later
forgot to include in last commit
```lua
local x = `local $y = "hi"`
```
to
```lua
local x = { kind = "local_declaration", { kind = "identifier", clone(y) } }
```
etc
This was previously done in the luagen phase which was incorrect.
|
Teal Playground URL: https://1040--teal-playground-preview.netlify.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements macro support for Teal.
Project Proposal