Skip to content

U Logo

The U Programming Language

This documentation is a work in progress, improvements are always welcome.

Please ensure you have read the Introduction.

If you are more interested in U syntax, please skip to U in 5 min.

The ultimate aim of U design is to improve the way programmers think and work when delivering valuable applications. Most easy languages are easier to write initially but required a lot of efficiency improvements and fine-tuning afterward. Our goal is to provide a way to express fast, robust, distributed systems by just giving directives to the U compiler.

Depending on your experience, imagine that you could save at least 30% of your time by just switching to U. Improve your productivity by reducing compile-time, debugging-time, and prototyping-time with U.

To reach that goal, U aims to be:

  • as simple, flexible as Python/Ruby/Js,
  • as fast, universal as C/C++,
  • as safe as rust, or a functional language,
  • as fun as [your favorite programming language].

U aims to be used in a wide variety of domains, except DO-178B for now ;).

Basic Syntax

In U, printing "Hello, world!" can be done in a single line in hello.u:

\< "Hello, world!"

Here is another version using the main entry point:

# This is a comment
# '\/' is the program entry point, like 'main' in C/C++. 
# '\/' represents the V of U.
\/ {
    # Bind a variable 'hello' to a string 'Hello world!'
    :hello : 'Hello, World!'

    # Call function '\<' to display the message
    # '\<' is like 'puts', 'print', or 'println' in others languages.
    \< hello
}
The Entry Point or main is optional if it's just a script.

Why U ?

U is a perfect match to deliver reliable, high-performance systems. We call Ulet a dynamic language used at compile time to generate statically compiled code. This is way better than generics, preprocessor, or comptime keyword.

For simplicity, we use the term U to describe the pair U + Execution Model .

U aims to prevent common programming errors by relying on its powerful syntax, its efficient type system, and modern programming patterns:

  • No null, nil, undefined keywords. Optional values are handled explicitly.
  • All type cast operations are explicit.
  • Variables must be initialized.
  • Integer overflow is controlled.

Memory is explicitly managed:

  • No buffer overruns, dangling pointer, or uninitialized memory access.
  • Out-of-bounds memory accesses with array indices.

U execution model includes by default:

  • No mutable variable → variables mutation is possible but strictly tracked.
  • Iterators → loop constructs are possible but iterators like map, each, are prefered for easy analysis and performance.
  • No Data Invariant Violations → Arrays, Sets updates can be stricly controlled.

U code is compiled and optimized to run on modern hardware. The U compiler is powered by the LLVM framework. The combination of safety and speed makes U an excellent choice for most systems: web apps, distributed infrastructure, low-level and embedded systems.

What makes U different in static mode?

  • Values are Immutable.
  • Type safe: Types are optional in U. The compiler guess (infer) values type most of the time, but you can add type annotations only if needed. See U Type System.
  • Memory safe: to prevent dangling pointers, buffer overruns, and other undefined behaviors, U keeps data about any value to ensure system-wide integrity.
  • Compile-time concurrency check: U type system ensures at compile time that concurrent and parallel parts of your system – like thread, locks, atomic operations – do not create data races or deadlocks. So you can write highly distributed code with confidence.
  • Optional Compatibility with C.
  • Efficient package management.

Features from other languages that U simplify:

  • No header files: freeze files' version to generate file signatures. U's build system Ugo optimizes modularity and dependencies for better code reuse.
  • No generic/preprocessor/meta-programming: use your dynamic language for infinite possibilities.

  • No exceptions: There are no built-in exceptions, no runtime exceptions. Exceptions are specified with user defined semantics if needed.

  • No built-in garbage collector: use user defined semantics.
  • No built-in memory management: use user defined semantics.
  • No built-in asynchronous events management: use user defined semantics.

Built to grow

U lets you grow its syntax: write less pretty code, extend, support or optimize it. Every U's layer is tailored and optimized to give full power to developers:

No one can predict every possible need or hardware platform developers will face in the future: new Iphones, AI models, better web architecture, autonomous cars, ...

U is built to grow to prevent it from being drowned out by useless core features in the future. It does not provide an all-in-one framework, but a simple parser on top of which everything piece is a user defined function. This optimally moves complexity from language implementation to user defined function management. It ensures the safety and clarity of U.

U syntax is powerful and has only one purpose: to make sense of your code structure. Not only to build efficient systems but also to have a common standard to share ideas with other doers.

With U, you only communicate your intent one way. Humans and machines read it the same way. U cannot be verbose or restrictive to be able to grow. Its facilities for abstraction behind the expressiveness is one of the most critical factors.

High Performance vs High Productivity

Unlike other languages, U's focus is not on high performance but rather on high productivity. High performance is all about coding a solution to a problem and make it fast. With high productivity, the solution starts when developers receive the problem and stop when the system runs on production.

Performance vs Productivity

U aims to support the complete solution process: programming, debugging, deployment, system administration – just everything involved in efficient systems design.

Towards Heterogeneous Systems

See Heterogeneous Systems.

Motivation

See Motivation.

Key features

See Key features.

Key Ideas

See Key Ideas.

Mental Models

See Mental Models.