<< 11-09-2021 >>

00:13:16*Gustavo6046 joined #nim
00:16:15*vicfred quit (Quit: Leaving)
00:18:22*Gustavo6046 quit (Excess Flood)
00:20:06*Gustavo6046 joined #nim
00:24:00FromDiscord<Varriount> Zevv: How difficult would it be to add an extendable optimizer to NPeg?
00:24:53*Gustavo6046_ joined #nim
00:25:40*Gustavo6046 quit (Ping timeout: 252 seconds)
00:27:09*Gustavo6046_ is now known as Gustavo6046
00:27:11FromDiscord<Varriount> In particular, an optimizer for deduplicating alternations with choices that share common starting/ending patterns.
00:28:37FromDiscord<Varriount> For example, `(start_one start_two middle_ONE end_one end_two) | (start_one start_two middle_TWO end_one end_two)`
00:30:13FromDiscord<Varriount> While I can hand-optimize rules like these, I do have to admit that the unoptimized form is more readable. And it's how the PostgreSQL grammar is structured.
00:32:47*neurocyte quit (Ping timeout: 252 seconds)
00:40:55*neurocyte joined #nim
00:40:55*neurocyte quit (Changing host)
00:40:55*neurocyte joined #nim
00:56:34*xet7 quit (Remote host closed the connection)
00:57:29*xet7 joined #nim
01:09:22FromDiscord<cabboose> In reply to @Jasmina Kiwi "If you'd like i": You must be a first year student to be cocky enough to throw around being a med student to people who are probably a lot “smarter” than you lol
01:12:21FromDiscord<cabboose> Also thanks leno for the heads up on the devel break of cps; I’ll keep an eye on it 🙂
01:12:51FromDiscord<Elegantbeef> I mean they were talking to me so dont overstate it↵(@cabboose)
01:15:28FromDiscord<cabboose> Well medical students will never be as cocky as beef
01:16:55FromDiscord<cabboose> Wait you are self deprecating
01:16:56FromDiscord<cabboose> awwww
01:16:57FromDiscord<Elegantbeef> Hey i was saying the exact opposite
01:16:59FromDiscord<cabboose> cute
01:17:03FromDiscord<Elegantbeef> Indeed
01:17:09FromDiscord<cabboose> i dont buy it
01:30:49FromDiscord<xflywind> In reply to @JSONBash "should https://nim-lang.github.io/Nim/channels_buil": It seems that docs gen becomes more strict. https://github.com/nim-lang/Nim/commit/6c2f041368e36bb7a6b217c7ac0c5de94c7b4a7a
01:32:01*neurocyte1 joined #nim
01:32:01*neurocyte1 quit (Changing host)
01:32:01*neurocyte1 joined #nim
01:34:34*neurocyte quit (Ping timeout: 260 seconds)
01:34:34*neurocyte1 is now known as neurocyte
01:49:49FromDiscord<cabboose> ok this might be a dumb question but with the new nimble what is the equivalent to previously just running `nimble develop` to create a link to a module
01:50:28FromDiscord<cabboose> because running that with devel nim doesn't function the same as it did before as far as i can see
01:50:53FromDiscord<cabboose> at least not with the most recent cps repo
01:51:19FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/8404#54212
01:51:35FromDiscord<cabboose> cheers big ears
01:55:23FromDiscord<cabboose> aw shit how did I miss all this 1.6 chatter
01:55:27FromDiscord<cabboose> golden
01:56:58*Gustavo6046 quit (Ping timeout: 252 seconds)
02:14:55*arkurious quit (Quit: Leaving)
02:16:41FromDiscord<cabboose> so although nim --version on devel still shows 1.5.1 this would be the 1.6 branch no?
02:17:06FromDiscord<cabboose> or do i need to explicitly use `choosenim '#version-1-6'` (which would fail with koch build error)
02:17:37FromDiscord<Elegantbeef> Devel is ahead of 1.6's RC afaik
02:17:48FromDiscord<cabboose> that's fine
02:17:48FromDiscord<cabboose> cool
02:17:52FromDiscord<cabboose> cheerio
02:18:51*Gustavo6046 joined #nim
03:18:13FromDiscord<aleclarson> do you guys always add `()` when using `options.get`? it looks kinda weird without them, like i'm referencing a proc property or smth
03:18:52FromDiscord<aleclarson> `foo.get` vs `foo.get()`
03:19:13FromDiscord<aleclarson> i suppose there's `get foo` too
03:19:44nrds<Prestige99> I add `()`
03:19:50nrds<Prestige99> but it's a choice
03:21:07FromDiscord<aleclarson> i think `get foo` reads best
03:21:24FromDiscord<cabboose> Yeah but if using method syntax adding the () is best
03:28:18FromDiscord<aleclarson> i thought `seq` was copy on assign. is this not true for parameters?
03:29:16FromDiscord<cabboose> I think the compiler chucks in sinks where it can
03:29:43FromDiscord<cabboose> I'm not sure how good it as at it though
03:30:19FromDiscord<aleclarson> how do i force a copy of a `seq`?
03:30:31FromDiscord<cabboose> deepcopy?
03:31:27FromDiscord<cabboose> oh for a proc though
03:31:41FromDiscord<Elegantbeef> Well you can not mutate parameters that are not passed as `var`
03:31:59FromDiscord<Elegantbeef> to copy a seq you just do `var a = yourSeq`
03:34:19FromDiscord<aleclarson> In reply to @Elegantbeef "to copy a seq": didn't seem to work
03:34:44FromDiscord<aleclarson> strange thing is, i can't reproduce in playground
03:35:13FromDiscord<aleclarson> does nim do strange things with tail calls?
03:35:30FromDiscord<aleclarson> oh, maybe `finally` runs before `except`?
03:35:52FromDiscord<Elegantbeef> No finally runs after except
03:35:58FromDiscord<cabboose> Link play dawg
03:36:35FromDiscord<aleclarson> In reply to @cabboose "Link play dawg": i would if i could reproduce the issue
03:36:37FromDiscord<cabboose> Except what?
03:36:54FromDiscord<Elegantbeef> Lol
03:36:58FromDiscord<cabboose> Ah yeah sorry didn’t see that
03:39:08FromDiscord<cabboose> I’m too used to using objects I didn’t consider seqs as just being GCd not refs
03:39:17FromDiscord<cabboose> I’m a monkey anyway
03:39:26FromDiscord<cabboose> I’m just here to spite beef
03:54:40FromDiscord<JSONBash> In reply to @flywind "It seems that docs": Cool you got it going so fast!
04:06:02*supakeen quit (Quit: WeeChat 3.2.1)
04:06:31*supakeen joined #nim
04:12:13FromDiscord<aleclarson> kinda bummed that `defer` runs at end of `if` block so i can't deduplicate the condition \:(
04:12:25FromDiscord<Elegantbeef> What?
04:13:01FromDiscord<aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3ywF
04:13:35FromDiscord<Elegantbeef> That's what one would expect
04:14:19FromDiscord<Elegantbeef> I dont get what "Deduplicate" means in this context though
04:15:09FromDiscord<aleclarson> sent a code paste, see https://paste.rs/C7U
04:15:15FromDiscord<aleclarson> assuming there's more stuff after the `if` block that i want done before `undoStuff` runs
04:17:16FromDiscord<cabboose> Yeah that's what defer should do though
04:18:52FromDiscord<cabboose> I see what you are lookin for tho
04:19:51FromDiscord<cabboose> I just started playing with cps
04:20:07FromDiscord<cabboose> and that can literally provide that functionality lol
04:20:16FromDiscord<Elegantbeef> Yea i was going to say CPS could do it
04:20:23FromDiscord<Elegantbeef> Otherwise you can just use a bool
04:22:26FromDiscord<cabboose> if you look into cps though you'll need to use arc/orc
04:22:29FromDiscord<cabboose> which is not a bad thing at all
04:22:55FromDiscord<cabboose> but some libraries are not up to date with being compatible with arc/orc
04:24:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ywG
04:24:20FromDiscord<Elegantbeef> maybe without the message inside the code block 😀
04:27:50FromDiscord<cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3ywI
04:27:51FromDiscord<Elegantbeef> Maybe if it was formatted properly
04:28:01FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3ywH this would though
04:28:20FromDiscord<Elegantbeef> Not that it's any more readable
04:29:07FromDiscord<Elegantbeef> Actually we can do this better
04:29:56FromDiscord<cabboose> you're about to get beefd @aleclarson
04:30:20FromDiscord<Elegantbeef> Well not that much better 😀
04:30:33FromDiscord<cabboose> `raise Defect(nil)`
04:31:22FromDiscord<Elegantbeef> Metaprogramming not even once https://play.nim-lang.org/#ix=3ywK
04:32:01FromDiscord<aleclarson> what's that, i think the playground is saying something... "kill... me... please"
04:32:26FromDiscord<Elegantbeef> Big code block 😀
04:32:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ywL
04:32:53FromDiscord<cabboose> now matrix want to die
04:33:15FromDiscord<Elegantbeef> Now in hindsight i think you were just joking about the code 😀
04:34:06FromDiscord<Elegantbeef> But hey it's like your desired defer so take that
04:34:15FromDiscord<aleclarson> think i'll just fork nim instead, thx
04:34:18FromDiscord<aleclarson> \:)
04:34:29FromDiscord<Elegantbeef> Have fun
04:34:36FromDiscord<cabboose> I don't even think the resetCond is necessary
04:34:59FromDiscord<Elegantbeef> It's not if you want to call `doReset` and `dontReset` often
04:35:12FromDiscord<aleclarson> im jk, i'll just do it the ol fashioned way
04:35:14FromDiscord<aleclarson> as god intended
04:35:17FromDiscord<cabboose> just make it DNR() instead
04:35:21FromDiscord<cabboose> (do not resuscitate)
04:35:36FromDiscord<Elegantbeef> the old fashioned way is what?
04:35:47FromDiscord<cabboose> `raise Defect(nil)`
04:35:57FromDiscord<Elegantbeef> Having a comment that says `#dont move this code`?
04:36:36FromDiscord<aleclarson> duplicate the `if` condition, and add a test case (jk i don't write tests)
04:38:05*rockcavera quit (Remote host closed the connection)
04:38:46FromDiscord<aleclarson> i made a deal with the devil that he'll test my spaghetti and i'll `raise Defect(nil)` in return
04:40:51FromDiscord<cabboose> why metaprogram when you can metajoke
04:44:52FromDiscord<aleclarson> that or metaphysics, and im not really in the mood for an existential crisis. maybe in them orning
04:44:56FromDiscord<aleclarson> (edit) "them orning" => "the morning"
04:46:50FromDiscord<aleclarson> what's the difference between `name` and `msg` in Exception type?
04:48:21FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#Exception
04:49:30FromDiscord<cabboose> Recommond the DevDocs extension on vscode if you use vscode, quick access to docs that can be cached for offline use too
04:49:54FromDiscord<aleclarson> so `name` equals `"Defect"` if i `raise newException(Defect, "blah")`?
04:51:17FromDiscord<cabboose> so you can just highlight Exception and run the command to see the documentation for it
04:51:30FromDiscord<cabboose> From my understanding yes
04:51:32FromDiscord<Elegantbeef> It should
05:21:13*neocron joined #nim
05:23:46*Doraemon quit (Ping timeout: 252 seconds)
06:02:02FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3yx7
06:02:36FromDiscord<Elegantbeef> That does compile
06:03:33FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3yx8
06:03:44FromDiscord<impbox [ftsf]> uhh, hold on, just realised my nim version is 1.0 on this laptop
06:04:09FromDiscord<Elegantbeef> Ah that's before typedef macros were added
06:06:59FromDiscord<impbox [ftsf]> \o/
06:07:52FromDiscord<Elegantbeef> Assuming you looked at my code the benefit of `static` is you dont get an AST you get the value as is
06:12:17FromDiscord<treeform> In reply to @cabboose "not unless you specifically": its not a `jsony` bug right?
06:14:00FromDiscord<treeform> In reply to @arkanoid "yeah! thanks treeform": you welcome
06:19:44FromDiscord<impbox [ftsf]> ahh dang, i can only edit the typedef, i can't add extra stuff after it like procs using that type
06:21:15FromDiscord<Elegantbeef> Nah there is a RFC for typesection macros though but yea nothing presently implemented to do as such you need to make your own typedef macro
06:21:17FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3yxi
06:31:46FromDiscord<impbox [ftsf]> gotcha
06:31:50FromDiscord<impbox [ftsf]> that rfc sounds nice
06:32:05FromDiscord<impbox [ftsf]> though i'm not sure if it would allow this
06:34:46FromDiscord<Elegantbeef> Ah not a RFC i guess it's a issue https://github.com/nim-lang/Nim/issues/13830
06:35:29FromDiscord<impbox [ftsf]> ayup that's what i was looking at
06:36:59FromDiscord<Elegantbeef> The best way to do what you want to do is to make a template(I seen the forum post)
06:37:38FromDiscord<impbox [ftsf]> yeah, the template was easy
06:37:45FromDiscord<impbox [ftsf]> but making it look nice >_>
06:37:53FromDiscord<Hamid Bluri> https://github.com/alaviss/union↵↵i cant get it
06:38:51FromDiscord<Hamid Bluri> what does this package do ?
06:39:14FromDiscord<Elegantbeef> It creates anonymous union values
06:39:57FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3yxo what's wrong with this imp
06:40:38FromDiscord<impbox [ftsf]> yeah pretty much what i was doing
06:40:59FromDiscord<impbox [ftsf]> was just hoping i could keep it tied to the type
06:41:04FromDiscord<Elegantbeef> Ah
06:41:07FromDiscord<impbox [ftsf]> rather than having to add it as an extra thing afterwards
06:41:14FromDiscord<Hamid Bluri> In reply to @Elegantbeef "It creates anonymous union": use case?
06:41:34FromDiscord<Elegantbeef> Having a variable that can hold a specified variety of types without making a tagged union
06:42:16FromDiscord<Hamid Bluri> ok, thanks
06:43:16FromDiscord<Elegantbeef> Yea aside from your own typesection operating macro you cannot do that sadly imp
06:45:20FromDiscord<Elegantbeef> Still thinking if there is some way one can abuse other features to get it
06:47:06FromDiscord<impbox [ftsf]> time to learn how to break nim internally!
06:47:50FromDiscord<impbox [ftsf]> sounds like a fun challenge during post-vax delirium
07:18:22FromDiscord<Elegantbeef> I've got half of it done with a term rewriting macro, the fun part is trying to make it call the emitted code ;D
07:19:33FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3yxu
07:20:04FromDiscord<haxscramper> sent a code paste, see https://paste.rs/xGV
07:20:24FromDiscord<haxscramper> This is a bug, that is supposed to work
07:26:09FromDiscord<impbox [ftsf]> is there a way to make quote do not add gensym?
07:26:30FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=
07:26:32FromDiscord<Elegantbeef> think genast from devel solves issues like that iirc
07:39:27FromDiscord<Elegantbeef> @impbox [ftsf]\: doesnt work with stable but works on devel https://play.nim-lang.org/#ix=3yxA
07:39:50FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/886154049911676928/image.png
07:39:51FromDiscord<Elegantbeef> Lovely output
07:39:58FromDiscord<impbox [ftsf]> wow magic
07:40:14FromDiscord<Elegantbeef> term rewriting macros are magic indeed
07:40:48FromDiscord<Elegantbeef> You can basically do your own post semantic passes if you can use your noggin, though it can be rather confusing
07:41:04FromDiscord<impbox [ftsf]> _reads up on them_
07:41:16FromDiscord<Elegantbeef> Heavily abusing them here, they're typically for making optimizations not for making a whole new variety of macros
07:41:22FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros well read up
07:41:37FromDiscord<Elegantbeef> They're basically macros that apply after semantic passing and have a pattern
07:44:49FromDiscord<Elegantbeef> The biggest issue with that impl is that any`serialize(x)` call gets converted to `doSerialize(x)`
07:47:06FromDiscord<impbox [ftsf]> pretty impressive you can do such crazy stuff though, kinda hard to follow
07:48:38FromDiscord<Elegantbeef> I'm surprised it actually sorta works
07:50:44*max22- joined #nim
08:18:45FromDiscord<Jasmina Kiwi> In reply to @cabboose "You must be a": I never said im smarter than anyone nor was i cocky and no im a 3rd year med student and i just asked for info and i suggested i can say a few things in return if they wanted
08:22:42FromDiscord<cabboose> I can smell the elitism from here; I do apologise for my lash out, my meds hadn't kicked in yet and I was a grumpy man
08:22:50FromDiscord<cabboose> I have a massive aversion to medical students and drs
08:22:59FromDiscord<cabboose> arrogant until proven otherwise
08:23:55FromDiscord<cabboose> However trust me when I say the things that these people do is way beyond the scope of difficulty compared to medicine
08:24:22FromDiscord<impbox [ftsf]> #offtopic pls if you must
08:24:33FromDiscord<cabboose> fair
08:24:36FromDiscord<impbox [ftsf]> or better yet not at all
08:25:09FromDiscord<cabboose> yis I am sorry
08:25:13FromDiscord<cabboose> that is all
08:25:25*jjido joined #nim
08:30:36FromDiscord<Rika> Woah hella drama
08:34:59FromDiscord<cabboose> image.png https://media.discordapp.net/attachments/371759389889003532/886167927890513940/image.png
08:52:46FromDiscord<gogolxdong (liuxiaodong)> What's the max length allocation of an array , like array[1 shl 32, uint32]?
08:54:11FromDiscord<Elegantbeef> I feel like the max size is more of "How big and fast is your swap"
08:55:08FromDiscord<Rika> No it’s limited by stack size I would believe
09:17:17*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:25:33FromDiscord<Varriount> Anyone know how I would begin to debug a Nim program that makes the C compiler use up all my computer's memory?
09:25:54FromDiscord<Varriount> (16 GiB)
09:27:20FromDiscord<impbox [ftsf]> cut it in half and test both halves
09:28:22FromDiscord<impbox [ftsf]> try a different c compiler
09:36:26FromDiscord<impbox [ftsf]> whoa. super odd behaviour... generating a proc but the output tree is rearranged =\
09:37:01FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3yy0 swaps the order of the last two statements, puts the return before the call to deserialize
09:46:37FromDiscord<impbox [ftsf]> seems to be caused by using `&` in `newIdentNode`
09:48:18*max22- quit (Remote host closed the connection)
09:49:03*max22- joined #nim
09:54:44FromDiscord<impbox [ftsf]> woo got it working, can now serialize and deserialize a seq of objects with a common base type
10:05:02FromDiscord<levovix> is there a way to store a `proc() {.closure.}` in `seq[byte]`?
10:08:04FromDiscord<impbox [ftsf]> pretty sure that's possible, it's just a pointer
10:08:23FromDiscord<impbox [ftsf]> so you'd be storing the address of the proc as bytes
10:19:16*Zevv joined #nim
10:21:00FromDiscord<impbox [ftsf]> (probably not a great idea though) why?
10:25:55FromDiscord<levovix> I need to make a universal dynamic type, I wanted to store a nim function there
10:26:36FromDiscord<impbox [ftsf]> why not use a `seq[proc() {.closure.}]` ?
10:27:46FromDiscord<levovix> because i also need to store other types
10:28:20FromDiscord<demotomohiro> https://nim-lang.org/docs/system.html#rawEnv%2CT↵https://nim-lang.org/docs/system.html#rawProc%2CT
10:28:50FromDiscord<demotomohiro> I think such idea would make your program less type safe.
10:32:03FromDiscord<demotomohiro> You might accidentally read bytes as float that you wrote as int.↵And there is no safety guards to prevent such error.
11:20:27*supakeen quit (Remote host closed the connection)
11:20:51*supakeen joined #nim
12:01:40*max22- quit (Ping timeout: 260 seconds)
12:06:02*supakeen quit (Quit: WeeChat 3.2.1)
12:06:30*supakeen joined #nim
12:15:04FromDiscord<auxym> so, nested macros/templates: the inner one is expanded first, and the resulting AST is passed to the outer one, right?
12:15:10FromDiscord<haxscramper> In reply to @levovix "is there a way": https://nim-lang.org/docs/system.html#rawProc%2CT
12:16:29FromDiscord<haxscramper> In reply to @levovix "is there a way": https://github.com/haxscramper/hmisc/blob/master/src/hmisc/algo/procbox.nim
12:21:05*arkurious joined #nim
12:21:59FromDiscord<auxym> I'm trying to create a macro that creates a whole bunch of `... == ...` expressions, to be called inside unittest's `check` macro, but I get a compile time error: `Error: expression 'cast[int](PORT.DIRCLR0.p) == 1090536452' is of type 'bool' and has to be used (or discarded)`
12:22:25FromDiscord<haxscramper> In reply to @auxym "so, nested macros/templates: the": https://forum.nim-lang.org/t/8357#53872
12:23:55FromDiscord<haxscramper> In reply to @auxym "I'm trying to create": 'check' is an untyped macro, it does some transformations of the passed arguments
12:24:12FromDiscord<auxym> I see, thanks, so I might have to roll my own "check" that takes `typed`, or just fall back to plain `doAssert`s
12:24:13FromDiscord<haxscramper> Your macro is evaluated after checks is executed, not before
12:24:28FromDiscord<auxym> got it
12:24:46FromDiscord<auxym> so asserts it is for now
12:56:25*max22- joined #nim
13:27:29NimEventerNew thread by Alexeypetrushin: Is it possible to tell `import` to not create const with same name as imported module?, see https://forum.nim-lang.org/t/8413
13:34:05*max22- quit (Remote host closed the connection)
13:34:34*max22- joined #nim
13:35:27*neurocyte quit (Quit: The Lounge - https://thelounge.chat)
13:44:20*max22- quit (Ping timeout: 260 seconds)
13:45:02FromDiscord<Kiloneie> When having a huge object that needs to be passed around, the best way to do it would be to make it a reference object right ?↵↵And if one has loads of tiny objects to be passed around, one would make the normal/plain objects ? Say a sequence to store a game's bullets ?
13:45:35FromDiscord<Yardanico> In reply to @Kiloneie "When having a huge": > the best way to do it would be to make it a reference object right ?↵no, nim passes big objects by reference by itself
13:45:44FromDiscord<Rika> yard too quick 4 me
13:45:56FromDiscord<Yardanico> ideally you should only use ref objects when you need shared ownership
13:46:12FromDiscord<Yardanico> or when you can't use `var` arguments, e.g. for async procedures since they get converted to closures
13:46:14FromDiscord<Rika> many tiny objects passed around are best passed in a contiguous chunk of memory
13:46:53FromDiscord<Rika> In reply to @Rika "many tiny objects passed": rather a pointer to a contiguous chunk of memory containing such objects
13:47:25FromDiscord<Yardanico> why would you need to pass that bullet sequence around though? 🤔 won't it be like a part of the scene object?
13:48:55FromDiscord<Kiloneie> okay wrong question then xD...↵↵I assume that using a sequence with reference object bullets would be better than using plain objects because the memory would never be freed while if bullets are ref objects GC will keep cleaning them up over the course of the game
13:49:09FromDiscord<Yardanico> wat
13:49:11FromDiscord<Rika> wat
13:49:23FromDiscord<Yardanico> as long as the bullet objects are in the seq they won't get deallocated by the GC
13:49:28FromDiscord<Yardanico> doesn't matter if they're ref objects
13:50:02FromDiscord<Yardanico> in most cases you really don't need ref objects :P
13:50:03FromDiscord<Kiloneie> no but when i say bullets, i mean, you shoot 100 , they hit enemies and get destroyed, get off screen get destroyed, then you shoot some more
13:50:17FromDiscord<Rika> when something is deleted on the seq then (object) it will just plainly be deleted, no freeing necessary (ref) it will be freed by the GC if no other things reference it
13:50:39FromDiscord<Yardanico> In reply to @Kiloneie "no but when i": it's better to have a seq with non-ref objects and pre-allocate it with some big enough number
13:50:47FromDiscord<Yardanico> so when you delete/add bullets there are no reallocations needed at all
13:50:52FromDiscord<Rika> In reply to @Rika "when something is deleted": no freeing necessary if the object has no refs in it as well
13:51:04FromDiscord<Rika> In reply to @Yardanico "it's better to have": aka newSeqOfCap
13:51:32FromDiscord<Rika> or maybe just newSeq if you're fine with dealing with empty (and potentially invalid) Bullet objects
13:52:39FromDiscord<Yardanico> well, another issue is that it's not really efficient to store bullet objects like that, is it?
13:53:00FromDiscord<Yardanico> since if you e.g. shoot 500 bullets, and first 100 of them get deleted, then you have to delete them from the start of the seq since they were added earlier
13:53:07FromDiscord<Yardanico> and that's not really fast
13:53:31FromDiscord<Yardanico> removing from the end is really easy though - just setLen and you're done
13:53:57FromDiscord<Yardanico> but yes @Kiloneie , in any way, most of the time ref objects are only needed when you want shared ownership
13:54:05FromDiscord<Yardanico> e.g. store references to the same object in two different places
13:54:28FromDiscord<Rika> maybe a ring buffer then
13:54:33FromDiscord<Yardanico> or for specific cases like async where you can't have "var ObjType" in async procs so you are forced to use ref objects
13:54:59FromDiscord<Yardanico> or maybe I'm wrong and it works now, lemme check
13:55:44FromDiscord<ant1fact> sent a long message, see http://ix.io/3yzb
13:55:45FromDiscord<Kiloneie> i hate this subject D:
13:56:12FromDiscord<Kiloneie> no wonder i quit making the video on it about a year ago
13:57:51FromDiscord<impbox [ftsf]> hmm trying to use `hasCustomPragma` but apparently it is an undeclared routine despite importing macros
13:58:23*max22- joined #nim
13:58:39FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3yzc
13:59:32FromDiscord<Kiloneie> So to double check, any container that has a dynamic size that gets an element removed from it will have that part of the memory cleared, deallocated right...?
13:59:52FromDiscord<impbox [ftsf]> unlikely
14:00:10FromDiscord<Yardanico> In reply to @Kiloneie "So to double check,": no, in most cases it won't
14:00:11FromDiscord<Rika> not deallocated
14:00:20FromDiscord<Rika> most of the time not cleared either
14:00:26FromDiscord<Yardanico> and specifically for Nim sequences - they don't get reallocated to the smaller size
14:00:39FromDiscord<Rika> though if you're using a security focused container it will definitely be cleared
14:00:59FromDiscord<Yardanico> so if you create a seq and add 1000 objects then remove all of them except 1 - the seq will still have at least sizeof(objectType) 1000 bytes allocated (actually a bit more because of the seq header)
14:01:31FromDiscord<Kiloneie> Oh okay
14:01:39FromDiscord<Rika> In reply to @Yardanico "so if you create": and also because of the growth factor not being exactly a mutliple of 10
14:01:40FromDiscord<Rika> lol
14:02:03FromDiscord<Yardanico> yes :)
14:03:28FromDiscord<impbox [ftsf]> `mySeq = @[]` will give you a fresh start thoguh
14:03:31FromDiscord<impbox [ftsf]> (edit) "thoguh" => "though"
14:03:38FromDiscord<impbox [ftsf]> and the old mem will get GCed
14:03:53FromDiscord<impbox [ftsf]> i'm not sure about setLen
14:04:00FromDiscord<Rika> setLen prolly wont
14:04:18FromDiscord<Yardanico> yeah if you shrink the seq by setLen it's not reallocated
14:07:26FromDiscord<Kiloneie> I think i get it now, use normal struct objects, got a big one? You can make a pointer or ref? (im not done learning all on nim's pointers). For optimization reasons, essess(whats the word...) the aprox mem needed and pre allocate. For modifying a plain object there is "var" keyword. Ownership... Ref objects owned = unique, i think "let ownedRefObject = smthing"
14:08:05FromDiscord<Yardanico> arghhh, why didn't you read my message :(
14:08:27FromDiscord<Yardanico> as I said above, Nim passes big objects by reference itself, you don't have to make big objects `ref`s
14:08:59FromDiscord<Yardanico> and the part about ref objects - as I said, they should be used when you need _shared_ ownership, not _unique_ ownership
14:09:00FromDiscord<Kiloneie> Okay but how does it know? There a size cap it checks for?
14:09:19FromDiscord<Yardanico> In reply to @Kiloneie "Okay but how does": yes, but you shouldn't mention that in a video since it's implementation-dependent :)
14:10:13FromDiscord<Yardanico> but if you really want to know the limit for pass-by-copy vs pass-by-ref is sizeof(int) 3
14:10:31FromDiscord<Yardanico> ah right sortry, it's sizeof(float64) 3
14:10:35FromDiscord<Yardanico> (edit) "sortry," => "sorry,"
14:10:40FromDiscord<Kiloneie> Okay i will write this down and butcher my script...
14:10:59FromDiscord<Kiloneie> For the third time...
14:11:19FromDiscord<Yardanico> i think it might be better to actually ask all your questions on the forum so you don't post a video with some info that's not right :)
14:11:37FromDiscord<Rika> In reply to @Yardanico "ah right sorry, it's": dont put this on the script though
14:11:38FromDiscord<Yardanico> about this sensitive topic about memory
14:11:39FromDiscord<Kiloneie> The video will go first up as private
14:11:47FromDiscord<Kiloneie> Im taking no risks with this one
14:12:55FromDiscord<Kiloneie> Probably gonna be standard procedure from now on, a day in advance as private.
14:13:16FromDiscord<Kiloneie> Some of these topics are just... Hell...
14:13:24FromDiscord<Yardanico> do you send the private one to araq or to the forum in general?
14:13:52FromDiscord<Kiloneie> Probably both?
14:14:04FromDiscord<Yardanico> sounds good enough
14:15:26FromDiscord<Rika> private? you mean unlisted right?
14:15:26FromDiscord<Kiloneie> i should call these videos "preview" right ?
14:15:29FromDiscord<Kiloneie> no
14:15:40FromDiscord<Rika> whats the point then?
14:15:57FromDiscord<Kiloneie> isn't private on YT being if you share link they can see it
14:16:00FromDiscord<Rika> no
14:16:01FromDiscord<Kiloneie> unlisted is NONE can
14:16:02FromDiscord<Rika> thats unlisted
14:16:07FromDiscord<Rika> private is none
14:16:17FromDiscord<Yardanico> :D
14:16:25FromDiscord<Yardanico> yeah, @Kiloneie , unlisted = link only, private = you only
14:16:31FromDiscord<Rika> i mean its in the name 😛
14:16:35FromDiscord<Kiloneie> ohhh okay
14:16:55FromDiscord<Kiloneie> remembered it wrong
14:17:07FromDiscord<Yardanico> well actually you can share private videos to other people by their google email addresses
14:17:56FromDiscord<Rika> yeah but he said forum too so i was suspicious
14:18:15FromDiscord<Yardanico> well obv it'll be unlisted for the forunm
14:18:16FromDiscord<Yardanico> (edit) "forunm" => "forum"
14:18:36FromDiscord<Kiloneie> well if the forum will turn out to be useless i will stop sharing it there, will see how that goes
14:19:22FromDiscord<Yardanico> well, just name your thread appropriately, like "asking for feedback"
14:19:33FromDiscord<Yardanico> <video title> - asking for feedback or something like that
14:23:10FromDiscord<Kiloneie> or PREVIEW OF VIDEO SERIES - VIDEO/EPISODE
14:23:19FromDiscord<Kiloneie> not all caps of course
14:23:32FromDiscord<Yardanico> i think preview might be a bit more confusing
14:23:53FromDiscord<Kiloneie> okay PROTOTYPE then ?
14:24:04FromDiscord<Yardanico> asking for feedback conveys the fact that you want people to check the video contents more than prototype/preview
14:24:16FromDiscord<Yardanico> iMO prototype/preview just sounds like you want to share
14:24:24FromDiscord<Yardanico> and not ask for corrections or something like that
14:24:30FromDiscord<Kiloneie> okay then
14:25:55FromDiscord<Rika> maybe "new episode of <name of series> - requesting for feedback" or something
14:26:26FromDiscord<Yardanico> then "asking for feedback" and "requesting feedback" is almost the same thing though, isn't it? :)
14:27:18FromDiscord<Rika> o i didnt realise you said that already
14:29:05FromDiscord<Yardanico> also @Kiloneie you might want to read http://zevv.nl/nim-memory/ if you haven't seen it already
14:30:05FromDiscord<Kiloneie> no i have not, will look into it
14:31:33FromDiscord<Yardanico> although some parts are a bit different with ARC/ORC, namely the way seqs and strings are represented in memory
14:32:15FromDiscord<Kiloneie> okay i will keep that in mind
15:15:28*supakeen quit (Remote host closed the connection)
15:15:53*supakeen joined #nim
15:18:49ZevvSomeone should extend that doc to talk about arc one day
15:25:07FromDiscord<deech> Is there a way to generate a C header with `exportc` modules?
15:28:03FromDiscord<Rika> i can predict the future and im expecting hax to answer
15:28:04FromDiscord<Yardanico> In reply to @deech "Is there a way": Don't think so, you'll have to write one yourself
15:29:16FromDiscord<deech> Thanks!
15:29:26FromDiscord<Yardanico> but maybe there's some lib that does this that I'm not aware of/forgot
15:29:36FromDiscord<Yardanico> just like there's https://github.com/treeform/genny for node/python
15:29:39nrds<R2D299> itHub: 7"Generate a shared library and bindings for many languages."
15:41:02FromDiscord<treeform> In reply to @Yardanico "just like there's https://github.com/treeform/genny": @deech @Yardanico I have a WIP C header generator in a branch: https://github.com/treeform/genny/pull/18
15:43:02FromDiscord<Yardanico> oh cool
15:44:02FromDiscord<deech> In reply to @treeform "<@!271498588981297157> <@!177365113899057152> I hav": This is really cool! Can't help thinking this would be so much easier if there was direct support in the compiler. I can see the `extern "C" N_LIB_PRIVATE N_NIMCALL ...` line in the generated C/C++, unless I'm missing something it shouldn't be hard to toss that into a header file.
15:47:29FromDiscord<xflywind> --header:FILE (already deprecated)
15:48:56FromDiscord<xflywind> https://nim-lang.org/docs/backends.html#interfacing-backend-code-calling-nim
15:48:57*rockcavera joined #nim
15:48:57*rockcavera quit (Changing host)
15:48:57*rockcavera joined #nim
15:52:20FromDiscord<deech> Wait, what? This seems like exactly what I want! `nim --fullhelp` doesn't even show the `--header` option which is why I didn't know about it!
15:53:21FromDiscord<deech> Oh wow that adding `--header` worked!
15:53:44FromDiscord<haxscramper> header is DePreCaTeD
15:54:38FromDiscord<deech> Why? Seems pretty useful, was it buggy or something?
15:55:05FromDiscord<deech> I'll ask in `internals`.
15:55:56FromDiscord<xflywind> it is buggy, so it was removed from --fullhelp
15:56:03FromDiscord<xflywind> https://github.com/nim-lang/Nim/commit/279df834bae8b6972af6cbcbdd57c1d53e1df9c7
15:56:09FromDiscord<xflywind> https://github.com/nim-lang/Nim/issues/4723
15:57:31*rockcavera quit (Remote host closed the connection)
15:58:19FromDiscord<xflywind> maybe someone can deprecate it properly(add a warning and add it back to --fullhelp).
15:59:35FromDiscord<treeform> In reply to @deech "This is really cool!": I disagree about having C header generator in compiler for exportc. Exportc just does the name mangling, how do you do ref objects? How does GC work? how do you do seq? How do you do overloads? Enums, constants... Many things can't just be exported to C plainly and require opinions and problems to solve. That is why we made genny there is enough to think about.
16:01:31FromDiscord<Rika> i told you guys hax was gonna answer
16:02:25FromDiscord<haxscramper> Well, deprecating `--header` without having any suitable alternative (it happened two years ago), because of some random bug seems
16:03:29FromDiscord<haxscramper> Quite questionable. genny is available now, and it does make sense to have an external tool, but for large APIs etc. it still might be useful
16:04:10FromDiscord<Rika> i dont think it was just because of some random bug
16:04:11FromDiscord<haxscramper> Also it might as well be a separate program that uses compiler API
16:04:19FromDiscord<Rika> i think no one was just willing to maintain it
16:04:26*stkrdknmibalz quit (Ping timeout: 265 seconds)
16:10:13FromDiscord<haxscramper> It does not seem to be an overly complicated - after all, what it really needs to to is to copy cgen of every `.exportc.` symbol into separate file
16:10:40FromDiscord<haxscramper> And that's it, at least that's what I would really expect from it.
16:11:26FromDiscord<haxscramper> And compiler does already generate all the C code, and all procs are foward-declared in generated C headers as well
16:26:22*stkrdknmibalz joined #nim
16:47:40FromDiscord<deech> In reply to @treeform "I disagree about having": I agree with your points, but with orc/arc isn't GC a non issue? TMK there's no need to explicitly spin up/down a Nim runtime to use exported procs.
16:49:20FromDiscord<treeform> well you still need to export unref for each object for C if you are going to use ref objects in C land.
16:49:38FromDiscord<treeform> is it simpler yes? do you still have to think about it, also yes.
16:49:49FromDiscord<Gumber aka Zachary Carter> using ref objects in C land is not simpler I'd argue
16:50:00FromDiscord<Gumber aka Zachary Carter> and is way less explicit
16:50:04FromDiscord<Gumber aka Zachary Carter> than custom destructors and pointers
16:50:11FromDiscord<Gumber aka Zachary Carter> but to each their own...
16:50:15FromDiscord<treeform> yeah you just need to free them
16:50:28FromDiscord<Gumber aka Zachary Carter> and ref / unref them
16:50:33FromDiscord<Gumber aka Zachary Carter> oh you mean pointers
16:50:38FromDiscord<Gumber aka Zachary Carter> or...
16:51:24FromDiscord<Gumber aka Zachary Carter> it's say that automatic memory management looses much of its benefit when you have to manually ref and unref objects
16:52:12FromDiscord<Gumber aka Zachary Carter> and it actually makes things more complicated, because now you have to think about when you need to perform these actions
16:52:23FromDiscord<Gumber aka Zachary Carter> whereas if you just wrote custom destructors
16:52:32FromDiscord<Gumber aka Zachary Carter> it makes reasoning about things much simpler
16:53:19FromDiscord<Gumber aka Zachary Carter> (edit) "it's" => "i'd"
17:02:35FromDiscord<treeform> C does not have custom destructors
17:02:45FromDiscord<treeform> I would argue the C api can be made simple
17:02:51FromDiscord<treeform> when you `new` a ref object you get it
17:02:59FromDiscord<treeform> then you `unref` when you are done with it.
17:03:35FromDiscord<treeform> in see you already have to free everything
17:03:42FromDiscord<treeform> (edit) "see" => "C"
17:06:36FromDiscord<Gumber aka Zachary Carter> no I'm talking about Nim custom destructors
17:06:58FromDiscord<Gumber aka Zachary Carter> and passing GC ref'd objects to C code from Nim
17:07:22FromDiscord<Gumber aka Zachary Carter> basically the opposite of what you're describing
17:07:47FromDiscord<Gumber aka Zachary Carter> I know C doesn't have destructors or RAII semantics
17:07:51FromDiscord<Gumber aka Zachary Carter> but Nim does now
17:08:28FromDiscord<Gumber aka Zachary Carter> (if you use ARC/ORC)
17:14:02FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=3yAn
17:14:11FromDiscord<treeform> all exported to C
17:40:08FromDiscord<Gumber aka Zachary Carter> sure
17:40:20FromDiscord<Gumber aka Zachary Carter> but if you want to pass them around and store references to them
17:40:40FromDiscord<Gumber aka Zachary Carter> by around - I mean between C and Nim code
17:40:51FromDiscord<Gumber aka Zachary Carter> you still need to ref and unref them appropriately
17:41:26*mdbauman joined #nim
17:46:56FromDiscord<treeform> nim can handle that
17:47:04FromDiscord<treeform> in C you just need to unref it once you are done
17:52:37FromDiscord<Gumber aka Zachary Carter> hmm?
17:52:49FromDiscord<Gumber aka Zachary Carter> if you pass a gc ref'd object to some C code and the C code makes a reference to it
17:52:55FromDiscord<Gumber aka Zachary Carter> Nim is not going to know that
17:53:12FromDiscord<Gumber aka Zachary Carter> (edit) "makes" => "stores"
17:53:35FromDiscord<Gumber aka Zachary Carter> you'd need to GCRef it on the Nim side first
17:53:41FromDiscord<Rika> ...unless C tells Nim about it
17:53:44FromDiscord<Gumber aka Zachary Carter> right
17:53:45FromDiscord<Rika> which is what treeform means i believe
17:53:51FromDiscord<Gumber aka Zachary Carter> yeah but I'm saying this is a lot of work
17:53:54FromDiscord<Gumber aka Zachary Carter> and just as dangerous IMO
17:54:00FromDiscord<Gumber aka Zachary Carter> as just using pointers
17:54:19FromDiscord<Gumber aka Zachary Carter> in fact I'd say it's more dangerous - but... I guess if you're working on some way to do this automatically
17:54:27FromDiscord<haxscramper> Can't this be solved by `T copied = copy_T(base value)`
17:54:29FromDiscord<Gumber aka Zachary Carter> without any overhead from the user - then yeah that'd be really swell
17:56:24FromDiscord<haxscramper> It gets more problematic when you store refs in the C structs, but overall having ref does not seem more dangerous and cumbersome than free pointer
17:56:41FromDiscord<haxscramper> At worst you are left with the same bugs as regular pointer
17:58:29FromDiscord<Gumber aka Zachary Carter> I mean a lot of time you don't have control over the C code you're calling into
17:59:23FromDiscord<Gumber aka Zachary Carter> but I'm not sure if that factors into this discussion or not
18:01:43FromDiscord<haxscramper> I'm not sure what C not under my control you refer to. I want to make my nim ref type available to C side, so I expose RefT, and provide memory management functions for it
18:03:28FromDiscord<haxscramper> These memory management functions allow to create, copy and delete and object, and if copy is correctly used then RefT needs to be freed (unrefed) multiple times. If copy is not used at all I simply need to call unref once
18:03:46FromDiscord<haxscramper> So it works like a regular pointer, or as poor man's shared\_ptr
18:05:55FromDiscord<haxscramper> C++ bindigs can just use destructors etc. and do all the ref-unref things internally.
18:07:22FromDiscord<ant1fact> In reply to @ant1fact "I am planning to": Sorry to bump this, can anyone chime in? ❤️
18:08:52FromDiscord<haxscramper> In reply to @ant1fact "Sorry to bump this,": You cant codegen C++ class from nim . The best solution would be to exportc nim procs, then call it on the C++ side
18:09:15FromDiscord<haxscramper> In reply to @haxscramper "https://github.com/haxscramper/hnimast/blob/master/": This
18:09:27FromDiscord<haxscramper> Actually next message, with code example
18:09:52FromDiscord<haxscramper> And I already managed to break and deprecate macro example I linked to so, just follow general idea
18:10:31FromDiscord<haxscramper> Also if you accept/return any nim types in your proc implementation you would have to put them to header as well
18:11:21FromDiscord<haxscramper> Actually it is another reason why --header might be useful ...
18:12:21FromDiscord<ant1fact> wow
18:12:28FromDiscord<ant1fact> not sure if you just save me days or weeks
18:12:34FromDiscord<ant1fact> of banging my head against the wall
18:12:51FromDiscord<haxscramper> @treeform do you plan to support C++ class generation in genny?
18:13:00*jjido joined #nim
18:13:09FromDiscord<haxscramper> For this specific kind of problem
18:14:06FromDiscord<haxscramper> And also for things like general interop with libraries that rely on OOP features. Like qt etc. considering you already would need to implement mapping of the Nim types to C/C++
18:15:13FromDiscord<haxscramper> Or would you be interested in me adding support for this?
18:16:44FromDiscord<haxscramper> I need to (re) implement it either way for qt wrappers, bit having related code on one place would be beneficial in the long run, since this stuff is really general and needed in fair number of places.
18:17:34FromDiscord<Gumber aka Zachary Carter> In reply to @haxscramper "I'm not sure what": Yeah I guess the use case you're describing differs quite a bit from what I had in mind
18:17:59FromDiscord<Gumber aka Zachary Carter> Because normally when I interop with C/C++ code I'm consuming C or C++ code from a static or shared library
18:18:13FromDiscord<Gumber aka Zachary Carter> and I normally don't write that code
18:18:30FromDiscord<Gumber aka Zachary Carter> I don't have too many situations where I'm writing some code in Nim and then calling it from C or C++
18:18:52FromDiscord<Gumber aka Zachary Carter> but I guess in the case of stuff like Qt this is very much necessary
18:18:57FromDiscord<Gumber aka Zachary Carter> since it's probably like all C++ virtual interfaces
18:19:04FromDiscord<Gumber aka Zachary Carter> that you have to provide implementations for
18:19:26FromDiscord<Gumber aka Zachary Carter> sorry - I just guess the context of the discussion went completely over my head initially heh
18:19:52FromDiscord<haxscramper> yes, those are two separate problems
18:20:16FromDiscord<Gumber aka Zachary Carter> agreed
18:23:45*max22- quit (Ping timeout: 260 seconds)
18:24:19FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3yAI
18:24:41FromDiscord<Gumber aka Zachary Carter> ugh
18:24:43FromDiscord<haxscramper> Generating C++ classes requires `#include` of all things that were used in public API for that class
18:25:15FromDiscord<haxscramper> Which naturally brings us back to genny, since I need to `exportc` all things that were used, in order to be able to include them in C++ again
18:25:22FromDiscord<Gumber aka Zachary Carter> right
18:25:28FromDiscord<Gumber aka Zachary Carter> all this for Qt huh?
18:25:33FromDiscord<haxscramper> yes
18:25:34FromDiscord<Gumber aka Zachary Carter> jesus...
18:26:14FromDiscord<haxscramper> And I also need to make sure that generated classes are placed somewhere qt moc can see, because I don't want to reimplement it from scratch
18:26:40FromDiscord<treeform> In reply to @haxscramper "<@107140179025735680> do you plan": Yes I eventually would like to support C++, and generate the proper OOP features like we do for python/node.
18:27:11FromDiscord<treeform> In reply to @haxscramper "I need to (re)": I think genny works the other way, you have nim library and what you want to export it to C++ people.
18:27:33FromDiscord<haxscramper> Qt use case is like both things at once
18:27:34FromDiscord<treeform> its nim -> X language, not X language -> nim.
18:27:44FromDiscord<haxscramper> I need to export nim to C++ and then import C++ back to nim
18:27:58FromDiscord<haxscramper> But nim to C++ comes first
18:28:10FromDiscord<treeform> ok
18:36:12FromDiscord<ant1fact> @haxscramper any good alternatives to Qt ? I would like to avoid the troubles you described earlier
18:36:51FromDiscord<haxscramper> Any other nim gui framework
18:37:17FromDiscord<haxscramper> I don't do gui, I do qt for the sake of doing qt
18:37:33FromDiscord<haxscramper> Torture test for hcparse basically
18:37:46FromDiscord<haxscramper> And for nim interop capabilities
18:37:52FromDiscord<haxscramper> And for haxdoc as well
18:37:53FromDiscord<ant1fact> I see
18:52:45*max22- joined #nim
18:59:53FromDiscord<treeform> do you have an example of what hexdoc generated output looks like?
19:01:14FromDiscord<haxscramper> the question is whether I have haxdoc in the first place ...
19:02:32FromDiscord<haxscramper> And so far the answer is no, I don't. The best I can give you right now is raw data, like json (via jsony), or sql database, or XML.
19:02:44FromDiscord<treeform> ok not ready yet, got it
19:17:33FromDiscord<enthus1ast> @ant1fact\: the gtk wrapper is capable (gintro)
19:18:14FromDiscord<enthus1ast> https://github.com/StefanSalewski/gintro
19:18:17nrds<R2D299> itHub: 7"High level GObject-Introspection based GTK3/GTK4 bindings for Nim language"
19:18:48FromDiscord<ant1fact> Many thanks, I will take a look
19:19:04FromDiscord<enthus1ast> also https://github.com/Dankr4d/BF2142Unlocker
19:19:07nrds<R2D299> itHub: 7"This project aims to unlock all weapons in BF2142 (coop/lan mode). You can equip/customize your soldier ingame."
19:19:14FromDiscord<enthus1ast> this is a big application in gintro
19:20:04FromDiscord<ant1fact> looks pretty good tbh
19:20:41FromDiscord<QueenFuckingAdrielle> Hiii, quick question.... are generics completely resolved during compilation or is there a runtime cost to performance?
19:20:59NimEventerNew thread by Ggibson: Weave+ARC WIP or my bug?, see https://forum.nim-lang.org/t/8414
19:27:54FromDiscord<Rika> In reply to @QueenFuckingAdrielle "Hiii, quick question.... are": Compile time only
19:28:00FromDiscord<Rika> No runtime cost I believe
19:28:40FromDiscord<Elegantbeef> Indeed it's all expanded at CT to be a procedure that takes all the args
19:29:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3yAW
19:29:39FromDiscord<QueenFuckingAdrielle> okay cool, its my understanding that some languages will end up type casting at runtime, didnt think that was the case with nim though
19:29:57FromDiscord<Yardanico> usually it's the case with languages that have a VM/bytecode interpreter
19:30:10FromDiscord<Yardanico> nim is fully statically compiled though, it doesn't have any VM at runtime
19:30:21FromDiscord<QueenFuckingAdrielle> ahhh i see, yea i heard that about java specifically, but wasn't sure
19:30:36FromDiscord<QueenFuckingAdrielle> cool, thank you for the help!
19:59:44FromDiscord<SivadNai> Can anyone find me an example for " https://nim-lang.org/docs/registry.html#getUnicodeValue%2Cstring%2Cstring%2CHKEY " like, say I want to get the value of HKLM\Software\Microsoft\Windows NT\CurrentVersion (sorry to be dim)
20:01:30FromDiscord<Elegantbeef> Is it not `getUnicodeValue("Software\Microsoft\Windows NT", "CurrentVersion", HkeyLocalMachine)`?
20:09:30FromDiscord<eliyanov> Hey guys
20:09:41FromDiscord<SivadNai> I thought so, but that doesn't work for me
20:10:14FromDiscord<eliyanov> sent a code paste, see https://play.nim-lang.org/#ix=
20:11:06FromDiscord<eliyanov> sent a long message, see http://ix.io/3yB7
20:11:30FromDiscord<eliyanov> sent a code paste, see https://play.nim-lang.org/#ix=3yB8
20:11:43FromDiscord<eliyanov> sent a code paste, see https://play.nim-lang.org/#ix=3yB8
20:11:57FromDiscord<Yardanico> can you please use playground or some pasting service?
20:12:01FromDiscord<Yardanico> your code is not being inserted correctly to discord
20:12:02FromDiscord<Gumber aka Zachary Carter> yeah
20:12:07FromDiscord<Gumber aka Zachary Carter> stop please
20:12:10FromDiscord<eliyanov> sent a code paste, see https://play.nim-lang.org/#ix=3yB9
20:12:31FromDiscord<SivadNai> my eyes
20:12:34FromDiscord<Gumber aka Zachary Carter> please use some clipboard service or play.nim-lang.org or something
20:12:56FromDiscord<Rika> I have long given up my eyes for better abilities
20:13:07FromDiscord<Yardanico> and also please ask the question itself :) @eliyanov
20:13:07FromDiscord<Gumber aka Zachary Carter> you a cyborg now?
20:13:08FromDiscord<eliyanov> If I edit it does it send a new one every time?
20:13:15FromDiscord<Rika> But seriously who thought changing the matrix bot was a good idea
20:13:20FromDiscord<Gumber aka Zachary Carter> yes on some bridged channels
20:13:22FromDiscord<Rika> Yes
20:13:29FromDiscord<Gumber aka Zachary Carter> but besides - the rule is not to copy and paste large blocks of code in here
20:13:52FromDiscord<Gumber aka Zachary Carter> you can just leave those unedited
20:13:59FromDiscord<Gumber aka Zachary Carter> don't worry about it 🙂
20:14:02FromDiscord<Yardanico> In reply to @Gumber "but besides - the": well it was the rule before the IRC bridge got proper code pasting support :)
20:14:09FromDiscord<Yardanico> but the matrix bridge isn't made by me and it has some issues like that
20:14:16FromDiscord<Gumber aka Zachary Carter> eh either way I think it's best to limit it
20:14:40FromDiscord<Gumber aka Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=3yBb
20:14:46FromDiscord<Gumber aka Zachary Carter> and it's a PITA to scroll through for logs
20:15:00FromDiscord<eliyanov> Okay I'll try asking with words. If I want to assign the result of a macro that happens to be an ObjectTy block, why does it say "Error\: invalid expression\: object ..."
20:15:00FromDiscord<Gumber aka Zachary Carter> you da boss tho 😉
20:15:46FromDiscord<Yardanico> @eliyanov because IIRC you have to generate the whole typedef block yourself]
20:15:47FromDiscord<Yardanico> (edit) "yourself]" => "yourself"
20:15:50FromDiscord<Yardanico> I think you can't just do `type Dat = typeDef(@["name"], @["string"])`
20:15:54FromDiscord<Gumber aka Zachary Carter> you need to return a nimnode
20:16:05FromDiscord<Yardanico> you have to do typedef(Dat, ...) and generate `type Dat` inside of the macro
20:16:08FromDiscord<Gumber aka Zachary Carter> and it needs to be a statement list
20:16:26FromDiscord<Yardanico> In reply to @Gumber "and it needs to": not neccesarily
20:16:30FromDiscord<Yardanico> (edit) "neccesarily" => "necessarily"
20:16:37FromDiscord<Gumber aka Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=3yBc
20:16:41FromDiscord<eliyanov> Why does it work with procTy blocks though
20:16:42FromDiscord<Gumber aka Zachary Carter> yeah you're right
20:17:00FromDiscord<SivadNai> Ah, it is getUnicodeValue("Software\\Microsoft\\Windows NT\\CurrentVersion", "CurrentVersion", registry.HKEY_LOCAL_MACHINE)
20:18:31FromDiscord<SivadNai> I would almost be tempted to update the documentation there
20:25:27FromDiscord<Gumber aka Zachary Carter> In reply to @eliyanov "Why does it work": I think this is because when you do it with a proc, you're still generating the entire proc inside the macro
20:25:49FromDiscord<Gumber aka Zachary Carter> if you're putting it on the right hand side of the assignment operator, then you're creating essentially a function pointer
20:26:11FromDiscord<Gumber aka Zachary Carter> unless you mean you can do like
20:26:40FromDiscord<Gumber aka Zachary Carter> `type MyFunctionPointerType = genProcHere`
20:26:47FromDiscord<Gumber aka Zachary Carter> if that's the case, then I don't really have a good explanation
20:27:15FromDiscord<Gumber aka Zachary Carter> I assume when you asked that question you meant doing something like:↵↵`var myFunctionPointer = genProcSignatureHere(...)`
20:27:58FromDiscord<Gumber aka Zachary Carter> although that doesn't even really make sense... I guess I'm not sure what you're trying to do with the `procTy` blocks
20:32:53FromDiscord<Yardanico> In reply to @Gumber "I assume when you": i mean that does make sense since you can make anonymous procs and assign them to variables
20:33:12FromDiscord<Gumber aka Zachary Carter> yeah true
20:33:22FromDiscord<Gumber aka Zachary Carter> sorry I have covid too so my brain is a little foggy
20:33:32FromDiscord<Gumber aka Zachary Carter> but yeah closures
20:33:39FromDiscord<Gumber aka Zachary Carter> forgot they are a thing for a moment
20:33:47FromDiscord<Yardanico> !eval var test = (proc = echo "hi"); test()
20:33:49NimBothi
20:33:49FromDiscord<Gumber aka Zachary Carter> or sorry
20:33:52FromDiscord<Gumber aka Zachary Carter> first class function
20:33:55FromDiscord<Gumber aka Zachary Carter> jesus
20:34:01FromDiscord<Gumber aka Zachary Carter> my brain really isn't working
20:34:11FromDiscord<Yardanico> with anon procedures you can achieve one-line programs in nim for most cases
20:34:11FromDiscord<Gumber aka Zachary Carter> hi NimBot
20:34:15FromDiscord<Yardanico> !ping
20:34:15NimBotpong
20:34:15FromDiscord<StardustAnnouncer> Pong!
20:34:31FromDiscord<Yardanico> !uptime
20:40:30FromDiscord<Ale_S> Hi everyone ... I'm trying Nim, but when I compile the antivirus 'Bitdefender' it finds a virus in the .exe file that is created .. it tells me "the file has been infected with Gen: Variant.Bulz.494784" .. have you also had similar problems?
20:41:12FromDiscord<enthus1ast> yeah, a few weeks ago all nim stuff was flagged
20:41:13FromDiscord<SivadNai> sounds familiar
20:41:36FromDiscord<enthus1ast> all false positives, maybe report it to bitdefender
20:42:44FromDiscord<enthus1ast> have reported my stuff to microsoft
21:12:24*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:49:55FromDiscord<gerwy> @treeform god, you make so many nim packages, when do you have time for that? How do you keep up with everything?
21:51:58*max22- quit (Quit: Leaving)
21:54:34FromDiscord<treeform> In reply to @Life Sucks "<@!107140179025735680> god, you make": 1. I like to program and am pretty fast at it. ↵2. I work on Nim at my job (we might be hiring more Nim programmers soon) and some of the libs I make are for work.↵3. Programming is my hobby, so instead of watching TV, playing computer games I just make stuff with Nim. Some times I publish it as libraries.
21:55:12FromDiscord<gerwy> Ahh sounds like a dream life
21:56:20FromDiscord<gerwy> for real, i would love to use nim in my future job too and to spend time programming instead of talking about programming
21:56:43FromDiscord<treeform> Yeah I work on a team of 1 and its pretty sweet.
21:57:12FromDiscord<treeform> I hate needless meetings, jet let me code.
21:57:19FromDiscord<treeform> (edit) "jet" => "just"
21:58:15FromDiscord<treeform> My company uses a ton of python, and they constantly have performance issues, crashes and bugs that would have been caught by Nim's type system.
22:03:51FromDiscord<gerwy> hah yeah i guess Nim would perfectly replace python in that case↵well unfortunately i can't use Nim anywhere other than my own projects, i will have big exam in a year and there are rumors we will be able to use the language of our choice (probably those that we had to learn) but if not, then maybe i could make them let me use Nim if its similar to Python so they don't need to worry about checking source code (because Python is one of tho
22:26:09FromDiscord<Gumber aka Zachary Carter> Just compile your code to C and submit the C code
22:26:19FromDiscord<Gumber aka Zachary Carter> 🙂
22:54:10*Gustavo6046 quit (Ping timeout: 260 seconds)
22:57:08*Gustavo6046 joined #nim