freenode/#sicl - IRC Chatlog
Search
4:22:58
karlosz
sent a pr for a small algorithmic improvement for cst reconstruction in concrete-syntax-tree. i'm fairly sure its right but would appreciate more pairs of eyes.
4:24:07
beach
Thanks! I'll see what I can do. Also, scymtym should have a look. I believe he wrote the existing one.
4:25:45
karlosz
just a performance improvement. not sure if it's possible to improve the quality of the result
4:34:33
beach
I am going to take a while to read more of the original algorithm than what is in the PR. That way I can understand both what it does (which I have forgotten obviously) and what yours is doing.
4:38:27
beach
Ah, yes, the original is definitely the work of scymtym, so he should have a look as well.
6:08:18
beach
For my daily exercise, I started watching a presentation by Raphael Meyer, entitled "C++ Error Handling Revisited", hoping to learn something about why it is so inefficient. I didn't learn anything like that yet, but I learned that apparently exceptions are often avoided in C++. There were hints as to why, but I am not sure I understood it fully.
6:08:19
beach
But then, in this 1 hour presentation, he has so far spent more than half of it talking about how Haskell does error handling, and he just started talking about how Rust does it. I'll watch the rest of the presentation later.
6:32:41
no-defun-allowed
The "C++ frequently questioned answers" list throws a lot of shade at exceptions, but I don't get why, other than throwing exceptions out of destructors is a bad idea.
6:42:55
no-defun-allowed
Apparently it interacts poorly with memory management, even though I thought the memory management was supposed to work well with exceptions?
7:52:50
scymtym
beach: karlosz: i think beach wrote the original reconstruct and i tweaked it later. that said, the change looks good to me
7:56:32
beach
no-defun-allowed: There was a hint to that effect. If the exception happens, it is apparently unclear whether objects have been allocate and/or initialized.
7:56:55
beach
scymtym: You can then go ahead and merge it. I'll read it anyway just out of curiosity.
7:57:13
scymtym
yeah, "exception safety" is what they call the thing they have trouble with, i think
7:57:43
scymtym
would it make sense to have a TREE-CST class that indicates the absence of sharing between its children? i think an eclector client could produce that
8:01:10
scymtym
ACTION discovered a branch called "iterative-reconstruct" in his concrete-syntax-tree repository
8:21:07
scymtym
ADD-ATOMS tracks seen CONS-CSTs and processes the original CST. knowing whether there is sharing in the original CST would allow skipping that. probably not a big deal
8:28:37
scymtym
the concrete-syntax-tree client in Eclector calls (reconstruct car cst …) … (reconstruct cdr cst …) which does some duplicated work processing CST
9:09:45
beach
Major progress. I can define a generic function in E5, and I can define methods on it, specialized to CONS, FIXNUM, or CHARACTER, and I can call that generic function, and it returns the right answer.
9:10:25
beach
Those are the difficult classes, because their instances are host objects during bootstrapping.
9:18:54
beach
Defining and calling the generic function feels much faster than it is in the current bootstrapping procedure, very likely because the discriminating function is now executed by host code generated from the AST evaluator rather than the HIR evaluator.
9:22:32
beach
My next task is going to be to create the cyclic graph in E5, because that's the penultimate bootstrapping step, but after I finish that work, there is going to be more code loaded into E5 before the cyclic graph is created.
9:25:21
scymtym
ok, i think i remember. Eclector uses RECONSTRUCT for the following situation: say we read #.(second '(2 (3 4) 5)). due to the recursive READ, there will be a raw expression (second '(2 (3 4) 5)) and a corresponding CST. when building the result for the whole input, the raw expression is (3 4) and the only child result is the CST for (second '(2 (3 4) 5)). so finding the CSTs for 3 and 4 involves analyzing the child CST in the way
9:27:34
scymtym
this is skipped in the common case in which (and (consp expression) (= (length expression) (length child-csts)) (every #'eql expression (map 'list #'cst:raw child-csts)))