Skip to content

Commit 786728f

Browse files
authored
Merge pull request #189 from BobHanson/master
java2script 3.3.1-v3 issues/205 ThreadPoolExecutor not waiting one microtick to initiate jobs -- resulting in unpredictable, incomplete handling of 0-delay tasks. Minimum set to 1 ms. See test.Test_Exec
2 parents b744287 + b5c7e62 commit 786728f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+11522
-5351
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ java2script/java2script is the overall master of the project. However, all activ
55
These notes are for Java developers who want to convert their Java applets or Java applications to
66
JavaScript, allowing continued, simultaneous one-source development of both Java and JavaScript.
77

8+
A discussion of application limitations and features is at https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.core/dist/swingjs/differences.txt
9+
810
Developers of java2script/SwingJS itself should read README-developers.md
911

1012
Bob Hanson (hansonr@stolaf.edu)
@@ -56,27 +58,31 @@ In the author's own words, "There are Java APIs that are impossible to implement
5658

5759
https://www.leaningtech.com/cheerpj/ "CheerpJ converts Java applications or libraries into JavaScript. Works on bytecode, does not require access to the source code. Compatible with 100% of Java including reflection and dynamic classes. Existing Java archives can be converted to Web applications effortlessly"
5860

59-
This sounds terrific. Very straightforward -- just convert the Java class files to JavaScript. I don't doubt that most of what is written here is true. I am dubious about that "100%" claim, as there are plenty of problems in Java that would take considerably more work than just using class files directly. The Java Reporter demonstration at https://www.leaningtech.com/cheerpj/demos/ crashed both Firefox and Chrome for me, so I cannot really evaluate what I see here.
61+
This sounds terrific. And truly it is. I am very impressed! Basically run the Java byte code in JavaScript. The Java Reporter demonstration at https://www.leaningtech.com/cheerpj/demos/ crashed both Firefox and Chrome for me, so I cannot really evaluate what I see here. But I have played with the JFiddle at https://javafiddle.leaningtech.com/, and it is pretty amazing.
6062

6163
The primary differences between java2script/SwingJS and CheerpJ, to the best of my knowledge, include:
6264

63-
- implementing a true HTML5 UI rather than just painting a canvas the way Java does
65+
- fast start-up time. SwingJS applications generally start within a second or two, sometimes within 100 ms
66+
- small downloads, anywhere from about 800K for a small non-GUI program to 10 MB for a full-blown Swing application (JSmol)
67+
- class-level just-in-time dynamic class loading; no need to retrieve entire JAR files just for a few methods
68+
- leveraging features of HTML5 and modern JavaScript rather than just painting a canvas the way Java does natively
6469
- delivering an easily interpretable and debuggable JavaScript translation of Java classes, with little or no obscurification (unless that is desired)
65-
- well-designed JavaScript-friendly Java core classes that leverage the considerable power of HTML5 rather than ignoring that completely
70+
- well-designed JavaScript-friendly Java core classes that leverage the considerable power of JavaScript
6671
- open source and completely extensible
6772

6873
# History - 2019-
6974

70-
SwingJS is now more than just "Swing"-JS. AWT applets and applications are now supported. A test suite of over 500 AWT applets has been used to refine the AWT runtime classes with great success. Many thanks to Karsten Blankenagel (University of Wuppertal) for access to this source code set.
75+
SwingJS is now more than just "Swing"+JavaScript. AWT applets and applications are now supported. A test suite of over 500 AWT applets has been used to refine the AWT runtime classes with great success. Many thanks to Karsten Blankenagel (University of Wuppertal) for access to this source code set.
7176

7277
Examples include:
7378

7479
MathePrisma (http://www.matheprisma.uni-wuppertal.de/) This site is still using the Java applets as of 2019.03.12; JavaScript versions still in development.
7580

7681
# History - 2017-
7782

83+
https://github.com/BobHanson/java2script/tree/hanson1 (development branch)
7884

79-
https://github.com/BobHanson/java2script (development master)
85+
https://github.com/BobHanson/java2script (master)
8086

8187
Current development "Version 3 development master" involves a completely rewritten transpiler (2017) “CompilationParticipant” that follows the Eclipse Java compiler. The implementation nearly perfectly emulates the Java Virtual Machine. It includes fully qualified methods, compile-time method binding, generic methods and classes, Java 8 lambda functions and streams, Java reflection and dynamic class loading for efficient modular just-in-time performance, Java Swing components, modal and nonmodel dialogs, audio, jpdf, the AWT event thread, and many other added packages. Java applications and applets can both be run in JavaScript in any browser.
8288

sources/net.sf.j2s.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: Java2Script Core
44
Bundle-SymbolicName: net.sf.j2s.core;singleton:=true
5-
Bundle-Version: 3.2.10
5+
Bundle-Version: 3.3.1
66
Bundle-Activator: net.sf.j2s.core.CorePlugin
77
Bundle-Vendor: j2s.sourceforge.net
88
Require-Bundle: org.eclipse.core.runtime,
48.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)