freenode/#lisp - IRC Chatlog
Search
23:29:35
jasom
wow sbcl's call-arguments-limit appears to be most-positive-fixnum. I don't think I'm going to exceed that any time soon
23:32:23
sjl
(defun function-with-one-hundred-thousand-arguments #.(loop :repeat 100000 :collect (gensym)) nil)
23:32:23
Colleen
sjl: PuercoPop said 22 hours, 5 minutes ago: Have you tried the command refresh-heads when StumpWM does recognize the new heads? https://stumpwm.github.io/git/stumpwm-git_9.html#External-Monitors
23:32:35
whartung
how big of a 2 element, N D array can you make before your computer ejects your swap partion through the case.
23:37:15
|3b|
hmm... for i of-type (unsigned-byte ,',(- (integer-length most-positive-fixnum) (integ\
23:46:10
aeth
I think you'll run into 64 bit RAM size limitations before you run into 63 bit fixnum limitations in most cases
23:46:42
aeth
you might be able to construct something with bit arrays... of course, then you do need more RAM than you normally get
23:49:09
aeth
|3b|: The official raspberry pi OS? I'd think you'd be able to just install the ARM64 fedora/etc. distros on it, idk
23:50:06
|3b|
ACTION tried a few other options and failed to get a good setup, will probably try some of the other options at some point
23:51:55
aeth
but practical minimums really require 32-bit or 64-bit, and 64-bit is a lot more convenient (e.g. unboxed single-float)
23:58:40
aeth
jasom: In SBCL double-float and (unsigned-byte 64) and (signed-byte 64) all heap allocate unless they're used in restrictive ways (within a function, saved to typed struct slots or specialized arrays)
23:59:51
aeth
In 32-bit ([un]signed-byte 64) are bignums in SBCL and their specialized arrays aren't there (just T arrays)
0:00:38
aeth
jasom: single-float's used a lot in graphics. Plus, you can work with double-floats and have single-float as the end result.
0:00:39
jasom
you would need to vary your range by 2**39 to ever have more precision with single-float vs unsigned-byte 64
0:01:54
aeth
jasom: single-floats are faster when you don't really care about the end result that much (e.g. gaming), and even faster since you'd have to use a third party library for fixed-point arithmetic
0:02:52
aeth
jasom: afaik in practice single-floats are just double-floats whose end results are stored as single-floats in CL implementations
0:03:44
aeth
jasom: But even then in CL you'd have to wrap it in (mod ... (expt 2 64)) after every operation to get it to be fast
0:05:06
aeth
generally this sort of thing is run with https://github.com/Shinmera/float-features/blob/91739d64c2d5c99f6add31be7367a9416a98891f/float-features.lisp#L143-L194
0:05:39
aeth
okay, it's actually generally just run with sb-int:with-float-traps-masked and a slow path for every other implementation, but that's the author's fault for not using the library Shinmera wrote for that
0:06:39
jasom
I do very few calculations where the required precision is relative to the magnitude of the value, so *shrug*
0:06:49
aeth
jasom: mask float traps when you are running your application, but keep the defaults when you run your unit tests
0:08:19
jasom
My motto is "fixnums can represent the entire solar system to a precision of under 1mm"
0:11:16
jasom
2um using the major axis of neptune: https://www.google.com/search?q=9.09e9km%2F2**62+in+um
0:11:30
aeth
jasom: usually there's some complicated algorithm that works around problems with floating point... and you can just implement the algorithm
0:12:51
aeth
jasom: If you do a solar system with single-floats (you could just go to doubles at that point) then you can divide it into zones
0:14:09
aeth
jasom: anyway, I think floating point is in general faster because CPUs build in hardware for floating point (but you might need special ASM to access it all)
0:14:15
jasom
At a minimum, my point is that integers are much larger than they were when floating-point won over fixed-point, so reevaluating ones choices might be good. Also, outside of certain scientific calculations the assumptions of floating-point may not fit your data
0:14:57
aeth
if you're doing real time use floats, if you're doing supercomputer simulations use floats.
0:15:19
aeth
Anything where you'd be using Fortran before SBCL became an acceptable Fortran, you probably want floats.
0:16:19
aeth
I've written my share of efficient integer arithmetic, too. It's a bit more painful in CL because CL actually wants correct behavior, so you need to establish your bounds or use unsigned and wrap each arithmetic operation with mod of a power of 2
0:18:04
aeth
I'm sure a compiler that enforced float correctness would make floats equally or more painful, of course. With floats you just get runtime nonsense values or a runtime exception (depending on settings), rather than a compile time possible bignum allocation.
0:20:13
aeth
I have established bounds for certain float functions with random testing, but I think that those bounds are probably best left as just documented rather than enforced.
0:26:55
aeth
Anyway, that's just my 2¢. On the other hand, if there's anyone who'd waste months implementing efficient fixed point in CL to be used in a handful of functions, it'd probably be me. :-p
0:30:46
oni-on-ion
"optimization: adding 1 to or subtracting 1 from a fixnum variable does not cons." =)
0:38:58
aeth
Hmm, doesn't appear to give correct results for me. I guess I was reading the manual incorrectly.
2:26:50
ealfonso
Why do I get different results with macro vs macrolet? https://pastebin.com/4nu0qsr9
2:28:24
|3b|
ACTION doesn't remember if there is a better way to get that local environment than with a macro or not
2:29:29
|3b|
macro/macrolet accept &environment lambda-list keyword to let you get access to the environment while expanding the macro
2:54:26
ealfonso
actually I'm still stuck... shouldn't the inner macro (defined via macrolet) be expanded before the defclass macro? https://pastebin.com/1U571DZC
2:56:08
Bike
since that's not even in a normal evaluation context, the my-local-slot-macro form will never be evaluated, so it's just a syntax error.