IRC logs for #opendune on OFTC at 2011-09-15
⏴ go to previous day
13:49:26 <TrueBrain> "I'd never have realized this without the OpenDune code though.. just as I would never have realized that tons of the previously-unknown values at the start could never be identified because they were shared by units and buildings, but completely unused by one of them. "
13:49:43 <TrueBrain> and this is why I didn't want to use his information from the start :D
15:34:54 <TrueBrain> glx: segra gave me the idea to make a EMC compiler, and a higher language on top of that; going to fiddle with that now (and most likely during the next 3 days :P)
15:35:23 <TrueBrain> higher language will be in python
15:35:28 <TrueBrain> lower in C I guess .. :P
15:35:39 <TrueBrain> it can borrow the ChunkFile_Read nicely :P
17:13:02 <TrueBrain> most likely due to translations
17:13:35 <TrueBrain> but we can just remove that stuff I guess
17:20:16 *** Alberth has joined #openDune
17:20:16 *** ChanServ sets mode: +o Alberth
17:58:55 <TrueBrain> glx: regarding the last commit ( DorpsGek is not reporting, forgot to fix that)
17:59:01 <TrueBrain> can you help me finding better names?
17:59:04 <TrueBrain> they are a bit longish now
17:59:14 <TrueBrain> Alberth / planetmaker : feel free to join the naming party :D
18:00:34 <Alberth> oh, that's much better than the previous one :)
18:04:16 <TrueBrain> mostly I wonder about the names PUSH_RETURN_OR_LOCATION, STACK_REWIND, ..
18:04:23 <TrueBrain> any better suggestions are very welcome :)
18:06:14 <TrueBrain> what is a good name for the bitwise negation (~)
18:06:23 <TrueBrain> I am tempted to name it XOR
18:06:59 <planetmaker> function an instruction is the same?
18:07:16 <planetmaker> of course XOR is good for that.
18:07:25 <planetmaker> I talked of values 14 and 15
18:07:42 <TrueBrain> a function is a C function
18:07:45 <TrueBrain> which can be anything
18:07:49 <TrueBrain> (there are like 80+ functions)
18:08:08 <planetmaker> ok, just checking it's really different... I'm missing the context of the diff :-)
18:08:54 <TrueBrain> yeah; I can udnerstand that :)
18:08:59 <planetmaker> your naming is good IMHO
18:09:09 <planetmaker> and they're not too long either
18:09:23 <TrueBrain> but if you could understand what they do, that is good :)
18:09:24 <planetmaker> well... they do... sometimes... but it's difficult
18:09:42 <planetmaker> and the comments make me feel like I should know what they do
18:10:23 <planetmaker> SCRIPT_SET_RETURNVALUE maybe
18:10:36 <TrueBrain> it is variable returnValue
18:10:40 <TrueBrain> also a silly name tbh
18:10:52 <TrueBrain> lot of shit is never used too ...
18:11:19 <planetmaker> and... maybe just SCRIPT_JUMP and ..._JUMP_NE
18:11:28 <planetmaker> a jump always has a target ;-)
18:12:47 <TrueBrain> (sucky DorpsGek :P)
18:13:15 <Xaroth|Work> DorpsGek is teh b0rked?
18:13:23 <TrueBrain> Xaroth|Work: it listens on the wrong port :P
18:13:36 <Xaroth|Work> then change the commit script? :P
18:14:06 <TrueBrain> there is nothing I can change it into which makes it work
18:21:37 <TrueBrain> lets reduce the amount of labels ...
18:29:46 <Alberth> STACKREWIND 1 <-- DROP 1 (or just DROP)
18:30:05 <TrueBrain> but then how to call STACKFORWARD?
18:30:11 <TrueBrain> (I wouldn't know why that would ever be used, but enfin)
18:30:37 <TrueBrain> unit uses it a few times, bah
18:31:33 <Alberth> the code reminds me a bit of Forth :)
18:38:05 <TrueBrain> INVERT is ambigious
18:38:10 <TrueBrain> I guess in some way it is the same :)
18:42:39 <TrueBrain> even in scripts they are just silly
18:42:49 <Alberth> xor is a binary operator for me, you are probably right that xor is more clear what it does
18:43:04 <TrueBrain> XOR is also an unary operator, which is always the issue :)
18:43:09 <TrueBrain> the binary I called BXOR
18:43:19 <TrueBrain> a similar problem exists with AND and BAND
18:43:22 <Alberth> they had a very stupid compiler :)
18:43:27 <TrueBrain> AND is the binary compare, and BAND the binary operator
18:43:50 <TrueBrain> I am trying to get Xaroth|Work write a higher language for this ... I think he is going for Python atm :P
18:44:19 <Alberth> good choice Xaroth|Work :)
18:44:44 <TrueBrain> all the script functions start with this PUSH 1 JNE <end of script>
18:44:51 <Alberth> and I was always thinking compare was written as CMP :p
18:45:32 <Alberth> strcmp for example :)
18:45:41 <TrueBrain> to what were you refering
18:45:53 <TrueBrain> it sounds a bit out-of-the-blue comment without a context
18:45:53 <Alberth> "AND is the binary compare"
18:46:22 <TrueBrain> if you call && CMP, fine by me :)
18:46:41 <Alberth> your short term memory needs to be increased in size, or you need a higher chat window :)
18:46:51 <TrueBrain> always ends a function
18:48:51 <TrueBrain> now how am I going to name CALL IDs
18:49:00 <TrueBrain> these names are far from known and are prone to changing
18:50:19 <TrueBrain> what do you guys think: we can either implement lua (embedded) in OpenDUNE to replace EMC, or use an encoder (like grfs) and keep this bytecode?
18:50:37 <Alberth> you'd think a true stack-based language would be simpler to implement than this mix
18:51:13 <TrueBrain> lua embedding is relative easy to add
18:51:16 <Alberth> in amount of work, lua is simpler probably
18:51:17 <TrueBrain> but it is another dep on the project
18:51:30 <TrueBrain> and it restrict you to one language
18:51:48 <TrueBrain> that while with a higher language which is not in OpenDUNE, you have a bit of freedom (NML vs NFO)
18:52:07 <Alberth> I did a small bit of lua in corsix, and I am not sure what to make of it
18:52:28 <TrueBrain> it is so insane fast :P
18:52:52 <Alberth> they seem to have lots of trouble with the dynamic nature, variables pointing to nil
18:52:57 <TrueBrain> meh; I don't like the idea of restricting ourself to a language tbh ...
18:53:27 <TrueBrain> no, lets keep EMC, clean it up where possible, extend it for all I care, and lets make a higher language on top :)
18:53:48 <Alberth> I picked the nml-route in freerct
18:53:58 <Alberth> but there you have a lot of graphics
18:54:30 <Alberth> I think keeping EMC is the right thing here
18:55:22 <TrueBrain> yeah, keeping NML like stuff for graphics is the best thing to do
18:55:30 <TrueBrain> modularity without cross-compile issues
18:56:19 <Alberth> actually, I am very much thinking to replace nml by python itself atm :)
18:56:41 <TrueBrain> Xaroth|Work noticed you can get the lex result of a piece of python from python
18:56:45 <TrueBrain> tokonizer or what is it called
18:56:50 <TrueBrain> in fact, you can even get the bytecode :P
18:57:05 <TrueBrain> really powerful to convert it to another format I think
18:57:14 <TrueBrain> I rather have the AST, but okay
18:57:16 <Alberth> yeah, Python is very well designed for such stuff
18:57:25 <TrueBrain> I wonder if Python has optimizers for its AST
18:57:40 <Alberth> there is a -O flag iirc
18:58:00 <Alberth> but the bytecode and AST is version specific
18:58:14 <TrueBrain> I wonder if there is any valid reason why the EMC functions start with this PUSH 1 / JNE, and end with POP LOCATION POP LOCATION ...
18:59:01 <Alberth> they jump just to the next location with JNE ?
19:00:13 <glx> TrueBrain: the end is not clear
19:00:47 <glx> maybe PUSH 1 /JNE is a kind of stack check
19:01:17 <Alberth> or a jump to 1 (or 0?) means 'end of routine' ?
19:02:55 <TrueBrain> Alberth: but nothing jumps to 1
19:03:01 <TrueBrain> glx: which end, sorry?
19:03:25 <glx> end of function, I don't understand how it ends
19:05:07 <glx> ha right, unless the JNE jumps
19:05:30 <TrueBrain> which can never happen ...
19:05:37 <TrueBrain> UNIT.EMC is also weird, starts with dead code :P
19:38:27 <Alberth> you should know such values without calculator :)
19:40:07 <Alberth> code is becoming readable even :)
19:46:37 <TrueBrain> updated the other scripts too
19:46:47 <TrueBrain> there is one problem with changing the EMC
19:46:51 <TrueBrain> loading savegames break immediatly :)
19:49:40 <TrueBrain> it helps to pick the right array :D
19:53:58 <TrueBrain> POP LOCATION is of course just RET
19:54:03 <TrueBrain> (it also modified the framepointer for example)
19:54:07 <TrueBrain> then what to call PUSH LOCATION
19:55:32 <TrueBrain> ugh, I would just have made that one opcode called: SUB C0
19:56:18 <Alberth> once Xaroth|Work has finished the program, you'll never see this code any more :)
19:56:35 <TrueBrain> no, but it is generated :P
19:56:38 <TrueBrain> so I want it to be tight :D
19:57:05 <TrueBrain> SAVE / JUMP ... / RET
19:57:48 <TrueBrain> well, it is the PUSH I wonder about
19:57:51 <TrueBrain> the POP we can call RET :)
19:58:56 <TrueBrain> that makes much more sense :D
19:59:37 <glx> the first push is opcode 2 ?
19:59:37 <TrueBrain> unit.emc doesn't start with silly JNE
19:59:51 <TrueBrain> opcode 2, parameter 1, yes
20:00:13 <glx> then push was too generic ;)
20:00:20 <TrueBrain> it was PUSH LOCATION
20:00:37 <glx> it was PUSH 1 in some versions ;)
20:00:57 <TrueBrain> we aer not talking about that
20:01:08 <TrueBrain> that is still PUSH 1
20:02:08 <glx> and that still makes no sense ;)
20:02:25 <TrueBrain> they indeed had a higher language :)
20:02:31 <TrueBrain> it is exactly that :D
20:06:59 <TrueBrain> spotted it because of windtraps :)
20:07:03 <TrueBrain> they first animate, then remove fog, THEN go in this while
20:08:18 <Alberth> TrueBrain wins the main price today :)
21:29:59 <TrueBrain> ah; stackpointer forward is used for local variables :)
23:20:42 <TrueBrain> okay, I have a decoder and encoder :D
23:20:46 <TrueBrain> well, almost .. encoder needs labels :P
continue to next day ⏵