libera/#clasp - IRC Chatlog
Search
13:48:15
drmeister
I think the SMARTS code that the Open Force Field people are using is malformed but it's being accepted by their parser.
13:49:08
scymtym
drmeister: are you planning to signal an error from the user code attached to a rule instead of letting the parse fail?
13:50:14
drmeister
Hmm, in the OpenSmiles description I see that I am wrong about the malformed SMARTS code.
13:50:22
drmeister
They say this "In a SMILES string such as "C1CCCCC1", the first occurrence of a ring-closure number (an "rnum") creates an "open bond" to the atom that precedes the ring-closure number"
13:50:45
drmeister
I always treated the ring-closure number as a label on the atom. They treat it as an "open bond".
13:52:44
drmeister
They say: "Two-digit ring numbers are permitted, but must be preceded by the percent '%' symbol, such as C%25CCCCC%25 for cyclohexane. Three-digit numbers and larger are never permitted. However, note that three digits are not invalid; for example, C%123 is the same as C3%12, that is, an atom with two rnum specifications."
13:53:41
drmeister
This will require changes to the parser and I have to reinterpret what the ring-closing number means. It's not a label on the atom, it's an open bond on an atom.
13:54:38
drmeister
scymtym: What do you recommend wrt an error? I had to search for a while to figure out what line of input was responsible for this current problem.
13:55:30
drmeister
Yes, I was planning to handle the parse error by signal an error from user code as well as report the parse error.
13:58:25
scymtym
drmeister: i assume you want to create a rule that identifies a particular syntax error and signals an appropriate error. in that case, the easiest way would be to use &bounds to capture the location and signal some condition which transports the location to the surrounding ESRAP:PARSE call
13:59:51
scymtym
around the PARSE call, which has the input text available, there could be something like (let ((input …)) (handler-bind ((transport-condition (lambda (condition) (error 'actual-condition :input input :location (location condition))))) (parse 'some-rule input)))
14:00:42
scymtym
two-digit ring numbers and the corresponding escaping seems like a relatively harmless change
14:12:48
drmeister
Now I can parse things like: `(chem:parse-smarts "[*]#%11-[*]=,:[*][*]=,:[*]#%11")`
14:16:12
drmeister
In a small way - this demonstrates the power of Cando and Common Lisp and esrap parsing. We can hit what looks like a bizarre corner case, and pick up this cold code that I haven't touched in years and make a fix.
14:30:02
scymtym
you can avoid the dummy by changing (:destructure (dummy msd lsd) …) => (:function rest) (destructure (msd lsd) …). the transformations are composed, so basically (destructuring-bind (msd lsd) (rest RAW-RESULT) …)
15:15:26
Bike
this is mostly unrelated, but have you used qlot and/or roswell? i found some github actions that use them for lisp stuff, but am not really familiar
15:18:23
yitzi
I have used roswell. Both for offline and CI usage. I don't really anymore. I prefer making my own github actions and relying on the system packages. I find roswell to kind of buggy.
15:20:16
Bike
do we have actions/etc available to just like, load sbcl and quicklisp, or do you think i should just use apt and curl or something
15:20:33
yitzi
Plus, with our nightly builds adding Clasp testing to something like common-lisp-jupyter is pretty easy.
15:21:04
yitzi
Here is a really simple action I am working on for Khazern. https://github.com/s-expressionists/Khazern/pull/2
15:22:55
yitzi
here I am installing other implementations besides sbcl https://github.com/yitzchak/common-lisp-jupyter/blob/master/.github/workflows/ci.yml#L34-L58
15:30:31
scymtym
drmeister: right, sorry i was unclear. the improvement is minor anyway. just gets rid of the dummy and the ignore declaration
15:32:13
Bike
now i'm checking what setup-miniconda does, and it turns out what it does is load an entire megabyte of javascript.
15:36:57
drmeister
I have to change the underlying smarts pattern matching code to change these labels from "atom labels" to "incomplete bond labels".
15:37:40
Bike
drmeister: hey i just saw your text - sorry, i wasn't checking my phone. should i still call?
15:45:56
yitzi
Bike: that ansi test pr made it through configure, so the broken-stdlib option worked, btw
15:56:12
Bike
it will definitely be useful the next time some compiler problem breaks misc tests that are 20000 in
16:45:11
Bike
https://bike.github.io/docgen-test/ i have successfully hacked together a github action to run staple to generate documentation
16:45:25
Bike
it uses the new pages-via-actions thing so the generated html doesn't stay in the repository, so that's nice
19:01:55
drmeister
Think about versioning API's - so we can provide documentation that describes what version an API is. Like under "System Information".
19:02:28
Bike
oh, staple does that automatically, i just didn't assign a version for this example system
19:02:42
Bike
i'm going to try using this for cleavir, which has much more fleshed out documentation
19:07:20
Bike
since cleavir is, knock on wood, at a point where i don't need to change the ir every time i want to do something new
19:08:55
Bike
I'd also like to set up clasp-developers.github.io with similarly auto generated documentation, but when i tried that last week i managed to screw up the formatting something fierce
19:22:30
Bike
I tried putting in the documentation generation for cleavir but it failed for a silly reason I'm fixing now
22:55:40
drmeister
https://github.com/clasp-developers/clasp/blob/main/src/lisp/kernel/cleavir/translate.lisp#L2018
22:56:23
drmeister
It appears to take constants from a (BIR?) module and generate load-time-values for it when cst-to-ast:*compiler* is 'cl:compile-file.
22:58:12
drmeister
Could the bytecode compiler be adapted to do something like this? Accumulate constants as it compiles and then generate load-time-values for them? I presume this uses the LITERAL compiler.
23:02:37
drmeister
If we did something similar for bytecode and we have Cfunction_O::link_function invoke the literal compiler to generate function descriptions and simple-fun's and return the BytecodeModule_sp object then we can add the bytecode_module and the startup bytecode generated by the literal compiler to FASO files and we would have compile-file be able to generate bytecode.
23:03:41
drmeister
Then we add source file info to this somehow and we could take the next step and convert bytecode+source file info into Cleavir-IR.
23:04:47
drmeister
compile-file to bytecode followed by judicious compilation to native code of oft called functions is the goal.
23:18:42
Bike
I am on variably. And yeah that's what that function does, with a BIR module. What you're describing is along the lines of what I've been imagining
23:19:12
Bike
The bytecode modules already kind of do constants in this way, but we'd have to add some stuff for load-time-value, and for generating the faso machin code of course
23:20:53
Bike
What I've been figuring is that for compile file we would make a bytecode compiler module, and then keep adding functions into it, and then at the end we have a bunch of bytecode cfunctions, a vector of constants to generate code for, and probably a vector of load-time-value forms or functions or something. then we fasoify it during linking.
23:21:11
Bike
the linking process would be a little different, since at compile time we wouldn't actually need to make bytecode entry points (though we could if we wanted)