[stringtemplate-interest] v4 ST

Terence Parr parrt at cs.usfca.edu
Wed Oct 7 19:52:47 PDT 2009


On Oct 7, 2009, at 5:41 PM, Zenaan Harkness wrote:

>> Example compilation:
>>
>> compile: <if(name)>works<else>fail<endif>
>>
>> 0000:	load_attr  #0:"name"
>> 0003:	brf        13
>> 0006:	load_str   #1:"works"
>> 0009:	write
>> 0010:	br         17
>> 0013:	load_str   #2:"fail"
>> 0016:	write
>>
>> compile: hi <name:a>!
>>
>> 0000:	load_str   #0:"hi "
>> 0003:	write
>> 0004:	load_attr  #1:"name"
>> 0007:	load_str   #2:"a"
>> 0010:	map
>> 0011:	write
>> 0012:	load_str   #3:"!"
>> 0015:	write
>>
>> Cool, right?
>
> Looks cool. Is that Java byte-code, or some new fangled thing?

new thing. 12 instructions.

> If it's new, was there a need to create a new byte-code language?

yep, specialized instructions for specialized language. now "map" for  
example in java.

Ter


More information about the stringtemplate-interest mailing list