Re: Tcl - compiling

2005-10-04 Thread Will Coleda
On Oct 4, 2005, at 5:11 AM, Leopold Toetsch wrote: On Oct 4, 2005, at 3:52, Will Coleda wrote: On Oct 3, 2005, at 6:34 PM, Leopold Toetsch wrote: I don't see the point. Your compiler can emit, e.g.: "while"(test, body) That's actually how things work right now (very similar to

Re: Tcl - compiling

2005-10-04 Thread Leopold Toetsch
On Oct 4, 2005, at 3:52, Will Coleda wrote: On Oct 3, 2005, at 6:34 PM, Leopold Toetsch wrote: I don't see the point. Your compiler can emit, e.g.: "while"(test, body) That's actually how things work right now (very similar to the interpreter from previous versions). Not quite: $

Re: Tcl - compiling

2005-10-03 Thread Will Coleda
On Oct 3, 2005, at 6:34 PM, Leopold Toetsch wrote: On Oct 3, 2005, at 22:57, Will Coleda wrote: 3) Keep a global counter that is incremented whenever a procedure is created or rename'd. When generating the compiled code, key against this counter - if it's changed, we must fall back to th

Re: Tcl - compiling

2005-10-03 Thread jerry gay
On 10/3/05, Will Coleda <[EMAIL PROTECTED]> wrote: > Committed: partcl is now now a compiler. Though some tests still fail > (leo fixed one of the unicode issues) > > t/cmd_global.t 3 768 63 50.00% 2-4 > t/cmd_proc.t 4 1024114 36.36% 3-4 8-9 > t/cmd_return.t

Re: Tcl - compiling

2005-10-03 Thread Leopold Toetsch
On Oct 3, 2005, at 22:57, Will Coleda wrote: 3) Keep a global counter that is incremented whenever a procedure is created or rename'd. When generating the compiled code, key against this counter - if it's changed, we must fall back to the interpreted version. (which, although it starts out wi

Re: Tcl - compiling

2005-10-03 Thread Will Coleda
Committed: partcl is now now a compiler. Though some tests still fail (leo fixed one of the unicode issues) t/cmd_global.t 3 768 63 50.00% 2-4 t/cmd_proc.t 4 1024114 36.36% 3-4 8-9 t/cmd_return.t 1 256 21 50.00% 1 t/cmd_string.t 2 5

Re: Tcl - compiling expressions

2005-10-01 Thread Will Coleda
On Oct 2, 2005, at 1:40 AM, Will Coleda wrote: I've attached the generated PIR output for the sample program, which outputs "10" set a 0 while {$a < 10} { incr a } puts $a Ok, technically, it's not the output of a complete PIR program, it's the concatenated output of several chunks. O

Re: Tcl - compiling expressions

2005-10-01 Thread Will Coleda
The simple version of the compiler is now mostly done in my sandbox: Failed Test Stat Wstat Total Fail Failed List of Failed --- t/cmd_global.t 3 768 63 50.00% 2-4 t/cmd_proc.t 4 1024

Re: Tcl - compiling expressions

2005-09-30 Thread Amos Robinson
Eeek. Yes, I forgot just how crazy a language it was. :-D > Yes, that's the plan, but the initial implementation isn't going to > be a compiler like most people would expect: > > For example, something like: > > while {$a < 10} { incr a } > > while isn't language syntax. it's a command. So, this c

Re: Tcl - compiling expressions

2005-09-29 Thread Will Coleda
Yes, that's the plan, but the initial implementation isn't going to be a compiler like most people would expect: For example, something like: while {$a < 10} { incr a } while isn't language syntax. it's a command. So, this code would result in creating two PMCs for the args (first arg is {$

Re: Tcl - compiling expressions

2005-09-29 Thread Amos Robinson
Very cool. Will have to look into it soon. Are you still contemplating making the whole thing compiled? > Tcl's [expr] command now compiles expressions to PIR (before, it would create an AST that it would then interpret when you wanted the value.). Note: the language itself is still interpreted, t