gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
17.38k stars 722 forks source link

Have the ability to add packages to the wasm compiler #3245

Open CrowdHailer opened 3 months ago

CrowdHailer commented 3 months ago

The current bindings for the wasm compiler only exposing add files/modules into the main project but not dependency files.

lpil commented 3 months ago

Given you can add the modules to the main project what would this provide?

CrowdHailer commented 3 months ago

I've been trying to use dependencies. and so far I write all their modules into the main project. Which I think is what you are suggesting. The first problem I run into is that some files clash. most importantly several packages use the same "ffi.mjs" at the top level. so one or other of these packages breaks.

lpil commented 3 months ago

Makes sense, thank you.

iirc the WASM API is bindings to the compile-package API so there is no way to support multiple packages in that context, it is intended to be done by whatever calls that API. If that's right then it'll be a large amount of work to support this, effectively making a new build tool.