IRC channel logs

2022-04-01.log

back to list of logs

<muurkha>re "raku is very amenable to building these", contrary to what you might think from a compiler class syllabus, except for C++, the hard part of writing a compiler is not parsing, even a minimal bootstrap compiler that with no optimizations and really stupid code generation (code generation being where the bulk of the code is for a normal production compiler)
<drakonis>i see
<muurkha>of the 2000 or so lines of Ur-Scheme, including blank lines and comments and unit tests, about 170 lines are the parser
<drakonis>right right
<muurkha>parsing C takes more code than that of course, but compiling C also takes more code than compiling Scheme
<muurkha>I feel like something like OCaml with algebraic data types and pattern matching helps a lot with the kind of structural case analysis you run into a lot in compilers, although I'm far from an expert on writing compilers, I'm just a muurkha
<muurkha>but I've written a couple of toy compilers so I feel like I might have learned *something* ;)
<drakonis>ha, i see.
<drakonis>raku does have that
<drakonis>but neither am i an expert in writing compilers or raku
<drakonis>(for the latter, yet.)
<drakonis>it is a lot of fun thouguh
<muurkha>(also I find OCaml's type checking helpful)
<drakonis>yes, that's nice.
<littlebobeep>muurkha: What "toy" compilers have you written?
<muurkha>well, there's Ur-Scheme and peg-bootstrap, which I linked above, and meta5ix (http://canonical.org/~kragen/sw/dev3/meta5ix.m5 http://canonical.org/~kragen/sw/dev3/meta5ix2c.m5 http://canonical.org/~kragen/sw/dev3/meta5ixrun.py)
<muurkha>and StoneKnifeForth: https://github.com/kragen/stoneknifeforth
<muurkha>and I guess http://canonical.org/~kragen/sw/dev3/sweetdreams-js.js compiles audio synthesizer signal flow graphs into JS, but they aren't Turing-complete
<muurkha>and a few others, I did one that compiles lambda calculus into SK-combinators I can't find
<littlebobeep>muurkha: Hmm I saw you mention Ur-Scheme but I saw no link...
<muurkha>oh sorry, http://canonical.org/~kragen/urscheme
<muurkha>also linked from https://bootstrapping.miraheze.org/wiki/Main_Page#Past_Research_/_intray
<siraben> https://blog.antoyo.xyz/rustc_codegen_gcc-progress-report-10
***alMalsamo is now known as littlebobeep