Recent

Author Topic: pas2js wasm demos throw 'unimplemented TPas2JSWASIEnvironment.fd_prestat_get'  (Read 1807 times)

PierceNg

  • Sr. Member
  • ****
  • Posts: 374
    • SamadhiWeb
Anyone has success running pas2js WASI demos?

I'm using pas2js and fpcwasm compilers built yesterday from respective current trunk/master/main. Running pas2js's demo/wasienv/simple, web page shows up with expected output; browser console has following:

Code: Text  [Select][+][-]
  1. > XHR GET http://localhost:20080/helloworld.wasm
  2. Unimplemented: TPas2JSWASIEnvironment.fd_prestat.get
  3. Hello world from FPC webassembly and Pas2JS!
  4. ... and a merry Christmas for all!


Next, copied helloworld.wasm over to demo/wasienv/wasiapp and ran that. Now web page doesn't show expected output, and browser console:

Code: Text  [Select][+][-]
  1. > XHR GET http://localhost:20080/helloworld.wasm
  2. Unimplemented: TPas2JSWASIEnvironment.fd_prestat.get
  3. <empty string>


Same 'unimplemented ...' shows up for every demo in demo/wasienv. These fd.prestat.get calls are made by FPC-generated Wasm (I guess) and the function is not implemented by pas2js's WASI, as per line 924 in packages/wasi/wasienv.pas. 

cai

  • New Member
  • *
  • Posts: 41
WASI is unimplemented in standard browser app(BS app), that is WASI designed(for CS App), we can not access local file in the browser world! means all document code in browser app can not call WASI to do something, unless a browser implement WASI, but it is not safety for user local data.

 

TinyPortal © 2005-2018