Category:Phix
This programming language may be used to instruct a computer to perform a task.
Official website |
---|
Execution method: | Interpreted or compiled |
---|---|
Garbage collected: | Reference Counting |
Parameter passing methods: | By copy-on-write |
Type expression: | Explicit |
Type checking: | Dynamic, Static |
Lang tag(s): | phix, Phix |
See Also: |
Phix is a self-hosted hybrid interpreter/compiler, developed by Pete Lomax. It is very easy to use, and similar to Euphoria.
A simple 20MB download contains a pre-compiled executable, all the sources, and everything needed to recompile them, in about 15 seconds. The download also contains a full-featured programmer's editor and 130+ demo programs.
Perhaps the most striking feature of Phix is that it has just five builtin data types:
<-------- object ---------> | | +-atom +-sequence | | +-integer +-string
Despite such apparent simplicity, or perhaps precisely because of it, Phix programs are pretty fast - not quite achieving the runtime performance of C or assembly, but making up for it with a very fast edit/run cycle and proper human-readable messages should anything go wrong (even in shipped pre-compiled executables). Sequences are the real powerhouse of Phix. The one type covers lists, queues, tables, trees, and arrays, with strings being the subset that is array of character. They can grow and shrink automatically without any memory management overhead. For example if s="food" then s[2..3]="e" makes s "fed", and then s[2..1]="east" makes s "feasted".
Phix applies the principle of least surprise, for instance in some languages myproc(list) or res = myfunc(list) can mangle list, whereas in Phix if you actually want that to happen you would code list = myproc(list) (and myproc would need to become a function) or {res,list} = myfunc(list). Likewise 1/2 is 0.5 (not 0, unless you explicitly ask for the floor()) and 0-1 is -1 (not +MAXINT). A core tenet is that for any line of code there is one and only one possible interpretation of it, and said meaning is utterly intuitive. True fact: the given answer for the question "describe what f(a++) does" in "More Exceptional C++" lists 4 possibilities for f, and 3 for a (so 12 in total) and uses the phrase "could mean just about anything" not once but twice - shudder.
Phix is not inherently object orientated, but achieves many of the claimed benefits, yet in a much simpler way. In fact I have been looking for proof that object orientation actually improves productivity compared to other paradigms for decades, and never found it. Not to say that I won't support it, but I certainly won't enforce it. One other thing I have never found is a "good object orientated design", and reached the conclusion that mythical creature simply does not exist, at least not as a separate entity as opposed to some ethereal quality of the finished code. Feel free to argue that one on User_talk:Petelomax. Phix offers perfectly decent encapsulation at the file level, proving that is not the sole purview of oo, implements polymorphism far more elegantly than C-based languages and far safer than duck-typed languages, and as for the third pillar of oop, inheritance, well isn't the current mantra "favour composition over inheritance"?
The fundamental goal of Phix is to make debugging easier, a whole subject area that does not seem to get the attention it deserves, despite several studies finding that most programmers actually spend between 70 and 90% of their time debugging. (Most of us tend to think that getting just-written code to work is somehow not debugging, but that bloke with a clipboard stood behind you would disagree.)
See also
Subcategories
This category has the following 8 subcategories, out of 8 total.
@
- Phix User (6 P)
P
- Phix/basics (123 P)
- Phix/Class (23 P)
- Phix/libcurl (19 P)
- Phix/mpfr (73 P)
- Phix/online (100 P)
- Phix/pGUI (118 P)
- Phix/xpGUI (4 P)
Pages in category "Phix"
The following 200 pages are in this category, out of 1,690 total.
(previous page) (next page)1
A
- A* search algorithm
- A+B
- Abbreviations, automatic
- Abbreviations, easy
- Abbreviations, simple
- ABC correlation
- ABC incremental counts
- ABC problem
- ABC words
- Abelian sandpile model
- Abelian sandpile model/Identity
- Abstract type
- Abundant odd numbers
- Abundant, deficient and perfect number classifications
- Accumulator factory
- Achilles numbers
- Ackermann function
- Active Directory/Connect
- Active Directory/Search for a user
- Active object
- Add a variable to a class instance at runtime
- Addition chains
- Addition-chain exponentiation
- Additive primes
- Address of a variable
- ADFGVX cipher
- Air mass
- AKS test for primes
- Algebraic data types
- Align columns
- Aliquot sequence classifications
- Almkvist-Giullera formula for pi
- Almost prime
- Alternade words
- Amb
- Amicable pairs
- Anadromes
- Anagram generator
- Anagrams
- Anagrams/Deranged anagrams
- Anaprimes
- Angle difference between two bearings
- Angles (geometric), normalization and conversion
- Animate a pendulum
- Animated Spinners
- Animation
- Anonymous recursion
- Anti-primes
- Append a record to the end of a text file
- Append numbers at same position in strings
- Apply a callback to an array
- Apply a digital filter (direct form II transposed)
- Approximate equality
- Apéry's constant
- Arbitrary-precision integers (included)
- Archimedean spiral
- Arena storage pool
- Arithmetic coding/As a generalized change of radix
- Arithmetic derivative
- Arithmetic evaluation
- Arithmetic numbers
- Arithmetic-geometric mean
- Arithmetic-geometric mean/Calculate Pi
- Arithmetic/Complex
- Arithmetic/Integer
- Arithmetic/Rational
- Array concatenation
- Array length
- Arrays
- Ascending primes
- ASCII art diagram converter
- ASCII control characters
- Aspect oriented programming
- Assertions
- Assertions in design by contract
- Associative array/Creation
- Associative array/Iteration
- Associative array/Merging
- Atomic updates
- Attractive numbers
- Audio alarm
- Audio frequency generator
- Audio overlap loop
- Autogram checker
- Average loop length
- Averages/Arithmetic mean
- Averages/Mean angle
- Averages/Mean time of day
- Averages/Median
- Averages/Mode
- Averages/Pythagorean means
- Averages/Root mean square
- Averages/Simple moving average
- AVL tree
B
- B-spline
- Babbage problem
- Babylonian spiral
- Bacon cipher
- Balanced brackets
- Balanced ternary
- Banker's algorithm
- Barnsley fern
- Base 16 numbers needing a to f
- Base58Check encoding
- Base64 decode data
- Base64 encode data
- Bell numbers
- Benford's law
- Bernoulli numbers
- Bernstein basis polynomials
- Best shuffle
- Bifid cipher
- Bilinear interpolation
- Bin given limits
- Binary coded decimal
- Binary digits
- Binary search
- Binary strings
- Binomial transform
- Bioinformatics/base count
- Bioinformatics/Global alignment
- Bioinformatics/Sequence mutation
- Bioinformatics/Subsequence
- Biorhythms
- Birthday problem
- Bitcoin/address validation
- Bitcoin/public point to address
- Bitmap
- Bitmap/Bresenham's line algorithm
- Bitmap/Bézier curves/Cubic
- Bitmap/Bézier curves/Quadratic
- Bitmap/Flood fill
- Bitmap/Histogram
- Bitmap/Midpoint circle algorithm
- Bitmap/PPM conversion through a pipe
- Bitmap/Read a PPM file
- Bitmap/Read an image through a pipe
- Bitmap/Write a PPM file
- Bitwise IO
- Bitwise operations
- Black box
- Blackjack strategy
- Blum integer
- Boids
- Boolean values
- Boustrophedon transform
- Box the compass
- Boyer-Moore string search
- Brace expansion
- Brace expansion using ranges
- Brazilian numbers
- Break OO privacy
- Brilliant numbers
- Bron–Kerbosch algorithm
- Brownian tree
- Brzozowski algebraic method
- Bulls and cows
- Bulls and cows/Player
- Burrows–Wheeler transform
- Bézier curves/Intersections
C
- Caesar cipher
- Calculating the value of e
- Calendar
- Calendar - for "REAL" programmers
- Calkin-Wilf sequence
- Call a foreign-language function
- Call a function
- Call a function in a shared library
- Call an object method
- Calmo numbers
- CalmoSoft primes
- Camel case and snake case
- Canny edge detector
- Canonicalize CIDR
- Cantor set
- Card shuffles
- Carmichael 3 strong pseudoprimes
- Carmichael lambda function
- Cartesian product of two or more lists
- Case-sensitivity of identifiers
- Casting out nines
- Catalan numbers
- Catalan numbers/Pascal's triangle
- Catamorphism
- Catmull–Clark subdivision surface