libera/commonlisp - IRC Chatlog
Search
12:04:04
gamaliel
Hi, does anyone have experience with the vgplot system? I don't know how to return a plot as a tk widget. When I run (vgplot:plot) it returns an empty string.
13:14:43
qhong
gamaliel: why you want to get a widget object? vgplot (or gnuplot) seems to rely extensively on global state and I think there’s no way to do that
13:15:50
qhong
gamaliel: iirc vgplot doesn’t manage its own GUI, it just sends command to a separate gnuplot process. I could be wrong. I was using it a lot for scientific computing but I had no need to hack it
13:51:57
nij-
I just watched beach's talk again on FCGE. A main issue it addressed is that it's not easy to implement FCGE without sacrificing run-time performance. But I fail to understand how his implementation resolves this issue.. any idea?
13:56:08
Bike
oh. well, beach's implementation uses cells, so that at runtime to look up a definition you just grab it from a cell that was compiled in, which is pretty quick. that's not in the presentation?
14:17:25
nij-
I did stop and re-watch many parts of it, but still failed to see the reason. Hmm.. I also need to think more about what you said.
14:26:54
beach
nij-: An indirection through as CONS cell has the same cost as an indirection through a symbol, which is what most implementations do.
14:27:22
beach
nij-: And as Bike said, previous work used a hash-table lookup for each function call.
14:27:26
nij-
And by grabbing it from a cell, do you mean the same thing as (slot-value ..) in CLOS? I'm not sure how CLOS is implemented.. but whenever (slot-value ..) is evaluated, under the hood isn't it doing a hash table lookup?
14:28:30
beach
nij-: More like (funcall (internal-car (load-time-value (find-function-cell <name>))) arg...)
14:30:49
nij-
I suppose there should still be a mechanism for it to look over a collection of cells, right? That doesn't make it as inefficient as a hash table lookup?
14:31:54
phoe
by the time INTERNAL-CAR is called at all, LOAD-TIME-VALUE has already called FIND-FUNCTION-CELL and installed the reference to the concrete Lisp object in its stead
14:38:40
nij-
Hmm.. so the goal is to make it efficient in run-time. And the heavy work has been done before run-time..?
14:40:55
beach
nij-: A typical Common Lisp implementation has an indirection through a symbol. The work to find that symbol at load time is the same as that of FIND-FUNCTION-CELL.
14:51:19
phoe
it's fun to be a bystander to this, because I'm working on an article documenting a library utility that directly depends on LOAD-TIME-VALUE
15:00:27
beach
It is also fun to see how it is not widely known what a typical Common Lisp implementation has to do at load time in order to find the symbol corresponding to a function call in source code. Nor is it widely known how a typical Common Lisp implementation represents the global (null-lexical) environment, as opposed to the lexical compile-time environments of CLtL2.
15:01:14
phoe
I think it's generally not widely known what a typical CL implementation has to do in order to achieve X, unless you're something of an implementer yourself
15:01:30
lisp123
TIL one of the inventors of Lisp Machines (Tom Knight) has founded a company worth $17bn as last year
15:02:18
lisp123
I do wonder if there is some secret LISP code in there that they are keeping a trade secret
15:03:25
nij-
Sigh. I start wondering if JS is really that bad. Is there any formal argument that shows JS is inferior to Lisp?
15:35:27
qhong
and it can yield bunch of sensible result, like mutation is real power, call/cc is real power, and delim/cc = call/cc + mutation > call/cc
15:37:08
lisp123
Not that I plan on doing it, but is it possible to call generic functions in a eval-when form (you know the ones that run code at load time)
15:44:37
Alfr
lisp123, the default behavior is for forms only to be evaluated when a compiled file is loaded, not when they are compiled.
15:48:28
lisp123
(eval-when (:compile-toplevel :load-toplevel :execute) (defgeneric test (a)) (defmethod test ((a list)) (print "test")) (test '(1 2 3)))
15:48:35
White_Flame
all functionality works at all run/load/compile-times. the question is whether or not that functionality is loaded/present at that time
15:49:30
lisp123
So as soon as the basic "CL" image is loaded, everything is kinda already in runtime?
15:50:31
White_Flame
it's a snapshot of the constructed system and has very little initialization per runtime
15:51:08
lisp123
White_Flame: But now I am curious, what do you mean by "very little initalization per runtime"
15:51:11
White_Flame
(relatively speaking. it initializes the heap and whatever, but all the code is extant)
15:51:29
White_Flame
lisp123: I mean it doesn't do any loading at that point. everything was already loaded before the image was made
15:51:51
White_Flame
now, further REQUIRE forms might pull in more stuff from the implementation, but generally speaking it's all already there
15:52:35
Alfr
lisp123, for the interaction and about what may or may nor be available/done to your running image when you compile a form or file, see
16:16:41
didi
The last version (2.2) of SBCL eliminated my problems with ENOMEM errors. Thank you, SBCL developers. <3
17:01:42
phoe
drakonis: we'll see where this goes - CDRs need implementations much more than they need authors
17:05:12
drakonis
some of the existing CDRs are related to runtime functionality rather than language functionality
17:09:20
beach
Maybe I am wrong here, but if something could be implemented as portable Common Lisp code, wouldn't it just be a library rather than a CDR?
17:10:43
phoe
it seems to me that the CL ecosystem depends on de-facto libraries much more than Scheme depends on SRFIs
17:11:19
phoe
and e.g. Ironclad has customized code that is compiled only on SBCL for performance reasons
17:11:28
etimmons
> For example, a CDR document can contain specifications of libraries, language extensions, example implementations, test suites, articles, etc.
17:11:58
drakonis
you can either write it as a generic library that's pure scheme/CL or write an implementation that takes advantage of features provided by the implementation
17:12:06
beach
etimmons: I can believe what the home page says, but it still seems to me that the main point would be as I guessed.
17:12:19
phoe
if Ironclad was a SRFI, which it could, then it would provide some API for accessing crypto functions, and then either SBCL would ship ironclad-performance-specific code with itself as a contrib or ironclad would carry SBCL-specific code with itself
17:13:01
random-nick
that would I guess be a CDR for library writers and not for implementation writers
17:13:10
phoe
random-nick: oh yes, and I dislike it, specifically because it has no way of conveying intent (see kmp's writeup on the topic)
17:13:57
pve
Hi, is there a Zork-like game (text-based adventure) written in CL that I could study? Zork itself was written in some other dialect of lisp.
17:14:32
EdLangley[m]
One of the things about generic equality is that it's usually possible to right a :key function that lets you use the standardized equality predicates
17:17:11
drakonis
https://medium.com/the-software-firehose/architecting-a-text-adventure-game-2e0dc4d49812
17:19:03
phoe
the code at https://github.com/shaaza/text-adventure-game would need untabification before it's readable to me
17:19:06
random-nick
phoe: right, but it makes me wonder if presentation types could be generalised a little to allow for things such as equality, hashing, serialisation, etc.
17:19:18
pve
drakonis: Thanks for the links, I'll check those out. It doesn't necessarily have to CL code, architecture is interesting too.
17:21:12
random-nick
basically, commands are defined to accept arguments of specific presentation types and all presentations have a presentation type attached
17:21:20
drakonis
the real question here is, what can be turned into a CDR that isn't already a library everyone uses?
17:22:12
random-nick
and presentation types also have defined a way of getting accepted (other than clicking on a presentation of the given type)
17:23:32
phoe
drakonis: the real real question here is, what CDRs can be turned into a library everyone uses
17:24:23
phoe
in particular, how to make something that's useful, as in, actually usable and used by people to solve real-world problems
17:25:02
phoe
I kinda guess that "notarizing" already de-facto standards into CDRs is the easy part and also the part that brings little overall benefit
17:25:35
pve
drakonis: The reason I asked (or one reason, anyway) is I'd like to find out if there are "standard" solutions to how to make creatures etc react to certain events. Say I'm in a room and drop a piece of gold. Then the greedy gnome in the same room should notice this and immediately try to grab the gold. Stuff like that.
17:25:41
random-nick
also, it would be nice if the compatibility libraries decoupled their implementation support from their main systems
17:26:26
phoe
it doesn't mean that you can use swank without an implementation-dependent piece of code, but the API is separated from the backend
17:26:35
random-nick
mezzano has to use a bunch of patched compatibility libraries because its internal interfaces aren't stable enough to upstream the patches
17:27:24
drakonis
but its not something widely loved by the CL community because they all prefer regular macros
17:29:31
random-nick
drakonis: well I think a lot of the use for hygienic macros isn't there in CL because of CL's package system
17:30:03
random-nick
where packages contain symbols instead of the scheme way of having a global symbol table and modules mapping symbols to values
17:30:17
EdLangley[m]
Especially racket's syntax-parse macros which always involve some complicated parser DSL
17:31:16
phoe
FORMAT Tilde Backspace, the quantum format directive that erases itself the moment somebody looks
17:32:19
random-nick
mit-scheme has a hygienic macros system where you write macros like with defmacro but symbols which you want to be exposed to user code (like the anaphoric IT or anything similar) you include as a "syntactic closure" instead of just as the symbol object itself
17:33:13
random-nick
such a style would be nicer imo, but still not that useful considering the package system
17:35:17
didi
Come to think about it, I would welcome a implementation extension that implemented string literals.
17:38:25
specbot
Potential Numbers as Tokens: http://www.lispworks.com/reference/HyperSpec/Body/02_caa.htm
17:39:15
phoe
continuations could be a CDR, too - I've seen a few discussions about how to solve the U-P reentrancy problem
17:39:23
random-nick
it was a feature on some old lisp I remember reading about, basically defining a lambda macro FOO would get called when you do something like ((FOO BAR) BAZ)
17:39:52
phoe
oh, so extra syntax for when an operator call argument is a list - like ((lambda ...) ...) is supported in standard CL
17:40:20
didi
phoe: If I recall correctly, schemers don't like continuations no more. Apparently "delimited continuations" are the way to go. I understand neither.
17:40:55
phoe
mfiano: https://www.reddit.com/r/Common_Lisp/comments/s98u12/portable_implementations_of_genericlabels_and/