IRC channel logs

2025-04-08.log

back to list of logs

<matrix_bridge><gtker> oriansj: There's an issue in M2-Planet because of how "//" comments have to be tokenized unlike "/*" comments. Would you be open to replacing the "//CONSTANT" syntax with either "enum { CONSTANT = 1 }" or "#define CONSTANT 1"?
<matrix_bridge><Andrius Štikonas> gtker: all cc_* compilers only support //CONSTANT
<matrix_bridge><gtker> Ah yeah, I was missing "in the "cc_*" compilers" at the end of my question
<matrix_bridge><Andrius Štikonas> Well, there are quite a few.of them though
<matrix_bridge><gtker> I'm not really looking forward to doing it but it would IMO be better long term if the language was just actual-subset-of-C and not subset-of-C-but-with-additions-as-comments
<matrix_bridge><Andrius Štikonas> And not just in stage0-posix
<matrix_bridge><Andrius Štikonas> Well, in principle I agree
<matrix_bridge><gtker> One for each arch, right?
<matrix_bridge><Andrius Štikonas> There is also https://git.stikonas.eu/andrius/stage0-uefi/src/branch/main/amd64/cc_amd64.M1
<matrix_bridge><Andrius Štikonas> And stage0 repo has knight version
<matrix_bridge><Andrius Štikonas> And somehow cc_* has # as comment
<matrix_bridge><gtker> So 9 versions total?
<matrix_bridge><Andrius Štikonas> Something like that
<matrix_bridge><Andrius Štikonas> Possibly C prototype
<matrix_bridge><Andrius Štikonas> Maybe less than 9...
<matrix_bridge><Andrius Štikonas> Hmm
<matrix_bridge><Andrius Štikonas> There is no armv7l
<matrix_bridge><gtker> Is that because there's no bootstrap chain for armv7l?
<matrix_bridge><Andrius Štikonas> Indeed
<matrix_bridge><Andrius Štikonas> Nobody has done it
<matrix_bridge><Andrius Štikonas> But //CONSTANT only works in bootstrap mode?
<matrix_bridge><Andrius Štikonas> If I remember correctly
<matrix_bridge><gtker> Yes, but the tokenizer doesn't treat "//" as comments at any point, so it has to tokenize everything that comes afterwards
<matrix_bridge><Andrius Štikonas> Can we adjust tokenizer for non bootstrap mode?
<matrix_bridge><Andrius Štikonas> If non bootstrap then treat // as comments
<matrix_bridge><gtker> Yeah, that makes sense
<matrix_bridge><Andrius Štikonas> Maybe that's less work
<matrix_bridge><gtker> It probably is, although I would still like to remove it from the other compilers since it's incredibly unexpected for everybody, even if you're aware of the extra CONSTANT syntax
<matrix_bridge><gtker> It would also allows us to use a single constant in M2-Planet rather than needing both, which I like 😄
<matrix_bridge><gtker> stikonas: It seems the "--bootstrap-mode" flag has to be on the command line before the file name otherwise it doesn't take effect. There are at least some tests where we don't do this and they fail. I think for now we should just leave the old behavior and optimally just add the proper behavior to (all the many) prior compilers. It's not super critical that we fix it now although I think it makes sense to...
<matrix_bridge>... prioritize fixing it in the future
<matrix_bridge><Andrius Štikonas> Yeah, Ok
<matrix_bridge><Andrius Štikonas> Hopefully it won't make assembly far more complex...
<matrix_bridge><gtker> My hope is that it will just slot in neatly next to the other functionality, although I have only looked at the amd64 briefly
<matrix_bridge><Andrius Štikonas> The others are very similar
<matrix_bridge><Andrius Štikonas> They are really ports of the same thing
<stikonas>oriansj: after https://github.com/oriansj/M2-Planet/pull/135 I'll probably have to update all arch-specific stage0-posix* repos again... Maybe you could add me to stage0-posix-aarch64?