JSIL | CIL to Javascript Compiler | Bytecode library
kandi X-RAY | JSIL Summary
kandi X-RAY | JSIL Summary
CIL to Javascript Compiler
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of JSIL
JSIL Key Features
JSIL Examples and Code Snippets
Community Discussions
Trending Discussions on JSIL
QUESTION
I'm trying to understand the point of WebAssembly from a .NET angle.
From the Blazor FAQ:
Running .NET in the browser is made possible by a relatively new standardized web technology called WebAssembly.
That's a weird claim.
Obviously you can run .NET code in the browser without WebAssembly by cross-compiling it to JavaScript (eg. with JSIL). That just sucks because
- The CLR's object model is more sophisticated than JavaScript's (eg. you can make a compact array of integers,
Uint8Array
, but not of a more complex value type in JavaScript) making the translation of certain types of code very inefficient. - .NET's native base library implementations need to be implemented in JavaScript too, which is a lot of work.
- The browser ecosystem is based on JavaScript so there's friction if you use such cross-compilations.
So the FAQ's meaning is that it's now practical, right?
I struggle to see how WebAssembly helps with any of these points though. A cursory glance suggests that its virtual machine still shouldn't be able to efficiently represent the CLR properly (still no complex value types, right?). And the other two points will hold no matter what.
So what changed? What exactly does WebAssembly bring to the table that wasn't possible with JavaScript alone? Is it really just that Webassembly is stack-based and JS itself isn't? Why should that be that big a deal?
EDIT: Couldn't be happier about Henk's super-to-the-point answer. For the interested, I now found a great rationale page.
...ANSWER
Answered 2019-Jun-26 at 21:49suggests that its virtual machine still shouldn't be able to efficiently represent the CLR properly
Correct. That is why Blazor first deploys a compiled-to-WASM version of Mono.
Blazor brings its own CLR to the party.
Your application code won't be compiled to Wasm, it will be deployed as (regular) IL that is executed by Mono. With the dev tools you can see a bunch of .DLL files being downloaded to your browser. You can in principle use any .net standard package that fits within the Browser security sandbox.
What exactly does WebAssembly bring to the table that wasn't possible with JavaScript alone?
It enables a C compiler to compile Mono.*.c to Mono.wasm.
And it is fast.
QUESTION
I'm trying to get started with JSIL. I've followed the directions as far as I understand. I have a very basic C# dummy project with the code:
...ANSWER
Answered 2017-May-26 at 20:36The missing piece is that JSIL's browser layer performs loading in two stages: There's the bootstrapper, which you've loaded successfully and has loaded your manifests, and then the browser scaffold, which sets up the DOM interfaces and actually executes the assemblies you've loaded. This occurs in two stages since so many things are asynchronous and you might have a reason to load additional assemblies on your own or do other work before actually running all the code.
The browser scaffold exposes a function called onLoad
(yeah, sorry) that you can call to perform the second stage. The examples all do this with or something similar, but you can call it any way you want.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install JSIL
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page