XiaoXuan Programming Language
XiaoXuan Language is a full-stack programming language that allows you to learn one language to develop all kinds of programs.
Currently, it can be used to develop a variety applications, including digital circuits and chips, microcontroller programs, GPU shaders, system programs, local native programs, cloud native programs, web applications and more.
XiaoXuan Language achieves this by providing multiple backends and variants, all of which follow the same syntax and design philosophy. This frees developers from the burden of learning multiple programming languages and tools.
XiaoXuan Language consists of the following variants:
-
XiaoXuan Core Build powerful user-space system programs that have extremely fast startup speed and small memory footprint, it can directly call syscall and interoperate with C shared libraries. Single-file, statically linked runtime make applications highly portable.
-
XiaoXuan Script Build high-performance, solid web applications. It can be compiled to WebAssembly on-the-fly without the need for any build tools. It aims to be the next programming language for web development.
-
XiaoXuan Managed Build extremely secure, robust, truly portable and responsive programs, including desktop applications, cloud-native applications (such as microservices and serverless functions etc.), business systems, data science and A.I. programs and more. Each program runs in its own isolated environement, eliminating the need for containers. Applications do not need to be installed, they can be run with just a URL.
-
XiaoXuan Native A memory-safe, general-purpose programming language inspired by Rust. It is designed to be simpler than Rust while it still provides automatic memory management without garbage collection, and avoids complex concepts such as ownership, borrow checking, and lifetimes. It aims to replace Rust in certain non-critical scenarios. It currently supports compiling to native code for architectures x86-64, aarch64 (ARM64), riscv64 and s390x (IBM Z), and will supports loongarch64 in the future.
-
XiaoXuan GPU A modern shading language designed to facilitate the rapid development of high-performance programs such as game engines, AR, AI engines, data analysis, biocomputing, scientific computing, and more. It features the same elegant syntax and design philosophy as the XiaoXuan Lang, allowing you to develop in new domains without learning a new language.
-
XiaoXuan Micro Build high-performance firmware for microcontroller (MCU) easily, the built-in micro VM makes it possible to “write once, run anywhere”, build IoT applications in a more modern way.
-
XiaoXuan Logic A brand new and modern hardware description language (HDL) that lets you design hardware and chips in the same ease and collaboration as open-source software. Its built-in GPU-accelerated simulator dramatically enhances test efficiency, saving you valuable time and resources.
Localization
The XiaoXuan Language supports writing code in local languages, such as Chinese, Japanese and French. In addition to keywords, the standard library and related documentation are also translated into local languages. Using local language programming is beneficial for children, beginners and non-computer majors who are not native English speakers.
The local language variants are as follows:
- XiaoXuan Core Hans - The simplified Chinese edition (简体中文版) of XiaoXuan Core.
Which one should I choose?
There are three variants designed for specialized application development:
- XiaoXuan Script: for building web applications.
- XiaoXuan Micro: for building microcontroller firmware.
- XiaoXuan Logic: for developing hardware such as digital circuits and chips.
The other three variants are general-purpose programming languages. However, the assets they generate run differently, so they have different focuses:
- XiaoXuan Core: for building command-line tools, system programs.
- XiaoXuan Managed: for building server-side service programs, business systems, data processing programs, and desktop applicatons.
- XiaoXuan Native: for building performance-critical native applications.
Where to get started
If you are a beginner in XiaoXuan Programming Language, it is recommended to start with XiaoXuan Script. Because it doesn’t require you to download or install any programs, there is an online testing page on the project’s web site where you can write and run XiaoXuan Script programs to learn about the syntax and main features.
If you perfer to write programs that run locally, it is recommended to start with XiaoXuao Core, which makes it very easy to write utilities. Once you are familiar with XiaoXuan Core, it will be easier to move on to XiaoXuan Managed and XiaoXuan Native.
- Get started with XiaoXuan Script in 5 minutes
- Get started with XiaoXuan Core in 5 minutes
Language features
TODO
Example program
TODO
Manuals & Tutorials
-
M01 - The XiaoXuan Programming Language Reference
Syntax, fundamental, and the standard library2023-04-16- Data types and Literals
- Variables
- Functions
- Collection
- Control Flow
- Error Handling
- Method, Generic and Interface
- Pattern
- Chain
- Modules, Packages and Properties
- Annotations and IoC
- Macro
-
S80 - Zero to OS: Building Your Own Usable Operating System, Volumn 1: The User Space
Build the user-space part of an OS for RISC-V platform from scratch in XiaoXuan Core2024-01-09- Set up a RISC-V virtual machine using QEMU
- Write a minimal `init` program
- Write a minimal `shell` program
- Fundamentals of file system and processes, implementing the `pwd` and `ls` commands
- Implement the `mount` and `umount` commands
- Principals of `redirect`, implementing the `echo` and `cat` commands
- Principal of `pipe`, implementing the `tee` and `tr` commands
- Session and process groups
- The `root` privileges, users and groups, and the `setuid` bit
- Add support for shell scripts
-
S82 - Building a Docker-like Container Utility from Scratch using XiaoXuan Core
Linux namespaces, capabilities, seccomp and virtual networking2024-01-15- The principal of Linux container
- Isolating the file system
- Isolating the process space
- Isolating the accounts
- The virtual networking devices and route