Search
Wednesday, 28th of October 2020, 20:53:16 UTC
20:53:16
SAL9000
...right, you still don't win unless you have two (identical) copies of the body of the caller, under an etypecase
20:53:16
Shinmera
you'd have to create separate functions that know their inputs
20:53:18
SAL9000
which can be done, but ew
20:53:29
Shinmera
this is where hot path analysis would help.
20:53:40
SAL9000
that or a macro emitting LABELS?
20:53:58
Shinmera
you can do it but not without duplicating emitted code.
20:54:15
SAL9000
you'd want these trivial functions to inline, anyways
20:54:19
Shinmera
having some magic that eliminates further dispatchers once it knows the type would be nice.
20:54:32
Shinmera
no idea how it'd work though :)
20:54:45
SAL9000
compiler-macro might work, although I don't know nearly enough about those
20:54:59
SAL9000
I've only played around a bit with the elisp ones
20:55:05
Shinmera
again, it only knows the solution at runtime.
20:55:10
Shinmera
no macro will help you with this.
20:55:16
SAL9000
I meant if the caller specifies (the x type) or whatever
20:55:42
Shinmera
ah. compiler macros don't have that info most of the time.
20:55:58
Shinmera
you'd want to look at deftransform in sbcl
20:56:20
SAL9000
I should stop here tbh before my RSI recovery backslides :<
20:56:27
Shinmera
but usually emitting typecase is "good enough" and while slow at compiling, SBCL should eliminate the branching if it knows the variable type.
20:56:42
Shinmera
ah, fair, get some rest!
20:57:02
SAL9000
yeah. so many ideas but not allowed to try them... :(
Thursday, 29th of October 2020, 8:53:16 UTC