00:10:12 | FromDiscord | <byt3bl33d3r> Stupid question that i've still not figured out, what's the simplest way of turning a char array into a string in nim? |
00:12:13 | * | lritter quit (Ping timeout: 264 seconds) |
00:13:16 | FromDiscord | <Zachary Carter> @byt3bl33d3r a sequence of characters or a C char array? |
00:13:21 | FromDiscord | <Zachary Carter> or a Nim array? |
00:15:26 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2LHN |
00:15:45 | FromDiscord | <Zachary Carter> but I don't really know what you're trying to do either so... |
00:16:56 | FromDiscord | <shadow.> for a `seq[char]` `import strutils; seq.join("")` could work but idk how efficient that is |
00:17:11 | FromDiscord | <shadow.> and for a cstring you can just use stringify operator iirc |
00:19:26 | * | u0_a216 joined #nim |
00:19:30 | mipri | https://play.nim-lang.org/#ix=2LHQ , https://play.nim-lang.org/#ix=2LHT |
00:25:59 | * | u0_a216 quit (Read error: Connection reset by peer) |
00:26:29 | * | u0_a216 joined #nim |
00:35:36 | * | u0_a216 quit (Read error: Connection reset by peer) |
00:36:19 | * | u0_a216 joined #nim |
00:39:01 | * | muffindrake quit (Quit: muffindrake) |
00:45:40 | * | u0_a216 quit (Ping timeout: 246 seconds) |
00:45:59 | * | muffindrake joined #nim |
00:53:44 | * | oddp quit (Quit: quit) |
00:56:14 | * | u0_a216 joined #nim |
01:04:34 | * | u0_a216 quit (Ping timeout: 246 seconds) |
01:11:29 | * | u0_a216 joined #nim |
01:15:26 | * | PMunch quit (Quit: leaving) |
01:23:16 | FromDiscord | <Daniel> Seems there is no other book, altho text, like from Dr. Stefan Salewski is rather good for total beginners. |
01:23:35 | * | Tanger joined #nim |
01:25:55 | * | u0_a216 quit (Ping timeout: 246 seconds) |
01:30:02 | * | u0_a216 joined #nim |
01:33:02 | * | D_ joined #nim |
01:36:36 | * | u0_a216 quit (Ping timeout: 240 seconds) |
01:41:33 | * | grfork joined #nim |
01:41:58 | * | abm quit (Read error: Connection reset by peer) |
01:44:01 | * | greenfork quit (Ping timeout: 264 seconds) |
02:17:05 | * | xet7 quit (Ping timeout: 240 seconds) |
02:31:13 | * | xet7 joined #nim |
02:32:38 | FromDiscord | <ElegantBeef> @tomck i've cleaned it up a bit and made it more of a proper nimble package, so hopefully it's more usable, if you run into any issues feel free to spam me |
02:39:56 | Tanger | Hey folks, I want to write a language parser for a custom lispish DSL. I can access all available commands at compile time and run them against some static rules, but I wanted to do something like put together a pegs grammar file and validate each expression against a pegs definition |
02:40:52 | Tanger | I'm not sure if this is even use the way to use pegs, but it seemed like it might be possible to do something like generate a peg definition file at compile time and use that for runtime validation |
02:41:04 | disruptek | !repo npeg |
02:41:05 | disbot | https://github.com/zevv/npeg -- 9npeg: 11PEGs for Nim, another take 15 149⭐ 7🍴 |
02:41:22 | leorize[m] | can npeg generate pegs files? |
02:41:50 | disruptek | no, but you can compose grammers for npeg. |
02:41:58 | disruptek | at compile-time, i mean. |
02:42:12 | disruptek | grammars, too. |
02:42:57 | leorize | I think Tanger wants to generate pegs file as spec for their language |
02:44:36 | disruptek | "I want to write a language parser" |
02:45:01 | disruptek | npeg will do this thing. and it works at compile-time, runtime, even on js. |
02:45:03 | disruptek | go nuts. |
02:45:09 | Tanger | Whoa |
02:45:11 | Tanger | Even on js? |
02:45:15 | Tanger | Get out of town |
02:45:22 | disruptek | SHUT THE FRONT DOOR |
02:45:23 | disruptek | yes, js. |
02:45:33 | leorize[m] | npeg is magic, literally |
02:45:53 | leorize[m] | it even tells you exactly what's wrong with your grammar |
02:46:25 | Tanger | Well, the end goal was to write an auto-completing/formatting textarea in js and validate it against a language parsing server |
02:46:29 | Tanger | But this skips the middle man |
02:46:39 | Tanger | I'm pumped with optimism now, thanks guys! |
02:46:44 | leorize[m] | npeg is better at errors than the compiler the last time I checked |
02:47:02 | leorize[m] | have fun :) |
02:51:11 | * | xet7 quit (Quit: Leaving) |
03:02:16 | FromDiscord | <Varriount> <3 NPeg |
03:03:05 | FromDiscord | <Varriount> mratsim: It seems to me that continuation passing is similar to Windows's Fibers API |
03:03:15 | disruptek | it's not. |
03:22:02 | * | muffindrake quit (Ping timeout: 246 seconds) |
03:24:12 | * | muffindrake joined #nim |
03:26:20 | * | u0_a216 joined #nim |
03:34:05 | * | sagax joined #nim |
03:35:42 | * | D_ quit (Quit: 💨) |
03:36:16 | * | D_ joined #nim |
03:36:55 | * | u0_a216 quit (Ping timeout: 265 seconds) |
03:37:57 | leorize | do we perform overflow checks for uint in nim? |
03:38:11 | leorize | !eval var a = high uint; a += 1; echo a |
03:38:14 | NimBot | 0 |
03:38:21 | leorize | appears not |
03:38:29 | disruptek | longstanding problem. |
03:41:24 | * | grfork is now known as greenfork |
03:45:11 | * | u0_a216 joined #nim |
03:52:35 | FromDiscord | <byt3bl33d3r> @Zachary Carter a C char array |
03:53:04 | FromDiscord | <byt3bl33d3r> Yeah thats exactly what i've been doing |
03:53:47 | FromDiscord | <byt3bl33d3r> I thought there would have been a better way like a built in method on array objects |
03:55:08 | FromDiscord | <byt3bl33d3r> Oh! thanks mipri for the examples! |
03:55:34 | * | u0_a216 quit (Ping timeout: 256 seconds) |
03:57:22 | FromDiscord | <flywind> I don't think there is a built-in method, but you could use `copyMem` |
03:57:31 | saem | I was all like I wonder what cool convos I missed out on today while working... then I caught up... now I feel less bad about work. |
03:57:38 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2LJ4 |
03:57:52 | disruptek | rude. |
03:58:23 | saem | am I wrong? |
04:00:15 | disruptek | you have to go easy on dom; he is but a child, only a few years older than clyybber. |
04:06:19 | saem | I mean, I walked away with, gram seems cool |
04:06:19 | saem | Also, folks want to say build me x according to some build of materials, and for all the things they don't specify the compiler either makes some guesses or barfs. But exactly how they do that is _very_ important. |
04:06:52 | * | Gustavo6046 quit (Ping timeout: 260 seconds) |
04:08:36 | disruptek | well, easy comments first: gram is very simple by design; it's for when you just need some graph-y structures. it's not designed to be fast, and someone is writing a proper graph database in nim that will have all the bells and whistles. |
04:09:08 | disruptek | i just wanted a way to do quick hacks because doing this shit by hand every time is a pita. |
04:09:42 | disruptek | the problem with nim's configuration is really deep-seated. i really think it's going to take a long time to fix. |
04:11:39 | * | sagax quit (Quit: Konversation terminated!) |
04:11:45 | disruptek | !last gyllou |
04:11:46 | disbot | Gyllou spoke in 12#nim 3 weeks ago 12https://irclogs.nim-lang.org/17-12-2020.html#13:23:36 |
04:11:55 | disruptek | ^ doing the graph lib. |
04:12:10 | saem | Interesting. |
04:14:42 | * | a_chou joined #nim |
04:22:09 | FromDiscord | <byt3bl33d3r> ah ok so i have a `array[0..259, WCHAR]` |
04:23:03 | * | a_chou quit (Quit: a_chou) |
04:23:15 | FromDiscord | <byt3bl33d3r> `$cast[cstring](myarray[0].unsafeAddr)` in this case won't work to turn it into a string it seems |
04:26:38 | saem | I think a package needs a config and that shouldn't be nimble, but something smaller. Nim does the building. Package and project shouldn't get conflated up, project is a precise definition to build something. And none of those things should be the unit of distribution when it comes to thing you download from the internet that people call packages. |
04:26:53 | * | sagax joined #nim |
04:28:16 | saem | A cohesive collection of module and/or an not yet complied program aren't packages, they're a distribution of stuff. |
04:28:39 | saem | But that might be decomposing things far too much for some folks |
04:29:33 | saem | The fact that some nimble "packages" are programs, while others are libraries is silly. |
04:29:40 | disruptek | we currently version .nimble files, of which only one exists per directory. |
04:29:56 | disruptek | ergo, the unit of measure for a versioned component (package?) is a directory. |
04:31:25 | saem | Except a natural namespace problem, wherein the a fully qualified name is needed and two versions can't exist at once because they're hogging the same folder |
04:32:01 | disruptek | it's not a problem, because two versions cannot occupy the same folder at the same time. |
04:32:23 | disruptek | or, if they can, more power to you. |
04:33:39 | saem | Then the multiple versions of the same thing folks get a bit sadder, but it's not an impossible thing to solve |
04:35:12 | disruptek | no, but it's another case of a problem where if you can't solve it 100%, then please... don't even try. |
04:35:46 | saem | I think we're thinking the same way with a different tact about the meta aspects of this. |
04:36:08 | saem | Decompose the thing into it's actual primitive parts... |
04:36:13 | saem | Figure those out |
04:36:17 | disruptek | yes. |
04:36:59 | saem | Then in order to make a cohesive system wide solution combine them and clearly describe the new things that arise from interactions |
04:37:13 | saem | Keep merging up until it's a cohesive thing |
04:38:04 | disruptek | you make it sound complex. |
04:38:51 | saem | I'm not against a nimble, npm, cargo, whatever where it does the thing and you don't have to learn all these separate things at once, but the difference between it working well and not is very hard to describe... apenwarr's system design explains the world type thing. |
04:40:22 | disruptek | seems like it's worth reading. |
04:40:46 | saem | I do don't I? I'm sure Hickey is somewhere really mad right now and inexplicably muttering "just use clojure" |
04:41:00 | saem | I'll link shortly, dinner |
04:41:01 | disruptek | well, he's not wrong. 😉 |
04:41:24 | disruptek | i'm reading it now. |
04:41:45 | disruptek | https://apenwarr.ca/log/20201227 |
04:43:42 | * | vicfred quit (Quit: Leaving) |
04:49:50 | saem | His giant treatise on bugs etc is pretty amazing, but he's a Deming fan |
04:53:18 | disruptek | "Disruption" is an exciting word, everybody wants to do it! |
04:53:23 | disruptek | ahh, if only he knew. |
04:58:22 | saem | Hehe |
05:00:17 | * | u0_a216 joined #nim |
05:04:16 | * | Gustavo6046 joined #nim |
05:04:24 | * | Gustavo6046 quit (Remote host closed the connection) |
05:04:59 | * | Gustavo6046 joined #nim |
05:06:49 | * | u0_a216 quit (Ping timeout: 264 seconds) |
05:07:52 | FromDiscord | <apollo> could someone care to explain to me how proc works |
05:08:07 | FromDiscord | <apollo> i've been trying to use my previous programming knowledge to understand it but the tutorials are kinda out of my scope |
05:08:22 | FromDiscord | <apollo> i dont understand does proc have an automatic return value or how does it work? |
05:10:15 | disruptek | what did you code in before? |
05:10:18 | disruptek | proc is like bash's function. |
05:10:41 | disruptek | you specify the return value. |
05:10:41 | FromDiscord | <apollo> https://play.nim-lang.org/#ix=2LJl |
05:10:49 | FromDiscord | <apollo> basic code is what im testing |
05:11:13 | disruptek | what do you think that code does? |
05:11:32 | * | u0_a216 joined #nim |
05:12:14 | FromDiscord | <apollo> i was just testing how the proc works so i was just trying random stuff |
05:12:39 | FromDiscord | <apollo> https://play.nim-lang.org/#ix=2LJn |
05:12:43 | disruptek | science is best conducted with hypotheses. |
05:12:45 | FromDiscord | <apollo> could you check this one please/ |
05:12:52 | FromDiscord | <apollo> agreed |
05:14:36 | FromDiscord | <Rika> @apollo check what in the second code? |
05:14:50 | FromDiscord | <apollo> it works but i want to know why? |
05:15:06 | FromDiscord | <Rika> because you set the return type to be int |
05:15:12 | FromDiscord | <apollo> if i call a function that has an echo in it i still have to specify echo when trying to print it on the scren |
05:15:17 | FromDiscord | <apollo> (edit) "scren" => "screen" |
05:15:24 | FromDiscord | <apollo> and why does a 0 show at the end.. |
05:15:25 | FromDiscord | <Rika> and by default, the return is 0, unless you return something else or change the value in `result` |
05:15:46 | FromDiscord | <Rika> you dont need to specify echo when it has no return value |
05:16:12 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2LJo |
05:17:03 | FromDiscord | <apollo> i see but when it does have a return value i have to? |
05:17:31 | FromDiscord | <Rika> you have to use the return value, aka set it to a variable, echo it, whatever |
05:18:06 | FromDiscord | <Rika> just cannot implicitly do nothing with it, explicit is possible with `discart myFunc()` |
05:18:07 | FromDiscord | <apollo> hmm thanks for the help i'll practice more till i get it |
05:18:09 | FromDiscord | <Rika> (edit) "`discart" => "`discard" |
05:18:41 | FromDiscord | <Rika> why? because a lot of bugs happen when implicitly discarding values |
05:19:37 | FromDiscord | <apollo> i see |
05:23:22 | * | u0_a2161 joined #nim |
05:23:23 | * | u0_a216 quit (Read error: Connection reset by peer) |
05:31:34 | FromDiscord | <ElegantBeef> Depending on what you're doing you can use the `discardable` pragma to make it so you do not need to manuall discard the proc |
05:39:13 | * | u0_a2161 quit (Ping timeout: 264 seconds) |
05:40:21 | saem | Back |
05:40:58 | disruptek | please don't use discardable unless you really understand its risk. |
05:42:44 | saem | The only time I've used it is when dealing with non-Nim APIs and it's JS so they of course are super sloppy about return types and all that... reinforcing the sentiment, discardable is a smell. |
05:43:52 | disruptek | i'm using it in gitnim for running a process where i often don't care about the output; a failure of the process is a failure of the program. but, seriously, i almost never use it. |
05:44:06 | disruptek | do as i say, not as i do. |
05:44:28 | * | u0_a2161 joined #nim |
05:45:37 | saem | I've had a long enough career to have had more than enough bugs from forgetting to deal use a return value (or handle errors), having to explicitly discard is very nice. |
05:45:53 | disruptek | yeah, it's great. |
05:46:01 | disruptek | also exhaustive case. |
05:47:04 | saem | i do wish Nim had more of a culture of Result/Try so errors had to be more explicitly handled, but not dumb like checked exceptions. |
05:47:13 | disruptek | !repo badresults |
05:47:13 | disbot | https://github.com/disruptek/badresults -- 9badresults: 11a less fascist fork of nim-result 15 1⭐ 0🍴 |
05:47:32 | disruptek | see the `:=` template. |
05:53:30 | saem | what now? |
05:55:03 | disruptek | it's a way to use results that promotes error handling. |
05:55:56 | saem | Where is that template defined I couldnt' find it in stdlib or the repo... (I might be having a moment) |
05:56:19 | disruptek | sorry, i'm dumb. |
05:56:33 | disruptek | the template is from gittyup. i haven't put it in badresults yet i guess. |
05:56:35 | disruptek | !repo gittyup |
05:56:35 | saem | thank you, i feel less bad now |
05:56:36 | disbot | https://github.com/disruptek/gittyup -- 9gittyup: 11higher-level libgit2 bindings that build upon nimgit2 15 6⭐ 1🍴 |
05:57:41 | disruptek | it's a lil messy because i wrote most of this before i had figured out which bits i wanted to use. |
05:57:56 | saem | only the good ones obviously |
05:58:12 | disruptek | obvs |
05:59:00 | disruptek | it's actually a really nice library. |
05:59:01 | saem | ugh... I need to stop talking to my buddy bastard keeps filling my head with all sorts of PL ideas. |
05:59:54 | saem | oh yeah... well your review goes against ethics in game journalism. |
06:00:07 | disruptek | fair, fair. |
06:00:10 | * | adnan338 joined #nim |
06:00:19 | * | adnan338 quit (Client Quit) |
06:00:31 | * | adnan338 joined #nim |
06:01:10 | saem | your life will be better if you read "popped" as "pooped" |
06:01:32 | disruptek | maybe i should just s/pop/poop/ before i push each gitnim release. |
06:02:20 | saem | I'm all for more butt jokes. |
06:02:29 | disruptek | right? life is too short. |
06:02:36 | saem | word |
06:17:33 | saem | I need to stop staring at this CPS code. |
06:18:16 | disruptek | it has cost me more than a few sleepless nights. |
06:18:58 | disruptek | my continuations-in-the-cloud project is a bit of a mind-fuck. |
06:19:30 | saem | Yeah, because like a jerk you decided that liveness problems weren't hard enough. |
06:19:55 | disruptek | i don't know what they are, so it helps. |
06:20:04 | saem | Ignorance is bliss |
06:20:35 | disruptek | but seriously, csp isn't all that difficult once you have cps rockin'. |
06:21:27 | saem | I'm referencing program correctness, specifically whether a computation will return an answer at all and when-ish vs whether it's correct or not. In distributed systems land, this all got restated as the CAP theorem, but no one really realized it until later. |
06:21:33 | FromDiscord | <ryanford> hey all, how well does Nim in Action reflect the currect state of Nim? |
06:21:39 | saem | And FLP is basically the halting problem. |
06:21:51 | disruptek | ryanford: care has been taken to keep it working correctly. |
06:21:57 | FromDiscord | <Rika> i believe theres a page for errata |
06:22:00 | FromDiscord | <Rika> but i dont remember where |
06:22:01 | FromDiscord | <ryanford> nice, thank you |
06:22:06 | disruptek | it's not bad, is the point. |
06:22:16 | disruptek | saem: yes, but liveness is not hard. |
06:22:26 | FromDiscord | <Rika> i mean, the errata page would make it better since it "updates the book" |
06:22:27 | saem | disruptek: looooool |
06:23:32 | saem | It's like the one thing that generation after generation of computer scientists have looked past because so many never bothered understanding the halting problem itself and how weak of an assertion it really is. Wherein the vast majority of research in program correctness, the most pervasive of which being type systems basically ignore it. |
06:23:38 | disruptek | i mean, i'm pretty relaxed about it. |
06:25:34 | * | narimiran joined #nim |
06:25:40 | saem | I mean I stop caring about type systems pretty fast after sum, product, and parameterized types. I'd like rows, but that seems to be greedy. Any how, after those first three I'd much rather see something better than totality. |
06:25:41 | * | opal quit (Read error: Connection reset by peer) |
06:25:58 | * | opal joined #nim |
06:28:08 | saem | It'd probably just make it easier when I can finally stop having to explain to folks that at scale the network is the enemy, disks are marginally better than dev null, and computer catch on fire every time you blink. |
06:28:20 | * | habamax joined #nim |
06:28:31 | disruptek | well, yeah, but so what, is the thing. |
06:28:44 | disruptek | you shouldn't be trusting computers in any event; they will only let you down. |
06:28:56 | disruptek | i can't see why you couldn't do rows with concepts. |
06:29:46 | saem | Do concepts preserve type information after? I think the way nim does generics it does. |
06:30:12 | * | u0_a2161 quit (Ping timeout: 272 seconds) |
06:30:36 | disruptek | yes. what i'm curious about is whether we cannot simply use types to model our rendezvous. it might be a bridge too far, but we could completely unwrap the continuation so it's just data. |
06:31:30 | saem | Fuck, I need to load some vocabulary in my brain, gimmie a sec gotta remember what a rendezvous is exactly |
06:31:32 | disruptek | the code part of the thing is static in any event, right? so what are we really talking about, here? |
06:31:58 | disruptek | it's when two processes trade fluids. |
06:32:09 | disruptek | er, when two processes synchronize. |
06:32:57 | saem | that's under a state machine mode of a process, yes? |
06:33:11 | disruptek | "process" can be practically anything. |
06:33:34 | disruptek | we're just talking algebra at this point. |
06:33:44 | saem | Yeah, I mean this could be shapes and layouts, yes? |
06:33:53 | saem | Like stupid abstract. |
06:33:56 | disruptek | yeah. |
06:34:06 | disruptek | but it's like this, what do you write down on the page? |
06:34:23 | disruptek | just the data, not the interaction. |
06:34:49 | disruptek | we already know how the data is going to interact at compile-time -- why do we need to express that at runtime? |
06:34:54 | disruptek | or carry it around with us. |
06:35:09 | saem | this smells like session types and I'm thinking you can use types to model it but the definition of the rendezvous needs to be closed -- as in it needs to be defined in some reasonably enumerable number of steps. |
06:35:32 | saem | what I mean here is not types in general, but types as in what Nim has at its disposal |
06:36:43 | saem | Only reason would be if you want to defer a decision to runtime (and here come those flooding thoughts about PL design, that fucker). |
06:37:09 | disruptek | but what decision could you possibly not know statically? |
06:37:49 | disruptek | you can't have an interaction that you haven't coded ahead of time. 🤣 |
06:37:58 | saem | Well... |
06:38:31 | saem | So as you accept more user input you eventually get to a point where you're effectively going more and more towards an interpreter. |
06:39:07 | disruptek | makes sense. |
06:39:09 | saem | So if whatever you build is all in static land, that's great, but lifting it into something a programmer can reuse again isn't going to be a thing. |
06:39:29 | saem | I mean, that can be outside the scope the design, but it's a thing. |
06:39:34 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:39:55 | * | mbomba joined #nim |
06:40:02 | saem | Ugh... I'm thinking Futumura projections at this time of night, this is going to go so well. |
06:41:45 | disruptek | i guess you don't lose the static analysis as long as you you're careful, but i doubt this is really a concern for nim's csp impl. |
06:43:18 | saem | hmm, maybe this isn't a big deal. If everything that CPS does is basically a very thin/narrow interface of macros/templates. Then that's just the surface, the rest of the code is regular code which _could_ technical run in non-macro land, it does because that's basically the VM, so as long as someone who wants to delay a decision either does the heavy lifting or lives with that part not being accounted for it's ok |
06:43:20 | disruptek | i'm probably wrong about the scale of growth, though. just too many possible interactions. |
06:43:36 | saem | Well that's the thing I was trying to state about it being closed. |
06:44:17 | disruptek | i mean, we don't want state machines with billions of states. |
06:44:24 | saem | It's like natural numbers the expression itself is closed, 0 plus a successor, but definition is not. |
06:45:02 | disruptek | we already have a growth problem that we need to fix, perhaps even before cps enters production. |
06:45:02 | * | krux02 joined #nim |
06:45:15 | saem | twss |
06:45:18 | disruptek | i think araq has some plans to solve it, though. |
06:45:19 | saem | What's that? |
06:45:39 | disruptek | just with folding generics. |
06:46:35 | disruptek | the compiler should scrunch them down into the minimal ast via i dunno what, a jit typeclass or something. |
06:46:52 | disruptek | or maybe it's even simpler. |
06:47:36 | disruptek | i mean, it's not like this has to be re-rendered as nim per se. |
06:47:56 | disruptek | okay, gitnim works with dist now. for some value of "works." |
06:48:32 | leorize | disruptek: does your testes not signal error for arc failures? https://github.com/alaviss/nim-sys/runs/1686305486?check_suite_focus=true#step:6:68 |
06:48:33 | disruptek | takes 5.4mins for me to setup a new nim branch on my shit-ass-pet-fuckers adsl. |
06:48:48 | disruptek | leorize: it no longer does, no, because arc failures are too common. |
06:49:33 | leorize | weird, I could not reproduce whatever is shown here |
06:49:45 | leorize | probably because my testes is older than the CI |
06:49:47 | disruptek | that has been my experience of late, also. |
06:50:07 | saem | I mean having a type system (read bunch of if statements + errors) that's in the CPS implementation for CPS is a thing, in which case you don't need to worry too much about what Nim supports or doesn't. |
06:50:37 | saem | I'm guessing that's what mratsim was alluding towards |
06:50:54 | FromDiscord | <mratsim> mmmmh? |
06:51:00 | FromDiscord | <mratsim> You woke up the slumbering beast |
06:51:05 | disruptek | oh shoot. |
06:51:50 | FromDiscord | <mratsim> I assume by "growth" and "millions of state" you mean compiler generated code for generics and concepts? |
06:52:27 | disruptek | no, unique interactions between processes. |
06:52:44 | saem | time to get the Jaeger |
06:52:47 | disruptek | a static value per each rendezvous. |
06:53:14 | FromDiscord | <mratsim> Well Erlang could deal with that in the 90 |
06:53:23 | FromDiscord | <mratsim> though static is maybe overkill |
06:53:32 | saem | It never could statically. |
06:56:03 | * | opal quit (Ping timeout: 272 seconds) |
06:56:22 | saem | fuck... now I remember why I hate type theory papers. |
06:56:50 | saem | https://www.di.fc.ul.pt/~vv/papers/thiemann.vasconcelos_context-free-session-types.pdf |
06:57:18 | disruptek | dat url |
06:57:29 | FromDiscord | <mratsim> seems OK until chapter 2.1 |
06:57:35 | saem | chill, I'm just rickrolling you. |
06:58:32 | saem | Yeah... man I wish I had access to a printer again. I need to be able to print these things and write all over them only way that stuff really lands. |
06:58:46 | FromDiscord | <mratsim> Look at this multithreading paper, after chapter 4.4: https://fzn.fr/readings/ppopp13.pdf |
06:59:05 | FromDiscord | <mratsim> well even 4.1 |
06:59:06 | saem | sooooo close to poop, they failed |
06:59:47 | disruptek | it's really a pita to even write these expressions. |
06:59:53 | saem | at least they have the decency to make a table unlike most who just litter that shit all over prose |
07:00:03 | FromDiscord | <mratsim> (i'm waiting for the "data-race free" borrow-checker that apparently handles all that for the programmer. |
07:00:20 | saem | You're holding your breath too, right? |
07:00:21 | FromDiscord | <mratsim> Looking at you Rust and your false promises. |
07:01:03 | disruptek | i just wanna know what they typeset in. |
07:01:22 | saem | Latex because "tradition" paying your dues, etc... |
07:01:54 | FromDiscord | <mratsim> not holding my breath, I'm actually writing a model checker to formally verify concurrent data structure: https://github.com/mratsim/weave/pull/127/files |
07:01:56 | disbot | ➥ [WIP] Thread Collider: Race detection / Formal Verification of Nim concurrent programs ; snippet at 12https://play.nim-lang.org/#ix=2IwE |
07:01:56 | saem | I mean Pony did it, but they took on a GC and they are more precise about their various borrowing/lending and life time flags. |
07:02:40 | saem | I've checked out weave and I think synthesis is pretty skookum |
07:02:51 | FromDiscord | <mratsim> but I need coroutines or continuations, and they need to be very very very low-overhead, to simulate threads that I can suspend and resume at will. |
07:03:43 | FromDiscord | <mratsim> bonus point if I can multi-thread those because verifying aven a simple queue system takes 10min in multithreaded Java formal verif tool |
07:03:51 | FromDiscord | <mratsim> (TLA+ from the same author as latex) |
07:04:23 | FromDiscord | <mratsim> 10min on a 18 cores machine, overclocked |
07:04:28 | saem | I mean if you're basically rendering out functions they're near free outside of any state they have to snapshot and calls you can't coalesce/inline. The rest is micro-batching of data, but it feels like there isn't enough information to hazard that. |
07:05:21 | FromDiscord | <mratsim> I think you lost me |
07:05:32 | disruptek | skookum, heh |
07:07:00 | saem | As in the overhead of CPS, given the current approach y'all seem to be taking, are basically render out a bunch of functions + snapshot any state because people be mutating. If all that code that got barfed out during that elaboration is relatively straightforward fort he compiler to inline then that's tonnes of overhead gone |
07:07:02 | * | opal joined #nim |
07:07:51 | disruptek | yes but if he wants his 1ns switch, it cannot be done with just compiler wizardry. |
07:07:55 | saem | The rest is the snapshot and the dispatcher itself, the latter which _may_ get in the way of inlining |
07:07:57 | FromDiscord | <mratsim> as it turns out, I've mention the two codegen we can take here: https://github.com/weavers-guild/weave-io/tree/master/implementation#the-cps-transform |
07:08:12 | FromDiscord | <mratsim> either we gnerate a state machine or a bunch of function |
07:08:29 | disruptek | if cond1: callback1(env) else: callback1(env) |
07:08:33 | disruptek | 2nd one needs a 2. |
07:08:36 | * | mbomba quit (Quit: WeeChat 3.0) |
07:08:54 | FromDiscord | <mratsim> The C++ CoroutineTS designers and LLVM compiler devs looked at it, and figured out that functions are easier to optimize and fold and transformation into state machine should be done as late as possible |
07:09:30 | saem | That makes sense, give all the hours poured into the former |
07:09:31 | disruptek | another reason not to worry too much about the cps papers. |
07:10:01 | saem | outside of the ones that tease apart the nuances and show the various trade-offs of different algebras? |
07:10:17 | FromDiscord | <mratsim> sent a long message, see https://paste.rs/a1h |
07:10:17 | saem | :D |
07:10:40 | FromDiscord | <mratsim> you have the slides and the talk |
07:10:55 | saem | I like how chrome is all like, translate from Norwegian? |
07:11:24 | FromDiscord | <mratsim> And with functions and stack coroutine this is what C++ is able to do with LLVM (not MSVC or GCC yet): https://godbolt.org/g/26viuZ |
07:11:36 | FromDiscord | <mratsim> constant fold across 3 iterators |
07:12:37 | saem | also fuck reading C++, content warning that shit next time. ;) |
07:12:50 | disruptek | lol so tame. |
07:13:17 | saem | I made some minor patches to LLVM a long time ago and that's enough C++ for me. |
07:14:08 | FromDiscord | <mratsim> I wrapped a C++ library last week |
07:14:16 | saem | I'm sorry, are you OK? |
07:14:34 | disruptek | that code is pretty cute, actually. |
07:15:08 | disruptek | but also, no, nim will be quite a bit nicer. |
07:15:23 | FromDiscord | <mratsim> warning, dangerous content ahead: https://media.discordapp.net/attachments/371759389889003532/798450029346029608/unknown.png |
07:15:27 | saem | I get disruptek's point though, the llvm magic + state machine magic to wring out the last bits, means that's all in translation land. So the algebra is the "IR" here which needs to be nailed. |
07:15:30 | saem | Hahaha, thanks |
07:16:13 | FromDiscord | <mratsim> I've spelled the LLVM API out, but I think this is a stretch goal |
07:16:28 | FromDiscord | <mratsim> they are working with both C++ and Swft to stabilize their coroutine API |
07:16:32 | saem | Does that arrow point to where the bad code hurt you? |
07:16:48 | FromDiscord | <mratsim> I'll be fine with 5ns coroutines for the time being 😉 |
07:17:09 | FromDiscord | <mratsim> No it's the type I need to translate properly into C++ |
07:17:23 | FromDiscord | <mratsim> or get properly from C++ |
07:17:37 | saem | Yeah, i was gonna ask, thought you were consuming here |
07:18:12 | FromDiscord | <mratsim> I do both, I have proc that accept typedescs and generate the corresponding C++ type |
07:18:41 | FromDiscord | <mratsim> I need to get the type right because you can't cheat with "auto" in Nim 😉 |
07:18:52 | FromDiscord | <mratsim> in the C++ codegen at least. |
07:19:15 | disruptek | your text about the storage makes sense to me, mratsim. |
07:19:43 | FromDiscord | <mratsim> That was what we agreed on 3 weeks ago, just spelled out. |
07:19:55 | disruptek | i'm just not sure that our continuations are one-shot and can overwrite the storage, etc. |
07:20:30 | FromDiscord | <mratsim> one-shot means foo.resume() and afterwards foo has been replaced or destroyed, and you cannot copy foo, only move. |
07:21:16 | FromDiscord | <mratsim> the mutant continuations are one-shot for sure, the non-mutant are one-shot unless the user copy the continuation and use it multiple times |
07:21:47 | disruptek | yes. i just don't want to give that up and i don't understand why i hafta. |
07:22:57 | FromDiscord | <mratsim> Well, I've tried to give all the rational justifications and I'm bad at emotional reason over Discord so shrug :p |
07:23:19 | saem | That's if you want to "compose" handlers that voltron into a dispatcher? |
07:23:20 | disruptek | where are the rational justifications? |
07:23:31 | FromDiscord | <mratsim> we can allow that for trivial types, those without ref or destructors. |
07:23:52 | * | u0_a2161 joined #nim |
07:26:55 | FromDiscord | <mratsim> This is the short summary: if you allow that for continuations that contains `free(foo)` you have the "enter the room once and exit twice" problem, you construct the object once but somehow by copying the continuation you can run `free(foo)` twice http://okmij.org/ftp/continuations/against-callcc.html#dynamic_wind |
07:27:15 | disruptek | yes. |
07:27:27 | FromDiscord | <mratsim> So Scheme has a complex thing called dynamic-wind to handle that |
07:27:54 | FromDiscord | <mratsim> that's the first part. Now the second part fo the argument is that in a decade they didn't find any use-case for this feature. |
07:28:13 | FromDiscord | <mratsim> It complexify the memory management and the language but doesn't seem to bring benefit. |
07:29:26 | FromDiscord | <mratsim> so what we can do `proc =copy[T: not supportsCopyMem](dst: var Continuation[T], src: Continuation[T]){.error: "non-trivial continuation cannot be copied".} ` |
07:30:05 | FromDiscord | <mratsim> and even so, that doesn't solves the problem of continuations that have a raw "free(pointer)" inside. |
07:30:05 | disruptek | how is it that we would ever have a finalizer run on read-only input? |
07:30:21 | disruptek | how could they exist, though? |
07:30:29 | disruptek | we're talking about strictFuncs. |
07:31:09 | FromDiscord | <mratsim> Are Sockets or Database handle var in strictfunct? |
07:31:16 | disruptek | of course. |
07:31:32 | FromDiscord | <mratsim> https://nim-lang.org/docs/nativesockets.html#close%2CSocketHandle |
07:31:44 | FromDiscord | <mratsim> close is not var here. |
07:32:03 | FromDiscord | <mratsim> so a continuation that closes a socket will close it twice if copied. |
07:32:52 | disruptek | well, c'mon, it makes a posix call. |
07:35:36 | * | adnan338 quit (Quit: adnan338) |
07:35:45 | * | adnan338 joined #nim |
07:35:46 | * | adnan338 quit (Remote host closed the connection) |
07:35:48 | FromDiscord | <mratsim> I'm pretty sure SQLite connections are the same. In general I think it's way more likely to shoot yourself in the foot. with that. And also when you debug, you will have the stacktrace maybe point to `close(handle)`, but will you see the copy of the continuation? |
07:35:54 | * | adnan338 joined #nim |
07:36:16 | FromDiscord | <mratsim> that's why I think this capability should be separate from core CPS. |
07:36:18 | disruptek | are you telling me that your argument against my semantics is nim's standard library? |
07:38:16 | FromDiscord | <mratsim> No, it's that we can do most of what we need with non-copyable continations. Over a decade of Scheme didn't find a use-case for multishot continuations, and enabling copying too early will likely lead to hard to understand and debug double-free. |
07:39:01 | disruptek | we don't even have to expose it yet, but it should be built into the design. |
07:39:45 | disruptek | nim is not scheme and not being a scheme coder, it's hard for me to understand how exactly it failed to compose for them. |
07:39:52 | FromDiscord | <mratsim> I'm advocating to put a `=copy` that prevents copying. This is easy to lift afterwards once we understand mroe the implication. |
07:39:55 | disruptek | but i do understand how strictFuncs can compose for me. |
07:40:06 | disruptek | okay, i'm fine with gating it. |
07:40:15 | disruptek | i just want to ensure that the logic works. |
07:40:34 | FromDiscord | <mratsim> we can even add a "-d:copyableContinuation" flag |
07:40:52 | disruptek | as long as it can be tested, i'm fine with it. |
07:40:59 | FromDiscord | <mratsim> sounds good |
07:43:55 | disruptek | so that's #3 on your third list of reminders. |
07:44:07 | disruptek | why can't i have the other 2? |
07:44:30 | FromDiscord | <Ulrik> So i decided to checkout nim but what is NIM why is it so little popular? |
07:44:46 | disruptek | i don't know. |
07:45:36 | FromDiscord | <ElegantBeef> It's picking up in popularity, but probably that it's a rather weird language from all the popular languages |
07:46:43 | FromDiscord | <Ulrik> But it has not yet even reached the TIOBE programming language rankings list yet, i wonder where NIM stands what makes it so uniqe? |
07:48:10 | FromDiscord | <haxscramper> We are in 'next 50' on tiobe |
07:48:23 | FromDiscord | <mratsim> @disruptek, the other 2? |
07:48:36 | FromDiscord | <ElegantBeef> It's a systems programming language with a non abrasive syntax, it's inspired by oberon, ada, lisp and pascal which is why i figure it's not overly popular 😄 |
07:48:50 | FromDiscord | <mratsim> btw, will have 5 hours electicity cut in 10min so if I stop suddenly you know why |
07:49:09 | disruptek | eh we'll talk later; it's 0300 here. |
07:49:13 | disruptek | gn |
07:49:50 | FromDiscord | <mratsim> gn |
07:50:05 | FromDiscord | <0xc45> sent a code paste, see https://play.nim-lang.org/#ix=2LKc |
07:50:30 | FromDiscord | <haxscramper> You need to generate asm statement via macros probably |
07:50:57 | FromDiscord | <haxscramper> https://nim-lang.org/docs/macros.html#statements-asm-statement |
07:52:21 | FromDiscord | <mratsim> You can use inline asm or {.emit: asm """ |
07:53:56 | FromDiscord | <mratsim> if in C it works but not in Nim asm |
07:54:33 | FromDiscord | <mratsim> also if your proc is pure assembly you can use {.asmNoStackFrame.}" to avoid a prologue and epilogue, this is equivalent to attribute((naked))" |
07:55:07 | FromDiscord | <mratsim> This is the library with the most ASM in Nim I think: https://github.com/mratsim/constantine/search?q=asm |
07:55:21 | FromDiscord | <mratsim> it includes an compile-time assembler for x86 |
07:55:51 | FromDiscord | <0xc45> Awesome, thanks both! I'll look into those references! 🙂 |
07:56:02 | FromDiscord | <mratsim> and this is what I'm talking about when you can use C asm: https://github.com/mratsim/constantine/blob/master/benchmarks/platforms/x86.nim#L65-L71 |
07:56:50 | FromDiscord | <0xc45> Oh that's an interesting example! Thanks |
07:58:07 | FromDiscord | <mratsim> and this repo has a couple of experiments I used to understand asm statement codegen: https://github.com/mratsim/finite-fields/blob/master/macro_add_carry.nim |
08:17:43 | FromDiscord | <faith_james || Nim Developer> Helllo |
08:17:54 | FromDiscord | <ElegantBeef> Hello |
08:20:10 | * | NimBot joined #nim |
08:28:32 | FromDiscord | <eye contacts for nyagito komaeda> are there any good tutorials out there on using nim with the js backend? |
08:28:42 | FromDiscord | <eye contacts for nyagito komaeda> specifically on binding js libraries for use in nim |
08:28:51 | FromDiscord | <eye contacts for nyagito komaeda> (to then be compiled back into js) |
08:36:46 | * | piron joined #nim |
08:40:44 | FromDiscord | <ElegantBeef> I have this small example of one way of doing it lazily https://github.com/beef331/mrapi |
08:56:04 | * | himu joined #nim |
09:01:04 | greenfork | eye contacts for nyagito komaeda, if you want just to use it (not to write a complete wrapper), you can leverage jsffi like so https://github.com/greenfork/colorvisualization/blob/master/src/animation.nim |
09:01:20 | * | jkiesian joined #nim |
09:01:29 | FromDiscord | <0xc45> sent a code paste, see https://play.nim-lang.org/#ix=2LKv |
09:07:34 | FromDiscord | <haxscramper> I'm pretty sure you can't emit `asm` at runtime, it is just not possible |
09:07:56 | FromDiscord | <haxscramper> Because it has to be present in compiled binary, otherwise it won't work |
09:08:11 | FromDiscord | <haxscramper> You might be looking into JIT territory if you need to do this at runtime |
09:08:32 | FromDiscord | <0xc45> Hmm yeah that makes sense if you put it like that. That's a shame, guess I'll have to find another way to make this work 🙂 |
09:16:31 | * | u0_a2161 quit (Ping timeout: 256 seconds) |
09:37:03 | * | cyraxjoe quit (Ping timeout: 260 seconds) |
09:52:28 | * | habamax quit (Ping timeout: 265 seconds) |
10:01:50 | * | himu quit (Ping timeout: 264 seconds) |
10:06:08 | * | piron_ joined #nim |
10:08:33 | * | piron quit (Ping timeout: 260 seconds) |
10:11:57 | * | himu joined #nim |
10:13:40 | * | Tanger quit (Quit: Leaving) |
10:16:35 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
10:17:54 | FromGitter | <gogolxdong> When will CPS ready for use? |
10:23:05 | * | PMunch joined #nim |
10:26:29 | adnan338 | Hello, I want to get the Appdata folder in windows. In powershell, this can be done by executing `$env:APPDATA`. How can I get environment variables in Nim? |
10:27:53 | * | u0_a2161 joined #nim |
10:28:09 | Prestige | https://nim-lang.org/docs/os.html#getEnv%2Cstring%2Cstring adnan338 |
10:28:38 | adnan338 | thank you Prestige |
10:29:01 | Prestige | no prob! had to know where to look, unfortunately |
10:31:02 | * | superbia joined #nim |
10:37:31 | * | u0_a2161 quit (Ping timeout: 246 seconds) |
10:50:45 | * | superbia quit (Quit: WeeChat 3.0) |
10:52:57 | * | filcuc_ joined #nim |
10:52:58 | * | habamax joined #nim |
10:56:39 | FromGitter | <gogolxdong> I know where caused GUI crashed, it's an global orderedTable accessing from different threads. |
10:57:41 | FromGitter | <gogolxdong> Which way to make it thread-safe and GC-safe? |
10:58:35 | FromGitter | <vinodvinu> Is there any GUI tutorial in Nim ? Especially for Windows GUI ? |
10:59:08 | FromGitter | <gogolxdong> https://github.com/khchen/wNim |
10:59:40 | FromGitter | <vinodvinu> Thank you @gogolxdong :) |
11:00:07 | FromGitter | <gogolxdong> https://github.com/gogolxdong/2DeFi uses wNim, there is an English REAMD-EN.md |
11:01:12 | FromGitter | <vinodvinu> Yeah, found it. |
11:01:23 | PMunch | @gogol, there is https://nim-lang.org/docs/sharedtables.html but it doesn't have orderedTable |
11:01:27 | FromGitter | <gogolxdong> https://www.bilibili.com/video/BV1E54y147xg here is my demo |
11:01:45 | * | filcuc joined #nim |
11:01:54 | * | filcuc_ quit (Ping timeout: 272 seconds) |
11:02:17 | PMunch | One option is to set up a request/response system using channels and have only the main thread access the table |
11:03:02 | FromGitter | <gogolxdong> Is sharedtables engough, I considered channel option. |
11:03:36 | FromGitter | <vinodvinu> @gogolxdong , Nice !. |
11:05:48 | FromGitter | <gogolxdong> channel will work , just no so elegant or straightforward. I think CPS will solve these issue. |
11:07:22 | FromGitter | <gogolxdong> Let's try sharedtables |
11:10:28 | PMunch | It's not ordered though |
11:11:35 | * | abm joined #nim |
11:13:19 | FromGitter | <gogolxdong> Thanks for reminding, I remember you worked on satellite right? It's awesome. Someday XSpace will run Nim in their rockets :) |
11:14:46 | PMunch | I used to work with satellite reception, but I don't any wore |
11:17:07 | narimiran | if anyone is interested, i wrote an article about various parsing methods in nim (based on my advent of code solutions): https://narimiran.github.io/2021/01/11/nim-parsing.html |
11:18:59 | PMunch | Did you change mut from the version I read? |
11:19:41 | narimiran | PMunch: it's basically the same thing! (i didn't add any regex examples per your suggestion, sorry) |
11:21:35 | * | Tanger joined #nim |
11:22:35 | FromGitter | <gogolxdong> What kind of satellite it was, communication or climate. |
11:23:25 | * | Vladar joined #nim |
11:25:08 | PMunch | Climate |
11:25:15 | PMunch | It was the EPS-SG satellites |
11:26:43 | FromGitter | <gogolxdong> awesome! |
11:30:12 | FromGitter | <gogolxdong> still crash |
11:33:33 | FromGitter | <gogolxdong> https://play.nim-lang.org/#ix=2LLi comment out the last lines of table accessing make it more robust |
11:35:02 | * | Torro joined #nim |
11:36:49 | FromGitter | <gogolxdong> Have no idea. |
11:41:26 | PMunch | What does it complain about if you remove {.gcsafe.} on line 40? |
11:47:10 | * | PMunch quit (Ping timeout: 246 seconds) |
11:49:10 | FromGitter | <gogolxdong> `Error: 'status_continue' is not GC-safe as it accesses 'nameIterVar`gensym319' which is a global using GC'ed memory` |
11:51:25 | FromGitter | <gogolxdong> https://play.nim-lang.org/#ix=2LLn this is whole part , there isn't something like name... |
11:52:26 | piron_ | hello everybody, I am learning nim, is there a "Ninety-Nine Nim problems" type or resource? |
11:56:12 | * | filcuc quit (Ping timeout: 265 seconds) |
11:56:24 | FromGitter | <gogolxdong> ```code paste, see link``` |
11:56:34 | FromGitter | <gogolxdong> it's from chronos |
11:59:26 | * | D_ quit (Ping timeout: 264 seconds) |
12:00:37 | * | PMunch joined #nim |
12:01:12 | * | Tanger quit (Remote host closed the connection) |
12:02:08 | FromDiscord | <haxscramper> piron_: you can try AOC problems |
12:04:45 | * | himu quit (Ping timeout: 240 seconds) |
12:05:59 | FromGitter | <gogolxdong> It doesn't show which GC'ed memory it's accessing ,not as a normal error. |
12:11:12 | * | himu joined #nim |
12:16:01 | * | himu quit (Ping timeout: 265 seconds) |
12:19:14 | * | leorize quit (Remote host closed the connection) |
12:19:39 | * | leorize joined #nim |
12:30:25 | * | jkiesian quit (Ping timeout: 240 seconds) |
12:32:29 | FromDiscord | <Rika> I’m being dumb again, how would I go about writing something with global state and async again? |
12:32:59 | * | Tanger joined #nim |
12:38:03 | * | gangstacat quit (Ping timeout: 272 seconds) |
12:41:53 | * | gangstacat joined #nim |
12:42:42 | * | jkiesian joined #nim |
12:45:46 | * | Lord_Nightmare quit (Ping timeout: 272 seconds) |
12:51:11 | PMunch | @Rika, just do it? |
12:51:21 | PMunch | There's nothing special to keep in mind in that case :P |
12:53:38 | FromDiscord | <mratsim> @0xc45, ycan't emit ".byte 0xfoo" at runtime with an ASM macro you need a JIT |
12:53:43 | FromDiscord | <mratsim> you can't |
12:54:06 | FromDiscord | <mratsim> there is a small example of a JIT here: https://github.com/mratsim/photon-jit |
12:56:05 | FromDiscord | <mratsim> basically, you allocate a page, make write your ASM function to it, make it executable, cast the pointer to a function and run it: https://github.com/mratsim/photon-jit/blob/ef1954406d6f23677f702151397fcd6d3889aad3/photon_jit/photon_types.nim#L60-L93 |
12:59:15 | * | adnan338 quit (Quit: adnan338) |
13:01:12 | * | FromDiscord quit (Remote host closed the connection) |
13:01:25 | * | himu joined #nim |
13:01:29 | * | FromDiscord joined #nim |
13:03:12 | FromDiscord | <Rika> Pmunch and get gcsafe issues yeah lol |
13:03:40 | PMunch | gcsafe in async? |
13:04:08 | FromDiscord | <mratsim> (edit) basically, you allocate a page, make write your ASM function to it, make it executable, cast the pointer to a function and run it: https://github.com/mratsim/photon-jit/blob/ef1954406d6f23677f702151397fcd6d3889aad3/photon_jit/photon_types.nim#L60-L93 |
13:04:09 | * | FromDiscord quit (Remote host closed the connection) |
13:04:23 | * | FromDiscord joined #nim |
13:04:41 | FromDiscord | <mratsim> (edit) and this repo has a couple of experiments I used to understand asm statement codegen: https://github.com/mratsim/finite-fields/blob/master/macro_add_carry.nim |
13:04:42 | * | FromDiscord quit (Remote host closed the connection) |
13:04:58 | * | FromDiscord joined #nim |
13:06:13 | * | himu quit (Ping timeout: 264 seconds) |
13:07:09 | * | jkiesian quit (Ping timeout: 256 seconds) |
13:14:17 | * | mbomba joined #nim |
13:14:23 | * | himu joined #nim |
13:19:34 | * | jkiesian joined #nim |
13:23:57 | * | u0_a2161 joined #nim |
13:25:02 | FromDiscord | <Rika> well i had to deal with some gcsafe issue when i used a global so yeah |
13:25:29 | FromDiscord | <Rika> i dont remember what i do to deal with those anymore sooo |
13:26:47 | Tanger | Hey folks, I've been tinkering with the npeg library and I figured it's worth asking if it's possible to create a grammar for a lispish language. |
13:27:37 | Tanger | I've been hitting issues with recursion, which is understandable given that the language can be recursive |
13:29:57 | Tanger | Is there a way to specify a recursion limit? ie cap it at X so compiling expressions doesn't just hang |
13:31:43 | Tanger | Nevermind, I think I just need to rewrite it if they have a JSON parser in the examples |
13:32:41 | FromDiscord | <lqdev> well, there's -d:nimCallDepthLimit=x iirc |
13:32:56 | FromDiscord | <lqdev> but that's for Nim and not npeg |
13:33:21 | * | Lord_Nightmare joined #nim |
13:34:12 | FromGitter | <gogolxdong> @PMunch, seems there is only one option , using channel |
13:34:42 | PMunch | Tanger, you can use capture and a counter |
13:35:17 | PMunch | @gogolxdong, there are some less safe options that can work if you are careful |
13:35:28 | PMunch | But the easiest is to use channels if you don't need absolute performance |
13:35:58 | FromGitter | <gogolxdong> what's the less safe options, using ptr? |
13:37:42 | FromGitter | <gogolxdong> How do you do for multithreading programming with performance at the same time. |
13:38:04 | PMunch | Well it depends on why you're using threads |
13:38:24 | PMunch | If you just don't want your UI to lock up while you do stuff in the background then a channel is fine |
13:38:33 | * | greenfork quit (Quit: Leaving) |
13:38:49 | PMunch | But if you extreme performance then you will have to architect some better solution |
13:42:40 | FromDiscord | <0xc45> sent a long message, see http://ix.io/2LMd |
13:43:06 | FromDiscord | <0xc45> (before anyone asks - yes this is legit, it's for my job as a pentester / red teamer 😛 ) |
13:43:34 | FromDiscord | <mratsim> seems like Nim is making inroads in offensive security? |
13:44:22 | PMunch | Heh, reminds me of the time I unknowingly helped optimise a honeypot-finder <_< |
13:44:59 | FromDiscord | <0xc45> It is! There's a couple of people that have published blogs/articles on why Nim is very useful in the context of offensive security tooling, so more and more people are picking it up. A nice example is here: https://github.com/byt3bl33d3r/OffensiveNim |
13:45:14 | PMunch | Oh cool |
13:46:01 | FromDiscord | <0xc45> The project I'm personally working on is a packer that wraps either C# binaries or plain shellcode in a Nim executable, deobfuscating and decrypting the payload at runtime |
13:46:10 | FromDiscord | <0xc45> Nim works really well for that 🙂 |
13:47:25 | FromDiscord | <mratsim> interesting. Well if you have questions feel free. I'm more familiar with the cryptographic world and security auditors (we finished our security audit in december) but pentesting looks very interesting as well. |
13:48:44 | FromDiscord | <0xc45> Cool! Yeah you guys have been very helpful so far! 😄 |
13:49:55 | FromDiscord | <mratsim> if many of your domains come here we can create an opsec-crypto channel on Discord |
13:50:02 | FromDiscord | <mratsim> experts in your domain |
13:50:38 | FromDiscord | <0xc45> Indeed! Haven't seen a lot of familiar names yet though |
13:50:48 | FromDiscord | <0xc45> But I'm sure there's some people lurking |
13:50:50 | * | EastByte quit (Quit: WeeChat 2.7.1) |
13:58:13 | FromGitter | <gogolxdong> good question, if there is an workaround in async like this https://play.nim-lang.org/#ix=2LMk works, there is no need for threads. |
13:58:27 | FromGitter | <gogolxdong> @PMunch |
14:00:17 | PMunch | What do you mean workaround? |
14:00:46 | FromGitter | <gogolxdong> how to achieve wait at the same time. |
14:01:23 | PMunch | By using sleepAsync? |
14:01:46 | PMunch | https://nim-lang.org/docs/asyncdispatch.html#sleepAsync |
14:02:04 | * | tane joined #nim |
14:02:14 | FromGitter | <gogolxdong> sleepAsync only echo "A" |
14:04:00 | FromDiscord | <Rika> dont discard c() |
14:04:03 | FromDiscord | <Rika> use waitfor |
14:04:22 | FromDiscord | <Rika> pmunch youre in charge of playground right? i think i fucked it |
14:04:36 | FromDiscord | <Rika> oh okay nvm its back xd |
14:07:28 | * | PMunch quit (Ping timeout: 272 seconds) |
14:10:04 | FromGitter | <gogolxdong> main thread is for rendering GUI. |
14:16:00 | FromGitter | <gogolxdong> I think it's one reason, then I can try to manage other three while true logics in another thread. |
14:17:35 | * | EastByte joined #nim |
14:17:42 | * | EastByte quit (Client Quit) |
14:20:59 | * | PMunch joined #nim |
14:22:30 | Oddmonger | asyncnet.nim , it's like using select() with C ? |
14:22:50 | Oddmonger | i mean, non blocking listening ? |
14:24:13 | Oddmonger | in fact, it seems a socket wrapper |
14:25:47 | * | xet7 joined #nim |
14:26:14 | ForumUpdaterBot | New thread by Miran: New article: Parsing inputs in Nim, see https://forum.nim-lang.org/t/7376 |
14:28:13 | FromDiscord | <lqdev> `(readFile filename).split("\n\n")` narimiran please |
14:28:22 | narimiran | teach me |
14:30:52 | FromDiscord | <lqdev> i mean, come on… did you really have to showcase command call syntax used in expressions here? :) |
14:32:36 | narimiran | so, i should move `(` one word right? :P |
14:34:22 | FromDiscord | <lqdev> yeah |
14:35:11 | FromDiscord | <lqdev> i know disruptek is poisoning people with his disrupstyle but i didn't expect people to start doing shenanigans like this |
14:35:27 | narimiran | haha, pushed the "correction" :D |
14:35:49 | narimiran | (it will be probably couple of minutes until the new version is built) |
14:41:33 | FromGitter | <gogolxdong> well, it's not about threading, it's about access global GC'ed memory, crash remains. |
14:43:46 | FromDiscord | <flywind> annoying dot is not fixed completely ... |
14:44:16 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2LMF |
14:45:29 | FromDiscord | <shadow.> narimiran: lol it's funny bc i also learned scanf and npeg through aoc |
14:45:42 | FromDiscord | <shadow.> prolly woulda still been split() and regexing everything |
14:45:44 | FromDiscord | <shadow.> if i didnt do aoc |
14:45:48 | narimiran | :) |
14:46:09 | narimiran | AoC is great for learning new stuff (including completely new languages) |
14:47:13 | FromDiscord | <shadow.> lol yeah |
14:47:16 | FromDiscord | <shadow.> that's how i learned nim |
14:49:02 | * | D_ joined #nim |
14:52:06 | narimiran | same here |
14:53:03 | * | D_ quit (Client Quit) |
14:54:15 | * | D_ joined #nim |
14:57:18 | * | u0_a2161 quit (Ping timeout: 260 seconds) |
14:59:02 | FromDiscord | <shadow.> lmao haven't you been doing nim for ages |
14:59:04 | FromDiscord | <shadow.> or am i being dumb |
14:59:17 | narimiran | well, AoC has been runing for ages too |
14:59:21 | FromDiscord | <shadow.> ahhhh |
14:59:22 | FromDiscord | <shadow.> i see |
14:59:23 | FromDiscord | <shadow.> haha |
14:59:26 | FromDiscord | <shadow.> i learned on this year's aoc |
15:06:33 | FromGitter | <gogolxdong> what's the difference between waitFor all([a,b]) and waitFor a or b |
15:11:20 | * | EastByte joined #nim |
15:12:23 | * | EastByte quit (Client Quit) |
15:13:24 | * | jkiesian quit (Ping timeout: 265 seconds) |
15:13:38 | * | EastByte joined #nim |
15:20:46 | FromDiscord | <Rika> nothing in particular i believe? |
15:26:27 | disruptek | gogolxdong: cps is a team effort, but you can promote prioritizing it by helping to sponsor my work. |
15:27:08 | * | fputs quit (Quit: WeeChat 3.0) |
15:28:23 | * | fputs joined #nim |
15:36:51 | FromGitter | <gogolxdong> Yes, I will back Nim this year. |
15:41:12 | FromDiscord | <mratsim> There are people who have been in the Nim community for more than 10 years now :p |
15:41:13 | * | Tanger quit (Remote host closed the connection) |
15:42:03 | FromGitter | <gogolxdong> make gcsafe gone. |
15:44:06 | FromGitter | <gogolxdong> There would be a Nim foundation, and Nim committee, you would be chosen as an expert :) |
15:44:50 | * | hmmm joined #nim |
15:46:51 | * | def- quit (Quit: -) |
15:47:03 | * | def- joined #nim |
15:47:16 | FromGitter | <gogolxdong> especially you four in CPS team. |
15:47:25 | * | EastByte quit (Ping timeout: 272 seconds) |
15:49:50 | disruptek | the only thing i seem to be expert at is not getting paid. |
15:50:37 | FromDiscord | <mratsim> Four? |
15:50:49 | FromDiscord | <mratsim> Where is the other Mr Fantastic? |
15:54:06 | FromGitter | <gogolxdong> (https://files.gitter.im/5602f03e0fc9f982beb19f61/sawk/image.png) |
15:54:33 | FromDiscord | <shadow.> lol yep |
15:55:33 | FromDiscord | <mratsim> Ah, Clyybber is just forced to fixed the types in a macro bug that we highlight :p |
15:56:22 | FromGitter | <gogolxdong> @disruptek, like your homorous |
15:57:03 | * | jkiesian joined #nim |
15:57:41 | FromGitter | <gogolxdong> Is that sense of humour? which I lack. |
15:59:27 | FromDiscord | <Rika> yes hes trying to be funny (in part) |
16:02:45 | * | EastByte joined #nim |
16:03:41 | * | waleee-cl joined #nim |
16:05:35 | * | himu quit (Quit: Konversation terminated!) |
16:16:43 | FromGitter | <gogolxdong> time to go to sleep.gn |
16:19:06 | FromDiscord | <VVX7> hey @0xc45 I'm also here for offensive security tooling with Nim. I'm working on a RAT for a Operator (like CALDERA). Would be interested to see what you're building. https://github.com/VVX7/nicodemus |
16:19:22 | FromDiscord | <VVX7> (edit) "<@!672742601362898985>" => "@0xc45" | "a" => "Prelude" |
16:21:16 | planetis[m] | mrastim: how are you today? |
16:23:35 | FromDiscord | <0xc45> Cool, that looks very interesting! I'll DM you about my project! 🙂 |
16:24:09 | disruptek | there's nothing funny about being destitute. |
16:26:01 | planetis[m] | disruptek: if you have something to say, say it |
16:27:47 | planetis[m] | "disrptek throbs" |
16:28:08 | * | vicfred joined #nim |
16:31:46 | FromDiscord | <VVX7> Cool stuff! I'll try to make time this weekend to dig in 🙂 |
16:32:40 | FromDiscord | <mratsim> @planetis, I'm good |
16:32:45 | disruptek | if i have something to say about what? |
16:33:20 | disruptek | hearts and minds, people; HEARTS AND MINDS! |
16:33:23 | disruptek | that better? |
16:33:57 | disruptek | today we repoint gitnim to the nightlies. |
16:34:18 | planetis[m] | mratsim: great, me too, just a little bored, bc of the lockdown, but I will start practising guitar or exercise |
16:34:42 | planetis[m] | depends what's my mood |
16:35:01 | FromDiscord | <mratsim> My usual wind up is either playing go or dancing but I can't dance due to covid |
16:35:10 | FromDiscord | <mratsim> I sually do that 5-8 hours per week |
16:35:17 | * | mipri left #nim (#nim) |
16:37:01 | * | jkiesian quit (Ping timeout: 265 seconds) |
16:37:16 | planetis[m] | dancing, as modern dance, are you a breakdancer? |
16:39:42 | FromDiscord | <mratsim> linking to offtopic |
16:42:08 | planetis[m] | ok great got to go now |
16:42:21 | disruptek | aight peace. |
16:46:36 | planetis[m] | would you be willing to study how the jsonserialization library works, before claiming that it handles random order correctly? K bye |
16:47:42 | FromDiscord | <mratsim> I produced code that worked fine on your example, what more do you want? |
16:51:47 | disruptek | ah serialization drama. 🍿 |
16:51:55 | disruptek | i can't think of a more boring topic. |
16:52:44 | disruptek | planetis[m]: you are allowed to use whatever serializer you want for whatever you want. |
16:53:34 | saem | Ugh, serialization, really wish it didn't exist, I like it was something that just worked so I never have to think about |
16:53:54 | saem | Also that it basically took no work |
16:55:09 | disruptek | some of our serializers fit that definition -- they took basically no work to build, and it shows. |
16:56:25 | saem | It's just a painful lesson that exposing your core data model as a format is almost always a bad thing |
16:57:11 | saem | Well once programs become bigger or you get requirements like compatibility across versions etc |
16:58:19 | disruptek | i dunno, i find that most software is ephemeral enough that it doesn't matter. |
16:58:49 | disruptek | if i can't read some data i just die. |
16:59:06 | disruptek | or, sure, recreate it. |
16:59:18 | disruptek | you have to engineer for failure, always. |
16:59:28 | * | hnOsmium0001 joined #nim |
17:01:45 | disruptek | pro tip time. |
17:02:01 | disruptek | so you know ic is this flat ast concept. |
17:02:08 | disruptek | just a sequence of nodes, no pointer soup. |
17:02:23 | disruptek | one of the genius ideas it raises is to embed errors in the ast. |
17:02:43 | disruptek | proc errorAst*(s: string): NimNode = |
17:02:43 | disruptek | ## produce {.error: s.} in order to embed errors in the ast |
17:02:43 | disruptek | nnkPragma.newTree: |
17:02:44 | disruptek | ident"error".newColonExpr: newLit s |
17:02:56 | disruptek | use it today. it works well. |
17:04:35 | disruptek | proc errorAst*(n: NimNode; s = "creepy ast"): NimNode = ## embed an error with a message errorAst s & ":\n" & treeRepr(n) & "\n" |
17:05:00 | disruptek | just sprinkle some newlines in there. |
17:05:41 | * | jkiesian joined #nim |
17:05:44 | leorize | we can do it better :P (in the compiler I mean) |
17:06:50 | disruptek | we will, eventually. but the concept is worth backporting to use today. |
17:08:19 | disruptek | after looking at the available string-templating engines for nim, i decided i don't need string-templating. 🙄 |
17:10:46 | * | mbomba quit (Quit: WeeChat 3.0) |
17:11:08 | * | shirty joined #nim |
17:16:10 | leorize | I'm adding support for Windows to nim-sys and now I'm questioning whether I should just tell people to use a threadpool to do tasks instead |
17:17:24 | disruptek | i think function color is such a terrible concept that i'm willing to do practically whatever it takes to avoid it. but this is just my subjective opinion, and we know what my opinion is worth around here. |
17:19:32 | leorize | I want to get rid of the notion as much as you do, but we don't have anything better yet (well there's cps in the work but I need a working impl before I try new things) |
17:20:18 | disruptek | let that motherfucker block. |
17:21:24 | leorize | either I need CPS or weave need an IO threadpool |
17:21:29 | leorize | since I do need async |
17:22:16 | disruptek | well, bug your compiler developers to fix crash bugs. |
17:24:13 | leorize | only Araq is the one working on the compiler full time as far as I know |
17:24:47 | leorize | we need more full-time devs I guess |
17:28:24 | FromDiscord | <mratsim> Types are function color |
17:29:15 | FromDiscord | <mratsim> Function colors is not a problem, just like being statically typed is not a problem |
17:30:09 | FromDiscord | <mratsim> interesting article: https://lukasa.co.uk/2016/07/The_Function_Colour_Myth/ |
17:31:38 | FromDiscord | <mratsim> Kotlin for example doesn't use the "await" keywords so you don't distinguish suspendable from classic function. According to them it makes refactoring to async/coroutines easier. |
17:32:02 | FromDiscord | <mratsim> And there is a small bullet in your IDE that outline suspending functions. |
17:32:53 | FromDiscord | <mratsim> I think having await and waitFor instead is perfectly fine, readable and I'll take an extra word to add if it helps maintenance, debuggability and easing people into the codebase. |
17:33:02 | * | shirty quit (Quit: Connection closed) |
17:33:21 | disruptek | i don't know how you think that article doesn't support my point. |
17:33:48 | reversem3 | what is your guys opinion who best tutorials and documentation for web frameworks |
17:34:38 | FromDiscord | <mratsim> @disruptek, I'm not always disagreeing with you. |
17:34:59 | disruptek | well, function color is a problem in nim, anyway. |
17:36:05 | disruptek | reversem3: visit indeed.com, plot salary against availability of work, find something like react or whatever and then go to react.com and click the biggest button on the page. |
17:36:30 | * | lritter joined #nim |
17:36:53 | FromDiscord | <mratsim> @leorize I wanted to start looking on IO multithreading 4 weeks ago and then got bitten by the CPS bug. |
17:37:02 | reversem3 | Oh sorry I should of been more specific ,I meant for nim |
17:37:11 | disruptek | and we are glad you did, mratsim. 😉 |
17:37:12 | FromDiscord | <mratsim> he was being facetious |
17:37:13 | * | superbia joined #nim |
17:37:24 | disruptek | !repo prologue |
17:37:25 | disbot | https://github.com/planety/prologue -- 9prologue: 11Prologue is an elegant web framework written in Nim. 15 645⭐ 21🍴 7& 6 more... |
17:37:46 | disruptek | there's really no reason to choose anything else, as support and momentum are what matter in this space. |
17:38:05 | FromDiscord | <mratsim> wow 645 stars 😮 |
17:38:17 | reversem3 | ok cool , hopefully I can use elm with it |
17:38:37 | * | disruptek 🤦 |
17:39:18 | reversem3 | what its a great front end |
17:39:57 | superbia | is anyone str3aming ? |
17:41:05 | leorize | gah, microsoft got rid of RtlGenRandom() docs |
17:41:26 | leorize | now you need two syscalls to get random numbers |
17:42:12 | * | rramos_eth joined #nim |
17:52:09 | FromDiscord | <shadow.> blech |
17:53:22 | saem | Seems like the only thing to do with function colour is to play at the edges of it. Like colouring the return type or parameters, which just mildly shifts things, but it works for other function color problems. Like auto-dereferencing, var vs let. |
17:54:24 | disruptek | that's basically mamy's point, i think. |
17:54:34 | FromDiscord | <shadow.> disruptek: i'm just uneducated, what are the obvious advantages over jester? |
17:54:59 | disruptek | shadow.: it's supported and widely used. |
17:56:31 | disruptek | saem: the metric that i've taken to using is really simple: |
17:56:51 | disruptek | if you can see the problem in your editor and fix it there, why can't the computer do it for you? |
17:57:54 | * | Arrrrrrrr joined #nim |
17:58:39 | saem | I like that metric |
17:58:55 | disruptek | ikr |
18:00:04 | disruptek | i think araq invented it, but i don't remember. |
18:01:14 | FromDiscord | <mratsim> I've read it a couple of times not sure if it was here Hacker new or reddit |
18:01:47 | saem | Probably read it, and not sold their conclusion will satisfy everyone, but I think colour is a necessary complexity and it could be automatically figured out in some special cases. Where those special cases are really you have enough info and flexibility to pay their price. I think those cases cover a very wide gamut, so what about green thread approach like go as a "mode"? |
18:01:47 | saem | http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ |
18:02:09 | FromDiscord | <mratsim> maybe talks as well "I know exactly what you want but I won't give in until you please me" |
18:02:37 | ForumUpdaterBot | New thread by Snej: Semantics of {.shallow.}?, see https://forum.nim-lang.org/t/7377 |
18:02:57 | * | himu joined #nim |
18:03:04 | FromDiscord | <mratsim> green thread don't work in javascript, they also don't work in embedded |
18:03:46 | FromDiscord | <mratsim> have to check in microLua but I think their stackful coroutines (= fibers = green threads) are not usable there |
18:04:02 | saem | I know, please see my special case remark and I'm saying this is to be layered not baked in |
18:04:18 | disruptek | saem: would you have a "fetches from memory are blocking" layer? |
18:04:48 | saem | I should also not use the authors language, because I think the spaghetti stack is the more important aspect. |
18:05:30 | saem | disruptek: depends which memory, but yeah, gotta barrier the stuff that's out side the execution context |
18:05:30 | FromDiscord | <mratsim> cool people call it the saguaro stack |
18:05:41 | disruptek | hah |
18:06:17 | saem | Colour is a decidability issue in the type system (fuck Jeremy, I bet you feel snug right now) and it can't figure out what to do so you gotta add more information. So that's either ambient or explicit |
18:06:18 | FromDiscord | <mratsim> Here is a writeup on the cactus stack/spaghetti stack/split stack: https://github.com/mratsim/weave/blob/master/weave/memory/multithreaded_memory_management.md |
18:07:52 | FromDiscord | <mratsim> I've mentioned in the section "The particular case of multithreading" but continuations happen to solve the cactus stack problem https://github.com/disruptek/cps/discussions/40#discussioncomment-241263 |
18:07:58 | saem | mratsim: partially an aside, to be clear I'm not doubting your thoroughness and conscientious research habits. It's thoroughly refreshing. |
18:08:14 | disruptek | there are cases where we are pretty well fucked, like mratsim's fd example, but i would rather solve that separately instead of conceding it in the design. |
18:08:18 | saem | I'm case that was coming across at some point |
18:08:44 | FromDiscord | <mratsim> fd? File descriptor? |
18:08:48 | disruptek | yeah. |
18:09:20 | FromDiscord | <mratsim> you will have to remind me, because I don't remember having a problem with file descriptors |
18:09:37 | * | himu quit (Quit: Konversation terminated!) |
18:09:53 | disruptek | the fd is just an integer but once it goes to ffi who the fuck knows what happens. |
18:09:56 | * | natrys joined #nim |
18:10:09 | disruptek | i don't think we should engineer for ffi, is my point. |
18:10:12 | FromDiscord | <mratsim> ah for the multishot continuations |
18:10:24 | disruptek | it's a problem everywhere. |
18:10:40 | saem | Yeah, that's what I mean, so either you bake assumptions into the environment (language, design, define, types, whatever) or the information needs to be at the call/declaration sites. |
18:10:45 | FromDiscord | <mratsim> here it's not FFI, close(socket) is in Nim code |
18:10:53 | FromDiscord | <mratsim> anyway we solved that |
18:11:11 | * | NimBot joined #nim |
18:11:21 | saem | FFI is a fence, isn't it (more colour)? |
18:11:28 | disruptek | but to saem's point, it should be baked into the type. |
18:11:36 | FromDiscord | <mratsim> and as an additional security, continuations will have a {.warning: "copy of a contination happens here".} |
18:11:48 | FromDiscord | <mratsim> to ease debugging |
18:12:07 | disruptek | sure. |
18:25:50 | saem | (opening a can of worms) mratsim: in your research have you stumbled across the dispatchers using something like algebraic effects to compose? I'm wondering if all the immutability related issues "go away", when you can stack/compose dispatchers (handling logic) or allow replay but use memoized data or whatever compensating strategy? |
18:30:16 | * | jkiesian quit (Ping timeout: 240 seconds) |
18:31:31 | FromDiscord | <mratsim> also you might want to look at the C++ coroutines in-depth analysis of fibers http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1364r0.pdf |
18:31:34 | saem | Nevermind, looks like the reason I was connecting the two things was because CPS is general enough to cover algebraic effects. |
18:31:48 | FromDiscord | <mratsim> btw to tag me you need to put @mratsim |
18:32:10 | FromDiscord | <mratsim> continuations are powerful enough to implement any Monad |
18:32:13 | saem | Ugh, annoying on a phone. y u no irc |
18:32:25 | FromDiscord | <mratsim> http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.43.8213&rep=rep1&type=pdf |
18:32:34 | Zevv | saem: wrong phone! |
18:33:05 | FromDiscord | <mratsim> fibers = green threads = stackful coroutines btw |
18:33:07 | saem | Zevv: hush! But also don't. What's the right phone in you opinion? |
18:33:19 | Oddmonger | i'm reading this: https://nim-lang.org/0.19.2/backends.html , but the URI puzzles me (0.19.2) : is there a more recent version ? |
18:33:27 | FromDiscord | <mratsim> = something that allocates a page, switch the stack pointer to it |
18:33:35 | saem | mratsim need a graph of this. :D |
18:33:41 | Zevv | saem: https://planetcom.squarespace.com/device |
18:33:58 | FromDiscord | <mratsim> A graph of my research? |
18:34:04 | FromDiscord | <mratsim> I only speak markdown |
18:34:06 | FromDiscord | <mratsim> 😛 |
18:34:12 | Zevv | and french |
18:34:12 | saem | Zevv: I like your style. I gots a pixel 5 |
18:34:22 | Zevv | saem: not enough keys on that :) |
18:34:28 | saem | Yes, but only in markdown |
18:35:01 | saem | I meant a big dotviz showing the taxonomy of concepts |
18:35:02 | Zevv | marque vers le bas |
18:35:17 | FromDiscord | <mratsim> at one point I need to write code as well |
18:35:26 | FromDiscord | <mratsim> but that reminder is in all my documents |
18:35:52 | FromDiscord | <mratsim> functions vs resumable functions and continuations (stackless) coroutines and fibers |
18:35:57 | saem | Hah, I teased my italian speaking boss with cappana da pizza |
18:36:28 | FromDiscord | <mratsim> non è troppo difficile di parlare italiano quando posso parlare francese |
18:36:55 | Zevv | you'll manage |
18:37:08 | Oddmonger | mais qu'est-ce qu'ils disent |
18:37:17 | FromDiscord | <mratsim> 说汉语马? |
18:37:35 | disruptek | no. |
18:37:46 | disruptek | disbot: what do you think? |
18:37:47 | disbot | cannot predict now. |
18:37:50 | disruptek | fair. |
18:38:16 | saem | Welp that pushed well past all my limited french understanding |
18:38:31 | FromDiscord | <mratsim> == what are you saying |
18:38:49 | saem | I could remember disent |
18:38:56 | saem | Couldn't |
18:39:14 | FromDiscord | <mratsim> dire/dise/disent is "say" |
18:39:33 | saem | Sigh, I knew that at some point |
18:39:36 | Oddmonger | a man who speaks two language is bilingual, but a man who speaks only one language is english |
18:39:52 | FromDiscord | <mratsim> Or a PHP dev |
18:40:09 | FromDiscord | <mratsim> Or perl? |
18:40:17 | saem | I'm on the west coast, no one will care about my crappy french skills |
18:40:19 | FromDiscord | <mratsim> something with a P |
18:40:30 | Oddmonger | Python |
18:40:40 | FromDiscord | <mratsim> Pascal |
18:40:53 | * | mipri joined #nim |
18:41:06 | Oddmonger | Turbo Pascal |
18:41:06 | saem | Prolog |
18:41:22 | saem | Processing |
18:42:07 | Oddmonger | Pizza time |
18:42:14 | Oddmonger | bon appétit :)’ |
18:42:27 | saem | Oddmonger: wins |
18:42:34 | saem | I love pizza |
18:44:01 | * | xace quit (Ping timeout: 246 seconds) |
18:45:53 | * | xace joined #nim |
18:56:58 | * | natrys quit (Ping timeout: 246 seconds) |
18:57:32 | FromDiscord | <jseb> sent a code paste, see https://play.nim-lang.org/#ix=2LOf |
18:57:42 | * | Torro quit (Quit: bye) |
18:59:30 | FromDiscord | <InventorMatt> Readfile returns a tainted string but you are trying to turn a world object into a tainted string |
18:59:48 | FromDiscord | <jseb> ahhh stupid me |
19:00:00 | FromDiscord | <jseb> i have forgotten to unserialize |
19:00:05 | FromDiscord | <jseb> thank you |
19:00:34 | FromDiscord | <InventorMatt> No problem |
19:07:23 | * | leorize quit (Ping timeout: 240 seconds) |
19:10:06 | * | natrys joined #nim |
19:11:11 | * | adnan338 joined #nim |
19:12:00 | * | leorize joined #nim |
19:13:33 | FromDiscord | <JSONBash> anyone sure how to make the nim.nvim plugin not collapse all functions calls be default? |
19:13:34 | * | adnan338 quit (Read error: Connection reset by peer) |
19:14:18 | FromDiscord | <lqdev> set nofoldenable |
19:15:04 | FromDiscord | <JSONBash> hero |
19:20:27 | * | l1x joined #nim |
19:28:36 | * | rramos_eth quit (Quit: Leaving.) |
19:34:28 | leorize | you can also customize `foldlevel` to only disable the first few levels of fold |
19:34:54 | leorize | but yea `set nofoldenable` work just fine |
19:35:09 | leorize | if you wanna selectively fold just type `zc` on a foldable region |
19:36:08 | * | Jesin quit (Quit: Leaving) |
19:40:12 | * | Jesin joined #nim |
19:50:18 | * | shirty joined #nim |
19:50:56 | * | habamax quit (Ping timeout: 240 seconds) |
19:53:23 | shirty | Hey people, just started with Nim, so far it's been my favorite language i've been trying out lately (vs Go, Odin). I'm looking for a replacement for C++ and python. Interestingly Nim seems like it would be able to replace both to some degree. |
19:53:49 | Zevv | but still, it's neither C++, nor python |
19:54:04 | shirty | I'm not looking for C++ |
19:54:07 | shirty | or Python |
19:54:10 | FromDiscord | <dom96> Hello shirty! Welcome! 🙂 |
19:54:16 | Zevv | shirty: right, that's the spirit |
19:54:45 | shirty | Zev: right, we understand each other :D |
19:55:07 | Zevv | always, buddy, always |
19:55:39 | Zevv | but the good thing is, if you know both C++ and python, you'll understand why Nim is what it is and does what it does |
19:55:49 | shirty | I still have a few things on my list: Julia, Jai and Zig. |
19:55:56 | Zevv | if you have a background on only one of the two, some things might feel kind of funny in the beginning |
19:56:05 | Zevv | All three very cool |
19:56:42 | shirty | Zevv: yea, that literarily been my experience with it, it feels litterarly like it directly solves my issues with both languages. |
19:56:57 | shirty | I'm surprised also at how much I really like indentation in Nim |
19:57:03 | Zevv | always nice to hear. |
19:57:13 | Zevv | any opinons on the style-insensitive part yet? |
19:57:20 | Zevv | because you have to hate it or love it, as a newby |
19:57:24 | Zevv | only later you can stop caring |
19:57:56 | Zevv | I loathed the indenting in the beginning, but I also stopped caring about that :) |
19:58:29 | mipri | I don't like it, but it doesn't bother me like { at the beginning of a line does. |
19:59:01 | FromDiscord | <mratsim> We can try Jai? |
19:59:12 | disruptek | since when? |
19:59:49 | shirty | Zevv: i like the style insensitive part specifically because I can literally stick to my C style. I have no issues with it, i'm not worried about it, i'm just curious what happens in larger codebases. |
20:00:06 | FromDiscord | <dom96> just wait, Jai will /blow/ your mind |
20:00:07 | disruptek | nothing unsurprising, is the answer. |
20:00:08 | shirty | I have a slight feeling of, hmm, how will it end |
20:00:24 | FromDiscord | <mratsim> @dom96 Zevv will say "nice try but i prefer italian humor" |
20:00:44 | shirty | disruptek mratsim: I don't think you can try it yet |
20:00:55 | shirty | it's available in closed beta form or something\ |
20:01:25 | Zevv | is it really mindblowingly? |
20:01:32 | FromDiscord | <dom96> What's italian humour? Is it things like forcing them to cook and eat Hawaiian pizzas? |
20:01:40 | FromDiscord | <mratsim> More like it's written by Jonathan Blow |
20:01:53 | Zevv | I only read the primer and it looks solid and well thought out, but I didn't see anything really absolutely surpsising yet |
20:01:57 | shirty | My initial feeling about the indentation was I won't like it. But I really like it now, blows c style stuff out the water, it's just cleaner |
20:02:38 | FromDiscord | <mratsim> My take with any language is that it will not cater to my use cases and i will have to write the code from scratch anyway |
20:02:59 | FromDiscord | <mratsim> so i hope it doesn't block me with silly rules |
20:03:04 | Zevv | which made me wonder. Why is there no mratsim-lang yet? |
20:03:05 | FromDiscord | <mratsim> like no operator overloading |
20:03:37 | leorize | mratsim: you sit in the triangle of NIH: cryptography, embedded and sciencific computing :P |
20:03:42 | FromDiscord | <mratsim> https://github.com/numforge/laser/tree/master/laser/lux_compiler |
20:03:55 | FromDiscord | <mratsim> you forgot multithreading |
20:04:20 | Zevv | yeah leorize, you forgot multithreading |
20:04:23 | FromDiscord | <dom96> embedded too? What kind of embedded stuff are you working on? |
20:04:26 | giaco | I've spent time to convert all casts to gentle type conversion and I was happy as it was compiling successfully, but at the end I got "Error: unhandled exception: invalid object conversion" at runtime. That's sad |
20:04:28 | FromDiscord | <mratsim> scientific computing does have a lot of code though I wonder how they shipped things before Docker |
20:04:37 | FromDiscord | <mratsim> I'm not doing embedded. |
20:04:58 | FromDiscord | <dom96> leorize: tut tut |
20:04:59 | FromDiscord | <mratsim> but cryptography happen to be one major use case for embedded |
20:05:10 | FromDiscord | <mratsim> so i write all crypto code with embedded in mind |
20:05:22 | leorize | embedded is just what I derive from mratsim constant reference of "no GC so it works on embedded" :P |
20:05:28 | leorize | no heap* |
20:07:23 | FromDiscord | <dom96> I'd love to know what devices he'd like his code to run on, everything I've seen so far that I'd ever want to use can deal with heap allocs |
20:08:24 | FromDiscord | <mratsim> That is the most popular crypto device out there: https://www.javacardos.com/store/javacard-a40cr.php |
20:08:33 | FromDiscord | <Avatarfighter> Javacards are so coo |
20:08:36 | FromDiscord | <Avatarfighter> cool |
20:08:43 | FromDiscord | <mratsim> mmm it does say support GC |
20:08:50 | FromDiscord | <Avatarfighter> cant believe a jvm runs in our sims and ccs |
20:08:50 | FromDiscord | <mratsim> sent a long message, see http://ix.io/2LOM |
20:09:31 | FromDiscord | <mratsim> but anyway, for crypto, you want to precisely control allocation because you might want to use an encrypted allocator anyway |
20:10:36 | FromDiscord | <mratsim> and for the current crypto I'm working on, it's GPU operation that are more interesting |
20:10:46 | leorize | so the only reason that io2 uses Result[T] is that the security auditors don't want unhandled exceptions? |
20:11:10 | FromDiscord | <mratsim> attack vector for on memory allocators: https://arxiv.org/pdf/1903.00503.pdf |
20:11:52 | FromDiscord | <mratsim> memory retention attacks: https://spacetime.dev/memory-retention-attacks |
20:12:04 | FromDiscord | <mratsim> encrypting secrets in memory: https://spacetime.dev/encrypting-secrets-in-memory |
20:12:05 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
20:13:12 | FromDiscord | <mratsim> @leorize, no, we force raises: [Defect] for part of the code that uses exceptions |
20:13:20 | FromDiscord | <dom96> Wouldn't some more formally verifiable be a huge advantage for these security conscious applications? |
20:13:26 | FromDiscord | <mratsim> yes |
20:13:37 | FromDiscord | <dom96> or would that swing the balance towards "too slow to develop" too much? |
20:13:59 | leorize | wait so what is the exact reason behind io2 using Result[T] then? |
20:14:29 | leorize | that threw me into a loop when I have to decide whether to use Result or exceptions for nim-sys |
20:15:00 | FromDiscord | <mratsim> our main dependency is being formally verified https://github.com/GaloisInc/BLST-Verification |
20:15:39 | FromDiscord | <mratsim> and ther eis a growing movement toward formally verified crypto: https://github.com/mit-plv/fiat-crypto#reading-about-the-code |
20:16:19 | FromDiscord | <mratsim> @leorize Exceptions should be exceptional |
20:16:42 | FromDiscord | <mratsim> network lost or file missing is something that we can't decide whether it's exceptional or not in a library |
20:16:57 | FromDiscord | <mratsim> the user should handle all cases and not only optimize for the happy path |
20:17:27 | FromDiscord | <mratsim> And there are even tools to formally verify crypto assembly code: https://project-everest.github.io/assets/vale2017.pdf |
20:19:16 | leorize | so it boils down to the policy behind exceptions that Status uses |
20:20:00 | FromDiscord | <dom96> Just make a wrapper that catches any exceptions you consider non-exceptional and return a Result[T], done 😛 |
20:20:09 | leorize | I was worried that I miss some niche use cases :P |
20:21:08 | FromDiscord | <mratsim> @dom96 We do that for in some cases |
20:21:12 | leorize | @dom96: their result library do have that, but I guess they want to stick to the policy for something made in-house. |
20:21:25 | FromDiscord | <mratsim> but we don't have a set policy because it's controversial within the team |
20:21:44 | FromDiscord | <mratsim> appart from specify out loud the exceptions that you throw if you throw some |
20:22:14 | disruptek | <mratsim> @leorize Exceptions should be exceptional |
20:22:16 | disruptek | thank you. |
20:22:51 | FromDiscord | <mratsim> you're welcome |
20:24:25 | FromDiscord | <dom96> Really depends on your definition of "exceptional" |
20:24:54 | * | Jehan_ joined #nim |
20:25:16 | leorize | at this point I just do whatever that's mainly done in the language |
20:25:36 | leorize | I'm out of arguments against exceptions with --exceptions:goto |
20:26:55 | ForumUpdaterBot | New thread by Adnan: How to serialize/deserialize my data type with options and DateTime, see https://forum.nim-lang.org/t/7378 |
20:33:13 | FromDiscord | <exelotl> @dom96 I avoid any heap allocation in GBA dev, it's entirely possible (arc works!) but I don't want the performance hit |
20:33:57 | Zevv | leorize: what *were* your arguments then? |
20:38:23 | FromDiscord | <exelotl> the sources of overhead are numerous - you have the cost of invoking malloc, the cost of reference counting, and additionally the heap lives in external work RAM which is slower to access. |
20:40:43 | leorize | Zevv: The high cost when exceptions occurs in zero-cost exceptions models and the non-deterministic properties of setjmp/longjmp used by "normal" exceptions implementations |
20:41:44 | leorize | I read about them wayy back when I was first into programming, so some of them might just be myths :P |
20:44:00 | * | Jehan_ quit (Quit: Leaving) |
20:44:33 | Zevv | there's too many opinions involved when talking exceptions |
20:47:18 | * | narimiran quit (Ping timeout: 256 seconds) |
20:48:17 | * | natrys quit (Quit: natrys) |
20:53:50 | FromDiscord | <mratsim> there is the cost but there is also coding only for the happy path and forgetting to handle a file missing for example |
20:56:06 | * | jkiesian joined #nim |
21:00:54 | leorize | to be fair, if anyone forgot to handle that I won't hold my hopes that they don't `discard` the Result[T]. |
21:01:35 | FromDiscord | <shadow.> lol yeah |
21:02:52 | leorize | speaking about those, I should add a classifier `proc` for error codes so people can match "File not found" cross-platform. |
21:21:00 | disruptek | what? |
21:21:14 | disruptek | why can't you use the existing platform errors? |
21:23:12 | * | shirty quit (Quit: Connection closed) |
21:23:26 | leorize | you expect developers to figure out all the myriad of ENOENT and whatever that is that Microsoft use? |
21:23:46 | disruptek | no, either give me a converter or give me a fatter type. |
21:24:12 | leorize | I'm adding a proc to help classify them, it's not like I'm not giving you the raw errors :P |
21:24:30 | * | disruptek shrugs. |
21:24:51 | disruptek | you may be forget what i wanted to rant about. |
21:24:56 | disruptek | s/may be/made me/ |
21:25:14 | leorize | Overlapped I/O is async, right? https://devblogs.microsoft.com/oldnewthing/20180725-00/?p=99335 :) |
21:25:29 | disruptek | anyway, exceptions are for situations you cannot handle. not code paths that may be anticipated. |
21:26:24 | leorize | I don't know whether I should just make a thread pool and get rid of this overlapped i/o code that I spent a day writing... |
21:27:03 | * | superbia quit (Quit: WeeChat 3.0) |
21:27:04 | leorize | disruptek: it's still too subjective |
21:27:30 | disruptek | which part? |
21:27:56 | leorize | Rust is one of the place where they tried out the concept, and last time I checked, running out of disk space gets you a panic |
21:28:20 | disruptek | well, that's silly. |
21:28:29 | leorize | we're also doing something similar in Nim with Defect vs CatchableError tbh |
21:28:36 | disruptek | well, that's silly. |
21:28:48 | disruptek | OutOfFilesystemSpaceDefect? |
21:30:02 | leorize | no, I meant the separation between "errors that can be handled" vs "fatal errors" |
21:30:18 | leorize | though we are classifying them as "bugs" vs "errors" |
21:30:23 | leorize | afaict, that is |
21:30:25 | disruptek | exactly. |
21:30:53 | disruptek | IndexDefect is a bug; that's obvious, right? |
21:31:07 | disruptek | but asking for a resource from the os and being denied... that's not a bug, is it? |
21:31:16 | disruptek | no amount of additional code is going to solve it. |
21:32:21 | leorize | I don't know, if you stick your pole into the wrong hole (Windows and their stupid path namespaces), it's a bug, and yes, more code will solve it |
21:32:41 | disruptek | i've gotten more than a few bugs from sticking my pole in the wrong hole. |
21:33:23 | disruptek | if more code will solve it, then i guess it's not a defect. |
21:33:31 | leorize | What you get will be an error code like "file not found" or "this device is not available" if you forgot that Windows have path namespaces. Are they fatal then? |
21:34:01 | disruptek | ENOTFOUND is not a defect, though. |
21:34:18 | disruptek | KeyError is an Error and not a defect. |
21:34:47 | leorize | "CON", "COM", etc. are only special under the win32 path namespace, and not under the nt path namespace |
21:35:03 | leorize | and they are definitely not special on linux |
21:35:24 | leorize | your code use that and you run it on windows, it errors with "file not found" |
21:35:28 | leorize | that's a bug in your code |
21:35:58 | disruptek | and more code would solve it, right? |
21:36:15 | leorize | yes, you need some sauce to convert it to NT paths but that's about it |
21:37:27 | disruptek | let's say that a defect is when the programmer and the code don't agree on the semantics. |
21:37:49 | disruptek | IndexDefect -- you think you should be able to access an index that doesn't exist. |
21:38:06 | disruptek | "CON" you think you should be able to treat a special file as unspecial. |
21:38:36 | disruptek | is running out of space the same as trying to access an index that is not available? |
21:38:43 | * | Clonkk[m] left #nim ("User left") |
21:38:48 | leorize | nah, out of space is a property of writes |
21:39:32 | disruptek | i guess it's subjective after all. |
21:39:47 | * | l1x quit (Quit: Connection closed for inactivity) |
21:51:23 | FromDiscord | <Avatarfighter> Yo yo yo what’s popping |
21:51:44 | disruptek | no, we're not doing that. |
21:52:29 | disruptek | clyybber: how did we decide how to do dist? a cfg file? |
21:53:43 | FromDiscord | <Avatarfighter> disruptek: whats popping |
21:53:48 | FromDiscord | <Avatarfighter> 🙂 |
21:53:53 | disruptek | damnit i will choke you out. |
21:54:22 | FromDiscord | <Avatarfighter> Hm |
21:54:29 | FromDiscord | <Avatarfighter> I will consider your offer |
21:54:37 | disruptek | aight. |
21:55:00 | FromDiscord | <Avatarfighter> how is cps doing |
21:55:17 | FromDiscord | <Avatarfighter> Your testes library is working yet? |
21:55:23 | FromDiscord | <Avatarfighter> (edit) removed "is" |
21:55:31 | disruptek | nope. |
21:55:43 | disruptek | as the kids say, |
21:55:44 | disruptek | rip |
21:56:16 | FromDiscord | <Avatarfighter> rip indeed |
21:57:57 | FromDiscord | <dom96> > Overlapped I/O is async, right? https://devblogs.microsoft.com/oldnewthing/20180725-00/?p=99335 🙂↵lol, I hope our customers don't look too closely at asyncfile |
22:00:31 | leorize | btw, the asyncfile code is incorrect regarding synchronous reads :) |
22:00:50 | FromDiscord | <dom96> asyncfile is synchronous |
22:01:20 | FromDiscord | <mratsim> that's not what the name suggest |
22:01:29 | leorize | never call `GetOverlappedResult()` if you don't set an event handle in the `OVERLAPPED` structure |
22:02:47 | leorize | if you don't set an event handle it will query the file handle instead, which might end up querying an another operation that is currently pending on the same file |
22:04:28 | leorize | I am amazed that Win32 applications even worked at all |
22:04:47 | disruptek | who says they worked? |
22:08:54 | leorize | lol |
22:33:29 | reversem3 | how does css work with karax? |
22:34:00 | reversem3 | is after you compile to js and create the html? |
22:34:52 | * | krux02 quit (Remote host closed the connection) |
22:47:29 | FromDiscord | <juan_carlos> Just add your `class` to the html. |
22:50:27 | * | jkiesian quit (Remote host closed the connection) |
22:56:27 | FromGitter | <gogolxdong> i |
22:56:29 | reversem3 | So not a nim file but only in the html file? |
22:58:06 | FromDiscord | <dom96> karax generates html for you |
22:58:12 | FromDiscord | <dom96> just do what you'd do in html |
22:58:51 | leorize | you can also build internal styles with VStyle in case you think CSS sucks |
22:59:31 | * | tane quit (Quit: Leaving) |
23:02:44 | * | piron_ quit (Read error: Connection reset by peer) |
23:03:01 | * | piron_ joined #nim |
23:05:17 | * | Vladar quit (Quit: Leaving) |
23:09:19 | * | PMunch quit (Quit: leaving) |
23:47:23 | * | synshroud joined #nim |
23:58:54 | Zoom[m] | Guys, do we have a star from Yann Colett and if no, how can we get it? https://i.imgur.com/t9YVy8v.png |
23:59:26 | Zoom[m] | *Collett |