freenode/#lisp - IRC Chatlog
Search
18:59:26
gendl
— which they actually might, because I doubt they use that .asd themselves. I’m not sure why it was actually added. I’ll try to find out.
19:00:43
gendl
It also disables output-translations, which borders on malicious and needs to be deleted.
19:04:51
Posterdati
pjb: it complains about memory limits, but if you change them, you've get the same error
19:29:40
ThJ
i had a look at the book Practical Common Lisp, and the example programs were relevant about 20 years ago. then i looked at Slime and the screenshot on the main page is also ancient (macOS hasn't used that style of scrollbars in at least a decade). also, all the documentation i can find looks like it was made in the 90s and would load in the Lynx browser... should i just continue expecting this kind of thing?
19:35:19
shka_
ThJ: hyperspec was done in the 90s and because it is copyrighted nobody can publish it in more modern form
19:38:56
_death
I guess you could have some react.js thingy lazy load the text, so that you won't be able to view it in lynx
19:43:42
_death
well, if you want your programs to work in 10, 20, 30 years.. maybe stability is a good thing.. if you think your program will be worhtless by next year, as it will be rewritten ("better").. then javascript makes sense
19:46:51
ThJ
but even languages that do try to be stable over time have made adjustments to the ecosystem.
19:48:17
ThJ
but it surprises me that searches for pretty basic lisp concepts don't turn up near the top of google search results, etc.
19:51:22
ThJ
granted, i didn't start it on the most positive note, but i don't feel that i was particularly harsh either, and it was a genuine first impression..
19:53:26
_death
if you want to discuss the lisp language, that's one thing.. if you want to vent about failure to satisfy the need for new it's another
19:53:55
ThJ
will i get shot at noon if i say that i've mostly been a vim user, and the thought of switching to emacs to use slime doesn't seem terribly alluring?
19:55:02
shka_
from what i understand new vim and neovim integrate with external process much better nowdays so it may be actually acceptable
19:55:48
_death
I think some vim people are ok with emacs modes that make it closer to what they're used to
19:58:43
ThJ
i'm not a particularly advanced vim user. yes, my vimrc has a fair bit of stuff in it, but i haven't got a bajillion vim commands committed to muscle memory.
19:59:02
ThJ
ah, yes, the old quote about emacs being an excellent operating system only lacking a decent editor
20:03:15
shka_
anyway, installing spacemacs is easy (copy one file), then you will be asked to choose your preferences (vim style, emacs style, hybrid style)
20:04:43
ThJ
but i reckon i'll need to break out my META keys if i'm going to actually use Slime or such, right?
20:18:20
emaczen
ThJ: It looks like you are using OSX? You may want to check out CCL, a common-lisp implementation that can interoperate with the cocoa libraries
20:39:02
sukaeto
Emacs' buffer management is much better, IMO. And setting up Emacs to run in daemon mode and then aliasing emacsclient (to, say, vi) has been a lot more convenient for me than trying to locate that one file I know I've got open in one of these tabs in one of these vim windows
21:09:50
slightlycyborg
Anyone familiar with SBCL sockets? I want to use a socket-stream on a UDP client, but I don't know if it is possible. I can use a stream on the server after I bind, but I may just have to use the socket-send function.
21:17:21
jmercouris
slightlycyborg: I'm not very familiar, but I remember there being some basic documentation in the source IIRC
21:20:31
jmercouris
I wish I could help you, I gave up (temporarily) on using bsd sockets in SBCL, as it is an ext and I didn't want to be too tightly married to SBCL
21:21:07
jmercouris
slightlycyborg: did you look at this: https://github.com/cffi-posix/cffi-socket?
21:21:55
slightlycyborg
Ok. I will probably make the switch. I have just enjoyed using other specific sbcl features like their threads
21:23:19
Bike
a list of at least two elements, where the first element is a sequence and the second is a ub16.
22:15:07
aeth
It's pretty hard to scale past 6k LoC because at that point you can start really abstracting and make each change fairly neutral in line count
22:47:22
_death
"can't even parse a single proper Prolog term".. because prolog syntax is so essential to it?
22:49:57
_death
also, when it uses the term "functions" it seems to mean functions in the mathematical sense..
23:58:39
montxero
Hi, I have a question regarding docstrings. Which one of these formating is more "canonical"? https://pastebin.com/g43tEgJn
0:30:33
stylewarning
montxero: I actually don't add newlines to my docstrings at all unless im starting a new paragraph
0:48:56
emaczen
ealfonso: It isn't something you would regularly do, but I'm sure there is an applicable scenario to do so
0:54:53
ealfonso
I''ve seen the pattern of exporting within a file rather than centrally in a defpackage form
1:18:00
aeth
Don't use something that's deprecated because a future version of the standard might remove it!
1:20:40
no-defun-allowed
so to really be in good form, your code better not use remove-if-not or importing outside defpackages :P
1:22:17
rpg
Bike: I'm not finding this in CLHS, either. But I recall getting warnings about uses of `IMPORT` and `EXPORT` at top level
1:23:56
rpg
There's some language in the DEFPACKAGE-ADDITION issue that explains why it's better to use DEFPACKAGE, but not to the extent of deprecating top level use of IMPORT and EXPORT.
1:24:59
rpg
ACTION kind of wishes the committee hadn't made the default for package use be implementation-dependent...
1:25:18
aeth
no-defun-allowed: Well, that's controversial because all the foo-if-nots are deprecated, but the foo-if (complement #'bar) equivalent forms aren't optimized, which you'd expect if they were idiomatic. So they're deprecated functions where everyone ignores the deprecation and good luck actually removing them in the future.
1:26:49
aeth
So do you do (remove-if (complement #'evenp) #(1 2 3 4)) and future-proof your code against a removal that probably won't happen or do you do (remove-if-not #'evenp #(1 2 3 4)) and get a faster program?
1:32:29
aeth
rpg: It's not up to you if there will be a future standard or not. It's up to the core developers of SBCL, CCL, etc. (Unless you are one, in which case it's fractionally up to you.)
1:33:00
aeth
rpg: I don't see any talks about a standard in any of their channels, so it's doubtful to happen in the next 5 years, but forever is a long time.
3:04:26
slightlycyborg
I basically want to call a function that writes to a socket whenever I write to a stream
3:11:31
slightlycyborg
I don't know what that would mean. However, I think I can just make a socket-stream
3:13:48
buffergn0me
slightlycyborg: You can use MAKE-BROADCAST-STREAM to take a bunch of streams. When you write to that broadcast stream, the same thing is written to all of them
3:23:01
Elronnd
Has anyone used ningle? Is there a good way to serve binary files with it aside from loading them into memory and returning them?
3:25:50
anamorphic
I have this function, (defun (setf attribute) (new-value handle attribute-name) ...) and it would be more useful if I returned `handle' instead of `new-value' (then I could chain things if I needed to). Is there anything wrong with returning an argument other than new-value from a setf function?
3:38:57
slightlycyborg
I know have the jankiest augmented reality machine imaginable. I took an rpi with a 3.5 inch lcd, mounted that to a bike helmet so that it hangs directly in front of my face. I then used SBCL sockets to create a *helmet-stream* so I can print things to my helmet console using (format *helmet-strea* ...)
3:52:29
mathu
herb sutter referenced defun defun () 3 in a talk; what is the tl;dr on what that does? :P
3:54:56
mathu
the context is he's describing how you can go too far with giving users control over Words of Power and language mechanics. he says "google defun defun 3" in the talk, which leads me eventually to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0707r3.pdf if you search "defun" here you can see
3:56:06
Bike
(defun defun () 3) would mean to define "defun" as a function of no arguments that returns 3, but that's illegal because defun is already a standard macro
3:56:28
no-defun-allowed
it just says how to piss off people with redefinition and standards violations
3:57:55
mathu
a footnote in the paper on the page that includes (defun defun () 3) says that common lisp added the restriction that standard names are protected, so i take it there is a history where this code worked
3:57:56
no-defun-allowed
see https://hastebin.com/opanedavep.coffeescript for a transcript of it working
3:59:22
no-defun-allowed
beach (IRC): apparently http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0707r3.pdf uses it as an example of redefinition or extensibility or something
3:59:46
no-defun-allowed
>In Lisp and related languages, programmers can redefine other people’s code and even global language facilities (e.g., the notorious (defun defun () 3) in Lisp, or (define define () 3) in Scheme).
4:00:13
no-defun-allowed
>This is powerful, but undisciplined (causes arbitrary global effects up to and including breaking the language itself)
4:00:38
no-defun-allowed
mind you, it's a bit rich from a C++ programmer to say Lisp could get unreadable
4:02:53
no-defun-allowed
mathu (IRC): http://clhs.lisp.se/Body/m_defun.htm#defun may help but if you've never read lisp it may as well be alien
4:03:03
beach
mathu: It sounds like someone who wants do discourage people from using one of the most powerful languages around by spreading misinformation by making people scared of using it.
4:04:03
beach
mathu: The truth is that it is impossible to write a C++ program that is both modular and fast, whereas that is entirely possible in Common Lisp. So Sutter is sending the wrong message.
4:05:03
no-defun-allowed
i have a sample size of three: the author of that and the doofus who steals my laptop's parents.
4:05:54
mathu
no-defun-allowed: herb sutter has been at microsoft for like 15 years so he's probably required to use word for papers haha
4:06:12
beach
mathu: Unfortunately, because of some very strong psychological phenomena, C++ programmers reading that paper will likely believe him and avoid looking at Common Lisp.
4:06:40
no-defun-allowed
"we gotta show our incompatible dialect of c++ and absolute bullshit language called c# are good what do we do"
4:06:43
mathu
beach: i feel like if you're reading proposal papers for c++ you're probably not writing a lot of common lisp as it is
4:07:21
beach
mathu: He should avoid making references to something that he knows nothing about and that is untrue.
4:07:37
beach
mathu: I advise you to avoid falling into that trap. We are here for you if you want to learn a better way of writing programs.
4:08:32
beach
mathu: The sooner you do it, the more time you will save over your remaining lifetime.
4:09:38
mathu
anyway, thanks for explaining what the supposed meaning of that code snippet was folks
4:09:53
beach
mathu: If you are a C++ programmer, you have probably already accumulated a bunch of false information about Common Lisp.
4:14:18
beach
I guess I meant to say: "OK. So you have not been told by anyone that Common Lisp is an "interpreted language". Good."
4:15:25
beach
mathu: I said that, because that is some of the misinformation about Common Lisp that ignorant people will spread in order to avoid that others discover its power.
4:17:00
beach
mathu: People confuse "interactive" and "interpreted" because they believe that when something is compiled, it has to generate an executable file. Common Lisp is interactive, but most implementations compile the code on the fly and then immediately execute it.
4:18:24
beach
mathu: In fact, it can compete with C for numeric computations: https://www.lrde.epita.fr/~didier/research/publications/papers/verna.06.elw.pdf
4:18:47
mathu
would you happen to know if haskell's ghci is a compiler of the kind lisp uses or if it's a true-blue interpreter?
4:20:14
beach
mathu: So with Common Lisp, you get the superior power of an interactive language, allowing you to test your code interactively as you code, not having to wait for the compiler and the linker every time. But you still have excellent performance.
4:20:28
mathu
it gives you a REPL, but i wasn't sure if it was the sort of iterative compiler that google is telling me CL has
4:21:39
beach
mathu: Plus, with Common Lisp you get a sane object system that is probably one of the most powerful object systems around, namely CLOS.
4:22:23
beach
mathu: Compared to C++, you also get the superior performance of a tracing garbage collector, compared to the slow new/delete or malloc/free (which in addition is terribly error prone).
4:23:20
LdBeth
GHCi can load compiled though, but it does not compile because GHC compiles really slow
4:27:21
aeth
With SBCL, you can make the same algorithm be up to 35x to 50x faster than slow (non-JIT) interpreters (like Python or Ruby).
4:29:09
beach
mathu: Most people who have invested many years learning some inferior technology are not ready to take in such information, as this essay explains: http://metamodular.com/Essays/psychology.html
5:02:29
no-defun-allowed
my dad always told me i spent too much time messing about with things, that explains a lot
5:02:42
gendl
Ha nice essay. I didn't realize it was written by beach until I got to the end. Then suddenly I heard the whole thing in his voice.
5:04:03
gendl
I had just tweeted something along those lines this morning (for some reason it seems I've taken to "tweeting" lately...)
5:08:24
gendl
beach: not so fast, tiger. My tweets usually get liked/retweeted 1-2 times or so, if i'm lucky lol.
5:10:59
beach
I read up on it a bit more. The origin is form Carol Dweck, who used the terms "open and closed mind set".
5:14:26
russellw
I want to search a string for occurrences of whitespace, so find-if seems to be the right function to use, but returns an element, where I need the position. search returns a position, but wants a subsequence, which in this case I don't have. What's the recommended function to use?
5:16:46
russellw
The position returned is the index within sequence of the leftmost (if from-end is true) or of the rightmost (if from-end is false) element that satisfies the test
5:39:15
aeth
gendl: I noticed the same comment on HN that started that Twitter conversation. This one. https://news.ycombinator.com/item?id=18226339
5:47:03
aeth
I think it can be safe to assume that any program filled with hundreds of giant, hand-written prog blocks isn't idiomatic Common Lisp
5:50:22
aeth
Even the standard doesn't want you to use prog. http://www.lispworks.com/documentation/HyperSpec/Body/m_prog_.htm
5:51:26
pjb
aeth: the opinion expressed in that ycombinator news item is bullshit. Lisp is the most maintainable language. Even when you start from bad lisp code, it's easier to edit it and make it good than from any other programmming language.
5:53:16
pjb
I don't know. I don't use maxima routinely. That is, I've not used it since I installed last time, a few years ago…
5:53:35
jackdaniel
speaking of atomic operations, support for them has been merged to ECL recently (interface is very much like sbcl's cas api)
5:54:15
no-defun-allowed
jackdaniel (IRC): remembering your clim textbox demo, are there resources for theming McCLIM?
5:54:57
jackdaniel
there is no abstraction for theming per se at the moment (of course CLLIM doesn't limit you on that front, it just doesn't have it)
5:55:16
no-defun-allowed
cool! i'll probably write a frontend for netfarm with mcclim if i can make it prettier
5:55:46
jackdaniel
as I said, I haven't finished that yet, I'm working on a support for applications for theming
5:57:56
jackdaniel
this does not work well and is wip, I won't share a code of the scraps being already there
6:02:40
aeth
CASes are useful because you can e.g. just say [1 1 1; 0 1 0; 0 1 1] * [1 0 -1; 0 1 0; 0 -1 1] and get the result of the matrix multiplication (that's GNU octave, not maxima... good syntax for matrices). Even if you're programming it, it's helpful to have an external, probably-reliable, alternate way to get the same result via a CAS to check your answer. Basically, math REPLs.
6:03:01
aeth
(The syntax for all of these CASes would be awful to actually program a non-trivial program in, though. That's why a CAS in CL is useful.)
6:03:54
no-defun-allowed
if there was a COND equivalent instead of IF it would be a bit easier though
6:10:27
jackdaniel
I mean - there are so many fun things to work on as an excercise which are not solved yet in so many software libraries, that hacking something what is already there is a waste
6:16:30
aeth
You have to write stuff that other people have written before you get good enough to write new stuff
6:18:12
jackdaniel
if this kind of statements were true, we'd be still developing wheel and discovering fire
6:21:28
oni-on-ion
ACTION sees a quit message in another channel just now: "The only real mistake is one in which we learn nothing"
6:23:10
ThJ
so, intro books... "Land of Lisp" or "Practical Common Lisp"? i've been told that either is "the best one".
6:48:14
jackdaniel
slightlycyborg: afaik beach works on a second climacs. first climacs is in quicklisp. I don't have any plans for emacs clone myself, I don't like this editor