Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foonathan/lauf
Bytecode interpreter
https://github.com/foonathan/lauf
Last synced: 8 days ago
JSON representation
Bytecode interpreter
- Host: GitHub
- URL: https://github.com/foonathan/lauf
- Owner: foonathan
- License: bsl-1.0
- Created: 2022-05-04T15:19:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T16:07:38.000Z (7 months ago)
- Last Synced: 2024-10-26T23:55:35.465Z (25 days ago)
- Language: C++
- Homepage:
- Size: 1.19 MB
- Stars: 68
- Watchers: 11
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
- awesomecpp - lauf - - bytecode interpreter. (Scripts)
README
= lauf
ifdef::env-github[]
image:https://img.shields.io/endpoint?url=https%3A%2F%2Fwww.jonathanmueller.dev%2Fproject%2Flauf%2Findex.json[Project Status,link=https://www.jonathanmueller.dev/project/]
image:https://github.com/foonathan/lauf/workflows/CI/badge.svg[Build Status]
endif::[]lauf is work-in-progress bytecode interpreter with a C API.
It is currently highly unstable, not ready for production use, and does not support anything other than a recent clang and Linux.== Features
* Stack based bytecode API.
* Designed to quickly generate bytecode and execute it; suitable for e.g. evaluating `constexpr` functions in a C++ compiler.
* Extensible instruction set via `lauf_builtin`: things like `add` can be defined with your own semantics (e.g. overflow behavior).
* Support for fibers: cooperative user threads to implement stackful coroutines and generators.
* Fully sandboxed VM that supports low-level operations like pointer arithmetic.== FAQ
How fast is it?::
On an M1 processor, recursive `fib(35)` takes about 325ms while the luajit interpreter (without JIT) takes about 535ms.
Proper benchmarks are TODO.Does it support just-in-time compilation?::
Currently, no.
I have started implementing it, but it's a lot of work, and I'll focus on adding features first.Why is it called lauf?::
"Lauf!" is German for "Run!" and lauf runs bytecode.== Documentation
Currently no documentation besides header comments.
Everything should be considered unstable.