<< 29-11-2023 >>

00:30:31*derpydoo quit (Ping timeout: 255 seconds)
00:53:59*mahlon quit (Ping timeout: 264 seconds)
00:55:53*mahlon joined #nim
01:04:03*rockcavera quit (*.net *.split)
01:04:03*cm quit (*.net *.split)
01:04:03*dtomato quit (*.net *.split)
01:04:03*tinytoast quit (*.net *.split)
01:04:03*attah quit (*.net *.split)
01:04:28*end quit (*.net *.split)
01:04:28*alice quit (*.net *.split)
01:04:28*tk quit (*.net *.split)
01:04:28*jkl quit (*.net *.split)
01:04:29*nisstyre quit (*.net *.split)
01:04:29*om3ga quit (*.net *.split)
01:04:29*droidrage quit (*.net *.split)
01:04:29*NimEventer quit (*.net *.split)
01:04:29*FromDiscord quit (*.net *.split)
01:04:29*lucerne quit (*.net *.split)
01:04:29*lumidify quit (*.net *.split)
01:04:29*marcus quit (*.net *.split)
01:04:30*_________ quit (*.net *.split)
01:04:30*oz quit (*.net *.split)
01:04:30*qwestion quit (*.net *.split)
01:04:30*Onionhammer quit (*.net *.split)
01:05:36*lucerne joined #nim
01:05:38*alice joined #nim
01:06:31*om3ga joined #nim
01:06:31*droidrage joined #nim
01:06:31*NimEventer joined #nim
01:06:31*FromDiscord joined #nim
01:06:31*lumidify joined #nim
01:06:31*marcus joined #nim
01:06:31*_________ joined #nim
01:06:35*rockcavera joined #nim
01:06:35*cm joined #nim
01:06:35*dtomato joined #nim
01:06:35*tinytoast joined #nim
01:06:35*attah joined #nim
01:06:38*_________ quit (Max SendQ exceeded)
01:06:40*oz joined #nim
01:06:40*qwestion joined #nim
01:06:40*Onionhammer joined #nim
01:07:04*_________ joined #nim
01:07:26*end joined #nim
01:07:26*tk joined #nim
01:07:26*jkl joined #nim
01:07:26*nisstyre joined #nim
01:07:30*adigitoleo quit (*.net *.split)
01:08:40*adigitoleo joined #nim
02:11:45*lucasta quit (Quit: Leaving)
02:20:15*oprypin quit (Remote host closed the connection)
03:30:16*edr quit (Quit: Leaving)
05:56:05*rockcavera quit (Remote host closed the connection)
05:56:52*cm quit (Ping timeout: 255 seconds)
06:00:53*cm joined #nim
06:10:39*oprypin joined #nim
06:15:59*notbad joined #nim
06:24:18*mahlon quit (Quit: PotatoTech)
06:38:26*azimut quit (Remote host closed the connection)
06:39:01*azimut joined #nim
06:50:39*mahlon joined #nim
06:53:19*azimut quit (Ping timeout: 240 seconds)
07:07:23*PMunch joined #nim
07:10:24*advesperacit joined #nim
07:15:27*kenran joined #nim
07:29:04FromDiscord<gogolxdong666> anyone played Vision Pro
07:41:28FromDiscord<arnetheduck> In reply to @guttural666 "or: will the compiler": this - by delaring the callback type gcsafe, you can only pass in gcsafe procedures so the caller of the callback can make assumptions - same with `{.raises.}` (right now, your callback can raise exceptions which you have to handle somewhere but you can constrain that too)
07:58:42FromDiscord<Phil> I wonder if nlvm has to be built on the system it'll run on or if you could build the binaries ahead of time and distribute them.↵I know that generally you can just distribute binaries but compiler repl stuff feels like a potentially special case
07:58:56FromDiscord<Elegantbeef> It has appimages
07:59:32FromDiscord<Phil> Which is the long version of" it doesn't have to be", check
08:00:37FromDiscord<Phil> Screwed up yesterday in trying to build with Nim 2.0 active and then it got too late for a second attempt for me, I'll try again later and maybe also check out said app image
08:02:14FromDiscord<arnetheduck> In reply to @isofruit "I wonder if nlvm": in classic toolchain terms, this is the "host" vs "target" - all compilers more or less support keeping them separate, some better than others - "normal" compilation where you compile for the same system as you're compiling on is a special case (that is usually optimised for because it's the most common one) - depending on how different the two are, you can reuse more or less of the pipeline
08:03:39FromDiscord<Phil> So basically building on your own CPU is prone to have some improvements associated
08:03:43FromDiscord<Phil> ?
08:04:24FromDiscord<arnetheduck> it's easier and faster in many cases, yes, starting with the user experience itself
08:05:35FromDiscord<Phil> Easier? I don't follow, mostly as my mental image of the scenario is downloading a binary Vs following installation instructions
08:05:47FromDiscord<Phil> What am I missing?
08:06:13FromDiscord<Phil> Note I haven't done app distribution so I'm prone to have knowledge gaps there
08:13:14FromDiscord<arnetheduck> what I mean is that if you want to build, it's easier to do so on the machine that you will run the binary on - otherwise, you're right - a precompiled binary will typically not be optimised for your specific setup.. what you're maybe thinking about is JIT, just-in-time compilation, which translates the code to machine instructions as it's being executed - this is what Java does
08:15:39*kenran` joined #nim
08:17:22*kenran quit (Ping timeout: 264 seconds)
08:19:30om3gaversions where nim was nimrod compiles in minix with minor modifications
09:07:02FromDiscord<konsumlamm> can anyone recommend a nice library for drawing stuff in a window?
09:09:43PMunchSDL?
09:22:33FromDiscord<konsumlamm> i'd prefer something that's easy to use and doesn't require any boilerplate (and that doesn't require me to first learn sdl)
09:26:38PMunchPen and paper then
09:27:41PMunchThe easiest would probably be to look at a small game library in Nim
09:27:59FromDiscord<nnsee> maybe naylib?
09:28:26FromDiscord<nnsee> also SDL is fairly boilerplate free
09:28:36FromDiscord<nnsee> as far as graphics goes
09:39:23FromDiscord<ravinder387> In reply to @nnsee "maybe naylib?": Hi Ras how's u
09:39:58FromDiscord<nnsee> hello
09:40:00FromDiscord<nnsee> i'm good, thanks
09:40:03FromDiscord<konsumlamm> naylib looks primising
09:40:13FromDiscord<konsumlamm> (edit) "primising" => "promising"
10:08:21*xutaxkamay quit (Ping timeout: 256 seconds)
12:11:48*kenran`` joined #nim
12:13:15*kenran` quit (Ping timeout: 245 seconds)
12:15:26*kenran``` joined #nim
12:17:58*kenran`` quit (Ping timeout: 264 seconds)
12:22:45*kenran``` is now known as kenran
12:37:15FromDiscord<Devon Myers> https://music.apple.com/us/album/luvhrts-ep/1716416831
12:37:42FromDiscord<nnsee> what
12:40:42FromDiscord<nnsee> https://media.discordapp.net/attachments/371759389889003532/1179401549663977563/06-toilet-tumblr_maecpaIZ7n1qde54qo1_500.png?ex=6579a649&is=65673149&hm=a332772b671e4da50a92cd0d6dbf1354cc2c66a6128ca937be86bf98fe8e8414&
12:56:40FromDiscord<pmunch> Devon Myers\: not at all related to Nim
13:21:24*edr joined #nim
13:26:24*azimut joined #nim
13:46:50FromDiscord<apetransaction> how do i return data from a asyncronous function
13:47:11FromDiscord<apetransaction> im trying to get a sequence of bytes because im working with annoying ass compressed websockets
13:49:23FromDiscord<odexine> Just return it normally like other functions? I don’t recall if result or expression return was broken but I know return keyword would work
13:53:40FromDiscord<apetransaction> how do i access the data inside?
13:53:45FromDiscord<apetransaction> just like a normal sequence
13:53:58FromDiscord<apetransaction> or do i have to do some conversion between future and seq
13:54:07PMunchYou need to await it
13:54:14PMunchOr use `waitFor`
13:54:51FromDiscord<apetransaction> sent a code paste, see https://play.nim-lang.org/#ix=4MNt
13:55:17PMunchPretty much
13:55:45PMunchIf you are in an async procedure you should use `var variableName = await asyncFunc()`
13:57:49FromDiscord<nnsee> for me, if i already have async code, it seems to somehow "spread" like an infection to the rest of the codebase, which i also rewrite to be async
13:59:22PMunchGood ol' coloring problem
13:59:40PMunchThe trick is to sprinkle in some `waitFor?
13:59:46PMunch`waitFor`
14:04:52NimEventerNew thread by dsrw: Enu 0.2, see https://forum.nim-lang.org/t/10700
14:04:59*rockcavera joined #nim
14:11:34FromDiscord<odexine> Multi sync should be used more prolly, think it would reduce “the colouring problem”
14:12:32FromDiscord<nnsee> i use multisync where i can
14:12:47FromDiscord<nnsee> the sway IPC library i made when i was pretty new to nim used multisync
14:13:02FromDiscord<nnsee> should revisit it and rewrite it now that i'm not as dumb
14:13:54PMunchI actually played around with a colorless async system a while back. It would create a template for async procedures which checked if their context included an async runtime. If it did then it would call the async version and hook it into the runtime, otherwise it would create one to evaluate the async stuff in
14:15:17FromDiscord<nnsee> love my consistency... used the implicit return here but the explicit one in an analogous proc like 5 lines down https://git.dog/xx/nim-swayipc/src/branch/master/src/swayipc2/connection.nim#L19
14:18:18*kenran quit (Remote host closed the connection)
14:31:49FromDiscord<michaelb.eth> sent a long message, see http://ix.io/4MNJ
14:32:46FromDiscord<michaelb.eth> (edit) "http://ix.io/4MNJ" => "http://ix.io/4MNK"
14:39:19FromDiscord<nnsee> very interesting, thank you michael
14:55:31PMunchWhich of course is annoying when you design async systems, because it seems like a nice little optimization to do
15:10:34*PMunch quit (Quit: Leaving)
15:37:43FromDiscord<bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4MOc
15:38:28FromDiscord<bostonboston> My plan was that and then to dumpAstGen the result I wanted and past it in
15:38:36FromDiscord<bostonboston> Paste
15:46:11*jmdaemon quit (Ping timeout: 245 seconds)
17:53:16NimEventerNew post on r/nim by dsrw: Enu: Learn to code and build 3D games with Nim, see https://reddit.com/r/nim/comments/186vivx/enu_learn_to_code_and_build_3d_games_with_nim/
18:22:54FromDiscord<Phil> The package I consistently got errors for was serialization-0.2.0
18:23:06FromDiscord<Phil> (edit) "The package I consistently got errors for was serialization-0.2.0 ... " added "and it having an invalid package name."
18:23:44FromDiscord<Phil> The above file is nim.cfg under the path `nlvm/Nim/config/nim.cfg`
18:24:43FromDiscord<Phil> sent a code paste, see https://paste.rs/1yNoP
18:31:17FromDiscord<Phil> ... is it normal that a repl allows redefining "let" and "const" variables ?
18:39:28Amun-Rastdin(2, 1) Error: '2' cannot be assigned to
18:39:30Amun-Rano
18:39:31FromDiscord<jviega> The `kind` field is an enumeration, so basically stored as an int. The cases are fields that are there or not depending on the value of the `kind` field
18:39:55FromDiscord<Phil> In reply to @Amun-Ra "no": Wait, what is that in response to?
18:39:58FromDiscord<jviega> They are stored in a fixed amount of space, it's essentially a `union` in C
18:40:24FromDiscord<jviega> More precisely, it's a "discriminated union"
18:40:29FromDiscord<null_pointer0> In reply to @jviega "The `kind` field is": Okay so if I have a Node with kind nkInt it still requires as much memory to store the fields I am not using
18:40:36FromDiscord<jviega> Yes.
18:40:41FromDiscord<null_pointer0> sent a code paste, see https://paste.rs/BGuQW
18:40:48FromDiscord<jviega> If you want it to be otherwise, store a pointer to an object specific to that type
18:40:57FromDiscord<jviega> (usually a ref object)
18:42:57FromDiscord<null_pointer0> Okay I see. So this code is actually very inefficient albeit cool
18:43:12FromDiscord<jviega> What do you mean by inefficient?
18:43:28FromDiscord<jviega> Not doing heap allocations is usually more efficient than having a pointer
18:43:35FromDiscord<jviega> Space is generally cheap
18:44:27FromDiscord<null_pointer0> In reply to @jviega "Space is generally cheap": Yeah but if you have lots of objects packed together the cache misses must be insane
18:44:34FromDiscord<jviega> It's less memory efficient if you have some node types that have disproportionately large sizes relative to others, but more performant in general.
18:44:58FromDiscord<jviega> Cache misses will come when you're using references, not when you're using the union
18:45:35FromDiscord<redmechanics> does anyone know how to simulate keypresses ?
18:46:05FromDiscord<jviega> Sure, what are you trying to do exactly?
18:46:06FromDiscord<null_pointer0> In reply to @jviega "It's less memory efficient": Well I mean no matter what the "kind" is we still need to reserve space for intVal, floatVal, etc
18:46:21FromDiscord<jviega> Yes, but it will all be next to each other, in the same cache line
18:46:48FromDiscord<jviega> Fields are access by offset, and are constant time accesses
18:46:56FromDiscord<redmechanics> In reply to @jviega "Sure, what are you": type some text automatically in a notepad
18:47:21FromDiscord<jviega> If you have a reference in there, you've got the possibility of a cache miss, since your data is probably on the heap
18:47:21FromDiscord<null_pointer0> In reply to @jviega "Yes, but it will": Yeah but is this really the best way to do it
18:48:16FromDiscord<jviega> Let me refer you to: `https://github.com/crashappsec/cap10`
18:48:32FromDiscord<jviega> It will make it easy to inject data into a subprocess
18:48:42FromDiscord<michaelb.eth> In reply to @jviega "Sure, what are you": her/his previous postings here in the last week+ are suggestive of a malware author
18:48:44FromDiscord<null_pointer0> In reply to @jviega "If you have a": Fair enough, I just wanted to know if it is essentially wasting memory
18:48:56FromDiscord<jviega> @NullPointer, absolutely, unless you are in an embedded system w/ a very constrained stack
18:49:02FromDiscord<jviega> Not at all
18:49:15FromDiscord<jviega> Good to know, thanks @michaelb.eth
18:49:30FromDiscord<jviega> Absolutely meaning it's absolutely better
18:49:41FromDiscord<null_pointer0> Thank you
18:50:51FromDiscord<michaelb.eth> after I wrote that, given the frequency and interleaving of posts, I was referring to DevNitrate, not NullPointer
18:50:55FromDiscord<jviega> Generally you should only worry about optimizations of any kind (memory, performance) once you know you have a problem, because they're rarely an issue in practice. And in my experience, memory is so cheap and plentiful these days (and virtual memory works so well) that your odds of needing memory optimization approach 0
18:51:03FromDiscord<jviega> Yeah I figured that out
19:18:34FromDiscord<Phil> I wonder if nlvm, given its a full fledged REPL, could be the basis for jupyter integration
19:18:50FromDiscord<Phil> Sadly, I know way too little about that entire area of tech
19:19:11om3gawhat can be atmdotdotatslibatssystemdotnim_Init000?
19:43:18*LuxuryMode joined #nim
19:55:52*Guest36 joined #nim
19:55:52*Guest36 quit (Write error: Connection reset by peer)
19:59:24FromDiscord<System64 ~ Flandre Scarlet> Does someone knows how I can port makefiles to Nim please?
20:08:40FromDiscord<michaelb.eth> In reply to @sys64 "Does someone knows how": in your current estimately, what pros does NimScript have over Makefile syntax?
20:08:48FromDiscord<michaelb.eth> (edit) "estimately," => "estimation,"
20:08:51Amun-Raport?
20:11:08Amun-Rasomething like this? https://dpaste.com/BQRNSTV43
20:11:30FromDiscord<nervecenter> sent a long message, see https://paste.rs/FKZFJ
20:11:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @michaelb.eth "in your current estimation,": I want to make bindings for SGDK
20:23:38FromDiscord<michaelb.eth> Ah, I get you. Well, depending on the dependency, sometimes it's feasible to have it as a submodule in your Nim lib, relying on nimble to resolve it in a shallow way (which it does), and in your lib's compile-time code using `gorgeEx` to invoke `make` or `cmake` or whatever.
20:23:50FromDiscord<michaelb.eth> Other times, that doesn't work out so well.
20:25:41FromDiscord<michaelb.eth> I've been meaning to explore `atlas`, to learn if it deals with that in a better way, but I've no experience with `atlas` currently
20:30:58*lucasta joined #nim
20:30:59FromDiscord<Chronos [She/Her]> In reply to @sys64 "Does someone knows how": I think @sOkam! 🫐's Confy library has that functionality somewhere?
20:55:21FromDiscord<Elegantbeef> Ideally if the compilation environment is compact enough you can just use the `{.compile.}` pragma with sub modules
21:10:28FromDiscord<yetiwizard> sent a code paste, see https://paste.rs/wbPwr
21:12:40*advesperacit quit ()
21:12:58FromDiscord<yetiwizard> (edit) "https://paste.rs/MksIu" => "https://paste.rs/dQpev"
21:22:33FromDiscord<Elegantbeef> But the solution is simpler
21:24:26FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/h137f
21:25:00FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/SOhhs
21:28:04*targz77 joined #nim
21:29:30FromDiscord<yetiwizard> omg, this works, thanks!↵still, if somebody could show how the example above could be implemented (to learn how to make macros), I'd be grateful
21:30:09FromDiscord<yetiwizard> unbelievable how simple it was
21:32:05FromDiscord<yetiwizard> sent a code paste, see https://paste.rs/eHVP9
21:48:48FromDiscord<griffith1deadly> In reply to @yetiwizard "I literally spent 2h": but dont forgot that copying decrease speed
21:53:33FromDiscord<yetiwizard> In my case characters is a seq of ref Character↵So I hope this won't affect speed too much
21:56:34FromDiscord<jviega> It's not always true that copying will decrease speed. Fragmenting your memory accesses can slow things down far more.
21:56:42FromDiscord<System64 ~ Flandre Scarlet> sent a long message, see https://paste.rs/01qz6
21:57:16FromDiscord<Elegantbeef> @griffith1deadly it's copying a ref so it's negligable
21:57:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @jviega "It's not always true": This is why computures tends to slow down until reboot?
21:57:31FromDiscord<Elegantbeef> It's a `gcref` + integer copy
21:57:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @sys64 "Well, the thing is": Also, the MegaDrive uses an m68000 CPU
21:59:40FromDiscord<jviega> Basically if we hung out in a real room, I'd wear a t-shirt with a different slogan about optimization each day, like "When you think you mean 'optimize', you really mean, 'make worse'", or "You should take meds for your premature optimization problem"
22:01:39FromDiscord<Elegantbeef> Lol
22:01:55FromDiscord<Elegantbeef> Don't worry my optimisation suggestions are optimisation suggestions!
22:03:40FromDiscord<jviega> I don't really mean you, more the tons of people who came to a compiled language and spend way too much time worrying about performance instead of learning the language
22:04:12FromDiscord<Elegantbeef> Oh I was just joking, I do often bikeshed silly optimisations that do not likely matter in the grand scale
22:04:27FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/ocivG
22:04:55FromDiscord<Elegantbeef> Like whenever I see "ref" I hiss audibly
22:05:43FromDiscord<jviega> Heh
22:05:51FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/S5zPD
22:08:38FromDiscord<Elegantbeef> This does make me want to toy with simd to try to speed up my silly fractal toy
22:08:39FromDiscord<Elegantbeef> fractal tree toy\
22:09:54FromDiscord<jviega> Hmm, if I've got a seq[X] in some object, is having a ref object wrapper the only reasonable way to hold a pointer to that?
22:10:28FromDiscord<Elegantbeef> Much smarter to just write a compute shader over using simd though....
22:10:31FromDiscord<Elegantbeef> Yep that's Nim 'safe' way to hold a pointer
22:10:51FromDiscord<Elegantbeef> thankfully move semantics means that it's very little overhead to take a seq and move it to a reference
22:12:03FromDiscord<jviega> Yeah, that's a bit lame, but okay. Basically have a huge array that's getting copied way too much by tree-nodes that basically just need to know how to get to the right element in the array.
22:12:41FromDiscord<Elegantbeef> I mean you can do `myData[0].addr` but that's of course unsafe if the seq is every mutated
22:13:32FromDiscord<jviega> Yeah, and doesn't work if the sequence is empty.
22:13:56FromDiscord<Elegantbeef> View types cannot come soon enough 😄
22:15:37FromDiscord<Elegantbeef> Works on my machine
22:15:38FromDiscord<Elegantbeef> `nim -v`?
22:16:22FromDiscord<yetiwizard> sent a code paste, see https://paste.rs/xnboF
22:16:30FromDiscord<yetiwizard> Nim Compiler Version 2.0.0 [Windows: amd64]↵Compiled at 2023-08-01
22:17:29FromDiscord<Elegantbeef> Odd
22:17:36FromDiscord<yetiwizard> sent a code paste, see https://paste.rs/2DZN0
22:18:04FromDiscord<yetiwizard> oh nvm
22:18:07FromDiscord<yetiwizard> it wasn't exported
22:18:14FromDiscord<yetiwizard> lol
22:18:34FromDiscord<yetiwizard> those sneaky asterisks
22:18:40FromDiscord<yetiwizard> thanks a lot!
22:18:41FromDiscord<Phil> Question, is how LLVM works basically:↵Programming Language --> LLVM-IR --> Binary↵With LLVM-IR basically being for any LLVM-based lang what C is for nim when compiling "normally" ?
22:18:51FromDiscord<Elegantbeef> Some people's children
22:20:39FromDiscord<Elegantbeef> For normal Nim it's really Nim -\> C -\> C compiler's IR -\> Binary 😄
22:20:41FromDiscord<Elegantbeef> But yes llvm ir is a lower level IR that holds "only what is necessary"
22:21:18FromDiscord<yetiwizard> what is a good resource to learn macros?
22:21:56FromDiscord<yetiwizard> also, from a performance point of view, do you think the iterator version or the macro version is "better"?
22:22:37FromDiscord<Phil> From a performance point of view unroll allllll the loops you can. Not sure if iterators can do that, macros can
22:22:44FromDiscord<griffith1deadly> In reply to @yetiwizard "what is a good": practice and echo some code like ast
22:23:45FromDiscord<jviega> Iterators generally optimize for memory, often at the expense of complexity and speed, which is usually wrong.
22:24:02FromDiscord<yetiwizard> echo result.repr is really useful for that, true
22:24:12FromDiscord<ElegantBeef> The iterator and macro and template version are identical
22:24:22FromDiscord<ElegantBeef> The iterator is the most compiler friendly
22:24:30FromDiscord<ElegantBeef> It does not have to resem a tree every time
22:24:40FromDiscord<Phil> As for learning macros:↵1) Understand that every kind of statement in Nim is a pattern of NimNodes↵2) Look at the NimNode patterns of some statements and try to write your own small DSL where the user inputs weird stuff and you transform it into the statement you desire
22:24:46FromDiscord<griffith1deadly> In reply to @yetiwizard "echo result.repr is really": dumpTree best
22:24:47FromDiscord<Phil> (edit) "desire" => "desire. That'll teach you a lot"
22:25:07FromDiscord<Phil> dumpTree and dumpAstGen both are useful for this imo
22:25:07FromDiscord<jviega> I think you just just return a big chunk of consecutive items and loop over them most of the time 🙂
22:25:24FromDiscord<ElegantBeef> I'd say iterators optimise for speed and memory
22:26:19FromDiscord<yetiwizard> oh, I didn't know about dumpTree, seems really useful for that
22:26:28FromDiscord<jviega> Eh, the extra state people tend to keep can often lead to extra cache misses
22:26:30FromDiscord<ElegantBeef> You do not have to allocate a sequence nor add to it a lot growing it causing more allocations and copy
22:26:45FromDiscord<ElegantBeef> Depends on what you're doing and how you're doing it
22:27:01FromDiscord<jviega> You also then basically have a view, instead of worrying about mutating white you work
22:27:08FromDiscord<Phil> And after the fundamentals (basically being able to replicate statements with NimNodes) you can look into nicer tools that allow you to generate some code more quickly like quote do
22:27:14FromDiscord<ElegantBeef> Also depends on whether we're talking about closure or inline iterators
22:27:16FromDiscord<Phil> IIRC, I don't tend to use those
22:27:21FromDiscord<Phil> (edit) "IIRC," => "IIRC at least,"
22:27:41FromDiscord<Phil> (edit) "do" => "do, or the micros package"
22:27:45FromDiscord<ElegantBeef> Speaking of macros phil I did make that partial call macro without using micros it's dead simple with just std/macros 😄
22:27:52FromDiscord<yetiwizard> In reply to @isofruit "From a performance point": can you unroll it with macros if you don't know the number of elems at compile time?
22:27:58FromDiscord<ElegantBeef> Of course not
22:28:02FromDiscord<Phil> In reply to @yetiwizard "can you unroll it": Nope
22:28:03FromDiscord<ElegantBeef> Loop unrolling is a static operation
22:28:32FromDiscord<Phil> In reply to @elegantbeef "Speaking of macros phil": The curry thing?
22:28:41FromDiscord<ElegantBeef> It's not currying actually, but yea
22:29:01FromDiscord<ElegantBeef> Currying and partial call evaluation are very similar but not the same
22:29:06FromDiscord<ElegantBeef> <https://github.com/beef331/nimtrest/blob/master/tumeric.nim>
22:29:14FromDiscord<ElegantBeef> I did give it a nice name when I threw it in my dumpster fire repo
22:29:21FromDiscord<yetiwizard> ok now I have some info to work with, thanks a lot for the help and info everyone :D
22:29:56FromDiscord<ElegantBeef> I will say that Nim gives you many ways to avoid using macros and that is generally the better path
22:29:58FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "Of course not": Not if you're a quitter! Embed the compiler into the program! /j
22:30:09FromDiscord<yetiwizard> another thing I was wondering:↵is it possible to have templates with default params like in procs?
22:30:27FromDiscord<ElegantBeef> It is, but it's not ideal
22:30:39FromDiscord<ElegantBeef> Generally just overloads are used
22:30:41FromDiscord<yetiwizard> cause rn I'm doing overloads
22:30:48FromDiscord<yetiwizard> kk
22:31:01FromDiscord<Phil> Generally overloads > Default parameters
22:31:35FromDiscord<Phil> There are some scenarios where default parameters are more expressive but I really don't recall them all that much
22:35:39FromDiscord<ElegantBeef> `cast[T](...)` would get rid of the warning
22:36:39FromDiscord<yetiwizard> sent a code paste, see https://paste.rs/KVHse
22:36:43FromDiscord<Phil> I mean you pretty much can't unless you disable that warning.↵The only reason cast gets rid of said warning as well is because cast is no-mans-land in terms of safety
22:37:08FromDiscord<ElegantBeef> Almost like that's a way to get rid of the warning 😄
22:37:30FromDiscord<ElegantBeef> You also can do `{.warning[HoleEnumConv]: off.}` and on
22:37:34FromDiscord<yetiwizard> where would I put that cast?
22:37:35FromDiscord<Chronos [She/Her]> My comment was ignored 😔✊
22:37:38FromDiscord<ElegantBeef> Or whatever that name
22:37:49FromDiscord<ElegantBeef> Around the expression giving the warning instead of a type conversion
22:38:04FromDiscord<ElegantBeef> In reply to @chronos.vitaqua "My comment was ignored": I read it but didnt have anything to respond with
22:38:15FromDiscord<Chronos [She/Her]> Yeah that's fair lol
22:38:28FromDiscord<Phil> I read it and decided to ignore it specifically out of sheer pettiness for that is me.
22:38:40FromDiscord<yetiwizard> In reply to @elegantbeef "You also can do": is this always per file/module?
22:38:46FromDiscord<ElegantBeef> Per project
22:38:55FromDiscord<ElegantBeef> So turn it off inside the block then turn it back on
22:39:16FromDiscord<Chronos [She/Her]> I'd imagine that's how it'd be done, at least according to Beef
22:39:28FromDiscord<Chronos [She/Her]> In reply to @isofruit "I read it and": Shame 😔
22:39:35FromDiscord<ElegantBeef> That or the warning disable
22:39:46FromDiscord<Chronos [She/Her]> Eh, I think this is more convenient
22:39:53FromDiscord<yetiwizard> hmmm, disabling the warning in a template and enabling it again is problematic
22:39:57FromDiscord<ElegantBeef> It uses `cast` so must be obliterated
22:39:58FromDiscord<Chronos [She/Her]> I dislike the fact the warning is turned off for the entire project
22:40:14FromDiscord<ElegantBeef> No one is saying turn it off for the entire project permanently
22:40:21FromDiscord<yetiwizard> cause I'd have to enable it where I use it, rather than doing it in the template
22:40:36FromDiscord<ElegantBeef> You can renable it inside the template
22:40:47FromDiscord<ElegantBeef> `T(0)`
22:40:55FromDiscord<ElegantBeef> Read the line number kids
22:41:12FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/kKrDL
22:41:14FromDiscord<Chronos [She/Her]> I remember trying to use `push` and `pop` to disable an unused import warning but I couldn't figure out why the code kept displaying it, until I decided I could live with it :P
22:41:26FromDiscord<ElegantBeef> Unused imports is done after module is semd
22:41:40FromDiscord<ElegantBeef> You cannot disable it's warning anywhere but project wide
22:41:41FromDiscord<Chronos [She/Her]> Ah so that's why then?
22:41:45FromDiscord<ElegantBeef> Well think about it
22:41:55FromDiscord<Chronos [She/Her]> Shame
22:41:56FromDiscord<ElegantBeef> To know if a module is unused you have to sem the entire module
22:42:05FromDiscord<ElegantBeef> If you disable the warning inside the module then enable it inside the module
22:42:14FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "To know if a": To check if it's unused within a specific file, though?
22:42:22FromDiscord<ElegantBeef> Right
22:42:29FromDiscord<ElegantBeef> But it happens after the entire module is sem'd
22:42:40FromDiscord<ElegantBeef> So as it sems it disables/enables the warning
22:42:42FromDiscord<Chronos [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/NULID/blob/main/src/nulid/private/constants.nim#L40
22:42:43FromDiscord<Chronos [She/Her]> Pain
22:42:45FromDiscord<ElegantBeef> Then it hits the end of the file
22:42:48FromDiscord<ElegantBeef> And it's not used
22:42:50FromDiscord<yetiwizard> sent a code paste, see https://paste.rs/gFhf7
22:43:04FromDiscord<Chronos [She/Her]> Oh well
22:43:22FromDiscord<ElegantBeef> What are you trying to prevent it from warning?
22:43:26FromDiscord<ElegantBeef> Those imports?
22:43:29FromDiscord<Chronos [She/Her]> I get why it happens now, but it's frustrating
22:43:35FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "Those imports?": Yep
22:44:12FromDiscord<Chronos [She/Her]> `HasJsony` and `HasDebby` purely exists so that I can just check a variables rather than using a `when compiles` check (because I just prefer it)
22:44:59FromDiscord<Chronos [She/Her]> Oh that's a good idea
22:45:43FromDiscord<ElegantBeef> Alternatively just put the unused switch around the import of `constants`
22:46:22FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/Xlux4
22:47:03FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/iAbPO
22:51:02FromDiscord<ElegantBeef> Me like CTE
22:53:04FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/FbVPj
23:36:12*xutaxkamay joined #nim
23:43:37*jmdaemon joined #nim
23:46:31*notbad quit (Remote host closed the connection)