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

add bytecode compiler and vm #77

Merged
merged 1 commit into from Jun 7, 2018
Merged

Conversation

matsud224
Copy link
Contributor

This pull-request adds a bytecode compiler and a virtual machine.
SATySFi interpreter is slow(see #63). This bytecode compiler improves an evaluation performance.
For example, it takes about 90 minutes to make a pdf of pi on my laptop by
the interpreter. By using the bytecode compiler, it only takes about 4 minutes.
The bytecode compiler can coexist with interpreter. You can use it by adding --bytecomp command line option.

To build the virtual machine, a Ruby script 'gen_code.rb' is used. This script reads 'src/frontend/bytecomp/vminstdef.yaml' and generates OCaml codes.
'vminstdef.yaml' is written in YAML format and contains instruction & primitive definitions. This mechanism makes it easier to add a new VM instruction or primtive. But now, interpreter and virtual machine are not share the code. Therefore you have to update both an interpreter and a virtual machine if you modify evaluator or add a new primitive.

@gfngfn gfngfn merged commit a89be38 into gfngfn:master Jun 7, 2018
@gfngfn
Copy link
Owner

gfngfn commented Jun 7, 2018

Thank you so much for sending a really amazing PR! I confirmed that the compiler and the VM work fine. I merged the PR after making the interpreter and the VM share some duplicate code and the definition of primitive operations.

@matsud224 matsud224 deleted the bytecomp-pr branch June 28, 2018 12:36
@matsud224 matsud224 restored the bytecomp-pr branch June 28, 2018 12:36
@matsud224 matsud224 deleted the bytecomp-pr branch June 28, 2018 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants