libera/#commonlisp - IRC Chatlog
Search
12:46:04
gin
is there a data structure to push a key-value pair into an alist where each assoc's car is the key and the cdr is a list of values? if I do (addkv "f" "foo" alist) (addkv "f" "fox" alist) (addkv "b" "bar" alist), I should get alist to be '(("f" . ("foo "fox") ("b" . ("bar")) which is really the same thing as '(("f" "foo" "fox") ("b" "bar"))?
12:46:35
gin
And if I (addkv "f" "frog" alist) to it again, I should get alist to be '(("f" . ("foo "fox" "frog") ("b" . ("bar")). and so on.
12:48:25
pjb
gin: but you need to write your own accessor to deal with the case where the key is not in the alist
12:49:31
gin
beach: but (cdr (assoc key list)) is going to be NIL when the key does not exist yet, so I need to check that and add an empty list to key before I push the value, right?
12:49:51
gin
beach: so I think the idea is to just use an alist and build this little functionality myself.
12:54:38
_death
if I choose to use an alist, very often I have it hold a list of values, even if the length of the list is 1.. this avoid annoying (a . b) syntax
15:19:47
random-nick
hello, I'm trying to write bindings to gtk (and possibly other gnome libraries) by using the girepository library which loads .typelib files from disk (which are a compiled version of .gir files, which are generated by parsing gobject-based library source code and special annotations)
15:21:07
random-nick
so the girepository library has a function which lets you call the introspected functions directly through it
15:22:12
random-nick
but it also gives enough information to be used to generate bindings which have no need for girepository during runtime
15:23:05
random-nick
I think generating cffi bindings is a better approach, but I am not sure how should these bindings get generated
15:24:08
random-nick
I could make it generate the bindings using a macro, which would then mean the finished bindings would be in a compiled fasl without having to load girepository, right?
15:25:04
random-nick
but a problem with that is that a system update could update gtk and render the bindings somehow outdated
15:26:29
random-nick
so should I make it generate the bindings during load time or during macro expansion time?
15:35:24
random-nick
there's also the option of loading girepository, asking it to load the library's typelib, querying the library's major, minor and patch version and then generating a .lisp file containing the bindings, or loading one if it already exists
15:43:30
pjb
random-nick: libraries are versionned too. So if you generate the bindings for libfoo.2.3.4.so, you won't take libfoo.2.4.1.so!
15:44:09
pjb
random-nick: in any case, when you generate a new cffi, you will have to modify your sources!
15:47:51
random-nick
pjb: gtk3's first soversion number has apparently stayed 0 across its lifetime, so the incompatibilities seem to be only in behaviour and new additions
15:49:16
random-nick
also, over the lifetime of one gtk version, there don't seem to be too many incompatibilities encountered by a single program, but I don't know if that might change with gtk4
15:54:15
random-nick
beach: well, I don't really prefer gtk, but there don't seem to be any gtk bindings which are up-to-date and generated with gobject-introspection and gtk is a "native" toolkit for a good chunk of gnu/linux environments
15:56:00
random-nick
I've also briefly looked into the possibility of a mcclim backend for gtk, but it doesn't seem to be feasible because gtk3 is not only not intended to be used by multiple threads at the same time, but it's also not intended to be used by threads other than the one running the main loop
15:59:21
beach
And by "that doesn't sound so great", I mean that it would make it useless for many Common Lisp GUI applications.
16:04:31
random-nick
and I don't really have an answer to your question since I don't really intend to use these gtk bindings for any serious project, and I honestly forgot why was I even looking into the gtk binding situation since it was a year ago
16:09:29
random-nick
oh, also regarding threads, the intended usage of threading in C gtk applications is to do everything GUI-related in initialisation code and in event callbacks, while all other threads are worker threads and send events to the main loop using glib's apis for that (some of glib's apis are thread-safe)
16:54:52
jackdaniel
it is possible to have the port run in main thread and core infrastructure will assure thread safety between frames and the pirt
16:56:08
jackdaniel
that said all ports that require being run in the main tgread would need to cooperate
18:19:37
lisp123
Creates HTML docs very easily (IMO one of the best possible static site generators out there), using only emacs, and for lisp, it will ensure indenting and syntax highlighting transfer over to the html file
18:20:04
lisp123
plus you get all the power of slime/paredit/any other tools you have when workign with code blocks with org
18:32:20
nij-
By a "rofi-like window", I mean an X window that always show up on top of all of the others.
18:50:04
mfiano
Which is the case when rofi is spawned after my panel with the same windowing hint applied to it
18:55:54
_death
I was just reminded of a Raymond Chen post.. https://devblogs.microsoft.com/oldnewthing/20050607-00/?p=35413
18:57:51
nij-
_death: Ran `rofi -show run` in one term and `sleep 3; rofi -show run` in another. The later receives an error:
18:59:09
jeosol
I was writting a simple neural network (one layer, but eventually, deep ones). I had to write a lot of the matrix vector operations from scratch (I mean they are simple operations with some broadcasting) . What is the recommended CL library for matrix computations and matrix-vector operations
18:59:31
nij-
bpaste is down... (process:24641): Helper-WARNING **: 13:57:08.368: Failed to set lock on pidfile: Rofi already running? (process:24641): Helper-WARNING **: 13:57:08.368: Got error: -1 Socket operation on non-socket
19:05:07
_death
nij: I guess https://specifications.freedesktop.org/wm-spec/1.3/ar01s07.html#STACKINGORDER
19:06:37
nij-
"<qball> normal window, with state above set and override redirect https://www.x.org/releases/X11R7.7/doc/man/man3/xcb_create_window.3.xhtml"
19:06:59
nij-
But this is in C, which I don't read.. hopefully someone knows how to do that with CLX.
19:31:27
nij-
jackdaniel: you're right. Here's how stumpwm create a modeline - https://github.com/stumpwm/stumpwm/blob/7fe59c00810b35843139194525db444a2c26aa72/mode-line.lisp#L214
19:35:58
nij-
However, modeline isn't interactive. On the other hand, it seems that stumpwm uses dark magic (NOT by create-window) to create an interactive menu - the deepest thing I got is here. https://github.com/stumpwm/stumpwm/blob/a5ab063398cbea2dbfe711cacd5623b0c5779bf4/input.lisp#L424 I got lost in the abstraction and failed to see how it uses CLX to create a top-level interactive window.
19:53:27
jeosol
Just wondering if there are folks where working with deep-learning related project but using python libraries (pytorch or tensorflow) -- With some effort we can consolidate some of the related cl libraries (clml and those from gabor melis)
20:09:42
nij-
MichaelRaskin: Thanks! Im reading CLX's manual to find out. Need more familiarity with it. :)
20:12:50
MichaelRaskin
nij-: radical approacj: enumerate exported symbols from CLX, trace all of them
20:27:46
jeosol
_death: nice, thanks for the links and the updates are recent too. I will reach out to the author later
20:37:34
jeosol
_death: his development is much further along. I sent him a message. Barring any licensing issues, I explore the library further once I hear back from him. Perhaps we can coalesce around a library and some development effort to it
20:41:19
_death
jeosol: cool.. personally I'm not doing "deep learning" nowadays (except for small stuff like translating swedish subtitles to english, but py4cl2 is sufficient there :) but good to keep up to date with Lisp libraries
20:53:55
jeosol
_death: so you call python/tensorflow/torch libraries from the cl side to do related work?
20:55:19
jeosol
It will take lots of efforts to get close to related libraries in python land. I don't think that's the goal except we get an army of developers - maybe get some of the core nets in CL. But again, people will say, if you can access the libraries from python, what's the point
20:56:55
_death
jeosol: not swedish, just watching some series.. in that case I do call python, yes.. with a library like "nlu" it's even easy
20:57:47
jeosol
that's how I use the libraries for now too, I write python, them call it from the CL side
20:58:37
_death
jeosol: no.. and in fact it takes a long time (minutes) to translate, since nlu uses the CPU.. but the results are pretty good
20:58:47
jeosol
tensorflow is awkward in a sense, I them learned that it was because of the underlying C++ implementation
20:59:18
jeosol
hahaha - not real time. But you are getting good results. I should look into that library
21:00:19
_death
it uses pyspark.. in some cases there may be a way to use the GPU, but I think it's not supported with the versions I used
21:00:53
jeosol
I see. I was planning to buy a GPU at some point but hoping also it will help my related CL programs.
21:01:24
jeosol
that's good at least it's working for you - calling an existing model. I think that's now most of the models are used anyway
21:02:11
jeosol
They have lots of parameters, and have been trained on larger corpus of words. Same in the vision/object recognition space
21:02:26
_death
for trying existing models I also used OpenCV's DNN support (I wrote some opencv bindings).. there's the onnx zoo where some models are usable
21:03:25
_death
and also there was some experiment using zeromq to communicate with javascript code which used some tensorflow..
21:04:00
jeosol
lisp123_: you won't go wrong with that. I have only used SBCL for several years and code will probably break with CCL
21:04:34
jeosol
_death: I guess that's why most won't see the need. One can already access these libraries from CL side
21:05:34
jeosol
I remember hearing about cl-cuda library but interested to see what kind of speed up I'd get with a GPU
21:06:16
_death
jeosol: possibly.. I do have pure CL libraries for machine learning tasks, but they're not "deep learning" ones
21:06:25
jeosol
For now I am trying to invest time in parallel build to get my application to build fast, looking into Fare's poiu
21:07:19
jeosol
stylewarning: not sure he is here, but he does use SBCL for computational and matrix related work
21:07:44
lisp123_
jeosol: thanks. I wish we weren't heading towards everything is tested on SBCL and may not work on other implementations
21:07:51
jeosol
I have gotten good performance with SBCL but I have not done much benchmarking with other languages
21:07:52
_death
jeosol: it depends on the task, implementation, and hardware.. it could easily go from the order of hours to minutes
21:08:13
stylewarning
lisp123_: it takes a lot of work to do high performance testing and porting to other compilers
21:09:03
stylewarning
lisp123_: we ported our stuff to ccl, allegro, and ecl; no doubt they’ve bit rotted, and allegro requires a long exchange with Franz engineers and never quite resolving the problems
21:09:33
jeosol
_death: interesting ... I do simulation work (fluid mechanics + numerical differentiation) . I was running a model that took 60 minutes, a friend said he used GPU and was able to get it to 400 seconds.
21:10:35
_death
jeosol: sounds plausible.. I think in my last job I've also seen some x10 speedup for some cpu->gpu task
21:10:49
jeosol
lisp123_: yeah, I think shinmera maintains a page that shows tests with several CL libraries: I think the SBCL column is mostly green all the way down, maybe followed by CCL
21:11:45
jeosol
_death: thanks for that metric. I thought my friend was BSing me. I don't have a gpu to test
21:12:33
lisp123_
jeosol: I do, I just also like that there is diversity since new ideas come from that - but all that said, its not like I would make that much effort to make my code portable (behind the basic stuff) so hopefully my comment isn't taken the wrong way :-)
21:12:41
Shinmera
unfortunately creating that page did not have the intended effect of pushing people to increase coverage.
21:13:10
jeosol
Shinmera: great work. It will be nice if they do. I see you have a column for SICL already
21:15:16
jeosol
lisp123_: I see what you mean. I think SBCL and CCL are the big free implementations. Early when I started, I once looked into Franz, but there was a timing limit and some limit what you could do. Then CMUCL, then just SBCL since.
21:16:49
moon-child
Shinmera: I see some cells are marked with an asterisk, but there's no mention of its meaning?
21:17:43
Shinmera
if you activate the long list view with the button in the top right you can see more detailed explanations.