What does HackerNews think of teavm?

Compiler of Java bytecode to JavaScript

Language: Java

Why you guys keep using this old non-maintained fork of TeaVM, while there's WASI support in main TeaVM (https://github.com/konsoletyper/teavm)?
Uses this apparently: https://github.com/konsoletyper/teavm

"TeaVM is an ahead-of-time compiler for Java bytecode that emits JavaScript and WebAssembly that runs in a browser."

SnapKit is a huge framework with lots of functionality. One key part for the browser integration module (SnapTea) is TeaVM https://github.com/konsoletyper/teavm

TeaVM converts Java code to run in the browser. It provides the ability to call JS functions to access browser features like canvas and XHR. However, unless you want to be coding like Vanilla JS, you'll want a framework on top. SnapKit provides that.

SnapTea leverages TeaVM https://github.com/konsoletyper/teavm to convert Java to JS. However, SnapKit provides an entire UI framework layer too, enabling app portability to other environments (like the desktop JRE).
> So why did I spend all this time trying to write it? I treated it as a programming riddle [...] Maybe because of these results I got quite addicted to the project itself [...] I guess it’s not too healthy (especially if you have a family), but it also doesn’t happen that often.

I can empathize, I think lots of us have GH profiles littered with projects we've hit real finish lines on but may not be useful to others. But I actually think it's healthy, especially if you have a family (assuming it's only your spare time). It provides sanity and brain maintenance simultaneously. Even better if you have an employer that doesn't track your every hour and recognizes the value of these kinds of things on down time.

> Right now I don’t have any obvious ways to move the app forward, so the addiction dissipated ;)

Run through https://github.com/konsoletyper/teavm to WASM and abstract graphics calls and what not :-)

Yes, from the FAQ: "The CheerpJ compiler, based on LLVM/Clang, as well as on parts of Cheerp, converts Java bytecode into JavaScript, without requiring the Java source. CheerpJ can be invoked on whole Java archives (.jar) or on single .class files, and generates a .jar.js (or .js) output. "

We've seen this plenty with GWT and the likes, but this one is self-hosted in the browser to support dynamic class loading. As with Emscripten, the real struggle is the stdlib, not the translation. As an alternative, I would recommend people look at TeaVM[0].

0 - https://github.com/konsoletyper/teavm

For those from Java world wanting to write client-side, there is obviously also GWT[1] and another interesting option is TeaVM[2]. Interesting part of TeaVM is that it translates bytecode, so I guess it could do Scala as well. But I've never used it, so cannot recommend really.

1. http://www.gwtproject.org/

2. https://github.com/konsoletyper/teavm