freenode/#lisp - IRC Chatlog
Search
1:54:17
vtomole
How strict is clhs on what counts as a standard? What I'm trying to ask: when is a implementation not considered to be common lisp?
2:03:24
vtomole
So if *theoretically* There was a set of procedures that CL programmers used a lot. Now if these programmer were tired of doing (load "utilities.lisp") on all their programs; if this utilities.lisp was added to SBCL. Will SBCL still be conforming?
2:04:39
aeth
A lot of de facto standards already exist, generally handled by portability libraries like cffi, bordeaux-threads, closer-mop, etc.
2:05:23
Boke
the point of the standard is to let programs run across implementations. an implementation having extra stuff doesn't mess w/that.
2:05:31
aeth
That's what i mean by 'practically a standard". Things that are supported by most if not all of the popular implementations are de facto standards.
2:19:34
PuercoPop
in sb-int: there are also some utility functions that you can find elsewhere, like with-unique-names and binding*, which is in the spirit of metabang-bind
2:25:48
PuercoPop
Fare: uiop:nest was about reducing the nesting so the code only right? TBH I just use vanilla constructs, never bothered me enough to load something like metabang-bind
2:49:34
aeth
The only thing that really bothers me is multiple-value-bind. I don't feel like adding a whole library to deal with it, though.
3:52:28
Fare
PuercoPop, yes: instead of reinventing all the binding forms, badly, to fit them into a mother-of-all form bind, just use the actual form, inside a nest.
3:57:53
fiddlerwoaroof
Clojure tried this with the threading macros and, all they do is obfuscate the structure of your code
4:07:50
jasom
so apparently I had left my ql2nix script in a state where I had just added support for lisps other than sbcl ... A quick 1 line change and it can handle systems that pass on some, but not all implementations. Still running now with 365 systems generated (it's *very* slow).
4:46:07
fiddlerwoaroof
The difference is that (->> (a b c) d (e f g)) turns into (a b c (d (e f g)))
4:49:20
jasom
also it looks like my dependency calculation needs improvements; I seem to miss dependencies in some projects (all of which so far appear to be using package-inferred systems)
4:51:18
jasom
ah, I'm just reusing ql's DB which doesn't handle package-inferred systems, but rather resolves those at runtime... I can do the same I suppose.
5:22:32
fiddlerwoaroof
PuercoPop: (uiop:nest (a b c) (d e f) (g h i)) turns into (a b c (d e f (g h i)))
5:27:55
fiddlerwoaroof
Still, I have the same problem with both: they obscure the structure of the code
7:57:58
malice
Is there a way to see how many times has a concrete quicklisp project been downloaded?
7:59:13
phoe
malice: I think you need to poke him directly. He always only uploads information about the top 100.
8:06:27
phoe
anyone up for cooperatively making a set of CL solutions to https://github.com/iiitv/algos ?
8:11:50
beach
They all start by testing for equality with the middle element. That increases the number of tests by (as I recall) 20% on the average.
8:12:36
beach
This is a very good example of the fact that 75% of the algorithms published in literature are wrong.
8:16:39
phoe
It wouldn't be an exercise if, speaking Python, you could just do "from future import antigravity".
8:18:27
malice
And if you want to make some things the right way, you need more code. cl-trie has more than one file, so that it's organized properly.
8:21:03
malice
Though if you need something, like BST or Trie or anything, feel free to implement yourself or contribute to existing projects.
8:22:25
beach
malice: I totally agree. But it's worse, because it is risky. If a Lisper who has insufficient knowledge about algorithms contributes a bad solution, Common Lisp will look even worse.
8:23:42
malice
I've seen some repo which had code to parse json data, and CL was there too - I believe it was written by pjb, but I might be wrong.
8:24:10
malice
I really liked the fact that CL was not only fast, but used reader macros to bring json to language and then just READ it :)
8:24:44
ecraven
Shinmera: of course, but if someone has actually used it and there were really obvious problems, that's saying something.
8:29:03
malice
pjb: I believe it might have been some benchmark, because there were many languages available. It wasn't library by all means. Also sorry for being wrong.
8:29:23
beach
I can only imagine in how many ways and by how many people more complicated algorithms are wrong.
8:31:10
jasom
beach: 2 out of top 3 hits on google for binary search get it wrong (wikipedia gets it right)
8:31:18
Shinmera
beach: There's more to get wrong if you use a language with restricted counter indices (eg int). See https://research.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html and others.
8:32:24
malice
I don't remember, the story was quite famous for some time, but I believe that it didn't work for some big numbers?
8:33:16
jasom
beach: I checked more pages, I ony found 2 on the first page of results that both 1) show code or pseudocode and 2) don't start by comparing for equality
8:36:22
beach
Shinmera: It would be very surprising if the addition would overflow on a 64-bit machine with 0-based arrays.
8:41:08
TMA
[in a sense, having the bounds stored in an int and not in a size_t is an error in itself -- so common an error that it is almost invisible]
8:56:08
Shinmera
I just always think back to the apparent law of "90% of any category is shit" and then settle for it not really mattering all that much.
9:04:15
kora9
And threadripper, and VR is getting off the ground! Hard to not be giddy about that :)
9:11:47
beach
kora9: Are you trying to cheer me up? I am afraid that won't work. At least not for the next 12 hours or so.
9:26:49
schweers
I’m not sure why that is a problem. I know that int and pointer don’t have the same sizes on all architectures, but it always seemed to be the sane thing to do, at least to me
9:29:32
shka
schweers: well, not really, most arrays may be small enough to be indexed by int, but not all
9:32:47
beach
schweers: It is clear that #lisp participants know more about C programming that C programmers. It is a good sign for #lisp participants, but it is a bad sign for the computing industry.
9:33:41
schweers
beach: do you really think that #lisp participants know more about C than C programmers? I mean people who actually know C, not some dilletant
9:33:45
shka
beach: i'm pretty sure that some lisp programmers are also competent C/C++/java/whatever programmers
9:34:33
beach
schweers: Sure, it boils down to the definition of "C programmer". But with your definition, I suspect that most people writing the software we depend on are not in that catagory.
9:35:56
schweers
I don’t understand why it doesnt’t make them turn their backs on the language if they can get away with it, though
9:36:31
jasom
and fwiw ##c is by far the most pedantic IRC channel I've ever been in. There's even someone in there who compulsively uses diaeresis (e.g. coördinate) in chat.
9:36:41
loke
ACTION is competent in Lisp/C/Java/Kotlin/Elixir/Elisp/C++/Shellscript/APL, with tinkering in Erlang/Smalltalk at the moment.
9:37:42
jasom
I know much more of the C++ standard than the average C++ programmer, but I've never written any significant code in C++...
9:38:58
jasom
schweers: no, but when I need to give a definitive source for customers, the prose in there is *extremely* more accessible than the C++ standard
9:39:45
jasom
and I looked something up to quote and said "wait, do I have it wrong?" checked the standard, and indeed Stroustrup had said "declaration" when he meant "definition"
9:42:01
jasom
There are worse languages than C++. Unfortunately many of those languages are what C++ programmers seem to think they are programming in...
9:42:19
schweers
ah, that’s not what I meant. I just find that “The C++ Programming Language” is very offputting. For instance because of its sheer size.
9:43:28
kora9
jasom: I once read an interview with Linus Torvalds in which he stated that he doesn't dislike C++ so much as C++ programmers
9:46:25
jasom
C++ is heavily slanted towards making library writing hard, but library usage easy. If you have well implemented libraries, often the solution looks nearly exactly like what it would in higher-level languages
9:47:13
schweers
I find reading library code in C++ difficult, but then again I’m no expert in the language
9:47:22
jasom
Poorly implemented libraries though devolve into something often called "C+" or "C++--"
9:48:09
jackdaniel
there is no good isolation between libraries and software using them. You basically need to follow programming style used in the library - library uses templates? then you need to do that as well. Does it have excessive class hierarchy? well, you need to subclass that and write methods for them. That is my impression from using this language.
9:48:37
jackdaniel
so using two libraries written in different styles, you need to adopt both. and this is a straight way spaghetti code
9:49:37
jasom
I have a critbit tree implementation that implements most, if not all of what C++11 provides for its standard containers. I've yet to update it for 14 or 17
9:49:51
schweers
jackdaniel: although I think that to be true of any multi-paradigm language. I’ve been annoyed by CL code which didn’t use classes, but just plain lists or vectors
9:52:19
jasom
typename conditional<is_const<T>::value,const ExternalNode&, ExternalNode&>::type operator*() const <-- this is the declaration for the dereference operator that returns either a mutable or constant external node, depending on whether the templated type is const
9:54:03
jasom
schweers: well you get used to it if you wade through library code; all of this does allow efficient implementation of very terse code for consumers of the library
9:56:41
jasom
and the magic is just an ugly syntax for: (if (is-const T) '(const & ExternalNode) '(& ExternalNode))
9:57:17
jackdaniel
my personal opinion is that there is infinite number of C++ subsets which are good languages, but when we take it as whole, we have features which step on other feature toes
9:57:49
jasom
jackdaniel: there is *huge* tension between template-based polymorphism and class-based polymorphism
9:58:38
jasom
schweers: well "proper"; templates are turing complete, so you actually can do most things you can do in lisp with it, *if* you don't care about your eyes, or the sanity of people reading the code later.
9:59:34
schweers
didn’t one of the designers exclaim “Oh my god, what have we done?” as someone found out that the template language was turing-complete?
9:59:40
jasom
oh, and that declaration is longer than the body of the function, which is just: return *this->where;
10:01:53
jasom
but you can loop over the key/value pairs in the data-structure in-order with exactly the same syntax as looping over built-in containers. That's something that can't be done with CL:LOOP
10:07:35
jasom
and interface-passing style (like Fare's LIL) is *very* natural in C++ with templates, and is all done at compile time.
10:09:36
schweers
I can’t help it but I find the only thing that it natural in C/C++ is poking around in virtual memory in a very controlled fashion. Everything else seems like a major undertaking. Even iterating in C++ seems very unwieldy to me
10:10:49
jasom
for(auto& item : v) { /* in here item is bount to each elt of v in sequence */ } <-- pretty straightforward as of C++11
10:11:29
schweers
as long as you don’t have to use iterators directly, which many libraries want. I understand why, but it still seems weird to me
10:13:16
jasom
schweers: they should only want that if you are going to iterate over a subsequence, since that code is semantically identical to: for(auto it = v.begin(), end = std::end(v); it != end; ++it) { auto& item = *it; ...}
10:14:37
jasom
schweers: everyone knows it's unwieldy which is why they introduced the new syntax, which is backwards-compatible with any libraries that implement iterators and std::end
10:15:34
Fare
jasom: is interface-passing style common / colloquial in C++ and/or used in (semi)popular libraries?
10:16:25
jasom
and if they *don't* implement those, it goes back to my point of poorly implemented libraries leading to hard to write client code.
10:16:51
jasom
Fare: there are parts ot the C++11 standard library that use it to do things that haskell might do with type-classes IIRC
10:19:25
Fare
ACTION thinks that while bringing IPS to CL was nice, the real innovation in the paper was about the correspondence between pure and stateful data structures, and the automation of wrappers between 4 programming styles.
10:22:37
jasom
http://www.boost.org/doc/libs/1_64_0/libs/mpl/doc/tutorial/higher-order.html <-- crazy stuff you can do in C++
10:22:44
axion
Fare: Do you know if that patch you did to uiop about a year ago to fix the performance of listing subdirectories was propagated to any major implementations yet with an asdf update?
10:30:19
jasom
Fare: http://en.cppreference.com/w/cpp/algorithm <-- this is entirely templated functions for performing operations on containers, and one can include an execution-policy object in the template parameters for parallel or sequential operation...
10:37:33
jasom
Fare: iterators also work by declaring which traits they implement (rather than inheriting from a class heirarchy). I think it's even sound as of C++17 (google SFINAE if you want to spend way too much time learning about incorrect compilation of templates)
11:20:54
schweers
does anyone here use series? I had a problem that I always got a whole load of warnings about using non-series objects as series expressions (or something like that, I don’t remember the exact detail). Was I likely doing something wrong or does series not behave well if parts of a series computation are defined and reused in different places?
11:22:18
knobo
djeis: https://sourceforge.net/p/sbcl/sbcl/ci/f0cda4884a396fa7a215f461c0187bac28f87521/
11:22:28
djeis
schweers: I've worked with it a good bit, but I don't understand too much of the internals. It's code-walker does some fun stuff inside lol.
11:23:07
schweers
as long as I had /one/ large expression all was well, but … that’s not how I like to do things
11:24:28
djeis
Nothing's wrong with them. I like them too, when they make code clearer. Just wasn't expecting it 😁
11:26:51
knobo
I also like anaphoric macros. Just that I realized that my likings does not always help me.
11:27:55
knobo
I'm kind of damaged by using perl for many years. Though it's quite many years since I used perl now.
11:28:37
knobo
I'm still afraid of going down the path of "wow... thats a cool feature. let me see how I can misuse that"
11:29:37
djeis
That's fair, I suppose, but I find in Lisp that kind of thinking can also lead you to a better understanding of what's actually going on under the hood.
11:31:58
djeis
The series optimizer is trying to make a single loop out of the series expression you've created, so it can efficiently pipeline everything.
11:32:48
djeis
If the expression has state which cannot be resolved in a single pass loop the optimization fails
11:33:22
djeis
And it gives you a ton of warnings because when screamer was written the fallback runtime code was a lot slower
11:33:32
schweers
that’s what I though too. seems to me that that makes it almost unusable in real programs
11:34:15
djeis
It makes it a lot less flexible, I suppose, but no less that any other looping construct.
11:35:28
schweers
without fully understanding those in the firstplace, so I may have been very misguided
11:37:21
schweers
I know, but it doesn’t seem to do that by storing state (i.e. closures and the like) but by resolving it all at macro expansion time
11:38:27
djeis
The problem with series is that it's trying to not loop over its inputs twice. Transducers can't do that either.
11:40:29
schweers
are you sure? because I thought that transducers avoid exactly that. Well, that and consing.
11:42:20
djeis
But yeah, the series fallback is closer to using lazy sequences in clojure instead building a transducer
11:45:22
schweers
I might still have some code in git, but I can hardly remember where and when to look
11:46:05
schweers
but it was basically something like this: (let ((intermediate (series stuff ...))) (do series stuff with intermediate))
11:47:45
djeis
Every code-walker you introduce adds a ton of compilation overhead, and because code walking isn't standard across implementations occasionally they step on each other's toes. Not a huge problem in practice, but it's bitten me once or twice.
11:48:27
schweers
hmm, okay? I do have one issue with this: iter code is annoying to debug, at least in sbcl
11:49:48
djeis
If you've set debugging to 3 you can usually step through it just fine, in my experience.
11:50:45
schweers
sbcl tells me which expression it’s about to evaluate, but if I let slime show me the code it highlights the entire iter expression
11:51:46
djeis
It's not like a regular macro, so it's much more difficult for sbcl to track where the input code ends up in the generated expression. It also effects the warnings sometimes.
11:54:50
djeis
So yeah, when I can I often use loop or do, since they have much better behaved semantics with the debugger and compiler and are often slightly better optimized. Occasionally tho, you can't beat some of the tools iterate gives you.
11:56:00
schweers
I’ve never been a fan of loop, I always have to look up how to say things. iter just feels much more natural to me. that’s one of the reasons I use it. Also there are things that are easy to say with iter, but cannot be directly expressed with loop
11:56:43
djeis
Both have similar tools to iterate but limit themselves just enough that they don't need a code walker
11:57:55
djeis
Once the code gets complicated enough, readability alone is often enough that I use iterate regardless
13:02:40
Shinmera
Speaking of FOR, I've just updated the docs to add some comparisons to LOOP for the examples.
13:11:03
axion
Shinmera: Thanks for listening. and I saw your comment, I just don't know how to reply yet.
13:15:04
axion
Shinmera: would it be possible to have the same syntax as loop destructuring, minus the ordinary lambda list sutff like &key etc, but given a VALUE form?
13:15:13
schweers
ACTION just realized that the word umlaut does not contain any of the characters it describes
13:16:52
jackdaniel
phoe: it was an unicode character `WHITE VERTICAL RECTANGLE (U+25AF)' copied over to fool around
13:17:41
phoe
schweers: 𝖞𝖔𝖚 𝖙𝖞𝖕𝖊 𝖜𝖎𝖙𝖍 𝖙𝖍𝖊 𝕱𝖗𝖆𝖐𝖙𝖚𝖗 𝖐𝖊𝖞 𝖕𝖗𝖊𝖘𝖘𝖊𝖉. 𝕯𝖎𝖉 𝖞𝖔𝖚𝖗 𝕷𝖎𝖘𝖕 𝖒𝖆𝖈𝖍𝖎𝖓𝖊 𝖈𝖔𝖒𝖊 𝖜𝖎𝖙𝖍𝖔𝖚𝖙 𝖎𝖙?
13:19:14
schweers
and I thought it was somewhat fancy that I can enter some greek symbols directly from the keyboard
13:19:46
Shinmera
axion: Having something like (for:for (((a b c) = (something) :transform-by multiple-value-list))) could work, but I don't know.
13:21:54
Shinmera
axion: Alternatively: (for:for (((values a b c) = (something)))) could work, but it would rule out using values as the name of a variable while destructuring.
13:22:02
jackdaniel
hum, someone apparently wrote a paper with a proof, that P <> NP: https://arxiv.org/pdf/1708.03486.pdf
13:22:40
axion
Shinmera: I have been thinking about it, and I don't think it is easily handled, nor does it make much sense.
13:23:01
Shinmera
axion: Well, I can see value in it, or value in the general :transform-by argument as posted above.
13:23:41
axion
Ok, I'm just not sure the best way to do it. I will say that loop, metabang, let-plus, etc all do not handle it though
13:24:16
Shinmera
The first case would require modifying all the existing bindings to include a :transform-by key argument. The latter would require changing the UPDATE operator.
13:24:59
axion
Actually ignore that last comment. let-plus does handle it, but it's not an iteration library. I'm not sure what I was thinking. There is something it didn't handle, but I can't remember now. I think I need to wake up.
13:25:55
Shinmera
The foreign update binding thingy I have on my own wishlist for FOR is much more complicated to implement without incurring general overhead.
13:30:55
Shinmera
The foreign update binding would require either a prefetch phase where the bindings are scanned for injections, which are then inserted into the update forms of the respective target bindings, or control variables that are set when an update happens.
13:34:02
Shinmera
Also: FOR generates efficient code where it can. Expansions should be on par with LOOP.
13:42:08
axion
TIFF supports 32 bit color, layers, and many internal formats, mostly lossless with better compression.
13:43:10
axion
Well I guess I can't ask you to compare my library with png-read then if you use FFI :)
13:44:35
Shinmera
I'm always open to switching to CL-native things, if I don't have to drop support. So, if there's something that can load JPG, PNG, GIF, and BMP in reasonable time I'd be happy to switch.
13:46:06
axion
opticl currently uses png-read, which is incredibly slow, but I am looking to change that.
13:47:39
Shinmera
I'm currently much more bothered by Harmony/cl-mixed fucking crashing in my face for inexplicable reasons.
13:48:35
Shinmera
Ah. I don't use the gl functions. I just load into memory and handle the texture allocation myself.
13:50:00
axion
It's a nasty issue though, for an unmaintained piece of software. Baggers wants to wrap SOIL2 soon.
13:51:19
Shinmera
Speaking of texture crap, any idea why this would give me an invalid operation gl error: (GL:TEX-IMAGE-2D :TEXTURE-2D 0 :DEPTH-STENCIL 956 1160 0 :DEPTH-STENCIL :UNSIGNED-BYTE (null-ptr))
13:51:20
axion
I personally try to do everything in portable CL except when I have no control. I use sdl2 for windowing, and opengl because, yeah.
13:51:35
Shinmera
Even if I use a specific internal format like :depth24-stencil8, I get the same complaint.