https://github.com/kulp/tyrga
Translate a useful subset of JVM bytecode to tenyr assembly
https://github.com/kulp/tyrga
jvm jvm-bytecode tenyr
Last synced: 12 months ago
JSON representation
Translate a useful subset of JVM bytecode to tenyr assembly
- Host: GitHub
- URL: https://github.com/kulp/tyrga
- Owner: kulp
- Created: 2018-04-14T03:08:01.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-31T11:31:37.000Z (over 1 year ago)
- Last Synced: 2025-02-08T22:15:44.424Z (about 1 year ago)
- Topics: jvm, jvm-bytecode, tenyr
- Language: Rust
- Homepage:
- Size: 1.12 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tyrga README
[](https://github.com/kulp/tyrga/actions/workflows/rust.yml)
tyrga is a project to translate [Java Virtual Machine] bytecode into [tenyr assembly], in order to provide high-level language support on the [tenyr] CPU.
Like tenyr, tyrga is a personal project meant for didactic use. It should not be used to do real work, but it aspires to be fun and educational.
[Java Virtual Machine]: https://en.wikipedia.org/wiki/Java_virtual_machine
[tenyr assembly]: https://github.com/kulp/tenyr/wiki/Assembly-language
[tenyr]: https://github.com/kulp/tenyr
## Status
The capability envelope is defined by the [test suite], which demonstrates both Java-language capabilities (like [static blocks] or [switches]) and algorithms (like [GCD] or a [sieve of Eratosthenes]).
Many capabilities of the JVM remain unimplemented, including basic things like memory allocation (although [references to allocation][allocation] can be translated).
[test suite]: https://github.com/kulp/tyrga/tree/develop/test
[static blocks]: https://github.com/kulp/tyrga/blob/develop/test/Static.java
[switches]: https://github.com/kulp/tyrga/blob/develop/test/Switch.java
[GCD]: https://github.com/kulp/tyrga/blob/develop/test/GCD.java
[sieve of Eratosthenes]: https://github.com/kulp/tyrga/blob/develop/test/Sieve.java
[allocation]: https://github.com/kulp/tyrga/blob/develop/test/Allocate.java
## Basic Usage
The `tyrga-cli` binary drives the `tyrga-lib` library. The main entry point is `tyrga-cli translate`, which takes Java 11-compatible `.class` files on input and produces `.tas` output files.
javac --release 11 -g:none test/Sieve.java
tyrga-cli translate --output test/Sieve.tas test/Sieve.class
Compare [`Sieve.java`](https://github.com/kulp/tyrga/blob/develop/test/Sieve.java) and [`Sieve.tas`](https://github.com/kulp/tyrga/blob/develop/test/Sieve.tas).