[antlr-interest] ST 4.0 planning

Loring Craymer lgcraymer at yahoo.com
Mon Sep 8 19:40:36 PDT 2008





----- Original Message ----
> From: Terence Parr <parrt at cs.usfca.edu>
> To: antlr Interest <antlr-interest at antlr.org>
> Sent: Monday, September 8, 2008 4:49:40 PM
> Subject: Re: [antlr-interest] ST 4.0 planning
> 
> 
> On Sep 8, 2008, at 1:48 PM, Gavin Lambert wrote:
> 
...
> > and the little you can't do
> > with that can be done with one of those interface methods being a
> > "fetch me this data by name" type method (and companion
> > setter).  The only holdout requiring some kind of factory method
> > instead, which could simply be implemented via a different common
> > interface.
> 
> Oh, you mean create an adaptor object that implements an intrface  
> collected from every reference in a template?  How could you know  
> until runtime what those types/methods are?
> 
> Hmm...i'm pretty sure nonreflective languages make ST hard to  
> implement since it's untyped.  And I mean untyped (like assembly code)  
> not dynamically typed like python.  I'd be overjoyed to be wrong  
> though ;)

Hmm--I don't see this at all.  ST is monotyped--"everything is a (multi-valued with ordered or named values) string"--just as Python follows the OO theme that "everything is an object".  Assembly code is statically typed, with bytes, words, and dwords; sometimes there are also floats and doubles and bits.  There are minor deviations--the use of Booleans, for example, in ST conditionals is the obvious one--but reflection is not a necessity for implementation, just a convenient way of translating (qualified) names to strings.  It is equally reasonable to have a standard wrapper "type" (interface, base adaptor class, etc.) and only pass strings, string templates, or wrapped objects to ST and to dispense with reflection.  The cost to the user is that he has to write the wrappers (not a big cost; even that can be automated from a "type specification"); the gain is that ST becomes easily portable.

--Loring

> 
> Ter
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address



      


More information about the antlr-interest mailing list