freenode/#lisp - IRC Chatlog
Search
17:45:26
Xach
That's the difference between "make it work, no hack too gross" and "suitable for general portable use"
17:46:27
gendl
because I can pretty much guarantee that those #+allegro-version<= aren't going away (I can still ask, though).
17:47:24
Xach
gendl: Thta's my impression, too. But maybe they'd be swayed by patches that use Xof-style feature flags instead? Where you test for a specific functionality, rather than a specific version, to handle incompatibility.
17:48:54
gendl
Ok i'll check into it. But I'm thinking in the meantime, make a portable fork (call it paserve2 or something) just as an interim solution, to be able to have a working setup in Quicklisp...
17:49:20
gendl
then work toward getting rid of that (and Franz might be swayed to help get rid of it, in the interest of limiting the number of aserve forks floating around)
17:49:52
Shinmera
could also have a #+allegro file that translates the version checks to regular features and then use those throughout
17:50:48
gendl
the other issue with getting original aserve into QL is the name clash with legacy portableaserve. One of the two has to be renamed (I've already reached out to anyone who I think cares, and in principle we're good to rename the old one paserve, but hasn't happened yet).
18:07:29
Bike
right, so the bt:make-thread is irrelevant. it's just a closure the same as any other closure.
18:19:44
gendl
Xach: what would it actually mean for aserve to be able to load “standalone?” I mean, it will always need zacl on non-allegro lisps, so how could it ever be wholly “standalone?”
18:20:34
gendl
how about just packaging it for quicklisp together with zacl, and call the whole thing “zaserve” or something?
18:22:50
gendl
and get the aserve part of it as close as possible to the canonical franzinc version (maybe not 100%) and someone “hopefully” (me for the foreseeable future) will just keep merging the upstream franzinc one into it every month or so.
18:34:08
whartung
can aserve load in a generic lisp (not run, but load)? Will it build, compile, and (ideally) fail tests? or does the “read table hacks” prevent it from loading?
18:52:26
Xach
gendl: truly standalone would mean load aserve and it loads its own prerequisites and runs.
18:53:16
Xach
gendl: bundling it with zacl and calling it zaserve seems to me the same strategy as paserve, which introduced the allegro-compat library.
18:54:20
gendl
...and as long as we’re trying to use pristine franzinc aserve, that’ll by definition never be possible, bcos pristine aserve will never have a :depends-on (:zacl) in its aserve.asd.
18:56:08
pjb
Posterdati: it should work, version 1.2.7 http://www.sbcl.org/platform-table.html Download the binaries.
18:57:24
gendl
yep, we’re pretty much landing back at “new & improved portableaserve”... but I can’t really see another way, unless Franz will accept :depends-on (#-allegro :zacl) in their official aserve.asd
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