Welcome to the Phix page! Here, you'll find a description of the language as well as a list of sample programs in that language.
This article was written by:
According to the Phix Official Site, the aims of Phix are as follows:
Phix was born out of frustration at waiting 18 months for a new release, only to find the problem was still there.
You may be wondering as to the reason for this name. According to the Phix Official Site:
Phix is Pete’s Self Hosted Hybrid Interpreter/Compiler. pshhic was not the best of acronyms, plus phiX is the name of the first ever manmade lifeform artifically created from scratch in a laboratory, which seems rather appropriate for a self-hosted compiler
Phix has the same four data types as Euphoria:
object- Base data type
atom- A 31-bit signed integer or 64-bit floating point number depending upon the value stored. This is actually called
numberin the official documentation, but
atomis still accepted.
integer- A 31-bit in signed integer
sequence- A list of values. This list can be comprised of
numbers) or other
However, it adds a fifth data type:
sequenceof characters or raw binary data
Unlike Euphoria, Phix provides short-circuited ternary operators. For
example, the iif function in Euphoria will evaluate both the true and false
expressions and select the appropriate value. In other words, this code in
Euphoria will call both
bar and then return the value to
depending upon whether
x is non-zero or not:
integer foo_or_bar = iff(x, foo(), bar())
In Phix, this can be written like this:
integer foo_or_bar = iff(x ? foo() : bar())
x is non-zero will
foo be called; otherwise,
bar will be called.
Here's a short summary of some of the other language features that Phix offers over Euphoria (just to name a few):
I'll have to admit, at first I just dismissed Phix as a knock-off of Euphoria, but after doing some more research, I have to admit this Phix is definitely worth further study!
If you'd like more information about this language, please see the Phix documentation.