<< 12-10-2022 >>

00:18:22*derpydoo joined #nim
01:15:18*dtomato0 joined #nim
01:15:25*dtomato quit (Ping timeout: 252 seconds)
01:15:25*dtomato0 is now known as dtomato
01:16:18*arkurious quit (*.net *.split)
01:16:18*estiquelapice quit (*.net *.split)
01:16:18*Onionhammer quit (*.net *.split)
01:16:18*mal`` quit (*.net *.split)
01:16:18*koltrast quit (*.net *.split)
01:16:19*deadmarshal quit (*.net *.split)
01:17:05*estiquelapice joined #nim
01:17:06*Onionhammer joined #nim
01:17:39*mal`` joined #nim
01:17:54*arkurious joined #nim
01:18:40*derpydoo quit (Ping timeout: 246 seconds)
01:19:06*koltrast joined #nim
01:22:23*deadmarshal joined #nim
01:36:43FromDiscord<Bung> https://github.com/nim-lang/Nim/issues/20152 is this true ?
01:36:56FromDiscord<Bung> useIter is inner proc
01:49:23*arkurious quit (Quit: Leaving)
03:44:57NimEventerNew thread by elcritch: Odd error in ARC when running in Windows, see https://forum.nim-lang.org/t/9524
05:38:49FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/shaders.nim#L131-L161↵I thought it would be simple to change the shader part of my framework to be type agnostic, oh how i was wrong
05:49:26FromDiscord<Stuffe> I am running into a strange quantum bug in nim, I wonder if someone here has any idea what is going on
05:49:43FromDiscord<Stuffe> So basically my program hangs when I run it, like if it was an infinite loop↵However, when I insert a debugecho to try and figure out what is going on, it doesn't hang anymore↵Even if I just debugecho "hello"
05:50:45FromDiscord<Stuffe> and every time I CTRL+c to stop execution, it shows that execution was at a particular spot in the standard lib sequtils.nim
05:51:15FromDiscord<Stuffe> (its ant the insert function)
05:51:41FromDiscord<Stuffe> if I try to debugecho anything in there it also doesn't hang anymore
05:52:07FromDiscord<Stuffe> I tried to produce a minimum POC, but changing any random thing seems to fix it
06:01:46FromDiscord<huantian> I have no solution but I would like to say that that's weird
06:03:33FromDiscord<Stuffe> yeah
06:11:18NimEventerNew thread by halloleo: Ways to tweak the output of the JavaScript backend, see https://forum.nim-lang.org/t/9525
06:15:03FromDiscord<untoreh> `FutureVar` can't be awaited? how do you use it?
06:16:09*kenran joined #nim
06:42:44*Onionhammer quit (*.net *.split)
06:42:44*genpaku quit (*.net *.split)
06:42:44*rez quit (*.net *.split)
06:42:44*jmd_ quit (*.net *.split)
06:42:45*adium quit (*.net *.split)
06:42:45*jkl quit (*.net *.split)
06:42:45*Jjp137 quit (*.net *.split)
06:42:45*m5zs7k quit (*.net *.split)
06:42:45*droidrage quit (*.net *.split)
06:42:45*ehmry quit (*.net *.split)
06:42:45*tanami quit (*.net *.split)
06:42:45*mahlon quit (*.net *.split)
06:42:45*nyeaa4 quit (*.net *.split)
06:42:55*tanami joined #nim
06:43:00*Onionhammer joined #nim
06:43:02*nyeaa4 joined #nim
06:43:03*Jjp137 joined #nim
06:43:22*mahlon joined #nim
06:45:17*jmdaemon joined #nim
06:45:32*m5zs7k joined #nim
06:45:49*jkl joined #nim
06:45:56*adium joined #nim
06:47:10*ehmry joined #nim
06:48:25*genpaku joined #nim
07:07:11*Jjp137 quit (Ping timeout: 250 seconds)
07:07:30*Jjp137 joined #nim
07:17:12*PMunch joined #nim
07:51:46*tiorock joined #nim
07:51:46*tiorock quit (Changing host)
07:51:46*tiorock joined #nim
07:51:46*rockcavera is now known as Guest4857
07:51:46*tiorock is now known as rockcavera
07:54:31*Guest4857 quit (Ping timeout: 246 seconds)
08:30:09*PMunch quit (Quit: Leaving)
08:36:14FromDiscord<FireLite> sent a code paste, see https://play.nim-lang.org/#ix=4cUD
08:43:55FromDiscord<qb> second argument for `createHook` takes a pointer so you could try `cast[pointer](cast[ByteAddress](keymapDetour))`
08:44:14FromDiscord<qb> Not sure if casting to a byteaddress is necessary
08:44:45FromDiscord<FireLite> In reply to @qb "second argument for `createHook`": My question was about third argument, how do I implement it?
08:44:58FromDiscord<FireLite> First and second works perfectly fine
08:45:35FromDiscord<FireLite> But I need to get the original keymap func to not cancel the keyboard input entirely.
08:47:54FromDiscord<Elegantbeef> Is that what you want?
08:47:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4cUF
08:49:55*xet7 joined #nim
08:50:27FromDiscord<FireLite> Probably, I will test if this works
08:52:47FromDiscord<qb> sent a code paste, see https://play.nim-lang.org/#ix=4cUH
08:52:59FromDiscord<qb> https://github.com/qb-0/Cube-2-Sauerbraten-Internal-Hack/blob/main/src/main.nim#L70
09:03:57FromDiscord<FireLite> Ok, thanks, it works. Now the question is how to I call this original function from hook to unlock the keyboard?
09:04:30FromDiscord<FireLite> Something like `oKeymap(key, held)` throws an error.
09:10:41FromDiscord<Clonkk> PR are welcome if you wish to add them. Otherwise, you can open an issue saying which module of the stdlib you'd like wrapped and I'll see what I can do↵(@demotomohiro)
09:12:49FromDiscord<Clonkk> Don't be intimated to contribute. Even small contribution are welcome; and if you open a PR, I'll review your code
09:15:20FromDiscord<4zv4l> why isn't it valid ?
09:15:22FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4cUJ
09:15:35FromDiscord<4zv4l> `diff_array.nim(1, 56) Error: cannot evaluate at compile time: arr1`
09:16:43FromDiscord<4zv4l> arr1 is a compile time constant so why not ?
09:24:55*PMunch joined #nim
09:35:20FromDiscord<hotdog> In reply to @Bung "I use a lot": That search says "We couldn’t find any code matching 'user:bung87 npeg'". Maybe they are private repositories?
09:37:00FromDiscord<Bung> In reply to @hotdog "That search says "We": src/scorper/http/acceptparser.nim src/crown_ui/datetime_utils.nim src/scorper/http/rangeparser.nim these are open sourced
09:37:15FromDiscord<hotdog> In reply to @Bung "src/scorper/http/acceptparser.nim src/crown_ui/dat": Cheers I'll take a look
09:46:10*rockcavera quit (Remote host closed the connection)
09:53:29FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4cUS
09:53:36FromDiscord<4zv4l> arr 1 and arr2 are compile time constant so what's the problem ?
09:54:46FromDiscord<Bung> never seen such a const expr inside generic
09:55:38FromDiscord<4zv4l> there is no generic there
09:55:41FromDiscord<4zv4l> only `int`
09:56:06FromDiscord<Bung> array[N,T]
09:56:29FromDiscord<4zv4l> I don't get what you mean
09:57:37FromDiscord<Bung> the simplest case array[3,int] , what you have is array[max(a.len,b.len), int]
09:57:57FromDiscord<4zv4l> yes
09:58:05FromDiscord<4zv4l> and since `a` and `b` are constants
09:58:11FromDiscord<4zv4l> it can check the length at compile time
09:59:59FromDiscord<Bung> I think there are two point , one: does that const expr really supported in generic, two: if it supported in generic parma, does it also work well with proc result ?
10:00:16FromDiscord<Bung> (edit) "parma," => "param,"
10:01:46FromDiscord<Bung> https://github.com/nim-lang/Nim/issues?q=is%3Aopen+is%3Aissue+label%3AGenerics you see there are 133 opened issues labeled as generics
10:06:26FromDiscord<4zv4l> alright, I'll try another way then
10:07:13FromDiscord<4zv4l> what's the equivalent of `usize` in nim ?
10:16:25FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4cUW
10:18:04FromDiscord<Bung> why `array[int, int]` ?
10:19:26FromDiscord<Bung> oh you can try `array_diff[N: static int]`
10:19:38FromDiscord<4zv4l> In reply to @Bung "why `array[int, int]` ?": where ?
10:19:52FromDiscord<Bung> proc def
10:20:21FromDiscord<4zv4l> I don't see see `array[int, int]`
10:20:30FromDiscord<4zv4l> its `array[N, int]`
10:20:50FromDiscord<4zv4l> N is the size not the type
10:20:54FromDiscord<Bung> the message report inffered type
10:21:08FromDiscord<4zv4l> yeah I don't get it
10:21:30FromDiscord<4zv4l> it doesn't translate my array in openArray either
10:21:58FromDiscord<4zv4l> are openArray constant or we can write to them ?
10:22:49FromDiscord<4zv4l> ok I made it works
10:22:50FromDiscord<4zv4l> finally
10:22:50FromDiscord<4zv4l> xD
10:23:35FromDiscord<Bung> yeah, I just tried static int works
10:23:51FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4cUZ
10:24:01FromDiscord<4zv4l> this works
10:24:05FromDiscord<Bung> https://play.nim-lang.org/#ix=4cUY
10:26:16FromDiscord<4zv4l> In reply to @Bung "https://play.nim-lang.org/#ix=4cUY": yeah that works too !
10:31:43*jmdaemon quit (Ping timeout: 268 seconds)
11:47:16*arkurious joined #nim
12:09:58*kenran quit (Remote host closed the connection)
12:16:49NimEventerNew Nimble package! wcwidth - Implementation of wcwidth with Nim., see https://github.com/shoyu777/wcwidth-nim
12:23:48*derpydoo joined #nim
12:27:40FromDiscord<Rika> cool
13:08:06*pro joined #nim
13:16:35*kenran joined #nim
13:21:05*piertoni joined #nim
13:24:45piertoniHI guys! Could someone help me with this dynamic library loading? I cannot understand why is not working...
13:24:45piertonihttps://play.nim-lang.org/#ix=4cVD
13:52:47FromDiscord<demotomohiro> Is it fail to load dll? Or it load dll but fail to find the function from that dll?
13:59:26*hochata joined #nim
14:00:52FromDiscord<Bung> In reply to @piertoni "HI guys! Could someone": one is load from relative path, one is load by searching system library path
14:03:31*PMunch quit (Quit: Leaving)
14:05:54*piertoni quit (Ping timeout: 244 seconds)
15:01:46FromDiscord<Goel> sent a code paste, see https://paste.rs/8Pp
15:07:06FromDiscord<demotomohiro> @Goel https://nim-lang.org/docs/manual_experimental.html#view-types
15:08:29*hochata quit (Ping timeout: 268 seconds)
15:10:38*kenran quit (Remote host closed the connection)
15:33:51*pro quit (Remote host closed the connection)
15:35:41FromDiscord<ezquerra> I got a super basic question: I am converting some Python code which uses a list of objects. In Python when you add an object to a list you are storing a reference to the object while in nim adding to a sequence makes a copy. What is the right way to store a sequence of references to objects? Also, will nim avoid recovering the object memory when the objects go out of scope as long as the sequence of references is still in scope (or vice
15:40:43FromDiscord<Rika> make your objects `ref object`
15:40:45FromDiscord<Rika> yes
15:40:49FromDiscord<Rika> (edit)
15:42:24FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cWy
15:46:23FromDiscord<demotomohiro> You can avoid copy by using ref object, but accessing seq of ref objects can be slower than seq of objects because seq of objects put data contiguously on memory but seq of ref object doesn't.
15:47:19FromDiscord<Rika> less of a "can be" more of a "usually is", dont worry too much about it until you're seeing its effects thoughj
15:49:04FromDiscord<bariali07> How can the Tower of Hanoi game be programmed using tables in C language using recursive?
16:07:04*derpydoo quit (Quit: derpydoo)
16:22:06*piertoni joined #nim
16:22:48*piertoni quit (Client Quit)
16:43:30FromDiscord<hector> Lol go do your homework
16:57:38FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4cWT
16:58:51FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cWU
16:59:06FromDiscord<AmjadHD> sent a code paste, see https://paste.rs/YSw
16:59:13FromDiscord<Patitotective> https://nim-lang.org/docs/manual.html#generics-mixin-statement
16:59:52*derpydoo joined #nim
17:14:43*derpydoo quit (Quit: derpydoo)
17:16:14*hochata joined #nim
17:20:30*derpydoo joined #nim
17:21:04FromDiscord<ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=4cX2
17:22:24FromDiscord<Patitotective> In reply to @ezquerra "Thanks. What if the": you can a ref object out of any object `MyRefObj = ref MyObj`
17:22:57FromDiscord<Patitotective> (edit) "In reply to @ezquerra "Thanks. What if the": you can ... a" added "make"
17:26:58FromDiscord<ezquerra> In reply to @Patitotective "you can make a": Umm. OK, I thought I had tried that but I probably made a mistake. I’ll give it another try. Thanks!↵I had been converting this Python code in a very “direct way” without paying too much attention and I was getting issues with objects in a sequence “not updating” because they were copies instead of references to the original objects 🤦🏻‍♂️😅
17:30:01FromDiscord<Patitotective> In reply to @ezquerra "Umm. OK, I thought": if you publish your code im sure we could help you more
17:36:09FromDiscord<Patitotective> this might be helpful for you @ezquerra https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
18:05:58FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4cXc
18:07:34FromDiscord<Patitotective> In reply to @AmjadHD "That works, but not": you don't need mixin there
18:07:38FromDiscord<Patitotective> just remove it
18:10:11FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4cXe
18:10:23*pro joined #nim
18:10:27FromDiscord<AmjadHD> Error: type mismatch: got <, int literal(1)>
18:10:35FromDiscord<qb> Could it be that the choosenim nim installation does not support to compile x86 binaries? I get a bunch of errors if I try to compile with `--cpu:i386`
18:10:41FromDiscord<qb> linux btw
18:11:37FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cXf
18:13:58FromDiscord<qb> In reply to @qb "Could it be that": Solved. I was missing `gcc-multilib`
18:15:46FromDiscord<AmjadHD> In reply to @Patitotective "what are you trying": https://github.com/nim-lang/Nim/blob/fa60378a7f992235efd766d656556a3e1e337008/lib/pure/base64.nim#L179↵I'm trying to change the signature of `encodeMime` to support an `openArray[T]`, but it's complaining about `Error: undeclared identifier: 'b'`.
18:19:02*pro quit (Ping timeout: 268 seconds)
18:20:35FromDiscord<ezquerra> sent a code paste, see https://play.nim-lang.org/#ix=4cXj
18:21:37FromDiscord<Patitotective> In reply to @ezquerra "I just tried it": I don't think you can, you could use pointers (`myObject.addr`), but they're unsafe↵could you share some code?
18:22:13FromDiscord<Patitotective> In reply to @AmjadHD "https://github.com/nim-lang/Nim/blob/fa60378a7f9922": why `T` and not `char`?
18:22:41FromDiscord<AmjadHD> `T: char or byte`
18:24:58FromDiscord<Patitotective> just use `openArray[char]`↵since `byte.high == char.high.byte`
18:27:54FromDiscord<AmjadHD> sent a code paste, see https://play.nim-lang.org/#ix=4cXl
18:37:14*hochata quit (Read error: Connection reset by peer)
18:43:22FromDiscord<ezquerra> In reply to @Patitotective "I don't think you": I’m basically trying to create objects that hold references to other objects.↵I’ll need to find a place to share and a small snippet that makes sense.↵I guess it makes sense that if non ref objects are stored in the stack you would not be able to just get a safe reference to them. I think I need to start thinking more like in C or C++ and less like in Python
18:48:21FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4cXx
18:50:10FromDiscord<Patitotective> In reply to @ezquerra "I’m basically trying to": sure https://zevv.nl/nim-memory
18:55:09*rockcavera joined #nim
18:55:09*rockcavera quit (Changing host)
18:55:09*rockcavera joined #nim
19:19:30FromDiscord<Patitotective> why does std/xmlparser fails to parse processing instructions? (`<?xml version="1.0"?>`)↵https://play.nim-lang.org/#ix=4cXJ
19:30:26Amun-Radoes xml require at least one element?
19:30:46Amun-RaparseXml does
19:31:05Amun-Rahttps://play.nim-lang.org/#ix=4cXR
19:31:42FromDiscord<Patitotective> oh, thank you :]
19:38:04FromDiscord<untoreh> why do all the free/max/occupied mem functions return 0 on my machine..
19:45:25FromDiscord<ezquerra> In reply to @Patitotective "sure https://zevv.nl/nim-memory": Thanks!
20:00:20FromDiscord<ezquerra> Is there any limitation to using a HashSet with a ref object?
20:23:34FromDiscord<ezquerra> Umm, I just found about -d:nimPreviewHashRef
20:23:45FromDiscord<ezquerra> Is this something that will still be there in nim 2.0?
20:31:10FromDiscord<Horizon [She/Her]> What does `..<` do?
20:32:12*derpydoo quit (Ping timeout: 264 seconds)
20:32:53FromDiscord<Patitotective> In reply to @Event Horizon "What does `..<` do?": exclusive slicing↵`0..1 == [0, 1]`↵`0..<1 == [0]`
20:33:08FromDiscord<Patitotective> In reply to @ezquerra "Is this something that": you might want to ask that in the forum
20:33:53FromDiscord<Horizon [She/Her]> In reply to @Patitotective "exclusive slicing `0..1 ==": Hm alright
20:34:20FromDiscord<Horizon [She/Her]> Is doing `pos < text.len-1` good enough for a tokenizer? :P
20:34:30FromDiscord<Patitotective> do `text.high`
20:34:42FromDiscord<Horizon [She/Her]> Text.high?
20:34:44FromDiscord<huantian> no you're high
20:34:47FromDiscord<Patitotective> highest index
20:34:52FromDiscord<Patitotective> In reply to @huantian "no you're high": in deed
20:35:27FromDiscord<Horizon [She/Her]> Ah thanks!
20:35:30FromDiscord<Patitotective> also @Horizon [She/Her], i recently made a lexer if you want to take a look https://github.com/Patitotective/kdl-nim/blob/main/src/kdl/lexer.nim
20:37:00FromDiscord<Horizon [She/Her]> Yeah I've seen xD
20:37:14FromDiscord<Horizon [She/Her]> I'm just working off of the crafting interpreters guide
20:37:21FromDiscord<Horizon [She/Her]> I need to stop crying because of parsers :p
20:37:56FromDiscord<Patitotective> In reply to @Event Horizon "Yeah I've seen xD": ive probably told you about my lexer many times, i forget :p
20:38:04FromDiscord<Patitotective> In reply to @Event Horizon "I need to stop": i still do
20:39:43FromDiscord<Horizon [She/Her]> In reply to @Patitotective "ive probably told you": Yeah you have xD
20:40:17FromDiscord<Horizon [She/Her]> In reply to @Patitotective "i still do": I need to be able to use a less painful language on the JVM so I've decided to make my own, until i finally get the energy to make Nim compile to the JVM
20:40:17qwrsearch for pratt parsing and stop crying (this is parsing technique that gives pretty easy parsing without using any generators) ;)
20:40:50FromDiscord<Horizon [She/Her]> Pratt parsing?
20:41:44qwrbasically extended/generalized precedence climbing algorithm
20:41:56FromDiscord<Horizon [She/Her]> Oh neat
21:01:47*pech quit (Remote host closed the connection)
21:39:14*jmdaemon joined #nim
21:52:36*xet7 quit (Ping timeout: 264 seconds)
22:05:27*xet7 joined #nim
22:19:33FromDiscord<auxym> @Horizon [She/Her] Pratt parsing is covered in part 2 of crafting interpreters, highly recommend the book. https://craftinginterpreters.com/contents.html
22:19:53FromDiscord<auxym> (edit) "2" => "3"