freenode/#lisp - IRC Chatlog
Search
4:27:27
emaczen
pillton: Why? I implemented aif, really liked it and then implemented acond, acase and atypecase
4:29:14
beach
jcowan: The use for NOTINLINE is so that the client can be sure that it is not necessary to recompile callers when the function changes.
4:29:25
pillton
emaczen: It is contentious as the macro determines the binding rather than the user.
4:31:08
beach
Elronnd: It's a good book. It explains the pitfalls of macro writings, such as order of evaluation and multiple evaluation.
4:33:52
beach
emaczen: I said that they are usually not a great idea. That means that there are better ways in most cases. Letting the user supply the variable to bind is often a much more scalable way.
4:38:23
beach
emaczen: Here is another reason AIF (and similar) is a bad idea: The expectations of the person reading the code is that the condition in an IF form be a Boolean. for AIF to be useful, it has to be a form with some arbitrary value. So that is a direct violation of the expectations, and the LUV slides by Norvig and Pitman explain (slide number 13 in particular).
4:42:48
beach
emaczen: Again, for AIF to be useful, the condition must be a form that returns something other than T or NIL, and that is a direct violation of the expectations of the person reading the code, as slide number 13 explains.
4:43:33
russellw
I often use generalized booleans in conditions anyway, even when I'm not using anaphors
4:45:32
russellw
Sure. In Lisp, I find the most common example is a recursive function or loop working its way through a list, checking to see whether there are more elements to process: just use my-list as the conditional, instead of (not (null my-list))
4:45:45
beach
russellw: That is also a direct violation of the expectations of the person reading the code, as slide number 13 explains.
4:47:10
russellw
beach, that depends on the person reading the code :) this difference in style is not confined to lisp; in Algol family languages, you would be on the Pascal side and I would be on the C side
4:48:10
beach
It is funny how all these discussions always turn from the general idea to "Well *I* prefer...", showing a total disregard for conventions.
4:48:53
russellw
Actually, I'm afraid you're the one disregarding the conventions built into the language. If this were scheme, you could make that claim. But in common lisp, I am right and you are wrong; the language is explicitly designed to support my style.
4:51:24
russellw
Pitman's memoir of his time writing the language standard is instructive: to his credit, he was very careful to keep his personal preference separate from the consensus that went into the language design
4:52:43
beach
There is a huge difference between "grammatical phrases" of a language, and "idiomatic phrases". The people designing a language only do the former. The latter is a matter of conventions that are established over time. The idiomatic phrases represent a tiny subset of the grammatical phrases. So thinking that all grammatical phrases are idiomatic is a big mistake.
4:52:48
emaczen
I was just curious as to what the language designers had in mind, because generalized booleans do seem to be part of the language since anything but nil evaluates to true
5:33:48
gendl
Hi, who feels like debugging something which looks like lots of fun in CCL (this is for the common-lisp.net site builder).
5:38:01
gendl
that will load the site-generator code, then try to generate the site. It crashes when trying to render libraries.md into libraries.html.
6:25:39
gendl
I'm about to lodge an Issue with http://gitlab.common-lisp.net/cl-markdown/cl-markdown
6:32:22
gendl
Welp, this is a bit embarrassing. I need to get myself more automated with keeping my impls up to date. Maybe should be hooking up with Portacle or cl-travis or something...
6:33:47
gendl
and cl-travis - is that just for running test pipelines online? Do they also maintain downloadable installations?
6:41:36
russellw
between (mapcar (lambda (x) (f a x)) xs) and (loop for x in xs collect (f a x)) is just a matter of taste, right? No reason to e.g. expect one to run faster than the other?
6:45:17
|3b|
(you could expect the LOOP to know XS is a list, or the LAMBDA to add a function call, but implementations might not take advantage of the extra knowledge, or might optimize away the extra function call)
6:46:57
gendl
Well I for one can never decypher loops when I see them. But maybe that's cause i never use them.
6:47:14
russellw
Personally loop is one of my favorite features of the language, but I'm aware not everyone shares my taste in this regard
6:47:25
gendl
I suppose loops can be more efficient in terms of not creating a bunch of intermediate lists when mapping stuff.
6:47:57
russellw
Paul Graham didn't like clos, but that's not because he thinks it's a bad object system, it's just that he doesn't like object-oriented programming in general
6:49:15
gendl
One of my issues these days is dealing with legacy ICAD code which had a proprietary iteration thing called `let-streams`
6:49:30
|3b|
lack of 'sequence' iterator is a big weakness of LOOP, along with lack of portable extensibility
6:51:10
gendl
apparently back in the day, the whole `let-streams` was a competing idea with something else which also didn't make it into the standard -
6:51:25
phoe
gendl: I use Roswell as an implementation manager. I consider it to be mature enough by now.
6:52:50
gendl
oh gheez, i've been out of touch. When SANO first presented it I think it was just doing SBCL
6:54:34
phoe
Or just make it download allegro from wherever it downloads it, and then remove the downloaded binary and symlink it to your original full one. (:
6:55:13
phoe
roswell still tends to explode once in a while (especially during installation), but it's generally stable enough for my use.
6:55:30
gendl
but you have to accept license agreements even to download it (even though it's not functional without a valid license key file)
6:56:36
gendl
but Allegro is constantly being patched - they have a (sys:update-allegro) which you're supposed to run on each platform, which pulls down all the bits, then you run an ./update.exe or ./update.sh to build new images.
6:57:15
gendl
That gets to be tedious on at least (* 3 2 2) platforms (Windows, Linux, Mac) x (SMP non-SMP) x (32-bit 64-bit)
6:57:55
oni-on-ion
is there a way to do (defmethod + ((string a) (string b)) ..) so that for eg. (+ "abc" "def") is "abcdef" ?
6:59:23
gendl
anyway it'd be nice just to do a `git pull` and keep all impls up do date. The whole Allegro (sys:update-allegro) thing appears to be from the old days when people really had to minimize bandwidth so they avoid having you have to download the built images.
7:01:32
oni-on-ion
can't mix generic method and function/macro hmm. thats ok, will shadow or use uiop if need to do this
7:06:13
gendl
I'll just take this opportunity to mention that github is still down (https://status.github.com/messages) meanwhile gitlab.common-lisp.net continues happily serving repositories and welcoming new ones.
7:08:51
shrdlu68
shka_: Some improvement: Implementing my own bit-vectors and hash function gets me ~4s faster.
7:10:44
shrdlu68
Using my own hash-table, I'm 1s faster, but with some promising paths for improvement. All this, without the benefit of inlining yet.
7:12:06
beach
oni-on-ion: It would have been difficult to make + generic since it has a variable number of arguments. The way Dylan did it, was that it specified that + calls binary-+ which was specified to be generic.
7:12:12
shrdlu68
The function sb-c::check-ds-list has 545 samples. My top function has 2055, for comparison. I've looked at that function's source, but I can't tell what it's for.
7:13:30
shrdlu68
At first I used murmurhash for hashing, but, to my astonishment, a function I clobbered together turned out to be faster and have less collisions.
7:16:15
Posterdati
please help, how can I capture the output of a linux process launched by uiop:program from a bordeaux-threads thread?
7:17:31
Posterdati
please help, how can I capture the output of a linux process launched by uiop:run-program from a bordeaux-threads thread?
7:17:56
shka_
(let ((output *standard-output*)) (bt:make-thread (let ((*standard-output* output)) (run...
7:18:21
shka_
(let ((output *standard-output*)) (bt:make-thread (lambda () (let ((*standard-output* output)) actually
7:19:13
gendl
Sano stood there in Montreal in 2014 (I think) and introduced Roswell, and was to tentative and shy about it,
7:19:39
gendl
he was making it sound like a piece of crap that I probably didn't want or need to spend time with at that point
7:20:10
shrdlu68
Posterdati: If using Slime, the manual says the output might go to the *inferior-lisp* buffer.
7:20:18
gendl
not just brilliant, but taking a huge amount of patience to work through tedious stuff
7:20:38
gendl
yes, sorry, disconnected. Sometimes that happens in here, I think. Interleaving threads of conversation.
7:20:39
phoe
shka_: yes, that's because for threads, the default value for *standard-output* is the output stream for the inferior lisp buffer.
7:23:04
gendl
At this point what I care about is someone willing to take the time to keep a central repository of up to date implementations.
7:27:35
LdBeth
ACTION uploaded an image: 屏幕快照 2018-10-22 上午12.27.13.png (227KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/AgLexMDwMtfqahZpNdLjUtAJ >
7:27:55
phoe
sharpsign macros are dispatch reader macros; dispatch, because the reader macro function on #\# dispatches on the character that comes right after it
7:29:00
LdBeth
that's what I feel unfair about: ask a newcomer on features not defined in standard language report
7:29:53
phoe
it's a book for people who are already somewhat competent in Lisp and want to broaden their knowledge about Lisp macros and learn a few tricks about them
7:30:41
phoe
(also, yes, we have colliding names, LoL stands for both Let over Lambda and Land of Lisp)
8:18:13
Posterdati
shka, could be *default-special-bindings* used to achieve uiop:run-program process output in a thread?
8:21:30
Posterdati
shka_: I did: (setf ,,, ,,, bt:*default-special-bindings* (list (cons 'output *standard-output*)))
8:23:51
shka_
this alist is supposed to hold association of special variable symbol and form to evaluate
8:27:19
jackdaniel
how about (let ((#1=bt:*default-special-bindings* (list* (cons '*standard-output* *standard-output*) #1#))) (bt:make-thread …)) ;?
8:47:51
shrdlu68
He should still see something: "Also :output means redirecting the error output to the output stream, in which case nil is returned."
8:53:10
jackdaniel
shrdlu68: I don't see uiop's run-program having default value :output for the error-output
8:54:11
jackdaniel
tbh I find uiop's layer for run-program a total mess (especially when it comes to streams: slupring, mangling and other error-prone walls of code) - I usually use run-program provided by the implementation directly
8:54:43
Posterdati
(simple-inferiors:run "wget" (list -O (format nil "~{~a ~}" (list destination file-url))) :output *standard-output* :copier :character)
8:55:38
jackdaniel
shrdlu68: try (uiop:run-program "wget google.com" :error-output *standard-output*) ; (output!)
8:55:45
jackdaniel
and (uiop:run-program "wget google.com" :output *standard-output*) ; (no output!) :)
9:01:36
jackdaniel
as of meaning of the docstring: if you did (uiop:run-program "foo" :error-output ;output :output *bam*)
9:02:53
Posterdati
(simple-inferiors:run "wget" (list -O (format nil "~{~a ~}" (list destination file-url))) :output *standard-output* :copier :character)
9:03:51
jackdaniel
Posterdati: if you had read what I've said above, you'd use :error-output in the original code
9:04:15
jackdaniel
also, before you try things with thread-local dynamic bindings *First* verify it works from repl as you had expected it to work
9:05:58
jackdaniel
(let ((#1=bt:*default-special-bindings* (list* (cons '*standard-output* *standard-output*) #1#)))
9:06:01
jackdaniel
(bt:make-thread (lambda () (uiop:run-program "wget google.com" :error-output *standard-output*))))
9:06:34
jackdaniel
because that works here locally, so either you have malfunctioning wget, lisp or uiop
9:22:37
Posterdati
(simple-inferiors:run "wget" (list -O (format nil "~{~a ~}" (list destination file-url))) :error *standard-output* :copier :character)
9:38:10
jackdaniel
Posterdati: maybe I didn't suggest it clear enough: try using your implementation's run-program, not uiop's
9:38:42
jackdaniel
for sbcl it will be sb-ext:run-program, for ccl it is ccl:run-program nad for ecl it is ext:run-program
9:41:18
jackdaniel
and if it does the same thing as external-program and uiop, then that could be seen as a nih syndrome
9:47:20
phoe
jackdaniel: it seems to be based on UIOP and specifically solves the issue of capturing process output
9:49:20
jackdaniel
phoe: external-program is just a portability lyaer for implementation-specific run-program
9:49:37
jackdaniel
uiop is a spaghetti with its own code accidently using implementation-specific extensions
9:50:49
jackdaniel
it could use some work, but my point is that external-program aims to be minimal abstraction unlike uiop in this regard
12:02:53
jcowan
beach: Your reference to Scheme preferring strict to generalized booleans is incorrect; generalized booleans (where #f is false and everything else, including (), is true) are common in Scheme
12:04:15
jcowan
Indeed, there is slightly better support for them than in CL. Scheme adds to the classic cond-clause another type of the form (<test> => <expr>) where expr must evaluate to a procedure. If <test> is true, then its value is passed to the procedure, and whatever it returns is the value of the cond.
12:06:46
jcowan
Eh, in f2f conversation I once misattributed a remark to Northrop Frye; it turned out to have been published by the person I was speaking to! "All die. Oh, the embarrassment."
12:49:33
didi
Uh, so the slides "Tutorial on Good Lips Programming Style", by Norvig and Pitman is a treasure trove.
12:50:22
beach
Especially since I believe those two people have more experience in software development, including in an industrial setting, than most people who hang out here.
12:51:09
didi
Unfortunately, as slides go, it's too terse to read out of context. I wish it was an article, or even a book.
13:07:07
beach
Personally, I have way less experience than Norvig and Pitman do when it comes to software development, and way way less experience than they do when it comes to software development in an industrial context. I would therefore not dream of making rules contrary to their recommendations. I would rightly be accused of hubris if I did.
13:09:38
phoe
also, I have a different question - can I get stats for not just the top 100? I'm thinking of using theis data to find some interesting projects that are not in the top 100.
13:15:47
HighMemoryDaemon
What's the reason SBCL doesn't have a bash-like REPL? (By that I mean features such as C-l to clear, up/down error keys to go through your history, etc) Doesn't matter too much when you have Emacs+SLIME but I'm still curious.
13:17:56
jackdaniel
schweers: code is primarily meant for reading. this is an additional hint for the reader (which may be the same person) of what he deals with
13:17:58
schweers
I’m not sure I’m satisfied by that answer. Depending on the algorithm it shouldn’t really matter if I pass in a list or vector.
13:18:35
beach
shrdlu68: No, (unless (null foo) (aref foo n)), or even better (if (null foo) (error..) (aref foo n))
13:18:38
Xach
schweers: i don't know what they had exactly in mind, but one example that i think of is asdf's original design for interaction
13:19:09
beach
schweers: The situation they are referring to is that the reader of the code should get as much information as early as possible when reading the code.
13:19:20
Xach
schweers: this was quite general but in practice there was only only a couple frequently-used operations
13:19:50
jackdaniel
schweers: if you are 100% certain that it will be a simple vector, then using svref in the code passes that knowledge to the reader. I find such hints very useful when I try to understand what's going on
13:19:57
sjl
HighMemoryDaemon: you can also use rlwrap to add the nice editing functionality, so that's another reason reason it's not worth bothering.
13:20:32
schweers
Ah, so if this one operation works with -- say -- both lists and vectors, but other parts of the library will work only with one of the two, one should prefer a specific operation?
13:21:31
jackdaniel
that could be an illustration where such information would be beneficial, but I didn't have exactly that in mind
13:24:52
HighMemoryDaemon
sjl: I haven't worked on it for a while, but I was following through the BuildYourOwnLisp course and I remember they did go over cross-platform readline support. (Well, they 'faked' readline support) http://buildyourownlisp.com/chapter4_interactive_prompt#the_c_preprocessor
14:39:14
phoe
READ error during COMPILE-FILE: Symbol "FUNCALLABLE-INSTANCE-FUN" not found in the SB-KERNEL package.
14:40:50
phoe
The issues seem to be here, https://github.com/hu-dwim/hu.dwim.web-server/blob/ac489a8eac77e3719cbbf093dd32784f8a33d8b2/source/application/session-logic.lisp#L147
14:54:01
phoe
the most simple workaround is to comment out that #+sbcl form; a proper fix would be to ask #sbcl what functionality should be used for source locations now.
14:57:21
jcowan
I think a cond is more readable than (if (progn (this) (that)) (progn (these) (those)))
14:59:08
jcowan
even if it's just one or the other if branch that needs multiple forms, I prefer cond
15:00:55
jcowan
I never got an answer to the question about the propriety of using qualified internal symbols (other than for testing, debugging, etc.)
15:01:11
jcowan
seems like it would be a code smell to me: if you need outside access, export the symbol
15:12:11
jcowan
I'm kicking around ideas for adding modularity to ISLisp. I think that DEFPACKAGE and IN-PACKAGE suffice (and can be implemented without having packages at runtime).
15:59:15
pfdietz
I ask because the global package namespace is a source of real aggravation in CL. Collisions are rampant in quicklisp.
16:00:24
Xach
pfdietz: I don't often see people write about encountering the conflicts in real life.
16:00:55
gendl
pfdietz: wasn't there some effort to portableize Franz' package-local hierarchical package names?
16:01:27
gendl
Also what about asdf systems names? Those can get collisions too. How about system-local systems...
16:01:46
gendl
But, I know not much of what I speak. It could be opening cans of worms that we'd best not.
16:02:08
pfdietz
ASDF system names can be made long without great pain, so collisions can be largely avoided.
16:02:09
gendl
Having the possibility of conflicts also forces people to collaborate more, which might have its upsides.
16:02:15
Xach
I think package-local nicknames would be nice. I think they should be implemented differently from how they are right now.
16:02:33
pfdietz
But the package namespace includes concise nicknames, which are much more prone to collision.
16:03:51
Xach
pfdietz: I've been working on a design that does not involve any new packages, but only new keyword arguments and return values from existing standard functions.
16:04:41
Xach
I'd like a system that can be used without loading portability packages or shims or anything like that.
16:06:19
gendl
jackdaniel: regarding UIOP and its notion of superseding several other targeted portability libraries, I understand that other targeted ones can have more purity and appear less "accidental," but from a practical standpoint, uiop is so ubiquitous and necessary for asdf (as long as asdf remains predominant, which is a discussion for another day), as far as I'm concerned, the more of the routine portability stuff that can be
16:06:23
pfdietz
I have wondered if the global namespace(s) could be made more first class. A sort of internal containerization systems for Lisp.
16:08:06
gendl
so i'm hoping more people can make a sincere effort to understand and contribute maintenance and improvements to uiop & asdf, rather than simply dissing them.
16:08:57
gendl
I also wonder if there could be broken out a "diet" version of ASDF which doesn't deal with upgrading itself -
16:09:33
pfdietz
Curation and enrichment of QL systems seems to me to be an important area of focus for CL, perhaps the most important.
16:10:47
gendl
how much simpler could a "lite" ASDF be if it could assume that it's being loaded into a clean image (or re-loaded on top of itself with the same version). From what I've seen over the years it seems like Faré had to dump inordinate amounts of resources into making ASDF be able to upgrade itself in-place from all kinds of ancient versions.
16:12:39
gendl
By the way - PSA - UIOP is separated out from ASDF for a reason. Application and library code shouldn't be depending on anything form ASDF or its sub-packages. Application and library code can freely depend on UIOP stuff (that horse has pretty much left the barn).
16:14:39
gendl
Occasionally I'll run into a quicklisp library which still is assuming that ASDF is present, in places other than its .asd file. This kind of thing is easy to miss during development because ASDF is usually always there in development. But then things start failing when trying to make standalone executables and runtime builds.
16:15:54
gendl
Maybe use asdf:system-relative-pathname during development, isolated in development-only scripts and stuff
16:16:29
Xach
gendl: I also think asdf calls should not be present in project source code, but it's a tempting convenience.
16:17:02
gendl
but for what it's worth, I certainly can't recommend using that in an actual library source code. How can one assume that source code will even be available at runtime, to think that an asdf:system-relative-pathname will even exist?
16:18:39
gendl
... a development style that assumes source code is always there with the application, all the time. That's an example of the kind of development style which keeps tending to isolate CL on its own little island.
16:19:36
Xach
gendl: Yeah? Do you feel it's unlike javascript, python, ruby development in that regard?
16:20:31
gendl
Well at least some of those are described as "scripting" languages, for example Python and Perl,
16:21:18
gendl
And people often (incorrectly) refer to CL as an "interpreted" language. Treating it like Python or Perl probably only serves to reinforce that misconception.
16:22:31
gendl
Maybe my point is more that with that style of CL development and deployment, the fact that it's Lisp is always in the user's face, whether they want or need to know about that or now
16:22:53
gendl
Sometimes it's advantageous to be able to deploy a program and have it just run like any other program.