00:06:27 | * | solitudesf quit (Ping timeout: 240 seconds) |
00:32:57 | * | krux02 quit (Remote host closed the connection) |
00:34:02 | FromGitter | <deech> How do I write a binding to typedef'd struct pointer? eg. `typedef struct FooImpl *Foo;` |
00:47:28 | * | thomasross joined #nim |
00:57:08 | * | iranika quit (Remote host closed the connection) |
00:58:05 | * | PMunch quit (Quit: Leaving) |
01:41:52 | leorize | @deech: `type Foo = ptr object` |
01:43:03 | leorize | of course you won't be able to allocate this object by yourself since the size is not known, but with most "opaque" C libraries, they should provide you functions to create these types that you can access via FFI |
01:46:02 | * | tiorock joined #nim |
01:46:02 | * | tiorock quit (Changing host) |
01:46:02 | * | tiorock joined #nim |
01:46:02 | * | rockcavera is now known as Guest42242 |
01:46:02 | * | tiorock is now known as rockcavera |
01:49:29 | * | Guest42242 quit (Ping timeout: 272 seconds) |
02:18:31 | * | abm quit (Read error: Connection reset by peer) |
02:26:50 | * | chemist69 quit (Ping timeout: 256 seconds) |
02:26:57 | disruptek | leorize: man, that really seems like a solvable problem. |
02:28:42 | * | chemist69 joined #nim |
02:28:43 | * | Hideki_ joined #nim |
02:31:56 | disruptek | i can't think of a reason that an emit wouldn't work. |
02:35:44 | disruptek | a part of me wishes i could go back to ANSI C-era. |
02:36:53 | disruptek | i wonder if girls and guys back then felt like they were building on top of dogshit. |
02:37:36 | * | dddddd quit (Ping timeout: 256 seconds) |
02:37:36 | disruptek | can you imagine how powerful computers will be when we finally figure out this software thing? |
02:38:08 | disruptek | it'll be like going from running on one cylinder to running on all 40,000. |
02:43:07 | disruptek | let's put ourselves there. |
02:53:13 | disruptek | i mean, at this rate, only you young'ins will live to see it, but still... i feel like we should try. |
02:54:41 | disruptek | shashlick, i'm sorry man, i didn't mean to summon you to your own beheading on that nimterop whine. |
02:55:09 | disruptek | you just have no idea how many times i ran `docker build` today. |
02:55:48 | disruptek | it makes my balls hurt, and i don't say that lightly. |
02:56:15 | disruptek | i guess you could say that i'm sensitive about my balls. |
02:59:38 | disruptek | or, come to think of it, maybe i just have extraordinarily sensitive balls. |
03:00:03 | disruptek | that's really what offends my balls and i about docker. |
03:00:34 | disruptek | here you've got this amazing cloud and you're going to waste the efficiency of the think with all this shit upon shit upon shit? |
03:01:07 | disruptek | nigel is a federated function system. |
03:01:32 | disruptek | FFS |
03:07:10 | FromDiscord_ | <Elegant Beef> Is there a way to use an object constructor without named variables? Where the desired types are just the order of declaration |
03:08:14 | disruptek | the /right/ solution is to create a constructor, because this will likely not be the last time you need one. |
03:08:51 | disruptek | i guess you could generate a template using a macro. |
03:09:34 | disruptek | you could maybe impl `()`. |
03:10:14 | disruptek | everything else seems to "manual" to justify, to me. |
03:10:20 | disruptek | s/to/too/ |
03:13:44 | FromDiscord_ | <Elegant Beef> Creating a constructor, i assume just means making a TCtr proc? |
03:14:02 | disruptek | yeah, name it anything you want. |
03:14:21 | FromDiscord_ | <Elegant Beef> the impl () im unclear on\ |
03:14:22 | FromDiscord_ | <Elegant Beef> the impl () im unclear on |
03:14:22 | disruptek | convention is newT() though. |
03:14:33 | FromDiscord_ | <Elegant Beef> Im from C# so fuck that convention π |
03:15:04 | disruptek | there's an experimental support for implementing proc `()`() |
03:15:24 | disruptek | that's call, for a type. |
03:15:35 | FromDiscord_ | <Elegant Beef> You mean overriding the default constructor? |
03:15:41 | disruptek | yeah. |
03:15:57 | disruptek | i dunno what they call it in c#. i only did some hax in it. |
03:16:11 | * | thomasross quit (Ping timeout: 260 seconds) |
03:16:31 | FromDiscord_ | <Elegant Beef> I mean in C# you declare your own constructor, and can have as many types as you want, but it's return type and name matches the class you're instantiating |
03:16:41 | disruptek | elegant beef, how come you don't come 'round no more? |
03:16:48 | * | thomasross joined #nim |
03:16:56 | FromDiscord_ | <Elegant Beef> huh? |
03:17:00 | disruptek | right, i remember that. |
03:17:17 | disruptek | i just dunno all the nomenclature because i'm dumb. |
03:17:38 | disruptek | honestly, there's an elegance to c#. |
03:17:48 | disruptek | it's very disneyland. |
03:17:49 | FromDiscord_ | <Elegant Beef> "elegant beef, how come you don't come 'round no more?" |
03:17:49 | FromDiscord_ | <Elegant Beef> I havent been here for more than like a week, i've been here plenty! |
03:18:02 | FromDiscord_ | <Elegant Beef> I mean nim has a ton of cool features i like |
03:18:17 | disruptek | let's talk about them. |
03:18:20 | FromDiscord_ | <Elegant Beef> being able to declare a proc and it will take the left hand in as a variable if it matches the first param |
03:18:37 | FromDiscord_ | <Elegant Beef> In C# you'd need an extension method and a class method for both |
03:18:42 | disruptek | i mean seriously, this is an opportunity for us to learn what brings people to nim. what's working. |
03:19:02 | FromDiscord_ | <Elegant Beef> It makes it so even floats feel more like objects |
03:19:10 | FromDiscord_ | <Elegant Beef> Which for an OOP language is important imo |
03:19:17 | disruptek | can you gimme an example? |
03:19:31 | disruptek | oh, mutable arguments? |
03:20:02 | disruptek | but you have out vars in c#. |
03:20:13 | disruptek | isn't that basically the same? |
03:20:28 | FromDiscord_ | <Elegant Beef> https://play.nim-lang.org/#ix=2b2B |
03:20:29 | FromDiscord_ | <Elegant Beef> No |
03:21:10 | disruptek | oh, you like the syntax. |
03:21:14 | FromDiscord_ | <Elegant Beef> In C# you'd need the `Add(int,int)` and extension method `Add(this int, int)` |
03:21:25 | disruptek | right. |
03:21:44 | FromDiscord_ | <Elegant Beef> Sure syntax, i say it allows data types feel more like objects |
03:21:55 | FromDiscord_ | <Elegant Beef> *I do wish i could use tabs though* |
03:22:10 | disruptek | yeah, the hardest thing about it is deciding what you like. just like with the symbol naming convention. yet everyone bitches about it. |
03:22:14 | FromDiscord_ | <Elegant Beef> I also like that nim doesnt require any special runtimes, so i can just run the built ap |
03:22:31 | FromDiscord_ | <Elegant Beef> app* |
03:22:41 | disruptek | you can use tabs with a source code filter. i did that for a little while. |
03:22:47 | disruptek | but, it's pointless to resist. |
03:22:56 | FromDiscord_ | <Elegant Beef> Tabs are superior |
03:23:04 | disruptek | agree. |
03:23:17 | disruptek | but, don't care. |
03:23:23 | FromDiscord_ | <Elegant Beef> The fact the user chooses how deep they are just makes it nicer to work with |
03:23:28 | disruptek | agree. |
03:23:38 | disruptek | but, turns out it's not what's important. |
03:24:31 | disruptek | and if that's what you're using to govern your language decisions, i feel like nim might be a little to sharp an instrument for a craftsman of your caliber. |
03:24:41 | disruptek | s/to/too/ |
03:25:25 | disruptek | 'til then, you can put this at the top of your tabbed source: |
03:25:28 | disruptek | #? replace(sub = "\t", by = " ") |
03:27:18 | disruptek | that reads a little more savage than it was intended; sorry! |
03:27:38 | disruptek | it wasn't mean to be accusatory. |
03:27:42 | disruptek | meant, rather. |
03:27:44 | FromDiscord_ | <Elegant Beef> tabbed source, that's uhh, a thing |
03:27:44 | disruptek | it was mean. |
03:28:13 | disruptek | yeah; you do that thing and you can have tabulators in your .nim. |
03:28:40 | FromDiscord_ | <Elegant Beef> Dont worry you could say much worse and i'd not be offended |
03:28:56 | disruptek | really? |
03:29:04 | FromDiscord_ | <Elegant Beef> and what's with the `s/to/too` |
03:29:07 | disruptek | you've got a condition? |
03:29:28 | FromDiscord_ | <Elegant Beef> Yea it involves not being offended by things on the internet |
03:29:30 | disruptek | it's a substitution, sed-style. |
03:29:35 | FromDiscord_ | <Elegant Beef> Call not giving a *uck* |
03:29:44 | disruptek | ah, nice. |
03:30:07 | disruptek | you know, you can catch that disease and be cured of it just as quick. |
03:30:27 | disruptek | lol |
03:30:33 | FromDiscord_ | <Elegant Beef> doubtful |
03:30:37 | FromDiscord_ | <Elegant Beef> I've had it as long as i can recall |
03:30:56 | disruptek | anyway, the problem with using tabs is just that no one else does. |
03:31:15 | FromDiscord_ | <Elegant Beef> Yea i know, even in C# people use "tabs" |
03:31:16 | disruptek | so you will fight an uphill battle, especially when publishing. |
03:31:44 | FromDiscord_ | <Elegant Beef> Only an issue if people are interested in your code |
03:31:47 | * | muffindrake quit (Ping timeout: 240 seconds) |
03:31:52 | FromDiscord_ | <Elegant Beef> Never write useful code, ever have a problem |
03:31:55 | FromDiscord_ | <Elegant Beef> never* |
03:32:11 | disruptek | dat logic. |
03:32:51 | disruptek | my next nimble package will be rewritten in rot-13. |
03:34:23 | * | muffindrake joined #nim |
03:35:13 | FromDiscord_ | <Elegant Beef> kill it with fire |
03:35:13 | FromDiscord_ | <Elegant Beef> ` return Command(niceName : niceName,name : name,id : id,runner : runner,dir : dir)` |
03:35:33 | disruptek | what is that? |
03:35:43 | FromDiscord_ | <Elegant Beef> The return line on, my constructor |
03:35:48 | FromDiscord_ | <Elegant Beef> On my badly named object |
03:36:55 | disruptek | put it on 5 lines. |
03:37:05 | disruptek | move on with your life. |
03:37:26 | disruptek | you are young yet, but it will not last. |
03:37:31 | FromDiscord_ | <Elegant Beef> What |
03:38:09 | disruptek | five shall be the number of lines, and the number of lines shall not exceed five. |
03:38:35 | disruptek | neither shall the number of lines be less than five. in particular, the number of lines need not be one. |
03:38:36 | FromDiscord_ | <Elegant Beef> Not 3? |
03:39:03 | FromDiscord_ | <Elegant Beef> I fart in your general direction |
03:39:11 | disruptek | fair enough. |
03:41:02 | disruptek | i have to watch this right now. |
03:41:50 | disruptek | we were talking at fosdem about how everyone saw it in a different language, first, and later saw it in english. |
03:42:20 | FromDiscord_ | <Elegant Beef> And just like that another soul was lost to the disease known as nostalgia |
03:42:20 | disruptek | sadly, i cannot change the source audio on netflix. |
03:42:33 | FromDiscord_ | <Elegant Beef> VPN/DNS π |
03:42:41 | FromDiscord_ | <Elegant Beef> Dont ask why i said DNS |
03:42:43 | FromDiscord_ | <Elegant Beef> It's cause im daft |
03:42:58 | disruptek | oddly, there are foreign subtitles. |
03:43:08 | disruptek | π |
03:51:46 | FromDiscord_ | <Chiqqum_Ngbata> I come to the conclusion that I want newTuple(arity) |
03:51:49 | FromDiscord_ | <Chiqqum_Ngbata> What's the workaround |
03:52:13 | FromDiscord_ | <Chiqqum_Ngbata> Can't use Set; might have duplicates |
03:53:07 | disruptek | that's odd, because objects are pretty lightweight. |
03:53:22 | FromDiscord_ | <Elegant Beef> cant use a seq either? |
03:53:30 | FromDiscord_ | <Chiqqum_Ngbata> seqs can only contain the same type right? |
03:53:39 | disruptek | yeah. |
03:54:16 | disruptek | is the arity arbitrary or is it one of, say, an enum's possible values? |
03:54:37 | FromDiscord_ | <Chiqqum_Ngbata> The arity is known at runtime |
03:55:11 | disruptek | maybe what you really want is a variant object with arity kinds, each with a variably-sized tuple. |
03:55:33 | FromDiscord_ | <Chiqqum_Ngbata> Actually, is it possible to get arity of tuple typedesc? |
03:55:51 | disruptek | you could do it with a macro. |
03:57:47 | FromDiscord_ | <Chiqqum_Ngbata> Eh, I do want this to be runtime. The library I'm interacting with sets arity; I'd rather trust the arity this C function call gives me rather than user-defined arity in nim |
03:57:51 | FromDiscord_ | <Chiqqum_Ngbata> So impossible? |
03:58:03 | disruptek | did you look at typetraits? |
03:58:15 | disruptek | i think there's an arity fetcher in there. |
03:58:22 | FromDiscord_ | <Chiqqum_Ngbata> I read something about that not working with --gc:arc ? |
03:59:21 | disruptek | why? does it use repr? |
03:59:43 | disruptek | that seems bizarre. |
04:00:46 | shashlick | disruptek: no worries π |
04:02:01 | disruptek | π |
04:08:29 | FromDiscord_ | <Chiqqum_Ngbata> It doesn't want me assigning to this new tuple (based on typedesc) at runtime |
04:09:01 | disruptek | assigning to it? |
04:09:48 | disruptek | do you have a good reason for not using an object? |
04:09:54 | FromDiscord_ | <Chiqqum_Ngbata> Yeah, say I have `var t: T` and want to set t[0] = 1 |
04:10:25 | disruptek | i think you just answered my question. |
04:10:58 | disruptek | please, use an object. that's what they were made for. |
04:11:56 | FromDiscord_ | <Chiqqum_Ngbata> So not possible to assign to index of tuple at runtime? |
04:13:10 | disruptek | never. |
04:14:35 | FromDiscord_ | <Winton> que viva Nim π Forever |
04:20:04 | FromDiscord_ | <Chiqqum_Ngbata> Iteration order of object fields guaranteed as defined? |
04:22:52 | disruptek | is this really the hill you want to die on, son? |
04:23:17 | FromDiscord_ | <Chiqqum_Ngbata> Yeah you're right, I'm giving up on solving this in nim. It doesn't look like there's a good way to do this |
04:23:23 | FromDiscord_ | <Chiqqum_Ngbata> Screws up my entire API but w/e |
04:23:58 | FromDiscord_ | <Elegant Beef> What is the data you're exactly storing? |
04:27:42 | * | dadada quit (Ping timeout: 268 seconds) |
04:31:48 | * | sagax quit (Read error: Connection reset by peer) |
04:38:47 | * | lritter quit (Ping timeout: 260 seconds) |
04:39:01 | FromDiscord_ | <Winton> Si hablo espaΓ±ol |
04:39:18 | * | lritter joined #nim |
04:56:57 | * | gangstacat quit (Ping timeout: 272 seconds) |
04:58:41 | * | lritter quit (Quit: Leaving) |
06:01:47 | * | rockcavera quit (Remote host closed the connection) |
06:22:32 | * | nsf joined #nim |
06:37:39 | * | adalricus joined #nim |
06:57:02 | * | greenfork joined #nim |
07:00:55 | * | narimiran joined #nim |
07:11:45 | * | blueberrypie quit (Quit: Ping timeout (120 seconds)) |
07:12:20 | * | blueberrypie joined #nim |
07:13:59 | rayman22201 | @disruptek: did you see the daily paper link I sent this morning? Reminds me of your cloud aspirations |
07:16:31 | * | thomasross quit (Ping timeout: 260 seconds) |
07:21:58 | * | thomasross joined #nim |
07:24:48 | * | marmotini_ joined #nim |
07:25:13 | * | marmotini_ quit (Read error: Connection reset by peer) |
07:25:44 | * | marmotini_ joined #nim |
07:33:24 | * | thomasross quit (Ping timeout: 256 seconds) |
07:34:18 | * | thomasross joined #nim |
07:34:42 | * | dadada joined #nim |
07:35:05 | * | dadada is now known as Guest58774 |
07:38:13 | * | solitudesf joined #nim |
07:39:23 | * | thomasross quit (Ping timeout: 260 seconds) |
07:42:56 | * | Guest58774 is now known as dadada |
07:44:49 | * | thomasross joined #nim |
07:46:01 | * | marmotini_ quit (Read error: Connection reset by peer) |
07:48:13 | * | hax-scramper joined #nim |
07:56:17 | * | Hideki_ quit (Remote host closed the connection) |
08:05:56 | * | gmpreussner joined #nim |
08:07:07 | * | thomasross quit (Ping timeout: 240 seconds) |
08:08:43 | * | thomasross joined #nim |
08:12:19 | FromDiscord_ | <Rika> make a custom proc for an object `[]` |
08:12:21 | * | thomasross is now known as Guest65607 |
08:12:21 | * | thomasross_ joined #nim |
08:12:21 | * | Guest65607 quit (Killed (adams.freenode.net (Nickname regained by services))) |
08:12:21 | * | thomasross_ is now known as thomasross |
08:12:21 | FromDiscord_ | <Rika> what |
08:12:27 | FromDiscord_ | <Rika> oops, pressed enter early |
08:13:33 | FromDiscord_ | <Rika> ah |
08:17:07 | * | dadada quit (Ping timeout: 240 seconds) |
08:19:11 | * | dadada joined #nim |
08:19:35 | * | dadada is now known as Guest25567 |
08:23:25 | * | hax-scramper quit (Read error: Connection reset by peer) |
08:24:49 | * | nsf quit (Quit: WeeChat 2.7) |
08:28:51 | * | theelous3 quit (Ping timeout: 260 seconds) |
08:32:24 | * | Hideki_ joined #nim |
08:49:20 | * | hax-scramper joined #nim |
09:00:53 | FromDiscord_ | <Rika> @Chiqqum_Ngbata i just had a massively idiotic idea that might just fit your specifications |
09:01:49 | FromDiscord_ | <Rika> make a seq[(string, typedesc)], then when storing, serialize into string and store typedesc, reverse if you're accessing; i dont know if typedesc is limited to compiletime though |
09:02:51 | * | Trustable joined #nim |
09:05:06 | FromDiscord_ | <demotomohiro> !eval var a:seq[(string, typedesc)]; echo a.len |
09:05:08 | NimBot | Compile failed: Error: internal error: getTypeDescAux(tyNone) |
09:05:31 | FromDiscord_ | <Rika> π€ |
09:05:39 | FromDiscord_ | <Rika> that made me laugh a bit |
09:20:21 | FromGitter | <alehander92> <3 |
09:20:23 | FromGitter | <alehander92> morning |
09:20:31 | FromGitter | <alehander92> what is the daily paper |
09:20:38 | FromGitter | <alehander92> is it a real service |
09:31:36 | * | hax-scramper quit (Read error: Connection reset by peer) |
09:31:50 | * | hax-scramper joined #nim |
09:38:14 | * | Hideki_ quit (Remote host closed the connection) |
09:38:34 | * | Guest25567 is now known as dadada |
09:39:24 | * | Hideki_ joined #nim |
09:44:29 | * | Hideki_ quit (Ping timeout: 272 seconds) |
09:45:33 | * | Hideki_ joined #nim |
09:46:51 | * | Hideki_ quit (Remote host closed the connection) |
09:47:48 | * | Hideki_ joined #nim |
09:55:38 | * | Hideki_ quit (Ping timeout: 240 seconds) |
10:08:19 | FromDiscord_ | <mratsim> @Pmunch, I didn't receive an email to check my video talk for FOSDEM, is that normal? |
10:17:35 | * | sagax joined #nim |
10:21:04 | * | gangstacat joined #nim |
10:21:49 | Araq | mratsim: happened to me too, join #fosdem-video and ask for a direct link |
10:23:39 | * | krux02 joined #nim |
10:23:57 | FromDiscord_ | <mratsim> So I have to configure this ancient protocol called IRC :/ |
10:24:07 | Yardanico | lol |
10:26:14 | * | Hideki_ joined #nim |
10:31:21 | * | narimiran quit (Ping timeout: 272 seconds) |
10:34:27 | * | marmotini_ joined #nim |
10:35:17 | FromDiscord_ | <sveri> I am curious. Nim has a AsyncHttpServer, but no synced http server. Is there a reason for this? Or is it just to show async capabitilities? |
10:35:37 | Yardanico | well, I don't think there's much sense in a synced http server :) |
10:35:49 | Yardanico | and you can just use asynchttpserver with sync code too, nobody stops you from doing that |
10:35:53 | Yardanico | but it will block then |
10:37:03 | FromDiscord_ | <sveri> That makes sense, thank you. I was just interested in the old way of having a server that spawns threads for each request. |
10:37:16 | Yardanico | well, I just think it wouldn't really be efficient |
10:37:25 | Yardanico | IO is slow, so use async for IO-bound stuff :) |
10:37:29 | Yardanico | and you can use threads with async too |
10:37:41 | * | marmotini_ quit (Read error: Connection reset by peer) |
10:38:02 | Yardanico | just need to be sure that you don't pass GCed stuff between threads, or use --gc:arc (on devel, has shared heap) or --gc:boehm (boehm gc with shared heap) |
10:38:04 | FromDiscord_ | <sveri> my 5 TB RAM cluster makes IO super fast π Just joking. |
10:38:04 | FromDiscord_ | <sveri> I see. |
10:38:29 | * | greenfork quit (Remote host closed the connection) |
10:39:50 | * | Hideki_ quit (Ping timeout: 256 seconds) |
10:41:44 | * | uu91 joined #nim |
10:43:28 | FromGitter | <Varriount> Yardanico: Doesn't arc use a whole "only one thread can own a object graph at a time" thing? |
10:43:43 | Yardanico | I don't really know about that, sorry |
10:43:57 | Yardanico | but I remember arc being advertised supporting shared-heap :P |
10:44:09 | FromGitter | <Varriount> https://forum.nim-lang.org/t/5734#35571 |
10:45:16 | * | ng0_ joined #nim |
10:48:07 | * | ng0 quit (Ping timeout: 240 seconds) |
11:02:43 | FromGitter | <garuse> why is mratsim's fosdem talk not available yet? |
11:08:43 | * | thomasross quit (Ping timeout: 272 seconds) |
11:09:02 | * | thomasross joined #nim |
11:13:00 | * | dddddd joined #nim |
11:13:13 | * | filcuc joined #nim |
11:16:23 | * | PMunch joined #nim |
11:17:13 | FromDiscord_ | <mratsim> they didn't send me a mail to verify my video ... |
11:19:25 | FromDiscord_ | <mratsim> @Araq, some interesting stuff on formal verification: |
11:19:25 | FromDiscord_ | <mratsim> Formal verification of crypto using Z3: https://saw.galois.com/ https://github.com/GaloisInc/saw-script |
11:19:25 | FromDiscord_ | <mratsim> And array bound checking, preconditions/postconditions/invariants, null pointer exceptions using a language agnostic CFG: https://github.com/seahorn/crab |
11:23:03 | * | hlavaty joined #nim |
11:26:14 | Zevv | thanks for the explanation of the sleep thing mratsim1 |
11:32:27 | FromGitter | <garuse> thanks mratsim. i hope it will be available soon. |
11:42:48 | * | Ven`` joined #nim |
11:46:02 | * | filcuc quit (Ping timeout: 240 seconds) |
11:49:55 | * | NimBot joined #nim |
11:54:36 | * | filcuc joined #nim |
11:56:48 | * | ng0 joined #nim |
11:56:51 | * | ng0 quit (Changing host) |
11:56:51 | * | ng0 joined #nim |
11:57:11 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
11:59:27 | * | ng0_ quit (Ping timeout: 240 seconds) |
12:08:32 | * | vesper11 joined #nim |
12:08:39 | * | vesper quit (Ping timeout: 260 seconds) |
12:15:04 | PMunch | Hmm, why doesn't single line try/except work? if (try: discard parseEnum[Commands](elem.strVal); true; except: false): |
12:18:55 | PMunch | Ah, works with another level of brackets: if (try: (discard parseEnum[Commands](elem.strVal); true) except: false): |
12:22:20 | PMunch | Are there any pure Nim libraries for creating a REPL? |
12:22:44 | PMunch | Currently I'm using the built in rdstdin, but I'd like to add tab completion and on the fly colouring |
12:23:35 | * | dddddd quit (Ping timeout: 260 seconds) |
12:23:47 | Zevv | If there was, Nim would not ship with linenoise, likely |
12:29:39 | PMunch | Hmm, there is `prompt` which looks promising https://github.com/surf1nb1rd/nim-prompt/blob/master/prompt.nim |
12:29:50 | PMunch | But it doesn't support the live colouring stuff |
12:29:54 | PMunch | Only auto-complete |
12:30:38 | FromDiscord_ | <Rika> how does live coloring work anyway |
12:30:47 | PMunch | I guess for live colouring to work you'd need to have a two way translate function that gets a buffer to display, and can return indices |
12:31:00 | PMunch | Rike, what do you mean how does it work? |
12:31:25 | FromDiscord_ | <Rika> terminal coloring is controlled by ansi codes, right |
12:31:29 | PMunch | Yeah |
12:31:34 | FromDiscord_ | <Rika> are there other methods? how would coloring work |
12:31:48 | FromDiscord_ | <Rika> when you're adding color to detected syntax or so |
12:35:09 | PMunch | Well I don't know if there are any libraries that support this |
12:36:51 | * | Hideki_ joined #nim |
12:36:52 | * | theelous3 joined #nim |
12:37:23 | PMunch | My idea was just to have a prompt library that deals with inputs and such, and then have a callback it would call before displaying anything where I could write a procedure that would colour the output |
12:41:19 | * | Hideki_ quit (Ping timeout: 260 seconds) |
12:44:18 | * | ng0_ joined #nim |
12:44:39 | * | nsf joined #nim |
12:46:27 | * | dadada quit (Ping timeout: 260 seconds) |
12:47:31 | * | ng0 quit (Ping timeout: 272 seconds) |
13:07:29 | * | ng0_ is now known as ng0 |
13:09:53 | * | dadada joined #nim |
13:10:17 | * | dadada is now known as Guest53397 |
13:29:54 | dom96 | so that's interesting |
13:30:02 | dom96 | nim-lang.org's search traffic doubled yesterday |
13:30:14 | dom96 | more than doubled in fact |
13:30:19 | FromDiscord_ | <Rika> huh |
13:30:22 | dom96 | I thought it might be a Google Analytics bug |
13:30:28 | FromDiscord_ | <Rika> maybe it's the towardsdatascience article |
13:30:29 | dom96 | but I just confirmed it via Google's search console |
13:30:43 | FromDiscord_ | <Rika> there was an article in towardsdatascience about nim |
13:30:43 | dom96 | link? |
13:31:01 | FromDiscord_ | <Rika> https://towardsdatascience.com/could-nim-replace-python-547145afcfd5 |
13:31:09 | FromDiscord_ | <Rika> was released 2 days ago |
13:31:31 | dom96 | ahh, this one. I tweeted about it on Nim's twitter |
13:31:51 | dom96 | The timelines certainly align |
13:32:14 | dom96 | and there are no links in that article so people are likely to search Nim |
13:32:24 | dom96 | cool |
13:32:29 | * | arecaceae quit (Remote host closed the connection) |
13:32:47 | * | arecaceae joined #nim |
13:34:33 | dom96 | The increase in users shown by analytics is 11x what it usually is (for each day) :O |
13:36:41 | lqdev[m] | > Though Nim is technically run with an interpreter, it should be noted that Nim also has its own compiler. |
13:36:45 | lqdev[m] | uh? |
13:36:56 | lqdev[m] | since when is Nim interpreted? |
13:36:57 | * | kungtotte quit (Read error: Connection reset by peer) |
13:37:12 | dom96 | yeah, someone should ask the author to correct this |
13:37:14 | lqdev[m] | yeah it has NimScript, but that's a much more limited version of the actual language |
13:38:23 | * | kungtotte joined #nim |
13:38:34 | lqdev[m] | > Nimβs code-base is primarily structured on the functional paradigm. |
13:38:43 | lqdev[m] | maybe I don't understand what 'functional' means here, but I wouldn't agree with this statement |
13:39:03 | * | leorize quit (Ping timeout: 240 seconds) |
13:41:13 | * | ng0_ joined #nim |
13:44:07 | * | ng0 quit (Ping timeout: 240 seconds) |
13:45:29 | lqdev[m] | dom96: seems like treeform_ already commented on the article, 2 days ago. |
13:49:13 | * | Guest53397 is now known as dadada |
13:53:22 | dadada | it just occurred to me that Nim's logo is pretty cool when seeing it in that article |
13:54:22 | * | leorize joined #nim |
13:56:06 | dadada | that article is fraught with errors |
14:01:34 | PMunch | Yeah, the article is really bad. But it has reached pretty far |
14:01:44 | PMunch | A guy at work got it reccomended to him through some algorithm |
14:01:53 | PMunch | And sent me a message about it :P |
14:02:28 | PMunch | And dadada I agree that the Nim logo is pretty neat :) |
14:03:03 | PMunch | We should really make some cardboard cut Nim crowns for next years FOSDEM |
14:03:24 | dadada | great idea |
14:03:29 | PMunch | Would probably be pretty easy to get a laser cutter to cut them and slightly colour the edges to make an outline |
14:03:50 | dadada | is there nim merchandise so far? shirts? |
14:04:44 | PMunch | There are shirts and a mug at least |
14:05:26 | dadada | where? |
14:05:54 | dadada | I expected to find a link to the store on the donate page, though there's none |
14:06:07 | PMunch | https://teespring.com/nimlang1 https://teespring.com/nimlang2 https://teespring.com/nimlang_mug |
14:07:37 | PMunch | Zevv, do you have the design for the one you created by the way? |
14:09:48 | * | Ven`` joined #nim |
14:13:23 | Zevv | sorry, design of what? |
14:14:20 | Zevv | oh the shirt, sorry |
14:14:31 | Zevv | http://zevv.nl/div/ni.png |
14:14:54 | Zevv | it looks crap as PNG, but on black it is okish |
14:15:09 | Zevv | disruptek: you awake? |
14:15:16 | dadada | stuff like that should be available form nim-lang.org, also to collect money for running the servers |
14:23:07 | * | narimiran joined #nim |
14:29:48 | FromDiscord_ | <treeform> Do you guys know what this <//> syntax do? |
14:29:48 | FromDiscord_ | <treeform> |
14:29:49 | FromDiscord_ | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/675709876374339594/unknown.png |
14:30:01 | narimiran | it was just a placeholder |
14:33:05 | FromDiscord_ | <treeform> for what? |
14:33:17 | narimiran | owned IIRC |
14:33:58 | FromDiscord_ | <treeform> ok |
14:34:15 | FromDiscord_ | <treeform> newSeq gives you a non ref-seq while newTable gives you a ref-table... |
14:34:22 | FromDiscord_ | <treeform> Why is newSeq not initSeq? |
14:34:39 | FromDiscord_ | <treeform> Why is difference between Table and TableRef important? |
14:35:31 | narimiran | "Why is newSeq not initSeq?" i would say (and i might be wrong) it is because of historical reasons and now it is too late to change it |
14:36:41 | * | ng0 joined #nim |
14:36:41 | * | ng0 quit (Changing host) |
14:36:41 | * | ng0 joined #nim |
14:37:47 | FromDiscord_ | <treeform> You are probably right |
14:39:40 | * | ng0_ quit (Ping timeout: 265 seconds) |
14:41:58 | PMunch | Anyone know who surf1nb1rd on GitHub is? |
14:42:41 | PMunch | dadada, the ones I linked from treeform are official and should contribute to that |
14:42:51 | PMunch | Urm, teespring.. |
14:43:19 | dadada | PMunch: is there a link from nim-lang.org? |
14:43:36 | dadada | it should at least appear in the donate section IMO |
14:43:49 | PMunch | I totally agree |
14:43:54 | PMunch | I found them here: https://forum.nim-lang.org/t/3284 |
14:44:02 | PMunch | But I remember when they were first posted |
14:44:17 | PMunch | I think they might've been updated though |
14:44:27 | PMunch | IIRC there is a mug design with the logo on both sides |
14:45:14 | PMunch | dom96, do you have any updates on merch? |
14:45:32 | FromDiscord_ | <treeform> lol I am teespring now π |
14:45:43 | FromDiscord_ | <Recruit_main_70007> @treeform is that vs? |
14:46:10 | PMunch | treeform, narimiran, isn't init vs new when you create an object vs ref object? |
14:46:16 | narimiran | it is |
14:48:38 | PMunch | Hmm, with nimble is it possible to require a library from a fork? |
14:50:27 | PMunch | Ah, never mind, I can just specify the full github URL |
14:54:26 | * | Hideki_ joined #nim |
14:56:14 | dadada | found this pretty interesting https://codescene.io/# |
14:56:37 | dadada | sadly proprietary, but free for FOSS, it doesn't have nim support yet |
14:57:47 | * | thomasross quit (Ping timeout: 240 seconds) |
14:59:41 | dadada | the video on the frontpage explains it well |
15:03:15 | FromDiscord_ | <sveri> Hi again. So I tried for some time now to have the AsyncHttpServer accept multiple requests at the same time using threads, but did not succeed to do so. Is that even possible at all? |
15:05:35 | * | Hideki_ quit (Remote host closed the connection) |
15:05:51 | * | sveri joined #nim |
15:06:34 | * | Hideki_ joined #nim |
15:07:09 | * | rockcavera joined #nim |
15:07:17 | * | Hideki_ quit (Remote host closed the connection) |
15:07:34 | * | Hideki_ joined #nim |
15:07:45 | * | thomasross joined #nim |
15:08:29 | * | Hideki_ quit (Remote host closed the connection) |
15:09:00 | * | Hideki_ joined #nim |
15:09:43 | * | vesper11 quit (Ping timeout: 260 seconds) |
15:10:17 | * | Zectbumo quit (Remote host closed the connection) |
15:11:24 | * | vesper11 joined #nim |
15:13:02 | FromDiscord_ | <treeform> @sveri I would say its difficult. HttpBeast written by dom does it, because dom is smart and wrote all of Async stuff. The new --gc:arc run should make async+threads interactions easier, but that is still in progress. The new --gc:arc is the main focus of nim development right now. I think we all would like the async+threads interactions to be easier. |
15:13:35 | FromDiscord_ | <treeform> I recommend not doing async+threads for now and wait for the smart people in charge to figure it out for us. |
15:13:52 | FromDiscord_ | <treeform> Just use async - 1 thread. Or threas but no async for now. |
15:14:44 | FromDiscord_ | <sveri> @treeform Thanks for stating my assumptions. |
15:14:44 | FromDiscord_ | <sveri> My thinking is that it should be easier to have a server running with threads and introduce async / await down the call stack if it's needed? |
15:15:33 | FromDiscord_ | <sveri> that's at least what I did in other languages. |
15:15:34 | FromDiscord_ | <treeform> Not sure what you mean. |
15:15:45 | FromDiscord_ | <treeform> down the call stack* |
15:16:05 | dadada | https://github.com/marketplace/codescene 5 open source projects can be analyzed for free |
15:16:21 | dadada | might be interesting to find out what the technical debt of nim is according to it |
15:16:29 | FromDiscord_ | <treeform> @sveri for async, the dispatcher must live at the highest level in order to dispatch IO stuff. It can't live down the stack. |
15:16:46 | FromDiscord_ | <treeform> You would do it like HttpBeast |
15:16:55 | dadada | darn, forgot for a second it doesn't support Nim yet |
15:16:58 | FromDiscord_ | <treeform> where each thread has its own io dispatcher |
15:17:52 | FromDiscord_ | <sveri> @treeform Yea, that's what I mean. |
15:17:53 | FromDiscord_ | <sveri> I guess I still did not understand async / await completely. |
15:17:53 | FromDiscord_ | <sveri> Thanks for bringing up httpBeast, I will read some more π |
15:18:51 | FromDiscord_ | <treeform> @sveri, http beast is not that big, its around 1000 lines: https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim |
15:19:30 | FromDiscord_ | <sveri> I am looking into it right now. I wonder why it would not work on windows? |
15:19:39 | FromDiscord_ | <treeform> That said you probably don't need its thread+async performance for your project. My recommendation is just wait for people smarter then us to figure out the async+thread stuff. |
15:20:01 | FromDiscord_ | <sveri> @treeform I definitely do not need it. I just want to try out stuff π |
15:21:22 | FromDiscord_ | <treeform> windows uses a different low level networking API then Linux/Mac it was just not implemented. |
15:21:29 | FromDiscord_ | <treeform> Probably because most HTTP servers don't run on windows. |
15:22:28 | FromDiscord_ | <treeform> You can see it creates a bunch of threads here: https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim#L420 |
15:22:49 | FromDiscord_ | <treeform> Each thread runs its own event loop: https://github.com/dom96/httpbeast/blob/master/src/httpbeast.nim#L268 |
15:24:13 | FromDiscord_ | <treeform> So its kind of running N separate nim programs. I don't think these threads communicate with each other. They use the OS's ReuseAddr to connect to the same address:port pair. |
15:24:34 | FromDiscord_ | <treeform> You could probably do the same thing with N normal single threaded async programs. |
15:26:04 | FromDiscord_ | <sveri> Interesting take. I did not know you could do that. |
15:26:04 | FromDiscord_ | <sveri> Basically like just starting x AsyncHttpServers on your machin depending on the amount of cores you have and put a load balancer in front of it. |
15:26:16 | FromDiscord_ | <treeform> yeah |
15:26:21 | FromDiscord_ | <treeform> but the load balancer is the OS |
15:26:34 | FromDiscord_ | <sveri> Exactly. And it's less ceremony. |
15:26:54 | FromDiscord_ | <treeform> I usually put nginx in front of my nim servers. |
15:27:18 | FromDiscord_ | <treeform> I could load balance there or event between different computers. |
15:27:42 | FromDiscord_ | <treeform> I also have used haproxy in the past... |
15:27:55 | FromDiscord_ | <Rika> > Why is difference between Table and TableRef important? |
15:27:56 | FromDiscord_ | <Rika> i think because you want to not always need to deref to work on the table |
15:28:22 | FromDiscord_ | <sveri> I used nginx too, just for the ease of installing letsencrypt with it π |
15:28:38 | FromDiscord_ | <treeform> Totally, HTTPS is a must in todays world. |
15:29:02 | FromDiscord_ | <treeform> I recommend using nginx to load balance. |
15:29:18 | FromDiscord_ | <treeform> And maybe some thing like redis for inter process communication. |
15:29:52 | FromDiscord_ | <sveri> I agree with using nginx as a load balancer. IPC makes things harder. I would avoid that as long as possible. |
15:29:58 | FromDiscord_ | <treeform> This will mean that you could run your server on multiple machines if you need too. |
15:30:15 | FromDiscord_ | <treeform> Well you are asking about async+threads |
15:30:22 | FromDiscord_ | <treeform> so you must have big problems π |
15:30:33 | FromDiscord_ | <treeform> if you don't ... do the simplest things. |
15:30:36 | FromDiscord_ | <sveri> No offense, sorry if that came of as rude. |
15:31:02 | FromDiscord_ | <treeform> Not offended, just agreeing with you. |
15:31:32 | FromDiscord_ | <sveri> I am thankful for your suggestions. |
15:31:33 | FromDiscord_ | <sveri> Coming from the java world it's just pretty easy and basically _standard_ to use threads when it makes sense. |
15:32:09 | FromDiscord_ | <treeform> Well you can use threads in nim too. |
15:32:21 | FromDiscord_ | <treeform> Its not that hard if you want to just use threads and no async. |
15:32:29 | FromDiscord_ | <treeform> That is what Java does. |
15:32:40 | FromDiscord_ | <sveri> Yea, that's true. No async in the java world. |
15:33:18 | FromDiscord_ | <sveri> This lead me down into an interesting rabbit hole so far π |
15:33:26 | * | filcuc quit (Remote host closed the connection) |
15:33:32 | FromDiscord_ | <treeform> Its an interesting rabbit hole. |
15:33:41 | FromDiscord_ | <treeform> Its just a matter of power an efficiency. |
15:34:34 | * | ng0_ joined #nim |
15:35:14 | FromDiscord_ | <treeform> HTTP Server power line: single threaded < multi threaded < async < async+threads < nginx + redis < haxproxy + ... < dns load balancer + haproxy per continent ... |
15:36:00 | FromDiscord_ | <treeform> most people skip single threaded, do async first then skip to nginx. |
15:36:07 | disruptek | Zevv: yeah. i have your png somewhere if you want it back. π |
15:36:26 | FromDiscord_ | <treeform> No one ever gets to DNS load balancer - that's for huge sites like Pinterest or Reddit... |
15:37:15 | * | thomasross quit (Ping timeout: 272 seconds) |
15:37:25 | * | thomasross joined #nim |
15:37:27 | * | ng0 quit (Ping timeout: 240 seconds) |
15:37:29 | FromDiscord_ | <sveri> I think I just have a different point of view. Our team has been working on a rules engine with frontend and runtime. The engine runs multithreaded and it has always been enough. |
15:38:04 | shashlick | I use the same httpbeast mechanism in px2 and it works just fine on windows |
15:38:08 | FromDiscord_ | <sveri> When node.js and async came up years ago it seemd like a step back to me. I am still not convinced. |
15:38:15 | * | ng0_ is now known as ng0 |
15:38:24 | shashlick | I'm not sure why httpbeast isn't supported on windows |
15:38:54 | FromDiscord_ | <sveri> shashlick: do you have the source somewhere available? |
15:39:25 | * | nsf quit (Quit: WeeChat 2.7) |
15:39:29 | shashlick | https://github.com/genotrance/px2 |
15:39:30 | FromDiscord_ | <treeform> @sveri thread per connection is too expensive. |
15:40:02 | shashlick | Thread per core, async per thread |
15:40:21 | FromDiscord_ | <sveri> shashlick: thank you, I will look into that. |
15:41:05 | * | thomasross is now known as Guest35738 |
15:41:05 | * | thomasross_ joined #nim |
15:41:05 | * | Guest35738 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
15:41:05 | * | thomasross_ is now known as thomasross |
15:41:52 | FromDiscord_ | <treeform> @sveri, You usually get 2mb per thread soo a 64gb server can only handle 32,000 connections. But with async which is like like around 4kb per connection you can go to 16,000,000 connections on the same machine. |
15:42:07 | shashlick | I'm not using AsyncHttpServer though, just AsyncSocket |
15:42:10 | FromDiscord_ | <treeform> @sveri but if you are not dealing which such numbers - you don't care. |
15:42:24 | shashlick | And a bunch of libcurl stuff but you get the basic idea |
15:42:32 | disruptek | terrible nim article, but at least it exists. |
15:44:22 | FromDiscord_ | <sveri> @treeform True, that's a thing I have not considered yet. |
15:44:54 | FromDiscord_ | <treeform> @sveri if you never reach such numbers - you don't have to think about it π |
15:45:29 | FromDiscord_ | <treeform> If your business makes enough per connection you could just scales servers. |
15:45:34 | FromDiscord_ | <Rika> argh cant break the habit of adding strintgs |
15:45:42 | shashlick | I disagree, making things as fast as possible is valuable if it isn't too hard |
15:45:46 | FromDiscord_ | <sveri> Yea, I know. This is my spare time. I am doing premature-premature-premature-premature optimizations which I dont have to do at work π |
15:46:08 | shashlick | And dom96 has already solved async plus threads |
15:46:40 | FromDiscord_ | <treeform> @sveri at one company I worked at ... our networking stack was soo bad ... we had haproxy give each connection its own machine... but they did a ton of CPU work and each user was pretty valuable so why not? |
15:47:07 | shashlick | Took me three days to get it working and most of that was because I didn't understand async well |
15:47:27 | dom96 | how did you get that working on Windows? :O |
15:47:28 | FromDiscord_ | <treeform> @sveri we can talk about millions of connections to machines, but that just pure IO, as soon as you are doing any work you get cache invalidation etc... it becomes soo much slower... |
15:47:49 | shashlick | You asking me? |
15:48:43 | FromDiscord_ | <sveri> @treeform Right. If someone pays for it, we do it. If my boss pays me to throw away three months of work I do it π |
15:49:15 | * | Hideki_ quit (Remote host closed the connection) |
15:49:59 | * | Hideki_ joined #nim |
15:50:24 | dom96 | shashlick, yes |
15:50:47 | FromDiscord_ | <treeform> httpbeast imports posix, that does not work on windows? |
15:50:55 | disruptek | usually, you split reads off writes early. so that may be an option you haven't considered. |
15:52:22 | shashlick | dom96: px2 uses AsyncSocket, usual async stuff, createThread and selector |
15:52:33 | shashlick | None of that is gated on windows |
15:52:45 | shashlick | I'm not sure what else you do in httpbeast |
15:54:59 | * | Hideki_ quit (Ping timeout: 272 seconds) |
15:55:04 | dom96 | well, the secret ingredient is SO_REUSEPORT which AFAIK windows doesn't support. |
15:55:51 | shashlick | That works too |
15:55:58 | FromDiscord_ | <sveri> that was my first thought too. port reusing sounds similar to deleting files that are in use, which works on linux, but not on windows. |
15:56:20 | shashlick | I did the same on my python based implementation |
15:56:43 | shashlick | In fact my python version uses multiple processes since you know how threads are in python |
15:57:26 | shashlick | https://github.com/genotrance/px/blob/master/px.py#L1151 |
15:57:46 | dom96 | hrm, interesting. |
15:58:12 | shashlick | What do you import posix for |
15:58:20 | dom96 | That said, an IOCP implementation would likely be the ideal on Windows |
16:01:46 | shashlick | Isn't that what asyncdispatch does |
16:01:52 | shashlick | The underlying implementation is based on epoll on Linux, IO Completion Ports on Windows and select on other operating systems. |
16:03:07 | dom96 | yes, are you using it? |
16:06:39 | shashlick | Well I'm using async so I presume that's what's being used behind the scenes |
16:06:54 | shashlick | I know nothing beyond that |
16:07:15 | dom96 | that's not answering my question, are you or are you not using asyncdispatch? :) |
16:10:36 | shashlick | Not beyond the async macro, await and waitFor |
16:10:58 | shashlick | So yes if that's the question |
16:11:30 | dom96 | cool. Nice that it works |
16:11:44 | shashlick | Hey I'm standing on your shoulders |
16:13:20 | * | al_ joined #nim |
16:13:20 | * | al_ is now known as Guest94576 |
16:14:36 | * | thomasross_ joined #nim |
16:14:36 | * | thomasross quit (Killed (adams.freenode.net (Nickname regained by services))) |
16:14:36 | * | thomasross_ is now known as thomasross |
16:22:27 | * | Hideki_ joined #nim |
16:23:06 | PMunch | Woop woop, I hacked nim-prompt to support colours, and added live colour support to stacklang :) |
16:23:21 | FromDiscord_ | <Rika> congrats |
16:26:01 | PMunch | Actually works pretty well, and with my "stdlib" stacklang is actually pretty useable now :P The "stdlib": http://ix.io/2b6F (put it in stacklang.custom if you want to try it) |
16:26:26 | * | Hideki_ quit (Ping timeout: 240 seconds) |
16:30:07 | FromDiscord_ | <Rika> why the quotes around standard lib |
16:35:42 | * | dddddd joined #nim |
16:37:07 | PMunch | Becase it's currently three functions :P |
16:37:23 | livcd | what is a stacklang? |
16:37:44 | PMunch | A `clear` function which is just a wrapper around `0 \pop until` that runs the `pop` command until the stack is 0 elements long |
16:38:11 | PMunch | And ( ) that essentially creates a new temporary command from everything within the brackets, essentially just a QoL thing |
16:38:23 | PMunch | livcd, it's my little calculator/programming language :p |
16:38:33 | PMunch | That I've spent way too much time and effort in creating |
16:38:57 | PMunch | It started because I was annoyed that there were no simple RPN calculators for the terminal |
16:39:03 | leorize | nice |
16:39:07 | nisstyre | is there a way I can have one nimble file and build two projects? (JS backend for one, C backend for the other) ? I know I can just have a custom task that builds the JS one or something but I'm curious if there's a recommended way of doing this |
16:39:24 | PMunch | And while I was creating it I re-discovered my old HP-41C which has programming support |
16:39:42 | leorize | I like how RPN calcs work but I never owned one |
16:39:46 | leorize | luckily emulators are plenty |
16:39:48 | PMunch | And from there I just started adding features into some sort of weird stack based language thing :P |
16:40:27 | disruptek | you know what's cool about the hp-41c? |
16:40:42 | disruptek | absolutely nothing. not a thing. |
16:40:50 | FromDiscord_ | <Rika> oof |
16:41:08 | nisstyre | leorize: I have an hp rpn calculator but I somehow fucked it up and it no longer works :( |
16:41:13 | leorize | nisstyre: yea a custom task is the way to go |
16:41:17 | nisstyre | leorize: ok cool |
16:41:26 | PMunch | leorize, you should try it out :) You can run it in a couple different ways, either just "./stacklang 1 2 +" and it will spit out 3. Or "./stacklang" and you will be in an interactive prompt with colours, history, and the whole shablam |
16:41:49 | PMunch | disruptek, why are you hating on the 41C? |
16:42:18 | nisstyre | but yeah, I turned my old HP calculator on after years a little while ago and I was hoping to recover my old programs from the memory, but it was corrupted or something |
16:42:43 | disruptek | bit rot. |
16:43:54 | PMunch | Well, what would you expect, it's from 1979 :P |
16:44:22 | PMunch | It's the first (and really the only) calculator I've ever used |
16:44:36 | PMunch | Once you go RPN you can't go back |
16:45:27 | PMunch | Oh well, I'm off to take a shower |
16:47:10 | FromGitter | <deech> Can I use a destructor for just one field of an object and expect the rest of the fields to be freed in the standard way? β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e3ee60e45000661fcab48a9] |
16:48:20 | nisstyre | seems like the JS backend is broken for me |
16:48:29 | nisstyre | /usr/lib/nim/system/jssys.nim(53, 6) Error: 'getCurrentException' is not GC-safe as it accesses 'lastJSError' which is a global using GC'ed memory |
16:48:39 | nisstyre | trying to compile `echo "foo"` |
16:48:40 | disruptek | you have no idea how hard it was to break it /just for you/ |
16:48:48 | nisstyre | lol |
16:54:05 | FromDiscord_ | <Rika> deech, is it not `f: var Foo` for the signature? also, i dont understand the destructor |
16:54:23 | FromDiscord_ | <Rika> what is `freeAPtr`? |
16:54:45 | nisstyre | it's really weird, it only fails inside my nimble project |
16:54:54 | nisstyre | if I copy the file outside of it and compile it elsewhere it works fine |
16:57:01 | leorize | @deech: not yet |
16:58:10 | leorize | Zevv: re: manual `=destroy` needed for ref, have you tested this with strings and seqs? |
16:58:31 | leorize | it'd be a major issue if you have to manually destroy strings and seqs if you write your own destructors |
17:00:29 | nisstyre | oh, it was my config.nims :| |
17:01:05 | disruptek | i would prefer .cfg to .nims if i were you. |
17:01:22 | disruptek | lemme restate: i prefer .cfg to .nims. |
17:02:02 | disruptek | easier for tooling to grok. |
17:02:43 | nisstyre | I fixed it by disabling stuff explicitly |
17:02:50 | nisstyre | yeah that makes sense |
17:03:10 | disruptek | obviously, if you need nims, you need nims. |
17:03:22 | FromDiscord_ | <Rika> is it guaranteed that an enum has a number tied to it? like it's guaranteed that SomeEnum.int will succeed? |
17:03:38 | disruptek | use ord |
17:04:09 | FromDiscord_ | <Rika> still |
17:04:18 | disruptek | it is guaranteed to be an ordinal. |
17:04:21 | disruptek | focus on the semantics. |
17:05:30 | disruptek | Zevv: are you still using this asyncGetAddr hack? |
17:05:55 | Zevv | It's in production somewhere, yes |
17:06:41 | Zevv | I assume you mean https://github.com/nim-lang/Nim/issues/7422 |
17:06:42 | disbot | β₯ Async networking and blocking host name resolving / DNS |
17:06:55 | disruptek | yeah. |
17:07:10 | disruptek | it bit me in the beginning and now it bit me again. |
17:07:20 | Zevv | It bites me in every single "async" framework |
17:07:53 | disruptek | i'm not always that unlucky. |
17:08:27 | disruptek | agree that it has to use the host's resolver. |
17:08:44 | disruptek | i hate using threads for this, but what can you do? |
17:08:51 | Zevv | fork a subprocess |
17:09:05 | disruptek | obviously worse. |
17:09:11 | Zevv | or use getaddrinfo_a |
17:09:21 | disruptek | obviously better. |
17:09:23 | Zevv | but - surpise - wait - that uses threads |
17:09:53 | dom96 | in what situation does it cause you trouble that this blocks? |
17:09:56 | disruptek | but no one was ever fired for using getaddrinfo_a. |
17:09:58 | dom96 | Are you doing lots of DNS resolutions? |
17:10:07 | FromGitter | <deech> leorize, so what's the proper way of writing a destructor for the example, ` ... = freePtr f.aPtr; f.aString = ""`? |
17:10:14 | Zevv | dom96: even if I do few, it can cause problems |
17:10:21 | * | Pqzcih5 joined #nim |
17:10:33 | disruptek | you can't always afford the latency. |
17:10:50 | Zevv | my case was: I talk to a farm of N servers which redirect to distribute load among each other. When there is a DNS issue *everything* stops |
17:10:54 | Zevv | even if one DNS lookup stalls |
17:11:07 | Zevv | it's simply not acceptable |
17:11:10 | disruptek | yep. |
17:11:25 | Zevv | you can't say "well, you don't use *that much* lookups, so you only have a *bit* of a problem" |
17:11:34 | Zevv | one flakey lookup stalls your proc - boom dead |
17:12:14 | dom96 | Makes sense. So how much would it take to create an async implementation? |
17:12:24 | Zevv | see the issue |
17:12:32 | disruptek | we're gonna go in circles here. |
17:13:08 | * | Hideki_ joined #nim |
17:13:20 | Zevv | well, let's first fix async/thread coop then :) |
17:13:27 | disruptek | Zevv: did you ever use lbnamed back in the day? |
17:13:27 | Zevv | because now I need to await on both |
17:13:29 | dom96 | So TL;DR: write an implementation in pure Nim or use threads |
17:13:31 | * | hax-scramper quit (Ping timeout: 272 seconds) |
17:13:45 | Zevv | dom96: basically yes. |
17:13:51 | Zevv | And the first I find not acceptable |
17:13:51 | disruptek | tl;dr: use getaddrinfo_a |
17:13:57 | Zevv | disruptek: portability |
17:14:02 | disruptek | not my problem. |
17:14:12 | disruptek | lbnamed? |
17:14:15 | dom96 | so we should push for the ability to await a FlowVafr |
17:14:17 | dom96 | *FlowVar |
17:14:23 | Zevv | riiiight! |
17:14:29 | Zevv | but I think I gave up on that |
17:14:34 | Zevv | that was reviewed to death |
17:14:41 | * | hax-scramper joined #nim |
17:15:09 | dom96 | we were really close |
17:15:23 | disruptek | some of these projects should be given a special tracker. |
17:15:25 | FromDiscord_ | <Rika> ah, i'm too much of a scaredy cat to dream of making a PR to a language stdlib; do you think it's fine? i want to change something about how `json` parses nodes to enums |
17:15:26 | Zevv | and of course there is https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncdns.nim |
17:15:30 | disruptek | that one and async leaks, for example. |
17:15:46 | Zevv | Rika: that is what PR's are for. |
17:16:03 | FromDiscord_ | <Rika> yeah, im just an anxious mess |
17:16:08 | disruptek | just make sure you do a good job of explaining your use-case. |
17:16:09 | Zevv | sure, we can always decide to still burn you at the stake :) |
17:16:13 | FromDiscord_ | <Rika> AAAAAAAAAA |
17:16:16 | dom96 | Zevv, cool, can we copy that into stdlib? :) |
17:16:33 | Zevv | dom96: LICENSE says yes |
17:16:45 | dom96 | I would first fix this sort of thing: Future[ptr AsyncAddrInfo] |
17:17:27 | Zevv | Rika: you'll be fine. If you want to do a good job, make a PR with a good description of how and why, think about any advert consequences it might have, and just send in the PR |
17:18:14 | Zevv | dom96: please pull the rest of that repo in as well then. I'd *love* async procs |
17:18:41 | dom96 | same, I use it for testing in some of my packages |
17:19:34 | Zevv | even Nim could use it so it does not die when gcc generates too much stderr outptu |
17:20:06 | FromDiscord_ | <Recruit_main_70007> how do i import: |
17:20:06 | FromDiscord_ | <Recruit_main_70007> namespace rlbot { |
17:20:06 | FromDiscord_ | <Recruit_main_70007> struct ByteBuffer { |
17:20:06 | FromDiscord_ | <Recruit_main_70007> void *ptr; |
17:20:06 | FromDiscord_ | <Recruit_main_70007> int32_t size; |
17:20:07 | FromDiscord_ | <Recruit_main_70007> }; |
17:20:07 | FromDiscord_ | <Recruit_main_70007> which is inside a dll? |
17:20:09 | FromGitter | <zetashift> And from the PR's I read, Nim maintainers are really fair to such PR's Zevv describes |
17:20:40 | Zevv | zetashift: well, I've been bikeshedded away a few times, but I just don't care. |
17:21:02 | Zevv | I put something in only becasue I personally need it, scrating my own itches. I send it in because it might be useful for others. If not, bad luck |
17:21:09 | FromDiscord_ | <Rika> does nim have a commit naming scheme |
17:21:16 | disruptek | nah. |
17:21:28 | Zevv | nope. For convenience you can call it rika-something |
17:21:29 | FromDiscord_ | <Rika> my lord why am i like this |
17:21:50 | disruptek | how could gcc's too much output be a problem? |
17:21:54 | Zevv | Rika: don't stress it dude. |
17:21:56 | Zevv | disruptek: try it |
17:22:09 | disruptek | i can't, i'm trying to code. |
17:22:18 | FromDiscord_ | <Rika> Zevv: last time i didnt stress something everything went wrong so :/ |
17:22:28 | disruptek | but, i am doing this in golden and so i wanna know if it's broken. |
17:22:52 | FromGitter | <zetashift> but bikeshedding (which I just googled) seems to happen a lot in these kinds of projects imho |
17:23:17 | Zevv | disruptek: nim forky da gcc. gcc write da pipe. pipe go full. nim waity for gcc to be done. but gcc can no write because pipe issa full |
17:23:29 | FromDiscord_ | <Rika> ZEVV |
17:23:36 | Zevv | RIKA |
17:23:38 | disruptek | well, duh. |
17:23:46 | disruptek | golden is smarter than that, at least. |
17:24:02 | FromGitter | <zetashift> JUST DO IT RIKA |
17:24:20 | FromGitter | <zetashift> I feel like I've quoted that meme clip way too many times |
17:24:22 | FromDiscord_ | <Rika> I CANT I DONT WANNA RISK BEING MURDERED BY ARAQ |
17:24:34 | FromDiscord_ | <Rika> oh fuck forgot that this is irc |
17:24:35 | Zevv | zetashift: I once tried to add a proc to allow a character insert into a string. Didn't make it in due to abundant opinions. |
17:24:47 | Zevv | Then I just go and rewrite the low level memory allocators or hack in the VM. An no one cares, stuff gets merged. |
17:24:55 | * | Hideki_ quit (Ping timeout: 272 seconds) |
17:25:22 | FromDiscord_ | <Rika> RIP i'll be murdered nonetheless goodbye nim community; change da world, my final message. Goodby e |
17:25:53 | disruptek | i forgot about that insert-a-character-into-this-string pr. |
17:25:56 | Zevv | Rika: stop whining dude and pull up the PR. You have to start somewhere, right. |
17:26:02 | Zevv | disruptek: I tried too |
17:26:32 | FromGitter | <zetashift> tough love there zevv |
17:26:32 | FromGitter | <zetashift> that's the dutch mentality alrite |
17:26:44 | Zevv | Rika: well, we *all* sent in our first PR once, right? |
17:26:56 | * | sveri quit (Remote host closed the connection) |
17:27:19 | * | sveri joined #nim |
17:28:09 | disruptek | my first pr was amazon's marketplace web services api, in python. |
17:28:10 | * | ng0_ joined #nim |
17:28:10 | FromDiscord_ | <Rika> Zevv: i've sent PRs before, just not to something this large, also my issue now is that i dont know what to name the commit; ill figure it out |
17:29:08 | Zevv | Rika: I also shat my pants the first time when commiting PR's to the linux kernel. But in the end it's just pretty normal people on the other side of the line |
17:29:51 | disruptek | monkeys building shelter out of mud and shit. |
17:30:02 | * | Pqzcih5 quit (Remote host closed the connection) |
17:30:05 | Zevv | that kind of sums it up. |
17:30:19 | * | Pqzcih5 joined #nim |
17:30:38 | disruptek | i did some nfs fixes to lk in the late 90s. |
17:30:46 | * | ng0 quit (Ping timeout: 265 seconds) |
17:31:30 | disruptek | pre-git, everyone reads all the patches in their email. |
17:31:37 | * | nsf joined #nim |
17:31:37 | disruptek | talk about pant-shitting. |
17:31:39 | Zevv | I was *just* grepping the git log :) |
17:31:49 | FromGitter | <zetashift> just read that PR, feature reminds me of `patch()` in Scala, I couldn't come up with an example of how it solves something, isn't it just ment to ease string processing? |
17:32:03 | FromGitter | <zetashift> with that PR I ment the insert(string, char, pos) thingy |
17:32:11 | Zevv | Anyway, pizza is ready, and life has priorities |
17:32:19 | FromGitter | <zetashift> might be something for https://github.com/status-im/nim-stew tho |
17:32:38 | FromGitter | <zetashift> enjoy your meal |
17:35:22 | FromDiscord_ | <Rika> what's the canonical way for converting an int to an enum |
17:40:08 | disruptek | i.SomeEnum |
17:41:53 | * | Guest94576 quit (Quit: Guest94576) |
17:47:40 | * | narimiran quit (Ping timeout: 256 seconds) |
17:52:26 | * | sveri quit (Ping timeout: 240 seconds) |
17:52:34 | FromDiscord_ | <Rika> ah i should have started editing from devel... |
17:54:34 | * | tane joined #nim |
17:58:34 | nisstyre | Hmm, `document.evaluate` isn't defined in the dom module |
17:58:42 | nisstyre | I'm trying to do XPath stuff |
18:00:09 | FromDiscord_ | <Zachary Carter> just bind to it? |
18:00:32 | nisstyre | how would that work? |
18:00:37 | FromDiscord_ | <Zachary Carter> https://nim-lang.org/docs/jsffi.html |
18:00:42 | nisstyre | oh I see |
18:00:44 | nisstyre | thanks |
18:00:51 | FromDiscord_ | <Zachary Carter> no problem |
18:01:00 | nisstyre | should I file an issue to get it in the dom module, since it is technically part of it? |
18:01:05 | * | narimiran joined #nim |
18:01:15 | FromDiscord_ | <Zachary Carter> I think a PR would be better |
18:01:34 | nisstyre | makes sense |
18:01:55 | nisstyre | ugh the type signature is so complex |
18:02:06 | nisstyre | I guess I can just use JSobject |
18:02:12 | nisstyre | for everything |
18:02:37 | FromDiscord_ | <Zachary Carter> well cstring for string |
18:02:58 | FromDiscord_ | <Zachary Carter> but yeah other parameters can just be JsObject or if you want to define them, you're free to do that as well |
18:03:16 | FromDiscord_ | <Zachary Carter> hell someone might have already done this - may want to do a github search first |
18:04:17 | nisstyre | I did do some googling |
18:04:20 | FromDiscord_ | <Zachary Carter> ah okay |
18:04:25 | nisstyre | couldn't find anything |
18:04:27 | FromDiscord_ | <Zachary Carter> well I just checked github and I'm not seeing much |
18:04:38 | nisstyre | I reckon not many people use the JS XPath stuff because it's so complicated to use |
18:04:52 | * | sveri joined #nim |
18:05:53 | FromDiscord_ | <Zachary Carter> I haven't touched XPath in years and am happier because of it π |
18:06:07 | nisstyre | sometimes it's the best solution |
18:06:12 | * | lritter joined #nim |
18:06:21 | FromDiscord_ | <Zachary Carter> yeah - I just thankfully don't have to touch XML much these days |
18:06:50 | nisstyre | I'm essentially building a bookmarklet that you can use to grab the last tweet in a twitter thread, I have it working in regular JS, but I want to translate it to Nim |
18:06:58 | FromDiscord_ | <Zachary Carter> ah cool |
18:07:20 | nisstyre | then it opens up a new tab into a local server that is able to rebuild the thread from the Twitter API, and stores it in an sqlite database for you |
18:07:23 | FromDiscord_ | <Zachary Carter> I'm working on implementing this pathfinding algo that @mratsim told me about earlier in the week |
18:07:31 | nisstyre | basically like that threadreader thing, but running locally |
18:07:45 | FromDiscord_ | <Zachary Carter> interesting |
18:07:55 | nisstyre | so I have all of that working, but I want to try and do it all in Nim |
18:19:24 | livcd | i just realized mratsim has a badass name |
18:19:43 | Zevv | and a badass threading lib |
18:26:09 | * | _1essn33k joined #nim |
18:26:30 | nisstyre | the fun challenge with pathfinding (At least for games) is making them work well but not too well |
18:26:38 | nisstyre | because then it's not realistic |
18:30:40 | FromGitter | <zetashift> how is that going @zacharycarter ? |
18:30:48 | FromGitter | <zetashift> Are you using weave? |
18:31:47 | Zevv | zachary: you should put that in your came: some enimies just have *no* clue at all and no sense of direction. The wander 90% off and mumble to themselves about where they think they are going |
18:31:56 | Zevv | "Is that north? Pretty sure north is that way, right?" |
18:33:32 | PMunch | Hmm, is it possible to conditionally add an element to an array? |
18:33:56 | PMunch | Something like [1, 2, (if something: 3 else: discard), 4, 5] |
18:34:48 | * | _1essn33k quit (Quit: Leaving) |
18:35:31 | disruptek | maybe using when. |
18:36:38 | FromDiscord_ | <Zachary Carter> heh |
18:37:08 | FromDiscord_ | <Zachary Carter> zetashift: I'm not - I can't really parallelize pathfinding in the procedural generation I'm doing, as each iteration of the pathfinding algo is dependent on previous iterations |
18:37:22 | leorize | PMunch: no, since it'd change the array type at runtime |
18:37:28 | FromDiscord_ | <Zachary Carter> so I'm implementing this - http://www.gameaipro.com/GameAIPro3/GameAIPro3_Chapter22_Faster_A_Star_with_Goal_Bounding.pdf |
18:37:29 | leorize | also we don't have a syntax for that :P |
18:37:32 | FromDiscord_ | <Zachary Carter> so far so good |
18:37:50 | PMunch | leorize, ah I actually meant a sequence |
18:37:58 | PMunch | And it wouldn't change the type, only the length |
18:38:00 | FromDiscord_ | <Zachary Carter> and Zevv: that sounds fun π I will have to do this |
18:38:08 | PMunch | But yeah, for arrays that means the type |
18:38:28 | leorize | there aren't any syntax for that :P |
18:38:57 | PMunch | Okay, bummer |
18:38:59 | * | PMunch quit (Quit: Leaving) |
18:39:05 | leorize | block: (var r = [1, 2, 4, 5]; if something: r.insert(3, 2); r) |
18:40:55 | * | thomasross quit (Ping timeout: 272 seconds) |
18:47:43 | * | ng0 joined #nim |
18:49:39 | disruptek | Zevv: what does it mean that your async addrinfo works fine but the sync version doesn't? |
18:49:58 | * | thomasross joined #nim |
18:50:13 | * | martinium joined #nim |
18:50:27 | * | ng0_ quit (Ping timeout: 260 seconds) |
18:54:33 | * | filcuc joined #nim |
18:56:07 | * | dadada quit (Ping timeout: 272 seconds) |
18:58:35 | * | dadada joined #nim |
18:58:48 | * | adalricus quit (Remote host closed the connection) |
19:00:37 | * | onionhammer quit (Quit: WeeChat 2.6) |
19:02:53 | leorize | the best way to do async dns is to write your own dns resolver :P |
19:03:04 | disruptek | terrible. |
19:03:15 | * | onionhammer joined #nim |
19:03:17 | leorize | as a starter you can just wrap libunbound, which features an async dns server |
19:03:42 | disruptek | pmunch did some with libunbound. |
19:04:10 | disruptek | i've written a couple dns servers. i don't think we want to go down that road yet. |
19:04:13 | * | martinium quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
19:05:10 | leorize | you can do async + threadpool, if rayman22201's await FlowVar arrived to stdlib |
19:07:59 | Zevv | disruptek: where did I say that about the sync version? |
19:08:18 | Zevv | leorize: *if* indeed |
19:09:24 | shashlick | It works today |
19:09:46 | leorize | Zevv: ^ solved I guess? |
19:11:37 | leorize | there's something that I've always been wondering |
19:11:50 | leorize | how exactly do you "cancel" an async request? |
19:11:51 | Zevv | didn't your mama tell you that? |
19:11:53 | Zevv | ooh |
19:11:54 | Zevv | that |
19:11:57 | Zevv | you *don't* |
19:12:06 | Araq | leorize, by using Chronos I guess |
19:12:20 | leorize | so basically you just remove all callbacks and ignore whatever the thing returns? |
19:12:31 | Zevv | no, you can't, really. It's not a feature |
19:12:55 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
19:13:08 | Zevv | yeah, ok, manaully removing the callbacks, that might work |
19:13:23 | * | Ven`` joined #nim |
19:13:37 | leorize | I mean that's how it works on the OS level, right? |
19:13:49 | * | Ven`` quit (Client Quit) |
19:14:04 | leorize | I have to read more on this |
19:14:54 | * | martinium joined #nim |
19:15:22 | Zevv | leorize: https://github.com/status-im/nim-chronos/pull/41 for inspiration |
19:15:23 | disbot | β₯ [WIP] Initial cancellation proposal. |
19:15:25 | disruptek | wow, it's an atoz but. |
19:15:27 | disruptek | bug. |
19:17:21 | shashlick | dom96: https://github.com/dom96/choosenim/pull/164 is good to go |
19:17:22 | disbot | β₯ Fix #28 - add ~/.nimble/bin to PATH on Windows |
19:18:53 | dom96 | Araq, leorize: the only way to cancel is to close the FD that the operation is using. |
19:21:41 | * | Hideki_ joined #nim |
19:26:16 | * | Hideki_ quit (Ping timeout: 256 seconds) |
19:26:16 | Araq | Zevv, disruptek, shashlick, leorize and others. Can we get ryu into the stdlib yesterday? |
19:26:39 | rayman22201 | I really tried with Await flowvar. We ended up getting stuck in the weeds with the async event bug, which led me to the virtual async event PR, which has a race condition that I never figured out... And lost momentum because of chronos politics and then gc:arc |
19:26:40 | disruptek | i dunno why it's /suddenly/ a problem. |
19:27:20 | Araq | because /suddenly/ we noticed our serializers (json etc) are broken for floating point |
19:27:23 | disruptek | iirc, the basic ryu algo is only like 100 loc. |
19:27:54 | disruptek | they've been broken forever. that's basically what ryu showed. |
19:28:08 | Araq | exactly. I would do it myself but I have to watch Columbo |
19:28:10 | disruptek | but, sure, i will look at it. |
19:28:18 | Araq | thanks! |
19:28:33 | disruptek | say `hi` to peter for me. |
19:28:39 | dom96 | rayman22201, we're so close to having it! |
19:30:02 | Zevv | so what is the main rationale for ryu, performance, correctness? Why can't we rely on the c stdlib implementation? |
19:30:04 | rayman22201 | We are so close to have leak free async in gc:arc too, but that last 10% is the hardest |
19:30:12 | disruptek | performance and correctness. |
19:30:44 | disruptek | the talks are the best introduction; pretty entertaining, actually. |
19:31:03 | dom96 | rayman22201, how is that more important than spawn + async? |
19:31:03 | Zevv | I think I watched that one some time ago ye |
19:31:16 | dom96 | Making spawn work with async will have a far bigger impact than async + arc |
19:31:17 | * | superbia joined #nim |
19:31:45 | rayman22201 | Disagree |
19:31:52 | leorize | do you know what will be bigger than that? making sure the new combination works with arc :) |
19:32:16 | Zevv | and integrate with weave right away, because now we have 3 kinds of awaitables |
19:32:56 | leorize | Zevv: it's easier to control the behavior when we are the one who implements it |
19:33:17 | leorize | and besides, it's better to not rely too much on the C stdlib |
19:33:19 | dom96 | rayman22201, why? |
19:33:43 | disruptek | depending on who you ask, because closure cursors aren't a thing. |
19:34:09 | dom96 | From my perspective, arc is just another GC type, it doesn't enable anything new for me. |
19:34:16 | * | tane quit (Quit: Leaving) |
19:34:31 | leorize | it gives you new bugs if you're interested in that :p |
19:34:39 | * | thomasross_ joined #nim |
19:34:39 | * | thomasross quit (Killed (cherryh.freenode.net (Nickname regained by services))) |
19:34:39 | * | thomasross_ is now known as thomasross |
19:36:11 | rayman22201 | Arc is the future of Nim. And the deterministic mm should allow Nim to actually have long running servers. |
19:36:21 | rayman22201 | That's kind of a big deal imo |
19:36:52 | * | nsf quit (Quit: WeeChat 2.7) |
19:37:05 | disruptek | it will close leaks, enable better tooling and detection, and enable lots of new optimization opportunities. |
19:37:10 | rayman22201 | I arguably think we need a new async all together. Rust style polling. The current asyc is legacy as far as I'm concerned |
19:37:18 | disruptek | agree. |
19:38:24 | rayman22201 | I want the current async to work, to make the transition to arc smoother, but I'm less enthusiastic about making new features for it |
19:39:19 | rayman22201 | And the politics around the sync event bug make it a hurculean effort to make any progress |
19:39:25 | * | superbia left #nim ("WeeChat 2.4") |
19:39:27 | disruptek | we'll build something heavier on weave and then we'll have a story we can stand behind. |
19:41:41 | dom96 | I agree about new async. Zero-cost futures themselves are a good goal and we will need to break stuff to get there. |
19:41:43 | rayman22201 | I think weave is important for compute intensive multithreading, but I think we might also need something like seastar for more io bound multithreading. |
19:42:23 | disruptek | it's a fire-and-forget solution. |
19:42:36 | rayman22201 | Agree @dom96 |
19:42:39 | dom96 | But long running servers are already a thing. You don't need arc for that. |
19:42:55 | dom96 | Also, I'm curious which politics you're talking about. |
19:43:11 | * | thomasross quit (Ping timeout: 260 seconds) |
19:43:12 | * | thomasross_ joined #nim |
19:43:12 | * | thomasross_ is now known as thomasross |
19:43:17 | rayman22201 | You were there lol |
19:43:20 | livcd | dom96: you getting mad that status is writing its own async implementation |
19:43:40 | * | tane joined #nim |
19:43:56 | dom96 | rayman22201, my memory is very short for this kind of thing :) |
19:44:23 | dom96 | livcd, huh? |
19:44:28 | rayman22201 | It took me a month to get that ioselector bug merged that was an obvious bug, because a certain person at status could not believe me. |
19:45:51 | dom96 | :o |
19:46:00 | rayman22201 | And that same person has said virtual async event is crap and is working on an alternate implementation in chronos |
19:46:17 | livcd | who?who?who? |
19:46:19 | dom96 | So what stops me from merging it? |
19:46:36 | dom96 | I'll happily merge it if we can get this feature. |
19:46:59 | rayman22201 | 4raq does. He always ends up being the middle man. |
19:47:39 | rayman22201 | And instead of fighting all the time I decided it was more productive to do other things. |
19:48:01 | dom96 | Ar4q can be reasonable, you just have to convince me and i'll fight for you. :) |
19:49:07 | livcd | are you trying not to highlight him ? |
19:49:33 | leorize | yep, he's busy and should not be dragged into these conversations :P |
19:51:16 | livcd | smart! |
19:51:29 | dom96 | So which do we want, #12232 or #12372? |
19:51:30 | disbot | https://github.com/nim-lang/Nim/pull/12372 -- 3Virtual async events 2 |
19:53:10 | disruptek | disbot prefers the 2nd one, i guess. |
19:53:31 | leorize | can someone look at #13201 and provide me additional feedback on what kind of multiprocess server that I'm making hard to write? |
19:53:33 | disbot | https://github.com/nim-lang/Nim/pull/13201 -- 3Make file descriptors from stdlib non-inheritable by default |
19:54:03 | leorize | I can add more escape hatch if needed to not hinder such use case |
19:54:44 | disruptek | sounds like fud to me. |
19:56:55 | leorize | well the concern was raised by folks at status from what 4raq told me on irc |
19:57:09 | leorize | I'd expect them to know a thing or two about this stuff |
19:58:50 | * | ng0_ joined #nim |
20:00:42 | dom96 | Why don't Status comment on the PR? |
20:02:37 | * | ng0 quit (Ping timeout: 272 seconds) |
20:04:02 | leorize | *shrug* well but I'll be adding -d:nimInheritHandles |
20:04:27 | disruptek | seems like a fine compromise to me. |
20:06:51 | dom96 | huh, doesn't your PR still make it possible to restore the default behaviour via some flag or something? |
20:07:09 | dom96 | (runtime flag I mean) |
20:07:22 | leorize | "backward compatibility" is the key here I s'pose |
20:08:26 | leorize | basically I just change every inhertiable runtime flag into defined(nimInheritHandles) :P |
20:08:48 | dom96 | IIRC Status is still on Nim pre-1.0 |
20:08:56 | dom96 | so it's odd that they'd care about this |
20:09:27 | dom96 | I guess they may want to update to a Nim 1.1 (which to be fair shouldn't break compatibility) |
20:09:42 | disruptek | nah, they are on 1.0.4+. |
20:11:18 | * | xet7 quit (Read error: Connection reset by peer) |
20:11:27 | * | xet7 joined #nim |
20:13:03 | rayman22201 | Sorry, driving. Second one is correct |
20:13:23 | leorize | you shouldn't drive and text |
20:13:37 | rayman22201 | π |
20:14:05 | dom96 | Please don't drive and IRC |
20:14:14 | * | Jesin quit (Quit: Leaving) |
20:16:00 | * | martinium quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
20:16:47 | * | thomasross quit (Ping timeout: 240 seconds) |
20:17:00 | * | Jesin joined #nim |
20:17:45 | * | thomasross joined #nim |
20:27:40 | Zevv | leorize: 13201 comments is FUD. It's not "much harder". It's just about documenting that you should be explicit about what you want to inherit. |
20:27:50 | Zevv | It's one single call you need to do somewhere |
20:28:29 | Zevv | but breaking compatibility is a fair point - existing code expecting fds to inherit will be surprised |
20:28:35 | * | filcuc quit (Quit: Konversation terminated!) |
20:29:13 | leorize | in the case of sockets, it's even easier, you just toggle a flag, and I believe that's the most common use case |
20:29:32 | Zevv | And pipes |
20:29:40 | Zevv | are commonly shared between parent and child |
20:29:55 | leorize | we don't even have apis to create pipes :P |
20:30:13 | Zevv | well, the normal posix ones, but these will not be affected anyway |
20:30:20 | leorize | yea |
20:30:24 | Zevv | I'm jus accustumed to close all fds >2 anyway, but still |
20:31:11 | leorize | do you want to add a close_fds flag to startProcess like python? :) |
20:31:26 | leorize | it will just stall your process startup by around 400ms on freebsd :) |
20:31:45 | Zevv | yeah I hate it, there is no good common api for that |
20:31:52 | Zevv | In linux you can iterate /proc/self/fd at least |
20:32:18 | Zevv | but to be fair, how often do I use all that. Twice a year maybe? |
20:35:14 | disruptek | you put the break in changelog; this isn't getting backported, is it? |
20:35:36 | leorize | it wouldn't be backported |
20:35:44 | leorize | and I'll have to write a change log message |
20:35:46 | disruptek | so it's fine. |
20:35:58 | leorize | my english is horrible for this |
20:36:13 | disruptek | just paste it here and we'll polish it. |
20:40:24 | rayman22201 | @dom96 Now that I'm no longer doing dangerous things for the moment. I can finish my rant. Lol. |
20:41:48 | rayman22201 | A lot of it is this: I'm glad you will fight for certain changes, but the reality is that you are not here as often, and I have limited time myself. |
20:42:19 | rayman22201 | I have to choose the things that I'm most interested in. |
20:42:42 | rayman22201 | I personally want to buse arc and asyc, so that was more important to me |
20:42:59 | rayman22201 | Use / abuse, either one lol |
20:43:43 | rayman22201 | That being said. We are close. I will try to look at it again |
20:43:54 | dom96 | I understand |
20:44:04 | dom96 | but indeed, I feel like we are super close |
20:45:05 | rayman22201 | The biggest thing is the race condition I found. I don't remember the details. I will have to re grok the problem a little bit. |
20:46:11 | rayman22201 | The regular async event didn't have the problem because the OS did all the hard locking stuff for us. The one advantage to having a FD for every event. |
20:52:50 | * | ng0 joined #nim |
20:55:59 | * | ng0_ quit (Ping timeout: 260 seconds) |
20:59:41 | Zevv | @leorize: https://github.com/nim-lang/Nim/issues/13373 |
20:59:43 | disbot | β₯ Nim lacks ref object constructor ; snippet at 12https://play.nim-lang.org/#ix=2b8u |
21:01:30 | leorize | please make an issue for no finalizer syntax for ref objects too :) |
21:01:58 | Zevv | Ar_q will just veto that I guess. Finalizers are niche things |
21:02:22 | leorize | it'd be needed for a new implementation of File :p |
21:02:26 | shashlick | I like 4raq best |
21:02:28 | leorize | since those should use ref semantics |
21:03:10 | FromGitter | <alehander92> Iraq |
21:03:14 | Zevv | sure, but you make a FileObject and a File |
21:03:23 | Zevv | and put the =finalize on `var FileObject` |
21:03:49 | Zevv | the solution is trivial. If you would type seven finalizers a day it would be handy |
21:03:59 | Zevv | but I guess you don't |
21:04:27 | leorize | true that |
21:04:48 | shashlick | That's cool too, 4raq looks best |
21:04:57 | shashlick | But Ar4q sounds best |
21:05:00 | Zevv | or just Q |
21:05:13 | shashlick | R-foque |
21:05:36 | FromDiscord_ | <clyybber> Just define a =destroy |
21:05:41 | FromDiscord_ | <clyybber> No finalize needed |
21:06:06 | FromDiscord_ | <clyybber> Its the same thing |
21:07:26 | shashlick | A BFDL shortcut is a more important discussion IMO |
21:07:38 | Zevv | clyybber: yeah that is what I ment. but you can't put that on a ref type |
21:07:56 | * | ng0_ joined #nim |
21:07:57 | FromDiscord_ | <clyybber> Zevv: But you'd want the finalizer to be run when the rc is zero? |
21:08:12 | FromDiscord_ | <clyybber> So you define `=destroy(x: var someRefType[])` |
21:08:31 | Zevv | yes - someRefType indeed. But sometimes I do not have a reftype |
21:08:33 | Zevv | but a ref var |
21:08:50 | Zevv | oh wait no sorry, I'm rambling |
21:08:50 | FromDiscord_ | <clyybber> Huh, wdym? |
21:08:58 | FromDiscord_ | <clyybber> I think you meant the other way around |
21:09:21 | Zevv | you can't do that: =destroy does not take 'var ref', it must be 'var object' |
21:09:27 | Zevv | /tmp/t.nim(6, 1) Error: signature for '=destroy' must be proc[T: object](x: var T) |
21:09:36 | FromDiscord_ | <clyybber> Eh, I was trying to deref the type here |
21:09:47 | * | ng0 quit (Ping timeout: 240 seconds) |
21:09:49 | FromDiscord_ | <clyybber> Should be `type(default(someRefType)[])` |
21:10:00 | * | FromGitter quit (Read error: Connection reset by peer) |
21:10:01 | FromDiscord_ | <clyybber> IMO you should just be able to deref types |
21:10:17 | Zevv | Can you fix this for me? https://play.nim-lang.org/#ix=2b8z |
21:10:19 | * | FromGitter joined #nim |
21:11:06 | FromDiscord_ | <clyybber> tyg: https://play.nim-lang.org/#ix=2b8B |
21:11:27 | FromDiscord_ | <clyybber> oh, wait a minute |
21:11:30 | Zevv | you make my eyes hurt |
21:11:57 | Zevv | )[])) is kind of offending |
21:12:09 | FromDiscord_ | <clyybber> yeah |
21:12:11 | FromDiscord_ | <clyybber> I agree |
21:12:16 | Zevv | /tmp/t.nim(6, 1) Error: too many brackets |
21:12:18 | FromDiscord_ | <clyybber> sadly Iraq doesnt agree |
21:12:19 | * | letto quit (Ping timeout: 260 seconds) |
21:12:50 | Zevv | Well, fair enough: like I mentioned above, it's probably not worth making some special syntax for this because it would be pretty rare |
21:13:08 | leorize | https://play.nim-lang.org/#ix=2b8D |
21:13:12 | FromDiscord_ | <clyybber> https://github.com/nim-lang/Nim/issues/12363 would be cool |
21:13:12 | Zevv | I can put an issue up if you thank it's worth discussing |
21:13:14 | disbot | β₯ [Feature] Extend dereference operator to types to get base ; snippet at 12https://play.nim-lang.org/#ix=2b8E |
21:13:19 | leorize | I broke your example :P |
21:13:31 | FromDiscord_ | <clyybber> the issue is, it doesn't echo anything for some reason |
21:13:50 | Zevv | ha |
21:13:53 | FromDiscord_ | <clyybber> leorize: Lol |
21:16:45 | FromDiscord_ | <clyybber> leorize: can you report it? |
21:17:12 | leorize | I'm kinda busy rn, so no :p |
21:18:34 | FromDiscord_ | <clyybber> alright, Im gonna do it then :p |
21:19:09 | FromDiscord_ | <clyybber> oh, |
21:19:10 | FromGitter | <alehander92> good thing we dont have |
21:19:12 | FromGitter | <alehander92> a ref guy |
21:19:14 | FromDiscord_ | <clyybber> it may not be a bug |
21:19:23 | FromGitter | <alehander92> what to do |
21:19:48 | FromDiscord_ | <clyybber> ref me like one of your french girls |
21:20:06 | Zevv | argh leorize I forgot your github name, what was it |
21:20:13 | FromDiscord_ | <clyybber> alaviss |
21:20:17 | Zevv | right |
21:20:22 | leorize | check your vim config if you forgot :P |
21:20:25 | FromDiscord_ | <clyybber> leorize: its not a bug, DateTime requires explicit init |
21:20:49 | leorize | i know, it's just that you can't define destructor with that pattern for certain objects |
21:21:20 | zedeus | dom96: did you see #13361? it broke jester |
21:21:22 | disbot | https://github.com/nim-lang/Nim/issues/13361 -- 3asynchttpserver form data/body broken with #13147 ; snippet at 12https://play.nim-lang.org/#ix=2b8H |
21:24:33 | FromDiscord_ | <clyybber> leorize: The destructor doesn't make an error though |
21:24:37 | FromDiscord_ | <clyybber> its your constructor |
21:24:38 | FromDiscord_ | <clyybber> https://play.nim-lang.org/#ix=2b8D |
21:32:17 | * | letto joined #nim |
21:38:47 | * | dadada quit (Ping timeout: 240 seconds) |
21:39:53 | * | martinium joined #nim |
21:41:05 | * | martinium quit (Client Quit) |
21:57:17 | * | Pqzcih5 quit (Remote host closed the connection) |
21:59:09 | * | thomasross quit (Ping timeout: 272 seconds) |
22:01:23 | dom96 | zedeus, :( |
22:02:17 | zedeus | body is now always empty, you need to use bodyStream. was that intended? |
22:02:46 | dom96 | if it breaks stuff then definitely not |
22:03:02 | * | PMunch joined #nim |
22:04:23 | leorize | oh is asyncstreams a thing now? |
22:04:33 | Zevv | it seems |
22:04:42 | Zevv | I used it the other day |
22:04:45 | leorize | > Unstable API. |
22:04:47 | leorize | https://nim-lang.org/docs/asyncstreams.html |
22:09:29 | * | thomasross joined #nim |
22:14:18 | lqdev[m] | lol https://nim-lang.org/docs/sequtils.html#filterIt.t%2Cuntyped%2Cuntyped |
22:14:34 | lqdev[m] | binary floating point numbers. |
22:15:07 | disruptek | they sure are fun. |
22:18:47 | * | narimiran quit (Ping timeout: 272 seconds) |
22:20:10 | PMunch | Ugh, Nim really needs a better macros module.. |
22:20:22 | PMunch | Remind me to create one when I'm back from vacation :P |
22:21:35 | dom96 | True that |
22:25:43 | * | ng0 joined #nim |
22:29:33 | * | ng0_ quit (Ping timeout: 272 seconds) |
22:31:27 | * | hax-scramper quit (Ping timeout: 240 seconds) |
22:31:34 | * | solitudesf quit (Ping timeout: 256 seconds) |
22:31:38 | * | hax-scramper joined #nim |
22:37:30 | lqdev[m] | +1 |
22:38:22 | leorize | 4raq thought about it iirc |
22:38:40 | shashlick | dom96: am moving into nimble work, unless any other crucial choosenim work |
22:38:48 | shashlick | Do we want to make another release |
22:39:03 | dom96 | my main concern is the openssl crash |
22:39:51 | shashlick | Oh ya there's that one too |
22:40:14 | shashlick | There is an issue with nimble since Nim 1.0 |
22:40:26 | enthus1ast | can i somehow check in a macro if a proc with the given signature exists? |
22:40:37 | shashlick | @leorize found it while testing nimble packages |
22:42:20 | PMunch | enthusiast, well you can output a when declared statement.. |
22:42:59 | Zevv | enthus1ast: Sometimes you can abuse `compiles` |
22:43:48 | shashlick | https://irclogs.nim-lang.org/07-02-2020.html#03:04:14 |
22:43:59 | shashlick | Fails on 1.0 Nim but works on 0.20.2 |
22:44:05 | shashlick | So it's a Nim change |
22:44:15 | enthus1ast | it seems that compiles works for: compiles(strfunc("")) but not for compiles(strfunc(string)) |
22:44:16 | shashlick | @leorize ^^ |
22:45:33 | * | thomasross quit (Ping timeout: 268 seconds) |
22:46:39 | enthus1ast | what i'm trying to do is to patch json to deserialize objects in a predefined way, the quasi opposite of `%*`(mytype: MyType) |
22:46:58 | * | thomasross joined #nim |
22:47:42 | enthus1ast | my idea was to let the to macro call also my defined to procs for a given type |
22:50:36 | enthus1ast | but i'm unsure if this could work out :/ |
23:01:33 | * | Ven`` joined #nim |
23:05:58 | * | ftsf joined #nim |
23:11:21 | * | hlavaty quit (Ping timeout: 272 seconds) |
23:23:22 | * | Hideki_ joined #nim |
23:27:10 | * | u0_a121 joined #nim |
23:27:38 | * | Hideki_ quit (Ping timeout: 240 seconds) |
23:29:06 | * | PMunch quit (Quit: Leaving) |
23:32:31 | * | sveri quit (Read error: Connection reset by peer) |
23:34:00 | * | martinium joined #nim |
23:43:32 | * | u0_a121 quit (Read error: Connection reset by peer) |
23:46:29 | * | ng0_ joined #nim |
23:47:04 | * | tane quit (Quit: Leaving) |
23:49:21 | * | ng0 quit (Ping timeout: 272 seconds) |
23:50:18 | * | u0_a121 joined #nim |
23:51:48 | * | thomasross_ joined #nim |
23:51:48 | * | thomasross quit (Killed (orwell.freenode.net (Nickname regained by services))) |
23:51:48 | * | thomasross_ is now known as thomasross |
23:55:07 | * | theelous3 quit (Ping timeout: 240 seconds) |