libera/#commonlisp - IRC Chatlog
Search
1:03:12
akoana
sorry the 2n stuff is a remnant of previous experiments, here a cleaned up version + results: https://termbin.com/b9a4
1:05:28
akoana
I did the tests with 100000 iterations in emacs before, so I gave up looking at the result :)
1:08:05
akoana
Bike, hayley: Thank you very much - I was about losing my confidence in lisp - you have saved my soul
5:45:24
resttime
I have three functions, add-fixnums, add-floats, add-doubles and their disassembly with optimizations: https://plaster.tymoon.eu/view/3349#3349
5:46:25
resttime
Is there a reason why add-doubles seems use many(?) more lines of assembly than add-floats?
5:47:22
resttime
My thoughts were that a double-float operation would be at least as single-float, only that the instruction used for addition would be different
5:48:28
hayley
This can be avoided when the ADD-... functions are declared INLINE, and when the functions are used in another function. (Though the effect will only be visible when disassembling that other function, and not in disassembly for any ADD-... function.)
5:51:13
White_Flame
and add-floats is longer than add-fixnums because it has to tag the single-float
5:52:53
resttime
Ohhhhh, I'm seeing the unbox/box of doubles because of how SBCL uses pointer tagging instead of NaN boxing
5:56:26
resttime
hayley: If I understood this correctly does that mean the box/unbox is still necessary in this outer function, but only happens at the entrypoint and endpoint of the function once?
5:59:39
White_Flame
you don't see the unboxing, because sbcl hides some of the arg-handling prologue
6:05:07
resttime
Interesting, somewhat related is there an SBCL function for printing the real memory representation of an object? I wanna see how a double is represented in memory
6:13:53
White_Flame
of course, that's just a single (in the upper 32 bits), and will work for immediate values. It doesn't display the heap representation word layout, though
6:38:44
resttime
Hmmm, in the case of a simple-array of double-float's, are these doubles layed out in contiguously in memory boxed or unboxed?
6:46:05
resttime
Oh nice and I see that (upgraded-array-element-type 'bignum) ; => T which makes sense since to me since bignum would be considered more abstraction
9:58:14
aeth
in SBCL, the rule of thumb is to either inline or to box your own floats with double-float arrays (which can be 0D, 1D, 2D, ...) or structs with double-float typed slots, but you have to be careful about implicit return values because those will still cons if they leave function scope
9:58:52
aeth
Not every implementation will do the struct part. Afaik, only CLISP doesn't do (upgraded-array-element-type 'double-float) => double-float
10:00:08
aeth
By implicit return value I mean e.g. (incf (aref your-double-float-array 0)) ; returns a double-float, will still cons if that part is implicitly returned from your function
10:02:10
aeth
You can get around the function boundary issue by returning nothing (i.e. only mutate these double-float data structures), by inlining (only good for small functions like add-doubles), or by coercing to a single-float (you lose precision but maybe you only need it in the intermediate steps and not the final result)
10:02:48
aeth
(Or, you know, tolerating exactly one boxing, for the final result, because it's still much better than having lots of boxing for every operation)
11:49:07
jackdaniel
standardizing networking, threads and metaobject protocol would be nice, but it is not that it would change much - we already have portability layers for these
11:49:28
jackdaniel
as of the rest - do you have anything important in mind that is left out (standard-wise)?
11:56:01
jackdaniel
perhaps it didn't make it there because that would make choices for implementing common lisp more limited
11:57:37
jackdaniel
either way, I wouldn't personally consider this part important enough to mandate the standard revision
11:59:01
drakonis
though something i find worth calling a revision for is to clean up the deprecated functions and have things be a bit more consistent
11:59:39
jackdaniel
would you deliberely break code that works for decades without a hitch? even C standard revisions aim at being backward-compatible
12:00:48
jackdaniel
but you can do that without a new standard- just create a library that leaves the package CL as is and put your own versions in the package CL22
12:02:22
jackdaniel
revising a standard (putting aside the cost; people often brought that argument), takes time and effort, so there should be a tangible reason to do so. if you may resolve some issue by creating a library using the existing standard, then why to propose a new standard?
12:04:33
drakonis
to be fair, i find the notion that having to spend money on revising the existing ansi standard to be silly
12:05:32
drakonis
and i'm working off the assumption that the revision would inevitably bring about some changes to the language internals
12:06:09
drakonis
since it could mandate things that werent part of the original spec like tail call optimizations and lexical scoping
12:06:52
jackdaniel
it is easier to gather a group of people who know what they are doing if you allow them to secure their wellbeing (i.e in a form of a salary), that is orthogonal to dedication; and dedication alone is not a guarantee of quality
12:12:09
drakonis
jackdaniel: sure you can invoke letf everywhere, but you can't define functions inside the scope of another and call them without it
12:14:07
jackdaniel
I thought that we are discussing lexical scoping in common lisp; but still I don't understand what do you mean by cl not having a lexical scope under certain circumstances?
12:15:34
drakonis
if i invoke defun inside another function, it will create the function inside the package's namespace instead of being local to it
12:16:07
_death
anyway, the link I was looking for was https://soundcloud.com/zach-beane/peter-seibel-common-lisp
12:19:55
_death
it's also unclear what deprecated functions drakonis is referring to, and what should be done with them
12:20:44
jackdaniel
I have a strong impression that you know little of you are talking about, so I will detach myself from the discussion
12:26:50
_death
DEFUN defines a function whose name is in the global environment.. neither have anything directly to do with "dynamic scoping"
12:45:20
beach
drakonis: When you say that you find the notion that having to spend money on revising the existing ansi standard to be silly, how would you go about revising it then?
12:46:16
drakonis
i had assumed it had to do with spending money to get it through the ansi approval process as opposed to spending money on people
12:47:43
beach
Oh, I see. You were specifically referring to ANSI. I strongly suspect that ANSI took a very small amount of money, and that the main cost was was for people to travel and eat.
12:48:58
drakonis
the assumption comes from whenever the topic is brought up, someone talks about the money spent on the ansi standard
12:50:12
_death
you need to pay people (or the organizations they represent) to work on it.. standardization involves both users and implementors
12:51:19
beach
And I don't think the standards organization is involved in that process at all. Neither the organization nor the cost.
12:53:38
beach
But perhaps the role of standards organizations is no longer needed, now that we have Digital Object Identifiers.
12:54:03
Bike
"there's no money for that" can also be a proxy for "there's insufficient interest compared to the effort required"
12:55:35
pjb
Perhaps a startup could give an official stamp on "standard" documents. With some quality criteria…
12:58:50
Bike
it's possible i'm just bad at it, but whenever i've set out to write a standardsy proposal for WSCL, it takes me like, half an hour minimum, usually more
12:59:09
Bike
and they've all been extremely minor things like "this description uses the wrong variable names"
13:00:31
jackdaniel
imo some of that could be alleviated with better tools; making a pull request on github is quite a hore