freenode/#lisp - IRC Chatlog
Search
8:02:31
fouric
https://fouric.github.io/update/lisp/2017/11/15/getting-started-with-common-lisp-2017-edition.html
8:03:00
fouric
it's not nearly as complete as what you were probably thinking of, but it's a start, and it can be mutated
8:04:52
mfiano
fouric: While nice, it doesn't solve the problem I am constantly faced with, and that's explaining why it's important not to use an _editor_ to write Common Lisp, and also transitioning a newcomer to Emacs (or Spacemacs, or even Vim with slimv, vlime, etc) is a task and a half.
8:06:02
mfiano
Most people new to Lisp are never even introduced to why it's important. They pick up [insert CL book here] and open their text editor to follow along.
8:07:28
mfiano
Can you name one that explains how to set up SLIME/Sly, paredit/etc, a modern implementation, and Quicklisp?
8:13:09
mfiano
sigjuice: Yes it helps greatly, but there is no book or lecture that mentions it, and it takes persuading users away from their favorite Sublime Text editor, etc, which is difficult...if I even notice they are using them...again, there are too many people that do not know how to start using a Common Lisp environment when they pick up a Common Lisp book or take a Common Lisp course.
8:17:19
shrdlu68
mfiano: Perhaps it's because most authors assume the implementation's RELP will be enough, and don't intend to complicate things too early.
8:18:12
shrdlu68
"The Land of Lisp", for example, seems to assume the the CLISP REPL will be enough for learning purposes, at least initially.
8:20:30
shrdlu68
Of course, once the learner progresses beyond a certain point some effort should be made to creating a suitable environment.
8:22:38
mfiano
I'm not suggestion an in-depth walkthrough of configuring Emacs or setting up Quicklisp. Just a mention that they will not be getting the full language experience by a mile without eventually looking into [list of tools].
8:23:11
mfiano
I see quite a few people decide CL is not right for them, and I wonder if this is part of the reason after my experience helping newcomers.
8:25:11
shrdlu68
I doubt it is - most learners would be smart enough to incrementally adapt their environment to their immediate needs.
8:25:17
sigjuice
if someone is reading PCL today, shouldn't it be possible to just substitute "Lisp in a Box" with Portacle?
8:27:33
mfiano
Assuming they were aware of it, they weren't so attached to [traditional editor], and actually knew why it's needed for the full experience, I don't see any problem.
8:28:02
mfiano
My point is most developers have grown attached to their traditional development editor/IDE which is unsuitable for Common Lisp, but they don't know any better.
8:31:10
mfiano
I've used Vim for CL for about 8 years, switched to Emacs a couple years ago, switched to Spacemacs recently...and now I'm using vim again (in addition to Spacemacs on some devices)
8:33:40
mfiano
fouric: I released this yesterday out of demand. A couple other people found it useful. If you want to try it out and report back, I'd appreciate it :) https://github.com/mfiano/common-lisp-sly
8:36:53
mfiano
This allows for example, deleting a line of a form while keeping parens balanced, etc
8:37:04
sigjuice
mfiano I too switched from vim to emacs from vim nearly 10 years ago. I tried evil, vimpulse etc. in the beginning but grew out of it eventually. I still end up typing j's and k's into my text once in a while.
8:38:58
mfiano
fouric: It's actually builtin to Spacemacs 0.300 (technically not released yet, so you should be on the develop branch for this layer to work)
8:39:28
mfiano
Well builtin, but not enabled by default. You have to follow the README instructions for this layer to set it properly
8:42:06
mfiano
I would encourage you to read the Sly documentation if you are curious about the few features it adds, such as my favorite, "stickers".
8:42:40
mfiano
and they show up in grey. you can add also add a sticker to a form/symbol within a sticker, and it'll show up as a darker shader of grey...
8:42:50
mfiano
then you C-c C-c the defun or wherever they are defined to "arm" them, and they turn to shades of blue.
8:42:59
mfiano
then you run your code, and each sticker captures every value that the stickers have seen, and you can cycle through the replay
8:43:26
mfiano
h and they turn from blue to green when they have captured something during execution
8:47:53
mfiano
There is one thing you may miss from SLIME if you use Sly though...it doesn't have a contrib for SBCL's statistical profiler
8:52:00
mfiano
in vim, you'd use the CL server part with one of the few vim client implementations rather than elisp
9:04:44
spiaggia
jackdaniel: When McCLIM says that it couldn't use fontconfig to configure fonts and that I have to do it manually, does that mean that I have to install a program (named fontconfig)?
9:05:59
jackdaniel
or you may push mcclim-ugly to features (don't remember exact name) to use native Xorg fonts
9:10:18
jackdaniel
and was part of climacs project (don't know what's its status now): https://www.common-lisp.net/project/climacs/images/screenshots/old/swine-ss.png
9:11:46
sigjuice
also just discovered this one #<SYSTEM trivial-swank / trivial-swank-quicklisp-ab90d90f-git / quicklisp 2018-01-31>
9:12:33
jackdaniel
from other interesting bits of information, if you read into swank sources there are hints, that implementing more rich presentations was planned (i.e sending images etc)
9:21:12
sigjuice
jackdaniel were you referring to this? https://github.com/slime/slime/blob/master/contrib/slime-media.el
9:23:19
jackdaniel
sigjuice: close. I was referring to the comment in this empty file: contrib/swank-media.lisp
9:27:45
sigjuice
I don't recall the details, but I remember doing something that produced images in my *slime-repl sbcl* buffer.
10:10:30
Shinmera
Sure, lots of things. Power going off, the process dying or being halted by a debugger
10:11:11
flip214
phoe: so, getting back to my question of yesterday evening, how come the UNWIND-PROTECT in hunchentoots PROCESS-CONNECTION doesn't close the socket?
10:11:38
flip214
Shinmera: in the first two cases the socket wouldn't still be active ON THIS MACHINE
10:12:33
phoe
flip214: are you sure it is executed? can you print something inside that unwind-protect to make sure control flow reaches it, just to be absolutely sure?
10:12:56
phoe
because if the control flow reaches the cleanup forms then the problem is elsewhere and most likely deeper
10:16:58
flip214
jdz: no. the QUUX acceptor stops working (as the child thread returns an unexpected error instead of :handler-done),
10:17:41
flip214
But I'd like to understand what causes the unwind-protect to be skipped... jackdaniel's terminate-thread might be the reason, but I don't know lparallel good enough yet.
10:19:33
thodg
jdz: yes but if he calls close in an unwind protect and be sure about it how would the socket remain open ?
10:20:11
jdz
I don't have the code, and it would be wrong to close the socket oneself because that's Hunchentoot's job.
10:23:17
phoe
if anything, you could try to wrap a finalizer around it, calling close on the associated socket-stream.
10:23:41
phoe
just to make sure that when the GC runs to clean up the usocket, its associated stream is closed.
10:24:07
jdz
The whole point of "thread pooling" is to have a pool of threads and reuse them instead of creating and destroying a thread for each connection.
10:24:38
thodg
jdz: well if the thread is not dead it might also close its socket on unwind-protect its true
10:25:13
phoe
But if the thread is alive and its unwind-protect forms are *not* called, then it means the thread is still inside unwind-protect.
10:26:22
jackdaniel
so having error in such thread, if there is no top-level handler-case is equivalent to crash (or destroy-thread)
10:26:25
pjb
But more seriously, the right CL way to do it, is: (bt:create-thread (lambda () (UNWIND-PROTECT (your-thread-code) (DO-YOUR-CLEANUP-HERE!))))
10:26:35
flip214
phoe: either that, or there's a bug that inhibits UNWIND-PROTECT doing the cleanup.
10:27:09
jackdaniel
pjb: that's not enough, it should be (bt:make-thread (lambda () (handler-case (…)))
10:28:33
jackdaniel
pjb: that's not guaranteed and in fact it doesn't happen on sbcl if you have --disable-debugger option and run standalone binary
10:29:21
jackdaniel
flip214: let me repeat: wrap your body in handler-case to be sure, that unwind-protect cleanup is executed in case of errors
10:29:57
jdz
UNWIND-PROTECT cleanup should always be executed, regardless of the presence of condition handling.
10:30:25
jackdaniel
jdz: that's why we have ups, so unwind-protect will be always executed even on power loss
10:31:00
jackdaniel
schweers: normally no, but if you have debugger disabled, then yes - otherwise such error may basically crash the thread (just as if you had called destroy-thread)
10:31:49
schweers
Oh. What if I only have one thread? Can this still happen? Does the standard say anything about this case?
10:32:48
jackdaniel
schweers: if your application doesn't have a debugger, then I guess it still can happen, yes. but I haven't checked it myself
10:33:42
flip214
when I "disable" the FORMAT via #+(or), the wrong behaviour is back - the socket stays open.
10:33:50
phoe
flip214: are you sure that PROCESS-CONNECTION is not redefined anywhere else in the code?
10:34:09
phoe
I had a similar issue before, and found that I defined a method in two places. The latter redefined the former.
10:34:38
flip214
jdz: can you ever by 100% sure? bit flip on the way to the inferior lisp, and you're defining a different method...
10:35:32
jdz
I've had quite a few non-productive discussions with people who are sure about something without checking their assumptions.
10:38:03
phoe
pjb: but a single FORMAT call should not be the difference on whether U-P cleanup forms are executed or not
10:39:59
flip214
how would I disassemble a method? the GF isn't interesting, and trying the method says
10:40:00
pjb
The questions is whether kill-thread (or pthread_kill) will allow unwind-protect to run?
10:42:27
jdz
flip214: You should show us the code that works as expected (with the FORMAT call), and the code that fails.
10:50:04
flip214
jdz: perhaps I'm completely wrong?! the reproduce pasted above is for sure, please make your own (correct) conclusions.
10:57:02
jdz
There is no reality that tells, there's only perceived reality, and subjects who perceive.
11:00:13
thodg
well interface definitions have that that they let you create virtual implementors and users of an interface
11:17:32
shka
_death: define as: "It is already here use this nice lib", or as "you can write it yourself"
11:21:49
shka
i think it should be extreamly easy (like inherit just input and output in-memory stream)
11:28:55
_death
I posted this some time ago https://gist.github.com/death/2709ae6a9124968a86070bbb760b1629
11:35:53
shka
thodg: it is pretty cool and useful lib, but i need gray stream api, so i stick to flexi-streams
11:50:47
flip214_
In case anyone wants to know the details: the "hanging" socket was a _new_ one, as Firefox helpful retries the request when there's no useful answer. but when QUUX handler crashed, it would just be accepted and then linger around.
12:03:54
Shinmera
Modern browsers like to spam the shit out of servers with requests when one fails.
12:14:13
flip214_
now let's hope that the maintainers merge soon, so that the next QL release already has the fixes, so that I can remove my checkouts
12:47:36
flip214_
beach: you're listed as maintainer for alexandria... would you like to take a look at https://gitlab.common-lisp.net/alexandria/alexandria/merge_requests? A few doc changes with little risk.
13:23:27
MetaYan
beach: I keep getting 'Unknown &KEY argument: :WEAKNESS-MATTERS' when loading clim-listener (SBCL 1.4.4 on OSX); http://termbin.com/lipp (<- it almost got it right... ;)
13:34:01
phoe
https://github.com/trivial-garbage/trivial-garbage/blob/master/trivial-garbage.lisp#L203
13:36:06
phoe
because (trivial-garbage:make-weak-hash-table :weakness :key :weakness-matters :nil) works on my machine
13:43:53
AeroNotix
can someone make the argument for anaphoric macros to me? It seems like unnecessary magic to me
13:44:10
AeroNotix
I get that "omg so rad" but in reality (where most of us should reside) they're annoying and magic
13:46:58
AeroNotix
honestly they seem like one day someone, somewhere realised "huh, that's possible" and here we are
13:46:58
pjb
AeroNotix: I don't know about code. But if "it" exists in natural languages, it must serve some purpose!
13:47:49
AeroNotix
I speak with several people on a daily basis who have different native languages and you wouldn't believe how often anaphora cause issues
13:48:37
pjb
But in a way, references such as "it" will always add some ambiguity, since they're implicit references. Therefore this may be something you want to remove from code. But then, how much implicit referencing do you have in your code really? More than you think in general!
13:49:22
pjb
The thing with implicit vs explicit, is that implicit is something that is hidden thru abstraction. So the question is whether rendering the reference named by "it" implicit is a good abstraction or not.
13:50:18
AeroNotix
lots of editors won't realise that they should jump to the anaphoric macro if you're looking for where `it' is defined.
13:50:30
pjb
If your scope is small and well delimited (as it generally is with lisp macros), then it could work.
13:52:41
AeroNotix
that --map function should be named something which describes how to access the element currently being mapped
13:53:39
pjb
AeroNotix: you can make a good case for binding macros where the user specifies the variable instead of using it.
13:54:23
pjb
(binding-when (foo (expression) (print foo))) -> (let ((foo (expression))) (when foo (print foo)))
13:56:27
shka
Xach: compressing sparse data, works great! If only, i wish I could have grey stream interface for compressor
14:08:33
shka
Xach: not sure, It failed once i attempted to write-byte into their stream, not sure if implementation is incomplete, or it is not gray stream
14:10:40
_death
you should also know that the gray stream protocol is incomplete (it lacks a stream-file-length function)
14:25:47
shka
Xach: also, i spent quite some time yesterday to figure out why no library offers that
14:28:59
comborico
I'm reading Practical Common Lisp, and there is an oversight that I'd like to get straightened out. What is the apostrophe before the parens called, and what
14:30:58
pjb
comborico: you should note that actually, the lisp reader interprets most characters going thru a table, the *readtable* and calling functions named reader macros, that return the "read" sexp.
14:31:16
pjb
comborico: in the case of 'x what is actually returned by the reader macro, is (CL:QUOTE x)
14:32:28
comborico
Phoe, check for yourself. '( ) is first used in second link with function REMOVE-IF-NOT.
14:33:01
Shinmera
comborico: I'm quite sure he elaborate how it works and what it means. Maybe just be a bit more patient with the book. There's a good reason he does not delve into things that are rather complicated to explain too early.
14:33:13
pjb
comborico: for example, the reader macro for ( reads a list. If that list is empty as in ( ) or as we usually write: (), then it actually returns the symbol CL:NIL
14:34:22
phoe
comborico: in other words: (a b c) most likely means a function call, function A is called with the values of B and C as arguments.
14:34:24
pjb
this is different of nil, which when read in the CL package, reads directly CL:NIL, and when evaluated, returns its value, which happens to be CL:NIL itself, so that's also what's returned, but there's it's a more complex evaluation process, since we go look for the value of a variable here.
14:35:03
pjb
(eval '(a b c)) means that (a b c) will be interpreted by the evaluator as an operator application.
14:36:58
comborico
Shinmera, I'm one of those types that has a burning desire to understand each character in the code. And because technical writings are notorious for oversights and typos, I thought it best to understand quote before progressing.
14:37:33
phoe
"practical" chapters are code first. you first write code, then are expected to understand it.
14:38:00
phoe
so if you don't know what a thing is, relax and just roll with it. it'll be explained later.
14:38:54
pjb
But don't take it for godspel, the CLHS is the reference (apart from where it has bugs, such as prog2).
14:38:58
phoe
also what Xach said; I myself started with the book ANSI Common Lisp by Paul Graham, and I consider it decent for learning the basics of Lisp.
14:39:17
Shinmera
In other news, ELS registration is now done! It's not online yet, but hopefully (up to Didier) within a few days.
14:39:17
phoe
It also has a more theoretical approach up front, and doesn't throw you straight into application writing like PCL does.
14:40:00
phoe
It also has Paul Graham who has a few pretty damn controversial views on Lisp's various parts
14:40:26
phoe
but then again, you'll figure it out after just using enough Lisp and asking enough questions afterwards.
14:41:53
Shinmera
And: it's not too late yet to give me harsh, soul-crushing feedback about my paper submission. https://github.com/Shinmera/talks/blob/master/els2018-glsl-oop/paper.pdf
14:45:58
comborico
Gotcha. The "and" part threw me off, which isn't difficult to do in my learning condition
14:56:31
comborico
They have a reputation for being slow-moving and redundant, but I've found that style is the best for me.
14:57:37
comborico
schweers, in book recommendations, if the recommender was aware of my preference, it would greatly aid in a proper recommendation.
14:59:08
schweers
I see; I don’t have any recommendations for you, apart from PCL, but I can tell you that you might have a hard time with grahams books. On the other hand, at least On Lisp is not directed at the newcomer anyway.
14:59:19
comborico
Thanks for acknowledging what i said was true, by the way. (No mention of quote upon its first use)
15:00:03
pjb
comborico: perhaps you'll like: Common Lisp: A Gentle Introduction to Symbolic Computation http://www.cs.cmu.edu/~dst/LispBook/ http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/user/dst/www/LispBook/index.html
15:15:23
schweers
comborico: sorry, I just realized I misunderstood your question about “On Lisp”. Yes, I kind of like it, but it covers fairly advanced and is kinda weird.
15:20:08
MetaYan
phoe: trivial-garbage / trivial-garbage-20150113-git / quicklisp 2018-01-31 (was away from keyboard)
15:21:09
phoe
I have the same version and the :WEAKNESS-SOMETHING keyword is *not* passed to the CL:MAKE-HASH-TABLE.
15:22:24
comborico
Out of curiosity, for explicit calling of functions #'( ), I wonder why #( ) is not sufficient. In other words, I'm wondering why that quote is necessary.
15:25:31
phoe
#lisp is good for these questions as well, but it might be better to ask there if #lisp has traffic at the moment. and such times happen.
16:19:24
tazjin
are different quicklisp libraries allowed to have overlapping package names, as long as the system names are unique?
17:32:06
fe[nl]ix
tazjin: actually I misread that. it can happen and there are actually a few systems that offer simple compatibility for other libraries
18:29:50
inaimathi
Hello; I wrote a thing to give me some cross-implementation generic-function introspection https://github.com/inaimathi/cl-mop/pull/1/files
18:31:03
inaimathi
(Also, I've only got access to clisp, sbcl and ccl locally, so I'm hoping a Lispworks/Allegro/CMUCL user can give me a rundown on how to extend this for those lisps)
18:35:30
Bike
i don't know why you'd want these functions that operate on both methods and generic functions
18:36:00
Bike
since specializer-object only works on eql specializers, specializer-objects-of is not going to work on anything with any methods that have any specializers other than eql ones
18:40:08
inaimathi
It looks like `closer-mop` does the cross-platform imports I'm looking for here. Thanks!
18:41:32
inaimathi
(`specializer-object` works on anything; it returns the object of eql-specializers and the identity of other specializers (which should be a class reference))
18:45:14
makomo_
are there any other languages that have 2-argument versions of rounding functions such as FLOOR, CEILING, ROUND, etc.?
18:49:37
makomo_
excel also has a 2-argument version of CEILING for example, but the second argument is the "singificance" rather than the divisor
19:11:31
aeth
Other languages probably optimise floor(x/y) to do the same thing as (floor x y) in CL (assuming that / is defined similarly to CL's)... but most (all?) CLs don't optimize (floor (/ x y)) because (floor x y) exists.
19:12:41
aeth
what's great, though, is that (1) it's explicit and (2) you have plenty of options (floor, ffloor, ceiling, fceiling, truncate, ftruncate, round, fround)
19:14:24
pjb
And that they return 2 values, so you don't need to call two functions to get the quotient and the remainder.
19:15:52
aeth
But if you do want just the latter, you have both mod and rem available, which is rare. Check out the table to see comparable languages: https://en.wikipedia.org/wiki/Modulo_operation#Remainder_calculation_for_the_modulo_operation