Giter VIP home page Giter VIP logo

cooktail's Introduction

Cooktail

Homo amending

Lightweight Rendering engine similar to Harmony, but use Fre and quickjs

homo from yisar

It was also called Fre native!

  • Javascript Runtime with Zig and quickjs
  • UI framework use Fre.js
  • Graphics Library use LVGL
  • Event loop and Event bubbling
  • DOM diff and Flex layout alghrithom
  • cross-compilation with Zig

Usage

import { render, useState } from "fre"

function App() {
    const [count, setCount] = useState(0)
    const add = () => {
        console.log('u clicked a button')
        setCount(count + 1)
    }
    return (
        <view style={{ height: 100, width: 100 }} onClick={add}>
            {count}
        </view>
    )
}
render(<App />, document.body)

Run demo

1)build
zig build

2)run
./zig-out/bin/fre  dist/app.jsx

说人话

Homo 是一个小型渲染引擎,它和鸿蒙、flutter等拥有类似的架构,只不过使用 quickjs 和 fre 而已

它甚至完整演示了浏览器的运行过程,包括 eval fre code => dom diff => flex layout => event loop => event bubbling

和鸿蒙不同的是,Homo 更贴近 web 子集,而且 homo 的编译链路非常流畅,zig 交叉编译quickjs,特别适合前端er 学习研究

另外,homo 未来如果要上生产,嵌入式是一个研究方向,手表,手环等,fre 拥有最小的尺寸

虽然理论上它仍然可以交叉编译到安卓,但是我建议大家还是使用 flutter,因为 flutter 的完成度是个奇迹

另外一个方向是,我会研究将 homo 编译到 ue 和 unity,但那就是另外一个故事了

总之大家,这是我在前端的最后一个开源坑了,来年其他领域再贱

cooktail's People

Contributors

canwhite avatar

Watchers

 avatar

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.