Skip to content

Commit 7509828

Browse files
committed
Updated README and added Hadoop testing script
1 parent 3bc7ae5 commit 7509828

File tree

4 files changed

+38
-26
lines changed

4 files changed

+38
-26
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ j2eo.jar
77
output.eo
88
output_eo
99
polystat_check
10+
/hadoop/
11+
/output_hadoop/

README.md

+17-26
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<img src="https://www.yegor256.com/images/books/elegant-objects/cactus.svg" height="100px" alt="eolang icon"/>
44

5-
<br>
65
<br>
76

87
[![Gradle Build](https://github.com/polystat/j2eo/actions/workflows/gradle-build.yml/badge.svg)](https://github.com/polystat/j2eo/actions/workflows/gradle-build.yml)
@@ -19,8 +18,9 @@ This is a translator of **Java** programming language to [EOLANG](https://www.eo
1918
1. Make sure you have installed:
2019
- **Java 16+** (make sure command `java -version` shows 16+ version of Java in terminal if you have multiple Java
2120
version installed)
22-
- **Maven 3.8+** (be aware of [possible conflicts](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980467) of the
21+
- **Maven 3.8+** to run tests (be aware of [possible conflicts](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980467) of the
2322
latest versions of Maven and Java on some OSs)
23+
- **ANTLR4 4.9.3** (if you want to build the parser on your own. If you don't have ANTLR, you still can build project using bundled version of parser.)
2424
2. Clone the repo into your folder:
2525

2626
HTTPS:
@@ -37,7 +37,6 @@ This is a translator of **Java** programming language to [EOLANG](https://www.eo
3737
```shell
3838
./build.sh
3939
```
40-
The testing report is generated in the `./j2eo/build/reports/tests/test/index.html` file.
4140
4. After build process, **j2eo.jar** file will appear in the project root folder (`./j2eo`). With this file, is it
4241
possible to translate **.java** files or packages to **.eo** packages. Run:
4342

@@ -56,6 +55,19 @@ This is a translator of **Java** programming language to [EOLANG](https://www.eo
5655
java -jar j2eo.jar src/test/resources/polystat_tests/test1 -o output_eo
5756
```
5857

58+
### Running translator on Hadoop
59+
60+
Hadoop is a large Java project (contains ~1.8M lines of code as of time of writing this). We included it as a benchmark of the translator.
61+
62+
Repository contains a script to build J2EO, download Hadoop repo and run J2EO on it.
63+
64+
Usage:
65+
66+
```shell
67+
./test-hadoop.sh
68+
```
69+
70+
5971
---
6072

6173
## Motivation
@@ -73,6 +85,8 @@ particular repository contains translator from Java to EO.
7385
**A**: Publicly available parsers only support older versions of Java, while we aim to support the latest version (
7486
currently 16). Thus, we had to create our own parser.
7587

88+
Also in recent versions, external Java grammar implemented in ANTLR was added as an alternative. It claims to support Java 17, and it does, as for our testing on big projects.
89+
7690
<br>
7791

7892
**Q**: Why do we implement EO AST?
@@ -89,26 +103,3 @@ bugs in our code. It is also much easier to work with abstraction layer than wit
89103
- First, the Java source code files are parsed recursively.
90104
- Then, for each file, translator converts Java AST to EO AST.
91105
- Then, EO AST is printed out as a source code to output directory in the same directory structure.
92-
93-
---
94-
95-
## NOT covered Java features list
96-
97-
- Type Erasure - Zouev
98-
- Subtyping - discuss with Yegor
99-
- Conversions - remove
100-
- Casting - remove
101-
- Modules
102-
- Exceptions - remove
103-
- Asserts - remove
104-
- Throws - remove
105-
- ``synchronized`` blocks
106-
- ``try``/``catch`` blocks - remove
107-
- ``yeild`` feature
108-
- Threads and Locks
109-
- Generics (all kinds of them) - remove
110-
- Native methods
111-
- break and continue statements - remove
112-
- RTTI (instanceof operator) ?????? - remove
113-
114-
In general, we cover **91 feature of 112** described in the Java language specification.

build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
set -e
55

66
echo "Building J2EO..."
7+
rm -r build/libs
78
./gradlew fatJar -x test
89
cp build/libs/* ./
910
echo "Build completed"

test-hadoop.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
# Exit on error
4+
set -e
5+
6+
echo "Building J2EO..."
7+
./gradlew build -x test jar
8+
cp build/libs/J2EO-0.4.0.jar .
9+
10+
echo "Cloning Hadoop..."
11+
git clone https://github.com/apache/hadoop || true
12+
cd hadoop || exit
13+
echo "Checking out tested revision..."
14+
git checkout ec0ff1dc04b2ced199d71543a8260e9225d9e014
15+
cd ..
16+
17+
echo "Starting J2EO on Hadoop..."
18+
java -jar J2EO-0.4.0.jar -o output_hadoop hadoop

0 commit comments

Comments
 (0)