freenode/#lisp - IRC Chatlog
Search
12:00:57
no-defun-allowed
That's definitely good practice, since then users can subclass those classes and create them dynamically.
12:01:34
pjb
fivo: you cannot export classes in lisp from anything (in the CL standard; you can always invent your own concepts).
12:03:07
fivo
ok, so it's no possible to just export the symbol of a class and have access to all the readers/writers
12:03:34
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.
12:04:26
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.
12:05:02
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.
12:05:54
pjb
fivo: and yes, you get to choose the precise list of accessors you want to export. Some accessors may be "private".
12:07:19
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.
12:11:17
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)
12:32:52
selwyn
fivo: you may be interested in cl-annot https://github.com/m2ym/cl-annot#annotation-export-accessors which provides this functionality with read macros
12:33:44
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".
12:34:31
beach
fivo: Yes, very good reasons. You almost never want to do that, so the functionality is fairly limited.
12:35:30
_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))))
12:36:23
_death
you should think about the external interface first, instead of automatically exporting symbols
12:37:47
p_l
fivo: also, package nicknames, and available in some systems package-local-nicknames, allow you nice shortnames that help with things
12:38:15
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/
12:39:10
p_l
Josh_2: it's good to think on external interface, including which symbols need to be qualified
12:39:22
beach
There is no problem exporting names of classes, especially if you want client code to be able to subclass, define :AROUND methods, etc.
12:40:15
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.
12:41:52
beach
Josh_2: The stuff you want to present to client code. Called API or Interface in other contexts.
12:43:58
beach
Josh_2: There is no problem. If your symbol names something that is part of the protocol, then export it, otherwise not.
12:48:50
Nilby
_death: lol, I think I need to make the whole thoughtfull-* suite, especially thoughtfull-defsystem, and thoughtfull-setf
12:55:57
_death
you can also add (unless (documentedp symbol) (setf (docstring symbol) (prompt "Please enter documentation for ~S:" symbol)))
13:18:05
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.
13:23:36
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.
13:24:28
pjb
_death: (unless (documentation symbol t) (setf (documentation symbol t) (prompt "Please enter documentation for ~S:" symbol)))
13:25:44
beach
pjb: I know what you mean, but it is better to use the established terminology, i.e. standard object.
13:49:18
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.
13:51:45
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))
13:56:29
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)
14:02:53
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
14:04:30
Josh_2
Well I have an app that I have made and I tried to dump the image but it isn't functioning properly
14:05:20
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
14:05:30
iarebatman
Josh_2: I'm definitely no expert in CL, but I was able to easily build a native executable with buildapp
14:09:25
Xach
Josh_2: the commercial implementations have guides to deployment/delivery but they don't directly apply to other implementations
14:12:30
fivo
iarebatman: If you want to parse json, you might want to look at https://github.com/hanshuebner/yason
14:13:06
Josh_2
with buildapp I specify the location of the --asdf-path and then name the package I created with --load-system ?
14:13:38
Xach
Josh_2: --load-system is for loading systems - systems usually load files that define packages.
14:17:42
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.
14:19:51
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
14:22:55
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.
14:26:46
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
14:27:35
Josh_2
because when I move my fingers on my android screen, normally repl spews tons of output :P
14:29:14
Xach
Josh_2: i don't think there is a general guide, just practice and troubleshooting, sorry.
14:29:23
Josh_2
Xach when I finish eating I will demonstrate how I create the image etc and what happens
14:48:16
Josh_2
Actually the networking seems to be working I'm not sure, my phone clearly connects but the move-mouse function isn't moving my mouse
14:53:00
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
14:57:29
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?
15:00:57
dlowe
when you reload the file, if the variable is already declared, it won't overwrite the value
15:08:30
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?
15:11:15
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
15:46:03
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
15:48:32
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"
15:50:16
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.
15:58:00
vms14
I have troubles while designing, and I guess with bottom up design will be easier than what I'm used to do
15:59:29
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.
15:59:33
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
16:01:21
vms14
bottom up design suggests start to creating functions like "create-post" "create-user" and go abstracting step by step?
16:02:12
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
16:03:52
Josh_2
vms14: http://dept-info.labri.fr/~strandh/Teaching/PFS/Common/Strandh-Tutorial/bottom-up-programming.html
16:06:05
Josh_2
just like if u learned CPP as first language OO is probs how you think about a problem naturally
16:08:09
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:
16:08:11
sjl_
1. Run Lisp on your machine. 2. Load all your code into that Lisp process with ASDF, Quicklisp, whatever.
16:08:13
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.
16:08:15
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.
16:08:49
vms14
as for a program that creates a forum, I should start by functions like "create-post" and go creating functions from that
16:09:37
vms14
and don't think about implementation until I'm on the step that needs to be implemented
16:09:46
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
16:22:10
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?
16:25:29
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
16:25:56
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)))
16:26:06
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?
16:26:31
sjl_
Bike: you need to have another check for string< p2 p1 before you move on to compare the symbol names
16:27:09
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
16:28:23
sjl_
at some point I wrote a compose-predicates-for-sorting function but I can't remember where I put it
16:30:51
dlowe
(also, they couldn't be simple predicates without some annoying duplication of effort
16:32:37
sjl_
Josh_2: Ah. Do you actually WANT the REPL, or do you just want the thing to not immediately exit?
16:35:21
sjl_
Then sb-impl::toplevel-init might work. Unfortunate that it's not exported/part of the public API
16:36:35
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.
16:37:11
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.
16:39:22
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.
16:43:04
Josh_2
I'd have a functional phone computer mouse if I could get clx to click and unclick :(
16:55:51
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
16:56:30
sjl_
Bike: dlowe: from memory I think it was something like this https://plaster.tymoon.eu/view/1357#1357
16:59:25
dlowe
if you have a comparison return :< :> or := then you could compose them much more efficiently
17:53:02
pjb
Bike: one instance in quicklisp: ~/quicklisp/dists/quicklisp/software/mcclim-20190307-git/Libraries/ESA/utils.lisp:460:(defmethod make-instance ((class modual-class) &rest initargs)
17:55:00
katco
i think i've found my issue, but i'd appreciate some discussion! `:cffi-libffi` is the system which contains the `(defctype :sizet size-t)` [here](https://github.com/cffi/cffi/blob/master/libffi/funcall.lisp#L130-L132). this system is only loaded when gsll's asd file is loaded [here](https://gitlab.common-lisp.net/antik/gsll/blob/master/gsll.asd#L21-22). because guix performs a `asdf:compile-bundle-op` to generate a fasl, and
17:55:01
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?
17:58:02
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
18:00:08
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`
18:00:09
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
18:01:47
Nilby
Bike: https://github.com/johanlindberg/lisa.git uses the defmethod of make-instance trick
18:02:08
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
18:02:34
katco
Nilby: i was reading some discussion around that, but alas, i am merely trying to package gsll, not modify it (atm)
18:04:18
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
18:06:35
katco
if behavior is needed at runtime as it is with gsll, this breaks anything trying to deal in fasls, and not source
18:08:00
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.
18:11:37
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`
18:14:15
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
18:14:56
katco
LiamH: no worries. would you mind reading the last bit of backscroll, or would you like a summary?
18:17:54
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
18:17:54
katco
it's defined in `cffi-libffi` which is loaded in gsll's asd file, which guix doesn't see when loading the fasl.
18:19:36
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?
18:20:11
Xach
katco: the best practices are recent and the system files were often written when there was no better option to accomplish certain goals.
18:20:35
Xach
i believe asdf has better ways to do things now but old system files are not always updated.
18:21:26
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.
18:22:28
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
18:23:19
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).
18:24:52
sjl_
this is the commit that introduced the eval-when. Commit message doesn't mean a lot to me, but maybe it can jog LiamH's memory :) https://gitlab.common-lisp.net/antik/gsll/commit/121e475d13f2bb854a9a9dc35d615f8402bc7647
18:25:02
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
18:25:24
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.
18:27:15
katco
guix has facilities to modify code before compiling; let me try that ^ on my end, and i'll ping you?
18:27:26
LiamH
Well the defsystem-depends-on is already there. So just try removing the eval-when and see what happens.
19:23:30
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.
19:33:38
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.
19:34:52
p_l
that's one part of it, another is that the bank probably outsourced it to idiots who made crappiest SSIS possible
19:46:52
defunkydrummer
i have also seen the horrible SSIS packages unexperienced people create when given the tool
19:47:26
defunkydrummer
"ETL tools are mostly GUI to write what would be a function" --> Basically, this.
19:48:38
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.
19:49:59
p_l
defunkydrummer: for what its worth, that few hundred lines of python better not have cpu-bound points
19:50:35
defunkydrummer
minion: memo to iarebatman: you wanted a function to traverse nested property-lists (plists). I have one here: https://gist.github.com/defunkydrummer/011c66f40a52977c2b33a1671bd5af0c. Enjoy.
19:51:03
p_l
defunkydrummer: I had to babysit a script once which was technically a transform script from pcap to CSV
19:51:16
minion
iarebatman, memo from defunkydrummer: you wanted a function to traverse nested property-lists (plists). I have one here: https://gist.github.com/defunkydrummer/011c66f40a52977c2b33a1671bd5af0c. Enjoy.
19:53:55
defunkydrummer
iarebatman: "TELL ME NOW SLAVE BOT"---> rofl!! So, why do you need to create plists that are so nested?
19:54:10
stylewarning
defunkydrummer: let's write a new quicklisp library where everything is written in spanish
19:55:08
defunkydrummer
stylewarning: i'd better write some lyrics and you can add music to them in your brand new yamaha SK-7
19:55:11
iarebatman
And I’m new to CL, with a tiny bit of Clojure experience - so their get-in macro came to mind
19:55:35
defunkydrummer
stylewarning: or we can create in spanish, a ML dialect embedded in common lisp, and call it "TONELADA DE CARBON"
19:56:00
defunkydrummer
awww sorry!! SK is a line of yamaha synths, my brain played neural network jokes on me
19:56:31
defunkydrummer
spanish is my native language, i'm from <redacted out>, same city as PuercoPop
19:57:40
defunkydrummer
so, iarebatman , welcome to the wonderful world of Common Lisp, now with 100% less underlying Java
19:59:24
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.
19:59:53
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!
20:00:20
defunkydrummer
iarebatman: if you check the (english) documentation of "getf*", you'll see it will also pick up lists of plists, which is useful.
20:01:03
stylewarning
defunkydrummer: i'm giving a lisp talk at a julia meetup saturday so i need to prep some
20:01:49
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
20:02:06
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.
20:02:47
defunkydrummer
phoe: Xach doesn't know the benefits of our job compensation plan: 1. Free Space Cadet Keyboard
20:03:14
iarebatman
Naw, I simply enjoy being able to hand a stand-alone executable to someone that they can run without a bunch of dependencies
20:03:47
defunkydrummer
iarebatman: yes, but note that the dependencies will "be there" in the form of a gigantic executable size
20:04:35
iarebatman
I ran “strip” on my buildapp test and it was around 200KB. That seemed reasonable to me
20:04:41
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.
20:04:44
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."
20:05:32
defunkydrummer
SBCL and you got 200KB? ummm are you from the future? tell us, did we solve global warming?
20:06:01
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...
20:06:42
defunkydrummer
although i havent "stripped" a binary before. I rather stay with my clothes on.
20:08:16
Bike
trying to understand the asdf manual... it might say that you can just have :grovel-file instead of cffi-grovel:grovel-file
20:08:29
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"
20:10:19
iarebatman
yup - so great news - it DOES reduce my 38MB hello world CL program down to about 270KB
20:10:42
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"
20:10:53
Bike
https://common-lisp.net/project/cffi/manual/html_node/Groveller-ASDF-Integration.html okay now THIS should be helpful, katco
20:11:16
katco
iarebatman: i recall having success with `:compress` options in sbcl. ~1-2MiB binaries i think? been awhile
20:11:53
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. :[
20:12:36
phoe
stylewarning: the only thing that's literally impossible in Common Lisp is fitting it on a microcontroller
20:12:37
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 =/
20:12:44
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
20:12:57
phoe
the rest is a matter of the Borg^W^W absorbing enough of the other paradigms to be able to emulate them
20:13:00
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.
20:13:05
dlowe
iarebatman: the nice thing is that if you make a huge app, it probably will only bump it up a few MB
20:13:34
MichaelRaskin
Also, there are some things that are cleaner in Julia from the language point of view
20:14:24
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
20:14:33
stylewarning
defunkydrummer: even MAGICL, which was supposed to be good, just hasn't had the time to actually be good.
20:14:48
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.
20:14:50
stylewarning
katco: well if you want to chat/want guidance/collaborate/etc., i'd be happy to
20:15:01
phoe
dlowe: brief googling tells me https://gist.github.com/burtonsamograd/f08f561264ff94391300
20:15:27
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
20:15:38
katco
stylewarning: i would definitely be interested in chatting and or guidance. i'm using CL to learn data science and ML stuff
20:15:38
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..
20:16:02
stylewarning
dlowe: phoe: We used a more "up to date" version of this before... See %ZAP-INFO: https://github.com/rigetti/quilc/blob/master/app/src/impl/sbcl.lisp
20:16:31
defunkydrummer
iarebatman the situation in CL doesn't get remotely close to the horrible mess that is the NPM module system.
20:17:38
defunkydrummer
stylewarning uses windows!! suddenly i don't feel alone!! We're two now, two!!!
20:17:58
stylewarning
defunkydrummer: no, i just have to build our sdk on windows, which is housed in some VM somewhere :[
20:19:19
stylewarning
katco: it provides relatively no-nonsense bindings to BLAS/LAPACK and another fortran lib called expokit for matrix logarithms and exponentiation
20:19:45
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.
20:20:06
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.
20:20:30
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
20:21:02
katco
stylewarning: and my immediate focus is data exploration prior to building a ML model. cl-ana seemed like a good fit for that
20:21:30
iarebatman
yay my CL book came in: Common Lisp: A Gentle Introduction to Symbolic Computation
20:22:16
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
20:22:21
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
20:22:21
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.
20:22:53
phoe
by the time it comes to deployment we're already doing docker shit that weighs hundreds of megabytes in total
20:28:59
defunkydrummer
dlowe : fair. But IMO that test would only show the size of the runtime and the presence/absence of a tree shaking mechanism
20:50:11
stylewarning
dlowe: to be clear, there shouldn't be a magical tree shaker, there are tradeoffs to what gets shaken out
21:25:15
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)
21:29:41
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))
21:31:08
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)
22:33:22
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))
22:37:28
vms14
(defclass meh () ((oh :accessor oh))) this won't let me push on this slot unless I put :initform nil