Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import suggestion #182

Open
ghost opened this issue May 12, 2019 · 0 comments
Open

Import suggestion #182

ghost opened this issue May 12, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented May 12, 2019

Feature Request

Overview

Right now from what I've learnt, you can only import symbols from other walt files and none of the symbols not imported from target walt file will be present in output wasm module.
Also I found no way to just import a walt file without giving it a symbol to import, like import "./base.walt";

Impact

Large, because it requires the compiler to include all code from imported module in output wasm module if necessary.

Details

Currently I'm looking for a clean and easy to use language that mainly targets wasm. I found walt and assembly script the most promising. But there's a serious issue with walt that I can't expand my script to other walt scripts for making a simple standard library or defining some default values without explicitly importing their name in my main script. For example I can't define a memory, table or type in another script and import the script with something like import "./std.walt"; and let the compiler automatically import everything from that script.

Also the compiled result of importing a script like import { a: i32 } from "./script.walt"; is (import "./script.walt" "a" (global $./std.walt.a i32)) which causes an error in the runtime I'm using because it cannot find "./script.walt"! I suggest to import the scripts statically (by putting everything from the imported script inside the main script or wherever it's imported from)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants