https://github.com/pisaiah/java2v
A Java to V translator/transpiler.
https://github.com/pisaiah/java2v
java java2c transpiler v vlang vlang-module
Last synced: 5 months ago
JSON representation
A Java to V translator/transpiler.
- Host: GitHub
- URL: https://github.com/pisaiah/java2v
- Owner: pisaiah
- Created: 2021-02-19T12:44:11.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-03-18T23:06:30.000Z (about 4 years ago)
- Last Synced: 2023-09-09T00:36:19.568Z (almost 3 years ago)
- Topics: java, java2c, transpiler, v, vlang, vlang-module
- Language: Java
- Homepage: https://isaiahpatton.github.io/java2v/
- Size: 1.05 MB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Java2V   [](https://patreon.com/isaiahp)
Java2V Transpiler (J2V) provides the ability to transpile Java source into human-readable V that can be compiled using V's C, or Javascript backends.
A subset of the Java Class Library *([See docs](https://isaiahpatton.github.io/java2v/))* is also implemented for use.
## Example
Input:
```java
public static void main(String[] args) {
File file = new File("data.txt");
System.out.println("File name: " + file.getName());
List content = Files.readAllLines(file.toPath());
for (String line : content) {
System.out.println(line);
}
}
```
Output:
```v
fn main() {
mut file := io.file("data.txt")
println("File name: " + file.get_name())
mut content := nio.read_all_lines(file.to_path())
for mut line in content {
println(line)
}
}
```
## Repo Structure
There are two modules in this repository.
- ``jcl/`` - Classes from the [Java Class Library](https://docs.oracle.com/javase/8/docs/api/) reimplemented in V.
- ``src/`` - Main transpiler source.