00:14:22 | * | jmdaemon joined #nim |
00:17:42 | FromDiscord | <Leftbones> sent a code paste, see https://play.nim-lang.org/#ix=4lxL |
00:18:17 | FromDiscord | <Leftbones> Even if they're both valid, I prefer to follow the coding standards (as long as they're not obnoxious, looking at you C#) |
00:18:40 | FromDiscord | <Leftbones> (edit) "C#)" => "any language that tells me open brackets should be on a new line)" |
00:18:53 | FromDiscord | <Leftbones> (edit) "any" => "any" | "line)" => "line)" |
00:19:27 | FromDiscord | <leorize> the modern version of that is to write your code in nim |
00:19:56 | FromDiscord | <leorize> re\: this |
00:20:16 | FromDiscord | <Elegantbeef> I personally do the latter left |
00:20:27 | FromDiscord | <Elegantbeef> Easier to add new types to |
00:20:43 | FromDiscord | <Leftbones> That's what I see on nim-by-example and other references and docs, so I assumed that was the recommended styling |
00:20:53 | FromDiscord | <Leftbones> And yeah, adding new types under the same `type` declaration is great |
00:21:32 | FromDiscord | <Leftbones> In reply to @leorize "the modern version of": Agreed, I'm a hobby/passion programmer, I don't get paid to do it, so I write in whatever language I like writing, and for the past few days I've really been vibing with Nim |
00:21:38 | FromDiscord | <Elegantbeef> Plus you never have an issue with cyclical types |
00:21:58 | FromDiscord | <Elegantbeef> Oh shit i'm doing this, but still not getting paid! đ |
00:22:28 | FromDiscord | <leorize> just work for status, duh |
00:22:57 | FromDiscord | <Leftbones> Will they hire someone who has no formal programming experience or training |
00:22:59 | FromDiscord | <leorize> surely the ethereum market won't crash overnight |
00:23:11 | FromDiscord | <Leftbones> Surely not, crypto is known for being stable |
00:23:20 | FromDiscord | <Elegantbeef> You're FTXing me |
00:25:36 | FromDiscord | <leorize> fwiw this is the case for most of nim devs, and they got hired so...â”(@Leftbones) |
00:26:07 | FromDiscord | <Elegantbeef> It's quite odd how many Nim programmers are self taught |
00:26:11 | FromDiscord | <Leftbones> I suppose there aren't many people with professional Nim experience at this point, and I'm not sure formal Nim education exists yet |
00:26:30 | FromDiscord | <Leftbones> Tbh I hope the industry continues to shift towards acceptance of self-taught programmers |
00:26:55 | FromDiscord | <leorize> I mean, do they not? as long as you have things to back you up |
00:27:26 | FromDiscord | <Leftbones> Yeah it just felt like for a long time, the only thing that matters is the piece of paper saying you know what you're doing (even if you don't, but you paid for the paper) |
00:27:28 | FromDiscord | <Elegantbeef> "acceptance of self-taught programmers" many big companies were founded by these |
00:28:09 | FromDiscord | <Elegantbeef> This is why i discredit leo here, he paid for his pretend knowledge đ |
00:28:41 | FromDiscord | <leorize> yep, throwing money into the pit for a paper of questionable value here |
00:28:41 | FromDiscord | <Leftbones> I remember reading that before Python was as popular as it is now, someone said hiring Python devs was like a cheat code for getting good programmers since they chose to write in a language they were passionate about, maybe that'll be what Nim is |
00:29:09 | FromDiscord | <Elegantbeef> That's the case for some Nim programmers, but i've seen some code |
00:29:10 | FromDiscord | <Leftbones> In reply to @leorize "yep, throwing money into": gold star, you done did itâ |
00:29:17 | FromDiscord | <Leftbones> (edit) "itâ" => "it â" |
00:34:59 | FromDiscord | <auxym> In reply to @Leftbones "I remember reading that": I've read people say that about clojure on HN recently |
00:36:02 | FromDiscord | <Leftbones> In reply to @auxym "I've read people say": Probably applies to a lot of the more "niche" languages, there's plenty of them haha |
01:32:08 | * | argonica joined #nim |
02:38:58 | * | jmdaemon quit (Ping timeout: 256 seconds) |
03:48:38 | FromDiscord | <Rika> In reply to @Leftbones "Wait, is the proper": Not standardised, I believe a good amount of people use one or the other |
04:06:36 | * | azimut_ joined #nim |
04:07:14 | * | azimut quit (Remote host closed the connection) |
04:18:04 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lyq |
04:26:01 | FromDiscord | <Elegantbeef> Cannot say much i dont use pattern matching\\ |
04:35:13 | FromDiscord | <sOkam!> @Rika I saw you mentioned in the fusion/matching doc page. Do you know what this code is doing, and if its possible to do it without fusion/matching? |
04:36:41 | FromDiscord | <sOkam!> I understand its matching tree types, and when the tree matches then it returns the tree in a different orderâ”but i'm not understanding what the @a, @x, @b, etc etc its supposed to be doing |
04:43:21 | FromDiscord | <Elegantbeef> Capturing the values |
04:46:25 | FromDiscord | <sOkam!> capturing the values as in creating a variable that contains the contents of that thing? |
04:46:41 | FromDiscord | <Elegantbeef> Think `@` is mutable capture |
04:46:44 | FromDiscord | <sOkam!> if so, how is it possible that the order is different, but it matches? |
04:49:10 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Think `@` is mutable": what does that mean in practice? |
04:49:19 | FromDiscord | <Elegantbeef> the `|` i assume |
04:49:33 | FromDiscord | <Elegantbeef> `x = y` would assign the field that `x` matches |
04:49:36 | FromDiscord | <Rika> I never would have thought that I would be pinged for help because of the quote on matching |
04:50:23 | FromDiscord | <Rika> In reply to @sOkam! "I understand its matching": It binds and sets a variable named that in the position it is in on the pattern |
04:50:53 | FromDiscord | <sOkam!> what do you mean bind/ |
04:50:59 | FromDiscord | <sOkam!> (edit) "bind/" => "bind?" |
04:51:17 | FromDiscord | <Rika> Not in the Nim sense but in the general sense |
04:52:04 | FromDiscord | <Rika> Like if the value matches the pattern, whatever value is in the place of the @name is placed in a variable named name |
04:52:19 | FromDiscord | <sOkam!> i see. is it possible to do this without matching? |
04:52:26 | * | genpaku quit (Remote host closed the connection) |
04:52:27 | FromDiscord | <Rika> No |
04:52:28 | FromDiscord | <Elegantbeef> Of course |
04:52:35 | FromDiscord | <Rika> I mean yeah but no |
04:52:37 | FromDiscord | <sOkam!> even if it takes 100 lines of code |
04:52:42 | FromDiscord | <Elegantbeef> Pattern matching is just a syntax sugar on the if statements |
04:52:44 | FromDiscord | <Rika> Itâs possible but do you really want to |
04:52:49 | FromDiscord | <Elegantbeef> Expand macros shows it's possible |
04:53:05 | FromDiscord | <Rika> I donât really understand the âis it possibleâ anyway |
04:53:11 | FromDiscord | <Rika> In what constraints |
04:53:31 | FromDiscord | <sOkam!> In reply to @Rika "Itâs possible but do": well, i want to implement an rbtree, and i don't want to rely on fusion/matching and/or GC'ed features. so i guess answer would be yeah |
04:54:02 | FromDiscord | <Rika> Why are people so averse to dependencies |
04:54:05 | FromDiscord | <sOkam!> In reply to @Rika "In what constraints": standard nim syntax, without experimental things |
04:54:22 | * | arkurious quit (Quit: Leaving) |
04:54:28 | FromDiscord | <Rika> In reply to @sOkam! "standard nim syntax,": Itâs possible, it just wonât be pattern matching. |
04:54:43 | FromDiscord | <sOkam!> In reply to @Rika "Why are people so": im not. this is a toy project that uses gc:none specifically. i don't mind experimental things or dependencies usually. its just for this project only |
04:54:44 | FromDiscord | <Elegantbeef> look at C implementations of RBTree |
04:54:46 | FromDiscord | <Elegantbeef> Implement that |
04:54:49 | FromDiscord | <Rika> I mean, unless you implement it of course which most likely will be more work than necessary |
04:55:09 | FromDiscord | <sOkam!> In reply to @Elegantbeef "look at C implementations": there is only cpp on the site, and its template hell |
04:55:43 | FromDiscord | <Rika> In what site |
04:56:00 | FromDiscord | <sOkam!> https://rosettacode.org/wiki/Algebraic_data_types#Nim |
04:56:43 | * | genpaku joined #nim |
04:57:16 | FromDiscord | <Rika> You have a bit of work to do this in a no GC environment |
04:57:18 | FromDiscord | <Rika> And why? |
04:57:43 | FromDiscord | <sOkam!> learning/toy project |
04:59:09 | FromDiscord | <Rika> Okay |
04:59:10 | FromDiscord | <Rika> Well |
04:59:42 | FromDiscord | <Rika> This will be unsafe, no way around that just saying |
05:00:41 | FromDiscord | <Rika> Hmm |
05:01:26 | FromDiscord | <Rika> I think itâs gonna look vastly uglier with no matching lol |
05:01:34 | FromDiscord | <sOkam!> i bet |
05:01:54 | FromDiscord | <Girvo> Simplest way of zeroing/clearing/emptying an `array[T, byte]`? |
05:02:05 | FromDiscord | <Girvo> memset I guess? lol |
05:02:29 | FromDiscord | <sOkam!> there is zeroMem, but there might be a safer way |
05:02:41 | FromDiscord | <Rika> arr = default(arr) â”Idk lol |
05:02:51 | FromDiscord | <Girvo> zeroMem thats what I was looking for yeah |
05:03:20 | * | azimut_ quit (Ping timeout: 255 seconds) |
05:03:26 | FromDiscord | <Girvo> Unsafe is fine I'm deep in in-place algorithms in embedded firmware đ„Č |
05:03:43 | FromDiscord | <Girvo> (And I have the length check anyway for this) |
05:11:18 | FromDiscord | <Girvo> Oh good now I need to shift/delete the first 4 bytes of this array haha |
05:23:03 | FromDiscord | <Elegantbeef> `reset` exists aswell |
05:23:59 | FromDiscord | <Girvo> Oh nice |
06:04:41 | * | rockcavera quit (Remote host closed the connection) |
06:42:37 | * | kenran joined #nim |
06:44:43 | * | kenran quit (Remote host closed the connection) |
07:24:38 | FromDiscord | <Scalpi> Where to put asterisk to make "import" public? Or is there some other syntax for this? Why not just use "pub" like in zig?â”I tried to write public at the beginning of the line and I get Error: invalid indentation... as an error. |
07:24:54 | FromDiscord | <pyryrin> What are "multimethods"? |
07:25:51 | FromDiscord | <pyryrin> In reply to @Scalpi "Where to put asterisk": `export` keyword |
07:26:45 | FromDiscord | <Elegantbeef> Export after symbol |
07:26:50 | FromDiscord | <Elegantbeef> `proc myProc(...) =...` |
07:27:38 | FromDiscord | <Elegantbeef> Oh i misread yea `export my module` |
07:27:58 | FromDiscord | <Elegantbeef> Multimethods are deprecated but they use type information of multiple parameters to dispatch |
07:28:10 | FromDiscord | <Elegantbeef> It's ludicrous for following code |
07:28:22 | FromDiscord | <pyryrin> Oh |
07:30:51 | FromDiscord | <Scalpi> sent a code paste, see https://paste.rs/Xwa |
07:32:24 | FromDiscord | <Scalpi> sent a code paste, see https://play.nim-lang.org/#ix=4lyP |
07:32:54 | FromDiscord | <Scalpi> sent a code paste, see https://play.nim-lang.org/#ix=4lyQ |
07:32:56 | FromDiscord | <Scalpi> (edit) "https://play.nim-lang.org/#ix=4lyP" => "https://paste.rs/2m6" |
07:33:18 | FromDiscord | <Scalpi> no one variant đŠ |
07:42:53 | FromDiscord | <Rika> import aâ”export a |
07:43:03 | FromDiscord | <Rika> import a as bâ”export b |
07:43:22 | FromDiscord | <Rika> @Scalpi |
07:44:52 | FromDiscord | <pyolyokh> <https://nim-lang.org/docs/manual.html#modules-export-statement> |
08:01:36 | * | jjido joined #nim |
08:03:24 | FromDiscord | <Scalpi> In reply to @Rika "import a export a": but this not "public" |
08:04:18 | FromDiscord | <Elegantbeef> Nim doesnt have "public" |
08:04:20 | FromDiscord | <Elegantbeef> It has exported and not exported |
08:04:23 | FromDiscord | <Elegantbeef> What does "public" mean to you |
08:04:55 | FromDiscord | <Scalpi> in file lib.nim: Warning: imported and not used: mâ”in file main: Error: undeclared identifier: 'm' |
08:06:24 | FromDiscord | <Scalpi> sent a code paste, see https://play.nim-lang.org/#ix=4lyY |
08:06:52 | FromDiscord | <Elegantbeef> Whatever you're doing is not how anything in Nim is written |
08:07:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/s5T |
08:07:33 | * | termer_ joined #nim |
08:09:09 | * | termer quit (Ping timeout: 256 seconds) |
08:09:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lz1 |
08:15:04 | FromDiscord | <ShalokShalom> @Elegantbeef#0000 you learned programming with C#? |
08:15:11 | FromDiscord | <Elegantbeef> Yes |
08:15:25 | FromDiscord | <Scalpi> sent a code paste, see https://play.nim-lang.org/#ix=4lz4 |
08:16:13 | FromDiscord | <pyolyokh> you'll need to create a structure explicitly. |
08:16:47 | FromDiscord | <Rika> In reply to @Scalpi "thanks ... can I": You donât need the constant, itâll just be like that as is |
08:16:59 | FromDiscord | <Elegantbeef> Nim modules are not like Zig modules |
08:17:16 | FromDiscord | <Elegantbeef> Importing a module gives you first class access to all of it's exported symbols |
08:17:30 | FromDiscord | <Elegantbeef> @ShalokShalom\: was there a follow up? |
08:17:40 | FromDiscord | <Elegantbeef> Or are you just stalking my git repos đ |
08:17:58 | FromDiscord | <pyolyokh> nah, you can do a lot of this, it's just a lot of work for no gain except that you'll have written some Nim code without ever giving Nim a chance |
08:18:25 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lz5 |
08:19:49 | FromDiscord | <Rika> You donât even need the nil import, either way would work |
08:19:58 | FromDiscord | <Rika> The nil import enforces, but itâs valid without |
08:20:04 | FromDiscord | <pyolyokh> without nil, `doit()` would work, which is what Scalpi's trying to avoid |
08:20:13 | FromDiscord | <Scalpi> In reply to @Rika "You donât need the": but then, if the names match, the compiler will explicitly ask me to specify a specific path ... |
08:20:14 | FromDiscord | <Rika> Yes, but I assumed they didnât want to avoid it |
08:20:32 | FromDiscord | <Rika> In reply to @Scalpi "but then, if the": Then you can disambiguate with just putting it |
08:20:35 | FromDiscord | <pyolyokh> In reply to @Scalpi "but then, if the": Nim isn't Python and doesn't have Python's problems |
08:21:17 | FromDiscord | <Rika> Procedures can be disambiguated by name and arguments |
08:21:17 | FromDiscord | <pyolyokh> if your modules are meaningful they're going to be filled with procs that operate on different types anyway |
08:22:10 | FromDiscord | <Elegantbeef> Yea the response "Dont pretend this is X language" is very much my response |
08:22:43 | FromDiscord | <Elegantbeef> Nim has plenty of mechanisms to disambiguate and when an ambiguity error comes up you can easily disambiguate |
08:23:10 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "<@208199869301522432>\: was there a": I was simply interested about the background of yours |
08:23:35 | FromDiscord | <Elegantbeef> It's non existent |
08:23:36 | FromDiscord | <ShalokShalom> And you once told me, C# is the only other language you know |
08:24:22 | FromDiscord | <Scalpi> In reply to @Elegantbeef "Nim has plenty of": I would not like to eliminate ambiguity errors, just declare once what exactly I need and use ... now I found the alias command but have not yet found its documentation ... maybe this is what I need, or maybe not ... still understand and understand... |
08:24:49 | FromDiscord | <Elegantbeef> Nim code doesnt really "declare exactly what i need and use" |
08:25:25 | FromDiscord | <Elegantbeef> you can using `from x import y` and `export y` but for most code that's far and few inbetween |
08:25:49 | FromDiscord | <Scalpi> In reply to @Elegantbeef "Nim code doesnt really": Indeed? why then errors like "discard not specified" |
08:25:59 | FromDiscord | <Elegantbeef> What? |
08:26:21 | FromDiscord | <Elegantbeef> I've never seen a "discard not specified" in my life |
08:26:51 | FromDiscord | <Rika> Nim does not allow for values to be left unused implicitly |
08:27:04 | FromDiscord | <Rika> Unless you make it do so, of course |
08:27:07 | FromDiscord | <Elegantbeef> Oh you mean "why does one have to explicitly discard" |
08:27:31 | FromDiscord | <Elegantbeef> It's cause everything can be an expression in Nim which means you enforce discarding to not make it ambiguous |
08:27:34 | FromDiscord | <Rika> In reply to @Scalpi "I would not like": I have never seen this alias command |
08:28:02 | FromDiscord | <pyolyokh> the other question, of how to make `foo` expand to `baz.bar.foo`, is a template. |
08:28:10 | FromDiscord | <pyolyokh> (edit) "the other question, of how to make `foo` expand to `baz.bar.foo`, is ... a" added "answered with" |
08:28:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lz9 |
08:29:41 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzâŠ) |
08:30:10 | FromDiscord | <Scalpi> In reply to @Rika "I have never seen": because it doesn't exist. I saw it in github nim and it looks like it was just a suggestion for inclusion in the language... |
08:30:14 | FromDiscord | <pyolyokh> implicit discards cause problems. Nim's module (lack of) namespacing doesn't. Languages evolve to address complaints with the language. |
08:31:01 | FromDiscord | <Rika> I think there are some readability problems with lack of name spacing but I donât think theyâre too much |
08:31:37 | FromDiscord | <Elegantbeef> There is some, but there's also readability issues with `myThing::myOtherThing::myOthererThing.myOtherFIeld` đ |
08:31:48 | FromDiscord | <pyolyokh> yeah, I slightly prefer go's way of it, but it's not a big deal. |
08:32:25 | FromDiscord | <pyolyokh> and go still requires tooling like 'goimport' to be tolerable |
08:32:48 | FromDiscord | <Elegantbeef> Go also does compiler directives with `///` |
08:33:07 | FromDiscord | <Elegantbeef> Whoops `//` |
08:33:39 | FromDiscord | <pyolyokh> yeah, it's a very silly language, but it works. That it's obnoxiously designed while having good tooling and basically working is part of why I'm not that sympathetic to minor design complaints with Nim. |
08:33:40 | FromDiscord | <Rika> Comments |
08:33:41 | FromDiscord | <Rika> With comments |
08:38:36 | FromDiscord | <Scalpi> sent a code paste, see https://play.nim-lang.org/#ix=4lza |
08:38:52 | FromDiscord | <Elegantbeef> Cause the parser is very bad at detecting bad code |
08:40:02 | FromDiscord | <pyolyokh> it punishes slightly-wrong Nim with bad errors. It very slowly gets better. The only effective cure is to learn the language |
08:40:23 | FromDiscord | <Rika> Whatâs the code you put |
08:40:57 | FromDiscord | <Scalpi> sent a code paste, see https://play.nim-lang.org/#ix= |
08:41:15 | FromDiscord | <Scalpi> my bad ^) |
08:48:11 | FromDiscord | <ShalokShalom> One of the core issues with Nim for me |
08:48:29 | FromDiscord | <ShalokShalom> Bad error messages |
08:50:44 | FromDiscord | <ShalokShalom> @pyolyokh I guess tooling also suffers under this |
09:20:42 | FromDiscord | <pyryrin> How do I detect if its compiling to javascript inside code |
09:21:45 | FromDiscord | <Elegantbeef> `when defined(js)` |
10:15:14 | * | argonica quit (Remote host closed the connection) |
10:39:15 | Amun-Ra | how to convert specific integer to pointer? |
10:44:11 | Amun-Ra | ah, I was casting to "pointer"⊠;> |
10:50:59 | Amun-Ra | (it's for FFI) |
11:06:41 | FromDiscord | <demotomohiro> !eval let x = 1234.cint; echo cast[int](cast[ptr float](x.int)) |
11:06:48 | NimBot | 1234 |
11:10:08 | * | PMunch joined #nim |
11:44:43 | * | xet7 quit (Remote host closed the connection) |
11:47:00 | * | PMunch quit (Quit: Leaving) |
11:52:53 | * | PMunch joined #nim |
12:05:47 | Amun-Ra | I had a brain fart and wrote cast[pointer] instead of pointer to specific type |
12:10:49 | FromDiscord | <Arouzing> I wonder what protections the bot has in place. |
12:15:43 | * | PMunch quit (Quit: Leaving) |
12:33:52 | * | PMunch joined #nim |
12:44:52 | * | PMunch quit (Quit: Leaving) |
12:56:16 | * | xet7 joined #nim |
12:58:09 | * | PMunch joined #nim |
13:17:35 | FromDiscord | <jmgomez> In reply to @ShalokShalom "Bad error messages": I dont feel like that's an area that needs improvement relatively to other areas like tooling in general or bugs on the type system. They can be better for sure, but they are more and less at the level of C++ (or even better) |
13:21:39 | FromDiscord | <Anpanman> sent a long message, see http://ix.io/4lA6 |
13:24:57 | PMunch | Any reason why you want to statically compile against them? |
13:26:30 | * | jjido joined #nim |
13:27:56 | * | argonica joined #nim |
13:32:27 | FromDiscord | <Anpanman> I'm learning Nim by making an agent in the mythic framework, single exe (or dll or what have you) is all that makes sense for it really |
13:32:34 | FromDiscord | <Anpanman> (Mythic is a C2 framework) |
13:33:08 | FromDiscord | <enthus1ast> @Anpanman\: another option is to use puppy |
13:33:17 | FromDiscord | <enthus1ast> this uses the os for http calls |
13:33:22 | FromDiscord | <Rika> In reply to @BigSlugga "(Mythic is a C2": "Do you have the slightest idea how little that narrows it down?" |
13:33:30 | FromDiscord | <Rika> In reply to @enthus1ast "<@352968094404313089>\: another option is": they mentioned it |
13:33:32 | FromDiscord | <Rika> they want async |
13:33:37 | FromDiscord | <Anpanman> Oh I mentioned that đ |
13:33:44 | FromDiscord | <enthus1ast> ok |
13:34:15 | FromDiscord | <enthus1ast> would be much simpler though |
13:34:34 | FromDiscord | <Anpanman> lol yes it would |
13:36:53 | FromDiscord | <enthus1ast> and when you use this for development https://teskalabs.com/blog/openssl-binary-distribution-for-developers-static-library |
13:36:59 | FromDiscord | <enthus1ast> and later build it yourself properly |
13:37:00 | FromDiscord | <enthus1ast> ? |
13:38:42 | FromDiscord | <Anpanman> hmm i'll take a look, that might be what i have to do |
13:39:15 | * | rockcavera joined #nim |
13:39:36 | FromDiscord | <enthus1ast> since you're hacking anyway, there is another more hacky solution |
13:40:08 | FromDiscord | <enthus1ast> https://github.com/khchen/memlib |
13:40:20 | FromDiscord | <enthus1ast> but no idea if this works out of the box with ssl |
13:41:00 | FromDiscord | <Anpanman> Not sure but looks pretty cool! Already using their winim library đ |
13:43:32 | * | argonica quit (Remote host closed the connection) |
13:44:19 | * | argonica joined #nim |
13:57:17 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzzâŠ) |
13:58:15 | FromDiscord | <fabricio> idk if anyone has asked this before but has anyone benchmarked programs compiled with the nim c compiler and nlvm to compare the performance? |
14:01:04 | * | argonica quit (Remote host closed the connection) |
14:02:23 | * | argonica joined #nim |
14:05:05 | FromDiscord | <pyryrin> does nim sometimes turn off dead code elimination or something? because in lot of c library wrappers source code there is explicitly `{.deadCodeElim: on.}` |
14:05:50 | FromDiscord | <ringabout> In reply to @pyryrin "does nim sometimes turn": `{.deadCodeElim: on.}` is always on. |
14:06:04 | FromDiscord | <pyryrin> so why would they explicitly say it |
14:06:34 | FromDiscord | <ringabout> You may blame c2nim for using deprecated `{.deadCodeElim: on.}`. |
14:06:46 | FromDiscord | <ringabout> But I have fixed it. |
14:07:23 | FromDiscord | <pyryrin> its in the official sdl2 and everything |
14:07:30 | FromDiscord | <pyryrin> (edit) removed "and everything" |
14:08:33 | FromDiscord | <ringabout> In reply to @pyryrin "its in the official": Yeah, because these C wrappers use c2nim |
14:08:43 | FromDiscord | <ringabout> See https://github.com/nim-lang/c2nim/pull/236 |
14:08:58 | FromDiscord | <ringabout> In reply to @pyryrin "its in the official": PR is welcome to remove the statement. |
14:14:33 | FromDiscord | <ringabout> https://cs.github.com/?scopeName=All+repos&scope=&q=%7B.deadCodeElim%3A+on.%7D++language%3Anim |
14:14:51 | FromDiscord | <ringabout> All of them should be removed. |
14:15:58 | FromDiscord | <ringabout> I will add a warning for the `{.deadCodeElim: on.}` statement, |
14:25:27 | * | arkurious joined #nim |
14:26:15 | FromDiscord | <Mitja Felicijan> Do any of you know about a good IMAP library for Nim? |
14:40:44 | FromDiscord | <enthus1ast> Mitja Felicijan\: idk if there is a lib already, but the core of the imap protocol is quite simple to implement |
14:41:55 | FromDiscord | <enthus1ast> Have done some imap basic for a spam analysis experiment |
14:45:00 | FromDiscord | <Mitja Felicijan> I would probably need to do this with sockets right? |
14:59:25 | * | argonica quit (Remote host closed the connection) |
15:01:15 | * | argonica joined #nim |
15:01:26 | * | argonica quit (Remote host closed the connection) |
15:02:32 | FromDiscord | <voidwalker> @mitja https://github.com/search?q=language%3Anim+imap&type=repositories and https://nimble.directory/pkg/imap |
15:04:15 | * | argonica joined #nim |
15:05:50 | FromDiscord | <Mitja Felicijan> Lovely! I should have checked Github lol đ Thank you!â”(@voidwalker) |
15:13:40 | * | PMunch quit (Quit: Leaving) |
15:18:47 | * | azimut joined #nim |
15:22:25 | FromDiscord | <ⶠZeno> how can i get string out of float ?â”â”0.546544 to "0.546544" for example |
15:22:37 | FromDiscord | <enthus1ast> $0.1337 |
15:22:46 | FromDiscord | <ⶠZeno> i completely forgot about $ |
15:22:47 | FromDiscord | <ⶠZeno> thanks |
15:23:04 | FromDiscord | <enthus1ast> yes |
15:32:09 | * | argonica quit (Quit: Leaving) |
15:32:35 | * | argonica joined #nim |
15:33:17 | FromDiscord | <Scalpi> In reply to @enthus1ast "<@352968094404313089>\: another option is": terrible barking at the entrance. Seriously? |
15:38:57 | FromDiscord | <sOkam!> In reply to @ⶠZeno "how can i get": reverse is also possible with parseFloat |
15:39:24 | FromDiscord | <ⶠZeno> In reply to @sOkam! "reverse is also": i see, thanks |
15:41:36 | * | jmdaemon joined #nim |
15:42:04 | * | argonica quit (Remote host closed the connection) |
15:42:48 | FromDiscord | <Jessa> what's the non-deprecated version of `readLines` |
15:43:41 | FromDiscord | <Rika> "Deprecated: use readLines with two arguments" |
15:43:55 | FromDiscord | <djazz> readBetweenTheLines |
15:44:03 | FromDiscord | <djazz> đ |
15:44:08 | FromDiscord | <Rika> if you want to read the whole file its `readFile`, passing the filename |
15:44:34 | FromDiscord | <Jessa> In reply to @Rika "if you want to": whole file just without trailing newlines |
15:45:15 | FromDiscord | <Rika> there is the iterator `lines` https://nim-lang.org/docs/io.html#lines.i%2CFile |
15:45:22 | FromDiscord | <Rika> takes either a File or a filename string |
15:46:17 | FromDiscord | <Jessa> idk what i did different, but now `lines` works for some reasonâ”whereas before it gave some weird error |
15:46:20 | FromDiscord | <Jessa> ÂŻ\_(ă)_/ÂŻ |
15:46:29 | FromDiscord | <Jessa> In reply to @Rika "takes either a File": thanks for actually helping and not just sending shade |
15:46:34 | FromDiscord | <fabricio> sent a code paste, see https://play.nim-lang.org/#ix=4lAL |
15:47:06 | FromDiscord | <Jessa> sent a code paste, see https://play.nim-lang.org/#ix=4lAM |
15:59:29 | * | jmdaemon quit (Ping timeout: 256 seconds) |
15:59:57 | * | jmdaemon joined #nim |
16:06:22 | FromDiscord | <Recruit_main707> why so mad lol |
16:06:29 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
16:07:18 | * | jmdaemon joined #nim |
16:39:42 | * | jmdaemon quit (Ping timeout: 272 seconds) |
16:48:20 | * | jmdaemon joined #nim |
17:14:23 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lB8 |
17:16:05 | FromDiscord | <sOkam!> i guess its the same question as:â”- how to get time in seconds in float64, based on a duration? |
17:16:07 | FromDiscord | <pyolyokh> use one of the inMicroseconds, inSeconds procs, and convert from int64 to float |
17:16:33 | FromDiscord | <sOkam!> In reply to @pyolyokh "use one of the": inseconds is int. it would destroy precision |
17:16:52 | FromDiscord | <pyolyokh> inSeconds would give you second precision. There are other procs |
17:17:09 | FromDiscord | <pyolyokh> int64 is more precise than float64 |
17:17:10 | FromDiscord | <sOkam!> yeah, but if i want to get seconds as float, that's what I'm not grasping how to do |
17:17:23 | FromDiscord | <pyolyokh> inSeconds is an example. There are other procs. |
17:17:32 | FromDiscord | <sOkam!> i know there are other procs |
17:17:39 | FromDiscord | <sOkam!> im saying that i don't get how to use them |
17:17:47 | FromDiscord | <pyolyokh> they work the same way as inSeconds |
17:17:49 | FromDiscord | <sOkam!> it must be really stupid dum question, but i always struggle with those |
17:18:11 | FromDiscord | <sOkam!> In reply to @pyolyokh "they work the same": except they are all ints |
17:18:22 | FromDiscord | <sOkam!> and I'm trying to get seconds as float |
17:18:24 | FromDiscord | <pyolyokh> int64 is more precise than float64 |
17:19:01 | FromDiscord | <sOkam!> man, but i need delta as 0.25s to multiply to a vector to get from velocity per frame to velocity per second |
17:19:14 | FromDiscord | <sOkam!> I would just use the int, but i need to multiply with a vector to interpolate and integrate |
17:19:33 | FromDiscord | <pyolyokh> right, so convert int64 to float64 to do that math |
17:19:41 | FromDiscord | <pyolyokh> in the units that work for you |
17:19:59 | FromDiscord | <sOkam!> except inseconds destroys precision |
17:20:24 | FromDiscord | <pyolyokh> then don't use that one |
17:20:30 | FromDiscord | <sOkam!> i feel this is one of those stupid things that must be in front of my damn face, and i never see them đ |
17:20:33 | FromDiscord | <pyolyokh> there are other procs! |
17:20:44 | FromDiscord | <sOkam!> but those other procs don't give seconds! |
17:20:53 | FromDiscord | <sOkam!> the question is basically how to convert |
17:21:02 | FromDiscord | <pyolyokh> OK, suppose you have 5000 milliseconds |
17:21:04 | FromDiscord | <pyolyokh> how many seconds is that? |
17:21:24 | FromDiscord | <sOkam!> 1/5000 ? |
17:22:06 | FromDiscord | <sOkam!> actually, nope. see, i'm dumb with these simple things đ |
17:22:15 | FromDiscord | <ezquerra> Is there a target date for the official release of nim v2.0? |
17:22:38 | FromDiscord | <treeform> I also would like to know |
17:23:38 | FromDiscord | <sOkam!> 5000 / (msec in a second) i guess? |
17:23:55 | FromDiscord | <pyolyokh> yeah |
17:24:36 | FromDiscord | <sOkam!> would it be better to do the math with nanoseconds, to not lose too much precision? |
17:25:32 | FromDiscord | <pyolyokh> do algebra with units, where x/x=1. If you take an amount and divide it by an equivalent amount, you get 1. Multiplying an amount by 1 leaves you with the same amount. 1000 milliseconds = 1 second, so 1000ms/1s and 1s/1000ms are both ratios that you can multiply by a number to get that same number back, because you're multiplying it by 1. |
17:26:30 | FromDiscord | <pyolyokh> take 5000ms 1s/1000ms, that's (50001mss)/(1000ms), treating the units as factors as. So you can cancel them out. ms/ms = 1. It simplifies to 5000s/1000 |
17:26:42 | FromDiscord | <pyolyokh> (edit) "as." => "as well." |
17:27:43 | FromDiscord | <pyolyokh> In reply to @sOkam! "would it be better": yeah. strictly speaking a Duration has >64bits of information, because it's an int64 of seconds + nanoseconds, but if you're making a game you're probably not going to want to wake a year before display updates |
17:28:26 | FromDiscord | <pyolyokh> just use whichever toThatUnit proc works for you, math it back to floating point seconds |
17:28:34 | FromDiscord | <sOkam!> kk |
17:39:48 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4lBm |
17:40:17 | FromDiscord | <sOkam!> i can divide an int64 by an int literal, but not i64 by i64 |
17:42:33 | FromDiscord | <ShalokShalom> In reply to @jmgomez "I dont feel like": Comparison to Elm... |
17:42:43 | FromDiscord | <ShalokShalom> Or Rust đ |
17:43:09 | FromDiscord | <ShalokShalom> Lots of languages have much better error messages and I think particularly new programmers stuble over this |
17:44:11 | FromDiscord | <pyolyokh> sent a code paste, see https://paste.rs/dyo |
17:44:30 | * | jmdaemon quit (Ping timeout: 256 seconds) |
17:44:37 | FromDiscord | <sOkam!> In reply to @pyolyokh "you have the duration.toSomeUnit": what float? i don't follow |
17:44:46 | FromDiscord | <jmgomez> In reply to @ShalokShalom "Comparison to Elm...": Yeah, that's why I said relatively to other parts of the lang that needs more attention |
17:45:07 | FromDiscord | <pyolyokh> `d1.toMillisevconds.float64 / 1000.0` for example |
17:45:26 | FromDiscord | <sOkam!> In reply to @pyolyokh "`d1.toMillisevconds.float64 / 1000.0` for": but im trying to divide one duration by another |
17:46:28 | FromDiscord | <pyolyokh> you should probably get floats first before what you're doing with that |
17:46:39 | FromDiscord | <pyolyokh> for one reason, there isn't a / implemented for Duration |
17:47:09 | FromDiscord | <pyolyokh> but anyway `d1.inNanoseconds.float64 / d2.inNanoseconds.float64` |
17:47:13 | FromDiscord | <sOkam!> yeah, because the result is going to be unit/dependent |
17:47:36 | FromDiscord | <sOkam!> In reply to @pyolyokh "but anyway `d1.inNanoseconds.float64 /": is f64 able to contain the whole nanosecond range? |
17:47:40 | FromDiscord | <sOkam!> that's why i wasn't doing that |
17:47:55 | FromDiscord | <sOkam!> i thought that it might break it |
17:48:22 | FromDiscord | <pyolyokh> a Duration 128 bits so to get a number from it at all you need to start with the ranges you're going to be working in |
17:48:31 | FromDiscord | <pyolyokh> (edit) "a Duration ... 128" added "is" |
17:49:32 | FromDiscord | <sOkam!> i understand the idea, but i don't know how to do it correctly in practice |
17:49:55 | FromDiscord | <sOkam!> i know i can just cast the nanoseconds to float, my worry if that's going to break the numbers or something |
17:50:26 | FromDiscord | <sOkam!> (edit) "i know i can just cast the nanoseconds to float, my worry ... if" added "is" |
17:54:26 | FromDiscord | <pyolyokh> int64.high of nanoseconds is about 292 years, if I'm doing this right |
17:54:37 | FromDiscord | <pyolyokh> `cast[Duration]((0, int64.high)).inNanoseconds.float / (1e9 3600 24 365.25)` |
17:55:15 | FromDiscord | <pyolyokh> int32.high is still almost 7 years |
17:55:25 | FromDiscord | <pyolyokh> nah wait I definitely did that one wrong |
17:56:19 | FromDiscord | <sOkam!> In reply to @pyolyokh "int64.high of nanoseconds is": yeah, but i know that f64 can only contain about 8y or something. hence my worry |
17:57:23 | FromDiscord | <pyolyokh> eh, float representation's weird. It's not as simple as counting the non-exponent bits. |
17:57:24 | FromDiscord | <cow> it'll just lose accuracy after 8 years đ |
17:57:49 | FromDiscord | <cow> but if you know how accurate you'll have your data it's probably not a good idea to use floats |
17:57:50 | FromDiscord | <pyolyokh> floats gradually have gaps in representation, so that f+1==f |
17:58:30 | FromDiscord | <cow> yeah that's another thing if you increment continuously |
18:00:52 | FromDiscord | <pyolyokh> `cast[Duration]((0, int32.high.int64)).inNanoseconds.float / 1e9` there that's the way to do it. 32 bits is enough for 2.1s |
18:02:07 | FromDiscord | <sOkam!> In reply to @pyolyokh "`cast[Duration]((0, int32.high.int64)).inNanosecond": why passing through i32, and f32? |
18:03:29 | FromDiscord | <pyolyokh> I wanted 32 bits and int32.high is convenient. 1e9's a float. |
18:10:45 | FromDiscord | <pyolyokh> sent a code paste, see https://play.nim-lang.org/#ix=4lBy |
18:12:00 | FromDiscord | <sOkam!> i don't think i understand 1% of that, or how to apply it. but sounds interesting |
18:16:05 | * | crem joined #nim |
18:23:38 | FromDiscord | <pyolyokh> if there's some kind of lesson there it's that, since I'm not using any of these numbers, I am not stressing them much at all. You should stress the numbers to the extent that you're using them. |
18:24:19 | FromDiscord | <pyolyokh> especially as if there was a float64-returning proc in times.nim it would just do .toMilliseconds and divide by 1000.0 or similar |
18:50:14 | FromDiscord | <treeform> stealth Nim post https://news.ycombinator.com/item?id=34427864 |
19:00:31 | * | jjido joined #nim |
19:03:43 | FromDiscord | <qb> `typedef lm_byte_t lm_bytearr_t;` could I wrap this as `lm_bytearr_t = openArray[byte]` assuming that lm_byte_t is `byte`? |
19:06:42 | FromDiscord | <qb> nvm |
19:48:48 | * | TakinOver joined #nim |
19:56:46 | * | argonica joined #nim |
20:01:07 | FromDiscord | <michaelb.eth> In reply to @treeform "stealth Nim post https://news.ycombinator.com/item?": Always happy to see Nim/-related posts on the top page of HN.â”â”In this case, the main argument of the article linked to from HN is a bit undercooked, but it includes a decent write up of the authorâs early experiences with Nim |
20:01:44 | FromDiscord | <michaelb.eth> (edit) "In reply to @treeform "stealth Nim post https://news.ycombinator.com/item?": Always happy to see Nim/-related posts on the top page of HN.â”â”In this case, the main argument of the article linked to from HN is a bit undercooked, but it ... includes" added "also" |
20:02:22 | * | argonica quit (Quit: Leaving) |
20:02:24 | FromDiscord | <IsaacPaul> I feel like most tools should 'phone home' especially crash reports. Hi |
20:02:26 | FromDiscord | <IsaacPaul> (edit) removed "Hi" |
20:02:40 | FromDiscord | <IsaacPaul> (edit) "I feel like most tools should 'phone home' especially ... crash" added "when it's" |
20:05:14 | * | argonica joined #nim |
20:09:20 | FromDiscord | <Leftbones> Does Nim not agree with the M1 macs or is vscode screwing with my environment again? https://media.discordapp.net/attachments/371759389889003532/1065362274707054592/image.png |
20:10:39 | FromDiscord | <Leftbones> It should be noted that this works fine on Windows, I wasn't expecting to see different results on my macbook |
20:12:56 | FromDiscord | <ygol55> Hello. If I want to run a GUI aplication programmed with Nim, and then run a code from another language, could I do that? |
20:13:20 | FromDiscord | <ygol55> I mean, If I'm running graphs on this application, can I do that using another language? |
20:13:31 | FromDiscord | <ygol55> I just want to run this from another language |
20:14:34 | FromDiscord | <ygol55> I guess there's a way to deal with that with JSON, right? |
20:14:40 | FromDiscord | <ygol55> To combine two langauges |
20:14:44 | FromDiscord | <ygol55> If I'm correct |
20:19:10 | FromDiscord | <hotdog> In reply to @ygol55 "Hello. If I want": What is the other language? |
20:19:16 | FromDiscord | <ygol55> Julia |
20:19:25 | FromDiscord | <ygol55> The Julia programming language |
20:19:58 | FromDiscord | <ygol55> I just want to create a graph, but I wanted to also learn doing GUI aplications in Nim |
20:20:11 | FromDiscord | <ygol55> So I thought this is possible |
20:20:34 | FromDiscord | <hotdog> In reply to @ygol55 "Julia": Perhaps look at https://github.com/Clonkk/nimjl |
20:21:10 | FromDiscord | <hotdog> In reply to @ygol55 "So I thought this": Yep should be possible |
20:21:14 | FromDiscord | <ygol55> And there's such bridging for most of the language |
20:21:35 | FromDiscord | <hotdog> In reply to @ygol55 "And there's such bridging": What do you mean? |
20:22:22 | FromDiscord | <Leftbones> In reply to @Leftbones "Does Nim not agree": GCC doesn't have conio.h, lovely |
20:22:23 | FromDiscord | <ygol55> Meaning, there could be such same link for C#, c++, python and so on? |
20:22:52 | FromDiscord | <ygol55> In reply to @hotdog "What do you mean?": And also, I just need to install that and include this in the main file? |
20:23:08 | FromDiscord | <ygol55> How do I use this github project? |
20:23:44 | FromDiscord | <hotdog> In reply to @ygol55 "Meaning, there could be": Yes there are ways of linking between nim and a lot of languages, depending on what you want to do |
20:23:55 | FromDiscord | <ygol55> Okay |
20:24:04 | FromDiscord | <hotdog> In reply to @ygol55 "And also, I just": Iâve not actually used the library Iâm afraid, I just remembered seeing it before |
20:28:55 | FromDiscord | <michaelb.eth> if the Julia program will be running in a long-lived process separate from the Nim process, maybe you include a JSON-RPC server in the Julia code and a JSON-RPC client in the Nim code |
20:40:32 | FromDiscord | <IsaacPaul> In reply to @Leftbones "Does Nim not agree": You might be using x64 nim? |
20:41:09 | FromDiscord | <Leftbones> In reply to @IsaacPaul "You might be using": Oh that is very likely, I took the lazy route and installed it from Brew |
20:41:17 | FromDiscord | <Leftbones> I'll have to check that out later |
20:41:43 | FromDiscord | <IsaacPaul> In reply to @Leftbones "Oh that is very": brew is also probably outdated too |
20:41:58 | FromDiscord | <IsaacPaul> (edit) "In reply to @Leftbones "Oh that is very": ... brew" added "nim package in" |
20:49:06 | * | uics joined #nim |
20:49:37 | * | krux02 joined #nim |
20:49:38 | * | uics left #nim (#nim) |
20:53:02 | FromDiscord | <deech> Why does `RangeDefect` not produce a stack trace? |
20:56:31 | * | argonica quit (Quit: Leaving) |
21:04:36 | * | xet7 quit (Quit: Leaving) |
21:09:52 | Amun-Ra | it does |
21:11:44 | * | krux02 quit (Remote host closed the connection) |
21:13:56 | Amun-Ra | have you set -d=danger on? |
21:14:54 | FromDiscord | <deech> I don't have a minimal example off hand but I'm using `Natural` in my project and if that throws all I get is a `RangeDefect` . I have `-d:release` but I don't think that implies `-d:danger`? |
21:15:22 | * | krux02 joined #nim |
21:15:43 | Amun-Ra | no |
21:17:42 | Amun-Ra | -d=release requires setting --stackTrace=on |
21:27:41 | FromDiscord | <michaelb.eth> fwiw, I usually have (among other things) the following in my projects' `config.nims` |
21:27:51 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4lCd |
21:28:17 | Amun-Ra | speaking of nims, how can one include another nims file? |
21:28:47 | Amun-Ra | my config.nims has 8.8KB ;) |
21:29:11 | FromDiscord | <michaelb.eth> that's a pretty big config, what are you doing in there? |
21:29:16 | FromDiscord | <michaelb.eth> just curious |
21:29:18 | FromDiscord | <leorize> you can use `import` |
21:29:29 | FromDiscord | <leorize> rename the other file to `.nim` and you can `import` |
21:30:56 | Amun-Ra | hmm, it works |
21:30:59 | Amun-Ra | thanks |
21:31:26 | Amun-Ra | michaelb.eth: settings flags for various crosscompilers, settings many hints on |
21:31:31 | * | argonica joined #nim |
21:57:11 | * | krux02 quit (Remote host closed the connection) |
22:09:12 | termer_ | Is startProcess in osproc blocking? In other words, does it block the thread until the OS launches the process? |
22:09:19 | * | termer_ quit (Quit: ZNC 1.7.5+deb4 - https://znc.in) |
22:09:48 | * | termer joined #nim |
22:11:40 | termer | I know I can use peek for the status code and streams, but I want to know whether I can also launch the process without blocking the thread. Currently I'm launching a thread that then starts the process and uses blocking I/O for the streams to get data, but if it's possible for me to launch the process without blocking, I can wrap everything in |
22:11:40 | termer | async pragmas and be just fine |
22:12:40 | FromDiscord | <Elegantbeef> It likely calls fork on \nix, so it'll block until that call yes |
22:12:55 | termer | what a shame |
22:13:09 | termer | But thanks for the answer |
22:13:15 | FromDiscord | <leorize> it does block until the program is started |
22:13:56 | FromDiscord | <leorize> the only way to launch programs without blocking is to do it in a thread |
22:15:33 | termer | that's what I figured. I guess it's an OS problem more than an implementation problem |
22:21:49 | * | krux02 joined #nim |
22:21:57 | * | Phytolizer joined #nim |
22:22:11 | * | Phytolizer quit (Remote host closed the connection) |
23:05:50 | FromDiscord | <sOkam!> what do you guys recommend for profiling a nim app? |
23:06:29 | FromDiscord | <sOkam!> an opengl game engine, to be specific |
23:13:08 | FromDiscord | <treeform> In reply to @sOkam! "an opengl game engine,": if you have NV GPU, https://developer.nvidia.com/nsight-graphics is really good. |
23:13:47 | FromDiscord | <treeform> if you are on windows or linux this I made this for quick and easy things: https://github.com/treeform/hottie/ |
23:14:22 | FromDiscord | <treeform> If you have Intel GPU this is also great: https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html#gs.n0ldf3 |
23:15:18 | FromDiscord | <treeform> I wish there was a good GUI open source profiler that worked on windows/mac/linux.... though I am still waiting. |
23:17:03 | FromDiscord | <treeform> my other library: https://github.com/treeform/benchy is also related |
23:29:34 | FromDiscord | <sOkam!> In reply to @treeform "if you are on": i only knew about benchy, and thought it wasn't what i was searching for. will take a look, tyty âïž |
23:40:33 | FromDiscord | <Saint> sent a code paste, see https://play.nim-lang.org/#ix=4lCw |
23:40:37 | FromDiscord | <Saint> (edit) "sent" => "How do I add" | "code paste, see https://play.nim-lang.org/#ix=4lCw" => "callback using `then`" |
23:41:17 | * | argonica quit (Remote host closed the connection) |
23:42:15 | * | argonica joined #nim |
23:42:37 | FromDiscord | <Elegantbeef> You make a proc that takes the result of your future |
23:42:47 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/asyncjs.html#then%2CFuture%5BT%5D%2Cproc%2COnReject |
23:45:52 | FromDiscord | <Saint> Oh is then only for asyncjs? |
23:45:57 | FromDiscord | <Elegantbeef> Yes |
23:46:05 | FromDiscord | <Saint> Oh okay I'm not trying to use asyncjs |
23:46:13 | FromDiscord | <Saint> I saw then in the docs for asyncdispatch |
23:47:07 | FromDiscord | <Saint> Is there a way for me to poll the length of a sequence which is supposed to be filled by callbacks from async procs, and when the length of the sequence is a certain number then the callback the future is returned? |
23:47:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lCx |
23:49:20 | FromDiscord | <Elegantbeef> Dont quite understand what you're asking |
23:50:20 | FromDiscord | <Saint> Gotcha with the callback thing |
23:50:29 | FromDiscord | <Saint> Aren't you supposed to use addCallback? |
23:51:08 | FromDiscord | <Elegantbeef> No clue, i dont really use async |
23:51:10 | FromDiscord | <Saint> In reply to @Elegantbeef "Dont quite understand what": I want to fire off a bunch of async procs, and each of these procs will add data to a global sequence. I want to watch this sequence and once it is filled up then something executes, does that make sense? |
23:52:14 | FromDiscord | <Elegantbeef> instead of using a raw seq i'd suggest using a custom seq type, that has a callback on fill so then you dont need to watch it from inside async code |
23:54:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4lCy |
23:54:46 | FromDiscord | <Elegantbeef> Due to\ đ |
23:59:01 | FromDiscord | <Saint> Interesting! Thanks |
23:59:19 | FromDiscord | <Saint> But how do I get it to like poll |
23:59:22 | FromDiscord | <Saint> Or like watch for the size |