freenode/#lisp - IRC Chatlog
Search
16:03:29
pjb
dieggsy: (let ((list '("foo" "bar" "baz" "qux"))) (print (sort list 'string-lessp)) list) #| ("bar" "baz" "foo" "qux") --> ("foo" "qux") |# does it really work?
16:04:43
dieggsy
pjb: it warns "Destructive function SORT called on constant data: ("foo" "bar" "baz" "qux")" but it does work
16:06:31
pjb
http://catb.org/jargon/html/N/nasal-demons.html http://3.bp.blogspot.com/-4f7bw2esn8w/Ut159zC3X4I/AAAAAAAAENQ/bhy3LecsfBQ/s1600/26831_1419257239999_7976058_n.jpg
16:07:10
kiwichap
I was interested in making a website or developing computer equipment and was told that LISP is the best for that
16:07:59
pjb
kiwichap: well, at least one guy earned 8-digits selling a web program written in Common Lisp, so it's possible.
16:08:31
beach
kiwichap: Yeah, well, sort of. For one thing, we haven't written in LISP for decades, so if you use LISP, we think you are using decades-old dialects.
16:08:52
beach
kiwichap: Furthermore, this channel is dedicated to Common Lisp, which is probably fine for what you want.
16:09:25
beach
kiwichap: Then, Common Lisp is the best choice for lots of stuff, you websites would represent no exception. :)
16:11:18
beach
kiwichap: When you use a Common Lisp system, you work more inside the system itself than in the host operating system, so you won't notice much difference.
16:11:23
kiwichap
ok sounds good, I am using FreeBSD, Debian and Open Suse for my websites at the moment
16:14:22
dieggsy
BSDs are excellent for servers. for daily use, much worse hardware support than Linux IME
16:16:04
dieggsy
dunno if i'd call it practical for productive use, but if you have the time, absolutely. contribute them upstream, even
16:16:32
kagevf
loke[m]: thank you - I didn't know about dirname ... yes, that would have done what I wanted ...
16:16:32
pjb
kiwichap: a lot of lisper use macOS to write lisp code on (even if deploying on MS-Windows or Linux).
16:17:49
dieggsy
is there anything that makes macOS better fit for lisp nowadays or is it just... historical vestiges kind o f
16:18:28
jackdaniel
I can't say much about osx, but I'm sure that historical vestiges play a role in some lispers preferring macos over linux
16:19:22
jackdaniel
also osx application market is bigger than linux's (if you want to sell software)
16:20:01
dieggsy
i mean surer, but that's getting at preferring macos over linux in general as opposed to for lisp specifically
16:20:48
pjb
dieggsy: I don't know, but there are some pictures of lisp conference assistance where there's about 90% mac laptops vs 10% PC laptops which probably run 90% Linux and 10% Windows.
16:21:02
jackdaniel
dieggsy: if some person prefers macos over linux and they happen to be a lisper, what do you think they will prefer for lisp?
16:21:16
Josh_2
Is there a library that makes storing data in files easier? Basically I'm thinking something like subclass of one class would store in one directory, subclasses of that in a directory inside of that. Not sure
16:21:50
dieggsy
jackdaniel: my question was, is there a particular reason to prefer macos over linux *for lisp*
16:21:53
jackdaniel
either way this drifts toward offtopic, so as a moderator I feel obligued to moderate you :)
16:22:28
kiwichap
thank you , sorry, I am tempted for a mac for IoS development and was interesting to realize Internet of Service
16:22:46
pjb
dieggsy: the only thing you have on macOS you don't have on Linux, is Clozure CL.app with a nice Hemlock editor, if you don't want to use emacs/slime.
16:23:04
pjb
dieggsy: on Linux you can run a PortableHemlock with a X11 backend, but it's not as nice.
16:23:42
jackdaniel
kiwichap: this channel is known for strict on-topicness rules, discussing other topic unrelated to common lisp is allowed on #lispcafe
16:24:22
pjb
the keyboard is more responsive on Linux\X11 than on macOS (and on Windows it's horrible).
16:24:44
pjb
and you've got more keys and modifiers in X11 than in macOS, which is nice for lisp or emacs.
16:33:10
dieggsy
Josh_2: they kinda suck to work with, but they can be mighty fast compared to other storage methods.
16:33:31
dieggsy
kiwichap: some people here swear by it, others dislike it, i don't have enough info
16:34:44
dieggsy
Josh_2: you're not wrong, but then you get into things like disk space and compression i suppose. TBH i'm no expert on the subject
17:39:50
stylewarning
But I guess it’s such an investment to build an implementation you might as well do fun stuff too
17:43:54
stylewarning
I think that’s possible but there’s also a certain way people write minimal software
17:45:41
_death
I remember lisp500 had an impressive .lisp file along with it.. although with some prettification the .c file was some 2kloc after all?
17:47:07
Josh_2
I read 'The rise of Worse is Better' in The Unix Haters Handbook very recently, interesting stuff and relevant to what you said stylewarning
17:48:19
pyc
http://clhs.lisp.se/Body/f_search.htm says this: "For example, when start-end is true, the ..." but I don't see start-end specified anywhere else on this page. what is start-end referring to here?
17:54:34
stylewarning
Josh_2: I’m not suggesting hyper-minimalism. I’m just saying that I think there’s room for a Common Lisp implementation that is small and straightforward, and especially easy for a reader to understand
18:11:40
jackdaniel
stripping away interrupt handling, threads, sticking to bytecode compiler (without linking sheningans) and bolting first "standard library" then "clos" should bring you 3/4 way there
18:14:40
jackdaniel
one could go a few steps further and: implement non-conforming format and non-conforming loop which cover >98% of use cases
18:19:37
jackdaniel
that would give you an ad hoc, bug-ridden, slow implementation of 100% of common lisp :)
18:23:14
shka_
honestly though, i think that for educational purposes some other lisp implementation makes more sense to study
18:23:19
jackdaniel
smaller modules are easier to maintain ;) but sure, given that we have a standard that would be a regression
18:27:48
dieggsy
lol, i think they meant more abstractly like algorithms and shit. i might disagree wit that too though. I dunno, I love scheme and I love CL. you can learn from either and make great practical use of either
18:28:28
stylewarning
dieggsy: but learning either doesn’t really provide insight into implementation
18:29:17
stylewarning
dieggsy: and currently in Common Lisp it’s hard to answer the question “what if Common Lisp had XYZ?”
18:30:01
stylewarning
For instance I would love to know what a computed goto special operator would be like in Lisp
18:30:20
stylewarning
Unless you’re a genius compiler hacker like Paul K, you can’t just simply add this to something like SBCL
18:31:15
stylewarning
If we had a COMPUTED-GO special operator, then we could hack something like cheap coroutines in Lisp
18:31:59
stylewarning
That would be fun to play with, but necessitates a substrate for easily modifying a CL implementation
18:32:31
raeda_
On that topic, I've been playing with Graal/Truffle lately, which is a compiler toolkit. If there was a Truffle based CL, it would be easy to modify it for experiments
18:33:15
stylewarning
As discussed, a COMPUTED-GO, or even simpler, a jump table, are not something you can implement in CL as a macro without huge caveats
18:37:53
Bike
can't you? if the implementation optimizes CASE (as sbcl does for example) it doesn't seem to me like you'd be doing much worse than direct support
18:38:56
stylewarning
Bike: well if an implementation supports CASE as a jump table then of course we are Golden
18:39:45
Bike
i don't understand how the simple implementation helps here, if you want to worry about performance
18:40:41
stylewarning
Bike: I gave an example of a control structure that is difficult to implement; maybe there are better examples than what I provided
18:40:54
pyc
Pastebin link please for this channel? I forgot it. Someone should add the pastebin link to the topic.
18:41:12
stylewarning
Optimized CASE still doesn’t give computed goto; tags would need be able to appear anywhere in the lexical scope
18:44:40
Bike
for a coroutine wouldn't you have to jump "into" a tagbody, essentially? tagbody only has dynamic extent so you can't do that
18:45:51
Bike
if i wanted to implement coroutines i'd probably start with continuations and go from there
18:46:14
stylewarning
I think the DEFUN would be something like: LET jump-point = LTV(mutable-cell); (TAGBODY (go jump-point) ...)
18:46:52
Bike
well, i mean, so you'd have the tagbody in the coroutine, and when you yield you communicate the jump point back to the caller, right?
18:49:24
Bike
lisp doesn't let you do that. if you want to do that, you'd have to take care of things like storing the stack frame to put it back when you enter
18:49:57
Bike
e.g. if you had some dynamic-extent thing in play at the yield point, you'd need to be able to put that back when you resume
18:51:09
jcowan
stylewarning: CLHS 1.7 http://www.lispworks.com/documentation/HyperSpec/Body/01_g.htm tells you what the requirements are to call your implementation "a subset of CL".
18:51:28
Bike
yeah, and your body is something like (defun coroutine ... (tagbody ...)) and you're doing (return-from coroutine), yeah?
18:51:43
stylewarning
(defun f () (let ((cell ...)) (tagbody (go cell) ... (setf cell 1) (return-from f x) (tag 1) ...)))
18:52:56
Bike
okay, so your cell doesn't just have the jump point, it also has the entire stack frame?
18:53:43
stylewarning
In this case it just has the jump point; which isn’t 100% what’s required for a full “Just Works” coroutine with previously established lexical scope
18:54:39
Bike
are there uses for coroutines with no state besides the control point? i've never really usd them but i assumed the state was a large part of the appeal
18:54:47
stylewarning
But that’s a deficiency in our definition of computed goto, not necessarily in what we are trying to do with coroutines
18:55:31
stylewarning
If you have a computed goto, you’ll have to decide what lexical variables mean if you’re jumping into a lexical context
18:56:27
_death
there are also the "off the beaten path" CL implementations like Corman, Eclipse, Scieneer..
18:56:37
stylewarning
And hence why it would be nice to have a simplistic implementation that removes barriers to trying these things out
18:57:42
Bike
i don't know how much a simple implementation would help with that. like you could do a fairly small interpreter-based one, but then adding this kind of extension would be pretty involved
18:58:09
Bike
and implementing this with an interpreter would be vastly different from doing it with a compiler to the extent it would be hard to transfer what you'd learned
18:58:16
stylewarning
But I would contend it’s likely an order of magnitude less involved than trying to hack it into SBCL
18:58:33
Bike
(source: i wrote up a scheme with delimited continuations once. when i tried to write a compiler problems happened)
18:59:11
stylewarning
Yes interpreter vs compiler vs bytecode vs .... are real implementation issues and written about extensively
18:59:33
Bike
i guess the other thing i'd do is use sicl, which isn't exactly "simple", but it's modular enough to let you swap some stuff out
19:01:08
Bike
i just don't understand what you'd do with the simple prototype exactly. you couldn't use it with production code sicne it's not efficient. you couldn't use it as much of a jumping off point for modding a more efficient lisp.
19:05:01
stylewarning
I implemented this but it would be cooler with green threads https://github.com/stylewarning/lisp-random/blob/master/generators.lisp#L62
19:08:26
theothor`
FWIW, https://dlmf.nist.gov/LaTeXML/ can parse the dpans repos with some tweaks. Returns xml, and can parse directly to html. It struggles with the table macros, but I think workarounds are possible. The xml could be parsed to a clos thing also, I guess?
19:09:10
_death
stylewarning: https://8c6794b6.github.io/posts/Delimited-continuations-with-monadic-functions-in-Common-Lisp.html
19:10:18
stylewarning
_death: it’s cool but to me it’s a toy only in the sense that it doesn’t provide an orthogonal feature
19:10:46
stylewarning
IOW you need to write Lisp differently if you want this kind of feature using that technique
19:11:20
stylewarning
Same issue with CL-CONT-based continuations, where it can’t CPS the standard library like MAPCAR
19:12:47
stylewarning
(This is the CL-CONT version of coroutines: https://github.com/stylewarning/lisp-random/blob/master/coroutine.lisp )
19:13:14
stylewarning
(It appears like it’s a nice orthogonal feature but it doesn’t work in certain circumstances, whereas the thread version does)
19:14:19
_death
yeah, I have some snippets for coroutines using arnesi.. at one time I switched to cl-cont, but decided I liked arnesi better
19:55:51
pjb
stylewarning: you can check it in the sources https://gitlab.common-lisp.net/cmucl/cmucl search for process-yield and idle-loop
21:29:06
opcode
i need some help understanding car and cdr: why does (append (cdr '(1 2 3 4)) (car '(a b c d))) return (2 3 4 . A) and not (2 3 4 A)?
21:42:27
edgar-rft
APPENDing elements at the end of a list is not fast in Lisp, if you must add several elements one after the other it's often faster to PUSH to the reversed list and reverse again if finished. Alternatively you can keep a pointer to the last cell in a variable, but this only makes sense if you have really *many* of those APPEND operations on the same list.
23:47:55
moon-child
wait-process returns an exit code. I think launch-program might also do something if it can't start the command
23:50:02
irc_user
Got it, thank you. I haven't actually downloaded lisp yet but it looked interesting so I wanted to try rewriting some scripts in it. Looks like UOIP comes with it and isn't a separate lib?
23:51:03
moon-child
uiop is a general portability library. It is not part of common lisp, but many implementations ship an implementation of it
0:36:26
nij
Why do some people name their personal systems like this? com.xyz-name.system-name? Should I follow this convention?
0:36:56
White_Flame
it's to avoid collisions. Because only a few people do that, I"m not sure it's really necessary
0:37:21
White_Flame
but if you do use that, there are nicknames and package-local-nicknames that can give a shorter prefix instead of the fqdn style
0:40:40
saturn2
i'd say it's a good convention to follow if you want to publish a ton of different things and not worry too much about how appropriate they are for general use
0:41:45
saturn2
it's annoying when someone squats on a generic name with a library that's not very good
0:50:01
nij
So as my personal scripts pile up, I will have to make systems that named "nij.scripts.celebrate", "nij.scripts.wordie".. etc? Isn't this a little cumbersome? Is there a better way, like (defsystem "wordie" :inherit "nij.scripts"..)?
1:36:00
nij
Should I consider using SICL over SBCL? I heard that the former is "cleaner" without understanding.
1:43:32
martinodb
hi! i have a question. I'm trying the maiden IRC framework, so this maiden-silly agent connected to an IRC channel, but it doesn't talk to me at all. The documentation says something about activating it. Doesn't it do anything out of the box? do I have to edit the code? thanks!
1:50:27
nij
"Everything should be in a repl cuz that's the coziest place to have fun.. including the repl itself!"
1:50:41
no-defun-allowed
If you are only interested in cleanliness, then your code would be subject to the ugly parts of both SBCL and SICL.
1:54:14
mister_m
I accidentally did an infinite recursion in the repl (using slime), I'd like to stop this without killing my inferior lisp process, how can I do that from within the REPL buffer? C-c C-c doesn't seem to do anything
2:07:40
mister_m
maybe I just missed the SLDB buffer that was created on C-c C-c in the REPL buffer.
3:19:48
asarch
I did a downgrade to Debian Stable and its Emacs 26.1 has been failing to get the M-x 'package-refresh-contents' to install Slime
4:00:56
White_Flame
mister_m: if your inferior-lisp gets dropped into ldb, you probably blew the heap, or the stack twice