libera/#commonlisp - IRC Chatlog
Search
10:59:12
ecraven
pjb: do you know Garnet? can I write constraints that depend on *other* objects (things like "if the object in my slot `parent' resizes itself, I want to change my size too"?
11:00:58
pjb
KR (Knowledge Representation) is independent of Garnet. Garnet is built on it. KR is a OO system (different from CLOS). You can use KR to implement your objects with constratins. If you want to use CLOS with constraints, you may consider Cells.
11:02:08
pjb
Now, I don't remember the details, but it's possible that it may be possible to merge KR and CLOS stuff. At least, you can write generic functions with methods on both kind of objects.
11:03:15
pjb
I guess nowadays you would choose CLOS+Cells instead of KR, and use KR only if you want to use Garnet. But it may be a good idea to have a look at KR.
11:03:58
ecraven
thanks. just found a tour.pdf and tutorial.pdf for garnet, I'll skim through these. just trying to understand how things work there ;)
11:08:01
ecraven
isn't prototype OO just as imperative as it gets? you create objects, modify them, save your image. you have no way of recreating them in the same way, if you lose that image, right?
11:09:25
hayley
The difference, though, is that the text form describes an object and its slots immediately, and not a class. For example, I can write a Self object as (| x = 42. |)
11:12:11
ecraven
hayley: but in practice, isn't it harder to write reproducible code? (though that might be an issue with image-based languages anyway, not just prototype ones)
11:12:46
hayley
I think that is an issue about how you approach persistence, not about prototypes or classes.
11:13:09
ecraven
hm.. would prototypes and generic functions work, if dispatch was based on predicates, not "types"?
11:14:08
hayley
You may wish to read on Korz <https://dl.acm.org/doi/10.1145/2661136.2661147> which was a multiple-dispatch prototype OO language.
11:14:22
scymtym
also https://github.com/sbcl/specializable/blob/master/examples/prototype-specializer.lisp
11:18:30
pjb
ecraven: it's harder to write reproducible code, if you code at the REPL. The same difficulty would occur with CLOS. If you type at the REPL: (defclass coo () ()) (defvar *coo-1* (make-instance 'coo)) (defmethod moo ((obj (eql *coo-1*))) 'hi) (moo *coo-1*) --> hi ; how reproducible is that?
11:18:49
pjb
ecraven: but if you put that in a file, then it'll be reproducible. Same thing with prototype based OO.
11:19:20
ecraven
but doesn't prototype-based OO "invite" this style of work more? because it's so easy to modify objects until "stuff works"
11:20:09
pjb
ecraven: if the predicate is (eql obj *coo-1), yes, prototypes and generic functions would still work the same. ;-)
11:21:27
ecraven
well, I don't just want to specialize on *one* object, but on predicates of objects (hypothetically ;)
11:21:41
pjb
the problem of image-based development can be corrected if you modify your REPL to keep the source forms. See Image Based Development http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html
11:22:07
ecraven
hayley: thanks for that Korz reference, I'll need to read that at leisure, it's not a trivial read :D
11:22:25
pjb
or rather: http://informatimago.free.fr/i/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html
11:22:44
ecraven
you edit code, and you can "dump" it into a file. the UI remembers where each function goes, and does the right thing ;)
11:25:12
Gnuxie
ecraven: idk what you mean by JavaScript "has no proper history of REPL development", there's quite clearly a REPL in the browser and it really is necessary to use to do any kind of web dev
11:26:06
ecraven
Gnuxie: indeed, and I'm not a web developper, so I don't know how the real pros do it, but from my experience that repl is more for "let's see what that function call really does in a browser" and less for "I'll write my program here in this repl", isn't it?
11:27:48
_death
indeed.. it's more "edit a file and reload".. where reload is equivalent to killing the image and starting anew
11:29:16
Gnuxie
maybe, but people do that in CL when they get into a situation where it is more ergonomic to reload than fix the environment
11:40:00
phoe
which is more of a FUBAR situation than a "every cycle of the feedback loop looks like this" situation
11:45:16
hayley
I watch over my bot via REPL; at best that means I've had a REPL open for 100 days or so.
11:46:33
_death
yes, similarly for my server.. but even on the development machine I sometimes have such sessions.. of course, sometimes I restart tens of times a single day
11:50:22
VincentVega
random-nick: Hey, sorry for the late reply, just saw this. I don't really mind holding this discussion anywhere.
11:50:51
VincentVega
random-nick: In Fern, I will do configurations and contexts using dynamic inheritance. Even if CLOS could be cajoled to allow that, it wouldn't work because you should be able to apply that to particular objects. Wrt GUIs, there are often a lot of similar entities that different only slightly, and which you might want to be creating at runtime programmatically (or modifying via slot addition/removal). If you are familiar with gamedev,
11:51:01
VincentVega
random-nick: As per cells vs constraints: multi-way constraints let you do stuff like multi-value unpacking (e.g. #(0 1 2) <--> :x 0 :y 1 :z 2), which is useful for defining synonyms and easy accessors. Multi-garnet also deals with loops, and well, there are quite a few other things to it, really. Cells isn't so bad, but it's not as nearly as capable (not judging, we all do this at times, but the codebase is kind of a
11:51:07
VincentVega
random-nick: I see this as a special case of the debate about dynamic typing. I am not arguing about the usefulness of explicit typing, but the case for flexibility is pretty clear-cut.
11:58:13
pjb
(uptime) #| uptime: 1 day, 22 hours, 11 minutes, 43 seconds.↩ --> 166303 |# I had to reboot for a system update 2 days ago…
11:58:15
_death
it does mean sbcl is not the most up-to-date, and sometimes (not often, as you can see) that's a reason for a restart
11:59:04
pjb
_death: system upgrade are more often reasons to restart (emacs, lisp, etc). Ie. those programs are quite stable!
12:01:33
_death
pjb: right, but here's there's also a mismatch between server and development machine, as I keep sbcl and libraries that use sbcl-specific code up-to-date on the latter.. sometimes this creates conflict if I want to update the code on the server
12:10:42
_death
I suppose a different style (the prevalent style, with docker and such) would be to build an image and deploy to server.. repl could still be available, but image restarts would happen more often
12:14:18
_death
in that style, whenever you want to update the code, you build a new image.. the repl could be used for debugging, but usually not updates
12:23:03
VincentVega
ecraven: And if you are interested in the solver, there's this: https://constraints.cs.washington.edu/solvers/skyblue-tr-92.html
12:35:53
atgreen
just give it input and output streams and it formats the code nicely, preserving comments
13:22:34
ecraven
after reading through the (normal) Garnet manual, it is definitely more complex than I had first thought.. but interesting ;) I don't see how this can be implemented in a performant way though...
13:46:37
jackdaniel
Fare: if you are up for necromancy then please merge: https://gitlab.common-lisp.net/frideau/fare-matcher/-/merge_requests/1
13:52:43
VincentV`
ecraven: At the time of writing KR was actually created as an efficient alternative to the typical frame-based systems of the time. (2) It was fast enough 30 years ago, it will be fast enough now. (3) There will be specialization mechanisms and batch graphical API commands in Fern.
13:55:53
ecraven
VincentVega: thanks for all the interesting ideas and links ;) regarding fast enough, it'll be interesting to see that, many things have improved, especially expectations ;)
13:57:56
VincentVega
ecraven: There will be caching mechanicsms in Fern. If you are interested, take a look at "The Drawing Process" in the Fern section.
14:03:11
pjb
ecraven: remember that garnet is a GUI; it doesn't have very hard time constraints, notably not on modern hardware. As long as the reaction time is under 10,000,000 ns…
14:04:32
pjb
ecraven: of course, using something like KR or Cells may have efficiency implications compared to more procedural systems, but again, you'd use that to avoid having to track the dependencies between the data elements yourself.
14:07:35
ecraven
pjb: I'm thinking of things like positioning points based on data, so if the data changes, widgets should move.. think of particle systems in a game. unless the idea is that this sort of approach just isn't suitable to that
14:13:50
VincentVega
ecraven: You could wrap a large point cloud into a custom data structure, and then build around that. I don't really see a problem.
14:17:57
VincentVega
I mean, sure, of course, if you create some crazy amount of interactive elements, and if you use constraints on all of them, it will probably be troublesome. It depends exactly on what you are doing, too. And, yes, sure, it's yet to be seen how exactly performant multi-way constraints are (but the papers claim good performance for their demos).
14:36:37
Fare
jackdaniel, I lost my OTP for cl.net... oops. I need to renew access before I may merge.
14:40:18
random-nick
VincentVega: don't gamedevs use entity-component-systems instead of prototype OO for such dynamic objects?
14:41:30
random-nick
also, it's unclear to me how would layout work, wouldn't child cells have to have some information about where the parent cell is going to put them during laying out?
14:42:13
VincentVega
random-nick: Some use protype OO. The point was that the class/object seperation doesn't work there.
14:42:31
VincentVega
random-nick: The information may be accessed via pointer variables. There are also contexts.
14:42:45
random-nick
and regarding your mentions of climacs, if you're not aware, there's a new in-development rewrite of it called second climacs, but it's still uses a character-based representation afaik (but it no longer uses a custom incremental parser) https://github.com/robert-strandh/second-climacs
14:44:14
VincentVega
random-nick: I knew about 2nd climacs, but not that it decided to ditch the parser. Interesting, thanks.
14:48:50
VincentVega
beach: Yeah, Eclector is an awesome development. Thank you for it, and the people who developed it. I am hoping to reuse it myself when the time comes.
14:52:06
random-nick
also it's important to note that climacs uses the lisp image it resides in, not a swank connection
14:58:57
beach
So write the code twice in different ways; in one way for the reader and in another way for the editor?
14:59:02
random-nick
VincentVega: and regarding the section about the project management platform, there already exists such an integrated platform implemented in C called fossil (https://www.fossil-scm.org/) and it's used by sqlite and tcl, though it's much stricter than what you want to make. basically, it's a version control system, bug tracker, forum and wiki all stored as a single sqlite database
15:00:09
VincentVega
beach: I can't provide a direct link to the particular section, but I wrote about that here https://project-mage.org/the-power-of-structure just search for the "Handling of Reader Macros" section.
15:01:25
VincentVega
random-nick: I've heard of fossil, never tried it though. But to me, yeah, the major point is in the environment.
15:05:39
minion
holycow, memo from mfiano: it's just a directory so sure, just updated your implementation's startup file to reflect the new location.
15:05:39
minion
holycow, memo from pjb: (load "/path/to/your/quicklisp/setup.lisp") in your rc file.
15:09:41
VincentVega
beach: I actually refer to your paper there, it helped understand a few points about reader macros.
15:15:22
ecraven
holycow: If you try using paredit (or one of the other similar modes) in Emacs, or watch videos of SEdit, you'll see what structure editors might be like.
15:15:49
ecraven
or actually just try SEdit, it even works online (https://interlisp.org/running/online/)
15:16:46
random-nick
VincentVega: also, as a drawing "backend" you might be able to use the lower parts of mcclim, it might or might not be more comfortable than sdl2 but could be more flexible if you need it
15:17:55
random-nick
reading the mcclim critique I thought you misunderstood some parts of clim, but I haven't really written anything with mcclim so I'm not sure
15:18:17
ecraven
VincentVega: have you written anything about handling text? that's one of the larger hurdles, imho ;)
15:21:39
VincentVega
random-nick: I did misunderstand a point or two. I will have to rearticulate that, I placed a notice there too. As per the backend: all I will want from the backend is some events and draw calls, I think that sdl should do just fine.
15:23:00
VincentVega
ecraven: I have. Too much on the one hand and, yet, it seems like too little. Please, see https://project-mage.org/the-power-of-structure#Rune
15:24:21
ecraven
sorry for not explaining what I mean, I'm talking about unicode and character composition and all that stuff
15:27:23
VincentVega
ecraven: Oh, no, I haven't written anything about unicode or encodings. As per rtl, I think that's where specialized editors could help, because every editor is itself responsible for its own graphical output (and stuff like cursor motion).
15:28:51
VincentVega
ecraven: I might be misunderstanding, but if you mean a hurdle to structural editing, could you elaborate?
15:29:23
ecraven
not to structural editing, but in general. even the structural editor should support entering all kinds of text, right?
15:32:05
VincentVega
ecraven: Yeah, I have read a few horror stories about the correct handling of various editing situations. But I am convinced that structural editing may only help. What structural editing gives you is knowledge about the information you are dealing with. Structural editors are in essence specialized editors, and so, yes, they can do whatever the information at hand requires them to do. There are no limitations to that.
15:32:13
ecraven
something like harfbuzz could do the shaping, then you "only" have to draw the glyphs ;)
15:32:41
VincentVega
ecraven: Yeah, that part of the text-handling story, I prefer to leave to stuff like harfbuzz, for now : )
15:36:31
VincentVega
random-nick and ecraven: thank you both for the interesing questions and the useful pointers, by the way : )
15:39:53
random-nick
regarding my mcclim as a backend point, I was referring to the fact that clim is structured as a tower of abstractions where you can use the lower levels without the higher ones
15:41:17
VincentVega
random-nick: Oh, yeah, you mean snatch away some lower layer? Ha, maybe. Who knows.
15:45:27
NotThatRPG
Using SLIME, should I expect evaluating a special variable in a debugger frame to give an accurate value for that special variable at that point in the stack? I'm getting a NIL where a function called incorrectly *binds* that variable, but I don't see the value set initially at the bottom of the stack. Using SBCL.
15:56:26
beach
It is interesting that the standard is ambiguous when it comes to the word "bound". I would like to fix that some day.
16:02:14
jackdaniel
NotThatRPG: if you mean the value before the dynamic binding, you may call symbol-value on it
16:06:23
jackdaniel
I see, thanks. I must have confused that with something else, because I'm sure I saw something like this..
16:06:56
random-nick
I don't think the standard provides a way to access the global value of a special variable?
16:07:24
beach
Here is an example of the ambiguity: (defparameter *a* 10) (defparameter *b* 20) (progv '(*a* *b*) '(30) (list (boundp '*a*) (boundp '*b*))) gives (T NIL).
16:08:44
beach
But the dictionary entry for PROGV says that *b* is "bound" (but "then made to have no value").
16:10:39
beach
I would like to fix the terminology so that there is a separation between "bound", i.e., a binding exists, and "having a value".
16:12:33
Catie
What would it mean for a symbol to be bound, but have no value? Just that BOUNDP would return T?
16:13:26
beach
Catie: It means the case illustrated by PROGV, and yes, if BOUNDP were correctly named in that situation, it would return T.
17:20:37
Bike
What's the best practice for having custom asdf component types? I remember it being an old problem that defsystem-depends-on doesn't help if your component class names are symbols in some dependent package, but I don't remember the solution.
17:21:55
jackdaniel
I don't know what is the best practice however asdf-user is a package that should exist
17:23:53
_death
I remember that problem with cffi grovel.. in the end it was resolved by it too using a keyword
17:24:02
random-nick
cffi seems to just alias its classes into the asdf package https://github.com/cffi/cffi/blob/master/grovel/asdf.lisp#L150