< 1543363241 321689 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :O, I found a Python program at https://github.com/shmup/mtgsqlive which is made for converting Magic: the Gathering card data from JSON to SQLite and vice versa < 1543363265 814328 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :how old? does it work with the Scryfall format? < 1543363355 357956 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :It says MTGJSON format, although maybe it might be possible to modify to work with Scryfall format < 1543364576 124582 :Phantom_Hoover!~phantomho@unaffiliated/phantom-hoover QUIT :Read error: Connection reset by peer < 1543365167 302664 :Melvar!~melvar@dslb-002-203-049-190.002.203.pools.vodafone-ip.de QUIT :Ping timeout: 240 seconds < 1543367695 800764 :Sgeo!~Sgeo@ool-18b98dd9.dyn.optonline.net JOIN :#esoteric < 1543367784 412938 :Sgeo_!~Sgeo@ool-18b98dd9.dyn.optonline.net QUIT :Ping timeout: 250 seconds < 1543368030 826548 :imode!~imode@unaffiliated/imode JOIN :#esoteric < 1543368469 421010 :Melvar!~melvar@dslb-002-203-107-036.002.203.pools.vodafone-ip.de JOIN :#esoteric < 1543368712 440518 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :oren: I'm still not sure how that proposal works but I like it more now. < 1543369474 525554 :danieljabailey!~danieljab@cpc75709-york6-2-0-cust725.7-1.cable.virginm.net QUIT :Ping timeout: 250 seconds < 1543369766 716098 :imode!~imode@unaffiliated/imode QUIT :Ping timeout: 268 seconds < 1543370095 817900 :imode!~imode@unaffiliated/imode JOIN :#esoteric < 1543370410 773806 :imode!~imode@unaffiliated/imode QUIT :Ping timeout: 250 seconds < 1543371065 470987 :danieljabailey!~danieljab@cpc75709-york6-2-0-cust725.7-1.cable.virginm.net JOIN :#esoteric < 1543372622 329568 :ais523!~ais523@unaffiliated/ais523 QUIT :Quit: quit < 1543372750 550455 :Melvar!~melvar@dslb-002-203-107-036.002.203.pools.vodafone-ip.de QUIT :Ping timeout: 250 seconds < 1543372874 418248 :imode!~imode@unaffiliated/imode JOIN :#esoteric < 1543377600 802958 :Lord_of_Life!~Lord@unaffiliated/lord-of-life/x-0885362 QUIT :Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine < 1543380766 283906 :Melvar!~melvar@dslb-002-203-099-095.002.203.pools.vodafone-ip.de JOIN :#esoteric < 1543382793 608 :oerjan!oerjan@hagbart.nvg.ntnu.no JOIN :#esoteric < 1543383552 180051 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :One idea about UNIX kernels is adding a new kind of kill() function that requires a timestamp, and if the target process started after the specified time then it is an error and no signal is sent. < 1543384352 1899 :xkapastel!uid17782@gateway/web/irccloud.com/x-mockunexmonqerdp QUIT :Quit: Connection closed for inactivity < 1543387430 787226 :hexfive!~hexfive@50-46-223-124.evrt.wa.frontiernet.net JOIN :#esoteric < 1543392084 196112 :AnotherTest!~turingcom@ptr-82l26zf5tit6s260cpd.18120a2.ip6.access.telenet.be JOIN :#esoteric < 1543393118 414401 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net QUIT :Ping timeout: 244 seconds < 1543393916 557778 :izabera!~izabera@unaffiliated/izabera PRIVMSG #esoteric :interesting < 1543393959 857607 :izabera!~izabera@unaffiliated/izabera PRIVMSG #esoteric :i like the idea of making pid_t an always-increasing 64bit number < 1543393967 685658 :izabera!~izabera@unaffiliated/izabera PRIVMSG #esoteric :no pid reuse ever occurs < 1543394424 290856 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :pids are scow < 1543394598 34963 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :no way to avoid the race < 1543394825 289160 :izabera!~izabera@unaffiliated/izabera PRIVMSG #esoteric :what race? < 1543394955 69674 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Between getting a pid and killing it < 1543395113 126197 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :E.g. in Windows you get a handle to a process, which is more like a fd (I think?) < 1543395423 250783 :izabera!~izabera@unaffiliated/izabera PRIVMSG #esoteric :nonreusable pids would totally avoid any race < 1543395593 952070 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Sure < 1543396283 237769 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :yeah pids are annoying because in the time it takes to do 'ps', read the pid you need, and 'kill' it, the process could potentially end, and the pid could be reused < 1543396437 250195 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I mean, you potentially want to hold a pid for much longer than that. < 1543396452 723652 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :that too < 1543396539 830752 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :also, it's possible to mistype a pid and kill the wrong process, which is why I think there should be a more interactive tool for looking at and killing processes < 1543396569 140259 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :like if 'top' had a way to select a process and kill it < 1543396663 131795 :sftp!~sftp@unaffiliated/sftp QUIT :Excess Flood < 1543396688 176617 :sftp!~sftp@unaffiliated/sftp JOIN :#esoteric < 1543396790 327703 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :zzo38: oh, I've actually been asked about something like that, outside of #esoteric, as in, how to use a pid (in kill or otherwise) without accidentally targeting the wrong process < 1543396887 874891 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :izabera: sadly we can't just change pids to 64-bit, there are a lot of kernel-process abis that expect them to be 32-bit. the only thing we could do is add a second kind of pid and consistently call it a different name than pid. but there are like three dozen system calls and all of /proc that's based on pids, so that's not an easy change. < 1543396914 805237 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :or technically we could start a new architecture, but even then there'll be badly programs that use an int instead of a pid_t. < 1543396952 42454 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :unix is scow anyway < 1543396953 678061 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :scrap it < 1543396986 424562 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :oren: there's a little bit of protection top could do, but I don't know of a complete protection. let me check that old email where someone asked me this. < 1543397191 95013 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :I think, instead of a new pid, it might be easier to add new interfaces that allow you to do various process operations like kill, sigqueue, setpriority etc given a directory handle into /proc, sort of like the openat family of functions < 1543397876 336805 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :yup, we didn't find a good workaround < 1543397964 120032 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :I mean, we know some partial workarounds, but nothing that really guarantees to solve the problem in worst case when someone forks really quickly, the scheduler is against you, and you don't want potentially bad side effects < 1543398093 257811 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Is fork even a good API? Is it worth all the trouble? < 1543398103 382282 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :What's the benefit of it? < 1543398272 992665 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net JOIN :#esoteric < 1543399442 200140 :oerjan!oerjan@hagbart.nvg.ntnu.no PRIVMSG #esoteric :. o O ( sounds like a challenge, ms. ambrose ) < 1543400025 957826 :Taneb!~Taneb@2001:41c8:51:10d:aaaa:0:aaaa:0 PRIVMSG #esoteric :oerjan: dehydrated space rations are soemthing I could well concieve a michelin-starred restaurant serving < 1543400580 113623 :oerjan!oerjan@hagbart.nvg.ntnu.no PRIVMSG #esoteric :they'd just turn it into foam first < 1543400605 594892 :oerjan!oerjan@hagbart.nvg.ntnu.no PRIVMSG #esoteric :shave -> < 1543401362 679409 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net QUIT :Read error: Connection reset by peer < 1543401389 813673 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net JOIN :#esoteric < 1543401491 46837 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :shachaf: IMO it's worth, though some of its design has led to hard to track down bugs. look at the complicated structures that the Win32 API has to use to define all the state that the new process gets. < 1543401517 200868 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :shachaf: bugs for fork include accidentally ignored signals inherited by subprocesses, file descriptors leaked by multithread race conditions, etc. < 1543401582 323009 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu PRIVMSG #esoteric :but some of those aren't a problem with fork. file descriptors should have started out not inheritable *on exec* by default (which is what Win32 does; inheriting through fork is fine) < 1543402052 469434 :imode!~imode@unaffiliated/imode QUIT :Ping timeout: 250 seconds < 1543403128 431826 :rain1!~My_user_n@unaffiliated/rain1 QUIT :Ping timeout: 245 seconds < 1543403477 9966 :b_jonas!~x@catv-176-63-24-80.catv.broadband.hu QUIT :Quit: leaving < 1543404441 871209 :oerjan!oerjan@hagbart.nvg.ntnu.no PRIVMSG #esoteric :the last panel here is looking more and more like a chekhov's gun at this point http://www.girlgeniusonline.com/comic.php?date=20180326 < 1543404570 305582 :oerjan!oerjan@hagbart.nvg.ntnu.no PRIVMSG #esoteric :...and today mezzacotta loaded instantly for once. < 1543405416 920949 :xkapastel!uid17782@gateway/web/irccloud.com/x-ithmfrpvmmpejjfx JOIN :#esoteric < 1543405792 241727 :oerjan!oerjan@hagbart.nvg.ntnu.no QUIT :Quit: Later < 1543412140 343970 :sebbu2!~sebbu@unaffiliated/sebbu JOIN :#esoteric < 1543412361 901806 :sebbu!~sebbu@unaffiliated/sebbu QUIT :Ping timeout: 252 seconds < 1543417430 248486 :arseniiv!~arseniiv@95.105.12.19.dynamic.ufanet.ru JOIN :#esoteric < 1543417565 141183 :AnotherTest!~turingcom@ptr-82l26zf5tit6s260cpd.18120a2.ip6.access.telenet.be QUIT :Ping timeout: 268 seconds < 1543418366 957620 :AnotherTest!~turingcom@natx-145.kulnet.kuleuven.be JOIN :#esoteric < 1543421463 420606 :rain1!~My_user_n@unaffiliated/rain1 JOIN :#esoteric < 1543422549 414740 :imode!~imode@unaffiliated/imode JOIN :#esoteric < 1543424568 493643 :imode!~imode@unaffiliated/imode QUIT :Ping timeout: 250 seconds < 1543424647 316124 :nfd9001!~nfd9001@c-73-157-90-101.hsd1.wa.comcast.net QUIT :Ping timeout: 240 seconds < 1543424735 825521 :imode!~imode@unaffiliated/imode JOIN :#esoteric < 1543425629 965487 :AnotherTest!~turingcom@natx-145.kulnet.kuleuven.be QUIT :Ping timeout: 246 seconds < 1543426284 125236 :AnotherTest!~turingcom@ptr-82l26zf5tit6s260cpd.18120a2.ip6.access.telenet.be JOIN :#esoteric < 1543426563 368108 :sebbu2!~sebbu@unaffiliated/sebbu NICK :sebbu > 1543427266 619883 PRIVMSG #esoteric :14[[07Special:Log/newusers14]]4 create10 02 5* 03Abc123mewot 5* 10New user account < 1543428347 304239 :arseniiv!~arseniiv@95.105.12.19.dynamic.ufanet.ru QUIT :Quit: gone completely :o > 1543428720 90431 PRIVMSG #esoteric :14[[07Talk:Capuirequiem14]]4 10 02https://esolangs.org/w/index.php?diff=58509&oldid=9562 5* 03Nthern 5* (+212) 10/* Implementation Source */ new section < 1543429117 960261 :arseniiv!~arseniiv@95.105.12.19.dynamic.ufanet.ru JOIN :#esoteric < 1543429390 804356 :Essadon!~Essadon@81-225-32-185-no249.tbcn.telia.com JOIN :#esoteric < 1543432271 856254 :Phantom_Hoover!~phantomho@unaffiliated/phantom-hoover JOIN :#esoteric < 1543432858 898022 :sleepnap!~thomas@2603:3015:260e:1900::13ed JOIN :#esoteric > 1543434536 196880 PRIVMSG #esoteric :14[[07User:DMC14]]4 M10 02https://esolangs.org/w/index.php?diff=58510&oldid=58507 5* 03DMC 5* (+101) 10 < 1543435690 961742 :imode!~imode@unaffiliated/imode QUIT :Quit: WeeChat 2.3 < 1543436071 703193 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :Maybe one way is to reserve one process ID number for a timestamp PID, and one function takes a timestamp and PID and always returns the timestamp PID number; any call in the same thread which is using timestamp PID will use the remembered timestamp and PID. < 1543436104 782795 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :(This is not important for waitpid() which is only for child processes; it is used when you want to deal with processes other than child processes.) > 1543436294 987394 PRIVMSG #esoteric :14[[07User:DMC14]]4 M10 02https://esolangs.org/w/index.php?diff=58511&oldid=58510 5* 03DMC 5* (-6) 10 > 1543436342 697559 PRIVMSG #esoteric :14[[07User:DMC14]]4 M10 02https://esolangs.org/w/index.php?diff=58512&oldid=58511 5* 03DMC 5* (+10) 10 < 1543436346 969557 :imode!~imode@unaffiliated/imode JOIN :#esoteric < 1543436381 310415 :imode!~imode@unaffiliated/imode QUIT :Client Quit < 1543436445 755769 :imode!~imode@unaffiliated/imode JOIN :#esoteric < 1543436713 293607 :MDude!~MDude@71.50.218.48 QUIT :Quit: Going offline, see ya! (www.adiirc.com) < 1543436730 526570 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :I did think of using /proc too < 1543436805 302462 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :So, that is another possibility to do, using the functions like openat() and so on < 1543437205 813711 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :(If you use that then you can check the timestamps) < 1543438960 245166 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu JOIN :#esoteric < 1543439190 673562 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :b_jonas: fork also requires a complicated implementation with copy on write < 1543439200 255942 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :And it precludes or nearly precludes having a single address space < 1543439252 186655 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :b_jonas: It seems to me that maybe better APIs for operating on other processes would be better than the fork approach? < 1543439265 390835 :Lord_of_Life!~Lord@77.29.186.194 JOIN :#esoteric < 1543439265 499894 :Lord_of_Life!~Lord@77.29.186.194 QUIT :Changing host < 1543439265 499951 :Lord_of_Life!~Lord@unaffiliated/lord-of-life/x-0885362 JOIN :#esoteric < 1543439346 18720 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :There is vfork() but it is deprecated and the way of its working is different on different systems. < 1543439428 365711 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: so? we already need full copy on write for mmap MAP_PRIVATE, probably even for MAP_SHARED as an optimization, for loading a writable but initialized data segment of an executable, etc. The problem isn't the complicated, but that some people complain that forking can take a long time if the forking process has a lot of memory associated to it. < 1543439464 805355 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :But the answer to that is just "then don't do that". Prefork from a smaller parent process, not from the database server process that mmaps your hundred gigabyte database read-write and starts a hundred threads. < 1543439518 303524 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :Fork is simply more general, because if you want, you can still make a spawn-like model by having a fork server process and serializing only the state you want the child to have to it from the controlling process through some controlling channel. < 1543439518 738808 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :That's kind of a silly answer, why shouldn't the database process be able to run programs? < 1543439525 964513 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :But you couldn't do it the other way. < 1543439565 635827 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: the database server can, but not from the large process. if you have such a huge process, it doesn't cost much to have a smaller watcher process. that can do other things too, like log fatal failures of the big process or whatever. < 1543439597 696868 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :I'm not saying that you should always fork. By all means, use a single spawn server process with clean state if you want. < 1543439636 266579 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :The fact that MAP_PRIVATE requires copy-on-write when you specifically request it doesn't mean that you should just give up and COW all the time everywhere. < 1543439669 682083 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :But don't expect the kernel itself to have a small and simple spawn function, because the kernel doesn't know what the "sane defaults" for the new process are, if there were sane defaults they'd be obsolete in three years, and there's not much point to have a huge spawn function that takes a hundred arguments to set all process state. < 1543439695 922557 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I'm not saying there should be one-size-fits-all defaults. < 1543439699 178400 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :You could do that kind of prefork, it could be helpful < 1543439706 312211 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :But it's a long way to go from that to fork. < 1543439720 100988 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: there are library wrappers over that, if you want. ones with and ones without pre-forking. < 1543439729 181139 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: heck, I think they even added one to posix < 1543439749 633518 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :posix_spawn? < 1543439750 362753 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: and if COW is really your problem, then cheat with vfork, but that's _hard_. < 1543439756 882979 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: something like that, yes. < 1543439768 772617 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net PRIVMSG #esoteric :b_jonas: posix_spawn is expected to use a vfork-analog, FWIW. < 1543439774 902433 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net PRIVMSG #esoteric :(and on common systems, actually *does*) < 1543439778 622939 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :and then good luck setting up whatever process state that particular spawn doesn't support. < 1543439815 832865 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net PRIVMSG #esoteric :Yeah, posix_spawn is definitely somewhat limited in the state it can set up. < 1543439833 766616 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net PRIVMSG #esoteric :I believe it has enough to set up the state a POSIX shell would need to, but not much more. < 1543439837 574643 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :exactly. and every spawn will be, unless it takes huge tables emulating every system call ever. < 1543439853 916028 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :What's the argument in favor of fork? That it's convenient to set up a particular process state after forking? < 1543439866 899472 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net PRIVMSG #esoteric :The "easy" workaround is to use a helper binary to do more. < 1543439907 265846 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net PRIVMSG #esoteric :shachaf: It was easy to implement back in the day, while obviously being sufficiently general to serve the task. < 1543439909 443583 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: that, and fork isn't hard to implement by the kernel once it already wants that and multithreading and general mmaps and shared memory < 1543439926 893922 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :it's still easy to implement now < 1543439944 925650 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Some Win32 functions let you operate on a different process. For example VirtualAllocEx lets you allocate memory in another process's address space. < 1543439956 661934 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I wish Unix had that. < 1543439971 634866 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :For debuggers if nothing else. < 1543439972 164198 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :and if you complain about the speed, just look at how slow in practice it is to spawn a thousand simple small programs from a simple small program on win32, and on unix. unix still wins by like two orders of magnitudes. < 1543439991 20077 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: linux has most of that, with a combination of /proc and ptrace < 1543439998 223276 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net PRIVMSG #esoteric :I think if I were designing a thing now, I'd set it up so you could create a "zygote" process, use system calls on it to set the state, and then start the process. < 1543440009 182629 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :pikhq: Yes, that's what I was thinking. < 1543440013 478711 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :ptrace and much of /proc are definitely for debugging only < 1543440014 598914 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :b_jonas: How do you mmap in a child process? < 1543440016 923316 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :but they're very general < 1543440040 385319 :pikhq!~pikhq@c-73-181-126-9.hsd1.co.comcast.net PRIVMSG #esoteric :But, to be honest, I wouldn't design a thing now. There's no fucking way it'd do anything more than be personally entertaining. < 1543440068 437149 :Lord_of_Life!~Lord@unaffiliated/lord-of-life/x-0885362 QUIT :Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine < 1543440087 679067 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: hmm, yes, that in particular might be hard and it may be good if there was an interface for it. you'd probably have to take over a little spare space in the process to bootstrap that, save its contents and the registers, and run an mmap call in there. and catch all signals during. < 1543440110 990978 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :and if that process has no writable page, you're screwed. < 1543440124 65328 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :ptrace can write to non-writable pages < 1543440133 22800 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :what? no way < 1543440134 601314 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :It converts them from MAP_SHARED to MAP_PRIVATE if necessary < 1543440137 643185 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :In Linux at least. < 1543440140 528287 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :wtf < 1543440231 830614 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: still, it can be hard to restore it to MAP_SHARED later if you can no longer acquire a handle to the underlying file or shared memory segment or bsd shared memory segment from /proc < 1543440249 738125 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Right. < 1543440250 295040 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :You can use ptrace for system call emulation and other stuff like that too and does not have to be only for debugging < 1543440262 513911 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :s/or shared memory segment or bsd shared memory segment/or sysv shared memory segment or posix shared memory segment/ < 1543440304 545853 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :oh yeah! < 1543440320 511731 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :hmm no < 1543440325 359821 :Lord_of_Life!~Lord@77.29.186.194 JOIN :#esoteric < 1543440325 540263 :Lord_of_Life!~Lord@77.29.186.194 QUIT :Changing host < 1543440325 540294 :Lord_of_Life!~Lord@unaffiliated/lord-of-life/x-0885362 JOIN :#esoteric < 1543440333 231315 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :I think you still need a little bit of writable memory in the process address space for that < 1543440362 731090 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :if you're planning to debug, you can probably just arrange to set aside a little space for that < 1543440413 588145 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :zzo38: the system call emulation is the opposite of what we want < 1543440478 913873 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :zzo38: system call emulation means that the traced process calls for a system call, but you ask linux not to perform that call, instead you do whatever you want and set then registers in the traced process to pretend whatever result you want from the system call and continue it. you could jump away to run other code for that if you want. < 1543440490 141259 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :that thing is heavy, you rarely want to do that, but it's possible < 1543440498 140766 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :usually there are better ways for most special cases < 1543440524 253216 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :like replacing library functions or fuse < 1543440682 975372 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :Sometimes you might want to override some system calls, such as to change the time that the program knows, or to use a proxy server for all network connections if the program does not implement that, or to change things in a program that you do not have the source code to be able to recompile it, etc < 1543441423 124552 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :c++ gore: < 1543441443 717804 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :cout << "percent errors: "; < 1543441464 783594 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :printf("%f\n", errors/entries); < 1543441506 55910 :imode!~imode@unaffiliated/imode PRIVMSG #esoteric :is that in an actual codebase. < 1543441511 709720 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :it is yes < 1543441514 337276 :imode!~imode@unaffiliated/imode PRIVMSG #esoteric :gross. < 1543441534 508536 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :note that it isnt even a percent < 1543441549 925857 :imode!~imode@unaffiliated/imode PRIVMSG #esoteric :LOL. < 1543441559 29363 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :perone errors < 1543441621 362269 :MDude!~MDude@c-73-187-225-46.hsd1.pa.comcast.net JOIN :#esoteric < 1543441689 193038 :AnotherTest!~turingcom@ptr-82l26zf5tit6s260cpd.18120a2.ip6.access.telenet.be QUIT :Ping timeout: 268 seconds < 1543441735 484736 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :shachaf: my brain insists that perone is pronounced as if it was an italian loanword < 1543441743 167893 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :perunit errors < 1543441872 496408 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :/pɛroʊneɪ/ < 1543441919 62183 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :I changed it to "" < 1543441930 735529 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :nobody reads this output anyway < 1543442145 921926 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :or, at least, they shouldn't. they should be looking at the json < 1543442168 855138 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :hiren < 1543442183 146207 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I heard a rumor structured logs and structured errors might be good. < 1543442187 476615 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Do you do something like that? < 1543442283 22751 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :shachaf: yes < 1543442311 790357 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :but a lot of code still has terminal outputs < 1543442317 607697 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :What's it like? < 1543442363 910095 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :shachaf: annoying because I have to write a bunch of database code and manage an internal tool to display things nicely < 1543442380 760351 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :whoa, why? < 1543442384 97077 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :but, since I'm the only one who understands that system < 1543442398 278488 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Seems like it should be no worse than string logs because you can always just print it as a string < 1543442442 224091 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :shachaf: well, the json is uploaded to an internal server which has a web tool on it that displays pretty graphs showing how much better we are today than last year < 1543442464 401600 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :That... Oh. < 1543442481 288885 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :seems problematic if you can't just run the program hth < 1543442496 119515 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :and the only other person who knows how that works just quit < 1543442515 376176 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :you should ask for more money hth < 1543443418 156515 :imode!~imode@unaffiliated/imode QUIT :Quit: WeeChat 2.3 < 1543444152 614092 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :How I would make timestamps to work in version 12 of X window system protocol, is that you have 64-bit timestamps which must be nonzero and that it is guarantee all timestamps after some request or event are greater than all timestamps before that request or event, so that it is monotonic (but the timestamps do not necessarily correspond to any specific interval of time; this is implementation dependent). < 1543444488 923889 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :zzo38: yeah. but, in particular, changing the time the program knows is really hard, because time is reflected in like a shitton of system calls, ones that put timestamps in various data structures, plus some /proc or /sys files may have to be rewritten too < 1543444522 473316 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :so that's one of the hardest things to do consistently without at least a full user-mode-linux or similar OS emulation or full system emulation < 1543444551 609804 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :it's one of those cases like invisibility in HHGG < 1543444566 482070 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :99 out of 100 times it's easier to actually change the system time and do with it < 1543444592 710927 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: structured logs and structured errors => I say ask zzo38 < 1543444627 322219 :zzo38!~zzo38@24-207-47-161.eastlink.ca PRIVMSG #esoteric :Yes, although it can be helpful when you need it. It should be a user library to deal with these things as needed and then programs that need it can use the user library, calling the kernel only to call ptrace() and do the other stuff in the user mode < 1543445628 158162 :sleepnap!~thomas@2603:3015:260e:1900::13ed PART :#esoteric < 1543447586 224143 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :wow, oerjan edited https://esolangs.org/w/index.php?title=La_Weá back. < 1543447650 362217 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :argh, stupid firefox < 1543447664 953371 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :https://esolangs.org/wiki/La_We%C3%A1 < 1543447676 969605 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :it only copy-pastes the url properly if you select ALL of it < 1543447682 614504 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :I hate this < 1543447703 368515 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Is there a reasonably low-level language (lets you specify memory layout, no hidden allocations, etc.) that has single-argument functions where you just pass one struct by value for multiple arguments? < 1543447728 237794 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :And maybe also has flexible struct literals to allow all kinds of things like keyword arguments, default arguments, varargs, etc. < 1543447744 202825 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :It seems like it should be possible and also nicer than most languages, but I'm not sure about the details. < 1543447747 190798 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: we talked about this at some point on #esoteric I think < 1543447768 582369 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :That makes sense. Though I've been wondering about this flexible struct literal thing more generally. < 1543447772 428756 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :may be in the logs < 1543447842 44538 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :A lot of languages have flexible integer literals, for example, right? < 1543447881 898041 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Where maybe integer types are 32-bit or 64-bit, but integer literals are unbounded, and you implicitly coerce a literal to a type with a runtime representation. < 1543447905 630169 :Essadon!~Essadon@81-225-32-185-no249.tbcn.telia.com QUIT :Quit: Qutting < 1543447941 934670 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :I think it's not that many languages that have that. That only works if the compiler can derive types. So rust and haskell does it, and perhaps SML, I'm not sure. < 1543447972 830013 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :Some other languages like C and C++ just have some easy conversions of integers to other integer types, plus explicit notations for some types of integer literals. < 1543447972 986374 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Haskell doesn't do it. < 1543447985 468918 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :"So rust and haskell does it, and perhaps SML" < 1543447993 868529 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :haskell and Haskell are the same language < 1543447997 691876 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :but yeah < 1543447999 76745 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I'm pretty sure I've seen languages that do it though I don't remember which one. < 1543448002 117382 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :What? < 1543448002 845713 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :haskell in fact does even more < 1543448009 846954 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I said Haskell doesn't do it. < 1543448018 403809 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :what? < 1543448021 704003 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :What? < 1543448023 934148 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :haskell _doesn't_ do it? < 1543448025 575082 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :no way < 1543448043 268583 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :No, the literal "123" is a value with a runtime representation. < 1543448069 857821 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :In particular it's the value "fromInteger (123 :: Integer)" < 1543448086 215467 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: sure. that works < 1543448094 39887 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I'm talking about literals that can exist only at compile-time. < 1543448121 699990 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :I think there was one other language that does that, maybe golang or D, I dunno < 1543448151 326693 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Anyway, I'm thinking of extending a thing like that to struct literals. < 1543448162 103578 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :even more than rust in fact, in the sense that expressions with certain simple arithmetic operations from integer literals are computed to full precision and are allowed to overflow the largest runtime integer type < 1543448173 316521 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :So maybe you have "struct T { int x; char y; };" < 1543448192 309522 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :And you have the literal value "[x=5, y='a']", which doesn't have a runtime representation < 1543448212 267651 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :But you can write "T t = [x=5, y='a'];" < 1543448227 289342 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: I'm not sure why the Haskell way is that much different from the Rust way. The main difference is that in Haskell, you can define new integer types, and that there's a library bigint type. < 1543448230 62005 :Phantom_Hoover!~phantomho@unaffiliated/phantom-hoover QUIT :Read error: Connection reset by peer < 1543448267 988773 :arseniiv!~arseniiv@95.105.12.19.dynamic.ufanet.ru QUIT :Ping timeout: 246 seconds < 1543448297 601111 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :b_jonas: The point is that there's a runtime representation of these bigint values, so the whole "literal that only exists at compile-time" thing doesn't come up. < 1543448302 416677 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: there is one proposal for rust for something like that, but only for untagged structures, not for tagged ones < 1543448373 630703 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :If you have struct Args { int x; int y; char c = 'q'; };, and void f(Args args);, you could write something like f[x=5, y=8], or f[5, 8, 'z'], or so on < 1543448395 932017 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :in the sense that (x,y) is an untagged tuple-like structure, P(x,y) is a tagged tuple-like struct after a declaration like struct P(T0,T1); Q{a:x,b:y} is a tagged non-tuple-like struct, and they want non-tagged non-tuple-like structs, < 1543448418 214892 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :with named members, but no tag. would need some weird rules, but seems possible. < 1543448431 266711 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Where these things are just specified with regard to literal->struct conversion rules, not anything specific to function application. < 1543448459 455223 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Flexible struct literals seem useful anyway for all sorts of reasons. < 1543448465 270873 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :and the proposal recommends that they can be implicitly converted to smaller untagged structs that miss some members, but such _implicit_ conversion (as opposed to an explicit cast) seems fishy to me < 1543448504 387857 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :they would be flexible in the sense that you can use dot-dot notation to include members from another non-tagged struct, possibly adding new members or replacing existing members < 1543448509 355425 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :in the constructor that is < 1543448534 469707 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :you can't use default values of course, because there's no declaration of the tagged type that would define the default values < 1543448535 510299 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Why does it seem fishy? < 1543448557 242940 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :This isn't a cast between types, to be clear. It's only a "cast" from literals to values. < 1543448585 733921 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: dunno... doesn't seem very rust like. I'm not entirely sure, could work with a smart enough compiler that gives a warning for typical mistakes where you add an extra member that the function you are calling doesn't support. < 1543448587 157432 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :So if you have struct A { int x; }; and struct B { int x; };, you can't write A a; B b = a; < 1543448598 522097 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I don't particularly care about Rust? < 1543448608 113562 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I'm wondering about this kind of feature in general. < 1543448645 717072 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :like, you could call f({x:3,y:0,z:1}) but f actually takes an {x:i32,y:i32} argument so the z value will get ignored, silently or with a warning < 1543448662 321154 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Oh, sure, that should be an error. < 1543448663 523406 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: you were the one who asked about any low-level language, sorry < 1543448681 686252 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: yes, that's what I think too. it should be possible to cast explicitly, perhaps with the as operator < 1543448707 175652 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :should I dig up the RFC? < 1543448708 606010 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Sure, but "this isn't compatible with language X" is a different claim from "this is a bad feature" < 1543448736 259369 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: no, I think it would be bad in any language, but perl is already like that < 1543448775 111212 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :OK, what's an example of a place where it would be bad or confusing? < 1543448776 309313 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :I'm not saying "compatible", more like it's not in the kind of mindset that rust wants, catching as many errors in compile time as possible, sort of like Haskell < 1543448777 966889 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :b_jonas: perl5 has the option to declare arguments tho < 1543448824 607684 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: um, I just said one. I said only the implicit upcast is what would be a bad feature, because f({x:3,y:0,z:1}) would silently throw away the z:1 member, when the caller might think the function does handle that argument < 1543448837 972314 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :When you say "cast", what do you mean? < 1543448868 626586 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: an explicit conversion to a different type. like a C-style cast, but with a slightly more agreeable syntax than a C-style cast. < 1543448905 833787 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :But it's important that I'm only allowing implicit conversions from literals to values here. < 1543448907 306970 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :and for struct values only, not references < 1543448927 316758 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: yes, I understand, but doesn't {x:3,y:0,z:1} count as a literal? < 1543448927 700805 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :That means everything can be checked at compile-time, because literals don't exist at runtime. < 1543448953 681641 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Sure, but I specified that that's an error. < 1543448958 188145 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :right < 1543448977 783297 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :and if this change gets accepted to rust (though it likely won't be), then they'll probably change that part < 1543448992 83504 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :or at least that's my guess < 1543449012 21573 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :wait in what sense do literals only exist at compile time? < 1543449026 77725 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :You said this would be a bad feature in every language, so I'm not sure why you keep bringing up Rust. < 1543449031 582349 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I'm wondering what makes it a bad feature. < 1543449045 763875 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: it's only that implicit conversion that would be a bad feature < 1543449047 514218 :oren!~oren@ec2-18-212-11-99.compute-1.amazonaws.com PRIVMSG #esoteric :I always thought of literals as nameless consts < 1543449067 225247 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :b_jonas: OK, but in the context I'm specifying this the implicit conversion is very important. < 1543449071 433104 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :I'm not certain the rest of the proposal, that is, untagged (undeclared) structs with named members, would be a good or bad feature < 1543449074 608306 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :So where would it be a bad feature? < 1543449099 36739 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: so what kind of implicit conversion do you want? a conversion to a tagged struct? < 1543449142 682535 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :A conversion from a struct literal to any struct. < 1543449160 414199 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :Assuming it passes checks like the one I mentioned. < 1543449183 535021 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :there was actually a plan, perhaps already landed in rust now, to make a struct constructor for tagged structs where you don't give the struct name (which is only the constructor name, like in Haskell), and it's only valid if the typechecker can figure out the struct type expected, otherwise it's an error < 1543449203 340710 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :I'm not sure what the syntax was, it's a funny looking one but one that makes sense < 1543449208 900251 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :let me check < 1543449319 508252 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :I must be asking my question badly because it seems like you have something in mind for why this would be bad but you keep talking about Rust instead < 1543449527 400159 :b_jonas!~x@catv-176-63-24-214.catv.broadband.hu PRIVMSG #esoteric :shachaf: I know this isn't completely the same, but I might also be misunderstanding you because I'm tired < 1543449587 806461 :shachaf!~shachaf@unaffiliated/shachaf PRIVMSG #esoteric :You said this would be bad in any language and I'm trying to figure out why.