libera/#climacs - IRC Chatlog
Search
7:27:13
beach
I had some ideas last night. At some point, we are going to want to do some kind of compilation of the code, but compiling potentially the entire buffer at typing speed might not be feasible, especially if we want some detailed analysis of the code.
7:27:19
beach
Also, if some editing is done at the beginning of a buffer, then a lot of code may need to be recompiled. So I came up with some preliminary ideas.
7:27:25
beach
For example, there is no point in compiling code that is detected as syntactically incorrect by the s-expression-syntax library. In particular, of the user is editing without the use of something like Paredit, a lot of the time, the code is going to be syntactically incorrect.
7:27:32
beach
And I was thinking of a way to avoid compiling everything that follows the point of editing. Compilation is going to affect things like colors and fonts and backgrounds, but not the overall space occupied by the code.
7:27:33
beach
So I was thinking that one might create "preliminary" output records for code that follows the viewport. Those output records might be good enough to create accurate scroll bars, but not much more. Then, when the output record is replayed, we can compile the top-level form at that time, and have the replay logic consult the result of the compilation.
7:28:35
beach
Maybe I should run some experiments with McCLIM to see how such "preliminary" output records might work.
7:30:04
beach
I could use the same technique for Clovetree. There is no point in creating a complete layout of a page that is not visible. As long as it is known what material goes into that page, it could be rendered only when actually visible.
7:42:56
beach
Computing indentation could be done this way too. Let's say the user inserts an opening parenthesis to (say) add a LET binding near the beginning of the buffer. Then, suddenly, the rest of the buffer becomes part of a huge top-level form, so indentation must be recomputed for all remaining forms in the buffer.
7:42:57
beach
But there is no point in recomputing indentation for the part of the buffer that is not visible.
10:15:15
beach
For example, if we want to use one color for lexical variables and another color for special variables, we can't know which one is which until we compile.
10:17:55
splittist
Separate thought: Since there is a strong correlation between indentation and code meaning, could there be a mode of interaction whereby one changed the indentation to change the code. No very good example: drag the test of an IF to the right to convert the form into a COND.
10:19:52
splittist
Sounds like you would want separate threads to do things like that (compilation coloring) (and spell checking, linting,…) while something else was concentrating on keeping the cursor where the typist expected it to be.
10:25:34
beach
But multiple threads complicate the code, so if they are not needed, I want to avoid them.