<< 08-06-2023 >>

00:20:32*azimut quit (Ping timeout: 240 seconds)
00:26:53*derpydoo joined #nim
00:45:51*oldpcuser quit (Ping timeout: 256 seconds)
00:46:13*oldpcuser joined #nim
00:47:27FromDiscord<Graveflo> Didn't someone mention a while back that there a is bug in the forums that can lock you out of your account? cuz I can't log in xd
02:06:46*krux02_ quit (Remote host closed the connection)
02:22:19*oldpcuser quit (Quit: "mIRC is sh1t because is non-free software. doesn't respect my chatting freedom!" Richard Stallman)
02:30:36*oldpcuser joined #nim
02:35:13FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4xJd
02:35:39FromDiscord<Elegantbeef> try finally exists
02:35:47FromDiscord<etra> (edit) "https://play.nim-lang.org/#ix=4xJd" => "https://play.nim-lang.org/#ix=4xJe"
02:36:50FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xJf
02:37:07FromDiscord<Graveflo> and i have this too but it doesn't work:
02:37:19FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xJg
02:40:52FromDiscord<etra> hey, beef, since you're here, early I was dealing with this: https://discord.com/channels/371759389889003530/371759389889003532/1116091536157970573↵and later solved it with https://discord.com/channels/371759389889003530/371759389889003532/1116107426081550436, is it too shitty of a solution?
02:41:01FromDiscord<etra> for some reason, winim has `HANDLE` as int...
02:42:29FromDiscord<Elegantbeef> I mean it seems HANDLE is supposed to be a pointer to void
02:43:17FromDiscord<Elegantbeef> So the correct thing to do would be to fork or PR Handle to be `type Handle {.byRef.} = object` or `type Handle = ptr object` I guess
02:43:46FromDiscord<Elegantbeef> It's just an opaque pointer
02:43:47FromDiscord<etra> yeah, but I'm unsure I should do a PR to winim, and I'm trusting my dependency's import of `windows.h` lol
02:44:45FromDiscord<Elegantbeef> I mean you should atleast make an issue
02:48:24FromDiscord<Elegantbeef> From what I can tell `Handle` should be an opaque pointer. I dont know C well but `typedef PVoid Handle` is not `Handle = int` 😄
02:49:16FromDiscord<etra> yeah, it seems like a major oversight
02:54:45FromDiscord<Elegantbeef> Do make an issue a the very least though
03:09:24*oldpcuser quit (Quit: "mIRC sucks because is non-free software" Richard Stallman)
03:22:57*disso-peach joined #nim
04:13:26*oldpcuser joined #nim
04:23:28*oldpcuser quit (Remote host closed the connection)
04:59:44*oldpcuser joined #nim
05:14:38FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xJu
05:15:11FromDiscord<Elegantbeef> Why dont you just use your own iterator
05:16:09FromDiscord<Elegantbeef> `for key, value in vt.config.pairs` or `for key, value in vt.pairs` makes much more sense than using template for an iterator
05:16:15FromDiscord<Graveflo> actually that would make sense here. I also screwed up the generic form again. The reason I didn't want to do that is because iteration used to be generic because `VCTTableRef` used to not be concrete. Custom iterator is better here yea
05:16:39FromDiscord<Graveflo> still tho say I was as it were before where it is generic. Why do I have to do weird stuff to bind in deps sometimes?
05:17:09FromDiscord<Elegantbeef> templates are not procedures they have even odder binding rules
05:17:16*oldpcuser quit (Remote host closed the connection)
05:17:44FromDiscord<Graveflo> I noticed... Ok I guess for now the rules is just "they're odd"... I swear I'm going to track down the actual mechanics of this crap one day
05:43:00FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xJz
05:43:09*oldpcuser joined #nim
05:46:32FromDiscord<Elegantbeef> What's even the point of `S(v)`?
05:47:13FromDiscord<Graveflo> your right. I just got it to work with `VideoColorTable[T](v)` and the compiler agrees with you... the problem is it's not binding to the correct generic for that concrete type. So different error then I though
05:48:43FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xJA
05:51:19FromDiscord<Graveflo> also I don't like the dupe loop too much and ignore that weird character concat at the end 😅
05:52:43FromDiscord<Graveflo> ok `pairs` needed to be public I guess
05:54:58FromDiscord<demotomohiro> You can write `&"{header}.{key}\n"` instead of `fmt"..." + '\n'`.
05:55:31FromDiscord<Graveflo> unfortunately not in `fmt` string I believe. I forgot just now too and tried it.
05:56:06FromDiscord<Graveflo> oh you use `&`
05:57:10FromDiscord<demotomohiro> Check: https://nim-lang.org/docs/strformat.html#nimfmt-vsdot-nimamp
05:58:17FromDiscord<Elegantbeef> no it doesnt need to be public
05:58:22FromDiscord<Elegantbeef> you just need to do `v.pairs`
05:59:38FromDiscord<Graveflo> no symbols that are not going to be in scope for client code have to be mentioned in the place of origin to get bound correctly? in general
06:00:11FromDiscord<Graveflo> (edit) "no" => "so"
06:04:04FromDiscord<Elegantbeef> Implicit iterators are broken
06:04:05FromDiscord<Elegantbeef> You have to use them explicitly in a generic otherwise they do not bind
06:04:30FromDiscord<Graveflo> noted thx guys
06:05:41FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4xJF
06:06:22FromDiscord<ringabout> I debugged a bit, it seems that it loses the type info of a, b; namely openArray in VM.
06:06:33FromDiscord<ringabout> (edit) "VM." => "move2."
06:07:29FromDiscord<Elegantbeef> Given it's the NimVm this should be a relatively easy operation, quite odd that it errors
06:08:40FromDiscord<ringabout> Well, it should have of `nkTupleConstr`(# refer to `of opcSlice`) type, but instead it becomes `nkStrLit`.
06:08:46FromDiscord<ringabout> (edit) removed "of"
06:09:37FromDiscord<ringabout> Indeed.
06:09:50*ntat joined #nim
06:11:42FromDiscord<arnetheduck> @ringabout in the category of version-2-0 failures, here's another one that works on devel and everywhere else, but not 2.0: https://github.com/status-im/nim-stew/pull/134
06:12:28FromDiscord<arnetheduck> it's actually not the code in the PR that fails, but rather some other stuff I think
06:12:36FromDiscord<arnetheduck> ie unrelated regression
06:13:22*rockcavera quit (Remote host closed the connection)
06:13:34FromDiscord<ringabout> Well, I guess version-2-0 might reset to devel. Not many commits to bisect anyway.
06:17:35FromDiscord<ringabout> In reply to @arnetheduck "<@658563905425244160> in the category": Isn't it the regression you reported?
06:18:14FromDiscord<arnetheduck> I did? 🙂 not sure
06:19:25FromDiscord<arnetheduck> ah, actually yeah, it might have been - I got confused by the test output
06:19:36FromDiscord<arnetheduck> and yeah, it might actually be the code in the PR after all
06:20:14FromDiscord<ringabout> Probably this one https://github.com/nim-lang/Nim/issues/21840
06:24:26FromDiscord<arnetheduck> right, thanks for checking, I had forgotten about it tbh.. that said, we'll be merging that PR soon which would mean that both your and our v2.0 tests will be red
06:25:59FromDiscord<ringabout> In reply to @arnetheduck "right, thanks for checking,": I have no idea of 2.0 policy, you might discuss it with miran.
06:43:15*PMunch joined #nim
06:46:25*azimut joined #nim
06:51:07PMunchvoidwalker, glad my Futhark wrapper helped you :) As you can see wrapping stuff isn't all that hard :)
07:10:41*junaid_ joined #nim
07:13:07FromDiscord<Chronos [She/Her]> In reply to @demotomohiro "You can write `&"{header}.{key}\n"`": Could do `"{header}.{key}\n".fmt` which I really like lol
07:16:14FromDiscord<Graveflo> yea that does work
07:18:24FromDiscord<pmunch> Hmm, is the IRC bridge broken?
07:18:36PMunchIt doesn't seem like my messages make it through..
07:18:46PMunchStrange, now it worked
07:18:50NimEventerNew post on r/nim by thindil: Nimalyzer, a static code analyzer for Nim (early alpha)., see https://reddit.com/r/nim/comments/14429rh/nimalyzer_a_static_code_analyzer_for_nim_early/
07:19:00PMunchBut my message to voidwalker about Futhark got lost :(
07:19:18FromDiscord<Elegantbeef> Oh there's pmunch 😄
07:19:34PMunchUh oh
07:19:38PMunchIt's an ambush!
07:19:40FromDiscord<Elegantbeef> So in response of your "Doesnt that mean your language needs a compiler"
07:19:47FromDiscord<Elegantbeef> You mean just like x86? 😄
07:19:56PMunchHuh?
07:20:05FromDiscord<Elegantbeef> All modern system languages atleast can create a wasm file
07:20:06PMunchOh is this about the webassembly stuff?
07:20:16FromDiscord<Elegantbeef> Yea
07:20:24PMunchRight, well that's a fair point
07:20:50PMunchI was just vary that I might exclude popular languages like Python by going that route
07:21:05FromDiscord<Elegantbeef> Sure but you also exclude python with a dynamic library
07:21:08PMunchOr even just less popular ones, but which still have the ability to create dynamic libraries
07:21:30PMunchNot really, you can use the Python embedded interpreter to write a Python loader dynamic library
07:22:04FromDiscord<Elegantbeef> You can do the same with the aforementioned python wasm runtime
07:22:39PMunchRight
07:23:56FromDiscord<Chronos [She/Her]> (Pyodide or even CPython via Emscripten)
07:24:09FromDiscord<Chronos [She/Her]> (Or MicroPython (subset) or RustPython (Rust impl)
07:24:21FromDiscord<Chronos [She/Her]> (edit) "impl)" => "impl))"
07:24:36FromDiscord<Elegantbeef> depending on what this is for of course there is also the benefit wasm is compile once deploy everywhere
07:24:53FromDiscord<Elegantbeef> So if there's ever a desire to share plugins with others it's just better
07:25:57FromDiscord<Chronos [She/Her]> Yeah, all you need is a WASM runtime, which if it's for your application, then you'd compile one in too
07:28:28PMunchSo what's the recommended way to integrate Wasm into a Nim application at the moment?
07:30:16FromDiscord<Elegantbeef> I personally use wasm3
07:30:32FromDiscord<Elegantbeef> A nice C library that's MIT licensed so extremely easy to include
07:32:20PMunchOh nice
07:33:21FromDiscord<Elegantbeef> You can use any runtime you want of course assuming you write bindings for it, there are some JIT'd ones if that's something you care about
07:33:28FromDiscord<Elegantbeef> Wasm3 is a very basic VM
07:33:58*advesperacit joined #nim
07:35:48FromDiscord<Elegantbeef> It also does something I appreciate a lot, it returns cstrings for errors/messages
07:36:33FromDiscord<Elegantbeef> Wasmer/Wasmtime had much more complicated error messages. Wasmer used Rust results practically as did Wasmtime I think
08:20:08*azimut quit (Ping timeout: 240 seconds)
08:21:28*azimut joined #nim
08:36:32*derpydoo quit (Ping timeout: 246 seconds)
08:56:24PMunchNew article out! This one is more of a guide https://peterme.net/setting-up-a-nim-server-for-dummies.html
08:56:40PMunchAnd please, if you have anything I should add let me know
09:07:13FromDiscord<leetnewb> In reply to @PMunch "And please, if you": I know dns isn't really the point, but it is mysterious to enough people that it might be worth explaining what A and AAAA records do
09:08:13PMunchHmm, fair point
09:09:37PMunchI originally just wrote this as I went when setting up a server. And then I filled in some more instructions and explanations before I posted it
09:12:19FromDiscord<leetnewb> I like including the unit file. That can be a little painful to search out.
09:16:23FromDiscord<spacestella> hello, i need the equivalent of `#define macro() // code` in nim. i have tried macros, templates, quote and `quote do`, but none have worked and the compiler just throws a thousand meaningless errors saying it expect type A but got type A instead. is there any way i can just instruct the compiler to replace every said macro call straight up with the text inside the macro?
09:17:09PMunchspacestella, that is what a template does
09:17:19PMunchIf you get type errors it's likely because your types are incorrect
09:17:31PMunchCould you show us an example of what you're doing?
09:18:11FromDiscord<spacestella> sent a code paste, see https://play.nim-lang.org/#ix=4xK7
09:18:13FromDiscord<spacestella> here's a simplified version of my code
09:18:13PMunchleetnewb, yeah for servers I really like running it as a service. So much less stress to know that it just restarts with the server and restarts if it ever crashes
09:18:37FromDiscord<spacestella> if i just replace the content inside of the quote do in the macro with the declaration, there are no errors.
09:18:38FromDiscord<Graveflo> return `untyped`
09:19:00PMunchOh and you need to add `{.inject.}` to those variables
09:19:48FromDiscord<spacestella> In reply to @PMunch "Oh and you need": to each of the variables?
09:19:57FromDiscord<spacestella> what about proc definitions and type definitions?
09:20:22PMunchThis works: https://play.nim-lang.org/#ix=4xK8
09:20:30FromDiscord<Graveflo> in macros you dont need to inject right munch?
09:21:28FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4xK9
09:21:37PMunchWell in a macro I think you need to first use `newIdent` and then quote it
09:21:39PMunchhttps://nim-lang.org/docs/manual.html#templates-hygiene-in-templates
09:21:51FromDiscord<spacestella> is there any way i could avoid the `{. inject .}`
09:21:56PMunchThat's the section on hygiene in templates
09:22:13PMunchSure, you could mark your template as `{.dirty.}` instead
09:22:57PMunchLike so: https://play.nim-lang.org/#ix=4xKa
09:24:29FromDiscord<spacestella> THANK YOU
09:24:45FromDiscord<spacestella> I HAVE BEEN STUCK ON THIS ISSUE FOR MORE THAN FIVE HOURS
09:25:26FromDiscord<Graveflo> well strap in. There's a lot of little things to learn. I'm still learning myself. It's been worth it so far
09:26:15FromDiscord<spacestella> In reply to @Graveflo "well strap in. There's": nim is certainly an amazing language. however, in my opinion there are some quirks to it, which are a bit annoying. but as you said, it's definitely worth it!
09:26:49FromDiscord<spacestella> also, do you know any good nim extensions for vscode? i have looked at every nim extension and they only provide basic warnings and errors on file sace.
09:27:08PMunchHaha, it also helps to ask here sooner than five hours into a problem :P
09:27:54FromDiscord<spacestella> In reply to @PMunch "Haha, it also helps": i think i did ask
09:28:06*redj joined #nim
09:36:44FromDiscord<spacestella> In reply to @PMunch "Haha, it also helps": by the way, can i split parts of an if-elif-...-elif-else block into different templates?
09:37:20FromDiscord<Graveflo> use a `case` statement probably
09:38:27FromDiscord<Zoom> Your background hue is too green to fit this blue sidebar. Perhaps make it orangeish (#F6F2F0) or blueish (#F3F7FA). Right-margin on the `.letter` spans ruins the title's kerning. I understand why it's there, but better remove it and, dunno, transition the rest of the name to background on collapsing the sidebar. Now onto the article...↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
09:47:56PMunchspacestella, no unfortunately such a block is a single AST node, so you can't split it into multiple templates
09:48:46PMunchAnd Zoom I assume that comment was meant to link to my article and not to the Nim doc page I shared :P
09:52:29PMunchNot quite sure what you mean about the `.letter` spans ruining the title kerning though..
10:01:23FromDiscord<spacestella> In reply to @PMunch "<@860891878077890561>, no unfortunately such": can i write the contents of each if/elif block in a template instead?
10:44:34PMunchLike the body of each block? Sure
11:08:17FromDiscord<Asbjørn> sent a long message, see http://ix.io/4xKq
11:08:18FromDiscord<Asbjørn> sent a long message, see https://paste.rs/jT4PI
11:08:49FromDiscord<Asbjørn> Any hints or ideas are appreciated 🫂
11:11:58PMunchHow do you create the cstrings?
11:15:35PMunchMy best guess is that the cstring (which is just a pointer to the first character in the string) is created in such a way that the pointer always stays the same and you simply modify the data underneath. So each time you send the cstring you send the same pointer address, and when your main reads from the channel the data is always the last value for the string.
11:22:12FromDiscord<Asbjørn> Hmm the `cstring` is created by calling an external C function. I can print it from inside the worker thread, but it doesn't survive the channel.
11:25:39FromDiscord<Asbjørn> sent a long message, see https://paste.rs/jo6uY
11:30:12PMunchTry casting the cstring to an int and print that out (both before you add it to the channel and after)
11:30:19NimEventerNew thread by Ivansete: Understanding `await sleepAsync`, see https://forum.nim-lang.org/t/10258
11:30:39PMunchSince it's just a pointer that cast should be fine and you can see if they all point to the same piece of memory
11:31:19NimEventerNew thread by Ivansete: Understanding await sleepAsync, see https://forum.nim-lang.org/t/10259
11:31:19PMunchOh wait, that sounds much more wrong that just some pointer shenanigans..
11:36:17FromDiscord<Asbjørn> I'll try the casting that you suggest, but I'm worried that it's not the the problem.↵Even if it were overwriting the previous string, I expect that the queue should still become empty after popping the last item.
11:40:55PMunchYes it definitely should..
11:41:05PMunchHard to tell what is going on without actually seeing some code
11:42:46FromDiscord<Asbjørn> yeah I realize... the project isn't exactly secret, but it's too big to ask a kind internet stranger to read though 😅↵I'm trying to reproduce in a minimal example now, that's actually worthwhile sharing
11:43:55PMunchWriting minimal reproductions can be useful in its own right, many times I have solved my own problem while trying to reduce something :)
11:44:21FromDiscord<Asbjørn> for sure
11:45:02FromDiscord<Asbjørn> annoyingly, so far it's just working fine in my tiny example 😅
11:46:06PMunchThat's good though, means that it's probably just some silly mistake somewhere
12:05:49FromDiscord<Asbjørn> but I hate silly mistakes! \:]
12:07:02PMunchI'd rather have a silly mistake than a serious mistake though
12:07:41FromDiscord<Asbjørn> but when I find the root cause of a silly mistake, I just feel dumb
12:08:09FromDiscord<Asbjørn> at least with serious mistakes, I can feel smart after debugging something complicated \:3
12:10:19FromDiscord<that_dude> Tbh I think I'd still call that a silly mistake. I'd say that a systematic issue that requires a redesign a serious mistake
12:10:54FromDiscord<Asbjørn> ah yes, the worst kind of mistake\: silly and complicated
12:13:08*raynei joined #nim
12:16:48FromDiscord<npapior/zerothi> sent a code paste, see https://play.nim-lang.org/#ix=4xKK
12:17:11FromDiscord<npapior/zerothi> (edit) "https://play.nim-lang.org/#ix=4xKK" => "https://play.nim-lang.org/#ix=4xKL"
12:18:59PMunchThat looks pretty smart to me
12:24:16FromDiscord<npapior/zerothi> Ok, thanks! 🙂
12:38:06FromDiscord<wikimedia foundation> Does anybody know how to contact Jibal? <https://github.com/jibal>
12:39:12PMunchSay their name three times fast in the mirror
12:40:16FromDiscord<exxjob> hold on let me laugh
12:40:43PMunchIf you have a commit of theirs you can look at the commit message to see if you can find an e-mail perhaps
12:40:51FromDiscord<exxjob> i dont
12:41:40*lucasta joined #nim
12:41:49PMunchDepends on the reason why you need to get in touch with them
12:42:04PMunchIf it's very serious I guess maybe GitHub can intervene
12:42:19PMunchBut if you just want to ask them something I guess you're out of luck
12:42:35FromDiscord<exxjob> solitude follows him
12:42:59PMunchSo do you..
12:43:07PMunchWho is he?
12:43:24PMunchI guess maybe try to reverse image search his profile picture?
12:47:02*redj quit (Ping timeout: 250 seconds)
12:48:09PMunchZoom, did you find anything about the article itself you didn't like?
12:50:18PMunchOooh, now I see what you mean about the .letter thing
12:50:52PMunchYeah that's done on purpose. If it had proper kerning it would show parts of the title when the sidebar is collapsed
12:51:13PMunchI guess I could solve that with a CSS animation to fade out the rest of the title though..
13:07:41*void09 quit ()
13:07:55FromDiscord<Zoom> BTWm anyone knows [Alkamist](https://github.com/Alkamist)? They are pretty reserved with their online presence.
13:08:19*void09 joined #nim
13:12:47*redj joined #nim
13:17:20*redj quit (Ping timeout: 248 seconds)
13:18:37*redj joined #nim
13:35:55*junaid_ quit (Remote host closed the connection)
13:50:45FromDiscord<voidwalker> Anyone use allographer ? Having trouble figuring out how to select row where a column is not "true" (1). I tried `.whereNotIn("deleted", @[1])` and it gives me only those rows with deleted == 1
13:52:07*redj quit (Remote host closed the connection)
13:53:31*redj joined #nim
13:54:25*rockcavera joined #nim
13:56:26FromDiscord<Chronos [She/Her]> In reply to @PMunch "That's good though, means": Not when working with very finicky code and environments aha
13:56:37*krux02_ joined #nim
13:57:04FromDiscord<Chronos [She/Her]> It's why I abandoned the shared library plugin system myself, was horribly broken and didn't really work
13:57:27FromDiscord<Chronos [She/Her]> Sometimes it'd be fine, sometimes you'd get segfaults, and a single change could do either
13:58:06*redj quit (Ping timeout: 250 seconds)
13:59:20*redj joined #nim
13:59:43*junaid_ joined #nim
14:17:31*oldpcuser quit (Ping timeout: 240 seconds)
14:21:35*PMunch quit (Quit: Leaving)
14:27:01*junaid_ quit (Remote host closed the connection)
14:32:29*raynei quit (Remote host closed the connection)
14:54:26NimEventerNew Nimble package! delaunator - Fast 2D Delaunay triangulation. A Nim port of Mapbox/Delaunator., see https://github.com/patternspandemic/delaunator-nim
15:17:17*om3ga quit (Ping timeout: 246 seconds)
15:21:09*om3ga joined #nim
15:38:43*redj quit (Ping timeout: 268 seconds)
15:49:55*redj joined #nim
15:54:08*redj quit (Ping timeout: 240 seconds)
15:55:10*redj joined #nim
15:58:48*redj quit (Client Quit)
16:00:02*ntat quit (Quit: Leaving)
16:07:51*oldpcuser joined #nim
16:11:34*redj joined #nim
16:28:44FromDiscord<Prestige> wtf I was just working on a nim port of that lmao
16:28:53FromDiscord<Prestige> like literally right now
16:29:50Amun-Rathe more the merrier
16:30:18FromDiscord<Prestige> Well if this port is finished and works I'll just use it haha. But what a weird timing coincidence
16:32:49FromDiscord<voidwalker> so many things left to port though : P
16:32:52*ntat joined #nim
16:33:16FromDiscord<voidwalker> maybe there should be a tracker for unfinished projects, where people can check if others are doing the same thing
16:33:39FromDiscord<Prestige> I just started mine like a day or two ago
16:33:43FromDiscord<voidwalker> we are missing so many things, and so few hands to spare
16:34:05FromDiscord<voidwalker> I was thinking of starting a wiki, or is there already one somewhere ?
16:34:13FromDiscord<voidwalker> nim. wiki is taken unfortunately :\
16:34:30FromDiscord<Prestige> wiki.nim-lang.org would be nice...
16:35:02FromDiscord<voidwalker> where you can have goal specific tutorials, like how to write a RAT, or parse html
16:36:39FromDiscord<voidwalker> indeed, like https://wiki.freepascal.org/
16:41:58FromDiscord<Prestige> Anyone know who `patternspandemic` is on github? I want to talk about this port with him
16:50:47FromDiscord<filipemtx> Is it possible to make a 3x3 supercube with a 5x5? I imagined you had to swap the centers trough the edges like this
16:51:53FromDiscord<filipemtx> https://media.discordapp.net/attachments/371759389889003532/1116409273279320157/Screenshot_2023-06-08-13-51-27-850_com.google.android.googlequicksearchbox.jpg
16:52:24FromDiscord<filipemtx> If you swap the edge-like centers you make this pattern
16:52:36FromDiscord<filipemtx> Then you just scramble like 3x3 and you have a 3x3 super cube
16:52:42FromDiscord<filipemtx> But how to make the pattern?
16:52:51FromDiscord<odexine> ? Wrong server?
16:53:27FromDiscord<filipemtx> Lol sorry
16:53:34FromDiscord<odexine> I was so confused
16:53:50FromDiscord<filipemtx> Lol my bad
16:54:17FromDiscord<odexine> GL with the question lol I don’t know what you were talking about but yeah
16:54:34FromDiscord<filipemtx> Haha thx
16:54:55FromDiscord<filipemtx> I didn't see i selected the wrong server on the menu
16:54:58FromDiscord<filipemtx> XD
17:00:31FromDiscord<filipemtx> https://media.discordapp.net/attachments/371759389889003532/1116411446838960218/Screenshot_2023-06-08-13-58-20-179_com.whatsapp.jpg
17:00:43*jmd_ joined #nim
17:00:44FromDiscord<filipemtx> I wanted to make this lol but posted on the wrong server
17:12:08*lucasta quit (Quit: Leaving)
17:18:46FromDiscord<pmunch> Closest we have to a Wiki is probably this\: https://github.com/nim-lang/Nim/wiki
17:21:04FromDiscord<pmunch> @Prestige, porting so fast he's porting from the future\: https://github.com/patternspandemic/delaunator-nim/blob/main/src/delaunator.nim#L3
17:22:37FromDiscord<pmunch> And you could always try to email them
17:25:50FromDiscord<jmgomez> In reply to @pmunch "Closest we have to": it would be great if it gets into the nim-lang page though, so it's easer for people to reach. Does GH have a way to embed them?
17:32:45FromDiscord<jmgomez> If not that one, a redefined version
17:36:22*ntat quit (Quit: Leaving)
17:36:33FromDiscord<voidwalker> yeah wiki's should be hosted on the main page. and no, you don't have to rewrite the wiki in nim to do that
17:36:40FromDiscord<voidwalker> (edit) "page." => "domain."
17:38:10FromDiscord<voidwalker> contributing centralized, structured knowledge to the language should be easy. you cannot really fiddle with the html documentation as that requires pull requests on github
17:38:22FromDiscord<voidwalker> and that is very limited in scope anyway
17:50:02NimEventerNew post on r/nim by PMunch: Setting up a Nim server for dummies, see https://reddit.com/r/nim/comments/144fyun/setting_up_a_nim_server_for_dummies/
17:50:51NimEventerNew thread by PMunch: Setting up a Nim server for dummies, see https://forum.nim-lang.org/t/10260
17:52:25FromDiscord<pmunch> Shh NimEventer, don't snitch on my shameless cross-posting \:P
17:56:56*oldpcuser quit (Remote host closed the connection)
18:32:01FromDiscord<sigmasd> where is the bot source code ?
18:35:16*oldpcuser joined #nim
18:53:15FromDiscord<pmunch> Which bot?
18:53:15FromDiscord<pmunch> NimEventer?
18:53:17FromDiscord<pmunch> https://github.com/Yardanico/nimeventer
19:04:26FromDiscord<Nerve> Can statements be aplit across lines?
19:04:31FromDiscord<Nerve> (edit) "aplit" => "split"
19:05:47FromDiscord<pmunch> Yes
19:05:52FromDiscord<Nerve> sent a code paste, see https://play.nim-lang.org/#ix=4xM9
19:06:11FromDiscord<pmunch> If you had the `or` on the first line it would work IIRC
19:07:46FromDiscord<Nerve> Okay that worked
19:07:50FromDiscord<Nerve> Thanks
19:08:19FromDiscord<Nerve> I think I like the readability of what I posted more though
19:14:38FromDiscord<sigmasd> but I don't see the matrix part
19:14:49FromDiscord<sigmasd> the code seems only for discord stackoverflow
19:17:48FromDiscord<Elegantbeef> Matrix bot is done using t2bot's matrix bridge
19:21:22FromDiscord<sigmasd> cool
19:21:50FromDiscord<sigmasd> !matrix help
19:22:11FromDiscord<sigmasd> image.png https://media.discordapp.net/attachments/371759389889003532/1116447099068883005/image.png
19:23:55FromDiscord<!&luke> What does -d:danger do in building
19:32:46FromDiscord<Boston> Is there an easy way to flip the endianess of copyMem
19:33:30systemdsucks-d:danger strips the binary dangerously
19:36:42FromDiscord<!&luke> Oh
19:38:27FromDiscord<Graveflo> In reply to @Boston "Is there an easy": You could just use unchecked array I guess. I don't see an options fo rit
19:40:47FromDiscord<Boston> sent a code paste, see https://play.nim-lang.org/#ix=4xMm
19:41:40FromDiscord<Boston> So if I just copyMem from bits to BufferSend I send "4.60008832e-41"
19:43:23FromDiscord<Elegantbeef> std/endians
19:44:19FromDiscord<Elegantbeef> Or https://github.com/auxym/bight/blob/main/bight.nim
19:49:07FromDiscord<Boston> Thank you, swapEndian32 is clean enough
19:52:13*jmd_ quit (Ping timeout: 256 seconds)
19:55:52FromDiscord<arnetheduck> In reply to @Boston "Thank you, swapEndian32 is": what we use for byteswapping: https://github.com/status-im/nim-stew/blob/6c97f11c7cb59eadf91b124b92d2ec035f7251fa/stew/endians2.nim#LL79C3-L79C
20:07:59FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4xMs
20:08:34FromDiscord<sOkam!> I was thinking of using a `seq[Type]`, but im getting parse errors because it wants `[]` instead of `{}` at top level
20:11:19*def- quit (Quit: -)
20:11:55FromDiscord<!&luke> What's the best way to deal with graphql in nim
20:12:00*def- joined #nim
20:12:09FromDiscord<!&luke> I'm trying to use a graphql api not create one
20:16:57FromDiscord<Nerve> In reply to @sOkam! "I was thinking of": Iterate over the keys and prase their child objects, then add them to the seq, you could do this in a `collect`
20:17:05FromDiscord<Nerve> (edit) "prase" => "parse"
20:17:52FromDiscord<sOkam!> In reply to @Nerve "Iterate over the keys": iterate over which keys?
20:18:16FromDiscord<sOkam!> i cannot get the thing to parse, so I have no data to iterate afaik
20:18:33FromDiscord<sOkam!> if you mean iterating over the JsonNode, then I don't know how to do so
20:19:16FromDiscord<Nerve> sent a code paste, see https://play.nim-lang.org/#ix=4xMv
20:19:48FromDiscord<sOkam!> what type is json_obj, and how do you get it?
20:20:03FromDiscord<Nerve> Take the JSON string you posted and use `parse_json`
20:20:15FromDiscord<Nerve> or `parseJson` if we're being pedantic
20:21:05FromDiscord<Nerve> And it's a `JsonNode`
20:21:46FromDiscord<Nerve> In addition all those sub-objects would be as well. `JsonNode` is a object variant and so whether it's an object, array, or primitive type is contained inside it
20:21:53FromDiscord<System64 ~ Flandre Scarlet> Is it possible to make a script that installs dependencies automatically?
20:21:53FromDiscord<Nerve> (edit) "a" => "an"
20:22:11FromDiscord<Nerve> In reply to @System64 "Is it possible to": make?
20:22:31FromDiscord<sOkam!> In reply to @System64 "Is it possible to": which dependencies exactly?
20:22:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @sOkam! "which dependencies exactly?": NimGL, NimGL's ImGUI, Tinydialogs
20:23:10FromDiscord<Elegantbeef> Make a nimble fiile
20:23:13FromDiscord<sOkam!> In reply to @System64 "NimGL, NimGL's ImGUI, Tinydialogs": `requires "nimgl"` in the nimble file?
20:23:22FromDiscord<sOkam!> or are you purposedly avoiding nimble
20:23:27FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4xMw
20:23:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @sOkam! "or are you purposedly": Nimble is fine
20:23:52FromDiscord<sOkam!> then just use nimble and make a build task
20:23:53FromDiscord<Elegantbeef> Why the hell are you making a batch script to compile
20:23:59FromDiscord<Elegantbeef> Make a config.nims and call it a day
20:24:02FromDiscord<System64 ~ Flandre Scarlet> However, I use Nim 2.0
20:24:04FromDiscord<sOkam!> probably because he/she doesn't know
20:24:22FromDiscord<Nerve> I use make whenever I can, only use nimble for `install`
20:24:31FromDiscord<Nerve> (edit) "make" => "`make`"
20:24:34FromDiscord<sOkam!> nimble is great
20:24:36FromDiscord<Nerve> But I'm crotchety
20:24:44FromDiscord<sOkam!> make is nightmare fuel on decently sized projects
20:24:54FromDiscord<sOkam!> specially for package management
20:25:11FromDiscord<sOkam!> (compared to nimble i mean)
20:25:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Make a config.nims and": It will detect it automatically? Also for Nimble build?
20:26:02FromDiscord<Elegantbeef> Yes
20:26:18FromDiscord<czgchsz> I've not seen projects using autotools for dependency management, thank god. Only for checking their existence (pkg-config counts too)
20:26:56FromDiscord<System64 ~ Flandre Scarlet> Oh alright↵And Nimble installs them if not installed?
20:27:08FromDiscord<Elegantbeef> That's what a dependency is
20:27:09FromDiscord<sOkam!> In reply to @System64 "Oh alright And Nimble": yep, exactly
20:27:16FromDiscord<System64 ~ Flandre Scarlet> Oh alright!
20:27:17FromDiscord<Elegantbeef> I honestly like pkg-config
20:27:36FromDiscord<czgchsz> Me too!
20:27:58FromDiscord<Elegantbeef> Oh you said it like you didnt like it
20:28:38FromDiscord<czgchsz> Oh nahh, I mean that I havent seen people trying to use makefiles for fetching and installing dependencies
20:29:54FromDiscord<czgchsz> I do use pkg-config in my makefiles etc
20:29:58FromDiscord<czgchsz> It'd be a nightmare \:p in this case nimble should be used
20:32:57FromDiscord<Nerve> That's probably where I'm different, I'm statically compiling with musl-libc. I compile my dependencies manually (documented of course) and drop the .a files in my project for linking.
20:33:02FromDiscord<Elegantbeef> Yea the dev of owlkettle uses pkg-config as intended 😄
20:33:25FromDiscord<Nerve> So make is fine since I only have to `nimble install` a few things when I pull my project to another computer
20:33:36FromDiscord<Nerve> And it's just in a single make command
20:34:04FromDiscord<czgchsz> I'm personally fine with that too, and do that as well in some cases↵(@Nerve)
20:38:14FromDiscord<czgchsz> Sometimes I just write down the dependencies required in the README and let users handle it themselves (typically by using their OS' package manager)
20:51:53FromDiscord<System64 ~ Flandre Scarlet> Well, okay?... https://media.discordapp.net/attachments/371759389889003532/1116469669356900574/image.png
21:09:58NimEventerNew Nimble package! pixienator - Helpers for visualizing delaunator with pixie., see https://github.com/patternspandemic/pixienator
21:10:28FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4xMA
21:13:17FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4xMD
21:13:21FromDiscord<ieltan> Oops
21:13:21FromDiscord<ieltan> sent a code paste, see https://paste.rs/ao3js
21:13:29FromDiscord<ieltan> Lol
21:13:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xME
21:14:02FromDiscord<ieltan> (edit) "https://play.nim-lang.org/#ix=4xMH" => "https://play.nim-lang.org/#ix=4xMG"
21:14:28FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=4xMD" => "https://play.nim-lang.org/#ix=4xMI"
21:14:34FromDiscord<System64 ~ Flandre Scarlet> Thanks!
21:25:18*cedb quit (Ping timeout: 250 seconds)
21:29:17FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#ix=4xMM
21:30:05FromDiscord<Elegantbeef> Rewrite `==` to do what you want
21:30:27FromDiscord<Elegantbeef> Also probably should implement your own hash aswell that mimics `==`
21:31:17FromDiscord<luteva> In reply to @Elegantbeef "Also probably should implement": do you have any example for that?
21:31:38FromDiscord<Elegantbeef> std/hashes
21:32:23*cedb joined #nim
21:34:10FromDiscord<!&luke> What's the difference between Object and ref object
21:34:39FromDiscord<Elegantbeef> read the manual/tutorial on `ref`
21:35:30FromDiscord<luteva> In reply to @ripluke "What's the difference between": object is stack allocated, ref object is heap allocated.
21:35:49FromDiscord<luteva> (edit) "In reply to @ripluke "What's the difference between": ... object" added "afaik:"
21:37:48FromDiscord<Elegantbeef> That is what `ref` means yes
21:37:56FromDiscord<Elegantbeef> One is a value type the other is a reference type
21:39:18FromDiscord<ieltan> use ref when you want to mutate an object and reflect that change to every "instance" that reference it
21:47:13FromDiscord<Andreas> In reply to @luteva "afaik: object is stack": and a `ref` is managed -> allocation/dealloc is taken care of by ARC/ORC opposite to a (unmanaged)-`ptr`.
21:48:56FromDiscord<luteva> In reply to @Andreas "and a `ref` is": yes (of course). heap allocated memory is garbage collected, stack allocated mem is not.
21:49:17FromDiscord<luteva> (edit) "In reply to @Andreas "and a `ref` is": yes (of course). heap allocated memory is garbage collected, stack allocated mem is not. ... " added "It's managed by the stack 🙂"
21:49:55FromDiscord<luteva> (edit) "It's" => "It is"
21:51:57FromDiscord<Andreas> In reply to @luteva "yes (of course). heap": well, i just mentioned, cos it took a bit for me 🙂
21:53:07*advesperacit quit ()
21:53:23FromDiscord<Elegantbeef> Not all heap allocated memory is garbage collected
21:53:26FromDiscord<Elegantbeef> Only `ref`
21:54:27NimEventerNew question by IvanS: How to write/read binary data (in type) in Nim?, see https://stackoverflow.com/questions/76435931/how-to-write-read-binary-data-in-type-in-nim
22:07:33FromDiscord<luteva> In reply to @ripluke "What's the difference between": btw.: this is one of the great things in nim. you have the choice what to use, switch the keyword and you have "the same thing" but technically two different implementations. Be explicit when choosing what you want to use! memory allocation is just one example. It's the same for static/dynamic dispatch (using proc/method), using if/when (for runtime/static switches) etc.
22:09:12FromDiscord<luteva> (edit) "nim." => "nim!"
22:29:51FromDiscord<Graveflo> Is there a way I can count how many times a generic gets instantiated during compilation?
22:56:37*redj quit (Ping timeout: 240 seconds)
22:57:30*redj joined #nim
23:03:47FromDiscord<sOkam!> Is there any existing way to extract `.tar.xz` files from nim?↵`treeform/zippy`and `nim-lang/zip` only have support for gz, tar and zip 😔↵Do you know of any way to unzip them? 🤔
23:10:32*jmd_ joined #nim
23:18:47FromDiscord<graveflo> if you don't find anything else: https://github.com/dom96/untar/blob/master/src/untar.nim
23:35:17*krux02_ quit (Remote host closed the connection)
23:36:40*oldpcuser quit (Quit: Ping timeout: 665 seconds)