Skip to content

Apertures provide several benefits:

Use any name: U has no direct keywords, allowing flexibility in naming.
Efficient compilation process: Anything not guarded by an Aperture is sent directly to the parser and processed as user code, ensuring a streamlined compilation process (benchmark results coming soon).
Control all compiler phases: Apertures allow you to define generics, create complex types, and fine-tune hardware attributes similar to alignof in GCC or attributes in Clang.
Extend U grammar: You can define user functions or embed another language to declare your data in formats like YAML or use CSS.

=============

An Aperture consists of one or more operators beginning with colon : or escape \ like ':', ':%', or '\'. Apertures interrupt user code processing to enable dynamic code execution. Only operators are allowed as Apertures; no alphanumeric characters can be used.

Since the colon : and escape \ characters are reserved for Apertures, operators cannot start with these characters.

Apertures provide several benefits:

  • Use any name: U has no direct keywords, allowing flexibility in naming.
  • efficient compilation process: Anything not guarded by an Aperture is sent directly to the parser and processed as user code, ensuring a streamlined compilation process (benchmark results coming soon).
  • Control all compiler phases: Apertures allow you to define generics, create complex types, and fine-tune hardware attributes similar to __alignof__ in GCC or attr__attributes__ in Clang.
  • Extend U grammar: You can define user functions or embed another language to declare your data in formats like YAML or use CSS.

    # This will generate an Array with ['name', 'password']
    :%yaml{
    - name
    - password
    }
    

With Apertures, most programming patterns can be expressed. Each aperture has its meaning to cover nearly all compiler phases.

U has the following apertures:

For a complete aperture list, see Grammar.

All apertures will be frozen on version 1.0 with community submissions. Feel free to contribute with your ideas.