Skip to content

feat(jit): implement a bytecode VM#5

Draft
TogarashiPepper wants to merge 56 commits into
mainfrom
bytecode-vm
Draft

feat(jit): implement a bytecode VM#5
TogarashiPepper wants to merge 56 commits into
mainfrom
bytecode-vm

Conversation

@TogarashiPepper
Copy link
Copy Markdown
Owner

@TogarashiPepper TogarashiPepper commented Jul 24, 2024

Currently the interpreter is very slow, to the point of it being really bad for anything that isn't simple. Computing fib(25) (with the recursive approach) takes ~52.5ms with node.js but in the koan interpreter it takes ~188.2ms. Hopefully a bytecode VM will help

TODO List:

  • >90% test coverage on all files, 100% function coverage
  • Reuse ExprPool in the REPL (have a global pool?)
  • Make TokenStream own its ExprPool
  • Implement variable semantics
  • Implement function definitions
  • Implement function calls
  • use type checker and make test cases for it
  • make arrays homogenous
  • make arrays SIMD'd
  • improve how value::{add, sub, mul, etc} are implemented (since theyre super messy rn)

@TogarashiPepper
Copy link
Copy Markdown
Owner Author

Pivoting from VM to llvm JIT because I think it's feasible and we'd get all the llvm optimizations "for free"

@TogarashiPepper TogarashiPepper changed the title feat(vm): implement a bytecode vm for evaluation feat(jit): implement a JIT with llvm and inkwell Jul 26, 2024
@TogarashiPepper
Copy link
Copy Markdown
Owner Author

update: it was very much not "for free"

@TogarashiPepper TogarashiPepper changed the title feat(jit): implement a JIT with llvm and inkwell feat(jit): implement a JIT with Cranelift Nov 24, 2024
@TogarashiPepper TogarashiPepper marked this pull request as ready for review November 24, 2024 19:34
@TogarashiPepper TogarashiPepper marked this pull request as draft November 24, 2024 19:34
@TogarashiPepper TogarashiPepper changed the title feat(jit): implement a JIT with Cranelift feat(jit): implement a bytecode VM Feb 17, 2025
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

Successfully merging this pull request may close these issues.

1 participant