IRC channel logs

2022-02-11.log

back to list of logs

***alMalsam1 is now known as alMalsamo
<unmatched-paren>stikonas: interesting... rascal doesn't support the pascal `const` keyword. that's probably why it rejected those example programs, `const` is used in pretty much every pascal program
<unmatched-paren>const should be extremely easy to implement
<stikonas>yeah, you can just ignore it
<stikonas>and assume that code is written correctly
<stikonas>that's basically the strategy of mrustc
<stikonas>mrustc does not implement borrow checker
<stikonas>just assumes that rustc code was written correctly
<unmatched-paren>?
<stikonas>well, bootstrap compiler doesn't have to be very good at things like error reporting etc...
<stikonas>which you might expect from production compiler
<unmatched-paren>who are you replying to? :)
<unmatched-paren>i'm confused
<unmatched-paren>i was talking about rascal
<stikonas>unmatched-paren: oh yes, I'm just saying that for rascal implementing const can be as easy
<stikonas>as just ignoring that const keyword
<stikonas>just skip it completely
<unmatched-paren>but it's necessary to treat them as immutable variables for almost every single pascal program to work....
<stikonas>why? They should just work
<stikonas>some invalid programs would also work instead of erroring out
<unmatched-paren>if you have `const x = 44;` then every `x` should be treated as `44`
<stikonas>but all valid programs should continue to work
<unmatched-paren>it certainly shouldn't be ignored
<stikonas>yes, but if const x = 44 is replaced with x = 44
<stikonas>then output of the program would be the same
<unmatched-paren>x = 44 is not valid pascal afaik
<stikonas>oh, maybe I was thinkign of C type const keyword
<unmatched-paren>that's equivalent to `x == 44` in c
<stikonas>haven't done Pascal since school...
<unmatched-paren>= is the equivalence operator in pascal
<unmatched-paren>hah, yeah, it shows its age :)
<stikonas>but in C const keyword can definitely be omitted
<stikonas>this is how "const" is implemented in M2-Planet https://github.com/oriansj/M2-Planet/blob/master/cc_types.c#L299
<stikonas>so basically just global_token = global_token->next;
<stikonas>i.e. skip const token and look at the next thing
<unmatched-paren>in pascal, you have a `program` block in your main file, which contains a bunch of procedure, function, variable and constant declarations, and then a block, like this: https://paste.debian.net/1230509
<unmatched-paren>pascal is a pretty bad language imo
<unmatched-paren>for example, list lengths are part of the type
<unmatched-paren>so you can't have a function/procedure that takes a list of any length
<unmatched-paren>its only gain over C is cleaner syntax...
<oriansj>unmatched-paren: well C does have a pretty clean syntax IF you stick to the turing core (which is what cc_* is)
<oriansj>once you toss in the C macro processing and varargs; it gets ugly fast but when you can turn that off, C is pretty clean.
<stikonas[m]>Still, we did a reasonable job with macro processing in m2-mesoplanet
<oriansj>stikonas: and that will only grow in size as we get more compatible with the C spec
<oriansj>but yes, for a C preprocessor, M2-Mesoplanet appears considerably cleaner than others that I've seen.
***Noisytoot is now known as [
<muurkha>[: missing `]'
<[>muurkha: Someone else has that nick
<muurkha>I'm just quoting bash
***vancz_ is now known as vancz
***sam_ is now known as sam__
***sam__ is now known as sam_