00:01:18 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166371&oldid=166370 * RaiseAfloppaFan3925 * (+163) Open the door for contribution (do it on github idiot)
00:01:53 <Sgeo> " The programmer should
00:01:53 <Sgeo> bear in mind that 10,000 executions of all nonoptimum instructions would
00:01:53 <Sgeo> take less than 3 minutes longer than 10,000 executions of optimum instructions. If the programmer spends 15 - 30 minutes on each routine
00:01:53 <Sgeo> trying to save machine time by optimizing, this time may never be made up in the actual running of the problem."
00:02:13 <Sgeo> https://bitsavers.org/pdf/royalPrecision/LGP-30/LGP-30_Subroutine_Manual_Oct60.pdf
00:05:32 <zzo38> (In this case, it was to prevent Clefable from falling asleep; it is risky because in both cases you might not be able to do anything, although with different probabilities of that occurring at different times. It also reduces Clefable's speed compared with my other active pokemon attacking first)
00:15:10 <int-e> ais523: I guess it's not a bug then. The underlying quirk is that switching to unbuffered mode intializes buffer start and end to comprise a 1 byte buffer. And the automatic allocation only kicks in if no buffer is initialized. It ignores the `size` argument, too, instead uses the default buffer size (10000?). 8c85a940b12f57ed5116e759b6c9aa388b169fdd
00:15:45 <int-e> huh, what's that hash
00:18:27 <int-e> ais523: one half of that is here, https://github.com/bminor/glibc/blob/master/libio/iosetvbuf.c#L45-L69 and the other half is here, https://github.com/bminor/glibc/blob/master/libio/genops.c#L481-L485 (well, in part, the logic is repeated at least once that I saw in passing)
00:19:10 <int-e> ais523: So I guess, don't use NULL there if you want to get a buffer.
00:19:26 <int-e> ais523: And of course a 1 byte buffer explains the 12/1 behavior perfectly.
00:21:10 <int-e> ais523: and you need a 1 byte buffer for ungetc(), I think that's the last piece of the puzzle
00:21:34 <int-e> that, and sharing the basic buffer setup between reading and writing
00:25:46 <ais523> Sgeo: nowadays, a) programs are run more often than they used to be, b) one-off programs often deal with a very large amount of data, so you're OK with making the O(1) compile slower in order to make the O(n) program faster even if the constant-factor tradeoff isn't good
00:26:04 <ais523> so although that advice was historically correct I don't think it applies much nowadays for choice of compiler settings
00:26:26 <ais523> (it does sometimes apply to choice of language, e.g. languages like Perl are good for one-off scripts acting on small datasets despite having bad performance)
00:26:46 -!- amby has quit (Quit: so long suckers! i rev up my motorcylce and create a huge cloud of smoke. when the cloud dissipates im lying completely dead on the pavement).
00:27:04 <ais523> but the traditional wisdom from the early days of programming was that the only program worth optimising is the compiler, as it's the only one you run often enough to make optimising it save net time
00:27:54 <ais523> int-e: a default size that is not a multiple of the page size looks so wrong to me
00:28:18 <ais523> (although I know that it's being used purely for memory copies and not any mapping tricks, so it shouldn't hurt in any way other than possibly wasted TLB space)
00:30:19 <ais523> actually, a good reason for it to be a multiple of the page size is that it's a big allocation, so some allocators may want to put it in its own mapping
00:37:12 -!- sytra has joined.
00:37:13 -!- sytra has quit (Remote host closed the connection).
00:39:22 <Sgeo> In the case of LGP-30, optimizing is ... apparently choosing where the data is located relative to the instruction in a particular way.
00:41:52 <int-e> ais523: Oh it's 8192, the 10k is from a test, my bad.
00:42:13 <ais523> Sgeo: was it designed for drum memory or delay line memory?
00:42:51 <Sgeo> But the instructions don't have a "next instruction" address. LGP-30 though was a predecessor machine to the one from Story of Mel apparently
00:45:03 <ais523> I just realised that with drum memory, it might make sense for the instruction pointer to, after each instruction, increase by a constant that's greater than 1
00:45:23 <ais523> to save the memory that would be needed for the "next instruction" pointer, whilst still getting decent speed
00:45:42 <ais523> although it'd require a full loop round the drum if the instruction accessed data memory that was on the same drum as the code
00:46:13 <Sgeo> I still have no intuition for why drives are better than drums (for secondary storage)
00:47:31 <ais523> you mean, like hard drives? I think it's just because they're more usefully three-dimensional
00:47:40 <ais523> with drum memory you only get the outer surface of the drum to work with
00:47:50 <ais523> with a hard drive you get the entire surface area of each platter
00:48:27 <Sgeo> I guess I keep thinking of hard drives as being single platter, but that... wasn't at all the case early on I think
00:48:58 <ais523> or to put it another way, multiple hard drive platters stack better into a small space than multiple drums do
00:56:38 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166372&oldid=166371 * RaiseAfloppaFan3925 * (+9) comment
01:19:59 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166373&oldid=166372 * RaiseAfloppaFan3925 * (+500) Added "nt tuff" + "so tuff"
01:24:14 <Sgeo> I was thinking how fascinating it would be if a computer used hard drive as main memory... LGP-21 did
01:32:38 -!- perlbot has joined.
02:25:20 * Sgeo vaguely wonders if perlbot has any relation to PerlNomic
02:28:40 <Sgeo> I'm not sure why I thought the Story of Mel was fictional
02:28:54 <Sgeo> When I first read it some time ago.
02:35:30 <zzo38> (The one that I thought the opponent's pokemon should attack the ally if I was in their place, was that I had Gastrodon with Storm Drain ability, with Recover and some other things (I do not remember all of the details). One of opponent's pokemons was both trapped and choice-locked (and I think it was Samurott, but I do not reember for sure).
02:36:30 <zzo38> Their other ones also could not attack Gastrodon enough, and both of my pokemons could attack the opponent's pokemon other than Samurott. I do not entirely remember why, but since opponent's Samurott was in all the time, I did not attack Samurott until knocking out all of opponent's other pokemons first.)
02:37:52 <Sgeo> zzo38, is this a specific Pokemon game?
02:39:00 <zzo38> This was the Pokemon Unbound Battle Frontier (which is a separate .gba file from the main Pokemon Unbound game)
03:29:37 -!- b_jonas has quit (Ping timeout: 255 seconds).
03:46:58 <ais523> Sgeo: in case you haven't seen it: https://melsloop.com/
03:49:04 <ais523> (summary: someone doing serious investigation into The Story of Mel, including figuring out who Mel was, and going into the technical details of the code – but there's also just a lot of general context added)
03:52:12 <Sgeo> Came across it, haven't read it yet
04:07:16 <zzo38> I am glad that someone wrote it because I had also wondering about such things like that
04:14:41 <zzo38> (It does not display the entire article on my computer unless I disable CSS; if it does not work for you, you might try that too)
04:32:52 <Sgeo> I saw a blog post by Masswerk about the LGP-50, but it contains an error (saying one's complement instead of two's complement). I hope... my email about that wasn't rude. I did call it nitpicking in the subject
05:07:49 -!- Yayimhere has joined.
05:09:56 <Sgeo> "Machines with serial number 1.2 or less read 4 of the 6 channels
05:09:56 <Sgeo> into the computer. "
05:10:20 <ais523> 1.2 would be a fun serial number
05:10:36 <ais523> I guess this is old enough that making 12 computers of a given model would be a lot
05:11:46 <Yayimhere> what are we working on around here?
05:11:54 * Sgeo is learning about LGP-30
05:11:59 <Sgeo> https://bitsavers.org/pdf/generalPrecision/LGP-30/manuals/LGP-30_Programming_Class_Notes.pdf
05:13:27 <ais523> I wonder whether there's a channel specifically for retrocomputing
05:13:36 <ais523> there's obviously a big overlap with esolangs, but they're technically different topics
05:13:52 <ais523> so the retrocomputing enthusiasts likely hang out elsewhere rather than here
05:14:11 <Sgeo> There are multiple retrocomputing Discords, and there's a retronetworking channel here (that I don't participate much in)
05:17:13 <esolangs> [[1L a]] https://esolangs.org/w/index.php?diff=166374&oldid=137854 * Ais523 * (+41) add the unknown computational class because TCness hasn't been proven (somewhat odd for a language from 2005 that was relatively famous at the time)
05:20:24 <Yayimhere> yay!!! I think I have found something interesting to make (finally)!!!
05:26:20 <Sgeo> The earlier LGP-30s have an extra break point button compared to the later ones
05:26:38 <esolangs> [[Talk:(ch34t) c0d3]] https://esolangs.org/w/index.php?diff=166375&oldid=141480 * Yayimhere2(school) * (-241) this was a comment by my, and is unnecessary
05:27:21 <esolangs> [[(ch34t) c0d3]] https://esolangs.org/w/index.php?diff=166376&oldid=148937 * Yayimhere2(school) * (+5)
05:31:28 <Yayimhere> how do you guys name your esolangs?
05:31:59 <ais523> I normally just go with the first thing that seems like it fits
05:32:32 <ais523> some of them have a lot of thought put into their names, e.g. Incident, but that's a minority of cases (I put extra effort into Incident because it was made for a competition)
05:32:48 <Yayimhere> I need to look at incident again lol
05:32:59 <ais523> it is not an easy language
05:34:08 <ais523> the funny thing is that I thought of the basic rule ("every token appears three times, non-middle jumps to middle, middle jumps back to the non-middle") really quickly and then everything else was trying to work through the implications
05:34:51 <ais523> (and the "every token appears three times" rule was inspired by a programming competition where people had to avoid particular characters appearing in the source code, so I wanted to make a language that was Turing-complete-with-I/O off any two characters)
05:35:06 -!- b_jonas has joined.
05:35:37 <ais523> the tight-infinite-loops rule was originally added to make polyglotting easier but it turned out to be useful for other things too (e.g. producing a syntax for a goto statement as emergent behaviour)
05:36:38 <Yayimhere> its so interesting to hear the backstories of esolangs as well
05:36:44 <ais523> or, well, backwards jumps don't need it, just the forward ones
05:37:56 <ais523> oddly enough I mentally categorise esolangs by where I was when I created them, e.g. Incident was created walking to a restaurant and Echo Tag was created in a railway station
05:38:07 <ais523> (not the entire language, just the key idea)
05:38:25 <Yayimhere> nearly all of my good esolangs were either made in the car, or in the bed while having a massive headache
05:39:22 <ais523> The Waterfall Model was a really boring location: sitting at my computer
05:40:10 <Yayimhere> also ive found a good name for my esolang
05:44:37 <b_jonas> hiding data in arbitrary English text as carrier: I like that concept, I tried it at least once, though I just encoded a short constant string rather than a bf program: https://www.perlmonks.com/?node_id=877696
05:44:53 <sorear> Sgeo: the lgp30 has one head _per track_, it "seeks" using a bank of relays instead of a voice coil and a hinge ... dunno if later drums solved this but you can't fit a perpendicular arc into a cylinder so you'd need a complicated linkage
05:44:54 <b_jonas> and making the text explain what you're doing is a good idea
05:48:16 <esolangs> [[Talk:]] https://esolangs.org/w/index.php?diff=166377&oldid=153045 * Yayimhere2(school) * (+181)
05:48:32 <esolangs> [[Talk:]] https://esolangs.org/w/index.php?diff=166378&oldid=166377 * Yayimhere2(school) * (+0)
05:49:06 <b_jonas> ais523: stegano vs obvious polyglot, there's a middle ground, where it's obvious that there's something hidden but it's not obvious how to decode it or what language it is polyglot with
05:49:44 <b_jonas> that usually comes up in puzzles, where the puzzle is written in a way that has an obvious surface meaning, and you can tell that there's something hidden, but it's hard to figure out what's hidden exactly
05:49:45 <ais523> b_jonas: like if you encounter a long hex string that's indistinguishable from random?
05:50:05 <ais523> the difference being that in the puzzle, it's meant to be decoded
05:53:06 -!- Yayimhere has quit (Quit: Client closed).
05:53:28 <b_jonas> wait, what are these two basic patterns for quining? I can think of only one basic pattern. there's one more pattern is cheating to read the source code from somewhere that it's stored, but that doesn't seem to be what you're referring to; and there's also empty quines in many languages, including Underload, but that also doesn't seem to be what you're referring to.
05:55:42 <ais523> b_jonas: quoted code + code, and eval-quine
05:56:18 <ais523> there's a "third" which is topological quines, but those aren't possible in most languages and are mildly controversial (albeit generally accepted)
05:57:36 <ais523> a topological quine is, e.g., starting a Befunge program with < and ending it with an unmatched ", in order to put the program both inside and outside a string literal and produce a quoted code + code quine with only one copy of the code
05:58:21 <b_jonas> what does "eval-quine" mean?
05:59:34 <ais523> b_jonas: you write the program in the form x="string literal"; eval(x)
05:59:53 <ais523> and then the body of the string literal is a function that regenerates the entire pattern from the contents of the string literal
06:00:19 <esolangs> [[Bog prok]] https://esolangs.org/w/index.php?diff=166379&oldid=141142 * Yayimhere2(school) * (-137)
06:00:30 <ais523> (which is still in the variable x, which is why you need a separate variable)
06:00:41 <b_jonas> same string is both evalled and used as literal. yes, I've done such a thing though not as a quine I think
06:02:53 <ais523> JS allows reverse eval quines where, instead of using a string literal as code, you use code as a string literal by calling toString on a function – but that's widely considered cheating, whereas eval-quines aren't
06:03:05 <ais523> quine legality is a weird subject and almost impossible to define objectively
06:03:27 <b_jonas> in perl a trick is to `eval for ` followed by a string literal, then the code can access the string from the $_ variable
06:03:37 <Sgeo> I've used JS reverse quines to make "malware" for the toy web OS Windows 96 >.>
06:06:30 <b_jonas> a (non-quine) example for that is https://www.perlmonks.com/?node_id=658930 . a large part of the string is a comment when it's interpreted as code, and that's long enough to encode all of the output, but you have to encode the output after you write the rest of the code in the string, because almost the whole string is used as data and is sufficiently mixed up so if you modify the code in any way it
06:06:36 <b_jonas> will completely ruin the output
06:08:04 <ais523> ugh, I remember I had a Perl-related problem in polyglotting or restricted source or something and fixed it by starting the code with a bareword followed by =~
06:08:11 <ais523> but can't remember what the problem was or why that helped
06:08:26 <esolangs> [[Bog prok]] https://esolangs.org/w/index.php?diff=166380&oldid=166379 * Yayimhere2(school) * (+99) /* other */
06:08:33 <ais523> ooh… maybe it was a "make the deletion of any character observable" type of problem
06:11:45 <korvo> The first recipe, repeating a quote twice, is the one that is guaranteed by the diagonal lemma. The trick is merely to substitute the quote twice with different delimiters, so that the generated code repeats the quote literally and "repeats the quote literally".
06:13:07 <ais523> the second recipe is also guaranteed, because you can write a self-interpreter in any TC language
06:13:28 <ais523> it's just really really verbose if the language doesn't have an eval builtin
06:14:26 <esolangs> [[Bog prok]] https://esolangs.org/w/index.php?diff=166381&oldid=166380 * Yayimhere2(school) * (+230) /* computation */
06:16:01 <b_jonas> int-e: is the file handle flushed before you do those setvbuf calls?
06:16:38 <ais523> b_jonas: we figured it out later in the scrollback
06:16:50 <ais523> (well, mostly int-e did)
06:18:42 <b_jonas> ais523: re advice for choosing what to optimize, another reason why this changed is because interactive debuggers and some other tools used to be much worse at dealing with optimized code, now they are much better because the compiler writes better debug info and the debugger can interpret that debug info better.
06:19:10 <ais523> I use -Og as a default when writing C nowadays
06:19:24 <ais523> but it's unclear whether it's actually much better for debugging than -O2 or -O3
06:19:24 -!- Sgeo has quit (Read error: Connection reset by peer).
06:26:14 <b_jonas> "mentally categorise esolangs by where I was when I created them" => hehe. for geo and scan that's really easy, because I made them for a university programming class, so I was clearly in the unviersity computer lab. I got the original idea for Consumer Society when I was visiting my brother in Sweden, but it took like a year after that to actually figure out how to get an interesting esolang based on
06:26:20 <b_jonas> that idea. But I've no idea when and how I first started to think about Enchain.
06:26:49 <b_jonas> Yayimhere: you have headache-inspired esoteric languages? I haven't tried that and I don't see how that strategy would work
06:28:04 <b_jonas> sorear: can't you use a head moving on a linear rail with a flexible cable, like how the head of some printers works?
06:29:31 <b_jonas> I mean the head is moved by a chain loop between two gears driven by a motor in that case
06:30:56 <b_jonas> although if you don't need to make the drum drive portable then you could use the typewriter method, where it's the drum that moves on a rail and the head is fixed to the bulk of the drive, which is better because you don't need flexible cables
06:31:09 <b_jonas> no wait, that doesn't work for a drum drive because you can't rotate the drum fast that way
06:31:20 <b_jonas> well, maybe you could, but it'd be harder than in a typewriter
06:32:49 <b_jonas> you'd need to add two or three extra eletric rails with moving contact footwear to transmit electricity into a motor in the moving part, in addition to the rails for mechanical linkage, and that gets ugly and the footwear can wear out too quickly
06:34:01 <b_jonas> what do you actually call in english the footwear that makes electrical contact between a moving carriage and a fixed rail?
06:37:30 <ais523> b_jonas: in the railway context, "contact shoe" <https://en.wikipedia.org/wiki/Current_collector#Contact_shoe> but often just "shoe" for short
06:37:37 <ais523> the equivalent in a motor is called a "brush"
06:39:00 <ais523> oh, and if it's an overhead conductor rather than on the ground, it uses a different form of electrical contact that's usually called a "pantograph" for some reason (I guess it kind-of looks a bit like the drawing tool?)
06:56:20 <b_jonas> also for magnetic storage, the r/w head should be kept at a steady distance from the drum, close but not touching, because the magnetizable media layer is fragile and if the head is touching it would damage the layer, and keeping the distance steady would be harder if the whole drum is moving on a rail
06:57:16 <sorear> the rail approach is also extremely slow compared to either a multi-head drum or a disk with a seek arm
07:00:11 <b_jonas> well now because of the shoe I'm imagining a Cinderella story: the prince found a custom disk drive left at the stairs of his palace, whoever has the matching disk that it can read must be the princess
07:01:04 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166382&oldid=166373 * RaiseAfloppaFan3925 * (+264) Removed comment, added two more keywords to the page + inspired by Rust
07:01:53 <sorear> the typewriter approach wouldn't work for the lgp30 due to the circulators, for true secondary storage it could work but the weight is problematic
07:34:07 -!- tromp has joined.
08:15:45 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166383&oldid=166382 * RaiseAfloppaFan3925 * (+570) im so stupid + added emoji requirement
08:26:01 -!- chiselfuse has quit (Remote host closed the connection).
08:26:14 -!- chiselfuse has joined.
08:27:44 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166384&oldid=166383 * RaiseAfloppaFan3925 * (-291) I TAKE IT BACK
08:29:59 -!- wob_jonas has joined.
08:30:17 -!- tromp has quit (Quit: My iMac has gone to sleep. ZZZzzz…).
08:30:36 <wob_jonas> sorear: right, I was thinking of the later disk drives that are used as backing storage rather than main memory, so you mostly read them sequentially and seek time is less important
08:36:30 <wob_jonas> https://www.righto.com/2024/08/minuteman-guidance-computer.html has a description about a computer that uses a multi-head disk with main memory. the part that's interesting to me is that the disk is used with at least two different delays. there's a more traditional addressed main memory part that stores both data and code instructions, where the
08:36:31 <wob_jonas> computer has to wait until the disk rotates to the place corresponding to the address that it wants to read from. but there are also tracks that are just one word long, so there's a read head one word behind a write head, and these store a single register value. the computer is serial, so reading the bits of a register in sequence works well.
08:53:10 <esolangs> [[/]] https://esolangs.org/w/index.php?diff=166385&oldid=136506 * Yayimhere2(school) * (+45) /* syntax */
08:57:24 <esolangs> [[Mango]] https://esolangs.org/w/index.php?diff=166386&oldid=166384 * RaiseAfloppaFan3925 * (+2317) Added stack example + classes and try/catch
09:08:24 <esolangs> [[(*)]] https://esolangs.org/w/index.php?diff=166387&oldid=138640 * Yayimhere2(school) * (+18) /* Memory */
09:09:00 -!- Yayimhere has joined.
09:10:32 <ais523> I suspect most of the channel regulars are asleep, given timezones
09:10:39 <ais523> (and I'm not very awake myself)
09:11:04 <Yayimhere> where are most ppl located anyways?
09:12:32 <Yayimhere> anyways, is the still Turing complete if evaluated non randomly?
09:13:13 <esolangs> [[]] https://esolangs.org/w/index.php?diff=166388&oldid=136857 * Yayimhere2(school) * (+22)
09:13:40 <ais523> see https://esolangs.org/wiki/Thupit
09:14:21 <ais523> this comes up often enough that I wrote a page about it
09:14:37 <ais523> but yes, you can modify Thue's evaluation order to more or less anything sensible and it's still Turing-complete
09:14:53 <ais523> because a Thue program can be written to only have one replacement available at a time
09:15:01 <ais523> it's easier to just link to the Thupit page and use that as the proof, though
09:15:51 <esolangs> [[]] https://esolangs.org/w/index.php?diff=166389&oldid=166388 * Yayimhere2(school) * (+30) /* turing completeness proof */
09:16:36 <esolangs> [[]] https://esolangs.org/w/index.php?diff=166390&oldid=166389 * Yayimhere2(school) * (+1)
09:17:04 <HackEso> wegian # Yayimhere:? ¯\(°_o)/¯
09:17:19 <Yayimhere> why the heck did I prove my lambda calculus copy Turing complete with thue lol
09:18:40 <wob_jonas> ``` \? wegian # Yayimhere: I meant this one
09:18:42 <HackEso> A wegian is an equivalence class of #esoteric regulars. There are two main wegians, the Nor (from Finland) and the Glas (from Hexham). There's also the hypothetical Gal, which hasn't been observed yet so we're not sure where it's from.
09:21:43 <esolangs> [[.chat]] https://esolangs.org/w/index.php?diff=166391&oldid=138635 * Yayimhere2(school) * (+23)
09:21:56 <esolangs> [[.chat]] https://esolangs.org/w/index.php?diff=166392&oldid=166391 * Yayimhere2(school) * (-61)
09:23:10 <wob_jonas> re Thue, I think that's because you can translate a deterministic one-tape Turing-machine into Thue in a straightforward way, such that the program state contains the tape except there's a terminating symbol at the end and the program state is inserted where the Turing machine head is, and each rule of the Turing-machine is encoded as a Thue rule,
09:23:11 <wob_jonas> except that rules that read the blank tape symbol each have an extra Thue rule to extend the tape.
09:24:30 <wob_jonas> yeah, like ais said, https://esolangs.org/wiki/Thupit#Computational_class explains this already
09:25:03 <esolangs> [[/]] https://esolangs.org/w/index.php?diff=166393&oldid=166385 * Yayimhere2(school) * (+22)
09:25:20 <ais523> I lost count of how many times I saw "Thue, except…" proofs explained (both by me and by others) and really should have written up the general page about it much earlier
09:26:24 <ais523> because although the angelic-nondeterminism version of Thue (i.e. the compiler picks replacements to make the program work) is really neat, and the pick-randomly version is what commonly gets implemented in practice, the evaluation-order-doesn't-matter version is by far the easiest for proofs
09:26:25 <esolangs> [[/]] https://esolangs.org/w/index.php?diff=166394&oldid=166393 * Yayimhere2(school) * (+9) /* syntax */
09:27:10 <wob_jonas> and by the way, this still works for any deterministic two-stack machine with finite control, which is a convenient generalization of Turing machines
09:28:01 <esolangs> [[/]] https://esolangs.org/w/index.php?diff=166395&oldid=166394 * Yayimhere2(school) * (+4) /* syntax */
09:28:08 <ais523> well, Turing machines are Turing-complete already, so the question is, what you gain by the generalisation?
09:28:14 <ais523> (I think something is gained but it is hard to quantify what)
09:28:30 <ais523> err, quailfy what? this is qualitative, not quantitative
09:30:28 <Yayimhere> I really need to get to identifying [ ]'s computation class lol
09:30:59 <sorear> korvo: What would you expect to see as Nix infrastructure in the nql repo?
09:32:03 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166396&oldid=166386 * RaiseAfloppaFan3925 * (+49) Mango is pseudonatural and I realized it yesterday how did I NOT ADD IT TO PSEUDONATURAL EARLIER AHHHHHHHHHHH
09:33:00 <wob_jonas> ais523: there are other Turing-completness proofs when you can reduce to a two-stack machine with finite control, such as for Blindfolded Arithmetic or Underload or Consumer Society. I think the general two-stack machine is in some sense more natural, because these proofs don't become easier with the Turing-machine restriction that you can't insert
09:33:50 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166397&oldid=166396 * RaiseAfloppaFan3925 * (+27) Guys is Mango thematic???
09:33:57 <ais523> now I'm thinking about how three-stack machines are faster at solving certain problems than two-stack machines, likewise for four-stack, five-stack and so on
09:34:48 <wob_jonas> also for a Turing-machine you need some extra argument to extend the tape, whereas for a two-stack machine you can just make it UB to try to access the bottom of any stack, and this makes the translations simpler
09:35:21 <ais523> I like my solution to that in StackFlow (a static analysis that prevents pops below the bottom of the stack)
09:35:38 <wob_jonas> ais523: wait, are four-stack machines faster than three-stack machines even in theory? I know a few extra tapes can be useful for practical cases, but I didn't know there were theoretical reasons for them.
09:35:41 <esolangs> [[]] https://esolangs.org/w/index.php?diff=166398&oldid=145758 * Yayimhere2(school) * (-19) /* syntax */
09:35:51 <ais523> wob_jonas: I think so but am not sure
09:36:35 <wob_jonas> I mean in the case when all three tapes are writable; if one of the three tapes is read-only then indeed a fourth tape helps
09:36:43 <Yayimhere> ok, so, I made this esolang a while back, and im stilll not sure if it "makes sense"? so I'd like to ask you all if you could take a guess: https://esolangs.org/wiki/⊥
09:37:33 <esolangs> [[]] https://esolangs.org/w/index.php?diff=166399&oldid=166398 * Yayimhere2(school) * (+6)
09:37:50 <ais523> Yayimhere: I don't think the spec is clear enough, in particular it doesn't explain how the axioms are used and what format they're in
09:38:10 <ais523> also ⊥ is used as the symbol for false in some types of logic, so pronouncing it as "true" will be confusing (although that might be intentional?)
09:38:23 <wob_jonas> (this argument is from TAOCP actually: Knuth argues in a multi-tape sorting algorithm for practical reasons it's best to treat the tape with the input as read-only, so he'll consider only algorithms with that constraint
09:38:27 <Yayimhere> ais523: pretty sure its intentional
09:38:51 <ais523> wob_jonas: bear in mind that three tapes is more power than three stacks
09:39:46 <wob_jonas> ais523: yes, but that just means even the third tape is less useful
09:40:01 <Yayimhere> hmmmmmm, I need two find an "axiom format" whatever that means lol
09:40:05 <ais523> there are definitely situations where extra tapes help with constant factors (e.g. the "merge" step of mergesort done on more than two lists at once) but that's only a constant factor, I feel like O(n) cases should exist but can't think of one immedaitely
09:40:22 <Yayimhere> how does a ppprogram interpret axioms?
09:40:24 <wob_jonas> sure, constant factor is believable
09:40:32 <Yayimhere> because in principle I want every character to be valid
09:41:15 <ais523> it's more, an axiom is part of a proof system – but they aren't useful without having rules for manipulating them to make proofs with them
09:41:42 <Yayimhere> I think I might have confused axioms with rule's, back in the daay
09:42:04 <ais523> here's an example of a simple system which has axioms and inference rules: https://en.wikipedia.org/wiki/Metamath#Language_basics
09:42:40 <Yayimhere> couldnt you take it in reverse order? (having a bunch of proofs and then the program interprets an axiom)
09:42:47 <ais523> although, to me, it's maybe a bit too simple to understand easily (because the simpler a language is, the more complicatedthe programs get)
09:43:31 <Yayimhere> i want the same with "only" axioms and not a specific logic system
09:43:53 <ais523> Metamath is close to that, I think – the language doesn't hardcode any axioms or inference rules
09:44:52 <Yayimhere> the biggest (wanted) difference is that any symbol is valid from the startt
09:50:22 <wob_jonas> ais523: re Metamath, wait, how does that work, does it encode some kind of context-free grammar parser?
09:50:46 -!- tromp has joined.
09:51:42 <wob_jonas> like, does Metamath include a yacc in its guts or something?
09:52:16 <ais523> wob_jonas: I don't know the language very well, the examples make it look like it matches ( and ) and otherwise just uses uninterpreted whitespace-separated tokens
09:53:08 <ais523> but that's effectively reverse-engineered from examples
09:53:24 <ais523> so I don't know for certain that that's actually how it works
09:55:34 <esolangs> [[UnCompetition]] N https://esolangs.org/w/index.php?oldid=166400 * Yayimhere2(school) * (+887) Created page with "'''UnCompetition''' is an esolang created by [[User:Yayimhere]], with the focus of trying to have an undecidable question, instead of actually being a programming language. == Description == UnCompetition consists of a tree, full of programs in its own
10:00:25 -!- Yayimhere has quit (Ping timeout: 250 seconds).
10:04:17 -!- ais523 has quit (Quit: quit).
10:11:49 -!- Yayimhere has joined.
10:15:45 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166401&oldid=166400 * Yayimhere2(school) * (+211) /* Description */
10:16:08 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166402&oldid=166401 * Yayimhere2(school) * (+0) /* Description */
10:17:31 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166403&oldid=166402 * Yayimhere2(school) * (+54) /* Description */
10:18:35 <esolangs> [[Lalala]] https://esolangs.org/w/index.php?diff=166404&oldid=136233 * Yayimhere2(school) * (-17) /* memory */
10:21:01 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166405&oldid=166403 * Yayimhere2(school) * (+13)
10:22:10 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166406&oldid=166405 * Yayimhere2(school) * (+97) /* Description */
10:22:58 <Yayimhere> ok, so, I'd just like to ask, if this documentation is clear?: https://esolangs.org/wiki/UnCompetition
10:23:32 -!- wob_jonas has quit (Quit: Client closed).
10:25:42 <esolangs> [[User:Yayimhere]] https://esolangs.org/w/index.php?diff=166407&oldid=148938 * Yayimhere2(school) * (+34)
10:35:01 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166408&oldid=166397 * RaiseAfloppaFan3925 * (+1) added empty line
10:50:15 -!- Yayimhere has quit (Ping timeout: 250 seconds).
10:55:02 -!- Yayimhere has joined.
11:06:41 -!- cbs has quit (Remote host closed the connection).
11:06:42 -!- ursa-major has quit (Remote host closed the connection).
11:06:42 -!- dcreager has quit (Remote host closed the connection).
11:06:42 -!- ManDeJan has quit (Write error: error:80000068:system library::Connection reset by peer).
11:09:19 -!- Yayimhere has quit (Ping timeout: 250 seconds).
11:22:00 -!- Yayimhere has joined.
11:23:34 <esolangs> [[User:Yayimhere]] https://esolangs.org/w/index.php?diff=166409&oldid=166407 * Yayimhere2(school) * (+20)
11:25:59 <esolangs> [[User:Yayimhere/Sandbox]] https://esolangs.org/w/index.php?diff=166410&oldid=148774 * Yayimhere2(school) * (+4)
11:28:45 <esolangs> [[Mango]] M https://esolangs.org/w/index.php?diff=166411&oldid=166408 * RaiseAfloppaFan3925 * (+46) Added clapback statement
11:30:42 -!- Yayimhere has quit (Quit: Client closed).
11:31:01 <esolangs> [[Bijection]] https://esolangs.org/w/index.php?diff=166412&oldid=166352 * Yayimhere2(school) * (+5) /* examples */
11:31:38 -!- Yayimhere has joined.
11:36:50 -!- Lord_of_Life_ has joined.
11:37:52 -!- Lord_of_Life has quit (Ping timeout: 260 seconds).
11:38:12 -!- Lord_of_Life_ has changed nick to Lord_of_Life.
11:41:51 <esolangs> [[RECT4n=GLE]] https://esolangs.org/w/index.php?diff=166413&oldid=147537 * Yayimhere2(school) * (-244) /* adding random programs onto eachother to see if it does anything */
12:02:20 -!- Everything has joined.
12:05:13 -!- Yayimhere has quit (Ping timeout: 250 seconds).
12:19:25 -!- dcreager has joined.
12:19:29 -!- cbs has joined.
12:19:29 -!- ursa-major has joined.
12:19:30 -!- ManDeJan has joined.
12:34:50 <esolangs> [[Hello world program in esoteric languages (B-C)]] https://esolangs.org/w/index.php?diff=166414&oldid=158175 * RaiseAfloppaFan3925 * (+100) Added Bussin and Bussin X
12:38:29 <esolangs> [[Hello world program in esoteric languages (T-Z)]] https://esolangs.org/w/index.php?diff=166415&oldid=163368 * RaiseAfloppaFan3925 * (+102) Added Yappacino
12:39:27 <esolangs> [[Hello world program in esoteric languages (T-Z)]] M https://esolangs.org/w/index.php?diff=166416&oldid=166415 * RaiseAfloppaFan3925 * (+3) Fixed the mistake, I'm so stupid
12:41:06 <esolangs> [[Hello world program in esoteric languages (N-S)]] https://esolangs.org/w/index.php?diff=166417&oldid=162760 * RaiseAfloppaFan3925 * (+81) Added Nonstraightforward
12:44:15 <esolangs> [[PythOwO]] https://esolangs.org/w/index.php?diff=166418&oldid=144637 * RaiseAfloppaFan3925 * (+25) PythOwO likely counts as a thematic language, and the main theme is "uwu" or something? How do you name this?
12:57:27 -!- amby has joined.
12:59:41 -!- wob_jonas has joined.
13:01:55 <wob_jonas> `python3 -cs='print("`python3 -cs=%r;exec(s)"%s)';exec(s)
13:01:57 <HackEso> `python3 -cs='print("`python3 -cs=%r;exec(s)"%s)';exec(s)
13:02:30 <wob_jonas> ^ exec-quine, based on ais's explanation yesterday
13:02:46 <wob_jonas> Yayimhere: no, the documentation is not clear
13:05:57 <esolangs> [[User:RaiseAfloppaFan3925]] https://esolangs.org/w/index.php?diff=166419&oldid=166338 * RaiseAfloppaFan3925 * (+1276) why
13:13:03 <wob_jonas> `perl -eeval for q(print((q(`perl -eeval for q(b))=~s/b/lc/re)))
13:13:04 <HackEso> `perl -eeval for q(print((q(`perl -eeval for q(b))=~s/b/lc/re)))
13:14:12 <wob_jonas> `perl -eeval for q(print(q(`perl -eeval for q(b))=~s/b/lc/re))
13:14:14 <HackEso> `perl -eeval for q(print(q(`perl -eeval for q(b))=~s/b/lc/re))
13:14:56 <wob_jonas> `perl -eeval for q(print(q(`perl -eeval for q(b))=~s/b/lc/re)# it's also easy to add a payload to these )
13:14:57 <HackEso> `perl -eeval for q(print(q(`perl -eeval for q(b))=~s/b/lc/re)# it's also easy to add a payload to these )
13:15:35 <wob_jonas> `python3 -cs='print("`python3 -cs=%r;exec(s)"%s)# payload in this one as well ';exec(s)
13:15:37 <HackEso> `python3 -cs='print("`python3 -cs=%r;exec(s)"%s)# payload in this one as well ';exec(s)
13:21:59 <wob_jonas> `perl -eprintf lc,lc for q(`perl -eprintf lc,lc for q(%s))
13:22:00 <HackEso> `perl -eprintf lc,lc for q(`perl -eprintf lc,lc for q(%s))
13:45:01 -!- wob_jonas has quit (Quit: Client closed).
13:51:13 -!- Yayimhere has joined.
13:52:09 <Yayimhere> there's this strange difference between newer and older esolangs, where older ones where more thematic, and newer one's are more abstract or conceptual(like, Underload Vs Whitespace)
13:55:04 <esolangs> [[Selt]] https://esolangs.org/w/index.php?diff=166420&oldid=103814 * I am islptng * (+36)
13:59:39 <esolangs> [[Hello world program in esoteric languages (N-S)]] https://esolangs.org/w/index.php?diff=166421&oldid=166417 * I am islptng * (+313) /* Add SLet */
14:12:49 <tromp> maybe because it's harder to come up with an original theme
14:24:41 <Yayimhere> ok if I was to have like, a null register, just any register with a null, then what would happen, if I were to negate that register?
14:27:22 -!- tromp has quit (Ping timeout: 246 seconds).
14:32:07 -!- Everything has quit (Read error: Connection reset by peer).
14:33:45 -!- Yayimhere has quit (Quit: Client closed).
14:35:05 -!- Yayimhere has joined.
14:35:27 <esolangs> [[=?]] https://esolangs.org/w/index.php?diff=166422&oldid=128527 * Yayimhere2(school) * (-103)
14:37:29 -!- Everything has joined.
14:51:04 -!- tromp has joined.
14:59:40 <esolangs> [[Hello world program in esoteric languages (H-M)]] https://esolangs.org/w/index.php?diff=166423&oldid=165780 * RaiseAfloppaFan3925 * (+173) Added Mango
15:09:07 <esolangs> [[Mango]] https://esolangs.org/w/index.php?diff=166424&oldid=166411 * RaiseAfloppaFan3925 * (+1153) Added progress
15:13:16 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166425&oldid=166406 * Yayimhere2(school) * (+9)
15:22:41 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166426&oldid=166425 * Yayimhere2(school) * (+10) /* Description */
15:23:44 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166427&oldid=166426 * Yayimhere2(school) * (+12) /* Description */
15:26:44 -!- Yayimhere has quit (Quit: Client closed).
15:28:41 <korvo> sorear: I don't really need anything in the upstream repo. If you choose to offer a Nix flake (flake.nix and flake.lock in the root) then I can import from that, but that's really just a fancier version of depending on an upstream git repo.
15:29:20 <korvo> b_jonas: Metamath's parser is hilariously simple: split on spaces, special tokens start with $. ( and ) are not matched, but the comments $( and $) are matched, as well as nesting brackets ${ and $}.
15:30:16 <korvo> There's no encoding of the target logic's grammar. Instead, users have to manually construct rules for each production.
15:37:40 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166428&oldid=166427 * Yayimhere2(school) * (+62) /* Description */
15:44:47 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166429&oldid=166428 * Yayimhere2(school) * (+273) /* Description */
15:47:00 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166430&oldid=166429 * Yayimhere2(school) * (+22)
15:53:02 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166431&oldid=166430 * Yayimhere2(school) * (+157) /* Description */
15:58:38 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166432&oldid=166431 * Yayimhere2(school) * (+0) /* Description */
16:13:42 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166433&oldid=166432 * Yayimhere2(school) * (+413)
16:16:51 <esolangs> [[User talk:Yayimhere]] https://esolangs.org/w/index.php?diff=166434&oldid=155727 * Yayimhere2(school) * (+132) /* Sorry? */
16:17:35 <esolangs> [[User:Yayimhere]] https://esolangs.org/w/index.php?diff=166435&oldid=166409 * Yayimhere2(school) * (+20)
16:18:24 <esolangs> [[Good writing, bad execution]] https://esolangs.org/w/index.php?diff=166436&oldid=148738 * Yayimhere2(school) * (+15)
16:18:47 <esolangs> [[Good writing, bad execution]] https://esolangs.org/w/index.php?diff=166437&oldid=166436 * Yayimhere2(school) * (+2) /* esolang */
16:20:15 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166438&oldid=166433 * Yayimhere2(school) * (+50)
16:23:05 <esolangs> [[Special:Log/newusers]] create * Agecaf * New user account
16:23:22 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166439&oldid=166438 * Yayimhere2(school) * (+36) /* Description */
16:26:38 <esolangs> [[Esolang:Introduce yourself]] https://esolangs.org/w/index.php?diff=166440&oldid=166341 * Agecaf * (+242) /* Introductions */
16:28:17 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166441&oldid=166439 * Yayimhere2(school) * (-19) /* Description */
16:32:05 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166442&oldid=166441 * Yayimhere2(school) * (-41) /* Description */
16:48:49 -!- tromp has quit (Quit: My iMac has gone to sleep. ZZZzzz…).
16:51:41 <b_jonas> Tayimhere: that's because DMM stopped making esolangs, and he was the one who made them thematic
17:03:24 <esolangs> [[UnCompetition]] https://esolangs.org/w/index.php?diff=166443&oldid=166442 * Yayimhere2(school) * (+9)
17:06:45 <korvo> That said, plenty of languages have themes. Monte has vats of objects slowly being turned, unfulfilled and broken promises, pulling ingredients from the freezer to bake muffins, vamping on a riff while waiting for a solo to start, and that's without talking about all of the windowing metaphors common to any TUI or GUI system.
17:07:43 <esolangs> [[User:Yayimhere]] https://esolangs.org/w/index.php?diff=166444&oldid=166435 * Yayimhere2(school) * (+22) /* esolangs */
17:08:05 <korvo> Those themes and analogies are apparently easier for people to understand than the brute concepts of concurrency, asynchrony, multi-stage compilation, and distributed parallelism respectively.
17:10:39 <esolangs> [[User:Yayimhere]] https://esolangs.org/w/index.php?diff=166445&oldid=166444 * Yayimhere2(school) * (+20) /* esolangs */
17:11:32 <esolangs> [[The Sophomores From Tbilsi]] https://esolangs.org/w/index.php?diff=166446&oldid=145475 * Yayimhere2(school) * (+0)
17:18:38 <b_jonas> korvo: sometimes yes, but sometimes the theme actually makes the language harder to understand because it masks familiar concepts under a description with unfamiliar terminology
17:22:32 <esolangs> [[]] https://esolangs.org/w/index.php?diff=166447&oldid=155991 * C++DSUCKER * (+0) X is not a bound variable, and y is the only bound one. this also makes the code work as intended.
17:25:00 <korvo> b_jonas: Yeah, for sure. I generally try not to come up with new names for old abstractions. I have a different bad habit: if an algorithm is only known by its author, like Lentz's or Welford's algorithms, then I'll just call the abstraction a "lentz" or "welford". The latter's now become a "welf" in my latest codebase.
17:27:55 -!- tromp has joined.
17:30:00 <esolangs> [[(,!)]] https://esolangs.org/w/index.php?diff=166448&oldid=135600 * Yayimhere2(school) * (-244) /* Minor paradox */
17:31:39 <esolangs> [[Y/]] https://esolangs.org/w/index.php?diff=166449&oldid=130424 * Yayimhere2(school) * (+31)
17:36:47 -!- Yayimhere has joined.
17:37:55 <esolangs> [[User:Yayimhere]] https://esolangs.org/w/index.php?diff=166450&oldid=166445 * Yayimhere2(school) * (+229) /* esolangs */
17:38:47 <Yayimhere> what is the most common category of languages you make? for me its concurrent language's(which makes no sense to me), and string replacement languages, which makes a lot more sense to me(I like strings)
17:41:59 -!- ais523 has joined.
17:42:09 <ais523> Yayimhere: for me it's mostly counter machines and tag systems
17:42:38 <b_jonas> Yayimhere: dunno, that depends on where you draw the boundary for what domain-specific thing counts as a "language" and how you count them
17:43:09 <ais523> because those are generally the best sorts of language for proving Turing-completeness with, so I need a lot of them in order to make Turing-completeness proofs easy to find
17:44:02 <ais523> although there are also a few languages which are very similar to tag systems but don't actually count as tag systems because they don't actually have a queue, I'm not sure how to classify those
17:44:03 <Yayimhere> b_jonas: tbh whatever you think Is more interesting for generating an answer I guess lol
17:44:32 <Yayimhere> ais523: i find your tendency to make languages to prove the TC'ness of other languages quite interesting
17:45:23 <ais523> it's one of the things I'm most interested in, out of esolang-related things (and the other things I'm interested in take much more time)
17:45:34 <Yayimhere> the closest ive ever gotten to that is Short Minsky Machine Notation, which barely is anythingh new
17:45:44 <esolangs> [[ThingLangOOP]] https://esolangs.org/w/index.php?diff=166451&oldid=166273 * Rasa8877 * (+57)
17:46:28 <korvo> Yayimhere: Most of my languages are actually APIs; they're patterns for calling an object and getting it to behave a certain way.
17:46:54 <ais523> one of my visions for big esolang-related projects, that I've had for many years now, is writing a program that, for any two esolangs in a large set of esolangs, can compile from one to the other
17:47:07 <korvo> Like, where the typical language is initial-coded, I'm usually final-coded. I wrote up how I look at things for the example of Brainfuck in Python 2.7: https://pypy.org/posts/2024/11/guest-post-final-encoding-in-rpython.html
17:47:20 <Yayimhere> korvo: I feel like that itself is a language "category" of sorts
17:48:56 <ais523> korvo: my interaction with final encodings is mostly remembering they exist, forgetting how they work, then getting instantly reminded upon seeing an example
17:49:10 <ais523> I guess they don't come up often enough for me to hold them in my memory
17:49:11 <korvo> Yayimhere: It is emphatically not a language, no. A language has an alphabet of symbols, strings, grammar, etc. The correspondence between initial and final encodings is deep; it turns out that computer science isn't just about languages.
17:49:12 <Yayimhere> sadly I need to leave now, but thanks for the short interaction!
17:50:04 <esolangs> [[User talk:ChuckEsoteric08]] https://esolangs.org/w/index.php?diff=166452&oldid=165057 * Yayimhere2(school) * (+218)
17:50:16 <ais523> …and now I'm thinking about parser visitors, which are quite similar to final encodings (but, I think, substantially different in practice)
17:50:19 -!- Yayimhere has quit (Quit: Client closed).
17:50:24 <korvo> ais523: They come up for me in the context of fast interpreters and code reuse. The difficult ergonomics are why they're not more common, I think.
17:51:23 <korvo> Coming up in Python, I didn't understand why visitors were weird at first. My types didn't have to line up, or they only had to line up in the fancy dependent way rather than at first order, so visitors and walkers seemed like the same thing phrased two ways.
17:51:27 <esolangs> [[Short Minsky Machine Notation]] https://esolangs.org/w/index.php?diff=166453&oldid=165037 * Yayimhere2(school) * (-9) Unstubbed, I would say it is detailed enough, for what it is
17:52:11 <ais523> there's probably more than one way to do a parser visitor
17:52:35 <ais523> but the one I've seen was, effectively, equivalent to representing as XML and then sending all the start-tags and end-tags individually
17:52:44 <korvo> Paraphrasing glyph, Python doesn't really have much of a different between f(x) and x.apply(f) besides who gets execution control. But paraphrasing Mark Miller and Allen Short, whoever is applying f onto x likely has an opinion about who should get that control, particularly when f and x are not trusted code.
17:53:00 <ais523> which is complex from a typing point of view because there's no static guarantee that it's correctly nested
17:53:52 <ais523> a final encoding feels like a type-safe version of that
17:55:42 <ais523> …and now I just realised that yacc generates what is in effect a final encoding
17:55:46 <korvo> Yeah! I actually first discovered them in a similar context; I was working with a Python library that could either return a synchronous value *or* an async handle, and I eventually arranged the library so that it was agnostic as to whether values were sync.
17:56:16 <ais523> and the semantic actions are normally used to convert that into an initial encoding, but they can do other things too
17:56:20 <korvo> Yep! Any time there is an interface of behaviors, there is a final-encoded algebra describing the effects of that interface.
17:59:37 <ais523> ah no, I just realised, there is a difference
18:00:09 <ais523> I was wondering about evaluation order
18:00:48 <ais523> but final encodings do allow a pure call-by-value approach (which is what yacc gives you)
18:01:51 <korvo> Right. Evaluation order only matters to the extent that one violates the encapsulation of the encoding; the caller isn't supposed to know anything about intermediate values.
18:02:12 <ais523> this makes it hard to generate visitors from them because you can't generate the list of events "start x, start y, end y, end x" from a final encoding with methods for x and y when using pure call-by-value, unless you convert to an initial encoding as a temporary
18:04:28 <korvo> Right, you can only generate the applicative trees on the final algebra. Since the starting and ending actions are part of the metatheory, they aren't visible to the encoding.
18:05:26 <ais523> now I'm thinking about performance
18:05:52 <ais523> suppose I want to write a program whose input is source code in some language, and whose output is the code's parse tree in XML
18:06:00 <esolangs> [[F calculus]] https://esolangs.org/w/index.php?diff=166454&oldid=166317 * C++DSUCKER * (+62)
18:06:01 <ais523> with a visitor, this is trivial to write
18:06:08 <ais523> with an initial encoding, this is just a recursive tree walk
18:06:21 <esolangs> [[F calculus]] M https://esolangs.org/w/index.php?diff=166455&oldid=166454 * C++DSUCKER * (-11)
18:06:22 <ais523> with a final encoding, there's an obvious way to write it but it has O(n²) performance
18:06:35 <esolangs> [[F calculus]] https://esolangs.org/w/index.php?diff=166456&oldid=166455 * C++DSUCKER * (+1)
18:07:48 <korvo> What's the big difference? In e.g. Python, we could imagine that an initial emitter for XML is like xmlelement.MakeElement(tag, attrs) while a final emitter is like lambda xml: xml.makeElement(tag, attrs)
18:08:15 <ais523> korvo: I mean, outputting the XML as text
18:08:20 <ais523> with an initial encoding you can stream it
18:08:44 <ais523> with a final encoding you're appending and prepending, which is slow to do repeatedly using most string types
18:10:18 <korvo> Sorry, I think I'm too far up the mountain. I'll try to climb down carefully. If the input is a tree and the output is a tree then the transformation is a hylomorphism, and we can decompose that into a katamorphism and anamorphism: we walk the input tree and build an intermediate structure in memory, we consume the intermediate structure to emit pieces of output tree.
18:12:20 <korvo> The initial encoding just looks like a heap-allocated AST, while the final encoding looks like a bunch of stack records and calls.
18:16:00 <esolangs> [[Adofaiscript]] https://esolangs.org/w/index.php?diff=166457&oldid=166365 * * (+533) /* Pattern-signal */ Added more patterns
18:17:30 <esolangs> [[User:]] https://esolangs.org/w/index.php?diff=166458&oldid=147377 * * (+98)
18:19:01 <korvo> ais523: Oh! I see what you're saying. You're saying that *my specific technique* in https://github.com/rpypkgs/rpypkgs/blob/6aebcb5b16de8d6572a5d263647dfd0b334dcc0c/bf/bf.py#L39-L47 is quadratic-time due to strings. Yeah, it would be if RPython didn't optimize that common case. When I do this in Cammy, I pass a list instead, using the string-builder pattern; RPython also has a StringBuilder helper.
18:20:38 <korvo> Or, if I wanted to be less pure, I could write e.g. def join(self, l, r): print l; print r;; def loop(self, bfs): print '['; print bfs; print ']'
18:21:11 <korvo> Appending to my buffer is quadratic. Appending to Somebody Else's Buffer is linear. Our machine models are cracked~
18:22:07 <ais523> korvo: not just you, other people have made that mistake too
18:23:37 <ais523> e.g. the «def join(self, l, r): print l; print r;; def loop(self, bfs): print '['; print bfs; print ']'» version is, when call-by-value, either quadratic or doesn't work (because the loop body either has to be printed before the loop itself, or has to be made into a string so that it can be printed after the [ of the starting loop)
18:24:13 <ais523> to make it work you have to create an initial encoding as a temporary
18:24:28 <b_jonas> ais523: you can do it in linear time though, it's just a big ugly process in two or three passes. first you create a tree of string snippets that you want to concatenate, creating a tree node instead of catenating the strings. then you do iterate on the leaves of the tree to make a flat list of those strings, then you join the strings in that list. this last sentence can be either one or two pass.
18:25:01 <ais523> b_jonas: oh yes, but that's basically the initial-encoding-as-temporary approach
18:25:42 <ais523> my usual way to do it is to use reverse-Polish as an intermediary, which a final encoding can generate efficiently without actually returning any values
18:26:53 <esolangs> [[Crypten]] N https://esolangs.org/w/index.php?oldid=166459 * * (+853) Started the page
18:27:47 <esolangs> [[Crypten]] https://esolangs.org/w/index.php?diff=166460&oldid=166459 * * (+72)
18:30:10 <korvo> ais523: That precise issue is fixed with an intermediate lambda-binding. No flavor of Python will let me do it easily, though; it will always look like an initial encoding because there's an explicit allocation. In Scheme the lambda would just go on the stack with all the other activated lambdas.
18:30:34 <korvo> Oleg has words about this; it bites him in SML too.
18:31:01 <ais523> yes, you can return closures/thunks and make it work that way
18:31:29 <b_jonas> yeha, that works too, it's just not my usual style
18:31:33 <ais523> (although the implicit allocation that that needs still bothers me, it's O(n) now but the constant factors are bad)
18:32:03 <korvo> Also, I'm not some sort of purist. Cammy's "kamis" solver uses plain strings as initial encoding and is constantly building new strings by concatenation; it turns out to be easier to let genes be strings and do recombination with string operations than to try to preserve type information and do well-typed recombination.
18:33:00 <esolangs> [[EarScript]] N https://esolangs.org/w/index.php?oldid=166461 * Agecaf * (+12957) EarScript is a programming language focused on the manipulation of integers.
18:34:14 <ais523> now I'm wondering what the best practical performance you can get for a model where you can create immutable strings, and concatenate them without losing access to the original
18:34:47 <ais523> or, indeed, just start with a set of strings representing characters, and concatenate them
18:34:57 <b_jonas> I mean general closures are nice to have, but in practical non-esoteric code, almost all the times when I write a closure, it's just the kind that refers to still active stack frames and thus don't survive the context that created them
18:34:59 <ais523> there is an obvious O(1) approach but the constant factors are terrible
18:35:00 <korvo> Rope, O(n log n), don't overthink it. RPython folks did a bunch of experiments and plain old rope ended up being the best by far.
18:35:25 <ais523> it maybe that O(n) or O(n log n) approaches are better in practice
18:35:52 <korvo> b_jonas: Yeah. And in final encodings it's especially annoying because I really just want a reader-monad transformation that attaches some sort of context, or a state-monad transformation that will thread a state through the control flow, for precisely the reasons ais523 has given.
18:36:00 <esolangs> [[Language list]] https://esolangs.org/w/index.php?diff=166462&oldid=166312 * Agecaf * (+16)
18:37:31 <korvo> (There's also a writer-monad transformation that collects results into a monoid, but that just kicks the can: how do we have an efficient list? Difference lists are what we've been talking about, and they require lots of heap allocations; so much for sticking to stack!)
18:39:18 <b_jonas> as for the string concatenation thing, when the concatenated string is long then I most likely don't actually construct the string, rather I print it streaming from the structured representation, and it's the structured representation that contains all the chunks of the string that I have in memory. I admit I haven't written a fully recursive one of these for a long time (unless you count
18:39:24 <b_jonas> read-modify-write with an existing XML or JSON library), only ones with limited depth, but I think this applies to recursive too.
18:41:11 <korvo> There is the related problem of making efficient text transducers, which are generic functions with type (String -> String) -> (String -> String). Most of the standard list- and string-manipulation tools are liftable to transducers, so it'd be nice to have a unifying theory of them, but they seem to be quite opaque in general.
18:41:43 <ais523> oh right, there's an alternative approach which involves running the parser twice, once to work out where in the output the output generated by each nonterminal of input goes, then once to write it
18:41:53 <ais523> this is probably slower but it's interesting that it exists
18:42:04 <ais523> it might be faster if the allocator is slow
18:44:59 <esolangs> [[EarScript]] M https://esolangs.org/w/index.php?diff=166463&oldid=166461 * Agecaf * (+184) Added categories
19:04:41 <b_jonas> hehe, I actually had a program (now unmaintained) that ran the same parser twice on the same input, but not for the reason that you mention, because the file that it parses is easier to parse with no deep recursion and prefix notation everywhere
19:04:50 <b_jonas> s/and prefix/and with prefix/
19:05:30 <b_jonas> (that's because I chose the format of the file parsed and I wrote the program that writes it, so obviously I made it easy to parse)
19:05:56 <esolangs> [[EarScript]] https://esolangs.org/w/index.php?diff=166464&oldid=166463 * Agecaf * (+0) Corrected a to b
19:07:32 <esolangs> [[EarScript]] M https://esolangs.org/w/index.php?diff=166465&oldid=166464 * Agecaf * (-1) /* Description */
19:19:23 <esolangs> [[User:Ivava]] https://esolangs.org/w/index.php?diff=166466&oldid=166332 * Ivava * (+14) /* Esolangs list */
19:44:19 -!- Everything has quit (Ping timeout: 255 seconds).
20:27:15 -!- vista_user has joined.
20:27:22 -!- vista_user has changed hostmask to ~vista_use@user/DOS-User:11249.
20:29:20 -!- vista_user has quit (Remote host closed the connection).
20:43:48 <esolangs> [[Monte]] https://esolangs.org/w/index.php?diff=166467&oldid=140192 * Corbin * (+154) /* Running Monte */ I fixed the flake's compatibility with nix-run and now the REPL can be directly loaded from The Cloud.
21:41:20 <zzo38> Now I made ASN.1 DER parser in PostScript, too. (Encoding is not implemented yet)
21:56:53 -!- tromp has quit (Quit: My iMac has gone to sleep. ZZZzzz…).
22:01:30 <zzo38> (I also wrote JSON parser in PostScript, but my opinion is that DER is generally better format than JSON, even though many people prefer to use JSON or one of its variants (which help a little bit but not much, and sometimes add additional things that are worse).)
22:08:26 -!- Sgeo has joined.