freenode/#lisp - IRC Chatlog
Search
0:09:25
schoppenhauer
is anyone using quicklisp on nixos? is it possible to have an isolated quicklisp-install for a nix-shell?
0:10:57
Fare
I'm pretty sure MichaelRaskin has some helpers to import quicklisp packages into nixos already
0:21:10
schoppenhauer
I found https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lisp-modules/from-quicklisp
0:22:18
fiddlerwoaroof
I've done a bit of work to prevent asdf/quicklisp from writing to standard directories
0:23:47
fiddlerwoaroof
jasom: that's too bad, Codecraft generally happens the last Wednesday of every month
0:24:32
schoppenhauer
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lisp-modules/README.txt i don't really get this file
0:25:46
fiddlerwoaroof
schoppenhauer: here's a builder I've used with some moderate success (Nix / OSX): https://github.com/fiddlerwoaroof/uclip/blob/master/builder.sh
0:25:55
jasom
plus, getting to Thousand Oaks by a reasonable time in the evening is ... not so easy.
0:25:59
fiddlerwoaroof
Here's the nix file: https://github.com/fiddlerwoaroof/uclip/blob/master/uclip.nix
0:26:47
jasom
oh, I don't have my laptop with me, but I have a reasonably complete program to generate nix exrpessions from quicklisp
0:29:38
jasom
Fare: it greps the output of the failure to load; I have manual rules for determining which nix package is needed to resolve the dependency
0:30:45
fiddlerwoaroof
schoppenhauer: the second link is the builder, the first is a shell-script that actually does things
0:31:12
Fare
jasom: does your script deal with executables made with e.g. cl-launch or xach's equivalent?
0:31:21
fiddlerwoaroof
I just read a bunch of stuff about nix and this was the shortest path to victory.
0:31:23
jasom
here's an autogenerated list of packages that failed to load: https://paste.pound-python.org/show/YqxSEXWKVP0rRoRD6XAw/
0:32:10
Fare
jasom, cool I don't see workout-timer there -- does that mean you succeeded at loading it?
0:32:55
fiddlerwoaroof
fiddlerwoaroof: if you have a shell script that does what you want named "builder.sh" that nix expression might do the right thing :)
0:37:15
fiddlerwoaroof
If I have a macro that creates a generic function object, will that cause problems at load time?
0:38:37
Fare
jasom, schoppenhauer does either of you know how to make nix-copy-closure work between two machines?
0:40:41
jasom
cl-sat.glucose.build #Invokes curl during build <-- here's a line from the blacklist that is fun...
0:49:25
jasom
https://paste.pound-python.org/show/WvGieEO57Ptr3qFHi6aN/ <-- here's my builder.sh; haven't looked at it since September, so I'd have to read it myself to remember how it works
0:49:46
fiddlerwoaroof
My impression was that a conforming program requires that all the literals be externalizable
0:51:07
jasom
but each lisp dependency has .conf file that adds its input/output rules, so you include those as part of any system that will depend on that one
0:52:03
fiddlerwoaroof
Boke: my chain of thought was that my macro is producing a generic function object rather than a literal
0:52:03
jasom
I had something working that didn't cache the build outputs, but that seemed not nixy enough, so now there are system-wide caches, though IIRC it fallsback to using your home directory if the system-wide caceh fails
0:52:39
fiddlerwoaroof
This means that the gf object is a "literal" .: it needs to be externalizable
0:52:41
Boke
fiddlerwoaroof: i would assume the macro is expanding to a form that will produce a generic function when evaluated
0:54:31
fiddlerwoaroof
I've fixed that on my version, I just removed the l-t-v call and quasiquote the call to make-anonymous-generic-function
0:56:02
fiddlerwoaroof
http://metamodular.com/CLOS-MOP/initialization-of-generic-function-and-method-metaobjects.html
0:59:38
fiddlerwoaroof
It's a bit like using class-prototype to get the value of a :class allocated slot
1:00:02
pillton
Couldn't you do (defmethod make-method-lambda ((gf standard-generic-function) (m standard-method-class) form))?
1:00:40
fiddlerwoaroof
I have one generic function that maps over a tree of objects and applies a callback to each
1:01:10
fiddlerwoaroof
The anonymous gf provides a nice-ish syntax for dispatching on the class of each object in the tree
1:08:01
pillton
Sure. That is why I like common lisp i.e. there is no god group to stop you from blowing your feet off.
1:42:13
fiddlerwoaroof
e.g. something like (with-imported-symbols (packag:symbol1 package:symbol2) (+ symbol1 symbol2))
1:42:44
Boke
macros affecting how forms in them are read doesn't make sense with the reader separation that exists
1:45:23
pillton
There are package local nicknames: http://www.sbcl.org/manual/index.html#Package_002dLocal-Nicknames
1:47:18
aeth
What about CCL? If something is supported by SBCL, CCL, and ECL it's practically a standard.
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.