00:05:28 -!- big_caballito has quit (Quit: leaving). 01:15:11 -!- sprock has quit (Quit: ...). 01:39:29 I'm trying to figure out the tree structure of a purely concatenative language. 01:39:39 and how it evolves over time. 01:40:56 1 2 [add] comppose ! compose ! 3 4 [add] compose ! compose ! ! swap ! ! [add] ! <-- form two quotations, evaluate the first one, swap them, evaluate the second one, then add their results. 01:41:08 every time you see a "!", it should read "apply". 01:46:26 -!- deltaepsilon23 has joined. 01:46:29 -!- deltaepsilon23 has quit (Remote host closed the connection). 01:47:03 -!- oerjan has joined. 01:49:06 -!- delta23 has quit (Ping timeout: 268 seconds). 01:50:05 -!- delta23 has joined. 04:39:26 -!- MDude has quit (Quit: Going offline, see ya! (www.adiirc.com)). 05:58:39 -!- delta23 has quit (Quit: Leaving). 06:18:06 -!- Sgeo has quit (Read error: Connection reset by peer). 06:18:22 -!- Sgeo has joined. 06:18:37 [[NDBall]] https://esolangs.org/w/index.php?diff=82389&oldid=81619 * Aspwil * (+488) 06:31:51 -!- Sgeo has quit (Read error: Connection reset by peer). 06:32:01 -!- Sgeo has joined. 06:56:41 -!- delta23 has joined. 07:09:18 -!- deltaepsilon23 has joined. 07:10:56 -!- delta23 has quit (Ping timeout: 252 seconds). 07:26:34 -!- oerjan has quit (Quit: leaving). 07:52:40 [[Toki pi ilo nanpa]] https://esolangs.org/w/index.php?diff=82390&oldid=82346 * Olus2000 * (+179) Added External resources 07:52:45 -!- imode has quit (Ping timeout: 260 seconds). 08:07:36 [[Toki pi ilo nanpa]] M https://esolangs.org/w/index.php?diff=82391&oldid=82390 * Olus2000 * (+194) /* Expressions and operators */ added `nanpa nasa` for randomness 08:07:38 -!- hendursa1 has joined. 08:09:57 -!- hendursaga has quit (Ping timeout: 240 seconds). 08:31:07 [[NDBall]] https://esolangs.org/w/index.php?diff=82392&oldid=82389 * Aspwil * (+161) /* Language Overview */ 08:38:55 -!- Sgeo has quit (Read error: Connection reset by peer). 08:44:11 -!- LKoen has joined. 09:27:11 -!- deltaepsilon23 has changed nick to delta23. 09:55:57 -!- mra90 has left ("Leaving"). 10:07:13 -!- op_4 has quit (Quit: ZNC 1.7.2+deb3 - https://znc.in). 10:07:31 -!- maximum_yellow has joined. 12:17:33 `` perl -e 'printf "%.1f %.1f %.1f %.1f", 1e-1, "1e-1", 0x1p-1, "0x1p-1"' 12:17:34 0.1 0.1 0.5 0.0 12:20:22 Heh. 12:21:17 More like meh, since I do have a string of the last form. And all I'm finding is "oh you don't have to convert strings to floats in perls because that happens automagically in a scalar context" 12:21:26 Which is not helpful. 12:24:57 `perl-e printf "%.1f", eval "0x1p-1" 12:24:58 0.5 12:25:04 Nothing eval can't solve. ;) 12:25:13 b_jonas: have you run into this perchance? 12:25:48 I really don't want eval... though I guess I could write down a pretty precise regexp for this case. 12:26:52 All I know is hex/oct, but that's just for integers. 12:27:44 https://www.effectiveperlprogramming.com/2015/06/perl-v5-22-adds-hexadecimal-floating-point-literals/ only suggests 'eval' (possibly restricted) as well. Sigh. Oh well, I guess I'll do that then. 12:29:24 `perl-e printf "%.1f", (hex "0x1")*2**"-1" 12:29:25 0.5 12:29:33 I guess you could always split it into that ^ 12:31:03 $_ = eval $_ if /^0x[0-9a-f]*(\.[0-9a-f]*)?p[+-][0-9]+$/; # ouch 12:32:21 [[NDBall]] M https://esolangs.org/w/index.php?diff=82393&oldid=82392 * PythonshellDebugwindow * (+13) /* Language Overview */ Deadlink 12:33:33 `perl-e $_ = "0x1p-1"; $_ = (hex $1)*2**$2 if /^(0x[0-9a-f]*(?:\.[0-9a-f]*)?)p([+-][0-9]+)$/; printf "%.1f", $_; # with the same regex 12:33:35 0.5 12:34:10 hmm true 12:34:59 uhm 12:35:33 oh, hex can do 1a.a1 kind of stuff? 12:36:14 Oh, right, that. 12:36:16 Yeah, no. 12:36:23 Didn't think of that. Awkward. 12:36:50 ah, the example didn't have that. reading is hard :) 12:36:59 I guess you could still do it by applying an offset to the exponent. 12:37:25 yeah no, it's not worth the effort, I'll trust the regexp instead 12:39:24 oh right, there's \d for [0-9] 12:41:54 But I guess in this context I prefer [0-9] (also, \d is different for unicode but that doesn't come up) 12:41:59 `perl-e $_ = "0x1.5p-1"; $_ = (hex $1.$2)*2**($3-4*length $2) if /^(0x[0-9a-f]*)(?:\.([0-9a-f]*))?p([+-][0-9]+)$/; printf $_; # just for completeness 12:42:01 0.65625 12:44:01 [[Sabdt]] M https://esolangs.org/w/index.php?diff=82394&oldid=78268 * PythonshellDebugwindow * (-1) /* Function declaration */ typo 12:45:31 FWIW, I'm sure there's also some lower-level-than-eval function somewhere in B or somewhere that'd do it for you. 12:46:53 -!- delta23 has quit (Quit: Leaving). 12:57:59 `perl-e printf"%g, %g\n", 0x1p-1074, 0x1.8p-1073 12:58:00 4.94066e-324, 0 12:58:17 flaws everywhere 13:01:25 `interp c double x,y; sscanf("0x1p-1074 0x1.8p-1073", "%a %a", &x, &y); fprintf(stdout,"%a %a",x,y); 13:01:26 0x0p+0 0x0.0007fp-1022 13:01:30 this is... worse. 13:03:47 `interp c double x = 0x1p-1074, y = 0x1.8p-1073; printf("%a %a", x, y); 13:03:49 0x0.0000000000001p-1022 0x0.0000000000003p-1022 13:04:10 Floats are hard. :/ 13:05:02 If memory serves, the requirements for strtod (and indirectly scanf) are different than that for floating-point literals. 13:05:59 it's still impressive how messed up the result for 0x1.8p-1073 is. 13:06:47 Hmm, they actually aren't for the special case of hexadecimal constants. 13:07:14 another data point: 0x0p+0 0x0.07ffcp-1022 13:07:15 C11 6.4.4.2p3: "For hexadecimal floating constants when `FLT_RADIX` is a power of 2, the result is correctly rounded." 7.22.1.3p5 "If the subject sequence [of strtod] has the hexadecimal form and `FLT_RADIX` is a power of 2, the value resulting from the conversion is correctly rounded." 13:07:28 I think that means you could report a bug. 13:07:49 (of course, floating point is hard, and denormals are harder) 13:08:28 fizzie: I was trying to show that your code is flawed because 2**($3-4*length $2) can underflow (so 0x1.8p-1073 being 0 is pretty much expected) 13:09:06 -!- arseniiv has joined. 13:10:02 (A /correctly rounded result/ means, 3.9p1, a "representation in the result format that is nearest in value, subject to the current rounding mode, to what the result would be given unlimited range and precision". Subnormal numbers may be a little bit of a grey area, since they're not required to exist, though I think a reasonable reading would mean if they *do* exist, a correctly rounded result must use 13:10:08 them.) 13:10:19 `perl-e printf"%a, %a\n", 0x1p-1074, 0x3p-1074 13:10:20 0x1p-1074, 0x1.8p-1073 13:12:02 I agree the 0x0.0007fp-1022 and especially the 0x0.07ffcp-1022 for 0x1.8p-1073 are pretty amazing. 13:12:10 `perl-e printf"%a, %a\n", 0x1p-1074, 0x1.0p-1074 #another variation on the theme 13:12:11 0x1p-1074, 0x0p+0 13:12:27 So I guess Perl does pretty much what you suggested internally. 13:14:52 Oh wait, it doesn't parse these at all, x and y are not intialized 13:15:53 `interp c double x = 42,y = 42; sscanf("0x1p-1074 0x1.8p-1073", "%a %a", &x, &y); fprintf(stdout,"%a %a",x,y); 13:15:56 0x1.5p+5 0x1.5p+5 13:16:05 okay, that is embarrassing 13:18:11 Oh. 13:19:33 strtod handles those correctly. phew. 13:20:17 `interp c double x = strtod("0x1p-1074",0), y=strtod("0x1.8p-1073",0); fprintf(stdout,"%a %a",x,y); 13:20:20 0x0.0000000000001p-1022 0x0.0000000000003p-1022 13:21:02 That's a relief. But it's also annoying that *scanf don't seem to support this format. 13:21:31 `interp c double x = 42,y = 42; sscanf("0x1p-1074 0x1.8p-1073", "%lf %lf", &x, &y); fprintf(stdout,"%a %a",x,y); 13:21:33 0x0.0000000000001p-1022 0x0.0000000000003p-1022 13:21:43 You forgot the 'l', and turns out %a is alias of %f. 13:21:46 uh 13:21:51 thanks 13:22:23 I guess it's an out-of-range error for a `float`, which is why it didn't assign anything. 13:22:34 And as floats these are 0, so that explains the near-0 results we saw 13:22:35 sigh 13:23:27 Right, the thing that led me astray here is the implicit conversion to double in printf. C can be nasty. 13:24:21 (because of varargs magic) 13:25:16 (And while I do use C quite a bit, I hardly ever parse anything involving floating point numbers.) 13:28:20 -!- Lord_of_Life has quit (Ping timeout: 265 seconds). 13:56:13 -!- Lord_of_Life has joined. 13:58:39 -!- MDude has joined. 14:03:37 -!- dionys has quit (Ping timeout: 265 seconds). 14:16:27 -!- dionys has joined. 15:13:35 -!- xkapastel has joined. 16:05:25 int-e: I think hex float syntax is newer than perl, so they didn't just want to change how a string is converted to a number for compatibility. but I don't know how to parse hex floats in perl, I haven't been doing perl for a while. 16:08:01 b_jonas: Probably, but what's the excuse for not adding a function for the purpose then? (Unless I missed one...) 16:08:07 -!- imode has joined. 16:11:24 int-e: they rarely add new core functions these days. there's probably something in a module. 16:12:21 not that python's treatment of hex float format is much better... 17:41:52 `` python -c 'print (float.hex(0.1), float.fromhex("0x1.1p-1"))' 17:41:53 ​('0x1.999999999999ap-4', 0.53125) 17:42:30 -!- Sgeo has joined. 17:42:31 b_jonas: no literals apparently, but as you can see, they have a function for converting a hex string to a float 17:44:42 which feels more normal to me than having a literal syntax for numbers but not way to parse that same format *shrugs* 17:45:10 I've complained, and I've solved my immediate problem. It's mostly good now, I'll live :) 17:57:42 [[Airline food]] https://esolangs.org/w/index.php?diff=82395&oldid=81929 * Largejamie * (+68) /* Overview */ 17:57:58 [[Airline food]] https://esolangs.org/w/index.php?diff=82396&oldid=82395 * Largejamie * (-2) /* Overview */ 18:01:29 -!- grimler32 has quit (Quit: Leaving). 18:05:58 int-e: the problem is just that 18:06:20 `python3 -cprint("%d %X %g" % (71, 71, 71/2)) 18:06:21 71 47 35.5 18:06:36 but there's no format specification for hex floats, you have to call an extra function to format to a hex float for some reason 18:06:52 `python3 -cprint("%a" % (71/2,)) 18:06:53 35.5 18:07:02 `python3 -cprint("%A" % (71/2,)) 18:07:03 Traceback (most recent call last): \ File "", line 1, in \ ValueError: unsupported format character 'A' (0x41) at index 1 18:07:07 `python3 -cprint("%X" % (71/2,)) 18:07:08 Traceback (most recent call last): \ File "", line 1, in \ TypeError: %X format: an integer is required, not float 18:07:28 I mean %a was already used, but there's no other format letter for this either 18:07:47 -!- Lord_of_Life_ has joined. 18:08:59 -!- Lord_of_Life has quit (Ping timeout: 268 seconds). 18:10:57 -!- Lord_of_Life_ has changed nick to Lord_of_Life. 18:17:10 I thought it was all about f-strings nowadays, and not the % operator. But those don't seem to have a syntax for hex floats either. 18:17:13 https://docs.python.org/3/library/string.html#format-specification-mini-language "The available presentation types for float and Decimal values are: ... eEfFgGn% ..." 18:18:17 They could've easily included a/A *there*, because right now it just throws "ValueError: Unknown format code 'a' for object of type 'float'". 18:19:09 `python3 -cprint(f"{0.4:.2%}") # TIL 18:19:10 40.00% 18:20:53 `python3 -cprint(f"{0.4:.2‰}") 18:20:54 Traceback (most recent call last): \ File "", line 1, in \ ValueError: Unknown format code '\x2030' for object of type 'float' 18:23:41 Let's not get carried away here. 18:23:58 That's the sort of thing you see on our wiki, not in a serious language. 18:24:43 * int-e checks the channel name 18:25:22 I think I tried it in the right place :) 18:27:09 I think you could write a wrapper class to support ‰ though, because AIUI the way it works is, the whole format specification gets passed to the __format__ method, which can interpret it in arbitrary ways. 18:27:46 [[Special:Log/newusers]] create * Angel * New user account 18:27:47 I don't know how to write Python oneliners though. Is it even possible to express arbitrary Python constructs without using a newline? 18:28:26 semicolons should work? good question. 18:28:34 oneliners can take the form of comprehensions. 18:31:59 [[Esolang:Introduce yourself]] https://esolangs.org/w/index.php?diff=82397&oldid=82384 * Angel * (+269) /* Introductions */ 18:32:48 Yeah, I'm just wondering how you'd for example declare a class, and then end that class declaration and do something using it. 18:37:37 don't think that's possible. :\ 18:38:06 kind of why I don't like Python as a language. 18:40:21 -!- hendursa1 has quit (Ping timeout: 240 seconds). 18:58:12 -!- Lord_of_Life has quit (Read error: Connection reset by peer). 19:01:30 -!- Lord_of_Life has joined. 19:06:29 -!- delta23 has joined. 19:07:35 -!- Soni has quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.). 19:08:35 [[--yay]] N https://esolangs.org/w/index.php?oldid=82398 * Angel * (+2317) Created page with "[[--yay]] is a [[Category:stack-based]] esoteric programming programming language created with the goal of creating an esoteric programming language (I know, very impressive,..." 19:08:57 [[Talk:--yay]] N https://esolangs.org/w/index.php?oldid=82399 * Angel * (+0) Created blank page 19:19:40 -!- xkapastel has quit (Quit: Connection closed for inactivity). 19:59:52 -!- Lord_of_Life_ has joined. 20:02:47 -!- Lord_of_Life has quit (Ping timeout: 252 seconds). 20:02:57 -!- Lord_of_Life_ has changed nick to Lord_of_Life. 20:23:59 -!- Soni has joined. 20:29:01 fizzie: I hate all the f-streams and bracket style format languages. 20:37:56 the ability to write oneliners is overrated 20:42:28 I would certainly appreciate it. 20:42:50 Using the Python REPL to define functions is awful. If you make one mistake you have to go back and repeat every other line. 20:43:24 REPLs are overrated too. Write it to a file, load it. 20:43:58 (especially when the REPL cannot save definitions... which I believe is the case for python) 20:44:10 Even when using it as a calculator? 20:44:43 I use ghci as a REPL and still define functions. 20:44:43 I guess I don't use Python as a calculator. 20:45:09 I don't know whether Python's REPL can save definitions, but if it did it automatically I'd disable it. 20:45:16 You may have a point there... I like simple putting one-line definitions in ghci 20:45:18 I disable history in almost all REPLs, and also less search history, etc. 20:45:24 simple putting -> putting simple 20:45:27 I mean the program `less`. 20:45:48 the `less` history annoys me 20:45:54 the `ghci` history is useful :P 20:46:03 (reverse-i-search)`let ': let c n 0 = 1; c n k = c (n-1) (k-1) * n `div` k 20:46:09 In bash I have it set up to not save history when I exit, except if I explicitly ask it to. 20:46:30 (that right there is my most common definition in ghci) 20:47:00 That's a pretty common definition. 20:47:40 uh. how do I parse that 20:48:27 I mean, everyone wants that one. 20:48:32 And it's tragically missing. 20:48:43 I do put a bunch of definitions and imports in my .ghci. 20:49:05 Except ghci startup has gotten so slow that now I don't have them in by default. 20:49:08 Meh .ghci is all wrong though. 20:49:48 I believe .ghci is sourced twice if you run ghci in your home directory. Which I do a lot. But maybe that's fixed. 20:50:14 Looks like it's only once. 20:50:16 But worse, it's picked up from whatever local directory I happen to be in and I don't want that at all. 20:50:57 Hmm, doesn't seem great. 20:51:01 Too much browsing third-party code, too much using `ghci` as a calculator in whatever shell I happen to have open. 20:51:01 *** WARNING: . is writable by someone else, IGNORING! 20:51:32 So I use alias ghci='ghci -ignore-dot-ghci' 20:51:39 Makes sense. 20:52:36 (Hmm, cann I still provide a global .ghci file *after* giving that option? It's been a long time since I considered this.) 20:52:50 You could try -ghci-script 20:53:06 Seems to work. 20:53:26 why don't you just empty .ghci then? 20:55:02 myname: which problem does that solve? 20:55:16 you don't need the alias 20:55:38 myname: the alias is for not picking up third party's .ghci files 20:57:57 shachaf: thanks for the discussion :) Yes, -ghci-script works in conjunction with -ignore-dot-ghci 20:58:12 myname: ghci reads ./.ghci, not just ~/.ghci. 20:58:20 ah 20:58:44 Now you can define c once and for all. 20:58:51 already did 20:59:04 it's my definition of choice 20:59:19 The main use of .ghci is to enable all the extensions upfront, since enabling them whenever I test something is so much typing. 20:59:44 I have 43 extensions enabled. 20:59:49 ouych 20:59:52 -y 20:59:55 No, 40, since a few are commented out. 21:00:11 Also I don't do much Haskell anymore so it's all irrelevant anyway. 21:00:35 I'm not convinced that I can even name 40 extensions on the spot :) 21:01:12 (yes, I can do :set -X) 21:01:28 -!- harha_ has quit (Quit: ZNC - https://znc.in). 21:01:43 One of them is NoMonomorphismRestriction. Is that an extension? 21:01:45 I guess the main thing here is that I never got into the really deep type hackery. 21:01:59 Sure, it is. 21:02:29 One of the funny extensions whose name starts with No. 21:02:30 I guess it's incomparable if you look at code being accepted or not. 21:02:44 You can see an old .ghci at https://slbkbs.org/ghci.txt 21:03:38 SOme of these are a bit silly. 21:04:48 Oh, the other thing is, when you enable extensions in your .ghci, you can ghci a file and not have to write the extensions at the top. 21:04:59 Which is very convenient even when you're experimenting in a file instead of the REPL. 21:05:38 I wonder what kind of type hackery counts as "really deep". 21:06:31 polykinded type family types of things 21:06:52 -!- harha_ has joined. 21:07:32 In ghci I usually get away with one or two extensions at a time, and often none at all. 21:07:58 -!- arseniiv_ has joined. 21:10:56 -!- arseniiv has quit (Ping timeout: 260 seconds). 21:13:13 Personally, I'm into kind hackery and value hackery, but not type hackery. 21:13:22 It's a parity thing. 21:13:30 Too bad GHC has type-in-type and ruins this. 21:13:30 pfft 21:16:10 Do you like distributed consensus? I had some questions about Paxos, I think. 21:33:03 . o O ( faux Paxos ) 21:33:44 Anyway, nah... never studied the stuff in detail. 21:38:00 -!- LKoen has quit (Quit: “It’s only logical. First you learn to talk, then you learn to think. Too bad it’s not the other way round.”). 22:28:56 TIL how to compose permutations given in cycle form, it’s surprisingly natural 22:29:01 -!- arseniiv_ has changed nick to arseniiv. 22:30:40 to compose a permutation σ in cycle form with a single cycle c, you kind of place portals right before all elements in σ which belong to c and then “re-glue” as needed 22:31:03 and then you just compose with all remaining cycles one by one 22:31:50 portals were my great discovery, before that I didn’t think you can multiply cycles on paper without converting them to substitutions and back 22:33:15 I don’t know if someone teaches that somewhere, but probably this method is implemented somewhere in GAP CAS, at least, as there are primitive permutation objects which you represent in cycle form and they don’t belong to any predefined group 22:35:12 one certainly can inject all multiplied permutations into a certain minimal S_n group and compute using substitution form and then convert back to cycles but now I see this isn’t a necessity at all 22:35:33 I like liberating moments like those 22:43:30 the strangest is that I wouldn’t end up with this on my own. I ended up here because I helped a person to prove you can’t make a certain class of permutations by composing just m transpositions. The proof ended up surprisingly simple but side effect was discovering this for myself 22:47:31 (the precise statement is: if a permutation from S_n has m cycles, including fixed points, then you can get it by composing ≥ n − m transpositions, and can’t for less than that. The simple truth there is that by composing with a transposition, you either add or subtract 1 from that number d, and that () has d = 0, so naturally, just induction and you’re done 22:48:12 ) 22:57:52 arseniiv: and you have to adhere to the parity restriction too 23:00:00 int-e: shouldn’t it be included in d? Parity is (−1)^d 23:00:23 arseniiv: the portal thing... note that (a b c) can be read as a -> b, b -> c, c -> a; so (a b c) (b d) with a "portal" between the b-s makes a -> b -> d the composition of two table lookups. 23:01:18 I need of course to add that my thing only proves that no < n − m suffices, and proving n − m suffices is another thing which in my case was proven beforehand so I helped just with this one 23:02:32 arseniiv: You can basically prove the parity property, but you didn't mention it. (I mean: n-m works, n-m+1 doesn't, n-m+2 works agein, n-m+3 doesn't, etc.) 23:02:34 int-e: yeah, of course both things are equivalent but converting from tables to cycles and back is still not good when you use only tables or only cycles 23:02:53 arseniiv: I just never write down the tables. 23:03:18 int-e: ah, yeah, I mis-that-thinged the proposition 23:04:39 int-e: now I probably wouldn’t too, though I almost don’t deal with permutations by hand at all in any case 23:05:09 though tables of course are useful for some demonstrations, I don’t remember which… 23:06:46 say: (1 2 3) (3 4 5) (2 5): 1 maps to 2, then 5. 5 maps to 3, 3 maps to 1. That's (1 5 3). And 2 maps to 3, then 4; 4 maps to 5 then 2, so (2 4). And that's the whole result in cycle form: (1 5 3) (2 4) 23:08:11 The point being, you can do all this fairly easily without every writing down a table. But applying a permutation to a single element is the same as such a table lookup. 23:08:21 every -> ever 23:09:38 Knuth actually devotes some space on algorithms for this in TAoCP. 23:09:51 (I forgot the details.) 23:13:55 oh, didn’t read TAoCP extensively. No surprise he would do that there, though! 23:14:20 yep, I mean for some reason before yesterday I thought multiplying cycles would be harrd 23:15:01 I thought when implementing something in that vein several years ago, probably 23:15:19 there were two classes for each representation, for that matter 23:15:36 it's hard... in that you can mess things up very easily :) 23:16:18 there is a common mistake when composing tables too, I knew about it and still made it a couple of times 23:17:05 forgetting to add elements which aren’t mapped to anything in the first table (and thus usually absent from its keys) 23:17:23 the keys of a corresponding map 23:44:24 [[Suptiftam]] M https://esolangs.org/w/index.php?diff=82400&oldid=81912 * PythonshellDebugwindow * (+1) /* Hello, world! */ Fix 23:52:30 -!- delta23 has quit (Quit: Leaving).