MIT License

项目介绍

samuelmtimbo/unit 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,采用 MIT License 许可证,目前获得 4.9k 个 Star、170 次 Fork。

仓库全名
samuelmtimbo/unit
开源许可证
MIT License
Star 数
4.9k
Fork 数
170

README 摘要

Unit Next Generation Visual Programming System Unit Unit is a General Purpose Visual Programming Language and Environment built with a primary focus on Developer Experience. It is heavily inspired by Live, Data Flow, Reactive, Functional and Object Oriented Programming paradigms. Formally, units are Multi Input Multi Output (MIMO) Finite State Machines (FSM). A program in Unit is represented as a Graph. The Unit…

完整内容见 GitHub 原始 README 或本页 。

常见问题

unit 用什么语言开发?

主要使用 TypeScript 编写,采用 MIT License 许可证,目前有 4.9k 个 Star。

unit 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 unit 的源码?

可以直接克隆仓库:git clone https://github.com/samuelmtimbo/unit.git;安装与运行步骤见仓库 README。

unit 最近还在维护吗?

仓库最近一次更新为 4 天前,当前没有未关闭的 Issue;Star 数为 4.9k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Next Generation Visual Programming System

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

HTML
JavaScript
TypeScript

README

Unit

Next Generation Visual Programming System

Unit merge sort example

Unit

Unit is a General Purpose Visual Programming Language and Environment built with a primary focus on Developer Experience.

It is heavily inspired by Live, Data Flow, Reactive, Functional and Object Oriented Programming paradigms. Formally, units are Multi Input Multi Output (MIMO) Finite State Machines (FSM). A program in Unit is represented as a Graph.

The Unit Programming Language was developed in close junction to the Unit Programming Environment, which is a Web application built for easy composition of new units. The environment is designed to feel visual and kinesthetic, giving the perception of Direct Manipulation of Live Virtual Objects. The Unit Programming experience is minimalistic, ergonomic, mobile, and can be performed through a variety of input devices, and editing can be partially expressed through Drawing, Gesture and Voice.

Unit is similar in concept to the Unix shell. For a seasoned programmer, Unit should feel like the 2D evolution of the Command Line Interface (CLI) where units’ (commands) inputs and outputs (stdin/stdout/stderr) can be piped together into a graph (script). Unit can be thought of as a re-exploration of the Unix Philosophy in the context of modern Software Engineering and Web Development.

The Unit system is set to grow into a simple and approachable Web Operating System, which is sandboxed by default, enabling a new era of Software Sharing and Collaboration, unifying the currently fragmented Computer Experience.

For an introduction to Unit Programming, visit Getting Started.

The broader design philosophy behind Unit is discussed in Concept.

To jump right into the official Unit Programming Environment, visit unit.land (beta).

Check out a collection of public open source units at unit.tools (beta).

Development

Install npm and git if you haven’t already.

Clone this repository:

git clone [email protected]:samuelmtimbo/unit.git

Get into the unit folder:

cd unit

Install:

npm install

Setup:

npm run setup

Start a local unit server:

npm start

For development mode:

npm run watch

Server

The quickest way to serve a local Unit Environment:

npx @_unit/unit

Then visit http://localhost:4000

Alternatively, specify a port:

npx @_unit/unit --port 8042

Library

Unit source code can be used as a general purpose library in any JavaScript project, both on Web and Node.js.

npm install --save @_unit/unit

To install unit globally:

npm install --global @_unit/unit

Usage

To render a unit JSON bundle:

import { renderBundle } from '@_unit/unit/client/platform/web/render'

const root = document.getElementById('root')

const bundle = {
  spec: {
    units: {
      helloworld: {
        id: 'a9cbed12-9a53-11eb-8c2e-f3146b36128d',
      },
    },
    render: true,
    component: {
      subComponents: {
        helloworld: {},
      },
      children: ['helloworld'],
    },
  },
}

const [system, graph] = renderBundle(root, bundle)

const helloworld = graph.getUnit('helloworld')

helloworld.push('style', {
  color: '#ffdd00',
})

To boot a system and instantiate a new unit on it:

import { boot } from '@_unit/unit/client/platform/node/boot'
import { fromBundle } from '@_unit/unit/spec/fromBundle'
import _specs from '@_unit/unit/system/_specs'

export const [system] = boot()

const bundle = require('./MergeSort.json')

const MergeSort = fromBundle(bundle, _specs, {})

const mergeSort = new MergeSort(system)

mergeSort.play()

mergeSort.push('a', [2, 1])

console.log(mergeSort.take('a')) // [1, 2]

Server

To start a local Unit server:

unit

Build

To build a Unit JSON bundle into a website, try:

unit build bundle.unit

This will produce a index.js file that can be loaded into HTML:

<body>
  <div
    id="__SYSTEM__ROOT__"
    style="
      display: block;
      position: absolute;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
    "
  ></div>
  <script type="text/javascript" src="index.js"></script>
</body>

Check index.html for a more complete template.

Test

npm test

List of related web applications:

unit.software

Landing page featuring the Unit language and system’s vision.

unit.md

Redirect to the official unit source code.

unit.land

Fully local version of the Unit Environment.

Any *.unit.land subdomain represents a completely isolated instance of the Unit system.

unit.tools

Marketplace to explore, collect and play with open live visual programs built in Unit.

unit.moe

Appending #url to https://unit.moe will attempt to encapsulate the unit served at that URL in a graph editor. This is helpful for debugging an open unit website, for instance:

https://unit.moe#https://unit.software will show the code for https://unit.software. https://unit.moe#https://unit.land will show the code for https://unit.land. https://unit.moe#https://unit.tools will show the code for https://unit.tools.

Documentation

The Unit Programming Environment was designed to be learnable by Experimentation and Exploration. Visual and written documentation about each unit can be accessed using Info Mode.

This codebase is a TypeScript implementation of the unit Programming Language Spec with an accompanying Web based Programming Environment.

Contributing

Please feel free to clone or fork Unit’s source code.

This is the best place to learn about Unit’s design and implementation, and the official channel for Open Source collaboration.

The project is open for pull requests.

See CONTRIBUTING for guidelines.

Everyone interacting in Unit and its sub-projects’ codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Unit code of conduct.

The Unit project has nearly infinite space for creative freedom, invention, and intimacy, which is what has motivated it from the start.

Backlog

Unit system API is composed of logical, platform (frontend and backend) and “operating system” units.

The direction of growth right now is ensuring a robust basic UI/UX and feature parity with Web and a subset of NodeJS (not native to the Web), like TCP and HTTP.

Visit Evolution to learn more about where Unit development is headed.

Community

If you have a question or a suggestion related to Unit, or if you just want to talk about the future of Programming, or if you wish to join the Unit team, feel free to message me at @io_sammt or email me at [email protected].

For updates about Unit’s development, including thoughts about vision and roadmap, follow us on X @io_unit.

We hope you enjoy Unit and invite you to be part of our community!

License

MIT License

Copyright UNIT IO, Inc

评论

暂无评论