←2020-07-31 2020-08-01 2020-08-02→ ↑2020 ↑all
00:00:13 -!- sprocklem has joined.
00:05:33 -!- xelxebar has joined.
00:07:13 -!- Arcorann has joined.
00:12:13 -!- adu has joined.
01:04:44 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76360&oldid=76326 * RocketRace * (+27) wording
01:27:46 <esowiki> [[Subreal]] https://esolangs.org/w/index.php?diff=76361&oldid=76360 * RocketRace * (+1036) Document subfinite loops
01:28:46 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76362&oldid=76361 * RocketRace * (-243) /* Subfinite loops */
01:30:00 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76363&oldid=76362 * RocketRace * (+0) Change the . instruction to reduce ambiguity for parsing
01:32:38 <adu> if you were to give a different name to 2 KiB, what would it be?
01:33:23 <esowiki> [[Subreal]] https://esolangs.org/w/index.php?diff=76364&oldid=76363 * RocketRace * (+133) Make subfinite loops deterministic; otherwise they are not possible to implement
01:41:35 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76365&oldid=76364 * RocketRace * (+106) Empty pops
01:45:45 <esowiki> [[Subreal]] https://esolangs.org/w/index.php?diff=76366&oldid=76365 * RocketRace * (+76) The ~ instruction
01:49:29 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76367&oldid=76366 * RocketRace * (+136) Document the binding strength of + and - in literals and instructions
01:49:41 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76368&oldid=76367 * RocketRace * (+0) -
01:56:04 -!- Sgeo has quit (Read error: Connection reset by peer).
01:56:43 -!- Sgeo has joined.
02:01:00 <shachaf> So in gcc, "int foo(void) { int i = 0; void bar(int d) { i += d }; bar(1); return i; }" does not make your stack executable, apparently.
02:01:29 <shachaf> But "int foo(void) { int i = 0; void bar(int d) { i += d }; void (*f)(int) = bar; f(1); return i; }" does.
02:05:07 -!- Phantom__Hoover has joined.
02:14:42 -!- Phantom__Hoover has quit (Ping timeout: 265 seconds).
02:20:35 -!- aaaaaa has joined.
02:24:06 <esowiki> [[Subreal]] https://esolangs.org/w/index.php?diff=76369&oldid=76368 * RocketRace * (+402) Computational class
02:24:30 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76370&oldid=76369 * RocketRace * (+6) Categorization.
02:25:38 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76371&oldid=76370 * RocketRace * (+0) Red links?!
02:27:31 <esowiki> [[Subreal]] M https://esolangs.org/w/index.php?diff=76372&oldid=76371 * RocketRace * (-9) No longer a stub.
02:57:13 <esowiki> [[WCDA]] https://esolangs.org/w/index.php?diff=76373&oldid=68642 * SoundOfScripting * (-691) Some changes, more to come.
03:00:44 -!- tromp has joined.
03:01:11 <zzo38> I suppose that the compiler can optimize it, although the second case could be possible to be optimized too (even if it currently doesn't), but can "volatile" be added?
03:03:29 -!- aaaaaa has left.
03:05:39 -!- tromp has quit (Ping timeout: 272 seconds).
03:18:05 -!- craigo has quit (Ping timeout: 240 seconds).
03:43:30 -!- Lord_of_Life_ has joined.
03:45:25 -!- Lord_of_Life has quit (Ping timeout: 240 seconds).
03:45:25 -!- Lord_of_Life_ has changed nick to Lord_of_Life.
04:20:33 -!- craigo has joined.
04:22:05 -!- Sgeo has quit (Read error: Connection reset by peer).
04:23:09 -!- Sgeo has joined.
04:49:04 -!- tromp has joined.
04:53:57 -!- tromp has quit (Ping timeout: 272 seconds).
04:54:58 -!- Sgeo has quit (Read error: Connection reset by peer).
04:56:13 -!- Sgeo has joined.
05:12:08 <shachaf> https://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudocode looks way too complicated. Why does it have two nested loops? Is that necessary somehow? My parser only has one loop.
05:23:14 <shachaf> I think the answer is that someone put up that code on Wikipedia in 2006 and it just stayed there since then, and I shouldn't go to Wikipedia for algorithms.
05:28:29 <shachaf> Or maybe it's to limit the stack depth?
05:33:20 <Arcorann> Did anyone mention it on the talk page?
05:38:40 <zzo38> Sometimes the first six astrological signs are designated as "learn" and the other six as "share", but I think would be better "northern signs" and "southern signs", since, the first six signs are north of the equator, and last six signs are south of the equator. (As can be seen on the map, the "Tropic of Cancer" and "Tropic of Capricorn".)
05:41:24 <shachaf> Oh, I do see someone making the exact complaint in the talk page, I missed it at first.
05:43:04 -!- tromp has joined.
05:43:44 -!- Sgeo has quit (Read error: Connection reset by peer).
05:44:07 <shachaf> I think I see why they do this now, but it doesn't seem like a great explanation.
05:45:19 -!- Sgeo has joined.
05:48:25 -!- tromp has quit (Ping timeout: 272 seconds).
06:02:05 -!- imode has quit (Ping timeout: 240 seconds).
06:15:53 -!- adu has quit (Quit: adu).
06:37:14 -!- tromp has joined.
06:38:05 -!- TheLie has joined.
06:41:26 -!- tromp has quit (Ping timeout: 244 seconds).
06:41:55 -!- craigo has quit (Ping timeout: 246 seconds).
06:48:38 -!- tromp has joined.
06:55:59 -!- kritixilithos has joined.
07:17:50 <esowiki> [[Special:Log/newusers]] create * Nezbednik * New user account
07:23:50 <esowiki> [[Esolang:Introduce yourself]] https://esolangs.org/w/index.php?diff=76374&oldid=76356 * Nezbednik * (+264)
07:35:52 -!- shinh has joined.
07:51:53 -!- hendursaga has quit (Remote host closed the connection).
07:52:53 -!- hendursaga has joined.
08:08:21 -!- hendursa1 has joined.
08:10:23 -!- hendursaga has quit (Ping timeout: 240 seconds).
08:10:40 <esowiki> [[1+/Snippets]] https://esolangs.org/w/index.php?diff=76375&oldid=76198 * TwilightSparkle * (+127) /* Medium */
09:22:08 -!- LKoen has joined.
09:22:47 <esowiki> [[Math&Matrix]] https://esolangs.org/w/index.php?diff=76376&oldid=76355 * FLeckami21 * (+742)
09:37:43 <esowiki> [[Math&Matrix]] https://esolangs.org/w/index.php?diff=76377&oldid=76376 * FLeckami21 * (-87) /* Matrix form */
09:44:36 -!- sebbu has quit (Quit: reboot).
09:45:45 <esowiki> [[Babalang]] M https://esolangs.org/w/index.php?diff=76378&oldid=76310 * FLeckami21 * (+18) Add Babalang into 2020 category
09:45:57 -!- TheLie has quit (Remote host closed the connection).
09:57:12 -!- Sgeo has quit (Read error: Connection reset by peer).
10:20:04 -!- sebbu has joined.
10:58:04 -!- craigo has joined.
11:12:28 <esowiki> [[1+/Snippets]] https://esolangs.org/w/index.php?diff=76379&oldid=76375 * TwilightSparkle * (+314) /* Hard */
11:26:16 <b_jonas> shachaf: how does that thing with gcc-style local function definitions even compile without the auto keyword?
11:27:01 <shachaf> Why would auto do anything? Where?
11:27:05 <b_jonas> adu: halfpage
11:27:34 <b_jonas> or maybe you need auto only to declare a local function before defining it?
11:27:38 <b_jonas> let me check the manual
11:27:52 <b_jonas> I never use gcc local functions
11:29:13 <shachaf> Neither do I.
11:29:30 <shachaf> I saw someone suggesting to use them and I was all, like, whoa, dude, that'll make your stack executable (if you know what I mean).
11:29:35 <b_jonas> https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Nested-Functions.html#Nested-Functions sorry, you only need the auto to declare a nested function early
11:30:09 <shachaf> I wonder whether I should get in the habit of always declaring my functions extern or static.
11:33:04 <shachaf> I'm reading BCPL compiler source code.
11:33:32 <shachaf> What was the first context of the style of precedence parser called "precedence climbing" or "Pratt-style" or various other names?
11:35:18 <esowiki> [[Unleash]] https://esolangs.org/w/index.php?diff=76380&oldid=76358 * Hakerh400 * (+231) Add a new example and fix instruction description
12:05:25 <esowiki> [[Unleash]] https://esolangs.org/w/index.php?diff=76381&oldid=76380 * Hakerh400 * (+267) Another example
12:07:37 <esowiki> [[Unleash]] M https://esolangs.org/w/index.php?diff=76382&oldid=76381 * Hakerh400 * (-6)
12:22:23 -!- kritixilithos has quit (Ping timeout: 240 seconds).
12:46:57 <esowiki> [[1+/Snippets]] https://esolangs.org/w/index.php?diff=76383&oldid=76379 * D * (+212) /* Legendary */
12:47:08 <esowiki> [[1+/Snippets]] https://esolangs.org/w/index.php?diff=76384&oldid=76383 * D * (-1) /* COME BACK LYXAL!!! */
12:47:42 -!- TheLie has joined.
13:16:16 -!- Phantom__Hoover has joined.
13:26:02 -!- hendursa1 has quit (Quit: hendursa1).
13:26:21 -!- hendursaga has joined.
13:44:56 -!- TheLie has quit (Remote host closed the connection).
14:25:03 -!- kritixilithos has joined.
15:10:58 -!- LKoen has quit (Remote host closed the connection).
15:11:01 -!- Arcorann has quit (Read error: Connection reset by peer).
15:13:28 -!- LKoen has joined.
15:43:06 -!- Lord_of_Life_ has joined.
15:46:05 -!- Lord_of_Life has quit (Ping timeout: 240 seconds).
15:46:14 -!- Lord_of_Life_ has changed nick to Lord_of_Life.
15:47:16 <shachaf> Oh, the B language supported single-statement functions without curly braces.
15:47:38 <shachaf> The manual gives this example: "char(s,n) return((s[n/4]>>(27-9*(n%4)))&0777);"
15:48:03 <myname> i hate that in "if" already
15:49:32 <int-e> ... that example
15:54:48 <shachaf> It's an untyped language.
15:55:28 <shachaf> I like how it uses "x =- y;" instead of "x -= y;"
15:56:03 <myname> that's confusing
15:56:26 <myname> do x = -y and x =- y behave differently?
15:56:36 <shachaf> Yes.
15:56:41 <myname> ew
15:56:49 <shachaf> Oh man, extern variables are declared with "extrn".
15:56:57 <shachaf> C is positively luxurious with its vowels.
15:57:05 <myname> gotta save those bytes
15:57:20 <b_jonas> shachaf: if it's an untyped language, why does it have functions that return char?
15:57:26 <b_jonas> or is char the function name?
15:57:31 <myname> its the name
15:57:32 <shachaf> char is the function name.
15:57:34 <b_jonas> ah
15:57:36 <myname> the function is not anonymous
15:57:45 <shachaf> https://www.bell-labs.com/usr/dmr/www/btut.html
15:58:51 <b_jonas> if you want a typeless compiled language that uses even less vowels, look at Viktor Toth's W language (I think there's a wiki entry)
15:59:02 <shachaf> Strings are terminated by ASCII EOT (U+0003)? Exciting.
15:59:12 <b_jonas> nopw, no wiki entry
15:59:34 <b_jonas> www.vttoth.com/w.htm then
16:00:30 <myname> links without protocols make my terminal sad
16:01:40 <shachaf> This manual has a section called "Function nesting".
16:01:59 <shachaf> I thought it'd be some fancy feature that C doesn't have. But it turns out they mean you can write things like putchar(getchar()).
16:02:28 <shachaf> Which, to be fair, the idea of expressions is one of the major features of high-level languages!
16:02:46 <myname> well, but it has to be supported by the compiler
16:03:41 <myname> "W may be elegant but it's also practical."
16:04:06 <myname> "i am intelligent as well as humble"
16:13:05 <Taneb> Are there any programming languages based on string diagrams?
16:13:46 <b_jonas> I disagree with that C is luxurious with vowels: strcpy, strcmp, strncmp, strchr, strspn, tmpnam, SIGABRT, SIGCHLD/SIGCLD, SIGTSTP, SIGPWR, BUFSIZ, ESRCH, SHRT_MAX, FLT_MAX, mknod, and the most infamous examples creat
16:14:39 <shachaf> Well, most of those are library features rather than keywords.
16:14:57 <b_jonas> yes, they all are
16:15:10 <shachaf> But the joke I was going for was that C is known not to be luxurious with its vowels. So it's funny for B to be even more so.
16:15:12 <b_jonas> but most of them are from K&R
16:15:20 <b_jonas> ah I see
16:15:28 <shachaf> Even less so?
16:15:34 <myname> Taneb: what do you consider a string diagram?
16:15:34 <shachaf> Taneb: Do you count languages that use index notation?
16:15:53 <shachaf> I think it's possible to argue for Prolog here, though it's a bit of a stretch.
16:16:44 <b_jonas> oh, and there's sbrk
16:17:10 <b_jonas> luckily we're rid of creat now, instead we have a versatile vararg function
16:20:42 <fizzie> statc cnst extrn dbl x; // please ignore mixing static and extern in the same declaration
16:21:52 <shachaf> Should I write "int const x;" instead of "const int x;"?
16:21:58 <shachaf> I mean, actually.
16:22:15 <b_jonas> it's beautiful by the way, in unix, the creat function is obsolete, you create or open files with open; in winapi, the OpenFile function is obsolete, and you create or open files with CreateFile
16:22:19 <shachaf> It is more cosistent with "int const *const p;", for example.
16:22:38 <fizzie> That consistency was why I was typing up "maybe".
16:23:04 <b_jonas> shachaf: I think the FAQ answer to that is "it doesn't matter, do whatever you want", same as with `char *x` versus `char* x`
16:23:20 <shachaf> No, "char *x" is clearly better, because it follows the grammar of the language.
16:23:30 <b_jonas> I always write `const int x;` and `char *x` these days, but it's your preference
16:23:35 <shachaf> Just like "sizeof x" is better than "sizeof(x)"
16:23:50 <shachaf> Of course it's fine to have preferences, but that doesn't mean all preferences are equal.
16:24:00 <b_jonas> shachaf: those are not the same though
16:24:11 <b_jonas> `sizeof x` versus `sizeof(x)`
16:24:13 <HackEso> sizeof? No such file or directory
16:24:17 <b_jonas> I think
16:24:20 <shachaf> Yes. For types I write "sizeof (T)"
16:24:20 -!- craigo has quit (Ping timeout: 256 seconds).
16:24:27 <fizzie> Just don't write `int static x;`, because "the placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature" (C11 6.11.5p1).
16:24:29 <shachaf> Anyway, "should I prefer X to Y" can still have a useful answer.
16:24:47 <shachaf> fizzie: I'm pretty irritated that gcc warns about "struct Foo { ... } typedef Foo;"
16:24:57 <int-e> I'd think that you only have to write char* x, y; once and get confused before you switch to char *x, *y; forever ;)
16:24:59 <shachaf> I used to write all my struct typedefs like that.
16:25:25 <fizzie> Since typedef is a storage-class specifier, I think that's an obsolescent feature too.
16:25:33 <shachaf> It sure is.
16:25:42 <shachaf> What a great storage class.
16:26:01 <b_jonas> I can only say my preferences. I write `char *x;` and `const int x;` and `char *
16:26:10 <b_jonas> f(char *)
16:26:11 <b_jonas> {`
16:26:40 <myname> i prefer not to write c
16:26:55 <shachaf> Hmm, but C seems like a big upgrade over B.
16:26:57 <b_jonas> myname: no no, I write these in C++
16:27:04 <shachaf> So your suggestion of writing B instead doesn't sound right.
16:27:12 <myname> b_jonas: okay, in that case, i _would_ prefer writing c
16:28:16 <b_jonas> shachaf: yes, that's because an angel visited K&R and told them about the original language used in heaven that would inspire C, and K&R remembered that and became prophets and copied as much of that language as they could remember in C. it's not a perfect copy, but they got a lot of good features from that.
16:32:21 <int-e> b_jonas: does the story continue with Stroustrup getting a visit from the devil?
16:32:49 <int-e> ...it would explain a lot...
16:33:00 <Taneb> I think the string diagrams that I was thinking of is also called Penrose notation
16:33:42 <shachaf> Oh, this is pretty good.
16:33:43 <int-e> Taneb: what about cat's cradle
16:33:49 <shachaf> All error messages are two characters long.
16:33:56 <int-e> ?
16:34:03 <int-e> (that was my `ed` impression)
16:34:04 <shachaf> In B.
16:34:11 <b_jonas> int-e: I don't know
16:34:12 <shachaf> Ah.
16:34:37 <shachaf> Taneb: Penrose's paper that talks about those diagrams also talks about abstract index notation.
16:34:42 <shachaf> (And introduced both, maybe?)
16:34:48 <shachaf> It's good, I like that paper.
16:36:48 <shachaf> Anyway, I think you can argue that something like Prolog counts.
16:43:58 -!- atslash has quit (Quit: Leaving).
16:46:28 -!- imode has joined.
16:59:44 <shachaf> Ah, right, they recommend making the first six characters of function and extern variable names unique.
16:59:48 <shachaf> Good reason for the economy.
17:01:33 <b_jonas> shachaf: that's because of ancient linkers. C also recommends that. even seebs' IAQ references that.
17:01:49 <shachaf> Right, I remember seeing that before.
17:02:46 <b_jonas> https://www.seebs.net/faqs/c-iaq.html#question-10.8\
17:02:50 <b_jonas> argh
17:02:51 <b_jonas> https://www.seebs.net/faqs/c-iaq.html#question-10.8
17:04:06 <b_jonas> that's why the C threading and thread synchronization functions (which nobody uses, because we already had pthreads, windows threads API, a pthreads compatibility layer for the windows threads API, boost threads, and eventually also the C++ threads library) have such silly names
17:07:47 <shachaf> The best thread API is Linux clone(2)
17:08:03 <shachaf> It is so good that you can only call the system call from assembly, not from C using the syscall wrapper.
17:08:14 <myname> what
17:08:18 <b_jonas> that's one of the low-level calls that implement pthread functinos
17:08:35 <b_jonas> I'd never call it directly
17:08:42 <b_jonas> well, not for threading
17:08:46 <b_jonas> for namespaces, sure
17:09:00 <shachaf> What if you aren't using libc?
17:09:07 <b_jonas> pthreads is done quite well, there's no need to use the low-level stuff
17:09:26 <b_jonas> shachaf: do you mean no libc on linux, or no libc on windows?
17:09:37 <shachaf> On Linux.
17:09:48 <shachaf> On Windows you'd use the Window thread API either way presumably.
17:09:54 <b_jonas> I don't think I ever do that. that's for esoteric stuff only.
17:10:07 <b_jonas> no, on windows I'd use one of the wrappers that I mentioned above
17:10:23 <shachaf> It is called CreateThread. The OpenThread API is deprecated, whereas in Unix the situation is reversed.
17:10:33 <shachaf> Hmm, avoiding libc doesn't seem that esoteric to me.
17:10:50 <shachaf> Compiling programs for Linux that are backward compatible is already a pain.
17:12:20 <b_jonas> maybe not esoteric, but then it's not really useful for the programs that I want to write
17:12:37 <b_jonas> for linux, again
17:12:46 <b_jonas> linux userspace
17:13:32 <shachaf> Usually the glibc wrappers around Linux system calls are worse APIs than the system calls themselves.
17:13:42 <shachaf> clone is an exception, I suppose.
17:14:01 <b_jonas> yes, but pthreads is rather carefully designed
17:14:14 <b_jonas> it has all sorts of limitations to not add overheads for features that you don't use
17:14:20 <b_jonas> well, that's the theory
17:14:23 <shachaf> (The reason you can't use clone to create threads yourself is that it returns twice in the same thread, but in the same address space, so you don't want both threads to continue executing and using the stack.)
17:16:04 <b_jonas> shachaf: that's why you also can't use vfork, right?
17:16:33 <shachaf> I think you're allowed to use vfork and use the stack.
17:17:22 <b_jonas> in both children?
17:17:23 <shachaf> The original process is suspended until you exec, so modifying unused stack memory is not so bad.
17:17:45 <shachaf> You just can't modify anything else.
17:17:55 <b_jonas> ah
17:18:00 <b_jonas> well I dunno how these things work tehn
17:18:14 <shachaf> Hmm, maybe I should use vfork more.
17:18:51 <shachaf> Oh, posix_spawn, which I use when possible, uses clone(CLONE_VFORK) on glibc.
17:18:58 <shachaf> So it's not so bad.
17:19:09 <b_jonas> is it actualyl guaranteed that it stays stopped, as opposed to that being just an optimization that happens in the common case, but not always happening?
17:19:13 <shachaf> Too bad fork/vfork/clone is a silly API.
17:19:33 <shachaf> Guaranteed by what?
17:19:38 <b_jonas> the kernel
17:19:59 <b_jonas> posix_spawn is implemented by glibc, it can do all sorts of ugly stuff that I don't want to see.
17:20:19 <shachaf> The parent thread is suspended according to the man page.
17:20:36 <shachaf> Other threads may continue to run.
17:20:40 <b_jonas> yes, but does it remain suspended?
17:20:59 <shachaf> "vfork() differs from fork(2) in that the calling thread is suspended until the child terminates (either normally, by calling _exit(2), or abnormally, after delivery of a fatal signal), or it makes a call to execve(2)."
17:22:07 <b_jonas> I thought there was like a 30 year old email where Linus threatens everyone that if they abuse vfork, he'll make it a synonym of fork, and I think that's still canon, in that if a future kernel does that, you keep the pieces
17:22:33 <b_jonas> oh right, if that happens, the two children have a stack each
17:22:35 <b_jonas> sorry
17:23:15 <shachaf> Yes, vfork is very restricted in what it can do. fork would be a valid implementation.
17:23:31 <shachaf> I wrote this wrapper around posix_spawn: https://slbkbs.org/tmp/dspawn.h
17:24:15 <shachaf> But then I never ended up using it.
17:32:02 <zzo38> I don't like vfork() and had idea implementing cfork() instead, which is different in some ways, such as registers being shared too; in this case it is possible for execve to return 0 if it is successful
17:36:38 <shachaf> My preference would be to abandon fork entirely. It's mostly silly.
17:36:50 <shachaf> Instead, have system calls to create threads or processes directly.
17:37:12 <shachaf> One way to get the benefits of fork would be to allow some system calls to affect other processes.
17:37:46 -!- Sgeo has joined.
17:37:54 <shachaf> So you could create a blank process, and then tell it to open, dup2, etc., and then to execve.
17:40:22 <shachaf> Being able to call e.g. mmap in another process's address space would also be useful for debuggers.
17:40:39 <shachaf> Windows's VirtualAllocEx takes a process handle argument.
17:42:44 <myname> being able to call mmap on another process's address space would be useful for attacking software
17:46:18 <esowiki> [[Special:Log/newusers]] create * Abbin21 * New user account
17:52:42 <esowiki> [[Esolang:Introduce yourself]] M https://esolangs.org/w/index.php?diff=76385&oldid=76374 * Abbin21 * (+296) /* Introductions */
18:31:02 -!- ineiros has quit (Ping timeout: 265 seconds).
18:37:25 -!- Phantom__Hoover has quit (Ping timeout: 240 seconds).
18:42:13 -!- kritixilithos has quit (Quit: quit).
19:07:27 -!- Phantom__Hoover has joined.
19:13:14 -!- craigo has joined.
19:31:24 <zzo38> Won't that make the interface for open/dup2/etc complicated though?
20:41:36 <esowiki> [[Casini]] N https://esolangs.org/w/index.php?oldid=76386 * Abbin21 * (+1902) Created page with "== Operators and INTs == There are four operators in casinii, which are represented by the four colors of playing cards. <pre> /\ | /\/\ | o | /\ \/ | \ / | o|o | / \..."
20:42:13 <esowiki> [[Casini]] https://esolangs.org/w/index.php?diff=76387&oldid=76386 * Abbin21 * (-1)
20:50:08 -!- tromp has quit (Remote host closed the connection).
21:02:11 -!- adu has joined.
21:02:13 <shachaf> zzo38: Well, maybe you can have a "run system call in child" interface, though you probably want to limit it.
21:10:16 <b_jonas> but then you also want to check the error that the system call returns
21:10:30 <b_jonas> so eventually it's easier to just have fork than to have some insane interface
21:15:30 <zzo38> Yes, it is what I think my "cfork" would be better. For compatibility with other programs, you can also define the macro: #define fork() (cfork()?:detach())
21:15:50 -!- craigo has quit (Quit: Leaving).
21:21:24 -!- craigo has joined.
21:24:22 -!- tromp has joined.
21:31:42 <shachaf> b_jonas: If you fork you still have to check the error.
21:32:05 <b_jonas> shachaf: yes, but then you can, because you still have a program running
21:32:06 -!- adu has quit (Quit: adu).
21:32:23 <b_jonas> you don't have to rewrite your normal ifs to some extra kernel interface that you have to learn
21:32:29 <b_jonas> you can just write normal code
21:35:41 <zzo38> Yes, if you fork, then you can check the error normally. However, the normal fork() function it is a bit difficult for the parent to detect errors in the child process, I think. So, fork is good, and for some purposes, cfork is a better alternative.
21:35:48 <shachaf> I don't follow.
21:36:12 <shachaf> Anyway, there are many options. posix_spawn lets you specify open/close/dup2 actions and doesn't even let you check for errors.
21:36:36 <shachaf> What is cfork?
21:36:47 <zzo38> I don't seem to have something called "posix_spawn" in my computer
21:38:03 <b_jonas> zzo38: posix_spawn is a windows thing, a crutch because they don't have a real fork, but gives a sort-of unix-like interface rather than a winapi interface
21:38:10 <shachaf> It is not a system call, just a POSIX API for running programs.
21:38:11 <b_jonas> (actually it also exists on linux)
21:38:54 <shachaf> posix_spawn is a Windows thing? I am skeptical.
21:39:43 <shachaf> Windows implemented fork in the kernel for WSL1.
21:40:54 <shachaf> https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf
21:41:47 <zzo38> Well cfork would be a bit like vfork, but improved; it returns either 0 to the child process, or -1 to the parent process in case it can't fork (it won't do both), and then exec or detach or _exit will return to the parent process (detach returns to both the child and parent process; exec and _exit return only to the parent process). Until the parent process resumes, the memory, registers, stack, etc are shared.
21:42:00 <zzo38> That is what it is. Can it be understand now?
21:42:35 <shachaf> What is the benefit of allowing detach?
21:42:39 <zzo38> (You can then also see why fork() is the same as (cfork()?:detach()); this also explains the return value of detach(). I can also provide other example if wanted.)
21:42:45 <shachaf> It seems like it'd make the implementation a good deal more complicated.
21:45:02 <zzo38> Well, since some programs may use fork(), and in some cases it is more useful than cfork(), too; maybe you might also want to change other things before detaching (or to more easily report some things from initialization to the parent before detaching).
21:45:35 <zzo38> So, that is why, instead of a fork() system call, it is just implemented as (cfork()?:detach()) instead.
21:56:14 <esowiki> [[Casini]] https://esolangs.org/w/index.php?diff=76388&oldid=76387 * Abbin21 * (+59)
21:57:04 <esowiki> [[Casini]] M https://esolangs.org/w/index.php?diff=76389&oldid=76388 * Abbin21 * (+62)
21:57:18 -!- 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:38:58 -!- tromp has quit (Remote host closed the connection).
22:39:14 -!- tromp has joined.
22:57:07 -!- tromp has quit (Remote host closed the connection).
23:35:49 <esowiki> [[Talk:Casini]] N https://esolangs.org/w/index.php?oldid=76390 * Bangyen * (+225) Created page with "==Example== Wouldn't the example represent 54 + 9 * 54, since diamonds represent multiplication? If so, do operations in Casini follow BEMDAS? - ~~~~"
23:52:25 -!- Phantom__Hoover has quit (Ping timeout: 240 seconds).
23:52:29 -!- adu has joined.
←2020-07-31 2020-08-01 2020-08-02→ ↑2020 ↑all