freenode/#lisp - IRC Chatlog
Search
16:36:46
phoe
you can put multiple forms inside a DEFUN - it has an "implicit PROGN", or so it's called.
16:37:12
phoe
*counter* instead of +counter+, as beach said. It's just notation - +foo+ denotes constants, *foo* variables.
16:39:04
beach
j`ey: If the (WHEN DFS-RES is supposed to be inside the LET, then the line is badly indented.
16:40:23
phoe
there's packages called slimv or vlime - they allow live interaction with Lisp images and should get you the best experience
16:40:41
phoe
I'm a spacemacs user myself, so won't be able to help you with vim setup - but perhaps someone else on the channel has that.
16:41:01
dim
j`ey: for growing a style and learning so many tricks when starting with CL I did like reading https://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-style.pdf ; I should give it another read even
16:41:03
phoe
j`ey: please do. half a fun of doing Lisp is its interactivity - and you need a toolkit that leverages that interactivity, so a mere text editor won't do
16:41:30
phoe
dim: and yeah, the three basic things: reading other people's code, writing your own code, and sending it for reviews
16:41:59
j`ey
my friend has looked at my code, but he's been too busy to look at some of the recent changes
17:09:17
drmeister
The first one is from the (defgeneric foo (page &key if-exists &allow-other-keys) ) definition
17:24:28
Colleen
Clhs: section 7.6.4 http://www.lispworks.com/documentation/HyperSpec/Body/07_fd.htm
17:24:34
Colleen
Unknown command. Possible matches: 8, mop, roll, set, say, get, login, block, award, time,
18:23:14
drmeister
makomo: Thank you - I encountered those incongruent lambda lists in some code from someone that I trust and I know that it is accepted in sbcl. I couldn't believe that clasp/ecl determined correctly that the lambda lists were correct and that the author and sbcl were incorrect.
18:35:34
drmeister
s/I couldn't believe that clasp/ecl determined correctly that the lambda lists were correct and that the author and sbcl were incorrect./I couldn't believe that clasp/ecl determined correctly that the lambda lists were INCONGRUENT and that the author and sbcl were incorrect./
19:28:51
phoe
generally there's always a newline in the DEFUN form after you finish typing the arguments
19:29:18
zhlyg
I *think* you should add tuple :if-does-not-exist :create to your with-open-file form (I'm cargo culting from PCL).
19:34:11
phoe
when you're opening the file for input, you likely don't want to supersede it if it exists
19:34:15
jmercouris
are there any VIM plugins for proper indentation? I belive steve losh is also a vim usr
19:35:18
j`ey
zhlyg: wouldnt I still need to get the different bytes out of the value into a sequence?
19:35:56
jmercouris
well, ':input will just evaluate to :input, not sure why you would do one over the other
19:36:40
pjb
jmercouris: a bad compiler could generate better code for ':input than :input. But it would need to be very bad.
19:37:10
pjb
jmercouris: it can never be different (unless the implementation allow for non-conforming setting of the keyword value)
19:38:00
pjb
But of course, this is only when they'er evaluated. If not, then there's a big difference: (quote (:foo ':foo)) #| --> (:foo ':foo) |# doesn't contain two symbols!
19:41:31
zhlyg
j`ey: scratch my idea of using write-sequence, it won't work because you are building an little-endian integer.
19:42:02
pjb
j`ey: a displaced array is an array whose elements are actually stored in another array.
19:43:06
pjb
and similarly, read-sequence, once you've read the dimensions and initialized the multidimensional array.
19:43:51
j`ey
now im confused. why am I doing all this byte stuff if write-sequence and read-sequence can write out an array?
19:46:33
pjb
j`ey: ah, well, this is not an array of bytes, so you still need to convert the elements into sequences of bytes (if you want to write your file portably).
20:03:14
pjb
(loop :for i :below (reduce (function *) (array-dimensions a)) :do (write-sequence (element-to-byte-sequence (row-major-aref a i)) stream))
20:05:29
pjb
(loop :with buffer (make-array +size-of-serialized-element+ :element-type '(unsigned-byte 8)) :for i :below (reduce (function *) (array-dimensions a)) :while (= +size-of-serialized-element+ (read-sequence buffer stream)) :do (setf (row-major-aref a i) (element-from-byte-sequence buffer)))
20:12:03
aeth
pjb: Yeah, I'm just saying when everyone's reaction is to go to the documentation maybe a simpler form is better
20:17:14
pjb
j`ey: didn't tell you that you should never use a literal value directly in the code? Instead, define a constant!
20:18:03
pjb
(eval-when (:compile-toplevel :load-toplevel :execute) (defconstant +byte-size+ 8)) and then :element-type `(unsigned-byte ,+byte-size+) and (logand (1- (expt 2 +byte-size)) ...)
20:20:33
pjb
But seriously, given the cost of studies, and the final results, I can't wait to see a suit asking refund.
20:20:51
aeth
pjb: Personally, I wouldn't use a constant for something like that, I'd use a *macro*.
20:22:04
pjb
You can also start with (deftype octet () `(unsigned-byte 8)) and use that type in :element-type everywhere…
20:22:29
aeth
https://gitlab.com/zombie-raptor/zombie-raptor/blob/5135a3ca53351660aa6482c18a1044afa04d5b9e/util/types.lisp
20:26:30
pjb
Then, there remains all the little monasteries and abbey where copist had libraries of volumes.
20:33:15
j`ey
in the CLHS it shows you can (map 'string..), with characters, is there a simple way to do it but with a list of strings?
20:36:37
aeth
I think you could probably do it with a mapfoo (probably not map) but it would be functionally equivalent to the reduce, but more verbose.
20:38:49
aeth
It doesn't look like my version of SBCL has a fast route for string concatenation when the types are known. i.e. this won't speed up your reduce (it will slow it down slightly, to check the types of x and y): (defun concatenate-string (x y) (declare (string x y)) (concatenate 'string x y))
20:40:42
aeth
j`ey: That will turn it into (concatenate 'string a b c d e ...) where "a b c d e ..." are elements of the list. It might be slower or faster. It's limited to call-arguments-limit
21:40:13
pfdietz
It might be nice if SBCL images could make the standard part shareable between different images, like libraries. Or is that the case already?
21:47:36
slyrus1
pfdietz: I agree. It might already be a thing, but, without thinking about it too deeply, something like dougk's shrinkwrapped binaries linked against a common libsbcl would be awesome.
21:52:49
slyrus1
Then again I'm busy downloading a 17MB string handling R package as some chained dependency so clearly nobody cares about package size anymore...
22:04:15
pfdietz
../../include/clasp/asttooling/astVisitor.h:30:10: fatal error: 'clang/AST/RecursiveASTVisitor.h' file not found
22:04:37
Colleen
Unknown command. Possible matches: 8, roll, clhs, set, say, mop, get, login, block, time,
22:06:12
oni-on-ion
who me? Colleen was mentioned here just earlier, thats where i first heard the name. i searched CL irc bot and got the same name, these reasons are why i say hi to her.
22:15:03
oni-on-ion
julia, colleen, ruby .. lady names are easy to remember, and at least partially altruistic =)
22:26:12
vsync
women do tend to score higher in extraversion, agreeableness, and conscientiousness, sure, but I prefer to keep the focus mainly on the individual
22:41:10
oni-on-ion
vsync: i mean for man to treat a lady. software and computers like we call the cars we work on "our baby"
22:44:24
oni-on-ion
Shinmera: broken link on colleen README.md - points to http://plaster.tymoon.eu/view/5A
23:00:58
Colleen
Shinmera: drmeister said 6 hours, 23 minutes ago: You used (:local-nicknames (#:cst #:concrete-syntax-tree))
23:00:58
Colleen
Shinmera: drmeister said 6 hours, 23 minutes ago: https://github.com/quicklisp/quicklisp-client/blob/master/dists/quicklisp/software/staple-20180711-git/parser/package.lisp#L11
23:00:58
Colleen
Shinmera: drmeister said 6 hours, 22 minutes ago: That last link won't work of course: https://github.com/Shinmera/staple/blob/master/parser/package.lisp#L11
23:00:58
Colleen
Shinmera: drmeister said 5 hours, 7 minutes ago: In staple here https://github.com/Shinmera/staple/blob/master/inference.lisp#L43 you use the symbol definition:declaration - that is only defined for sbcl.lisp in the definitions system.
23:00:58
Colleen
Shinmera: drmeister said 4 hours, 33 minutes ago: There are some incongruent lambda lists in staple. https://github.com/quicklisp/quicklisp-client/blob/master/local-projects/staple/page.lisp#L30 the methods look like they need to have &allow-other-keys added to them.
23:11:46
pfdietz
Even ignoring GFs, it could make sense to do that with ordinary functions, since you can pass keyword parameters if you include a :allow-other-keys t pair of arguments.
23:14:01
Shinmera
We're specifically talking about (defgeneric f (a &key b &allow-other-keys)) (defmethod f (a &key))
23:16:54
Shinmera
drmeister: the sbcl-isms in staple should be fixed now. (except for the local nicknames)
23:18:37
drmeister
It means when you are in a particular package - that certain additional nicknames are available.
23:19:28
Shinmera
adding a local-nickname table to the package object and making intern look there when it searches for symbols
23:20:22
pfdietz
The various standard functions that take packages are arguments may have to be modified, as well as the reader and the printer.
23:21:45
Shinmera
right. there's also a protocol to query the system, if you want to be fully compatible with onther implementations
23:23:27
pfdietz
I've been thinking there should also be "standard" local nicknames for a package, and a way to say "use that package's standard local nicknames inside this package". The standard local nicknames could collide, but if they do it's immediately detectable and you just manually specify a different one for one of the colliding packages.
23:44:43
oni-on-ion
Shinmera: oh!! alright. it was the first search result and i've come across it before, and seen her here in chan.
23:51:47
oni-on-ion
in framework? could be a good thing. i've got some wierd big ideas for something; ive had a couple game servers that had irc integration for eg.
0:09:57
oni-on-ion
yeh but its possible to accomplish in other ways surely. dang tho, its not a good solution ?
0:10:51
AeroNotix
oni-on-ion: no no I meant "dang I didn't realise export was a function on its own"
0:32:31
oni-on-ion
(loop for value being the hash-values of (irc:users *con*) using (hash-key key) do (print value)) ;; holy moses....!
0:39:11
oni-on-ion
putting it in #lispgames because i want to generate some amusing fake titles among other useful bits of musery
0:50:23
commanderkeen
it's been a long time since i've touched common lisp. how do i access a variable defined via defvar from another package? say im package :stumpwm and I want to access *servers* in :swank. my initial thought was swank:*servers* but that doesnt work
0:54:46
AeroNotix
commanderkeen: but that's because it's not exported. Single colon works when the symbol is exported from the package.
0:55:11
AeroNotix
Double is for accessing unexported package symbols. Not recommended to build software around relying on unexported symbols.
0:56:26
commanderkeen
AeroNotix: thanks for the info. i was just reading up on the difference. i just wanted get running swank servers from my window manager.
0:56:29
no-defun-allowed
aeth: `(maphash (lambda (k v) (declare (ignore k)) (print v)) (irc:users *con*))`
0:56:50
Shinmera
oni-on-ion: I created it because I wanted a general framework for chat systems, and that's what it is.
1:04:23
saturn2
it no longer compiles with the latest sbcl and i wonder if they still want to maintain it or if i should try to figure it out
1:08:21
oni-on-ion
Shinmera: alright, just curious, it looks awesome. i will try to get it to connect later, playing with cl-irc right now
1:13:06
oni-on-ion
ie. a privmsg hook added, then change the hook , still uses the "old" one. maybe there is a priority for "compiled" code? i've been using C-c C-c in slime and i think its doing something different than my usual C-x e
1:17:14
AeroNotix
rove has some fancy pants symbols showing test success/failure (tick/cross) which sb-cover chokes on
1:22:35
AeroNotix
rove has some unicode chars within its source. It seemed sb-cover was choking on those
1:23:01
AeroNotix
hmm, I remvoed them from the rove source (to test), sb-cover worked, I've since replaced them and now it's not failing in the exact same way
1:34:13
AeroNotix
anyway, looks like you can pass :external-format to sb-cover:report any way. That might help if I can see why it's not failing again
1:40:53
AeroNotix
Ugh, is there a better coverage system than sb-cover then? Now I'm running in to a different issue.
1:41:13
AeroNotix
It's spitting out weird warnings about lisp files it can't find but their names are lists of numbers like (3 3 3 2 2 1 2 3)
1:41:27
AeroNotix
1) in file /home/xeno/.quicklisp/dists/quicklisp/software/portable-threads-20180131-git/portable-threads.lisp
1:42:41
AeroNotix
yeah, deleting the fasls, recompiling without sb-coverage enabled removes those warnings
1:48:11
saturn2
on further investigation it wasn't city-hash's fault but a different package, nibbles, and updating that fixed things
1:59:06
AeroNotix
oni-on-ion: runs your code (e.g. your test suite) and outputs a set of files which highlight what parts of the code were actually ran. Helps figure out what code is left untested.
2:51:36
AeroNotix
oni-on-ion: it shows in green what was ran, yellow where only one branch in a conditional was taken e.g. (if (some-predicate) (foo) (bar))
2:53:01
AeroNotix
It looks like it doesn't deal with how WHEN expands (always leading it to be yellow)
2:55:00
no-defun-allowed
re a previous discussion on generational hypothesis: i read the gc handbook and it says older objects are often less mutated
2:55:26
no-defun-allowed
still a remembered inter-gen set is necessary otherwise i'd be pulling a lot of data to keep no old->new pointers
2:58:54
AeroNotix
johnjay: there's some metrics somewhere on the quicklisp blog about downloads by implementation. SBCL was far and away the most widely used implementation, at least as far as using quicklisp
3:00:36
no-defun-allowed
yeah emacs isn't a great lisp for general purpose computing but it's certainly the most used
3:02:21
aeth
Emacs Lisp is essentially a time capsule of an old pre-CL Lisp with some things ported from CL much later on
3:05:00
oni-on-ion
no-defun-allowed: https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS#L897
3:05:42
aeth
johnjay: I don't really like Emacs, though. I like its concept of being programmable in a Lisp and I like its key bindings.
3:06:26
aeth
I think pretty much every other editor is worse than GNU Emacs, especially for Common Lisp programming, but that doesn't make Emacs Lisp a good editor.
3:07:29
aeth
Look at GNU Emacs new? I'd be looking at about 4 years before being comfortable in it. I can understand why people try to avoid it.
3:08:08
aeth
If anything needs an interactive gamified tutorial, it's GNU Emacs, but it can't because it's not capable enough.
3:08:46
aeth
oni-on-ion: What editors are available? Especially years ago. ed, nano, vim, emacs, gedit, kate, etc.
3:08:52
oni-on-ion
i've been using it since hmm 1994 i guess, didnt really truly grasp as much as i do in the last couple years. (i took a hiatus from comp/tech before that)
3:09:07
aeth
Of these Unix editors, emacs might be the only editor that's both graphical and terminal-based.
3:22:13
no-defun-allowed
it runs on i386 with no GC and there's a commodore 64 fork which has a faulty GC
3:22:34
johnjay
https://www.reddit.com/r/lisp/comments/5zbmwo/lisp_os_is_mezzano_the_closest_to_being_a_modern/
3:24:57
no-defun-allowed
oni-on-ion: which requires serialisation and deserialisation. a real lispos could pass a pointer quite easily
3:27:05
ym
The only thing which stops me from implementing/porting LISP OS is Altera's proprietary bitstream format.
3:27:19
Oladon
johnjay: I don't think beach was actually suggesting that you never wonder again, just that you don't wonder about that specific item anymore.
3:29:25
aeth
A Linux distro is just something with its own package repositories, possibly with its own package manager, too. (Most just use an existing one with custom repos, though.)
3:29:28
oni-on-ion
well i need to know because i was designing a pretend computer using a count of 22 for something
3:29:39
no-defun-allowed
here's some names you might be able to complain to: Thomas F Knight Jr, David Moon, Jack Holloway and Guy L Steele Jr
3:30:44
aeth
I've been using Fedora since 2006. I stopped even trying out other distros in VMs probably 6 years ago.
3:30:46
no-defun-allowed
iirc there's a J1 fpga processor which runs forth. add some tags and clean up the function stack and you're halfway to a lispm
3:31:46
ym
The original CADR was highly constrained with technical capabilities of that time. One can expand it any way.
3:32:08
no-defun-allowed
i'd have a go at trying replace-string 22 32 but it might not work like that
3:33:28
aeth
But GNU is politically opposed to "nonfree software" so you won't be able to easily run things like Steam on it. Well, you might be able to get around that with the Steam Flatpak. Drivers will be trickier. I guess you'd need to use an AMD GPU.
3:34:25
aeth
Most people have some proprietary software that they want to run. That's one of the advantages of a "LispOS" running Android-style on top of the Linux kernel
3:35:23
no-defun-allowed
according to the doc, the cadr machine is hardware to run lispm firmware but i say the cadr machine is a lisp machine
3:35:27
aeth
Note that copyfarleft's added restrictions would make it neither open source nor free software
3:36:15
oni-on-ion
no-defun-allowed: ok. says here that cadr machine is the microprocessor, and lisp machine is cadr machine plus microcode to interpret
3:37:15
no-defun-allowed
in other words: 3d print the keycaps and make your own hall effect switches
3:41:22
aeth
If you wanted to make a LispOS on top of the Linux kernel you would need: (1) a package manager, (2) a terminal emulator, (3) a posix shell, (4) a Lisp shell, (5) a text editor, (6) a file manager (not everything is convenient in the terminal)
3:42:04
aeth
stumpwm isn't very convenient on laptops, though, because there it's nice to have a bar for wifi/battery/volume/brightness
3:42:05
johnjay
aeth: i thought i could see how to do a terminal emulator by looking at xfce-terminal's code. but it refers to vte which does the actual term emulation
3:42:50
aeth
johnjay: most things in the C world are so hard that they just use libraries to do all of the real work
3:43:02
no-defun-allowed
i broke the emulator and it's telling me someone can't use the elevator to get to the ninth floor
3:43:13
johnjay
would there be architectural or performance differences between a LispOS on a linux and something like mezzano, that's lisp all the way down?
3:43:18
aeth
e.g. there's like two libraries that do font rendering and they share a common core iirc
3:45:00
aeth
johnjay: With Lisp on Linux you have a decision to make fairly early on. Do you put everything in one Lisp image or do you accept having 10x the memory use of the equivalent C application by running one Lisp image per thing?
3:45:43
oni-on-ion
ah nice. get wayland going on a bare linux kernel, emacs loaded with exwm and slime connected to system, use eshell and yea
3:47:11
aeth
I wouldn't recommend making your own CPU, though. If that's your concern, just use RISC V.
3:48:38
no-defun-allowed
it's not lisp all the way down and the "lisp machine" abstraction would end when the kernel starts
3:48:46
beach
johnjay: This document http://metamodular.com/lispos.pdf is not about Mezzano, but it explains how different a Lisp OS could be.
3:49:02
aeth
CPUs have a network effect. That's one of the reasons why Lisp on x86 quickly was faster than Lisp on LispMs even though 32 bits isn't really enough for Lisp imo (36-bit is good because of tags)
3:49:42
aeth
Even if you wanted 100% FOSH, RISC V will be faster and more feature complete than what you can design and make
3:50:52
aeth
oni-on-ion: you don't want a lot of logic in the microcode (or the circuits or whatever)
3:51:07
aeth
oni-on-ion: Optimizing compilers on general purpose hardware is generally the way to go.
3:51:41
aeth
Besides, people aren't going to update their hardware every 2 years these days, so updates will come much faster for software.
3:52:45
aeth
oni-on-ion: You are probably not going to beat the performance of SBCL on x86-64 ever. It will optimize faster than you can with your Lisp-on-a-chip.
3:53:40
aeth
(i.e. by the time you get to the level of performance SBCL is now, SBCL will have had dozens of revisions and x86-64 will get its annual 10% improvements)
3:55:17
aeth
oni-on-ion: A Lisp on a GPU would be really fast at things like MAP, but not in general
3:56:13
kristof
for all the ugly architectures we've had and all the good ones in the dust bin (I think SPARC is beautiful), mass producing intel chips has resulted in a computing power explosion
3:56:34
kristof
that people rarely appreciate in the same way as if there house suddenly doubled in size every two months
4:02:17
oni-on-ion
my phone is faster and way better gfx than my desktop and tablet probably combined
4:02:36
kristof
https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Moore%27s_Law_Transistor_Count_1971-2016.png/1200px-Moore%27s_Law_Transistor_Count_1971-2016.png
4:03:17
aeth
kristof: Transistor count used to translate into single-threaded performance. Now we're at the point where that's essentially false
4:03:42
aeth
Single-threaded performance is still going up a bit, but mostly due to cleverness (of the kind that causes Spectre/Meltdown)
4:05:06
johnjay
aeth: the concept of process was just designed for computers with small memory/addressing?
4:05:10
aeth
I suspect what we'll see is consumer CPU core counts dramatically increasing until that also hits a wall. (I wonder where that wall will be. 128? more?)
4:07:35
beach
johnjay: Pretty much. In some cases (like Unix), it was meant to emulate the raw machine so that old technology could be used for compilers and linkers.
4:07:41
oni-on-ion
typing in little letters with our fingers and it explodes into essentially a heaven of information and entertainment and complexity and discovery, the computers multiply those key presses ...
4:08:43
ym
I can't see a heaven. I can see overthinked specifications and constant reimplementations.
4:09:01
johnjay
beach: i feel like im learning more in the last 5 minutes than 5 years of programming (!)
4:09:10
beach
johnjay: Now, if you look at the OS literature, it is often presented as a security thing. It is true that running programs in separate address spaces gives a certain degree of security.
4:09:38
beach
johnjay: Though, attacks like overwriting the return address on the stack are hard to prevent.
4:10:25
beach
johnjay: Plus, there is a case of turning the implication arrow the wrong way. Security can be obtained with other means than processes, and processes are definitely overkill in other respects.
4:10:56
beach
johnjay: In order to communicate between programs, you can't just pass a pointer. You have to serialize and unserialize everything.
4:11:53
beach
johnjay: I know what you mean. #lisp has some smart and knowledgeable people, so people who have not come here before often learn a lot.
4:15:25
johnjay
ah ok. i think that's some kind of security flaw or something. link to a document with you real name.
4:16:15
johnjay
beach: just a little joke there. i was able to figure out you wrote the document from the way you spoke about it
4:16:57
beach
johnjay: Lots of #lisp participants know each other quite well. We meet every year at ELS.
4:17:03
kristof
Although I also like the idea of sandboxing code that might use raw addresses like C programs.
4:17:35
AeroNotix
kristof: ah, it's not referenced in the sections talking about the issues with a single address space
4:17:36
beach
johnjay: I don't think froggey has the same considerations with Mezzano as I have in that document.
4:17:55
johnjay
i haven't heard of mezzano before today but it appears to be all lisp. a lot of it is lisp that is emitting machine code though. -_-
4:19:10
aeth
johnjay: What Lispers generally do is they put things in s-expressions and then turn that into the desired output. You see this with asm, HTML, XML, JSON, CSS, JavaScript, GLSL, SQL, etc.
4:19:52
kristof
AeroNotix: Really? You think incorrect permission bits are a valid concern even though it's the equivalent of bugs in a UNIX kernel?
4:21:40
AeroNotix
Suit yourself. Not sure if you're offended by something I've said or done in the past. If so, just let me know in PM or whatever. Wouldn't like there to be beef
4:22:37
AeroNotix
read/writing it. I'd love to see an explanation of how concurrency is supposed to work in a system like this
4:22:43
beach
AeroNotix: I am not offended. Just tired of repeating the same arguments over and over again, even though they are all spelled out in the document and in the OS literature.
4:23:35
kristof
AeroNotix: You were right about glossing over the essay since there was an entire section on concurrency.
4:24:35
beach
johnjay: Generally, #lisp will recommend PCL to people who already know some programming.
4:25:19
AeroNotix
kristof: dealing with concurrency issues within a single program, with threads and locks is already tedious and requires careful testing. Imagine that being multiplied by additional external processes, some of whose code you may not be in control of.
4:25:22
no-defun-allowed
it's the only one i have in hard copy (cause it was only $30, compared to SICP's $100)
4:25:30
kristof
johnjay: You will be surprised to learn that Common Lisp has *more* "good" books than most other programming languages do. Combined, eevn.
4:25:31
beach
johnjay: Practical Common Lisp, PAIP, On Lisp, OO programming in Common Lisp, Common Lisp recipes, etc, etc.