[stringtemplate-interest] pushed another ST4 build
Terence Parr
parrt at cs.usfca.edu
Wed Dec 29 11:44:38 PST 2010
Cool :) Yeah, the bytecode interp is WAY simpler and in principle
much much faster than tree-based one for STv3.
The new GUI debug widget is totally great too.
Ter
On Dec 29, 2010, at 11:23 AM, Monty Zukowski wrote:
> Just read your notes on the interpreter. Looks very clean, should
> make for great portability and speed.
>
> Nice!
>
> Monty
>
> On Wed, Dec 29, 2010 at 9:03 AM, Terence Parr <parrt at cs.usfca.edu>
> wrote:
>> Nope, just an array;
>>
>> t(x,y) ::= "<x><y>"
>>
>> generates
>>
>> load_local 0
>> write
>> load_local 1
>> write
>>
>> The compiler translates id to int. For dynamic scoping look up, it
>> keeps a
>> hashtable but in the template def object not the ST itself. then
>> you can do
>>
>> locals[impl.formalArgs.get(id).index]
>>
>> to get value if you only have a name.
>>
>> This saves a hashtable per ST :) memory and gc overhead savings
>>
>> T
>> On Dec 28, 2010, at 2:32 PM, Monty Zukowski wrote:
>>
>>> What's the rationale there? Is the array key,value,key,value?
>>> Since
>>> the number of items is usually short, a few equals() calls beats the
>>> hash function?
>>>
>>> Monty
>>>
>>> On Mon, Dec 27, 2010 at 12:54 PM, Terence Parr
>>> <parrt at cs.usfca.edu> wrote:
>>>>
>>>> fast array not hashmap look up for attributes.
>>>> http://bit.ly/hVN7PG
>>>> Ter
>>>> _______________________________________________
>>>> stringtemplate-interest mailing list
>>>> stringtemplate-interest at antlr.org
>>>> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>>>>
>>>>
>>> _______________________________________________
>>> stringtemplate-interest mailing list
>>> stringtemplate-interest at antlr.org
>>> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>>
>>
More information about the stringtemplate-interest
mailing list