00:04:39 | FromDiscord | <konsumlamm> In reply to @jordan4ibanez "So nim multidimensional arrays": if you mean the builtin `array`, yes, those have no indirections (but the compiler doesn't do anything special there, that's just what naturally happens) |
00:10:36 | FromDiscord | <jordan4ibanez> I'm used to java literally taking my array literal |
00:54:40 | FromDiscord | <arathanis> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/blob/version-2-0/li": how come the template is exposed but not the var temp to the surrounding scope? |
00:54:46 | FromDiscord | <arathanis> (edit) "temp" => "tmp" |
01:07:45 | * | lucasta quit (Quit: Leaving) |
01:28:50 | FromDiscord | <Elegantbeef> @arathanis\: cause you're not accessing `tmp` and do not provide it a name so it's gensym'd |
02:01:06 | FromDiscord | <m4ul3r> sent a code paste, see https://paste.rs/vU2Es |
02:04:58 | FromDiscord | <Elegantbeef> It's just `sect: untyped` |
02:13:33 | FromDiscord | <m4ul3r> It’s working, but moving it to the .data rather than the stack, so it’s something in the function. ↵Future me will look at why |
02:13:50 | FromDiscord | <m4ul3r> Something in assign chars |
02:14:55 | FromDiscord | <Elegantbeef> Eh I'd stop using a macro and just use a proc |
02:23:24 | FromDiscord | <terrygillis> Performance-wise and language-agnostic, how would inheritance/subtyping + dynamic dispatch using `method` compare to object variants + pattern matching `case`? |
02:24:05 | FromDiscord | <terrygillis> Nim seems to discourage method and dynamic dispatch |
02:24:56 | FromDiscord | <terrygillis> But logically, using a look-up table should be more efficient than going through all the cases right? |
02:25:07 | FromDiscord | <jakraes> I remember I was able to make a case of with ranges, is it still possible? I'm currently trying and I'm failing miserably 💀 |
02:25:21 | FromDiscord | <Elegantbeef> `of a..b` works fine |
02:25:22 | FromDiscord | <heysokam> what was the way to force-import all symbols from a module, even those that are not public? 🤔 |
02:25:40 | FromDiscord | <Elegantbeef> Nim's methods are not done using a table present |
02:26:06 | FromDiscord | <jakraes> In reply to @Elegantbeef "`of a..b` works fine": Yup, it works |
02:26:10 | FromDiscord | <Elegantbeef> The thing is though that's not the only thing to be concerned of when dispatching |
02:26:11 | FromDiscord | <Elegantbeef> You also have pointers for all your types with thrash your cache |
02:26:11 | FromDiscord | <Elegantbeef> `import x{.all.}` |
02:26:12 | FromDiscord | <Elegantbeef> presently |
02:26:37 | FromDiscord | <jakraes> I discovered the error in these last seconds tho, turns out I can't do 0..0.3 for example |
02:26:42 | FromDiscord | <jakraes> I need to use 0.0..0.3 |
02:27:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4DoW |
02:27:59 | FromDiscord | <Elegantbeef> you can do `0f..0.3f` |
02:28:11 | FromDiscord | <Elegantbeef> The range has to be the same type on both sides |
02:28:23 | FromDiscord | <terrygillis> In reply to @Elegantbeef "You also have pointers": why does Nim `method` only work on ref types btw? is it because it's not using a table or sth? |
02:29:01 | FromDiscord | <Elegantbeef> It technically works on all types, the dynamic dispatch only works on `object of X` cause it needs type information |
02:29:24 | FromDiscord | <Elegantbeef> The entire point of dynamic dispatch is that you do not know the type you have statically and as such need a dynamic mechanism to call procedures |
02:30:50 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4DoY |
02:30:54 | FromDiscord | <Elegantbeef> `std/importutils` |
02:31:09 | FromDiscord | <Elegantbeef> Object fields are not on the module so require `privateAccess` |
02:31:28 | FromDiscord | <terrygillis> In reply to @Elegantbeef "It technically works on": The manually specifically says: "For dynamic dispatch to work on an object it should be a reference type." and the examples given are all ref types. |
02:31:50 | FromDiscord | <Elegantbeef> Right the manual says that cause unless you know what you're doing you're going to run through a mine field |
02:32:34 | FromDiscord | <Elegantbeef> It does technically work for non ref types, but you're supposed to use inheritance + dynamic dispatch with refs |
02:32:40 | FromDiscord | <Elegantbeef> Since non refs cannot be stored in a collection together, there is no reason to use dynamic dispatch with them |
02:32:55 | FromDiscord | <Elegantbeef> normal procs work just fine |
02:34:48 | FromDiscord | <heysokam> In reply to @Elegantbeef "Object fields are not": does that work on objects that are privately access with {.all.}? |
02:34:55 | FromDiscord | <heysokam> (edit) "access" => "accessed" |
02:35:14 | FromDiscord | <Elegantbeef> No clue I avoid hacks like that as much as possible |
02:35:33 | FromDiscord | <terrygillis> In reply to @Elegantbeef "Since non refs cannot": Ok, it's all over my head now, again 😢 What do you mean by "non refs cannot be stored in a collection together"? |
02:35:52 | FromDiscord | <Elegantbeef> How do you store two objects of different sizes inside of an array? |
02:36:09 | FromDiscord | <heysokam> In reply to @Elegantbeef "No clue I avoid": yeah same. but the idea is that only one of the fields needs to be exportd by the module, and the rest are opaque |
02:36:31 | FromDiscord | <heysokam> but they are imported by multiple files, so.... need to be `` in some way |
02:37:03 | FromDiscord | <terrygillis> In reply to @Elegantbeef "How do you store": Ah that's illuminating |
02:37:33 | FromDiscord | <Elegantbeef> The only reason you use inheritance and runtime dispatch is when you have a variable or collection which can contain multiple different types |
02:37:49 | FromDiscord | <Elegantbeef> With Nim's generics and overloading there is like 0 reason to do it otherwise |
02:42:58 | FromDiscord | <terrygillis> But generally speaking about programming languages, and assuming only heap-allocated types are considered (I'm meddling with some kind of tree traversal), am I right to assume subtyping + dyn dispatch (vtable supported) is faster than sumtypes/variants + match? |
02:43:28 | FromDiscord | <Elegantbeef> They're too different to really say if the dispatch is faster |
02:44:47 | FromDiscord | <Elegantbeef> If you can achieve the same logic with value types that are tagged unions it's likely to be the faster program as it does not have pointer indirection, and the switch can be converted to a jump table |
02:44:55 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
02:45:30 | * | pbsds joined #nim |
02:47:25 | adigitoleo | I want to update the void-linux package for Nim to v2. Looks like there aren't any major build changes, but just wanted to ask here in case. |
02:47:25 | FromDiscord | <Elegantbeef> It's mostly pointless to worry about the dispatch overhead and best just to write the program |
02:48:26 | FromDiscord | <arathanis> In reply to @Elegantbeef "<@136570191038513152>\: cause you're not": oh ok, so it actually is exposed but its gensymed so it'a name is mangled? |
02:49:36 | FromDiscord | <arathanis> looks like they are indeed exposed as tmp\`gensymN |
02:50:00 | FromDiscord | <Elegantbeef> Gensym is unaccessible |
02:50:22 | FromDiscord | <arathanis> oh ok i didnt know that |
02:50:30 | FromDiscord | <arathanis> is Gensym explained somewhere? in the manual? |
02:51:03 | FromDiscord | <Elegantbeef> Probably |
02:53:10 | FromDiscord | <terrygillis> In reply to @Elegantbeef "If you can achieve": btw can object variants in nim be considered a sumtype with a few quirks syntactically? |
02:53:28 | FromDiscord | <Elegantbeef> I mean they are sumtypes, depending on what your definition is |
02:54:06 | FromDiscord | <Elegantbeef> Tagged unions, sum types, rust enums, bleh bleh bleh.... people use 80000 different names to describe a simple concept |
02:54:39 | FromDiscord | <Elegantbeef> The most loosest definition of a sum type is "A type which allows storage of a single instance of a set of types" |
02:57:16 | FromDiscord | <terrygillis> Is Nim's object variants the `variant records` described in this blog: https://journal.stuffwithstuff.com/2023/08/04/representing-heterogeneous-data/ |
02:57:23 | FromDiscord | <terrygillis> (edit) "Is Nim's object variants the `variant records` described in this blog: https://journal.stuffwithstuff.com/2023/08/04/representing-heterogeneous-data/ ... " added "?" |
02:58:05 | FromDiscord | <terrygillis> (edit) "`variant records`" => "`record cases`" |
02:58:25 | FromDiscord | <Elegantbeef> Yes Nim is descended from pascal |
03:00:48 | FromDiscord | <Elegantbeef> Using this list of definitions a sumtype is a specific implementation of a variant record or variant object as nim calls them |
03:00:54 | FromDiscord | <Elegantbeef> Or even object variant 😄 |
03:01:54 | FromDiscord | <terrygillis> Is an object variant's size always constant regardless of the discriminator, as opposed to subtypes? |
03:02:36 | FromDiscord | <Elegantbeef> Correct |
03:02:46 | FromDiscord | <Elegantbeef> Well actually that's wrong sorta |
03:02:54 | FromDiscord | <terrygillis> Is there some optimization beneath that reduce obj variant size when not need? (just curious, i guess not) |
03:03:16 | FromDiscord | <Elegantbeef> Since all subtypes are pointer in-directed their value component is the size of a pointer regardless of their heap data size |
03:03:46 | FromDiscord | <Elegantbeef> Nah there is not one cause that'd require manual allocating at runtime based off the size and you're back to the issue of trying to put two different types in a single array |
03:05:47 | FromDiscord | <Elegantbeef> It doesnt solve any problems it just makes more |
03:05:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Dp7 |
03:06:16 | FromDiscord | <Elegantbeef> If you can move it to a smaller variant make a smaller variant, metagn's got some good ideas in a recent RFC about this |
03:06:43 | FromDiscord | <fit_z> Is there a package for dlib in nim ? |
03:07:14 | FromDiscord | <terrygillis> In reply to @Elegantbeef "Since all subtypes are": all subtypes invariably involve pointers? |
03:07:44 | FromDiscord | <terrygillis> It's not just copying the fields over and have a hidden field pointing to the base type right? |
03:07:50 | FromDiscord | <Elegantbeef> That is what `ref T` means and modern OOP languages use `class`s which are pointer indirected |
03:08:26 | FromDiscord | <terrygillis> but how about a subtype that is not a ref? |
03:10:22 | FromDiscord | <terrygillis> In reply to @terrygillis "It's not just copying": i mean, is `type A = object of B` represented as another different record types with the same fields of B and a hidden field `baseType: B`? |
03:10:47 | FromDiscord | <terrygillis> (edit) "types" => "type" |
03:11:06 | FromDiscord | <Elegantbeef> That's how Nim does it iirc, look at the generated C to see |
03:14:07 | FromDiscord | <terrygillis> Where is the `$HOME/nimcache` folder on Windows? |
03:14:40 | FromDiscord | <terrygillis> is it some environment variables because checking the list and there seems to be no HOME set? |
03:14:47 | FromDiscord | <Elegantbeef> Given I do not know I can only do the joke response of.↵I think you need to install\: https://www.debian.org/ |
03:15:08 | FromDiscord | <Elegantbeef> you can do `--nimCache:someFolder` |
03:20:59 | FromDiscord | <terrygillis> In reply to @Elegantbeef "Given I do not": Hopefully one day :)) Got to stick to Win for now to work with others (I'm in a foreign country where Macbooks are still a foreign concept) |
03:21:13 | FromDiscord | <graveflo> In reply to @terrygillis "Where is the `$HOME/nimcache`": home is the same as `%USERPROFILE%` or something like that I think |
03:21:32 | FromDiscord | <Elegantbeef> I thought home was where .config was |
03:21:33 | FromDiscord | <graveflo> (edit) "home" => "`$HOME`" |
03:21:35 | FromDiscord | <Elegantbeef> \:d |
03:22:14 | FromDiscord | <graveflo> perhaps it should be |
03:22:20 | FromDiscord | <terrygillis> In reply to @graveflo "`$HOME` is the same": I found it thanks |
03:34:51 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=4Dp8 |
03:34:54 | FromDiscord | <aph> sorry that's a big chunk of error |
03:38:14 | FromDiscord | <Elegantbeef> It's a bug due to the `union1` intialisation |
03:38:32 | FromDiscord | <Elegantbeef> No clue how to resolve it, I guess make an issue on github |
03:38:37 | FromDiscord | <Elegantbeef> Or search for it |
03:41:56 | FromDiscord | <aph> oh, ok thanks! |
04:24:52 | * | rockcavera quit (Remote host closed the connection) |
04:39:57 | NimEventer | New thread by RedDirt: Networking with Nim, see https://forum.nim-lang.org/t/10405 |
04:48:54 | FromDiscord | <arathanis> sigh atlas is busted |
04:49:18 | FromDiscord | <Elegantbeef> How? |
04:49:53 | FromDiscord | <arathanis> if you do `atlas init --deps=<depsfolder>` the first time you do `atlas use <package>` it will clone that package into the root instead of to `depsfolder` but all its dependencies and any subsequent `atlas use ...` will clone to the `<depsfolder>` |
04:50:26 | FromDiscord | <arathanis> so the first installed package gets dropped in the root |
04:52:23 | FromDiscord | <Elegantbeef> Seems like an easy fix though |
04:52:38 | FromDiscord | <arathanis> yeah |
04:52:48 | FromDiscord | <arathanis> but it might be hard to find a source |
04:52:51 | FromDiscord | <arathanis> its very weird behavior |
04:52:59 | FromDiscord | <arathanis> what logic makes it drop the first one into the root but no others? |
04:53:51 | FromDiscord | <Elegantbeef> Might just be a case that the first file does not load from the config creating this behaviour |
05:05:30 | FromDiscord | <arathanis> In reply to @Elegantbeef "Might just be a": so it looks like the issue is that when `choosenim` builds `2.0.0` it gets atlas 0.6.2 |
05:05:37 | FromDiscord | <arathanis> which appears to have this problem |
05:05:43 | FromDiscord | <arathanis> but its fixed in 0.6.3 |
05:06:00 | FromDiscord | <arathanis> which is what you get if you clone and build atlas from source |
05:06:12 | FromDiscord | <Elegantbeef> Cant you just `nimble install atlas` 😛 |
05:06:23 | FromDiscord | <arathanis> that seems so cursed haha |
05:08:34 | FromDiscord | <arathanis> In reply to @Elegantbeef "Cant you just `nimble": it says it can't find the package when i try that rip |
05:08:40 | FromDiscord | <arathanis> you got my hopes up for nothing D: |
05:09:07 | FromDiscord | <Elegantbeef> `nimble install https://www.github.com/nim-lang/atlas` |
05:10:10 | FromDiscord | <arathanis> that installed 0.6.2 which explains why choosenim gets sad, what is the syntax for ignoring the tags and grabbing the head commit? |
05:10:33 | FromDiscord | <Elegantbeef> `@#head` |
05:10:42 | FromDiscord | <arathanis> that did it |
05:11:01 | FromDiscord | <arathanis> complete with all the compiler warnings 😍 |
05:11:05 | FromDiscord | <Phil> TFW I need to check for tuples explicitly in my "getFields" proc+ |
05:11:34 | FromDiscord | <Phil> Does micros NimNode equivalent for tuple also have a fields operator? |
05:12:36 | FromDiscord | <Elegantbeef> I do not have tuples wrapped |
05:12:41 | FromDiscord | <Phil> One sec, does micros do tuples?↵I don't.. ahh check |
05:14:30 | FromDiscord | <Elegantbeef> They're fairly simple, only have the `nnkTupleConstr`, `nnkPar`, `nnkTupleTy` |
05:16:04 | FromDiscord | <Phil> Hmm I could check for node if it's an object/ref object to use the micros way and for tuples I just iterate over the fields because thank god their typedefs can't be complicated |
05:18:30 | FromDiscord | <Elegantbeef> Right |
05:46:00 | * | xet7 joined #nim |
05:49:39 | * | azimut_ joined #nim |
05:51:03 | * | advesperacit joined #nim |
05:51:54 | * | azimut quit (Ping timeout: 246 seconds) |
06:11:42 | adigitoleo | What is the advantage of atlas over nimble? |
06:12:36 | FromDiscord | <Elegantbeef> Atlas should generally work better and is simpler 😄 |
06:12:45 | adigitoleo | Is it stable? |
06:12:52 | adigitoleo | Or should I wait |
06:13:23 | FromDiscord | <Elegantbeef> It should be stable |
06:13:30 | FromDiscord | <Elegantbeef> Most of the issues are not about the program but features iirc |
06:15:42 | * | azimut_ quit (Ping timeout: 246 seconds) |
06:33:07 | * | PMunch joined #nim |
06:48:44 | FromDiscord | <arathanis> is there a way to annotate requires for certain nim versions? |
06:49:02 | FromDiscord | <arathanis> like "it requires this iff NimMajor == 2" |
06:49:21 | FromDiscord | <arathanis> (edit) "versions?" => "versions in nimble files?" |
06:50:22 | PMunch | Hmm, I don't think so |
06:50:44 | PMunch | Or wait, Nimble files are just NimScript |
06:50:59 | FromDiscord | <Elegantbeef> You can use `when` but that's not really good to do |
06:51:05 | FromDiscord | <arathanis> that's a bummer. i wonder if that support will be added? otherwise packages are gonna have a fun time with "md5" |
06:51:08 | PMunch | So you could try to do `when NimMajor >= 2: requires "something"` |
06:51:35 | FromDiscord | <arathanis> since if you `import md5` on Nim 2.0 you get a warning that should you install `checksums` and so `import checksums/md5` |
06:51:35 | PMunch | Oh? What's going on with md5? |
06:51:59 | FromDiscord | <arathanis> (edit) "since if you `import md5` on Nim 2.0 you get a warning that ... should" added "you" | removed "you" |
06:52:03 | FromDiscord | <Elegantbeef> Just stop supporting nim 1943 |
06:52:22 | FromDiscord | <arathanis> i guess nothing is stopping them from using checksums al the time |
06:52:26 | FromDiscord | <arathanis> i can support that |
06:52:36 | PMunch | Well a warning isn't all that bad |
06:52:45 | FromDiscord | <arathanis> context is im fiddling with a package that does't work on nim 2.0 |
06:52:49 | FromDiscord | <Elegantbeef> My family was killed by a warning! |
06:52:58 | FromDiscord | <arathanis> and now im in its dependencies fixing their issues with 2.0 |
06:53:07 | FromDiscord | <arathanis> good news: seems to run 😎 |
06:53:13 | PMunch | Nice! |
06:53:29 | PMunch | I have yet to go through my packages and fix things up for 2.0 |
06:53:37 | FromDiscord | <arathanis> also it just has a straight up error that needs correcting |
06:53:47 | FromDiscord | <arathanis> nothing to do with 2.0 or not |
06:53:49 | FromDiscord | <arathanis> its just wrong lol |
06:53:58 | PMunch | Haha, that's always fun |
06:54:08 | FromDiscord | <arathanis> yeah, i think i hit an edge case they didn't test |
06:54:18 | FromDiscord | <arathanis> well i wouldn't call it an edge case |
06:54:24 | FromDiscord | <arathanis> but they must have not tested it |
06:54:42 | PMunch | I guess the way to solve this would be to have two versions of a package, one for pre-2.0 without the dependency, and one for post-2.0 with it. And then you'll have to lock version to the pre-2.0 one if you're not using 2.0 |
06:54:59 | PMunch | In the MD5 module? |
06:55:03 | FromDiscord | <arathanis> Beef's idea might be right, why not just make `checksums` a dependecy and always use that? |
06:55:11 | FromDiscord | <arathanis> In reply to @PMunch "In the MD5 module?": nah this is in the package |
06:55:17 | PMunch | Right |
06:55:34 | PMunch | Sure, it doesn't hurt to install a package you don't need |
06:55:41 | FromDiscord | <arathanis> why try and differentiate between md5 and checksums/md5 when you can just use the latter lol |
06:55:45 | PMunch | Or wait, I guess you could use it in pre-2.0 as well |
06:55:50 | FromDiscord | <arathanis> exactly |
06:55:51 | PMunch | Exactly |
06:55:59 | FromDiscord | <arathanis> anywho the error i found is |
06:56:05 | FromDiscord | <Elegantbeef> That was not my idea 😛 |
06:56:05 | FromDiscord | <Elegantbeef> My idea was not to worry about schlubs wanting to use 1.6.x |
06:56:11 | FromDiscord | <arathanis> lmaaaaao |
06:56:22 | FromDiscord | <arathanis> does checksums not work on pre nim 2/ |
06:56:24 | FromDiscord | <arathanis> (edit) "2/" => "2?" |
06:56:56 | PMunch | Checksums is probably just a copy of the old module, maybe with a nicer interface |
06:57:07 | FromDiscord | <arathanis> anywho, the error:↵its a mongodb lib↵↵if you pass in multiple hosts it does not properly inherit the username/password from the first host (as it shoudl according to the mongodb uri schema) so the hosts after the first fail to authenticate |
06:57:27 | FromDiscord | <arathanis> so you can't use replicals properly without a non-standard URI where you repeat the username/password for each host |
06:57:32 | FromDiscord | <arathanis> (edit) "replicals" => "replicas" |
06:58:02 | FromDiscord | <arathanis> `mongodb://username:password@host1,host2,host3` |
06:58:32 | FromDiscord | <arathanis> does not work, you have to↵`mongodb://username:password@host1,username:password@host2,username:password@host3` |
07:04:25 | * | junaid_ joined #nim |
07:10:34 | * | ntat joined #nim |
07:47:55 | FromDiscord | <bung8954> @ElegantBeouf why fungus not generate `getData` for me , that could be handy |
07:48:18 | FromDiscord | <Elegantbeef> What would `getData` do? |
07:50:06 | FromDiscord | <bung8954> return LineData or CircleData depends on kind in your example |
07:50:39 | FromDiscord | <Elegantbeef> How could that work |
07:51:09 | FromDiscord | <Elegantbeef> `getData` would have to be generic for that to work, but then it'd not work cause you need runtime information |
07:51:52 | FromDiscord | <Elegantbeef> If you want the tuple that badly just do `val.Line.distinctBase` |
07:52:48 | FromDiscord | <bung8954> I see, indeed. |
08:04:22 | FromDiscord | <System64 ~ Flandre Scarlet> Is there a good lib to make REST Apis please? |
08:09:48 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/dom96/jester↵Maybe I can use that |
08:12:25 | * | fallback quit (Ping timeout: 240 seconds) |
08:14:36 | * | fallback joined #nim |
08:20:18 | PMunch | Jester is pretty simple to work with |
08:20:24 | PMunch | But there are also many alternatives |
08:22:13 | PMunch | Basically any web-server package should also be able to create a REST API |
08:49:41 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DpN |
08:50:22 | PMunch | The error should be pretty obvious.. |
08:50:44 | FromDiscord | <odexine> You don’t have 80 parameters do you |
08:51:13 | FromDiscord | <System64 ~ Flandre Scarlet> Oh wait I'm dumb |
08:52:59 | FromDiscord | <System64 ~ Flandre Scarlet> paramStr is for arguments |
08:55:28 | NimEventer | New Nimble package! propositionalLogic - A library for (standard) propositional logic, see https://github.com/Azumabashi/nim-propositional-logic/ |
09:35:16 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DpU |
10:11:01 | FromDiscord | <Phil> Wait for can't not be blocking.↵You can just delay where you call waitfor |
10:12:06 | FromDiscord | <System64 ~ Flandre Scarlet> And what about callback on Future? |
10:22:20 | PMunch | This is what async is for.. |
10:22:31 | PMunch | You're supposed to use `await` instead of `waitFor` in this caes |
10:24:12 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Dq6 |
10:24:25 | FromDiscord | <odexine> You don’t need to use callbacks |
10:25:40 | FromDiscord | <odexine> It would be better learn to use await first before resorting to callbacks or so |
10:26:09 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Dq7 |
10:26:30 | FromDiscord | <odexine> Then make start auth window async |
10:33:23 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Dqa |
10:42:00 | FromDiscord | <odexine> Why not |
10:42:08 | FromDiscord | <odexine> Oh |
10:42:28 | FromDiscord | <odexine> I cannot read the code, the indentation looks fucked |
10:43:08 | FromDiscord | <System64 ~ Flandre Scarlet> the indentation is normal? 🤔 |
10:44:59 | FromDiscord | <System64 ~ Flandre Scarlet> This is the entire login window code https://media.discordapp.net/attachments/371759389889003532/1140596926811738183/loginWindow.nim |
10:49:26 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Dqi |
10:49:48 | FromDiscord | <heysokam> `string | Path` is not compatible with `Path` ❔ |
10:50:15 | FromDiscord | <odexine> Do you consume the return value |
10:50:32 | FromDiscord | <heysokam> I add it to a seq |
10:50:47 | FromDiscord | <heysokam> (edit) "seq" => "`seq[ShaderProg]` with `add`" |
10:51:20 | FromDiscord | <odexine> Perhaps is the path type it asks for different to the path type you use |
10:51:21 | FromDiscord | <ringabout> What's `gl`? |
10:51:26 | FromDiscord | <System64 ~ Flandre Scarlet> OpenGL |
10:51:27 | FromDiscord | <ringabout> > gl.newShaderProg(frag) |
10:51:38 | FromDiscord | <heysokam> In reply to @ringabout "What's `gl`?": `from myModule as gl import nil` |
10:53:11 | FromDiscord | <heysokam> In reply to @odexine "Perhaps is the path": I noticed some issues with `import std/[ os, paths ]`... where it was not able to resolve them as the same type |
10:53:16 | FromDiscord | <heysokam> maybe its related 🤔 |
10:53:44 | FromDiscord | <ringabout> Does `proc newShaderProg(frag: Path):` or `proc newShaderProg(frag: Path | string): ShaderProg` match? |
10:53:57 | FromDiscord | <heysokam> let me try |
10:54:35 | FromDiscord | <heysokam> `Path | string` doesnt |
10:55:26 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Dqj |
10:57:04 | FromDiscord | <heysokam> Ok, yeah. so the other file is doing `import std/os` and the one with the proc is doing `import std/paths`... and they are resolved as different types |
10:57:21 | FromDiscord | <heysokam> that is hella annoying. aren't they both coming from the exact same type? |
10:58:16 | FromDiscord | <ringabout> Where is the Path thing from except `std/paths`. There doesn't seem to have another one in `std/os`/ |
10:58:19 | FromDiscord | <ringabout> (edit) "`std/os`/" => "`std/os`." |
10:58:25 | FromDiscord | <ringabout> (edit) "`std/paths`." => "`std/paths`?" |
11:00:24 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Dqm |
11:00:40 | FromDiscord | <heysokam> In reply to @ringabout "Where is the Path": as far as i understand, os exports paths |
11:01:16 | FromDiscord | <heysokam> (edit) "https://play.nim-lang.org/#ix=4Dqm" => "https://play.nim-lang.org/#ix=4Dqo" |
11:01:46 | FromDiscord | <ringabout> I don't think so, could you find the export statements? |
11:02:02 | FromDiscord | <heysokam> you mean in os? |
11:02:05 | FromDiscord | <ringabout> yeah |
11:02:16 | FromDiscord | <heysokam> if I remove the std/os line it doesn't fail in that file |
11:02:35 | FromDiscord | <heysokam> that is already enough evidence? or is that not what you mean |
11:03:48 | FromDiscord | <odexine> os has no Path exported |
11:05:02 | FromDiscord | <heysokam> @ringabout https://github.com/nim-lang/Nim/blob/037f536e7ee25c4baf23dff8a4525825c506442c/lib/pure/os.nim#L32-L33 |
11:05:16 | FromDiscord | <heysokam> In reply to @odexine "os has no Path": except it exports `ospaths2` |
11:05:45 | FromDiscord | <odexine> Does it have a path type? |
11:05:45 | FromDiscord | <ringabout> `ospath2` is based on `string`, not `Path`. |
11:06:12 | FromDiscord | <heysokam> In reply to @ringabout "`ospath2` is based on": aren't all `Path`s just a distinct string? |
11:06:27 | FromDiscord | <heysokam> In reply to @odexine "Does it have a": well definitely |
11:06:35 | FromDiscord | <odexine> Did you actually look? |
11:06:41 | FromDiscord | <heysokam> that's what i used on stable before it was released, by manually copying the contents of that file |
11:07:06 | FromDiscord | <heysokam> In reply to @odexine "Did you actually look?": I haven't, but i used to copy all contents from that file into a project for a few months, before they were released to stable |
11:10:59 | FromDiscord | <odexine> I see no Path type in any of the imports of OS |
11:19:51 | * | Brainzman joined #nim |
11:21:46 | FromDiscord | <heysokam> well wherever its coming from, i had to qualify it explictely with `paths.Path` in all calls and now it works 🤷♂️ |
11:31:49 | FromDiscord | <heysokam> is there an existing way to remove a specific item or id from a seq? |
11:32:46 | FromDiscord | <nomad> So im trying to run a nim file, which works fine on my main machine. But im having problems running the file on a virtual machine. When trying to run the file in a vm, i get a missing dll error.↵↵Here is where i get confused. I wrote the program using only pure libraries, and i understood pure libraries dont need any dll's to run. Could somebody help me out? |
11:33:28 | FromDiscord | <nomad> The file is compiled on my main machine and then sent to the vm if that helps |
11:34:05 | FromDiscord | <heysokam> In reply to @nomad "So im trying to": that could be simplified to "my app doesn't work because my computer its missing a binary"↵its too ambiguous without any error messages for anyone to be able to help |
11:34:21 | FromDiscord | <heysokam> aka: post the error, otherwise its impossible to know |
11:34:29 | FromDiscord | <nomad> Alright one second |
11:36:00 | FromDiscord | <nomad> sent a code paste, see https://play.nim-lang.org/#ix= |
11:36:32 | FromDiscord | <nomad> Thats the error |
11:38:43 | FromDiscord | <odexine> In reply to @nomad "So im trying to": Did you compile with the SSL define |
11:38:48 | FromDiscord | <odexine> That needs the library you posted |
11:39:01 | FromDiscord | <odexine> (edit) "library" => "DLL on the error" |
11:39:06 | FromDiscord | <nomad> In reply to @odexine "Did you compile with": Yes i did |
11:39:14 | FromDiscord | <nomad> In reply to @odexine "That needs the DLL": Aah explains it |
11:39:28 | FromDiscord | <nomad> Well i really need ssl |
11:40:05 | FromDiscord | <nomad> Any way i could compile the nim file, and include the dll needed so to speak? |
11:40:21 | FromDiscord | <nomad> So i can send the file without needing a wizard or a ton of dll files |
11:42:12 | FromDiscord | <heysokam> In reply to @nomad "So i can send": thats the main problem with dynamic linking |
11:42:30 | FromDiscord | <demotomohiro> Why dont you ship with dlls? |
11:42:51 | FromDiscord | <heysokam> because you would need to ship every single potential dll on earth, which is nonsense |
11:43:03 | FromDiscord | <heysokam> that task is sent to the operating system |
11:43:11 | FromDiscord | <heysokam> and/or the user, depending on the os in question |
11:43:39 | FromDiscord | <nomad> In reply to @demotomohiro "Why dont you ship": I could but a single exe is a lot cleaner, and i dont have to have zip files and all that |
11:44:03 | FromDiscord | <heysokam> In reply to @nomad "I could but a": then you need to static-link with ssl in some way |
11:44:22 | FromDiscord | <nomad> Yeah thats what i was thinking, now the question is how |
11:44:26 | FromDiscord | <demotomohiro> You need to rebuild openssl to produce static link lib. |
11:44:59 | FromDiscord | <nomad> In reply to @demotomohiro "You need to rebuild": Sounds like a ton of work lol |
11:45:03 | FromDiscord | <odexine> Yes it is |
11:45:18 | FromDiscord | <odexine> You can use an alternative SSL implementation which is also a lot of work |
11:45:47 | FromDiscord | <nomad> Yeah, and i need http requests so no sll isnt an option |
11:45:53 | FromDiscord | <nomad> (edit) "sll" => "ssl" |
11:46:16 | FromDiscord | <demotomohiro> I saw many programs that are shipped with many dlls. |
11:46:39 | FromDiscord | <nomad> Yeah i know its not really uncommon in any way |
11:46:50 | FromDiscord | <odexine> Matter of preference |
11:47:33 | FromDiscord | <nomad> Could i perhaps use memlib in some way? |
11:47:49 | FromDiscord | <odexine> Use what? |
11:48:07 | FromDiscord | <nomad> https://github.com/khchen/memlib |
11:48:56 | PMunch | Isn't that exactly what memlib is used for? |
11:49:41 | FromDiscord | <nomad> Yeah i really dont know |
11:50:32 | FromDiscord | <nomad> Never used it |
11:52:12 | FromDiscord | <nomad> Ill look into it, thanks for the help guys |
12:05:33 | * | ntat quit (Quit: leaving) |
12:13:37 | * | azimut joined #nim |
12:23:26 | * | om3ga joined #nim |
12:29:25 | FromDiscord | <enthus1ast> i tend to use puppy for non async http calls these days |
12:29:35 | FromDiscord | <enthus1ast> this uses the os builtins |
12:29:47 | FromDiscord | <enthus1ast> winapi on windows and curl on linux and mac |
12:30:52 | NimEventer | New thread by hamidrb80: [Scala background] How does a macro in Scala differs from macro in Nim?, see https://forum.nim-lang.org/t/10406 |
12:31:04 | FromDiscord | <enthus1ast> but in any case, why not just make a folder with all the dll's required and zip it up? |
12:31:48 | FromDiscord | <odexine> In reply to @nomad "I could but a": . |
12:35:36 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DqX |
12:36:38 | FromDiscord | <Hamid_Bluri> yeap |
12:36:41 | FromDiscord | <Hamid_Bluri> yep |
12:36:49 | FromDiscord | <System64 ~ Flandre Scarlet> It echo nothing |
12:37:15 | FromDiscord | <Hamid_Bluri> what `checkNameAvaillability` proc returns? |
12:37:22 | FromDiscord | <Hamid_Bluri> (edit) "what ... `checkNameAvaillability`return?" added "does" | "returns?" => "return?" |
12:38:04 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/IeqXK |
12:39:04 | FromDiscord | <Hamid_Bluri> well maybe there is the body response of request`http://127.0.0.1/availlableName/{name}` is empty |
12:39:12 | FromDiscord | <Hamid_Bluri> (edit) removed "there is" |
12:39:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @hamidb80 "well maybe the body": It works fine when I do waitFor |
12:41:22 | FromDiscord | <Hamid_Bluri> aren't you using the `client` in multiplie places?? |
12:42:15 | FromDiscord | <System64 ~ Flandre Scarlet> this is the only place where client is really used |
12:42:32 | FromDiscord | <System64 ~ Flandre Scarlet> otherwise I pass it from function to function |
12:42:40 | FromDiscord | <Hamid_Bluri> if you try to send some code to reproduce this sitatation, I could help |
12:42:58 | FromDiscord | <Hamid_Bluri> otherwise I can't guess further |
12:43:13 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1140626679966994463/loginWindow.nim |
12:58:39 | * | Brainzman quit (Quit: Brainzman) |
13:06:26 | FromDiscord | <heysokam> sent a long message, see http://ix.io/4Dr6 |
13:15:11 | FromDiscord | <Hamid_Bluri> In reply to @sys64 "": man I've downloaded maybe around 300MB packages & deps and this code does not have a `main` function or anything to see the result |
13:21:27 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=4Dr9 |
13:22:08 | FromDiscord | <Hamid_Bluri> (edit) "https://play.nim-lang.org/#ix=4Dr9" => "https://paste.rs/Zgww3" |
13:23:40 | * | rockcavera joined #nim |
13:36:20 | FromDiscord | <System64 ~ Flandre Scarlet> Seems only WaitFor works |
13:39:26 | PMunch | Probably not properly ticking the async loop then |
13:39:54 | FromDiscord | <System64 ~ Flandre Scarlet> the async loop? |
13:41:23 | PMunch | Ah, you discard your Futures.. |
13:41:41 | PMunch | And you don't appear to tick the async event loop |
13:42:04 | FromDiscord | <System64 ~ Flandre Scarlet> How can I tick the event loop? |
13:42:15 | PMunch | Well it depends on the structure of your program |
13:42:57 | PMunch | You can use `runForever` which will run until the async loop is out of work to do |
13:43:09 | PMunch | Or `waitFor` on some master task |
13:43:22 | PMunch | Or poll/drain for mine fine-grained control |
13:43:23 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Dri |
13:43:28 | PMunch | It all depends on the structure of your program |
13:43:37 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1140641885304655872/loginWindow.nim |
13:43:42 | PMunch | Well that's all well and good |
13:43:43 | FromDiscord | <System64 ~ Flandre Scarlet> And this is the login window |
13:44:20 | PMunch | But since you discard `drawLoginTab` and `drawRegisterTab` in `drawApp` instead of awaiting them that won't do much |
13:44:42 | PMunch | `openLoginWindow` doesn't have any `await` statements, so it will just run to the bottom and complete |
13:45:12 | PMunch | drawWindow, and drawApp both need to be `async` |
13:45:46 | PMunch | `drawApp` needs to `await` the other draw calls, and `drawWindow` needs to await `drawApp` |
13:47:40 | PMunch | Oh, you also need to `await` your calls to `checkNameAvaillability` |
13:48:10 | PMunch | In fact you should probably just read up on how async actually works.. |
13:48:27 | PMunch | This might help: https://peterme.net/asynchronous-programming-in-nim.html |
13:49:12 | FromDiscord | <System64 ~ Flandre Scarlet> Will read that |
13:49:42 | FromDiscord | <System64 ~ Flandre Scarlet> No freeze (I simulate a lag on the server) but nothing is printed https://media.discordapp.net/attachments/371759389889003532/1140643411477659721/loginWindow.nim |
13:50:17 | PMunch | Well since you've got your async code all kinds of wrong I'm not surprised you have bugs.. |
13:50:31 | PMunch | Reminds me of that good ol' Babbage quote |
13:51:07 | FromDiscord | <System64 ~ Flandre Scarlet> The server doesn't even print anything |
13:51:14 | FromDiscord | <System64 ~ Flandre Scarlet> like it was never called |
13:51:14 | PMunch | "On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." -Charles Babbage |
13:51:33 | PMunch | Again, your code is all kinds of wrong, I'm not surprised in the slightest |
13:52:39 | PMunch | The server probably is never called, because your code is wrong and doesn't do what you think it does |
13:53:07 | * | junaid_ quit (Remote host closed the connection) |
13:54:35 | FromDiscord | <enthus1ast> where do you actually drive your async loop? |
13:58:41 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Drq |
13:59:30 | PMunch | Well it's *a* loop, but not *the* loop |
14:00:20 | PMunch | Ah wait, you actually call `openLoginWindow` with `waitFor`, so at least that is correct |
14:00:43 | PMunch | Still doesn't fix all your other issues however |
14:01:15 | FromDiscord | <enthus1ast> it seems the matrix bridge has issues and i actually miss this whole discussion \:) |
14:02:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Well it's *a* loop,": Well, sorry but I don't get this async loop thing :/ |
14:04:43 | FromDiscord | <System64 ~ Flandre Scarlet> I mostly did async with Javascript |
14:10:18 | * | azimut quit (Ping timeout: 246 seconds) |
14:17:35 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Dry |
14:19:31 | FromDiscord | <System64 ~ Flandre Scarlet> Is that this async loop? |
14:20:10 | PMunch | Don't worry, it can be a bit tricky. JavaScript handles the async loop for you, but since Nim is a systems programming language you have to deal with it yourself |
14:20:25 | PMunch | That is one way of running the loop, yes |
14:20:58 | * | PMunch quit (Quit: Leaving) |
14:22:15 | FromDiscord | <System64 ~ Flandre Scarlet> Aaaaaaah I now understand why I struggle so much! |
14:22:18 | FromDiscord | <odexine> I don’t recommend it |
14:26:13 | FromDiscord | <System64 ~ Flandre Scarlet> Is there any other method? |
14:26:40 | FromDiscord | <odexine> Run forever |
14:26:42 | FromDiscord | <odexine> The procedure |
14:26:48 | FromDiscord | <odexine> Somewhere in the module lol |
14:28:05 | FromDiscord | <enthus1ast> When you build a game, have you considered Netty instead of http? |
14:29:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @enthus1ast "When you build a": Obviously↵I use http only for stuff outside the game, such as login or retrieving a list of the scores |
14:31:20 | FromDiscord | <enthus1ast> Then, if it's not an integral part of the game, maybe avoid "coloring" your functions with async |
14:32:05 | FromDiscord | <enthus1ast> But have a module that does this stuff in a thread, use puppy, and pull in the draw loop if it's done or not |
14:32:17 | FromDiscord | <enthus1ast> And poll |
14:34:51 | FromDiscord | <System64 ~ Flandre Scarlet> Login is only at the very stary |
14:36:30 | FromDiscord | <Dylan> Hello |
14:38:00 | * | azimut joined #nim |
14:38:33 | FromDiscord | <Dylan> Am a professional social account hacker and best in penetration testing as well.↵↵For more details let’s discuss this. |
14:40:16 | * | rockcavera quit (Read error: Connection reset by peer) |
14:40:51 | * | rockcavera joined #nim |
14:40:51 | * | rockcavera quit (Changing host) |
14:40:51 | * | rockcavera joined #nim |
14:41:42 | FromDiscord | <odexine> <@&371760044473319454> I think you’ll be interested in this offer |
14:54:49 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DrI |
14:55:23 | FromDiscord | <enthus1ast> this should be poll() |
14:55:29 | FromDiscord | <odexine> It doesn’t, the procedure does as it says, so if you already have some global loop then maybe poll should be used |
14:55:57 | FromDiscord | <enthus1ast> but it could be also not working, since in drawWindow there could be multiple async calls |
14:56:07 | FromDiscord | <odexine> I only didn’t recommend it because I didn’t know you had a loop already |
14:56:33 | FromDiscord | <jviega> I'm such a non-fan of the whole async paradigm! |
14:56:49 | FromDiscord | <enthus1ast> when poll does not work, maybe try drain |
14:58:07 | FromDiscord | <enthus1ast> i would also not do this in a game loop, but maybe it works |
14:58:39 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @enthus1ast "i would also not": It's not the game loop, the game loop comes later↵But drain works, but it lags |
14:58:51 | FromDiscord | <enthus1ast> then try to lower the timeout |
14:59:14 | FromDiscord | <enthus1ast> drain(16) |
15:00:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @enthus1ast "drain(16)": thanks god IT FUCKING WORKS! |
15:01:02 | FromDiscord | <enthus1ast> nice |
15:02:44 | FromDiscord | <enthus1ast> @System64 ~ Flandre Scarlet\: you might want to calculate the ms to timeout (or go as low as possible) based on the frames you target |
15:03:18 | FromDiscord | <enthus1ast> but since its not in the gameloop you might be good to go \:) |
15:05:29 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4DrS |
15:07:39 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/IP5KU |
15:09:47 | FromDiscord | <odexine> That’s cursed but sure |
15:36:08 | * | xet7 quit (Remote host closed the connection) |
15:47:00 | * | Brainzman joined #nim |
16:21:56 | FromDiscord | <yepoleb> In reply to @odexine "<@&371760044473319454> I think you’ll": What is your offer? |
16:22:51 | FromDiscord | <odexine> It’s gone lol |
16:22:57 | FromDiscord | <odexine> Some scammer posted |
16:27:56 | FromDiscord | <yepoleb> Yes but what is yours |
16:41:48 | FromDiscord | <odexine> I offer nothing in exchange for you to be more vigilant against spammers :baqua: |
16:58:12 | FromDiscord | <yepoleb> Garbage offer tbh |
17:06:15 | FromDiscord | <odexine> Who said it was any good |
17:16:19 | NimEventer | New thread by fosilpro: Equivalent to Rust's Command spawn/try_wait? , see https://forum.nim-lang.org/t/10407 |
17:29:22 | * | Brainzman quit (Ping timeout: 256 seconds) |
17:42:38 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4Dsy |
17:42:55 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=4Dsy" => "https://play.nim-lang.org/#ix=4Dsz" |
17:43:07 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=4Dsz" => "https://play.nim-lang.org/#ix=4DsA" |
17:44:22 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4DsC |
17:51:18 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, thanks! |
17:53:38 | * | krux02 joined #nim |
17:57:16 | * | Guest86 joined #nim |
17:57:31 | * | Guest86 quit (Client Quit) |
18:20:06 | FromDiscord | <guttural666> isn't updating Nim done by again installing Nim with nimble install nim? or what am I doing wrong here? https://media.discordapp.net/attachments/371759389889003532/1140711458708127804/image.png |
18:20:21 | FromDiscord | <guttural666> or does choosenim do the job? |
18:20:34 | FromDiscord | <jos7388> i think choosenim is the one |
18:20:46 | FromDiscord | <jos7388> does anybody know how to do inline tests, rust style? |
18:21:53 | FromDiscord | <jos7388> something like this |
18:21:56 | FromDiscord | <jos7388> sent a code paste, see https://play.nim-lang.org/#ix=4DsZ |
18:21:59 | FromDiscord | <jos7388> i just wanna stick my tests on the bottom of the file like people tend to do in rust |
18:37:13 | FromDiscord | <jos7388> i am extremely annoyed that testament requires tests to start with the letter "t" |
18:37:17 | FromDiscord | <jos7388> :cartired: |
18:37:36 | FromDiscord | <jos7388> i tried balls last time but i really didn't like it |
18:46:06 | termer | Runnable examples need to compile, but I don't know of inline tests specifically |
18:46:20 | termer | Though I'm not that knowledgeable on this part of the lang |
18:48:17 | FromDiscord | <jos7388> unrelated, with `codeReordering` enabled, i get an error when i `import strformat` |
18:48:59 | FromDiscord | <jos7388> sent a code paste, see https://play.nim-lang.org/#ix=4Dta |
18:49:01 | FromDiscord | <jos7388> i'll post an issue i guess |
18:49:26 | termer | I believe codeReordering is no longer necessary in 2.0.0, but I could be wrong |
18:50:20 | FromDiscord | <jos7388> i think it is |
18:50:34 | FromDiscord | <jos7388> or at least my code only compiles with it enabled |
18:53:08 | FromDiscord | <jos7388> https://github.com/nim-lang/Nim/issues/22476 |
18:55:32 | termer | Hope the issue gets resolved for you quickly then |
18:56:26 | NimEventer | New thread by IvanS: How to echo distinct type, see https://forum.nim-lang.org/t/10408 |
18:56:49 | FromDiscord | <Phil> In reply to @guttural666 "or does choosenim do": choosenim stable (or install stable), sth like that |
18:59:15 | FromDiscord | <guttural666> In reply to @isofruit "choosenim stable (or install": yeah choosenim update 2.0.0 seems to have worked |
18:59:19 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Dtd |
19:00:18 | FromDiscord | <jos7388> i can try runnableexamples |
19:00:22 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4Dtd" => "https://play.nim-lang.org/#ix=4Dtf" |
19:00:25 | FromDiscord | <guttural666> on a clean install on my other machine nimlsp also works again in Vim with everyting freshly installed, can't get it to work on my dev machine (broken for months now), fkn pain in the ass |
19:00:42 | FromDiscord | <Phil> In reply to @jos7388 "i can try runnableexamples": runnableExamples are basically like rusts compiled doccomment examples |
19:01:06 | FromDiscord | <Phil> They only get executed when compiling docs with `nim doc <file.nim>` |
19:01:14 | FromDiscord | <Phil> (edit) "doccomment" => "doc-comment" |
19:01:39 | FromDiscord | <Phil> Or just nim doc <your-key-project-file>.nim |
19:03:05 | FromDiscord | <jos7388> interesting |
19:03:14 | FromDiscord | <jos7388> i like the other approach |
19:03:20 | FromDiscord | <jos7388> i did try something like that though in the past, i forget why it gave me issues |
19:03:26 | FromDiscord | <jos7388> might have been because i used balls, can't remember, but im trying unittest2 now |
19:04:42 | FromDiscord | <Phil> In reply to @jos7388 "might have been because": For reference:↵@treeform uses that approach a fair bit for testing IIRC, as does the compiler itself.↵Further, I tend to use it to compile-in/compile-out certain features, e.g. in norm you can use it to compile-out logging (for performance) |
19:05:53 | FromDiscord | <jos7388> what framework do they use to test? |
19:05:58 | FromDiscord | <Phil> I'd use runnableExamples for the purposes of better documentation and the compiled-out section approach for "propper" tests with possibly a more complex setup.↵↵Generally I'm rather happy with just using std/unittest though |
19:07:05 | * | fallback quit (Ping timeout: 246 seconds) |
19:07:06 | FromDiscord | <Phil> Example:↵https://github.com/PhilippMDoerner/nimword/blob/main/tests/t_argon2.nim |
19:08:17 | FromDiscord | <jos7388> that makes sense to me, i'll use that approach too |
19:08:23 | FromDiscord | <jos7388> to me runnableExamples is good to make sure that your docs don't bitrot |
19:08:29 | FromDiscord | <jos7388> but it's just not enough structure for a proper suite of tests |
19:08:42 | FromDiscord | <Phil> Agreed |
19:09:24 | FromDiscord | <Phil> Out of curiosity, how do other langs deal with procs calling other procs?↵Do they have frameworks for monkey-patching the static dispatch? |
19:10:34 | FromDiscord | <krisp0> whenever I run my program in nim v2.0.0, is there a way to disable orc? |
19:11:15 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Dth |
19:11:22 | FromDiscord | <jos7388> i don't think rust does that |
19:11:28 | termer | When you say "disable orc", do you mean the cycle collector? |
19:11:29 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4Dth" => "https://play.nim-lang.org/#ix=4Dti" |
19:11:37 | termer | or do you mean use the old refc collector? |
19:11:45 | FromDiscord | <jos7388> it sounds like a cool idea though, sounds like a very practical way to implement unit tests to me |
19:11:50 | FromDiscord | <Phil> In reply to @krisp0 "whenever I run my": You can specify which memory management strategy you want with the `--mm`flag |
19:12:02 | FromDiscord | <Phil> In reply to @jos7388 "it sounds like a": The thing is that it's hard as hell |
19:12:14 | FromDiscord | <Phil> At least for me who has very little to no propper grasp of low level stuff |
19:12:28 | FromDiscord | <jos7388> maybe, i think the compiler could just have a table for indirection and it would work just fine-- but i don't know any compilers that have something like that |
19:13:10 | FromDiscord | <Phil> The best I could come up with (or rather beef came up with) was a macro that turns `proc myProc()` into `var myProc = proc()...`.↵Which allows reassignment and is really cool...↵↵until you realize that generics aren't real and you can't mock generic procs that way |
19:13:22 | FromDiscord | <Phil> (edit) "with)" => "with upon my pestering)" |
19:14:02 | termer | krisp0, To disable the ORC cycle collector, you can call GC_disableOrc to disable it at runtime, or you can use pure ARC with --mm:arc (no cycle collector at all). If you want to use the old refc GC, you can compile with --mm:refc. |
19:14:07 | FromDiscord | <Phil> I maybe need to give that another spin since I know a lot more about macros now than I did back then |
19:20:25 | FromDiscord | <krisp0> In reply to @termer "<@222794789567987712>, To disable the": refc is used by nim pre v2.0.0 right? |
19:20:39 | termer | Yes |
19:20:52 | termer | Why do you want to disable ORC? |
19:25:52 | FromDiscord | <jos7388> does anybody know how to patch your local nim install.. i want to fix the formatValue bug i linked earlier, it's blocking me |
19:26:02 | FromDiscord | <jos7388> some of my dependencies are using strformat and i can't avoid it |
19:26:19 | FromDiscord | <jos7388> i'm using choosenim if that helps |
19:30:56 | termer | if it's in the stdlib, you can edit it easily |
19:31:08 | termer | if it's a compiler issue, I don't know how to do that |
19:32:20 | FromDiscord | <krisp0> In reply to @termer "Why do you want": since it takes longer to compile my nim code compared to previous versions |
19:33:30 | termer | You can use --mm:refc to use refc, but keep in mind that there are benefits to using ORC |
19:34:04 | termer | if you just want faster compile times during development and aren't taking advantage of ORC's features then you can use refc during development |
19:34:34 | termer | I've been using ORC ever since it came to 1.4.* so I've never noticed a compile time difference |
19:36:52 | FromDiscord | <Phil> In reply to @krisp0 "since it takes longer": Do you compile during development with `-d:release`?↵That one imo is the flag that impacts my compiletimes a fair bit more |
19:37:51 | FromDiscord | <krisp0> nope |
19:37:53 | FromDiscord | <Phil> `-d:release` and `-d:lto` both are immense slowdowns for compiletime.↵So during development I tend to never compile with them |
19:38:01 | FromDiscord | <Phil> hmm |
19:38:19 | FromDiscord | <Phil> Yeah then compiling with --mm:refc might be the way to go |
19:38:26 | FromDiscord | <Phil> (edit) "Yeah then compiling with --mm:refc ... might" added "during development" |
19:39:03 | FromDiscord | <Phil> I'd still want to use orc in general for my deployment builds, but eh |
19:39:10 | FromDiscord | <Phil> (edit) "eh" => "that can be a separate build-task" |
19:39:40 | FromDiscord | <jos7388> oh lord i have no clue how to fix this |
19:39:49 | FromDiscord | <jos7388> the broken line is in a macro that calls `bindSym("formatValue")` |
19:39:55 | FromDiscord | <jos7388> i guess i will order my code by hand |
19:39:59 | FromDiscord | <jos7388> <:sad_kermit:763192714085793853> |
19:41:02 | FromDiscord | <jos7388> aha |
19:41:06 | FromDiscord | <jos7388> i only had to move 3 declarations |
19:41:09 | FromDiscord | <jos7388> <a:PE_PandaFire:806808235150671893> |
19:42:09 | termer | you can make the declarations and then define them later I think, C-style |
19:42:18 | FromDiscord | <jos7388> yup that's what i did for procs |
19:42:38 | FromDiscord | <jos7388> i kind of prefer to order things a certain way for readability, but it's okay |
19:42:49 | termer | I know the pain |
20:03:09 | FromDiscord | <jos7388> https://media.discordapp.net/attachments/371759389889003532/1140737394073669752/image.png |
20:03:10 | FromDiscord | <jos7388> lovely!!!!!!!! |
20:03:13 | FromDiscord | <jos7388> best language ever!!!!!!!!! |
20:03:19 | FromDiscord | <jos7388> inline tests!!!! |
20:05:01 | termer | magic |
20:05:14 | termer | can't tell how sarcastic you're being lol |
20:05:30 | FromDiscord | <jos7388> no it's quite nice 🙂 |
20:05:35 | FromDiscord | <Elegantbeef> PS if you lexer works at CT make `expression(src: static string)` 😄 |
20:05:37 | FromDiscord | <jos7388> very few languages give you this much control over everything |
20:05:37 | termer | also what font is that |
20:05:44 | FromDiscord | <jos7388> umm let me check |
20:05:54 | FromDiscord | <Elegantbeef> No termer you're supposed to flame their white theme |
20:06:10 | FromDiscord | <jos7388> https://github.com/protesilaos/iosevka-comfy |
20:06:16 | FromDiscord | <jos7388> i love this font |
20:06:17 | termer | I'm more interested in the rounded sans font |
20:06:30 | termer | not in the mood for a theme war today |
20:06:33 | termer | maybe tomorrow |
20:06:41 | FromDiscord | <jos7388> i change color themes a lot 🙂 |
20:06:48 | FromDiscord | <jos7388> sometimes light is nice!!! |
20:06:58 | termer | I choose something and stick with it for years |
20:07:36 | termer | lol of course the font creator is an Emacs autist |
20:07:39 | FromDiscord | <Elegantbeef> Termer has not changed his underpants since the obama administration |
20:07:51 | termer | You're not supposed to know that |
20:08:01 | FromDiscord | <Elegantbeef> I can smell it from here |
20:08:12 | FromDiscord | <Elegantbeef> Skidsmark mcgee |
20:08:33 | termer | And yet your scent hasn't escaped me since I started using Nim |
20:08:52 | FromDiscord | <Elegantbeef> Much like skunk, it has a long staying time |
20:08:59 | termer | I suppose it's mutual |
20:09:22 | FromDiscord | <Elegantbeef> Did you see the nico script stuff termer? I know you said a fantasy console would be nifty, and it's on the way to that path 😄 |
20:09:47 | termer | I did see that but didn't pay any attention |
20:10:07 | termer | is it just live reloading Nim scriptd |
20:10:12 | termer | scripts |
20:10:19 | FromDiscord | <Elegantbeef> Yea |
20:10:34 | termer | Isn't Nick a game enginr |
20:10:36 | termer | engine |
20:10:37 | termer | fuck |
20:10:44 | termer | NICO |
20:10:46 | FromDiscord | <Elegantbeef> Nah he's a person |
20:10:48 | FromDiscord | <Elegantbeef> Nico is a game framework yea |
20:11:17 | termer | I think that's why I didn't pay attention cause I assumed it only applied to Nico |
20:11:47 | FromDiscord | <Elegantbeef> Well it's just nimscripter's new dynamic library API applied to nico |
20:12:25 | termer | Cool |
20:12:38 | termer | Meanwhile I'm still waiting for real hot code reloading |
20:13:24 | FromDiscord | <Elegantbeef> I did have an idea using term rewriting macros to make HCR work, but I stopped myself down that path |
20:13:36 | termer | that sounds horrendous |
20:13:42 | FromDiscord | <jmgomez> HRC you mean the one in the compiler? |
20:13:54 | FromDiscord | <Elegantbeef> Me? No |
20:13:57 | termer | HRC in the compiler doesn't work |
20:14:08 | FromDiscord | <Elegantbeef> Especially since it's HCR |
20:14:17 | FromDiscord | <jmgomez> Yeah, it should be striped away |
20:14:56 | termer | I want IC, I want HCR, I want CPS! I want all the acronyms, and I want them now! |
20:15:15 | FromDiscord | <Elegantbeef> This is the sad story of how termer got AIDS |
20:15:24 | termer | AHAHAHA |
20:15:42 | FromDiscord | <jos7388> weird, my tests are marked as OK even if an exception is thrown |
20:15:52 | termer | Add try catch lol |
20:15:56 | termer | I dunno |
20:16:12 | FromDiscord | <Elegantbeef> `except: discard` 😛 |
20:16:21 | termer | hehehe |
20:16:33 | FromDiscord | <Phil> In reply to @jos7388 "": Hmm what result lib you using? |
20:16:42 | FromDiscord | <jos7388> my own |
20:17:04 | FromDiscord | <Phil> Can you specify an arbitrary amount of error-parts of the result without too much typing? |
20:17:12 | FromDiscord | <Phil> (edit) "error-parts of" => "error-types for" |
20:17:40 | FromDiscord | <Phil> Like, result may be "okay" or "Err1" or "Err2" (those may be exception types or whatever) etc.? |
20:17:45 | termer | except: quit 0 |
20:18:09 | FromDiscord | <Elegantbeef> I mean just make a type that takes a tuple and expands into a variant |
20:18:22 | FromDiscord | <Elegantbeef> Boom, instant varadic results |
20:18:25 | FromDiscord | <jos7388> https://media.discordapp.net/attachments/371759389889003532/1140741236752392313/image.png |
20:18:32 | FromDiscord | <jos7388> https://media.discordapp.net/attachments/371759389889003532/1140741263679815681/image.png |
20:18:39 | FromDiscord | <jos7388> :thonkomega: |
20:19:04 | FromDiscord | <graveflo> try making it a template? |
20:19:10 | FromDiscord | <jos7388> that would probably work |
20:19:16 | FromDiscord | <jos7388> if i don't have the fn there it's fine |
20:19:52 | FromDiscord | <jos7388> idk.. seems a little fragile though? |
20:19:53 | FromDiscord | <graveflo> `test` is a macro-ish thing. It matters that `check` is in the AST |
20:20:18 | FromDiscord | <Phil> I'm reasonably certain that std/unittest does not play nice at all with checks not being directly in a test-block |
20:20:26 | FromDiscord | <Phil> Was one of the limitations I stumbled into IIRC |
20:20:37 | FromDiscord | <jos7388> i guess ill just use assert for now |
20:20:51 | FromDiscord | <Phil> It does effectively the same, check simply provides nicer error messages IIRC |
20:20:52 | FromDiscord | <graveflo> you can just to asserts or exceptions or return values if you really want to use procs like that |
20:21:10 | FromDiscord | <Elegantbeef> Just use balls |
20:21:10 | FromDiscord | <Elegantbeef> Everyone loves balls |
20:21:22 | FromDiscord | <graveflo> wait HUH |
20:21:28 | FromDiscord | <pelfox> how can I read bytes from tcp connection as a seq instead of string? |
20:21:42 | FromDiscord | <jos7388> i tried balls but had some issues |
20:21:42 | FromDiscord | <Elegantbeef> Use the raw procs |
20:21:45 | FromDiscord | <jos7388> maybe ill try again |
20:21:47 | FromDiscord | <Elegantbeef> But now why do you want a seq instead of a string |
20:22:07 | FromDiscord | <pelfox> sent a code paste, see https://play.nim-lang.org/#ix=4DtN |
20:22:29 | FromDiscord | <Phil> Balls docs completely hasn't managed to convince me of why I would use it over just std/unittest |
20:22:33 | FromDiscord | <Elegantbeef> You didnt allocate |
20:22:33 | FromDiscord | <Elegantbeef> `bytes = newSeq[byte](1024)` |
20:22:34 | FromDiscord | <Elegantbeef> also `bytes[0].addr` |
20:22:34 | FromDiscord | <Elegantbeef> But again |
20:22:50 | FromDiscord | <Elegantbeef> Why do you need `seq[byte]` that `.toOpenArrayByte(0, str.high)` would not work |
20:24:50 | FromDiscord | <pelfox> In reply to @Elegantbeef "Why do you need": I didn't thought about it, idk why, thank you |
20:25:25 | FromDiscord | <Elegantbeef> No problem, you can always use a seq[byte] with my changes if you really really must, just wrap it in a proc to make it sane |
20:29:02 | termer | Does anyone know whether there are any utils in std that can help with treating an openarray of chars as a string? |
20:30:08 | termer | I'm trying to write a zero-allocation HTTP parser |
20:37:25 | * | Guest72 joined #nim |
20:39:26 | * | Guest72 quit (Client Quit) |
20:43:56 | FromDiscord | <Elegantbeef> Why would you need that use std/parseutils |
20:44:55 | FromDiscord | <Elegantbeef> Everyone's favourite asshat made `parseutils` and `unicode` work with `openArray[char]` so be merry and use that work |
20:46:19 | FromDiscord | <Elegantbeef> It's also impossible to convert an `openArray` to `string` or `seq` without allocating |
21:19:28 | FromDiscord | <bung8954> `var info = getAddrInfo( "127.0.0.1", Port(9000))` `info.ai_addr` empty? |
21:20:07 | FromDiscord | <bung8954> I need pass into `proc connect(s: SocketHandle; name: ptr SockAddr; namelen: SockLen): cint` now I get `-1` |
21:32:43 | FromDiscord | <Elegantbeef> Is it still nil with a different address? |
21:39:49 | * | fallback joined #nim |
21:52:05 | * | advesperacit quit () |
21:54:25 | FromDiscord | <bung8954> yes, just tried. no clue |
21:59:59 | FromDiscord | <nomad> how do i upload files as multipart data with puppy? |
22:01:18 | FromDiscord | <Elegantbeef> https://github.com/treeform/puppy#examples |
22:01:40 | FromDiscord | <nomad> yea i saw that but didnt understand it |
22:01:55 | FromDiscord | <nomad> ive been working with httpclient and its late, my brain is slow right now |
22:02:11 | FromDiscord | <nomad> (edit) "ive been working with httpclient ... and" added "until just now" |
22:02:33 | * | Guest81 joined #nim |
22:03:00 | * | Guest81 quit (Client Quit) |
22:03:59 | FromDiscord | <nomad> sent a code paste, see https://play.nim-lang.org/#ix=4Dug |
22:04:05 | FromDiscord | <nomad> how do i do that with puppy |
22:04:37 | FromDiscord | <nomad> (edit) "https://play.nim-lang.org/#ix=4Dug" => "https://play.nim-lang.org/#ix=4Duh" |
22:04:39 | FromDiscord | <Phil> Plain text file? |
22:04:52 | FromDiscord | <nomad> yeah |
22:05:02 | FromDiscord | <nomad> mostly txt and dll files |
22:06:03 | FromDiscord | <Phil> What part of the example is confusing?↵Basically for payload, just read in the plain-text file into a string, is that the bit that's difficult? |
22:06:32 | FromDiscord | <Elegantbeef> I mean isnt it the exact same as the httpclient api? |
22:06:35 | FromDiscord | <heysokam> is it possible to define the `--gc` being used from a pragma?↵is there a switch pragma or something, similar to how there is a `{.define: symbol.}` one? 🤔 |
22:06:39 | FromDiscord | <Elegantbeef> Also phil isnt that dumb to load the file into a string |
22:06:53 | FromDiscord | <Elegantbeef> No there's no way of changing the GC inside Nim |
22:06:53 | FromDiscord | <nomad> wait i might be really dumb right now let me test |
22:07:15 | FromDiscord | <Phil> In reply to @Elegantbeef "Also phil isnt that": Depends on the size of the file, for quick and dirty that's absolutely an option |
22:07:55 | FromDiscord | <Elegantbeef> Right, but isnt a point of multipart data to stream it, or am I missing what multipart means 😄 |
22:08:08 | FromDiscord | <Phil> But generally when you send plain text around you tend to not be sending massive amounts |
22:08:18 | FromDiscord | <nomad> In reply to @isofruit "Depends on the size": i could most likely load the file into a string |
22:08:19 | FromDiscord | <Phil> Video and audio are the heavy stuff, so might as well not give a hoot about memory |
22:09:21 | termer | Elegantbeef, "It's also impossible to convert an `openArray` to `string` or `seq` without allocating" I'm aware, that's why I was wanting to operate on openArray |
22:09:37 | termer | also is it possible to make my own implementation of openArray? |
22:09:46 | FromDiscord | <Elegantbeef> But you asked to convert an openArray to a string 😄 |
22:09:51 | FromDiscord | <Phil> I'd be suggesting something else if I saw anywhere in the puppy API a way to pass on a file handle or the like |
22:09:54 | FromDiscord | <heysokam> is it possible to disable exceptions usage completely? |
22:09:54 | FromDiscord | <Elegantbeef> make a template |
22:09:55 | termer | did I |
22:10:19 | termer | I've got effectively a seq but stack allocated |
22:10:46 | FromDiscord | <Elegantbeef> Right write `openArray[char]` and carry on |
22:11:29 | FromDiscord | <Elegantbeef> `template toOpenArray(...): untyped = cast[ptr UncheckedArray[char]](myData[0].addr).toOpenArray(0, size)` |
22:12:05 | FromDiscord | <Elegantbeef> Likely do not need the cast assuming you have `(len, array[size, char])` |
22:12:16 | FromDiscord | <Elegantbeef> No it's not possible to disable exceptions sokam |
22:12:31 | FromDiscord | <Phil> In reply to @nomad "i could most likely": If it's small enough ( a couple MB at most) that should be all good then.↵Read it in, throw it in as a body, done |
22:12:41 | FromDiscord | <nomad> In reply to @isofruit "I'd be suggesting something": i feel so dumb right now, but i can not make it work for the life of me |
22:12:46 | termer | I need to look at the definition of openArray apparently |
22:12:52 | FromDiscord | <nomad> lets say i have a file called test.txt |
22:13:06 | FromDiscord | <nomad> how do i send it as multipart data |
22:13:06 | termer | my object is just an object with an int and array |
22:13:17 | FromDiscord | <Elegantbeef> Right |
22:13:24 | termer | nomad, Read httpclient docs |
22:13:27 | FromDiscord | <nomad> so sorry for all the dumb questions btw |
22:13:35 | FromDiscord | <Phil> In reply to @nomad "how do i send": The filepath you try to read the file from is relative to your binary, you taken that into consideration? |
22:13:35 | termer | it shows you how to do it in an example I think |
22:13:40 | FromDiscord | <nomad> termer im working with puppy |
22:13:53 | FromDiscord | <Phil> Note that your binary is not necessary in the same dir as your project.nim file |
22:13:53 | FromDiscord | <nomad> In reply to @isofruit "The filepath you try": same dir |
22:13:56 | FromDiscord | <Elegantbeef> so your template should be `template toOpenArray(myStr: MyString): untyped = myStr.data.toOpenArray(0, myStr.len)` |
22:14:01 | termer | can't help you with puppy, sorry |
22:14:13 | FromDiscord | <nomad> no the exe, nim and txt is all in the same dirs rn |
22:14:14 | FromDiscord | <Elegantbeef> Sadly there is no mechanism to overload `toOpenArray` to convert implicitly |
22:14:16 | FromDiscord | <nomad> (edit) "dirs" => "dir" |
22:14:22 | termer | Elegantbeef, Thanks |
22:14:41 | termer | I mean, I could use converter, right? |
22:18:42 | FromDiscord | <Phil> In reply to @nomad "no the exe, nim": What's the path you're looking at? |
22:19:09 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/g269m |
22:19:23 | FromDiscord | <Elegantbeef> No you cannot use converters cause openArrays cannot be return types |
22:19:26 | FromDiscord | <Elegantbeef> I'd probably suggest a concept |
22:19:39 | termer | what the fuck lol |
22:19:40 | FromDiscord | <Elegantbeef> Phil you can just do `lines("fileName")` and cut the middle man and not leave a file handle open |
22:19:46 | termer | Amazing |
22:20:09 | FromDiscord | <Elegantbeef> Remember termer openArrays can point to the stack so without a borrow checker dangling pointers could happen |
22:20:13 | FromDiscord | <nomad> sent a code paste, see https://play.nim-lang.org/#ix=4Duk |
22:20:53 | FromDiscord | <nomad> sent a code paste, see https://play.nim-lang.org/#ix=4Dul |
22:21:01 | termer | I suppose that makes some sense |
22:21:12 | termer | but that template is safe, right? |
22:21:19 | FromDiscord | <nomad> the body is empty |
22:21:19 | FromDiscord | <Elegantbeef> Yea of course |
22:21:23 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Dun |
22:21:37 | FromDiscord | <nomad> yeah i get 200 ok code so it gets through |
22:21:43 | FromDiscord | <nomad> but the body is empty |
22:22:13 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4Duo is another alternative termer |
22:23:13 | FromDiscord | <Phil> In reply to @nomad "yeah i get 200": As in, your server receives it as an empty body? |
22:23:20 | FromDiscord | <nomad> yes |
22:23:21 | FromDiscord | <Elegantbeef> That would allow the builtin types and any user defined ones with a relatively simple API to cover |
22:24:13 | FromDiscord | <Phil> Just to double check, based on what is the server stating it is an empty body?↵Mostly asking because the body puppy returns is a valid multipart request body so that should work without issue |
22:25:20 | FromDiscord | <nomad> sent a code paste, see https://paste.rs/o70dM |
22:25:28 | FromDiscord | <nomad> and the console shows `{}` |
22:25:54 | FromDiscord | <Phil> Can you log the entire request? |
22:25:59 | FromDiscord | <nomad> sure |
22:27:35 | FromDiscord | <Phil> I'm not insanely familiar with JS server frameworks (at least that's what that looks like). ↵Some frameworks treat multipart requests as separate from the body, depending |
22:28:52 | FromDiscord | <nomad> In reply to @isofruit "I'm not insanely familiar": i am so dumb lol |
22:28:57 | FromDiscord | <nomad> that was the issue |
22:29:28 | FromDiscord | <nomad> my several years of javascript was defeated by lack of sleep |
22:30:11 | FromDiscord | <Phil> 😄 ↵Today is the day of my troubleshooting |
22:30:57 | FromDiscord | <Phil> Burnt out at least a hundred brain cells at work to finally figure out how a colleague of mine's refactor broke our new microservice, managed to spot an issue with another colleague of mine's useage of a job and now this |
22:31:24 | FromDiscord | <Phil> (edit) "Burnt out at least a hundred brain cells at work to finally figure out how a colleague of mine's refactor broke our new microservice, managed to spot an issue with another colleague of mine's useage of a ... job" added "scheduled" |
22:31:39 | FromDiscord | <nomad> phil the phixer |
22:31:39 | FromDiscord | <Phil> As a sidenote: Java magic is the worst |
22:32:12 | FromDiscord | <nomad> In reply to @isofruit "As a sidenote: Java": anything java is beyond me |
22:32:18 | FromDiscord | <nomad> (edit) "phil the phixer ... " added "(fixer)" |
22:32:48 | FromDiscord | <nomad> well im gonna go sleep before i do more dumb shit |
22:33:01 | FromDiscord | <nomad> thanks for the help |
22:36:23 | termer | Is it possible to do an unsafe get on an array without having to do pointer fuckery? |
22:36:54 | termer | I know that bounds checks are disabled on danger, but for my implementation, I want to avoid a check since I'm already doing a check |
22:37:41 | FromDiscord | <Elegantbeef> `{.boundChecks:off.}` iirc |
22:38:07 | termer | doesn't seem to be a valid pragma |
22:38:17 | FromDiscord | <Elegantbeef> `bounds`...? |
22:38:55 | FromDiscord | <Elegantbeef> I always forget |
22:39:18 | termer | no luck |
22:39:27 | FromDiscord | <Elegantbeef> You lied to me |
22:39:54 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4Duq |
22:40:03 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#pragmas-compilation-option-pragmas |
22:40:32 | termer | Oh, I was trying to use it inside of a proc |
22:41:18 | termer | this is tricky |
22:42:38 | termer | I need to disable bounds checks on one specific line, and also check if checks are enabled so I can do my own check |
22:51:44 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Dut |
22:51:52 | FromDiscord | <Elegantbeef> Would be ugly but could define two procs 😄 |
22:51:53 | FromDiscord | <heysokam> i can't find what in my code is calling for that (if any) |
22:52:16 | FromDiscord | <Elegantbeef> Are you using assert? |
22:53:28 | FromDiscord | <heysokam> oh im using doAssert |
22:53:43 | FromDiscord | <heysokam> i guess that raises exception, right |
22:57:01 | FromDiscord | <heysokam> is there a way to quit and print a backtrace (without exceptions)? |
22:57:25 | FromDiscord | <Elegantbeef> `writeStackTrace()` |
22:59:45 | FromDiscord | <heysokam> tysm! |
23:27:43 | * | rockcavera quit (Read error: Connection reset by peer) |
23:28:29 | * | rockcavera joined #nim |
23:28:29 | * | rockcavera quit (Changing host) |
23:28:29 | * | rockcavera joined #nim |