Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Create WebAssembly Guide with various languages #93

Closed
12 of 20 tasks
nickvidal opened this issue Mar 3, 2022 · 26 comments · Fixed by #157 or #163
Closed
12 of 20 tasks

Create WebAssembly Guide with various languages #93

nickvidal opened this issue Mar 3, 2022 · 26 comments · Fixed by #157 or #163
Assignees
Labels
enhancement New feature or request

Comments

@nickvidal
Copy link
Contributor

nickvidal commented Mar 3, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Description

We want to create a WebAssembly Guide with a simple example using various programming languages that currently have support for WASI:

https://enarx.dev/docs/WebAssembly/Introduction

Fermyon has a good matrix showing languages that support WASI:

https://www.fermyon.com/wasm-languages/webassembly-language-support

Among these languages, recently we saw JavaScrip/TypeScript getting support:

https://blog.suborbital.dev/bringing-javascript-and-typescript-to-suborbital

Acceptance Criteria

The languages we are interested in are the following, currently ordered by their support of WASI and importance:

  • Rust
  • C
  • C++
  • Go
  • JavaScript
  • TypeScript
  • AssemblyScript
  • .NET
  • Ruby
  • Grain
  • Zig
  • Python
  • Swift
  • Kotlin
  • Java
  • Erlang
  • Haskell
  • Lisp
  • COBOL

Suggestions for a technical implementation

We are thinking in using Fibonacci as an example:

https://github.com/enarx/outreachy/tree/main/Jennifer/Rust-to-WASI

If you are interested in contributing, please:

  • Implement Fibonacci in your language of choice
  • Add a markdown file to docs/WebAssembly
  • Add a sidebar link at sidebars.js
  • Create a PR against this repo

Thank you!

@nickvidal nickvidal added the enhancement New feature or request label Mar 3, 2022
@Deepansharora27
Copy link
Contributor

I have the C++ Demo already created
Here is the Link to the Repository for the Demo in C++:
https://github.com/Deepansharora27/HammingCodeGeneration

@Deepansharora27
Copy link
Contributor

Shall I Raise another issue for the C++ Example or will embedding it here will work Nick ?

@Deepansharora27
Copy link
Contributor

Deepansharora27 commented Mar 3, 2022

https://github.com/Deepansharora27/FibonacciEnarx
@nickvidal Hi Nick,
This is my demo example for Fibonacci Example in C++ as well.

So, C++ is done from my side now.

@moksh-pathak
Copy link
Contributor

I will be implementing demo example for Fibonacci in Golang.

@nickvidal
Copy link
Contributor Author

nickvidal commented Mar 3, 2022

I will be implementing demo example for Fibonacci in Golang.

Hi Moksh, please check with Jennifer before, as I believe she's also interested in Golang. Maybe she can leave the Golang implementation to you, and do some exploration around Python.

@jnyfah
Copy link
Contributor

jnyfah commented Mar 3, 2022

@moksh-pathak I have done that of Golang and rust, currently trying C# and python

@moksh-pathak
Copy link
Contributor

No worries @jnyfah. Good going!

@nickvidal
Copy link
Contributor Author

If you are adventurous, you might want to explore AssemblyScript or Grain! :)

@moksh-pathak
Copy link
Contributor

Would like to give it a shot!

@moksh-pathak
Copy link
Contributor

I am also working on the Swift demo.

@mayankkumar2
Copy link
Contributor

@nickvidal is kotlin,Erlang,Haskell,C up for taking?

@nickvidal
Copy link
Contributor Author

Hi @mayankkumar2, I believe @Deepansharora27 is working on the C example, but the other ones are open.

@Deepansharora27
Copy link
Contributor

Deepansharora27 commented Mar 13, 2022

Yes right @nickvidal I have also made a Pull Request for the Same.
Also I have already done work on the Java and Kotlin side of things.
Telling so that it doesn't block the workflow for others 😊

@mayankkumar2
Copy link
Contributor

Ok then, I will take up Haskell and Erlang.

@aryankaushikdev
Copy link
Contributor

I would like to create the guide with javascript.

@mayankkumar2
Copy link
Contributor

mayankkumar2 commented Mar 24, 2022

I tried out erlang and Haskell, the tooling is giving me some trouble. lumen's latest release seems to not even compile the hello world example, will have to build from source and document the same. For Haskell with asterius, I got stuck with a weird error ahc-dist: internal error: Unable to commit 2902458368 bytes of memory, have been trying to debug what's going wrong :(. The example code for both these languages seems to compile perfectly with their native compilers but not with the web assembly toolings.

@nickvidal
Copy link
Contributor Author

Hi @mayankkumar2, no worries. Perhaps the tooling is "not there" yet.

Would you be interested in exploring Python (with @jnyfah ) or Java (with @Deepansharora27)?

@nickvidal
Copy link
Contributor Author

Regarding Python, I got some recommendations from @tiran:

I just got WASI builds working with help of https://github.com/singlestore-labs/wasix .

$ wasmtime --mapdir=.::../.. -- ./python.wasm -c "import sys;
print(f'Hello {sys.platform} from {[sys.implementation.name](http://sys.implementation.name/)}')"
Hello wasi from cpython

You can find instructions and build container at
https://github.com/tiran/cpython_builddep/#webassembly-build .

You have to run the command from a recent cpython git checkout. Next build a
native Python with ./build-python-build.sh and finally wasm32-wasi with
./build-python-wasi.sh

@mayankkumar2
Copy link
Contributor

mayankkumar2 commented Mar 24, 2022

Sure @nickvidal, I will connect with them on Rocket Chat then, regarding what all they have done (tried out) till now.

@Deepansharora27
Copy link
Contributor

@mayankkumar2 You can connect with Jennifer for python for now as Java is something that I would like to work on independently till Sunday and maybe if issue still prevails , then we can connect together on Monday

@nickvidal
Copy link
Contributor Author

Anyone with .NET knowledge who wants to try this?

https://github.com/SteveSandersonMS/dotnet-wasi-sdk

@Deepansharora27
Copy link
Contributor

Anyone with .NET knowledge who wants to try this?

https://github.com/SteveSandersonMS/dotnet-wasi-sdk

I would like to take this up

@nickvidal
Copy link
Contributor Author

Anyone interested in exploring Ruby?

https://www.ruby-lang.org/en/news/2022/04/03/ruby-3-2-0-preview1-released/

@jnyfah
Copy link
Contributor

jnyfah commented Apr 3, 2022

Anyone interested in exploring Ruby?

https://www.ruby-lang.org/en/news/2022/04/03/ruby-3-2-0-preview1-released/

I saw that some hours ago over Twitter, I have started checking it out

@IIITM-Jay
Copy link

IIITM-Jay commented Apr 4, 2022

Hi @nickvidal , an outreachy applicant here,
May I work on swift or any other language?

This was referenced Apr 4, 2022
@moksh-pathak
Copy link
Contributor

Hi @IIITM-Jay, I have already taken up the Swift WASM demo before.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
7 participants