<< 05-06-2024 >>

01:14:45*Batzy joined #nim
01:30:18*beholders_eye quit (Read error: Connection reset by peer)
01:36:33*beholders_eye joined #nim
01:50:59*rockcavera quit (Remote host closed the connection)
02:04:56*rockcavera joined #nim
02:23:57*dza7 joined #nim
02:24:29*dza quit (Ping timeout: 255 seconds)
02:24:35*dza7 is now known as dza
02:25:32FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=EybLNuGU
02:25:55FromDiscord<saiplayz1138> yo
02:38:02*pmp-p quit (Quit: No Ping reply in 180 seconds.)
02:39:19*pmp-p joined #nim
02:49:39*krux02 quit (Quit: Leaving)
02:55:43FromDiscord<demotomohiro> In reply to @user2m "is there a way": You probably need to write a macro that takes code block and adds `importc` pragma.
02:57:33*beholders_eye quit (Ping timeout: 268 seconds)
03:28:47FromDiscord<saiplayz1138> is making a discord bot with nim easy?
03:40:06FromDiscord<sebastian_solace> is there a way to import the wincrypt32 lib into nim?
03:43:50systemdsucksyou can wrap it with something like futhark
04:31:14FromDiscord<morgan> anyone know how broken either of the bgfx bindings are?
04:31:21FromDiscord<morgan> given how ancient they both are
04:32:21FromDiscord<morgan> oh there's one from 2 years ago
04:34:14FromDiscord<morgan> also i decided to see if the author of the less old of the two really old ones (that are on nimble) and i was not expecting all that conspiracy stuff from the author dayum
04:34:30FromDiscord<morgan> (edit) "also i decided to see if the author of the less old of the two really old ones (that are on nimble) ... and" added "was around to ask about if it still worked"
04:34:50FromDiscord<morgan> (reposting since im not sure edits are propagated)↡also i decided to see if the author of the less old of the two really old ones (that are on nimble) was around to ask about if it still worked and i was not expecting all that conspiracy stuff from the author dayum
04:39:17FromDiscord<morgan> sokol has great nim support but doesn't have an easy way to render to an existing window
04:39:20FromDiscord<morgan> which i need
04:39:24FromDiscord<morgan> like hard requirement
04:39:34FromDiscord<morgan> and bgfx looks to have that
04:39:36FromDiscord<morgan> sooooooo
04:39:45FromDiscord<morgan> i am going to switch to that lol
04:40:13FromDiscord<morgan> <https://github.com/JoshFlash/bgfx-nim> this is at least only 2 years old so it hopefully won't take too much to get working
04:40:49FromDiscord<morgan> and then maybe i'll make a third package on nimble for bgfx lol
04:41:40FromDiscord<morgan> is there any process or whatever for retiring old and unsupported packages to not clutter nimble with tons of old unusable stuff?
04:53:39*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
04:54:04*SchweinDeBurg joined #nim
05:12:42FromDiscord<Robyn [She/Her]> In reply to @saiplayz1138 "is making a discord": There is Dimscord for the Discord API in Nim
05:13:17FromDiscord<Robyn [She/Her]> In reply to @morganalyssa "is there any process": Don't believe so, maybe by filing an issue on the GitHub, maybe?
05:13:45FromDiscord<Robyn [She/Her]> In reply to @morganalyssa "and then maybe i'll": Are you going to make a Nim bindings generator using the Lua stuff in the BGFX window?
05:14:41FromDiscord<morgan> lua?
05:14:50FromDiscord<saiplayz1138> In reply to @chronos.vitaqua "There is Dimscord for": is it easy to use
05:15:01FromDiscord<morgan> do they have something that generates bindings like sokol has?
05:15:33FromDiscord<morgan> it would be cool to have autogenerated and thus easily updated bindings for bgfx too
05:22:16FromDiscord<Robyn [She/Her]> In reply to @saiplayz1138 "is it easy to": It could be better but it does seem good
05:22:26FromDiscord<Robyn [She/Her]> In reply to @morganalyssa "do they have something": Yeah, it's Lua scripts but idk how they work
05:22:33FromDiscord<morgan> huh neat
05:22:46FromDiscord<saiplayz1138> is there a reason why nim isn't that popular
05:23:47FromDiscord<Robyn [She/Her]> In reply to @saiplayz1138 "is there a reason": Mostly just because other languages like Rust or Golang have big backers I'd imagine
05:23:50FromDiscord<morgan> i think it's in part that it has yet to have a big company kinda force it into some degree of popularity
05:24:04FromDiscord<saiplayz1138> hm
05:24:09FromDiscord<morgan> like rust was written by a mozilla employee
05:24:15FromDiscord<Robyn [She/Her]> Also there are some issues with Nim at times
05:24:16FromDiscord<saiplayz1138> cuz from what I see, Nim is basically my dream language
05:24:28FromDiscord<Robyn [She/Her]> In reply to @saiplayz1138 "cuz from what I": I mostly feel the same :)
05:24:34FromDiscord<morgan> yea i quite like nim
05:24:34FromDiscord<Robyn [She/Her]> Been using it for a few years now
05:24:43FromDiscord<morgan> it's been my main language for a while
05:24:56FromDiscord<saiplayz1138> easy to type, fast, can be used for the web
05:25:05FromDiscord<saiplayz1138> it can do literally everything honestly
05:25:09FromDiscord<morgan> not the only one i've used in the past few years but the one i use if im starting a project
05:40:17FromDiscord<ElegantBeef> Oh @Robyn [She/Her] I realized the issues I mentioned about the type graph where actually down to a type hash
05:40:24FromDiscord<ElegantBeef> So it only really effects destructors
05:43:12FromDiscord<Robyn [She/Her]> In reply to @elegantbeef "Oh <@524288464422830095> I realized": Where you needed a field that contained the unused generic values?
05:43:56*rockcavera quit (Remote host closed the connection)
05:44:49FromDiscord<ElegantBeef> Yea
05:57:21*ntat joined #nim
06:10:46FromDiscord<Robyn [She/Her]> Good to know
06:30:16*PMunch joined #nim
06:42:26*ntat quit (Quit: Leaving)
07:16:33FromDiscord<Robyn [She/Her]> Oof
09:34:06*beholders_eye joined #nim
09:50:06*beholders_eye quit (Ping timeout: 268 seconds)
10:03:41*beholders_eye joined #nim
10:54:18FromDiscord<Robyn [She/Her]> Can you make Nim inline closures when possible?
11:02:23FromDiscord<Robyn [She/Her]> Ah, I keep getting `getTypeDescAux(tyVoid)`... :/
11:03:06FromDiscord<Robyn [She/Her]> I did run koch temp c on it but it was a bunch of gibberish to me, but the only places I've used void in the code is in the generated empty field defs, could that be the issue?
11:06:07FromDiscord<Robyn [She/Her]> https://pasty.ee/qzDCakNK
11:07:40FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "Ah, I keep getting": Yeah changing that to a different type solved the issue, I'm guessing to fix it, I need to use discard in the case statement instead
11:14:54*beholders_eye quit (Ping timeout: 268 seconds)
11:24:55FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=GUmDmmAd
11:24:56FromDiscord<Robyn [She/Her]> Hm.
11:37:58FromDiscord<Robyn [She/Her]> Nice, fixed it
11:38:06FromDiscord<Robyn [She/Her]> `newLit(nil)` was the issue
11:38:11FromDiscord<Robyn [She/Her]> `newNilLit` worked
11:52:28FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=pfeOJlMF
11:52:30FromDiscord<Robyn [She/Her]> 😭
11:53:20*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
11:53:53FromDiscord<Robyn [She/Her]> https://play.nim-lang.org/#pasty=xakBlrGS
11:54:16FromDiscord<Robyn [She/Her]> This is the relevant code, not sure why it's an issue?
11:55:05*xutaxkamay joined #nim
12:01:09*ntat joined #nim
12:10:43FromDiscord<ravinder387> any body know how to deploy prologue nim app at github action
12:11:29FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#pasty=bDOaguSt
12:47:52FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=NEHQnlnU
12:58:46FromDiscord<Robyn [She/Her]> In reply to @griffith1deadly "maybe `thenBlock` not closure": Even then, it should be a `nimcall` which is accepted into closures
12:59:05FromDiscord<Robyn [She/Her]> In reply to @ravinder387 "hi robyn how are": I'm fine, thanks for asking, how about you Ravinder?
13:34:15FromDiscord<Robyn [She/Her]> Anyone familiar with the `genasts` module? Trying to use it rn to generate a closure, but the implicit capture is messing me over rn because I can't do `result = "my value"` without it trying to set the result for the macro
13:37:00FromDiscord<Robyn [She/Her]> I just used `quote do` instead
13:46:39*lucasta joined #nim
13:53:11PMunchThat's not really tinnitus is it though?
13:53:17PMunchWhoops, wrong channel
13:56:13*PMunch quit (Quit: Leaving)
13:57:02*beholders_eye joined #nim
14:41:04*rockcavera joined #nim
15:51:38*strogon14 joined #nim
16:03:23*lucasta quit (Quit: Leaving)
16:25:48FromDiscord<frusadev> sent a code paste, see https://play.nim-lang.org/#pasty=fZRKeuWs
17:09:39FromDiscord<sOkam! 🫐> I have defined an `Thing = enum` and a set of flags with that enum as `set[Thing]`↡what would be the way to use the set to check for condition in `case of ...` situations?
17:12:46FromDiscord<Robyn [She/Her]> In reply to @heysokam "I have defined an": `case thing of thingSet: ...`?
17:13:30FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "`case thing of thingSet:": whats thing and whats thingset?
17:14:56FromDiscord<Robyn [She/Her]> I would've thought it was obvious :p↡`thing` is one of the values in your `Thing` enum and `thingSet` is `set[Thing]`
17:17:33FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=fwJJxKja
17:17:48FromDiscord<sOkam! 🫐> you cannot use the set to filter for each case
17:18:12FromDiscord<Robyn [She/Her]> Ah, that you can't do, you could use `if One in arg: ... if Two in arg: ...` etc
17:18:37FromDiscord<sOkam! 🫐> yeah well, then you lose the power of switches (aka not repeat yourself 10 times on each check)
17:18:47FromDiscord<sOkam! 🫐> that's why I was asking about `case of`
17:19:50FromDiscord<Robyn [She/Her]> In reply to @heysokam "yeah well, then you": Can always make a template?
17:20:08FromDiscord<Robyn [She/Her]> Or a macro
17:21:09FromDiscord<sOkam! 🫐> `disjoint` never heard of it, but I guess this is what I need↡https://nim-lang.org/docs/sets.html#disjoint%2CHashSet%5BA%5D%2CHashSet%5BA%5D
17:21:40FromDiscord<nervecenter> In reply to @chronos.vitaqua "Can always make a": You can overload the proc multiple times with different parameters if that's what you're talking about
17:22:25FromDiscord<Robyn [She/Her]> In reply to @heysokam "`disjoint` never heard of": Oh neat
17:22:31FromDiscord<Robyn [She/Her]> In reply to @nervecenter "You can overload the": No, that's not it aha
17:22:42FromDiscord<nervecenter> Ah yeah this is a runtime thing
17:30:22FromDiscord<frusadev> sent a code paste, see https://play.nim-lang.org/#pasty=pNNDcQsB
17:32:24FromDiscord<Robyn [She/Her]> Nimsuggest is fragile, is all I can say
17:34:51FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=UlNQCubP
17:37:26FromDiscord<sOkam! 🫐> In reply to @frusadev "Can someone tell me": I'd try renaming `Token`, `DynamicTree`, `Tokens` to different, just to make sure you are not colliding with something in the compiler
17:37:41FromDiscord<sOkam! 🫐> might not be the reason, but it's the first thing that comes to mind
17:37:43FromDiscord<frusadev> In reply to @chronos.vitaqua "Nimsuggest is fragile, is": I see
17:40:28FromDiscord<frusadev> In reply to @heysokam "I'd try renaming `Token`,": Yep. I tried to rebuild line by line the file. But nimsuggest crashed when i wrote `iterations -= 1`
17:43:08FromDiscord<sOkam! 🫐> I believe there is a `dec` or `decr` for decreasing values, just like `inc(num)`
17:43:43FromDiscord<sOkam! 🫐> probably not an answer to your question, since you ask about the bug, but maybe it gets you past the error
17:43:55FromDiscord<sOkam! 🫐> (edit) "bug," => "crash,"
17:44:47FromDiscord<sOkam! 🫐> is there any equivalent to `someSet.incl( thing )` that does not take a `var set[T]`, and actually returns the new set? πŸ€”
17:46:24FromDiscord<Robyn [She/Her]> In reply to @heysokam "is there any equivalent": You could use `dup`, from `std/sugar`, maybe?
17:47:35FromDiscord<kots> How about `someSet + {thing}`?
17:47:54FromDiscord<frusadev> In reply to @heysokam "probably not an answer": Thanks. I'll that once i get back to my laptop
17:48:43FromDiscord<frusadev> (edit) "In reply to @heysokam "probably not an answer": Thanks. I'll ... that" added "try"
17:51:32FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "You could use `dup`,": using syntatic sugar for a basic function declaration? πŸ€·β€β™‚οΈ
17:51:55FromDiscord<sOkam! 🫐> sounds like duck-taping the situation 😦
17:51:58*krux02 joined #nim
17:52:54FromDiscord<Robyn [She/Her]> You could make a PR to the stdlib?
18:57:21FromDiscord<pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=uCNddpRl
18:57:41*m5zs7k quit (Ping timeout: 240 seconds)
18:58:00FromDiscord<pmunch> (edit) "https://play.nim-lang.org/#pasty=SbGyAwGt" => "https://play.nim-lang.org/#pasty=jdWQVGcv"
18:58:14FromDiscord<pmunch> Should be much faster
18:58:44*m5zs7k joined #nim
19:04:32*ntat quit (Quit: Leaving)
19:05:25FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "You could make a": this assumes there is no function for that purpose. my question wasn't "why is there no function for it" but "what is the function for it" πŸ€·β€β™‚οΈ
19:05:33FromDiscord<sOkam! 🫐> (edit) "purpose. my" => "purpose↡my"
19:06:53FromDiscord<sOkam! 🫐> In reply to @pmunch "`card(b - a) ==": why is this resulting into an `anyIn` check?
19:08:02FromDiscord<sOkam! 🫐> also, `len` is much more readable than `card`
19:09:45FromDiscord<pmunch> Depends on how you look at it, cardinality is a set thing πŸ€·β€β™‚οΈ
19:09:55FromDiscord<pmunch> And that's the disjoint test
19:09:55*zgasma quit (Quit: leaving)
19:10:14FromDiscord<sOkam! 🫐> oh, I think I see what you mean https://media.discordapp.net/attachments/371759389889003532/1247990883526246460/image.png?ex=66620995&is=6660b815&hm=1135baa9ed5c440cad9915eee53ee6115b3e427c13edb17acd3b04bbb1925025&
19:10:34FromDiscord<pmunch> If the set B subtracting all the elements of set A is the same size as B then B is disjoint with A
19:10:36FromDiscord<sOkam! 🫐> In reply to @pmunch "And that's the disjoint": I just copy/pasted the `disjoint` implementation, tbh
19:11:09FromDiscord<sOkam! 🫐> In reply to @pmunch "Depends on how you": but you need to understand sets math to even know the concept
19:11:28FromDiscord<sOkam! 🫐> while `len` is available for any other `seq`, `array`, etc
19:12:21FromDiscord<sOkam! 🫐> In reply to @pmunch "If the set B": you say this is faster than the for loop? i don't mind which to use, tbh
19:16:11NimEventerNew thread by mishankov: XSLT transformations, see https://forum.nim-lang.org/t/11715
19:21:45*beholders_eye quit (Ping timeout: 268 seconds)
19:28:22FromDiscord<ElegantBeef> In reply to @pmunch "`card(b - a) ==": Probably not cause `card` of a set is a `O(n)` operation
19:30:13FromDiscord<ElegantBeef> If it's a small enough set you can just do `cast[int](b - a) > 0`
19:30:23FromDiscord<ElegantBeef> Well `cast[uint]`
19:33:53Amun-Rawhy not (b - a).int > 0?
19:34:08FromDiscord<ElegantBeef> Cause sets cannot be converted to integers
19:34:17Amun-Raah, these are sets
19:34:22FromDiscord<ElegantBeef> https://play.nim-lang.org/#pasty=yjFTfPQw a generic solution for all sets is this
19:35:31FromDiscord<ElegantBeef> Though since this makes a new set it's probably slower than sokams
19:35:47FromDiscord<ElegantBeef> For larger sets atleast
19:36:01FromDiscord<ElegantBeef> Assuming `a` is a small set
19:36:04FromDiscord<pmunch> In reply to @elegantbeef "Probably not cause `card`": Hmm, didn't think of card as being expensive..
19:36:34FromDiscord<ElegantBeef> Well it's just `countBits` repeatedly over the set
19:36:44FromDiscord<ElegantBeef> So it requires iterating the entire set
19:36:54FromDiscord<ElegantBeef> You technically can do `for x in a b: return true`
19:37:06FromDiscord<pmunch> Would `b - a == a` be faster?
19:37:18FromDiscord<ElegantBeef> That checks if all of a is in b
19:37:20FromDiscord<ElegantBeef> Not if any
19:37:40FromDiscord<ElegantBeef> For a set that is <=8 bytes yes that's 2 ops
19:37:44FromDiscord<pmunch> Oh sorry, meant `b - a == b`
19:37:47FromDiscord<ElegantBeef> But any larger set that's iteration
19:38:16Amun-Rafun fact: set `aaa` is longer than set `a` (glad, I could help)
19:38:36FromDiscord<ElegantBeef> Lol
19:38:52FromDiscord<pmunch> Iterating over the bytes though, not bit masking out every value
19:39:13FromDiscord<ElegantBeef> Sokam's method is likely the fastest without getting into simd
19:39:38FromDiscord<ElegantBeef> You can throw large sets into simd and compare with 0
19:39:48FromDiscord<ElegantBeef> Well `or` then `cmp`
19:40:16FromDiscord<ElegantBeef> Especially since `anyIn` is an early exist
19:40:19FromDiscord<ElegantBeef> exit
19:40:41FromDiscord<ElegantBeef> It's the best if you can test each value sequentially as it's `O(1)` lookup
19:40:55FromDiscord<ElegantBeef> But it does mean the worst case is `O(n)` to see if any are in
19:41:17FromDiscord<ElegantBeef> the fastest is highly variable on the size of the tested set and the set type
19:41:27FromDiscord<ElegantBeef> Am I rambling? I might be rambling
19:41:35Amun-Ranah
19:42:07FromDiscord<ElegantBeef> Could be a fun project to add simd variations of set operations
20:05:22FromDiscord<sOkam! 🫐> you have a very unique definition of fun
20:05:38FromDiscord<sOkam! 🫐> I hear simd and run the other way πŸ™ˆ
20:12:13FromDiscord<ElegantBeef> Cmon you just have to manually write into registers then apply operations then extract the data!
20:21:46FromDiscord<Robyn [She/Her]> Ugh the mention of registers reminds me of the deal with my friend 😭
20:22:02FromDiscord<Robyn [She/Her]> He wants me to write a pacman game in assembly
20:23:08FromDiscord<Robyn [She/Her]> I can use any platform's assembly (Gameboy, Atari, Windows x64, Linux Arm64, etc) but it must be something that can run on bare-metal, even if I use an emulator for dev and actually showcasing it
20:23:51FromDiscord<huantian> Go risc v
20:24:14*beholders_eye joined #nim
20:25:27FromDiscord<saint.___.> 68k
20:27:00FromDiscord<Robyn [She/Her]> In reply to @huantian "Go risc v": Idk how I'd draw pixels to the screen with an emulator
20:27:39FromDiscord<Robyn [She/Her]> In reply to @saint.___. "68k": What's that? Amiga 68k, what was it made for?
20:27:49FromDiscord<Robyn [She/Her]> In reply to @chronos.vitaqua "Idk how I'd draw": Prolly via QEMU or something
20:29:15FromDiscord<saint.___.> In reply to @chronos.vitaqua "What's that? Amiga 68k,": Ohh I meant motorola 68k
20:29:21FromDiscord<saint.___.> But I see you wanna do a game system
20:33:28FromDiscord<Robyn [She/Her]> In reply to @saint.___. "But I see you": They're probably gonna be a lot easier to develop a pacman-like game for
20:36:12FromDiscord<saint.___.> Ya true
20:36:20FromDiscord<saint.___.> Gameboy could be cool
20:36:42FromDiscord<saint.___.> 68k is pretty easy though
20:36:55FromDiscord<saint.___.> Lots of documentation for it
20:39:19FromDiscord<Robyn [She/Her]> The Amiga one?
21:03:31FromDiscord<pmunch> The arduboy could be fun
21:21:01FromDiscord<Robyn [She/Her]> Ooooh I'll look into that, thanks PMunch :>
21:21:39*krux02_ joined #nim
21:24:10*krux02 quit (Ping timeout: 246 seconds)
22:17:28*beholders_eye quit (Read error: Connection reset by peer)
22:23:20*beholders_eye joined #nim
22:25:13*beholders_eye quit (Read error: Connection reset by peer)
22:25:41*beholders_eye joined #nim
22:42:36FromDiscord<Elegantbeef> Is it alive again?!
22:42:46FromDiscord<ElegantBeef> Seems bridge is up
22:58:49*m5zs7k quit (Ping timeout: 268 seconds)
23:00:04*m5zs7k joined #nim
23:10:11*dtomato quit (Ping timeout: 264 seconds)
23:17:38*dtomato joined #nim
23:29:19*beholders_eye quit (Read error: Connection reset by peer)
23:33:40*dtomato quit (Ping timeout: 268 seconds)
23:35:04*beholders_eye joined #nim
23:41:19*dtomato joined #nim
23:45:04*beholders_eye quit (Ping timeout: 268 seconds)