freenode/lisp - IRC Chatlog
Search
21:54:19
phoe
pjb: there was this article of yours methinks where you showed how to run a LISP 1.5 theorem prover on modern Common Lisp
22:10:22
phoe
minion: memo for mazoe: https://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html
23:34:21
cheryllium
What's the easiest way to copy a file without using a library? (I could read from the file and write to the output location using with-open-file, but I'm wondering if there's a better/easier way.)
23:39:38
aeth
pjb: Unrelated to that particular action, but what's generally wrong with libraries are the lack of: (1) performance, (2) documentation, (3) anything else that comes with polish
23:41:39
pillton
cheryllium: I would probably use uiop since it provides other file/directory operators which aren't provided by the standard.
23:41:45
aeth
Suzuran: Well, other languages have things sort of like a library library. Framework ecosystems that are basically subecosystems within the language ecosystem.
23:42:11
pjb
No, the real problem with libraries is that they're NIH. Hence cesarum: My very own library invented here! (and also, since I've been programming in CL since 1996, it has some anteriority ;-) ).
23:42:15
Suzuran
I feel like I should say something about synergies here, but I feel like I should be shot for it.
23:42:54
aeth
pjb: But I can understand why people would NIH if they need performance, or documentation, or a reasonable architecture, etc.
23:42:55
pjb
and I note that Faré implemented his own uiop library instead of using cesarum (or even alexandria).
23:42:56
cheryllium
I'm not /opposed/ to using a library, I simply asked if there was a way to do it without one. Copying a file seems like a common enough operation that maybe the language had a nice built-in way to do it.
23:43:28
pjb
cheryllium: amongst (apropos "COPY-FILE"), there's a high probability to find an implementation dependent one.
23:43:43
aeth
pjb: A lot of libraries are things written naively in CLOS, last updated 8 years ago in the custom (i.e. court-untested) LLGPL license, with absolutely no documentation but the source code. This is only a slight exaggeration.
23:44:22
cheryllium
Okay, thank you. I was not trying to start any sort of war here, sorry if it was a sensitive topic for you.
23:45:03
pjb
cheryllium: for years people have been complaining for the lack of CL libraries… so yes, it's rather sensitive to put it that way.
23:45:42
cheryllium
What, really? But CL has so many libraries for everything, I can't fathom that being a real complaint. I usually hear "lack of documentation" as the main complaint :P
23:46:03
edgar-rft
cheryllium: use WITH-OPEN-FILE to open the source and the destination file, and a binary-stream to copy all bytes from the source to the destination. No library needed for that.
23:46:07
aeth
cheryllium: CL has 8 libraries for everything, each solving a different 60% of the problem ime.
23:46:18
cheryllium
I usually run into the opposite problem where there are too many libraries and I don't know which to pick!
23:46:26
pjb
Just type M-. on any result of (apropos "COPY-FILE") and copy-and-paste the code into your own library ;-)
23:46:57
cheryllium
But as a coder in general I do try to avoid libraries for things I only need to do once because it adds an extra dependency.
23:47:26
pjb
cheryllium: most of those libraries are already dependencies (of other libraries you are using).
23:48:02
pjb
Again, the mere fact that (apropos "COPY-FILE") gives me 6 different functions NAMED copy-file in the current scratchpad repl, demonstrates it!
23:48:16
aeth
alexandria and uiop and more specific libraries like bordeaux-threads, etc., cover portability issues and missing features. Expect to use them.
23:50:04
aeth
As an example of a missing feature, higher order functions without partial application leads to a lot of unnecessary lambda boilerplate, but alexandria's curry and rcurry fix this.
23:50:18
aeth
Alexandria also has some iteration constructs and types that really ought to be in the language itself.
23:51:28
cheryllium
Oh Alexandria has curry implemented? I will have to pass that along. I know someone who tried to write a curry macro, he was frustrated by the lack of it in CL
23:52:18
cheryllium
I'll do some reading on UIOP, I haven't used it before but it sounds very useful, maybe essential
23:52:32
pjb
(defun curry (f &rest largs) (lambda (&rest rargs) (apply f (append largs rargs)))) (mapcar (curry '+ 2) '(1 2 3)) #| --> (3 4 5) |#
23:53:45
aeth
curry and rcurry have functions and compiler macros. I'm assuming the latter are much better, where possible.
23:54:14
cheryllium
I believe that's what my friend ended up with too, I think he may have started out writing a macro but realized at some point that a function was sufficient.
23:58:16
cheryllium
I'm reading and it says UIOP comes with ASDF - If that's the case, how should I refer to UIOP functions? Do they exist in the asdf namespace then?
23:58:59
cheryllium
Do I need to (require :uiop)? (I guess that's the source of my confusion- does requiring asdf take care of that?)
0:41:03
aeth
pillton: That's not a good convention, though, because most internet domains don't have hyphens, but when you have a multiple word package, you should use hyphens.
0:41:31
aeth
pillton: So either you reserve a mostly useless extra domain with the hyphen in there or you basically violate CL conventions by running multiple words together hyphenless
0:42:20
pillton
Yeah. I hate reversed internet domain name. That was the only place I could find which encourage dots.
0:42:43
pillton
Sorry.. I could find, in the time I allocated for the search, which encouraged dots.
0:45:51
PuercoPop
cheryllium: no need to requirement, you can use them from the uiop package, which just rexports all symbols from the the uiop/* packages
0:46:54
PuercoPop
however if you are going to submit the project to quicklisp, you'd have to declare uiop as a dependency
0:47:05
pillton
aeth: I can't remember what encourage me to use dots. It has been 10 years since I asked the question.
0:54:36
Suzuran
Hey, is the sense of (> x y) supposed to be backwards of what you would expect? (T if Y is bigger than X)
0:58:34
aeth
Try the case where (= x y) so you can see if you accidentally negated it (i.e. <= instead of >) or accidentally reversed the comparison somewhere (i.e. < instead of >)
4:03:54
Bike
because there should be an even number. one keyword and one value, two keywords and two values, whatever.
4:04:46
krator44
ok so i have a function call like this (concatenate-with-divider :divider ", " :items '("a" "b" "c" "d"))
4:12:10
White_Flame
there's a ton of stuff in there. I certainly don't have it all memorized; that's what google's for
4:16:21
nyef
Is it even possible to do with format, without using one invocation to prep the control string for another?
4:18:56
White_Flame
~/ can call an aribtrary function, so that's technically not nested FORMAT strings
4:19:58
White_Flame
but I did think that there was some directive for "pull this arbitrary field from the function parameters" to substitute inline literal parameters. I guess not
4:20:08
loke`
nyef: I'm not sure that's possible. ~{ traverses down into a sublist, so it won't be able to access the custom separator.
4:21:27
loke`
You normally don't want to create dynamic format strings, as that will prevent the formatter to be compiled.
4:22:34
nyef
White_Flame: There's a way to pull a literal parameter, but the problem is that the parameter isn't available at that point.
4:29:08
White_Flame
krator44: then it's probably a good idea to just roll your own, to get familiar with things
4:30:01
loke`
White_Flame: FORMAT. The only reason not to use it is if you need to have the separator customisable.
4:30:21
beach
Here is a psychological phenomenon that ought to be documented. People often complain or at least are surprised that some function they need is not in the standard. But then they gladly turn around and use a language that doesn't even HAVE a standard.
4:31:28
White_Flame
if a langauge comes with a rich standard library, even though it's not an official ANSI/ISO/FOOBAR Standard, it's still practical to use
4:32:18
White_Flame
and those standard libraries have full documentation, even if the language itself isn't "standardized" in the way CL is
4:33:22
aeth
I think the reason people are shocked that something isn't in the standard because the way most people learn CL probably goes like this: (1) reimplement everything from a small subset of the language. (2) gradually replace things with things the language provides that they're shocked the language provides.
4:34:11
White_Flame
another thing is because of the standardization process CL got locked into, the language hasn't updated to bring new stuff into the standard itself. While other "unstandardized" languages release new versions that keep up with the times
4:34:14
loke`
aeth: I thin kyou're right, and it also points out that Lisp should be taught differently. It should be taught as a practical language to do stuff in.
4:35:59
White_Flame
Lisp is appropriate for both purposes: Exploring the nature of languages in a academic dissection & build-up, and for practical use. I agree that too much has been only put on the former
4:36:08
aeth
It'd be interesting to do a survey as to how many people went through a phase of "oh wow, that's in the standard? time to simplify my old code that poorly half-reimplemented something in the standard"
4:36:15
beach
White_Flame: So if they just ignored the Common Lisp standard, they would be in the same situation. Instead, they complain.
4:36:40
White_Flame
beach: people are used to large standard libraries, I think it's as simple as that
4:37:02
aeth
White_Flame: "Unstandardized" languages have one official, dominant version and a bunch of much smaller, much less feature complete versions that are generally targeting niches like JVM and JavaScript.
4:37:05
White_Flame
(and yet C and C++ are still wildly popular, with their ad-hoc library ecosystem similar to lisp)
4:37:48
aeth
White_Flame: CL is healthier than most other languages because it has more than two major implementations, more like C++ than Python or Ruby.
4:38:04
aeth
But that also means that there's a concept of portability that holds back what you can do.
4:38:37
White_Flame
right, it'd be nice for all the trivial-* portability layers to become an add-on standard
4:38:38
pillton
White_Flame: I have encountered people which use the terms language and library as if they are the same thing.
4:38:39
aeth
If we were all using SBCL, you *could* just extend sequences, for instance. (This is a major complaint missing feature.)
4:43:28
aeth
pillton: how do you distinguish between the language of CL and the standard library of CL?
4:44:06
aeth
You could, if it were designed that way, say that e.g. do and loop and mapfoo etc. are actually really just tagbody + go, eventually. Which they usually are. But it's not required to be that way.
4:45:41
pillton
The common lisp hyperspec outlines everything a conforming common lisp implementation is to provide.
4:50:42
beach
PuercoPop: Yes, I think you are right. People only look at "out of the box" and when it comes to Common Lisp, they confuse "out of the box" with the standard.
4:52:47
beach
PuercoPop: That also explains why some people complain about some missing feature in the Common Lisp standard, but they gladly use C or C++ in which the feature is missing from the standard as well. Except the feature is provided by the Unix environment they are using, so it's "out of the box".
4:53:38
White_Flame
of course, that's comparable to implementation-specific features, but they tend to learn for CL tutorials not SBCL/CCL/CLISP/etc tutorials
4:54:39
krator44
i wasn't really complaining but.. it is nice when a language has an extensive standard library
4:54:48
beach
White_Flame: Yes, indeed. Again, they don't seem to care, probably because they use the only dominant implementation.
4:56:58
beach
krator44: See, that's the problem. Languages such as C or C++ do not have extensive standard libraries. They come with Posix, which should probably be compared to Quicklisp for Common Lisp. And languages like Python don't have a standard, so they don't have any standard libraries.
4:58:41
beach
White_Flame: In my definition of "standard", I require a document describing the library or language that is published by an organization different from the one that provided one or more implementations.
4:59:27
White_Flame
anybody can have "the standard", if they've documented it and are the most common point of reference
5:01:56
White_Flame
and I"m not alone in my opinion that while the ANSI CL standard might have been desirable back in the industry heydays of Lisp, it's an albatross for progress now
5:02:41
White_Flame
it foments thinking like Beach's, where there's no true successor until it's been approved by an industry standards body
5:03:56
pillton
The common lisp standard emerged from a critical mass. The existence of the standard doesn't inhibit the formation of a new critical mass.
5:04:00
White_Flame
and nothing is accepted to update the standard, because it's assumed to be an undertaking of the industry, with commercial vendors funding & organizing standardization committees
5:04:39
White_Flame
there is resistance to a new critical mass from adherence to the existing standard
5:05:06
White_Flame
and again, the attitudes I've seen are dismissive of any new formative masses if there's no standards bodies involved
5:05:54
White_Flame
now, there are things like Clojure, which are mostly clean-room of CL's specifics, which don't necessarily require transition from Common Lisp's audience
5:07:44
beach
White_Flame: I think you definition of "standard" makes it pretty useless. With that definition, there could be simultaneous, conflicting standards, and the definition of the standard could change over time in arbitrary ways. Any project leader in industry who decides to use such a language should be fired.
5:08:21
White_Flame
just look at academic publishing. There's rinkydink publications that nobody takes seriously, and there are serious publications that are. Who decides?
5:08:44
White_Flame
Which standard do you use to determine Real Standards Bodies, vs just the rinkydink ones?
5:09:07
loke___
beach: But unfortunately, Python is taken seriously in industry. It's horrific but true.
5:10:53
pillton
White_Flame: I'd gladly switch to a lisp which i) was a lisp2 ii) defined something better then packages iii) had first class environments and provided a CL compatibility layer.
5:12:06
beach
White_Flame: A project leader for a major project in industry who is unable to distinguish between serious standard bodies and the others should be fired.
5:25:44
krator44
anyway i don't see how a language whose defining characteristic is its ability to specify domain-specific syntax would be encumbered by some kind of a standards setting committee
5:27:56
krator44
where the standards committee has trouble coordinating its efforts but features cannot otherwise be added to the language
5:29:20
White_Flame
ad-hoc features certainly can be added to C in the same way it is in Javascript, by "transpiling"
5:32:00
beach
White_Flame: My favorite characterization of the work done by people like project leaders and engineers is that they are "pruners of decision trees". There are just too many decisions to be made, and evaluating each possible outcome would take too long and cost too much. These people use their experience to eliminate large parts of the decision tree because they estimate that the decisions therein are inferior to the others.
5:32:02
beach
If decisions could be made base on objective criteria, these people could (and should) be eliminated in favor of low-level admin staff or even spreadsheet programs. Unfortunately, the software industry often employs project leaders with completely insufficient training and experience. The result is, as we observe, projects that are years behind schedule and an order of magnitude over budget.
5:32:41
White_Flame
well, from the business end it's widely believed that everything is based on metrics
5:33:12
White_Flame
no metrics and objective predicates are sufficient to rely on for business decisions
5:33:46
beach
White_Flame: Yes, including which standards bodies are serious and which ones are not.
5:33:53
White_Flame
right, that's an additional confounding factor. That's why it doesn't work in practice, yet it also doesn't really work in theory
5:35:34
White_Flame
beach: my point about selection of standards bodies extends to selection of whether or not python's published specs count as "standard". Who is to say that they're not a valid publisher of that standard?
5:36:00
White_Flame
they've had maturity and continuity of being the standard bearer, regardless of the quality of the language
5:37:17
beach
Whenever the so-called "standard" is written by the same set of people who provide the implementation, as a project leader, I would be very reluctant to consider it a good basis for a project because of what I said above.
5:37:58
White_Flame
sure, that's your preference. But it doesn't make it more or less qualified as a "standard"
5:40:00
beach
In a programming project, it is less important to determine the exact word for it, than it is to determine whether it can be relied upon as a basis for the software to be developed.
5:40:30
White_Flame
well, your initial argument was that the word "standard" should not be applied to python
5:42:23
White_Flame
right, that's the shorthand implication I used for your wording of " I require a document describing the library or language that is published by an organization different from the one that provided one or more implementations."
6:07:11
ecraven
I haven't tried yet, but they should be on bitsavers, and it seems Daniel Seagraves is working on finishing a 5.0 release (which was in a prototype phase when LMI ended). That can be found https://s3.us-east-2.amazonaws.com/ds.storage.0000/Lambda-Release5.tar.gz
7:05:08
ecraven
I'm not good with autotools, just running autoconf or autoreconf does not lead to a working configure script here :-/
7:06:05
ecraven
well, this is just my lack of knowledge on how to properly run things :-) thank you!
7:11:24
ecraven
loke___: hm.. when running ../src/lam in examples (where ld.conf is) after copying tapes/ there, I get SDU:open: No such file or directory
7:19:02
p_l
I need to add LD to my collection...and patch it for virtual network, same with other emulators :-|
7:20:33
ecraven
loke___: http://bitsavers.trailing-edge.com/bits/LMI/ should have the roms, but I have no idea where :-/
8:13:17
beach
What should I call an operation that transforms the list (x y1 y2 ... yn) to the list ((x y1) (x y2) ... (x yn))?
8:16:58
beach
I have this impression that there is a kind of standard name for it. But maybe I am thinking of some kind of APL operator.
8:16:59
flip214
(mapcar (curry #'cons (first input)) (rest input)) ..... hardly a function, right? ;)
8:17:39
beach
The thing is, I need to use it several times in different methods, so I had better make it a separate function.
8:23:30
beach
It is not used in a macro. It is used in methods for canonicalizing declaration specifiers so that (ignore a b c) become ((ignore a) (ignore b) (ignore c))
8:33:27
White_Flame
is there a common name for ((key val) (key val) ...) style lists? we call them m-lists
8:35:27
jackdaniel
is there a point in using (and providing accessors) such kind of structure instead of alist?
8:36:12
White_Flame
it works very well for our Member matching operation (hence the "m" in m-list), and it serializes better to languages that can't do dotted lists
8:45:06
xificurC
please please tell me how can I run an sbcl command without the initial splash screen?
8:46:01
xificurC
I'm comparing various scripting runtimes' startup time for a hello world script. So I'm looking for the equivalent of `bash -c 'echo hi'`
8:47:01
Josh_2
Going out on a limb here but you put #!/bin/sbcl --script ?? at the top of the program?
8:53:48
xificurC
jackdaniel: --noinform was it, thanks. It's not in `sbcl --help` so I didn't find it
8:54:33
xificurC
Josh_2: I am running from the command line with no files, so there's no program to put a shebang into
8:54:41
jackdaniel
xificurC: for automatic scripts (to time them) running it as script (as others pointed out) will be better though
8:55:02
xificurC
shka: while that's a good option it would add more overhead to the startup, which is what I'm trying to measure
8:56:58
xificurC
jackdaniel: what do I lose with --no-sysinit? What is it that it actually skips loading?
8:56:59
jackdaniel
or --non-interactive to skip both disable-debugger and quit according to the manual
8:57:31
jackdaniel
I *think* that it skips loading system-wide .sbclrc placed *somewhere*, which probably is non-existent by default
8:59:09
phoe
jackdaniel: quicklisp's loader is put in .sbclrc though, so I wouldn't claim it's non-existent by default
9:01:24
ogamita
beach: (defun distribute (e list) (mapcar (curry #'list e) list)) (defun distribute (e list) (cartesian-product (list e) list))
9:03:10
ogamita
or left-distribute, and (defun right-distribute (e list) (cartesian-product list (list e)))
9:05:19
beach
ogamita: Thanks. But in fact I lied. It is not really a list of items, but a concrete syntax tree, so I can't use standard list operations.
9:06:18
ogamita
beach: I know you know how to write it, I just cannot resist to the pleasure of writing them!
9:07:39
minion
mazoe, memo from phoe: https://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html
9:09:33
loke`
It is funny how in the olden days, people wrote Lisp code by putting newlines once they hit the end of the line.
9:10:24
loke`
ogamita: Thanks for remidning me, but the joke about WJ still remains (for it was a joke)
9:10:24
ogamita
loke`: they had no choice, it wasn't an end-of-the-line, but rather an end-of-the-punch-card.
9:11:06
loke`
ogamita: right, but I think in many case it would have made sense to put the line break at more sensible places.
9:11:28
loke`
That said, now that I'm thinking of punch cards, that probably wasn't an issue, and such indentation/lie breaks probably didn't help on the cards.
9:12:22
ogamita
loke`: No, actually they wrote code on paper first, and then the punch cards could be filled (by secretaries actually) and weren't used to be read. Then they assumed a pretty-printer for the listing.
9:13:13
phoe
This is a daily reminder that we have a slowly growing project called Lisp Guild, where people who have some tasks to be done can post them, and people who want to practice and gain experience on real-life code can grab these tasks and do them. https://github.com/Lisp-Guild/lisp-todo/projects/1 <- currently 4 tasks to be done, but feel free to post more.
9:13:28
ogamita
loke`: yes. The only reason to split an expression over several punch cards would be to help debugging the programs (replacing a card by another).
9:13:49
loke`
But I never thought that the card was a 1-to-1 mapping to the paper. That's why they had programming forms after all?
9:13:49
loke`
http://blog.bounceweb.com/wp-content/uploads/2011/06/old_cobol_formcobol-as-a-programing-language.jpg
9:13:52
phoe
So if you, who's reading these words, wants to get some Lisp practice on small, well-defined tasks while being able to get help from the Lisp community - grab one of these.
9:26:36
jackdaniel
if I'll get on roll, I'll maybe manage to merge some code and make an iteration report