freenode/#lisp - IRC Chatlog
Search
15:56:29
flip214
Bike: ah right, thanks a lot... the (read-client-data) doesn't overwrite but just appends. remind me at ELS, one beer is on me!
15:57:24
francogrex
I will fill it out with ints. I omitted that part: something like (loop for i from 0 below 50000000 do (setf (aref do i) 1)) , but it won't be just 1s...
15:58:46
pjb
francogrex: you may want to add an explicit check: (defun vc-ref (vc vc-index index) )(if (<= (+ 3 (do-index vc-index)) (length do)) (if index (aref vc vc-index) (aref do (+ index (do-index vc-index)))) (error "invalid vc-index"))
16:00:05
pjb
francogrex: well, you just implement the abstraction you need to map the indices as you wish.
16:01:21
|3b|
francogrex: if your ints are bounded, you might be able to save some space with typed arrays
16:05:05
pjb
francogrex: again, the point here is that if you can compute the data, then compute the data. Don't store it.
16:05:44
|3b|
though even typed vectors are a lot of overhead per 3 values, so still probably better to store the values in a single vector and just pass around offsets if possible if you are working close to your heap limits
16:19:50
flip214
Bike: yeah, that's what I did. "netstat" shows 10 open TCP connections (saturating my 10 threads), each with unread data.
16:23:42
attila_lendvai
razzy: don't know what you mean, nothing is wrong with your problem. it's just a good approach generally to first update everything, and then go out looking for a solution, because some others may have resolved your problem already
16:42:30
beach
razzy: So is there anything you need that is not provided by a particular implementation?
16:46:06
flip214
can anybody else reproduce QUUX-HT hangs via high load? (I'm using "wrk" to test latency)
16:53:58
razzy
beach: if asynchronous multiprocessing was implemented in some basic common lisp functions, people would use it without even knowing :]
16:55:03
jackdaniel
razzy: if someone uses asynchronous multiprocessing without knowing what he's doing then something is wrong
16:59:30
jackdaniel
multiprocessing is hard - asynchronous access is a source of many bugs for instance
17:00:30
beach
razzy: Oh, you mean like some implementation using multiprocessing for implementing the sequence functions?
17:00:47
beach
razzy: Sure, an implementation is often free to do that, and perhaps some of them do.
17:01:41
beach
razzy: I have been thinking about multi-threaded implementations of primitives such as SORT, FIND, POSITION, etc.
17:20:18
borei
quick question. if slot has "class" allocation is there an option to get an access to value via class but not via instance of the class, something like "static" members in C++ ?
17:23:28
jackdaniel
afair you need at least one instance of this class, so it is not the same as static member
17:24:51
Shinmera
No, you can get it with the class prototype as long as the inheritance is finalised.
17:27:33
beach
borei: MOP means "Meta-Object Protocol". From the book "The Art of the Meta-Object Protocol".
17:29:42
whoman
hmm. i thought there was a way to define slots that are shared or somesuch. maybe that was eieio
17:34:59
sjl
> The results are undefined if a portable program modifies the binding of any slot of prototype instance.
17:35:16
sjl
Does that mean you can read, but can't write, the :class allocated slot via that prototype instance?
17:38:19
pjb
perhaps. On the other hand, perhaps the class slot is not a slot of the prototype instance?
17:55:14
whoman
stacksmith, i dont know, i will probably just link the package.lisp folder into ~/quicklisp/local-projects and load it that way
17:56:21
stacksmith
I've been using roswel for the last few months. It just works, and pulls in fresh sbcl. I got spoiled - no more fiddling with links and installing SBCL every month...
17:59:55
jackdaniel
hm, my backquote understanding is lacking.. why (given *print-circle* = t) '#1=(1 . #1#) works fine, but `#1=(1 . #1#) blows the stack?
18:01:14
stacksmith
backquote does some spelunking looking for commas, while quote is pretty passive... Although...
18:12:23
stacksmith
That's a better reason. Lgically, consider the intent of each item... Quote means 'do not touch the objects inside' while quasiquoting means 'search inside this list and perform expansions and substitutions. It is a DSL for building lists...
18:13:45
whoman
stacksmith, i dont mind compiling sbcl from source =) binaries seem to be a step behind anyway. btw topic still says 1.4.1 !?
18:14:46
stacksmith
whoman: yeah, the changes are usually subtle month to month. After a few years you get tired of keeping the environment and start looking for shortcuts.
18:17:35
stacksmith
Although there is little in the standard, I believe, and different implementations do it in various ways. SBCL creates private objects for comma and quasiquote...
18:17:46
shrdlu68
It seems to me as if it's first reading #1=(1 . #1#) - that would explain blowing the stack.
18:18:03
whoman
ah years... yes... relating to that. ive got 100+ packages in my debian that needs upgrading but i dont want to do it, because of years. hah
18:19:37
stacksmith
whoman: right. I've learned to enjoy complete screwups of my computers every so often. All this hard to maintain stuff that takes all this time to sort and backup... Then poof - and I don't miss it. Garbage collection.
18:20:01
pjb
Notice also that the commas are to be found inside vectors and structures, not only inside lists.
18:20:28
Bike
you could determine that it's infinite first. it's just annoying to have to do that all the time
18:21:45
stacksmith
whoman: now, I have one folder with all configuration files that once was neat and now is definitely 'legacy', but works. I can move to another machine in minutes. Similarly, my cell phone has 3 apps that I never use anyway. Just disposable stuff.
18:21:45
whoman
stacksmith, heh hmm yeah =) i suppose that is why people use guix or nginx or whatever those things are called, like docker images but a system config; not sure the terminology there
18:22:11
shrdlu68
I didn't think backquote eval'd until it encountered a comma, so - before I saw this, my guess would have been that `#1=(1 . #1#) simply returns #1=(1 . #1#)
18:22:52
whoman
disposable stuff makes life a lot less stressful that is for sure. ive got to clean my room and throw stuff out that i dont even use. but for computer, i reduced/restrict all my usage to emacs, so its just one project folder including my emacs.org and should be easy to move to another setup (even windows, with some changes)
18:23:19
pjb
shrdlu68: the only thing is that it's up to the implementation to choose how to do it. It could be (append '(a b c d) (list e))
18:24:43
pjb
`(x1 x2 x3 ... xn . atom) may be interpreted to mean (append [ x1] [ x2] [ x3] ... [ xn] (quote atom))
18:25:46
pjb
so `(foo) which is `(foo . nil) == (append [foo] (quote nil)) = (append (list `foo) (quote nil)) = (append (list (quote foo)) (quote nil))
18:26:17
jackdaniel
I was trying to bind bt:*default-special-bindings* dynamically in bt:*default-special-bindings* (so my values get "inherited" without setfing this special variable). apparently this can't be done without intermediate variable (what is fine, just didn't think aobut it at first)
18:26:17
stacksmith
whoman: I tried messing with docker, but found it even more annoying... Roswell works really well for my needs... My #1 need is to know _nothing_ about roswell. every so often I do ros update or something like that which I don't even need to remember, and everything works. It pulled in fresh slime, and I think even emacs. I moved my config folder and that's that.
18:26:23
pjb
shrdlu68: `(foo) as specified actually conses twice a list! Of course, implementations will optimize that.
18:32:30
shrdlu68
"`basic is the same as 'basic, that is, (quote basic), for any expression basic that is not a list or a general vector."
18:39:36
pjb
(let ((x (random 2))) `#*111111,x) #| ERROR: Reader error on #<string-input-stream :closed #x30200237ECED>: Comma not inside backquote |#
19:20:34
_rumbler31
I was re-reading the conversation about code walking the other day and I don't understand the factors that make it difficult. There was some mention about how macros mean that you can't somehow just macroexpand your way to a final tree, or something
19:21:43
Bike
It's rather that implementations define their own special operators, or custom behavior for existing special operators.
19:22:58
jackdaniel
(named-lambda exists at least in sbcl and ecl, but I wouldn't be suprised if ccl has one too)
19:25:27
Bike
There's also the matter of implementation defined keywords; lambda-list-keywords exists but doesn't give you any hing how the extras are to be dealt with
19:25:41
stacksmith
_rumbler31: There are times when you want a macro to change something inside the code you are looking at, deep in some expression. Expanding to a final tree is of no help at all, and getting to your desired location is tricky.
19:25:42
jackdaniel
sure, ecl has for that instance ext:with-backend (different code for different compiler backends)
19:27:48
stacksmith
_rumbler31: A simple example of a tree walker is 'flatten'... It is limited, but you can search the list for a symbol, for instance, to see if it's present in your code...
19:28:43
Bike
that one book does that, leading to at least a dozen noobs over the years coming in wondering why it doesn't work on sbcl
19:29:21
stacksmith
Lisp is surprisingly hard to walk, considering the surface impression of 'no syntax'...
19:30:16
dlowe
tonight's homework will be to design a lisp designed specifically for very easy codewalking
19:31:20
stacksmith
You'd think Scheme would be easier, but somehow you can't even have decent macros...
19:35:29
_rumbler31
so codewalking isn't necessarily the same thing as making a call graph forest of a piece of code
19:36:28
White_Flame
and again, if you macroexpand, it can result in internal artifacts that aren't standard and aren't normally exposed
19:36:36
dlowe
(let ((foo (bar)) (baz)) - bar and baz is code, but you'd have to teach your code walker about LET in order to know that.
19:36:37
stacksmith
The code you are interested in when writing macros is very different from the code that will eventually be compiled...
19:37:25
dlowe
which is why "design a lisp (with macros and the like) that can be easily codewalked" isn't a trivial challenge.
19:38:11
jackdaniel
macros are about misleading unexperienced lispers, so they obfuscate their code :-)
19:38:28
stacksmith
dlowe: To be hones, I can't think of a language that is more suited for metaprogramming, even if it's hard to do some things...
19:38:53
dlowe
stacksmith: no, there really isn't. We've bolted a full compiled language onto the front of our compiler.
19:41:05
stacksmith
I mean, there is nothing even remotely close that allows you to build upwards without losing performance or flexibility, or downward without losing all the high-level tools...
19:42:45
_rumbler31
so what kinds of activities require or benefit from codewalking? From cursory reading it seems hard enough to do right that it seems not worthwhile
19:43:32
stacksmith
For some mind-opening reading about macros, I suggest On Lisp followed by Let Over Lambda.
19:43:54
Bike
walking code to see what it calls, so that that information could be provided to an editor
19:44:23
White_Flame
_rumbler31: some embedded languages might do code walking to find special things for replacement
19:44:59
Bike
some lisp implementations use a "code walker" for an extra analysis stage used to deal with method bodies
19:45:00
White_Flame
I did it for a prolog style query language, picking out all symbols starting with "?", creating a binding list of variables
19:45:16
Bike
you can do a few extra things if you know that parameters aren't setf'd, and call-next-method isn't called in certain ways, and suchlike
19:47:38
stacksmith
Or any macro that wants to do something more interesting than just expand stuff right there.
19:48:20
Bike
well, there aren't too many of those, and usually you can use macrolet or such to get similar effects even with advanced ones
19:48:34
_rumbler31
so a given implementation can fully know what a given set of code can do, but because there is enough implementation specific behavior, there is no such thing as a general "call graph" because a walker would have to know what a final implementation would do
19:58:57
pjb
you can still make a call graph, only you cannot label the nodes by the name of the functions, you have to label them by the function themselves.
19:59:47
pjb
(let ((i 0)) (loop repeat 10 for closure = (lambda () (incf i)) collect (funcall closure))) #| --> (1 2 3 4 5 6 7 8 9 10) |# in this code, the call graph calls 10 different closures.
20:01:01
pjb
(declaim (notinline foo)) (let ((i 0)) (loop repeat 10 for fun = (defun foo () (incf i)) collect (foo))) #| --> (1 2 3 4 5 6 7 8 9 10) |# in this code, the call graph calls 10 different functions from (foo)!
20:03:11
pjb
(let ((i 0)) (let ((closure (lambda () (incf i)))) (loop repeat 10 collect (funcall closure)))) #| --> (1 2 3 4 5 6 7 8 9 10) |# ; in this code, the call graph calls 1 (ONE) single closure!
20:04:07
pjb
(let ((i 0)) (flet ((foo () (incf i))) (loop repeat 10 collect (foo)))) #| --> (1 2 3 4 5 6 7 8 9 10) |# just like in this one. In this case, the call graph could have a node named foo. but notice it would be a different foo each time this expression is evaluated!
20:11:35
stacksmith
Right. You can only speak for the image at the point in time you looked at it...
20:19:07
jasom
otwieracz: also the write-lock code looks wrong; usually rwlocks allow one writer or many readers; this appers to allow many writers or many readers
20:23:34
jasom
otwieracz: yeah, I see it now. Were you able to get it to work with condition variables?
20:25:04
jasom
semaphores and condition variables have a large overlap; it's easy to implement one with the other, and they are used for similar things
21:34:45
Shinmera
Implementing that should not be too hard -- crawl through the slime/swank sources and tear out the relevant parts.
21:35:29
Shinmera
And for the interface it would probably just be an eval-in generic function taking a frame and a form.
21:44:44
jasom
I may investigate. Right now my geany plugin runs emacs to drive swank as I found that to be easier than implementing all the parts of slime that are elisp
21:47:09
Shinmera
I also have an inspector written, but that's currently tied to Trial. Should export it to QUI some time. https://www.youtube.com/watch?v=w70XyHBrUDI&list=PLkDl6Irujx9Mh3BWdBmt4JtIrwYgihTWp&index=27&t=0s
21:52:37
Shinmera
Need to make more videos. And more articles. And more libraries. More of everythign!
22:05:33
stacksmith
Is there any reason top-level def forms have a lambda-list like (name lambda-list &body body) instead of something that indicates destructuring, like (name (&rest lambda-list) &body body)? Is there any point in passing a non-list as a lambda-list?
22:08:10
stacksmith
It disambiguates the structure. Otherwise, an entity looking at the first lambda-list and a parameter list may just as well assume it's a function call returning a single value lambda-list.
22:08:19
mepian
is it possible to upgrade ASDF from 2.010 to 3.3.1 with install-asdf.lisp on Clozure 1.6-r14468M?
22:09:27
Bike
(defun (setf foo) ...) is ok, but nothing analyzing code can go "ah, it's a call to the function 'setf'"
22:10:49
Shinmera
stacksmith: What are you going on about? It's a lambda-list. You can't just go ahead and make up rules willy nilly about how you want to read things.
22:11:11
Bike
whereas you can have a macro like (defun foo (form) form), and then in (foo (setf foo)) there is in fact a call to the function 'setf'
22:11:44
Bike
what i'm saying, stacksmith, is that you're attributing more semantics to lambda lists than they actually have
22:13:01
Bike
for another example, you could also give defun the lambda list (name lambda-list &rest body)
22:13:31
Bike
if the semantics could be summed up in the lambda list we wouldn't need the actual macro function
22:16:29
stacksmith
Is there anything semantically different with (name (&rest lambda-list) &body body)?
22:18:50
Shinmera
I object to (&rest lambda-list) for a different reason: a lambda list is a structure in itself. It is not really applicable to what &rest means: an enumeration of items.
22:21:57
mepian
ASDF went from one file (asdf.lisp) in 2.010 to multiple directories of sources, that's quite a growth
22:22:07
Shinmera
I have. My joke is that most clients are so old and well-trodden that a crash is very peculiar.
22:22:36
stacksmith
Bike: I thought &rest can be in an inner destructuring list along with dotted notation...
23:01:34
emaczen
pjb: can you show me map-reduce with #'map #'reduce bt:make-thread and bt:join-thread?
23:21:51
mepian
wow, I somehow completely misunderstood the process of upgrading ASDF - I should have just downloaded the new asdf.lisp and load it instead of mucking around with the tarball
3:19:56
krwq
I've today encountered this: https://github.com/GrammaTech/sel does any of you helped with this? :)
3:21:44
krwq
haven't had time to familiarize with what's possible but overview of the project sounds pretty cool
3:31:45
krwq
can't find it right now over there but either there or in one of the blackhat videos comment
3:43:23
pfdietz
https://www.prnewswire.com/news-releases/grammatech-releases-automated-software-engineering-library-into-open-source-300586264.html