Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Refine import #92

Open
nidin opened this issue May 25, 2017 · 0 comments
Open

Refine import #92

nidin opened this issue May 25, 2017 · 0 comments
Labels

Comments

@nidin
Copy link
Contributor

nidin commented May 25, 2017

What?
Refine import syntax for

  • Importing external TurboScript
  • Importing JavaScript functions

Decouple declare native function from import.

Update

Import Cases

  • import from local tbs file

import {func,class,var} from "./local/module"

.tbs will automatically append to import from file

  • import from javascript built-ins

import {Math} from "javascript"

special tbs file where all javascript methods declared. it should be outside library source.

  • import from compiled wasm binary

import {func,global_var,memory} from "./bin/module.wasm"

unwanted functions from imported wasm should be removed and combine in to one wasm output.

Notes: All declare syntax outside library source should allocate imports. import from wasm binary need a wasm binary parser.

import strategy

if library && declare ---> no import
if declare ---> import

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

No branches or pull requests

1 participant