<< 23-11-2024 >>

00:14:02FromDiscord<nervecenter> In reply to @axlefublr "huh! that's a very": Well to clarify, I'm compiling that module as its own entire executable, the `whenIsMainModule` trick just determines at compile time which module is main, and anything in that block is compiled into the final binary. So I can compile isolated test suites essentially.
00:14:10FromDiscord<nervecenter> (edit) "`whenIsMainModule`" => "`when isMainModule`"
00:14:46FromDiscord<axlefublr> In reply to @nervecenter "Well to clarify, I'm": yep, got that! thanks for clarifying :>
00:14:52FromDiscord<nervecenter> (edit) "In reply to @axlefublr "huh! that's a very": Well to clarify, I'm compiling that module as its own entire executable, the `when isMainModule` trick just determines at compile time which module is main, and anything in that block is compiled into the final binary. So I can compile isolated test suites essentially. ... " added "Without needing to compile the entire project, just what I need to run the tests."
01:01:38*alexdaguy quit (Quit: w)
01:14:21FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=fPhYctKz
01:15:04FromDiscord<aintea> I'm making something that heavily relies on tables and nested tables, and having `result["this"]["this2"]["another_one"]["and_another_one"]` is not the prettiest to be honest
01:15:10FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#special-operators
01:15:17FromDiscord<aintea> that was fast
01:15:21FromDiscord<Elegantbeef> You can implement a `[]` that takes multiple arguments
01:15:39FromDiscord<Elegantbeef> So then it's just `result["this", "this2", "another_one", "and_another_one"]`
01:16:00FromDiscord<aintea> I specifically want it to become `result.this.this2.another_one.and_another_one`
01:16:28FromDiscord<Elegantbeef> Read the link
01:16:33FromDiscord<aintea> I'm doing so
01:19:35FromDiscord<aintea> I find it so interesting nim has a lot to offer but finding what I want is hard
01:19:43FromDiscord<aintea> Thanks for the help
01:46:48FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=Ftftntbm
01:47:31FromDiscord<Robyn [She/Her]> oh it can't be a proc, damn
02:04:53FromDiscord<demotomohiro> This works:
02:04:59FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=tRYYWyBV
02:15:53FromDiscord<odexine> You can have a dot operator macro
02:16:10FromDiscord<odexine> Though they’re still experimental
03:22:55*SchweinDeBurg joined #nim
03:30:17*zgasma quit (Quit: Lost terminal)
03:41:40FromDiscord<maxtachine> sent a code paste, see https://play.nim-lang.org/#pasty=pOyNjwAb
03:42:04FromDiscord<maxtachine> even when I remove the ptr in the cast and the dereference operator
03:42:11FromDiscord<maxtachine> (edit) "even when I remove the ptr in the cast and the dereference operator ... " added "I get the error"
03:42:27FromDiscord<maxtachine> (what im trying to do is something called manual mapping)
03:49:40FromDiscord<odexine> `hDll: ptr` isnt concrete, if youre looking for a void pointer use `hDll: pointer`
03:49:43FromDiscord<odexine> same with the other one
03:51:44FromDiscord<maxtachine> oh thanks it fixed it
06:14:32*greaser|q quit (Remote host closed the connection)
06:14:55*greaser|q joined #nim
07:51:54Amun-Raor 'ptr object'
07:56:01*ntat joined #nim
08:35:27*greaser|q quit (Changing host)
08:35:27*greaser|q joined #nim
08:35:29*greaser|q is now known as GreaseMonkey
09:00:56*alexdaguy joined #nim
09:09:06*tdc joined #nim
10:34:43FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=vJjsiPBx
11:00:45*alexdaguy quit (Quit: restarting computah)
11:04:10FromDiscord<k0ts> You could even say it was quite an Elegant way
11:17:59*alexdaguy joined #nim
11:51:43FromDiscord<aintea> And that wouldn't start any Beef within my team of devs because of the readability
12:00:46*perr_ is now known as perro
12:52:33*tokyovigilante quit (Ping timeout: 248 seconds)
12:53:04*tokyovigilante joined #nim
12:58:03*alexdaguy quit (Ping timeout: 276 seconds)
13:03:22*alexdaguy joined #nim
13:07:19*alexdaguy quit (Client Quit)
14:59:36*coldfeet joined #nim
15:30:29*tdc quit (Ping timeout: 248 seconds)
16:49:33*deeo9 quit (Quit: The Lounge - https://thelounge.chat)
17:46:43*GnuYawk quit (Quit: The Lounge - https://thelounge.chat)
17:47:02*GnuYawk joined #nim
18:06:44FromDiscord<dawidek.2137> how to define an extern proc on C backend? the extern pragma seems to be for something else
18:07:26FromDiscord<dawidek.2137> at least I dont understand why it needs a string argument (unlike exportc etc)
18:16:29FromDiscord<dawidek.2137> can I generate a c++ extern struct with it's method signatures without emitting code myself?
18:43:56*Guest96 joined #nim
18:45:49*Guest96 quit (Client Quit)
18:46:30*Guest96 joined #nim
18:47:38*tdc joined #nim
18:47:47*Guest96 quit (Client Quit)
20:19:53FromDiscord<maxtachine> sent a code paste, see https://play.nim-lang.org/#pasty=thwjigVd
20:21:41FromDiscord<thearthurm> Is there a way to do an assignment in an expression, like the := in python?
20:22:08FromDiscord<maxtachine> i thought := was a golang operator
20:22:16*coldfeet quit (Remote host closed the connection)
20:22:46FromDiscord<thearthurm> In reply to @maxtachine "i thought := was": It is, but it's also a way to assign variables in an expression in python
20:22:52FromDiscord<thearthurm> It's called the walrus operator
20:23:00FromDiscord<maxtachine> i see https://stackoverflow.com/questions/26000198/what-does-colon-equal-in-python-mean
20:23:17FromDiscord<thearthurm> `if (x := function()): ...`
20:23:54FromDiscord<thearthurm> In reply to @maxtachine "i see https://stackoverflow.com/questions/26000198/": I'm going to write my programming language in nim and I'm trying to port over my cli lib
20:24:23FromDiscord<maxtachine> there doesnt seem to have one in nim
20:24:38FromDiscord<thearthurm> In reply to @maxtachine "there doesnt seem to": That's fine, we do it the manual way hehehehehe
20:24:58FromDiscord<thearthurm> Wait, can you unpack a dictionary as keyword arguments?
20:25:11FromDiscord<maxtachine> dunno
20:25:14FromDiscord<thearthurm> If not, then I won't even need it
20:25:44FromDiscord<thearthurm> In reply to @maxtachine "dunno": `func(dictionary)`
20:26:02FromDiscord<suvan0522> which version of nim do you ppl prefer to use?
20:26:39FromDiscord<thearthurm> In reply to @suvan0522 "which version of nim": Whichever one I have installed, I'm not sure
20:26:47FromDiscord<thearthurm> I think it's the latest
20:26:55FromDiscord<suvan0522> 2.2.0?
20:28:28FromDiscord<thearthurm> In reply to @suvan0522 "2.2.0?": 2.0.8 apparently
20:29:08FromDiscord<suvan0522> oh okay
20:40:24FromDiscord<bostonboston> In reply to @maxtachine "im trying to compile": When I need to do this I install a 32bit version of gcc and in my nim.cfg add a @if that changes gcc.path to the 32bit bin
20:40:42FromDiscord<bostonboston> `@if i386` that is
20:47:57FromDiscord<thearthurm> Do we have var args in nim or do I have to pass in a sequence
20:50:03FromDiscord<maxtachine> In reply to @bostonboston "When I need to": yeah i got it to work
20:50:17FromDiscord<maxtachine> now i just need to figure out why its doing segfault
21:00:25FromDiscord<solitudesf> In reply to @thearthurm "Do we have var": i wish there was some place where you could look up this information
21:00:30FromDiscord<solitudesf> https://nim-lang.org/docs/manual.html#types-varargs
21:00:55FromDiscord<Elegantbeef> I keep asking the LLMs about Nim and they just talk about matchsticks
21:05:30FromDiscord<diogenesoftoronto> In reply to @Elegantbeef "I keep asking the": What are your Prompts lol
21:08:39FromDiscord<Elegantbeef> sent a long message, see https://pasty.ee/QfOOkfDR
21:14:42*ftajhii quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:23:21*ftajhii joined #nim
21:36:48FromDiscord<thearthurm> In reply to @solitudesf "i wish there was": My phone is really slow because I don't have good Internet, people respond much faster and I can ask a follow up question instead of waiting another 2 minutes for each search, and then another 2 minutes for each link to load
21:37:07FromDiscord<thearthurm> Discord works just fine, but my browser is super sluggish
21:55:17*ntat quit (Quit: Leaving)
22:04:44FromDiscord<maxtachine> In reply to @Elegantbeef "I keep asking the": Lmfao
22:19:07*krux02 joined #nim
22:36:55*tdc quit (Ping timeout: 260 seconds)
22:40:30FromDiscord<axlefublr> In reply to @Elegantbeef "I keep asking the": lmaoooo
22:53:52FromDiscord<aintea> In reply to @thearthurm "`if (x := function()):": `if (let x = func(); x) == y:`
22:54:15FromDiscord<thearthurm> In reply to @aintea "`if (let x =": Oh sweet :0
22:55:03FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=kDzMKrUv
22:56:48FromDiscord<aintea> Everything is possible with Nim
22:57:07FromDiscord<aintea> Except having fun debugging your macros
22:57:21FromDiscord<fabric.input_output> print debugging always works
22:57:37FromDiscord<aintea> Yeah but wondering why it expands in the wrong way is a nightmare
22:57:56FromDiscord<fabric.input_output> print the prior steps
23:39:13*Jjp137 quit (Ping timeout: 252 seconds)
23:47:01*Jjp137 joined #nim