IRC channel logs
2025-03-25.log
back to list of logs
<matrix_bridge><gtker> oriansj: Why did you end up creating the "// CONSTANT BLA 1" syntax instead of just treating "#DEFINE BLA 1" as a constant? <ekaitz>janneke: sent you a documentation patch for Mes, if it needs some extra work in the docs to accomodate that kind of explanation <ekaitz>I also plan to add documentation about the Mes interpreter internals, once it's reworked <ekaitz>for the moment i tried to be the less intrusive as possible with the rest of the document <matrix_bridge><Andrius Štikonas> gtker I guess early versions of cc_x86 had # as a comment and it was processed very early (in tokenizer) <ekaitz>stikonas: interesting how my if->switch change makes gcc -O0 20% faster but it's unoticeable in M2Planet <stikonas>hmm, I guess gcc can optimize things better <stikonas>still I guess it's not bad that gcc build is faster <ekaitz>structurally speaking the changes I did are only in the garbage collector <ekaitz>so it makes sense that the impact is kind of small in both cases anyway <ekaitz>stikonas: in M2-Planet I can rely on checking the first field of structs vs integers? <ekaitz>i know it was written somewhere in a book, let me find <ekaitz>the proper question would be: can I cast pointers in M2Planet? <ekaitz>are the struct fields in order and all that? <stikonas>casting, e.g. (void*) int_pointer is not allowed yet <ekaitz>so i can reassing a pointer to a struct to an int pointer and it will get the first field of the struct (if it's an int) <stikonas>well, if something doesn't work, feel free to report <stikonas>we fixed that switch issue that you had... <ekaitz>uugh i thought this thing was going to be easier but Mes compares things by pointer <ekaitz>very interesting, i will need to rewrite many things :) <stikonas>I'm not too familiar with mes... I mostly looked at meslibc and mescc <ekaitz>it's a very simple interpreter, pretty short, but in a couple of places it gets interesting <ekaitz>and now M2-Planet supports pointer arithmetic, right? <stikonas>yeah, looks like mes/src/*.c has similar size as M2-Planet these days <ekaitz>mihi: oh! yeah that must be a huge improvement in performance <ekaitz>the complexity really is in mescc i think <stikonas>ekaitz: as for pointer arithmetic, it is supported in += -= ++ and -- <stikonas>++ and -- are unreleased though, not part of 1.12 <stikonas>so if you can, port pointer arithmetic cases to += or -= <stikonas>there is include/mes/mes.h:#define M2_CELL_SIZE sizeof (struct scm) <stikonas>I guess e.g. something like cell_zero = cell_arena + M2_CELL_SIZE; could now be written cell_zero = cell_arena; cell_zero += 1; <stikonas> cell_zero = cell_arena + 1 wouldn't work yet