libera/#sicl - IRC Chatlog
Search
19:04:20
ecraven
hm.. a question about parsing.. how do you deal with comments? how do you put them into the syntax tree?
19:33:22
yitzi
ecraven: Eclector can capture comments with "skipped" input. See make-skipped-input-result in the manual.
19:47:22
yitzi
You'll have to use eclector.concrete-syntax-tree or roll your own syntax representation.
19:49:35
yitzi
via declaring your own client. There is an example of me rolling my own syntax here: https://github.com/yitzchak/common-lisp-jupyter/blob/master/src/cl-jupyter/parser.lisp
21:28:39
Bike
the bytecode VM can run code in a sandbox now. i give the compiler (lambda (x) (+ x 7)). the compiler uses a clostrum cell. at runtime the VM loads from the cell. so i can do (setf (clostrum:fdefinition client *evaluation-environment* '+) #'-), do (funcall that-lambda 3), and get -4
21:28:57
Bike
i think i need a trucler client for clostrum to make it work correctly all the way through, though
22:21:34
scymtym
ecraven: the state machines in the Eclector manual are rendered with https://plantuml.com/state-diagram
3:20:14
Bike
maybe i should look for applications that could actually use a sandboxed evaluator, if there are any around already
3:21:00
beach
Many people have asked for such things in the past, but I fear they all want slightly different things.
3:24:15
Bike
yeah, i've seen them around #commonlisp a couple times, but i don't remember details. i would think it would be for a "scripting" type thing like in a game or web interface, but i don't know any concrete examples
3:24:33
Bike
i don't really need a sandbox at all - i'm working on this for cross compilation - but sandboxing is probably easier to show off
3:29:30
beach
So you are basically using the first-class global environments the same way as SICL does?
3:32:04
Bike
i don't know all the details of what SICL does. obviously the boot procedure i'm going for is a bit different, i'm not building up an ersatz image. but what i'd like to do is set up a first class environment where all the standard macros are defined, compile things relative to that environment, and then load the results in clasp (or something else, hypothetically)
3:34:42
beach
But it also seems that you can evaluate things in this environment. That's what has been unique about SICL bootstrapping so far.
3:36:46
Bike
Yes, I can... though currently it's only function lookups that are hooked up to it. I will have to work something out for global variables as well
3:37:23
Bike
(other parts of global environment acces like classes are done through functions, so as long as the environment's functions cooperate i don't think that will be a problem)
3:38:55
beach
That's how we can get away with bootstrapping CLOS first. The CLOS object graph is best described as the result of a suite of executions, so evaluating things makes that process more natural.
3:42:32
Bike
hm, not sure i follow. i've honestly sort of held off on trying to understand exactly how SICL boot works since I know you're still making changes
3:45:16
beach
I see. I am not making changes to the essence of the bootstrapping process. What I mean is that it is best to describe the relationship between CLOS (and MOP) standard generic functions and classes as the result of executing a CLOS program.
3:45:17
beach
It would be too tedious to describe it manually. You would get many things wrong, and it would be hard to maintain. So if you want CLOS to be operational early on in the bootstrapping process, you must be able to execute code early on.
3:47:31
beach
Right. And the only alternative is the PCL way, i.e., rely on a CLtL1 environment only in order to get CLOS up and running.
3:55:42
Bike
i'll keep hammering away - there's more to do before i can even really think of how to arrange the actual code being booted, like CLOS - but i'm feeling good about how it's going now
4:09:04
beach
I have been working way too hard lately, and I am still not pleased with the progress. But I am encouraged by the direction things are going.
4:09:05
beach
I think the s-expression-syntax library can be essential to a lot of code-processing code. And since it uses a fairly simple interface (the architecture.builder-protocol), depending on it does not impose too many constraints. My work on Iconoclast I hope will enable a simpler and more maintainable version of CST-to-AST that can also be used in an IDE.
4:11:46
beach
And I still need to explore the idea of doing macro processing (at least parsing, but perhaps also expansion) at the AST level.
4:12:48
beach
There is a lot of code in SICL (and I suppose in other Common Lisp implementations as well) for parsing and checking the syntax of standard macros.