1. EU script
Has anyone written an EU scripting engine?
I didn't see it in the archives.
I'm surprised in fact that there isn't one there already.
It would solve quite a few problems.
Like variable execution, dynamic includes, plugin applications.
I have started on one, but I thought I would ask in case it's already out
there somewhere and I overlooked it.
Side note:
What exactly is p-code? I know it's an intermediate language definition,
to aid in speeding up the execution. But is there other reasons for using
it?
I'm already implementing p-code, but I just want to know if there's more I
should be doing with it,
So far, my script engine can process expressions. And I use the p-code, for
the secondary, execution pass, and inlining literal expressions in the
parser pass.
What's the best way to handle routines? Should I inline them into the
p-code? or should the p-code still call the routines? Or CAN I inline the
routines?
I can't wrap my brain around the concept of branching the p-code.
Chris
2. Re: EU script
From: Chris Bensler <bensler at telus.net
> Has anyone written an EU scripting engine?
> I didn't see it in the archives.
> I'm surprised in fact that there isn't one there already.
> It would solve quite a few problems.
> Like variable execution, dynamic includes, plugin applications.
>
> I have started on one, but I thought I would ask in case it's already out
> there somewhere and I overlooked it.
Chris:
Have you thought about imbedding Lua? That's exactly what it was designed
for,
and Lua looks so much like euphoria it's spooky. Even down to the --
comments.
Example follows:
--------------------------------
-- 99 bottles of beer ~ Lua 4.0
--------------------------------
function bottle(n)
if n==0 then return 'no more bottles'
elseif n==1 then return '1 bottle'
else return n..' bottles'
end
end
n=99
while (n > 0) do
print (bottle(n)..' of beer on the wall,')
print (bottle(n)..' of beer.\nTake one down,\npass it around,')
n = n - 1
print (bottle(n)..' of beer on the wall.\n')
end
Regards,
Irv
3. Re: EU script
That does look very familiar, but my intention is to have a scripting engine
that can execute any EU code file.
including 'includes'... maybe, hmm, don't know yet..
So someone could effectively write a stand alone eu program and run it as a
script.
Chris
> Have you thought about imbedding Lua? That's exactly what it was designed
> for,
> and Lua looks so much like euphoria it's spooky. Even down to the --
> comments.
> Example follows:
>
> --------------------------------
> -- 99 bottles of beer ~ Lua 4.0
> --------------------------------
> function bottle(n)
> if n==0 then return 'no more bottles'
> elseif n==1 then return '1 bottle'
> else return n..' bottles'
> end
> end
>
> n=99
> while (n > 0) do
> print (bottle(n)..' of beer on the wall,')
> print (bottle(n)..' of beer.\nTake one down,\npass it around,')
> n = n - 1
> print (bottle(n)..' of beer on the wall.\n')
> end
>
> Regards,
> Irv
>
4. Re: EU script
----- Original Message -----
From: Chris Bensler <bensler at telus.net>
> That does look very familiar, but my intention is to have a scripting
engine
> that can execute any EU code file.
> including 'includes'... maybe, hmm, don't know yet..
> So someone could effectively write a stand alone eu program and run it as
a
> script.
Dave Cuny (I think) had a Euphoria interpreter written in Euphoria. Maybe
it's still in the archives. I believe it was fairly slow, being an
interpreter running in an interpreted language.
Regards,
Irv