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

Loader transform engine #14

Open
archseer opened this issue Jan 25, 2019 · 1 comment
Open

Loader transform engine #14

archseer opened this issue Jan 25, 2019 · 1 comment
Labels
K-enhancement Kind: New feature or request L-hard Level: hard

Comments

@archseer
Copy link
Owner

Beam implements a transform engine that transforms beam opcodes during the load phase, that way they can implement optimizations that are independent of the OTP version.

https://github.com/erlang/otp/blob/master/erts/emulator/internal_doc/beam_makeops.md

The problem is, it's a large perl script that generates a bunch of C arrays. The loader then uses that array as a series of simple instructions in state machine. The state machine part should be easy, for the generator, we might just fork the perl script to generate rust arrays. Or implement some form of a rust codegen.

https://github.com/erlang/otp/blob/49eb25c80514b1e221cc516c423bbc45ba7cc107/erts/emulator/beam/beam_load.c#L5207

This is a time consuming issue, but will yield a lot of performance improvements (optimize bif calls, instruction combining, etc).

@archseer archseer added K-enhancement Kind: New feature or request L-hard Level: hard K-research This topic is still being researched labels Jan 25, 2019
@archseer
Copy link
Owner Author

archseer commented Jun 4, 2019

Work has started via proc_macro in https://github.com/archseer/enigma/tree/transform-engine

@archseer archseer removed the K-research This topic is still being researched label Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
K-enhancement Kind: New feature or request L-hard Level: hard
Projects
None yet
Development

No branches or pull requests

1 participant