<< 08-04-2020 >>

00:01:54*dwdv quit (Ping timeout: 240 seconds)
00:03:41zacharycartersweet - SSE intrinsics are working
00:04:17zacharycartertime to work on shader hot reloading
00:05:56*Zectbumo joined #nim
00:06:26*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:18:58FromGitter<awr1> yes
00:19:52FromGitter<awr1> my original idea for it, because using `_m128`s invoke their own problems, was to have a "fast" vector type and a "strict" vector type
00:20:02*sleepyqt joined #nim
00:20:57FromGitter<awr1> `_m128`s aren't tightly packed, for instance
00:27:05*qbradley joined #nim
00:32:51ryukopostingtext entry box with support for japanese and chinese input almost finished :)
00:35:14ryukopostinghttps://cdn.discordapp.com/attachments/673968364598853662/697242864383426600/2020-04-07_19-29-43.mp4
00:45:49*dsrw joined #nim
00:48:17FromDiscord<ejstembler> Does Nim have something equivalent to Ruby's ERB (https://ruby-doc.org/stdlib-2.7.1/libdoc/erb/rdoc/ERB.html), or Crystal's ECR (https://crystal-lang.org/api/0.21.1/ECR.html) ? Basically the ability to render templates with embedded nim code.
00:49:46leorizesource code filter seems to be the closet thing that I could think of
00:50:08*NimBot joined #nim
00:50:17leorizehttps://nim-lang.org/docs/filters.html
00:55:20FromDiscord<ejstembler> Thanks @leorize ! Looks like that may work for my use-case. I'll give it a try...
01:01:48*krux02_ quit (Remote host closed the connection)
01:19:09*chemist69 quit (Ping timeout: 265 seconds)
01:21:00*chemist69 joined #nim
01:28:26*sleepyqt quit (Ping timeout: 256 seconds)
01:34:38*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:37:23*dsrw joined #nim
01:41:04*lritter quit (Ping timeout: 256 seconds)
01:41:25*lritter joined #nim
02:15:25FromDiscord<Benumbed> Wow that was a quick turnaround on the httpclient bug I filed, thanks Araq and narimiran!
02:27:27*endragor joined #nim
02:32:37*muffindrake quit (Ping timeout: 265 seconds)
02:34:41*muffindrake joined #nim
02:46:27*oculuxe quit (Ping timeout: 265 seconds)
02:46:34*ikan_keli joined #nim
02:48:20*kotrcka left #nim ("https://quassel-irc.org - Chat comfortably. Anywhere.")
02:48:22*kotrcka joined #nim
02:48:26*kotrcka left #nim ("https://quassel-irc.org - Chat comfortably. Anywhere.")
02:53:27FromGitter<awr1> @ryukoposting looks cool! are you using the SDL text input API or are you getting stuff directly from the windows IME
02:59:18ryukopostingawr1: I'm using SDL2's text input system. It's not great (no autofill suggestions) but it's portable
03:01:19*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:03:31*sleepyqt joined #nim
03:26:05FromDiscord<Rika> is SDL really easy to use?
03:27:20FromDiscord<Benumbed> Relatively yeah
03:27:37FromDiscord<Benumbed> Esp if you're comfortable with C
03:28:21FromDiscord<Benumbed> I use it in the game engines I've written for the input, window and OS events because it's petty simple and stays out of my way
03:28:36FromDiscord<Benumbed> and means I don't have to write abstraction layers for that stuff
03:29:26zacharycarterI'm using sokol in my current game project and like it so far
03:30:12ryukopostingThe nim port of it is pretty much a 1:1 clone of the normal library, so the official wiki is a good resource even though you aren't using C
03:31:23ryukopostingI plan on stripping my engine's abstraction layer out, and making it into its own library so you can get easy access to some higher-level facilities
03:31:54*waleee-cl quit (Quit: Connection closed for inactivity)
03:32:23ryukopostingI'll definitely make my audio thing into a separate library. It's like SDL_Mixer except it can handle multiple audio streams simultaneously. only supports WAV at the moment, though.
03:32:43*oculux joined #nim
03:32:53*Asgaroth_ joined #nim
03:34:05shashlick@zacharycarter - if you have time, would you be able to test how the new ast2 algorithm works on sokol?
03:35:27zacharycartershashlick: sure - what do I need to do?
03:36:03shashlickare you using toast on the command line or cImport in a nim file?
03:36:12zacharycartercImport
03:36:23zacharycarterand cCompile
03:36:25*Asgaroth quit (Ping timeout: 265 seconds)
03:37:54shashlickokay, just pushed latest stuff to #head so if you can pull that first
03:38:02zacharycartersure
03:38:05*oculuxe joined #nim
03:38:13shashlickand then update cImport with a `flags = "-f:ast2"` param
03:38:38shashlicki've not tagged any of the new stuff until it is good to replace the legacy algo
03:38:51shashlickbut even #head should work the same as 0.4.4 from a legacy perspective
03:39:22*oculux quit (Ping timeout: 258 seconds)
03:39:26shashlickidea is to tag 0.5.0 with legacy deprecated but still the default, followed by bug fixes on ast2, finally making ast2 the default in 0.6.0 and removing legacy in 0.7.0
03:39:31shashlicklet's see how it goes
03:39:45zacharycarterif I just nimble install from the cloned repo's master branch, will that be okay?
03:40:12zacharycarterhow do I install #head?
03:41:01zacharycarteroh I guess head is origin - okay let me add that flag
03:41:28shashlickya just nimble install nimterop@#head
03:43:38zacharycarterhmm ran into some errors
03:44:35zacharycarterI threw it on both of the libs I'm using nimterop with - let me just add it to sokol and see what happens
03:45:51shashlicki guess first might just want to try #head as is without -f:ast2 and see if it just works
03:45:59shashlickthen try -f:ast2 one at a time
03:46:12shashlickast2 has a bunch of stuff fixed so it should be better - https://github.com/nimterop/nimterop/issues?q=is%3Aissue+is%3Aopen+label%3Afixed
03:46:28shashlickbut it is new so bugs for sure
03:56:19zacharycarterI'm compiling my program with `nim c --gc:arc` and switching to #head causes a SIGABRT
03:56:39zacharycarterwithout the ast2 flag
03:56:53shashlickhmm, i've not tested with gc:arc at all, not even 0.4.4
03:57:18shashlickare you compiling toast also with gc:arc?
03:57:21zacharycarterseems to be working fine with nim devel
03:57:39zacharycarterI'm just installing it with `nimble install nimterop`
03:57:52zacharycarterso I guess not
04:06:01*supakeen quit (Quit: WeeChat 1.9.1)
04:06:38*supakeen joined #nim
04:08:59shashlickat the very least, #head should work as is like 0.4.4 so if that's not working, please let me know
04:09:27zacharycarterdoesn't seem to be with gc arc :/ I can try with the default gc if you'd like
04:11:02FromDiscord<KingDarBoja> Trying to pass to some procedure a inherited type but getting a error message like -> "first type mismatch at position: 2
04:11:02FromDiscord<KingDarBoja> required type for nodes: Option[seq[ParentType]] or Option[ParentType]
04:11:02FromDiscord<KingDarBoja> but expression 'some(@[someChildValue])' is of type: Option[seq[ChildType]]"
04:12:49FromGitter<zacharycarter> irc or tmux or something just froze... anyway, shashlick: I get that same SIGABRT error with `nimble install nimterop@#head` whether I use `--gc:arc` or not on nim devel
04:17:00shashlickhmm - can you share something that I could test and reproduce?
04:17:40FromGitter<zacharycarter> I only have things working on osx atm :/
04:18:38FromGitter<zacharycarter> I'm about to watch a movie and go to sleep but I can try to help debug more tomorrow
04:21:20shashlicksure, don't want to send you down a rathole
04:21:44shashlickbut anything you can send my way to debug, will appreciate
04:22:51*nsf joined #nim
04:26:12FromDiscord<KingDarBoja> Found this at the manual: Object fields that should be visible from outside the defining module, have to be marked by *. In contrast to tuples, different object types are never equivalent.
04:27:06FromDiscord<KingDarBoja> But inherited object types are somewhat equivalent to its parent type.
04:27:34FromDiscord<Varriount> Yes, but not equivalent
04:29:32FromDiscord<KingDarBoja> So if I try to pass a object, let's call it ChildA to some procedure whose argument uses ParentOfChildA, it will throw an error, right?
04:29:37*ikan_keli quit (Ping timeout: 260 seconds)
04:36:01FromDiscord<KingDarBoja> https://nim-lang.org/docs/manual_experimental.html#covariance Maybe this is what I am asking for?
04:37:08leorizeno, it won't error out
04:37:27leorizeyou can just try :P
04:37:59FromDiscord<KingDarBoja> Well I am getting one unless I cast the child type to the parent type
04:38:20leorizecan you post an example?
04:42:50FromDiscord<KingDarBoja> Not sure, I do have pushed my code on the repo
04:43:25FromDiscord<KingDarBoja> But let me explain
04:43:26*casaca quit (Remote host closed the connection)
04:43:32*ehmry_ joined #nim
04:43:53FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/error/graphql_error.nim#L73 This proc should accept any child type (nodes) that inherits from "Node" type
04:44:54FromDiscord<KingDarBoja> On the test, I am trying to pass the proper sequence whose object type is a child of "Node" https://github.com/KingDarBoja/Phosphate/blob/master/tests/error/test_graphql_error.nim#L51
04:46:06FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim#L140 The inherited type (the child type) is called "SelectionNode", but for some reason, the terminal isn't accepting it unless I cast the value to "Node"
04:47:39FromDiscord<KingDarBoja> But if I don't cast, I get: "first type mismatch at position: 2
04:47:39FromDiscord<KingDarBoja> required type for nodes: Option[seq[Node]] or Option[ast.Node]
04:47:39FromDiscord<KingDarBoja> but expression 'some(@[fieldNode])' is of type: Option[seq[SelectionNode]]"
04:48:00FromDiscord<KingDarBoja> Not sure why I am needing the cast on my code...
04:50:25*ikan_keli joined #nim
04:57:07FromGitter<awr1> maybe try `let nodes :Option[seq[Node]] = @[fieldNode]`
04:57:41FromGitter<awr1> the compiler needs more information to know that the sequence isn't just constrained to the root obj
04:58:15FromGitter<awr1> i mean `let nodes :Option[seq[Node]] = some @[fieldNode]`
04:59:12FromGitter<awr1> *constrained to the inherited obj
05:00:00FromDiscord<KingDarBoja> On the test you mean?
05:00:08FromGitter<awr1> yes
05:00:24FromDiscord<KingDarBoja> Instead of directly passing the `some(@[fieldNode])` ?
05:00:28FromGitter<awr1> yes
05:00:52FromGitter<awr1> if that doesn't work, you may need to do `let node :Node = fieldNode`and then do `some(@[node])`
05:00:57FromDiscord<KingDarBoja> Nope -> type mismatch: got <Option[seq[SelectionNode]]> but expected 'Option[seq[Node]]'
05:01:06FromDiscord<KingDarBoja> Let me try
05:02:52FromDiscord<KingDarBoja> Well it works, either setting as you said or just setting the type to FieldNode to be Node
05:02:56FromDiscord<KingDarBoja> "let fieldNode: Node = operationDefNode.selectionSet.selections[0]"
05:03:02*ehmry is now known as ehmry[m]
05:03:10*ehmry_ is now known as ehmry
05:03:23*ehmry[m] left #nim ("User left")
05:03:38FromGitter<awr1> try making it a `method`
05:03:39FromDiscord<KingDarBoja> But I expected the compiler to treat fieldNode (which is SelectionNode type) as Node
05:03:58FromGitter<awr1> https://github.com/KingDarBoja/Phosphate/blob/095101d74e236e91a9350034cf1f04b464431ab1/src/error/graphql_error.nim#L71
05:04:10FromGitter<awr1> `method newGraphQLError(..`
05:04:58FromDiscord<KingDarBoja> Doesn't work if doing that, getting same error as before
05:05:21FromGitter<awr1> use the method with the original call
05:05:36FromGitter<awr1> `let e = newGraphQLError("msg", some(@[fieldNode]))`
05:07:55FromDiscord<KingDarBoja> Nop
05:08:09FromDiscord<KingDarBoja> https://imgur.com/HRMMA10
05:09:14FromGitter<awr1> i think maybe this deserves an issue
05:09:20FromGitter<awr1> a compiler issue
05:09:26FromGitter<awr1> i did a minimal example, the issue is with the optionals
05:09:33FromDiscord<KingDarBoja> Arrrh
05:09:37FromDiscord<KingDarBoja> Again the optionals
05:09:47FromGitter<awr1> https://play.nim-lang.org/#ix=2h7q
05:09:50FromDiscord<KingDarBoja> There is another bug (I think) I found with Options module
05:10:04FromDiscord<KingDarBoja> But related to Table on that same error file
05:10:48FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/error/graphql_error.nim#L78 If you try to use Option to specify the type with Table[string, string], you will get an error too
05:11:00FromGitter<awr1> but this is not really `Option[T]` specific on a technical level, it is more with how generics wrap inheritable types and what is supposed to happen in regards to type resolution
05:11:34FromDiscord<KingDarBoja> I see
05:12:06*rockcavera quit (Remote host closed the connection)
05:12:13FromDiscord<KingDarBoja> The other issue (not sure if bug) -> Use something like this: "someArgument: Option[Table[string, string]] = some(Table[string, string])""
05:12:44FromDiscord<KingDarBoja> You get the following error: _"first type mismatch at position: 1 required type for val: T but expression 'Table[string, string]' is of type: type Table[system.string, system.string]"_
05:13:00FromDiscord<KingDarBoja> Like... both **are** the same type lol
05:13:27FromDiscord<KingDarBoja> Looking at your repr awe1
05:15:52FromGitter<awr1> https://github.com/nim-lang/Nim/issues/2686
05:15:53disbotDynamic dispatch doesn't work properly when types are generic
05:17:57FromDiscord<KingDarBoja> Ugh?
05:18:06FromDiscord<KingDarBoja> By the way, you are right with the bug
05:19:12FromGitter<awr1> technically what is described here is different
05:19:47FromGitter<awr1> this is referring to when the ref type itself is the generic i think
05:20:24FromGitter<awr1> i'm gonna make an issue anyway
05:20:32FromDiscord<KingDarBoja> Thank you awr1
05:20:48FromDiscord<KingDarBoja> I will follow the issue, just be sure to share it here 😄
05:21:17FromDiscord<KingDarBoja> In the meantime, I will specify the type so my test work
05:21:50FromGitter<awr1> https://github.com/nim-lang/Nim/issues/13922
05:21:52disbotGeneric call doesn't resolve when working with inherited ref types ; snippet at 12https://play.nim-lang.org/#ix=2h7t
05:22:32FromDiscord<KingDarBoja> That was fast
05:25:22FromGitter<awr1> if this is intended behavior, then your workaround is
05:25:25FromGitter<awr1> `let node :Node = fieldNode; let e = newGraphQLError("msg", some(@[node))`
05:25:45FromDiscord<KingDarBoja> Yup
05:25:58FromDiscord<KingDarBoja> Looking forward on the issue (I just subscribed)
05:26:06FromDiscord<KingDarBoja> Now I must go to sleep, midnight here
05:26:06FromDiscord<KingDarBoja> 😄
05:26:10FromDiscord<KingDarBoja> Cya
05:28:14FromGitter<awr1> cya
05:55:27*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:55:38*njoseph joined #nim
06:02:54FromDiscord<treeform> VTune works with nim through --debugger:native flag. This is amazing. Thank you to who made this work.
06:17:22*narimiran joined #nim
06:24:24*sleepyqt quit (Ping timeout: 256 seconds)
06:25:23*solitudesf joined #nim
06:27:13*PMunch joined #nim
06:38:56*xet7 quit (Quit: Leaving)
06:43:36*arecaceae quit (Remote host closed the connection)
06:43:53*arecaceae joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:26*zacharycarter quit (Ping timeout: 256 seconds)
07:03:15number_oneHey folks, with the setControlCHook, I assume that it's pretty much an `onSignal(SIGINT)` under the hood. Sorry if it's a dumb question, but if you set a handler for it, can you ever return to the execution point where the SIGINT was raised?
07:03:40number_oneI'm also assuming that you can only really use it for clean exiting etc
07:05:12*gmpreussner joined #nim
07:06:02FromDiscord<mayse> hey everyone. i'm trying out the code here : https://nim-lang.org/docs/hcr.html - i've got the sdl bits working, but compiling this ends with `dlopen(libnimhcr.dylib, 2): image not found`
07:06:32FromDiscord<mayse> I've searched on google and the only source that talks about this is here, back in 21/03/2020 which someone mentioned doing some PATH thing. I haven't been able to progress from there.
07:07:33FromDiscord<mayse> Here's how I compile it: `nim c -d:nimDebugDlOpen --hotCodeReloading:on --verbosity:2`
07:07:52number_oneWhoal, hotCodeReloading works for C now?
07:09:00FromDiscord<mayse> do you mean that hotCodeReloading is only for javascript output, @number_one ?
07:09:07leorizenumber_one: I think if you don't exit, the execution point will be returned
07:09:39leorize@mayse: you gotta build nimrtl and nimhcr
07:10:01leorizethe files required are in nim's base directory
07:10:29leorizehow did you install nim?
07:10:34FromDiscord<mayse> thanks leorize. I'll try that! any idea how to do that with choosenim ?
07:10:39Araqnumber_one: signal handling is just broken, don't use it
07:10:39FromDiscord<mayse> I installed nim with choosenim devel
07:11:07leorizeok, then it should be in ~/.choosenim/nim-current/lib
07:11:20leorizeif my understanding of choosenim's layout is correct
07:11:30leorizeyou'll see the two files: nimrtl.nim and nimhcr.nim
07:11:50number_one@Araq, Just broken flat out? Any workarounds in circulation? Or should I handle this in C?
07:12:13FromDiscord<mayse> i see them leorize, they're at `~/.choosenim/toolchains/nim-#devel/lib`
07:12:32leorizerun nim c --outdir:$PWD /path/to/nimrtl.nim
07:12:39leorizeand nim c --outdir:$PWD /path/to/nimhcr.nim
07:13:12leorizeyou'll get libnimrtl.dynlib and libnimhcr.dynlib in your current directory
07:13:23Araqnumber_one: no it's broken in C... see http://man7.org/linux/man-pages/man7/signal-safety.7.html
07:13:50leorizenumber_one: it means: it works, just that the idea is fundamentally broken
07:14:18FromDiscord<mayse> it's working! thank you so much `leorize` ! . to leave a message for posterity if anyone searched into here, the two commands leorize mentioned should be ran in the source dir where you have your .nim, not in the ...lib/ dir.
07:14:44number_one:/
07:15:03number_oneWow
07:15:05number_oneDaaaang
07:16:13Araqleorize: :-)
07:25:42FromDiscord<mayse> a question aside from that, the code that is in that file won't work because nimble package sdl2 changed how it works (a lot). how would I contribute back the version that works to the documentation? (I'm very new to this, please be patient with me)
07:25:54Yardanicois it expected that this doesn't work?
07:25:57Yardanico!eval var a = ""; a &= if true: "hello" else: "no"
07:25:59NimBotCompile failed: /usercode/in.nim(1, 18) Error: expression expected, but found 'keyword if'
07:26:02YardanicoI thought it'd work
07:26:30narimiran!eval var a = ""; a &= (if true: "hello" else: "no")
07:26:32NimBot<no output>
07:26:38narimiranYardanico: ^
07:26:39Yardanicowell but then
07:26:45Yardanicovar a = ""; a = if true: "hello" else: "no"
07:26:47Yardanico!eval var a = ""; a = if true: "hello" else: "no"
07:26:50NimBot<no output>
07:27:06Yardanicoi got a bit confused :P
07:28:30FromDiscord<Rika> i think = isnt a proc, whilst &= is?
07:28:57FromDiscord<Rika> no clue but yeah if it's an "augmented" equals, then you need parens., even w/ blocks
07:29:16Yardanicosomehow I didn't notice that until now :P
07:29:35FromDiscord<Rika> and you've been here for real long...
07:29:38Yardanicoxdd
07:31:34Araqmayse: I don't understand the question
07:33:32FromDiscord<mayse> @Araq I found it I think. so to change that document, would I need to send a request to change this file on github ? `https://github.com/nim-lang/Nim/blob/devel/doc/hcr.rst`
07:33:48Araqyes
07:34:27*zacharycarter joined #nim
07:34:28FromDiscord<mayse> thanks, will do that
07:35:11FromDiscord<mayse> it's just that sdl2 changed since (I can see now jun 2019) and the example code does not work anymore. so I'll send in a version that works. (cf: `https://github.com/nim-lang/sdl2/blob/master/src/sdl2.nim`)
07:37:48FromDiscord<eliezedeck> Hey guys
07:38:58*zacharycarter quit (Ping timeout: 256 seconds)
07:44:12PMunchMorning :)
07:50:12FromGitter<Vindaar> Good morning :)
08:01:41FromDiscord<eliezedeck> 🙂
08:02:07FromDiscord<eliezedeck> @Araq: https://github.com/nim-lang/Nim/issues/13923 ... I could not find any more ways to solve the high memory usage
08:02:09disbotOutrageous memory usage due to numerous inefficiencies in the STD lib (async) ; snippet at 12https://play.nim-lang.org/#ix=2h84
08:10:48FromDiscord<eliezedeck> I hope this problem is cause by OpenSSL ... but I highly doubt that
08:10:55FromDiscord<eliezedeck> I hope this problem is caused by OpenSSL ... but I highly doubt that
08:13:41Yardanicoit's easy to test - just compile without -d:ssl and test with an HTTP website
08:15:00FromDiscord<eliezedeck> good idea ... let me ...
08:15:45*natrys joined #nim
08:16:32FromDiscord<eliezedeck> @Yardanico 830 MB -> 530 MB ... so, in some part, it is ... but not fully OpenSSL only
08:17:13*xet7 joined #nim
08:23:26*Asgaroth joined #nim
08:23:31*lritter quit (Ping timeout: 265 seconds)
08:25:43*Asgaroth_ quit (Ping timeout: 258 seconds)
08:35:42dom96Araq, narimiran: we're still doing 1.0.8 right? Can we include #13919?
08:35:43disbothttps://github.com/nim-lang/Nim/pull/13919 -- 3Fixes issues with dynamic loading OpenSSL. Fixes #13903.
08:36:00narimiranok
08:37:13narimiran(when merging, add [backport] tag)
08:38:31*hpyc9 quit (Quit: ZNC 1.7.5 - https://znc.in)
08:38:42*hpyc9 joined #nim
08:39:15dom96should I modify the commit msg to include that?
08:50:40narimiranjust add it when you (squash) merge
08:56:43dom96I might just amend
08:56:49dom96Can someone review my PR? :)
09:11:15Araqeliezedeck: COW strings means "copy on write"
09:11:31Araqbut it's cheaper to fix the stdlib than fixing Nim's builtin string type
09:12:00Araqwith --gc:arc the builtin string type became very hackable but --gc:arc isn't yet ready for async code :-/
09:12:34FromGitter<alehander92> eliezedeck just a very friendly note: please try to use objective language in your issues: you can say something is "very high", "outrageous" is subjective (its useful to do in general, would you read a science paper called "outrageous values of protein in mice when a" :D
09:14:10Araqfwiw I LOL'ed when I read the title
09:14:24*Asgaroth_ joined #nim
09:14:32FromGitter<alehander92> otherwise i've heard before that we can use more streams for stuff
09:15:39FromGitter<alehander92> yeah, it's very human, i like it, but i can just imagine "scandalous segfault when using expr as a type parameter, people riot on the streets"
09:17:37*Asgaroth quit (Ping timeout: 264 seconds)
09:17:47FromDiscord<mratsim> Btw, now that we have dup, can we refactor all the strutils proc?
09:18:14FromDiscord<mratsim> I'm always saying this but it's the biggest performance trap of Nim in my opinion, and I don't use strings that much
09:18:57narimiran@mratsim it is on my personal (long-term) todo :)
09:19:08*Asgaroth_ quit (Client Quit)
09:23:01*dwdv joined #nim
09:23:33*lbart is now known as lbat
09:23:59*lbat is now known as lbart
09:27:43federico3dom96: what test?
09:29:57Araqmratsim: fine with me but we should also take the opportunity to introduce strbasics that is a strutils with the few procs that I acually need
09:30:38Araqthe existing strutils can be kept and do 'import strbasics; export strbasics'
09:31:46dom96federico3, ci-ssl
09:32:46dom96Araq, what's the point? we have dead code elimination for a reason
09:33:39Araqdom96, we still lack IC though
09:34:33dom96so you'll save 1 or 2 seconds at most, not worth the extra maintenance and knowledge about another module
09:35:34Araqfair enough
09:43:03Araq(it's much less than 1s btw)
09:44:32supakeenSpeaking off, would it be silly to PR `getBit` as a partner get `getBit` in bitops? :)
09:45:17*ikan_keli quit (Read error: Connection reset by peer)
09:45:51supakeenWow that sentence didn't make sense. As a partner to `setBit`.
09:46:10AraqI like it
09:47:04supakeenNeat :)
09:47:19supakeenI'll make it so then.
09:47:56*Tyresc joined #nim
09:51:06*sleepyqt joined #nim
10:00:41FromDiscord<eliezedeck> @Araq, @alehander92 ... alright, I'll update the title to "very high" 😛
10:01:17Araqeliezedeck: I can guide you to the problem
10:01:18FromDiscord<eliezedeck> and happy to bring about some lols
10:01:25FromDiscord<eliezedeck> yes please
10:01:29Araqright here, right now
10:01:47FromDiscord<eliezedeck> alright, let's go ...
10:01:59Araqcompiler / lambdalifting.nim line 203
10:02:35Araqwe used the quick string assignment called 'nkFastAsgn' but had to use the slower assignment because of reported bugs
10:02:37FromDiscord<exelotl> fug
10:02:38FromDiscord<exelotl> https://cdn.discordapp.com/attachments/371759389889003532/697385906042306671/image0.jpg
10:02:58Yardanico@exelotl how much RAM?
10:03:28FromDiscord<exelotl> 512mb
10:03:49FromDiscord<exelotl> maybe if I close the web browser...
10:03:54Yardanicoyes, and do a swap :P
10:04:04Araqeliezedeck: you can try to use 'nkFastAsgn' and see if it makes a difference
10:04:16FromDiscord<eliezedeck> alright
10:04:19Araqand if it does, we can figure out how to do this properly
10:04:29Araqvia some analysis inside the compiler
10:06:13Araqand maybe you need to check for ri.kind notin {nkStrLit..nkTripleStrLit}
10:06:19Araqas the comment indicates
10:07:04FromDiscord<eliezedeck> ok, thanks for the pointers
10:07:28FromDiscord<eliezedeck> so, I suppose I have to build_all.sh, right?
10:07:33Yardanicono
10:07:41Yardanicoyou can do ./koch temp c path_to_your_nim_file
10:07:54Yardanicoin the dir with nim compiler
10:07:56FromDiscord<eliezedeck> alright, that's useful
10:08:00FromDiscord<eliezedeck> thanks
10:08:16Yardanicothat'll compile nim compiler in debug mode and that compiler will compile your file
10:08:45FromDiscord<eliezedeck> interesting and much appreciated
10:10:30Araqhttps://nim-lang.org/docs/intern.html#debugging-the-compiler
10:15:16FromDiscord<eliezedeck> unfortunately, it doesn't compile:
10:15:16FromDiscord<eliezedeck> ```
10:15:16FromDiscord<eliezedeck> /Nim/lib/system/gc.nim(239) asgnRef
10:15:17FromDiscord<eliezedeck> /Nim/lib/system/gc.nim(184) incRef
10:15:17FromDiscord<eliezedeck> SIGBUS: Illegal storage access. (Attempt to read from nil?)
10:15:17FromDiscord<eliezedeck> ```
10:16:20*dadada joined #nim
10:16:22FromDiscord<mratsim> mmm
10:16:30FromDiscord<mratsim> does gc:markandsweep help?
10:16:43*dadada is now known as Guest51436
10:17:29FromDiscord<mratsim> if yes can you compile with "-d:useSysAssert -d:useGcAssert" as well
10:18:03FromDiscord<Recruit_main707> currently, there is no tool to transpile c/c++ to nim right?
10:18:45Yardanicoif you mean something which works for everything - no :P
10:19:15FromDiscord<Recruit_main707> and, something that kind of works?
10:19:21Araqc2nim
10:19:23FromDiscord<mratsim> c2nim
10:19:47Araqit parses C89 and C++98, kind of :-)
10:19:58FromDiscord<Recruit_main707> i hope it likes flatbuffers generated code because if not im gonna go crazy
10:19:59FromDiscord<eliezedeck> yes, gc:markandsweep got rid of the crash ... but the memory usage hasn't changed
10:20:09Yardanicowhat about trying without async and with --gc:arc :P
10:20:22AraqYardanico, it's all about async
10:21:16Araqeliezedeck: if memory usage didn't change we need a better analysis of the problem than just "closure parameters are copied"
10:21:37FromDiscord<eliezedeck> @Yardanico use multiple system threads? I don't think that would be a good idea for my case, it will receive multiple requests from clients
10:22:05FromDiscord<eliezedeck> right, so what's the next step?
10:23:18Araqdo you use --gc:arc?
10:23:38FromDiscord<eliezedeck> no
10:23:44FromDiscord<mratsim> I thought it didn't work with async yet?
10:23:52Yardanicoit works but leaks memory AFAIK :P
10:23:57FromDiscord<eliezedeck> and that's the reason I didn't
10:24:42Araqok, good, just wanted to be sure
10:25:04FromDiscord<Recruit_main707> how severe is the leak?
10:25:46FromDiscord<eliezedeck> @Araq ... just for compleness, --gc:arc increased memory usage back to 700MB
10:25:58FromDiscord<eliezedeck> and as I leave it running, it went-up to 1GB
10:26:13Araqwell it leaks, it will go as high as you want to go
10:26:20FromDiscord<eliezedeck> 🙂 right
10:26:20*Zectbumo quit (Remote host closed the connection)
10:26:58*zacharycarter joined #nim
10:28:57Araqopen lib/system/sysstr.nim
10:29:09*Tyresc quit (Ping timeout: 258 seconds)
10:29:23Araqif (src.reserved and seqShallowFlag) != 0
10:29:35Araqis the test you want to be true but isn't
10:29:43Araqtry something like:
10:30:22Araqif (src.reserved and seqShallowFlag) != 0 or src.len > 6_000: # never copy long strings
10:30:38Araqas a hack and see if that improves the situation for your test program
10:30:42FromDiscord<eliezedeck> there are 2 of them ... I should I go to copyString or copyStringRC1?
10:30:48Araqto both
10:30:51FromDiscord<eliezedeck> ok
10:30:58Araqbbl lunch here
10:31:25*zacharycarter quit (Ping timeout: 265 seconds)
10:31:55FromDiscord<eliezedeck> @Araq Mazoto homana (a malagasy way to wish you courage in eating 🙂 )
10:32:11FromDiscord<eliezedeck> lunch also here, bbl too
10:32:31*waleee-cl joined #nim
10:32:55*krux02 joined #nim
10:45:46FromDiscord<eliezedeck> I have switched to the sample bug report file that I have reported, which uses 830MB RAM without any change ... when doing `if (src.reserved and seqShallowFlag) != 0 or src.len > 6_000:`, the memory usage dropped to 330 MB
10:47:42FromDiscord<eliezedeck> when just using `nkFastAsgn` and `--gc:markandsweep`, it dropped to 435MB
10:49:30FromDiscord<clyybber> @eliezedeck I think I have a different solution that doesn't require relying on compiler optimizations
10:49:38FromDiscord<eliezedeck> when (`nkFastAsgn` and `--gc:markandsweep`) and `if (src.reserved and seqShallowFlag) != 0 or src.len > 6_000` is used, it remains at 330MB
10:49:51FromDiscord<eliezedeck> I'm all ears
10:50:07FromDiscord<clyybber> Can you try using ```type rcstring = object
10:50:10FromDiscord<clyybber> damn
10:50:13FromDiscord<clyybber> hit enter too fast
10:50:18FromDiscord<eliezedeck> 🙂
10:50:27FromDiscord<clyybber> ```type rcstring = object
10:50:27FromDiscord<clyybber> s: string
10:50:27FromDiscord<clyybber> ```
10:50:42FromDiscord<clyybber> ```type rcstring = ref object
10:50:42FromDiscord<clyybber> s: string
10:50:42FromDiscord<clyybber> ```
10:51:00FromDiscord<clyybber> Can you try using this instead of string?
10:51:20FromDiscord<clyybber> string has value semantics by default in nim, so with this wrapping ref object you would get a refcounted string
10:51:59FromDiscord<clyybber> `type rcstring = ref string` maybe works too, but I'm not too sure the backend can already handle it 😄
10:52:10FromDiscord<eliezedeck> so, i should do a cast?
10:52:34FromDiscord<clyybber> Nope, do rcstring(s: yourstring)
10:52:43FromDiscord<clyybber> That should yield you a refcounted string
10:54:00FromDiscord<eliezedeck> and how do I pass it to the stdlib for use? buff.s ? but then, wouldn't that be the same thing?
10:54:15FromDiscord<clyybber> Yeah, it will not eliminate all copies
10:54:31FromDiscord<eliezedeck> https://play.nim-lang.org/#ix=2h80
10:54:50FromDiscord<clyybber> Oh, thanks. I didn't see your example yet
10:55:10FromDiscord<eliezedeck> I can eliminate copies right before the calls, but once it gets passed into the stdlib, I have no control of what it's doing anymore
10:55:15FromDiscord<clyybber> Yeah
10:55:26FromDiscord<clyybber> Are you certain the stdlib is the problem here though?
10:55:29FromDiscord<clyybber> And not async?
10:55:38FromDiscord<eliezedeck> no, I'm not sure
10:55:51Yardanicowell *technically* async is a part of stdlib :D
10:55:55FromDiscord<eliezedeck> Araq said it's the async, but what do I know
10:56:07FromDiscord<eliezedeck> yes
10:56:47FromDiscord<clyybber> Hmm, I'm gonna take a look at where those copies happen. One moment
10:57:01FromDiscord<eliezedeck> you can run the example yourself, I'm not experienced Nim developer, may be you could help
10:57:12FromDiscord<eliezedeck> that would be very helpful
10:58:17FromDiscord<eliezedeck> as I tried yesterday to find-out where the memory goes to, but I couldn't ... already tried -d:useMalloc, but no ... valgrind won't report anything meaning full or anything close... tried Xcode's Instruments this morning, not much thing either
10:58:51FromDiscord<clyybber> Yeah, valgrind is best for leaks, so not sure how it would help here
10:59:15FromDiscord<eliezedeck> valgrind --tool=massif
10:59:40FromDiscord<clyybber> Ah
10:59:59*narimiran quit (Ping timeout: 250 seconds)
11:00:32FromDiscord<eliezedeck> it is very unfortunate that valgrind didn't work
11:00:44Yardanicowell, maybe because ther weren't any leaks? :P
11:00:46FromDiscord<eliezedeck> it could have been a valuable tool for this
11:02:16FromDiscord<eliezedeck> @Yardanico if we consider that, then how can we explain 830MB resident memory being consumed? you could try the example yourself and you'll see ... and the thing is: I don't believe it's a leak, it's just that there are too many unnecessary copies of the original 100MB, passing from one proc to another, and so on
11:02:28Yardanicowell, valgrind doesn't detect "copies" and stuff like that
11:02:34YardanicoI'm not saying it's okay
11:02:42FromDiscord<eliezedeck> and yes, Xcode said it didn't have any leaks too
11:03:15FromDiscord<eliezedeck> yes, but valgrind --tool=massif is supposed to help in pin-pointing where are all the memories that were allocated coming from
11:03:27FromDiscord<eliezedeck> https://www.valgrind.org/docs/manual/ms-manual.html
11:04:40*zacharycarter joined #nim
11:08:40FromDiscord<clyybber> @eliezedeck if you remove the async annotation and use the non async httpclient what does the mem usage jump to?
11:09:27*zacharycarter quit (Ping timeout: 260 seconds)
11:10:23*liblq-dev joined #nim
11:11:45FromDiscord<clyybber> Araq: Do the "old" strings use refcounting?
11:12:08FromDiscord<eliezedeck> without async, the memory usage for that bug report is 101.2MB
11:12:30FromDiscord<clyybber> Ha, ok. So it really is async
11:12:30FromDiscord<eliezedeck> 830MB with async
11:12:35FromDiscord<clyybber> Ok, thank you
11:13:27*ryan_ joined #nim
11:13:41*ryan_ is now known as number_two
11:13:48*narimiran joined #nim
11:14:55FromDiscord<eliezedeck> if the string is immutable (shallow), it should not be copied, like, **at all** ... is that a wrong supposition?
11:16:04*number_one quit (Ping timeout: 265 seconds)
11:16:07FromDiscord<clyybber> Curious, whats the memory usage with gc:arc and without async?
11:17:23FromDiscord<eliezedeck> 101.1 MB
11:18:17FromDiscord<clyybber> And with async?
11:18:21FromDiscord<clyybber> 830 I assume
11:18:29FromDiscord<eliezedeck> yes
11:18:32FromDiscord<clyybber> Not more?
11:18:45FromDiscord<eliezedeck> a little bit more, may be
11:18:55FromDiscord<eliezedeck> hovers around that number
11:18:56FromDiscord<clyybber> Ok
11:19:37FromDiscord<eliezedeck> and I really didn't expect it to be so different
11:20:22FromDiscord<eliezedeck> bbl
11:21:06FromDiscord<clyybber> Ok, I'll investigate a bit in the meantime
11:26:33Araqclyybber: no implementation yet uses COW but I planned to play with it with ARC
11:27:01Araqbecause the new implementation is easier to tinker with
11:28:18FromDiscord<clyybber> Yeah definitely
11:31:40*Vladar joined #nim
11:34:05*PMunch quit (Quit: leaving)
11:39:57FromDiscord<clyybber> @eliezedeck Put a bunch of `echo getOccupiedMem()` s in there.
11:40:22FromDiscord<clyybber> The mem usage is spiking in the last 2 lines of `infeficientCopiesAllOver`
11:40:42*chemist69 quit (Ping timeout: 260 seconds)
11:41:20*chemist69 joined #nim
11:41:37FromDiscord<clyybber> @eliezedeck Can you try maybe patching asynchttpclient to take rcstrings instead of strings for the body?
11:41:48FromDiscord<clyybber> Just for testing for now.
11:42:06FromDiscord<clyybber> Just to test for now.
11:42:42*Vladar quit (Remote host closed the connection)
11:42:49FromDiscord<clyybber> @mratsim Hey, I was wondering if you have any fft implementation in laser?
11:43:04FromDiscord<mratsim> nop, but AFAIK xflywind has one
11:43:05*Vladar joined #nim
11:43:10FromDiscord<mratsim> otherwise just use fftw
11:43:17FromDiscord<clyybber> Ok, thanks!
11:44:54FromDiscord<mratsim> There are a couple of fft benchmarks in C for multithrading runtime as well
11:45:02FromDiscord<mratsim> so I wanted to do one for Weave
11:45:11FromDiscord<mratsim> for example: heather.cs.ucdavis.edu/~matloff/OpenMP/Examples/OmpSCR_v2.0/applications/c_FFT/c_fft.c
11:45:19FromDiscord<mratsim> and I remember seeing one super complex as well
11:46:09FromDiscord<mratsim> maybe this one: https://github.com/bsc-pm/bots/blob/master/omp-tasks/fft/fft.c
11:46:46FromDiscord<mratsim> I nope'd out of this one though
11:46:53FromDiscord<flywind> Hello, is it wise to use Natural everywhere instead of uint? For example function parameters, minus or plus and return type?
11:47:22FromDiscord<clyybber> Natural introduces range checks without -d:danger
11:47:24FromDiscord<mratsim> it's broken as soon as you want to use generics
11:47:41FromDiscord<mratsim> like "Natural or seq[Natural]" won't type check
11:48:15FromDiscord<mratsim> https://github.com/nim-lang/Nim/issues/9136 https://github.com/nim-lang/Nim/issues/7446
11:48:17disbotGenerics: type mismatch "SomeunsignedInt or Natural" ; snippet at 12https://play.nim-lang.org/#ix=2h98
11:48:18FromDiscord<mratsim> otherwise it works
11:48:48FromDiscord<clyybber> @flywind https://github.com/xflywind/scim/blob/master/src/scim/fft.nim#L146 What does this comment refer to?
11:52:50FromGitter<alehander92> stacktrace
11:52:57FromGitter<alehander92> with -d:danger: is it fast ?
11:53:07FromGitter<alehander92> or do we need libstacktrace?
11:54:00FromDiscord<flywind> It only supports when array length is 2 ^ N? I can't remeber.@clyybber
11:54:48FromDiscord<clyybber> Ok, thanks!
11:55:20FromDiscord<clyybber> @mratsim Do you know of a more up to date fftw wrapper than this one: https://github.com/ziotom78/nimfftw3 ?
11:59:15*dsrw joined #nim
12:02:03*dsrw quit (Client Quit)
12:02:20FromDiscord<flywind> I think this book is a great introduction to fft algorithms.
12:02:37FromDiscord<flywind> The electronic version of this book is available free of charge at http://www.jjj.de/fxt/#fxtbook, it is identical to the printed version.
12:03:21FromDiscord<flywind>
12:03:21FromDiscord<flywind> https://cdn.discordapp.com/attachments/371759389889003532/697416290339651674/fxtbook.pdf
12:03:48FromDiscord<clyybber> Thanks!
12:04:11FromDiscord<flywind> no problem.
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:46*supakeen joined #nim
12:07:56FromDiscord<clyybber> > radix-2 Cooley-Turkey algorithm: this algorithm can't handle transform of data which size is not a power of 2
12:08:11FromDiscord<clyybber> So thats the reason for the comment probably
12:09:31Araqmratsim: that has nothing to do with generics though, but with the "convertible" type relation
12:09:55Araqand you can always use 0.Natural much like you can use 0'u32
12:16:41*Guest51436 quit (Ping timeout: 250 seconds)
12:18:35*dadada joined #nim
12:18:59*dadada is now known as Guest16363
12:27:38FromDiscord<eliezedeck> > The mem usage is spiking in the last 2 lines of `infeficientCopiesAllOver`
12:27:38FromDiscord<eliezedeck> @clyybber yes, that's because that's where the interesting part of the program begins ... I'll try rcstring; is there something you think we should test by doing that? because I can `shallow randomBuff`, which I believe would have the same effect
12:28:04FromDiscord<eliezedeck> once it enters `HttpClient.send()`, the string becomes immutable, right?
12:35:33dom96Araq, can I get a review? #13919
12:35:34disbothttps://github.com/nim-lang/Nim/pull/13919 -- 3Fixes issues with dynamic loading OpenSSL. Fixes #13903.
12:39:03*endragor quit (Remote host closed the connection)
12:48:40Araqbummer
12:48:56Araqmy tool is smarter than me
12:49:34Araqah no it isn't
12:50:47FromDiscord<eliezedeck> @Araq: in `sysstr.nim`, is there anything that would indicate that the souce string is currently immutable?
12:50:56*sunwukong` joined #nim
12:50:59FromDiscord<eliezedeck> source*
12:56:41FromGitter<alehander92> Araq
12:56:48FromGitter<alehander92> `old` is an interesting annotation
12:58:03FromGitter<alehander92> can it apply to globals
12:58:49FromGitter<alehander92> and overally can globals be somehow used in require/ensure? probably impossible, (tho one can indeed count them as "invisible params" as clyybber says)
12:59:19*filcuc joined #nim
12:59:21Araqglobals don't cause any trouble
12:59:48FromGitter<alehander92> but can you say `global == old(globalVariable)`
13:00:07*filcuc quit (Client Quit)
13:00:09Araqnot yet, but in principle, yes
13:00:13FromGitter<alehander92> e.g. to ensure the function doesnt change this variable
13:00:18*zacharycarter joined #nim
13:00:23FromGitter<alehander92> ok
13:00:30FromGitter<alehander92> what did you decide about break/return etc
13:00:51Araqreturn is harmless, just check the .ensures holds
13:01:09Araqbreak needs some additional logic but seems to work too
13:01:38Araqyou need to combine the break condition with the condition of the loop
13:01:41Araqe.g.
13:01:49Araqwhile A:
13:01:50FromGitter<alehander92> so can it detect like dead code , or does the whole analysis happen after dce
13:01:54Araq if B: break
13:02:30Araq--> postcondition: not A or B
13:02:46FromGitter<alehander92> yeah, this makes sense, so basically it can detect some code would be never ran
13:03:02FromGitter<alehander92> and e.g. `list[list.len + 1]` is not an error after if true: break
13:04:34*sunwukong` left #nim ("Leaving")
13:06:50*sunwukong joined #nim
13:10:22*nsf quit (Quit: WeeChat 2.7)
13:14:11Araqmuhahah 'old' works :-)
13:19:04*zacharycarter quit (Quit: Lost terminal)
13:20:19*zacharycarter joined #nim
13:21:43zacharycartershashlick: is there an easy way to capture the output from what nimterop produces? I added a call to `cDebug` but if I pipe the output to my clipboard tool it doesn't copy it
13:21:55zacharycarterI want to compare the output of sokol with nimterop vs nimterop head
13:23:37*natrys quit (Ping timeout: 264 seconds)
13:26:46*dddddd joined #nim
13:35:31*natrys joined #nim
13:39:13FromDiscord<mratsim> is there a defined(danger)?
13:39:27FromDiscord<clyybber> Yeah!
13:39:32FromDiscord<clyybber> And its defined(danger)
13:39:34FromDiscord<clyybber> :p
13:51:16*sendai_ joined #nim
13:59:36shashlickThere's no cOutput yet
13:59:43shashlickBut cDebug works usually
13:59:49zacharycarterhmm
14:00:01zacharycarterI'll try to figure out how to capture it
14:03:49dom96yay, thanks for merge
14:04:33FromGitter<faulander> hi, nim newbie coming from python here. Ok, originally coming from assembler (6502) in mid 80ie, but that doesn't count. Looking forward to use Nim alot in the future. Just wanted to say hi and thanks for this cool language.
14:04:53FromGitter<kaushalmodi> @faulander The language and this community is awesome
14:04:56FromGitter<kaushalmodi> Welcome
14:05:41FromGitter<faulander> i am still struggling alot, but i'll find my way around. someone who was self-teaching assembler will get the hang of everything - will take a while though :)
14:05:44FromGitter<zetashift> Enjoy your stay faulander
14:06:10FromGitter<Vindaar> @faulander Welcome! Don't worry about asking questions, people are really nice around here
14:06:59zacharycarterwelcome!
14:07:07dom96hello faulander! Welcome :D
14:07:13FromGitter<faulander> i have a question indeed. i am using django for web projects alot - but i am not, and never will be a frontend guy. i read that Nim can be compiled to JS - so where would i start reading on it?
14:07:40FromGitter<mratsim> nim js yournimfile
14:07:53FromGitter<alehander92> or `nim -d:nodejs js yournimfile`
14:07:59FromGitter<alehander92> if you just try it in the terminal
14:08:23FromGitter<alehander92> `nim js` is the browser one tho
14:09:17livcdand there's karax
14:09:24livcdalthough I dislike how karax reads :/
14:09:43FromGitter<faulander> i hate c notation - so i would prefer python (or nim) notation to write my frontend code. Do i need to read up on something? how would i create dom manipulation in nim? That's what i meant when asking for a starting point, not how to compile it ;)
14:10:08FromGitter<alehander92> but this is important too
14:10:12zacharycartershashlick: https://gist.github.com/zacharycarter/52030f74296fc3662746b94ae1e87f70
14:10:26livcdfaulander: https://github.com/pragmagic/karax
14:10:27FromGitter<alehander92> yeah, you can use karax which does vdom diffing: something like what react/vue/similar do internally
14:10:39FromGitter<alehander92> you can also just call the normal browser dom API-s
14:10:44FromGitter<alehander92> or jquery or whatever you need
14:11:08zacharycarterthe jsffi module is a good one to get familiar with
14:11:23FromGitter<alehander92> you can look at `jsffi` and `js/dom` in stdlib indeed
14:11:28zacharycarterbut there's also this module https://nim-lang.org/docs/dom.html
14:11:35FromGitter<faulander> ok, i start reading jsffi and karax. thanks guys.
14:11:39zacharycarterthose are the two modules I'd check out
14:11:54livcdfaulander: check dom96's nimforum as a reference
14:12:02FromGitter<alehander92> and also note: you can use all kinds of 3rd party modules in two way: either dynamically with `JsObject` which you might need to cast on the boundary with normal nim typed code
14:12:05zacharycarterkarax is a library, not part of the stdlib - so you may want to check it out after you see what the dom and jsffi modules have to offer
14:12:10FromGitter<alehander92> or with annotating them with `importcpp`
14:12:44FromGitter<alehander92> we can port typescript definitions to nim types one day .. but the older tool that did it isnt maintained anymore :(
14:13:09livcdis Araq still working on knete?
14:13:09FromGitter<alehander92> and usually its easy enough to type the several functions you really need typed
14:13:26Araqlivcd: no but why?
14:13:26*qwertfisch quit (Read error: Connection reset by peer)
14:13:38FromGitter<faulander> imports made me already struggle, haha. Last time i was writing pascal or code like that was in school in early 90s. Of course i knew i have to create procs before calling them, but since i am so used to python where this is not necessary i forgot it and struggled an hour :)
14:13:42livcdAraq: because you said it will replace karax
14:13:46FromGitter<alehander92> something like svelte for nim might be interesting too
14:13:59Araqlivcd: I say many things
14:14:13zacharycartercan the modern web die already please?
14:14:56*qwertfisch joined #nim
14:14:58FromGitter<zetashift> @alehander92 isn't that really hard though? They use some tricks specifically tailored to the dynamic nature of JS I think
14:15:09FromGitter<alehander92> i am not sure honestly
14:15:11FromGitter<faulander> i would love to see a modern dreamweaver like tool which creates css and framework code. that would sell like cut bread.
14:15:14zacharycarterwould be cool to see someone build something like blazor with Nim
14:15:20FromGitter<alehander92> ahh are you talking for typescript sourcemaps
14:15:25FromGitter<alehander92> types*
14:15:39zacharycarterI started to make an attempt and then rapidly lost interest when I remembered how much I hate the web
14:15:51livcdzacharycarter: are you back in the states?
14:15:57zacharycarteryeah - in Austin now
14:16:05livcdcool!
14:16:20zacharycarteryup! just in time for quarantine!
14:16:39livcdDid you also find a new job?
14:16:48livcdsorry ...we an perhaps go to #nim-offtopic
14:18:03Araqzacharycarter: lol :-) +1 for hating the web
14:18:15FromGitter<zetashift> fwiw alehander92 I do think a no vdom solution for Nim would be nice, e.g. like svelte or this one: https://github.com/raquo/Laminar
14:18:18FromGitter<faulander> +1 from me to, atleast for fronted
14:19:11FromGitter<alehander92> maybe!
14:19:17Araqzetashift: karax has a vdom
14:19:25nisstyreI'm writing a window manager in Nim. If I want to support dynamically recompiling and reloading, all that's needed is to serialize my state somehow, recompile with nimble, then call execv on the freshly built executable. Does that sound right?
14:21:19Araqnot sure, for NimEdit I used the compiler as a library to make everything theme-able
14:21:47Araqand while nimEdit sucks big time, I never regretted using nimscript
14:21:47nisstyrethat might be a better idea
14:22:12shashlick@zacharycarter that's a working version?
14:22:34zacharycartershashlick: the file named `nimterop_sokol_master.txt` is the working one
14:23:00zacharycarterthe one named `nimterop_sokol_head.txt` is the one that is produced when I run with nimterop@#head
14:23:26zacharycarterboth of those are just from me running `nim c -r` on the wrapper file itself, not on my whole project
14:23:30FromGitter<sheerluck> sokol is falcon in Russian
14:23:44*kungtotte quit (Read error: Connection reset by peer)
14:23:45zacharycarterso they don't produce the SIGABRT I mentioned yesterday
14:24:05zacharycartersheerluck: yes it is
14:25:09*kungtotte joined #nim
14:26:17shashlickOk but still arc right?
14:26:53livcdsokol is falcon in slavic languages
14:28:25zacharycartershashlick: no no arc when I produced those
14:28:40zacharycarterI can produce the crash without involving arc
14:29:15zacharycarterlmk if you want the same thing but for the entire project - I can produce that as well
14:33:32shashlickwell, so you aren't seeing the failure without the entire project right?
14:34:34zacharycartershashlick: yes the runtime error occurs only when I run the entire project
14:34:42zacharycarterand only when I use nimterop@#head
14:35:38FromGitter<zetashift> @Araq I know, I ment that Svelte and Laminar don't use one( a VDOM), and that option would be nice to have in Nim too
14:35:44*sendai_ left #nim ("Leaving")
14:36:10shashlick@zacharycarter: can you share some minimal example I can reproduce here? do you get a stack trace or something i can debug
14:36:27FromGitter<zetashift> But I think Svelte offloads a lot of complexity to it's compiler too
14:36:56zacharycartershashlick: what OS are you using?
14:37:05*liblq-dev quit (Ping timeout: 250 seconds)
14:38:14shashlicki'm on linux but can debug on osx if needed
14:38:29Araqfwiw I don't want "reactive"ness anymore, it's complex stuff, had reactive seqs in Karax
14:39:10*liblq-dev joined #nim
14:39:48zacharycartershashlick: well the repo is up on github and currently works only on OSX. Give me a few moments though - looking at the files I produced and checking them against sokol.h and the stack trace I have.
14:40:07shashlickawesome - i can pull and run and see how it works here
14:41:28Araqbut yeah, I'd probably try to make 'Knete' more convenient
14:42:35zacharycartershashlick: https://github.com/zacharycarter/junkers - should just need to do `git submodule update --init --recursive` and then `nim c -r src/junkers.nim` from the project root
14:43:10disruptekfwiw, ic will probably do dce automagically.
14:43:34zacharycarterI'm wondering if it's being caused by - `sg_buffer_desc* {.importc: "struct sg_buffer_desc", header: headersokol_gfx, bycopy.} = object` in master vs `sg_buffer_desc* {.bycopy.} = object` on #head
14:45:34shashlickbut are you using -f:ast2 with #head or legacy
14:46:02shashlickoh ya, #head also has the optional {.header.} feature
14:46:21shashlickcan you try with the `-H` flag and see if it works
14:46:45*liblq-dev quit (Ping timeout: 258 seconds)
14:48:34*liblq-dev joined #nim
14:50:21zacharycartershashlick: sure where does the -H flag go? on `cImport`?
14:50:31zacharycarterand I'm not using `-f:ast2` yet in any of this
14:51:32shashlickya, just provide flags = "-H"
14:52:11shashlickbasically I added https://github.com/nimterop/nimterop/issues/169
14:52:11disbotSkip `{.header.}` generation
14:52:16zacharycarteryup that fixed it
14:52:38zacharycarternow let me try with ast2
14:52:50shashlickit's interesting - including the header fixes the issue but need to understand why
14:53:26zacharycartercan I do `flags = "-H -f:ast2"`?
14:53:34shashlickyes
14:53:38zacharycarterokay let me try that
14:53:40shashlickheader is opt in
14:53:57shashlickis this supposed to work on linux
14:54:04zacharycarterno not yet
14:54:11zacharycarteronly on macosx right now
14:56:40zacharycarterokay adding - `-f:ast2` to the flags for sokol works, but if I add it to the second library I'm using nimterop with: `physfs` I get an error
14:57:52zacharycarterand I can reproduce it without the entire project
14:58:13shashlicknice
14:58:37zacharycarterneed to go to a meeting but will be back after that
14:58:58shashlickcool
14:59:17*endragor joined #nim
15:03:54*couven92 joined #nim
15:04:16shashlickthe original issue without -H, is it failing at runtime?
15:04:44zacharycarteryup
15:05:01shashlickokay, need GUI so not running on SSH
15:06:27disruptek~stream
15:06:27disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
15:06:42disruptektoday we try to find a way around broken .loc in the ast.
15:07:01FromDiscord<Rika> Has anyone ever thought of adding namespaces to nim, or is there a better solution
15:08:33FromDiscord<Rika> Actually, I have to go, so I'll just ask it again or not some other time, please disregard
15:08:45*endragor quit (Remote host closed the connection)
15:08:58FromDiscord<Rika> Don't try pinging either, since you can't exactly ping from irc to discord, so yeah
15:09:02FromDiscord<Recruit_main707> ngl, i never got the point of namespaces
15:09:13AraqRika: modules have namespaces
15:09:23FromDiscord<Recruit_main707> @Rika
15:09:56FromDiscord<Recruit_main707> i tried :(
15:12:24FromGitter<faulander> can you point me to a resource on how to create a list of dict (python) or a linked list of tables (nim) (at least i know that already)
15:12:33FromDiscord<Rika> I mean like the namespace of C# where you can define a symbol for namespacing within a file
15:12:47FromDiscord<Rika> I really have to go now, I'll think this over later
15:12:54FromDiscord<Rika> It's prolly not needed in Nim
15:13:12FromDiscord<Rika> faulander: see the tables module
15:13:28FromDiscord<Rika> Then just wrap the Table type you want in a seq
15:13:40FromDiscord<Rika> I have to go (sleep, it's late)
15:13:45FromGitter<kaushalmodi> @faulander And list could be sequences (or arrays .. a bit unlikely) on how you implement in Nim
15:13:54FromDiscord<Recruit_main707> good night Rika
15:14:39FromGitter<faulander> @kaushalmodi i don't understand?
15:15:07FromGitter<faulander> so i create a list like a seq and append the table to it?
15:15:32FromGitter<kaushalmodi> In Nim, there are sequences and arrays.. check out https://narimiran.github.io/nim-basics/#_containers
15:15:47FromGitter<kaushalmodi> > so i create a list like a seq and append the table to it? ⏎ ⏎ Yes, you can create a seq of any type
15:16:21FromGitter<kaushalmodi> If you haven't already, check out https://play.nim-lang.org/
15:16:31FromDiscord<Rika> Python list == Nim seq
15:16:41FromDiscord<Rika> Python diff == Nim table
15:16:43FromGitter<kaushalmodi> first play with Nim tables there.. and then extend that to play with seqs of tables
15:16:48FromDiscord<Recruit_main707> u need to sleep
15:16:48FromGitter<faulander> and what is the type of the seq?
15:17:01FromDiscord<Rika> I don't know why I'm still here :)
15:17:15FromGitter<kaushalmodi> @faulander check out that nim-basics link
15:17:29FromGitter<kaushalmodi> you can have a seq of *any* type.. ints, floats, objs, tables, you name it
15:17:33FromGitter<faulander> @kaushalmodi will do, thanks. i know i am asking basics :(
15:19:20FromGitter<kaushalmodi> no worries; that's why I pointed you to a good resource
15:19:23FromGitter<faulander> i read the article. It states nowhere, what the type of the seq must be if it's tables.
15:20:02FromGitter<kaushalmodi> it will be of the `Table` type: https://nim-lang.github.io/Nim/tables#Table
15:20:13FromGitter<kaushalmodi> so, first play with the Table type
15:20:14FromGitter<faulander> that's what i wanted to hear :) thanks
15:20:48FromGitter<kaushalmodi> I built up some Nim notes over time.. here are some on tables: https://scripter.co/notes/nim/#tables
15:33:36FromGitter<faulander> Error: cannot instantiate 'Table[A, B]' inside of type definition: 'tradl'; Maybe generic arguments are missing?
15:33:52FromGitter<faulander> var possible_downloads: seq[Table] = @[]
15:35:52FromGitter<eagledot> This is my first time .Can i just ask a question directly?
15:35:55FromGitter<faulander> same error on the playground
15:36:44FromGitter<faulander> @eagledot if someone is still here? :)
15:36:56FromGitter<eagledot> yes. i am here.
15:37:10FromGitter<faulander> i meant, someone who can answer your question :)
15:37:24FromGitter<faulander> i presumely cannot - also newbie
15:37:44FromGitter<zetashift> You can just ask the question directly heh
15:37:54FromGitter<eagledot> Ok. Thanks
15:38:15FromGitter<eagledot> I am having a problem as raised in issue here. https://github.com/dom96/nim-opencv/issues/11#issue-595597351
15:38:41FromGitter<eagledot> I thought of asking here directly than waiting on github.
15:39:40dom96$ and then toSeq with 'cast' seems like you're asking for trouble :)
15:39:59dom96no idea what's in frame.imageData but have a look at how they do it in C and just translate that
15:40:18FromGitter<eagledot> I am a newbie to Nim donot know my way around much. :)
15:40:39FromGitter<faulander> me neither, stuck on soooo many basic problems - but its fun! :)
15:40:57*sunwukong quit (Quit: Leaving)
15:41:50FromGitter<eagledot> i have stated the problem more clearly here . https://forum.nim-lang.org/t/6163#38052
15:43:09FromGitter<eagledot> I have pointer (i.e cint type) for a camera frame. So the data size i think should be fixed for a frame?
15:43:37FromGitter<Vindaar> @faulander your error message says what's wrong. You need to specify the table, e.g. `Table[string, int]`, so `seq[Table[string, int]]` or whatever types your table should hold
15:44:09FromGitter<eagledot> @dom96 how to get data from a cint type into a sequence?
15:44:21FromGitter<zetashift> @faulander glad to know you're enjoying it
15:45:15dom96Firstly a `cint` is not a `pointer`
15:45:23dom96either the wrapper is incorrect or you're doing something wrong :)
15:45:43FromGitter<faulander> @Vindaar so if its 6 times string i do Table[string, string,string,string,string,string,]
15:45:58FromGitter<faulander> or Table[string:string, string:string ..]
15:45:59FromGitter<eagledot> @sorry my bad i wanted to say cstring as pointer not cint
15:46:11dom96I guess the frame data is an fixed size array? If so you can just cast[array[64, uint8]](myPointer)
15:46:31FromGitter<Vindaar> @faulander no, a Table holds keys of one type (the first arg in `Table[arg1, arg2]`) and has values for each such key of type `arg2`.
15:46:58FromGitter<Vindaar> The table doesn't care how many elements it has to hold
15:47:01FromGitter<faulander> aaah, yes. of course. so its key:value pairs, dumb me. so its string, string
15:47:36FromGitter<Vindaar> and your `seq` of tables is only required if for some reason you actually need several Tables of course
15:47:50FromGitter<eagledot> It defines it as imageData*: cstring # Pointer to aligned image data.
15:48:36FromGitter<eagledot> @dom96 So i can directly cast imageData as array[64,uint8]
15:48:53FromGitter<faulander> yes, i have a table with 2 key:value pairs and a seq of many of these tables, its a small downloader for internal use. the table holds filename:filename, url:url and the seq is a list of these
15:49:08dom96eagledot: if that is what the C code examples do, then yes
15:51:05FromGitter<eagledot> @dom96 i meant to ask if a variable is of type cstring. Then would it mean it is a pointer to an array of bytes/characters ?
15:51:06FromGitter<Vindaar> @faulander ah, I see!
15:51:27FromGitter<faulander> @Vindaar it works, thank you so much!
15:51:33FromGitter<Vindaar> you're welcome!
15:51:37dom96eagledot: sometimes, it can be anything really
15:52:39dom96assuming that the wrapper is correct though, it is an array and likely contains bytes, yes.
15:54:39FromGitter<eagledot> @dom96 Your nim-opencv code works fine. and it returns a reference to type i put here. https://forum.nim-lang.org/t/6163#38052 . Can u take a look?
15:54:55zacharycartershashlick: back - sorry that meeting was long
15:55:22shashlickNo worries, I'm meetings myself
15:55:47*Trustable joined #nim
15:56:01shashlickHow much of sokol are you using in your code
16:05:44*couven92 quit (Quit: Client Disconnecting)
16:07:25FromGitter<eagledot> @dom96 Sorry you were right .It was foolish of me first casting `cstring` to string using `$` .Direct casting to
16:10:26FromGitter<eagledot> @dom96 As i gather casting to desired type generally using `cast[T]` works basede on T .It is heavily overloaded proc right??
16:14:46ryukopostinghow efficient is iteration over key-value pairs in a table? Say, versus iteration over just the keys, just the values, or a seq
16:14:56Yardanico@eagledot "cast" is not "type conversion"
16:15:02Yardanicoit's literal casting with same memory representation
16:15:17Yardanicoyou usually only use it when doing FFI or some low-level stuff
16:15:30FromDiscord<mratsim> key should be efficient, values and key-values should be same speed and slower because there is a need to dereference
16:16:22FromGitter<eagledot> @Yardanico Can u tell me a more about `cast ` operation. I am generally confused.
16:16:33Yardanicohttps://nim-lang.org/docs/tut2.html#object-oriented-programming-type-conversions
16:16:42ryukopostingthanks mratsim. Was just curious. Chroma uses tables to store the objects representing each UI element, character, dialogue, etc declared by the user, and there are many places where it has to iterate over those tables.
16:17:23Yardanico"cast" is not really implemented as a normal procedure, it's a compiler magic
16:17:52ryukopostingTrying to figure out why it occasionally has a weird performance hiccup.
16:17:57Yardanicoyou can "cast" any type to any type, but it's an unsafe operation so you can get crashes and all sorts of interesting stuff ;)
16:18:25FromDiscord<mratsim> cast does that conversion just for integer/floats but that's likely inherited from history, now it's really a reinterpretation of the memory layout for everything else
16:19:00FromDiscord<mratsim> @ryukoposting, if you search for hash or table and performance on the github there are several threads
16:19:08ryukopostingyup, cast[T](x) is exactly like doing (T)x in C. Just gives you a variable at the same place in memory with a different type. Very useful for interfacing with C libraries, very dangerous otherwise
16:19:19FromDiscord<mratsim> many were addressed but had other corner case perf issues
16:19:31FromGitter<eagledot> @Yardanico Thanks for explanation.I wanted to know that i can get different results based on what i cast ?
16:20:04Yardanicowhat do you mean?
16:20:22Yardanicowell, if you do something like casting a int to a pointer and try to dereference it...
16:20:38Yardanico!eval echo cast[ptr string](123123)[]
16:20:38ryukopostingembedded guys be like
16:20:41NimBotTraceback (most recent call last)↵/usercode/in.nim(1) in↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)
16:21:05FromGitter<eagledot> like if i cast a `cstring` to int and if i cast the `cstring` to an array[64,uint8]
16:22:05FromDiscord<Chiqqum_Ngbata> How to accomplish https://play.nim-lang.org/#ix=2heZ
16:23:16FromDiscord<mratsim> you can directly cast the cstring to arra[64, byte]
16:23:36ryukopostingChiqqum_Ngbata looking at your code rn, one moment
16:23:44FromDiscord<mratsim> fn should be untyped
16:23:57FromDiscord<mratsim> in the macro
16:24:35ryukopostinghaven't touched pragma macros much, so trying to read this is making me dizzy
16:24:42FromGitter<eagledot> @mratsim Ok Earlier i tried to first cast it using $ and then to a sequence.It gave weird results.
16:25:11FromDiscord<mratsim> don't cast to GC-ed type unless you now the internal representation of set:string
16:25:54FromDiscord<mratsim> I thought I had a forum post or Nim issue with lots of example of macro as pragma mmm :/
16:26:14FromDiscord<Chiqqum_Ngbata> That errs @mratsim https://play.nim-lang.org/#ix=2hf9
16:26:19FromDiscord<mratsim> ah yes: https://forum.nim-lang.org/t/5450
16:26:48FromDiscord<mratsim> see the second version: https://forum.nim-lang.org/t/5450#34078
16:27:04zacharycartershashlick: I'm using sokol_gfx and sokol_app atm
16:27:19FromGitter<eagledot> @mratsim Ok,So i know the exact data type like `T= array[64,uint8]` I just use casting as `cast[T](x)` while interfacing with C libraries?
16:27:22zacharycarterbut will eventually be using some more of the modules i imagine
16:28:48FromDiscord<Chiqqum_Ngbata> I don't think I've seen an example that does what I want. Is it actually possible for the pragma macro to return a non-function
16:29:36FromDiscord<mratsim> @eagledot, you can directly use array[64,uint8] in your wrapper signature
16:30:32FromDiscord<mratsim> @Chiqqum_Ngbata yes
16:30:50FromDiscord<mratsim> if you modify the runHook macro in my example
16:30:55FromDiscord<mratsim> you can make it return anything
16:31:15FromDiscord<mratsim> it's just an AST transformation and the last argument gets passed the proc declaration
16:31:48*Trustable quit (Remote host closed the connection)
16:32:11FromDiscord<mratsim> use the example and put some "toStrLit" on some of the AST node, it should be simple enough
16:33:03FromDiscord<Chiqqum_Ngbata> Is there an obvious reason why this minimal example does not work https://paste.ofcode.org/YzB78fSG2AwgfcqgZdKfqf
16:35:31*Trustable joined #nim
16:41:46FromDiscord<Recruit_main707> how did i initialise a result sequence?
16:42:21Yardaniconim seqs are initialized by default since 0.20 or something like that
16:42:24Yardanicosame for strings
16:42:37Yardanicoif you still want to do it explicitly, "result = @[]"
16:42:56FromDiscord<Recruit_main707> yep, i was doing something else wrog, thanks anyway
16:43:19YardanicoAlso, does anyone know what's the best way to implement thread timeouts?
16:44:01Yardanicoso that for example I can stop all threads which execute for longer than 10 seconds
16:44:07Yardanicowhile having a lot of threads running simultaneously
16:56:05shashlick@zacharycarter awesome cause just wrapping doesn't mean much, need to use the generated procs too so glad I can test with your code base
16:56:21shashlickWill do the same with lqdev's rapid as well
16:58:18*lritter joined #nim
16:58:31zacharycarternice!
17:00:21FromGitter<dumjyl> Chiqqum_Ngbata: you can't use an nnkProc as an nnkLambda, you need to transform it: https://play.nim-lang.org/#ix=2hfr
17:05:13FromDiscord<Chiqqum_Ngbata> Oh, right. This makes sense
17:05:16FromDiscord<Chiqqum_Ngbata> Thanks
17:09:01*Guest16363 is now known as dadada
17:09:28dadadahi
17:21:40dadadamaybe you guys can appreciate some Miles Davis https://www.youtube.com/watch?v=OcIiu1kQMx0
17:22:32companion_cubethat's a good idea
17:24:52companion_cubedadada: https://www.youtube.com/watch?v=YYTIXJuxvgY
17:27:40*dongbei joined #nim
17:29:04dongbeigood day, I was reading about arc and then I watched this vid on the different memory management models https://youtu.be/yA32Wxl59wo?t=20m43s
17:29:24dongbeiat that time in the video rumpf talks about object pools
17:29:40dongbeiI don't understand what he's explaining
17:29:54dongbeidoes that have anything to do with arc and how can I use it?
17:30:33dadadarumpf is Araq here
17:30:37dongbeiyah
17:30:41dongbeiok so Araq
17:30:52dongbeisorry
17:31:18dadadano need to be sorry
17:31:41FromGitter<yglukhov> Hey guys, how do I make an object outlive NimMain with --gc:arc. Or better - all objects.
17:32:14FromGitter<yglukhov> A global variable that is
17:33:07leorizeI thought global vars are not destroyed?
17:34:04leorizebut what would be the use case for outliving NimMain? doesn't that basically mean that your program continues to run after it exits?
17:34:27FromGitter<yglukhov> I thought so too, but apparently gdb shows `eqdestroy___Zdkyao3Rp9cTCBDO7vWqjWw` for a global var at the end of `NimMainModule`
17:34:55FromGitter<yglukhov> It makes sense for a library.
17:35:11Araqhmm well it's a feature
17:35:22leorizedongbei: it's a specialized scheme of memory management
17:35:40leorizebasically you allocate a large pool with enough space for all of your objects
17:35:46Araqmakes no sense to me, but it's a feature
17:35:48leorizesay, a big seq[T]
17:36:38leorizewhen you "free" an object, just basically mark the space as empty and re use it later
17:36:54leorizesave you the time spent allocating and deallocating memory
17:37:42leorize@yglukhov: that sounds like a bug then
17:38:11Araqyglukhov: tried --noMain ?
17:38:34leorizeglobal vars shouldn't be destroyed in a shared lib because we don't know when the program that use it quits
17:38:44FromGitter<yglukhov> Araq: so I'm using this pattern a lot. for nimpy, for emacs, for android and emscripten apps. It basically goes like this. NimMain is called first to initilialize and execute global scope, setup callbacks etc. then other exported functions are called and they kinda may rely on the global vars.
17:38:58leorizeAraq: --noMain just disable to auto initializer
17:39:07leorizeNimMain is still there
17:40:17FromDiscord<Recruit_main707> can you convert a sequence into an array?
17:40:17FromGitter<yglukhov> Araq: noMain would not help, as i still need to execute main. If I do noMain and run main manually I bet I would still see the same result
17:40:53leorize@Recruit_main707: yes
17:41:06leorizenot that I'd recommend it :P
17:41:10FromDiscord<Recruit_main707> how would that be done?
17:41:42leorizea for loop copying/moving all elements over :P
17:42:18FromGitter<yglukhov> Araq: as a counterstatement,I see no sense in destroying global vars in NimMain in app:lib mode :)
17:43:02*tane_ joined #nim
17:43:09FromGitter<yglukhov> Why would anyone call _dllmain if it can't setup the global state
17:45:41Araqsure, consider it fixed
17:46:33FromGitter<yglukhov> Wow, really? That was easy. Thanks :)
17:47:36FromDiscord<Recruit_main707> `seqToArray*(aseq: seq[(Vector3, float)]): array[aseq.len, Vector3]` how would i do something like this?
17:47:44leorizeyou can't
17:47:54leorizearrays are statically-sized
17:48:01FromDiscord<Recruit_main707> passing the length as another argument?
17:48:22*sleepyqt quit (Ping timeout: 256 seconds)
17:48:26FromGitter<zetashift> I think you'd need an other data structure for that as leorize says arrays need to know their size
17:48:36leorizeif you want a variable sized array it's a seq :P
17:48:59FromDiscord<Recruit_main707> ill try something else then
17:52:02*tribly quit (Quit: WeeChat 2.7.1)
17:52:35FromGitter<yglukhov> Araq: same goes for staticLib I think.
17:53:04leorizeto be fair we might need a nimrtl for static libs :P
17:53:41leorizenim's handling of static libs is kinda useless atm
17:54:20companion_cubeyou mean it's ahrd to statically link?
17:54:28companion_cubeto build a statically linked binary*
17:55:39leorizeno, the static lib created by nim is well, not the best
17:56:35stefantalpalaruIt can be done: https://github.com/status-im/nimbus/blob/927a5f3afeee05e82557f1070cd4ee3e1b69ec7f/Makefile#L129
17:57:04leorizebasically you will have a "fat" static lib
17:57:14stefantalpalaruHere it's being used from C and Go: https://github.com/status-im/nimbus/blob/927a5f3afeee05e82557f1070cd4ee3e1b69ec7f/Makefile#L147
17:57:54leorizeNim don't split functions into smaller objects (it's hard anyway), so you are certain to have a "fat" static lib that increase the binary size by a ton when linked
17:58:28FromGitter<yglukhov> leorize: for android i'm actually produce a staticlib with nim, which is later fed to gradle.
17:58:46leorizenot to mention because of the stdlib, you can't link two static objects into a binary because of symbol clashing between them
17:58:53leorizethough libnimrtl can be used to mandate this
17:58:57leorizebut NimMain will still clash
18:01:04*tribly joined #nim
18:01:10*tribly quit (Changing host)
18:01:10*tribly joined #nim
18:04:40companion_cubeleorize: ah ok, I was just wondering about producing one statically linked *binary*, not a lib
18:04:46companion_cubesomething easy to copy on other machines
18:05:15leorizeah, that part is simple, if you're using musl libc :)
18:05:34companion_cube✔ cool.
18:05:56*natrys quit (Ping timeout: 265 seconds)
18:14:05*rockcavera joined #nim
18:18:59*natrys joined #nim
18:24:17*Zectbumo joined #nim
18:25:46FromGitter<kaushalmodi> companion_cube: https://scripter.co/nim-deploying-static-binaries/
18:26:28FromGitter<kaushalmodi> That blog post and the technique described there came to fruition thanks to a lot of help from leorize and folks in this Gitter/IRC
18:26:47companion_cubethank you 😊
18:29:03companion_cubenimble.directory doesn't list the dependencies of a package, that's strange
18:29:56leorize@kaushalmodi: zig cc support has been merged :) maybe time to revisit that post?
18:32:01FromGitter<kaushalmodi> yes I know.. I am staying away from another rabbit hole
18:32:22FromGitter<kaushalmodi> *if it's working, don't touch it right now*
18:34:24YardanicoI've also had success with https://github.com/richfelker/musl-cross-make
18:34:32Yardanicofor building a cross-compiling toolchain
18:34:39Yardanicoand then manually building libressl with it and then a nim app :P
18:34:45Yardanico(statically of course0
18:37:49kungtotteAm I misunderstanding what "side effect" means in Nim, or does func/noSideEffect not work? I'm able to modify external values passed in without a single complaint from the compiler. It picks up on things like using I/O though. Is that the only side effect that Nim is concerned about?
18:38:18FromDiscord<Rika> Side effects mean anything not accessible by params
18:38:34FromDiscord<Rika> Var params can still be edited with no issue
18:39:04FromDiscord<Rika> YES I KNOW ITS BEEN 3 HOURS SINCE I SAID I'LL SLEEP
18:39:22leorizeI didn't even notice :)
18:39:43leorizekungtotte: Nim's idea of "side effect" is no where near FP's "pure" definition
18:40:00narimirankungtotte: yes, you are misunderstanding what it means in nim :)
18:40:20kungtotteYeah I can tell :D
18:40:29FromDiscord<Rika> Why are they different though I wonder
18:41:06leorizebecause Nim's idea is much more practical :p
18:41:15kungtotteIt's not named well in my opinion. CS and pretty much every other programming language (FP or not) has mostly the same idea about what "side effect" means, so Nim using it to mean something different is for sure a gotcha!
18:41:49solitudesfbut its not a side effect, you clearly annotate parameter with `var`
18:42:20FromDiscord<Rika> That is true, all params in fp are immut aren't they
18:42:35leorize"in theory"
18:44:10leorizeI'd say that Nim's version of noSideEffect is much more practical than the FP version
18:44:29FromDiscord<Rika> You said that already
18:44:35leorizewe should clarify this pragma in bold so people stop being confused :P
18:46:50FromGitter<iffy> @krux02 I'm interested to know your qualitative opinion about what it's like to use https://github.com/arnetheduck/nim-result throughout a project. Do you like how things end up when using it? Or do you miss try/except at all? Does the code seem better or too cluttered?
18:47:19leorizenot krux but I use both that and exceptions in the same project
18:48:03narimiran@iffy that Arne is not the Arne you mentioned :P
18:48:26FromGitter<iffy> oh, oops
18:49:01leorize@arnetheduck is the one you're looking for
18:49:42FromGitter<iffy> Thanks -- and now I know there are 2+ Arne's in the community :)
18:50:18leorizeI'd say that nim-result works well when you have to handle all of the errors (ie. interfacing to C, or a proc used on the public interface of your web server)
18:51:06leorizeotherwise I like exceptions more, since stacktraces are a killer feature :)
18:54:00FromDiscord<Rika> I only use a result when there is explicitly a value of none for the field, like an "optional" field or so
18:54:01FromGitter<iffy> Right... I didn't consider the absence of stack traces. The forced handling of errors is what's making me consider it.
18:54:18FromDiscord<Rika> In where the optionality isn't defined by a kind
18:54:51leorize@iffy: if forced handling is something you desire, then nim-result is what you want
18:54:55FromDiscord<Recruit_main707> i dont know what scares me more, that you havent slept yet, or that you have already woken up
18:55:15leorizebut the moment you found yourself using the `?` operator too much, I'd say exceptions is what you want
18:55:23FromDiscord<Rika> I haven't slept :P
18:55:54FromDiscord<Recruit_main707> u should :)
18:56:13Yardanico@Rika is nim chat that interesting? 🤔
18:56:46YardanicoI should probably sleep too, I've been awake for like 18 hours at least
18:57:07*NimBot joined #nim
18:58:51*Prestige joined #nim
19:01:47FromDiscord<Rika> No, I'm thinking that I'm just deprived of programming
19:05:15leorizeyou can take Yardanico and make it work without having to restart every 8 hours or so
19:06:24leorizeYardanico's bot*
19:06:26leorize:P
19:06:30leorizethe discord bridge
19:07:17FromDiscord<Recruit_main707> what kind of float is "inf"??
19:07:22Yardanicoinfinity
19:07:33Yardanico
19:07:40FromDiscord<Recruit_main707> that would also explain the overflow
19:08:33Yardanicowell, about the bot - it seems that "irc" nim module is really stable, but the discord part is much more meh (they are very "modern" and use stuff like websockets)
19:08:48Yardanicowell it might be the discordnim's fault, i'm not sure
19:11:27leorizeI'd be worried if irc module is not stable :P
19:12:17Yardanicoalso sad to say but matterbridge is really stable too
19:12:44leorizeit might be that the web server disconnects after `n` packets or so
19:12:52leorizeso you just have to reconnect when that happens
19:13:30*uvegbot joined #nim
19:13:32companion_cubehaven't looked, does `irc` auto-reconnect? I saw it supports TLS, whcih is already more than most IRC libraries in other langs
19:13:44FromDiscord<Rika> leorize: I have been trying already for a few months
19:13:55leorizecompanion_cube: I guess it does
19:14:02leorizeit's the backbone of NimBot and disbot
19:14:19leorizeand they almost never disconnects
19:14:40FromDiscord<Rika> I have a feeling I know pinpoint the issue with discordnim but haven't gone into it yet
19:14:41companion_cubeyeah that's quite neat
19:14:51Yardanicoi'm embarrased to say that the current running version of matterbridge in this channel is from march 2018 :D
19:15:01Yardanicomaybe I should finish ircord
19:15:04Yardanicowith @Rika
19:15:07FromDiscord<Rika> Basically I think it doesn't handle disconnected websockets that well
19:15:30FromDiscord<Rika> Oh, no, my code changes are insanely radical
19:15:34*zyklon quit (Ping timeout: 240 seconds)
19:15:35Yardanicothat's for the best
19:15:48FromDiscord<Rika> I made a God macro for the objects...
19:15:53Yardanicoircord doesn't need a lot of advanced discord functionality anyway
19:16:13FromDiscord<Rika> I'll have to refactor that macro
19:16:42FromDiscord<Rika> It's 3 am
19:16:45Yardanicoalso seems like "ircord" is used by at least 5 other projects on github which do irc <-> discord, because I'm very good at naming projects
19:16:47Yardanico22:16 here
19:16:56FromDiscord<Rika> I should have slept 6 or 7 hours ago
19:17:35FromDiscord<Rika> I just name my bots with some anime or Japanese game character name
19:19:45Yardanicowell I've only watched ~200 anime but I guess I should do the same as you
19:21:36*dongbei quit (Read error: Connection reset by peer)
19:23:50FromDiscord<Rika> I mean, if you want to do so sure
19:23:55FromDiscord<Rika> I'm just saying what I do
19:24:03FromDiscord<Rika> Also 200 is a lot
19:24:12FromDiscord<Rika> I think I only number at a hundred
19:24:21FromDiscord<Rika> Though I do number at 600 manga
19:25:16FromDiscord<mratsim> 200 x 26 episodes x 20 minutes --> 72 days 24/7 of watching animes?
19:26:02FromDiscord<Rika> Most anime have one cour, that is to say, 13 or 12 episodes
19:26:33FromDiscord<Rika> Some people don't skip openings and endings, which makes an episode 24 minutes
19:39:44*al1ranger joined #nim
19:40:57*dddddd_ joined #nim
19:42:54*dddddd quit (Ping timeout: 240 seconds)
19:43:01*dddddd_ is now known as dddddd
19:44:39dadadaRika: what's a god macro?=
19:49:24*Tyresc joined #nim
19:51:28FromDiscord<mratsim> `macro worship(altar: untyped): untyped = discard`
19:52:00dadadaheh
19:52:15FromDiscord<mratsim> But I suppose it's similar to a god object in OOP
19:52:32FromDiscord<mratsim> A macro that does everything including the coffee and the kitchen sink
19:54:31dadadawhat's a devil macro?
19:56:26FromDiscord<clyybber> the same
19:58:28dadadaso god and the devil are one? :-)
19:59:40dadadajust found the naming funny
20:01:47*dongbei joined #nim
20:07:20supakeenI sometimes see procs with a signature such as `proc foo(value: var Something)`. What does the var denote here?
20:07:30supakeen(it's a bit of a difficult searchterm)
20:07:49dadadasupakeen: mutability
20:07:54FromDiscord<clyybber> It denotes that its a mutable parameter
20:07:59solitudesfhttps://nim-lang.org/docs/tut1.html#procedures-parameters
20:10:44supakeenAha.
20:11:09supakeenSo that implies that functions like this: https://nim-lang.org/docs/bitops.html#setMask%2CT%2CT will mutate their argument instead of returning a new value?
20:12:11*al1ranger quit (Quit: Leaving)
20:13:32solitudesfyes. lack of return type also implies that.
20:13:33leorizeAraq: resolved all conflicts in #13201
20:13:35disbothttps://github.com/nim-lang/Nim/pull/13201 -- 3Make file descriptors from stdlib non-inheritable by default
20:14:01leorizesolitudesf: that could be parsed in the wrong way :P
20:15:32supakeensolitudesf: Thanks for the explanation, I guess the 'returns' text in the docstring confused me :)
20:23:19*disruptek quit (Ping timeout: 250 seconds)
20:24:03*disbot quit (Ping timeout: 256 seconds)
20:24:41*Zectbumo quit (Remote host closed the connection)
20:29:02*narimiran quit (Quit: leaving)
20:39:34*Vladar quit (Quit: Leaving)
20:48:34companion_cubehmm I'm surprised, the stdlib doesn't have zlib bindings
20:51:34FromGitter<awr1> i think it used to
20:51:35leorizebindings are only in the stdlib because it's used somewhere in there
20:51:45leorizeif it's not then it won't be in the stdlib
20:51:55FromGitter<awr1> https://github.com/nim-lang/zip
20:52:03FromGitter<awr1> https://github.com/nim-lang/zip/blob/master/zip/zlib.nim
20:52:08companion_cubeare the DB bindings used in the compiler then?
20:52:23FromGitter<awr1> the compiler uses sqlite
20:52:57leorizecompanion_cube: the stdlib provides db_* abstractions
20:53:20companion_cubeyeah that's why I ask, I'm surprised
20:53:27companion_cubeanyway, thanks for the answer. It makes sens
20:53:29companion_cubee
20:53:34leorizethe stdlib used to be a kitchen sink
20:53:55leorizewe kinda slim it down and cut parts that no one use into packages
20:54:34PrestigeWas looking at this comparison of nim vs typescript https://github.com/nim-lang/Nim/wiki/Nim-for-TypeScript-Programmers#comparison does it say typescript code is formatted with npm? O.o
20:57:19Yardanicoask @juancarlospaco :P
20:57:38Yardanicomaybe he meant that it's a package that needs to be installed via npm
20:58:46Prestigenim looks so nice, going to start using this for everything
21:00:22*dwdv quit (Quit: quit)
21:08:06FromDiscord<arnetheduck> @iffy see for yourself: https://github.com/status-im/nim-eth/pull/211/files#diff-1428a55e5654ff6e85a6177d4f6101afR343 - like others have said, exceptions work best if you don't care about errors and can crash (which is the only time you need a call stack, if you think about it)
21:08:23ryukopostingwhat does it mean if the compiler is saying "export only allowed at the top level" but there's no exports in the module it's complaining about
21:10:37leorizeit means that you might spot an export marker `*` somewhere that's not the top-level
21:11:21ryukoposting... is that it
21:11:32ryukopostingI've spent 2 hours rearranging imports trying to make the damn thing work
21:11:47FromDiscord<arnetheduck> from a pragmatic point of view - in our medium-sized application, the parts of our codebase that don't use exceptions are also the ones that turn out to be the most solid / have the fewest bugs
21:13:51leorizethough beware that there might be some hidden bias in play
21:14:36FromDiscord<Varriount> @arnetheduck Personally, I don't mind either style (C-style errors or C++-like exceptions). What I do mind is the fact that it is generally harder to get stack traces when using C-style errors.
21:14:56leorize+1
21:15:22FromDiscord<arnetheduck> yeah, but when do you need stack traces? predominantly when you're not handling errors
21:15:40FromDiscord<arnetheduck> that's the point kind of -they're great in a script that you're iterating on
21:15:49leorizeI spent hours pin pointing where an error was coming from Haiku code base because they have a strict no-exceptions policy
21:15:55FromDiscord<Varriount> When I'm debugging? When the system is throwing an exception that I haven't anticipted.
21:16:26dom96Varriount++
21:16:49FromDiscord<Varriount> With errors, there's then the temptation to add logging before returning each error... and suddenly you get 100 line pseudo-tracebacks that are horrid to read. And you have logging logic in places that shouldn't have logging logic.
21:17:50leorizearnetheduck: I don't think it's too hard to have nim-result gather stacktrace
21:18:10FromDiscord<arnetheduck> there's a bias in our issue tracker, that's for sure 🙂
21:18:25FromDiscord<Varriount> arnetheduck: That being said, errors in Nim are much more easily handled.
21:18:42FromDiscord<arnetheduck> leorize: https://github.com/arnetheduck/nim-result/blob/master/result.nim#L344
21:18:45FromDiscord<Varriount> You can have templates that do the stock "if err != nil: return" for you.
21:19:05FromDiscord<Varriount> (or is that too much implicit flow control)
21:19:11dom96<leorize> @iffy: if forced handling is something you desire, then nim-result is what you want
21:19:12FromDiscord<arnetheduck> Varriount: https://github.com/arnetheduck/nim-result/blob/master/result.nim#L516
21:19:18dom96That's wrong, you can also use Nim's exception tracking
21:19:25leorize@arnetheduck: I mean hidden bias in terms of "this part is more carefully crafted since it's mission critical", and so on
21:19:57FromDiscord<Varriount> @arnetheduck Yep. That get's rid of 50% of my concerns.
21:20:25FromDiscord<Varriount> I'll say that trying to determine whether an error should collect a stack trace or not is tricky...
21:20:27leorizeI don't like comparing error handling schemes unless you have two similar projects going with two different schemes
21:20:49FromDiscord<Varriount> leorize: I'll soon have that, once my port of Go's filepath module is complete.
21:21:13leorizeotherwise there's a lot more to factor in than just "it doesn't use exceptions and it has less bugs"
21:21:16FromDiscord<Varriount> I have a nearly-semantically-correct version, if not a functional one that I can post.
21:21:29leorizesure :) that'd be great
21:22:06FromDiscord<Varriount> https://gist.github.com/Varriount/65a91d2d74baba4d9ec25a173d31e945
21:22:36leorizedom96: that works, but when you want forced forced it's different :P
21:22:44leorizeevery scheme has it's own use case
21:22:50dom96forced forced?
21:22:56dom96what does that mean? :)
21:23:26leorizeI'm making an UI, and I want pretty errors :)
21:24:23FromDiscord<Varriount> leorize: I also posted the Python file used to do the initial syntactic transformation
21:24:29leorizesure I can use a custom exception handing scheme, but at that point it just look like I'm using `try` in place of `if`
21:25:07FromDiscord<Varriount> It would be interesting to see a compiler plugin that converted possible exceptions to error return values.
21:26:13dom96FWIW I think we should have a Result[T, E] type in the stdlib. But I doubt I'd personally adopt it as much as I have adopted Option[T]
21:26:40FromDiscord<arnetheduck> exceptions have it in their name that they're good for exceptional situations - that's also when you want to have a call stack - for errors that you intend to actually handle, it's a tremendous waste
21:27:07leorizea call stack is also useful while debugging fwiw
21:27:24FromDiscord<arnetheduck> here's a funny thing: `type Option[T] = Result[T, void]`
21:27:37FromDiscord<Varriount> Hm, is it theoretically possible for a compiler to determine code paths in which an exception is handled, and "turn off" stack traces for those situations?
21:28:02leorizethe problem I have in C: I got an EACCES, I display to the user "Access not granted"
21:28:19leorizenow when I'm debugging, where does that EACCES came from?
21:28:46leorizeI don't know, since it's forwarded from god knows where
21:29:07leorizethat's my biggest issue with the Result scheme
21:29:24FromDiscord<arnetheduck> you're using it wrong if you're letting that bubble up the abstractions though
21:29:43FromDiscord<arnetheduck> but whatever, each scheme has its benefits
21:30:30leorizeit's the case in C, sadly
21:30:41leorizethey don't have exceptions so they went with this poor man's scheme
21:31:41leorize@arnetheduck: do you think having "optional" stack trace support (like -d:resultStackTrace) would be useful?
21:32:28FromDiscord<arnetheduck> not reallly - I don't believe global defines are ever a good idea beyond toy projects
21:32:33FromDiscord<arnetheduck> not really - I don't believe global defines are ever a good idea beyond toy projects
21:32:49FromDiscord<arnetheduck> and toy projects are easy enough to reason about without that kind of crufty
21:32:51FromDiscord<arnetheduck> and toy projects are easy enough to reason about without that kind of cruft
21:32:58dom96Here is the problem with the Result scheme, you have to handle the results explicitly. Then you either end up with Go (simplicity so you just copy and paste `if (err, res) ...` everywhere, or you get more and more complex mechanisms to deal with Result like all sorts of monads and you end up with Hasell
21:33:00dom96*Haskell
21:33:45leorizeI don't think we are arguing about that anymore :P
21:34:26leorizeI use a healthy mix of both schemes
21:34:44dom96leorize: Are you sure? :P :P :P
21:35:36leorizethe only time that I'd have a problem with the result scheme is when you wanna replace exceptions as the default scheme with it
21:35:52leorizeotherwise they are useful in their own way
21:39:13FromDiscord<arnetheduck> > a call stack is also useful while debugging fwiw
21:39:13FromDiscord<arnetheduck> gdb?
21:40:11FromGitter<awr1> hello all
21:40:54leorize@arnetheduck: I can either step from the start until I found my error, or I can make it spit out a stacktrace for me and I'd know where to set my breakpoints
21:41:18*xet7 quit (Quit: Leaving)
21:41:38*xet7 joined #nim
21:45:53FromDiscord<arnetheduck> I guess if that's your workflow, gathering stack traces might help sometimes.. or using a `Result[T, cstring]` and making sure each error has a more or less unique string which lands you the line where it was triggered which is usually the part of the stack trace that you're looking at
21:46:23leorizehttps://ziglang.org/documentation/master/#Error-Return-Traces <- even something like this will help
21:46:45dom96I do actually wonder how Rust/Golang programmers figure out why their program crashes
21:46:50leorizeour exceptions stacktrace when used without --stacktraces:on is also implemented like that
21:47:08dom96I often just run things in debug mode so I can get a stack trace on my server
21:48:30companion_cubeI think rust can give stacktraces?
21:48:52FromDiscord<arnetheduck> well, the stack trace implementation in the nim c backend is preposterous 🙂
21:49:29FromDiscord<arnetheduck> rust gives traces for panics - panics in rust btw are exceptions, for all practical purposes: they unwind the stack, you can mostly catch them
21:51:30dom96right, but they are likely very rare. What I imagine happens is that everyone spends extra time handling all possible Result variants
21:51:40FromDiscord<arnetheduck> it's about defaults: exceptions by defualt let you ignore errors, stuff like Result encourage you to handle them - in rust, the default is encourage people to handle/think up-front about errors, but there exists a mechanism to ignore as well - so for example, most of the nim std library is not exception safe, because nobody's really thought about what happens when an exception bubbles up the stack
21:52:03*solitudesf quit (Ping timeout: 260 seconds)
21:53:32FromDiscord<arnetheduck> they're rare - yes - they're used as asserts mostly, ie to signal situations the programmer didn't expect would actually happen, and it's even more rare to try to catch them
21:54:36dom96yes, and that definitely works much better for certain types of applications
21:54:57dom96for Nim that ship has sailed, you'd have to rewrite the stdlib to get the same conventions
21:55:05dom96and we all know how that turned out for D.
21:55:37companion_cubebut nim has checked exceptions, right?
21:55:54dom96yep
21:56:15FromGitter<awr1> https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst#def-directive
21:56:38FromGitter<awr1> out of curiosity
21:57:05*moerm joined #nim
21:57:07FromGitter<awr1> it seems like #def does everything #define does, so...what's missing?
21:57:11companion_cubeso checked exceptions should be as safe as result types…
21:57:17moermHello everyone
21:58:28leorizeif you know what you're doing, you're safe no matter what scheme you use :P
21:58:42FromDiscord<Varriount> awr: Normally Nim tries to turn `#define`s into Nim templates. This isn't always possible, because a `#define` can be a syntactically invalid piece of C code.
21:59:31FromDiscord<Varriount> So `#def` essentially says "don't try to turn this into a template, just treat it like a C define"
21:59:38FromDiscord<Varriount> *awr1 ^
21:59:53FromGitter<awr1> i see
21:59:56FromDiscord<exelotl> is it recommended to have the "nim" in ".. code-block:: nim" ?
22:00:16FromDiscord<exelotl> it seems that syntax highlighting will still be applied in docs even if you omit it
22:00:17leorizeyep
22:00:32leorizefor general purpose RST, yea you need `nim`
22:00:36FromDiscord<Varriount> Well, right now it's applied. That might now always be the case.
22:01:06companion_cubenim should use readthedocs, it's where RST people go !
22:01:20leorizewe have our own docgen, no thanks :P
22:01:45FromDiscord<arnetheduck> and our own RST!
22:02:01FromDiscord<Varriount> I wish there was a slightly nicer RST... a cross between RST and markdown.
22:02:37FromGitter<awr1> hm
22:02:43FromDiscord<Varriount> On the one hand, I love the advanced formatting/markup RST allows... but things like not having line breaks is anooying.
22:02:44moermI gave up on md and use asciidoc
22:02:47FromDiscord<Varriount> *annoying
22:02:51FromGitter<kaushalmodi> Varriount: Are you being sarcastic?
22:02:52FromGitter<awr1> i wish c2nim could skip #defines, as like a cmdline arg
22:02:54leorizeNim's RST is a cross between markdown and rst :P
22:03:19FromDiscord<Varriount> kaushalmodi: I am not. I used RST to write a user manual for a utility I wrote.
22:03:23FromGitter<kaushalmodi> *what leorize said.. I am already not liking the hybrid RST/md that Nim uses*
22:04:05FromDiscord<Varriount> RST -> Sphinx -> HTML -> wkhtmltopdf -> PDF
22:05:03moermWhat an abomination!
22:06:14FromDiscord<Varriount> Nah, it worked quite well, and the CSS was easy to tweak.
22:07:25FromDiscord<exelotl> RST is quite painful sometimes, I have a table with 4 columns and some hyperlinks, it's really not nice
22:08:22FromDiscord<exelotl> it also seems quite hard to style hyperlinks because backtick does so many different things
22:09:05*liblq-dev quit (Quit: WeeChat 2.7.1)
22:12:48*natrys quit (Quit: natrys)
22:20:59companion_cubehmm, I'm trying to use `openapi` but it fails with a `undeclared routine: 'endsWith'` (eevn though strutils seems imported)
22:21:46companion_cubeseems like I need to import it from where I *invoke* the macro?
22:22:13leorizesounds like a bug to me
22:22:19leorizeping disruptek
22:22:25leorizeoh he went offline
22:24:42*tane_ quit (Quit: Leaving)
22:28:05companion_cubehmmm, build happens out of tree, right?
22:28:15companion_cubehow do I get a .json to be available at build time?
22:28:45leorizeyea, but macros should bind whatever symbols they plan to use beforehand
22:28:52leorizeso you shouldn't have to import things in
22:29:45companion_cuberight
22:29:57companion_cubeit's weird because `strutils` is imported in the original `openapi` code
22:34:12*bunbunbunbunny joined #nim
22:34:15*bunbunbunbunny left #nim (#nim)
22:34:31moermHave a good time, cu
22:34:36*moerm quit (Quit: Leaving)
22:51:23*opal quit (Ping timeout: 240 seconds)
22:55:06FromDiscord<Varriount> Anyone here running Windows?
23:01:04FromDiscord<KingDarBoja> Me
23:02:39*Trustable quit (Remote host closed the connection)
23:10:55FromDiscord<Varriount> Do you know how one would escape a double quotation mark in the PATH environment variable?
23:11:59FromDiscord<Varriount> @KingDarBoja So, if you want to add a path containing a semicolon to the PATH environment variable, you surround the path with quotes. But what do you do if you want a single quote in your path?
23:13:02FromDiscord<KingDarBoja> Like this? `"\'"`
23:13:36FromDiscord<KingDarBoja> Wait, I think that doesn't work
23:13:44FromDiscord<Varriount> I don't know. I looked through the Microsoft documentation, on the web, and even the source code of ReactOS/Wine, and couldn't find an answer.
23:14:03FromDiscord<Varriount> And my personal laptop (which runs Windows) is away on repair.
23:14:28FromDiscord<KingDarBoja> I think you must escape it
23:14:57FromDiscord<KingDarBoja> As it is surrounded by double quotes, and viceversa
23:15:07*opal joined #nim
23:15:22FromDiscord<KingDarBoja> -> `"some\path\'in\my\dir"`
23:16:27FromDiscord<KingDarBoja> Nvm, tested it and doesn't work
23:17:09FromDiscord<KingDarBoja> At least not on CMD, trying powershell
23:17:36FromDiscord<KingDarBoja> Oh yeah, powershell works
23:17:49*Tyresc quit (Quit: WeeChat 2.7-dev)
23:18:14FromDiscord<Varriount> You might want to test by changing the variable value through the system settings, rather than the prompt.
23:18:37FromDiscord<Varriount> Otherwise prompt parsing comes into play. >_<
23:19:01FromDiscord<Varriount> And it uses double quotes ("), not single ones (')
23:19:32FromDiscord<KingDarBoja> Not sure what you wanna do
23:19:41FromDiscord<Varriount> Hm.
23:20:50FromDiscord<KingDarBoja> https://imgur.com/CZSWiOQ
23:21:30FromDiscord<KingDarBoja> Now let me see if I can set it using the env system settings that's what I think you asking for
23:23:00FromDiscord<KingDarBoja> I set the same path and echo on my CMD
23:23:24FromDiscord<KingDarBoja> `...;D:\Programming\ts_projects\some'sample;...`
23:23:57FromDiscord<KingDarBoja> Just copied and pasted the path into the system PATH list
23:39:52*krux02_ joined #nim
23:44:03*krux02 quit (Ping timeout: 260 seconds)
23:54:32krux02_@iffy: Regarding nim-result. I did not use that particular implementation. But generally speaking such a type is really useful. I really recommend to use it.
23:54:53krux02_This is what rust does as well.
23:55:07krux02_But after all it all depends on the implementation of that type and how it is used.
23:55:31krux02_good night folks
23:55:38*krux02_ quit (Remote host closed the connection)