freenode/#sicl - IRC Chatlog
Search
11:56:24
beach
For one thing, it would contain some of the same information that HIR-to-MIR and MIR-to-LIR must contain, like argument passing with an arbitrary number of arguments. etc.
11:58:14
beach
I think it would be better to treat the top-level function, i.e. the one to be executed to "tie" the code to an environment, just like the rest of the code.
11:58:45
beach
The only problem with that is that we need to know what to do with those famous residual constants.
11:59:05
beach
I think the solution is that we stick them in the static environment of the top-level function.
12:00:40
beach
So, we collect all those residual constants. Where they have been inputs, we add accesses to the static environment, just as we do with constants in nested functions.
12:01:13
beach
Then the entire top-level function and all the nested functions can be turned into MIR, then LIR, etc.
12:02:17
beach
To "tie", then, we build a closure with the resulting code of the top-level function and an environment that contains all those residual constants. And finally, we invoke the resulting closure as an ordinary function.
12:07:50
beach
I should change the translation suite so that at some point, I obtain a top-level function containing no CONSTANT-INPUTs, but only IMMEDIATE-INPUTs, i.e. constants that I know can be turned into immediate constants in native code.
12:08:54
beach
Other residual constants should be collected outside the top-level function for use when the top-level function is turned into a closure.
12:10:44
beach
HIR-to-MIR can then also be applied to the entire top-level function, including the top-level forms to be executed at load time, which was not possible before.
12:23:09
beach
For the work done by heisig, we tentatively decided that all constant inputs be hoisted, and we would be left with a lexical location in the using code. But we also said that this lexical location could be a subclass of the standard one, and the subclass would have a type, presumably (EQL <the-constant>).
12:24:02
beach
At some later pass, some implementation-specific and backend-specific code could decide whether to use the lexical variable or turn the type into an immediate input.
14:37:41
scymtym
beach: i worked on other issues and forgot about it, sorry. i'm re-reading our discussion now. i'll try to get to it today
14:40:39
beach
The Eclector thing? I plan to replace the modified SICL reader currently in Second Climacs by Eclector.
14:41:32
scymtym
the iterate issue got me sidetracked into "extensible quasiquotation" and i made this to investigate whether/how a hash-table literal that works like a vector literal could be implemented: https://techfak.de/~jmoringe/hash-table-literal-test.lisp
14:43:42
scymtym
reading our final conclusion, it doesn't seem to much work (famous last words) and i'm almost done with the essential backquote-related changes
15:46:33
scymtym
what i'm planning to commit for eclector will do `#'(lambda () ,(random 10)) |- Unquote is illegal in the function reader macro
15:51:05
beach
That is interesting. If I weren't so tired, I could probably deduce how it must be implemented.
15:53:05
scymtym
it reads (quasiquote (function (unquote *foo*))) and the rest is macroexpansion, i think
15:55:43
scymtym
i guess quasiquote depth should be reset to 0 by SHARPSIGN-DOT to get a good error message
15:57:13
scymtym
maybe i should distribute pre-built versions of the style-check thing and let people attempt to break it in order find bugs in eclector and the syntax library
17:21:56
scymtym
beach: i made a prototypical READ-MAYBE-NOTHING function: https://github.com/robert-strandh/Eclector/tree/read-maybe-nothing . if this works for you, i can clean it up and push to master tomorrow
18:17:13
beach
Great, thank! I'll study it tomorrow. Now i must go spend time with my (admittedly small) family.