1. [GEN] Re: Random Thoughts, Worth What You Paid For Them.
R. W. D. wrote:
> 4. OX is interesting; I -think- I see where Mr. Cuny
> is going. I'd been wishing for yacc & lex in Euphoria
> too. But I wonder how difficult it would have been to
> implement precedence rules? ("...left as an exercise
> for the reader." ?)
Ox was a diversion, written mainly because I figured out an easy way to
convert LL(1) grammar into Euphoria code. The project grew from there. The
justification was that I needed a better parser for SWIG, but the reality
was that it was a fun project, and a bit of a challange.
Take a look how the Py grammar implements precedence - it's actually
trivial. If you're serious about using it, I'll be willing to look into
adding precedence rules into Ox. It shouldn't be that difficult to code -
just programmatically do what's already done by hand.
> [ Mr. Cuny] certainly seems to contribute... quite
> a bit.
Please, call me David. "Mr. Cuny" makes me feel so... old.
All this contribution seems indicitive that I need to get a life. Now excuse
me as I chase my two-year old back to bed...
> On a guess, is Mr. Cuny contemplating the creation
> of his own language to compete with Euphoria?
No, sorry. It's too much work to market and promote a niche language, even
if I did want to code one. If I were serious about it, I'd write it in C.
And I really don't like writing in C, because I code for fun, and I've been
spoiled by interpreters.
I wrote Py as a demo for Ox. I wanted to show how one could write a fairly
complex grammar and interpreter using Ox. I didn't want to write a direct
Euphoria clone, since Robert has stated that he doesn't want to post
Euphoria clones on his site - sort of counter-productive to his business. Py
is different enough from Euphoria that he (hopefully) won't consider it a
Euphoria clone. And it's enough like Euphoria that I can actually use it to
code.
Since I've been reading about Python, I started writing Py as a 'mini'
version of Python. Then I started added some Euphoria grammar, and the
result is... well, rather interesting. I think it demonstrates a number of
very cool features, and I'll continue to develop it. I figure that if
Euphoria is about 40 times faster than Python, then even if Py is 20 slower
than Euphoria, it's still twice as fast as Python, and it still fits on a
single floppy disk. So I get the best of both worlds.
If anyone tried Py and has some feedback, I'd appreciate it. I've already
fixed a number of bugs in the code.
Hrm... Wasn't I supposed to be working on those emulated widgets this
weekend? Sorry, Judith.
> I'd bet on Mr. Cuny's language
> in the long run, based on a single
> statement he made about the
> nature of computer languages.
That would be a mistake. A couple of years ago, I set out to write a clone
of Euphoria. I did a horrible job, and finally gave up. The scheme that I
invented to work with sequences was complex beyond belief, and I kept
reference counts on *everything*. Pete (and Menno) did a much better job
with Peuphoria.
> 5. What's "orthogonality"? I have three books
> about compiler construction on my desk, and
> the word is not in any of the indexes or table of
> contents.
Think of it as a consistant use of operands. In Euphoria, the binary
operators {+-*/} operate on sequences. That is, if you write:
2 + {1,2,3}
you get:
{3,4,5}
The '+' operator accepts a sequence as an argument, and (here's the
important bit) returns a sequence as a result.
Robert says that Euphoria is a sequence-bassed language, and binary
operators returning sequences if they were passes sequences is just basic
consistancy. So the other binary operators {= != < <= > >= and or} return
sequences if they are passed sequences.
> 7. There is (or was) a language called FORTH. FORTH's
> creator eventually built a microprocessor that can be
> directly coded in FORTH ... that is, the processor's assembly
> language -IS- FORTH.
Take my word for it - you don't want to code in FORTH, even if it's
supported in silicon. I did it for years, and actually enjoyed it. But
there's not really a lot of demand for FORTH coders, except maybe at some
Saudi airport.
> I assume that some hardware guy somewhere is
> slapping together microprocessor to execute Java
> bytecode. If Euphoria could emit this bytecode, it
> would have a jump on other languages when such
> a microprocessor becomes available.
Actually, a number of chips (like Transmeta's) go a step further and allow
you define your own opcodes. So you can tell the CPU to behave like an x86,
and run PC programs, and then a 68000 and run old Mac code, execute Java
code natively, or even (bleah) run .NET.
-- David Cuny