LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Running WebAssembly from Windows 10 or * Linux (https://www.linuxquestions.org/questions/programming-9/running-webassembly-from-windows-10-or-%2A-linux-4175719875/)

des_a 12-16-2022 11:01 PM

Running WebAssembly from Windows 10 or * Linux
 
First off lets start off with facts. Java, last I checked, if you download the official JDK, can be run from Linux or windows, with "java helloWorld". That would run the Java bytecode program helloWorld.class, which is assumed to come from helloWorld.java.

From official sources, can you do that with web assembly? What command would it be, and would it be cross platform, the same?

I'm trying to find out so I can, in a way, "hook onto it". Nothing malicious.

teckk 12-17-2022 07:36 AM

You are probably going to have to read the docs.

https://developer.mozilla.org/en-US/docs/WebAssembly
https://www.w3.org/community/webassembly/
https://www.w3.org/wasm/
https://webassembly.org/docs/faq/
https://www.webassembly.fr/en/

sundialsvcs 12-17-2022 08:21 AM

Is WebAssembly still "a thing?" I thought it had pretty much died off from neglect.

des_a 12-18-2022 02:17 AM

Thanks! I'll read those links, and come back here if I don't understand them. I'm new to that concept and didn't know about those.

Quote:

Is WebAssembly still "a thing?" I thought it had pretty much died off from neglect.
Good question.

Actually, the first I heard of web assembly, and back before I was as experienced with things, especially programming, I was trying to solve some programming issues besides this question. I won't link it, but that was the first I heard of it. ...Had to stop myself from senseless rambling... LOL

So I'll read the docs now that I know about them. Thanks!

sundialsvcs 12-19-2022 09:18 AM

It still amazes and puzzles me that modern-day web technology is still based on languages that are interpreted from source-code ... and that attempts to improve the speed of JavaScript (why did the winner turn out to be JavaScript ...?) using esoteric things like "just-in-time compiling to machine code on the user side."

We abandoned Adobe Flash® and refused to integrate anything like it into browsers. Instead, we packed HTML (sic ...) full of esoteric graphics features. And now we are left with "JavaScript libraries" that are megabytes long. The "hideous complexity" of all of this makes utterly no engineering sense to me.

rclark 12-19-2022 08:08 PM

Quote:

We abandoned Adobe Flash® and refused to integrate anything like it into browsers. Instead, we packed HTML (sic ...) full of esoteric graphics features. And now we are left with "JavaScript libraries" that are megabytes long. The "hideous complexity" of all of this makes utterly no engineering sense to me.
+1. I personally really liked the concept of Java Applets when they were introduced. Write once, run everywhere. A self contained application that was 'easy' to deploy. At my company at the time, was getting on the band wagon and it was working out very well ... except all of a sudden the customer IT people got involved and wouldn't allow Applets to run... Grrrr.... Security. But for us, the 'concept' was wonderful. No more installing applications to each machine, just pull up your browser and the application was 'loaded' automatically from one 'repository' site. Not dependent on HTML or anything as the browser was only there as a vehicle to load the self-contained applet. Wonderful... Then blocked it...they call it progress. <sigh> We also ran into IT again with security when email came along. Wonderful. Now we can zip up our program and send directly to the customer instead of fed-X'ing' a CD to them.... Reset. Not allowed to receive zip files.... Blocked again... We have the technology ... but can't use it! Of course we know it just went down-hill from there. Now I have to use Liquid Files at work to send stuff back and forth between customers. Yuck..... I digress.

As for WebAssemby, not quite as easy as one would think. There is a nice little book called 'The Art of WebAssembly' that will get you started though if you really want to dig into the language.

Quote:

, and would it be cross platform, the same?
I believe the answer here is yes. Use a program written in 'C'/'C++' for example and compile it to a WASM binary. Then run that in any browser on any platform. I believe that is the goal.

des_a 12-20-2022 03:54 AM

So, I couldn't find anything about running from the command line. Awhile back though, I saw what looks like an unofficial way. Just run the javascript produced by the c++ compiler for wasm. Run it from command line instead of putting it in the browser with HTML. I guess that's the only way to do it. So I guess, thread sovled.

Basically, I wanted to give it a fair chance and create a hook for it in my language I've almost got objects in. Looks like it's not going to happen.


All times are GMT -5. The time now is 05:38 AM.