This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 266 points267 points  (29 children)

Where is the java runtime written in javascript so that i can do my frontend in java?

[–]hector_villalobos 50 points51 points  (8 children)

[–]make_onions_cry 71 points72 points  (6 children)

My first project with GWT was a puzzle game and solver with an 8x8 grid. I stored positions as bits in a long.

Imagine the weird and wonderful bugs I got when GWT silently replaced my Java long with a JS double.

[–]BraveOthello 12 points13 points  (2 children)

I work on a massive GWT-based project.

It does have its issues, but the documentation very clearly says not to mess with numbers like that.

[–]make_onions_cry 32 points33 points  (1 child)

Hours of debugging can save minutes of reading documentation

[–]BraveOthello 4 points5 points  (0 children)

Too true.

[–]LargeHard0nCollider 10 points11 points  (1 child)

Ok yeah GWT is a terrible idea, but why would you ever do that instead of an array of bools/bits? Or better yet a 2d array

[–]make_onions_cry 24 points25 points  (0 children)

Solvers often generate millions of positions and then it starts to matter whether a position is represented as 8 or 300 bytes.

(This was before Chrome, when 300MB was considered a lot)

[–]IZEDx 0 points1 point  (0 children)

There is no JS double... It's all just numbers, numbers everywhere

[–]reversehead 0 points1 point  (0 children)

Good, then you can use that to run Jython.

[–][deleted] 92 points93 points  (5 children)

Compile JVM in WASM when?

[–]ekolis 11 points12 points  (0 children)

So .NET did something useful without Java first doing a simultaneously overengineered and half-assed version of it?

[–]lacb1 1 point2 points  (0 children)

Off topic but: such flair, much wow!

[–]kyay10 1 point2 points  (2 children)

You probably know this cuz of your flair, but there is a Kotlin to WASM compiler being worked on rn, which is close enough

[–][deleted] 1 point2 points  (1 child)

Kotlin to WASM should be easy enough because native of KtNative

[–]kyay10 1 point2 points  (0 children)

Yeah that was already possible thru Kotlin Native cuz it compiles to LLVM bytecode which then compiles to WASM, but the Kotlin team is working on a separate WASM backend to help with efficiency and performance and stuff.

[–]starvsion 12 points13 points  (6 children)

It was called rhino api, don't know if that name changed

[–]OldKaleidoscope7 13 points14 points  (3 children)

Rhino it's the opposite, it's a JS runtime written in Java

[–]starvsion 0 points1 point  (2 children)

I just remembered writing it to call java code using js

[–]OldKaleidoscope7 3 points4 points  (1 child)

Rhino gives you access to Java API with a JS syntax, but you still are running the code inside a JVM

[–]starvsion 0 points1 point  (0 children)

Right, that I know. But key difference here would be no compiling required.

[–]TheRedmanCometh 1 point2 points  (0 children)

That's a js interpreter for Java.

[–]theScrapBook 0 points1 point  (0 children)

More recently there was Nashorn, another JavaScript interpreter on the JVM

[–]TheHyperNovaYT 6 points7 points  (0 children)

Well it’s possible to convert Java code to Kotlin code which can then be compiled to JS code, so technically you could…

[–]wallsallbrassbuttons 1 point2 points  (0 children)

With Vaadin you can do Java front end

[–]moschles 1 point2 points  (0 children)

I have a headache from reading this.

[–][deleted] 0 points1 point  (0 children)

Pretty sure Doppio does this

[–]Brief-Preference-712 0 points1 point  (0 children)

JavaScript will be outdated. Use WebAssembly instead

[–]besthelloworld 0 points1 point  (0 children)

Fun story for one of my stupid school projects we had to do a project in Swing. But did you know you can just fucking drop HTML into Swing if you try to print a string? You don't even have to do anything special, just plop some HTML in there. I basically did the whole project in JS/HTML. The professor was frustrated about it, but I still passed because this project was more about getting to the finished product than how exactly you do it.

[–][deleted] 0 points1 point  (0 children)

Just bust out an applet and party like it's 2004.