Rust-based language and runtime for cross-platform app development

Related tags

Command-line pax
Overview

Pax

Pax is a cross-platform rendering engine & Rust framework for interactive graphics, animations, and GUIs.

Pax extends the Rust programming language with a syntax for declarative component-based graphical content and behavior. Pax programs compile through Rust into lightweight native app executables or WebAssembly-powered Web apps with a <100kB base footprint and up to 120FPS rendering.

As of September 2022, Pax is being developed in the open, in alpha preview.

Example

Following is a simple Pax component called IncrementMe:

//increment-me.rs

use pax::*;
use pax_std::{Text};
use pax_std::forms::{Button, ArgsButtonSubmit};
use pax_std::layout::{Stacker};

#[pax(
  <Stacker cells=2>
    <Text>{"I have been clicked " + self.num_clicks + " times."}</Text>
    <Button @submit=self.increment>"Increment me!"</Button>
  </Stacker>
)] 
pub struct IncrementMe {
  pub num_clicks: Property<i64>
}
impl IncrementMe {
  pub async fn increment(&self, args: ArgsButtonSubmit) {
    let old_num_clicks = self.num_clicks.get();
    self.num_clicks.set(old_num_clicks + 1);
  }
}

Any Pax component like the example above may be included inside other Pax components, or may be mounted as the root of a stand-alone app.

See a more thorough and running example in the docs.

Docs

Read more in The Pax Docs

Getting Started

Refer to the guide for getting started in the Pax docs.

Current status & support

Pax is in alpha-preview and is not yet viable for building apps — read the latest status.

End-to-end:

  • Syntax design
  • Parser
  • Compiler front-end WIP
  • Compiler back-end
  • Rendering engine
  • Cross-platform chassis
  • Browser runtime
  • macOS runtime

Support matrix:

Web browsers Native iOS Native Android Native macOS Native Windows Native Linux
Development harness & chassis
2D rendering and UIs
Canvas

CoreGraphics

Cairo

CoreGraphics

Direct2D

Cairo
3D rendering and UIs
Vector graphics APIs
2D layouts
Animation APIs
Native text rendering
DOM

UIKit

android:*

SwiftUI

System.Windows.Forms

GTK
Native form elements
DOM

UIKit

android:*

SwiftUI

System.Windows.Forms

GTK
Native event handling (e.g. Click, Tap)
Rust host language
WASM

LLVM

LLVM

LLVM

LLVM

LLVM
JS/TypeScript host language
Legend:
Supported
Not yet supported

License

© 2022 The Pax Foundation [[email protected]].

This project is licensed under either of:

at your option.

Development

Architectural Reference

Runtime dependency & codegen graph



Pax compiler sequence diagram | Compiler source

Optional environment setup, web chassis

  • Install wasm-opt via binaryen:

    brew install binaryen
  • Install 'wasm-pack' via:

     curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh 
  • Install node: https://nodejs.org/en/download/

  • Install yarn:

    # if necessary: sudo chown -R yourusername /usr/local/lib/node_modules 
    npm i --global yarn

Optional environment setup, macOS chassis

  • Install xcode, command line utils

Running Development Environment

First, refer to the latest project status

The current leading edge of development is in the compiler —

cd pax-compiler
./run-example.sh

To run pax-example's parser binary and print its output to stdout:

cd pax-example
cargo build --bin=parser --features=parser

To run a full, compiled Pax example you must check out an older branch and run the demo there.

git checkout jabberwocky-demo
./run.sh # or ./run-web.sh

To initialize the docs submodule, for super-grep powers:

git submodule update --init --recursive

As needed, review the git submodule docs.

You might also like...
Umpteen is a general-purpose programming language currently in active development being bootstrapped from Rust

The Umpteen Programming Language This repository provides the reference implementation for the Umpteen Programming Language, bootstrapped from Rust. U

A cross-platform graphical process/system monitor with a customizable interface and a multitude of features
A cross-platform graphical process/system monitor with a customizable interface and a multitude of features

A cross-platform graphical process/system monitor with a customizable interface and a multitude of features. Supports Linux, macOS, and Windows. Inspired by both gtop and gotop.

A simple cross-platform easy to use STL Viewer with GUI and CLI options
A simple cross-platform easy to use STL Viewer with GUI and CLI options

Stlvi STL viewer written in Rust. This project is still in development. It is available in both CLI and GUI mode. Supported OS Linux Windows Mac Scree

Cross-platform file sharig application for desktop and mobile devices
Cross-platform file sharig application for desktop and mobile devices

Skylite Description Getting Started Dependencies Installing Executing program License Acknowledgments Description Cross platform file sharing applicat

Cross-platform GameMaker extension for getting system information and resource usage
Cross-platform GameMaker extension for getting system information and resource usage

GM Sysinfo Cross-platform GameMaker extension for getting system information and resource usage Table of Contents Table of Contents Examples Display m

Rust-battery - Rust crate providing cross-platform information about the notebook batteries.

battery Rust crate providing cross-platform information about the notebook batteries. Table of contents Overview Supported platforms Install Examples

Cross platform terminal library rust
Cross platform terminal library rust

Cross-platform Terminal Manipulation Library Crossterm is a pure-rust, terminal manipulation library that makes it possible to write cross-platform te

Cross-platform Rust rewrite of the GNU coreutils
Cross-platform Rust rewrite of the GNU coreutils

Cross-platform Rust rewrite of the GNU coreutils

A cross platform, rust implementation for the Tegra X1 bootROM exploit
A cross platform, rust implementation for the Tegra X1 bootROM exploit

Switcheroo A CLI and GUI for the RCM BootRom exploit (Fusée Gelée exploit for Nintendo Switch) Only works on unpatched Switches: https://ismyswitchpat

Owner
Pax
Rust-based language and runtime for cross-platform app development
Pax
A pure Rust, cross-platform soundboard app

afx This thing is my attempt at a soundboard program. afx.mp4 Why? I tried some prior art and decided that none of the existing options fit my needs.

Andrew Kvapil 11 Dec 15, 2022
Simple macros to write colored and formatted text to a terminal. Based on `termcolor`, thus also cross-platform.

Bunt: simple macro-based terminal colors and styles bunt offers macros to easily print colored and formatted text to a terminal. It is just a convenie

Lukas Kalbertodt 202 Dec 22, 2022
Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Tim Oram 1.2k Jan 2, 2023
Build light & secure cross-platform applications with a web-based UI

Millennium Icon by XFaon. *Stats are from Tauri and may not be fully accurate. Millennium is a cross-platform webview framework written in Rust. With

pyke 20 Dec 29, 2022
Platform that enables Windows driver development in Rust. Developed by Surface.

windows-drivers-rs This repo is a collection of Rust crates that enable developers to develop Windows Drivers in Rust. It is the intention to support

Microsoft 1.1k Oct 11, 2023
A cross-platofrm desktop app to manage your ports made with Dioxus and Rust.

Port Manager A cross-platofrm desktop app to manage your ports made with Dioxus and Rust. This app has been tested only on macOS. Test on other platfo

Muideen 3 Mar 30, 2024
A todo list app that indexes your app to find TODO:'s

forgot A todo list app that indexes your app to find TODO:'s Usage to list all your todos forgot list list all your todos ignoring search in ./target,

null 2 Oct 6, 2022
Cross-platform Rust library for coloring and formatting terminal output

Coloring terminal output Documentation term-painter is a cross-platform (i.e. also non-ANSI terminals) Rust library for coloring and formatting termin

Lukas Kalbertodt 75 Jul 28, 2022
Write Cross-platform application with React-like decralative UI framework and scalable ECS architecture all in Rust.

bevy_dioxus Dioxus Plugin for Bevy Write Cross-platform application with React-like decralative UI framework and scalable ECS architecture all in Rust

Junichi Sugiura 269 Dec 29, 2022
Are we lang yet? A simple website providing information about the status of Rust's language development ecosystem.

Are We Lang Yet This project answers the question "Is the Rust ecosystem ready to use for language development yet?". arewelangyet.com What is this? C

null 8 Dec 7, 2022