All Projects → Becavalier → Sharpen

Becavalier / Sharpen

Licence: Apache-2.0 License
(Demo) A v-dom "diff" engine based on WebAssembly, aim to build efficient and fluent web apps.

Programming Languages

javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language
CMake
9771 projects
HTML
75241 projects

Projects that are alternatives of or similar to Sharpen

Asm Dom
A minimal WebAssembly virtual DOM to build C++ SPA (Single page applications)
Stars: ✭ 2,604 (+12920%)
Mutual labels:  virtual-dom, webassembly
Awesome Wasm Runtimes
A list of webassemby runtimes
Stars: ✭ 490 (+2350%)
Mutual labels:  engine, webassembly
Uno
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
Stars: ✭ 6,029 (+30045%)
Mutual labels:  mvvm, webassembly
Asm Dom Boilerplate
A simple boilerplate to start using asm-dom without configuration.
Stars: ✭ 49 (+145%)
Mutual labels:  virtual-dom, webassembly
Mini Mvvm
基于 virtual dom 的轻量级mvvm库 >_<#@!
Stars: ✭ 62 (+210%)
Mutual labels:  virtual-dom, mvvm
Cascade
A modern library for creating user interfaces.
Stars: ✭ 50 (+150%)
Mutual labels:  virtual-dom, mvvm
Nice Lua
基于xlua的MVVM框架,支持Addressables, 统一渲染管线等Unity新特性
Stars: ✭ 207 (+935%)
Mutual labels:  engine, mvvm
Percy
Build frontend browser apps with Rust + WebAssembly. Supports server side rendering.
Stars: ✭ 1,856 (+9180%)
Mutual labels:  virtual-dom, webassembly
Ioing
Implement the solutions of performance improvement and componentization for your SPA (single page application) products with this Progressive Web App Development Engine.
Stars: ✭ 224 (+1020%)
Mutual labels:  virtual-dom, mvvm
Mp3ID3Tagger
🎶🎵A macOS application to edit the ID3 tag of your mp3 files. Developed with RxSwift and RxCocoa. 🎸🎼
Stars: ✭ 17 (-15%)
Mutual labels:  mvvm
MvvmScarletToolkit
MvvmScarletToolkit is a personal project and framework to speed up the development process of xaml based applications using the viewmodel first approach
Stars: ✭ 23 (+15%)
Mutual labels:  mvvm
Noted-Android
Noted app for android
Stars: ✭ 78 (+290%)
Mutual labels:  mvvm
Uno.Themes
This library is designed to help you use the material design system with the Uno Platform
Stars: ✭ 112 (+460%)
Mutual labels:  webassembly
OrdersManagementSystem
Project demonstrates usage of Prism composition library, Material design library, SQL Server, Entity Framework in WPF application
Stars: ✭ 29 (+45%)
Mutual labels:  mvvm
RxSwiftDemo
RxSwift Demo
Stars: ✭ 19 (-5%)
Mutual labels:  mvvm
ReMVVM
ReMVVM is an application architecture concept, marriage of Unidirectional Data Flow (Redux) with MVVM.
Stars: ✭ 180 (+800%)
Mutual labels:  mvvm
cat-o-licious
Cat game written in Go
Stars: ✭ 100 (+400%)
Mutual labels:  webassembly
PlayAndroid
✌️✊👋玩安卓Mvvm组件化客户端,整合Jetpack组件DataBinding、ViewModel以及LiveData;屏幕适配✔️状态栏沉浸式✔️黑夜模式✔️,无数据、加载失败状态页;骨架屏、Koin依赖注入等
Stars: ✭ 193 (+865%)
Mutual labels:  mvvm
Kade-Engine
Kade Engine is a Competitive Rhythm Game engine rewrite for FNF with Quality of Life features included.
Stars: ✭ 400 (+1900%)
Mutual labels:  engine
MiniRTS
A game engine to learn about game engine development
Stars: ✭ 99 (+395%)
Mutual labels:  engine

⚡️Sharpen

experimental

A v-dom "diff" engine based on WebAssembly, aim to build efficient and fluent web apps.

Basic Concept

We use the following kind of data structure to pass the "Diff" info of input DOMs from the C++ side to JavaScript side. All the data exchange through these two contexts will be encoded and decoded as standard JSON format by our lightweight specialized JSON parser (Not a standard full-parser). Here we can call the following data structure is "DDIR". Each "Object" structure shows in the following "Array" stucture will be regared as a diff "Commit", and those commits will be transacted and inflected on the real DOM by the specific JavaScript code.

DDIR:
[
    ...,
    {
        _CP_ACT_: _D_,
        _CP_TYP_: _HTML_,
        _CP_VAL_: TypeRoot*
    },
    {
        _CP_ACT_: _U_,
        _CP_TYP_: _ATTR_,
        _CP_HAS_: TypeRoot*,
        _CP_KEY_: TypeRoot*,
        _CP_VAL_: TypeRoot*
    },
    {
        _CP_ACT_: _C_,
        _CP_TYP_: _TEXT_,
        _CP_HAS_: TypeRoot*,
        _CP_VAL_: TypeRoot*
    },
    {
        _CP_ACT_: _U_,
        _CP_TYP_: _STYLE_,
        _CP_HAS_: "",
        _CP_KEY_: TypeRoot*,
        _CP_VAL_: TypeRoot*
    }
    ...
]
  • Why do we use JSON?

Because "JSON" is lightweight and it's easy to encode and decode, also it's better to reduce the overhead between WebAssembly and JavaScrit contexts by this kind of "one-time" data delivery. But it seems that we can discard it after the "Host-binding" and "Reference Type" featrues are implemented.

Getting Started

Compile

If you want to compile and use this project, please install the following software before:

then, run the following command to compile the core engine:

npm run build

then, build the "html" demo:

cd test/html && npm run start

finally, serve the demo:

npm run serve

Others

  • Unit Test:

We use "googletest" to proceed the unit test of the source code, run the following command:

npm run test

  • Code Lint:

We use "cpplint" to check the code style, you can install it by the follow command:

pip install cpplint

And lint the source code by:

npm run lint

  • Memory Check:

Install "valgrind" on MacOS according to the following article first:

How to Install Valgrind on macOS High Sierra

Then run the following command to detect the memory leak of the binary version program:

npm run memcheck

Roadmap

  • Add benchmark (basic JavaScript version);
  • Fix memory leak;
  • "Preact" support;
  • Support "Levenshtein-Distance" search (separated);
  • Support partial changes on "style" tag;
  • GC support (Post-MVP);
  • Reference type and host-binding (Post-MVP);
  • Optimize JSON parser;
  • Upgrade Emscripten to version 1.39.0 or above;
  • Enable Google Closure Compiler;
  • Multithreading support;

BTW

  • application/wasm

Please make sure your backend server can normally responding ".wasm" type file with application/wasm header, if you wanna get a resonable loading time for static resources.

Copyright and License

Licensed under the Apache License, Version 2.0 (the "License");

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].