<< 09-05-2026 >>

00:04:29*redj joined #nim
00:05:14*shanoaice quit (Quit: The Lounge - https://thelounge.chat)
00:05:27*shanoaice joined #nim
00:19:14*tanami quit (Ping timeout: 256 seconds)
01:15:17*tanami joined #nim
01:17:02*ftajhii quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
01:24:09*ftajhii joined #nim
03:30:13*mal`` quit (Ping timeout: 256 seconds)
03:31:30*rockcavera joined #nim
03:39:09*mal`` joined #nim
07:01:19*tiorock joined #nim
07:01:19*tiorock quit (Changing host)
07:01:19*tiorock joined #nim
07:01:19*rockcavera quit (Killed (uranium.libera.chat (Nickname regained by services)))
07:01:19*tiorock is now known as rockcavera
07:04:39FromDiscord<mratsim> In reply to @nervecenter "Wasn't there a standard": import ansi_c something
07:05:35FromDiscord<mratsim> import system/ansi_c
07:06:15FromDiscord<mratsim> it doesn't work at compile-time though.↵↵Timothee cour had a ffi stuff that worked at compile time
09:21:42FromDiscord<crochubourbier> is there a type that we can use inside a macro or template instead of typed / untyped to represent any callable object and any proc with any call convention ?
09:23:17FromDiscord<crochubourbier> (edit) "is there a type that we can use inside a macro or template instead of typed / untyped to represent any callable object and any proc with any call convention ? ... " added "in the same way as we have iterable[T] for any iterator ?"
09:23:27FromDiscord<crochubourbier> (edit) "convention ?" => "convention,"
09:23:34FromDiscord<crochubourbier> (edit) removed "as"
09:55:24FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=QmaXkzbV
09:57:38FromDiscord<crochubourbier> sent a long message, see https://pasty.ee/KJeoJdhW
09:57:58FromDiscord<crochubourbier> (edit) "https://pasty.ee/DLNTweNw" => "https://pasty.ee/ODGwiAJG"
09:58:56FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=ccXNPhwG
10:00:07FromDiscord<crochubourbier> sent a code paste, see https://play.nim-lang.org/#pasty=zUsLhhFE
10:02:24FromDiscord<crochubourbier> it doesnt seem possible without macro magic then
10:06:05FromDiscord<crochubourbier> wouldn't the ability to check ast nodes inside a concept type like we can do in macros be sick ? Id love a feature like that
10:28:05*xet7 quit (Remote host closed the connection)
10:47:47FromDiscord<mratsim> In reply to @crochubourbier "is there a type": what do you want to do?
10:49:19FromDiscord<mratsim> In reply to @crochubourbier "is there a type": if you want to apply a template or a macro to a function call, it's easy with nnkCall, like this: https://github.com/mratsim/weave-io/blob/master/weave_io/parallel_offloading.nim#L244-L245
10:49:45FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#pasty=vosvjekj
10:50:23FromDiscord<mratsim> actually I can probably use `funcCall: NimNode{nkCall}`
11:35:16FromDiscord<crochubourbier> In reply to @mratsim "actually I can probably": What ?? Ive never seen this syntax, you can restrict a variant object to one of its variant like this ?
11:36:09FromDiscord<crochubourbier> (edit) "In reply to @mratsim "actually I can probably": What ?? Ive never seen this syntax, you can restrict a variant object to one of its variant like this ? ... " added "Do you have any documentation for this syntax or is it a custom "{}" operator ?"
11:38:58FromDiscord<crochubourbier> it must be a custom {} operator because I just tested and it doesnt work
12:29:51FromDiscord<demotomohiro> In reply to @crochubourbier "What ?? Ive never": https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros-parameter-constraints
12:30:49FromDiscord<crochubourbier> thank you
12:32:31FromDiscord<crochubourbier> holy fuck it's a game changer, how did I miss that ?
12:34:10FromDiscord<crochubourbier> I could have written my macros much more cleanly
12:34:13FromDiscord<mratsim> In reply to @crochubourbier "holy fuck it's a": You merely adopted macros, I was born in them, molded by them
12:37:08FromDiscord<mratsim> In reply to @crochubourbier "holy fuck it's a": It might be placebo though, it's been a while sine I looked into this
12:37:16FromDiscord<mratsim> (edit) "sine" => "since"
12:37:41FromDiscord<mratsim> but at the very least it's good documentation
12:38:09FromDiscord<crochubourbier> I mean it reduces verbosity by removing some manual checking, so still good to take
12:38:36FromDiscord<mratsim> In reply to @crochubourbier "I mean it reduces": the fact that I use expectKind makes me think it wasn't checking enough ,)
12:39:22FromDiscord<crochubourbier> why would you need expectKind if your parameter is already restrained to {nk...} ?
12:39:42FromDiscord<crochubourbier> apart for child branches
12:39:54FromDiscord<crochubourbier> (edit) "for" => "from"
12:40:29FromDiscord<crochubourbier> And some constraints are useful, for example `lvalue` is cool because it's hard to check by hand if a symbol is a lvalue
12:40:39FromDiscord<mratsim> In reply to @crochubourbier "why would you need": that's what I'm saying, in my code I use `NimNode{nkSym}` and `expectKind(nnkCall)`
12:40:48FromDiscord<mratsim> so make sure to test to confirm it works
12:41:21FromDiscord<crochubourbier> Yeah sure
12:43:33FromDiscord<crochubourbier> the fact that you can do template foo{customPattern} is cool too
12:43:43FromDiscord<crochubourbier> (edit) "foo{customPattern}" => "foo{customPattern}()"
12:43:53FromDiscord<crochubourbier> (edit) "too" => "too, I didnt know that"
12:44:06FromDiscord<mratsim> In reply to @crochubourbier "the fact that you": ah yes, I used to do this for optimization
12:44:27FromDiscord<mratsim> it's a bit of a mess on compile-time though because the compiler tries to match all the way down the call stack
12:45:19FromDiscord<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/math_ops_fusion/math_ops_fusion.nim#L30-L42
12:46:19FromDiscord<crochubourbier> sent a code paste, see https://play.nim-lang.org/#pasty=phFMaHUA
12:47:12FromDiscord<crochubourbier> hiding this template in a library would be evil
14:02:18*amadaluzia quit (Read error: Connection reset by peer)
14:03:09*amadaluzia joined #nim
15:32:43*xet7 joined #nim
16:19:16*oculux joined #nim
16:21:50*kick455 quit (Ping timeout: 245 seconds)
16:25:09*amadaluzia quit (Read error: Connection reset by peer)
16:26:57FromDiscord<the.heathen.wildcat> Is there a function to trim spaces from the beginning and end of a string?
16:29:08FromDiscord<spotlightkid> https://nim-lang.org/docs/strutils.html#strip%2Cstring%2Cset%5Bchar%5D
16:29:51FromDiscord<the.heathen.wildcat> In reply to @spotlightkid "https://nim-lang.org/docs/strutils.html#strip%2Cstr": Ah, strip! I was searching everywhere for "trim".↵↵Thank you so much!
16:30:27FromDiscord<spotlightkid> Yeah, some languages call it trim (JS, I believe), some strip (e.g. Python).
16:31:42*amadaluzia joined #nim
16:49:32FromDiscord<crochubourbier> sent a code paste, see https://play.nim-lang.org/#pasty=JNCtbvXz
16:50:20FromDiscord<crochubourbier> (edit) "https://play.nim-lang.org/#pasty=EiMuUNqF" => "https://play.nim-lang.org/#pasty=pssPbTgE"
17:00:31FromDiscord<nnsee> In reply to @crochubourbier "Is it me or": https://play.nim-lang.org/#pasty=NMEgzcEU
17:11:19FromDiscord<crochubourbier> In reply to @nnsee "https://play.nim-lang.org/#pasty=NMEgzcEU": Ok, this makes sense as procs can be recursive
17:39:15FromDiscord<graphiq> why is this detected as malware by malwarebytes ? https://media.discordapp.net/attachments/371759389889003532/1502726654487826534/image.png?ex=6a00c2c1&is=69ff7141&hm=77558583d5a11320b4d7d97921e9a73505ee494f5b17ca95c4164bfb61674049&
17:39:20FromDiscord<graphiq> is this a false positive
17:40:10FromDiscord<graphiq> 🧐
17:44:46*beholders_eye joined #nim
18:27:22*beholders_eye quit (Ping timeout: 265 seconds)
19:16:55*jj_ quit (Ping timeout: 244 seconds)
19:18:35*jj_ joined #nim