IRC channel logs

2021-11-13.log

back to list of logs

<oriansj>oh now I remember "\r" broke MesCC
<oriansj>as nyacc couldn't support it
<stikonas>oh ok
<stikonas>oriansj: hmm, maybe let's revert that last PR...
<stikonas>it's behaviour is just too confusing right now
<stikonas>and can catch us unaware...
<stikonas>at least with the assignments it either works or compilation error but here it's silently different behaviour
<stikonas>the more I look at this, the more it looks like ++/-- are not easily implementable...
<stikonas>and probably needs AST
<stikonas>so I guess not for M2-Planet...
<oriansj>stikonas: its ok, M2-Planet is a very thrown together sort of solution.
<oriansj>a sort of rough prototype for cc_x86 which grew out of control
<stikonas>yeah, I know...
<stikonas>it does follow cc_* very closely
<stikonas>I guess without AST it's hard to know what is lvalue and what is rvalue
<oriansj>and It wasn't designed to be a proper C, despite how much one might want it to be
<stikonas>as that is not immediately visible from type of expressions
<stikonas>so my suggestion is to revert that last commit. I can still look at fixing up assignments
<oriansj>yeah, its kinda embarassing how ad-hoc M2-Planet is. The Multi-arch support could have been so much cleaner
<stikonas>oh I wouldn't be embarrased if I were you
<stikonas>M2-Planet is quite amazing for its size
<oriansj>it is hard to maintain and update or expand or port
<oriansj>but it kinda holds together just well enough
<stikonas>well, adding new arches is quite easy
<stikonas>adding new features... It depends
<stikonas>some of the stuff was quite easy
<oriansj>perhaps a fresh perspective helps
<stikonas>ok, somewhat good news is that I've gotten += to work properly on AMD64
<stikonas>or at least better than before, so things like *b += 2; now work
<stikonas>just need to extend this to other arches and other assignments
<stikonas>and if possible, simplify emitted code a bit
<stikonas>but all of that should be doable
<Hagfish>nice
<Hagfish>a pity about ++/--, but i get what you mean about needing an AST
<stikonas>Hagfish: haven't thought about it since yesterday
<stikonas>first, I'll finish all compounds assignment operators
<stikonas>but it's not the end of the world if we can't support ++/--
<stikonas>we might still be able to improve m2-planet to the point where required mes simplifications can be merged upstream
<stikonas>especially since we have a preprocessor support for #ifdef __M2__
<stikonas>in any case ++ / -- are less useful if we don't have pointer arithmetic working
<stikonas>as they would increment pointer address by 1 instead of by register size
<oriansj>object size not register size. as if foo is a struct; foo++ increments it by the sizeof(struct)
<stikonas>oriansj: I also need LOAD_INTEGER_rbx define. I'm not too familiar with x86 hex encoding, how do I get it?
<stikonas>s/x86/amd64/
<stikonas>x86 actually has LOAD_INTEGER_ebx
<stikonas>something like PUSH_ebx\nLOAD_INTEGER_ebx\nADD_ebx_to_eax\nPOP_ebx\nSTORE_INTEGER\n in expression function does work with += reasonably well
<stikonas>definitelty better than what I did in preprocessor
<oriansj>here is what I would do to look up the encoding: rasm2 -a x86 -b 64 "mov rbx, 0x1234567"
<stikonas>maybe I should learn AMD assembly better :D
<oriansj>which will return: 48c7c367452301 then remove the 67452301
<oriansj>to get the 48c7c3 needed by M1
<stikonas>ok, let me install rasm2...
<oriansj>it also can help sanity check your hex: rasm2 -a x86 -b 64 -d "48c7c3 00000000"
<oriansj>which will display: mov rbx, 0
<stikonas>ok, got that define
<Hagfish> https://news.ycombinator.com/item?id=29209270 a nice mention of guix and bootstrappability (although no direct link to the work being discussed here)
<stikonas>oriansj: "get_machine --override" crashes
<stikonas>well, we are supposed to provide what to override with, but we should not crash in any case