freenode/#lisp - IRC Chatlog
Search
11:47:21
makomo
i figured i can arrange the evaluation of the condition by injecting it into the temps/exprs values returned by the setf expander
11:49:03
makomo
one thing i'm not sure about was a warning from SBCL i got which i can't reproduce now
11:49:38
makomo
it was warning about how "NIL is not a CONS" because it analyzed that WHEN and UNLESS might return NIL
11:50:18
makomo
Bike: yeah :/. i was thinking of somehow merging the temps/exprs as well, but i'm not sure if it's fixable
12:04:34
makomo
Bike: as an expander, yes, but in this case it's used as a macro that expands into code that gets the value of the place
12:05:17
makomo
and i think this conditional place is finally a proper example of a place which you can't treat as a form and ev
12:06:48
makomo
i was thinking of how you can get the value of the place "(car a)" just by evaluating the form "(car a)"
12:07:09
shrdlu68
shka_: I think this is more accurate: https://gist.github.com/shrdlu68/081a78c6196b676395ca518a268d9119
12:07:24
Bike
i figured (iff a b c) would expand into (let* ((#:1 a) (#:2 (when #:1 b)) (#:3 (unless #:1 c))) (if #:1 #:2 #:3)) which is obviously just a more complicated (if a b c)
12:10:59
makomo
Bike: hm, i think i don't even need to rely on READF and the expander of IFF for the IFF macro
12:11:38
Bike
i'm not sure what readf is for, except i guess writing a complicated setf expander with complicated get, and wanting to not duplicate it
12:42:21
makomo
the places are implemented via macrolets that expand into a %READF form, which is either a call to the macro %READF or a %READF place
12:48:07
makomo
both of those just set a flag to trigger a different expansion of the macrolet, and the expansion is initiated by GET-SETF-EXPANSION
12:48:24
makomo
i think that's the trickiest part, the hidden macroexpansion within GET-SETF-EXPANSION
12:55:56
shrdlu68
shka_: I'm not sure how this works, does it show the time taken in a function, taking into account the functions called by that function?
12:56:50
shrdlu68
If function A calls B, do we get the time spent in A outside the function call to B?
13:37:29
flip214
The iterate darcs' tree has been renamed some time ago... see https://www.common-lisp.net/project/iterate/darcs/
13:57:02
phoe
pjb: this is going to be a funny mail - asking https://tlo.mit.edu/ for FOSSing a piece of software written 23 years ago. (:
14:05:52
phoe
I've been refurbishing it since yesterday and got satisfying results; now I'm trying to get an official license on it
14:57:22
beach
I am hoping my favorite coauthor will have time to set up the infrastructure for testing the algorithms this year. Last year, she was on an all-research year, so she was buy doing that.
14:58:10
_death
shka_: https://groups.google.com/forum/message/raw?msg=comp.lang.lisp/EoKU5n0lbJs/DGdyZ-lCuTEJ
15:00:37
_death
further confirmation from 1993 https://groups.google.com/forum/#!search/sxhash/comp.lang.lisp/oBHfPf0mnog/RC9uTGiMz_8J
15:11:43
beach
I did that as part of compiling the text of the book, but I don't think that is the good way of doing it.
15:13:22
beach
The algorithms are written in Common Lisp and translated to my own algorithmic notation.
15:40:44
makomo
Bike: regarding the SETF-EXPANDERLET thing, wouldn't this have to be wrapped with an EVAL-WHEN to be portable? https://github.com/Hexstream/place-utils/blob/master/main.lisp#L9
16:06:24
beach
So let's say that METHOD-COMBINATION is a class. Then presumably STANDARD, AND, PROGN, etc., would be instances of that class, right? But then, method combinations take options, so it would appear that a method combination metaobject is an instance of an instance of a class.
16:08:14
beach
Let's call the last thing a "variant". FIND-METHOD-COMBINATION would check whether the name and the options describe and already existing variant and return it. DEFINE-METHOD-COMBINATION, on the other hand, would define an instance of METHOD-COMBINATION. Does this seem reasonable?
16:10:15
beach
But he does not allow lambda lists in long method combinations, so no "use time" options.
16:10:20
Bike
i think he mentioned it, but find-method-combination makes more sense if it's called compute-method-combination
16:11:22
Bike
is there any reason to have the "same" method combination use in two different generics be the actual same object, besides maybe saving some memory?
16:12:11
beach
There might be. Currently that is how it is done in SBCL according to Didier's paper.
16:14:28
beach
The main question is what kind of animal is the result of DEFINE-METHOD-COMBINATION and what kind of animal is returned by FIND-METHOD-COMBINATION.
16:15:04
beach
And I think DEFINE-METHOD-COMBINATION might make an instance of the class METHOD-COMBINATION.
16:15:44
beach
And, like I said, FIND-METHOD-COMBINATION might create a "variant" which is some kind of instance of the instance that was created by DEFINE-METHOD-COMBINATION.
16:16:12
Bike
The way I think of it is that define-method-combination defines a kind of method combination, but the actual method combination objects have to be computed and have all the argument information. so they are "variants" so to speak.
16:16:46
beach
The other possibility is for DEFINE-METHOD-COMBINATION to create a subclass of METHOD-COMBINATION rather than an instance.
16:17:00
Bike
in ECL and Clasp's implementation, the things like "standard" and "progn" don't really exist as objects, there's mostly just a hash table that stores the expansion function and stuff, and then the actual method combination object is equipped with that when it's created.
16:18:03
beach
Either way, there has to be some kind of dictionary to look things up given the name.
16:19:47
Bike
I think the "general" things are different from the specific "variants"- classes is one way I guess
16:23:18
dim
beach: you're contemplating making every function (operator?) a generic function the same way that any data type is usable as an object?
16:25:17
beach
I am not considering making every Common Lisp function generic, no. I am not sure what it means for any data type to be usable as an object. I can't see how (integer 2 3) would be an object, other than in the trivial sense that it is a list of 3 elements.
16:26:23
dim
my vocabulary on those concepts is lacking, maybe I should consider reading the mop someday…
16:28:17
dim
in math the zero-argument result of the + function would be named the neutral element in the group, right?
16:28:43
Bike
but it's not clear what the group is. fixnums and floats are different groups (i don't think floats actually form a group, but w/e)
16:29:14
dim
so maybe that's the missing piece that would allow for a generic +, where your specification would allow for a “neutral element” to be defined for any data type (integer, defclass instance, etc)?
16:29:17
beach
I am still interested in getting good performance, and I don't know how to do that without inlining and I don't know how to inline generic functions.
16:31:01
beach
dim: I will make things like SYMBOL-NAME and SYMBOL-PACKAGE generic though, simply because it is easier to do that than to make them non-generic in SICL. Plus, the generic function would not do any more work than an ordinary function would do.
16:33:13
makomo
beach: what do you think about Fare's LIL? is it a feasible approach? i think i remember watching part of his 2-3 hour stream about LIL
16:33:48
beach
(defclass symbol () ((%name ... :reader symbol-name) (%package ... :reader symbol-package)) (:metaclass built-in-class))
16:35:26
pjb
The 0-ary CL:+ doesn't prevent to define a generic function SI:+ taking 1 or more arguments, with (defun cl:+ (&rest args) (if (zerop (length args)) 0 (apply (function si:+) args))) and to document it. If enough implementation do that, we could even standardize it!
16:35:38
makomo
beach: not to be rude, but i thought i heard your voice on the stream :-) https://www.youtube.com/watch?v=kV63Mf5Qb2Q
16:36:53
makomo
beach: yeah, i don't think fare's LIL is directly related to what you're talking about currently
16:37:18
stylewarning
dim: nitpick: for associative functions that allow “zero arguments”, you only need monoidal structure, not group structure
16:37:19
makomo
but i wonder whether it's a feasible design given the potential overhead of GFs, etc.
16:38:32
dim
stylewarning: I know nothing of monoids, only was taught groups and some other basic stuff 20+ years ago
16:39:54
shka_
and LIL is worth studying because it is a very sound way to develop certain class of protocols
16:42:41
makomo
btw, it appears the talk lasts about 1h 30m, i don't know why i thought it was longer
16:45:40
makomo
beach: ah, this is the 2h 30m one, but it's about ASDF https://www.youtube.com/watch?v=Qqqbc31ZZ-U
16:45:57
makomo
beach: but i'm not sure anymore whether i heard your voice or not, maybe i confused you for someone else :-)
16:47:10
beach
makomo: If it turns out to be true, I will go seek professional help for my bad memory.
16:47:14
stylewarning
makomo: beach sounds like a professor and someone who thinks about compilers sometimes
16:49:56
makomo
stylewarning: oh, since you mentioned abstract algebra, i want to ask: what do you think is the relation (or is there any) between Lisp and abstract lagebra/category theory/etc., compared to the same thing but with Haskell for example?
16:50:26
makomo
the question is probably vague but maybe you can understand/guess what i'm getting at
16:51:19
stylewarning
makomo: I think there’s no intrinsic relationship, except that Lisp being dynamically typed allows you to get away with implementing broader protocols for algebraic structures
16:52:37
stylewarning
makomo: Haskell type classes are limiting because they force you to choose one implementation that you want to be polymorphic over (in other words, you can only create one Group over Integer as a type class, even though integers have many such group operations)
16:52:38
makomo
stylewarning: do you say that because nobody ever formalized Lisp in those terms or? and would you say that Haskell does have such a relationship?
16:53:25
stylewarning
makomo: I say it because Lisp lets you implement things that arent adhering to a strict static type system
16:54:44
stylewarning
Standard ML lets you get a bit further than Haskell on this front by having “parameterizable signatures” called “functors”
17:01:21
dim
you might have fun reading about Mythril if you're interested into SML family, https://mythryl.org/my-Executive_summary_.html
17:26:06
flip214
when interrupting QL during download of packages, and later on retrying (ql:update-all-dists), it just says "already updated" - and not-yet-downloaded packages are kept in the old version.
18:39:13
phoe
Xach: does quicklisp have any option to invalidate all archives and force-redownload everything?
18:44:22
dim
Xach: is it intentional that the directories in this order read like proper English? ;-)
18:45:12
dim
shka_: it could be protected to only do that when there's no diff known to the downloaded version
19:02:17
jeosol
Some of you are aware of my work on an optimization challenge using CL. I am presenting on Friday in Spain. Some of the complexity of the work is possible with the image-based development in CL and other CLOS features
19:02:58
jeosol
I will meet with other (larger service companies) who will be asking questions about how I did so and so. How have you guys dealt with such questions
19:03:38
jeosol
do you tend to hide your toolkit (e.g., choice of language) -- think Graham mentioned something about this.
19:04:52
jeosol
A company may be interested in the code and may want to get it on or convert to C++.
19:06:01
phoe
converting code from Lisp to C++ is doable, provided that you do all of the heavy lifting and debugging in CL before the translation (;
19:06:03
jeosol
I had one a few weeks ago to code up similar functionality in C/C++, after thinking about it (refreshing OOP in C++) I realized I can't replicated many things from CLOS or the ease, so I backed out.
19:06:57
jeosol
I use a lot of around, :before and :after modifies in the CLOS parts to keep things clean and organized
19:07:20
jeosol
their concern will be I am the only one that knows the code very well, and CL not being common.
19:08:13
phoe
jeosol: one thing I'd do is actually prepare "why I can't easily translate this into C++"
19:09:01
phoe
talk about the interactive debugger, livepatching etc (which aren't required but are extremely nice)
19:09:42
phoe
that's why I said that moving from CL to C++ is doable once you have everything figured out in CL
19:10:20
dim
jeosol: the only reason why CL would not be popular/common is that not enough people are using it, so the only cure is that more people would use it?
19:10:43
phoe
dim: correct, except "it won't be our company that pays people to learn this alien language" mentality
19:11:49
jeosol
but there will be vendors who may be interested in how I was able to organize the code and achieve some of the things I am claiming ...
19:11:58
aeth
AeroNotix: That's not QL-specific. I've had Linux package manager issues if I lose power during an update/upgrade in the past.
19:12:58
jeosol
dim: I guess I would say, to garner interest from the larger companies who may be trying to get into the space and would need a large code base to pick up.
19:13:05
dim
jeosol: without that I can't help you decide how to organize the presentation, if you don't care for yourself just explain why you picked CL and then how it helped, but only as an appendix — always begin with the result, the take away
19:14:13
phoe
jeosol: "well, translating this code to C++ will surely make it worse and you'll lose a lot of the tactics that aren't possible with C++ - why don't you teach your people better languages instead?"
19:14:56
jeosol
dim: I am proposing some new features and how to solve an existing problem, and CL really enabled this. but the initial focus for the presentation is not CL per se. It's domain area specific."
19:16:06
dim
just explain how your solution is better than the other ones, show what “technology lock” you managed to break through
19:16:10
jeosol
I am talking of follow up conversations later, when issues of conversation or sticking with CL (with me running things)
19:18:31
jeosol
The reason I am concerned on how to spin it (continue CL with me, or we convert) is that,
19:19:16
dim
“can we do it in C++ instead?” “I don't think I could have done it in C++, that's why I've done it in CL”
19:19:34
dim
and then when they begin to ask what's so good about CL, then you can begin to answer, slowly
19:20:02
jeosol
as phoe mentioned above, interactive enabled rapid feedback. it's a big plus in my development. Some of the load times (without saving image) is around 10 minutes to re/load the problem.
19:20:30
dim
jeosol: search for the change curve and https://en.wikipedia.org/wiki/Kübler-Ross_model applied to politics/management/change
19:21:39
jeosol
dim: thanks. I would like to lead an internal effort to use CL somewhat, but be able to have that discussion in the beginning and explain why CL was better.
19:23:03
jeosol
dim: that's a useful link. I will study it as I start locking horns with these guys.
19:23:05
dim
jeosol: before you can lead that effort, people in power must have understood why CL is good for them, and you have two options: drive the change, or make them drive the change by allowing them to pretend it's their own idea
19:23:44
jeosol
dim: thanks, I would like to drive that change, like lead the effort, and find CL developers, or teach or sth.
19:24:35
dim
they need to accept the change then, and there's nothing much technical or CL specific in that approach, I believe
19:24:55
jeosol
I feel it is easier to continue in CL, code is cleaner, and after questions here and at comp.lang.lisp, I was able to get it to run for weeks with no issues.
19:25:07
dim
I know beach has some very good content to help approach choosing a programming language and CL in particular, though, and that might help you there
19:25:34
jeosol
dim: yes, that is example of materials I am trying to gather to make very solid arguments
19:25:40
dim
I believe it only helps when they have reached a certain point in the acceptance curve though, before that all you can say is “yes it's Common Lisp”
19:26:49
dim
early they want to show why change is not necessary, and remember to spot the steps denial/anger/bargain, only make your move after that
19:29:20
jeosol
dim: thanks. The kubler-ross model thingy will be useful. I anticipate a lot of why CL and not some other language, e.g., Java,C/C++. Like you said, it is not so much like gathering the benefits of CL but I guess how you sell it.
19:32:41
russellw
I read the NASA one awhile back. In a nutshell, they needed C aboard their spacecraft because when you are programming embedded real-time control software, C always comes into the picture, and then it turned out to be awkward to integrate two completely different programming languages in a tiny spacecraft control computer when there was no room for error
19:33:45
trittweiler
jeosol: Ravenpack.com is based in Marbella, Spain, and uses Common Lisp. May be interesting to you, for the upcoming presentation and perhaps personally in case you can consider relocation :)
19:34:14
russellw
Then they made an excuse about lisp being too slow, so someone spent a couple of years making it run faster, but it was a waste of time because this was not the real reason in the first place. Moral of that story: be careful of the difference between reasons and excuses. In programming, 'too slow' is more often an excuse than a reason
19:35:31
jeosol
trittweiler: Thanks for that. I will be in Barcelona, not sure how close. But I will try to reach out if they still/use CL heavily.
19:36:10
dim
they presented their use at the ELS 2018 (conference in Marbella) and I think they are still heavy users of CL yes
19:36:25
jeosol
dim: hmm, interesting about google flights, if they are still using the ITA software in CL
19:36:39
aeth
jeosol: Here's how you say it imo: There's the right tool for every job to get the problem solved in the simplest way. These days, that means being multilingual.
19:36:57
dim
https://www.ravenpack.com/careers/common-lisp-developer ; https://www.ravenpack.com/careers/junior-common-lisp-developer
19:38:01
jeosol
for some of the ML/AI related tasks, I am making calls to python libraries from CL. Didn't have much success with the clml lib but will go back to it later.
19:38:27
jeosol
I think for the overall layering and organization, debugging, interactive development, CL helped a lot.
19:39:01
jeosol
a former colleague saw my screen and wondered why I was working with parentheses all the screen. It was jarring for him.
19:39:55
jeosol
all: I appreciate the feedback you guys have given. very useful with the links also.
19:39:58
trittweiler
Maybe you want to use a reader-macro that turns #\( to #\< and #\) to #\>, so it will look like xml
19:40:14
dim
parens... it took me about one week before I didn't take, and a couple months before every other programming language would look weird to my eyes
19:40:53
dim
in C/Java parens translate to (){}[]; and then you realise that mostly lisp code uses less parens than C/Java
19:49:44
pjb
oystewh: the only operator that can create closures is cl:function. In ((lambda () (+ 10 10))), no cl:function occurs, therefore no closure.
19:50:50
pjb
oystewh: notice that in make-func, lambda is a macro that expands to (cl:function (cl:lambda () (+ x 10))) ; so it returns a closure.
19:52:21
pjb
(let ((x 24)) ((lambda (y) (+ x y)) 18)) may look like a closure, but it's actually equivalent to (let ((x 24)) (let ((y 18)) (+ x y))).
19:54:43
pjb
granted, an implementation could also compile (let ((x 24)) ((lambda (y) (+ x y)) 18)) as: (let ((x 24)) (funcall (lambda (y) (+ x y)) 18)) and here a closure would be created. But it would be anti-optimizing. (pessimising).
19:55:52
Bike
oystewh: it's a syntax thing. Function calls can be either (function-name ...) or ((lambda ...) ...). You can't compute the function like in scheme.
19:58:35
Bike
if you want to call a function you compute you just use the funcall function like i indicated.
21:26:43
AeroNotix
I know it's quite a trivial thing to parse but wanted to know if something was already out there.
22:07:48
AeroNotix
I'm not too bothered about which syntax(es) they parse I'm just interested in looking what techniques/libraries they use
22:08:16
AeroNotix
in my case I want to parse z80 assembly or rather a subset of it since I find there are quite a few "dialects" out there
22:48:19
makomo
AeroNotix: you might be interested in https://github.com/whily/yalo/blob/master/doc/AssemblyX64.md as well, but it's not directly related to z80