freenode/#lisp - IRC Chatlog
Search
10:31:34
bhartrihari
What problems would one want to look at while trying to improve the state of smalltalk like image based programming in CL?
10:32:28
no-defun-allowed
I'd like to "atomically" replace a set of functions and types, so that busy threads don't get confused if they try to use those while I'm reloading them.
10:41:14
no-defun-allowed
One easy implementation would be to have something like (with-stopped-world (ql:quickload :some-stuff)), but that doesn't help if a thread has entered the code we wish to replace.
10:45:19
no-defun-allowed
Maybe you can get closer with first-class global environments. Compile into a copy of the current environment, work out which functions changed, wait for all the threads to leave those functions, then stop the world and install them in the current environment.
10:46:02
bhartrihari
Maybe we could find something to solve that while trying to solve the problem of serializing runtimes with multiple threads?
10:46:34
no-defun-allowed
Do you mean like save-lisp-and-die -ing in the presence of multiple threads?
10:47:31
no-defun-allowed
The way restoration works there only really leads to one (fresh) thread coming back after you reload the image, so you could destroy all other threads to get an approximation of the solution.
10:49:25
no-defun-allowed
I can't comment on the possibility of persisting threads in an image, but alien data structures and associated state (including POSIX threads for example) and images aren't friends.
10:52:29
no-defun-allowed
I think old Smalltalk virtual machines implemented threads at the image level, i.e. Smalltalk would flip between contexts as a timer interrupts the virtual machine, but that's quite far from modern implementations.
11:23:07
beach
Not surprisingly, I didn't understand the meaning of the question by bhartrihari. bhartrihari: Are you saying that currently, no Common Lisp implementation is fit for image-based development, and that you are looking for ways to improve current implementations to make such development practical?
11:25:46
phoe
one thing that smalltalk images commonly provide is an integrated GUI/IDE/class browser - CL currently does not have such a facility
11:35:21
bhartrihari
beach: I'm looking to explore the problems therein, mainly to decide whether I would want to spend time making it more practical. There are certain problems which are documented in manuals for implementations like incompatibilities in images between versions. I was wondering what the concerns of the community are that have kept them from adopting that workflow more widely.
11:42:22
bhartrihari
Persistence via source control is one good thing about working with text files. I still need to take a closer look at clobber for that.
11:42:23
beach
For a "modern" OS, it is true that saving and restoring an image must work correctly.
11:43:22
beach
But there are other problems. It is way too easy to break the working image in ways that can't be fixed other than starting a new one.
11:44:30
beach
First-class global environments with a pertinent set of pre-configured environments would be a start.
11:45:44
lukego
bhartrihari: I'm not sure if Lisps usually have an Object>>become: method hiding somewhere, or Object>>allInstancesDo:, but I often miss those in non-Smalltalk images.
11:46:47
no-defun-allowed
lukego: It's possible to write an overwrite-instance, like the one in https://gitlab.com/cal-coop/netfarm/netfarm/-/blob/master/Code/Objects/MOP/rewrite-references.lisp#L36
11:47:13
bhartrihari
On binary incompatibility, sbcl manual states that nobody has been motivated enough to do a lengthy fix. I wonder if that is speculation alone, or there are any hints as to what the lengthy solutions might look like.
11:48:11
no-defun-allowed
(You probably wouldn't write it exactly like that, because we use that function to splat in the slots of an object we received into another instance.)
11:49:18
beach
bhartrihari: Doing more with standard classes, standard objects, and generic functions would help that problem. But SBCL and the other existing Common Lisp implementations were written before CLOS became part of the standard, so they add CLOS late. This means a lot of dependency on exact representation of objects.
11:52:16
bhartrihari
I don't think I understand that fully. You mean there is no standardized representation (ABI?) to conform to?
11:53:54
beach
Sort of. The internal representation of objects is often visible everywhere in the system, say in the form of tag bits and such. CLOS would help abstract those dependencies away.
11:58:30
beach
But it would be a monumental task to modify an existing implementation in that direction.
12:09:30
bhartrihari
Writing a standardized spec for that is a task in itself. Unless there's some ABI standard out there that fits the bill well.
12:13:54
bhartrihari
I think layout is fine. But calling conventions would probably take it too close to the compilation target. I would like to see something that both sbcl and ECL can conform to.
12:16:52
bhartrihari
I do need to do more readings in ABI specs before setting expectations on that though.
12:17:45
beach
For object layout, you may want to look in the SICL specification. I am using what I think is the simplest possible layout that will still allow for decent performance.
12:23:11
sm2n_
does it really matter, as long as you can convert to and from the format you make to whatever format the implementation in question uses?
12:36:58
bhartrihari
Though for now, I wasn't thinking of the possibility of two implementations running a piece of code simultaneously (that's the only case that comes to mind where we have competing GCs). Only at how that standardization can help with image based programming.
12:41:49
bhartrihari
I guess what it comes down to is perhaps to have a standard way to represent the "world", which multiple implementations can use.
12:43:00
beach
bhartrihari: But then the question is, what makes the difference between different implementations? Currently object layout (closely related to memory management) is an important part of that.
12:55:24
aaaaaa
Hi all. Have anybody used Lisp for static webpage generation? I would be interested in how it was done
12:58:40
contrapunctus
aaaaaa: I believe there are innumerable solutions for that. One is listed here - https://github.com/CodyReichert/awesome-cl#static-site-generators
13:35:35
adlai
ACTION has yet to patiently read the entire document, although it should be much more interesting than https://www.cliki.net/LLGPL and its ilk
13:42:15
adlai
ACTION is currently targeting a childishly simple goal: reducing the number of forks hosted under github.com/adlai that exist for the sole purpose of an open pull request
13:44:05
adlai
the practical relevance is that I am wondering whether to adopt the websocket client library, due to the uncertain status of its dependency, 8arrow's library event-emitter
13:45:26
adlai
this is skew-parallel, and not quite orthogonal, to the licensing uncertainty hovering over scalpl.
13:49:15
adlai
ACTION can't even recall whether the author's IRC nick is 8arrow or nitro_idiot ; either way, does not seem to be here right now :(
13:59:10
adlai
I realize my current goal is arguably a waste of time; however, since my primary purpose is turning a throwaway prototype into a tool both useful and worthy of publication, and this tool is explicitly for use by for-profit enterprises, it does seem counterproductive to rely on free services.
14:13:50
edgar-rft
Let's start a service that's only goal is to make others pay money and serve nobody
15:17:42
ak-coram
hi, I'm playing around with simd instructions in sbcl. does anyone know how I can unpack simd-packs?
15:31:05
rumbler31_
hey everyone. After perusing the latest quicklisp dist update, I am reading this code and trying to figure out what it does. https://github.com/Hexstream/enhanced-typep/blob/master/main.lisp
15:32:42
rumbler31_
it appears that if the argument is a constant, then a lambda is returned that tests a random object var against the specified type, otherwise
15:35:01
rumbler31_
the code looks deceptively simple and short but i'm having trouble figuring out what it does, and what machinery behind define-compiler-macro makes it necessary
15:39:26
adlai
rumbler31_: it's worth noting that code using define-compiler-macro should always have identical correct behavior when the forms defining the compiler macro are deleted
15:40:09
adlai
no guarantees about consistent failures, nor efficiency; although, compilers are allowed to ignore define-compiler-macro
15:43:08
adlai
ACTION begins to experience anger after too much time reading common lisp in github's website, and finds himself nostalgic for paste.lisp.org
15:43:57
rumbler31_
running the code in the repl was illuminating. I see that we are returning forms, not the lambdas themselves
15:44:35
adlai
correct, the function in question builds a lambda form, that can be compiled into a function
15:45:20
adlai
you may want to avoid thinking of the given arguments as "random", and instead just call them the given object name, and given type name.
15:49:02
adlai
rumbler31_: the author[s] have published their own chat website, in another repository under that same account, in case you want to contact them directly; although please remember to update, in here, if you learn something surprising in answer to your questions there
15:50:39
rumbler31_
I'm trying to play in the repl to understand the output of the function a little better
15:51:56
adlai
the function in question probably returns a lambda form, instead of a literal function, to avoid preventing serialization of compiled code.
15:52:58
adlai
yes; if you modify the code you are running so that it returns #'(lambda ...) instead of '(lambda ...), it will return a literal function object
15:53:18
adlai
that will work when you test it interactively, although it will almost certainly fail in certain compilation scenarios.
15:54:04
adlai
ACTION forgets the precise syntax for doing this bad idea with quasiquote, although it is probably `#'(lambda ... ,etc)
16:02:34
adlai
I hope you aren't also trying to unread projects that are removed from quicklisp... that is the garbage collector's job, not yours.
16:06:17
adlai
ok, read all of scalpl. it is terrible code, hitting almost all the nasty twisted corners of the standard, and it works.
16:07:29
adlai
if there is a specific part of the standard that you wish to see in use, please designate it.
18:11:57
daphnis
what's the cl equivalent of echo foo >bar, where bar is a named pipe? (with-open-file (s "bar" :direction :output :if-exists :supersede) (format s "foo")) doesn't seem to work.