<< 07-04-2020 >>

00:01:15FromDiscord<Rika> so is `|` a compatibility thing
00:04:13shashlick@zacharycarter figured that convertor out?
00:13:00zacharycartershashlick: I ended up just overloading `[]=` and `[]` for that type
00:13:12zacharycartercouldn't figure out the converter
00:15:21FromDiscord<KingDarBoja> Just tested the `or` and looks like it will asign the type to the parameter on the call but then if I use a if-else statement to cast, it will throw an error
00:17:33FromDiscord<KingDarBoja> Hold a second, I will attach a pic
00:17:39FromDiscord<KingDarBoja> https://imgur.com/a/Prl8c88
00:25:27FromDiscord<konsumlamm> ```nim
00:25:28FromDiscord<konsumlamm> proc test[T](x: T) = discard
00:25:28FromDiscord<konsumlamm>
00:25:28FromDiscord<konsumlamm> test[12](42)
00:25:28FromDiscord<konsumlamm> ```
00:25:32FromDiscord<konsumlamm> ok, why does this work?
00:29:57*abm quit (Read error: Connection reset by peer)
00:34:07FromDiscord<KingDarBoja> idk
00:34:28FromDiscord<KingDarBoja> Maybe it discard as does return nothing
00:36:53FromDiscord<konsumlamm> ?
00:37:15FromDiscord<konsumlamm> im confused because i can pass 12 as type and 42 as argument
00:37:32*Jjp137 quit (Ping timeout: 256 seconds)
00:38:16FromDiscord<KingDarBoja> Ah, you mean that.... probably the compiler is guessing the type according to the type value
00:38:43FromDiscord<konsumlamm> ye, but why does it accept 12 as type parameter then?
00:40:19*Jjp137 joined #nim
00:41:56FromDiscord<Benumbed> Because both 12 and 42 are of type `int`
00:42:13FromDiscord<KingDarBoja> Ah, found my error, it should be `when` not `if`
00:42:22FromDiscord<Benumbed> I imagine if you tried `proc test["foo"](42)` it would fail
00:44:31FromDiscord<Benumbed> @konsumlamm For the record you don't need that [12], `test(42)` is equivalent
00:44:35FromDiscord<konsumlamm> youre right
00:44:47FromDiscord<konsumlamm> ik that i dont need it, im just confused that it works
00:44:50FromDiscord<Benumbed> The compiler infers the type `T` refers to from the `x` argument
00:45:08FromDiscord<Benumbed> πŸ™‚ Β―\_(ツ)_/Β―
00:45:29FromDiscord<konsumlamm> why does the compiler accept an instance of a type when it actually should be a type?
00:45:38FromDiscord<Benumbed> I think there's probably meta stuff where you could potentially use that? But I haven't looked that closely into it yet
00:46:10FromDiscord<Benumbed> Because an instance of a type is still typed? The compiler knows what the underlying type of that 12 is
00:46:21*brainproxy joined #nim
00:47:19FromDiscord<Benumbed> May just be because sugar, I dunno there, maybe disruptek would know, they seem pretty knowledgeable of Nim internals
00:48:02FromDiscord<Benumbed> There are other core devs over on IRC, but I forget their handles, disruptek was just the loudest when I was asking lots of questions πŸ˜„
00:52:32*sleepyqt quit (Ping timeout: 265 seconds)
00:56:48*uu91 quit (Read error: Connection reset by peer)
00:57:11*uu91 joined #nim
00:58:30FromDiscord<KingDarBoja> Jummm, trying to figure out if it is possible to pass a procedure to another procedure without triggering its logic. That means, not returning the value while being passed to the other proc and instead, trigger it once it is inside
00:59:37FromDiscord<konsumlamm> just pass it as an argument?
00:59:47FromDiscord<Benumbed> ^
01:00:17FromDiscord<KingDarBoja> That's what I did
01:00:39FromDiscord<Benumbed> Did you read https://nim-lang.org/docs/manual.html#types-procedural-type in the manual?
01:00:57FromDiscord<KingDarBoja> Nope
01:01:00FromDiscord<Benumbed> That explains how to do what you're talking about
01:05:29FromDiscord<KingDarBoja> I got very confused reading that
01:05:34FromDiscord<KingDarBoja> The key is `{.closure.}` ?
01:06:09FromDiscord<Benumbed> no, the key is the `proc(someArg: someType)`
01:06:25FromDiscord<Benumbed> That's actually a type
01:06:28FromDiscord<konsumlamm> that pragma is just a calling convention
01:06:29FromDiscord<Benumbed> like an int or a string
01:07:32FromDiscord<Benumbed> So you should have a proc definition that looks like `proc someProc(firstArg: string, callback: proc(someArg: someType))`
01:08:35FromDiscord<KingDarBoja> without the return type of the proc being passed?
01:08:41FromDiscord<Benumbed> and then you'd pass your external proc in as `someProc("foo", yourProcNameHere)`
01:08:53*uu91 quit (Read error: Connection reset by peer)
01:09:04*uu91 joined #nim
01:09:14FromDiscord<Benumbed> No, if you have a return type, it needs to be in the type definition too, I just didn't use a return type for brevity
01:09:35FromDiscord<KingDarBoja> ok
01:09:49FromDiscord<Benumbed> `proc someProc(firstArg: string, callback: proc(someArg: someType):returnType)`
01:10:17FromDiscord<KingDarBoja> Done... but now getting error
01:11:00FromDiscord<KingDarBoja> "type mismatch: got <seq[proc (self: Parser): MyGenericType{.closure.}]> but expected 'seq[MyGenericType]'" while trying to trigger the proc inside a seq
01:11:43FromDiscord<KingDarBoja> Wait a second
01:12:17FromDiscord<KingDarBoja> https://imgur.com/gLHDDpj Left side is the proc and the right one the call of that procedure
01:14:05FromDiscord<konsumlamm> you have to call the proc
01:14:18FromDiscord<konsumlamm> `parseProc(self)`
01:14:20FromDiscord<konsumlamm> like this
01:15:54FromDiscord<Benumbed> They probably are calling it elsewhere, the stuff on the left is just building a dispatch list
01:17:16FromDiscord<Benumbed> Oh I see the problem
01:17:19*crem quit (Ping timeout: 252 seconds)
01:17:27FromDiscord<Benumbed> You can't do `seq[T]`
01:17:41FromDiscord<Benumbed> You're assigning a procedural type to the sequence, not the return value
01:18:03FromDiscord<Benumbed> you'd have to do `seq[proc(self: Parser):T]`
01:18:20*crem joined #nim
01:18:20*kotrcka joined #nim
01:18:28FromDiscord<Benumbed> Although I'm not quite sure why you're adding it twice πŸ™‚
01:18:33FromDiscord<konsumlamm> i assume they actually want a `seq[T]` and just didnt call the proc
01:18:39*uu91 quit (Read error: Connection reset by peer)
01:18:52FromDiscord<Benumbed> Good point, no idea
01:19:04*uu91 joined #nim
01:19:09FromDiscord<KingDarBoja> Neither I am sure why it got called twice on source code (Python)
01:19:38FromDiscord<Benumbed> Can you link to the Python source?
01:19:54FromDiscord<KingDarBoja> Sure!
01:20:03FromDiscord<Benumbed> May be easier for us to help you if we see what you're porting from
01:20:07*chemist69 quit (Ping timeout: 272 seconds)
01:20:12*uu91 quit (Read error: Connection reset by peer)
01:20:51FromDiscord<KingDarBoja> https://github.com/graphql-python/graphql-core/blob/master/src/graphql/language/parser.py#L1074
01:21:21*uu91 joined #nim
01:21:32*chemist69 joined #nim
01:21:36FromDiscord<Benumbed> I continue to be uncertain whether I love or hate type-hinting in Python
01:22:38FromDiscord<Benumbed> Yeah @KingDarBoja They're calling the method not storing it, @konsumlamm was correct
01:22:48FromDiscord<Benumbed> you're trying to store it as the code stands
01:23:01FromDiscord<Benumbed> Need to call the proc
01:23:18FromDiscord<KingDarBoja> I assumed it was being called inside the other proc
01:23:39FromDiscord<KingDarBoja> But wasn't sure how it was the proper approach
01:24:21FromDiscord<Benumbed> No you need to call it within manyNode on both lines that reference it
01:24:42FromDiscord<KingDarBoja> like @konsumlamm said? right?
01:24:46FromDiscord<Benumbed> yep
01:25:48*ryan_ joined #nim
01:26:52FromDiscord<KingDarBoja> Okay, did that but still an error, I will share another pic, please forgive me if asking too much
01:27:10FromDiscord<KingDarBoja> https://imgur.com/RiDpF3Q
01:27:52*ryan_ is now known as number_one
01:29:12FromDiscord<Benumbed> Um, Not sure what you're up to with `[:DefinitionNode]` there but I think that's your problem
01:29:19*Tlongir quit (Ping timeout: 250 seconds)
01:29:28FromDiscord<Rika> That's the generic brackets thing
01:29:43FromDiscord<Rika> You need a colon at the start for it to work with method style syntax
01:30:05FromDiscord<Benumbed> I have not encountered that yet
01:30:06FromDiscord<KingDarBoja> Yup, what Rika sensei said
01:30:16FromDiscord<Rika> Suddenly Japanese word usage
01:30:53FromDiscord<Benumbed> Well I have no ideas at this point because I know nothing of the `generic brackets thing` πŸ™‚
01:31:05*FromDiscord <KingDarBoja> RIP
01:31:59FromDiscord<KingDarBoja> > I continue to be uncertain whether I love or hate type-hinting in Python
01:32:15FromDiscord<Rika> I hate dynamic languages because of python
01:32:20FromDiscord<KingDarBoja> I love it because it annoys me trying to guess the type everytime I declare a variable and later reasign it
01:32:33FromDiscord<KingDarBoja> And TypeScript is somewhat the same stuff on JS
01:32:48FromDiscord<KingDarBoja> Feels like C#-Script
01:33:29FromDiscord<Benumbed> @Rika You must ❀️❀️❀️ JavaScript then πŸ˜›
01:33:53FromDiscord<Rika> γ‚΄γƒŸ
01:34:03*FromDiscord <KingDarBoja> Yamete Kudasai
01:34:13FromDiscord<Benumbed> Python is downright pleasant compared to JavaScript, which I, sadly, have been forced into at work
01:34:21FromDiscord<KingDarBoja> Well let's keep on the topic, I am stuck xD
01:34:21FromDiscord<Rika> Types riot?
01:34:23FromDiscord<Rika> Ugh
01:34:26FromDiscord<Rika> Typescript
01:34:30FromDiscord<Benumbed> But in these times, a steady job is a steady job
01:34:36FromDiscord<Rika> Thanks SwiftKey lmao
01:34:52FromDiscord<Rika> @KingDarBoja can you run the code so I can see the error message better lol
01:34:53FromDiscord<KingDarBoja> I use both Python and TypeScript at my job
01:35:03FromDiscord<Rika> I don't got a job
01:35:22FromDiscord<KingDarBoja> Error: type mismatch: got <Parser, TokenKind, DefinitionNode, TokenKind>
01:35:22FromDiscord<KingDarBoja> but expected one of:
01:35:22FromDiscord<KingDarBoja> proc (self: Parser, openKind: TokenKind, parseProc: proc (self: Parser): DefinitionNode{.closure.}, closeKind: TokenKind): seq[DefinitionNode]{.noSideEffect, gcsafe, locks: <unknown>.}
01:35:22FromDiscord<Benumbed> I'm most likely going to be furloughed in the next month myself :/
01:35:27FromDiscord<KingDarBoja> There you go mate
01:35:51FromDiscord<KingDarBoja> I hate my job, not because what I do but because my boss
01:36:41FromDiscord<KingDarBoja> Tired of having to report everything I am doing besides having a software which takes screenshots every time I want to work on... and also "computes" my perfomance
01:37:40leorizeKingDarBoja: looks like you're having trouble separating functions call and functions as a value
01:38:12leorizeso here's the rule: function name without arguments and/or `()` = a value
01:38:16leorizeotherwise it's a call
01:42:18*lritter quit (Ping timeout: 256 seconds)
01:42:55FromDiscord<KingDarBoja> So everytime I do `self.myProc()` it is a value?
01:42:57*lritter joined #nim
01:43:25FromDiscord<Benumbed> Well it will run the proc and return a value
01:43:34leorize@KingDarBoja: reread the text again :P
01:43:40FromDiscord<Benumbed> `self.myProc` without the () is a value
01:43:48leorizethat's still not a value fwiw
01:44:00FromDiscord<Rika> `aProc` is a value function, `aProc()` is a called function
01:44:00leorizeunless myProc is just a field
01:44:11leorizebut I don't have the context here
01:44:21FromDiscord<Benumbed> Well yeah, it's techically a function pointer
01:45:38FromDiscord<KingDarBoja> -> function name without arguments and/or () = a value, i.e. `self.myProc(someArg)` ?
01:45:50leorize**without**
01:46:02FromDiscord<KingDarBoja> Ah
01:48:49*lritter quit (Ping timeout: 264 seconds)
01:54:06FromDiscord<KingDarBoja> So a **function call** is only the proc with arguments, like `self.myProc(someArg)`
01:55:07FromDiscord<KingDarBoja> Whereas the **function value** is the proc without arguments and/or "()", like `myProc`
01:55:45FromDiscord<KingDarBoja> Right?
01:55:50FromDiscord<Rika> yes
01:56:04FromDiscord<Rika> note that `self.myProc` is a **function call** since self is an argument
01:56:25FromDiscord<KingDarBoja> Yeah, I was confused by the self itself
01:56:34FromDiscord<Rika> of course, this is given that `myProc` is a ***proc*** and not a ***field that takes a proc***
01:58:06FromDiscord<KingDarBoja> So that leads me to this question -> https://github.com/graphql-python/graphql-core/blob/master/src/graphql/language/parser.py#L434 This "partial" on Python performs a **function value** but pass the argument without making it a **function value**, right? If that's the case, is there a equivalent on Nim?
01:58:19*FromDiscord <KingDarBoja> My brain is getting overloaded
01:58:44FromDiscord<Rika> okay so partial
01:58:48leorizea closure
01:58:53FromDiscord<Rika> partial takes a function value, then returns a function value
01:59:49FromDiscord<Rika> so lets say this is passed to (next message): ```proc(a: int, b: int): int```
02:00:01FromDiscord<Rika> ```partial(thatProc, 2)```
02:00:25FromDiscord<Rika> partial then returns a ```proc(b: int): int```, and `a` now assumes 2 always
02:01:32FromDiscord<Rika> this is a very FP style thing so i dont think nim has it
02:02:34FromDiscord<KingDarBoja> Owwww
02:02:48FromDiscord<Rika> was my explanation good?
02:03:07*endragor joined #nim
02:03:14FromDiscord<KingDarBoja> Yeah, I knew that on Python, my question sounded like I didn't
02:03:34FromDiscord<KingDarBoja> The real question was if that's the case, Nim equivalent is?
02:04:15FromDiscord<KingDarBoja> Of course I don't expect the answer now but I am worried as now I am needing that lol
02:04:49FromDiscord<Rika> ```let newProc = do (proc arguments) -> return type: theProc(all arguments, w/ the applied and the nonapplied)``` is what i would do
02:06:27FromDiscord<KingDarBoja> Pass it like a pipe to another proc which returns a proc?
02:08:17FromDiscord<Rika> uh no, make a new proc that just uses the old proc w/ whichever filled in values you want
02:08:42FromDiscord<Rika> ok so with the old example it would be
02:09:08FromDiscord<Rika> ```let newProc = do (b: int) -> int: theProc(2, b)```
02:09:53FromDiscord<Rika> it can also be ```let newProc = proc(b: int): int = theProc(2, b)``` i think...
02:11:00*endragor quit (Remote host closed the connection)
02:13:11FromDiscord<KingDarBoja> So in my case, would be self as argument and "isConst" as fixed value (true in this case)
02:13:40*krux02_ quit (Remote host closed the connection)
02:14:00FromDiscord<Rika> i guess eyah
02:14:02FromDiscord<Rika> yeah
02:15:31FromDiscord<KingDarBoja> "let partialValueLiteral = do (self: Parser) -> ValueNode: parseValueLiteral(self, true)"
02:15:42FromDiscord<Rika> basically yes
02:15:46FromDiscord<KingDarBoja> But getting "expression expected, but found 'keyword do'"
02:15:48FromDiscord<KingDarBoja> wtf
02:15:52FromDiscord<Rika> oh
02:15:57FromDiscord<Rika> i think do syntax needs a proc...
02:16:00FromDiscord<Rika> use the other one i sent
02:16:16FromDiscord<KingDarBoja> Ok
02:16:38FromDiscord<KingDarBoja> Ok, no error on that syntax
02:18:49FromDiscord<KingDarBoja> DUDE
02:18:52FromDiscord<KingDarBoja> I LOVE YOU
02:18:52FromDiscord<KingDarBoja> ❀️
02:19:04FromDiscord<KingDarBoja> Thanks all πŸ˜„ πŸ˜„ Manage to make it work (the test is passing now
02:21:18leorizepartial is not really a thing in nim the people do afaik
02:26:23FromDiscord<KingDarBoja> I see...
02:28:11FromDiscord<eliezedeck> Good morning everyone
02:33:15*muffindrake quit (Ping timeout: 265 seconds)
02:35:03*muffindrake joined #nim
02:36:29*endragor joined #nim
02:44:28*endragor quit (Remote host closed the connection)
02:47:40FromDiscord<konsumlamm> ```nim
02:47:40FromDiscord<konsumlamm> proc test[T](x: T) = discard
02:47:40FromDiscord<konsumlamm>
02:47:41FromDiscord<konsumlamm> test[12](42)
02:47:41FromDiscord<konsumlamm> ```
02:48:35FromDiscord<konsumlamm> i think i kinda get why this works
02:48:42FromDiscord<konsumlamm> but *why*
02:48:56FromDiscord<konsumlamm> like, whats the reasoning for this design?
02:49:09FromDiscord<konsumlamm> why isnt this an error?
02:49:25number_oneDoesn't it derive the type T from the int literal?
02:50:52*zacharycarter quit (Ping timeout: 256 seconds)
02:52:55FromDiscord<konsumlamm> my question is not how it works, but rather why it isnt an error
02:55:57FromDiscord<eliezedeck> intersting
02:59:59FromDiscord<eliezedeck> it's good that the compiler can infer all sorts of thing, but here, it shouldn't try to derive for the sake of correctness ... imagine `test["hitman"](47)` ... now, it looks as if one would like to access an array that contains an element of `proc(v: int)` type and calls it ... total confusion
03:00:50FromDiscord<konsumlamm> `test["hitman"](47)` doesnt work actually, it only works when the generic parameter has the same type as the argument
03:00:54FromDiscord<eliezedeck> @konsumlamm I would suggest you report this as a bug
03:01:07FromDiscord<eliezedeck> oh, right .. but still
03:01:26FromDiscord<konsumlamm> will do Β―\\_(ツ)\_/Β―
03:01:53*ryukoposting joined #nim
03:03:11ryukopostingfigured out why my VN engine is so memory hungry. Every time I push the game state (which happens pretty regularly, so you can move backwards and forwards in the script), it's like 50MB of stuff lmao
03:03:13FromDiscord<eliezedeck> so, `test["hitman"]("fourty seven")` would then work, right?
03:03:16*endragor joined #nim
03:03:23FromDiscord<konsumlamm> mhm
03:04:13FromDiscord<eliezedeck> and that is still confusion
03:16:17FromDiscord<Rika> ryukoposting: maybe consider using a ref for that lmao
03:17:36*nsf joined #nim
03:21:05*chemist69 quit (Ping timeout: 272 seconds)
03:21:58*chemist69 joined #nim
03:23:55*zacharycarter joined #nim
03:39:36number_oneHey guys, am I doing exceptions wrong? Shouldn't this code be raising an EOFError and not an IOError? https://play.nim-lang.org/
03:39:40number_oneOne sec, sorry
03:39:48number_onehttps://play.nim-lang.org/#ix=2h1p
03:42:27leorizewait, we have EOFError?
03:42:45leorizewell the problem is simple, EOFError inherits from IOError
03:42:55leorizeso the branch for IOError catches first
03:44:47*zacharycarter quit (Ping timeout: 265 seconds)
03:46:07number_oneAh, wow!
03:46:10number_oneThanks
03:50:13companion_cubeseems like this would deserve a warning?
03:50:19companion_cube("unreachable case")
03:51:01*zacharycarter joined #nim
03:55:21*zacharycarter quit (Ping timeout: 250 seconds)
04:01:48ryukopostingaaayy, proper image caching took idle memory usage from 900 MB to 460 MB
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:11*rockcavera quit (Remote host closed the connection)
04:06:46*supakeen joined #nim
04:34:44*whaletechno quit (Remote host closed the connection)
04:35:01*whaletechno joined #nim
04:40:21leorizecompanion_cube: feel free to open an issue for that :)
04:45:02*waleee-cl quit (Quit: Connection closed for inactivity)
04:53:02*brainproxy quit (Ping timeout: 256 seconds)
04:54:17*narimiran joined #nim
05:22:33*brainproxy joined #nim
05:28:48*brainproxy quit (Ping timeout: 256 seconds)
05:41:31number_onehey guys, is it possible to ask the compiler to override the version of linenoise wrapped in the nim stdlib with a custom version when compiling a file?
05:41:41*zacharycarter joined #nim
05:42:17leorizeno, sorry
05:46:35*zacharycarter quit (Ping timeout: 265 seconds)
06:10:23*kenran joined #nim
06:12:02*solitudesf joined #nim
06:28:07wgetchis there a way to inspect the type of a proc call generated by a macro?
06:29:12*nekits quit (Remote host closed the connection)
06:36:45FromDiscord<Rika> you can inspect the output of a macro with expandMacros
06:36:50FromDiscord<Rika> if thats what you need
06:41:40*gour joined #nim
06:54:55*dddddd quit (Remote host closed the connection)
06:56:14*andinus joined #nim
06:59:39*filcuc joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:18*andinus left #nim (#nim)
07:00:37*endragor_ joined #nim
07:02:35wgetchthat did end up getting me exactly what I needed! thank you
07:02:52*endragor quit (Ping timeout: 256 seconds)
07:03:26*onionhammer quit (Ping timeout: 256 seconds)
07:03:53*onionhammer joined #nim
07:04:42*gmpreussner joined #nim
07:18:49*brainproxy joined #nim
07:22:00*PMunch joined #nim
07:22:54*brainproxy quit (Ping timeout: 240 seconds)
07:23:28*kenran quit (Quit: leaving)
07:33:54*hax-scramper quit (Ping timeout: 240 seconds)
07:35:24*hax-scramper joined #nim
07:55:13*NimBot joined #nim
07:58:39*EvilKhaosKat joined #nim
07:58:55*EvilKhaosKat quit (Client Quit)
08:00:36*brainproxy joined #nim
08:04:34*dwdv joined #nim
08:20:57*sleepyqt joined #nim
08:23:20*PMunch quit (Ping timeout: 256 seconds)
08:29:59FromDiscord<eliezedeck> Hey guys, are strings passed by reference around or by value? more specifically, I'm sending a string to a `FutureStream[string]` ... is Nim going to copy the string or send it by reference, and how can I control this?
08:34:59*PMunch joined #nim
08:36:03*brainproxy quit (Ping timeout: 265 seconds)
08:37:49FromDiscord<Benumbed> It'll copy it unless its a `ref`
08:39:49FromDiscord<eliezedeck> alright, thanks
08:49:19*hax-scramper quit (Ping timeout: 260 seconds)
09:04:47*brainproxy joined #nim
09:19:13Araqit's pass by reference
09:20:03Araqdon't mess with it, the compiler is good at it and getting better
09:21:17FromDiscord<eliezedeck> @Araq thanks for the clarification
09:21:19FromDiscord<Rika> so what things are pass by ref and not?
09:21:26FromDiscord<eliezedeck> so, it's safe to just pass string around
09:22:00Araqin a nutshell: Nim passes things as const& T or as T depending on sizeof(T)
09:22:14Araqif you know C++ this is the quickest explanation
09:22:20FromDiscord<eliezedeck> yes, I'd like to know that too ... looking at the output of --gc:arc ... there are `Performance` hints here and there, and so, I was wondering
09:22:44FromDiscord<eliezedeck> oh, right
09:23:12FromDiscord<eliezedeck> that sounds great
09:24:09Araqand 'sink T' is very much like C++'s "want speed, pass by value"
09:25:03Araqfor a sink parameter the compiler emits a move but this means the parameter must be owned. if what you pass to it isn't owned, the compiler has to introduce a copy for correctness
09:25:10Araqand that's when the warning kicks in.
09:30:45FromDiscord<eliezedeck> and how do you control ownership?
09:31:21FromDiscord<eliezedeck> how do you know if something is owned or not
09:31:29FromDiscord<Rika> araq what size does nim convert to pass by ref
09:33:14AraqRika: 3*sizeof(float)
09:34:03Araqeliezedeck: well the compiler knows. you own your local variables and your 'sink' parameters
09:37:11FromDiscord<eliezedeck> so, suppose that I have the warning, what should I do and should I do something about it (take below a real example that I ran just now):
09:37:11FromDiscord<eliezedeck> `Nim/lib/pure/httpclient.nim(980, 38) Hint: passing ':envP.:up.client3.userAgent' to a sink parameter introduces an implicit copy; use 'move(:envP.:up.client3.userAgent)' to prevent it [Performance]`
09:39:50*brainproxy quit (Ping timeout: 256 seconds)
09:39:52*gour left #nim ("Leaving")
09:40:00Araqeliezedeck: you cannot do anything and this warning is a bug :-)
09:41:55FromDiscord<eliezedeck> Ok, alright ... So, should I ignore all of these warnings from this point on then? I also get these warnings in my own code, and adding a `move ...` before the assignment does get rid of them, but then I seem to have a lot of move here and there ... should I remove those and stop worrying about them?
09:42:21FromDiscord<eliezedeck> not before the assignment, but as suggested by the warning, sorry
09:44:20Araqwarnings in your own code might be worth looking at
09:46:36FromDiscord<eliezedeck> out of curiosity, `httpclient` doesn't seem to contain any `sink` parameter at all ... and yet, the compiler will mention about it in that file; how is that so?
09:48:00FromDiscord<eliezedeck> so, it looks as if the compiler will auto-consider certain proc to have sink parameters, is this the case? and if it so, is it worth knowing these kind of proc?
09:49:56FromGitter<Vindaar> @Araq: how experimental is `dynamicBindSym` considered to be? I think it might really help me, but I don't want to rely on it if it might disappear at some point
09:51:12*dsrw joined #nim
09:53:17FromGitter<alehander92> hey guys
09:55:22FromDiscord<eliezedeck> hello @alehander92
09:56:27FromDiscord<eliezedeck> @alehander92 I saw you had a patch to allow using `await` in a template, but it's not yet merged ... what's the status on it? and why is it blocked?
09:56:44FromGitter<alehander92> yes
09:56:48FromGitter<alehander92> well..i dont remember
09:56:50FromGitter<alehander92> i use it!
09:56:52FromGitter<alehander92> locally in my code
09:57:02FromGitter<alehander92> i think i had some strange type error
09:57:08FromGitter<alehander92> but cant remember how to reproduce
09:57:23FromGitter<alehander92> otherwise have to check if multisync works.. but
09:58:03FromGitter<alehander92> i can try to fix it and let it be merged: i'd like to get closer to upstream! ⏎ the patch is basically just a port of the chronos solution tho
09:58:28*narimiran quit (Ping timeout: 256 seconds)
09:58:30FromDiscord<eliezedeck> I see ... I'm be interested to try it, but if it breaks multisync, then it might not be a good idea
09:58:56FromDiscord<eliezedeck> I personally prefer to be closer to upstream as well
09:59:02FromGitter<alehander92> it doesn't have to break it i think
09:59:09FromGitter<alehander92> i just dont remember, have to look again
09:59:18FromGitter<alehander92> what are you working on
09:59:29FromDiscord<eliezedeck> well, it would greatly help everyone if you manage to get it working
09:59:40FromDiscord<eliezedeck> GraphQL client
10:00:07FromDiscord<eliezedeck> I prefer to have the same exact thing on client and on server, that's why I'm writing it with Nim
10:00:42FromGitter<alehander92> yes
10:00:58FromGitter<alehander92> ok, hmm
10:01:00FromDiscord<eliezedeck> I'm planning on use it on a Flutter app
10:01:12FromGitter<alehander92> how does the dsl look
10:01:13FromDiscord<eliezedeck> unfortunately, the Dart API isn't really appealing to me
10:01:36FromDiscord<eliezedeck> and current graphql library doesn't seem to be able to do what I exactly want
10:01:38FromGitter<alehander92> i wonder because one can typecheck a lot of things in such orm-like things
10:02:01FromDiscord<eliezedeck> which dsl?
10:02:17FromGitter<alehander92> the graphql lib one
10:02:23FromGitter<alehander92> well, api*
10:02:41FromDiscord<eliezedeck> how does it look... I'm not sure I understood you
10:02:54FromDiscord<eliezedeck> (be back in an hour, lunch)
10:03:53FromGitter<alehander92> i mean
10:04:00Araqeliezedeck: the compiler does sink parameter inference
10:04:02FromGitter<alehander92> can i see how it is invoked
10:04:04FromGitter<alehander92> :D
10:04:30AraqVindaar: if you can avoid it, do so. it's an ugly beast
10:08:43FromGitter<alehander92> i think https://github.com/nim-lang/Nim/pull/12085#discussion_r319680783
10:08:43disbotβž₯ Make await a template
10:08:53FromGitter<alehander92> i had a strange problem if not using `auto`
10:09:12FromGitter<alehander92> otherwise i should mostly answer the objections
10:09:16FromGitter<alehander92> and fix
10:10:40FromGitter<Vindaar> @Araq: ok, thanks. I'll see if I can find another way
10:11:03*Zectbumo quit (Remote host closed the connection)
10:16:55*brainproxy joined #nim
10:21:08*krux02 joined #nim
10:22:52*brainproxy quit (Ping timeout: 265 seconds)
10:38:19*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
10:42:07*pbb joined #nim
10:44:05*hax-scramper joined #nim
10:51:44FromDiscord<Recruit_main707> i am having some issues trying to override a method, what am i doing wrong here? https://play.nim-lang.org/#ix=2h2Q
10:52:36*brainproxy joined #nim
10:58:51FromDiscord<konsumlamm> you have two definitions of `get_output` that have the same sgnature
10:59:00FromDiscord<konsumlamm> you have two definitions of `get_output` that have the same signature
10:59:13FromDiscord<konsumlamm> so the compiler doesnt know which to choose
11:01:03FromDiscord<Recruit_main707> so how can i fix that? because i need a definition of get_output in the first file
11:02:52FromDiscord<konsumlamm> idk what you want
11:03:03FromDiscord<konsumlamm> dont import get_output from the first module?
11:04:10PMunchimport RLNim except get_output
11:05:39*hax-scramper quit (Ping timeout: 250 seconds)
11:06:00FromDiscord<Recruit_main707> didnt work, let me elaborate a bit more that code
11:06:30*hax-scramper joined #nim
11:07:38FromDiscord<Recruit_main707> https://play.nim-lang.org/#ix=2h2T this is much more self explanatory
11:08:08FromDiscord<Rika> hi
11:08:16FromDiscord<Recruit_main707> hello Rika
11:08:54FromDiscord<Rika> thats not how methods work
11:09:01FromDiscord<Rika> the signature should be different
11:09:11FromDiscord<Rika> if you want to "override" it, exempt it from your import
11:10:00FromDiscord<Recruit_main707> ive done this, but it throws me an error still: `import RLNim except get_output`
11:10:37FromDiscord<konsumlamm> why does `get_output` in RLNim even exist? you can't override it with the same signature anyway
11:11:22FromDiscord<konsumlamm> and what error do you get when doing `import RLNim except get_output`?
11:11:23FromDiscord<Recruit_main707> because `receive_and_respond()` calls the method
11:11:50FromDiscord<Recruit_main707> the error is the same one, "should override this method"
11:12:15FromDiscord<Rika> make it a proc
11:12:16FromDiscord<konsumlamm> you need to define the two methods in the same module then
11:12:53FromDiscord<konsumlamm> or import get_output where you define receive_and_Respond
11:16:50FromDiscord<Recruit_main707> making it a proc didnt work, and if i have to import it it would kind of loose the purpose
11:16:59FromDiscord<Recruit_main707> i will see what can i do
11:17:12*tane joined #nim
11:18:10*Vladar joined #nim
11:27:38*brainproxy quit (Ping timeout: 265 seconds)
11:27:43*dddddd joined #nim
11:48:03*whaletechno quit (Read error: Connection reset by peer)
11:48:05*whaletechho joined #nim
12:00:06*brainproxy joined #nim
12:01:20*ormiret joined #nim
12:03:27FromDiscord<eliezedeck> @Araq string doesn't seem to be passed by reference as you said ... every-time I cross to another function, passing it around, the memory usage increase by the amount of the original string ... I'm testing with ~65MB file, and in the end, the memory usage of the program is 700 MB+ ... that is not good
12:03:28FromDiscord<eliezedeck> I tried both --gc:arc and without it, it's right about the same memory usage
12:04:03FromDiscord<eliezedeck> I'm using devel branch
12:05:01*brainproxy quit (Ping timeout: 264 seconds)
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:14FromDiscord<eliezedeck> not using any `sink` or ref or whatever ... just plain `string` ; i'm currently testing upload of a large file (65MB), and for some reason, the CPU usage also is not where it should be ... trivial task like that would typically not consume more than 5% CPU on my internet connection, yet, it reached 25 - 30%
12:06:31FromDiscord<eliezedeck> of course, I was testing with `-d:release`
12:06:46*supakeen joined #nim
12:08:04FromDiscord<eliezedeck> this is for testing the WIP that I'm hoping to contribute to Nim about the `bodyStream` for HTTP requests (https://github.com/nim-lang/Nim/issues/13856)
12:08:06disbotβž₯ httpclient: Ability to stream HTTP request body
12:09:39FromDiscord<Rika> elieze are you absolutely sure its string causing you issues
12:10:04zedeusRelated? https://github.com/nim-lang/Nim/pull/12982
12:10:05disbotβž₯ Implement file streaming for httpclient's MultipartData
12:10:05*narimiran joined #nim
12:11:31FromGitter<alehander92> elieze
12:11:35FromGitter<alehander92> string is just a small struct
12:11:37FromGitter<alehander92> in nim
12:11:46FromGitter<alehander92> eliezedeck*
12:12:04FromGitter<alehander92> which contains capacity, length and char pointer if i recall correctly
12:12:15FromGitter<alehander92> (maybe with some differences between gc modes)
12:12:38Araqeliezedeck: 'async' changes the picture
12:13:04AraqI described Nim's calls, not what async layers on top of it
12:14:04Araqalehander92: you're wrong, it's a pointer to a variably sized block of memory that contains the length, cap and character data
12:14:13FromDiscord<eliezedeck> @zedeus your PR is more multipart centric, I was building one that is absolutely dumb where you are responsible of the correct headers (Content-Length) and for composing the whole POST (or any request for that matter) body
12:14:49FromGitter<alehander92> Araq sorry, so a pointer (but isnt it still to a struct?)
12:14:54FromDiscord<eliezedeck> @Araq, yes, it's all async
12:15:30FromDiscord<eliezedeck> so, what is then the behavior in async context?
12:15:40FromDiscord<eliezedeck> I suppose string copy?
12:16:11FromGitter<alehander92> maybe they get preserved in the closure?
12:16:38FromDiscord<eliezedeck> no wonder a program that should stay at ~65 MB memory usage end-up using 700+ ... there is a chain of async proc that is being called until it finally arrives to socket.send()
12:16:38Araqthe closure "captures" the string causing the copy, I think
12:16:51*ikan_keli joined #nim
12:16:55FromGitter<Vindaar> @Araq: managed a way around without `dynamicBindSym` by writing a macro that creates bindSym calls to my computed idents and calling that macro as an argument for another macro. Kinda hacky, but gets the job done
12:17:40FromDiscord<eliezedeck> hmmm... and how do I completely send the string fully to the next proc? may be `move`?
12:17:55*Guest29531 quit (Ping timeout: 260 seconds)
12:17:58FromGitter<alehander92> hm, thats an interesting problem
12:19:48*dadada joined #nim
12:20:11*dadada is now known as Guest58097
12:21:24FromDiscord<eliezedeck> I'm sure this is not the first time this kind of problem has been raised here, and I'd like to know what is the idiomatic Nim-way of solving this problem
12:25:13*rockcavera joined #nim
12:29:13Araqeliezedeck: via 'move'
12:30:14FromDiscord<clyybber> eliezedeck: Are you trying async with gc:arc ?
12:31:52FromDiscord<eliezedeck> @clyybber yes
12:31:56FromGitter<alehander92> is gc:arc doing
12:32:14FromGitter<alehander92> what is it doing differently for async closures
12:32:16FromDiscord<clyybber> @eliezedeck heh, its not working yet. Its leaking
12:32:28FromDiscord<eliezedeck> oh, ok
12:32:31FromDiscord<eliezedeck> good to know
12:37:37*whaletechho quit (Remote host closed the connection)
12:38:36*whaletechno joined #nim
12:45:44*andinus joined #nim
12:45:55*brainproxy joined #nim
12:46:44FromDiscord<eliezedeck> trivial question, but I don't know the answer: how to convert `TaintedString` to `string`?
12:46:56narimiran`myTainted.string`
12:47:05FromDiscord<eliezedeck> lol... thanks
12:47:37*muffindrake quit (Quit: muffindrake)
12:48:41*zacharycarter joined #nim
12:50:33*andinus left #nim (#nim)
12:52:16lqdev[m]if you don't use taint mode you don't need to convert at all
12:55:12dom96yeah, the compiler should probably have some logic to make it obvious that TaintedString is the same as String when tainted mode is off
12:55:16*dsrw quit (Quit: Textual IRC Client: www.textualapp.com)
12:59:20FromDiscord<eliezedeck> the issue is, on VSCode, I suppose it defaults to tainted mode = on ... unless there is a way to disable that, but I really don't want to ... I want to stay with the default behavior, plus, the `.string` is fine
13:00:09FromGitter<alehander92> hmmm
13:03:53dom96Ehhh, VS Code shouldn't be setting that by default.
13:04:07dom96Nim has it's own defaults, VS Code really shouldn't be changing them
13:04:15dom96taint mode isn't on by default in Nim
13:05:53zacharycarteris a `var` return type valid, for example does this proc signature make sense? It seems to work - proc `[]`(a: var openArray[sg_color_attachment_action]; b: int): var sg_color_attachment_action =
13:06:33dom96yes
13:07:02zacharycarterOkay thanks - I guess I'm returning a managed pointer in this case?
13:07:09zacharycarteror a managed reference?
13:09:07*sentreen_ joined #nim
13:11:16*whaletechno quit (Remote host closed the connection)
13:11:31*whaletechno joined #nim
13:13:24FromDiscord<eliezedeck> ohh
13:15:06FromDiscord<eliezedeck> @Araq ... I only managed to avoid 2 copies, once the 65MB buffer gets passed `FutureStream.write`, I no longer have the ability to have `move` applied to the rest of the call chain
13:18:57FromDiscord<eliezedeck> isn't there a way to have an immutable string that it should be copied at all? I'd like to see where is the code that does this copying ... this is a very serious problem for me
13:19:12FromDiscord<eliezedeck> *should not be copied
13:19:50zacharycartergitub pages being down is super annoying
13:20:05FromDiscord<eliezedeck> for example, if I say: `let fileContent = readFile("...")` ... fileContent should be immutable, right?
13:22:21FromDiscord<eliezedeck> if it is immutable, the compiler shouldn't copy it at all, may be just increment GC ref counter, and as it is passed around, it stays immutable (and AFAIK, a parameter will be immutable) ... and since nobody is going to modify it, it is safe to use the original
13:23:15Araqrun 'shallow(str)' on the string to do that
13:23:26Araqbut this feature isn't available for ARC (yet?)
13:23:50FromDiscord<eliezedeck> i'm no longer using ARC for now, from @clyybber 's suggestion
13:29:46FromDiscord<eliezedeck> @Araq that reduced memory usage from 700+ to 350MB πŸ™‚ ... a good progress, but not quite there yet
13:30:11FromDiscord<eliezedeck> it should be lower than 100MB
13:31:21FromDiscord<eliezedeck> there may be at least still 5 copies of that buffer, roughly ... what's the typical memory debugging tool for Nim?
13:37:31*Vladar quit (Quit: Leaving)
13:38:12*Vladar joined #nim
13:40:36FromGitter<alehander92> try to use maybe valgrind with `-d:useMalloc`
13:40:43FromGitter<alehander92> but not sure if this works only for `--gc:arc`
13:41:04FromGitter<alehander92> i think there was some config file for a normal gc and valgrind tho
13:42:39zacharycartershashlick: I'm trying to use nimterop on another header file - https://github.com/RandyGaul/cute_headers/blob/master/cute_math.h - and a lot of types definitions are being skipped over. Mind pinging me when you're around today?
13:48:47*ikan_keli quit (Ping timeout: 260 seconds)
13:48:54zacharycarternevermind I think I understand why it's happening
13:49:53*brainproxy quit (Ping timeout: 250 seconds)
13:49:58FromDiscord<eliezedeck> thanks @alehander92
13:51:12shashlickSup
13:51:46zacharycarterwell I figured out it was skipping those type defs because the types had no fields
13:51:57zacharycarternow I'm trying to figure out how to make nimterop deal with namespaces
13:52:30zacharycarteralso when we're out of quarantine, we should hang out. disruptek mentioned coming to Austin to visit
13:52:53companion_cubeyou're in Austin? damn
13:52:54shashlickThat will be fun
13:52:59zacharycarteryeah!
13:53:08FromDiscord<Recruit_main707> is this the only flatbuffers implementation we have in nim? https://github.com/Skrylar/skflatbuffers
13:53:13*companion_cube moved away 2 weeks ago
13:53:19zacharycarter:(
13:53:20shashlickThis header is implementation
13:53:29zacharycarterwell it's everything
13:53:36zacharycarterit's just a single header lib
13:53:59zacharycartersame with the library I used nimterop for yesterday - sokol
13:54:37shashlickOk but those online procs won't be wrapped right
13:54:43shashlickInline
13:56:03zacharycartergotcha
13:56:29zacharycartermaybe I'll just try to port this
14:02:57*liblq-dev joined #nim
14:09:32*waleee-cl joined #nim
14:11:35shashlick@zacharycarter: I guess you could modify the header and get a wrapper if you want
14:21:44*solitudesf quit (Remote host closed the connection)
14:23:03FromGitter<alehander92> companion_cube where you livin now
14:24:13companion_cubejust moved to DC, and I miss Austin a bit already :p
14:33:40FromDiscord<eliezedeck> How to detect Linux / macOS? (using when ...)
14:33:52narimiran`when posix`
14:34:31narimiran`when defined(posix)`, to be more precize
14:34:44FromDiscord<eliezedeck> @narimiran thanks, I want to separate the two
14:34:50FromDiscord<eliezedeck> detecting Linux from macOS
14:35:08narimiran`when defined(linux)`
14:35:16FromDiscord<eliezedeck> πŸ˜„ thanks
14:35:22narimiranyou can guess the other one, i hope :P :D
14:36:20*oculuxe joined #nim
14:36:32disruptek!last zevv
14:36:33disbotZevv spoke in 12#nim 12 days ago
14:36:49*oculux quit (Ping timeout: 264 seconds)
14:37:08FromDiscord<eliezedeck> yes πŸ˜›
14:37:14shashlickcompanion_cube: whoops
14:42:18*letto_ joined #nim
14:44:39*letto quit (Ping timeout: 258 seconds)
14:57:29*Ven`` joined #nim
14:57:37*brainproxy joined #nim
14:58:24zacharycartercompanion_cube: I'm originally from Northern VA haha
14:58:40zacharycarterbut I was in Helsinki for the past 9 months, just moved to Austin in Feb
14:59:11companion_cubeah well, you'll be able to enjoy Barton Spring once the quarantine is over
14:59:29companion_cubealso, be careful with this thing called the sun
14:59:30zacharycarteryeah - I'm looking forward to getting out and exploring more of Austin
14:59:49zacharycarterhaha yeah - I have 100 spf sunscreen. I've already had skin cancer once and I'm only 35 haha
14:59:50*salotz[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
15:00:32companion_cubeoh shit, yeah
15:00:36companion_cubeand sunglasses
15:01:31zacharycarterfor sure
15:02:58companion_cube(but yeah, look for barton springs, best thing in austin)
15:03:56zacharycarterwill do - my gf lived here for a few years so she knows all the hot spots, but I've heard about barton springs from multiple people, so def going to check that out
15:07:14*whaletechno quit (Remote host closed the connection)
15:07:31*whaletechno joined #nim
15:08:38Zevvdisbot: sup
15:09:08companion_cubeI still have plenty of friends in Austin… will fly back to see them when it's safe
15:09:38disruptekhey zevv, do i just use nimLUA for lua in nim?
15:09:41disruptekor something else?
15:13:02FromDiscord<eliezedeck> Using Valgrind Massif to analyze where are the 350 MB memory usage going ... tried with and without `-d:useMalloc`: memory reported by massif is always about 78 KB (yes, kilobytes)
15:13:03FromDiscord<eliezedeck> What up here?
15:17:47FromDiscord<mratsim> with -d:useMalloc should work, if it doesn't it's a bug
15:18:03FromDiscord<mratsim> without Valgrind cannot analyze memory because Nim does raw mmap/VirtualAlloc calls
15:21:41FromDiscord<eliezedeck> so, it's a bug then ... I tried many times with -d:useMalloc, nothing
15:22:19*sendell[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
15:22:52FromDiscord<eliezedeck> πŸ˜”
15:24:04FromGitter<alehander92> well, please just give us a repro example
15:24:18FromGitter<alehander92> its not easy to discuss without one
15:26:48FromDiscord<mratsim> And I've checked the recent refs_v2 code and it properly calls c_malloc / c_free when using -d:useMalloc
15:27:30*endragor_ quit (Remote host closed the connection)
15:27:37FromGitter<alehander92> oh i just have a nice tool to check quickly this stuff
15:27:39*filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
15:27:39FromGitter<alehander92> let me try
15:27:44FromDiscord<eliezedeck> is that dev channel?
15:27:54FromGitter<alehander92> eh?
15:27:55FromDiscord<eliezedeck> devel*
15:28:27FromGitter<alehander92> i thought stuff_v2 is only for newruntime
15:28:35FromGitter<alehander92> yes, it is in `devel` branch :)
15:28:37FromDiscord<mratsim> ah maybe
15:29:36FromDiscord<eliezedeck> is that devel branch?
15:29:59FromDiscord<eliezedeck> going to try 1.2.0 ...
15:30:56ryukopostingdom96: noticed you have a commit in the SDL2 library called "fix TextInputEventObj and TextEditingEventObj padding." I'm starting on my engine's text entry stuff today, but I'm running on the most recent tag, not #head. Did the padding break those objects to the point of un-usability?
15:31:31dom96ryukoposting, yeah, it prevents casting because Nim checks sizeof of each type
15:31:43*brainproxy quit (Ping timeout: 250 seconds)
15:32:50ryukopostingoh man. If you guys have a process for this, obviously I understand, but if you could get that v2.0.3 tag made soon, that'd be very nice.
15:33:07dom96why do you need a tag?
15:34:00disruptekthis again.
15:34:08dom96you can just depend on a specific commit for now
15:34:09ryukopostingI can have the engine depend on head for now, but once I move towards releasing an early beta version (which should happen in the next couple weeks), I'd prefer not to
15:34:55disruptekryukoposting: dom only has a couple tags left and he's hoarding them.
15:35:04ryukopostingI know "make a tag so my random library will work!" is kind of an asinine question lol
15:35:07*brainproxy joined #nim
15:35:35disruptekafter all, they are pretty expensive. we only use them to fix software we care about.
15:35:45disruptekyours obviously doesn't rank.
15:36:12dom96disruptek, stop your cheek
15:36:20disruptekstop being a douchebag.
15:36:38ryukopostingoooooooh suddenly I remember why disruptek is a familiar name
15:36:38disruptekthey guy is trying to help.
15:36:42FromDiscord<eliezedeck> hmm... 1.2.0 also has the same exact graph and peak of 78KB ... Wondering if it has something to do with openssl, as somewhere at the end of the call, it calls a sslWrite in an sslLoop
15:37:19FromDiscord<eliezedeck> at least, that should point to the fact that devel hasn't broken -d:useMalloc
15:37:20FromGitter<alehander92> guys i have 65k
15:37:23FromGitter<alehander92> =destroy calls
15:37:27ryukopostingdom96 I promise I don't want to come off as pushy. You surely have more important things on your plate
15:37:27FromGitter<alehander92> in one small binary
15:37:31FromGitter<alehander92> is that normal
15:37:43disruptekryukoposting: i'll fork it and tag it. what's the package?
15:37:44FromGitter<alehander92> like, when i run it *
15:38:00dom96ryukoposting, not pushy at all, don't worry. I just wanted to give you a workaround while the tag is made.
15:38:12FromGitter<alehander92> huh, its probably a bug because i have like super many one after another
15:39:00ryukopostingdisruptek, actually, come to think of it, it wouldn't be a horrible idea for me to do that myself. I've made this giant abstraction layer over the SDL2 library to make my engine work, and that library is likely to be very useful on its own
15:39:16ryukopostingdom96, for sure. Thanks!
15:39:21disruptekcool.
15:39:37disrupteki made a tag maker because it's so hard for mere mortals to do.
15:39:40disruptek!repo bump
15:39:41disbothttps://github.com/disruptek/bump -- 9bump: 11a tiny tool to bump nimble versions 🍻 15 13⭐ 1🍴 7& 1 more...
15:39:42disruptekhope it helps.
15:39:43*solitudesf joined #nim
15:40:15ryukoposting...!repo <>, interesting command.
15:40:33FromGitter<alehander92> hm sorry probably a bug in my text graph
15:40:34ryukoposting!repo CEASER-DS
15:40:37disbothttps://github.com/ryukoposting/CEASER-DS -- 9CEASER-DS: 11Directory-based cache coherence with encrypted addressing 15 0⭐ 0🍴
15:40:40FromGitter<alehander92> the =destroy thing
15:40:42ryukopostingoh that's really cool
15:41:18ryukopostinghave a link to my project for my advanced computer architecture class last semester lmao
15:42:38*whaletechno quit (Remote host closed the connection)
15:42:58*whaletechno joined #nim
15:44:21companion_cubeis disbot based on the `irc` package?
15:45:26disruptekyep.
15:45:59disruptek!repo xs
15:46:00disbothttps://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 2⭐ 0🍴
15:46:25companion_cubeahah the `ix` package :D
15:46:59disruptekthe bot needed it.
15:47:10companion_cubenot critizing
15:48:28FromGitter<alehander92> mratsim yeah, it seems to me
15:48:35FromGitter<alehander92> the default gc doesnt use `useMalloc`
15:51:15ryukopostingdom96, for what it's worth, my engine and test game run a-okay on #head, and it uses all of the new audio-related calls.
15:52:00ryukopostingand I got to delete the module from my project that just has the new calls in it lol
15:52:46dom96awesome :D
15:52:51*Trustable joined #nim
15:54:45ryukopostingI'm hoping to have a sort of alpha version on my gitlab soon. right now, the code is littered with uses of an old project name that I need to replace, and the test game is using art I ripped from another VN so I can't really publish that
16:02:03*aEverr quit (Ping timeout: 250 seconds)
16:03:09*aEverr joined #nim
16:04:47*Asgaroth joined #nim
16:07:35*aEverr quit (Ping timeout: 256 seconds)
16:08:27*aEverr joined #nim
16:16:28*xet7 quit (Remote host closed the connection)
16:18:03*xet7 joined #nim
16:18:16*natrys joined #nim
16:31:52*lritter joined #nim
16:35:35*brainproxy quit (Quit: WeeChat 2.8)
16:38:26disruptekwhy do i have to export a symbol that i use in an imported template?
16:45:30disruptek~salewski is a cool book on nim: http://ssalewski.de/nimprogramming.html
16:45:32disbotsalewski: 11a cool book on nim: http://ssalewski.de/nimprogramming.html
16:45:46*hax-scramper quit (Read error: Connection reset by peer)
16:45:47disruptek!repo inim
16:45:49disbothttps://github.com/AndreiRegiani/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 229⭐ 18🍴
16:46:15*hax-scramper joined #nim
16:49:48*Zectbumo joined #nim
16:59:01leorizedisruptek: shouldn't be needed
16:59:23disruptekand yet, somehow, i am still needed.
16:59:40leorizedo you have an example?
17:00:13disruptek!repo nimph
17:00:14disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 55⭐ 4🍴 7& 1 more...
17:00:41disruptekthe export issue? i ran into it in the compiler.
17:01:03leorizeok I give up there :P
17:01:40leorizeusually that'd only happen if the template copy the AST elsewhere than the site of declaration
17:02:00leorizeyou might want to employ `mixin`
17:02:11disrupteki dunno anything about mixin.
17:02:36disruptekthe idea here is that the template is the api, not the goods it represents.
17:02:49leorizecan I see the template?
17:02:51disruptekbut i'm not working on the compiler today.
17:03:05disruptekit's in my ic2 branch, filename is compiler/rod.nim and it's at the bottom.
17:03:21disruptekor i can put it on stream quickly.
17:05:03*opal quit (Ping timeout: 240 seconds)
17:05:31leorizedisruptek: hmm, interesting, the template looks fine
17:05:52leorizeI don't really know why you'd need to export symbols when you use it then
17:06:23disrupteki think i can make a macro that calls it instead.
17:06:40disruptekthis is probably a "feature".
17:06:52leorizenah, this kind of template is used everywhere
17:06:57leorizeand you don't need to export symbols for it
17:07:08leorizeit's injected to the caller's scope afterall
17:07:20leorizeor do you mean that you have to export things like `.reject`?
17:07:25disruptekmaybe because i have an inject stmt in there.
17:08:08disrupteki dunno, i'll take a closer look at it tomorrow. thanks for checking it out anyway.
17:08:14*narimiran quit (Quit: leaving)
17:08:17leorizenp :)
17:13:07*opal joined #nim
17:19:05*koltrast joined #nim
17:19:25*koltrast_ quit (Ping timeout: 240 seconds)
17:34:29*biqqles joined #nim
17:48:13disruptekleorize: seems to be a problem for macros as well.
17:51:19leorize[m]if you can give me some examples it'd be great
17:51:48disruptekwriting one now.
18:26:16*biqqles quit (Ping timeout: 240 seconds)
18:28:04shashlickgreat - nim-regex broke non-greedy in the latest release
18:29:45*aEverr quit (Ping timeout: 265 seconds)
18:30:39*aEverr joined #nim
18:34:16FromGitter<alehander92> disruptek `mixin` is about late binding iirc
18:36:37shashlickhttps://github.com/nitely/nim-regex/issues/61
18:36:41disbotβž₯ Non-greedy ? operator broken in 0.14.0 ; snippet at 12https://play.nim-lang.org/#ix=2h5j
18:36:43shashlickcc @nitely
18:40:45FromDiscord<exelotl> a friend was asking what's the best way to append 2 or more elements to a seq
18:41:08FromDiscord<exelotl> spent a long time searching the docs but couldn't find anything
18:41:11leorize.add twice or more :P
18:41:18leorizejk .add also takes an openArray
18:43:17FromDiscord<exelotl> huh, I could've sworn I tried that
18:43:30FromDiscord<exelotl> guess not
18:46:06shashlickhttps://github.com/yglukhov/emacs
18:48:48*whaletechno quit (Remote host closed the connection)
18:49:23*whaletechno joined #nim
18:51:08leorizekrux02: ^ now you can make the ultimate nim emacs plugin
18:55:19krux02leorize, maybe
18:55:57krux02I currently need to reevaluate my priorities though.
18:58:25*nsf quit (Quit: WeeChat 2.7)
19:23:57FromGitter<kaushalmodi> shashlick: Thanks for sharing that link.. I have reached out to that repo's author: https://github.com/yglukhov/emacs/issues/1
19:24:03disbotβž₯ Want to collaborate?
19:26:33FromDiscord<Varriount> @krux02 You still up?
19:34:30FromDiscord<eliezedeck> @Araq, specifying `shallow` (line 212) for `data` in the `asyncnet.nim::sendPendingSslData` reduces memory usage from 350MB -> 280MB; I wonder, how many of that kind one may find in the standard library; can't the compiler know to do that automatically? it was obviously a local variable ... Behold, the quest for `shallow`ing local vars πŸ™‚
19:35:53*tiorock joined #nim
19:35:53*tiorock quit (Changing host)
19:35:53*tiorock joined #nim
19:35:53*rockcavera is now known as Guest36326
19:35:53*Guest36326 quit (Killed (livingstone.freenode.net (Nickname regained by services)))
19:35:53*tiorock is now known as rockcavera
19:47:23krux02Varriount: yes I am still up, it is not yer that late
19:47:36krux0221:47
19:47:47*dddddd quit (Ping timeout: 260 seconds)
19:47:48*hax-scramper quit (Ping timeout: 256 seconds)
19:48:42*natrys quit (Quit: natrys)
19:49:23*hax-scramper joined #nim
19:55:09*muffindrake joined #nim
19:59:07FromDiscord<Varriount> eliezedeck: Do you know if sink analysis would have caught it?
20:01:44*Ven`` quit (Quit: Textual IRC Client: www.textualapp.com)
20:09:24FromDiscord<eliezedeck> @Varriount I not sure what is "sink analysis", is that a tool?
20:10:38dom96hello hello
20:10:53leorizeit's just a thing in the compiler that try to infer if move optimization if possible
20:11:03leorizeit's not a thing for oldruntime strings/seqs iirc
20:11:15leorizehi dom96
20:12:03FromGitter<awr1> @leorize thoughts on this? https://github.com/nimterop/nimterop/pull/176
20:12:04disbotβž₯ Preprocessor mode fixes
20:12:49dom96So let's see if I can fix this openssl bug
20:13:29FromDiscord<eliezedeck> @dom96 cool ...
20:13:48FromDiscord<Varriount> leorize: If a sequence can be moved, then it doesn't need to be copied.
20:13:54FromDiscord<eliezedeck> but I don't think it's really specific to openssl
20:14:08FromDiscord<eliezedeck> it's more something that the compiler should have optimized
20:14:13leorize@Varriount: I'm not sure if it's a thing for old runtime strings
20:14:22dom96eliezedeck: I'm referring to something else I think
20:14:26FromDiscord<eliezedeck> there's a lot of inefficient and unnecessary copy happening
20:14:35dom96#13903
20:14:37disbothttps://github.com/nim-lang/Nim/issues/13903 -- 3openssl wrapper corrupts stack on OpenSSL 1.1.1f + Android ; snippet at 12https://play.nim-lang.org/#ix=2h0G
20:15:01leorize@awr1: please don't process .h.in
20:15:07FromDiscord<eliezedeck> oh, ok
20:15:10leorizethose files are usually incomplete
20:15:36leorizethey have to be passed through their build tools before they become valid C for consumption
20:15:54FromGitter<awr1> i only did it because AppVeyor was complaining about it
20:16:02FromGitter<awr1> but i will fix that
20:16:45FromGitter<awr1> specifically when processing PCRE
20:17:07leorizedom96: do you think that our implementation of dynlib isn't adequete for android?
20:17:27leorizethe openssl wrapper is patchy, but I don't see any problems in it
20:18:00dom96leorize: I'm not sure, the code works if I comment out the first attempt to load the "old" C function
20:18:14leorizeyea, sounds like that might be our problem
20:18:31dom96I tried unloading the lib handle pointer
20:18:40dom96didn't help
20:18:58dom96I guess I can try loading the methods using the same lib handle and see if that helps
20:19:00dom96any other ideas?
20:21:03FromGitter<awr1> i don't get it though, aren't the build tools executed before toast
20:21:50FromGitter<awr1> https://github.com/awr1/nimterop/blob/master/tests/tpcre.nim
20:23:01shashlickhey awr1
20:23:16shashlickyet to review that PR but same feedback as leorize
20:25:30shashlicki don't see the point of the changes in toast
20:26:33FromGitter<awr1> the issue is with c2nimport
20:26:41shashlickand why mode = "" by default
20:26:49FromGitter<awr1> because you already have mode selection
20:27:00FromGitter<awr1> *automatic mode selection
20:27:49shashlickright now, it isn't doing it at all which is why I'm debating removing c mode altogether
20:27:51FromGitter<awr1> `if gState.mode.Bl:` won't ever get followed through, unless you explicitly are like `--mode=""` to toast
20:28:03shashlicksince it is set to cpp and never changed by anyone
20:29:36FromGitter<awr1> c2nimport gets toast to do the preproc pass, which does it in cpp mode
20:29:39*sleepyqt quit (Ping timeout: 258 seconds)
20:30:03FromGitter<awr1> meaning things like `#ifdef __cplusplus` get followed through
20:31:02leorizedom96: can you check if it's reproducible in environments like termux?
20:31:16shashlickokay i see where you are going
20:31:22FromGitter<awr1> and c2nim doesn't play nice with `extern "C"` so by default it tries to skip `__cplusplus`, but it can't anymore because the preproc already cleaned those out
20:31:24leorizethen we can make a reproducible sample and it'd be easier to debug
20:32:04*disruptek quit (Ping timeout: 256 seconds)
20:32:30*munksgaard left #nim ("WeeChat 1.0.1")
20:33:13*disbot quit (Ping timeout: 264 seconds)
20:33:40shashlickkeep c2nim aside for a minute
20:34:00shashlicklooking at the issue 175 submitted
20:35:59shashlickthe extern "C" piece is only of interest to the C++ compiler
20:36:39shashlickwhat you are saying tho is that since the mode is default c++, we end up with the extern "C" portion that c2nim doesn't like
20:36:43shashlicktoast doesn't care
20:37:36shashlickwhat you are saying tho is that c2nim can process extern "C" but I don't think it does today
20:38:25shashlickideally c2nim should be able to ignore that since many headers have that for compatibility
20:38:37shashlickand more often than not, c2nim is used without nimterop
20:39:13shashlickbut i agree having a fix for this in nimterop will make c2nim work better in this use case
20:39:23leorizewhat he is saying is that c2nim doesn't define __cplusplus
20:39:36leorizeso it escapes the `extern "C"` problem
20:39:44shashlickokay makes sense
20:39:58shashlickso this is finally a legitimate use case to process .h with c mode and .hpp with c++ mode
20:40:22shashlickbut will need a bunch of testing to verify that it doesn't really break every wrapper out there since everything has been parsed with tree-sitter-cpp
20:52:41dom96leorize: I guess, but seems like a faff :)
20:53:50leorizeI can't really help you on this one unless I can reproduce it :P
20:55:34FromGitter<awr1> i removed the `.in` thing
20:56:35shashlickcan you also check if there's any hard-coded c/cpp in build and cimport that can be handled correctly?
20:58:23*disbot joined #nim
20:58:25FromGitter<awr1> sure
20:58:36*Zectbumo quit (Remote host closed the connection)
20:58:37dom96leorize: just grab the latest openssl and try to use httpclient.get() on an https site?
20:59:14*disruptek joined #nim
20:59:20dom96oh, I think I just fixed it
20:59:32leorizewhat lol
21:00:53dom96I believe the problem is that loadLib() and loadLibPattern are called twice
21:01:42leorizewell according to linux dlopen, they can be called as much as you'd like
21:01:58leorizethe entries are ref-counted
21:02:56dom96well I moved the loading of each method into sslSym and it works
21:03:08dom96hopefully I'm not just getting lucky
21:03:43leorizeI heard that dlopen was broken on android til mashmallow
21:03:55leorizebut you're unlikely to be on an android version that old
21:04:49dom96yeah, I'm just above that, Android 7 (Nougat)
21:06:19leorizenice, nim 1.2.0 is in termux repo already
21:07:57*filcuc joined #nim
21:08:51leorizedom96: openssl 1.1.1f, no prob
21:08:58leorizeon android termux env
21:09:15leorizeI use get() on https://example.org
21:09:47leorizeon android pie though
21:10:30dom96interesting, thanks for checking
21:16:29dom96#13919
21:16:30disbothttps://github.com/nim-lang/Nim/pull/13919 -- 3Fixes issues with dynamic loading OpenSSL. Fixes #13903.
21:18:12leorizedom96: that patch introduces more corruptions btw :P
21:18:39leorizesslModule() and thisModule() caches the handles they create
21:18:50leorizeif you free them then they will be invalid
21:19:36dom96I changed that
21:19:53leorizecan you have them cache?
21:20:10leorizeit's not cheap to open then close shared libraries, esp since they are used a lot
21:20:19dom96yeah, I guess I should
21:25:40*liblq-dev quit (Quit: WeeChat 2.7.1)
21:26:26dom96okay, good, it still works :)
21:28:09dom96pushed
21:28:11*qbradley quit (Read error: Connection reset by peer)
21:28:14dom96looks like there is a test failure
21:29:52leorizeloadPSSLMethod can be make a bit simpler
21:30:14leorizeyou can do the cast right when you use sslSym
21:30:31leorizesince it's still a pointer .isNil would still work
21:30:48dom96why does it matter?
21:31:08leorizeso you don't need the weirdly named method2Proc?
21:31:57leorizealso I'd recommend dropping the `else`. `raise` is already a noreturn statement
21:31:59dom96I disagree with you here.
21:32:04dom96It's clearer this way.
21:32:15*Vladar quit (Quit: Leaving)
21:35:09dom96That I can do
21:35:31leorizeactually do you think sslSym can be made fatal?
21:36:30leorizethe other APIs just ignore when sslSym returns nil
21:38:17dom96federico3, props to you, your tests just caught a bug in my PR
21:45:40*solitudesf quit (Ping timeout: 256 seconds)
21:48:10dom96GitHub's CI is pretty freaking awesome
21:48:50leorizeyep
21:49:03dom96Our CI runs each file's main module tests right?
21:49:07dom96Any ideas how to run those?
21:49:31leorizessl ci?
21:49:46leorizehttps://github.com/nim-lang/Nim/blob/devel/.github/workflows/ci_ssl.yml#L85
21:50:15dom96that's just for untestable things
21:50:25dom96I'd rather be part of the main CI
21:50:48leorizejust put it in a subfolder in tests
21:50:52leorizefile name starts with `t`
21:51:00leorizeit will be run as part of `testament all`
21:51:25leorizerun individual then `testament r <category/testname>`
21:51:40dom96yeah, but what I want to test is better being a part of openssl.nim
21:52:38leorizehttps://github.com/nim-lang/Nim/blob/devel/testament/categories.nim#L695
21:52:42leorizewe don't test lib/wrappers
21:53:25dom96that sucks, I assume we've got openssl in our main CI
21:54:57*hax-scramper quit (Ping timeout: 256 seconds)
21:55:26leorizewe test the things that use openssl instead
21:55:37*hax-scramper joined #nim
21:57:44*whaletechno quit (Remote host closed the connection)
21:58:01*whaletechno joined #nim
21:58:29dom96I would like to have some unit tests for openssl specifically
21:58:45dom96our testing infra really needs someone's time commitment
21:58:52dom96anyway, I updated the PR
21:58:59dom96I guess testing will have to happen some other time
22:00:00leorizeyou can just put it in the tests folder for now
22:00:11leorizeit doesn't have to be pretty, it just have to prevent the bug
22:01:00dom96Spent too much time on this already
22:03:03*zedeus quit (Quit: zedeus)
22:06:46*filcuc quit (Ping timeout: 265 seconds)
22:09:51*zedeus joined #nim
22:17:51*tane quit (Quit: Leaving)
22:20:10*PMunch quit (Quit: leaving)
22:35:08FromDiscord<KingDarBoja> Hi all
22:36:57leorizegah, Nim is generating overflow checks for C unsigned types
22:56:35nisstyreleorize: that doesn't sound right...maybe there's a way to disable that
22:56:58nisstyrehttps://forum.nim-lang.org/t/3434
22:57:01nisstyreseems to imply there is
22:57:04leorizenah, false alarm
22:57:12nisstyrebut would that disable it for signed ints too I wonder
22:57:14nisstyreah ok
22:57:15leorizebecause some cross platform code is a bit out of date
22:57:44nisstyreyeah I generally think Nim does the right thing when interacting with primitive types like that
23:02:18zacharycarterhttps://imgur.com/a/wAq7UoG
23:02:36zacharycartercube with sokol!
23:03:14zacharycarternow I can play with hot reloading shaders and also simd for the linalg module I'm composing
23:09:59FromDiscord<KingDarBoja> Awesome!
23:16:47leorizeAraq: nim is generating range checks for importc-ed types, is this intended?
23:20:18*Guest58097 quit (Ping timeout: 256 seconds)
23:23:01*letto_ quit (Ping timeout: 264 seconds)
23:23:22*letto_ joined #nim
23:33:18*dsrw joined #nim
23:35:48krux02zacharycarter, where do you use simd?
23:36:06zacharycarterjust adding it to matrix operations
23:36:33zacharycarteradding SSE instructions
23:37:59krux02cool
23:39:15*Trustable quit (Remote host closed the connection)
23:39:50krux02is in an optimization for you existing vectormath operations?
23:40:03krux02or is it custom SIMD vectormath?
23:40:48*krux02_ joined #nim
23:41:35krux02_I am currently trying to optimize some glm as I am totally unhappy with its performance.
23:41:48krux02_got a reconnect
23:41:57krux02_somehow I can't set my name back to krux02
23:42:41zacharycarterI'm porting https://github.com/HandmadeMath/Handmade-Math/blob/master/HandmadeMath.h and combining it with some of the syntactic sugar you provided in glm
23:44:43*krux02 quit (Ping timeout: 265 seconds)
23:46:21FromDiscord<Recruit_main707> We don’t have any flatbuffers parser for Nim yet right?
23:52:58*whaletechno quit (Quit: ha det bra)
23:57:23FromGitter<awr1> i have an algebra module that i never released, uses SSE intrins
23:58:31FromGitter<awr1> including SSE 4.1
23:59:23zacharycarterlinear algebra?