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

[Feature] Ship preparsed stdlib #524

Open
b1ek opened this issue Oct 21, 2024 · 1 comment
Open

[Feature] Ship preparsed stdlib #524

b1ek opened this issue Oct 21, 2024 · 1 comment
Labels
compiler enhancement New feature or request stdlib

Comments

@b1ek
Copy link
Member

b1ek commented Oct 21, 2024

Is your feature request related to a problem? Please describe.
this is mainly to speed up performance in debug mode, but it will optimize away some milliseconds in production:

[Tokenize]      in      1ms     std/array
[Tokenize]      in      10ms    std/date
[Tokenize]      in      15ms    std/env
[Tokenize]      in      3ms     std/fs
[Tokenize]      in      17ms    std/text
[Tokenize]      in      1ms     std/http
[Tokenize]      in      1ms     std/math
                ∑       48ms

the development unoptimized build is totally unreasonable:

[Tokenize]      in      9ms     test.ab
[Tokenize]      in      177ms   std/array
[Tokenize]      in      2733ms  std/date
[Tokenize]      in      4739ms  std/env
[Tokenize]      in      692ms   std/fs
[Tokenize]      in      6578ms  std/text
[Tokenize]      in      155ms   std/http
[Tokenize]      in      182ms   std/math
                ∑       15.2s

Describe the solution you'd like
pretokenize stdlib before compiling it in

probably will require to split away the compiler from cli, i dont think there is a way to use regular rust code in macros or from the same crate in build.rs

Additional context
definetely will require amber-lang/heraclitus#66

@b1ek b1ek added enhancement New feature or request stdlib compiler labels Oct 21, 2024
@b1ek
Copy link
Member Author

b1ek commented Oct 21, 2024

i would've used MessagePack to serialize the parsed stdlib. i don't see a reason to use JSON as it will be completely unreadable anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler enhancement New feature or request stdlib
Projects
None yet
Development

No branches or pull requests

1 participant