ballercat / walt

:zap: Walt is a JavaScript-like syntax for WebAssembly text format :zap:

Home Page:https://ballercat.github.io/walt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

export default

rjoydip-zz opened this issue Β· comments

Feature Request

Great work πŸ‘

Overview

It would be nice to export default functions.

Example:

export function decrement(): i32 {}
export function increment(): i32 {}

export default {
    decrement,
    increment,
};

Thanks!

Could you talk more about how you would like to use the default export above? Since in JS this module would look something like this already:

// WebAssembly module result
const mod = {
   instance: {
      exports: {
         decrement: fn(),
         increment: fn()
      }
   }
}

So I'm a bit fuzzy on what the utility added by default here.

We could use default for the Module Start Function. Right now that is done by simply naming a function start so using a default keyword might be nicer.

I haven't anything in my mind but I am just wondering something like export default function or like es6

export default function count () {}