freenode/#lisp - IRC Chatlog
Search
20:14:51
dlowe
I wonder if it would be practical to form a lisp project specifically to take python's standard library (which is held in high esteem) and duplicate its functionality.
20:15:38
Fare
I don't hold said standard library in high esteem -- but I take in high esteem that there is one at all.
20:16:26
Fare
that said, these days, I'd rather invest in Gerbil than in CL, but I understand the value offered is very different.
20:17:55
borodust
hmm, actually, following asdf-flv example, i just can propagate system name binding it dynamically, then use this name for finding out absolute path..
20:20:11
borodust
system's resources, but rather than module-defined (would be a hassle to list all) it is root-path-defined
20:21:24
dlowe
one of the problems of such a mega-library, though, is that you get into the hu.dwim problem where you just splinter off from the main CL community entirely.
20:34:00
Shinmera
Given the number of libraries I've written I have felt that I might be diverging into my own ecosystem too much. I usually try to combat that by splitting things up fine enough that they each manage to stand on their own more or less.
20:38:47
Shinmera
Whether that's working or not, I don't have much of an idea. I don't know how much of my stuff gets used at all, let alone how often or extensively.
20:59:53
Fare
lack of a *reference*, *curated* repository for shared libraries is a downer in CL indeed.
21:00:29
Fare
ideally, you'd like the really good libraries, whatever they are, to become blessed, ubiquitous, and continually improved.
21:01:55
Shinmera
How does one determine whether a library is really good? What happens if someone comes up with a better overall design later? Wouldn't a "this is the best there is" kind of designation discourage rediscovery?
21:06:29
Fare
Shinmera, there are many solutions possible. But thinking in terms of ecosystems rather than just libraries is a big plus.
21:06:54
scymtym
maybe people would only roll their own if they had a specific plan for doing better than the blessed library instead of rolling their own more or less by default
21:07:01
Fare
i.e. there can be several "reference" ecosystems (compare the OCaml situation, where Jane St offers a complete replacement for the standard library)
21:07:50
Shinmera
scymtym: Well yes, my point is more that people might be lead to the idea that this is the best thing possible, and thus, even if there was a better way out there, the likelihood of it being discovered was much smaller.
21:08:44
Fare
Shinmera, depends on how rigid an ecosystem is in embracing alternatives and deprecating older designs.
21:09:33
Fare
"yes, your library is promising, keep making it better and we'll embrace it and deprecate the current library for the same thing (unless it steps up its game in the meantime)"
21:11:55
xantoz
python has several libraries that do the same thing, in the standard library, iirc (i.e. one old version, and one new version that is the recommended for new code)
21:12:05
Shinmera
Just to note, I'm not against a curated source of libraries, these are just questions that immediately spring to mind that one would have to consider when attempting such a thing for real.
21:12:45
scymtym
Shinmera: in my experience, people are likely to write replacements/competitor libraries, no matter how the ecosystem works
21:35:25
Fare
also, CL is so much on the "too many half-assed libraries" side of the equation that even if there could be an abuse of curated ecosystems, that's not a present problem for CL at this time.
21:36:25
Fare
Actually, I should try to build a layer of gerbil libraries above gerbil and see how easy that is...
22:48:15
lambdice
generaly, when i write a kind of library foo, in foo.lisp i defpackage foo, then the first line after this definition should be (in-package :foo) ?
22:58:19
lambdice
humm apparently yes, the first form after the definition of my package foo should be an (in-package :foo)
22:59:44
lambdice
But i am thinking, in my defpackage from if i need to import some name/symbol from another package, can i just use :shadowing-import-from instead of the basic import-from ?
23:04:31
lambdice
yeah i was doing some test with a foo.lisp and bar.lisp defining exactly the same function, so in my main.lisp i choose which on i need with some :shadowing-import-from
23:05:10
lambdice
but as :shadowing-import-from works even when there is no conflict why use import-from ?
23:07:26
_death
because "works" depends on the circumstances.. if you have your or someone else's symbol and you :import-from a different symbol with the same name, you will get a nice conflict error instead of silently shadowing it
23:09:06
_death
so by default, to pervent issues like this, you should use :import-from.. only when you really mean to shadow a symbol you should use :shadowing-import-from
23:09:27
lambdice
_death: if i get a "nice conflict error" then i can choose if i need to shadow something or not
23:11:16
_death
if you want to use two different symbols with the same name, you should qualify at least one
23:12:56
lambdice
so in my main.lisp i will have to load first package.lisp, then foo and bar right?
23:15:09
lambdice
and in foo.lisp first form should be (in-package :foo) and in bar.lisp first form should be (in-package :bar)
23:19:04
lambdice
i will use quickproject anyway, but before i want to understand a bit how it works
23:19:43
_death
another style that works well for many cases is the one described in http://davazp.net/2014/11/26/modern-library-with-asdf-and-package-inferred-system.html
23:24:05
_death
it has its own gotchas.. for example the association of file path and package name could make it difficult to rename later on, if you're not careful.. but it also has some good qualities
23:29:07
_death
one cool thing is that you can load just the one module you need (w/ all its dependencies).. so if you have large-project and a module large-project/standalone-utility, and want to load just that, you simply (ql:quickload "large-project/standalone-utility") and it works
23:32:23
lambdice
apprently if i want to import symbol from :foo and :bar i dont need to add them in the :use form instead defpackage
23:33:19
lambdice
when i wrote i package i used (:use :cl :foo :bar) but apprently it works too with just (:use :cl)
23:34:50
_death
:use is different from :import.. my general rule is to :use :cl and possibly other packages I control.. the rest I just :import-from
23:37:46
_death
lambdice: :use affects symbol lookup, but does not import symbols.. the set of names it "brings over" is not fixed, and this may create difficult trouble now or in the future
23:45:38
_death
for example, imagine your package uses :quux, a third party package.. you (defun my-function () ...) .. a day later, a new :quux version is out, and it now exports a my-function symbol of its own.. now, your defun will redefine quux:my-function!
23:46:49
_death
this has happened to me personally multiple times in the past, and the effect is often very puzzling until you figure it out
23:48:48
_death
less puzzling effects include conflict errors when two packages at some point decide to export same-named symbols.. this has a good chance to happen if you :use utility libraries
23:50:37
_death
by the way, the redefinition was even more puzzling because it wasn't me who defined my-function, but another library that used :use
23:58:20
_death
generally the package-inferred-system style helps w/ accidental reuse of symbols, since it encourages small packages (one per file) that export a small portion of their symbols
23:59:16
_death
with one-big-project-package you may forget that you used this symbol in another file
6:35:37
mfiano
Hello. Can someone help me out with a function to generate the following? http://paste.lisp.org/display/359377
6:38:07
mfiano
A couple of us have been trying for 2 hours in another channel. Using shared structure is not working
6:41:09
quazimodo
is there a _very_ cheap hash function that can take a deeply nested object and return a hash with a reasonable uniqueness, but not something like md5
6:41:39
quazimodo
basically, a very fast way to say "I'm pretty sure this hash's obejct is different to that has
6:45:18
quazimodo
stream based view rendering off a single atomic state object is using functional lensing. Because of this, subcomponents on the page can't isolate vdom updates to their own 'setStates' and have to update each time _anyone_ does a setstate, because we can't be sure if they're lensed on other component's data
6:45:46
quazimodo
essentially child 1 changes title to 'Hi' and child 3 _must_ update because it's using a lens that _may_ be using child 1's title
6:48:18
quazimodo
because the lens literally takes the entire atomic state object as an argument, then picks and chooses what the child component sees as it's own private state
6:48:36
quazimodo
the child _thinks_ it has a wholey private state, but in fact that representation may bo comprised of many other components states
6:49:04
quazimodo
we either register what it listens to and do checks if those changed, or compare child's previous state to current and if no changes, don't bother emitting a view update event
6:49:16
Shinmera
Then give the lens a capability to tell you whether it cares about another object that you just updated or not.
6:56:16
shka_
mfiano: acumulate variable, not really needed in how this code works, would be more sensible with reduce instead of append/mapcar combo
7:29:10
dtornabene
in sbcl, and i'm getting an "undefined function" via the command line, in sbcl, after having loaded it via quicklisp
7:33:37
loke
secondary benefit is that it's easy to see which package a certain function belongs to.
7:34:32
loke
Most people don't, until they write their first large program and want to change the name of a package (for example), or want to identify all places where a certain package is used, etc...
7:46:13
phoe_
dtornabene: bordeaux-threads and binary-types both use BT nickname, which has last been a problem... one, or two days ago?
7:47:24
dtornabene
interestingly enough i got a problem with an auth failure so I ducked over and tried to connect to a sqlite3 db via datafly....which rec'd use-package
7:49:57
dtornabene
this is the error if anyone has any thoughts on *that* error http://paste.lisp.org/display/359385
7:55:10
dtornabene
so, I'm assuming I should put the ip addr in there then? as in, via the error 127.0.0.1:something?
7:56:12
loke
ACTION uses Kerberos autoentication so I don' thave to deal with passwords, but that takes a bit more effort (the Kerberos support was what I contributed)
7:57:06
dtornabene
i've got the user created via postgres, but I must have bungled the password somehow
7:57:49
loke
dtornabene: plain psql uses local connection, not over the network. There is a config file soemwhere you have to edit to enable network logins.
8:05:49
dtornabene
"host local not found: 3(NXDOMAIN)" after printing "local has address 198.105.254.24" "local has address 198.105.244.24"
8:06:41
loke
you should be using localhost, but you need to make sure the user exists and has a password assigned