WebAssembly for VisualBasic.NET
1. Which platform that I can running my VisualBasic.NET application
Theoretically, you can develop your VisualBasic.NET application for Windows/Linux/Mac/IOS/Android, from PC, mobile phone, tablet and Raspberry Pi, running on every platform if the platform supports WebAssembly!
2. How fast that my VisualBasic.NET can running
Theoretically, your VisualBasic.NET application is running as fast as C/C++ application, as VisualBasic.NET is generate same assembly code as C/C++ application it does.
3. Can I run my VisualBasic.NET application on nodejs environment
yes! If your current nodejs environment supports WebAssembly.
4. Can I publish my VisualBasic.NET application onto npm
yes! If the npm supports WebAssembly package.
5. Win32/.NET Framework api supports?
Core version, which means almost all of the things must create from scratch if you target your VB.NET application to WebAssembly platform.
6. What can I do with WebAssembly
Using WebAssembly compiler for VB.NET
Using WebAssembly compiler for VB.NET language, follow these steps:
1. Write your applications' code
Write your VisualBasic.NET application in VisualStudio, and then save it.
Module Demo Declare Function Print Lib "console" Alias "log" (text As String) As Integer Public Function HelloWorld() As Integer Call Print("Hello World!") Return 0 End Function End Module
Project only supports a single source file, a single module,
Class/Structure/Enum/Arrayis not supports yet in current version of the VB.NET wasm compiler, but all of this VB.NET programming feature will be supportted in future works. Probably not supports generic method.
2. Run wasm compiler
Current version VB.NET wasm compiler just supports compile a single source file. A VB.NET project with multiple source file will be supported in the future. For compile a VB.NET application, create a console application, and add reference to
VisualBasic.Wasm.dll, at last write these code for compile your VisualBasic source file:
Dim vb = "/path/to/app.vb" Dim [module] = Wasm.CreateModule(vb) ' Target Assembly file (*.wasm) [module].Compile("HelloWorld.wasm") ' Compiler debug used only (*.wast, *.dmp) [module].ToSExpression.SaveTo("HelloWorld.wast") [module].HexDump(True).SaveTo("HelloWorld.dmp")
Compiler project source file available at: https://github.com/GCModeller-Cloud/data.ts/tree/878d93e4d011f666d0dc4dbc0062a6fd1685bc9b/TsBuild/Wasm
Add script reference to