freenode/#lisp - IRC Chatlog
Search
4:01:27
pierpa
just tell him what he probably is looking for? asarch, probably you want: (loop for line = (read-line in nil nil) while line do ...)
4:11:57
pjb
asarch: so read-line returns usually a string, so returning NIL when eof is discriminating.
4:13:55
pierpa
right. Thanks pjb. I must correct myself: most input functions can either signal a condition or return a value you choose on end of file.
4:22:18
asarch
Question: if Common Lisp is not a multi-threating environment per se, why the "feof checks it too late, the file might have grown since!" condition?
4:25:11
pjb
This is because the OS and CL are different entities that you cannot know when the file will grow (or shrink).
4:26:00
asarch
pierpa, I just looking for something a la C: while (feof(fp) != NULL) {fscanf(fp, "%s", buffer); printf("%s", buffer);}
4:28:15
pjb
asarch: reproducing C bugs in CL will require more work; as I explained above, you can define a feof function, by memorizing the result of the last read operation for each stream!
4:31:11
pjb
Notice that C doesn't have multiple values, conditions, or types associated to objects. This is so defectuous! This is why the function fread() cannot distinguish between end-of-file and error! Hence the need to store the eof status in the stream record, and retrieve or clear it with feof and clearerr.
4:31:46
pjb
asarch: but this let you forget that those are not synchronous operations! You're just accessing a memorized flag in a structure.
4:34:35
pjb
asarch: for example, that you don't write a while(!feof(fp)) loop. You're a lame C programmer.
4:39:12
asarch
When I was learning JavaScript, I asked if there was a shell who could understand JavaScript commands directly
4:40:19
asarch
However, they told me that it was not possible because the common and useful shell constructs like piping and redirection would conflict with JavaScript constructs
4:58:18
pjb
asarch: cd ~/quicklisp/local-projects ; git clone https://gitlab.com/com-informatimago/com-informatimago.git # Then (ql:quickload :com.informatimago.common-lisp.cesarum)
4:59:29
pjb
(com.informatimago.common-lisp.interactive.interactive:lspack :com.informatimago.common-lisp.unix.passwd t)
6:42:02
jackdaniel
but looking at PRs it seems it is not *actively* maintained. but it is not abandoned either
8:59:07
phoe
I have a DEFINE-FOO macro that has a &body as its last argument. I need to tell it that the first string of that &body is a docstring and should be highlighted as such, not as an usual string.
9:10:19
dmiles
lets say my lisp reader is reader a symbol had just read.. "#:A" . Are these the only characters that will stop reading the symbol? #\; #\, #\( #\) #\' #\` #\" #\: ?
9:11:13
schweers
dmiles: if I understand your question correctly, every terminating macro character will terminate (hence the name) reading the symbol (or number)
9:12:48
schweers
they are listed somewhere in the hyperspec, I’m looking for the page right now, give me a sec
9:15:57
schweers
not quite as nice, but figure 2-7 does the job: http://www.lispworks.com/documentation/lw70/CLHS/Body/02_ad.htm
9:16:40
schweers
keep in mind that we are talking about standard syntax, you may change the readtable to include other terminating macro characters
9:19:33
dmiles
also next is there a lisp reader written in lisp somewhere.. the reader i implemented is too permissive .. for example I dont keep count of backquote level when reading commas
9:22:43
Shinmera
schweers: What do you mean? The reader is just an algorithm. You can implement it in any language.
9:23:35
schweers
Shinmera: I don’t know a lot about bootstrapping, but then I remembered that one needs a working CL environment to build sbcl, so it doesn’t seem that unusual anymore.
9:25:12
dmiles
i i was suprised at sbcl is that impls end up doing a minimalistic reader in their lnaugage (say C) then if they start to writ e alisp reader in Lisp.. their C code gets jealous and starts to take over until the lisp becomes busywork
9:27:33
dmiles
so they weight the cost benefits of having two codebases.. one lame one in C they cant delete (and they forever have to improve) .. vs a *overly* fantastic one im Lisp
10:24:21
dmiles
well my current reader is doing pretty well... it will probly be a week to two months before i really need to borrow a reader in lisp
11:05:57
beach
scymtym_: It looks like it is close to being usable. I certainly intend to start using it for reading SICL code.
11:29:30
scymtym_
beach: it should definitely be fine (strictly speaking "no worse than") for that particular case since it still mostly identical to the code it is replacing. i was referring to FIXMEs for not-yet-defined condition types, recently discovered (small) bugs and the like with that statement
11:56:55
beach
scymtym__: Sure, I understand that it is not completely finished, but it is definitely getting there.
12:43:50
pfdietz
dmiles: SBCL doesn't have to have a reader written in C, any more than a C compiler needs to have a lexer/parser written in assembler.
13:11:46
dmiles
pfdietz: to read SBCL's lisp reader into SBCL i was assuming there was a less functioning primordial reader
13:45:44
pfdietz
And gcc is written in C and compiled with a C compiler. The first C compiler written by Dennis Ritchie was in PDP-11 assembler though.
13:51:36
beach
It is very strange to me that so many people assume that a Common Lisp system must be (at least partially) written in some other language.
13:58:37
beach
makomo: So you are saying that, if asked, these people don't think that C compilers are written in C?
13:59:34
makomo
i always like to think about what would happen if you had the ability to destroy all compilers for high-level languages in an instant
14:00:02
makomo
the same would happen if you destroyed all of the robots in factories or something like that
14:00:51
makomo
it's a very interesting concept, because if you go deep enough, *someone* had to make the first version from something that was more primitive
14:09:26
JuanDaugherty
maybe with a core bootstrap in something else, e.g. the vm in smalltalk being in machine lang
14:17:58
dmiles
do others think that makomo is correct.. we'd have to start from scratch with lisp if there was not already a lisp impl?
14:18:47
makomo
dmiles: well how else would you do it? the initial lisp compiler was surely written in something that was not lisp, because lisp didn't exist until that moment :-)
14:19:08
beach
What do you mean by "start from scratch"? You would obviously have to write the first Lisp system in some other language.
14:19:45
jackdaniel
"starting from scratch" is a bold statement - you have all ideas around (even the standard)
14:20:26
makomo
when you get to the bottom of that thought, someone somewhere implemented the first program with a few electrodes :D
14:20:26
jackdaniel
while starting of scratch would be also thinking on how this should be specified
14:20:27
dmiles
well i just mean we have everything of all the lisp code and spec yet we didnt have lisp impl in any language other than lisp
14:21:37
makomo
so if you destroyed everything we had now, we would have to redo that whole process again
14:22:17
jackdaniel
makomo: that's not as terrifying, since you have all the design all over the place, you may implement from scratch only n-1 step to bootstrap step n
14:22:58
lieven
let me give you an even better one. If the electricity grid over a big enough area goes down, getting it up again would be a major problem.
14:23:45
dmiles
or like when the computer chip factory burned down in singapore iot took us 5 years before we could buy ram again
14:24:27
schweers
chris wellons wrote about part of this problem: http://nullprogram.com/blog/2016/11/17/
14:25:23
wingodboleash
actually, maybe in the process of reinventing the wheel somebody will find out that we've been doing it all wrong since the very beginning and so maybe it'll be for the better if everything gets destroyed...
14:25:28
JuanDaugherty
i.e. the first electronic ones were, the jackard looms were punched hole programs but not computers
14:30:41
wingodboleash
on a sidenote, why does it seem to me that i'm gonna have to write my own custom implementation of lisp to be truly satisfied with the language ? Seems to me that there's a sort of a law for lisp where everyone feels this at some point, and those who actually come up with a new implementation just increase the entropy of the scheme universe ! And then it becomes harder for a beginner to choose which dialect to choose and the beginner gets the same
14:31:53
lieven
schweers: http://yarchive.net/comp/linux/extreme_system_recovery.html Al Viro once did that for real without docs
14:32:37
dmiles
i am making my impl because i dont think anyone has ever built common lisp on prolog before
14:32:41
beach
wingodboleash: I take it you mean a new language as opposed to a new implementation of an existing language? That is not a problem, because new languages usually don't become widely used.
14:33:38
wingodboleash
yeah... like theres a feeling that i want to create a dialect of lisp that is taylored to my use... probably what lisp is most useful for ?
14:34:52
Shinmera
I'm a practical person, so I really don't see the use in creating yet another language for which you'll have to waste decades upon decades until you're at a point where you have enough libraries to be actually productive.
14:36:23
dmiles
JuanDaugherty: what Shinmera saiid is the reason I have to build my impl.. Imagine how many ytears it would take get all the lisp libraries for prolog?
14:36:38
Shinmera
wingodboleash: Well fortunately for you this channel is only about Common Lisp, and that world is just one language.
14:37:34
JuanDaugherty
dmiles, to me function is function, i'd rather think about ways to leave function as is and work on a means to leverage in a common system
14:37:48
dmiles
jackdaniel: the problem is there are 7 refernce impl of Prolog.. immagine me having to write all teh lisp libraries for all 7 ?
14:39:37
JuanDaugherty
everything pretty much boils down to the same ol jacked up 8080 instruction set anywho these days
14:39:46
dmiles
but then the whoile prolog world would need to abandon their 7 impls and jsut use proplog.. the path i have now all 7 can run all the lisp libraries
14:41:06
jackdaniel
dmiles: you coming up with your own incompatible implementation is like in this xkcd joke: we have 6 standard, that's unacceptable (and they make 7th standard)
14:43:32
dmiles
jackdaniel: though luckily i am *only* implemeting one standard that i did not create (common lisp). and having to write 3-5 shims to cover the differnces in the 7 impls of prolog
14:46:05
dmiles
the 3-5 shims (prolog-to-prolog compatibility libaries) already mostly exist . why i probly only have ot create 3-5
14:46:45
dmiles
JuanDaugherty: i find hta tis the only hard part about the impl.. Do i act like SBCL or do i cat like Clisp or like ECL?
14:48:07
dmiles
meaning i picking one #+<SBCL/ECL/CLISP> and making sure i conform to being really hte same
14:52:24
dmiles
Also though I figure most users with be user of Sicstus and SWI.. using things like CLEWS
14:56:56
dmiles
*nod* though since SWI is the slowest, it hard not having some of its libs on sicstus.. which the common-lisp libs will more than make up for
15:02:22
dmiles
to contrast speed differnces though i wrote a HPSG parser on SWI, and Goolseby ported a HPSG to ACL.. What took 2 seconds to run on SWI took 30secs on ACL
15:07:33
dmiles
https://github.com/SWI-Prolog/bench/blob/master/chat_parser.pl <- in fact, its a daily benchmark for SWI
15:10:27
dmiles
here is the output of the english2logic system: https://docs.google.com/document/d/1rdI_f-2YnX0e2RD6rGAY57YAqzLj2xHsk36m5HT6SoM/edit