freenode/#lisp - IRC Chatlog
Search
21:39:09
Shinmera
I suppose I should be happy that I can't tell if that'll actually tell me if there's a failure going on
21:40:51
Shinmera
Anyway, thanks! Hopefully you won't have to manually bother me about failures anymore now.
21:49:27
dim
wow, I think I managed to make quite some progress on my pgloader COPY batch crazyness, now streaming the bytes directly down the protocol when on-error-stop is picked (default in db-2-db cases) rather than the classis on-error-resume-next
21:51:29
dim
https://github.com/dimitri/pgloader/blob/master/src/pg-copy/copy-db-write.lisp --- parts of the inner magic, for perf comments inclined people ;-)
21:58:50
__rumbler31
read through this, your defun descriptions are the same paragraph. Also, was there anything more to your optimizations than including the right (declare... options?
21:59:25
__rumbler31
er that might have sounded belittling. I'm a novice at this, so the most obvious signal is the declare forms
22:01:56
dim
https://imgur.com/zAaK1HM for the turbo thing, if for reasons you don't remember about that...
22:03:28
__rumbler31
I've scrounged together towers with those buttons on them with of course nothing to wire them to. I think I used it once when the wire for the real power button was too short
22:05:46
_death
dim: my advice then is to remove the unsafety declarations and if it's not crawling keep it that way
22:21:06
sjl
1 is the "neutral value" according to the spec. pretty sure most implementations make 1 the default.
22:24:00
_death
dim: safety 0 means you're on the segfault-corruption scale if something isn't right..
22:24:56
dim
well... the patch makes it half as likely for pgloader (using SBCL) to end up in the lldb prompt because if Exhausted its memory space anyway
22:25:59
dim
the typical user of pgloader runs the command and then does something else, segfault won't have more impact than another error condition to them I think, it's not as if I was playing with a live dev env from a lib down
22:27:04
sjl
silently corrupting data they're inserting into the db would probably be more impactful
22:28:54
dim
once again I didn't think it would be that “easy” to implement this idea of streaming without intermediate buffer when on-error-stop is picked
22:31:21
_death
I spent most of my day writing C++.. and a bit of Lisp.. so CL to the rescue here as well :)
22:35:10
dim
for me it feels like I can do in a couple hours in CL what I would have done in a couple days in Python and a week or two in C
22:40:13
z3t0
I have been hacking lisp for a few months and am now starting to write a small program
22:42:18
jasom
Shinmera: the downside to that is that there are such varied styles; it's usually easier to start with a single style when beginning
22:43:57
aeth
There are a few style guides for CL. Here's Google's: https://google.github.io/styleguide/lispguide.xml
22:44:18
aeth
Here's one of many copies of Norvig's: https://www.cs.umd.edu/%7Enau/cmsc421/norvig-lisp-style.pdf
22:44:49
rpg
Speaking of things, does anyone know if Chris Riesbeck's "CS linter" is still out there?
22:45:12
aeth
I don't know anything about the quality of this guide or the author, but I just found this, which is high up on DuckDuckGo's results: http://lisp-lang.org/style-guide/
22:46:23
jasom
z3t0: I can't find a beginners tutorial, but you can get a skeleton setup using quickproject
22:49:19
rpg
Xach: did you get it from the g000001 repo at github? That seems to be the root of the tree on github.
22:51:35
rpg
p_l: package-per-file was integrated into ASDF, but I'm not sure I would say that it's clearly seen as The Right Thing. It is pretty useful if you have complex and changing dependencies (like ASDF and UIOP), because it enables ASDF to figure them out for you. But I can't say I like interacting with systems with that many namespaces, personally.
22:52:15
rpg
Especially since completion sometimes turns nice readable exported names into hard-to-read over-specific sub-packages.
22:53:14
rpg
I would say if you are writing your first system, then you shouldn't need a zillion packages to avoid name collisions.
22:55:23
Shinmera
I consider packages part of the user interface. They don't have much to do with how the code is organised internally, really.
22:56:56
rpg
Shinmera: Occasionally I find myself introducing sub-packages, in cases where there's a clearly delineated sub-function (e.g., some specialized form of tree search), and I want to not have to worry about using common names like "search", "visited," etc.
22:57:54
p_l
Shinmera: If I were to go with package-per-file, I'd probably cleanly separate an "user-facing" package (possibly multiple) that would cover the APIs
22:58:24
rpg
p_l: that's what ASDF does. It has its ASDF/INTERFACE package, that is nicknamed just ASDF.
22:58:36
Shinmera
I guess. I just feel like p-p-f encourages writing huge files, and incurs tedious symbol juggling.
22:59:31
_death
Shinmera: I've already talked about package-inferred-systems advantages/disadvantages in the past though
22:59:46
rpg
Actually, since we're off into the package rabbithole, I should say that though I don't enjoy p-p-f, I *do* think that Fare's macros for defining packages have some really useful features. Especially for p_l's example -- it's nice to have a defpackage variant that will import and then export a symbol with a single specification.
23:01:17
p_l
actually I'd often create a `cl3` package or similar that would use conduits to bridge conduits, closer-mop and bunch of other similar libs into common base language
23:02:22
drewbert
Hi peeps. I'm super new to lisp. I'm looking at the core for a lisp I want to use in a project. I see it has def, which it uses to define defmacro, and defmacro defines defn, and defn seems to be defining runtime functions. What is `def` ?
23:04:06
Shinmera
drewbert: Note the channel topic. This channel is for Common Lisp only. Other lisps have their own channels (#scheme, #clojure, for instance).
23:04:49
Shinmera
drewbert: There's also ##lisp for the family of languages, but I don't know how active it is.
0:11:14
Xach
z3t0_: nth-value relates to getting one of the multiple-values returned from a function via values
0:11:36
Xach
z3t0_: common lisp can return multiple values from a function, like with decode-universal-time
0:18:01
Xach
z3t0_: you normally wouldn't. but it is normal to iterate over a chain of conses (a list) with dolist or loop.
0:18:49
z3t0_
I have a cons of elements that I need to go over in order to process each one, initially i thought of using loop for x in data but that doesn't seem to work
0:18:51
minion
z3t0_: please see pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
0:19:58
jasom
z3t0_: a cons is just a pair; however they are often used to make a linked list (are you familiar with the linked-list data structure from other languages?)
0:20:24
z3t0_
Yes I am familiar with linked lists, not too sure about how to deal with them in cl htough
0:21:05
pjb
In practice, it's more efficient if the implementation provides primitive implementations of some other types, but it wouldn't be necessary.
0:22:53
jasom
z3t0_: when a CONS is used as a list (car FOO) gets you the data element and (cdr FOO) gets you the next cons in the chain
0:23:24
jasom
z3t0_: and similarly (loop for item in FOO ...) will iterate over the items in FOO, assuming FOO is a list
0:29:08
jasom
hmm, any ideas on how I could get an unhandled memory fault when not using FFI and restricting safety to 3?
0:46:43
Xach
paule32: the error is not adding what you tried, what you expected, and what you got instead of what you expected.
0:52:34
Xach
I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
0:53:39
Xach
paule32: my understanding of a half adder is that it works on bits, as well, and not something like 2 and 3...
0:59:46
jasom
paule32: can you make a simple buffer out of two inverters with this, and show us it working? Because right now this code literally does nothing other than return 'ok
1:01:32
jasom
presumably an and gate would have two wires on its input, and then assert some signal on its output; right now there are no side effects at all.
1:04:40
jasom
paule32: note that there is a function-call there, you've just put some symbols next to each other
1:05:08
jasom
e.g. if you type in: "1 2 3 4" you haven't made a function call, you've just evaluated 4 expressions that do nothing
1:08:21
jasom
right, but this part scheme and common lisp are the same; no parens means no function call
1:08:58
jasom
your wires are also missing actions; without actions you can't define the gate functions yet.
1:15:31
jasom
and is if A & B are logical high, C goes to logical high, otherwise C goes to logical low
5:45:59
iqubic
I thought you were doing the thing where it's always "morning" when you enter an IRC channel and "night" when you leave.
6:30:51
beach
Wow, more offers to help me with the work on SICL. Perhaps I should convert to being a project manager instead of writing the code myself.
6:34:35
beach
I have always explored the design space by writing code, so that would have to change. Or at least, I would have to stick to small code snippets for showing the consequences of some particular design decision.
6:35:45
whoman
hmm makes sense. architecting the garden geometry itself rather than tilling and plotting and weeding
7:59:46
phoe
or, simply use an implementation that allows you to extend CL:SEQUENCE, see http://www.doc.gold.ac.uk/~mas01cr/papers/ilc2007/sequences-20070301.pdf
8:35:27
beach
Let's suppose I have an initial executable containing the image of a minimal Common Lisp system. In particular, it does not contain an evaluator. Now, I can cross compile DEFMETHOD forms so that the result is in a FASL file that can be loaded into that minimal image.
8:35:41
beach
The code for a method has already been processed by MAKE-METHOD-LAMBDA, so the METHOD-FUNCTION of the method already contains definitions of NEXT-METHOD-P and CALL-NEXT-METHOD (we assume the default situation where a method function is called with a list of arguments and a list of next methods).
8:35:50
beach
So, in this minimal image, I must be able to call the applicable methods according to the method combination of the generic function. I can't really call COMPUTE-APPLICABLE-METHODS or COMPUTE-APPLICABLE-METHODS-USING-CLASSES each time I call a generic function, because these are generic functions as well, so I would get into an infinite computation.
8:36:14
beach
But in SICL, I have a call history in every generic function. It contains a list of pairs (S,E) where S is a signature consisting of classes of specialized arguments that have already been seen, and E is something that we can call an "effective method function".
8:36:20
beach
It is not an "effective method" because that term is define in the AMOP to be a form that needs to be converted by the evaluator to a function. Now, after some methods have been loaded from FASL files, I need to be able to take them into account when I call the generic function.
8:36:32
beach
So when the call fails because the call history does not contain an existing pair that will do, I need to compute a new such pair. But I can't do that by calling COMPUTE-EFFECTIVE-METHOD, because the result of such a call would have to be evaluated. So here is my tentative solution that I would like comments on:
8:36:41
beach
In the initial image, when a call to a generic function fails because there is no appropriate pair in the call history, I create a new one as follows: I call COMPUTE-APPLICABLE-METHODS-USING-CLASSES and perhaps also COMPUTE-APPLICABLE-METHODS as usual. Then, instead of calling COMPUTE-EFFECTIVE-METHOD, I call a different SICL-specific function called (say) COMPUTE-EFFECTIVE-METHOD-FUNCTION.
8:36:42
beach
It takes the applicable methods and returns a closure that can be used as the E component of the pair. The CODE for that closure is already in the image, so it is compiled. Therefore, creating the effective method function does not require any evaluator. Does this sound right, or am I missing something?
8:52:08
scymtym
beach: are the individual precompiled method functions compiled with particular lexical function bindings for NEXT-METHOD-P and CALL-NEXT-METHOD that are aware of this scheme?
8:53:30
beach
That method function, by default, takes a list of arguments to the generic function and a list of next methods.
8:53:56
beach
So, the cross compiler has already inserted definitions of NEXT-METHOD-P and CALL-NEXT-METHOD.
8:53:58
scymtym
sure, i was uncertain whether the way in which the list of next methods is passed is compatible between this scheme and the scheme eventually used once the compiler becomes available
8:54:47
beach
But later on, I will specify optimized versions for standard generic functions, so the methods would then have to be compiled again.
8:56:06
beach
Once I have the compiler in the image, I can ditch the first-class global environment that has been used for the initial image, and create a completely new first-class global environment that contains optimized versions of everything.
8:59:32
scymtym
i will have to read more about the bootstrapping procedure to understand why that couldn't be done in the host lisp
9:04:28
dim
the very simple image that depends on possibly nothing from the host? do you want to be able to bootstrap SICL from itself someday? I mean we have quite advanced Open Source standard CL implementations around that you could choose to depend on?
9:06:44
beach
The executable image is supposed to be a complete Common Lisp implementation, so it can't depend on any existing implementation. The host Common Lisp system, used to cross compile code to generate SICL FASLs and to create the initial image can in theory be any conforming Common Lisp implementation that also supports closer-mop.
9:09:45
dim
the simple image you're talking to is its own thing, you cross-compile it but then it runs by itself, without the need of any CL host around, right?
9:10:52
beach
Sorry! It is hard for me to describe something that I have been so familiar with for such a long time.
9:11:45
dim
I though SICL was about offering pieces of CL implemented in CL, following the metamodular idea, so that if e.g. an implementation has loop and other things but not CLOS, it could use SICL implementation of CLOS
9:12:31
dim
didn't understand that you want to produce a full CL image from SICL sources, and now the whole bootstrapping idea makes more sense