Uartix Programming Language

/wor·tiks/

Strange dynamic programming and scripting language that performs mathematical computations on a connected Raspberry Pi Pico (RP2040) through UART connectivity.




Why Uartix?

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 Raspberry Pi Pico, with its dual-core ARM Cortex-M0+ processor, offers an irrelevant yet affordable platform for hardware-level computation.
  • Uartix provides a specialized environment where developers can perform mathematical operations directly on the hardware.
  • Compared to many external coprocessors, Uartix running on a Raspberry Pi Pico presents a highly cost-effective solution. The affordability of the Pico reduces overall project costs while still delivering substantial computational power for a variety of applications.
  • The Raspberry Pi Pico, with its energy-efficient ARM Cortex-M0+ cores, offers a low-power solution for performing mathematical calculations which is perfect for Uartix runtime execution.
  • Why not? I was bored when I started developing this.

Your First Program

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.


Development Support

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.




Copyright 2024 © Nathanne Isip