Logo Compilers 
Author Message
 Logo Compilers

Quote:

> I don't see the difficulties you point out as being too
intractable.
> Logo like languages have been compiled in one form or
another for
> decades and the knowledge behind it all is there for all
to read. Alot
> is free on the net too.

I agree though that it's do-able. To do well, it requires a
JIT (Just In Time) compiler. In this case, a new/modified
procedure is compiled to native code on the fly. One aspect
of Logo that is a pain for implementation is part of it's
beauty. Given a statement "foo 5 bar 6 7" The logo
interpreter can either treat this as (foo 5 (bar 6 7)) or
(foo 5) (bar 6 7) (and there's enough run-time context to
know which). If the number of default parameters to "foo" is
changed during run-time, every procedure that is dependent
upon "foo" potentially has to be re-compiled.

Of course, you can ignore all this and restrict the power of
the Logo language by ripping out the 'difficult' functions
(define etc).

A more popular alternative is p-code compilers. Compiling
into an internal code (usually referred to as p-code).
There's still an interpreter involved so when someone asks
for a compiler, this doesn't jump to mind. This is the
technique employed by TKTS Logo (and I'm sure others) and
allows for optimizations without going the whole-hog in
writing native code on the fly.

Quote:

> > I'm always wary when someone asks for a Logo compiler.
Most
> > people who ask for compilers are asking for one of two
> > things
> > 1) A self contained executable unit. There are other
ways to
> > achieve this without having a full compiler.
> > 2) Speed. If this is the requirement, Logo is most
likely
> > the wrong language choice for the project.

> Don't get this at all.

When someone asks for a compiler, what are they really
asking for? A compiler is a means to an end, and that end is
almost always performance. In this arena, Logo is not very
efficient.

Jamie

To unsubscribe from this group, send an email to:

LogoForum messages are archived at:
http://www.*-*-*.com/

Your use of Yahoo! Groups is subject to http://www.*-*-*.com/



Mon, 05 Jul 2004 21:30:10 GMT  
 Logo Compilers

Quote:

> Given a statement "foo 5 bar 6 7" The logo
>interpreter can either treat this as (foo 5 (bar 6 7)) or
>(foo 5) (bar 6 7) (and there's enough run-time context to
>know which). If the number of default parameters to "foo" is
>changed during run-time, every procedure that is dependent
>upon "foo" potentially has to be re-compiled.

Or (foo 5 (bar 6) 7)! :-)

I believe that pretty much all Logo interpreters actually carry out the first
step of compiling, which is to turn the procedure text into a tree structure
that disambiguates the grouping.  (This is done when foo is first called, not
when it's defined, because when foo is defined we might not have defined bar
yet, so we don't know enough to build the tree yet.  And indeed foo is
re-parsed if either foo or bar is redefined.  Some implementations, including
UCBLogo, simplify the bookkeeping by throwing out *all* parse trees for all
known procedures whenever any procedure is redefined in a way that changes
its default number of inputs.  This means that some procedures will be
re-parsed unnecessarily, but the theory is that it's very rare to redefine
a procedure in a way that changes how many inputs it takes.)



Wed, 07 Jul 2004 04:35:17 GMT  
 Logo Compilers

Quote:
> -----Original Message-----
> From: Brian Harvey
> Sent: Friday, January 18, 2002 8:23 PM

> Subject: Re: [LogoForum] Logo Compilers

> I believe that pretty much all Logo interpreters actually
> carry out the
> first
> step of compiling, which is to turn the procedure text
into a tree
> structure
> that disambiguates the grouping.

In TKTS Logo, I disambiguate it while compiling the p-code
from the runparse'd list without creating an intermediate
tree (though you could argue that there is an implicit tree
via nested calls).

My point though was that in a Logo compiler that fully
implements Logo there has to be a throwing away of generated
code in favor of new code which is not limited to the newly
defined procedure, implying some level of JIT compilation.

Quote:
> (This is done when foo is first called, not when it's

defined, because when foo

Quote:
> is defined we might not have defined bar
> yet, so we don't know enough to build the tree yet.  And
indeed foo is
> re-parsed if either foo or bar is redefined.

A full compiler probably would be more aggressive in when it
does the compilation. TKTS Logo though, being a p-code
compiler follows this JIT concept.

Quote:
> Some implementations,
> including
> UCBLogo, simplify the bookkeeping by throwing out *all*
parse
> trees for
> all
> known procedures whenever any procedure is redefined in a
way that
> changes
> its default number of inputs.  This means that some
procedures will be
> re-parsed unnecessarily, but the theory is that it's very
rare to
> redefine
> a procedure in a way that changes how many inputs it

takes.)

TKTS Logo also keeps track of whether a procedure has been
used in it's default form. If the procedure hasn't been used
in it's default form (by that I mean another procedure has
been compiled or built into a tree based on the default
arguments) then there is no need throw everything away.

Jamie

To unsubscribe from this group, send an email to:

LogoForum messages are archived at:
http://groups.yahoo.com/group/LogoForum

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



Thu, 08 Jul 2004 11:12:48 GMT  
 Logo Compilers


     Given a statement "foo 5 bar 6 7" The logointerpreter can either treat
this as (foo 5 (bar 6 7)) or(foo 5) (bar 6 7)
     Or (foo 5 (bar 6) 7)! :-)
 In Elica you'd also consider:     (foo 5 (bar) 6 7)  or (foo (5 bar) 6 7)
or (foo (5 bar 6) 7) or (foo (5 bar 6 7)) ... :-)      or even:      ((foo
5) bar 6 7)... :-) :-)
To unsubscribe from this group, send an email to:

LogoForum messages are archived at:
<http://groups.yahoo.com/group/LogoForum>
http://groups.yahoo.com/group/LogoForum

  Your use of Yahoo! Groups is subject to the
<http://docs.yahoo.com/info/terms/> Yahoo! Terms of Service.



Thu, 08 Jul 2004 11:18:20 GMT  
 Logo Compilers
i didnt realy understand that but the main reasion i want to be able to
compile is to have a exe file not a logo file
and what i understood didnt help me with that but thanks neway 8) <('.'<)
Quote:
----- Original Message -----

Newsgroups: comp.lang.logo
Sent: Friday, January 18, 2002 8:35 PM
Subject: Re: [LogoForum] Logo Compilers


> > Given a statement "foo 5 bar 6 7" The logo
> >interpreter can either treat this as (foo 5 (bar 6 7)) or
> >(foo 5) (bar 6 7) (and there's enough run-time context to
> >know which). If the number of default parameters to "foo" is
> >changed during run-time, every procedure that is dependent
> >upon "foo" potentially has to be re-compiled.

> Or (foo 5 (bar 6) 7)! :-)

> I believe that pretty much all Logo interpreters actually carry out the
first
> step of compiling, which is to turn the procedure text into a tree
structure
> that disambiguates the grouping.  (This is done when foo is first called,
not
> when it's defined, because when foo is defined we might not have defined
bar
> yet, so we don't know enough to build the tree yet.  And indeed foo is
> re-parsed if either foo or bar is redefined.  Some implementations,
including
> UCBLogo, simplify the bookkeeping by throwing out *all* parse trees for
all
> known procedures whenever any procedure is redefined in a way that changes
> its default number of inputs.  This means that some procedures will be
> re-parsed unnecessarily, but the theory is that it's very rare to redefine
> a procedure in a way that changes how many inputs it takes.)



Wed, 07 Jul 2004 17:30:27 GMT  
 Logo Compilers
Sorry, we got off in a tangent.
There are some utilities out there that will extract and run
some files from an exe (for example iexpress). I'm not sure
if MSWLogo will work in this model, I'm pretty sure UCBLogo
will.

As someone else pointed out, you can cause the logo program
to invoke the interpreter but it depends what your ultimate
goal is.

Jamie

Quote:
> -----Original Message-----
> From: jimmcgrim
> Sent: Sunday, January 20, 2002 8:24 AM

> Subject: Re: [LogoForum] Logo Compilers

> The message below is being cross-posted from
comp.lang.logo.
> Please reply


> i didnt realy understand that but the main reasion i want
to
> be able to
> compile is to have a exe file not a logo file
> and what i understood didnt help me with that but thanks
> neway 8) <('.'<)
> ----- Original Message -----

> Newsgroups: comp.lang.logo
> Sent: Friday, January 18, 2002 8:35 PM
> Subject: Re: [LogoForum] Logo Compilers


writes:
> > > Given a statement "foo 5 bar 6 7" The logo
> > >interpreter can either treat this as (foo 5 (bar 6 7))
or
> > >(foo 5) (bar 6 7) (and there's enough run-time context
to
> > >know which). If the number of default parameters to
"foo" is
> > >changed during run-time, every procedure that is
dependent
> > >upon "foo" potentially has to be re-compiled.

> > Or (foo 5 (bar 6) 7)! :-)

> > I believe that pretty much all Logo interpreters
actually
> carry out the
> first
> > step of compiling, which is to turn the procedure text
into a tree
> structure
> > that disambiguates the grouping.  (This is done when foo
is
> first called,
> not
> > when it's defined, because when foo is defined we might
not
> have defined
> bar
> > yet, so we don't know enough to build the tree yet.  And
> indeed foo is
> > re-parsed if either foo or bar is redefined.  Some
implementations,
> including
> > UCBLogo, simplify the bookkeeping by throwing out *all*
> parse trees for
> all
> > known procedures whenever any procedure is redefined in
a
> way that changes
> > its default number of inputs.  This means that some
> procedures will be
> > re-parsed unnecessarily, but the theory is that it's
very
> rare to redefine
> > a procedure in a way that changes how many inputs it
takes.)

> To unsubscribe from this group, send an email to:

> LogoForum messages are archived at:
> http://groups.yahoo.com/group/LogoForum

> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/

To unsubscribe from this group, send an email to:

LogoForum messages are archived at:
http://groups.yahoo.com/group/LogoForum

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



Fri, 09 Jul 2004 13:18:57 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. LOGO-L> Logo compiler

2. Logo Compiler

3. logo compiler

4. Logo Compilers

5. free Logo compiler

6. Looking for: Free Win 95 Logo Compiler

7. Logo compiler for a Macintosh

8. Logo Compilers?

9. Anyone know of a LOGO compiler?

10. Logo compilers

11. logo compiler

12. looking for logo compilers/interpreters

 

 
Powered by phpBB® Forum Software