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

Investigate feasability of bytecode backend #220

Open
lthls opened this issue Jul 23, 2020 · 0 comments
Open

Investigate feasability of bytecode backend #220

lthls opened this issue Jul 23, 2020 · 0 comments

Comments

@lthls
Copy link

lthls commented Jul 23, 2020

A number of optimisations are done in lambda/simplif.ml because we want them to apply to the bytecode compiler too.
It would make sense to use flambda instead to generate the bytecode.
Expected issues:

  • Symbols do not exist in bytecode. Some of them can be compiled to constants, but not all of them (and most importantly, not closures)
  • The code in Closure_conversion.close_c_call needs to use the correct primitive (and calling convention)
  • Cmx files must not be emitted. They shouldn't be read either (because they would have been emitted for a native backend, so calling conventions for C primitives would be different), but it might be feasible to introduce a new file extension (.cmxo?) to hold the equivalent of cmx files for bytecode compilation, or to put it in an optional field of the cmo.

Although the Lambda language doesn't have any notion of closures, the bytecode language (described in bytecomp/instruct.ml) does, so separation of code IDs and closures is not a problem.

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

No branches or pull requests

1 participant