Giter Site home page Giter Site logo

Comments (8)

aduros avatar aduros commented on May 14, 2024 2

Welcome!

Yeah, we need a page in the documentation for this. For now here's a rough guideline for anyone interested.

At a very minimum your language needs:

  1. A way to import and export WebAssembly functions.
  2. The compiler must be configured to import memory. Generally compilers export their own memory by default.
  3. The memory needs to be sized to an initial size and maximum size of 1 page (64 KB).
  4. The compiler must be configured to avoid using the lower region of memory reserved by WASM-4.

LLVM-based languages can use these wasm-ld linker flags to configure the above: --import-memory --initial-memory=65536 --max-memory=65536, --global-base=6560 and/or -zstack-size=....

I think that should be all you need to get a new language running with WASM-4. As a bonus, you can take it even further by including:

  • A new project template for w4 new.
  • An output format for w4 img2src.
  • Updated docs on the website.

If you're planning support for a specific language, definitely let us know! It's possible other language X users would be interested and willing to help.

from wasm4.

eXponenta avatar eXponenta commented on May 14, 2024 1

I think binary will over 65k in scratch for C# =)

from wasm4.

takaeri avatar takaeri commented on May 14, 2024

Hello there! May I ask, what language are you planning to support?

The only problem here that if dev would like to add support or definitions for a language from the list, By myself looked into docs but this isn't mentioned...

My guess is you open an issue and discuss with the owner/contributors. Adding a support for a language requires a template (like here).

from wasm4.

eXponenta avatar eXponenta commented on May 14, 2024

I proposed support custom templates for png2src, can be used for generating image source without adding a generator template inside runtime.

#53

from wasm4.

Rabios avatar Rabios commented on May 14, 2024

@aduros Thanks! ❀️

If had time will try to give Nim or C# a try...
(Though i can't promise with that due to time lack, but if did will reply further and thanks!)

from wasm4.

Rabios avatar Rabios commented on May 14, 2024

@eXponenta sad for that...
But that doesn't mean i can't try any another language... πŸ˜„

from wasm4.

Yardanico avatar Yardanico commented on May 14, 2024

@Rabios Hi, I've made a repo that shows how to use WASM-4 from Nim - https://github.com/Yardanico/wasm4nim/. I think after I polish things a bit more and create a nimble project (so that it can be built with a single command) I can add it to the wasm4 repo as a template.

from wasm4.

aduros avatar aduros commented on May 14, 2024

@Yardanico That's awesome! Please open a PR when you feel it's ready for others to use!

from wasm4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.