The current version of the compiler is NOWUT 0.25 and the documentation is here.

What is NOWUT?

NOWUT is the name of a programming language that was created in 2018, and it also refers to the self-hosted compiler which implements the language. The compiler is offered under the terms of the GPL. It currently targets 16- and 32-bit x86 CPUs, 68000, and SH2. A separate linker (LINKBIN) is included to handle several output formats, while Win32 programs can be built using the third party GoLink.

The earliest, pre-release version of the compiler was written in FreeBASIC. It took about 40 hours to translate the FB code into NOWUT, reimplement necessary console and file I/O functions, and squash bugs until it could build a matching copy of itself. The resulting executable was also 10 times quicker and one third the size.

The goal of NOWUT is to be easier than pure assembly language but without unnecessary abstractions. It keeps the straightforward aspects of assembly:

  • simplistic syntax consisting of instructions followed by operands
  • manual layout of initialized data, uninitialized data, and data structures
  • no mutually-exclusive types, data is just data
  • At the same time, it removes certain burdens:

  • avoids (mostly) being CPU specific
  • no micro-management of CPU register usage
  • math and address calculations that would span many assembly instructions can be specified in a compact form similar to other high-level languages
  • confusing assortments of branch instructions are replaced with clear statements like IFEQUAL, IFGREATER, WHILELESS, etc.
  • The compiler design aims more for simplicity than for omniscience. It won't find your bugs or optimize your code. The inline assembler allows for manual optimization of speed-critical routines.

    What's on the roadmap for future NOWUT versions?

    Features being considered:

  • dynamic-linkable Linux binary output
  • floating point support
  • more cross-platform library routines
  • SH-4 / Dreamcast support
  • What NOWUT code exists so far?

    The compiler archive includes these examples:

  • JPEG decoder (Amiga 68K, 16-bit DOS, 32-bit DOS, Sega 32X, Sega Genesis, Sega Saturn, Sharp X68000, Win32)
  • OpenGL textured cube (Win32)
  • HuC6280 disassembler (buildable on several platforms)
  • Several other programs written in NOWUT have been released separately:

  • DeHunk 68000 disassembler, UnSuper SH2 disassembler
  • Imaginary Sound Chip
  • Mod players and Saturn VGM player
  • P-ST8 utility for AMD CPU power management
  • The cross-platform role playing game Glamorous Zombie Flakes
  • Visit the Anachro-mputing Blog for other software, hardware, and NOWUT-related posts.

    Visit the Go Tools website for the Go Linker which works with NOWUT.