freenode/#lisp - IRC Chatlog
Search
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.
16:24:55
gendl
And regarding JS, Python, Ruby, Perl, shell, haskell: How many other languages make it a matter of routine to assume that their build system is always loaded and available during production running of an application.?
16:25:12
Xach
It would be helpful to have a guide to "how to write code so it can be easily delivered"
16:25:44
Xach
I don't think that's a primary motivating factor for many people, but it would be nice to know how, for those for whom it is
16:26:42
gendl
The fact that it's "not a primary motivating factor" for many people, to me, is a red flag, and one of the things that keeps CL out of the mainstream.
16:26:44
Xach
something as simple as a checklist of little things that make it harder would be handy
16:27:27
Xach
People are motivated by many things and I don't think "take CL mainstream" is high on the list for many people.
16:27:55
gendl
I started a development blog ages ago that started to address this kind of thing, but kind of abandoned it for the past 5 years or so..: http://gendl.blogspot.com/2013/03/saving-images-with-asdf3.html
16:31:28
shka_
gendl: how many languages assume that user is supposed to modify deployed application by editing the source code?
16:32:29
gendl
shka_: Ah I see what you're saying. CL applications are potentially programmable after they're deployed. Sure, that's a feature and it makes sense to take advantage of it in some circumstances.
16:32:47
gendl
But I think the question is more of an application-specific one than a language-specific one.
16:33:17
gendl
the question should be "how many applications assume that user is supposed to modify deployed application by editing the source code?"
16:34:37
gendl
The fact that CL can do both is a great testament to CL. But it doesn't mean that 100% of CL applications must therefore necessarily ship with a development and build environment built into them.
16:35:51
gendl
ok.. and that Z% of users can range anywhere from 0% to 100%, depending on the application domain and a bunch of other factors.
16:38:38
didi
I disagree with the "mainstream" statement, but I'm with Xach: an article about deploying applications would be nice.
16:39:32
gendl
I worked at Ford in ICAD in the 1990s. (ICAD was a CL based knowledge based engineering system with a solid modeler -- in principle an ICAD application could automate tons of manual CAD design). ICAD was able to demonstrate some fantastic, amazing, miraculous, unbelievable things from a development seat. But very few applications ever made it out into actual enterprise-wide mission-critical production. We sucked at actually
16:39:32
gendl
deploying anything into production. And I feel one reason for that is the environment is so geared toward development that it might even seem to actively _discourage_ production deployment.
16:42:32
gendl
And I suppose people are entitled to their opinions. This attitude of "well, CL people don't really have production deployment or mainstream acceptance as a priority" may be fact today, but nothing says it has to stay that way foreve.r
16:46:24
shka_
gendl: i honestly think that you are making this issue to appear larger then it really is
16:47:46
gendl
shka_: maybe I'm making a mountain out of a molehill. Someone said it's a matter of subtle mindset, and I think that's right.
16:48:19
gendl
But the practical ramification that started this rant is when things like `asdf:system-relative-pathname` show up in mainline application or library code.
16:50:01
gendl
didi: No. You can only think of it as a package which is available in a development mode, when all your ASDF systems are actually present.
16:51:00
gendl
If you want your application to be forever bound by the baggage of its ASDF system and source codebase, then that is of course your right to do so, but it should be done deliberately with eyes wide open.
16:51:43
gendl
alexandria:foo is not assuming the presence of a certain ASDF system in your filesystem. It's just doing some generic portability convenience thing for you.
16:52:08
gendl
And by the way, a large percentage of what's in alexandria is likely available in UIOP as well.
16:52:51
gendl
if UIOP can supersede cl-fad, alexandria, and several other little "trivial" libraries, I for one would find that a happier state of affairs.
17:03:35
gendl
Xach: I appreciate the way you state facts as you see them (whether happy facts or not), you sometimes express your desires ("I wish.."), and you avoid idle speculation.
17:03:45
didi
gendl: I see. Thank you. Personally I don't use ASDF functions, but despite morally, I can't see it been different from any other package.