<< 07-10-2021 >>

00:08:23FromDiscord<Elegantbeef> Presently it's just cause seqs/strings have the same internal representation, if either one changes it stops working
00:11:46*rockcavera quit (Remote host closed the connection)
00:15:20*rockcavera joined #nim
00:40:14nrds<Prestige99> Elegantbeef I have an interesting question for you, if you have a min to look. Has to do with that animation macro
00:40:54nrds<Prestige99> https://git.einheit.tech/EinheitTechnologies/shade/src/commit/39443345601dfd2b750b829db9aa4880cf5ec8dd/src/shadepkg/game/animation.nim#L165 this assignment can't be done with a proc/template in the `foo=` form, but I'd like it to. Would I need a special case for it?
00:41:31nrds<Prestige99> Curious if I could just generate an AST that'd be parsed in the same way as writing "foo = 5" where `foo=` is a proc
00:47:39FromDiscord<Elegantbeef> properties only work applied on a symbol
00:48:58FromDiscord<Elegantbeef> Unless you use accquotes as such https://play.nim-lang.org/#ix=3B3w
00:55:23nrds<Prestige99> hmm
00:57:29FromDiscord<Elegantbeef> I suppose if you had foo be `proc foo=(a: typedesc[void], val: int)` you could do `void.foo = val` 😛
00:58:23nrds<Prestige99> atm I have method `scale=`*(this: Node, scale: DVec2) - thoughts?
00:58:40nrds<Prestige99> Maybe I've coded myself into a corner.. didn't expect this to break down with the animation system
00:58:45FromDiscord<Elegantbeef> Use a macro to check if it's a property
00:59:48nrds<Prestige99> Like to see if it's a proc ending with = ?
00:59:55FromDiscord<Elegantbeef> Yes
01:01:21FromDiscord<Elegantbeef> Also this compiles? https://git.einheit.tech/EinheitTechnologies/shade/src/commit/39443345601dfd2b750b829db9aa4880cf5ec8dd/src/shadepkg/game/animation.nim#L151 shouldnt it be `isnot`
01:01:36nrds<Prestige99> it works yeah
01:01:46FromDiscord<Elegantbeef> Odd
01:03:09nrds<Prestige99> https://git.einheit.tech/EinheitTechnologies/shade/src/commit/39443345601dfd2b750b829db9aa4880cf5ec8dd/examples/basic/animationplayer_example.nim#L42 is the particular case I'm having an issue with
01:03:26nrds<Prestige99> I'm passing in `king.scale` so I don't think the macro can see it's a proc?
01:04:52FromDiscord<Elegantbeef> Where is scale?
01:05:12FromDiscord<Elegantbeef> Ah i've found it
01:05:18FromDiscord<Elegantbeef> you're passing the setter #1
01:05:33nrds<Prestige99> Right
01:05:42FromDiscord<Elegantbeef> so you'll need to do \`\`\` `scale=`(king)\`\`\`\`
01:05:44FromDiscord<Elegantbeef> I mean getter
01:05:51nrds<Prestige99> oh
01:06:33FromDiscord<Elegantbeef> it's a typed macro so with that you can get if it's a property
01:06:58FromDiscord<Elegantbeef> I dont quite get why this is a macro
01:07:31FromDiscord<Elegantbeef> You're using 0 introspection, so i think this'd work as a template
01:08:37nrds<Prestige99> But it'll need to be one to check if it's a property vs a setter yeah?
01:09:07FromDiscord<Elegantbeef> Not really since you can make a macro that does it for you 😀
01:09:44nrds<Prestige99> I wish I could just pretend it's a property when I pass it into the macro/template 🤔
01:09:53nrds<Prestige99> instead of scale=(king) or w/e
01:10:35FromDiscord<Elegantbeef> You can do `king.scale` check if it's a proc/method if so add a `=`
01:13:17FromDiscord<gnu+linux user> In reply to @รєคɭ๓๏שє "haven't seen any Hacktoberfest": what does it have to do with me
01:21:10FromDiscord<Elegantbeef> Prestige for instance this https://play.nim-lang.org/#ix=3B3I
01:22:26FromDiscord<Elegantbeef> that `newLit(10)` should be whatever you feed into the value, this can just be called inside the proc
02:01:26*krux02 quit (Remote host closed the connection)
02:01:37NimEventerNew thread by Rb3: How to use memory leak detection tools on Windows with --gc:arc and -d:useMalloc?, see https://forum.nim-lang.org/t/8483
02:08:35FromDiscord<Varriount> @PMunch Can futhark handle Windows API headers?
02:14:02FromDiscord<NullCode> for windows api, use `winim`
02:14:17FromDiscord<NullCode> https://github.com/khchen/winim/
02:14:18nrds<R2D299> itHub: 7"Nim's Windows API and COM Library"
02:14:23FromDiscord<NullCode> it's just better
02:16:08*Zevv joined #nim
02:23:17*arkurious quit (Quit: Leaving)
02:51:49nrds<Prestige99> Is there a place that defines what all the nim node kinds are?
02:55:39FromDiscord<impbox [ftsf]> it's an enum so i guess so
02:56:06nrds<Prestige99> I meant like, documentation
02:56:20FromDiscord<impbox [ftsf]> https://github.com/nim-lang/Nim/blob/devel/lib/core/macros.nim#L26
02:57:20FromDiscord<impbox [ftsf]> I think that's all you get, the names are mostly easy to figure out, but if you've got questions
02:57:37FromDiscord<impbox [ftsf]> I guess you can also just create some and look at their repr
02:57:44nrds<Prestige99> Thanks
02:59:25FromDiscord<SirFozz> Is there any difference between `%%` and `mod`?
03:00:24FromDiscord<impbox [ftsf]> yep!
03:01:37FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=3B42
03:01:49FromDiscord<SirFozz> Wait I believe I found it
03:02:10FromDiscord<SirFozz> `%%` Can only accept ints as arguments
03:02:31FromDiscord<impbox [ftsf]> they have different behaviours for negatives
03:02:42FromDiscord<SirFozz> Oh really
03:02:55FromDiscord<impbox [ftsf]> check the output of that example i posted
03:02:55FromDiscord<SirFozz> I'll check that link out
03:02:58FromDiscord<SirFozz> Yeah
03:04:02FromDiscord<SirFozz> I though it was just redundancy at first, but that's neat
03:04:06FromDiscord<SirFozz> Thank you for the help
03:05:05FromDiscord<impbox [ftsf]> probably we should add in runnable examples for %% like mod has
03:05:44FromDiscord<impbox [ftsf]> %% is implemented as `cast[int](cast[uint](x) mod cast[uint](y))`
03:06:15FromDiscord<Rika> How fun
03:06:18FromDiscord<impbox [ftsf]> hmm weird, i thought it would convert them rather than cast
03:09:13FromDiscord<impbox [ftsf]> seems the result is the same shrug
03:51:49NimEventerNew thread by Alexeypetrushin: Question about algorithm.upperBound, see https://forum.nim-lang.org/t/8484
04:06:02*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:39:54*xet7 quit (Remote host closed the connection)
04:40:57*xet7 joined #nim
05:00:03*rockcavera quit (Remote host closed the connection)
05:55:51FromDiscord<NullCode> https://media.discordapp.net/attachments/371759389889003532/895549963512201226/unknown.png
05:55:56FromDiscord<NullCode> if there are more than 1 defer
05:56:04FromDiscord<NullCode> which one's executed last?
05:56:10FromDiscord<impbox [ftsf]> did you check?
05:56:20FromDiscord<NullCode> docs?
05:56:27FromDiscord<impbox [ftsf]> try it out and see what happens
05:56:30FromDiscord<Elegantbeef> first in last out
05:56:47FromDiscord<NullCode> oh so first one's executed last
05:56:48FromDiscord<NullCode> gotchu
05:56:54FromDiscord<NullCode> In reply to @impbox "try it out and": well it's not clear
05:56:59FromDiscord<Elegantbeef> well it defers everything after the body
05:57:17FromDiscord<Elegantbeef> so after everything below it is ran the defer body is ran
05:57:31FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3B4B
05:57:44FromDiscord<NullCode> In reply to @Elegantbeef "so after everything below": yeah
05:57:49FromDiscord<Elegantbeef> FILO 😛
05:58:04FromDiscord<NullCode> but since i was told `defer` does stuff at the very end
05:58:08FromDiscord<Elegantbeef> Impbox that isnt getting nicoscripter running, how dare you not work 24/7 on it
05:58:17FromDiscord<impbox [ftsf]> i'm at work atm =p
05:58:36FromDiscord<impbox [ftsf]> will get back to nicoscripter this evening
05:58:39FromDiscord<NullCode> (edit) "end" => "end↵i was wondering what starts first after ending last"
05:58:42FromDiscord<Elegantbeef> I mean if it did it any other way it'd not be defered
05:58:50FromDiscord<impbox [ftsf]> though i'm kind of at a loss as to how to proceed with it
06:00:32FromDiscord<Elegantbeef> Yea like i said i can always take a look if you want
06:00:52FromDiscord<impbox [ftsf]> yeah, gotta sort out some stuff before i can send since i had to change stuff in nico
06:00:58FromDiscord<Elegantbeef> Ah
06:01:06FromDiscord<Elegantbeef> sorry 😛
06:02:22FromDiscord<Elegantbeef> But the NimVM ran the code fine if you didnt reload?
06:02:26FromDiscord<impbox [ftsf]> nah
06:02:38FromDiscord<impbox [ftsf]> it compiles it, but errors on invoke
06:02:55FromDiscord<Elegantbeef> Did the code work in a native build?
06:02:59FromDiscord<impbox [ftsf]> yep
06:03:13FromDiscord<impbox [ftsf]> (i better check it still works)
06:04:02FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3B4F
06:04:08*vicfred quit (Quit: Leaving)
06:04:14FromDiscord<Elegantbeef> If it does perhaps a emscripten issue with the nimvm, making the nimscript just `echo "Hello world"` with no additions, imports, or anything is where we should start i guess
06:04:28FromDiscord<impbox [ftsf]> no error if the functions are just discard
06:04:44FromDiscord<Elegantbeef> Guess i should go copy treeforms emscripten example and do some tests with just a console app
06:04:49FromDiscord<impbox [ftsf]> no error if just echoing
06:04:56FromDiscord<impbox [ftsf]> i'll tar up now and send to you
06:09:13FromDiscord<impbox [ftsf]> @ElegantBeef https://github.com/ftsf/nico/tree/nicoscripter https://github.com/ftsf/nico/tree/nicoscripter/examples/nicoscripter
06:09:26FromDiscord<impbox [ftsf]> can run `nimble webr` from examples/nicoscripter to build for web
06:09:38FromDiscord<Elegantbeef> ok thanks!
06:10:09FromDiscord<impbox [ftsf]> assuming you have emscripten installed
06:10:18FromDiscord<Elegantbeef> Yea i do
06:13:46*neurocyte0132889 joined #nim
06:13:46*neurocyte0132889 quit (Changing host)
06:13:46*neurocyte0132889 joined #nim
06:20:27FromDiscord<Rika> isnt it in the docs how defers are run
06:21:19FromDiscord<Elegantbeef> Odd emscripten errors with a python error, lovely
06:22:13FromDiscord<impbox [ftsf]> @Rika doesn't seem like it's in the manual
06:22:17FromDiscord<impbox [ftsf]> D:
06:22:21FromDiscord<Rika> i remember it being documented
06:22:31FromDiscord<impbox [ftsf]> yeah sounds familiar too
06:22:32FromDiscord<Rika> because i know the order before having tried
06:26:30FromDiscord<Elegantbeef> I really wish software just worked
06:26:40FromDiscord<impbox [ftsf]> that'd be nice
06:31:27FromDiscord<Rika> i wish software is sound as soon as i write it
06:31:36FromDiscord<Rika> a world where tests arent needed xddd
06:33:47FromDiscord<Elegantbeef> Ah issue was emcc was expecting llvm11 but i gave it 12 it seems
06:34:38FromDiscord<impbox [ftsf]> you monster
06:35:18FromDiscord<Elegantbeef> How dare i have multiple llvm versions 😛
06:35:52FromDiscord<Elegantbeef> `Aborted(No EM_ASM constant found at address 169128)` much more interesting error
06:37:30FromDiscord<retkid> whats the fastest way to do threading
06:37:42FromDiscord<retkid> do i just spawn all the tasks i need to do whenever?
06:37:58FromDiscord<retkid> well i take that back
06:38:09FromDiscord<retkid> does anyone have a good write up on threading in nim?
06:40:11FromDiscord<Rika> uh
06:40:15FromDiscord<Rika> i feel like we do
06:40:19FromDiscord<Rika> but i dont recall where
06:40:24FromDiscord<retkid> I looked for a little bit
06:40:34FromDiscord<retkid> threadpools doesn't have anything on the manual
06:40:37FromDiscord<Rika> gumberrrrrrrrr your lectures are needed
06:40:37FromDiscord<retkid> threads does tho
06:41:13FromDiscord<retkid> how about instead of him lecture, he add it to the manual...↵↵i was reading one of the nim guides on it, and half way it turned into german and i was like "alrighty then"
06:44:33*jjido joined #nim
06:46:37FromDiscord<impbox [ftsf]> if you have nim-in-action it has a section on threads
06:46:46FromDiscord<retkid> its not too extensive
06:47:07FromDiscord<retkid> and nothing on pools
06:47:25FromDiscord<impbox [ftsf]> chapter 6.2.2 is about thread pools
06:47:28FromDiscord<retkid> ooo
06:47:31FromDiscord<retkid> maybe i mssed
06:47:33FromDiscord<retkid> (edit) "mssed" => "missed"
06:48:11FromDiscord<impbox [ftsf]> i haven't read the threads stuff much so i dunno how useful it is, but it seems to have a fair chunk of content
06:48:43FromDiscord<impbox [ftsf]> in general i'd recommend the book though
06:49:09FromDiscord<retkid> my initial instinct is the pool should be equal to the amount of threads available to the cpu, and instructions get sent in, each one sent to each thread
06:49:26FromDiscord<retkid> and each instruction must wait for the next avalible slot
06:49:28FromDiscord<retkid> (edit) "avalible" => "available"
06:49:36FromDiscord<retkid> (edit) "and each instruction must wait for the next available slot ... " added "of 3"
06:49:37FromDiscord<retkid> (edit) "3" => "4"
06:49:39FromDiscord<Elegantbeef> Well i cannot get nico to run with wasm so that's fun
06:49:39FromDiscord<retkid> (edit) "4" => "x"
06:49:56FromDiscord<Elegantbeef> your project does not run for me ☹️
06:50:00FromDiscord<impbox [ftsf]> D:
06:50:03FromDiscord<retkid> D:
06:50:05FromDiscord<retkid> BAD
06:50:19FromDiscord<impbox [ftsf]> does it build?
06:50:33FromDiscord<Elegantbeef> It builds but aborts on initing nico
06:50:57FromDiscord<Rika> oh man job scheduling
06:51:06FromDiscord<Rika> In reply to @retkid "and each instruction must": job scheduling is relatively complex
06:52:59FromDiscord<retkid> In reply to @Rika "job scheduling is relatively": Yea i want to know about that but cant find muhc
06:53:04FromDiscord<retkid> (edit) "muhc" => "much"
06:53:12FromDiscord<retkid> suppose thats overkill for what im doing
06:53:17FromDiscord<Rika> because its not exactly beginner level
06:53:23FromDiscord<Rika> rather
06:53:35FromDiscord<Rika> not many people write beginner level content on job scheduling
06:53:40FromDiscord<retkid> Is it a thing where you probably learned it somewhere else
06:53:50FromDiscord<retkid> and can apply the concepts to nim
06:53:54FromDiscord<Rika> yes
06:54:13FromDiscord<retkid> coolio
06:54:14FromDiscord<retkid> well
06:54:44*PMunch joined #nim
06:54:45FromDiscord<Elegantbeef> Ah seems llvm12 fucked stuff up
06:54:51FromDiscord<retkid> I've never done multi threading before so I suppose i will continue to dig or I'll learn it in Kotlin
06:54:58FromDiscord<retkid> if kotlin can even do trhat
06:55:01FromDiscord<retkid> (edit) "trhat" => "that"
06:55:37FromDiscord<Rika> it can afaik
06:57:03PMunchHmm, that reminds me, I should write my multi-threading in Nim article soon
06:57:28FromDiscord<Elegantbeef> Indeed you should
06:57:34FromDiscord<Elegantbeef> Get at it, best be done by tomorrow
06:57:57PMunchBut I'm busy..
06:58:11FromDiscord<impbox [ftsf]> bebestdonebtomoryrow
06:58:50FromDiscord<Elegantbeef> Sorry we dont speak australian
07:05:49*max22- joined #nim
07:07:22FromDiscord<Elegantbeef> I might be wrong impbox but the issue seems possibly caused by the last line's odd indentation in the html
07:08:04FromDiscord<impbox [ftsf]> o_O
07:08:05FromDiscord<Elegantbeef> Or not
07:08:21FromDiscord<impbox [ftsf]> the problem I was having? or the problem you're having?
07:08:50FromDiscord<Elegantbeef> Yours, but i was wrong
07:11:09PMunchWhat's the issue?
07:11:40FromDiscord<Elegantbeef> The Vm isnt playing well with the iterative calling in wasm
07:11:49FromDiscord<Elegantbeef> Update/draw are where the issue occurs
07:12:33FromDiscord<Elegantbeef> Actually it's any proc that's implemented
07:12:37FromDiscord<Elegantbeef> Odd
07:14:20FromDiscord<Elegantbeef> ponders if it's a 32bit issue or an emscripten issue
07:21:18FromDiscord<Elegantbeef> Actually it could be a me problem with implemented routines
07:21:58*neurocyte0132889 quit (Read error: Connection reset by peer)
07:23:12*neurocyte0132889 joined #nim
07:23:13*neurocyte0132889 quit (Changing host)
07:23:13*neurocyte0132889 joined #nim
07:29:58FromDiscord<impbox [ftsf]> feel free to blame my code too
07:30:18FromDiscord<impbox [ftsf]> maybe we should test with something less crazy
07:31:01FromDiscord<impbox [ftsf]> export just some simpler procs
07:31:23FromDiscord<Elegantbeef> Indeed
07:31:41FromDiscord<Elegantbeef> Though i have a feeling they'll not work
07:41:10FromDiscord<NullCode> i wonder if i should wrap a 7z library
07:41:13FromDiscord<NullCode> to understand how this works
07:42:47*neurocyte0132889 quit (Read error: Connection reset by peer)
07:43:12*neurocyte0132889 joined #nim
07:43:12*neurocyte0132889 quit (Changing host)
07:43:12*neurocyte0132889 joined #nim
07:54:38*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:05:50*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
09:02:39PMunch@hotdog are you around?
09:03:11PMunchI added a rename callback, but I wanted to see what you thought of it before I merged it into master: https://github.com/PMunch/futhark/pull/2
09:09:28PMunchHmm, this is an interesting bug: https://play.nim-lang.org/#ix=3B54
09:12:23PMunchIt seems like it isn't able to see the NilLit as a valid proc..
09:27:28FromDiscord<qb> Does nim have pbkdf2 somewhere?
09:29:09FromDiscord<qb> To be more precise im looking for https://docs.python.org/3/library/hashlib.html#hashlib.pbkdf2_hmac
09:33:04FromDiscord<enthus1ast> @qb\: this? https://github.com/cheatfate/nimcrypto/blob/master/nimcrypto/pbkdf2.nim
09:57:52FromDiscord<Clonkk> What's the rules when using C++ type that already have move / copy rules and destructor defined with `=sink` / `=copy` / `=destroy` ?
09:59:13FromDiscord<haxscramper> Unknown
09:59:26FromDiscord<haxscramper> This is an open question how this should be mapped to the Nim code
09:59:28FromDiscord<Clonkk> That explains why I didn't know how it worked then \:D
10:00:12FromDiscord<haxscramper> Cxx destructor is invoked unconditionally, though if you are using ref T with placement new you might want to call it explicitly in the finalizer
10:00:40FromDiscord<haxscramper> Non-copyable objects might be mapped to =copy {.error.}
10:00:58FromDiscord<haxscramper> Better to have nim errors than cxx codegen failures
10:01:06FromDiscord<hotdog> In reply to @PMunch "<@472459996068839424> are you around?": Hey I'm here
10:01:18FromDiscord<hotdog> In reply to @PMunch "I added a rename": Thanks! I'll have a look
10:01:23FromDiscord<haxscramper> Non default-constructible can be mapped to {. requiresinit.}
10:01:36FromDiscord<Clonkk> The issue is getting stuff lke std\:\:unique\_ptr to work with Nim object
10:01:40FromDiscord<haxscramper> =sink - no idea
10:01:59FromDiscord<Clonkk> Currently, the Nim `=destroy` hooks do not get called
10:02:04FromDiscord<haxscramper> You mean ref object?
10:02:10FromDiscord<Clonkk> Same for pushing objetc into a std\:\:vector from Nim bindings
10:02:30FromDiscord<haxscramper> For impprtcpp objects or for nim ones?
10:03:12FromDiscord<Clonkk> Potentially, it's a generic type T. Shouldn't matter though; any object type can have `=destroy` hook and `=sink` hook that sould be called when performing operation on C++ containers
10:03:48FromDiscord<haxscramper> Oh, is see. Yes, this is a problem really.
10:04:08FromDiscord<haxscramper> You work with c++ containers on the C++ side or on nim side?
10:04:22FromDiscord<Clonkk> https://github.com/Clonkk/nim-cppstl/issues/15
10:05:07FromDiscord<Clonkk> The setting is Nim binding to C++ class (std\:\:vector, std\:\:unique\_ptr, std\:\:shared\_ptr). From Nim side you have `CppVector` which is a binding to std\:\:vector
10:05:57FromDiscord<Clonkk> Ideally pushing a Nim object in a `CppVector` should keep the memory consistent during Move / copy / destroy
10:06:18FromDiscord<Clonkk> The issue will arise with any C++ library that uses containers or smart pointer (or worse custom smart pointers / custom containers)
10:07:46FromDiscord<haxscramper> Another pain point that has to be solved I guess
10:08:30FromDiscord<haxscramper> Right now I don't think I have any concrete ideas about how to solve this, at least without digging into codegen and examining all interactions
10:11:45FromDiscord<haxscramper> But generally speaking I'm not sure if this can be achieved without making some very strange codegen and emit hacks, or making some sort of NimAcceptor cxx object that manages lifetime by calling destructors, moves and so on.
10:12:07FromDiscord<haxscramper> Right now this is just a hypothesis
10:17:58FromDiscord<Clonkk> Right, so I don't know anything about codegen in the compiler. My gut feeling (probably wrong) is that Nim `=sink` / `=copy` / `=destroy` is very similar to the "rule of 3" in C++, so I would assume managing lifetime of a C++ object through Nim's hooks is do-able
10:18:13FromDiscord<Clonkk> So it should be, at the very least, "mappable"
10:19:07FromDiscord<Clonkk> Then there's also the issue of copy assignment being deleted in C++ causing all sort of codegen bugs
10:20:07FromDiscord<Clonkk> If Nim handles copy by calling the C++ version of the `=copy` hooks for instance, you'd avoid the codegen error (and most likely having a `=copy` that's not an error if copy assignment is deleted is a bug)
10:20:52FromDiscord<Clonkk> Currently, if `=copy` is declared as a {.error.}, the codegen can still generate C++ copy assignmet \:) (which of course doesn't compile)
10:22:50FromDiscord<haxscramper> Wait what
10:24:02FromDiscord<haxscramper> We can double down on dirty hacks and put emit everywhere, maybe it will provide a solution that is at least correct wrt. to runtime behavior
10:24:13*krux02 joined #nim
10:25:21FromDiscord<haxscramper> Sink is an optimization, while in cxx move constructor is guaranteed to be called, something like that
10:25:36FromDiscord<haxscramper> Nim uses sink optionally
10:25:49FromDiscord<haxscramper> I don't know how reliable the rules are
10:26:17FromDiscord<haxscramper> For example when passing to a function, depending on the further uses of a given object it might be either a copy or a sink
10:26:18FromDiscord<haxscramper> And so on
10:26:35FromDiscord<haxscramper> We are talking about assignment, but even in this case behavior is unclear to me
10:27:45FromDiscord<Clonkk> I thought the difference was that C++ gives you a syntax to explicitly do one of the other (i.e. DYI solution) while Nim estimates based on memory ownership, size of object (and maybe other heuristics) whether it can move or should copy ?
10:28:27FromDiscord<Clonkk> If it's optionnal then I don't understand sink parameters in function
10:29:34FromDiscord<haxscramper> Well, sink is an optimization, it cannot make your code more correct
10:30:16FromDiscord<haxscramper> So cxx might use it for unique pointers and other things to explicitly transfer ownership, I don't think nim can do this
10:30:55FromDiscord<haxscramper> I need to write some basic test suite that shows these differences, I'm not really sure myself how they are handled
10:35:12FromDiscord<Clonkk> Okay
10:35:32FromDiscord<Clonkk> This probably also means that mapping `=destroy` to the object destructor is actually wrong
10:35:53FromDiscord<Clonkk> You then have a Nim hoo kthat explicitly calls a C++ destructor when C++ destructor would already be called
10:36:14FromDiscord<Clonkk> (which can still work if Nim generate hooks in the right place, but there'sn oguarantee)
10:45:49FromDiscord<haxscramper> It would be much better if nim had precise tools to manage object lifetimes, like default or explicit construction, "require moved argument", "disallow copy" and so on
11:11:17FromDiscord<tandy> what would `sizeof(MD5Buffer = array[0..63, uint8])` output? 63?
11:11:36FromDiscord<enthus1ast> 64
11:11:44FromDiscord<tandy> ok ty
11:12:07FromDiscord<enthus1ast> at least array[0..63, uint8] is 64 byte
11:12:25FromDiscord<enthus1ast> not sure if you can assign in sizeof
11:21:57FromDiscord<tandy> does this look right?
11:21:57FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3B5G
11:22:12FromDiscord<tandy> i took code from nimSetMem
11:22:50FromDiscord<hotdog> @PMunch should I test this in my wrapper? Or is it in progress? I've set up your branch but can't figure out how to add the callback
11:22:52FromDiscord<tandy> sent a code paste, see https://paste.rs/rbb
11:23:04FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3B5H
11:24:35PMunch@hotdog, please do :) Here is an example on how the callback can be added: https://github.com/PMunch/futhark/pull/3/files
11:25:23PMunchWith line 13 obviously not commented out :P
11:27:47FromDiscord<hotdog> @PMunch ah I think it's just picking up the cached version, even though the callback has changed
11:28:11FromDiscord<hotdog> Is there a flag to ignore the cache?
11:28:21PMunchAh yes, you need to reset your futhark cache for the callback to be called again. I guess I should add that to the README..
11:28:44PMunchNo flag as of right now, simply delete the futhark_<hash>.nim file from your nimcache directory
11:29:27PMunchI wanted to have it ignore the cache when -f was passed. But I couldn't figure out how
11:31:18FromDiscord<hotdog> Gotcha
11:32:18FromDiscord<hotdog> Might be worth hashing the callback proc and using that in the cache too. Not sure if there's something in stdlib
11:33:58PMunchHmm, yes that would be a good idea..
11:34:17PMunchNot entirely sure I can cache a proc though
11:34:25PMunchOr hash a proc rather
11:34:40PMunchAdded a switch to master now that prevents cache usage
11:35:15PMunch`git fetch --all && git rebase master` should bring them into the branch you're on
11:36:03FromDiscord<hotdog> @PMunch never used it, but this may work - https://nim-lang.org/docs/macros.html#symBodyHash%2CNimNode
11:36:17PMunchI also force pushed it over the branch now
11:36:34FromDiscord<hotdog> In reply to @PMunch "Added a switch to": Cool
11:36:58PMunchQuestion is just if I actually get the proc as a symbol
11:38:26FromDiscord<hotdog> Ah
11:44:33PMunchYeah I just get an error saying that `renameCallback` is of type RenameCallback while it expects a NimNode
11:54:25*Vladar joined #nim
12:00:19*max22- quit (Ping timeout: 265 seconds)
12:04:14*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:30*supakeen joined #nim
12:07:57*neurocyte0132889 joined #nim
12:07:57*neurocyte0132889 quit (Changing host)
12:07:57*neurocyte0132889 joined #nim
12:10:39FromDiscord<hotdog> @PMunch in the rename callback do I need to handle name collisions? Or will Futhark still do that with the output of the rename cb?
12:11:32PMunchFuthark will still run it through it's renaming scheme
12:11:38PMunchits*
12:11:42FromDiscord<hotdog> Ok cool
12:12:10PMunchSo first your callback is run, then it removes _ and __, normalizes the identifier, and adds kind and hash if there are collisions
12:12:25FromDiscord<hotdog> I see
12:12:57FromDiscord<hotdog> I get an error now, on an enum type that does not get renamed by my callback: `futhark.nim(612, 22) Error: type expected, but symbol 'Jackoptionsenum' has no type.`
12:13:34FromDiscord<hotdog> Removing the callback stops the error, but the callback does not modify that name at all
12:15:13PMunchHmm, do you return the "name" argument in your callback?
12:15:23FromDiscord<hotdog> Yeah
12:15:29PMunchTry simply running the compiler again
12:15:34PMunchWithout making any changes to your file
12:15:40FromDiscord<hotdog> Same each time
12:16:00PMunchWithout the futharkReload flag
12:16:13FromDiscord<hotdog> If I don't clear the cache, I get `futhark_F7EB25CF51BFC97C.nim(171, 5) Error: undeclared identifier: 'Jackoptionsenum_18930414'`
12:16:14PMunchfutharkRebuild*
12:16:19PMunchAh okay
12:16:27PMunchSo it's not the weird bug I saw earlier
12:16:46PMunchCan you share your wrapper?
12:17:23FromDiscord<hotdog> Yeah let me clean it up and I'll push it
12:17:24FromDiscord<hotdog> 2m
12:18:55PMunchJust pushed a small commit that adds the hash of the callback to the file, thanks for that suggestion!
12:19:22FromDiscord<hotdog> Oh cool!
12:19:36PMunchFigured out a way to do it :)
12:20:23FromDiscord<hotdog> Yeah I just had a look to see how you did it
12:20:36FromDiscord<hotdog> Good macro wrangling
12:23:57PMunchHaha, that's my jam :P
12:28:48*NeoCron joined #nim
12:30:22FromDiscord<hotdog> Can I pass a dynamic path for the headers?
12:30:43FromDiscord<hotdog> If so I'll stick the headers I've got in the repo so you can test the same ones I'm using
12:31:36FromDiscord<hotdog> Oh ignore that, I was doing something dumb
12:33:19*jjido joined #nim
12:35:31FromDiscord<hotdog> @PMunch https://github.com/geotre/jack/blob/main/src/jack.nim
12:39:43*arkurious joined #nim
12:54:37PMunchHmm, after adding the path to my C library files I get an Error: Unknown kind in findAlias: {"kind":"invalid","value":"invalid?"} error
12:55:03PMunchCould you share your opir output in a paste?
12:56:59*rockcavera joined #nim
12:56:59*rockcavera quit (Changing host)
12:56:59*rockcavera joined #nim
12:57:38PMunchIt seems like it goofes on a packed pragma
12:57:44PMunchgoofs*
12:57:52PMunchHave you seen similar issues?
12:59:00FromDiscord<hotdog> If I remove the renamecallback, it compiles fine
12:59:04FromDiscord<hotdog> Do you get the same?
12:59:34FromDiscord<hotdog> In reply to @PMunch "Hmm, after adding the": I haven't seen this error
13:00:01PMunchNope I just get that error
13:00:06PMunchBut what C sources are you using?
13:00:22FromDiscord<hotdog> What do you mean?
13:00:48PMunchJust compiling the code you uploaded gives me an error from Opir: Fatal: 'stddef.h' file not found
13:01:07PMunchTo fix that I must give a path to either clang or GCC C sources
13:02:37PMunchWhat platform are you on?
13:02:47FromDiscord<hotdog> Ah it's an ubuntu container
13:03:10FromDiscord<hotdog> with libjack-dev
13:03:30PMunchHmm
13:03:41PMunchWhich C compiler?
13:03:47PMunchAnd is it using musl?
13:04:04FromDiscord<hotdog> gcc
13:04:06FromDiscord<hotdog> No musl
13:04:23PMunchWhich GCC version?
13:04:34FromDiscord<hotdog> 9.3.0
13:05:12PMunchAnd Jack version?
13:06:23FromDiscord<hotdog> 0.125.0 I think
13:08:52PMunchUhm, mine is 1.9.19
13:08:58PMunchAccording to pacman
13:09:07FromDiscord<hotdog> Interesting
13:09:12PMunchThat's jack2
13:26:10FromDiscord<tandy> is it posible to make https://github.com/nim-lang/Nim/lib/system/memory.nim work on js backend?
13:27:53PMunchOkay, implemented packed structures now @hotdog. It compiles, but using the rename callback gives me the same error you got
13:28:26FromDiscord<hotdog> In reply to @PMunch "Okay, implemented packed structures": Cool
13:29:21FromDiscord<hotdog> The renamer that runs after the callback should handle any collisions, so in theory no renaming should cause an error as long as it's a valid nim identifier right?
13:29:44FromDiscord<hotdog> I am poking around the futhark code a bit to try and understand
13:30:13PMunchHmm, I think I see what has happened
13:31:23PMunchSo you rename jack_options_t to JackOptions, this would normally be called jackoptionst by the renamer. Then JackOptions from the C code gets renamed to JackOptions_enum since it now collides with this identifier. But somewhere in the code this gets lost
13:32:02PMunchAs you can see the enum JackOptions is created in the futhark output, it should be called JackOptions_enum
13:34:16PMunchEasy fix, it was simply that enum names was never passed through the name sanitizer
13:35:50*max22- joined #nim
13:41:57FromDiscord<tandy> https://github.com/tandy-1000/Nim/commit/b6eba2850ec79e41c4fc6ee6b5f57be365adc2f0
13:42:01FromDiscord<tandy> is this completely stupid
13:45:20krux02yes
13:45:26FromDiscord<Rika> imo define the xxmem proc bodies in the respective procs of memory.nim (behind defined(js))
13:45:29FromDiscord<Rika> no need to change md5
13:45:46FromDiscord<Rika> i have no idea whether what your procs do what they actually do in js
13:46:15FromDiscord<tandy> me neither↵(@Rika)
13:46:26FromDiscord<Rika> then that is stupid
13:47:07FromDiscord<tandy> i was thinkin about doing that↵(@Rika)
13:47:19FromDiscord<tandy> but i realised there must be a reason why that wasnt done already
13:47:25krux02any pointer type casting that isn't just base-class child-class casting is doomed to fail on js
13:47:32FromDiscord<Rika> yes, because how does xxmem work in js???
13:47:49FromDiscord<tandy> hmm
13:48:01krux02what is xxmem?
13:48:12FromDiscord<tandy> copyMem, zeroMem
13:48:15FromDiscord<tandy> setMem
13:48:18krux02it doesn't
13:48:37FromDiscord<tandy> how the heck do i make this work then \:x
13:48:46FromDiscord<Rika> best just reimplement them
13:49:02krux02you have to find workarounds that don' use copyMem, zeroMem etc
13:49:03FromDiscord<Rika> or wrap, though i doubt youd get that in the stdlib that way
13:49:19FromDiscord<tandy> hmm
13:49:26FromDiscord<tandy> how do i go about doin that
13:49:26krux02js has a very different memory layout than tha C backend
13:49:34FromDiscord<tandy> its hard also cos u cant easily test js stuff
13:49:45krux02why not?
13:49:50FromDiscord<Rika> you can? just run it in a browser
13:50:06FromDiscord<tandy> tru i gues↵(@Rika)
13:50:07*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:50:55FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3B6i
13:51:04FromDiscord<tandy> in streams they do this
13:52:50FromDiscord<Rika> that looks wrong
13:52:53krux02tandy: you can set elements to 0 with a loop
13:53:00krux02insdead of useing zeroMem
13:53:51FromDiscord<tandy> i think @dom96 did it
13:53:59FromDiscord<tandy> thats what i do↵(<@709044657232936960_krux02=5b=49=52=43=5d>)
13:54:18FromDiscord<tandy> well what memory.nim does
13:54:27FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3B6j
13:55:37PMunch@hotdog, not sure if you saw, but I updated the PR with a fix for your issue
13:55:58PMunchThanks for finding it, pretty trivial bug that should never have been added
13:56:01FromDiscord<Rika> dont pass pointers in js
13:56:54*kinkinkijkin quit (Remote host closed the connection)
13:58:31krux02tandy instead of zeroMem you can use `reset`
13:58:36*pch joined #nim
13:58:42FromDiscord<tandy> hm il try that
13:58:54*pch quit (Remote host closed the connection)
13:59:27*pch joined #nim
14:00:32FromDiscord<tandy> need to get rid of the copyMemJs stuff to make it compile now
14:01:08FromDiscord<hotdog> @PMunch I'm back just saw it! Nice one
14:01:33PMunchHopefully it'll work for you now :)
14:01:45krux02tandy, you also need to get rid of the `cstring` + `len` arguments and convert it to an openarray[byte] somehow
14:01:59krux02`cstring` + `len` doesn't work on js
14:02:07PMunchBut I have to run, so just leave your feedback on the issue if anything else comes up :)
14:02:08*PMunch quit (Quit: Leaving)
14:02:50FromDiscord<hotdog> In reply to @PMunch "Hopefully it'll work for": Just rewriting my code that uses the lib to see if it all works
14:03:03FromDiscord<hotdog> In reply to @PMunch "But I have to": Will do! Cheers
14:03:11krux02cstring used to be a string for the c backend, but smartassery development thought, hey cstring can mean `compatible string` not `c string` and it is whatever the backend things a string is.
14:03:33krux02that ends up in code that is written for one backend in mind, that is completely broken on the other
14:04:11*rockcavera quit (Remote host closed the connection)
14:06:28FromDiscord<Rika> why the hell does cstring not work on js
14:06:35FromDiscord<Rika> if its "meant" to mean compat string
14:09:20FromDiscord<tandy> omg↵(<@709044657232936960_krux02=5b=49=52=43=5d>)
14:09:27FromDiscord<tandy> maybe i just need to a wrap cryptojs
14:09:40FromDiscord<tandy> this is more effort than i thought
14:12:21FromDiscord<tandy> why the heck does lastfm api even need md5 bruh
14:27:21FromDiscord<Rika> thats strange ngl
14:27:23krux02Rike: it is not that cstring doesn't work on js. The problem is that it is something completely different on js
14:27:33FromDiscord<Rika> what is it on js?
14:27:35krux02@Rika, ^
14:27:40FromDiscord<Rika> yes im hee
14:27:42FromDiscord<Rika> here
14:27:43krux02is is a javascript string
14:27:56FromDiscord<Rika> whats the issue with that?
14:27:59krux02not the nim-string
14:28:08krux02as I explained
14:28:25krux02code written with c string usually expects to deal with a string from the C world
14:28:34krux02and that is something completeld different than a javascript string
14:28:39krux02not compatible at all
14:28:48FromDiscord<Rika> ah lol
14:30:15krux02you should convert everything to work with `openarray[byte]` and `array[byte]` instead of `cstring`
14:30:30krux02then things might work in the JS world.
14:41:25FromDiscord<tandy> hmm↵(<@709044657232936960_krux02=5b=49=52=43=5d>)
14:50:51FromDiscord<haxscramper> https://github.com/haxscramper/hcparse/issues/13 [Clonkk](https://matrix.to/#/@rf.c:matrix.org)
14:51:00krux02I looked a bit into md5 and tried to fix some of the copyMem stuff
14:51:27krux02the problem is there is some code that reinterprets an array uint8 as an array of uint32
14:51:32krux02that is tough in the js world
14:51:57FromDiscord<haxscramper> Maybe I wrote incorrect C++ or nim code for this example, so maybe they actually work the same way
14:52:26FromDiscord<haxscramper> But maybe not, which means we have more problems
14:59:27*dukester joined #nim
15:01:24*dukester left #nim (#nim)
15:28:49*crem quit (Ping timeout: 252 seconds)
15:31:07*crem joined #nim
15:42:18FromDiscord<retkid> i think im doing typing wrong
15:42:37FromDiscord<retkid> all my types have fields which are non mandatory and i have to type the name of the key to make it
15:42:47FromDiscord<retkid> i assume you use functions to make it smoother
15:43:01FromDiscord<retkid> like for example
15:43:09FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3B7j
15:54:42FromDiscord<Rika> what do you mean
15:54:57FromDiscord<retkid> `im afraid im doing this wrong
15:55:00FromDiscord<retkid> and theres a better way
15:55:14FromDiscord<Rika> we cant tell you whats wrong because we dont have context
15:56:07FromDiscord<retkid> theres nothng wrong
15:56:15FromDiscord<retkid> i just want to define a type with constructors
15:56:32FromDiscord<retkid> it has constructors but none are mandatory and when i create it i need to add the key
15:56:40FromDiscord<retkid> ie newtype(name : "xyz)
15:56:49FromDiscord<retkid> (edit) "newtype(name" => "``newtype(name" | ""xyz)" => ""xyz")``"
15:56:57FromDiscord<retkid> is this just how it is? or am i using the wrong tool
15:57:10FromDiscord<Rika> common practice is to make a proc
15:57:18FromDiscord<Rika> `initType(params here): Type`
15:57:56FromDiscord<retkid> I've done that for annoying types
15:58:14FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/895701555666358293/unknown.png
15:58:21FromDiscord<retkid> I just feel kinda guilty about making them
15:58:23FromDiscord<retkid> i dunno
15:58:40FromDiscord<Rika> is there any reason you're making methos
15:58:42FromDiscord<Rika> (edit) "methos" => "methods"
15:58:55FromDiscord<retkid> oh those were the wrong procs
15:59:25FromDiscord<retkid> theres a reason but i decided not to comment my code so i dont know off the top of my head 🤡
15:59:29FromDiscord<retkid> (edit) "theres a reason but i decided not to comment my code so i dont know off the top of my head ... 🤡" added ""
15:59:41FromDiscord<retkid> by decided i meant neglected
16:00:49FromDiscord<retkid> the code in this file is uh
16:00:54FromDiscord<retkid> (edit) "uh" => "uh, not a quality I'm proud of"
16:01:05FromDiscord<haxscramper> if you need mandatory field init you can use `{.requiresinit.}`
16:01:23FromDiscord<retkid> Thank you!
16:01:26FromDiscord<haxscramper> But common approach is to make a code
16:01:44FromDiscord<retkid> I dunno if i got this from Java's oop
16:01:53FromDiscord<retkid> but i like to write things for other people who are maintaing my code
16:01:56FromDiscord<retkid> (edit) "maintaing" => "maintaining"
16:02:22FromDiscord<retkid> restricting certain things which shouldn't be done is good
16:02:24FromDiscord<haxscramper> Well, there is nothing wrong with the idea of requiring some fields to be explicitly initialized
16:03:31FromDiscord<retkid> oh god i gotta do database code
16:03:39FromDiscord<retkid> the pasta i will unleash upon my future self
16:04:07FromDiscord<retkid> im probably gonna use SQLite because thats the only one i vaguely understood
16:05:17FromDiscord<Rika> In reply to @retkid "restricting certain things which": its good to a point, if you can make something optional easily then do so
16:07:24*asd quit (Ping timeout: 245 seconds)
16:08:19*koltrast_ quit (Quit: ZNC - http://znc.in)
16:09:22*koltrast joined #nim
16:09:23*asd joined #nim
16:16:37*NeoCron quit (Remote host closed the connection)
16:17:10*pro joined #nim
16:18:19*koltrast quit (Ping timeout: 252 seconds)
16:18:53*bkay joined #nim
16:19:14*NeoCron joined #nim
16:19:25*beshr quit (Ping timeout: 252 seconds)
16:21:41*systemds1cks quit (Ping timeout: 264 seconds)
16:21:55*systemdsucks joined #nim
16:26:31*koltrast joined #nim
17:13:30*pro quit (Quit: WeeChat 3.3)
17:20:27FromDiscord<reilly> I'm trying to work with NimGL/IMGUI, but I'm missing `cimgui.dylib`. Where would be the best place to get this/How can I build this myself?
17:21:06FromDiscord<enthus1ast> from imgui site/repo ?
17:21:43FromDiscord<enthus1ast> could be that this is a c wrapper of their c++ api
17:21:59FromDiscord<Yardanico> In reply to @reilly "I'm trying to work": you can 1) use the C++ backend, then you won't need cimgui at all
17:22:16FromDiscord<Yardanico> 2) compile cimgui - it's actually referenced as a submodule of the nimgl/imgui repo, but you can build it yourself
17:22:23FromDiscord<Yardanico> https://github.com/nimgl/cimgui
17:22:25nrds<R2D299> itHub: 7"c-api for imgui (https://github.com/ocornut/imgui)"
17:23:56FromDiscord<gerwy> does nim has unions? or something like that
17:25:07FromDiscord<Yardanico> In reply to @Life Sucks "does nim has unions?": it does, but why do you need them? they're really only useful for C FFI
17:25:08FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#foreign-function-interface-union-pragma
17:25:31FromDiscord<Yardanico> you should use object variants in Nim instead
17:26:18FromDiscord<gerwy> im rewriting one python lib, i didn't understood all the code yet so i just wanted to rewrite the basics of it as true to the original as possible
17:27:10FromDiscord<Yardanico> can you show the python code?
17:27:30FromDiscord<Yardanico> python's union typehints are a quite different thing, you should've clarified that :P
17:28:07FromDiscord<Yardanico> if you mean https://docs.python.org/3/library/typing.html#typing.Union, to replicate that in Nim you need to use object variants or some modules that add some sugar to that as https://github.com/alaviss/union
17:28:10nrds<R2D299> itHub: 7"Anonymous unions in Nim"
17:28:41FromDiscord<gerwy> In reply to @Yardanico "can you show the": `def _getValue(self, source: dict, path: List[str]) -> Union[str, int, dict, None]:`
17:28:47FromDiscord<Yardanico> yes, as I said
17:29:05FromDiscord<Yardanico> but with 4 values like that you'll certainly need an object variant
17:29:32FromDiscord<Yardanico> ah actually no, alaviss' union still supports that (kind of)
17:29:47FromDiscord<gerwy> hmmm
17:29:57FromDiscord<Yardanico> but really you shouldn't try to translate this code as-is, it's pretty dynamic as that single _getValue function can return 4 different types (that's what "Union" typehint in Python means)
17:30:10FromDiscord<Yardanico> so this python _getValue can return either a str, an int, a dict, or None
17:31:10FromDiscord<Rika> You should refactor the api
17:32:00FromDiscord<gerwy> no no i its just for me to get the base, i know it wont work i just want to get grasp of it
17:32:07FromDiscord<gerwy> also its a method of class
17:32:47FromDiscord<gerwy> In reply to @Yardanico "so this python _getValue": yeah i know that, but idk how to do the same thing in Nim
17:33:10FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#types-object-variants
17:33:14FromDiscord<haxscramper> `dict` is another can-return-anything
17:33:23FromDiscord<haxscramper> there is no `dict` in nim
17:33:37FromDiscord<haxscramper> no dict equivalent\
17:33:44FromDiscord<Yardanico> yeah, that's true as well
17:33:52FromDiscord<Elegantbeef> It's dynamism you can only approximate it in Nim or use generics
17:34:05FromDiscord<gerwy> In reply to @haxscramper "there is no `dict`": i thought of using Table
17:34:42FromDiscord<Rika> not equal
17:34:48FromDiscord<Rika> you dont know what values are stored in that dict
17:35:03FromDiscord<Rika> unless you do, since you have the code
17:35:47FromDiscord<Yardanico> In reply to @Life Sucks "i thought of using": yeah, as others told, in Python dict is not limited to 1:1 type mapping
17:37:55ehmryis compile time iteration possible? I want to do `for i in 0..<tupleLen(tuple): f(tuple[i])`
17:37:57*jjido joined #nim
17:38:38FromDiscord<gerwy> hmm i mean i use this github repo as reference
17:38:39FromDiscord<gerwy> https://media.discordapp.net/attachments/371759389889003532/895726829900554240/unknown.png
17:38:42FromDiscord<haxscramper> `std/typetraits`
17:38:57FromDiscord<Yardanico> In reply to @Life Sucks "": again, as I said, this is not official and not of it is correct info
17:39:02FromDiscord<Elegantbeef> Do you mean loop unrolling or just iterating over at compile time?
17:39:05FromDiscord<haxscramper> https://nim-lang.org/docs/typetraits.html↵(<@709044657232936960_ehmry=5b=49=52=43=5d>)
17:39:42FromDiscord<haxscramper> Also there is a `fieldPairs` that works with enums as well
17:39:55FromDiscord<Yardanico> (edit) "In reply to @Life Sucks "": again, as I said, this is not official and not ... of" added "all"
17:39:56ehmryElegantbeef: loop unrolling, so that my `i` is const
17:40:05FromDiscord<gerwy> In reply to @Yardanico "again, as I said,": yeah hmm, i prob need like a list of types of python and nim alternatives
17:40:18FromDiscord<Yardanico> In reply to @Life Sucks "yeah hmm, i": there's no direct alternative to dict in Nim as others said
17:40:32FromDiscord<Yardanico> but if you debug your python program to know what types it stores in the dict you can find out how many of them it uses
17:40:53FromDiscord<Yardanico> but yeah, that code looks like it's pretty dynamic so you really should try adopting it to Nim from the start instead of doing 1:1 translation
17:40:54ehmryI need to modify the tuple fields, the typetrait iterators don't seem to do that
17:41:17FromDiscord<Elegantbeef> you can do `for x in tuple.fields`
17:41:30FromDiscord<Elegantbeef> Which already unrolls it
17:41:39FromDiscord<Rika> doesnt that give strings of the names of fields
17:41:47FromDiscord<Rika> what use is that in this case
17:41:50FromDiscord<Elegantbeef> Nope that's fieldpairs
17:42:10ehmrybut are the field pairs modifiable?
17:42:24FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3B7X
17:43:34FromDiscord<Elegantbeef> fields gives you a mutable reference to the fields of the object/tuple
17:44:08FromDiscord<Elegantbeef> And due to how this needs to work it's already unrolled afaik
17:45:26ehmryyea, that seems to work, thanks
17:46:27FromDiscord<sealmove> In reply to @richard stallmen(crazy GNU guy) "what does it have": nothing, just greeting the greek guy
17:50:53*max22- quit (Ping timeout: 246 seconds)
18:01:27*rockcavera joined #nim
18:01:27*rockcavera quit (Changing host)
18:01:27*rockcavera joined #nim
18:02:19ehmryugh, avoid `when compiles(…)` if you can
18:02:54ehmryits not fun to figure out what did or did not silently fail to compile
18:10:09FromDiscord<reilly> In reply to @Yardanico "you can 1) use": Last time I tried using the C++ backend, I could have sworn I needed a certain compiler flag in order for it to build correctly. In any case, with just `nim cpp gui.nim`, the build fails with the following message: `error: invalid argument '-std=gnu++14' not allowed with 'Objective-C'`↵I can also give you the whole command it was using if you want.
18:10:20FromDiscord<Yardanico> wait, objective c?
18:10:26FromDiscord<Yardanico> why is there objective c
18:10:29FromDiscord<reilly> Yeah, that's what I was thinking!
18:10:41FromDiscord<reilly> I'm doing `nim cpp gui.nim`, exactly like that.
18:10:47FromDiscord<Yardanico> idk, it works just fine for me
18:11:29FromDiscord<reilly> I can't imagine that it'd have anything to do with me being on MacOS, right?
18:13:06FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3B8c
18:15:47FromDiscord<Yardanico> In reply to @reilly "I can't imagine that": most probably yes
18:16:40FromDiscord<Yardanico> @reilly i think it has to do with you using macOS specific stuff like cocoa
18:16:45FromDiscord<Yardanico> maybe you can't link C++ and Objective C code together
18:17:32FromDiscord<Yardanico> but yeah, then you have to use the C backend with cimgui
18:18:04FromDiscord<reilly> Well, I'm happy as long as I can get it working.
18:18:48FromDiscord<reilly> In reply to @Yardanico "most probably yes": I asked the wrong question, though. A better question would have been "Is this a NimGL, IMGUI, or Nim compiler thing?"
18:19:13FromDiscord<Yardanico> it's a macOS thing :)
18:20:01FromDiscord<Yardanico> see e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=1420165
18:20:10FromDiscord<Yardanico> In reply to @reilly "The command it's running": can you try cleaning the Nim cache?
18:20:14FromDiscord<Yardanico> and compiling with C++
18:20:17FromDiscord<Yardanico> backend
18:20:39FromDiscord<Yardanico> hm, what's nimgl/private/glfw/src/cocoa_init.m
18:21:23FromDiscord<Yardanico> ohh those .m files in nimgl are objective c
18:22:30FromDiscord<Yardanico> so yeah, sorry, I can't really help with that exact problem as I don't have macOS, but probably clang is not happy when you try to compile C++ together with Objective C code
18:23:03FromDiscord<reilly> I'll just build cimgui and call it a day.
18:23:43FromDiscord<reilly> The dylib just needs to be in the same directory as the executable, right?
18:25:01FromDiscord<reilly> Yay, a window! I don't even know if I'll need this, but I'm glad I have it.
18:25:13*max22- joined #nim
18:37:19FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3B8r
18:38:19FromDiscord<haxscramper> 10^9 IQ moment, I forgot I can just do `when (expr is proc)`
19:25:42FromDiscord<retkid> is there any large examples of sqllite
19:25:46FromDiscord<retkid> in any repo
19:26:10FromDiscord<Yardanico> not sure what exactly do you want to learn with that - sqlite's interface is pretty simple
19:26:15*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
19:26:16FromDiscord<Yardanico> for example nimforum uses it https://github.com/nim-lang/nimforum
19:26:18nrds<R2D299> itHub: 7"Lightweight alternative to Discourse written in Nim"
19:26:44FromDiscord<retkid> i dont know sqllite specifically and the docs are kinda bad
19:26:49FromDiscord<retkid> so i just want a working example
19:26:54FromDiscord<Yardanico> you don't have to know sqlite specifically
19:26:56FromDiscord<Yardanico> it's just SQL
19:27:01FromDiscord<retkid> well i dont know any SQL
19:27:03FromDiscord<retkid> (edit) "well i dont know any SQL ... " added "at all"
19:27:15FromDiscord<Yardanico> then you can just search examples for SQL
19:27:40FromDiscord<retkid> that is very cool thought it had different syntax
19:27:41FromDiscord<retkid> thank you
19:28:01FromDiscord<zidsal> has anyone managed to solve the windows issue where using choosenim 0.8.2 returns a 0 byte zip if you try and install 1.6?
19:33:55FromDiscord<zidsal> nevermind found the chat in internal, I was picking the wrong version, althought it still errors for other reasons which I shall investimigate
19:34:24FromDiscord<reilly> Compiling with the default C backend while wrapping a C++ library probably doesn't work... Right?
19:44:56*Figworm joined #nim
19:48:47FromDiscord<Jakes1403> Is there a way to get Nim Playground to not truncate console output?
19:48:57FromDiscord<Jakes1403> I think that's really stupid
19:50:21FromDiscord<Yardanico> In reply to @Jakes1403 "Is there a way": as in?
19:50:42FromDiscord<Yardanico> ah I see what you mean
19:51:01FromDiscord<Yardanico> well I think it's actually ok as you really rarely need very long output on the playground
19:51:12FromDiscord<Yardanico> you can try https://wandbox.org to see if it's better for you
19:51:23FromDiscord<Jakes1403> I'm messing around rn bc I don't have a PC lol
19:51:30FromDiscord<Yardanico> well you don't need a PC for Nim
19:51:36FromDiscord<Yardanico> if you're on android you can install it in termux
19:51:54FromDiscord<Yardanico> it's not ideal, but certainly better than doing nim in nim playground on mobile
19:57:44*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
20:04:53*vicfred joined #nim
20:09:27FromDiscord<Jakes1403> I'll try that
21:00:42FromDiscord<Ale_S> xnim
21:09:40*Gustavo6046 is now known as Several
21:09:44*Several is now known as Gustavo6046
21:20:09*Figworm quit (Quit: Figworm)
21:23:49*LyndsySimon quit (Ping timeout: 250 seconds)
21:23:55*robertmeta quit (Ping timeout: 268 seconds)
21:24:32*notchris quit (Ping timeout: 268 seconds)
21:24:45*euantorano_ joined #nim
21:24:46*ormiret quit (Ping timeout: 260 seconds)
21:24:56*euantorano quit (Ping timeout: 268 seconds)
21:24:56*euantorano_ is now known as euantorano
21:25:37*ormiret joined #nim
21:28:50*robertmeta joined #nim
21:29:42*notchris joined #nim
21:29:58*LyndsySimon joined #nim
21:37:42*Vladar quit (Remote host closed the connection)
21:50:31*Gustavo6046 quit (Ping timeout: 252 seconds)
22:02:10*jjido joined #nim
22:11:34*Gustavo6046 joined #nim
22:35:06*stkrdknmibalz joined #nim
22:44:59*pch quit (Remote host closed the connection)
22:46:59*pch joined #nim
22:47:34*pch quit (Remote host closed the connection)
22:58:41*max22- quit (Remote host closed the connection)
23:22:46*pch joined #nim
23:47:24*stkrdknmibalz quit (Ping timeout: 245 seconds)