/wor·tiks/
Strange dynamic programming and scripting language that performs mathematical computations on a connected Raspberry Pi Pico (RP2040) through UART connectivity.
Despite its unconventional and dynamic behavior, as well as its lack of fundamental APIs, Uartix can still serve as a general-purpose programming and scripting language. The following points outline the reasons behind the development of Uartix:
The language includes standard control flow constructs such as if
, while
, and loop
, as well as more specialized ones like unless
, when
, and random
. These constructs enable developers to write clear and concise code that directly expresses their intent, reducing the need for verbose and boilerplate code.
One of the standout features of Uartix is its support for multiple numerical bases, including binary, trinary, octal, and hexadecimal, in addition to standard decimal numbers.
Uartix introduces an innovative test
statement that facilitates in-code testing and validation. This feature allows developers to embed tests directly within their codebase, providing a streamlined approach to verifying functionality and ensuring code correctness. The test
statement is particularly useful for unit testing, where individual components of the code can be tested in isolation.
A distinctive feature of Uartix is its treatment of control flow constructs as expressions rather than traditional statements. This design choice enhances the language's expressiveness and flexibility, allowing control flows to be used as part of larger expressions.
true
, false
, and maybe
Uartix introduces unique boolean constructs true
, false
, and maybe
, which add a layer of versatility and unpredictability to the language's logic handling. While true
and false
are standard boolean values, maybe
is a distinctive feature that represents an uncertain or probabilistic state, which is resolved at runtime.
The Hello World program in Uartix demonstrates the basic syntax and functionality of the language, showcasing how to define and call a function that generates a simple greeting message. This example introduces key concepts such as function definition, string concatenation, and function invocation, providing a foundation for more complex programs.
hello.utx
# Hello world example
greet = func(name)
render "Hello, " + name;
greet("world");
The line greet = func(name)
defines a function named greet
that takes a single parameter, name
. In Uartix, the func keyword is used to declare a function. The assignment greet = func(name)
binds this function to the identifier greet
, allowing it to be called later in the program. The parameter name
represents the input that the function will receive when it is called.
Within the function body, which is indicated by the indentation following the function definition, there is a single statement: render "Hello, " + name;
. This line uses the render
keyword, which is a command in Uartix to output text to the console or display. The expression "Hello, " + name
demonstrates string concatenation, where the literal string "Hello, "
is combined with the value of the name
parameter. The resulting string is then rendered or displayed as the output of the function.
Finally, the line greet("world");
calls the greet
function with the argument "world"
. When this line is executed, the function greet
is invoked, and the string "world"
is passed as the parameter name
. Inside the function, this parameter is used to create the greeting message. Consequently, the render
statement outputs the concatenated string "Hello, world"
, which is the final result of the program.
Uartix is an open-source project and is voluntarily developed. If you find Uartix useful and would like to support its continued development and improvement, you can make a donation.