Skip to content
A JavaScript-like and C based language for building user interfaces.
JavaScript C Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE docs: add bug report template Jun 16, 2019
.vscode chore(vscode): update settings Jun 1, 2019
bin feat(cli): add tradc Jun 15, 2019
docs docs: update design document Jun 16, 2019
example build(example): update include_directories Jun 16, 2019
images docs: update Chinese documention Jun 15, 2019
packages
test test: update compiler tesst Jun 16, 2019
.eslintrc.json chore: update eslint config Jun 16, 2019
.gitignore chore: update .gitignore May 26, 2019
CODE_OF_CONDUCT.md docs: update English documentation Jun 16, 2019
CODE_OF_CONDUCT.zh-cn.md docs: update Chinese documention Jun 15, 2019
CONTRIBUTING.md docs: update CONTRIBUTING.md Jul 28, 2019
CONTRIBUTING.zh-cn.md docs: update CONTRIBUTING.zh-cn.md Jun 17, 2019
LICENSE docs: update LICENSE Apr 8, 2019
README.md docs: fix typo (#5) Jun 18, 2019
README.zh-cn.md docs(README): add language switch Jun 17, 2019
package-lock.json feat(compiler): add resolve.extensions config Jun 7, 2019
package.json feat: add command-line interface (#3) (#7) Jul 22, 2019

README.md

Trad

Introduction

(中文/English)

A lightweight and C based language for building user interfaces.

Trad is:

  • Base on C: Trad compiles to readable, standards-based C. Its relationship with C is like the relationship between TypeScript and JavaScript.
  • Optimized for UI: Simplify your development work with syntax features specialized around the needs of user interface creation.
  • Easy to use: Designed for C developers' usage habits, you can get started quickly without having to spend a lot of time reading complex documents.
  • Not Productive: The current version of the architecture design has not been stable and is only used for technical communication, not for production.
  • Community-driven: small size, easy to read and modify. Anyone can participate in the design of language specifications, and this project development status is affected by community activity.
  • Cross platform: Support for Linux and Windows desktop platforms, but does not support Mac OS and mobile platforms

Trad's syntax is based on JavaScript, it has good compatibility with existing JavaScript development tools/editor extensions, and it won't change much for a long time, so you can temporarily write it as JavaScript.

Example

Installing

npm install -g tradlang

Usage

Compile to C source file:

tradc example.jsx

Compile to binary file:

gcc -c example.jsx.c
gcc -o example example.jsx.o -lLCUI

Note: The UI layer of the Trad application is powered by LCUI and you should install it before compiling.

The current version only implements the features required for the smallest sample application and cannot be applied to actual projects. Please wait for future updates.

Contribute

There are many ways to contribute to Trad.

Trad has adopted the code of conduct defined by the Contributor Covenant. This document is used across many open source communities, and we think it articulates our values well. For more, see the Code of Conduct.

Roadmap

The main tasks are listed below, for detailed work plans and progress please see the project boards.

  • Core
    • Basic syntax
    • Basic data type
    • Compatible with C syntax
    • Template literals (Template strings)
    • Function nesting and Closures
    • Decorator
    • await/async
    • Standard library
  • LCUI extension
    • Redesign language binding of LCUI
    • Implement the Widget.render() method
    • @UIThread decorator
  • Tool chain
    • Compiler
      • Command-line interface
      • Friendly error output
      • Line comments
    • Package manager
    • Building tool
  • Documention
    • FAQ
    • Language specification
    • Tutorial

License

Trad is MIT licensed.

You can’t perform that action at this time.