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