2022-10-16 15:33:04 olle: local stack? have you seen Factor? 2022-10-16 15:33:53 Would anyone actually be interested in a Forth IRC bot on here?? 2022-10-16 15:35:48 lagash: I have seen nothing x) 2022-10-16 15:35:53 Totally new to Forth 2022-10-16 15:36:09 If #c has a C bot, this channel damn sure need a forth bot! 2022-10-16 15:36:45 #C++* has geordi 2022-10-16 15:37:24 Forth is like the perfect language as well 2022-10-16 15:37:40 Bonus points if it's persistent per user or channel, so you can collab 2022-10-16 17:02:01 #c has a C bot?? Is it TCC? 2022-10-16 17:02:34 I recall TCC allowed a limited interpreted form of C..?? 2022-10-16 17:04:05 tcc is c99 and it doesnt interpreter, it just compiles then runs 2022-10-16 17:05:23 lagash: Dunno, go there and check? Call it with ,cc I think 2022-10-16 17:08:41 one could jam the C code into a main(), compile, and run. there's probably more elegant ways 2022-10-16 17:13:18 So, does anyone know any existing Forth IRC libraries? 2022-10-16 17:14:13 ya 2022-10-16 17:14:20 #geordi it was in #c 2022-10-16 17:14:36 I was interested in a Forth bot but never got around to it 2022-10-16 17:14:46 I see there's https://comp.lang.forth.narkive.com/GX6dubCN/nano-irc-client-in-forth 2022-10-16 17:15:11 you would have to pick a forth. I think running an embedded forth in an emulator would give you the most control of everything but may not be everyone's taste 2022-10-16 17:18:09 I could rig up eforth to an irc bot pretty quick, probably 2022-10-16 17:19:06 tricky bits would be showing the stack, halting loops and other abuse, etc 2022-10-16 17:19:44 Perhaps we could initially use https://tools.suckless.org/ii/ so we don't have to do all the IRC work in Forth yet? 2022-10-16 17:20:26 thrig: halting loops as in, infinite loops designed to DoS the bot? 2022-10-16 17:20:42 thrig: thats why I think an emulator is good. you can limit the number of iterations before terminating for example 2022-10-16 17:21:27 Huh. Factor SHIPS with its own IRC bot! 2022-10-16 17:21:56 truncating the ouput to fit in IRC, overflowing to a website, blah blah 2022-10-16 17:22:19 terminating or just pausing it until the user cranks it again 2022-10-16 17:22:25 so not difficult but a lot i's to cross and t's to dot 2022-10-16 17:23:00 languages like Idris dont have this issue, because theyre guaranteed to terminate! 2022-10-16 17:24:36 I think you could solve just about all of those problems with emulation 2022-10-16 17:25:10 also sandboxing is nice so no one tries to do unkind things to your system 2022-10-16 17:54:00 Just put it in docker? 2022-10-16 17:54:26 docker isnt a sandboxing tool 2022-10-16 17:54:32 usernamespaces are a notoriously vulnerable api :) 2022-10-16 17:54:51 and i believe the normal ones are similarly bad 2022-10-16 17:55:13 with the added benefit that 'breaking out' gives you root! 2022-10-16 17:55:42 sandboxed enough for most cases? 2022-10-16 17:55:56 not for running arbitary code off the internet 2022-10-16 17:55:59 you need more than docker 2022-10-16 17:56:11 bocker! 2022-10-16 17:56:15 ....or less, considering how much docker is 2022-10-16 17:59:47 freebsd jail? 2022-10-16 17:59:53 presumably you'd use pledge and unveil or try to cope on linux 2022-10-16 18:00:56 How'd that be safer that docker, which also has its own filesystem? 2022-10-16 18:03:29 and fun with that filesystem e.g. https://www.opencve.io/cve/CVE-2021-21284 2022-10-16 18:05:26 hm 2022-10-16 18:06:52 with pledge you'd probably put the forth in a process allowed to do stdio only 2022-10-16 18:08:14 any comments on jail? 2022-10-16 18:08:20 I 2022-10-16 18:08:27 'd say copy what geordi does for security 2022-10-16 18:10:19 The hell is geordi? 2022-10-16 18:10:35 "Geordi La Forge was a Human male Starfleet officer who originally was the helmsman of the USS Enterprise-D during 2364," 2022-10-16 18:12:19 http://www.eelis.net/geordi/ 2022-10-16 18:13:35 aha 2022-10-16 18:36:22 " 2022-10-16 18:36:23 geordi runs as a Docker container." 2022-10-16 18:36:25 :| 2022-10-16 18:36:44 lmao 2022-10-16 19:24:06 There's like no end to the layers. :-| 2022-10-16 22:54:10 I'd say a FreeBSD jail or using OpenBSD's pledge / unveil would be superior to any Docker copycats. 2022-10-16 22:55:00 The only "worry" I'd have would be side-channel attacks like SPECTRE 2022-10-16 23:03:48 it would be very impressive if you managed to exploit SPECTRE via a forth bot 2022-10-16 23:04:35 Hence the quotes. 2022-10-16 23:04:50 Just disallow /query'ing the bot and we're good! 2022-10-16 23:12:23 someone is working on pledge for linux 2022-10-16 23:16:43 So I've heard, so I've heard. I'm keeping on eye out for seL4 and other secure microkernels.