Re: wikipedia draft
- Posted by _tom (admin) Jan 10, 2021
- 1740 views
The article is now too long for the form. That means it needs brutal editing.
Sticking with Creole formatting until we get this sized properly.
Draft: The Phix Programming Language
Phix is a programming language created by Pete Lomax, of London England. Phix is designed with simplicity, compactness, and orthoganality--to provide a performant language that is easy to learn and program.
History
Robert Craig released the Euphoria programming language in 1993, influenced by the work of John Backus on FP (functional programming) languages.
In 2006, Pete Lomax released the Phix language as a clone of Euphoria. Phix was then re-written from assembly language into the Phix language. The result is a hybrid self-hosting interpreter/compiler. A developer can re-compile Phix as p -cp very quickly. A programmer can both interpret and compile applications.
While Euphoria remains conservative, Phix extended the language in pragmatic ways: try/catch, regex, json, ipc, serialize, gmp, xml, sqlite, unit tests, and more. A major additon of structs and classes permits object-oriented programming, (Phix 0.8.1 March 2020).
Overview
Phix is suitable for educational, general, high-level scripting, and text processing. Phix is available for Linux and Windows platforms and in 32 bit and 64 bit versions.
Simplicity minimalism orthogonality are achieved through:
- two distinct data-types
- freeform syntax with English keywords
- generic routines and operators
The Art of Unix Programming states "Compactness is the property that a design can fit inside a human being's head."; to this I add you must also put your computer program there at the same time. Phix is a compact language and thus easy to learn and program. The cognitive load needed to learn and use Phix is reduced. For example it is easier to remember that the Phix & operator always concatenates, and the + operator always adds. Many languages are contrary: the & operator concatenates numbers (but not strings), and the + operator concatenates strings (but not numbers).
The Phix design is "keep what you have learned." If you learn to process strings then you have automically learned to process any generic sequence.
learn strings | apply the same ideas to any data |
---|---|
string s = "hello" |
sequence S = {1,2,3,4,5} |
-- mutable variables s[1] = 'j' ? s --> "jello" |
S[1] = 99 ? S --> {99,2,3,4,5} |
Source code safety is ensured by:
- data type checking
- enforcing subscript bounds
- variables must be declared and explicitly assigned values
- argument are passing by-value (but with the efficiency of copy-on-write)
- lack of pointers
The Phix developer is provided with:
- human readable error messages
- automatic memory management
- garbage collection
- interpretation and compilation of source code
- gui libraries based on IUP and GTK
- a standard library that includes features like: ipc, json, curl, zip, gmp, regular expressions, sockets, and unit testing
- debugger and execution profiler