00:00:00 --- log: started retro/13.01.24 00:16:30 --- join: tangentstorm (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #retro 00:23:14 --- quit: tangentstorm (Ping timeout: 255 seconds) 00:46:30 --- join: tangentstorm (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #retro 00:53:09 --- quit: tangentstorm (Ping timeout: 264 seconds) 01:26:29 --- join: tangentstorm (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #retro 03:21:57 In +ws I think the &pass should go before the &remap:whitespace 03:22:31 ... 03:23:31 d'oh 03:23:43 :) 03:56:16 --- nick: tangentstorm -> tangentaway 09:43:55 --- join: ncv (~quassel@89.35.216.197) joined #retro 09:43:58 --- quit: ncv (Changing host) 09:43:58 --- join: ncv (~quassel@unaffiliated/neceve) joined #retro 09:58:20 --- join: Mat2 (~claude@91-65-144-133-dynip.superkabel.de) joined #retro 09:58:27 namaste ! 10:58:16 hey all. 10:58:19 --- nick: tangentaway -> tangentstorm 11:01:56 hi tangentstorm 11:02:53 hey Mat2. How goes it? :) 11:03:20 quite good 11:03:47 what is new about your oberon compiler ? 11:03:55 h 11:04:03 er. Constants! 11:05:04 you can declare int and string constants now, except the string "xyz" turns into ""xyz"" and i haven't gotten around to fixing it 11:06:01 i still haven't tested the for loop compiler crc helped me with... i have to fix variables first :) 11:07:38 i'm thinking about using retro's class idea in my compiler. 11:08:57 like maybe set up a listener mode that doesn't immediately execute the class, but just leaves it on the stack 11:09:09 That's what I'd recommend you 11:09:56 you can probably use the macro class as alternative 11:10:13 so if you say 2 x + the + would be a special "compiler +" that actually accepted 4 values : left left-type right right-type 11:10:35 maybe 11:10:46 here's the problem: 11:11:04 say i want to emit x := x + 1; 11:11:22 to compile that i mean 11:11:30 x @ 1 + x ! 11:11:51 it's the @ and ! that cause problems 11:12:26 or 11:12:30 x := y + 1 11:12:43 here, y might be a variable or might be a constant 11:12:50 so is it: 11:12:56 y @ 1 + x ! 11:12:58 or: 11:13:01 y 1 + x ! 11:13:14 x and y must be priour defined variables 11:13:36 hmm 11:13:45 so implement a variable class first, which run-time behaviour 11:13:57 i suppose i don't need constants 11:14:13 parse the input buffer 11:15:22 and execute routines dependent on operator tokens like + := etc. 11:16:00 another appoach would be to convert to postfix first before processing 11:16:26 the code i emit is already in postfix 11:16:30 i thought that would be hard 11:16:53 but it's easy because the act of parsing already takes care of ordering things 11:17:23 * and / just show up higher in the abstract syntax tree than + and - 11:17:41 so for any binary operator, you can just emit left right op 11:17:57 than executing is just application of class behaviour 11:18:32 x 1 + x := 11:18:34 --- join: kumul (~Kumool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 11:19:25 execute class-routine of x: -> '@x' 11:19:32 in plain retro, x 1 + will add 1 to the address of x 11:19:45 if x is a variable 11:19:59 or 1 to the value if its a constant 11:20:57 just create a constant and variable class 11:21:44 but i don't know whether i want the value or the address until i know what the operation is 11:21:55 so the operator itself needs to know that 11:22:05 you will need a state variable for this decision 11:22:29 + needs to make everything a value and := needs to make the one on the left an address 11:22:44 the := is easy 11:22:56 but the + is tricky 11:23:30 it can't treat both arguments the same 11:23:36 because either can be a constant or a variable 11:23:57 in the PL/0 compiler i just worked this out in python and generated the correct code 11:24:10 but i am trying to let retro do the work here 11:24:39 so the idea i had was to put 4 numbers onto the stack 11:24:44 no, it's easy. Every variable routine set a state variable and the routine for '+' is now able to compile different code for each case 11:25:03 better define a flag array for each possible state 11:25:23 hmm 11:25:24 so each class-routine can compile dependent on all valid states possible 11:25:42 but where does the flag come from? 11:25:54 the state variable i mean 11:26:21 ?? just create an array 11:26:44 in forth: create n allot 11:27:00 i mean... 11:27:04 like.. hrm.. 11:27:26 let me show you the code 11:27:35 --- join: kumool (~Kumool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 11:28:11 actually you've given me an idea and i think i have an answer now, but let me show you the code anyway :) 11:28:42 ok :) 11:29:51 https://github.com/nickelsworth/noct/blob/master/targets/Retro.stg#L47 11:29:59 op_add(a, b) ::= " +" 11:30:11 --- quit: kumul (Ping timeout: 256 seconds) 11:30:52 this is StringTemplate code... It has basic if/then logic available and a "foreach" but it can't do any numbers or calculations 11:31:08 the if/then is only "is this field empty or not?" 11:31:25 no other expressions, as far as i know 11:32:52 so the template doesn't know what a and b are... they're already compiled strings 11:33:24 uh 11:33:58 execute the string with eval ? 11:34:37 the compiler itself walks the abstract syntax tree recursively and when it gets to a variable-node, it will emit the name 11:34:50 but right now it doesn't know whether it's on the left hand side or the right hand side of := 11:35:20 or if it's going to call a procedure, it doesn't know whether it's going to pass by reference or pass by value 11:35:54 i can make the java part of the compiler figure it out 11:36:05 but i don't want to because the java part is going away 11:36:18 if your compiler would create a word for each new variable this would not the problem 11:36:27 ( the oberon compiler is a prototype for the compiler i really want to make ) 11:36:34 it does 11:37:12 but say i emit x 1 + 11:37:22 x could be a constant or a variable 11:37:36 well 11:37:39 instead of 1 say 2343 11:37:55 the class handler can handle this (state-smart word defination) 11:37:57 now say x happens to be defined in the dictionary at point 2343 11:38:01 x 1 + 11:38:06 hx 2343 + 11:38:18 x 2343 + 11:38:26 on the stack : 2343 2343 + 11:38:46 how does + know which one is a literal 2343 and which one is an address? 11:38:52 this is why it needs to be: 11:39:13 2343 ADDR 2343 CONST [+] 11:39:57 the parser need to set the state information 11:40:03 at parsing 11:40:26 the information is in the tree 11:40:49 but eventually i want the parser to be pretty dumb 11:41:01 because in wejal, you can extend the parser 11:41:10 ( the language i'm creating ) 11:41:18 your parser do not handle states 11:41:29 it could but i don't want it to 11:41:55 anyway, this is what i came up with up until now 11:42:01 but you gave me the idea to do this: 11:43:02 : [+] 2 numbers + ; 11:44:45 : numbers "( XXn-xx ) convert n type-tagged items to n values" :doc .... ; 11:45:06 maybe values would be a better word for it 11:45:17 yes 11:45:42 I'm off for some hours, see you later ! 11:45:49 2 values might even simplify to op: + 11:45:52 ok. seeya :) 11:45:56 thanks! 11:46:00 no problem 11:46:06 --- quit: Mat2 (Quit: Verlassend) 12:23:46 --- join: mo (~Kumool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 12:24:10 --- nick: mo -> Guest48630 12:26:38 --- nick: Guest48630 -> Kumul 12:27:25 --- quit: kumool (Ping timeout: 256 seconds) 12:28:03 --- join: kumool (~Kumool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 12:31:12 --- join: impomatic (~digital_w@87.114.138.192) joined #retro 12:32:09 --- quit: Kumul (Ping timeout: 264 seconds) 12:45:39 --- join: Mat2 (~claude@91-65-144-133-dynip.superkabel.de) joined #retro 12:46:00 *ping* 12:48:53 wb 12:52:44 have you solved the problem ? 12:58:18 nope, i was doing chores and checking email and stuff :) 12:58:27 just getting back to work on it now 13:11:55 ok 13:27:30 --- nick: Mat2 -> Mat2-coding 14:57:02 --- quit: ncv (Remote host closed the connection) 15:11:43 --- quit: kumool (Read error: Connection reset by peer) 15:56:34 --- join: kumul (~Kumool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 16:20:17 --- nick: Mat2-coding -> Mat2 16:20:27 get some sleep, ciao 16:20:32 --- quit: Mat2 (Quit: Verlassend) 16:23:48 --- nick: tangentstorm -> tangentaway 16:50:38 --- join: erider (~chatzilla@unaffiliated/erider) joined #retro 16:50:43 hi all 17:32:27 --- quit: erider (Quit: ChatZilla 0.9.89 [Firefox 18.0/20130107224926]) 17:46:24 Hi erider 19:23:40 --- quit: kumul (Quit: Leaving) 19:30:08 --- join: kumul (~Kumool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 20:31:07 --- nick: tangentaway -> tangentstorm 21:08:30 --- quit: kumul (Quit: Leaving) 22:09:16 --- nick: tangentstorm -> tangentwork 23:58:13 --- quit: karswell (Read error: Connection reset by peer) 23:58:49 --- join: karswell (~user@93-97-29-243.zone5.bethere.co.uk) joined #retro 23:59:59 --- log: ended retro/13.01.24