←2021-02-06 2021-02-07 2021-02-08→ ↑2021 ↑all
00:30:40 -!- tromp has joined.
00:35:05 -!- tromp has quit (Ping timeout: 240 seconds).
00:41:26 -!- oerjan has joined.
01:01:24 -!- rain1 has quit (Quit: WeeChat 3.0).
01:06:01 -!- tromp has joined.
01:10:45 -!- tromp has quit (Ping timeout: 264 seconds).
01:17:08 <oerjan> <Sgeo> I... think it's usually supposed to be Sceolang? <-- argh.
01:17:32 <oerjan> feel free to include something suitably celtic in the entry
01:17:51 -!- hendursaga has joined.
01:19:19 <Sgeo> My knowledge of Celtic anything is limited to the existence of a dog named Sceolang and that Enya has music related to Celtic culture.
01:20:49 <oerjan> i didn't know about the dog but i've been aware of a dog of dogs
01:21:41 <oerjan> wait
01:21:47 <oerjan> i'm confused
01:43:00 -!- tromp has joined.
01:47:05 -!- tromp has quit (Ping timeout: 240 seconds).
01:56:07 <nakilon> 05:00:38 <nakilon> how I think that if I take some existing library ...
01:56:43 -!- tromp has joined.
01:57:03 <nakilon> the only thing I've found is https://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/
01:57:55 <nakilon> and compared to mystem (that is Russian only) it gives to little information that my plan didn't work well
01:58:06 <nakilon> *so little
01:59:07 <nakilon> the automated tagging appeared to be only 45% accurate
02:00:51 -!- tromp has quit (Ping timeout: 246 seconds).
02:17:54 -!- tromp has joined.
02:18:37 -!- tromp has quit (Remote host closed the connection).
02:20:25 -!- zzo38 has quit (Ping timeout: 240 seconds).
02:52:41 -!- tromp has joined.
02:57:27 -!- tromp has quit (Ping timeout: 256 seconds).
03:09:34 -!- oerjan has quit (Quit: leaving).
03:13:02 -!- ubq323 has quit (Quit: WeeChat 2.3).
03:28:46 <esowiki> [[User:Erinius/Ideas]] https://esolangs.org/w/index.php?diff=80592&oldid=80525 * Erinius * (+110)
03:35:31 <esowiki> [[IDK]] M https://esolangs.org/w/index.php?diff=80593&oldid=80584 * GrapeApple * (-35)
03:45:19 <esowiki> [[IDK]] M https://esolangs.org/w/index.php?diff=80594&oldid=80593 * GrapeApple * (+97)
04:00:08 -!- zzo38 has joined.
04:04:15 -!- deltaepsilon23 has joined.
04:04:26 -!- delta23 has quit (Ping timeout: 265 seconds).
04:04:37 -!- deltaepsilon23 has quit (Remote host closed the connection).
04:05:21 -!- delta23 has joined.
04:34:46 <esowiki> [[IDK]] M https://esolangs.org/w/index.php?diff=80595&oldid=80594 * GrapeApple * (+1137)
04:36:25 <esowiki> [[IDK]] M https://esolangs.org/w/index.php?diff=80596&oldid=80595 * GrapeApple * (-15) /* Language */
04:36:48 -!- tromp has joined.
04:38:06 -!- tromp has quit (Remote host closed the connection).
04:41:23 <b_jonas> ais523: if it's C11 mode then try #pragma STDC FP_CONTRACT OFF
04:48:03 <b_jonas> "<ais523> really the problem is that C doesn't have any way to say "excess precision is OK in this small subset of an expression" => it does: enable -fexcess-precision=standard or -std=c11 for standard behavior, then use an assignment or cast to force a value without excess precision. that's documented.
04:49:58 -!- tromp has joined.
04:50:42 <b_jonas> "for example, how do you take the average of two size_t values in C (rounding towards 0)?" => Hacker's Delight suggests (x & y) + ((x ^ y) >> 1)
04:54:27 -!- tromp has quit (Ping timeout: 246 seconds).
04:55:06 <b_jonas> but you're probably right that the hand-written assembly might work better here
05:08:21 -!- delta23 has quit (Read error: Connection reset by peer).
05:08:40 -!- delta23 has joined.
05:33:44 -!- Lord_of_Life has quit (Read error: Connection reset by peer).
05:33:45 -!- sprock has quit (Ping timeout: 240 seconds).
05:35:56 -!- Lord_of_Life has joined.
05:46:24 -!- sprock has joined.
06:17:04 <esowiki> [[IDK]] M https://esolangs.org/w/index.php?diff=80597&oldid=80596 * GrapeApple * (-32) /* Language */
06:19:05 -!- delta23 has quit (Quit: zzzzzzzzzzzzzz).
07:25:01 -!- sprock has quit (Ping timeout: 265 seconds).
07:27:10 -!- tromp has joined.
08:33:33 -!- craigo has quit (Ping timeout: 264 seconds).
09:10:05 -!- hendursa1 has joined.
09:10:59 -!- hendursaga has quit (Ping timeout: 268 seconds).
09:12:57 -!- LKoen has joined.
09:54:05 <esowiki> [[Brainfuck code generation]] https://esolangs.org/w/index.php?diff=80598&oldid=79780 * Maxi * (+453) /* Other */
09:54:22 <esowiki> [[Brainfuck code generation]] https://esolangs.org/w/index.php?diff=80599&oldid=80598 * Maxi * (-586) /* Languages that compile to brainfuck */
09:54:40 <esowiki> [[Brainfuck code generation]] https://esolangs.org/w/index.php?diff=80600&oldid=80599 * Maxi * (+586) /* Other */
10:12:45 -!- imode has quit (Ping timeout: 240 seconds).
10:25:54 -!- rain1 has joined.
10:28:05 -!- spruit11 has quit (Read error: No route to host).
10:29:58 -!- Lord_of_Life_ has joined.
10:31:23 -!- spruit11 has joined.
10:32:57 -!- Lord_of_Life has quit (Ping timeout: 264 seconds).
10:33:01 -!- Lord_of_Life_ has changed nick to Lord_of_Life.
10:49:21 <nakilon> with this p-o-s tagger results are even worse: http://www.cs.cmu.edu/~ark/TweetNLP/
10:50:09 <nakilon> maybe because they use only one char long tags
10:59:12 -!- Sgeo has quit (Read error: Connection reset by peer).
11:08:51 -!- pablo has joined.
11:15:10 -!- pablo has quit (Quit: Leaving).
11:32:38 -!- Hooloovo0 has quit (Ping timeout: 260 seconds).
11:41:36 -!- Hooloovo0 has joined.
11:46:12 -!- Hooloovo0 has quit (Ping timeout: 256 seconds).
12:18:42 -!- Hooloovo0 has joined.
12:31:08 -!- FreeFull has joined.
12:42:23 <esowiki> [[Flame]] N https://esolangs.org/w/index.php?oldid=80601 * CatLooks * (+76) Created page with "'''Flame''' is a programming language created by [[User:CatLooks|CatLooks]]."
13:15:37 -!- tromp has quit (Remote host closed the connection).
13:15:39 <nakilon> results of these one https://code.google.com/archive/p/hunpos/ are close to tree-tagger; this one https://textblob.readthedocs.io/en/dev/index.html worked for me as bad as ARK
13:32:02 <esowiki> [[Horribly Translated BASIC]] N https://esolangs.org/w/index.php?oldid=80602 * Gilbert189 * (+4679) Created page with ":''Note that I have horribly translated this page just for the heck of it. The original text should be available.'' :''Remember, this is just an example. Dictionary, syntax, e..."
13:34:03 <esowiki> [[Talk:Horribly Translated BASIC]] N https://esolangs.org/w/index.php?oldid=80603 * Gilbert189 * (+4830) Created page with "==Original text== :''Note that this is only an example. The keywords, syntax, and any other should not be exactly like this.'' Horribly Translated BASIC is BASIC but horribly..."
13:36:21 <esowiki> [[Horribly Translated BASIC]] https://esolangs.org/w/index.php?diff=80604&oldid=80602 * Gilbert189 * (+33)
13:36:23 -!- tromp has joined.
13:39:27 <esowiki> [[Horribly Translated BASIC]] https://esolangs.org/w/index.php?diff=80605&oldid=80604 * Gilbert189 * (+77)
13:40:22 <esowiki> [[Horribly Translated BASIC]] https://esolangs.org/w/index.php?diff=80606&oldid=80605 * Gilbert189 * (+27)
13:42:23 <esowiki> [[SQ]] M https://esolangs.org/w/index.php?diff=80607&oldid=80276 * PythonshellDebugwindow * (+74) /* Opcodes */ Categories
14:26:21 -!- Arcorann_ has quit (Ping timeout: 264 seconds).
14:34:13 <esowiki> [[User:Gilbert189]] https://esolangs.org/w/index.php?diff=80608&oldid=80514 * Gilbert189 * (+32)
15:12:34 -!- arseniiv_ has joined.
15:48:13 -!- arseniiv has joined.
15:50:00 -!- arseniiv_ has quit (Ping timeout: 246 seconds).
16:46:18 -!- xelxebar has quit (Remote host closed the connection).
16:46:37 -!- xelxebar has joined.
16:59:22 -!- craigo has joined.
16:59:38 -!- ais523 has joined.
17:04:51 <esowiki> [[BSS]] https://esolangs.org/w/index.php?diff=80609&oldid=80395 * CatLooks * (+2335)
17:22:16 <esowiki> [[User:Hakerh400/JavaScript Quiz]] https://esolangs.org/w/index.php?diff=80610&oldid=80146 * Hakerh400 * (+221)
17:24:23 <esowiki> [[User:Hakerh400/JavaScript Quiz]] https://esolangs.org/w/index.php?diff=80611&oldid=80610 * Hakerh400 * (-36)
17:26:09 <esowiki> [[User:Hakerh400/JavaScript Quiz]] https://esolangs.org/w/index.php?diff=80612&oldid=80611 * Hakerh400 * (-1)
17:30:23 <b_jonas> apparently I can't type "quest". my fingers finish it as "question".
17:35:06 <int-e> typing of questionable quality
17:35:32 <b_jonas> yeah
17:53:50 <fizzie> A quest for an ion.
18:11:30 -!- tromp has quit (Remote host closed the connection).
18:14:02 <shachaf> What are some interesting Las Vegas algorithms that aren't SAT or that kind of search problem?
18:14:29 <shachaf> There are a lot of randomized algorithms, like randomized quicksort or something, but those finish quickly with such high probability that they barely count.
18:31:36 -!- tromp has joined.
18:32:33 -!- NotApplicable has joined.
18:36:15 -!- tromp has quit (Ping timeout: 246 seconds).
18:43:11 <fizzie> Is "hammersmith" the kind of smith that makes hammers, or the kind of smith that uses hammers to make other things (possibly also including hammers)?
18:43:29 <NotApplicable> yes
18:44:09 <fizzie> It seems to be a maker of hammers, if wiktionary is to be believed.
18:48:15 -!- LKoen has quit (Remote host closed the connection).
18:49:33 <int-e> two more islands, one more friend...
18:58:16 -!- FreeFull has quit.
19:14:25 -!- Lord_of_Life has quit (Ping timeout: 240 seconds).
19:18:40 -!- tromp has joined.
19:22:48 -!- tromp has quit (Ping timeout: 246 seconds).
19:22:57 -!- Lord_of_Life has joined.
19:49:41 -!- NotApplicable has quit (Quit: Connection closed).
19:51:45 -!- tromp has joined.
20:01:38 <ais523> <b_jonas> ais523: if it's C11 mode then try #pragma STDC FP_CONTRACT OFF ← I did, it didn't help
20:01:38 <nakilon> hammersmith sounds like WW2 time German aircraft
20:02:07 <ais523> actually I think I forgot to use -std=c99 / -std=c11 in addition to the pragma, although that's unlikely to matter
20:02:22 <ais523> I tried -fexcess-precision=standard as well, that didn't help either
20:03:55 <ais523> your (x & y) + ((x ^ y) >> 1) suggestion is clever, slightly fewer operations than (x / 2) + (y / 2) + (x & y & 1), although neither is obviously equivalent to ((int65_t)x + (int65_t)y) / 2
20:04:10 <ais523> and at least to me, it's a lot less obvious what it's doing
20:04:38 <ais523> (it works by doing the two half-additions that make up a full-addition separately)
20:07:53 <ais523> it looks clearly better than clang -O3's compilation of the __builtin_uaddll_overflow version
20:08:19 <esowiki> [[NyaScript]] https://esolangs.org/w/index.php?diff=80613&oldid=80459 * ThatCookie * (+938) Added NyaScript++
20:08:25 <ais523> not clear on whether it's better than gcc's branchy version, it probably depends on how predictable the branch is
20:08:59 <esowiki> [[NyaScript]] M https://esolangs.org/w/index.php?diff=80614&oldid=80613 * ThatCookie * (+1)
20:09:20 <ais523> really, I think in terms of compiler branch hints, a hint that a branch is predictable/unpredictable would be more useful than a hint that a branch is likely/unlikely…
20:12:17 <ais523> predictable branches are very cheap, but unpredictable branches are very costly
20:12:47 <ais523> (assuming that all the code being run is in L1 cache already, which it normally will be for anything performance-sensitive)
20:14:38 <kmc> what would the CPU do with such a hint?
20:15:17 <ais523> not the CPU, the compiler
20:15:32 <ais523> there's often a complex way to avoid generating a branch instruction, by computing all possible branches in parallel
20:15:45 <ais523> this is normally slower if the branch instruction would be fast, but faster if the branch instruction would be slo
20:15:47 <ais523> * slow
20:16:10 -!- tromp has quit (Remote host closed the connection).
20:20:43 <ais523> e.g. modern compilers targeting x86-64 will compile (x >= 0 ? x : -x) (with x an int) to the equivalent of ({long _Temp = (long)x >> 32; (x ^ _Temp) - _Temp})
20:22:28 <myname> isn't there an abs asm command?
20:22:42 <ais523> not as far as I know
20:22:50 <myname> huh
20:23:06 <ais523> there isn't even a floating-point negate, most compilers use an xor to flip the sign bit
20:24:14 <ais523> (I have a suspicion that subtraction from zero may be more efficient, though, although the answer isn't quite the same due how floating point works)
20:24:25 <fizzie> `fabs`, on the other hand, was a thing back when floats were done by x87.
20:24:27 <HackEso> fabs`,? No such file or directory
20:24:41 <fizzie> HackEso: I wasn't talking to you.
20:24:41 <ais523> ah yes, I'm only checking the sse/avx FPU
20:24:58 <ais523> x87 has its own set of commands that are different
20:26:46 <fizzie> Looks like x87 negate was the rather unexpectedly named "FCHS", for "change sign".
20:27:40 <esowiki> [[English]] M https://esolangs.org/w/index.php?diff=80615&oldid=77788 * ThisIsTheFoxe * (+16) added link (awesome lang btw)
20:28:37 -!- hakatashi1 has quit (Remote host closed the connection).
20:28:53 -!- hakatashi has joined.
20:29:37 <ais523> huh, the treatement of negative zero seems to be consistent across languages, so maybe subtraction from 0 isn't a *valid* way to negate a floating point number
20:29:59 <ais523> in particular, 0-0 is positive zero
20:30:12 <ais523> -0-0 is negative zero, and -0+0 is positive zero
20:32:36 -!- imode has joined.
20:33:30 <ais523> oh, I didn't try 0+-0, that's also positive zero
20:36:51 <nakilon> in ruby it depends on if the zero is integer or float
20:37:21 <ais523> twos-complement integers don't have a separate +0 and -0 so you will always just get (the only available) zero
20:37:48 <nakilon> https://dpaste.org/P1w4/slim
20:37:56 <ais523> but floats are represented as sign-magnitude on almost all commonly used processors, so +0 and -0 have separate representations
20:40:17 <nakilon> seems like in RASEL they are always positive
20:41:37 <fizzie> I've been keeping track of the C23 process every now and then, and the current draft drops support for non-two's-complement integers. And no longer allows a trap representation for two's-complement either, unless there's padding bits. So a signed char will finally have exactly as many unique values as unsigned char.
20:43:55 <nakilon> wait, didn't they both had 256? _OO
20:44:05 <nakilon> *have
20:47:21 <fizzie> Up until now, unsigned char has had two to the power of CHAR_BIT unique values (where CHAR_BIT is 8 or greater), but signed char may have had one less. For ones' complement and sign-and-magnitude, because of the redundant "negative" zero. And for all three allowed representations, even without padding bits, there's one special bit pattern that's allowed to be a trap representation. (Come to think of it,
20:47:27 <fizzie> maybe that was ruled out for character types, though.)
20:52:29 -!- tromp has joined.
20:59:32 -!- hendursa1 has quit (Ping timeout: 268 seconds).
20:59:45 -!- tromp has quit (Ping timeout: 246 seconds).
20:59:57 <ais523> "0 with sign bit flipped" makes for a decent trap representation in practice, but most systems don't want one
21:02:07 -!- NotApplicable has joined.
21:02:12 <nakilon> I'm sorry I still don't get it, unsigned were 0..255, signed were -128..+127 -- isn't it the same number 256 of uniq values?
21:03:14 -!- hendursa1 has joined.
21:03:22 <fizzie> It would if those were the guaranteed ranges, but signed is allowed to be just -127 .. 127.
21:03:36 <nakilon> woah
21:08:41 <NotApplicable> fizzie: (I just joined so I don't have much context) From my experience its -128 ... +127. Perhaps there's a +0 and a -0?
21:10:08 <fizzie> That's more or less what we were talking about, yes.
21:10:26 <fizzie> C11 6.2.6.2p2: "If the sign bit is one, the value shall be modified in one of the following ways: [explains sign and magnitude, two's complement, ones' complemet]. Which of these applies is implementation-defined, as is whether the value with sign bit 1 and all value bits zero (for the first two), or with sign bit and all value bits 1 (for ones' complement), is a trap representation or a normal value. In
21:10:32 <fizzie> the case of sign and magnitude and ones' complement, if this representation is a normal value it is called a /negative zero/."
21:11:03 <fizzie> With the larger context being that current C23 draft no longer allows that.
21:11:23 <NotApplicable> Ah, thanks
21:13:38 <nakilon> so what I was taught in uni back in 2004 wasn't really implemented until C23? lol
21:15:05 -!- Sgeo has joined.
21:15:16 -!- rain1 has quit (Ping timeout: 240 seconds).
21:15:36 <fizzie> I don't think there were necessarily too many more people using non-two's-complement integers back in 2004 either, but the standard doesn't follow practice that fast.
21:17:07 -!- tromp has joined.
21:21:16 -!- tromp has quit (Ping timeout: 240 seconds).
21:21:20 <nakilon> god bless hipster languages and bignums
21:23:29 <nakilon> if I knew this before I would not be able to sleep
21:30:25 -!- ubq323 has joined.
21:39:53 -!- tromp has joined.
21:40:57 <int-e> fizzie: every time I see this I wonder whether there really are architectures like this anymore
21:42:07 <int-e> maybe if you implement signed ints as floats
21:43:10 <int-e> but I'm not sure whether that's really allowed... are int and unsigned int required to have the same size?
21:43:40 <fizzie> Yes.
21:44:04 <int-e> that's awkward then
21:44:28 <int-e> for this particular (bad) idea
21:44:42 <fizzie> They're even required to have the value bits of the signed type be exactly the same bits of the object representation as the matching value bits of the corresponding unsigned type.
21:45:23 <fizzie> AFAICT, you could have the sign bit of the signed type not be the same bit as the last remaining value bit of the unsigned type, though.
21:45:32 <fizzie> (You'll need at least one padding bit for that.)
21:45:35 <ais523> fwiw, the all-ones representation doesn't make for a good trap representation in one's complement
21:45:50 <ais523> most calculations will naturally produce it when producing a result of zero
21:46:02 <ais523> so it makes more sense for all-zeros to be the trap representation, and all-ones the representation of 0
21:46:45 <ais523> one's-complement is almost as easy to implement in hardware as two's-complement, incidentally (the only difference is what you do with the carry from the top element)
21:46:46 <fizzie> Right, but it also makes sense (and is required) for all-zeros be a valid representation of 0 for the purposes of zeroed memory and such.
21:47:00 <ais523> but I think two's-complement is preferred because it chains better to numbers that are more than one word wide
21:47:13 <fizzie> (Well, maybe if all your integer types were ones' complement, you'd 1-fill your memory instead, who knows.)
21:47:16 <ais523> fizzie: C doesn't require zero-initialised structures to have zeroed memory, does it?
21:47:26 <int-e> oh right, using 0x80...00 as a trap value in 2s complement would make sense
21:47:58 <fizzie> ais523: No, but it does require zeroed memory to be a valid representation of 0 for integer types.
21:48:10 <ais523> one advantage of 0x80…00 as a trap value is that you can't get an integer overflow on division any more
21:48:35 <ais523> it's quite easy to forget that INT_MIN/-1 will overflow the integer range
21:48:36 <int-e> > abs (minBound :: Int)
21:48:38 <fizzie> It also makes `-x` defined for all valid values of x.
21:48:38 <lambdabot> -9223372036854775808
21:48:49 <int-e> there's also this (related)
21:49:03 <ais523> fizzie: aww (wrt zeroed memory)
21:49:21 <int-e> > abs (minBound :: Int8) -- human readable
21:49:23 <lambdabot> -128
21:49:40 <ais523> I've grown to really hate C, because it attempts to give generic access to a range of processor features, yet it isn't generic enough and is holding back processors from doing things that C can't express or disallows
21:50:00 * int-e somehow doesn't know 2^63 or 2^64 by heart :)
21:50:13 <ais523> I know 4294967296 off by heart (2**32)
21:50:20 <ais523> but not 2**31 or 2**63 or 2**64
21:50:34 <fizzie> (C11 6.2.6.2p4: "For any integer type, the object representation where all the bits are zero shall be a representation of the value zero in that type." It doesn't have to be the "canonical" representation of zero -- that could have some set padding bits, or maybe be the negative one -- but it has to be a non-trap zero.)
21:50:34 <nakilon> Int, Int8... -- there was probably the reason to introduce such type as "byte"
21:50:39 <int-e> 2147...something
21:50:50 <int-e> > 2^31
21:50:52 <lambdabot> 2147483648
21:51:03 <ais523> it's not that hard to divide 2**32 by 2 in your head
21:51:12 <int-e> I'm sure I knew it all at some point :)
21:51:25 <nakilon> you aren't required to remember the 10-base number
21:51:28 <fizzie> I don't know 2**63 or 2**64 by heart, but I immediately assume anything that starts with 9 or 18 and is about the right length is going to be exactly that.
21:51:45 <nakilon> ais523 1**32
21:51:53 <int-e> nakilon: of course not... but it wouldn't hurt
21:51:59 <ais523> 1**32 is just 1, isn't it?
21:52:03 <ais523> or did you mean 1<<32?
21:52:05 <nakilon> tshhhhh
21:52:22 <nakilon> I forgot to add /s to the end
21:52:37 <fizzie> In fact, I don't remember any of the ones past 16777216, and even that probably just because of the 777.
21:53:03 <nakilon> 216 is 6^3
21:53:14 <nakilon> don't tell me now I'll remember this number too
21:53:43 <ais523> 59049 is 3**10
21:53:52 <ais523> that one comes up in Malbolge and TriINTERCAL
21:54:02 <int-e> 86400 seconds in a day, 1440 minutes
21:54:04 <ais523> sort of the 65536 equivalent
21:54:27 <int-e> 45054 = 0xAFFE, no reason ;)
21:54:33 <ais523> (I think esolangers have collectively decided that a word on a trinary virtual machine is a multiple of 10 trits long)
21:54:51 <ais523> 1114111 == 0x10ffff, the maximum codepoint in Unicode
21:55:19 <nakilon> yeah, 86400 is in my "one post in a day"-filtered RSS feed URL
21:55:35 <int-e> nakilon: well you probably know a lot of random and mostly useless numbers like these
21:55:36 <NotApplicable> This is unrelated, but does anybody know why sometimes `(float 1) = (float 1) - (float 2)` results in the actual answer plus/minus 0.00000001 or 0.11111111 or something along those lines, regardless of the value in either of the variables beforehand?
21:55:57 <esowiki> [[Photon (Quintopia)]] https://esolangs.org/w/index.php?diff=80616&oldid=80588 * Quintopia * (+592) /* Computational Class */
21:56:09 <int-e> 86400 though is useful, and a lot of people don't know it...
21:56:09 <ais523> when I was a reserve for the UK olympic maths team, I asked my co-competitors what the largest prime was that they could spell out as digits from memory
21:56:13 <ais523> the most common answer was 65537
21:56:15 <nakilon> int-e my brother was learning Pi
21:56:23 <ais523> and I don't think I have a higher prime memorised either
21:56:28 <int-e> 3.141592...enough :)
21:56:29 <nakilon> I guess he has learned 100 digits
21:56:44 <ais523> some of them could get very deep into pi, though
21:57:00 <int-e> (yes, I didn't even memorize the full calculator value... 10 digits)
21:57:11 <ais523> NotApplicable: I've been looking into floating-point maths a lot, recently
21:57:30 -!- xelxebar has quit (Ping timeout: 268 seconds).
21:57:38 <ais523> the way to think about it is that a floating-point number is stored internally as an integer times 2 to the power of an integer (either of the integers can be negative)
21:57:53 <nakilon> 00:56:28 <int-e> 3.141592...enough :)
21:58:06 <nakilon> you floored it though instead of rounding
21:58:07 <ais523> so for example, 2.25 would be stored as 9*(2**-2)
21:58:16 <nakilon> the next digit is 6
21:58:18 <int-e> > (2^2^5 + 1) `mod` 641
21:58:21 <lambdabot> 0
21:58:46 <int-e> (I somehow remember that 641)
21:58:54 <ais523> however, both these integers have a limited range (the range on the exponent rarely ends up mattering, but the range on the multiplier is very often relevant)
21:58:58 -!- xelxebar has joined.
21:59:00 <fizzie> 3.141592654 (rounded) is I think what my calculator used to have, so I learned that, and 3.141592653589... (floored) as an extension to that.
21:59:02 <nakilon> maybe there can be a computer based not on binary, not on ternary but on prime numbers
21:59:22 <ais523> so if you end up with an integer overflow on the multiplier, the processor compensates by halving, quartering, etc. the multiplier and adjusting the exponent to match
21:59:35 <int-e> nakilon: yes it's floored and that's still good enough :P
21:59:45 <fizzie> nakilon: Is this leading to some sort of a pun about the word "primary"?
22:00:09 <NotApplicable> ais523: OH
22:00:20 <nakilon> oh, my Pi estimation was floored too? (
22:00:33 <ais523> anyway, if you're adding or subtracting floats, the processor basically has to scale the multipliers to make the exponents the same, and when the exponents are very different, normally one of the multipliers ends up overflowing as a consequence and lots of bits get thrown away
22:00:45 <NotApplicable> so if I make the numbers smaller, it wouldn't overflow
22:01:02 <ais523> smaller, ignoring multiples of 2
22:01:21 <NotApplicable> thanks!
22:01:28 <ais523> e.g. 3072 is a very "small" number as a floating point, because it's 3*(2**10) and 3 and 10 are small
22:01:56 * nakilon is glad RASEL does not have float precision errors
22:02:21 <int-e> shachaf: at least I can reasonably estimate the number of islands now... I'll say 590 +/- 3.
22:02:26 <fizzie> The base-2 representation is also why numbers like 0.1 can't be exactly represented as floats.
22:02:44 <ais523> yep, 0.1 isn't an exact integer multiplier of *any* power of 2
22:02:45 * NotApplicable is sad because QB64 apparently does
22:02:59 <ais523> so it will get rounded to a float that can actually be represented
22:03:10 <fizzie> `! c printf("%.80f", 0.1);
22:03:11 <nakilon> fizzie it was probably an old human mistake to adopt 10 base
22:03:12 <HackEso> 0.10000000000000000555111512312578270211815834045410156250000000000000000000000000
22:03:29 <int-e> "mistake"
22:03:53 <ais523> fizzie: now I'm curious what the exponent on that one is
22:04:26 <int-e> binary would've been a mistake
22:04:38 <NotApplicable> I personally really like working in hexadecimal
22:05:13 <esowiki> [[Parse this sic]] M https://esolangs.org/w/index.php?diff=80617&oldid=80586 * Digital Hunter * (-9)
22:06:08 <int-e> decimal really works well enough, except for computers if one isn't careful
22:06:13 <fizzie> 0.1000000000000000055511151231257827021181583404541015625, on the other hand, is exactly 3602879701896397*2^-55.
22:06:26 <ais523> fizzie: thanks for working it out for me
22:06:31 <ais523> I was trying to but wasn't sure of a good approach to use
22:07:17 <int-e> > toRational (10^54 * 0.1)
22:07:18 <lambdabot> 100000000000000020589742799994816764107083808679919616 % 1
22:07:58 -!- rain1 has joined.
22:08:20 <int-e> > toRational (2^54 * 0.1) * 5^54
22:08:23 <lambdabot> 200000000000000011102230246251565404236316680908203125 % 2
22:08:35 <fizzie> I used bc + scale=100 + tested multiplying that number by some reasonable powers of two, starting from 2^50, until I got an integer result (at 2^55).
22:08:42 <nakilon> $ ruby -e 'p 10r**100'
22:08:42 <nakilon> (10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/1)
22:09:04 <int-e> > toRational 0.1 * 10^55 -- err, that was stupid
22:09:05 <nakilon> $ ruby -e 'p (10r**100).to_i'
22:09:05 <nakilon> 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
22:09:06 <lambdabot> 1000000000000000055511151231257827021181583404541015625 % 1
22:09:28 <ais523> > toRational 0.1
22:09:30 <lambdabot> 3602879701896397 % 36028797018963968
22:09:52 <nakilon> $ ruby -e 'p 0.1r'
22:09:52 <nakilon> (1/10)
22:10:12 <int-e> `toRational` is a really terrible function
22:10:15 <HackEso> toRational`? No such file or directory
22:10:17 <nakilon> ah sorry this is correct:
22:10:18 <nakilon> $ ruby -e 'p 0.1.to_r'
22:10:18 <nakilon> (3602879701896397/36028797018963968)
22:10:27 <int-e> HackEso: sorry
22:10:32 <nakilon> *correct analogy
22:11:31 <ais523> huh, this just made me realise a parser ambiguity in Rust (0.1 could either be a single number, or field 1 of the integer 0)
22:11:43 <ais523> at least one of the meanings is never going to be useful, so you can resolve it as the other
22:11:59 <rain1> interesting
22:12:04 <ais523> this doesn't come up in most languages, because "1" is not a valid identifier
22:12:14 <ais523> so you can't use it as a method/property name
22:12:24 <ais523> but Rust uses numeric identifiers for anonymous fields of structures
22:12:46 <int-e> > [False..]
22:12:48 <lambdabot> <hint>:1:9: error: <hint>:1:9: error: parse error on input ‘]’
22:12:51 <int-e> > [False ..]
22:12:53 <lambdabot> [False,True]
22:13:02 <int-e> kinda similar
22:13:32 <ais523> it actually shocks me how many ambiguities there are in programming language syntax in general, especially if you don't have a separate lexing stage
22:13:57 <ais523> lots of languages have constructs that could plausibly mean something else
22:15:05 <int-e> /*/ comment /*/
22:15:30 <rain1> it's nuts
22:15:34 <ais523> ah, /*/, the "toggle comment" construct, beloved of polyglots
22:15:39 <rain1> everything is basically defined by implementation
22:15:49 <fizzie> Go has this thing where, because they dropped the ()s around the controlling expressions of if and friends, expressions that'd want to involve a composite literal, like `if x == T{a,b,c} { ... }`, need to be instead written either `if x == (T{a,b,c}) { ... }` or `if (x == T{a,b,c}) { ... }` to disambiguate the composite literal from the statement's block.
22:16:03 <rain1> hah
22:16:14 <ais523> !c int a = 4; int *b = &a; printf("%d", 8/*b);
22:16:21 <ais523> `! c int a = 4; int *b = &a; printf("%d", 8/*b);
22:16:23 <HackEso> Does not compile.
22:16:29 <ais523> `! c int a = 4; int *b = &a; printf("%d", 8/ *b);
22:16:31 <HackEso> 2
22:16:40 <ais523> I guess this is why we teach people to put spaces in their expressions :-)
22:16:43 <NotApplicable> QB64 has ALOT of ambiguatitiesicantspell
22:16:53 <nakilon> everything in undefined in the first place ..D
22:17:02 <nakilon> especially in JS
22:17:43 <ais523> fizzie: Rust gets away with that by not using {} as a subscripting operator
22:18:00 <ais523> JS is very precisely defined, just the definitions are usually not what you are expecting
22:18:54 <nakilon> well it clearly says everything is undefined
22:18:55 <nakilon> https://i.imgur.com/JYeLWqr.png
22:19:17 <nakilon> "not defined", whatever
22:19:52 <int-e> the browser side (DOM, events) used to be terrible
22:20:26 <ais523> it still is terrible, just more standardised than it used to be
22:20:27 <int-e> the JS language itself is mostly okay
22:20:44 <fizzie> `` echo 'long long long i;' | gcc -x c - # I keep waiting for the day when someone with no sense of humour gets rid of this specific error message
22:20:45 <HackEso> ​<stdin>:1:11: error: ‘long long long’ is too long for GCC
22:20:51 <int-e> ais523: yeah good point
22:20:56 -!- tromp has quit (Remote host closed the connection).
22:21:03 <ais523> int-e: JS was created by someone who clearly knew what they were doing, but in a timescale too short to do a proper job of it
22:21:25 <ais523> so it has all sorts of shortcuts-to-get-the-implementation-done-faster, like function scope rather than lexical scope
22:21:48 * nakilon sees "jshell" command available in his bash and wonder if it's J SHELL or JS HELL
22:21:49 <myname> modern js is pretty nice if you compare it with pre-ES6
22:23:22 <ais523> this reminds me, a while ago I improved JSFuck down to just a 5-character character set using ES6 features (but losing IO-completeness, although I retained Turing-completeness), but apparently now there are newer JS features that give you IO-completeness (and even DOM-completeness) with just a 5 character character set
22:23:45 <myname> :O
22:23:59 <myname> what new features made it possible to remove chars from jsfuck?
22:24:18 <ais523> template strings let you call functions with `` as long as you give them a hardcoded string literal as argument
22:24:34 <ais523> which saves characters because `` is one character twice, as opposed to () which is two different characters
22:24:56 <myname> i see
22:25:23 <ais523> the new new feature is the |> pipeline operator, which *also* lets you call functions
22:25:40 <myname> oh i'm not aware of |>
22:25:43 <myname> what does it do?
22:25:45 <ais523> and saves one char because > is a comparison operator, so you can get at booleans without needing to add =, >, or some similar character
22:25:55 <ais523> x |> f is equivalent to f(x)
22:26:04 <myname> of course
22:26:20 <myname> somebody liked haskell, i guess
22:26:28 <shachaf> Man, they gotta stop adding features to JavaScript.
22:26:45 <myname> nah
22:26:51 <ais523> last time I seriously programmed OCaml I was using two different pipeline operators, I forget what the difference was
22:27:02 <ais523> maybe one of them had a built-in map and the other didn't?
22:27:09 <ais523> IIRC one was a builtin and I implemented the other myself
22:27:54 <shachaf> Or at least the version that's in browsers.
22:28:47 <int-e> |> seems such a silly addition...
22:28:57 <ais523> oh wow: https://caniuse.com/mdn-javascript_operators_pipeline
22:29:09 <ais523> apparently |> isn't implemented by *any* common browser
22:29:22 <ais523> I don't think I've ever seen that when looking up the compatibility of a JavaScript feature
22:29:25 <nakilon> in Ruby the new features are added in the way that on meetings guys come up with ideas or community feedbacks as "what if we implement this?" and Matz either says "yes" or "no" -- and sometimes he's in too good mood to allow implementation of a shit the language didn't need on my opinion
22:29:30 <myname> what about node?
22:30:00 <fizzie> "The experimental pipeline operator |> (currently at stage 1) --" makes me wonder what exactly the stages are.
22:30:07 <nakilon> such things that kind of hide the errors, like "let's return nil here instead of raising the exception" -- the community loves it because it's in the mood of web
22:30:24 <ais523> I don't think caniuse supports Node (or other offline JSes like Rhino)
22:30:25 <int-e> s/silly/useless/
22:30:38 <fizzie> https://github.com/tc39/proposal-pipeline-operator "Warning: The details of the pipeline syntax are currently unsettled. There are two competing proposals under consideration."
22:30:53 <ais523> don't they mean "not settled"? "unsettled" means something else
22:31:36 <fizzie> "Man's greatest asset is the unsettled mind", said an Asimov short story.
22:32:13 <myname> i wonder how you would use multiple arguments in pipeline
22:32:24 <ais523> the proposal gives an example
22:32:40 <ais523> but I don't find it very readable, it basically involves wrapping the pipeline stage in a lambda
22:33:05 <ais523> they suggest combining it with https://github.com/tc39/proposal-partial-application
22:33:07 <shachaf> I don't know why they even work on anything other than making browser programming a usable compiler target.
22:33:08 <ais523> which is, wow
22:33:35 <ais523> it reminds me of Mathematica's #…& operator, but it's actually pretty different
22:34:40 <myname> oh, partial application would be nice
22:35:16 <int-e> ais523: https://www.merriam-webster.com/dictionary/unsettled looks ambiguous
22:35:32 <shachaf> This is only for something in function argument position, and it lambdifies the immediately surrounding function?
22:35:36 <int-e> I'm sure I've seen "unsettled conjecture" before
22:35:53 <int-e> (which is redundant, but never mind that)
22:36:01 -!- craigo has quit (Quit: Leaving).
22:36:06 <fizzie> "Need to write |> _ => for each step in the pipeline." // That looks like one of those horizontal / non-rotated emoticons.
22:36:40 <shachaf> That seems very specific.
22:36:58 <ais523> it's just a lambda inside a pipeline stage
22:37:07 <ais523> _ => is the lambda (with a funky argument name)
22:37:14 <ais523> and |> is the pipeline operator
22:37:36 <shachaf> |> _ =>
22:39:53 <fizzie> The fact that `f(g(?))` is `f(_0 => g(_0))` rather than `_0 => f(g(_0))` makes perfect sense, but I feel like that'd lead to bugs anyway.
22:40:18 <int-e> the competing proposal looks more like a syntactical transformation where foo |> bar is let # = foo [# here unless `foo` uses #] in bar (ML-style non-recursive let)
22:40:21 <fizzie> (Well, maybe it's more likely to not work at all rather than to work wrong.)
22:40:23 <nakilon> fizzie lol at those "Think" magazine rejections: https://en.wikipedia.org/wiki/The_Greatest_Asset
22:40:45 <ais523> fizzie: Mathematica's # … & operator gets round the problem by using an & to mark the function you're partially applying
22:41:06 <shachaf> I guess you're encouraged to write g(?) |> f instead.
22:41:08 <ais523> but, it's too general and is even harder to figure out the scope, because the & is placed at the end of the scope you're lambda'ing over but there's no marker for the start
22:41:34 <ais523> shachaf: no, g(?) |> f is equivalent to f(g(?))
22:41:44 <ais523> i.e. the partially applied function is given as an argument to f
22:42:06 <shachaf> Oh, right, I forgot what the goal was.
22:42:29 -!- tromp has joined.
22:42:29 <shachaf> Wait, hmm.
22:42:36 <ais523> you'd need a Haskell-style compose operator
22:42:39 <ais523> (g . f)(?)
22:42:43 <shachaf> I meant you'd write ... |> g |> f
22:42:45 <ais523> (or just (g . f))
22:42:53 <shachaf> But of course it's all silly in that context anyway.
22:43:11 <ais523> ooh! that's probably the other operator I had, besides |>
22:43:17 <ais523> I must have had both pipeline and compose
22:43:31 <ais523> but an argument-swapped compose
22:43:39 <ais523> or, hmm
22:43:42 <ais523> not swapped
22:49:14 -!- sprock has joined.
22:50:33 -!- NotApplicable has quit (Quit: Leaving).
22:57:28 <shachaf> I was wondering the other day about centralizing handling of all JavaScript events.
22:59:19 <shachaf> So instead of having callbacks that do anything, they'd just add events to a queue, which you'd drain later.
22:59:53 <shachaf> One problem is that if you get multiple events at once, there's no way of knowing, really. You can't ask if there are other events on the queue, as far as I know.
23:00:06 <shachaf> You can process events once per frame or something like that, I suppose.
23:04:29 -!- NotApplicable has joined.
23:09:23 -!- hendursa1 has quit (Remote host closed the connection).
23:11:56 -!- hendursa1 has joined.
23:15:49 <esowiki> [[Photon (Quintopia)]] M https://esolangs.org/w/index.php?diff=80618&oldid=80616 * Hakerh400 * (-9) fix formatting
23:23:45 <zzo38> I think over the time they have added many good features into JavaScript, such as typed arrays, generator functions, arrow functions, big integers, etc. But, some things they didn't add, such as a goto command, and a alternate call stack capability.
23:27:16 -!- tromp has quit (Remote host closed the connection).
23:31:33 -!- tromp has joined.
23:32:55 <zzo38> I don't know what new functions they will add for big integers. They should add 64-bit MOR and MXOR, and also popcount, two log2 functions (one returning a floating number and one returning a integer), Date.bigNow() (in case of future), and functions for reading/writing arbitrary length integers into array buffers.
23:32:55 -!- tromp has quit (Read error: Connection reset by peer).
23:33:03 -!- tromp has joined.
23:36:51 -!- tromp has quit (Read error: Connection reset by peer).
23:37:13 <zzo38> I think those idea about partial application are not so good, I thought of other way too they don't seem very good; best probably using arrow functions in the existing way, since the other ways are not general enough
23:37:17 -!- tromp has joined.
23:42:01 -!- tromp has quit (Ping timeout: 272 seconds).
23:42:36 <NotApplicable> why does tromp keep joining and quitting
23:42:53 <zzo38> I don't know why.
23:44:28 <nakilon> my client folds these messages, like: "10 users have joined, and 1 user has left"
23:44:47 <NotApplicable> What client is that?
23:45:38 <nakilon> https://thelounge.chat/
23:46:17 <nakilon> /ctcp nakilon version
23:46:49 -!- Arcorann_ has joined.
23:47:01 -!- NotApplicable has quit (Remote host closed the connection).
23:47:07 -!- NotApplicable2 has joined.
23:47:23 <nakilon> also I've applied a CSS to make them barely visible'
23:47:55 <nakilon> https://i.imgur.com/58qEz5u.png
23:49:37 -!- NotApplicable2 has changed nick to NotApplicable.
←2021-02-06 2021-02-07 2021-02-08→ ↑2021 ↑all