freenode/lisp - IRC Chatlog
Search
7:56:48
beach
Work is going fine, thank you. I am currently preparing my slides for the ELS talk. And yes, I work every day for around 10-12 hours.
8:02:51
saganman
Yeah, it is brought by people and government with their carelessness. Anyway you work relentlessly beach
8:04:31
beach
saganman: I think most researchers work all the time. One can't just turn the brain off.
8:20:33
remby
what is a lisp image? I know it's a binary that holds the interpreter, but I'm not sure how to picture this
8:23:08
beach
It is a bit long to quote it all here, but you can read it yourself in the Common Lisp HyperSpec.
8:31:03
remby
I think this is just kinda hard for me to imagine cause I'm not experienced with low level stuff, but I'll do more research
8:33:25
beach
Just think of it as a large graph of objects, each object taking up a chunk of memory, and some words in the chunk may contain pointers to other objects.
8:34:04
beach
So, a symbol will be a chunk that has a pointer to a string that holds the name of the symbol, and another pointer that refers to a package object.
8:35:04
beach
Executable code is just a vector of bytes that is tagged so that the operating system accepts that it is executed.
8:37:25
Nilby
ACTION laments that operating systems lost the ability to save a restartable image for any process.
8:38:58
beach
remby: Code is truly executable only when it is in the primary memory of the computer.
8:39:19
beach
And then it is just a sequence of bytes that the processor understands as instructions.
8:42:23
beach
There are lots of details that you need to know about to understand everything, of course. Like how a function calls another function, and how a function can refer to its arguments and its lexical variables.
12:08:17
daphnis
i couldn't find a straightforward way to checking that "foobar" ends in "ar" for example
14:39:00
lotuseater
hey i ran into an interesting problem recently ^^ an algorithm with TAGBODY and labels 1..13 has a step with "now goto step Z+3" so I calculate with (let ((next-step (+ Z 3))) (go next-step)) but of course that didn't work, as no NEXT-STEP label is there. i got it to run otherwise, but my question is is there another clever trick? :D
14:41:35
phoe
lotuseater: if you mean something like computing the tagbody tag dynamically - nope, that won't work
14:42:21
phoe
I mean, you can make yourself a function that accepts a number of sorts at runtime and contains a CASE with a series of GO calls
14:53:24
nij
Has anyone used Kenzo :) or even better seen the author hanging around in #lisp? http://www-fourier.ujf-grenoble.fr/~sergerar/Kenzo/
15:14:28
MichaelRaskin
Josh_2: what exactly are two states of the nose suitable for use in counting??
15:26:39
Bike
(defmacro computed-goto (min max val) `(ecase ,val ,@(loop for i from min to max collect `((,i) (go ,i)))))
15:26:54
Bike
i guess if you wated to be really fancy you could define a computed-tagbody macro to get the min and max for you
15:35:10
jcowan
phoe: You can't just eval the go, you have to eval the whole thing and use quasiquote to subsitute in the appropriate go tag.
17:09:37
nij
Amazing: (sscanf "000000004713b902: 00000002 00000000 00010000 0005 01 19462 /run/WSL/8_interop" "%x: %8x %8x %8x %4x %2x %5lu %s") ;; => (1192474882 2 0 65536 5 1 19462 "/run/WSL/8_interop")
17:24:46
dieggsy
splittist: you have (sscanf "123 abc" "%d %s"), i'd almost expect (sscanf "%d "%s" "123 abc")
17:27:43
splittist
dieggsy: yeah. But that's how C does it: int sscanf(const char *str, const char *format, ...);
17:28:24
splittist
dieggsy: it kind of makes sense if you think of fscanf having the FILE *stream first
18:21:48
gigamonkey
I gather the folks who wrote uiop consider uiop/pathname a replacement for cl-fad. Can anyone point me to any discussion about why certain things that are in cl-fad are not in uiop (e.g. pathname-as-file unless I'm missing something)?
18:28:26
jackdaniel
(member '|Alpha| (list '|Alpha| '|sdas|)) for heavy-wieght eq-comparable not mutable strings ,)
18:29:14
phoe
you forgot about interning, please consider '#:|Alpha| as ultra-ugly heavyweight eq-comparable immutable strings
18:31:25
Shinmera
gigamonkey: Fwiw I wrote my own pathname mangling library in https://shinmera.github.io/pathname-utils
18:32:17
gigamonkey
Shinmera: well, it's just about manipulating pathnames. Like if you wanted to create a file name based on a directory name.
18:32:31
Shinmera
It has a very different idea of what it means to turn a pathname into a "file pathname"
18:33:04
gigamonkey
E.g. (let ((p #p"some/dir/")) (merge-pathnames p (make-pathname :type "foo"))) gives you a goofy result of a pathname with a type but no name.
18:33:28
gigamonkey
Whereaas (let ((p #p"some/dir/")) (merge-pathnames (pathname-as-file p) (make-pathname
18:34:19
gigamonkey
To my mind? If I have a directory named foo/bar/ and I want to make a file foo/bar.whatever it does that.
18:37:54
Shinmera
I guess. My disagreement I suppose comes from directories and files being fundamentally of different purposes, so "converting" a directory into a file seems wrong. I would have worded the same maybe like this: (make-pathname :name (pathname-utils:directory-name path) :type "foo" :defaults (pathname-utils:parent path))
18:40:02
gigamonkey
Yeah. The whole point of CL-FAD (when I wrote the original code for PCL) was to do syntactic manipulations of pathnames. And because pathnames distinguish between directory names and file names I needed a function to say, how would I make a syntactically correct pathname that is the "same" name but as a file.
18:44:59
Shinmera
The depressing thing about writing pathname-utils was that a lot of the behaviour around munging pathnames can be hairy on certain implementations.
18:56:37
loskutak
Hi, I want to do a SVD decomposition of (small) matrix in common lisp. Is there any library, that could do that for me? I have tried gsll, but so far I couldn't get it to work.
18:57:46
jackdaniel
dieggsy: yes; but then you limit yourself to .a linkage (i.e no C-compiled fasls)
18:58:20
jackdaniel
that limitation is more a defect than a hard constraint - it could be fixed with code
18:59:02
jackdaniel
compile ecl with --disable-shared to have libecl.a; as for how to compile libraries (with dependencies) to static libraries, check out examples/ directory
18:59:59
dieggsy
is there a big performance difference between e.g. SBCL and ECL (i know SBCL is like the holy grail of lisp performance lol)
19:00:51
jackdaniel
sbcl is much faster for a) generic function dispatch, b) inferred numeric operations
19:01:51
jackdaniel
sure. here is somewhat dated benchmark: Bhttps://common-lisp.net/project/ecl/static/files/misc/benchmarks/2016-05-bench-all.html
19:03:41
jackdaniel
I believe that a type inferencer and a fast generic function dispatch will bring ecl much closer to more performant implementations
19:04:15
Josh_2
does anyone know how SBCL compares to commercial implementations in terms of performance?
19:05:05
jackdaniel
Josh_2: I believe Rainer Joswig ran cl-bench also against lw and allegro, but I don't remember for sure
19:05:27
loskutak
In fact, I want to solve A*x = 0 (nullspace of A), so non-SVD methods would probably be ok as well.
19:08:20
dieggsy
hmm, what would be the best method to live code an ncurses application? Start a swank server in the program ?
19:09:58
loskutak
dieggsy: idk, I probably just cannot load it properly. I do (ql:quickload "gsll"), (in-package :gsll), then I want to create the matrix with (make-marray) and I get gsll::make-marray is undefined... I am quite new to CL, so I have no idea what is going on... I have also tried testing the installation with (asdf:test-system :gsll), but that fails after while with heap exhausted error
19:10:22
jackdaniel
dieggsy: here is a rather hackish tutorial (for cl-charms binding to ncurses) :http://turtleware.eu/posts/cl-charms-crash-course.html
19:10:49
jackdaniel
on the same blog you will see also two tutorials about controlling the terminal without ncurses
19:11:09
jackdaniel
http://turtleware.eu/posts/Controlling-the-terminal.html; http://turtleware.eu/posts/Charming-CLIM-tutorial-part-2--Rethinking-The-Output.html
19:13:48
charles`
Would it be bad to tell a user to redefine a function from my library for configuration?
19:14:22
dieggsy
loskutak: for example, after (ql:quickload :gsll) you can use the gsl:sv-decomposition function
19:17:15
Shinmera
if by define you mean set, yes. At least then reloading your library would not override it (provided you defvar).
19:17:33
Shinmera
but it's still not great if multiple different actors would want to configure different aspects of your library.
19:20:16
loskutak
dieggsy: cool, this works - I can gsl:sv-decomposition, but if I give it an array created by (make-array '(2 3) :initial-contents '((3 2 2) (2 3 -2))), it fails with: There is no applicable method for the generic function ... gsll:mpointer (3). So I guess I have to convert the array to some other type?
19:23:14
dieggsy
loskutak: dunno, i've never used it, i'm just googling stuff. i'd suggest https://common-lisp.net/project/gsll/#examples and https://quickref.common-lisp.net/gsll.html
19:29:22
loskutak
dieggsy: it seems that they create a matrix with #2m(...), but that gives me "no dispatch function defined for #\M"
19:29:59
jackdaniel
dieggsy: there is only one terminal, and that termial is accessed with standard-output (and other) streams bound in the thread started from said terminal
19:30:17
jackdaniel
so this (sleep 1) is to not have the repl in that "main" thread get in the way with input and output processing
19:30:52
jackdaniel
for example repl calls (read); so it is first waiting for a character (or a line) - to not have that you make it "busy"