freenode/#sicl - IRC Chatlog
Search
19:06:19
heisig
Bike: I just had a look at your changes. Let me rephrase your change to make sure I actually understood it.
19:06:51
heisig
We are only considering declarations that are not bound to a particular variable. Things like ftypes, types, special, dynamic-extent etc are already handled by other means.
19:07:49
heisig
The only one of these declarations in the standard is cl:optimize, but implementations might support further declarations.
19:08:31
Bike
I need to get that information from the environment somehow and this is what I came up with
19:11:25
heisig
But the compiler wouldn't be able to detect user-defined lexical declarations. So Trucler doesn't have to worry about that either.
19:12:03
Bike
well, it might want to record them in an environment where they could be used by compiler macros or whatnot
19:13:10
Bike
https://github.com/guicho271828/trivia/blob/master/level2/impl.lisp#L370-L390 for reference, here's a use of them in the wild i found when i was seeing if anyone actually did this
19:15:29
heisig
I think those are good changes. The only thing I wonder is whether we should conflate describe-optimize and describe-declarations.
19:18:12
heisig
The point is that describe-optimize returns an instance of a particular class, while the latter returns the X of some (declare X) just like it appeared in the source code.
19:19:03
Bike
oh, i was thinking of describe-declaration as returning a description object of some kind
19:19:35
Bike
I figure in the spirit of "CLTL2 but modern" it would always do so, and if you want a custom declaration you need to define a description class or something
19:20:40
heisig
Oh, I see. But what information other than the declare form would be stored in that declaration-description?
19:21:36
Bike
I don't know. Whatever the user wants. In this trivia example, I guess it would be the actual optimizer function rather than its name.
19:39:37
heisig
The first case is accessing the current optimize settings. Trucler already has a better way of handling that.
19:40:34
heisig
The second case is that of accessing the set of user-defined declarations that are currently permitted.
19:41:05
heisig
The third case is that of accessing a particular use of one of these user-defined declarations.
19:41:33
heisig
My hunch would be to introduce separate API functions for each of these three cases.
19:43:36
heisig
The first case stays as it is, with the generic function describe-optimize that returns an optimize-description.
19:44:24
heisig
The second case should be handled by a describe-declarations function that returns a declarations-description.
19:45:00
heisig
We could then define some generic functions for querying such a declarations description.
19:48:32
heisig
The third case could be handled by a generic function called describe-declaration, that returns the declaration specifier whose first entry is that symbol, or NIL if no such declaration specifier exists.
19:49:12
heisig
(Please tell me if it doesn't make sense. I am still very tired from chairing ELS and likely to make mistakes)
19:50:59
Bike
the first two cases make sense. The third... I'm not sure, users might want some processing like cltl2 has, but that's probably out of band for trucler
19:58:17
Bike
define-declaration defines a function that th eenvironment is supposed to call when an environment is augmented
20:01:13
heisig
Oh, right, I had missed define-declaration. Give me some time to re-think what I just said.
20:01:41
Bike
sure. i mean, i can work on the first two cases to begin with, anyway, that's what i need to use trucler in cleavir
21:24:45
Bike
::notify heisig i think an actual define-declaration analog would be out of scope for trucler. but trucler could have a function to read implementation-defined info for a user defined declaration, and maybe one to augment
1:57:28
Bike
::notify heisig the other trucler thing i probably need for cleavir to use it is being able to store arbitrary optimize info, like for client dependent qualities... i'll write a PR for that too i guess
5:23:59
no-defun-allowed
I can't remember exactly; are floating point addition and multiplication commutative? I know they are not associative, but I can't recall commutativity.
5:26:31
no-defun-allowed
With the existence of NaN, I understand that e.g. 1 + NaN ≠ NaN + 1, but then that reduces to NaN ≠ NaN, so it's not as if anything changed.
5:27:39
jackdaniel
heisig: I once started writing a test suite for cltl2 env accessors and to my surprise sbcl implementations also had plenty of issues (afair it was mostly related to querying);
5:35:02
beach
This is what I watched this morning for my daily exercise, and I found it interesting: https://www.youtube.com/watch?v=9-IWMbJXoLM because the speaker was essentially telling the participants of a Linux conference that Unix and C are not so great, and that we should strive for better things.
5:38:49
beach
Yeah, though I attended the Australian Linux conference when it was held in Dunedin. :)
5:39:41
no-defun-allowed
Holy crap, that's a lot of files to do...something with USB devices which I forgot.
5:42:50
lukego
I've been meaning to look at LLVM one of these days. I also have no desire to interface with it via C++ but could potentially be interested in using its textual IR representation as a target for something.
5:47:37
no-defun-allowed
Also, is there a problem with defining the binary floating-point instructions to be subclasses of BINARY-OPERATION-MIXIN?
5:48:37
beach
That mixin was meant to encode the restriction of the x86 that the destination and the first operand are the same.
5:49:26
no-defun-allowed
That is also the case for SSE floating point instructions - I thought we agreed that the three-address AVX instructions would be too new.
5:50:45
no-defun-allowed
AVX was 2011, AVX2 was 2013. Now I need to double check if the three-address instructions were AVX or AVX2.
5:57:07
no-defun-allowed
I don't have a machine that doesn't have AVX instructions (though, again, some don't have AVX2), and the Steam hardware survey states that 94.77% of computers surveyed support AVX. So I suppose it should be fine.
5:59:58
beach
Also, remember that we want to do something simple, just to get an executable system soon-ish. We absolutely have to count on others implementing more things, once that first step is done.
6:04:41
no-defun-allowed
Right. However, I've now noticed that we at least have to perform the COMMUTATIVE-MIXIN preprocessing for addition and multiplication, as only the second input can be an immediate* with three-address instructions.
6:05:29
no-defun-allowed
*And by "immediate" I mean that it will have to be encoded as a memory input (whatever "m64" is called) which loads some constant value.
6:06:20
no-defun-allowed
A similar transform to what I wrote for integer multiplication and division would be done for floating-point subtraction and division.
6:55:11
lukego
I'm reading some SICL papers. Really fun! One is so used to reading papers from the 1980s about this stuff in a historical "what they were thinking at the time" context but not current work :)
6:56:42
lukego
I've only had a quick read through the Call-site optimization paper but when it talks about eliminating a memory data load (for accessing the symbol-function) is this at the expense of adding a memory code load (for the heap-allocated snippet object)? and if so might that be a net loss because an OoO CPU can better mitigate data latency than control latency (or can this be predicted in practice?)
6:56:54
beach
What I find "amusing" is how much current Common Lisp implementations are based on technology that is no longer the norm.
6:57:01
lukego
I'm not sure I've understood though, have to take another read. is this implemented btw?
6:57:53
lukego
Sorry maybe it's control latency in bother cases i.e. you are loading the symbol-function in order to branch to it so you can't branch until it's loaded.
6:58:35
lukego
I was thinking in LuaJIT terms where the compiler emits a hard-coded branch to the function definition it expects but guards that with a test-and-branch on the symbol-function (so to speak) to detect when this is invalid.
7:00:00
lukego
though LuaJIT has its own whole bag of tricks so it might not be an awful idea to compare notes a bit anyway.