<pjb>
fivo: you cannot export classes in lisp from anything (in the CL standard; you can always invent your own concepts).
<pjb>
fivo: in CL, you can only export symbols from packages.
rumbler31 has joined #lisp
<no-defun-allowed>
fivo: I don't think that is good advice.
<fivo>
ok, so it's no possible to just export the symbol of a class and have access to all the readers/writers
<fivo>
you need to also export all the readers/writers?
<fivo>
*symbols
<pjb>
fivo: what this tutorial means to convey, is that you should define and document your own API. It is valid to define make-instance '<your-class> as the API to instanciate objects of your class, and to specify that they're CLOS object.
<no-defun-allowed>
Yes, that's also a good idea.
selwyn has joined #lisp
makomo has quit [Ping timeout: 255 seconds]
<pjb>
fivo: but if you could want to implement them as structures or as something else (eg. a reference in a database, a handle), then you may want not to publicise the fact that they're clos objects and it's a class.
<pjb>
fivo: in that case, you would define your API in terms of functions such as make-person, instead of a clos class with a constructor such as make-instance 'person.
rumbler3_ has quit [Ping timeout: 258 seconds]
<pjb>
fivo: and yes, you get to choose the precise list of accessors you want to export. Some accessors may be "private".
<pjb>
(accessor names, actually).
<pjb>
Since CL is a lisp-n, (cf. lisp-2 vs. lisp-1) a symbol can name several things. When you export it, thru it you give access to all the things it names.
Bike has joined #lisp
X-Scale has quit [Ping timeout: 244 seconds]
<fivo>
ok so there is no mechanism to automatically export all accessors whenever I export the symbol of clos class? (maybe also for a good reason)
<no-defun-allowed>
You can write a macro to do that.
heisig has quit [Quit: Leaving]
rumbler31 has quit [Ping timeout: 244 seconds]
Folkol has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rumbler31 has joined #lisp
rumbler31 has quit [Read error: Connection reset by peer]
<beach>
pjb: There is no such thing in the Common Lisp HyperSpec as a "CLOS object". The only reasonable meaning of such a term would be equivalent to "object" or "datum".
<beach>
fivo: Yes, very good reasons. You almost never want to do that, so the functionality is fairly limited.
<_death>
you may also be interested in this: (defun thoughtful-export (symbols &optional (package *package*)) (dolist (symbol symbols) (when (y-or-n-p "Do you really want to export the symbol ~S?" symbol) (export symbol package))))
<_death>
you should think about the external interface first, instead of automatically exporting symbols
<p_l>
fivo: also, package nicknames, and available in some systems package-local-nicknames, allow you nice shortnames that help with things
rumbler31 has quit [Read error: Connection reset by peer]
<katco>
can anyone recommend a common-lisp equivalent to pandas? the only one i can find that appears similar is cl-ana http://pandas.pydata.org/
<Josh_2>
wait so the answer is contradictory?
<Josh_2>
It's good but It's bad to export classes?
rumbler31 has joined #lisp
<p_l>
Josh_2: it's good to think on external interface, including which symbols need to be qualified
<beach>
There is no problem exporting names of classes, especially if you want client code to be able to subclass, define :AROUND methods, etc.
<beach>
Josh_2: As several people pointed out, it is not whether it's a class or not that counts, but whether the entity is part of the external protocol.
<Josh_2>
I don't know what that means
<Josh_2>
part of the external protocol?
<fivo>
selwyn: beach: thanks for the pointers
<beach>
Josh_2: The stuff you want to present to client code. Called API or Interface in other contexts.
<Josh_2>
O right
<selwyn>
fivo: any time
<Josh_2>
So the problem occurs when it is or isn't an API?
<beach>
Josh_2: There is no problem. If your symbol names something that is part of the protocol, then export it, otherwise not.
X-Scale has joined #lisp
Folkol has joined #lisp
<Josh_2>
O right
<selwyn>
the API is something that you, as the author of the package or library decide upon
cosimone has joined #lisp
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]
<Nilby>
_death: lol, I think I need to make the whole thoughtfull-* suite, especially thoughtfull-defsystem, and thoughtfull-setf
orivej has joined #lisp
cosimone has quit [Client Quit]
<_death>
you can also add (unless (documentedp symbol) (setf (docstring symbol) (prompt "Please enter documentation for ~S:" symbol)))
rumbler3_ has joined #lisp
rumbler31 has quit [Ping timeout: 258 seconds]
<iarebatman>
beach: yes, I am new here.
vms14 has joined #lisp
mooshmoosh has joined #lisp
moldybits has quit [Read error: Connection reset by peer]
v88m has quit [Read error: Connection reset by peer]
rumbler31 has joined #lisp
moldybits has joined #lisp
v88m has joined #lisp
rumbler3_ has quit [Ping timeout: 258 seconds]
<pjb>
beach: object and datum include objects of build-in classes. What I mean by CLOS objects are instances of standard-object; there remains instances of user-defined standard-classes.
brundleticks has quit [Remote host closed the connection]
<pjb>
katco: why would anybody want an equivalent of pandas? They're stupid, lazy, evil, gluttonous, (and they eat something they're not supposed to eat), they don't reproduce, and they cost a lot of CO₂, being shuffled around in planes.
<katco>
pjb: :) i'm speaking of the lib at the url i pasted, of course
<pjb>
_death: (unless (documentation symbol t) (setf (documentation symbol t) (prompt "Please enter documentation for ~S:" symbol)))
<pjb>
katco: ;-)
brundleticks has joined #lisp
<katco>
they are cute though!
<pjb>
Cuteness in the animal world, is often a sign of danger…
<beach>
pjb: I know what you mean, but it is better to use the established terminology, i.e. standard object.
jgodbou has quit [Ping timeout: 256 seconds]
jgodbou has joined #lisp
<pjb>
beach: you're right. I need to learn more about CLOS actually (*^.^*)
schjetne has joined #lisp
<_death>
pjb: there's a reason I didn't use documentation :)
phoe has quit [Ping timeout: 268 seconds]
<pjb>
_death: Yes, because there are several documentations :-)
<pjb>
lisp-n
rwlisp has joined #lisp
rumbler3_ has joined #lisp
rumbler31 has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #lisp
<iarebatman>
Anyone know if there is an analogue in CL to clojure's {get-in,assoc-in} ?
etrumbo has joined #lisp
<beach>
iarebatman: It is a much better strategy to describe what you need. Then people who do not know the language you are referring to can also help out.
FreeBirdLjj has quit [Ping timeout: 246 seconds]
rumbler31 has joined #lisp
<iarebatman>
beach: Thanks for the tip. Is there a convenient way to traverse an alist/plist depth-wise to get at a value at a certain 'path' ? ex, instead of nesting several (cdr (assoc))s, something like (get-in alist '(:first :second :value-of-second))
anewuser has joined #lisp
<Xach>
iarebatman: not built-in
rumbler3_ has quit [Ping timeout: 268 seconds]
<iarebatman>
Perhaps a well-known and popular library?
<Bike>
lisp code doesn't use nested alists very much.
<Xach>
iarebatman: in my experience it is not so common to construct objects that require key path lookup like that in CL, and I don't know of a popular library to do it. (it seems pretty common when processing e.g. json though)
<Bike>
so i don't think so.
* Xach
has a local "jref" function that does long key path lookup on json structures
<iarebatman>
Yeah that's my current predicament, parsing json
<Xach>
iarebatman: i'll show you what i use, maybe it would be useful for you
<Xach>
but feel free to make/find something better!
<iarebatman>
Xach: thank you! I'll take a look at this
anewuser has quit [Read error: Connection reset by peer]
Josh_2 has joined #lisp
rumbler3_ has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
<Josh_2>
Is there a guide somewhere that explains in laymans terms how the heck to deploy an app in CL and why certain steps have to be taken. I've deployed before but never anything more than like 100lines of cl
etrumbo has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
rtypo has joined #lisp
<Xach>
Josh_2: it depends on what kind of app...what did you have in mind?
anewuser has joined #lisp
<Josh_2>
Well I have an app that I have made and I tried to dump the image but it isn't functioning properly
rumbler3_ has quit [Read error: Connection reset by peer]
<Josh_2>
It's not functioning properly when dumped. pjb has gone over some things with me but I was hoping there would be a nice guide that explains why things are the way they are
<iarebatman>
Josh_2: I'm definitely no expert in CL, but I was able to easily build a native executable with buildapp
<Josh_2>
with buildapp I specify the location of the --asdf-path and then name the package I created with --load-system ?
<Xach>
Josh_2: --load-system is for loading systems - systems usually load files that define packages.
<Josh_2>
right
dale_ has joined #lisp
dale_ is now known as dale
<Xach>
Josh_2: here's what i do!
<Xach>
i have one rule that builds the project with Quicklisp, that means all the prerequisites are available. the next rule dumps a quicklisp system manifest file. the next rule uses that manifest to build my program binary.
idlus has joined #lisp
<iarebatman>
fivo: the parsing is fine with cl-json, it’s after it’s been turned into cl representation that I was looking for a better way to extract nested values
idlus_ has quit [Ping timeout: 256 seconds]
<Josh_2>
hmm
<mfiano>
Keep in mind that you have to explicitly unload any foreign code that is loaded in the image prior to dumping it, and then re-open the libraries in a function called on initialization. You can't dump the path CFFI used to load the library on *your* system.
<Josh_2>
That's what pjb was saying
<Xach>
Josh_2: are you using some foreign libraries?
<Josh_2>
not directly but I'm using usocket, which I assume does
<Xach>
Josh_2: not usually.
<Xach>
Josh_2: what trouble do you have?
<Xach>
I did not see any previous discussion, sorry.
<Josh_2>
Basically when I load normally with asdf in sly I have no problems, if I use a function to load the asdf then dump the image the server doesn't work properly, tcp seems to work but udp doesn't
<Xach>
Josh_2: how can you tell?
<Josh_2>
because when I move my fingers on my android screen, normally repl spews tons of output :P
<Xach>
what Lisp are you using?
<Josh_2>
SBCL
* loke`
is actually reading tex.tex
<loke`>
Why you ask? Well, I'm trying to learn how it does maths rendering.
<Xach>
nobody asked!!!
<loke`>
And no, literate programming is still as useless as ever.
<loke`>
Xach: good point.
sjl_ has joined #lisp
<loke`>
I just wanted to complain that Knuth's programming is atrocious.
<Xach>
Josh_2: i don't think there is a general guide, just practice and troubleshooting, sorry.
<Josh_2>
Xach when I finish eating I will demonstrate how I create the image etc and what happens
<Xach>
Josh_2: ok
<Josh_2>
I'm probably just doing something wrong, that's normally the case xD
Folkol has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Josh_2>
Well I fixed why move-mouse isn't working in the image, It's set using (defparameter ..) and pjb was talking yesterday about how globals need to be setup in a different way
igemnace has joined #lisp
<Josh_2>
rip it worked
lucasb has joined #lisp
<Josh_2>
off to the gulags I go
<Xach>
great!
<Josh_2>
just spilled diet coke all over my desk in excitement xD
<Josh_2>
So I'm guessing I need to create a function that sets up all my global variables and call that as my top level function?
<dlowe>
or use defvar for things that need initializing only once
<Josh_2>
so defvar instead of defparameter?
<dlowe>
right.
<dlowe>
when you reload the file, if the variable is already declared, it won't overwrite the value
fivo has quit [Quit: WeeChat 1.9.1]
t58 has joined #lisp
ludston has quit [Ping timeout: 245 seconds]
Folkol has joined #lisp
Achylles has quit [Remote host closed the connection]
<katco>
i'm packaging gsll for a linx distro called guix, and i'm running into an issue i don't understand. guix compiles packages using `asdf:compile-bundle-op`. gsll compiles just fine, but when i go to load it in sbcl, i get an `cffi::undefined-foreign-type-error`: "Unknown CFFI type :SIZET". any ideas?
<katco>
Xach: some searching suggests you ran into something similar in 2016 with quicklisp and cl-glu, but it looks like that was a compile-time
<katco>
same error though
igemnace has quit [Ping timeout: 250 seconds]
igemnace has joined #lisp
rumbler3_ has joined #lisp
cosimone has joined #lisp
edgar-rft has quit [Quit: Leaving]
rumbler31 has quit [Ping timeout: 244 seconds]
mindCrime has joined #lisp
FreeBirdLjj has joined #lisp
cranes has joined #lisp
hhdave has quit [Ping timeout: 250 seconds]
Folkol has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rumbler31 has joined #lisp
elderK has joined #lisp
dmiles has joined #lisp
rumbler3_ has quit [Ping timeout: 250 seconds]
<Josh_2>
I have :export in defpackage and am export two symbols "wait-to-play" and "setup-x-control" but this always says these functions are not external to to my package Q_Q https://plaster.tymoon.eu/view/1355#1355
<sjl_>
You're using strings in export, with the names in lowercase
<beach>
Josh_2: Are you sure you want them in lower case?
<Josh_2>
So It's case sensitive
<sjl_>
But by default, the lisp reader will uppercase symbols when it reads them. So the symbols you're trying to access in lines 22/23 are named "SETUP-X-CONTROL" and "WAIT-TO-PLAY"
<sjl_>
You're already using uninterned symbols for the package name and in the :use, you could just do the same for the :export list.
LiamH has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
<vms14>
since your lispers, can you give me some hint for bottom up design?
<vms14>
you're*
<vms14>
I have troubles while designing, and I guess with bottom up design will be easier than what I'm used to do
<Josh_2>
sjl_: yep I don't know much about the CL package system
<sjl_>
it takes a little while to get used to, but once you do it's pretty nice to work with. there are just a couple of annoying edge cases that newbies often hit.
<vms14>
The program I don't know how to design is some kind of forum with hunchentoot, to learn lisp and backend at same time
<Josh_2>
I'm just trying to use save-lisp-and-die and load a function that is in my package
<Josh_2>
or two
FreeBirdLjj has quit [Ping timeout: 244 seconds]
<Josh_2>
two functions and then go to top-level
<vms14>
I need to create some UI with frontend, but make some kind of api for the back
phoe has joined #lisp
<vms14>
bottom up design suggests start to creating functions like "create-post" "create-user" and go abstracting step by step?
<vms14>
or I should start at other place?
<Josh_2>
https://plaster.tymoon.eu/view/1356#1356 I have that file which is called save-image.lisp I load it in sbcl from term run (save) it produces the executable I use ./server it then returns instantly
<Josh_2>
doesn't do anything
<Josh_2>
That code isn't so correct, but even without the #'sb-impl it doesn't work *shrug*
<vms14>
Josh_2: yeah, that's all the info I'll find with google
<vms14>
I try to look for a tutorial or even a book
<vms14>
but nope
<Josh_2>
I learned CL as first language so bottom up is probably just what I do naturally
<Josh_2>
just like if u learned CPP as first language OO is probs how you think about a problem naturally
<p_l>
vms14: bottom up is where you start from small end pieces and string them together
<p_l>
vms14: top-down is when you start from the grand top level
<p_l>
I've seen both done with CL
<Josh_2>
functions on functions on functions :P
<p_l>
"Debugger-driven Development" is common case of top-down
<sjl_>
Josh_2: I'm not sure exactly what you're trying to do, but often people distribute binaries in CL by doing something like:
<sjl_>
1. Run Lisp on your machine. 2. Load all your code into that Lisp process with ASDF, Quicklisp, whatever.
<sjl_>
3. Use save-lisp-and-die with :toplevel 'mypackage:foo to produce a binary that will call the function mypackage:foo when it's run.
<sjl_>
mypackage:foo would initialize any variables/whatever that depend on the computer it's being run on, and then it would do the actual useful thing you want the program to do.
<vms14>
p_l: this is why I ask
<p_l>
vms14: I suspect environment that most visibly pushes you to bottom-up is Forth
<vms14>
as for a program that creates a forum, I should start by functions like "create-post" and go creating functions from that
<vms14>
?
<vms14>
and don't think about implementation until I'm on the step that needs to be implemented
<sjl_>
In your snippet, I don't know why you're calling (load-up) twice, the in-package isn't necessary and/or helpful, and I don't know why you're calling sb-impl
<Josh_2>
sjl_ that's what I'm trying, I'll will change to what you said one minute
<Bike>
i mixed up something obvious and string< doesn't work like i thought, so, is there an easy way to sort a list of strings in lexicographic order?
<Bike>
every char<, maybe
<dlowe>
wait, why doesn't string< work?
<phoe>
likely an implementation problem
<phoe>
which sounds logical since Bike is an implementor
<Bike>
no that's not it
<phoe>
oh
<Bike>
maybe i'm missing something stupid, sorry
<phoe>
Bike: let's start from scratch - why do you think string< doesn't work?
cage_ has joined #lisp
<Bike>
well, what i'm actually trying to do is sort a list of (symbol ...) by the symbols, by sorting the package first and then the symbol names
<Bike>
so i'm sorting with (or (string< (package-name (symbol-package s1)) (package-name (symbol-package s2))) (string< (symbol-name s1) (symbol-name s2)))
<Josh_2>
sjl_: okay that worked, but now my executable just shuts instantly, is there a function I can call to take my to the sbcl top-level?
<Bike>
but my results are uh, not sorted.
<sjl_>
Bike: you need to have another check for string< p2 p1 before you move on to compare the symbol names
<dlowe>
Bike: uh, you should only sort by name if packages are equal
selwyn has quit [Ping timeout: 276 seconds]
<Bike>
ohh
<dlowe>
or what sjl_ said
<Josh_2>
the function I call 'x-control:setup-x-control sets up the params and then calls the main function, however that function works in the background on seperate threads
<Bike>
yeah that makes sense. thanks. dumb indeed
<sjl_>
otherwise you get b:b < a:c
<Bike>
right, i see now
<sjl_>
at some point I wrote a compose-predicates-for-sorting function but I can't remember where I put it
<sjl_>
Josh_2: Your wait-to-play function doesn't... wait?
<dlowe>
sjl_: nice idea for a little utility
<Josh_2>
It does wait, but it waits in the background
<dlowe>
it would have been even better if SORT had taken multiple predicates
<dlowe>
but I don't think any language has that
<jdz>
You can SORT using one predicate, and then STABLE-SORT using the other?
<dlowe>
(also, they couldn't be simple predicates without some annoying duplication of effort
sjl_ has quit [Quit: WeeChat 2.3-dev]
sjl_ has joined #lisp
<sjl_>
Josh_2: Ah. Do you actually WANT the REPL, or do you just want the thing to not immediately exit?
<Josh_2>
I want the repl
<sjl_>
Then sb-impl::toplevel-init might work. Unfortunate that it's not exported/part of the public API
<Josh_2>
ah
<sjl_>
You can use it, you just don't get any promises from the SBCL folks that they won't rename it or change it in the future.
<Josh_2>
It would be nice if it just evaluated the :top-level function and went into repl :(
<sjl_>
Not if you don't WANT it to go into the REPL after. In your case you do, but for other programs you might not.
<sjl_>
I suppose you could make everyone that DOESN'T want the REPL call (sb-ext:exit :code 0) manually, rather than making the people who DO want the REPL call the REPL function.
<sjl_>
But, meh.
<Josh_2>
strawpoll! xD
<Josh_2>
It's working now though :) Thanks for the help everyone who chipped in
akovalenko has quit [Remote host closed the connection]
<Josh_2>
I'd have a functional phone computer mouse if I could get clx to click and unclick :(
hhdave has joined #lisp
makomo has joined #lisp
<pjb>
Josh_2: how is the *display* variable initialized?
<Josh_2>
pjb: It's now initialized using a function which is called at toplevel
<Josh_2>
:toplevel 'setup-x-control
warweasle has joined #lisp
<Josh_2>
that sets the values of *display* etc
<pjb>
and this setup-x-control calls the repl?
<Josh_2>
yes
<pjb>
ok.
<Josh_2>
when it is done
<pjb>
Then you should definitely debug why you get this Bad file descriptor error.
<Josh_2>
I don't get it anymore
<Josh_2>
Heres another question. CLX comes with a folder called "extensions" but the functions contained within aren't callable with (xlib:fake-motion-event ..) for example
<Josh_2>
how do I use these functions at my toplevel?
<katco>
then generates a new asd file to point to the `--system.fasl`, the `eval-when` in gsll never gets called. my question is: why does gsll load `:cffi-libffi` this way?
<Bike>
hm. no idea what this is doing. how odd.
<Bike>
it does use the actual class, though
<katco>
addendum: the `eval-when` only gets called when the `asdf:compile-bundle-op` is performed, but not on subsequent loads of the fasl, which is why there are no errors at compile-time, but there are at load-time
charh has quit [Ping timeout: 245 seconds]
<pjb>
katco: add print inside the eval-when, because it should run in all situations.
<Bike>
i don't think y ou're supposed to do that stuff in an .asd.
<katco>
pjb: i have a minimal test case, and it doesn't. gsll's asd file is out of the picture by the time the fasl is compiled, and a user or consumer system is loading the `--system.fasl`
<Nilby>
katco: I think software that uses cffi should define its own size-t type if it needs to and not use on the one in cffi-libffi
<karlosz>
there are lots of examples in art of mop
karlosz has quit [Quit: karlosz]
pjb has quit [Read error: Connection reset by peer]
<katco>
pjb: mind you, this is a unique property of how guix packages things. it has little to do with how this would work with say, quicklisp, which loads the original asd every time
<katco>
Nilby: i was reading some discussion around that, but alas, i am merely trying to package gsll, not modify it (atm)
<katco>
Bike: and yes, asdf's "best practices" doc says not to define code (let alone macros) in the asd. i am wondering what's behind that stance, and also why a package author would choose to rely on cffi-libffi in this manner and not through `:depends-on` or something
charh has joined #lisp
<katco>
why do this in an `eval-when`? what pattern am i ignorant of?
<Bike>
i think it's just genuinely weird
<Bike>
Nilby: an :around, even...
<katco>
if behavior is needed at runtime as it is with gsll, this breaks anything trying to deal in fasls, and not source
<katco>
Bike: in your experience, would this warrant filing an issue? i do see this "pattern" a lot. i wish someone could tell me why people use it. i'd like to understand it better.
<Bike>
it's weird enough that i'd at least expect a comment in the asd
<katco>
if it's so weird, why is it so prevalent?
<Bike>
i've never seen an eval-when asdf:oss in an asd before.
<Bike>
oos
<katco>
ah, it' the `oos` that makes it strange
<Bike>
actually i don't think i've seen an oos (or load-system, or etc) in an asd ever
charh has quit [Ping timeout: 246 seconds]
<Bike>
i mean you're like... defining the system and its dependencies right there
<katco>
yeah, that was what i thought
<Bike>
now the comment does mention needing cffi-grovel
bobby has joined #lisp
<Bike>
and you can see the asd does use that package and stuff
<Bike>
so there's a problem there
charh has joined #lisp
karlosz has joined #lisp
<katco>
i think `cffi-libffi` depends-on those
<katco>
i am assuming i'm missing some nuanced interplay between cffi and this package. liam is involved in both, and there was an email thread discussing the removing of `:sizet`
<Bike>
i mean, as the comment says, it loads cffi-grovel
<Bike>
and the asd itself uses cffi-grovel
<Bike>
there's defsystem-depends-on for that but i think it's difficult with the reader
nowhere_man has quit [Ping timeout: 246 seconds]
<katco>
LiamH: are you the author of gsll?
<LiamH>
katco: Yes
<LiamH>
and of cffi-libffi
beach has quit [Ping timeout: 258 seconds]
orivej has quit [Ping timeout: 244 seconds]
<katco>
LiamH: hi, thanks for the packages. i'm trying to package it into a linux distro called guix, and i was having some issues related to what we've been discussing
<LiamH>
sorry, not following the discussion
<katco>
LiamH: no worries. would you mind reading the last bit of backscroll, or would you like a summary?
<LiamH>
I've skimmed it but a summary would be good.
<katco>
LiamH: sure thing
karlosz has quit [Quit: karlosz]
beach has joined #lisp
vms14 has quit [Quit: WeeChat 2.3]
brundleticks has quit [Ping timeout: 246 seconds]
<katco>
basicaly, the way guix compiles/packages lisp systems is by doing an `asdf:compile-bundle-op` and then generating its own asd to point to the pre-compiled `--system.fasl`. this causes issues when there is functionality needed at runtime defined in systems' `.asd` files (as is the case with gsll). in this case, gsll compiles fine, but then if you try to use it, it errors saying cffi has no `:sizet`. as you know, this is because
<katco>
it's defined in `cffi-libffi` which is loaded in gsll's asd file, which guix doesn't see when loading the fasl.
<katco>
asdf's "best practices" doc says not to add code into the asd file, so i was wondering (1) why do packages do this (2) specifically why does gsll do this instead of specifying `cffi-libffi` as a dependency?
charh has quit [Ping timeout: 255 seconds]
<Xach>
katco: the best practices are recent and the system files were often written when there was no better option to accomplish certain goals.
igemnace has joined #lisp
<Xach>
i believe asdf has better ways to do things now but old system files are not always updated.
charh has joined #lisp
<Xach>
can't help with gsll, sorry
<katco>
Xach: thanks, that gives me a lot of context
<LiamH>
I am trying to recall exactly why it's done. As Xach says, it's been a while since I wrote that - about a decade.
<LiamH>
I haven't looked at the code in that time much either.
<katco>
no worries if the reasoning escapes you :) one of the reasons i love CL is that i can pick up libs written long ago, and they're still useful
<LiamH>
Without finding the reason yet, I'd say if there is now a better way to do this, I'm more than happy to make or pull the appropriate change(s).
<katco>
that would be great. unfortunately i don't know what the better way is as i'm unsure what this is trying to accomplish
<LiamH>
Here's what I remember, looking at my comment "loads cff[i]-grovel too, needed here": If I tried to make a dependency, even :defsystem-depends-on (which is set), it would not get the grovel code.
<LiamH>
I found the only way to make it work was to put the explicit load of cffi-libffi.
<LiamH>
To get the groveling code.
<katco>
ah, maybe this is a work-around for a bug that's been fixed?
<LiamH>
I don't know. I don't know if it's a bug or even where the bug would be (ASDF?).
<sjl_>
Seems worth trying to move it into a defsystem-depends-on and see if it still works
<katco>
guix has facilities to modify code before compiling; let me try that ^ on my end, and i'll ping you?
<LiamH>
Well the defsystem-depends-on is already there. So just try removing the eval-when and see what happens.
idlus has quit [Ping timeout: 256 seconds]
sauvin has quit [Read error: Connection reset by peer]
<katco>
i don't see a clause for `:cffi-libffi` which is what i think contains `:sizet`
<katco>
i think gsll needs to depend on that... i think.
<LiamH>
OK maybe add that to the d-d-o
<katco>
yeah, trying that now
<LiamH>
But I think cffi-grovel has a dependency on cffi-libffi.
<katco>
an aside: i love the internet. ty for responding!
<LiamH>
If it's a CFFI question, luis is the keeper and he would know best.
pankajgodbole has quit [Ping timeout: 268 seconds]
karlosz has joined #lisp
edgar-rft has joined #lisp
anewuser has quit [Ping timeout: 246 seconds]
cage_ has quit [Remote host closed the connection]
Lord_of_Life has quit [Ping timeout: 245 seconds]
lumm has quit [Read error: Connection reset by peer]
lumm_ has joined #lisp
lumm_ is now known as lumm
Lord_of_Life has joined #lisp
v88m has quit [Quit: Quit]
v88m has joined #lisp
cosimone has quit [Quit: WeeChat 2.3]
lumm has quit [Remote host closed the connection]
lumm has joined #lisp
lumm has quit [Client Quit]
idlus has joined #lisp
lumm has joined #lisp
gravicappa has quit [Ping timeout: 255 seconds]
charh has quit [Ping timeout: 258 seconds]
Jesin has quit [Quit: Leaving]
<p_l>
... I want an ETL tool in Lisp
<p_l>
If I see SSIS one more time I'm going to get ill
<p_l>
phoe: pretty much what pgloader does, except more generic
kajo has joined #lisp
v88m has quit [Ping timeout: 250 seconds]
v88m has joined #lisp
cyberoctopi has quit [Remote host closed the connection]
<Nilby>
p_l: as a programmer I used clsql as an ETL tool, but I had to write the transform part myself. ETL tools are mostly GUI to write what would be a function. Unfortunately it's hard to have non-programmers do your data cleaning for you, if you don't make them a GUI.
gigetoo has quit [Ping timeout: 258 seconds]
pjb has joined #lisp
cosimone has joined #lisp
gigetoo has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
karlosz has quit [Remote host closed the connection]
<Nilby>
Unfortunately, years later, the ETL got outsourced to a bank who did a crap version in SSIS or something :( , probably because nobody could understand WTF I was doing in Lisp.
<p_l>
that's one part of it, another is that the bank probably outsourced it to idiots who made crappiest SSIS possible
<Nilby>
yes indeed
vlatkoB has quit [Remote host closed the connection]
cosimone has quit [Quit: WeeChat 2.3]
karlosz has joined #lisp
defunkydrummer has joined #lisp
<defunkydrummer>
p_l, Nilby -- just logged in here to say that I can feel your pain sirs
<defunkydrummer>
i have also seen the horrible SSIS packages unexperienced people create when given the tool
<defunkydrummer>
"ETL tools are mostly GUI to write what would be a function" --> Basically, this.
<p_l>
GUI isn't the bad part
<defunkydrummer>
now you have tools like Alteryx, in which an inexperienced person, after receiving a full course in Alteryx, can be able to create in a full one or two hours of clicking and clicking through menus, the equivalent to a few dozen lines Python script.
<defunkydrummer>
yours only for about $15000 a year, but "look ma, no coding needed!"
<p_l>
defunkydrummer: for what its worth, that few hundred lines of python better not have cpu-bound points
<p_l>
defunkydrummer: since that day, I viscerally hate PyEval_FrameEx
<stylewarning>
cool spanish comments
<defunkydrummer>
stylewarning sorry, i created the Gist quickly to give it to iarebatman
<defunkydrummer>
didn't have time to rewrite the comments
igemnace has quit [Read error: Connection reset by peer]
<stylewarning>
defunkydrummer: I'm cool with spanish comments
<stylewarning>
i welcome more
<defunkydrummer>
iarebatman: "TELL ME NOW SLAVE BOT"---> rofl!! So, why do you need to create plists that are so nested?
<defunkydrummer>
@sty
<stylewarning>
defunkydrummer: let's write a new quicklisp library where everything is written in spanish
<iarebatman>
Oh I don’t, I’m trying to pull values out of some parsed json
<defunkydrummer>
stylewarning: i'd better write some lyrics and you can add music to them in your brand new yamaha SK-7
<iarebatman>
And I’m new to CL, with a tiny bit of Clojure experience - so their get-in macro came to mind
cosimone has joined #lisp
<stylewarning>
defunkydrummer: Shigeru Kawai, not Yamaha!
<defunkydrummer>
stylewarning: or we can create in spanish, a ML dialect embedded in common lisp, and call it "TONELADA DE CARBON"
igemnace has joined #lisp
<stylewarning>
defunkydrummer: haha
<defunkydrummer>
awww sorry!! SK is a line of yamaha synths, my brain played neural network jokes on me
<stylewarning>
. . . or should I say, jaja
<defunkydrummer>
spanish is my native language, i'm from <redacted out>, same city as PuercoPop
<defunkydrummer>
so, iarebatman , welcome to the wonderful world of Common Lisp, now with 100% less underlying Java
idlus_ has joined #lisp
<defunkydrummer>
stylewarning plz contribute more memes to LispMemes, it's a moral imperative to satisfy the hunger of the Lambda Calculus gods. I admit the quality of my own memes have declined a bit.
<iarebatman>
That’s definitely a huge plus in my book - I was ecstatic when I discovered CL was actually still used by people and that I could build native executables with it!
<Xach>
it's hard to get motivated for it when you have to make memes all day for work
<defunkydrummer>
iarebatman: if you check the (english) documentation of "getf*", you'll see it will also pick up lists of plists, which is useful.
igemnace has quit [Read error: Connection reset by peer]
<stylewarning>
defunkydrummer: i've had some good meme ideas brewing
* defunkydrummer
green of envy of Xach's job
<stylewarning>
defunkydrummer: i'm giving a lisp talk at a julia meetup saturday so i need to prep some
idlus has quit [Ping timeout: 256 seconds]
<phoe>
Xach: we at /r/lispmemes would like to hire you, what's your hourly rate
<iarebatman>
Thank you for the gist defunkydrummer, I will have to take a look later tonight when I get to work on my personal stuff
<defunkydrummer>
iarebatman : yes, however note that modern lisp implementations are going to compile your functions to machine language anyways, so you'll get no speedups when producing an executable. In other words, if you are looking for creating an executable only for a potential speedup, it isn't needed at all.
<defunkydrummer>
you're welcome
<defunkydrummer>
phoe: Xach doesn't know the benefits of our job compensation plan: 1. Free Space Cadet Keyboard
cosimone has quit [Ping timeout: 250 seconds]
<defunkydrummer>
2. Unlimited ACL and LW licenses
<defunkydrummer>
3. your own Snoopy Line Printer calendar for the year 1969
<iarebatman>
Naw, I simply enjoy being able to hand a stand-alone executable to someone that they can run without a bunch of dependencies
<defunkydrummer>
iarebatman: yes, but note that the dependencies will "be there" in the form of a gigantic executable size
nowhere_man has joined #lisp
<iarebatman>
I ran “strip” on my buildapp test and it was around 200KB. That seemed reasonable to me
<defunkydrummer>
because they will need to be loaded in the Lisp image for your system to work. When producing the executable, this effectively means embedding that image into the executable. Unless you use an implementation like Embedded Common Lisp (ECL) which is able to do all kinds of magic.
<katco>
LiamH: well, it appears as though as of asdf v3.2, `:defsystem-depends-on` does not do what we think it should do in this case. it can't find `CFFI-GROVEL` despite it being in `XDG_DATA_DIRS`: "READ error during LOAD: Package CFFI-GROVEL does not exist."
cosimone has joined #lisp
<defunkydrummer>
iarebatman : which lisp implementation were you using?
<Bike>
it probably tries to read the defsystem form.
<iarebatman>
SBCL
<Bike>
which will error immediately, since the package doesn't exist
<Bike>
so it doesn't even get to the point of finding the defsystem depends on
<defunkydrummer>
SBCL and you got 200KB? ummm are you from the future? tell us, did we solve global warming?
<iarebatman>
.....let me double check my work - sec
<katco>
i can correct my guix package by also specifying `:cffi-libffi` in the `depends-on` clause, but i remain unsure what the correct way to do something like this is...
<defunkydrummer>
although i havent "stripped" a binary before. I rather stay with my clothes on.
<katco>
Bike: any ideas? heh
<Bike>
sorry, i'm only good at identifying problems.
<dlowe>
it seems likely that "strip" doesn't recognize the lisp code and removes it entirely
<dlowe>
leaving only the runtime
<dlowe>
which is about 200k
<katco>
Bike: haha :)
<Bike>
oh, hang on...
warweasle has quit [Quit: meh]
<defunkydrummer>
stylewarning : good luck with your talk sir!
<defunkydrummer>
@dlowe
<Bike>
trying to understand the asdf manual... it might say that you can just have :grovel-file instead of cffi-grovel:grovel-file
<katco>
someday i will understand how asdf works :|
<defunkydrummer>
dlowe: good grief...
<stylewarning>
defunkydrummer: I think I'm just going to sit there projecting emacs saying "this is how you debug problems in lisp, maybe u should consider this in julia"
<iarebatman>
yup - so great news - it DOES reduce my 38MB hello world CL program down to about 270KB
<iarebatman>
it just doesn't actually work afterwards
<iarebatman>
minor problems
<Bike>
or maybe it has to be in the asdf package...?
<phoe>
minor yeah
<defunkydrummer>
stylewarning: it would be nice if Julia was a pathway drug to Common Lisp... "if you like Julia, you'll love CL. It will make you feel like Rick James"
<katco>
iarebatman: i recall having success with `:compress` options in sbcl. ~1-2MiB binaries i think? been awhile
<Bike>
i'm going to hope the code is right and the text is wrong
<stylewarning>
defunkydrummer: unfortunately, given that it's Literally Impossible (TM) to interactively plot data in Lisp, and it's Literally Impossible (TM) to do any real world linear algebra, nobody in the Julia community will be converting to Lisp. :[
<katco>
Bike: hm maybe! there is a non-zero chance LiamH wrote that though haha
<katco>
stylewarning: is that a joke?
<phoe>
stylewarning: the only thing that's literally impossible in Common Lisp is fitting it on a microcontroller
lumm has quit [Ping timeout: 258 seconds]
lumm_ is now known as lumm
<iarebatman>
sigh - well 38MB files aren't awesome for sure - I thought I had hit the jackpot here. you guys sorta bummed me out and now I'm a sad panda =/
<defunkydrummer>
iarebatman : if you are looking for small binaries, don't use SBCL. I mean, you can reduce the binary size by enabling compression when using save-lisp-and-die. If smaller binaries are required, CLISP produces smaller ones. If ultimate small binaries are required, ECL will compile your Lisp code to C and can produce reasonable sizes. Or if you hav
<defunkydrummer>
e money you can use LispWorks which has a tree shaker.
<defunkydrummer>
not that LispWorks is too expensive, though
<phoe>
the rest is a matter of the Borg^W^W absorbing enough of the other paradigms to be able to emulate them
<stylewarning>
katco: Well the capitalization and TM were sort of jokes, but right now, Lisp isn't suitable for the kind of thing the usual scientific programmer wants to do.
<dlowe>
iarebatman: the nice thing is that if you make a huge app, it probably will only bump it up a few MB
<katco>
stylewarning: i am literally working on this right now haha
<phoe>
but yes, I see the point. (The one with the linear algebra.)
<stylewarning>
katco: what parts?
<MichaelRaskin>
Also, there are some things that are cleaner in Julia from the language point of view
<katco>
stylewarning: data analysis "things" in CL
<defunkydrummer>
wow, thought linear algebra was already covered in some CL libs
<MichaelRaskin>
Like uniformlu generic everything.
<stylewarning>
defunkydrummer: it's all half-baked and not good
<dlowe>
I should try writing an sbcl tree shaker
<katco>
stylewarning: i definitely got matplot histograms out on my first day of trying. i'm working with linear algebra and data science libs right now
<stylewarning>
defunkydrummer: even MAGICL, which was supposed to be good, just hasn't had the time to actually be good.
<katco>
stylewarning: have you looked at gsll? cl-ana?
<defunkydrummer>
stylewarning the other hand... and i'm going to be a SmugLispWeenie here, if suddenly CL had the same support for "data analysis" and "data science" as Python, we would have a huge influx of people adding very low quality libraries to the ecosystem. Which is what is happening with Python now.
<stylewarning>
katco: well if you want to chat/want guidance/collaborate/etc., i'd be happy to
saravia has quit [Remote host closed the connection]
<defunkydrummer>
dlowe: please call the function "shake-shake-shake" like the LW guys did, or "shake-yer-booty". Or you can call the project: SHEIK YERBOUTI
<katco>
stylewarning: i would definitely be interested in chatting and or guidance. i'm using CL to learn data science and ML stuff
<iarebatman>
I mean that makes me feel just about as icky as bundling up a node project or a python project with virtualenv and a bunch of deps. I guess at least in this case there are possible solutions..
<stylewarning>
katco: it provides relatively no-nonsense bindings to BLAS/LAPACK and another fortran lib called expokit for matrix logarithms and exponentiation
techquila has quit [Remote host closed the connection]
<stylewarning>
katco: but the high-level library part of it is really poor and lacking, and deserves to be redesigned. There's also a decent einsum macro.
<defunkydrummer>
dlowe: don't measure binary size by using "hello world" programs, that doesn't make too much sense. Considering that CL is able to generate code and compile it at runtime, for a complex program, or even a slightly complex/big program, binary sizes will be totally alright.
<dlowe>
defunkydrummer: it establishes a minimum bound
<katco>
stylewarning: cool. i'm not really in a position to comment on utility yet as i'm just starting out. my focus is ML stuff
<katco>
stylewarning: and my immediate focus is data exploration prior to building a ML model. cl-ana seemed like a good fit for that
<iarebatman>
yay my CL book came in: Common Lisp: A Gentle Introduction to Symbolic Computation
<phoe>
ooh, gentle
<phoe>
it's a good book, especially for people who have not programmed before at all
<phoe>
in case you have programmed, it might be a little bit too gentle - but let's see what you think after the first few chapters
<defunkydrummer>
dlowe: It doesn't make sense for practical purposes. Nobody uses a language like Lisp for "hello world" programs. If your goal is the ultimate small hello world, you just create a shell script that prints Hello World. Or use assembly language to put "Hello World" in a memory location and jump to the OS function that prints it out... In any case, y
<defunkydrummer>
ou CAN do a small hello world in Lisp by using Embeddable Common Lisp (ECL), which will compile it to C and then produce the binary.
<phoe>
by the time it comes to deployment we're already doing docker shit that weighs hundreds of megabytes in total
<defunkydrummer>
phoe: yes, it was too gentle for me. I wanted to be a macho man.
* defunkydrummer
endorses what phoe says
<phoe>
so by then no one really cares if my hello world is 40kB or 40MB
<phoe>
welcome to the age of modern containerization and so on
<defunkydrummer>
... and to the eventual death of the conventional operating systems
<phoe>
but that's already #lispcafe material
<dlowe>
defunkydrummer: I didn't say it was practical
<defunkydrummer>
wow, joining lispcafe then
igemnace has joined #lisp
<defunkydrummer>
dlowe : fair. But IMO that test would only show the size of the runtime and the presence/absence of a tree shaking mechanism
<dlowe>
and the quality of the tree shaking mechanism
<defunkydrummer>
exactly
<defunkydrummer>
for measuring that, then it's a good test
defunkydrummer has left #lisp [#lisp]
defunkydrummer has joined #lisp
lumm has quit [Quit: lumm]
lumm has joined #lisp
orivej has joined #lisp
lavaflow_ has quit [Read error: Connection reset by peer]
lavaflow_ has joined #lisp
<stylewarning>
dlowe: to be clear, there shouldn't be a magical tree shaker, there are tradeoffs to what gets shaken out
karlosz has quit [Quit: karlosz]
<Xach>
shouldn't??
<Xach>
after the success of DWIM?
gxt has joined #lisp
cosimone has quit [Quit: WeeChat 2.3]
nowhere_man has quit [Ping timeout: 257 seconds]
cosimone has joined #lisp
cosimone has quit [Client Quit]
cosimone has joined #lisp
spoeplau has joined #lisp
<aeth>
Am I being naive if I store an immutable graph like this? 1 <-> 2 <-> 3 and 1 <-> 4 would be #(2 4 1 3 2 1) and #2A((0 1) (2 3) (4 4) (5 5)) where the 1D array is the connections and the 2D array is essentially the key that says what range the (n+1)th element is in (since the graph here starts with 1)
<aeth>
I'm not using lists because of random access, e.g. I can look up an item (and there might be thousands) as (subseq connections (aref range (1- item) 0) (aref range (1- item) 1))
<aeth>
(Except subseq is probably unnecessary in every actual use because most sequence functions have a start and an end, which is why I'd be storing the start and end)
defunkydrummer has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
anewuser has joined #lisp
vms14 has joined #lisp
<grewal>
aeth: why do you need two arrays instead of one? You can just store the nodes each node is connected to. Using your example, something like #(#(2 4) #(1 3) #(2) #(1))
<vms14>
why I need to specify :initform nil if I want to push later to that slot?
<vms14>
(defclass meh () ((oh :accessor oh))) this won't let me push on this slot unless I put :initform nil
<vms14>
so they're unbound unless I initialize them
<vms14>
I thought they were initialized to nil
<vms14>
but not, and it's an error to access unbound symbols
<vms14>
so then I should put :initform nil to all slots im not sure if will be initialized?
random-nick has quit [Read error: Connection reset by peer]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
lucasb has quit [Quit: Connection closed for inactivity]
caltelt has joined #lisp
Bike has joined #lisp
lumm has quit [Quit: lumm]
X-Scale has quit [Ping timeout: 246 seconds]
<aeth>
grewal: You can't, rows have to be the same length. I could pad it with -1s (or 0s, if I keep them starting at 1) but then I wouldn't know where they end ahead of time
<aeth>
grewal: It would also be better to use fake 2D arrays rather than actual 2D arrays, so sequence operations could be used with start/end.
<aeth>
so e.g. with a max length of 10, pad the rest out.
<no-defun-allowed>
vms14: Slots by default are unbound, not bound to NIL.
<no-defun-allowed>
NIL-initalisation might be from defstruct from memory.
<vms14>
no-defun-allowed: so defstruct initializes to nil?
<aeth>
vms14: Initform NIL or (error "The slot foo requires an argument)
<vms14>
then I'll just put initform nil to everything and prevent future errors
<aeth>
s/argument/argument"/
<no-defun-allowed>
From what I remember, yes, but don't just use defstruct for that.
wigust- has joined #lisp
<vms14>
tnx <3
ltriant has joined #lisp
wigust has quit [Ping timeout: 258 seconds]
kajo has joined #lisp
LiamH has quit [Quit: Leaving.]
<grewal>
aeth: I didn't use #2a. It's a vector of vectors, not a multi-dimensional array. Ultimately, the two approaches are probably the same under-the-hood, but your approach just seems a bit oblique
<aeth>
grewal: oh I see you didn't use #2A
<aeth>
grewal: I don't think I really see arrays-of-arrays in CL
<Bike>
defstruct does not initialize to nil. it's undefined, which is worse than defclass, because if you read an uninitialized structure slot anything could happen
<aeth>
grewal: I think my solution scales better because two specialized arrays are going to be more efficient than a T array of specialized arrays because the GC will afaik have to iterate through the T array, but not the two specialized arrays.
terpri has quit [Remote host closed the connection]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
torbo has joined #lisp
<White_Flame>
aeth: more efficient would be to ensure the GC isn't triggered often, and use the most appropriate data structure regardless of its latency effect on GC
<White_Flame>
you're going to be traversing it a ton more than the GC is
<White_Flame>
(if this is a performance bound situation)
cosimone has quit [Ping timeout: 276 seconds]
<vms14>
White_Flame: would be the gc a thing to worry about in a game?
<White_Flame>
_triggering_ the GC is generally a worry there
<White_Flame>
microoptimizing the length of a GC cycle woldn't be
<White_Flame>
especially if this stuff isn't going to be in the nursery anyway
<vms14>
so the way is try to control when the gc is triggered and minimize as possible the work of the gc
<vms14>
how would you do that?
<aeth>
vms14: by not allocating
<White_Flame>
reuse buffers
<aeth>
vms14: of course you can't actually not allocate, so it's more choosing where to allocate... so preallocate
<vms14>
but everytime you use let, you're adding work to the gc, not?