[00:55:53] * MrBusiness [MrBusiness!~ArcMrBism@2602:306:8325:a300:55d5:1331:dd86:b443] has quit (Ping timeout: 252 seconds). [00:56:10] * MrBismuth [MrBismuth!~ArcMrBism@2602:306:8325:a300:3cd4:aa5a:1eb7:eb6f] has joined the channel. [03:59:23] * xkapastel [xkapastel!uid17782@gateway/web/irccloud.com/x-prxrinnmjicllvag] has joined the channel. [05:36:19] * flogbot [flogbot!~flogbot@2001:4800:7814:0:2804:b05a:ff04:4ba7] has quit (Ping timeout: 246 seconds). [05:36:27] * flogbot [flogbot!~flogbot@2001:4800:7814:0:2804:b05a:ff04:4ba7] has joined the channel. [05:36:27] :karatkievich.freenode.net 353 flogbot = #concatenative :flogbot aspect xkapastel MrBismuth tgunr FreeFull hackerfoo m_hackerfoo jtimon groovy2shoes bmp shmibs jeaye MDude earl Sonderblade Sgeo ecx86 ephe_meral rotty diginet mtp rgrinberg sclv zgrep amuck lonjil delvinj dustinm` pointfree rprimus apajx erg mollerse otoburb jeremyheiler strmpnk carvite jlewis merry @shapr shachaf cstrahan [05:36:27] :karatkievich.freenode.net 366 flogbot #concatenative :End of /NAMES list. [06:21:46] * jtimon [jtimon!~quassel@164.31.134.37.dynamic.jazztel.es] has quit (Ping timeout: 240 seconds). [10:49:07] * xkapastel [xkapastel!uid17782@gateway/web/irccloud.com/x-prxrinnmjicllvag] has quit (Quit: Connection closed for inactivity). [14:06:06] * jtimon [jtimon!~quassel@164.31.134.37.dynamic.jazztel.es] has joined the channel. [14:19:05] * MrBusiness3 [MrBusiness3!~ArcMrBism@2602:306:8325:a300:3cd4:aa5a:1eb7:eb6f] has joined the channel. [14:21:39] * MrBismuth [MrBismuth!~ArcMrBism@2602:306:8325:a300:3cd4:aa5a:1eb7:eb6f] has quit (Ping timeout: 252 seconds). [17:03:28] * xkapastel [xkapastel!uid17782@gateway/web/irccloud.com/x-nhsntgcvlltkwcph] has joined the channel. [17:57:57] * MDude [MDude!~MDude@c-73-187-225-46.hsd1.pa.comcast.net] has quit (Ping timeout: 264 seconds). [18:23:36] * MDude [MDude!~MDude@c-73-187-225-46.hsd1.pa.comcast.net] has joined the channel. [19:09:44] * tgunr [tgunr!~tgunr@cpe-76-173-79-238.hawaii.res.rr.com] has quit (Ping timeout: 260 seconds). [21:19:41] * evincar [evincar!~jon@173-228-12-171.dsl.dynamic.fusionbroadband.com] has joined the channel. [21:20:05] So I've been working on a code generator for Kitten [21:28:32] I decided to start by generating the assembly that I would expect a "hello world" to generate [21:29:08] And I'm generalising upward from there until I reach the IR [21:35:33] It's been nice so far, forcing me to confront my assumptions [21:35:35] And figure out what I actually need from the frontend [21:35:52] Maybe I should have built the compiler like this in the first place [21:42:57] That's how I do it, both on PoprC and at work. [21:56:19] To be fair, starting from the frontend let me figure out a lot of design & usability issues first [21:56:35] Meeting in the middle seems like it'll work, anyway [22:09:25] Sure. It's good to start from either end, because the stuff in between is least clear. [22:46:54] * MDude [MDude!~MDude@c-73-187-225-46.hsd1.pa.comcast.net] has quit (Ping timeout: 248 seconds). [22:51:31] This ABI is gonna take some figuring out [22:52:35] Right now I use %rsp/%rbp for return addresses and locals, %rbx points to the data stack, and %rax holds the top value on the stack if it's "small" [22:53:22] I could keep more stuff in registers but it would complicate the calling convention [22:54:03] And this doesn't really handle floating-point or vector values [22:55:39] I like having the stack reified because it lets me have recursive stack-polymorphic functions easily [22:59:00] Might compromise and say "as much as possible is kept in registers locally, but spilled between non-inlined calls" [23:02:37] Effectively using registers is pretty important on architectures with more registers available, like ARM. [23:03:09] And concatenative languages encourage small functions. [23:03:52] I suggest aggressive inlining and flattening the inputs and outputs so they can be passed via registers. [23:08:08] That's basically the idea [23:08:13] Also seeing what Ertl has to say in "Implementation of Stack-Based Languages on Register Machines" [23:21:03] * xkapastel [xkapastel!uid17782@gateway/web/irccloud.com/x-nhsntgcvlltkwcph] has quit (Quit: Connection closed for inactivity). [23:32:23] * MDude [MDude!~MDude@c-73-187-225-46.hsd1.pa.comcast.net] has joined the channel. [23:32:25] * xkapastel [xkapastel!uid17782@gateway/web/irccloud.com/x-qsofhyqzznocrtxl] has joined the channel. [23:35:39] I almost wonder if it would be better not to think of it as a Forth-like language for compilation [23:38:17] Could get to something like System F or combinators and use techniques from that world [23:51:03] I suggest using a stack no more than C does. [23:51:31] Or rather, use the stack like C does.