A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Feneric/nim-wasm-helpers below:

Feneric/nim-wasm-helpers: Help quickly set up a VM configured to build WebAssembly code using Nim.

Help quickly set up a VM configured to build WebAssembly code using Nim.

Here are a few collected aids to generating WebAssembly (WASM) from Nim using Emscripten. The Vagrantfile can be used with Vagrant and VirtualBox to create a virtual machine (VM) that's already equipped with a properly configured build environment. We won't reproduce all of the Vagrant documentation here, but in general after installing both Vagrant and VirtualBox you should be able to type:

git clone https://github.com/Feneric/nim-wasm-helpers.git
cd nim-wasm-helpers
vagrant up

and after waiting for awhile for everything to download and configure you should have your environment to play in. The vagrant command will produce a lot of output in a variety of colors (mostly green with some gray, white, yellow, and cyan, and maybe two lines of red related to dpkg-preconfigure and building a symlink). This should work on Linux, macOS, MS-Windows, Solaris, BSD, etc. but has only been tested extensively on Linux. This build environment makes use of the Bodhi Vagrant Box which runs Bodhi Linux. Once it's up, you can use:

to log in via a shell. The VM is set with a shared folder to enable you to do edits from outside, but if you want to play around directly within it, it has Vim installed with Nim syntax coloring and uses Fish for its shell.

There are also a few traditional "hello world" samples included, and a Makefile to make building them via make easy. They are all in the Samples folder. The VM provides an NGINX Web server that exposes all the samples via the local Web address: http://bodhi64.local/Samples/

If you are running into difficulties, you may find that it is just something transient and rerunning the vagrant up script may fix things. If you are specifically running into errors related to ifdown and ifup they are probably related to a known Vagrant Ubuntu issue. The fix is to manually vagrant ssh into the box after attempting the first vagrant up and type sudo aptitude install ifupdown in the shell. Once it completes, exit the box and try vagrant up again.

Beyond that it makes sense to enter the box and manually each of the steps listed in the Vagrantfile in order to see what fails when. This makes use of several unrelated packages, and new releases do sometimes break things. If you have some helpful tips, putting them into the wiki may help others, too.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3