1. wikipedia draft
- Posted by petelomax Dec 31, 2020
- 2480 views
https://en.wikipedia.org/wiki/Draft:The_Phix_Programming_Language
suggestions welcome
2. Re: wikipedia draft
- Posted by katsmeow Dec 31, 2020
- 2433 views
Can you delete AngusWOOF? Just who does he think is more qualified to speak about Phix than you?
3. Re: wikipedia draft
- Posted by irv Dec 31, 2020
- 2422 views
I personally wouldn't waste much time with Wikipedia. I fail to see any benefit to being listed there.
4. Re: wikipedia draft
- Posted by ghaberek (admin) Jan 01, 2021
- 2422 views
Can you delete AngusWOOF? Just who does he think is more qualified to speak about Phix than you?
Wikipedia's own rules are stated there in the header:
This submission appears to read more like an advertisement than an entry in an encyclopedia. Encyclopedia articles need to be written from a neutral point of view, and should refer to a range of independent, reliable, published sources, not just to materials produced by the creator of the subject being discussed. This is important so that the article can meet Wikipedia's verifiability policy and the notability of the subject can be established. If you still feel that this subject is worthy of inclusion in Wikipedia, please rewrite your submission to comply with these policies.
Is Phix notable? (And for that matter, is Euphoria?) Is the information from reliable sources? It's mostly from Pete. Is Pete, as the sole author and publisher of all-things-Phix, a verifiable source for that information?
I'm not doubting Pete or Phix or the authenticity of the article in and of itself. But these are the objective questions that Wikipedia asks of all articles to ensure that the content is valid and worthy of inclusion in an encyclopedia.
-Greg
5. Re: wikipedia draft
- Posted by ghaberek (admin) Jan 01, 2021
- 2432 views
I personally wouldn't waste much time with Wikipedia. I fail to see any benefit to being listed there.
Wikipedia is meant to be a place for storing knowledge. As it sits, I'd agree with the editor who declined the article that the content is too advertiser-y and not knowledge-y enough.
Also the Phix article reads like a direct copy/paste of the article for Euphoria. It'd probably be better for the article to have its own voice.
Which, by the way, Euphoria isn't even linked to correctly and instead implies that Phix is influenced solely by the concept of "euphoria" itself. Might wanna fix that, Pete.
-Greg
6. Re: wikipedia draft
- Posted by irv Jan 01, 2021
- 2411 views
I agree with all you wrote, but sill contend that there is very little to be gained from being listed in Wikipedia, Especially for a subject such as 'programming languages'. It's not a place I would look if I were interested in a new programming language.
7. Re: wikipedia draft
- Posted by katsmeow Jan 01, 2021
- 2417 views
Is Phix notable? (And for that matter, is Euphoria?) Is the information from reliable sources? It's mostly from Pete. Is Pete, as the sole author and publisher of all-things-Phix, a verifiable source for that information? -Greg
By this criteria, managed this way, the telephone would not have been admitted the day after it was invented. Send a letter, or yell louder, what's wrong with you? Why do you want to talk to someone so far away you cannot see them? Do they even exist? Has anyone else seen them? Mr Bell, we know a circus trick when we see one! Seriously, the Telephone entry on wikipedia also as a "needs verification" banner on it.
Should Pete reduce the entry to merely
It has been said that Phix is computer programming language[1].
? Perhaps wikipedia should look up the definition of "encyclopedia". And we are talking of Wikipedia, so at least one word in the entry should be misspelled.
Kat
8. Re: wikipedia draft
- Posted by petelomax Jan 01, 2021
- 2402 views
Wikipedia's own rules...
I'd agree with the editor who declined the article that the content is too advertiser-y and not knowledge-y enough.
Absolutely.
Also the Phix article reads like a direct copy/paste of the article for Euphoria. It'd probably be better for the article to have its own voice.
Guilty as charged, obviously I am seriously biased. What speel should be dropped and what facts should be added?
Which, by the way, Euphoria isn't even linked to correctly and instead implies that Phix is influenced solely by the concept of "euphoria" itself. Might wanna fix that, Pete.
Link fixed, thanks. If the reviewers noticed that several other people beside me had made edits to that page, it might help.
There is very little to be gained from being listed in Wikipedia
Probably true. I posted it because another site I was playing on expected me to provide a wp link, and that had been sitting in my wp sandbox for years.
Maybe though I'm just bored with sitting in my own little hermit cave pretending that the outside world doesn't exist.
9. Re: wikipedia draft
- Posted by euphoric (admin) Jan 01, 2021
- 2354 views
I agree with Kat, here. Of course Phix should be in Wikipedia. It is something that exists in our universe of which we (humanity) have knowledge.
That's what an encyclopedia is for: documenting our knowledge and providing information regarding that knowledge.
I read the criticism of the article (by the Wiki editor) and disagree completely. Pete is the best source for telling us what Phix is, of course.
To me, the article sounded matter-of-fact, not at all like an advertisement.
Anyway, this is why I generally avoid the biased trash that is Wikipedia except to obtain other citations.
10. Re: wikipedia draft
- Posted by petelomax Jan 02, 2021
- 2340 views
I read the criticism of the article (by the Wiki editor) and disagree completely. Pete is the best source for telling us what Phix is, of course.
No, the points made are all perfectly fair. I may indeed know it better than anyone else, but I am by definition the very last person on the planet to have a neutral point of view.
To me, the article sounded matter-of-fact, not at all like an advertisement.
It needs more brutal honesty, eg
It does not (although most can be emulated) directly support lambda expressions, closures, nested functions, currying, partial function application, function composition, function prototyping, monads, generators, anonymouse recursion, the Y combinator, aspect oriented programming, interfaces, delegates, first class environments, implicit type conversion (of the destructive kind), interactive programming, inverted syntax, list comprehensions, metaprogramming, pointers (other than to raw allocated memory), topic variables, enforced singletons, safe mode, s-expressions, or formal proof construction.
Sure, there's b****r all on that list I would ever miss and we can deride them as much as we like on this forum, but not on wp.
11. Re: wikipedia draft
- Posted by euphoric (admin) Jan 02, 2021
- 2347 views
I may indeed know it better than anyone else, but I am by definition the very last person on the planet to have a neutral point of view.
While you might not have a neutral point of view, that does not prevent you from presenting a neutral point of view.
Oh, well!
12. Re: wikipedia draft
- Posted by petelomax Jan 02, 2021
- 2325 views
While you might not have a neutral point of view, that does not prevent you from presenting a neutral point of view.
Hmm, you don't by any chance expect the ugly fat stupid kid's mother to actually say that her child is ugly fat and stupid, do you?
13. Re: wikipedia draft
- Posted by euphoric (admin) Jan 02, 2021
- 2334 views
While you might not have a neutral point of view, that does not prevent you from presenting a neutral point of view.
Hmm, you don't by any chance expect the ugly fat stupid kid's mother to actually say that her child is ugly fat and stupid, do you?
ha! OK, maybe that's a good point. If so, I'm biased too.
14. Re: wikipedia draft
- Posted by _tom (admin) Jan 05, 2021
- 2299 views
I suggest that Pete should not be the one to submit the wikipedia article because the "COI" (conflict of interest) tag makes things difficult. Maybe if I submit your article, with an effort to make things neutral, we'll get acceptance--that puts us one "COI measure" further from direct conflict of interest.
The original draft was, almost, a direct copy of an existing wikipedia article. So yes, it should have passed. However, we must respect the reviewer.
be well
_tom
15. Re: wikipedia draft
- Posted by petelomax Jan 05, 2021
- 2297 views
- Last edited Jan 06, 2021
I suggest that Pete should not be the one to submit the wikipedia article because the "COI" (conflict of interest) tag makes things difficult. Maybe if I submit your article, with an effort to make things neutral, we'll get acceptance--that puts us one "COI measure" further from direct conflict of interest.
The original draft was, almost, a direct copy of an existing wikipedia article. So yes, it should have passed. However, we must respect the reviewer.
be well
_tom
Sounds good to me.
You should probably put a notice on the talk page that you've taken over and I've agreed to go hands off (and keep any further discussion/input to this forum).
As you say, the first thing is to replace "opinions" and "sales spiel" with "neutral indisputable cold hard facts", however brutally honest they are.
I was thinking of citing the following (on the talk page) as "precedents" or "comparable references" (that is, once it is ready to be resubmitted):
https://en.wikipedia.org/wiki/Elm_(programming_language)
https://en.wikipedia.org/wiki/Factor_(programming_language)
https://en.wikipedia.org/wiki/PicoLisp
https://en.wikipedia.org/wiki/Pike_(programming_language)
https://en.wikipedia.org/wiki/Red_(programming_language)
(iow, the reference sections on those pages are relatively speaking pretty low-grade, yet they've been allowed)
FYI, off the back of the ycombinator discussion, I've added the following ready for the 0.8.3 docs ( http://phix.x10.mx/docs/html/language.htm )
The type "number" is a simple alias of "atom" (0.8.3+). There is deliberately no separate "float" type, rather 1.0 is stored as the integer 1 and that can be used directly in a floating point calculation without any casting or other type coercion. Technically there is such a thing internally, T_N, which is "fraction but not whole number", however were that exposed it would simply break should some result happen to be a whole integer, such as 1.5+1.5, so T_N is only ever used for fixed fractional values known at compile-time.
16. Re: wikipedia draft
- Posted by katsmeow Jan 05, 2021
- 2290 views
I was thinking of citing the following (on the talk page) as "precedents" or "comparable references" (that is, once it is ready to be resubmitted):
https://en.wikipedia.org/wiki/Elm_(programming_language)
https://en.wikipedia.org/wiki/Factor_(programming_language)
etc
Since you did say "suggestions welcome" .. i'd present those other languages only as examples of what programmers can stop using now that Phix is here to save the day (olde Mighty Mouse reference, or was it Superman?). They may be young languages too, but that's the end of the commonality.
Kat
17. Re: wikipedia draft
- Posted by petelomax Jan 05, 2021
- 2258 views
I'd present those other languages only as examples of what programmers can stop using ...
I'm pretty sure the wp:aspirin page does not say "don't use that paracetamol rubbish, this stuff is miles better", or vice versa. (I've added a little iow explanation to that list)
18. Re: wikipedia draft
- Posted by katsmeow Jan 05, 2021
- 2253 views
Another way of interpreting what i wrote is that i would not list the other languages, as a list of comparable languages. I would, however, provide some examples to show off the differences and strengths of Phix, beyond the pale "Hello World" demo. I recall seeing more than a few places where the C family is mentioned for it's lack of garbage collection and heavy reliance on pointers. Or a language claims it's faster than C or Java.
Kat
19. Re: wikipedia draft
- Posted by _tom (admin) Jan 05, 2021
- 2240 views
I have identified myself to AngusWOOF as an article writer.
Wow, this "notable" stuff (as pointed out by Greg) is killer stuff.
What I need are articles about Phix that I can copy from--which as we know are lacking. Looks like we need to have articles, cut and paste, from other articles to create some authenticity!
This is a puzzle that will need help from everyone.
be well
_tom
20. Re: wikipedia draft
- Posted by petelomax Jan 06, 2021
- 2260 views
I have identified myself to AngusWOOF as an article writer.
Wow, this "notable" stuff (as pointed out by Greg) is killer stuff.
What I need are articles about Phix that I can copy from--which as we know are lacking. Looks like we need to have articles, cut and paste, from other articles to create some authenticity!
This is a puzzle that will need help from everyone.
be well
_tom
Check out the reference sections of PicoLisp, Pike and Red - if we(well, you) can match those, it should by rights be enough.
Quite how the Red page doesn't have any of those kind of warnings at all is beyond me.
21. Re: wikipedia draft
- Posted by _tom (admin) Jan 08, 2021
- 2306 views
Draft: The Phix Programming Language
Phix is a programming language created by Pete Lomax, of London England. Phix is designed with simplicity, compactness, and orthogonality--to provide a performant language that is easy to learn and program.
History
Robert Craig wrote a Master's thesis at the University of Toronto influenced by the work of John Backus on FP ( functional programming ) languages. He then created a working language, for the Atari Mega-ST, to demonstrate these ideas. The Euphoria programming language was later released for the DOS platform in July 1993 under a proprietary licence. Euphoria was written in the C language and provides an interpreter (for running source code immediately), and a translator generating C source code (for compiling programs with GNU or Watcom compilers).
In 2006, Pete Lomax created Phix as clone of Euphoria, but written in assembly language. Phix is self-hosting and can re-compile itself. The single Phix executable can both interpret and compile source code.
Phix 8.1, released in March 2020, added structs and classes to permit the object-oriented programming style.
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, and orthogonality are achieved through:
- two distinct data-types
- free form 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." 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 concatenates all values, and the + operator adds all values. Some languages are contrary: the & operator concatenates numbers (but not strings), and the + operator concatenates strings (but not numbers).
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
Examples and Syntax
[ to be developed ]
Features
Paradigms: imperative, procedural, object-oriented
Standardized: No, the manual includes language specification
Type strength: strong
Type safety: safe
Expression of types: explicit, partially implicit
Type compatibility: duck
Type checking: dynamic, static
Parameter Passing Methods Available: copy on write, immutable reference, multiple returns
Garbage collection: Reference counting
Intended use: Application, Educational, General, High-level scripting, Text processing
Design goals: Simplicity, Readability, Ease of use
Execution modes
Interpreter Compiler
Comparable languages
Euphoria Lua Go Python REBOL Ruby
References
"pGUI documentation". Retrieved 2020-12-31. "IUP". Retrieved 2020-12-31. "Phix and GTK example". Retrieved 2020-12-31. "GTK". Retrieved 2020-12-31. "PCAN/interfaces". Retrieved 2020-12-31. "database documentation". Retrieved 2020-12-31. "other databases". Retrieved 2020-12-31.
External links
Free downloads of Phix. Official website Phix PCAN - Phix Contributions & Assorted Nicknacks openEuphoria Forum Phix · GitHub Development repositories. Discussion on ycombinator Hacker News on facebook link Discussion of differences with Euphoria How to implement a program for History variables in Phix Learn To Phix Programming by Tom Ciplijauskas Phix Tutorial: Basic Sequence Actions, also by Tom, with some discussion Phix Tutorial: Basic Sequence Operations, also by Tom, with some discussion
Programming languages implemented in Phix
Phixmonti and Klingphix (spanish) see also Phixmonti and Klingphix on rosettacode
Category:Procedural programming languages Category:Cross-platform software Category:Programming languages created in 2006 Category:Free educational software
22. Re: wikipedia draft
- Posted by _tom (admin) Jan 08, 2021
- 2195 views
Brutal comments are now encouraged.
be well
_tom
23. Re: wikipedia draft
- Posted by petelomax Jan 08, 2021
- 2229 views
- Last edited Jan 09, 2021
Two quickies:
"Phix 8.1, released in March 2020" -> "Phix 0.8.1, released in March 2020"
"argument are passing by-value" -> "arguments are passed by value"
Also, if you think it would help, other significant recent releases include:
0.8.2 was released November 2020 (unit tests)
0.8.0 was released April 2019 (gmp,xml,sqlite)
0.7.9 was released Apr 2018 (maintenance release)
0.7.8 was released Mar 2018 (zip)
0.7.7 was released Feb 2018 (ipc,serialise)
0.7.6 was released Jul 2017 (try/catch,regex,json)
How about:
switch statement requires explict fallthrough if that is wanted, rather than doing the wrong thing when the break statement is accidentally omitted.
I think the scary "it does not support" paragraph really ought to stay, and maybe add: The author wryly comments "That should scare off and attract the right people"
24. Re: wikipedia draft
- Posted by petelomax Jan 08, 2021
- 2205 views
- Last edited Jan 09, 2021
Examples:
Strings are fully mutable, with variable length slice substitution:
string s = "food" ?s -- outputs "food" s[2..3] = "e" ?s -- outputs "fed" s[2..1] = "east" ?s -- outputs "feasted"
the above, wp-ready:
Strings are fully mutable, with variable length slice substitution: <font color="#004080">string</font><font color="#000000"> s</font><font color="#0000FF"> =</font><font color="#008000"> "food" </font><font color="#0000FF"> ?</font><font color="#000000">s </font><font color="#000080"><i> -- outputs "food"</i></font> <font color="#000000">s</font><font color="#0000FF">[</font><font color="#000000">2</font><font color="#0000FF">..</font><font color="#000000">3</font><font color="#0000FF">] =</font><font color="#008000"> "e" </font><font color="#0000FF"> ?</font><font color="#000000">s </font><font color="#000080"><i> -- outputs "fed"</i></font> <font color="#000000">s</font><font color="#0000FF">[</font><font color="#000000">2</font><font color="#0000FF">..</font><font color="#000000">1</font><font color="#0000FF">] =</font><font color="#008000"> "east" </font><font color="#0000FF"> ?</font><font color="#000000">s </font><font color="#000080"><i> -- outputs "feasted"</i></font>
Exception handling:
try integer i = 1/0 -- or, for example, throw("file in use") catch e ?e[E_USER] end try puts(1,"still running...\n")
Output:
"attempt to divide by 0" -- or "file in use" still running...
the above, wp-ready:
Exception handling: <font color="#008080">try</font> <font color="#004080"> integer</font><font color="#000000"> i</font><font color="#0000FF"> =</font><font color="#000000"> 1</font><font color="#0000FF">/</font><font color="#000000">0</font> <font color="#000080"><i> -- or, for example, throw("file in use")</i></font> <font color="#008080">catch</font><font color="#000000"> e</font> <font color="#0000FF"> ?</font><font color="#000000">e</font><font color="#0000FF">[</font><font color="#004600">E_USER</font><font color="#0000FF">]</font> <font color="#008080">end try</font> <font color="#7060A8">puts</font><font color="#0000FF">(</font><font color="#000000">1</font><font color="#0000FF">,</font><font color="#008000">"still running...\n"</font><font color="#0000FF">)</font> Output: "attempt to divide by 0" -- or "file in use" still running...
25. Re: wikipedia draft
- Posted by katsmeow Jan 08, 2021
- 2182 views
Very very good. Except for one point... err punctuation....
The Art of Unix Programming states "Compactness is the property that a design can fit inside a human being's head."
While i see you are quoting from a written tome which contains it's own period, i argue that your written sentence also should end with a period. Curiously, it remains your discretion to (or not) include the period in the quote of the book.
I am otherwise speechless. Very good, Tom.
Kat
26. Re: wikipedia draft
- Posted by petelomax Jan 09, 2021
- 2163 views
Suggestion:
Phix uses 1-based indexes
The widespread use of 0-based indexes[8] stems from a paper[9] by Edsger W. Dijkstra and the benefits for pointer arithmetic[10], which Phix does not have.
There have been many other debates[11],[12] about the use of 0-based vs. 1-based indexing.
In 0-based indexing the first,last,length are 0,n-1,n whereas in 1-based indexing they are 1,n,n.
If the first element of an array is a[0], you cannot index the last as a[-0], whereas a[1] and a[-1] are much more reasonable.
In a language that allows negative indexes from the end of the array (such as Python[13]), having all indexes in -2,-1,0,1,2 be meaningful will obviously catch fewer errors than when a[0] is always an error (as it is in Phix).
You don't need to explain 1-based indexing to anyone and you certainly don't need a diagram.
For these reasons, Phix uses 1-based indexing, similar to Julia[14]
original of the above, wp-ready:
== Phix uses 1-based indexes == The widespread use of 0-based indexes<ref name=copla/> stems from a paper<ref name=EWD831/> by [[Edsger_W._Dijkstra|Edsger W. Dijkstra]] and the benefits for pointer arithmetic<ref name=adtio/>, which Phix does not have.<br> There have been many other debates<ref name=io0ah/>,<ref name=jggd/> about the use of 0-based vs. 1-based indexing.<br> In 0-based indexing the first,last,length are 0,n-1,n whereas in 1-based indexing they are 1,n,n.<br> If the first element of an array is a[0], you cannot index the last as a[-0], whereas a[1] and a[-1] are much more reasonable.<br> In a language that allows negative indexes from the end of the array (such as Python<ref name=python/>), having all indexes in -2,-1,0,1,2 be meaningful will obviously catch fewer errors than when a[0] is always an error (as it is in Phix).<br> You don't need to explain 1-based indexing to anyone and you certainly don't need a diagram.<br> For these reasons, Phix uses 1-based indexing, similar to Julia<ref name=julia/><br> <ref name=copla>{{cite web|url=https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(array)#Array_system_cross-reference_list|title=Array indexing comparison|accessdate=2021-01-09}}</ref> <ref name=EWD831>{{cite web|url=https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html|title=Why number should start at zero by Edsger W. Dijkstra|accessdate=2021-01-09}}</ref> <ref name=adtio>{{cite web|url=https://en.wikipedia.org/wiki/Array_data_type#Index_origin|title=Array datatype index origin|accessdate=2021-01-09}}</ref> <ref name=io0ah>{{cite web|url=https://www.jsoftware.com/papers/indexorigin.htm|title=Is Index Origin 0 a Hindrance? Roger Hui|accessdate=2021-01-09}}</ref> <ref name=jggd>{{cite web|url=https://groups.google.com/forum/?hl=en#!topic/julia-dev/tNN72FnYbYQ|title=Thread on Julia google groups|accessdate=2021-01-09}}</ref> <ref name=python>{{cite web|url=https://en.wikipedia.org/wiki/Python_(programming_language)|title=Python|accessdate=2021-01-09}}</ref> <ref name=julia>{{cite web|url=https://en.wikipedia.org/wiki/Julia_(programming_language)|title=Julia|accessdate=2021-01-09}}</ref>You might want to find more specific references for Python (-ve indexes) and Julia (1-based).
27. Re: wikipedia draft
- Posted by petelomax Jan 09, 2021
- 2169 views
Suggestion:
the Phix & operator concatenates all values, and the + operator adds all values
==>
the Phix & operator always concatenates, and the + operator always adds (unlike JavaScript<ref name=jspo/>) <ref name=jspo>{{cite web|url=https://en.wikipedia.org/wiki/JavaScript#Weakly_typed|title=Javascript + operator|accessdate=2021-01-09}}</ref>
28. Re: wikipedia draft
- Posted by petelomax Jan 09, 2021
- 2159 views
Filtering:
function odd(integer a) return remainder(a,2)=1 end function function even(integer a) return remainder(a,2)=0 end function ?filter(tagset(10),odd) -- ==> {1,3,5,7,9} ?filter(tagset(10),even) -- ==> {2,4,6,8,10}
the above, wp-ready:
Filtering: <font color="#008080">function</font><font color="#000000"> odd</font><font color="#0000FF">(</font><font color="#004080">integer</font><font color="#000000"> a</font><font color="#0000FF">)</font><font color="#008080"> return</font><font color="#7060A8"> remainder</font><font color="#0000FF">(</font><font color="#000000">a</font><font color="#0000FF">,</font><font color="#000000">2</font><font color="#0000FF">)=</font><font color="#000000">1</font><font color="#008080"> end function function</font><font color="#000000"> even</font><font color="#0000FF">(</font><font color="#004080">integer</font><font color="#000000"> a</font><font color="#0000FF">)</font><font color="#008080"> return</font><font color="#7060A8"> remainder</font><font color="#0000FF">(</font><font color="#000000">a</font><font color="#0000FF">,</font><font color="#000000">2</font><font color="#0000FF">)=</font><font color="#000000">0</font><font color="#008080"> end function </font><font color="#0000FF">?</font><font color="#5E005E">filter</font><font color="#0000FF">(</font><font color="#5E005E">tagset</font><font color="#800000">(</font><font color="#000000">10</font><font color="#800000">)</font><font color="#0000FF">,</font><font color="#000000">odd</font><font color="#0000FF">) </font><font color="#000080"><i> -- ==> {1,3,5,7,9} </i></font><font color="#0000FF">?</font><font color="#5E005E">filter</font><font color="#0000FF">(</font><font color="#5E005E">tagset</font><font color="#800000">(</font><font color="#000000">10</font><font color="#800000">)</font><font color="#0000FF">,</font><font color="#000000">even</font><font color="#0000FF">) </font><font color="#000080"><i> -- ==> {2,4,6,8,10} </i></font>
Specify what versions and/or operating systems are required to run the source code:
requires("0.8.2") -- crashes on 0.8.1 and earlier requires(WINDOWS) -- crashes on Linux requires(64) -- crashes on 32-bit
In the latter case, if you try to run a 64-bit-only program with a 32-bit interpreter, it will try to locate a suitable 64-bit interpreter and offer to re-run it with that (and vice-versa, for instance the older arwen and win32lib libraries are 32-bit only).
the above, wp-ready:
Specify what versions and/or operating systems are required to run the source code: <font color="#5E005E">requires</font><font color="#0000FF">(</font><font color="#008000">"0.8.2"</font><font color="#0000FF">) </font><font color="#000080"><i> -- crashes on 0.8.1 and earlier</i></font> <font color="#5E005E">requires</font><font color="#0000FF">(</font><font color="#004600">WINDOWS</font><font color="#0000FF">) </font><font color="#000080"><i> -- crashes on Linux</i></font> <font color="#5E005E">requires</font><font color="#0000FF">(</font><font color="#000000">64</font><font color="#0000FF">) </font><font color="#000080"><i> -- crashes on 32-bit</i></font></html> In the latter case, if you try to run a 64-bit-only program with a 32-bit interpreter, it will try to locate a suitable 64-bit interpreter and offer to re-run it with that (and vice-versa, for instance the older arwen and win32lib libraries are 32-bit only).
Unit testing:
test_equal(2+2,4,"2+2 is not 4 !!!!") test_summary()
If all goes well, no output is shown, and the program carries on normally.
You can easily force a summary to be output, quietly create a logfile, etc.
the above, wp-ready:
Unit testing: <font color="#5E005E">test_equal</font><font color="#0000FF">(</font><font color="#000000">2</font><font color="#0000FF">+</font><font color="#000000">2</font><font color="#0000FF">,</font><font color="#000000">4</font><font color="#0000FF">,</font><font color="#008000">"2+2 is not 4 !!!!"</font><font color="#0000FF">)</font> <font color="#5E005E">test_summary</font><font color="#0000FF">()</font> If all goes well, no output is shown, and the program carries on normally.<br> You can easily force a summary to be output, quietly create a logfile, etc.
PS I'm colouring code via <block select> Edita\Edit\Clipboard\Copy with HTML, but then I have to delete <head> etc and re-space every line. I'm more than happy to do that for any fragment you post here, including the existing examples on wp, not that I personally think they're worth keeping.
29. Re: wikipedia draft
- Posted by _tom (admin) Jan 09, 2021
- 2143 views
Kat, you have been given grammar privileges--I have lost my copy of "Strunk & White".
Pete, Bills are in playoff football, don't expect me to think too hard.
be well
_tom
30. Re: wikipedia draft
- Posted by petelomax Jan 09, 2021
- 2136 views
Pete, Bills are in playoff football, don't expect me to think too hard.
No problem, no pressure, enjoy the game. I'm just dumping things here as I stumble across them, as a distraction from what I'm really supposed to be doing.
31. Re: wikipedia draft
- Posted by petelomax Jan 09, 2021
- 2134 views
- Last edited Jan 10, 2021
Suggestion:
as clone of Euphoria, but written in assembly language. Phix is self-hosting and can re-compile itself.
->
as a clone of Euphoria, initialy written in assembly language but now in Phix itself, ie fully self-hosted and open source. To re-compile Phix from source simply run `p -cp`. No other compilers or similar tools need to be installed.
Another:
The use of explicitly tagged ends, such as "if ... then ... end if", while much more verbose than (say) "if (...) { }", catches many more errors and slip-ups, and avoids problems such as the [[Dangling_else|dangling else]].
(obviously that last link will actually link to dangling else, when the { { { } } } are removed)
Another:
Robert Craig wrote ... compilers).
->
Robert Craig released the first version of [[Euphoria_(programming_language)|Euphoria]] in July 1993.
(likewise Euphoria for that link, I think the full paragraph is/was too much needlessly replicated and largely irrelevant detail)
PS Please don't misinterpret all this as brow-beating, should you reject every single one of my suggestions, as is your right, I will simply live with it.
32. Re: wikipedia draft
- Posted by _tom (admin) Jan 10, 2021
- 2073 views
The Buffalo Bills win their first play-off game in 25 years.
Wikipedia is doable.
The boiler plate section will look like this; it will not change much:
Phix | Phix logo |
Paradigm | Imperative, procedural |
Developer | Pete Lomax |
First appeared | 2006; 15 years ago |
Stable release | 0.8.2 / November 24, 2020; 42 days ago |
Typing discipline | static, dynamic |
OS | Windows, Linux |
License | Open Software License 3.0 / Academic Free License 3.0 |
Filename extensions | .e, .ex, .exw, .edb |
Website | phix.x10.mx |
Influenced by | Euphoria |
Comparable languages
Euphoria Lua Go Python REBOL Ruby
References
"pGUI documentation". Retrieved 2020-12-31. "IUP". Retrieved 2020-12-31. "Phix and GTK example". Retrieved 2020-12-31. "GTK". Retrieved 2020-12-31. "PCAN/interfaces". Retrieved 2020-12-31. "database documentation". Retrieved 2020-12-31. "other databases". Retrieved 2020-12-31.
External links
Free downloads of Phix. Official website Phix PCAN - Phix Contributions & Assorted Nicknacks openEuphoria Forum Phix · GitHub Development repositories. Discussion on ycombinator Hacker News on facebook link Discussion of differences with Euphoria How to implement a program for History variables in Phix Learn To Phix Programming by Tom Ciplijauskas Phix Tutorial: Basic Sequence Actions, also by Tom, with some discussion Phix Tutorial: Basic Sequence Operations, also by Tom, with some discussion
Programming languages implemented in Phix
Phixmonti and Klingphix (spanish) see also Phixmonti and Klingphix on rosettacode
Category:Procedural programming languages Category:Cross-platform software Category:Programming languages created in 2006 Category:Free educational software
Forked into: Da Bills and Phix Version 1.0
33. Re: wikipedia draft
- Posted by _tom (admin) Jan 10, 2021
- 2083 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
34. Re: wikipedia draft
- Posted by _tom (admin) Jan 10, 2021
- 2117 views
Examples and Syntax
A syntax element uses English keywords (like while) and finishes with an end tag (like end while); no additional rules; no additional punctuation.
Learn one sample | Then just follow the pattern |
---|---|
-- a list of user defined error messages sequence e = { "attempt to divide by 0", "user error 1", "user error2" } -- the try catch block try integer i = 1/0 catch e ? e[E_USER] end try puts(1,"still running...\n") |
-- loop for i=1 to 10 do ? i end for -- branch if x>0 then ? "big" elsif x < 0 then ? "small" end if -- function function positive(integer n) if n>=0 then return True else return False end if end function |
-- output is attempt to divide by 0 still running... |
Explicitly tagged ends ("if ... then ... end if") maybe verbose but catch many errors and slip-ups, and avoids problems such as the dangling else.
The syntax is pragmatic, and it includes some redundancy.
- A comment line begins with double dashes - -, double slashes / /, or is enclosed by /* */ delimiters.
- Either = (for traditional programmers) or =: (for programming educators) may be used as an assignment operator.
The syntax is freeform'; you may write in a style that suits obvious needs.
Typical Style | Exploiting Freeform |
---|---|
if count < 6 then ? "pay donut tax" else ? "pay printed price" end if |
if count < 6 then ?"pay donut tax" else ?"pay printed price"end if |
x = 3 y = 4 h = 5 |
x=3 y=4 h=5
|
https://en.wikipedia.org/wiki/Dangling_else
One-Based-Indexing
From a discussion on the Julia website "What’s the big deal? 0 vs 1 based indexing" comes a simple explaination:
Steven_Sagaert Dec 2016 That’s exactly it. 1-based indexing is actual indexing like in mathematics, while 0-based “indexing†isn’t indexing at all but pointer arithmetic. This comes from C where an array is just syntactic sugar for a pointer.
One-based indexing allows extensive and intuitive operations on sequences.
https://discourse.julialang.org/t/whats-the-big-deal-0-vs-1-based-indexing/1102
Sequence Operations
Understanding how sequences work is the key to understanding Phix.
Phix uses one-based indexes.
The widespread use of 0-based indexes[8] stems from a paper[9] by Edsger W. Dijkstra and the benefits for pointer arithmetic[10], which Phix does not have.
There have been many other debates[11],[12] about the use of 0-based vs. 1-based indexing. In 0-based indexing the first,last,length are 0,n-1,n whereas in 1-based indexing they are 1,n,n. If the first element of an array is a[0], you cannot index the last as a[-0].
In a language that allows negative indexes from the end of the array (such as Python[13]), having all indexes in -2,-1,0,1,2 be meaningful will obviously catch fewer errors than when a[0] is always an error (as it is in Phix).
You don't need to explain 1-based indexing to anyone and you certainly don't need a diagram.
For these reasons, Phix uses 1-based indexing, similar to Julia[14]
[tom, need some clear examples here, thinking about this...]
Rosetta Code
Rosetta has over one thousand programming challenges, and states "...we do not (and cannot) have solutions to every task in every language."
Phix does not (although most can be emulated) directly support lambda expressions, closures, nested functions, currying, partial function application, function composition, function prototyping, monads, generators, anonymouse recursion, the Y combinator, aspect oriented programming, interfaces, delegates, first class environments, implicit type conversion (of the destructive kind), interactive programming, inverted syntax, list comprehensions, metaprogramming, pointers (other than to raw allocated memory), topic variables, enforced singletons, safe mode, s-expressions, or formal proof construction.
Phix has over one thousand completed Rosetta examples. A compact language like Phix is not limited by its simple nature.
http://www.rosettacode.org/wiki/Rosetta_Code
Features
Paradigms: imperative, procedural, object-oriented
Standardized: No, the manual includes language specification
Type strength: strong
Type safety: safe
Expression of types: explicit, partially implicit
Type compatibility: duck
Type checking: dynamic, static
Parameter Passing Methods Available: copy on write, immutable reference, multiple returns
Garbage collection: Reference counting
Intended use: Application, Educational, General, High-level scripting, Text processing
Design goals: Simplicity, Readability, Ease of use
Execution modes
Interpreter Compiler
35. Re: wikipedia draft
- Posted by katsmeow Jan 10, 2021
- 2067 views
1) The Phix design is "keep what you have learned."
2) orthoganality--to
3) A major additon of structs and classes permits object-oriented programming, (Phix 0.8.1 March 2020).
4) Phix is available for Linux and Windows platforms and in 32 bit and 64 bit versions.
5) ... the Phix & operator ... and the + operator ...
6) ... argument are passing by-value ...
7) Explicitly tagged ends ("if ... then ... end if") maybe verbose ...
8) The syntax is freeform';
9a) For these reasons, Phix uses 1-based indexing, similar to Julia[14]
9b) states "...we do not (and cannot) have solutions to every task in every language."
10) Phix does not (although most can be emulated) directly support
1) period in wrong place.
2a) orthoganality -- to
2b) orthoganality ... to
3) no need for the comma, and you have space to spell out "structures", and spell "additon" right
4) comma after "platforms"
5a) the italics as a means of making an object "stand out" doesn't seem to be working for & or +
5b) the '&' is also tricky to show on a webpage, based on charset in use, vs Fixedsys in a text editor.
6) "passing" vs "passed" ?
7) "may be"
8) why is there an apostrophe?
9) Sentences end with periods.
10) awkward! put the (...) somewhere closer to, and after, what it pertains to.
I hope i have not blown my grammar privileges away. I understand what you have posted here is temporary, and will be revised.
Kat
36. Re: wikipedia draft
- Posted by petelomax Jan 11, 2021
- 2045 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.
Eh? I don't think we should limit what goes on wp by what fits on euforum ?
37. Re: wikipedia draft
- Posted by petelomax Jan 11, 2021
- 2047 views
OK, engage brutal mode:
Plain wrong:
-- a list of user defined error messages sequence e = { "attempt to divide by 0", "user error 1", "user error2" }
argument are passing by-value (but with the efficiency of copy-on-write)
woah, hang on a minute there...
I've just realised that is all wrong, a complete rewrite follows below (phix docs need updating too).
Wikipedia is not a place for sales pitch or opinion
While Euphoria remains conservative,
in pragmatic ways -> with
A major additon -> The addition
very quickly
Simplicity minimalism orthogonality
thus easy to learn
The cognitive load needed to learn and use Phix is reduced
it is easier to remember
no additional rules; no additional punctuation.
Wikipedia is not a place for tutorials
"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
Learn one sample
Then just follow the pattern
Extolling/examples of freeform feels really odd to me, like grasping for something positive to say and completely missing the target.
Sure, briefly mention it, but explaining it is rather patronising/probably belongs on a completely different wp article.
Either = (for traditional programmers) or := (for programming educators) may be used as an assignment operator.
Sounds like it is trying to say "traditional programmers must use =, and programming educators must use :="...
know your place - you will be punished should you dare to use the one not meant for your lot...
Can you add "operator, function, or builtin overloading, " to "the scary list" (just before pointers).
Lastly, how about this for an opener:
The design of Phix is based on three tenets: simplicity, clarity, and make debugging easier, rather than cling to the vain hope of avoiding it altogether.
I know it ain't easy...
One really useful thing I am already getting from all this is the ability to see just how far off the mark the Phix website is.
The last few days have really perked me up, this is somehow making me feel alive for the first time in ages.
Oh, erm, well done the Bills, btw, I think..
38. Re: wikipedia draft
- Posted by petelomax Jan 11, 2021
- 2054 views
As promised, a complete rewrite:
Parameter passing
Integers are always passed by value, whereas atom/sequence/string are passed by reference with copy-on-write semantics.
That realises the performance benefits of pass-by-reference but with the behaviour of pass-by-value, for example:
function set55(sequence s) s[5][5] = 5 return s end function sequence a = repeat(repeat(0,5),5), -- a 5x5 matrix b = set55(a)
The value of a is not changed by the call, b obviously ends up with a single 5 in the lower right.
In fact it only "clones" the top-level of b and b[5], b[1..4] actually still share the same memory as a,
but will cease doing that if and when further modifications are made to b. It will not need to re-clone
the top-level of b or b[5] again (and now ditto a) but can instead update those non-shared parts in situ.
(The fact that atoms quiely undergo a similar treatment should be of little or no practical concern.)
In contrast, dictionary and struct/class instance parameters are more accurately described as pass-by-reference.
Again the reality is slightly different, for example:
class mytest public string s end class procedure change(mytest c, d) c = new({"c"}) d.s = "d" end procedure mytest a = new({"a"}), b = new({"b"}) change(a,b) ?a.s -- "a" ?b.s -- "d"
In practice, a remains unmodified, because we simply overwrote the reference to it, whereas b is modified
indirectly as and when the field of d is updated. Note that had you instead performed delete(c), then a
would have instantly become meaningless and invalid, and a cannot be nullified within change() other than
by making it a function which returns (c or null), and then explicitly assigning that return back to a.
One other (fairly obvious) true thing to say is that new() creates space to hold values, and you can never
hold more values, that is, in instance variables, than the number of times you have invoked new().
A very similar program but with no classes and all strings could at one point hold four different strings
in a,b,c,d, but that's simply not possible in the above because you've only called new() three times.
39. Re: wikipedia draft
- Posted by petelomax Jan 11, 2021
- 2057 views
Comparison with Euphoria
- Phix has 8-bit strings and variable length slice substitution
- Phix requires explicit sequence ops such as sq_add() rather than an implicit inline +
- Phix has structs and classes, with reference semantics
- What Euphoria calls maps, Phix calls dictionaries, and uses a different syntax
- Phix has multithreading, as well as multitasking, whereas Euphoria only has the latter
- Phix allows negative indexes from right to left, mirroring positive indexes' left to right
- Phix has named parameters, and does not permit parameter omission with ,, syntax
- Phix allows the explicit := and == as well as the (implicit) = determined from context
- Phix allows nested constant declarations via the := operator
- Euphoria does not support the ~ << >> && || operators
- Phix allows ; as an entirely optional statement separator
- Euphoria requires equal() and compare() in many cases where Phix allows ==, <, etc.
- Euphoria allows full expressions in parameter defaults whereas Phix is relatively limited
- Euphoria returns a length of 1 for an atom, whereas Phix (deliberately) crashes
- Euphoria requires routine_id("name") whereas Phix also allows a bare name
- Euphoria requires call_func(rid,{...}) whereas Phix also allows rid(...)
- Phix allows inline variable declaration in desequencing operations
- Phix has a format directive to specify compilation options
- Euphoria can be transpiled to C, Phix cannot
- The ternary operator (iff) in Phix has full short-circuit evaluation
- Phix allows forward routine declarations and un-named parameters
- Euphoria supports binary/octal/hex/decimal, Phix supports all number bases 2..36
- Euphoria allows floating-point for loop control variables, Phix does not
- Phix allows static variables and routine-level constants (except on fwd calls)
- Euphoria supports enum by /N, which Phix does not
- Euphoria's private/export/global are all simply treated as global by Phix
- Several include and with/without options are different and/or incompatible
- Euphoria namespaces can reference the current file, which is broken in Phix
- Euphoria allows forward references to variables, Phix does not
- Euphoria allows implicit discard of function results, Phix requires "{} ="
- Euphoria has with label, break label, and a loop construct, Phix does not
- Phix has a try/catch/throw, whereas Euphoria has no exception handling
- Phix allows min(i,j) as well as min({i,j,k,..}), ditto max()
- Euphoria still has match_from() whereas Phix relies on match() optional start
- Euphoria requires explict includes for many things Phix can auto-include
- Euphoria yields 97.36 for lower(65.36) whereas Phix yields 65.36
- Euphoria permits daisy-chaining delete_routine(), Phix is single-shot
- Euphoria must allocate_string for c_func, Phix can pass strings directly
- Phix supports inline assembly (and sometimes relies on it)
- The machine_func/machine_proc of Euphoria are mostly deprecated in Phix
- Euphoria allows goto whereas Phix uses #ilASM{ jmp :lbl } to deter newbies
- Despite all these, quite a bit of legacy code still runs happily on both.
https://openeuphoria.org/forum/m/133443.wc
https://openeuphoria.org/forum/m/117059.wc
Wow, that has grown a few extra limbs. . .
40. Re: wikipedia draft
- Posted by katsmeow Jan 11, 2021
- 2019 views
- Phix allows nested constant declaraions via the := operator
Respectfully, just in the case you were going to copy/paste that list directly to your websites.
Kat
41. Re: wikipedia draft
- Posted by katsmeow Jan 11, 2021
- 2022 views
Overall I'd say it was pretty stable and perfectly usable but there is plenty left to do, including finding that special "magic" that gives it a real edge.
A few people have made suggestions that could place Phix out of the ball park vs what can be done with existing languages. No comment on the mention of those suggestions and Phix's placement on Wikipedia.
Kat
42. Re: wikipedia draft
- Posted by petelomax Jan 11, 2021
- 2014 views
Phix allows nested constant declaraions via the := operator
Thanks, updated
A few people have made suggestions that could place Phix out of the ball park vs what can be done with existing languages. No comment on the mention of those suggestions and Phix's placement on Wikipedia.
Links? Did anything ever make it past vaporware?
43. Re: wikipedia draft
- Posted by katsmeow Jan 11, 2021
- 2006 views
A few people have made suggestions that could place Phix out of the ball park vs what can be done with existing languages. No comment on the mention of those suggestions and Phix's placement on Wikipedia.
Links? Did anything ever make it past vaporware?
Greg and i each re-made a suggestion last month here on Euphorum. I am not inclined to go find the url due to lack of hope that would be helpful.
Re vaporware, i can now run a function or separate program which uses a different program's shared variable space. What is shared is up to the programmer. It's crossed my lil mind that this would be more versatile if i re-coded it to use tcp, so a program on any of the other computers could share the variable space of a program on any other computer (thereby coincidently opening the use of other OSs and programming languages).
Can Phix have the goto as it's implemented in OE?
This should be a different topic thread.
Kat
44. Re: wikipedia draft
- Posted by petelomax Jan 11, 2021
- 1985 views
Can Phix have the goto as it's implemented in OE?
NO. In phix use
#ilASM{ jmp :lbl } ... #ilASM{::lbl}
Added to that phix vs eu list
45. Re: wikipedia draft
- Posted by katsmeow Jan 11, 2021
- 1993 views
Can Phix have the goto as it's implemented in OE?
NO.
I am too old for this.
Kat
46. Re: wikipedia draft
- Posted by _tom (admin) Jan 11, 2021
- 1986 views
... I hope i have not blown my grammar privileges away. I understand what you have posted here is temporary, and will be revised.
Kat
You have grammar privileges for life. Much appreciated.
I expect to have a few re-writes before I get close to looking at grammar.
be well
_tom
47. Re: wikipedia draft
- Posted by _tom (admin) Jan 11, 2021
- 1994 views
Comparison with Euphoria
...
https://openeuphoria.org/forum/m/133443.wc
https://openeuphoria.org/forum/m/117059.wc
Wow, that has grown a few extra limbs. . .
My new strategy is to minimize references to Euphoria. Lets say, honorary mention. Other than being able to run some simplistic code, there are two languages here.
be well
_tom
48. Re: wikipedia draft
- Posted by euphoric (admin) Jan 11, 2021
- 1975 views
That's a serious bug.
49. Re: wikipedia draft
- Posted by petelomax Jan 11, 2021
- 1966 views
That's a serious bug.
Where?
50. Re: wikipedia draft
- Posted by euphoric (admin) Jan 11, 2021
- 1956 views
That's a serious bug.
Where?
ha! Oops. I misread that.
That's the "making the upper case lower case" function.
Nevermind.
Carry on.
51. Re: wikipedia draft
- Posted by petelomax Jan 12, 2021
- 1959 views
Where?
Nevermind. Carry on.
Aye, Phix takes the view it is clearly not a character, nor is it 'A' plus some third of 'B' (the 'a' part is fine but which third of 'b' to return?), so leave it alone.
In an ideal world it should probably just crash, and force the programmer to only provide sensible arguments to upper/lower().
52. Re: wikipedia draft
- Posted by petelomax Jan 12, 2021
- 1929 views
Can Phix have the goto as it's implemented in OE?
NO.
I am too old for this.
Sigh. Well then, grow up and re-read what I wrote.
53. Re: wikipedia draft
- Posted by katsmeow Jan 12, 2021
- 1932 views
Can Phix have the goto as it's implemented in OE?
NO.
I am too old for this.
Sigh. Well then, grow up and re-read what I wrote.
Sorry, i wanted goto as an option for difficult flow control issues, not mind games to make coding more difficult.
The Phix help file does a great job of hiding the feature you don't want anyone to use, and it's top-level only, and cannot be used within procedures or functions, which is traditionally where the difficult code is found. If hiding the programming tools represents an improvement in computer programming, why put out a help file at all?
The statement that you are looking for the great feature that sets Phix apart and above other languages seems disengenuous when you refuse any feature not already in some other language... unless you think of it first.
Phix's help file has a couple paragraphs about how much trouble the coder can get into using the case statement, which wouldn't happen if goto was available. That's all about fighting the compiler (or interpreter, in the case of Euphoria) and the philosophy.
Kat
54. Re: wikipedia draft
- Posted by petelomax Jan 12, 2021
- 1900 views
OK, I concede. No idea on timescales though.
Full disclosure: I have always been quite strongly opposed to adding goto, and more recently the lack of said in JavaScript somewhat strengthened that opposition, since it might interfere with my plans for a JavaScript transpiler. But it would never ever in a bazillion years have supported #ilASM{} anyway. So yes, sometimes I spout nonsense.
The Phix help file does a great job of hiding the feature you don't want anyone to use
Fair point, in that there was no proper mention of goto or the #ilASM replacement anywhere at all in the manual. Not everyone has read pops.e (see line 1117), I guess...
I also searched for and re-read a few arguments that goto is fine as long as it's all forward-only (or all backward-only), which helped change my mind, so the new manual entry will recommend that.
and it's top-level only, and cannot be used within procedures or functions
Actually not true at all, the only thing is label scopes don't overlap, as in cross top-level/routine boundaries, since the callstack would inevitably and instantly and irretrievably be fubar.
(Although, actually, you can jump to a global label from within a routine, at your own risk.)
how much trouble the coder can get into using the case statement, which wouldn't happen if goto was available.
That was in fact a pretty good winning point. It also reminded me of how reluctant I once was to adding the switch statement.
55. Re: wikipedia draft
- Posted by katsmeow Jan 12, 2021
- 1892 views
Fair point, in that there was no proper mention of goto or the #ilASM replacement anywhere at all in the manual. Not everyone has read pops.e (see line 1117), I guess...
Ok, read. To address your concerns...
I am guessing, but i suspect the labels in OE are in quotes, being strings, to avoid the possibility of them being reserved names of anything. However, and you are in a better position than me to test this, this feature prohibits the ability to goto the value of a variable.
words = {"apple","tree","cow"} goto words[1] :tree -- code for trees :apple -- code for apples
I 100% agree major code boundries should not be crossed.
All the existing flow control loops go backwards, and i suspect if i checked, all but one or two of my uses of goto will be forwards, but this doesn't mean i'd prohibit back jumps. It's just that if i know i will be making a jump back, i can use a loop construct that does that. If you can admit while 1 do ... break ... end while is legal, and break is a forwards jump?
Kat
56. Re: wikipedia draft
- Posted by petelomax Jan 13, 2021
- 1866 views
I am guessing, but i suspect the labels in OE are in quotes, being strings, to avoid the possibility of them being reserved names of anything.
Maybe, I was not planning on replicating Euphoria's label "string" and goto "string" syntax anyway.
(I also have no intention of adding labelled/numbered break, continue or exit statements, or any form of retry. A goto would cover all that nonsense perfectly well enough anyway, and more.)
However, and you are in a better position than me to test this, this feature prohibits the ability to goto the value of a variable.
words = {"apple","tree","cow"} goto words[1] :tree -- code for trees :apple -- code for apples
Oh my, I wasn't planning on anything like that.
Why on earth would anyone in their right mind ever want anything remotely like that, he asks, hopefully rhetorically.
Given that Phix already supports
#ilASM{ jmp :meaningful_label } ... #ilASM{ ::meaningful_label }
I was merely planning on the following (exact) syntax
goto :meaningful_label ... ::meaningful_label
And simply re-factoring/re-using some of the existing code.
goto should be resolved at compile-time, into a fixed single (possibly short) machine instruction.
If you think I was reluctant to add goto, imagine how reluctant I will be to carry forward a string lookup table and the associated address table into the runtime, along with error handling code and an almost guaranteed branch misprediction.
(Besides, if you really, really, really wanted to, you could do all that in #ilASM{} yourself anyway, today)
doesn't mean i'd prohibit back jumps.
I said recommend, not prohibit.
57. Re: wikipedia draft
- Posted by katsmeow Jan 13, 2021
- 1845 views
However, and you are in a better position than me to test this, this feature prohibits the ability to goto the value of a variable.
words = {"apple","tree","cow"} goto words[1] :tree -- code for trees :apple -- code for apples
Oh my, I wasn't planning on anything like that.
Why on earth would anyone in their right mind ever want anything remotely like that, he asks, hopefully rhetorically.
In the olden daze, and here i mean the early 1980's (like 1979), it was a pretty elegant way to do a case statement. In the example, i picked a value from the predetermined list of words, as if i was restricting the range of words, but back then it was common to play with the machine code mechanism behind the scenes, leading to such situations (updated with modern Eu/Phix syntax) as
goto {"tree","orange"} :tree ::orange -- would land here :color ::orangeBut of course we could find a way to do that differently now.
doesn't mean i'd prohibit back jumps.
I said recommend, not prohibit.
Yes, sorry, let me rephrase : i would not prohibit whichever one i didn't recommend.
Kat
58. Re: wikipedia draft
- Posted by _tom (admin) Jan 13, 2021
- 1836 views
latest draft of wikipedia Phix is now in sections for easier access
be well
_tom
59. Re: wikipedia draft
- Posted by irv Jan 14, 2021
- 1799 views
Just to note: claiming Phix works with Gtk is mostly wishful thinking.
I have approximately 5% of the Gtk library converted at this point. Some of the remaining 240-odd controls can be done in a few minutes, other more complicated ones may each take weeks.
If we remain in quarantine for another year, I might finish in a year. If not, I'm gone on a world cruise.
60. Re: wikipedia draft
- Posted by _tom (admin) Jan 14, 2021
- 1794 views
Just to note: claiming Phix works with Gtk is mostly wishful thinking.
I have approximately 5% of the Gtk library converted at this point. Some of the remaining 240-odd controls can be done in a few minutes, other more complicated ones may each take weeks.
If we remain in quarantine for another year, I might finish in a year. If not, I'm gone on a world cruise.
thanks, will be fixed
be well
_tom