RoyalIcing / Orb

Write WebAssembly with Elixir
https://useorb.dev
BSD 3-Clause "New" or "Revised" License
215 stars 4 forks source link

[Feature request] Support WASM import definitions #34

Closed orsinium closed 5 months ago

orsinium commented 5 months ago

Hi Patrick,

Thank you for this amazing project! Wasm lacks functional languages and interpreted languages, and Elixir is both.

I'm working on Firefly Zero a FOSS handheld game console running WebAssembly. It's in the early stages but you can already make games for it and try out the ones we have. I want to make an official SDK for Firefly Zero using Orb, making it possible to write retro games with Elixir. All I need is a way to define wasm imports for functions (and exports as well but it seems like you already support it with defw). From reading the docs, looks like there is no way to do that yet. Is it something you'd be interested in implementing?

RoyalIcing commented 5 months ago

That sounds like a great project! I hope more independent hardware makers come into the world.

Imports are supported, and your issue prompted me to make the syntax better in 0.0.46.

The docs for Orb.Import are here. Let me know if they suffice, I will keep improving things until they are clear.

Let me know how else I can help, and looking forward to having an SDK — that sounds awesome!

orsinium commented 5 months ago

I've got it working! Thank you, the new API is indeed better. I'll let you know when I have a fully working SDK, now it's just a matter of time :)

image

RoyalIcing commented 5 months ago

That’s incredible! Any hitches or things you think could be better let me know! I won’t be offended if you say “this sucks, can you make it better”.

orsinium commented 5 months ago

Any hitches or things you think could be better let me know!

I sure will! I have only one blocker so far: https://github.com/RoyalIcing/Orb/issues/36

Other than that, the SDK for graphics is ready: https://github.com/firefly-zero/firefly-elixir

I've published it in your Show & Tell: https://github.com/RoyalIcing/Orb/discussions/37