GithubHelp home page GithubHelp logo

web-devkits / webinizer Goto Github PK

View Code? Open in Web Editor NEW
21.0 7.0 7.0 15.41 MB

Webinizer is a collection of tools to convert native applications, such as these programmed by C/C++/Rust, to Web applications which are constructed by HTML/CSS/JavaScript and WebAssembly.

License: Apache License 2.0

JavaScript 2.36% Shell 0.01% TypeScript 97.36% C++ 0.07% CMake 0.09% C 0.10% Makefile 0.02%

webinizer's Introduction

Webinizer

Important

Webinizer is now in Beta trial. We'd greatly appreciate your feedback!

About

Webinizer is a collection of tools to convert native applications, such as these programmed by C/C++/Rust, to Web applications which are constructed by HTML/CSS/JavaScript and WebAssembly.

Webinizer consists of two parts; a core engine that analyzes the code and then either fixes or highlights issues, and a web frontend to configure projects and display results. This repo consists of the core engine, for the web frontend see the webinizer-webclient repo.

We also provide the webinizer-demo repo that holds the demo projects and build scripts to setup Webinizer.

Setting up Webinizer

Run with Docker (recommended)

Webinizer provides scripts to build a Docker image that will setup everything for you and make Webinizer ready to use out of the box.

Please follow the Docker installation and setup guide for the detailed instructions.

Run locally

The Webinizer also supports running locally without Docker. Currently this is validated on Linux (Ubuntu 20.04).

Please follow the Run locally guide for the detailed instructions.

Documentation

Webinizer User Manual is available under documentation/ folder with below structure.

Using Webinizer

Extending Webinizer

Webinizer provides an extension mechanism for developers to extend the capabilities of the tool.

Areas under development

We're considering how to create a package format and repository hosting for libraries and applications ported to Wasm. There are proposals for module format and registry hosting in our wiki.

Setting up the development environment

The steps to setup the development environment are similar to those described in Run Webinizer locally.

Basic commands

  • npm run serve to launch the core engine server and start at port 16666.
  • npm run test to run the unit tests, see tests/README.md for details.
  • npm run lint-fix to format code with ESLint.
  • npm run doc to generate the Webinizer Extension API document into ./docs.
  • npm run swagger-autogen to generate the swagger specification for server RESTful APIs , see generate swagger specification for details.

Recommended IDE setup

It's preferred to use VS Code for development.

It's preferred to use Prettier formatter, along with Format on Save. Please setup the Prettier and ESLint extensions and configure them accordingly.

NOTE that we set printWidth as 100 and tab width as 2.

Contributing

We welcome contributions to Webinizer. You can find more details in CONTRIBUTING.md .

webinizer's People

Contributors

amitrahman1026 avatar dependabot[bot] avatar lingyuncai avatar ningw101 avatar pgc avatar rdower avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

webinizer's Issues

Enhancements for `Dependent packages check` advisor

image

Currently, dep_check advisor will just remove the find_package(XXX) statement but ignore other operations related to this emscripten ported library , which may cause the errors block the building process. We should make enhancements to avoid this problem.

  • For emscripten ported libraries (as shown in the above pictures), webinizer will add -sUSE_LIBXXX into the compiler & linker flags, and emscripten will take responsibilities of linking libraries and including header files directories, so except for find_package statement, the include_directories(${XX_INCLUDE_DIRS}), target_link_libraries(target ${XX_LIBRARIES}) and other operations related to this library are not necessary any more.
  • For the dependencies added from webinizer UI, should also remove the find_package(DEP) statement from the main project, besides, should adjust the statement pattern to target_link_libraries(target -ldepName)

Support more project metadata

We should support more project metadata and enhance the Publish page accordingly.

  • author
  • keywords
  • repository
  • homepage
  • bugs
  • license

The content of error not handled by webinizer is not well displayed

image

The reason is that the raw data of desc in actions is

"desc": "This error isnot handled by Webinizer, please try to resolve it manually:\n\n```emcc: error: no input files\n```",

and the emcc in content will be recognized and converted to code-block: language and the content will be ignored and not displayed.

Resolution:

https://github.com/intel/webinizer/blob/cf8459f2c83fa3b642155a671c3151dfa6d11fbd/src/advisors/errors_not_handled.ts#L39C52-L39C59
->

image

Develop `ModularizeJS` advisor

  • Modularize JS output configuration option is enabled by default, generally the building process goes well but errors will occur if we want to output html. Developing ModularizeJS advisor is to automatically detect the output target suffix and disabled modularize js out option if the output suffix is set as html.

Enhancements summary

As more and more projects are tested, more and more improvements will be found based on the current implementation. We open this issue to save and track these enhancements.

Enhancements for `SIMD` advisor

According to the emscripten documentation, there are five different ways to leverage WebAssembly SIMD in your C/C++ programs:

  • Enable LLVM/Clang SIMD autovectorizer to automatically target WebAssembly SIMD, without requiring changes to C/C++ source code.
  • Write SIMD code using the GCC/Clang SIMD Vector Extensions (__attribute__((vector_size(16))))
  • Write SIMD code using the WebAssembly SIMD intrinsics (#include <wasm_simd128.h>)
  • Compile existing SIMD code that uses the x86 SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2 or 128-bit subset of the AVX intrinsics (#include <*mmintrin.h>)
  • Compile existing SIMD code that uses the ARM NEON intrinsics (#include <arm_neon.h>)

x86intrin.h header file is usually used in C\C++ codebase, which contains the support of multiple instruction sets, commonly covering the one or several of MMX, SEE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, etc, but it is related to the what compiler you use. For the clang inside of the emsdk, it contains ia32intrin.h & mmintrin.h, which will not handled by emscripten during the building, so the better ways to port your project with SIMD support are:

  • if there is no SIMD code used in the codebase and you want to enable SIMD option to let compiler autovector to target wasm-simd, add -msimd128 is enough.
  • if your current codebase exists SIMD code, include <wasm_simd128.h> and then use the wasm SIMD intrinsics to replace your current code.
  • if your current codebase include SIMD code targeting x86 SSE* instruction sets, add -msimd128 and additionally corresponding flag.
    • For example, SSE: pass -msse and #include <xmmintrin.h>. Use #ifdef __SSE__ to gate code.

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.