12:25 | <Jack Works> | does anyone know if there is a list of exotic objects in ECMAScript and Web APIs? 👀 |
14:53 | <jschoi> | If anyone is familiar with Haskell, Scheme (R6RS or R5RS/R7RS), Common Lisp, or the GNU Multiple Precision Arithmetic Library, then I’d love if they would glance at https://github.com/js-choi/proposal-popcount/blob/main/README.md#description and double-check that the behavior column is correct for that language/library. |
16:38 | <TabAtkins> | jschoi: My CL impl (SBCL) is not using 2s complement. I'm not sure what it's using, since (logcount -1) returns 0 |
16:41 | <TabAtkins> | ohhhhhh if the input is negative it counts the 0 bits |
16:41 | <TabAtkins> | okay then with that weird wrinkle, confirmed the Common Lisp entry |
17:01 | <jschoi> | Thanks for looking! And, yeah, I need to note that it’s counting the zero bits of the 8-bit two’s complement and rolling over beyond 8 bits. At least…I think that’s what’s going on. (logcount 255) and (logcount -256) are 8, and (logcount 256) and (logcount -257) are 1, according to whatever implementation https://www.tutorialspoint.com/execute_lisp_online.php is using. |
17:09 | <jschoi> | That behavior is actually pretty similar to what Scheme (R7RS)’s SRFI 151 does (https://srfi.schemers.org/srfi-151/srfi-151.html), except SRFI 151 does it with arbitrary integer sizes. I’ve been meaning to try out Chicken Scheme for years but never have found the time… |
17:18 | <TabAtkins> | Oh, I'm not seeing it be 8-bit, actually |
17:18 | <TabAtkins> | It's not specified to be so in the clhs |
17:18 | <TabAtkins> | and if it's not bit-constrained, then getting 8 and 1 for 255 and 256 is correct and expected |
17:19 | <TabAtkins> | (CL is supposed to be arbitrary-precision, with fixnums transparently upgraded to bignums when you get large enough) |
17:24 | <TabAtkins> | yeah note (logcount (1- (expt 2 100))) return 100, it's definitely not 8-bit |
17:25 | <jschoi> | and if it's not bit-constrained, then getting 8 and 1 for 255 and 256 is correct and expected |
17:25 | <jschoi> | Thanks, that’s definitely an error. |
17:25 | <jschoi> | So it’s basically the same as SRFI 151. |
17:27 | <TabAtkins> | Yeah looks identical save for the name |
18:00 | <ljharb> | there are very few 262 objects that are not exotic |
18:00 | <ljharb> | i think the same may be true on the web |
19:08 | <ptomato> | bakkot: have you ever run into casing weirdness with the emu-import element name in https://github.com/tc39/ecmarkup/blob/main/src/Spec.ts#L1934? |
19:09 | <bakkot> | yes |
19:09 | <bakkot> | sorry |
19:09 | <bakkot> | it's a bug in a transitive dependency |
19:09 | <bakkot> | I will pin that and publish a new version |
19:09 | <ptomato> | ah, I was wondering if it was something like that |
19:09 | <ptomato> | thanks |
19:09 | <bakkot> | you're the third person to run into it |
19:09 | <bakkot> | https://github.com/tc39/ecmarkup/pull/471 |
19:09 | <bakkot> | https://github.com/dperini/nwsapi/issues/57 |
19:10 | <bakkot> | you can just pin nwsapi at 2.2.0 if you don't want to wait for the ecmarkup job to finish |