The Phix Programming Language Reference Manual

Version 0.7.6


Phix has several advantages over other programming languages:
  • A remarkably simple, yet flexible and powerful language definition that is easy to learn and use.
  • A high-performance interpreter/compiler much faster than most.
  • Fully managed dynamic data storage with no requirement to allocate or free memory. Variables can grow or shrink to any size without any manual housekeeping.
  • Extensive run-time checking for: out-of-bounds subscripts, uninitialized variables, bad parameter and variable assignments and many more. There are no mysterious machine exceptions -- you always get a full English description of any problem that occurs within your program at run-time, with the exact source line it occurs on, along with a full call-stack listing and a dump of all of your variable values. Programs can be debugged quickly, easily, and more thoroughly.
  • A source level debugger allows execution of programs line-by-line. Tracing can begin (or end) on any line or for any condition, under full programmer control.
  • A built-in execution profiler identifies which lines of code take up the highest percentage of execution time, or are executed the most often.
  • Features of the underlying hardware are usually hidden. Programs are not typically aware of word-lengths, bit-representations, byte-order etc.
  • However, Phix also satisfies anyone with a deeper curiosity. There is no hidden wall between the language and the operating system to fully understand how things actually work. Phix can create low-level listing files which show the exact addresses and assembly instructions generated, and also includes a program (filedump.exw) that shows every bit and byte in full detail (within reason, for example icons and other such data are shown in raw hex), for Windows PE, Linux ELF, and other format files.
  • Self-hosted so there is no need to know another language, or obtain any other development tools, to enhance or fix the language itself. You can easily download, install, and recompile Phix in less than two minutes! (See the short webcast at, and also Recommended Tools.)
  • The Edita programmers editor is freely available, and written in Phix with everything you might expect, including multiple and user-definable syntax colouring, multilingual support, intellisense, autocompletion, code folding, integrated help, window painter, full source, and more.
  • Standalone executables can be created simply by adding a "-c" flag to the normal interpret command (or via Ctrl F5 if using Edita). (The detailed assembly listing mentioned above is likewise just a "-d".) There are no complicated compiler options to remember and there is no separate linking phase. A simple "format" directive in the source allows for easy cross-compilation to any other supported system.
  • Phix programs are naturally generic. The example program shows a single routine that will sort any type of data -- integers, floating-point numbers, strings etc. Phix achieves many of the benefits of object-oriented programming, yet in a much simpler way.