Category:Phix: Difference between revisions
m
search links have now fixed themselves
m (100 demos) |
m (search links have now fixed themselves) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 2:
|exec=both
|site=http://phix.x10.mx
|gc=yes
|parampass=both
|express=explicit
Line 12:
|bnf=http://phix.x10.mx/bnf.php
}}
Phix is a self-hosted hybrid interpreter/compiler, developed by Pete Lomax. It is very easy to use, and similar to
[https://rosettacode.org/wiki/Category:Euphoria Euphoria].
On [https://rosettacode.org/wiki/Rosetta_Code/Rank_languages_by_popularity/Full_list?oldid=294533 26th December 2021, Phix became the first programming language on this site to have submissions for 100% of all tasks].<br>
(On 20th June 2022 [[Wren]] became the second, albeit with [https://www.rosettacode.org/wiki/Category:WrenGo 13]+[https://rosettacode.org/wiki/Special:Search?search=wren.h&wprov=acrw1_-1 66] of those embedded that I, for one, have been unable to run.)
[http://phix.x10.mx/download.php A simple 30MB download] contains a pre-compiled executable, all the sources, and'' '''everything''' ''needed to recompile them, in under 20 seconds. The download also contains a full-featured programmer's editor and about 1000 demo programs.
You can also [https://replit.com/@PeteLomax1/PhixInterpreter#main.sh run Phix on replit here] (1.0.3 Lnx 64 bit), and several manually transpiled and uploaded entries [https://rosettacode.org/wiki/Category:Phix/online here]
Perhaps the most striking feature of Phix is that it has just five builtin data types:
Line 32 ⟶ 36:
Phix supports object orientation, but does not enforce it, and can achieve many of the claimed benefits in a much simpler way. In fact I have been looking for <i><b>proof</b></i> that object orientation actually improves productivity compared to other paradigms for decades, and never found 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"?
Technically Phix does not have a garbage collector, instead it is reference counted, so memory is automatically reclaimed whenever a reference count drops to zero, and hence there are no sudden pauses, although the reference counting can itself reduce performance.
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.▼
▲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
Since 1.0.0 you can also run (many/most) Phix programs in a browser, by using pwa/p2js (as included in the distro) to transpile the program to JavaScript (plus a bit of standard HTML and CSS). If you see "'''with javascript_semantics'''" it means the program has been tested and works fine, both on the (Windows/Linux) desktop/Phix and in a browser via pwa/p2js, and in fact unix_dict() has been added to avoid reading unixdict.txt. Conversely, "without js" being present on a rosettacode entry means that (for instance) it uses the local file system, and is therefore desktop/Phix only. It is worth pointing out that "with js" and deep_copy() have proved ''staggeringly'' effective and nowhere near as painful as first feared. In just a few months (1.0.0 was released in July 2021) I have tested, fixed where necessary, and marked as javascript compatible ''[https://
==See also==
* [http://phix.x10.mx Phix site]
* [https://github.com/petelomax/Phix github]
* [[Tasks_not_implemented_in_Phix]]
{{Language programming paradigm|Generic}}
|