freenode/#lisp - IRC Chatlog
Search
4:07:51
jasom
LdBeth: most lisp implementations provide a way to run a program. It is possible that uiop:run-program will do what you need
4:11:01
jasom
hmm (uiop:run-program "htop" :output :interactive) didn't work as I expected, so maybe not
4:11:02
PuercoPop
jasom: My knowledge of terminals is not very deep. But I would imagine that the REPL wouldn't play nice with a program that takes the whole screen for a while. Like htop or vim.
4:11:36
jasom
PuercoPop: the REPL is uninvolved until the form returns in most implementations, so I wouldn't think that would be a problem
4:12:11
jasom
(uiop:run-program "htop" :output :interactive :input :interactive) ;; works on sbcl on MyMachine(tm)
4:12:49
jasom
It does not work on CCL, which makes at least some sense because ccl has a separate REPL thread IIRC
4:17:09
jasom
PuercoPop: for fancy REPLs there is a good chance that the program won't return the tty to the same state as before it was run, so those might have a problem. SBCL's REPL is so minimal it's not a problem
4:17:42
jasom
LdBeth: this works on every lisp I tried except ccl: (uiop:run-program "htop" :output :interactive :input :interactive)
4:18:27
PuercoPop
I've ran into issues with two programs writing to the same terminal (webpacker and vis, the editor).
4:19:02
jasom
There's a patchset for CCL that doesn't spawn a separate thread for tty interactions, but it's not maintained anymore
4:20:14
jasom
ealfonso: there are several, each with different strengths and weaknesses. I usually just write directly on top of clack because I'm a control freak.
4:20:46
PuercoPop
LdBeth: you might be interested in cl:ed, http://www.lispworks.com/documentation/HyperSpec/Body/f_ed.htm
6:00:15
edgar-rft
iqubic: some mac-specific GUI stuff, see https://en.wikipedia.org/wiki/Cocoa_(API)
11:53:13
light2yellow
what is the official name of standard library? the one which contains e.g. cons, car, cdr functions
11:54:06
light2yellow
or is it being put like "the implementation of the dialect should define blablabla"?
11:56:10
jackdaniel
any conforming implementation must have these two packages and symbols defined in the standard
11:56:19
light2yellow
I also find it hilarious that ANSI publishes a "standard", and then sells it for money. how is this a thing? same with C
11:57:30
jackdaniel
I don't understand many things as well, but texinfo sources are public domain and there are freely available standard resources build from them
11:58:57
light2yellow
"I will publish a standard, proclaim one to be so, but make it closed-access so that..." what? I doubt they earn any money, that's firstly, secondly, why are you called ANSI, you should be a non-commercial org
11:59:39
light2yellow
yes, of course, finding it or downloading from speacial resources is not an issue
12:05:36
edgar-rft
light2yellow, the "Common Lisp Standard" already includes the standard library. The symbols of the standard Libary there are called "the symbols in the COMMON-LISP package".
12:09:35
theemacsshibe[m]
ACTION funcalls set-difference with jackdaniel's answer and the perfect one -- keeps getting NIL
12:11:07
devon
http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_1-9.html 1.9 Symbols in the COMMON-LISP Package
12:11:57
light2yellow
jackdaniel: I wanted to hear what is understood under standard library in CL, in more or less official form, since there's no such term as "standard library". now I know that there are packages, and COMMON-LISP is the standard package (i.e. not technically called "library"), and that is where standard "symbols" are defined. that's what I wanted to know
12:14:03
edgar-rft
the full bureaucratic story is here: http://www.lispworks.com/documentation/HyperSpec/Body/01_e.htm
12:20:07
edgar-rft
AFAIK sympols are imported, not inherited. So it's a matter of importance, not inheritance :-)
12:20:07
light2yellow
now, another question. is it up to implementation and/or interpreter to define what cons (as a function: http://www.lispworks.com/documentation/HyperSpec/Body/f_cons.htm) yields? for example, (cons 1 nil) => (1) -> a list, okay. (cons nil nil) => (NIL) -> same as (), an empty list, okay. (cons nil 1) => (NIL . 1) -> so, specifically a dotted pair. I know that cons is a dotted pair and a list is implemented
12:20:09
light2yellow
using cons, but won't it break somewhere if I was to pass it somewhere else, something that expects a list - since this is not a list, because a list ends with nil
12:21:51
Xach
light2yellow: in some cases it is specified that something will error if the object is not a "proper list"
12:22:01
theemacsshibe[m]
A list is just some nice conses where each CDR is just more of the list or nil
12:22:37
theemacsshibe[m]
List recursion like mapcar and loop .... in will fail because the final cdr isn't another cons, saying it's not a proper list.
12:25:06
light2yellow
regarding first part of the question, is it up to interpreter's pretty-printer to show me either a list, or a dotted pair, or does it show me exactly what objects will be yielded and passed?
12:27:27
theemacsshibe[m]
I believe implementations have to make a fancy list printout if possible, dotting the last cdr if needed.
12:30:53
theemacsshibe[m]
Also what books can I give GNU_PONUT to learn Lisp? They know some C(++) and Python already.
12:31:21
Xach
light2yellow: that is why '(defun foo () bar) at the repl prints as (DEFUN FOO () BAR) and not (DEFUN FOO NIL BAR)
12:31:38
Xach
theemacsshibe[m]: i like practical common lisp and paradigms of ai programming, both available for free.
12:33:32
theemacsshibe[m]
I see. I've finished PCL and started Norvig's works, and they're great, but idk how accessible they are for people used to algol syntaxes.
12:35:44
Xach
it takes time to get used to new syntax no matter what. some people take less time, some more.
12:36:54
light2yellow
so, then I guess interpreters will yield a list if car of the last cdr of the last list cons is nil
12:38:57
Xach
light2yellow: i don't really understand what operation you mean by "yield" or "return" - if the data structure exists, it exists.
12:39:42
Xach
what happens with a list (whether proper, dotted, or circular) depends on what you try to do with it.
12:39:46
theemacsshibe[m]
Also, reading A Gentle Introduction to Symbolic Computation made me see NIL technically isn't (NIL . NIL) since NIL is just a symbol with odd traits
12:40:08
jackdaniel
yield is usually used in coroutine context, it is more related to execution than returning anything
12:42:02
splittist
light2yellow: the 'interpreter' is doing three things: reading, evaluating, and printing. It might be easier to think of them separately. The reader returns an object or signals an error, for example.
12:43:27
jackdaniel
lisp code may be interpreted, most implementations do at least minimal compilation though
12:44:01
theemacsshibe[m]
CLISP (is dead, and) interprets bytecode. It's not very fast and does type checks all the time, so it seems interpreted basically.
12:44:20
phoe
theemacsshibe[m]: not actually dead, it has some recent commits although it does not have a recent release
12:44:20
light2yellow
jackdaniel: yeah, actually, true. I remember reading smth on this (regarding C interp)
12:45:13
jackdaniel
also clisp does a lot of optimizations before it produces bytecode (and it has jit infrastructure etc etc)
12:45:49
phoe
theemacsshibe[m]: a lot of the CLISP friendliness comes because it comes with readline bundled
12:45:50
jackdaniel
I would think twice before calling clisp an interpreter, but sure, lines are blurred at some cases
12:46:20
light2yellow
so, it translates input to an internal representation? if so, it's more like jvm, which isn't considered an interpreter. but python vm (despite the name) is, since it just eval()s stuff. so, I suppose CL interps can do both - translate into IR (internal representation) or eval()?
12:48:17
theemacsshibe[m]
The only parts of the system that cares about how the code is run are the user, their patience and any nearby clocks.
12:53:14
MetaYan
|3b|: I found that you mentioned "https://www.cliki.net/site/account?name=83.47.187.150" some months ago. Did you contact someone about it?
12:55:50
MetaYan
|3b|: Ah, I found "https://www.cliki.net/site/account?name=94.123.198.15" as well now, which undid some of the undo's, but not all
13:02:54
shrdlu68
Given that there's this much interest in readline support in sbcl, how come it hasn't been implemented yet?
13:06:01
light2yellow
Xach: you said it can break (see my question about pretty-printing the object which cons returns), but I've discovered there's type-of function, and (type-of (cons 1 nil)) and (type-of (cons nil 1)) both return CONS, so I rpobably don't understand how it can break, since type of a list is CONS
13:07:49
jackdaniel
if you call a function, which is meant to work on lists, on a cons (which is not a list)
13:12:49
jackdaniel
from the glossary: proper list n. A list terminated by the empty list. (The empty list is a proper list.) See improper list.
13:17:12
light2yellow
shrdlu68: that actually makes sense, since if I nest conses, the only way for them to be a proper list is to have cdr of the cdr of the cdr... until the innermost cons's cdr to be nil (that's from experimenting with interp)
13:19:36
jackdaniel
(cons nil nil) will evaluate to (NIL), while NIL will evaluate to NIL, which is an atom
13:21:08
jackdaniel
well, it could be: proper list is either NIL or a cons chain with the last element being NIL
13:21:34
shrdlu68
> list n. 1. a chain of conses in which the car of each cons is an element of the list, and the cdr of each cons is either the next link in the chain or a terminating atom. See also proper list, dotted list, or circular list. 2. the type that is the union of null and cons.
13:21:41
jackdaniel
or even better: it is either nil or a cons where car is list's head and cdr is list's tail (and must be another list)
13:36:10
verisimilitude
It shouldn't be difficult to write a Readline replacement purely in Common Lisp; maybe I should do that soon.
13:37:43
verisimilitude
Since #quicklisp is rather dead, I'll ask here: Would you tell me why my packages haven't been accepted into quicklisp yet, Xach?
13:38:31
jackdaniel
common question would be: did you create an issue on quicklisp-projects repository & do they work on at least two CL implementations
13:45:02
jackdaniel
so, if we are presenting our opinions (because why not!) it will be difficult and even harder in pure cl ;-). but I will back down if someone will ask me for any arguments to support my opinion
13:45:57
phoe
then you should. it's what you describe as a "readline replacement purely in Common Lisp"
13:46:35
verisimilitude
As for the portability, jackdaniel, it works on anything supporting a full seven bit character set, as the only nonstandard dependency.
13:47:02
jackdaniel
shrdlu68: why would it be impossible? I mean – do you have an example of an operation which wouldn't be possible?
13:47:33
verisimilitude
You don't need C just to control a terminal device; as I'm gradually showing, Common Lisp clearly does it better.
13:48:15
verisimilitude
That's a good point, shrdlu68; now, I wanted to entirely avoid providing that, but I've begrudgingly done so and support several implementations so far.
13:49:13
verisimilitude
Currently, I have support for Allegro, CMUCL, SBCL, ECL, and am working towards it for CCL and others.
13:49:16
shrdlu68
Yes, of course, but one would have to add these syscalls to each implementation individually, or use FFI.
13:49:28
verisimilitude
However, I don't believe this should be done in Common Lisp; it should be done before it's entered, instead.
13:50:14
verisimilitude
Either the implementation has functionality specifically for this or I end up using bindings to tcgetattr and tcsetattr.
13:51:12
verisimilitude
I don't use this functionality, I'm merely providing it because some interested parties wanted it.
13:51:27
verisimilitude
After all, why have echo streams and READ-CHAR and whatnot when you can use disgusting POSIX code, instead?
13:52:37
jackdaniel
shrdlu68: OK, you are right on that, you can't use escape sequences to control certain things apparently
13:52:37
beach
light2yellow: ANSI is a commercial organization just like most standard organizations in the world. They publish standards for money.
13:53:20
verisimilitude
It's disgusting that UNIX breaks just about every programming language that has character granular input.
13:54:59
verisimilitude
My suggestion, since the Common Lisp program is launched by something else, is to disable system echoing and buffering beforehand, if you need it disabled; this is what every program should do, unless it truly needs control over this during program execution, which it probably doesn't.
13:58:00
verisimilitude
So, Common Lisp has character granular input as a primitive, whereas other languages don't; this is a good example of Common Lisp providing functionality real programs need.
13:58:28
dlowe
verisimilitude: it's common to focus on one implementation and then branch out to other implementations as needed
13:58:34
shrdlu68
I also don't understand "The very notion of line discipline is stupid.", as opposed to what?
13:59:31
verisimilitude
So, UNIX doesn't send you the actual characters typed in, by default; that would be too simple.
14:00:07
verisimilitude
The line discipline says things such as ``Translate this character to that character.'' or ``Only send input after this many characters have been typed or so much time has passed.''.
14:00:53
verisimilitude
If you think of POSIX like a retarded Microsoft, it's as if a fool's way of inconveniencing everyone else.
14:03:00
beach
light2yellow: It is not. I just grepped the TeX sources. It is in a comment but not in the specification text.
14:06:46
light2yellow
if it's a programming language which is supposed to have an open specification, and be allowed to implement, the specification shouldn't be paywalled
14:07:37
shrdlu68
light2yellow: The standards body supposedly needs to pay for pencils and paper clips,
14:07:38
verisimilitude
Technically, wouldn't only the implementors need a copy, necessarily; I don't know if implementors received a free copy or not, but they probably didn't.
14:08:09
verisimilitude
I believe it was Lispworks that said the final draft was equivalent and so should just be used.
14:08:47
light2yellow
beach: yes, I don't know how the standards work. it would be great if you link or expain
14:09:20
beach
light2yellow: The important aspect of a standard is that it is published by an organization independent of those who then apply it. So if Microsoft publishes the specification of C#, then that is not a very good standard at all.
14:09:34
jackdaniel
light2yellow: I believe some effort on your side (like trying to look yourself in wikipedia for that instance) would be more polite than asking for explanation
14:09:38
phoe
also, they *are* equivalent. The standard is just dpANS3 with new labels and front page attached to it.
14:09:40
shrdlu68
I think light2yellow's point is that the specification itself should be freely available.
14:10:15
phoe
it is freely available enough with dpANS3 and CLHS. the ANSI standard itself is not available but for all practical purposes its readable representation does not even have to exist.
14:10:39
phoe
for reference, there is CLHS and slowly-crawling CLUS; for original text, there is dpANS3.
14:10:46
light2yellow
jackdaniel: if I knew what to look for, I would have already looked. as I said, I don't understand why ANSI pdfs are paywalled, I think they should not. that's what I said
14:11:24
beach
cess11_: Sure, that is another option. Like I said, the important aspect is that the standard be published by someone other than those providing implementations.
14:11:33
jackdaniel
yes, but can you honestly say, that you did try to look? (my pre-last remark, the last one is that this discussion belongs to #lispcafe)
14:12:18
tfb
verisimilitude: there was in fact a big saga about whether the final draft of the standard (which circulated freely at the time and which I'm sure all implementors had copies of) could be published in the way it now has been. I don't know if the details of that saga are now readily available. For CL the question is moot now.
14:13:36
verisimilitude
Well, Microsoft did push their OOXML or whatever through an independent standards body, but it was clear what really happened.
14:14:21
verisimilitude
So, it's not enough to just be published by an independent organization. It needs to pass a common sense ``smell test'' of sorts.
14:14:42
verisimilitude
I dislike that phrase ``smell test'', but there's not much of a better way to put it, I suppose.
14:15:12
beach
The fact that the standard should be published by an independent organization is a necessary but not sufficient condition for it to count.
14:16:02
foom
tfb: FWIW, that's the same compromise that's in place for C and C++ standard documents for a few decades now.
14:16:40
tfb
foom: yes, for the same reasons I bet, it may even be that the CLHS was the test case in some sense
14:17:36
phoe
CLHS was actually an official thing; read http://www.nhplace.com/kent/Papers/cl-untold-story.html
14:24:16
tfb
phoe: This is off-topic but I don't think it was. That was certainly the intention but I think the copyright situation is less clear than it might be (KMP's document talks about this I think)
14:25:14
phoe
tfb: you are correct. For me, for all practical purposes, dpANS3 is public domain enough. Even ANSI does not care about Common Lisp - see the sorry excuse for the standard that they sell.
14:25:24
Xach
When I talked to Kent Pitman, he said his intent was that people could create derived works of the dpans without limit.
14:32:45
beach
I have started converting the dpANS files into something that can be compiled with a single call to `pdflatex'.
14:33:22
jackdaniel
beach: did you take a look at http://cvberry.com/tech_writings/notes/common_lisp_standard_draft.html ?
14:34:21
jackdaniel
(and this https://gitlab.com/vancan1ty/clstandard_build/ which is linked from the abovementioned page)
14:35:26
jackdaniel
OK, then it may be worth looking at, Currell Berry did work on TeX sources and produced a very nice-looking pdf document from them
14:36:03
rme
1. incorrect usage of foreign pointers; 2. bugs in code compiled at (safety 0); 3. (more rarely, but it has been known to happen) bugs in ccl.
14:36:05
beach
jackdaniel: My purpose is to modify it and add an appendix that explains changes from dpANS to WSCL.
14:38:49
rme
also, beware that some libraries have been known to do things like (declaim (optimize (safety 0))). In ccl, those are pervasive. (declaration-information 'optimize) will show current settings.
14:40:56
jmercouris
jackdaniel: I see :), "uhm" in english generaly has a connotation of thinking, like you're making a vocalized pause and haven't finished your thought, just a heads up
14:41:40
verisimilitude
Since #quicklisp is rather dead, I'll ask here: Would you tell me why my packages haven't been accepted into quicklisp yet, Xach?
14:41:50
beach
jackdaniel: Thanks for pointing me to it. I will definitely check whether it is usable.