Coder Social home page Coder Social logo

x3haloed / superstring-net-standard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atom/superstring

0.0 0.0 0.0 2.05 MB

Native core components for Atom, ported to .NET Standard

License: MIT License

JavaScript 65.08% C++ 31.82% Shell 0.53% C 0.02% C# 1.96% CMake 0.60%

superstring-net-standard's People

Contributors

arcanis avatar as-cii avatar ben3eee avatar daviwil avatar leroix avatar maxbrunsfeld avatar smashwilson avatar torn4dom4n avatar

Watchers

 avatar

superstring-net-standard's Issues

Compiled WASM module is broken

I was able get the WASM module compiled with WASI via clang and LLVM, but when I try to execute a function, it fails or hangs.

Using dotnet-webassembly, attempting to execute the "MarkerIndex::generate_random_number" static method produces the following error: "System.InvalidProgramException: 'Common Language Runtime detected an invalid program.'"
See SuperstringSample.Program line 35. You can use the attached compiled WASM file.

Attempting to execute that same method via the browser results in the browser locking up w/ high CPU usage.

<html>
<body>
  <script>
    fetch('superstring.wasm').then(response => {
      console.log('received wasm file');
      return response.arrayBuffer();
    }).then(bytes => {
      console.log('converted to bytes')
      return WebAssembly.instantiate(bytes, {imports: {}})
    }).then(results => {
      console.log('instantiated wasm file');
      console.log(results.instance);
      window.fib = results.instance.exports._ZN11MarkerIndex22generate_random_numberEv(1);
      console.log('result: ' + window.fib);
    });
  </script>
</body>
</html>

Can anyone with more C++ and WASM experience help me understand what I've done wrong?

To see the steps I'm using to compile the WASM module, check out /script/build-browser-version.sh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.