Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fvm-project/fvm
A Clojure library for writing self-optimizing interpreters
https://github.com/fvm-project/fvm
clojure interpreter jit tracing vm
Last synced: 3 months ago
JSON representation
A Clojure library for writing self-optimizing interpreters
- Host: GitHub
- URL: https://github.com/fvm-project/fvm
- Owner: fvm-project
- License: epl-2.0
- Created: 2020-05-24T17:01:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T10:48:13.000Z (over 4 years ago)
- Last Synced: 2024-08-03T13:04:39.795Z (6 months ago)
- Topics: clojure, interpreter, jit, tracing, vm
- Language: Clojure
- Homepage:
- Size: 85.9 KB
- Stars: 29
- Watchers: 5
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fvm [![Clojars Project](https://img.shields.io/clojars/v/fvm-project/fvm.svg)](https://clojars.org/fvm-project/fvm)
**fvm** is a Clojure library for writing self-optimizing interpreters.
## How it works
fvm provides a function called `defnode` for defining instruction nodes with the following signature:
```clojure
(fvm/defnode )
```- any node with the option `{::fvm/jit? true}` is considered a loop
- if such a node is executed frequently enough, its next execution is put in "trace-mode"
- in trace-mode, all the sub-nodes executed are logged in a "trace"
- the trace is effectively an unrolled version of the loop with function calls inlined
- once the node finishes executing, this trace is "compiled" into a Clojure function
- the compiled version is used on future executions of this node## Examples
[ednlang](https://github.com/fvm-project/ednlang) is a simple stack-based concatenative language implemented using fvm.
ednlang is meant to showcase all the features of fvm, and is also used to test and profile fvm.
Work is ongoing to implement a lisp on top of fvm.
## Status
This is **EXPERIMENTAL** software. Here be dragons.
## License
Copyright © 2020 Divyansh Prakash
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License, v. 2.0 are satisfied: GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or (at your
option) any later version, with the GNU Classpath Exception which is available
at https://www.gnu.org/software/classpath/license.html.