<< 19-07-2022 >>

00:00:04*cyraxjoe quit (*.net *.split)
00:00:05*rwb quit (*.net *.split)
00:00:05*Goodbye_Vincent quit (*.net *.split)
00:00:05*tanami quit (*.net *.split)
00:00:05*djanatyn1 quit (*.net *.split)
00:00:05*termer quit (*.net *.split)
00:00:05*joast quit (*.net *.split)
00:00:05*mal`` quit (*.net *.split)
00:00:17*tanami joined #nim
00:00:28*djanatyn1 joined #nim
00:00:32*Goodbye_Vincent joined #nim
00:01:50*rwb joined #nim
00:01:50*rockcavera joined #nim
00:02:07*rockcavera quit (Changing host)
00:02:07*rockcavera joined #nim
00:02:38*termer joined #nim
00:03:22*cyraxjoe joined #nim
00:07:20*mal`` joined #nim
00:14:20FromDiscord<Elegantbeef> No
00:19:02*joast joined #nim
00:19:15FromDiscord<Prestige> Well, dang
00:19:56FromDiscord<frobnicate> In reply to @Avahe "I.. don't think I": Sorry I meant inject not emit
00:19:57FromDiscord<Elegantbeef> And it's just a tedious thing to debug dude to the 1.4.x to 1.6.x transition
00:20:19FromDiscord<Elegantbeef> Nim templates are hygenic so you need to use `inject` to emit identifiers that are accessible outside the template
00:20:37FromDiscord<frobnicate> Oh I see
00:47:11FromDiscord<Tibix> sent a code paste, see https://play.nim-lang.org/#ix=44Ly
00:47:14FromDiscord<Tibix> Any tips would be much appreciated.
00:47:32FromDiscord<Elegantbeef> you need to give it a type
00:47:53FromDiscord<Elegantbeef> So it should be `kvPair[int]` or something similar
00:47:57FromDiscord<Elegantbeef> `T` doesnt exist in this context
00:48:02FromDiscord<Tibix> But I can't, `kvPair` stands for key-value pair. I can't know beforehand what type it will be.
00:48:19FromDiscord<Tibix> (edit) "it" => "the value"
00:48:23FromDiscord<Elegantbeef> How do you think the Nim table implementation works?
00:48:42FromDiscord<Elegantbeef> You do `var a = initTable[string, int]()` and get a `string` -\> `int` table
00:49:12FromDiscord<Tibix> In reply to @Elegantbeef "How do you think": I do not know anything about the language other than the small examples I've read in Learn Nim by Example.
00:49:28FromDiscord<Tibix> So what you're telling me that declaring an array with generic key-value pairs is impossible?
00:49:37FromDiscord<Elegantbeef> Well yes nim is not dynamically typed
00:49:59FromDiscord<Elegantbeef> Generally speaking in Nim you have a heterogeneous collection
00:50:37FromDiscord<Elegantbeef> So this means you do something like `proc initTable[T](): array[1024, kvPair[T]] = default result`
00:50:46FromDiscord<Elegantbeef> then you can do `var map = initTable[int]()`
00:51:20FromDiscord<Elegantbeef> The point of generics is they give flexibility without repetition
00:51:43FromDiscord<Tibix> oh, I understand
00:51:58FromDiscord<Tibix> in this case is there a different kind of project I can make that's useful for learning?
00:52:16FromDiscord<Elegantbeef> In general or generics?
00:52:21FromDiscord<Tibix> In general
00:52:37FromDiscord<Elegantbeef> command line interface programs are pretty great to get the basics
00:53:39FromDiscord<Tibix> I've done quite a few those back in the days where I was first learning programming, but maybe something more exact?
00:53:57FromDiscord<Tibix> In webdev for example a todo list is pretty much the hello world for JavaScript, maybe something similar exists here
00:54:10FromDiscord<Tibix> maybe I'll make a cli todo list lmao
00:54:14FromDiscord<Elegantbeef> Hard to say i'm mostly a gamedev so my suggestion is always "make arcade games"
00:54:40FromDiscord<Tibix> that's an interesting suggestion, however I'd need some knowledge of graphics libraries and ECS for that right?
00:54:53FromDiscord<Elegantbeef> Nico exists
00:54:58FromDiscord<Elegantbeef> So you can do it relatively high level
00:55:29FromDiscord<Tibix> oh this is really interesting, thanks
00:57:43FromDiscord<Elegantbeef> The nice thing is you can do pong/snake in like 100 lines 😄
01:03:43FromDiscord<Tibix> I will try
01:04:07*jmdaemon joined #nim
01:07:28*wallabra joined #nim
01:09:07FromDiscord<# Luke> Anyone got a good dithering tutorial
01:18:13FromDiscord<# Luke> Also how can I handle text input with nimja
01:27:23FromDiscord<Tibix> sent a code paste, see https://play.nim-lang.org/#ix=44LN
01:27:26FromDiscord<Tibix> https://media.discordapp.net/attachments/371759389889003532/998762959318831115/unknown.png
01:27:53FromDiscord<Tibix> (if I don't want a sequence)
01:28:17FromDiscord<Elegantbeef> `len: static int`
01:28:26FromDiscord<Elegantbeef> also `array(len, kvPair` is invalid\`
01:28:45FromDiscord<Tibix> why so?
01:29:01FromDiscord<Elegantbeef> to which?
01:29:10FromDiscord<Tibix> ??
01:29:10FromDiscord<Elegantbeef> The `static int` is required cause you need to give it a length at compile time
01:29:15FromDiscord<Elegantbeef> and `static` is a compile time constant
01:29:30FromDiscord<Tibix> hmm, but what if the user needs to enter the length in cli?
01:29:58FromDiscord<Elegantbeef> You use `seq`
01:30:27FromDiscord<Tibix> nim works very very differently to what I'm used 😅
01:30:47FromDiscord<Elegantbeef> It's a statically typed language so yes 😛
01:31:18FromDiscord<Elegantbeef> Types have to be resolved at compile time dynamism is to be avoided as much as possible
01:31:19FromDiscord<# Luke> It's like python + ruby + elixir + c
01:31:30FromDiscord<Tibix> can I make a fixed length seq?
01:31:38FromDiscord<# Luke> In reply to @Tibix "can I make a": Yea
01:31:43FromDiscord<Tibix> awesome
01:31:44FromDiscord<Elegantbeef> Just dont use add 😄
01:31:51FromDiscord<Tibix> 🤔
01:31:58FromDiscord<Tibix> that's kinda exactly what I wanted to use though
01:32:10FromDiscord<# Luke> In reply to @Tibix "can I make a": seq[type](len)
01:32:18FromDiscord<Elegantbeef> If you want a fixed length you dont want to use add
01:32:23FromDiscord<Elegantbeef> You want to do `newSeq[type](len)` and never call `add`
01:32:23FromDiscord<# Luke> In reply to @Tibix "that's kinda exactly what": On a fixed Len seq?
01:32:37FromDiscord<# Luke> In reply to @Elegantbeef "If you want a": Yea
01:33:01FromDiscord<# Luke> In reply to @Elegantbeef "You want to do": Oh yeah make a new seq
01:33:20FromDiscord<Tibix> well then I will get rid of length then I guess
01:34:21FromDiscord<Tibix> can I initially return an empty sequence somehow?
01:34:28FromDiscord<Elegantbeef> `@[]`
01:34:47FromDiscord<Elegantbeef> Or just `discard`
01:34:53FromDiscord<Elegantbeef> the default value of a sequence is empty
01:35:30FromDiscord<Tibix> https://media.discordapp.net/attachments/371759389889003532/998764988397264936/unknown.png
01:35:31FromDiscord<Tibix> jeez
01:35:56FromDiscord<# Luke> In reply to @Elegantbeef "`@[]`": Yea
01:36:17FromDiscord<# Luke> In reply to @Tibix "": What are you trying to do?
01:36:21FromDiscord<Tibix> so like this? this will be the correct type when returned? https://media.discordapp.net/attachments/371759389889003532/998765204001280060/unknown.png
01:36:57FromDiscord<# Luke> In reply to @Tibix "so like this? this": It'll be an empty sequence
01:37:04FromDiscord<Tibix> In reply to @ripluke "What are you trying": I see
01:37:12FromDiscord<# Luke> Huh?
01:37:17FromDiscord<Prestige> I like your color scheme
01:37:21FromDiscord<Tibix> In reply to @ripluke "It'll be an empty": I see
01:37:30FromDiscord<Tibix> In reply to @ripluke "Huh?": Wrong reply to the wrong message 😄
01:37:36FromDiscord<# Luke> Lol
01:37:48FromDiscord<# Luke> In reply to @Avahe "I like your color": Lol same
01:37:48FromDiscord<Tibix> In reply to @Avahe "I like your color": Thanks, it's called Ayu Mirage
01:38:01FromDiscord<Prestige> Thanks I'mma look it up
01:38:14FromDiscord<Tibix> Np
01:38:38FromDiscord<Tibix> is there a combination of return types in nim?
01:38:39FromDiscord<Tibix> like
01:38:59FromDiscord<Tibix> for ts for example there is `string | null`
01:39:13FromDiscord<huantian> if you want `string | null` you want `Option[string]` in nim
01:39:16FromDiscord<huantian> from std/options
01:39:47FromDiscord<# Luke> What if you want like a string or a sequence of strings?
01:39:59FromDiscord<# Luke> Rn I just put that single trying in a sequence
01:40:00FromDiscord<Elegantbeef> You use an object variant
01:40:09FromDiscord<huantian> or you just return a sequence with a single string in it
01:40:27FromDiscord<# Luke> In reply to @Elegantbeef "You use an object": Is it the create your own type thingy
01:40:36FromDiscord<# Luke> In reply to @huantian "or you just return": Yea that's what I'm doing rn
01:40:40FromDiscord<Elegantbeef> Or leorize's union
01:40:47FromDiscord<Elegantbeef> But yes you'd create an object variant
01:41:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44LR
01:42:02FromDiscord<Prestige> Being able to return more than 1 type is a mistake imo
01:42:08FromDiscord<# Luke> Hmm does nimble have something like nodemon
01:42:12FromDiscord<Prestige> Makes code harder to work with
01:42:20FromDiscord<huantian> you shouldn't use it lightly
01:42:24FromDiscord<Prestige> nodemon being hot code reloading?
01:42:33FromDiscord<# Luke> In reply to @Avahe "Makes code harder to": That's why I haven't really used it
01:42:49FromDiscord<huantian> anonymous unions should only be used when they have to and they're the most elegant way to do it
01:43:05FromDiscord<Prestige> This looks neat ty for color scheme https://media.discordapp.net/attachments/371759389889003532/998766897254383706/unknown.png
01:43:08FromDiscord<# Luke> In reply to @Avahe "nodemon being hot code": Well by hot reloading if you mean that every time a file with a .js extension changes then it reruns the provided command
01:43:18FromDiscord<# Luke> (edit) ".js" => ".js/ts"
01:43:19FromDiscord<Elegantbeef> Could've asked me forever ago↵(@Prestige)
01:43:34FromDiscord<Prestige> You use the same? I don't think I've seen you code
01:43:49FromDiscord<# Luke> In reply to @Avahe "This looks neat ty": Nimdow? Lol I recognize that border color
01:43:58FromDiscord<Elegantbeef> He's the author of nimdow
01:44:01FromDiscord<Prestige> ^ yep haha
01:44:05FromDiscord<# Luke> In reply to @Elegantbeef "He's the author of": I do know that
01:44:07FromDiscord<# Luke> Lop
01:44:10FromDiscord<# Luke> (edit) "Lop" => "Lol"
01:44:24FromDiscord<Elegantbeef> Unlike me prestige actually uses what he programs
01:44:32FromDiscord<Elegantbeef> I just throw it out in the weekly garbage day
01:45:03FromDiscord<# Luke> In reply to @Elegantbeef "I just throw it": I just throw mine in a GitHub repo archive 💀
01:46:53FromDiscord<# Luke> In reply to @ripluke "Hmm does nim have": Does it lol? If not I'll make my own ig
01:47:10FromDiscord<# Luke> Webdev is hard without nodemon 💀
01:48:29FromDiscord<Tibix> https://cdn.discordapp.com/emojis/406598738925322250.webp?size=64 https://media.discordapp.net/attachments/371759389889003532/998768259480420432/unknown.png
01:48:38FromDiscord<Tibix> 🤔 https://media.discordapp.net/attachments/371759389889003532/998768298533593118/unknown.png
01:48:41FromDiscord<huantian> In reply to @ripluke "Webdev is hard without": i'd wager there's a vscode extension that does that
01:48:53FromDiscord<huantian> or is logical comparison
01:49:00FromDiscord<huantian> eg `true or false`
01:49:03FromDiscord<# Luke> In reply to @huantian "i'd wager there's a": The problem is I don't use vscode
01:49:17FromDiscord<# Luke> In reply to @Tibix "🤔": Can't use or like that
01:49:25FromDiscord<# Luke> It's more of a conditional
01:49:35FromDiscord<Tibix> In reply to @ripluke "Can't use or like": https://tenor.com/view/crying-emoji-dies-gif-21956120
01:49:38FromDiscord<Tibix> teach me how
01:49:43FromDiscord<# Luke> Like ↵if this or that
01:49:43FromDiscord<Elegantbeef> Nim isnt TS 😄
01:50:02FromDiscord<# Luke> In reply to @Tibix "https://tenor.com/view/crying-emoji-dies-gif-219561": No embed
01:50:27FromDiscord<huantian> In reply to @Tibix "🤔": what do you expect `"a string" or "another string"` to do?
01:50:35FromDiscord<Tibix> In reply to @ripluke "No embed": rip
01:50:40FromDiscord<huantian> strings can't be null in nim
01:50:47FromDiscord<Tibix> In reply to @huantian "strings can't be null": that's new
01:50:50FromDiscord<huantian> oh is it an `Option[string]`?
01:50:58FromDiscord<# Luke> If null:↵ Return ""↵Else: ↵ Return other thingy
01:51:02FromDiscord<Elegantbeef> There you go
01:51:06FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Ok7
01:51:12FromDiscord<# Luke> In reply to @ripluke "If null: ": Replace null with what can be null
01:51:22FromDiscord<Elegantbeef> remove the `)` on line 2
01:52:39FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=44LT
01:52:49FromDiscord<Tibix> sent a code paste, see https://play.nim-lang.org/#ix=44LU
01:52:51FromDiscord<Tibix> and what will this return if nothing is found?
01:53:02FromDiscord<huantian> `none()`
01:53:11FromDiscord<Tibix> and I have to check for that like
01:53:12FromDiscord<Tibix> if
01:53:17FromDiscord<Elegantbeef> I dont really like return cause if you have needed logic after you might fuck itup↵(@huantian)
01:53:29FromDiscord<huantian> mm yeah ig
01:53:30FromDiscord<Elegantbeef> It does work here
01:53:37FromDiscord<Elegantbeef> But eh just a habit i have
01:53:43FromDiscord<Tibix> `if getValue("hello") == none()`
01:53:43FromDiscord<Elegantbeef> Only return when you really need to
01:53:48FromDiscord<Tibix> In reply to @Tibix "`if getValue("hello") == none()`": I need to check it like that?
01:53:54FromDiscord<huantian> In reply to @Tibix "`if getValue("hello") == none()`": `if getValue("hello").isNone`
01:53:59FromDiscord<Tibix> ooh, thanks
01:54:04FromDiscord<Tibix> well time to sleep and continue this tomorrow
01:54:15FromDiscord<huantian> there's also `isSome` that does what you think it does
01:54:18FromDiscord<Tibix> thanks for the help guys, I would've given up without you a long time ago
01:54:32FromDiscord<Elegantbeef> Well spoonfeeding gets old quick
01:54:37FromDiscord<Elegantbeef> So.... stick with it
01:55:25FromDiscord<# Luke> i remember when i first joined the server how i thought that beef was just some very good ai chatbot 🤣
01:55:32FromDiscord<Elegantbeef> I am
01:55:44FromDiscord<Elegantbeef> Wait i'm not?!'
01:55:44FromDiscord<# Luke> oh
01:56:22FromDiscord<# Luke> pls send your source code if u are a bot :P
01:56:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44LW
01:57:23FromDiscord<# Luke> nice, i have just figured how to make ai that can beat google's
02:10:32FromDiscord<# Luke> Beef I found your code
02:10:33FromDiscord<# Luke> https://github.com/nim-lang/nimbot
02:17:15FromDiscord<carlosri> sent a long message, see http://ix.io/44M2
02:17:56FromDiscord<# Luke> In reply to @carlosri "Hi, i have a": Ok and what do u want to do with them lol
02:18:07FromDiscord<carlosri> (edit) "http://ix.io/44M2" => "https://paste.rs/qne"
02:19:05FromDiscord<huantian> all the objects with a given fuente, or fore each different fuente
02:19:28FromDiscord<sharpcdf> is it possible to call a shell command without having the output be printed?
02:19:37FromDiscord<# Luke> In reply to @sharpcdf "is it possible to": Yes
02:19:47FromDiscord<sharpcdf> how would you do it
02:20:03FromDiscord<# Luke> discard exCmdEx(your command as a string here)
02:20:17FromDiscord<# Luke> Also u have to import osproc from the Nim stdlib
02:20:42FromDiscord<sharpcdf> oh yea ive been using `execShellCmd`
02:21:04FromDiscord<# Luke> In reply to @sharpcdf "oh yea ive been": Yea that prints the output and returns the exitcode iirc
02:21:41FromDiscord<sharpcdf> yea
02:22:05FromDiscord<sharpcdf> wait do you need to explicitely use `execCmdEx` or can you use `execCmd`
02:22:12FromDiscord<carlosri> In reply to @huantian "all the objects with": all objects with the same fuente but i dont want to give the fuente it has to look for it in the sequence
02:22:59FromDiscord<# Luke> In reply to @sharpcdf "wait do you need": execCmdEx
02:23:07FromDiscord<# Luke> Because it doesn't print output
02:23:16FromDiscord<# Luke> While execCommand does
02:23:29FromDiscord<# Luke> (edit) "execCommand" => "execCmd"
02:24:11FromDiscord<sharpcdf> oh i see now
02:24:15FromDiscord<sharpcdf> it returns the output
02:24:45FromDiscord<# Luke> In reply to @sharpcdf "it returns the output": Yea, and by discarding it you get no output
02:36:56FromDiscord<Dale> Whoop, I think my threaded logger is actually finished. That was more of Nim exercise than I originally thought, but I learned a lot about templates! Thanks to Mr. Beef for helping out so much :D https://media.discordapp.net/attachments/371759389889003532/998780447528079370/unknown.png
02:38:02FromDiscord<Dale> sent a code paste, see https://play.nim-lang.org/#ix=44M9
02:38:24FromDiscord<Dale> Actually that string in `open` does nothing now, it resolves the filename automaticalluy, should get rid of that
02:38:28FromDiscord<Dale> (edit) "automaticalluy," => "automatically,"
02:42:11FromDiscord<# Luke> Is it on nimble?
02:42:52FromDiscord<Dale> The logger?
02:43:09FromDiscord<Dale> Nah, it's integrated into the engine. I could maybe split it out at some point
02:43:28FromDiscord<# Luke> In reply to @Dale "Nah, it's integrated into": That'd be cool
02:43:32FromDiscord<# Luke> In reply to @Dale "The logger?": Yes
02:43:33FromDiscord<Dale> It's a little better than the std one since it uses a lot of compile time stuff, and no `if`s
02:43:57FromDiscord<Dale> That's the main reason I didn't use the std one
02:44:37FromDiscord<# Luke> Oh
02:44:57FromDiscord<sharpcdf> how can i check if a file has an extension
02:44:59FromDiscord<Dale> There is a case block, but it's in the writer thread
02:45:09FromDiscord<Dale> There's a proc for that in `os`
02:45:23FromDiscord<sharpcdf> ah ok
02:45:42FromDiscord<# Luke> In reply to @sharpcdf "how can i check": spliteFile(name).ext
02:45:50FromDiscord<# Luke> Will return file extension
02:45:56FromDiscord<# Luke> (edit) "spliteFile(name).ext" => "splitFile(name).ext"
02:46:53FromDiscord<sharpcdf> oh yea
02:46:58FromDiscord<Dale> Yeah splitfile returns a tuple, but there's also `fineFileExt` if you don't want to waste the extra data (and have to label them as used)
02:47:09FromDiscord<sharpcdf> already used it 20 and i still dont remember it lmao
02:47:19FromDiscord<sharpcdf> (edit) "already used it 20 ... and" added "time"
02:47:22FromDiscord<sharpcdf> (edit) "time" => "times"
02:47:23FromDiscord<Dale> Ah, it's `searchExtPos`
02:48:02FromDiscord<sharpcdf> my app is short living so it shouldnt be a big deal
02:50:59FromDiscord<# Luke> Lol can someone help me in #webdev
03:16:53*noeontheend joined #nim
03:37:47FromDiscord<b1rdf00d> In reply to @carlosri "Hi, i have a": sounds like a good fit for using a dataframe - is datamancer the way to go?
04:12:41*noeontheend quit (Ping timeout: 255 seconds)
04:29:02FromDiscord<sharpcdf> whats a good way to parse command line flags
04:29:10FromDiscord<sharpcdf> like `--version` and whatnot
04:31:37FromDiscord<Prestige> https://nim-lang.org/docs/parseopt.html @sharpcdf
04:39:53*arkurious quit (Quit: Leaving)
04:41:17*duuude joined #nim
04:41:28duuudehow to parse html on nim?
04:51:10FromDiscord<sharpcdf> In reply to @Avahe "https://nim-lang.org/docs/parseopt.html <@459463405": ohhh, i didnt know this existed, thanks!
04:58:45*rockcavera quit (Remote host closed the connection)
05:05:57FromDiscord<Elegantbeef> https://nim-lang.org/docs/htmlparser.html#parseHtml%2C↵(<@709044657232936960_duuude=5b=49=52=43=5d>)
05:11:53duuudethank you Elegantbeef
05:12:46duuudebtw I wasn't pinged and when I clicked on the link the ↵ was in the link too (not sure if bridge's fault)
05:13:16FromDiscord<Rika> It’s the bridge
05:13:25FromDiscord<Rika> It goes from matrix to discord to IRC
05:17:27FromDiscord<j-james> the bridge could use some improvements
05:17:50FromDiscord<j-james> it doesn't propagate matrix ==> discord edits, and there's the username thing
05:18:08FromDiscord<j-james> also it delays and/or drops messages from matrix some times
05:18:36FromDiscord<j-james> i heard that was a performance issue with matrix's federation though
05:18:52FromDiscord<j-james> (edit) "though" => "though, not sure if that's true"
05:19:25duuudematrix to libera bridges are straightforward and supported by the matrix/libera teams themselves.
05:19:39duuudethat is the way libera makes money
05:20:08duuudematrix->IRC discord->IRC could work
05:20:08*j-james joined #nim
05:20:40FromDiscord<Rika> That loses out on the rich editing both discord and matrix share
05:20:55duuudebridges from IRC to other stuff are hard to do stuff wrong, since they are just text.
05:21:45duuudewell, one shouldn't let perfection to get in the way of good enough
05:22:01FromDiscord<j-james> that discord edit doesn't look too bad on irc
05:22:15duuudeyeah, I quite like this one
05:22:33duuudeunlike the matrix bridge edit
05:23:18FromDiscord<j-james> what about matrix edits?
05:23:18FromDiscord<Rika> Well one thing is that the matrix bridge is not by the same people as those who made the discord bridge
05:23:34FromDiscord<Rika> The discord bridge is actually by Yardanico lol
05:23:50duuudemake the discord-bridge people make matrix bridges :P
05:23:51FromDiscord<j-james> what about matrix edits?
05:24:00FromDiscord<j-james> what about matrix edits?
05:24:22j-jameslooks like matrix edits aren't going through right now? hmm
05:24:23duuudematrix edits are: *the new message content
05:24:35duuudediscord edits are nice diffs
05:24:41duuudesometimes with color even
05:25:11duuudehaha, you keep pinging yourself on irc
05:25:19FromDiscord<Rika> Instead of having a linear bridge system why don’t we just bridge everything to everything else with the bridges ignoring each other
05:25:22FromDiscord<Rika> xddd
05:25:46duuudenice idea
05:26:06duuudewhy ignore, that is rude
05:26:10duuudemake it a full loop
05:26:30FromDiscord<Rika> You want the bridge to bridge itself to itself?
05:26:46duuudeyeah
05:26:48FromDiscord<Rika> Discord -> IRC -> matrix -> discord…
05:27:09duuudewould be cool if it removes the original
05:27:18duuudeit degrades everything to the worst level
05:27:23duuudemakes it fair
05:28:48madpropsirc > disco > maytricks
05:28:56FromDiscord<Rika> You do you
05:40:48*duuude quit (Quit: Konversation terminated!)
05:41:04*duuude joined #nim
05:48:44FromDiscord<Dale> I miss IRC :(
05:49:04FromDiscord<Dale> I really dislike how discord basically killed it
05:49:17FromDiscord<Dale> IRC + mumble is where it’s at
05:50:57FromDiscord<Rika> Well discord is a “better” service in terms of ease of use
05:51:13FromDiscord<frobnicate> Doesn't really feel like it
05:51:26FromDiscord<frobnicate> I think it just had more marketing
05:51:37FromDiscord<frobnicate> It's always the marketing and the normies
05:52:39FromDiscord<Dale> The only thing I like about discord is that you can screen share easily. I prefer IRC and mumble in every other way
05:52:45FromDiscord<Rika> I mean for IRC you have to know the server then make an account for each of them and find the channel somehow and then maybe even nick serv and …
05:53:09FromDiscord<Dale> Yeah but that stuff is trivial, especially for programmers
05:53:19FromDiscord<Dale> And there are clients that handle all of that for you
05:53:19FromDiscord<Rika> Most people aren’t programmers 🙂
05:53:33FromDiscord<Rika> You overestimate what trivial for people could be
05:53:42FromDiscord<Rika> Are the clients easy to use
05:53:49FromDiscord<Dale> Well I used IRC before I could program
05:54:03FromDiscord<Rika> Wow a sample size of 1
05:54:09FromDiscord<Rika> How statistically significant
05:54:57FromDiscord<Dale> No need to be rude. I’m just saying that I like it more, and it’s not actually that complicated. People on here understand commands and stuff
05:55:36FromDiscord<Dale> It’s nice and simple, doesn’t have obnoxious marketing, and doesn’t have junk features
05:55:54FromDiscord<Dale> (Also bot electron haha)
05:55:59FromDiscord<Dale> (edit) "bot" => "not"
05:56:30FromDiscord<Rika> What I mean is that there’s a good reason discord was able to kill it
05:57:17FromDiscord<Dale> = most people don’t know how to use computers
05:57:34FromDiscord<Dale> Which is even more sad :(
05:57:42FromDiscord<Dale> But okay I guess
05:57:43duuudeElectron bad
05:58:16FromDiscord<Dale> There’s a new project called Tauru that aims to replace it, seems promising
05:58:30FromDiscord<Dale> (edit) "Tauru" => "Tauri"
05:58:45FromDiscord<Rika> In reply to @Dale "Which is even more": I can’t imagine how
06:00:26FromDiscord<Dale> Yo does Tauri have nim binds? Hmm
06:01:23duuudeweb bad
06:03:14FromDiscord<Dale> Ban network cards when
06:04:15*vicecea quit (Read error: Connection reset by peer)
06:05:10*vicecea joined #nim
06:05:16FromDiscord<ajusa> can you generate a type using templates?
06:05:22FromDiscord<ajusa> or do you have to use a macro?
06:06:25duuudenet good
06:06:26duuudeweb bad
06:06:39duuudeno web brings net good
06:08:26FromDiscord<Rika> In reply to @ajusa "can you generate a": What do you mean? Yeah? I’m not sure what you meant
06:09:36*CyberTailor joined #nim
06:11:00FromDiscord<ajusa> Like can I create a custom type based on parameters passed into a template
06:12:24FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=44ME
06:18:23FromDiscord<Rika> Should work but "typedesc type" -> "typ: typedesc" and type -> typ for the value:type part
06:36:01FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44MI
06:36:05FromDiscord<sharpcdf> please help its so ugly
06:37:12FromDiscord<Rika> Put them in procs
06:37:31FromDiscord<Rika> The ends with one in a “compatible extension” one
06:38:01FromDiscord<Rika> The contains one in an “architecture” one
06:38:12FromDiscord<Rika> The other one in an operating system one
06:38:29FromDiscord<sharpcdf> ill try it
06:38:47FromDiscord<sharpcdf> ive been up for so long i just want to go to sleep but my brain wont let me until i get this right 🥲
06:40:32FromDiscord<# Luke> In reply to @Dale "There’s a new project": Yea it's really nice
06:40:48FromDiscord<# Luke> In reply to @Dale "Yo does Tauri have": Tauri takes in js right?
06:40:57FromDiscord<# Luke> Then just compile Nim to js
06:41:16FromDiscord<# Luke> (edit) "compile Nim to" => "use nims" | "use nimsjs ... " added "backend"
06:41:19FromDiscord<amadan> Nim is on their roadmap iirc
06:41:27FromDiscord<# Luke> Oh
06:42:01FromDiscord<amadan> They just gotta do a lot of other stuff first rip https://media.discordapp.net/attachments/371759389889003532/998842130304872498/Screenshot_20220719-164135391_1.jpg
06:42:08*j-james quit (Quit: leaving)
06:42:54FromDiscord<# Luke> I don't get the point of that tho
06:43:24FromDiscord<# Luke> It's supposed to be a way to make apps with web tech
06:43:43FromDiscord<# Luke> What's the point of supporting Nim or python or cpp
06:44:22FromDiscord<# Luke> Those langs have there own app frameworks
06:44:29FromDiscord<# Luke> (edit) "What's the point of supporting Nim or python or cpp ... " added "or go"
06:44:33FromDiscord<j-james> it's supposed to be a way to make apps with web frontends
06:44:48FromDiscord<sharpcdf> oh neat i thought tauri was rust only
06:45:11FromDiscord<# Luke> In reply to @j-james "it's supposed to be": Wait so I can make 1 app that I can also use as a website
06:45:18FromDiscord<j-james> because every other gui framework sucks lmao
06:45:42FromDiscord<# Luke> In reply to @sharpcdf "oh neat i thought": No the backend is written in rust
06:45:58FromDiscord<# Luke> But it's mainly supposed to support js/html/css
06:46:08FromDiscord<# Luke> It also supports rust tho I think
06:46:22FromDiscord<j-james> yeah i think the idea is your traditional frontend/backend webapps can be ported to the desktop easily
06:46:26FromDiscord<j-james> hmm wait that might not be right
06:47:16FromDiscord<amadan> Isn't it marketed as an electron replacement?↵Rust logic, JS UI
06:47:37FromDiscord<# Luke> Wait but let's say I don't have anything, then I make an app in tauri, can I deploy that app to the web, and then also have a standalone application?
06:48:00FromDiscord<j-james> i know that cinny uses it, which is weird, because cinny is pure js
06:48:11FromDiscord<Rika> Why not that one thing I forgot the name of
06:48:39FromDiscord<# Luke> In reply to @Rika "Why not that one": Hmm if I knew it's name I'd tell you why not 😁
06:48:49FromDiscord<amadan> Neel maybe?
06:49:07FromDiscord<Rika> Sciter
06:49:59FromDiscord<amadan> Guess main difference is sciter doesn't support all CSS so you cant just chuck in a CSS library (idk I might be remembering wrong lol)
06:59:19FromDiscord<sharpcdf> In reply to @Rika "Put them in procs": i did that, and while its definitely much cleaner its still downloading a file that has darwin in teh name 😩
06:59:26FromDiscord<sharpcdf> (edit) "teh" => "the"
07:01:31FromDiscord<Elegantbeef> Tauri is a lighter runtime than electron↵(@j-james)
07:01:52FromDiscord<Rika> In reply to @sharpcdf "i did that, and": That’s a logic issue now
07:02:20FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44MN
07:02:23*duuude quit (Ping timeout: 272 seconds)
07:02:53FromDiscord<j-james> it seems they plan to make mobile apps using tauri too
07:02:55FromDiscord<j-james> which is interesting
07:04:38FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=44MQ
07:05:01FromDiscord<Rika> not (x or y or a) != not x or not y or not z
07:05:07FromDiscord<Rika> (edit) "a)" => "z)"
07:05:48FromDiscord<Elegantbeef> It's a big old sign you're doing it wrong 😄
07:07:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44MR
07:07:21FromDiscord<sharpcdf> In reply to @Rika "This says that if": yea but how is it reading like `and` when im using `or`? i thought it would be that if the file doesnt contain darwin or etc. then return true
07:07:31FromDiscord<Rika> In reply to @Rika "not (x or y": Read this
07:07:43FromDiscord<sharpcdf> whats the difference
07:07:46FromDiscord<Rika> not a or not b == not (a and b)
07:07:52FromDiscord<Rika> De Morgan’s law
07:08:57FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=44MS
07:09:06FromDiscord<Rika> What are you checking anyway
07:09:10FromDiscord<Rika> In plain English
07:09:16FromDiscord<Rika> Just to make sure we’re getting it right
07:10:08FromDiscord<sharpcdf> > The negation of a disjunction is the conjunction of the negations↵> The negation of a conjunction is the disjunction of the negations↵i get it now
07:10:18FromDiscord<sharpcdf> In reply to @Rika "What are you checking": im checking the name of github release files
07:10:23FromDiscord<Rika> “not (A or B) = (not A) and (not B)↵not (A and B) = (not A) or (not B),”
07:10:29FromDiscord<sharpcdf> yea lmao
07:10:38FromDiscord<sharpcdf> kinda confusing but oh well
07:10:48FromDiscord<Rika> Yeah you have to be careful with this
07:10:52FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44MT
07:11:09FromDiscord<Rika> In reply to @sharpcdf "ok so i have": You can do the same for loop trick with the other ones
07:11:16FromDiscord<sharpcdf> yea
07:11:19*toluene quit (Quit: Ping timeout (120 seconds))
07:11:22FromDiscord<Rika> “Trick”
07:11:36FromDiscord<Rika> Not really a trick if it’s the point of a for loop haha
07:11:44FromDiscord<sharpcdf> i was kind of avoiding using `for` loops because i feel like they have worse performance than if statements which makes no sense and is bullshit
07:11:57FromDiscord<sharpcdf> well thanks anyways lol
07:11:57FromDiscord<sharpcdf> o7
07:14:49*toluene joined #nim
07:16:25*duuude joined #nim
07:21:03FromDiscord<sOkam!> In reply to @sharpcdf "> The negation of": 😵‍💫
07:21:43FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44MV
07:22:10FromDiscord<sOkam!> I think those sentences left me more confounded than when I started reading them↵Sry, i meant contjucted,.... or confused... i don't remember anymore
07:22:10FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44MW
07:22:40FromDiscord<Rika> In reply to @sOkam! "I think those sentences": Negated
07:22:51FromDiscord<sOkam!> Accurate
07:22:55FromDiscord<sharpcdf> dijunctitored
07:23:18FromDiscord<sharpcdf> In reply to @sharpcdf "still doesnt work <:nimRawr:712689930668867633>": damn it i just forgot to put the `not` back in
07:23:56FromDiscord<sOkam!> you forgot to negate it, so nothing not not works
07:24:10FromDiscord<sharpcdf> correct
07:25:44FromDiscord<sharpcdf> In reply to @sharpcdf "damn it i just": NOW ITS ALSO SHOWING DARWIN ARM
07:25:50FromDiscord<sharpcdf> WHICH ISNT SUPPOSED TO HAPPEN
07:25:52FromDiscord<sharpcdf> AAAAAAAAAAAAAAAAA
07:26:20FromDiscord<Elegantbeef> you need to return false in that case otherwise return true
07:26:24FromDiscord<sOkam!> sent a code paste, see https://paste.rs/t28
07:27:36FromDiscord<sharpcdf> YES!!!!!!!!!!
07:27:59FromDiscord<sharpcdf> I HAD TO ADD `notin` TO THE PROC THAT CHECKS THE ARCHITECTURE
07:28:03FromDiscord<sharpcdf> i am
07:28:06FromDiscord<sharpcdf> unbelievably
07:28:08FromDiscord<sharpcdf> happy
07:28:13FromDiscord<sharpcdf> so
07:28:14FromDiscord<sharpcdf> happy
07:28:20FromDiscord<sharpcdf> its 3:30 am
07:28:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44MZ
07:28:53FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44N0
07:29:14FromDiscord<Elegantbeef> if you have a return inside that will exist on the first check
07:29:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44N1
07:29:54FromDiscord<sharpcdf> In reply to @Elegantbeef "if you have a": wdym
07:31:06FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/ht8
07:31:52FromDiscord<sharpcdf> what, would that not work properly?
07:31:53FromDiscord<Elegantbeef> So only in the case that `os` is in `a` will it do another iteration
07:32:13FromDiscord<sharpcdf> no
07:32:36FromDiscord<sharpcdf> ah i see, i need to add to `result`?
07:32:51FromDiscord<Elegantbeef> Or just do what i showed
07:33:29FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=44N3
07:34:48FromDiscord<sharpcdf> oh i see
07:34:53FromDiscord<sharpcdf> yea ill do that
07:35:29FromDiscord<sharpcdf> yea im stupid, i shouldve done that first lol
07:40:13FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44N6
07:40:34FromDiscord<sharpcdf> good thing i know the error or i would be crying right now
08:00:56FromDiscord<sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=44Nd
08:03:44FromDiscord<Elegantbeef> You have early returns
08:03:48FromDiscord<Elegantbeef> Why do you not use my code?
08:03:52FromDiscord<sharpcdf> i did
08:03:53FromDiscord<sharpcdf> did i not
08:03:55FromDiscord<Elegantbeef> Also use a const
08:03:57FromDiscord<Elegantbeef> No you did not
08:04:03FromDiscord<Elegantbeef> you have early returns
08:04:15FromDiscord<Elegantbeef> I wrote my code in a specific way cause it only early returns in the case it matches
08:04:32FromDiscord<sharpcdf> oh i didnt see `result = true`
08:04:34FromDiscord<sharpcdf> let me fix that
08:04:39FromDiscord<Elegantbeef> Result is set to true on the first line and the procedure only returns false if the name is in the string
08:04:45FromDiscord<Elegantbeef> use const instead of var for os
08:06:04FromDiscord<sharpcdf> In reply to @Elegantbeef "use const instead of": whats the difference?
08:06:06FromDiscord<sharpcdf> performance?
08:06:24FromDiscord<Elegantbeef> Possibly, also it's the proper way to write Nim
08:06:32FromDiscord<Elegantbeef> constants should be constants
08:06:40FromDiscord<sharpcdf> fair enough
08:06:45FromDiscord<sharpcdf> but why not immutable
08:07:00FromDiscord<Elegantbeef> What?
08:07:09FromDiscord<Elegantbeef> `let` is a runtime "constant"
08:07:17FromDiscord<Elegantbeef> `const` is a compile time constant
08:07:43FromDiscord<Elegantbeef> you cannot mutate a `const` no matter how much you try
08:07:57FromDiscord<sharpcdf> yea i know
08:08:03FromDiscord<sharpcdf> why not use `let` instead of const
08:08:16FromDiscord<Elegantbeef> Cause it's still a runtime value
08:08:38FromDiscord<Elegantbeef> You use the most restrictive declaration possible
08:08:56FromDiscord<Elegantbeef> If you can use const you do, if you can use let you do
08:09:37FromDiscord<Elegantbeef> Using a constant instead of a let means the program doesnt have to allocate new strings inside of that array
08:10:54FromDiscord<sharpcdf> In reply to @Elegantbeef "Using a constant instead": ah ok
08:11:01FromDiscord<sharpcdf> well anyways heres the fruits of my labor
08:11:03FromDiscord<sharpcdf> https://media.discordapp.net/attachments/371759389889003532/998864533684764712/unknown.png
08:11:08FromDiscord<sharpcdf> some more but this is the main part
08:11:38FromDiscord<sharpcdf> i do want to see if theres some cli library for choosing versions to install/remove
08:13:33*syl quit (Quit: C-x C-c)
08:13:43FromDiscord<Elegantbeef> "adding executables to bin"
08:13:52FromDiscord<Elegantbeef> This is a user defined bin path right 😄
08:14:58FromDiscord<sharpcdf> In reply to @Elegantbeef "This is a user": its in `~/.jitter/bin`
08:15:03FromDiscord<sharpcdf> and the user adds it to path
08:15:13*syl joined #nim
08:15:18FromDiscord<sharpcdf> im sorry
08:15:19FromDiscord<sharpcdf> but
08:15:29FromDiscord<sharpcdf> i plan on making a config file where you can choose the bin
08:16:02FromDiscord<Elegantbeef> Seems sensible to me
08:18:09FromDiscord<sharpcdf> 😄
08:18:28FromDiscord<sharpcdf> i want to have it so everything is still changeable but by default everything is in one place
08:18:57FromDiscord<sharpcdf> tomorrow i fix the rest f the bugs and work on gitlab support
08:19:03FromDiscord<sharpcdf> (edit) "f" => "of"
08:20:12*pch quit (Quit: Leaving)
08:31:27*toluene quit (Quit: Ping timeout (120 seconds))
08:33:28*toluene joined #nim
08:45:09FromDiscord<Phil> Question, is there a way to ensure that a variable with a ref-type can't be nil?
08:47:57FromDiscord<Phil> As in, get compile time assurance that it won't be?
08:48:02FromDiscord<flywind> No good solution, check thr strictnotbil experiemental feature.
08:48:06FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#strict-not-nil-checking
08:48:09FromDiscord<flywind> (edit) "thr" => "the"
08:48:20FromDiscord<flywind> (edit) "strictnotbil" => "strictnotnil"
08:48:21FromDiscord<Elegantbeef> strict not bullet bill\
08:48:45FromDiscord<Elegantbeef> It ensures all enemies you meet are atleast koopas
08:49:02FromDiscord<flywind> lol, I typed on the phone
08:50:14FromDiscord<Phil> Check. If I wanted to only assure this only for my own project code (I've made bad experiences with e.g. system.nim failing for some "WarningAsError" and "HintAsError" flags), do I have to add the pragma to every single `.nim` file?
08:50:22FromDiscord<Phil> (edit) removed "only"
08:50:50FromDiscord<flywind> Feel free to make prs to system.nim.
08:51:13FromDiscord<flywind> (edit) "system.nim." => "system.nim to remove warnings."
08:52:03FromDiscord<Phil> Can I take that as a yes for the "Add pragma to every file" question?
08:52:34FromDiscord<flywind> I mean the warningAsError issues.
08:52:50FromDiscord<flywind> Only the modules you used this feature Imo.
08:53:22FromDiscord<Phil> Yeh, I'll likely take a look at it if I can find the time, next to other obligations and the stuff I've got going with norm
08:53:58FromDiscord<Phil> In reply to @flywind "Only the modules you": I'd want blanko "check for not nil", though only for my own code, thus the question.
08:54:05FromDiscord<flywind> push and pop pragmas may work for you case
08:54:26FromDiscord<Phil> Ah right, I could push the pragma on the root file and never pop it?
08:54:45FromDiscord<j-james> really wish object fields didn't initialize as `nil`
08:56:34FromDiscord<flywind> In reply to @Isofruit "Ah right, I could": Yeah, stdlib does this for some cases.
08:57:32FromDiscord<flywind> And you need to include it in your projects,
08:57:34FromDiscord<flywind> https://github.com/nim-lang/Nim/blob/efcb89fa702da5bd5d2cf000ace759df90152895/lib/system/inclrtl.nim#L51
08:58:41FromDiscord<flywind> https://nim-lang.org/docs/manual.html#pragmas-push-and-pop-pragmas works for some experimental features but it depends on its implementation, not sure which ones work.
09:31:40*jmdaemon quit (Ping timeout: 272 seconds)
09:35:52*syl quit (Quit: C-x C-c)
09:36:11*syl joined #nim
09:36:39*syl quit (Remote host closed the connection)
09:36:54*syl joined #nim
09:48:23*vicecea quit (Ping timeout: 255 seconds)
10:14:06*duuude quit (Ping timeout: 272 seconds)
10:28:20FromDiscord<RedBeard0531 (Mathias Stearn)> Has anyone had success bridging nim closure types into a C++ `std::function`? Or for that matter exposing nim closure types to C++ at all?
11:01:52FromDiscord<Phil> In reply to @Elegantbeef "https://nim-lang.org/docs/manual_experimental.html#": Oh sweet, strict not nil only throws warnings, not errors.↵Just ran it over my code. It... flagged a lot. Like, a ton of jsony code as well. Hmm
11:21:34FromDiscord<Tibix> good morning, am I missing something? https://media.discordapp.net/attachments/371759389889003532/998912478488576060/unknown.png
11:22:13FromDiscord<planetis> pbl not var
11:22:16FromDiscord<Tibix> sent a code paste, see https://play.nim-lang.org/#ix=44NT
11:22:19FromDiscord<planetis> yep
11:22:32FromDiscord<planetis> hashMap: var seq[kvPair]
11:23:04FromDiscord<Tibix> oh that worked tysm
11:23:49FromDiscord<Tibix> sent a code paste, see https://play.nim-lang.org/#ix=44NU
11:24:28FromDiscord<RedBeard0531 (Mathias Stearn)> Have you considered just using https://nim-lang.org/docs/tables.html
11:24:58FromDiscord<Tibix> I am implementing my own hashmap purely for fun
11:25:02FromDiscord<Tibix> And to learn Nim
11:25:27FromDiscord<RedBeard0531 (Mathias Stearn)> I don't know if "bad practice" is what I'd say, but do you have a plan for how to handle hash colisions? It looks like it won't be possible since you don't have the unhashed key.
11:25:27FromDiscord<Tibix> I will probably make something that doesn't exist yet next haha
11:25:44FromDiscord<Tibix> In reply to @RedBeard0531 (Mathias Stearn) "I don't know if": Oh yes, hash collisions come later, I will just use rehashing
11:27:01FromDiscord<RedBeard0531 (Mathias Stearn)> It is certainly confusing to name something `key` but have it actually be a hash
11:27:39FromDiscord<RedBeard0531 (Mathias Stearn)> Usually a hash table will either store both the raw key and the hash, or just the raw key and have the hash re-computed on demand when needed.
11:30:03FromDiscord<Tibix> That's fair yeah
11:30:08FromDiscord<Tibix> Well rip https://media.discordapp.net/attachments/371759389889003532/998914634545377320/unknown.png
11:30:41FromDiscord<Tibix> I tried to replicate the C function in Nim
11:30:42FromDiscord<Tibix> https://gist.github.com/MohamedTaha98/ccdf734f13299efb73ff0b12f7ce429f
11:30:56FromDiscord<Tibix> apparently I fucked something up?
11:30:57FromDiscord<Tibix> sent a code paste, see https://play.nim-lang.org/#ix=44NW
11:33:44FromDiscord<carlosri> In reply to @b1rdf00d "sounds like a good": thanks I'll look into it
11:33:49FromDiscord<RedBeard0531 (Mathias Stearn)> I think you want `%` rather than `` since you want wrapping behavior on overflow. https://nim-lang.org/docs/system.html#%2A%25%2Cint%2Cint
11:34:22FromDiscord<enthus1ast> Nim also has shift left shl()
11:34:30FromDiscord<RedBeard0531 (Mathias Stearn)> Or just use `uint` rather than `int`
11:35:18FromDiscord<RedBeard0531 (Mathias Stearn)> hashes should basically never use signed ints because hashes aren't really numbers, they are just bags of bits
11:46:16FromDiscord<RedBeard0531 (Mathias Stearn)> Is there a canonical binding library for the c++ stdlib (things like `std::vector`and `std::string`) to use when interfacing with C++ libs or does everyone roll their own every time?
11:57:50*wallabra_ joined #nim
11:59:14*rockcavera joined #nim
11:59:14*rockcavera quit (Changing host)
11:59:14*rockcavera joined #nim
12:00:40*wallabra quit (Ping timeout: 260 seconds)
12:02:35*wallabra_ quit (Ping timeout: 268 seconds)
12:15:40*kenran joined #nim
12:23:33*kenran quit (Ping timeout: 276 seconds)
13:03:20FromDiscord<Professor Actual Factual> In reply to @RedBeard0531 (Mathias Stearn) "Is there a canonical": You kinda make your own every time, but c2nim should take away most of the pain in interop
13:14:02FromDiscord<voidwalker> hey @enthus1ast ! db consulting time again 🙂
13:15:18FromDiscord<voidwalker> I want to turn what is a column of strings in the input file, in a column of ints pointing to another table with id -> string
13:16:28FromDiscord<voidwalker> I am thinking two small ints (<=32 ) will take up less space than the string
13:17:06FromDiscord<voidwalker> Is there any standard method to do this conversion from SQL, when importing?
13:23:33*pch joined #nim
13:38:34FromDiscord<demotomohiro> @RedBeard0531 (Mathias Stearn) https://github.com/Clonkk/nim-cppstl
13:41:00FromDiscord<RedBeard0531 (Mathias Stearn)> @\_discord\_288750616510201856\:t2bot.io thanks. That helps, but is still extremely limited. It does at least cover string and vector, but not much else.
13:43:29*xet7 quit (Remote host closed the connection)
13:52:58FromDiscord<Rika> PR additions so that it does become the de facto cpp stl to go to
14:07:48FromDiscord<Tibix> In reply to @RedBeard0531 (Mathias Stearn) "Or just use `uint`": THis worked, thanks
14:10:27FromDiscord<trevor> Hey folks, is there an easy way to inspect the generated source of a macro?
14:11:56FromDiscord<aMOPel> What framework would you use for creating a gui app or web app in nim atm? nimx, fidget, karax, jester, prologue or smth else? What's most fleshed out and usable?
14:13:00FromDiscord<Prestige> @trevor `dumpMacros`
14:13:11FromDiscord<Prestige> woops, `expandMacros`
14:13:15FromDiscord<Prestige> https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped
14:14:42*wallabra joined #nim
14:19:41FromDiscord<Phil> In reply to @voidwalker "I want to turn": The input file is an actual file or are we talking sqlite?
14:23:03FromDiscord<Phil> If it's a file you'd need to write a script to send the SQL queries for inserts either way and cold do it in there.↵↵If this is 2 tables in the same database, sqlite does have methods for splitting and type casting. Together with "insert into select" it should be possible to write the SQL for that
14:27:48FromDiscord<Phil> In reply to @aMOPel "What framework would you": Only the front-end? If you really want to use nim I've heard good things about karax.↵The backend? Jester and prologue are widespread, I personally use prologue. Nexus is in development but might interest you since it's planned to have an ORM included, where jester and prologue tell you to plug in and wire up your own.
14:29:13FromDiscord<Phil> For ORMs for prologue and jester only norm did what I wanted to have, which supports postgres and sqlite.
14:29:45FromDiscord<aMOPel> and what did you try on the frontend side so far?
14:30:34FromDiscord<Phil> Since it's web I prefer to work directly with js Frameworks rather than have Nim compile to js. There I use angular
14:31:45FromDiscord<aMOPel> I see. yeah seeing the frontend web frameworks I was wondering how easily they integrate with other frontend tooling like css preprocessors and tailwind and stuff
14:31:59FromDiscord<aMOPel> and did you try gui frameworks?
14:32:40FromDiscord<voidwalker> well i am using csv to import data, and would like the end result to be in sqlite
14:32:55FromDiscord<Phil> In reply to @aMOPel "and did you try": I haven't done any native gui's ever. But other folks here have and likely can give better input
14:33:39FromDiscord<aMOPel> did you use backend frameworks in other languages and can give a comparison?
14:33:42FromDiscord<Phil> Heard good things about owlkettle, and there are nim bindings for gtk
14:34:15FromDiscord<voidwalker> I am sure this is a very common methid in SQL databases, so I'd rather not write anything but use existing SQL code
14:36:01FromDiscord<voidwalker> I have two uses cases. A set of singular string values present in a column, and a set of comma separate values present in a column. For the later, as there are no arrays in sqlite, I'd have to implement one in code, or have extra 2 tables, one with (id_of_thing, name) and the other with (key_id, id_of thing1..n)
14:38:11FromDiscord<Phil> sent a long message, see http://ix.io/44OH
14:38:15*arkurious joined #nim
14:39:42FromDiscord<Phil> Ah, maybe should state that I rewrote a django backend in Nim. Made use of an ORM, replicated Django signals, copied the way django does encryption etc
14:41:06FromDiscord<aMOPel> you used norm and a signal and encryption library for that or built it from the ground up?
14:41:49FromDiscord<Phil> In reply to @voidwalker "I am sure this": I found https://linuxhint.com/sqlite-import-csv/↵But that requires your CSV to already have the desired format. And the import itself isn't handled via SQL, but a separate functionality
14:42:57FromDiscord<voidwalker> .import /home/linux/DATA.csv DATA interesting, I wonder if this is available as an SQL query as well
14:43:07FromDiscord<voidwalker> well, I already wrote the csv to sqlite import thing in nim
14:43:40FromDiscord<Phil> In reply to @aMOPel "you used norm and": For encryption used the openssl wrapper. For signals I had to build something from scratch. Same for connection pooling. And yeah, v used norm ( for simple queries) and nisane(for complex queries line recursive queries or sqlite fts queries)
14:44:20FromDiscord<voidwalker> I think normalization is the term I am looking for
14:44:33FromDiscord<Phil> The good news is, my connection pooling code I turned into a lib so you can use that if you want
14:45:17FromDiscord<Phil> And I also contributed a couple things I need to norm that weren't there before
14:45:45FromDiscord<Phil> (edit) "need" => "needes" | "before" => "before, so higher chances it has all the functionality you might need"
14:46:15FromDiscord<Phil> Norm can't deal well with raw SQL (compared to e.g. Django) , that's where nisane comes in handy
14:50:02FromDiscord<aMOPel> Nisane looks pretty handy
14:52:36FromDiscord<Phil> Other than that, jsony for dealing with JSON and zippy for gzip commission have both been fantastic
14:53:00FromDiscord<Phil> (edit) "commission" => "compression"
14:54:03FromDiscord<Phil> In reply to @voidwalker ".import /home/linux/DATA.csv DATA interesting,": I wouldn't bet on it, haven't seen it yet at least
14:56:56FromDiscord<Phil> In terms of docs I found prologue to be pretty good and fairly workable. I haven't worked with jester myself but given that a fair chunk of webdev folks here use it I have to assume it's good as well
15:01:17FromDiscord<voidwalker> Delivery guy called, will have Mastering nim in 5-6 mins : D
15:11:44FromDiscord<Phil> In reply to @voidwalker "Delivery guy called, will": Nice!
15:20:24FromDiscord<voidwalker> Welp, disappointment. Pages are small, not too many, mostly code, and very wide spacing
15:21:24FromDiscord<voidwalker> This should've been a PDF. does not feel like a reading book, more like a refference doc :\
15:22:18FromDiscord<Phil> It provides a starting point for macro's, that alone I'd assume is pretty valuable
15:22:38FromDiscord<voidwalker> Well, at least I hope it help support nim development, for what it's worth. And that it's concise and ceal enough for a beginner to intermediate programmer like myself to make use of it
15:22:49FromDiscord<voidwalker> (edit) "ceal" => "clear"
15:23:15FromDiscord<Phil> I just really wish araq would put the book as a patreon reward
15:24:08FromDiscord<Phil> ~~i don't wanna unsub for a couple months to finance the book with what would otherwise have been patron money~~
15:24:55FromDiscord<Prestige> I also have the physical book, but still want a PDF version
15:25:18FromDiscord<voidwalker> It kinda sux we're wasting paper, giving amazon a big chunk of the money, for what 90% of use would preffer as a PDF
15:25:33FromDiscord<voidwalker> Yeah, I payed 70 EUR (w taxes and shipping for it) and I still have to scan it :\
15:25:51FromDiscord<Prestige> I really don't want to spend the time scanning every page
15:26:04FromDiscord<voidwalker> I understand Araq has some feelings about physical books, which I share, but other people might feel different things
15:26:50FromDiscord<Prestige> The feeling of the paper in this book bothers me a bit, strangely enough
15:27:24FromDiscord<voidwalker> Yeah this is not the art of computer programming..
15:28:26FromDiscord<voidwalker> the quality of the print is also not that great, contrast is bad.. letters are no black enough
15:28:35FromDiscord<aMOPel> In reply to @Isofruit "Django and spring (python": I was wondering, did you feel like it was worth it to keep it in nim and put all this extra effort? Or was it more of a passion project?
15:28:38FromDiscord<voidwalker> (edit) "no" => "not" | "enough" => "enough. Feels like a quick laser print"
15:35:51FromDiscord<voidwalker> @Prestige you know what, you are right.. scanning every page of 300 is a huge waste of time. Going to wait for my ADF scanner to arrive and I'm gonna chop the book up :\
15:37:50FromDiscord<Prestige> Good thinking
15:38:02FromDiscord<flywind> Imo not every part needs to be scanned, for instance part 2.
15:38:33FromDiscord<Prestige> I think someone else was talking about scanning + OCR'ing it
15:38:36FromDiscord<Prestige> forget who
15:39:08*Guest21 joined #nim
15:39:14*Guest21 quit (Client Quit)
15:39:53FromDiscord<voidwalker> Hm not sure if I am right, not familiar with the nim community so well, but I could see so far at least 2-3 rather strong and unpopular opinions/perspectives from Araq.. is this root cause for the nimskull fork ?
15:42:04FromDiscord<Prestige> Could read https://github.com/nim-works/nimskull#FAQ
15:42:43FromDiscord<haxscramper> more or less
15:43:57FromDiscord<haxscramper> it was partially converted from the manual, according to author↵(@voidwalker)
15:45:35FromDiscord<Prestige> God I hate element
15:45:44FromDiscord<Prestige> Can't figure out how to join a room from an invite link
15:47:12FromDiscord<voidwalker> Haha yeah same here, been using it for a year and it still felt alien. Now I use nheko, but it's lacking some stuff
15:47:48FromDiscord<Prestige> I miss when everyone just used irc
15:48:12FromDiscord<haxscramper> we have IRC
15:48:34FromDiscord<Prestige> I mean another community I was going to join seems to only exist on matrix
15:48:58FromDiscord<haxscramper> IIRC you every matrix room has an IRC one somehow
15:49:04FromDiscord<haxscramper> or maybe it was the other way around
15:49:11FromDiscord<haxscramper> can join IRC using matrix client
15:51:08FromDiscord<Phil> In reply to @aMOPel "I was wondering, did": I wanted to learn Nim through this and the speed up was a beneficial side effect.↵If I wanted to write something simple, I likely would pick Django.↵If I wanted to write something fast, given all the ecosystem now has almost all the tooling I could want? Nim every time, particularly since wiring up the existing pieces isn't that much more work, you just need to have an idea on how you want to
15:54:08FromDiscord<Phil> What I appreciate more than anything in nim over python is the compiler telling you you're doing stuff wrong. You can eliminate entire error classes through this, which you'd need separate tooling for in python (iirc it has a static type checker)
15:57:27FromDiscord<Phil> I've particularly come to like compile time procs to check some pieces of logic, e.g. for generating many to many queries
15:59:07FromDiscord<Phil> In reply to @voidwalker "Hm not sure if": I'd wager that him having a short fuse sometimes (from what I've seen on e.g. a recent issue about packaging support) also contributed
15:59:44FromDiscord<voidwalker> Well short fuses can be fun sometimes. Like Linus has : D
15:59:53FromDiscord<voidwalker> had.. until he was corrected
16:00:06FromDiscord<Phil> Man, that dude can explode
16:01:02FromDiscord<Phil> "you should be retroactively aborted" is a strong take. Not a good one IMO, but that leaves an impression.
16:27:03FromDiscord<lantos> has anyone got like an automated way to patch nim locally in your own package?
16:27:43FromDiscord<Yardanico> If you mean the stdlib, there's patchFile
16:30:06FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=44PL
16:31:04FromDiscord<Rika> must be in nimscript
16:42:52*kenran joined #nim
16:43:19*kenran quit (Client Quit)
16:51:51FromDiscord<lantos> wo it worked. Nim is actually good.
17:43:05FromDiscord<# Luke> In reply to @Avahe "Can't figure out how": It's easy
17:43:28FromDiscord<# Luke> Just paste it in this box
17:43:48FromDiscord<# Luke> https://media.discordapp.net/attachments/371759389889003532/999008667229761627/IMG_1687.png
17:44:16FromDiscord<dom96> In reply to @Isofruit ""you should be retroactively": wow, didn't hear that quote before
17:44:55FromDiscord<Prestige> In reply to @ripluke "Just paste it in": Didn't work for me
17:45:21FromDiscord<Phil> In reply to @dom96 "wow, didn't hear that": I've actually contemplated whether that quote was a bit too harsh to be posted here about 5 minutes after posting it
17:45:53FromDiscord<Phil> But yeah, Torvalds can be a bit of an ass
17:46:05FromDiscord<Phil> To put it mildly
17:46:10FromDiscord<# Luke> In reply to @Avahe "Didn't work for me": Hmm send me a link and I'll try it
17:47:12FromDiscord<Phil> In reply to @dom96 "wow, didn't hear that": Also! If you have time, I posted an architectural webdev question in the webdev channel, I would also be interested in your opinion !
17:47:30FromDiscord<Prestige> I got it working with Cinny, they have an input box for invite links
17:47:57FromDiscord<dom96> In reply to @Isofruit "Also! If you have": Sure thing, will take a look :)
18:20:37FromDiscord<Tuatarian> What is the purpose of backticks around a func name if yourw not declaring q custom operator?
18:21:24FromDiscord<Tuatarian> Say for example is there a difference between func `sgnmod` and func sgnmod?
18:21:42FromDiscord<Tuatarian> Discord formatting did that one a little dirty
18:22:23FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=44Q7
18:24:57FromDiscord<Phil> I...err... Don't think it does anything (?)
18:46:18FromDiscord<Yardanico> In reply to @iWonderAboutTuatara "What is the purpose": there's no difference, backticks are used when a name you want to use isn't a valid Nim identifier
18:46:27FromDiscord<Yardanico> useful when doing FFI or some serialization stuff with names from foreign places
18:46:41FromDiscord<Tuatarian> I see
18:47:03FromDiscord<Tuatarian> Why are =destroy and such wrapped in backtick?
18:47:13FromDiscord<Yardanico> because = is not valid in a Nim identifier
18:47:28FromDiscord<Tuatarian> I see
18:47:30FromDiscord<Yardanico> you can't do `let =myname = 5`
18:47:38FromDiscord<Tuatarian> Right
18:47:41FromDiscord<Tuatarian> Thanks
18:48:11*noeontheend joined #nim
19:03:51*duuude joined #nim
19:04:29*pch quit (Quit: Leaving)
19:06:23*krux02 joined #nim
19:18:55FromDiscord<sharpcdf> should i manage downloaded packages in a json file or should i just go through the directory that holds them and manage it directly
19:19:31FromDiscord<sharpcdf> like look to see if a package exists in a json file or just go through the directory and see if its there
19:19:47FromDiscord<sharpcdf> right now im doing the latter but idk if the json file would be better
19:32:15FromDiscord<!Patitotective> In reply to @sharpcdf "should i manage downloaded": why do you want to do that?
19:32:53FromDiscord<!Patitotective> not sure if `nimble list -i` works in your case
19:34:56FromDiscord<sharpcdf> In reply to @Patitotective "why do you want": not nimble packages
19:35:08FromDiscord<sharpcdf> basically folders that im downloading
19:36:05FromDiscord<sharpcdf> im making a package manager
19:36:54FromDiscord<!Patitotective> then i think the best would be to go though a directory because someone can maybe delete a folder manually and the json file would be obsolete
19:37:05FromDiscord<sharpcdf> yea thats what i was thinking
19:37:07FromDiscord<sharpcdf> thanks
19:41:41FromDiscord<creikey> Is there any way for a nim library to expose functions to the nimble file?↵Like I want to make a library that does https://github.com/treeform/nim_emscripten_tutorial webassembly stuff for you, so you can do↵`requires "library > 1.0.0"`↵`doWasm()`
19:42:25FromDiscord<sharpcdf> In reply to @creikey "Is there any way": i dont think nimble files can use user libraries
19:42:30FromDiscord<sharpcdf> so id assume not
19:42:32FromDiscord<creikey> In reply to @sharpcdf "i dont think nimble": it can use std though
19:42:34FromDiscord<creikey> like import nimscript
19:42:50FromDiscord<sharpcdf> yea but nimscript cant do like `import zippy`
19:45:52FromDiscord<creikey> https://nimble.directory/pkg/nimterlingua it imports this in the exmaple
19:45:55FromDiscord<creikey> (edit) "exmaple" => "example"
19:46:04FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/999039439760269342/unknown.png
19:46:40FromDiscord<sharpcdf> In reply to @creikey "": thats not nimscript
19:46:41FromDiscord<sharpcdf> its nim
19:46:49FromDiscord<sharpcdf> oh wait
19:46:52FromDiscord<Yardanico> In reply to @sharpcdf "i dont think nimble": they can
19:46:53FromDiscord<sharpcdf> there is a nimscript example
19:46:58FromDiscord<Yardanico> .nimble is a nimscript file
19:47:01FromDiscord<Yardanico> so you can `import` and stuff
19:47:03FromDiscord<sharpcdf> i guess so
19:47:05FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/999039698175545424/unknown.png
19:47:15FromDiscord<sharpcdf> In reply to @creikey "": yea lol i had no idea
19:47:20FromDiscord<creikey> it can't find this file though https://media.discordapp.net/attachments/371759389889003532/999039758875512892/unknown.png
19:47:35FromDiscord<aMOPel> Is there some information on how fidget 2 is coming along?
19:47:44FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/999039861535289485/unknown.png
19:49:42FromDiscord<!Patitotective> In reply to @creikey "it can't find this": you can import .nim modules in nimscript but you can't import .nims "modules" in .nim/.nims modules
19:49:49FromDiscord<creikey> oh yeha
19:49:50FromDiscord<creikey> (edit) "yeha" => "yeah"
19:49:53FromDiscord<!Patitotective> you should make `helper.nims` `helper.nim`
19:50:05FromDiscord<creikey> cool it works
19:50:18FromDiscord<creikey> are `requires` ran before the import or after
19:50:24FromDiscord<creikey> like can I import a library I requries
19:50:28FromDiscord<creikey> (edit) "requries" => "requires"
19:51:06FromDiscord<!Patitotective> i dont think you can but let me try
19:51:13FromDiscord<creikey> no they arne't
19:51:16FromDiscord<creikey> (edit) "arne't" => "aren't"
19:51:19FromDiscord<creikey> I just tested that's a bummer
19:52:07FromDiscord<!Patitotective> why are you using dependencies in the nimble ?
19:52:10FromDiscord<!Patitotective> (edit) "nimble ?" => "nimble?"
19:52:22FromDiscord<creikey> I want to make a library that has easy webassembly support
19:52:42FromDiscord<!Patitotective> (edit) "nimble?" => "nimble file?"
19:53:01FromDiscord<creikey> so you can do like `nimble webassembly` or something after doing in the nimble:↵`requires "mylibrary"`↵`import mylibrary`↵`makeWasmTask("webassembly")`
19:53:56FromDiscord<!Patitotective> why not a cli tool?
19:54:21FromDiscord<creikey> requiring a separate build tool for people to install is so much worse than just a nimble library
19:54:36FromDiscord<creikey> now your program needs an external binary you have to update to be built
19:55:04FromDiscord<creikey> I mean if it's also managed with nimble maybe not so bad
19:55:19FromDiscord<# Luke> In reply to @Patitotective "why are you using": You can do that?
19:55:19FromDiscord<creikey> a nimble package like `easywasm` or something you do `nimble install easywasm` then `./easywasm myproj.nimble`
19:55:25FromDiscord<!Patitotective> you can take a look at↵https://github.com/c-blake/cligen↵or↵https://bitbucket.org/maxgrenderjones/therapist/src/master/
19:55:27FromDiscord<!Patitotective> In reply to @ripluke "You can do that?": no
19:55:33FromDiscord<# Luke> Oh
19:55:58FromDiscord<!Patitotective> In reply to @creikey "a nimble package like": yea well, when you install easywasm it should install all the deps where the cli tool is
19:56:12FromDiscord<creikey> wait wait
19:56:20FromDiscord<!Patitotective> (edit) "at↵https://github.com/c-blake/cligen↵or↵https://bitbucket.org/maxgrenderjones/therapist/src/master/" => "at↵https://github.com/c-blake/cligen↵or↵https://bitbucket.org/maxgrenderjones/therapist"
19:56:24FromDiscord<creikey> so in the library I'm making I can also provide a cli tool to build nim projects to webassembly
19:56:35FromDiscord<!Patitotective> yep
19:56:37FromDiscord<creikey> and they're like together
19:56:40FromDiscord<creikey> I just provide a binary target in the library's nimble
19:56:41FromDiscord<creikey> neat
19:56:46FromDiscord<creikey> this is a good solution thank you
19:57:01FromDiscord<!Patitotective> :]
20:02:49FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=44QE
20:03:54FromDiscord<!Patitotective> In reply to @lantos "how can do you": does this fail?
20:04:54FromDiscord<!Patitotective> In reply to @lantos "how can do you": since it is an `{.async.}` procedure i think it return type must be of type `Future`
20:04:58FromDiscord<!Patitotective> (edit) "it" => "its"
20:05:46FromDiscord<lantos> yeah it fails that way
20:05:58FromDiscord<!Patitotective> In reply to @lantos "yeah it fails that": which way?
20:06:05FromDiscord<huantian> you'd have to return a `Future[FutureStream[string]]` ig?
20:06:16FromDiscord<lantos> Expected return type of 'Future' got 'FutureStream'↵asyncmacro.nim(261, 29): async↵asyncmacro.nim(162, 21): asyncSingleProc↵asyncmacro.nim(121, 10): verifyReturnType
20:06:43FromDiscord<sharpcdf> how can i get colors other than `fgBlue`, etc. in `std.terminal` and use them
20:07:13FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=44QF
20:07:34FromDiscord<!Patitotective> but if you're awaiting for `bodyStream` it won't be a future?
20:07:37FromDiscord<!Patitotective> (edit) "future?" => "future (?)"
20:08:08FromDiscord<Rika> In reply to @sharpcdf "how can i get": What do you mean by other colours
20:08:26FromDiscord<huantian> yeah you would just return res.bodyStream
20:08:45FromDiscord<!Patitotective> In reply to @sharpcdf "how can i get": https://nim-lang.org/docs/colors.html#Color ?
20:09:10FromDiscord<!Patitotective> (edit) "?" => "?↵https://nim-lang.org/docs/terminal.html#setBackgroundColor%2CFile%2CColor"
20:09:47FromDiscord<Rika> You have to be wary of terminal colours
20:09:58FromDiscord<sharpcdf> how so
20:09:59FromDiscord<Rika> There are terminals that do not support colours in that sense
20:10:42FromDiscord<Rika> There are terminals that only support 2 colours, 8 colours, 16 colours, 256, and full 24 bit
20:11:14FromDiscord<sharpcdf> then what would the best way of terminal coloring be
20:11:21FromDiscord<Rika> Anything except 24 bit is “palette based” and you can’t rely on the names of the colours matching the actual colour shown because of theming
20:11:28*jmdaemon joined #nim
20:11:40FromDiscord<Rika> You can assume terminals have at least 16 colours
20:12:27FromDiscord<sharpcdf> In reply to @Rika "Anything except 24 bit": should i use ascii coloring?
20:12:59FromDiscord<Rika> What do you mean
20:13:16FromDiscord<Rika> You mean ANSI?
20:13:24FromDiscord<sharpcdf> oh yea
20:13:26FromDiscord<sharpcdf> lol
20:13:33*CyberTailor quit (Quit: Konversation terminated!)
20:13:43FromDiscord<lantos> In reply to @Patitotective "but if you're awaiting": oops fixed that
20:13:45FromDiscord<Rika> I believe the terminal library uses that under the hood
20:13:57FromDiscord<sharpcdf> oh ok
20:14:28FromDiscord<sharpcdf> i think ill just stick with what im doing right now and change it if i encounter any problems
20:17:07FromDiscord<sharpcdf> In reply to @Patitotective "https://nim-lang.org/docs/colors.html#Color ? https": is there any way to use it with `styledEcho`?
20:20:45FromDiscord<!Patitotective> In reply to @sharpcdf "is there any way": doesn't seem so :/
20:20:53FromDiscord<sharpcdf> rip
20:21:57*duuude quit (Ping timeout: 276 seconds)
20:23:25FromDiscord<!Patitotective> can't you just use set the background/foreground color before styledEcho?
20:24:12FromDiscord<Hi02Hi> In reply to @creikey "I just provide a": nico is an example of this with nicoboot
20:27:44FromDiscord<!Patitotective> actually @sharpcdf you can just convert your `Color` using `ansiForegroundColorCode` or `ansiBackgroundColorCode`
20:28:27*noeontheend quit (Ping timeout: 244 seconds)
20:29:15FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44QM
20:29:21FromDiscord<!Patitotective> where `fgBlue` is your `Color`
20:41:19FromDiscord<dankey> sent a code paste, see https://play.nim-lang.org/#ix=44QO
20:43:31FromDiscord<!Patitotective> what is `i`
20:43:40FromDiscord<treeform> it expands the i to full the args of print
20:43:57FromDiscord<treeform> `print(i)` -> `print(i[0], i[1])`
20:44:14FromDiscord<treeform> There is probably a macro one could write
20:44:23FromDiscord<treeform> but this is just not the code that should happen often in nim
20:44:47FromDiscord<treeform> in python you operate on "unstructured" data a ton, like lists or tuples of random types
20:44:54FromDiscord<treeform> in Nim you should just not do that
20:44:57FromDiscord<dankey> sent a code paste, see https://play.nim-lang.org/#ix=44QR
20:45:10FromDiscord<dankey> (edit)
20:45:25FromDiscord<dankey> In reply to @treeform "in Nim you should": tnx but idc i just want to explore the lang
20:45:30FromDiscord<dankey> if anyone got a suggestion id like that
20:46:07FromDiscord<treeform> I think in nim all call arguments needs to be known at compile time
20:46:32FromDiscord<treeform> `print(range(i))` is not possible with dynamic range
20:46:44FromDiscord<treeform> if range(i) is known at compile time that can work
20:47:06FromDiscord<dankey> let's say that it is
20:47:13FromDiscord<treeform> if you only care about printing you can write a custom print that just prints the list
20:47:34FromDiscord<dankey> sure
20:47:41*duuude joined #nim
20:47:41FromDiscord<dankey> not what i wanted tho
20:51:59FromDiscord<treeform> https://play.nim-lang.org/#ix=44QS
20:52:47FromDiscord<treeform> I don't remember how range works in python is it inclusive or exclusive?
20:52:53FromDiscord<treeform> you can change to what you need
20:53:30FromDiscord<treeform> what does it print in python?
20:58:24FromDiscord<dankey> exclusive
20:58:32FromDiscord<dankey> thank you ill check it one in a minute
20:58:53FromDiscord<dankey> meanwhile is there a better way to annotate a tuple than `tuple[a: int, b: int]` ?
20:59:25FromDiscord<!Patitotective> In reply to @dankey "meanwhile is there a": `tuple[a, b: int]` lol
21:00:02FromDiscord<dankey> In reply to @Patitotective "`tuple[a, b: int]` lol": how about if i already know it's always size 2
21:00:09FromDiscord<dankey> is there maybe another ds for that?
21:00:32FromDiscord<dankey> more suited one i mean
21:00:38FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44QV
21:00:43FromDiscord<!Patitotective> In reply to @dankey "how about if i": nope
21:00:53FromDiscord<dankey> tnx!
21:10:23*krux02 quit (Remote host closed the connection)
21:10:46NimEventerNew thread by Patitotective: Nim v1.6.6 support for Codewars, see https://forum.nim-lang.org/t/9310
21:14:33FromDiscord<huantian> @!Patitotective what does it mean for a kata to need an update? for example I just did this one <https://www.codewars.com/kata/53da3dbb4a5168369a0000fe/nim>↵ which was super hard, but I got it
21:14:39FromDiscord<huantian> but it didn't seem to have any issues
21:15:44FromDiscord<huantian> oh ig it's in the test cases?
21:21:07FromDiscord<huantian> huh so once it's fixed, where is this fabled publish button
21:21:50FromDiscord<!Patitotective> https://media.discordapp.net/attachments/371759389889003532/999063536774942720/unknown.png
21:21:56FromDiscord<huantian> ah I had to save first
21:22:30FromDiscord<huantian> <https://www.codewars.com/kumite/62d7206318c60fa0b705f758?sel=62d7206318c60fa0b705f758>↵wow I'm a profession nimmer!
21:22:50FromDiscord<!Patitotective> nice :]
21:28:58*noeontheend joined #nim
21:33:09FromDiscord<pouriya.jamshidi> sent a long message, see http://ix.io/44R1
21:33:31FromDiscord<pouriya.jamshidi> (edit) "long message," => "code paste," | "http://ix.io/44R1" => "https://play.nim-lang.org/#ix=44R2"
21:34:03FromDiscord<pouriya.jamshidi> (edit)
21:35:07FromDiscord<sOkam!> Is `{.varargs.} {.cdecl.}` the same as `{.varargs, cdecl.}`?
21:36:06FromDiscord<!Patitotective> In reply to @sOkam! "Is `{.varargs.} {.cdecl.}` the": yes...
21:37:28*noeontheend quit (Remote host closed the connection)
21:38:12FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44R4
21:38:58FromDiscord<pouriya.jamshidi> In reply to @Patitotective "what do you mean": correct. but those are the default values. I modified my question and added the way I run the command
21:39:35FromDiscord<pouriya.jamshidi> (edit) "command" => "command. The value I provide in the terminal is not shown in the program"
21:42:07FromDiscord<!Patitotective> well @pouriya.jamshidi thats because you're initializing the opt parser with `--recv_q=600 --send_q=600` not with `commandLineParams`
21:43:29*duuude quit (Ping timeout: 268 seconds)
21:44:22FromDiscord<pouriya.jamshidi> In reply to @Patitotective "well <@807159997627891752> thats because": ah I see. So I have to utilize `commandLineParams` and then feed it to opt parser?
21:44:44FromDiscord<!Patitotective> checkout https://nim-lang.org/docs/parseopt.html#getopt.i%2Cseq%5Bstring%5D%2Cset%5Bchar%5D%2Cseq%5Bstring%5D
21:45:49FromDiscord<!Patitotective> also you might want to check↵- https://github.com/c-blake/cligen↵- https://bitbucket.org/maxgrenderjones/therapist
21:47:35FromDiscord<pouriya.jamshidi> In reply to @Patitotective "also you might want": thanks a lot. I was trying to just utilize the standard library and learn to read them 😄 ↵↵really appreciate your help.
21:51:44*noeontheend joined #nim
21:51:56*noeontheend quit (Client Quit)
21:52:15FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44R5
21:54:13*noeontheend joined #nim
22:00:36FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44R9
22:01:14FromDiscord<jan0809> isnt rotation something youd do to a tensor?
22:01:24FromDiscord<!Patitotective> In reply to @sOkam! "What's the correct way": doesnt `\"` work?
22:01:31FromDiscord<jan0809> or what kind of rotating
22:01:36FromDiscord<sOkam!> In reply to @Patitotective "doesnt `\"` work?": don't know, asking
22:01:51FromDiscord<sOkam!> since I currently have no way of testing it, that I know of
22:02:01FromDiscord<creikey> I'm trying to wrap my head around how treeform's jsony works: https://github.com/treeform/jsony/blob/master/src/jsony.nim#L563 , how does nim know which function to call after this one?
22:02:11FromDiscord<creikey> and why is x a parameter, it seems unused?
22:02:12FromDiscord<!Patitotective> In reply to @sOkam! "since I currently have": well it shouldnt compile if it doesnt work
22:02:26FromDiscord<sOkam!> yes, but i dont have anything that compiles with that
22:02:35FromDiscord<sOkam!> so can't really test yet
22:03:13FromDiscord<huantian> In reply to @creikey "and why is x": x lets you specify the return type (and thus the type of `result`) without using a generic parameter with `[]`
22:03:30FromDiscord<huantian> once nim knows the type of `result`, it can use overloading to determine which `parseHook` to call
22:03:33FromDiscord<sOkam!> the lsp does mark it as escaped `"`, so I guess i will trust it for now 🤔
22:03:57FromDiscord<!Patitotective> In reply to @sOkam! "the lsp does mark": nimlsp has some bugs but yeah lol
22:04:08FromDiscord<creikey> In reply to @huantian "x lets you specify": why not use the generic form?
22:04:15FromDiscord<!Patitotective> In reply to @jan0809 "or what kind of": string
22:04:21FromDiscord<!Patitotective> In reply to @jan0809 "isnt rotation something youd": i dunno
22:04:36FromDiscord<huantian> you have to use `[:T]` form when using generic procs with UFC
22:04:46FromDiscord<jan0809> what would rotating a string do?
22:04:51FromDiscord<huantian> so this just saves you from having to do that
22:05:17FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44Ra
22:05:35FromDiscord<huantian> `"""{"some": "json"}""".fromJson(SomeType)`
22:05:47FromDiscord<huantian> instead of `"""{"some": "json"}""".fromJson[:SomeType]`
22:06:21FromDiscord<creikey> the compiles macro is crazy
22:06:26FromDiscord<creikey> I think I get how jsony works now
22:06:31FromDiscord<creikey> this is so cool
22:10:21FromDiscord<huantian> jsony is awesome
22:10:39FromDiscord<creikey> I wish there was fromJson(j: JsonNode)
22:10:46FromDiscord<creikey> I don't think it's really possible though
22:10:53FromDiscord<Dale> Are there any good libs for yaml?
22:10:54FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44Rb
22:11:04FromDiscord<huantian> Isn’t there one called yaml
22:11:18FromDiscord<creikey> In reply to @Dale "Are there any good": https://nimyaml.org/
22:11:31FromDiscord<# Luke> In reply to @creikey "https://nimyaml.org/": Was just about to send that lol
22:11:47FromDiscord<creikey> jsony is a work of art
22:12:00FromDiscord<creikey> so simple
22:12:06FromDiscord<Dale> Ah thanks that looks about as good as jsony
22:12:47FromDiscord<sOkam!> What's the difference between `ptr` and `pointer`? Are they different?
22:13:11FromDiscord<huantian> In reply to @creikey "I wish there was": Do you mean json string to json node or json node to object
22:13:59FromDiscord<creikey> In reply to @huantian "Do you mean json": json node to object
22:14:29FromDiscord<huantian> In reply to @sOkam! "What's the difference between": Yeah that’s not really possible without rewriting all the parsehooks to go from json node to T as well
22:14:41FromDiscord<creikey> so the struct is like
22:14:42FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44Rc
22:14:47FromDiscord<!Patitotective> In reply to @sOkam! "What's the difference between": `ptr T` is a pointer to an object of a certain type↵even though it gets later converted into an untyped pointer `pointer`
22:15:04FromDiscord<creikey> sent a code paste, see https://paste.rs/sVO
22:15:09FromDiscord<sOkam!> In reply to @Patitotective "`ptr T` is a": makes sense, ty
22:15:15FromDiscord<creikey> and want to only set the fields that exist in newPlayer on a Player
22:15:31FromDiscord<huantian> Why not just use optionals
22:15:42FromDiscord<creikey> lot of fields would need an optional for every singlef ield
22:15:43FromDiscord<creikey> (edit) "singlef ield" => "single field"
22:15:59FromDiscord<creikey> and then `if newPlayer.field1.isSome()` ...
22:16:00FromDiscord<creikey> (edit) "..." => "etc"
22:16:28FromDiscord<huantian> You could probably make a macro to do that for you 😛 but that might just be unnecessary complexity
22:16:32FromDiscord<creikey> yeah
22:16:44FromDiscord<creikey> I mean right now I just have a separate message for each field of player that needs to be changed
22:16:56FromDiscord<huantian> Though maybe you could generalize it just with fieldPairs and templates
22:17:37FromDiscord<creikey> can you set object fields by runtime strings?
22:17:46FromDiscord<creikey> or like refer to a field of an object with a variable
22:18:01FromDiscord<creikey> I think this is runtime time information right
22:18:03FromDiscord<jan0809> ah is there a way to make a field of custom type validate against regex
22:18:25FromDiscord<jan0809> a string field obviously
22:18:28FromDiscord<Elegantbeef> Creikey you can do it without type information
22:18:34*duuude joined #nim
22:18:50FromDiscord<creikey> In reply to @Elegantbeef "Creikey you can do": how you need to know the names of the fields on the struct ight
22:18:52FromDiscord<creikey> (edit) "ight" => "right"
22:18:54FromDiscord<creikey> at runtime to compare to
22:19:08FromDiscord<creikey> and then set the corresponding field on the struct from the name
22:19:21FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/999078018838442016/unknown.png
22:19:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44Ri
22:19:52FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44Rk
22:20:14FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/999078235029655642/unknown.png
22:20:17FromDiscord<creikey> what's up with this bug
22:20:25FromDiscord<Elegantbeef> What bug?
22:20:29FromDiscord<creikey> In reply to @Elegantbeef "What bug?": the warning
22:20:32FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44Rl
22:20:43FromDiscord<Elegantbeef> Loop unrolling is an important note, the other part i dont know
22:20:59FromDiscord<Elegantbeef> I've never ran into the latter issue, though i think it might be related to `fmt` like macros
22:21:10FromDiscord<creikey> nim is getting too crazy
22:21:19FromDiscord<Elegantbeef> "getting"
22:21:36FromDiscord<creikey> so complicated but so simple
22:21:52FromDiscord<Elegantbeef> Worth noting `fieldPairs` and `fields` does not work on variants
22:21:53FromDiscord<Dale> Have you thought about using a hashmap creiky ?
22:22:00FromDiscord<creikey> In reply to @Dale "Have you thought about": yeah
22:22:00FromDiscord<creikey> meh
22:22:02FromDiscord<Elegantbeef> You'd want to use disruptek/assume/typeit
22:22:07FromDiscord<creikey> not typesafe on fields
22:22:28FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44Rm
22:22:29FromDiscord<Dale> You can use asserts?
22:22:41FromDiscord<creikey> In reply to @Dale "You can use asserts?": all the values aren't the same either
22:22:55FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=44Rm" => "https://play.nim-lang.org/#ix=44Rn"
22:22:58FromDiscord<Elegantbeef> It means it offsets the pointer by 1 byte
22:23:01FromDiscord<Dale> What about a hashmap of procs?
22:23:21FromDiscord<Dale> The map points to get/sets
22:23:23FromDiscord<creikey> hashmap might actually be faster because this call might be happening often
22:23:52FromDiscord<huantian> Would it be hard to use a macro to generate an PlayerUpdate object that wraps all the fields with Option, then make another update proc which uses fieldPairs to automate checking the options and assigning the new value?
22:24:34FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44Ro
22:24:45FromDiscord<Elegantbeef> Of course it's a simple solution
22:24:46FromDiscord<creikey> In reply to @huantian "Would it be hard": not worth now that I'm looking at jsony and it's already doing what I'd do on the JsonNode
22:25:04FromDiscord<creikey> I think I can half the size of the server code with this
22:25:40FromDiscord<creikey> I made like 5 message types for different updates on the player but I can just do one called `PlayerUpdate` now where you provide the updated fields
22:25:45FromDiscord<sOkam!> In reply to @Elegantbeef "It means it offsets": right, but what does it mean to offset a pointer by -1?↵I get that +1 is "get the next element"... but why offsetting on the opposite way? what if its a value of `0`?.... or can't it not be 0 at all?
22:26:05FromDiscord<Elegantbeef> I can only tell you what it does if it's not documented i dont know why
22:26:24FromDiscord<sOkam!> ✍️
22:26:48FromDiscord<creikey> I don't understand how fieldpairs works, is it some compiler magic? how does it write to the value of the struct without the value being a ref type?
22:26:50FromDiscord<sOkam!> ok. lets say i want to offset a pointer by some `N` value in nim↵is that possible?
22:27:39FromDiscord<!Patitotective> Is `@['a', 'b', 'c'].join` the best way to join a seq of chars to make a stirng?
22:27:53FromDiscord<Dale> I think so
22:28:36FromDiscord<creikey> I wish jsony let you skip fields for dumphook
22:28:42FromDiscord<creikey> like fields of objects
22:28:55FromDiscord<creikey> In reply to @Patitotective "Is `@['a', 'b', 'c'].join`": no, doesn't this allocate a new string?
22:29:06FromDiscord<creikey> if it's a sequence you can append a null terminator then cast to string I think
22:29:17FromDiscord<creikey> subtract one from the length after doing that
22:29:19FromDiscord<creikey> I think
22:31:36FromDiscord<!Patitotective> do you guys think making a PR to add the rotations algorithm to std/algorithm is worth? 🤔
22:31:52FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44Rr
22:32:36FromDiscord<# Luke> Sure ig they might come in handy to someone
22:33:14FromDiscord<Elegantbeef> Aslong as it's efficiently written
22:33:21FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44Rs
22:33:40FromDiscord<NiChrosia> cast[pointer](cast[int](ptrToData) + offset))
22:33:47FromDiscord<NiChrosia> at the very least
22:33:54FromDiscord<NiChrosia> not sure if there's special functions for pointer math
22:34:29FromDiscord<Elegantbeef> `cast[ptr UncheckedArray[T]](myPtr)[-1]` if it's a collection you want to offset a collection
22:34:46FromDiscord<Elegantbeef> There isnt pointer arithmetic built into Nim there are libraries for it
22:35:09FromDiscord<sOkam!> In reply to @Elegantbeef "`cast[ptr UncheckedArray[T]](myPtr)[-1]` if it's": wdym by collection?
22:35:17FromDiscord<NiChrosia> (edit) "cast[pointer](cast[int](ptrToData)" => "`cast[pointer](cast[int](ptrToData)" | "offset))" => "offset))`"
22:35:21FromDiscord<sOkam!> isn't a pointer just an int? not sure i follow
22:35:27FromDiscord<Elegantbeef> Heap allocated array that you hold a pointer to
22:35:40FromDiscord<Elegantbeef> the example is just `cast[int](myAddr) - 1`
22:35:44FromDiscord<sOkam!> there is nothing storying anything
22:35:50FromDiscord<sOkam!> its just types definitions so far
22:36:15FromDiscord<sOkam!> one of the type definitions is a pointer to some other type, but offset by -1
22:36:26FromDiscord<sOkam!> (edit) "one of the type definitions is a pointer to some other ... type," added "pointer"
22:36:28FromDiscord<Elegantbeef> That's not at type definition
22:36:41FromDiscord<sOkam!> well, that's what the C code is doing tho 😔
22:36:44FromDiscord<!Patitotective> no way they already existed https://nim-lang.org/docs/algorithm.html#rotateLeft%2CopenArray%5BT%5D%2Cint
22:36:44FromDiscord<Elegantbeef> That's a static pointer proc
22:36:54FromDiscord<sOkam!> ah tru
22:37:17FromDiscord<!Patitotective> but it's weird there is no `permutations` or `rotations` just left/right
22:37:32FromDiscord<Elegantbeef> There are permuations
22:37:46FromDiscord<Elegantbeef> https://nim-lang.org/docs/algorithm.html#nextPermutation%2CopenArray%5BT%5D
22:38:24FromDiscord<!Patitotective> In reply to @Elegantbeef "There are permuations": yes but only `nextPermutation` not a `permutations` procedure that returns all the permutations
22:38:52FromDiscord<Elegantbeef> Cause `collect` and `toSeq` exists
22:39:18FromDiscord<!Patitotective> 🤨
22:39:24FromDiscord<!Patitotective> can you show an example
22:39:27FromDiscord<Elegantbeef> Also> If you start with an unsorted array/seq, the repeated permutations will not give you all permutations but stop with the last.
22:40:27FromDiscord<Elegantbeef> I might be wrong though
22:40:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44Rt
22:40:57FromDiscord<Prestige> Elegantbeef maybe I should take a stab at fixing the issue you had a solution for
22:41:06FromDiscord<Prestige> Which will probably mostly consist of bugging Araq
22:41:19FromDiscord<Prestige> This https://github.com/nim-lang/Nim/issues/19371
22:41:28FromDiscord<Elegantbeef> I mean the issue is just down to multiple steps of nimsuggest
22:42:03FromDiscord<Prestige> I just have 0 knowledge of it, but I'm down to learn at this point
22:42:13FromDiscord<Prestige> tired of having to disable nimsuggest
22:42:33FromDiscord<Elegantbeef> Well have fun he explained how to find where
22:42:44FromDiscord<Elegantbeef> But i looked found where and didnt get how to solve it
22:44:36FromDiscord<!Patitotective> is there a table to seq of tuples proc?
22:45:01FromDiscord<Elegantbeef> `myTable.pairs.toSeq`
22:47:15FromDiscord<creikey> wonder why this is true https://media.discordapp.net/attachments/371759389889003532/999085037645467738/unknown.png
22:47:19FromDiscord<creikey> wait
22:47:22FromDiscord<creikey> field loops are probably just unrolled
22:47:25FromDiscord<creikey> that's what it said
22:47:29FromDiscord<Elegantbeef> "probably" 😄
22:47:41FromDiscord<creikey> In reply to @Elegantbeef ""probably" 😄": I could be being trolled by the docs you neve rknow
22:47:43FromDiscord<creikey> (edit) "neve rknow" => "never know"
22:48:04FromDiscord<Elegantbeef> You just do thing with a `when` instead
22:48:19FromDiscord<Elegantbeef> how do you have a for loop that is heterogenous?
22:48:46FromDiscord<demotomohiro> sent a long message, see http://ix.io/44Rv
22:52:05FromDiscord<creikey> trying to add skiphook to jsony right now
22:52:10FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/999086271710363738/unknown.png
22:52:10FromDiscord<creikey> like this
22:52:28FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44Rw
22:52:42FromDiscord<creikey> want skipField to not be in the serialized json
22:52:47FromDiscord<creikey> skip over the work of serializing it
22:52:57FromDiscord<Elegantbeef> Just make your own json hook
22:53:01FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=44Rx
22:53:10FromDiscord<creikey> In reply to @Elegantbeef "Just make your own": for dumping the whole object?
22:53:42FromDiscord<Elegantbeef> Yes
22:54:09FromDiscord<creikey> like this https://media.discordapp.net/attachments/371759389889003532/999086769830121543/unknown.png
22:54:13FromDiscord<creikey> you're so right honestly
22:54:18FromDiscord<creikey> this is not that much code
22:54:36FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44Rz
22:55:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44RB
22:56:08FromDiscord<huantian> well dumphook of the field wont' give you the eky
22:56:12FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=44RC
22:56:13FromDiscord<Elegantbeef> It made a static pointer proc so make that `var sysCall = proc(syscalPtr: pointer) =...`↵(@sOkam!)
22:56:14FromDiscord<huantian> it's just the field value
22:56:27FromDiscord<Elegantbeef> I've never used jsony
22:56:31FromDiscord<Elegantbeef> So give me a break
22:56:43FromDiscord<creikey> I think to do it you need to copy paste the object dumphook
22:57:00FromDiscord<Elegantbeef> I much prefer the stdlib json hooks
22:57:17FromDiscord<Elegantbeef> but yes they're slower
22:57:58FromDiscord<huantian> In reply to @creikey "like this": but yeah your skipHook should be a compile time proc and you should use `when not...` instead of `if not...`
22:58:24FromDiscord<Elegantbeef> Wait jsony supports skiphooks already?
22:58:27FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44RE
22:58:31FromDiscord<creikey> In reply to @Elegantbeef "Wait jsony supports skiphooks": no I added that
22:58:34FromDiscord<creikey> but it doesn't seem to be working
22:58:36FromDiscord<Elegantbeef> Nim doesnt have a `...` operator
22:58:44FromDiscord<huantian> I'm using ... to mean the rest of the line lol
22:58:54FromDiscord<creikey> because the skiphook isn't called because the type isn't the type i define the skiphook on it's just `object`
22:59:01FromDiscord<sOkam!> ok, didn't know. so it means that thing?
23:03:18FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44RH
23:10:44FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44RL
23:14:08FromDiscord<!Patitotective> ~~futhark~~
23:14:20FromDiscord<sOkam!> its a dll interface
23:14:25FromDiscord<sOkam!> else i would
23:19:19FromDiscord<sOkam!> In reply to @sOkam! "Code that its giving": @mratsim I discovered that the pointer needs to be offset by -1↵Any clue? About this? 🤔
23:21:45FromDiscord<Elegantbeef> Ah yes the most specific version is used↵(@creikey)
23:22:10FromDiscord<creikey> https://github.com/treeform/jsony/issues/50 made an issue for it
23:24:24FromDiscord<Elegantbeef> Personally i'd go for a `template jsonySkip{.pragma.}` so you can just do `conn {.jsonySkip.}: WebSocket`
23:24:53FromDiscord<Elegantbeef> I'd also say a `template jsonyName(name: string){.pragma.}` would be nice
23:24:54FromDiscord<Elegantbeef> So you can give custom names
23:24:55FromDiscord<Elegantbeef> Without a user defined hook
23:25:33FromDiscord<huantian> plus one on the pragmas
23:26:06FromDiscord<Elegantbeef> It's a bit odd serialisation libraries dont use pragmas more
23:26:51FromDiscord<Elegantbeef> You can do so manything in a less redundant way
23:29:48FromDiscord<Elegantbeef> The `newHook` could be just a `{.jsonDefault:someVal.}` for the most part
23:30:18FromDiscord<huantian> also this is one way to do per-field serialization
23:30:19FromDiscord<Elegantbeef> Rename hook would just be the `jsonName`
23:30:24FromDiscord<creikey> I'm not sure I understand
23:30:30FromDiscord<creikey> In reply to @Elegantbeef "Personally i'd go for": this
23:30:37FromDiscord<creikey> how do you see if a field has that tempalte
23:30:38FromDiscord<Elegantbeef> Use pragmas to replace hooks cause hooks are tedious
23:30:39FromDiscord<creikey> (edit) "tempalte" => "template"
23:30:43FromDiscord<Elegantbeef> It doesnt
23:30:59FromDiscord<Elegantbeef> Nim allows you to make template pragmas and you can then access them with macros
23:31:07FromDiscord<creikey> well like adding that jsonySkip pragma doesn't change jsony behavior right
23:31:08FromDiscord<Elegantbeef> They're basically markers
23:31:17FromDiscord<Elegantbeef> No but it should is what i'm saying
23:31:19FromDiscord<creikey> you need to check for it in the fieldpairs loop over its fields
23:31:24FromDiscord<creikey> yeah how do you check for it
23:31:35FromDiscord<creikey> `when field.has(jsonySkip)`
23:31:37FromDiscord<creikey> this is what I mean
23:32:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44RQ
23:32:13FromDiscord<creikey> that's pretty good
23:32:27FromDiscord<Elegantbeef> you can also do `getCustomPragmaVal`
23:33:15FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=44tI it's not for json but this is an example i wrote the otherday for dale
23:33:29FromDiscord<Elegantbeef> Suffice to say you can do alot with pragmas
23:33:39FromDiscord<creikey> pretty cool code
23:37:36FromDiscord<Elegantbeef> I might miss the point of the `newHook` and the `postHook` of jsony, but to me it seems those can be just done inside the `parseHook`
23:38:30FromDiscord<huantian> mm sometimes for postHook you can say process your data to get rid of stuff you dont' want
23:39:44FromDiscord<Elegantbeef> Doesnt a parseHook already do that?
23:40:36FromDiscord<sharpcdf> should my search proc print every repo that has the term in the name or ever repo thats name == the term
23:40:44FromDiscord<sharpcdf> `jtr search term`
23:40:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=44RS
23:41:08FromDiscord<sharpcdf> (edit) "ever" => "every"
23:41:14FromDiscord<Elegantbeef> Depends on how useful you want the search↵(@sharpcdf)
23:41:25FromDiscord<Elegantbeef> Exact matches suck
23:41:28FromDiscord<sharpcdf> In reply to @Elegantbeef "Depends on how useful": max usefulness??
23:41:31FromDiscord<sharpcdf> ah ok
23:41:41FromDiscord<creikey> can `FieldDefect` be caught?
23:41:47FromDiscord<Elegantbeef> Why are you even searching and not just using the github api
23:41:55FromDiscord<sharpcdf> In reply to @Elegantbeef "Why are you even": i am using the api
23:41:58FromDiscord<sharpcdf> to search
23:42:00FromDiscord<Elegantbeef> It's a defect it's not meant to be but you can if you have `--panics:off`↵(@creikey)
23:42:03*qwr joined #nim
23:42:15FromDiscord<creikey> In reply to @Elegantbeef "It's a defect it's": does the nim playground have this by default?
23:42:20FromDiscord<Elegantbeef> No
23:42:32FromDiscord<sharpcdf> In reply to @Elegantbeef "Why are you even": but the thing is i plan on searching through 4 different sources so if it isnt an exact match than its gonna print a shit ton of repos
23:42:37FromDiscord<creikey> In reply to @Elegantbeef "No": https://play.nim-lang.org/#ix=44RT
23:43:09FromDiscord<Elegantbeef> defects can be caught in debug
23:43:20FromDiscord<sOkam!> Can a type be restricted to only being a pointer?
23:43:36FromDiscord<sOkam!> (edit) "pointer?" => "pointer of that type?"
23:43:59FromDiscord<sOkam!> or is that done during assignment only?
23:44:07FromDiscord<Elegantbeef> What?
23:44:19FromDiscord<Elegantbeef> `ptr T` is a pointer of T
23:44:38qwrthere seems to be something fishy with ARC when passing lambdas around, i've got in few days another case where it breaks down, but trying to simplify the test-cases is hard, in both cases the bug tends to disappear with simpler code...
23:44:39FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=44RV
23:44:43FromDiscord<sOkam!> not a function, a pointer function
23:45:02FromDiscord<Elegantbeef> Just assign a proc to a variable
23:45:31FromDiscord<Elegantbeef> Creikey the proper way to do what you're doing is check the `kind` of the json node and if it's not a bool raise an exception then handle that
23:45:56FromDiscord<Elegantbeef> Qwr are your lambdas capturing complex objects?
23:46:13qwrnot really complex, just local variables
23:46:14FromDiscord<Elegantbeef> I dont even know what you're considering a lambda
23:46:21FromDiscord<Elegantbeef> So it's a closure
23:46:24qwryes
23:46:36qwrwhy would i use lambda without closure? :)
23:46:41FromDiscord<Elegantbeef> How does it break
23:46:59FromDiscord<Elegantbeef> I might be wrong but anonymous procedures can also be called 'lambdas'
23:47:07qwrthe variables tend to get replaced with default value
23:47:18qwrlike empty string
23:47:39FromDiscord<Elegantbeef> Can i see the scope the closure is declared in?
23:50:24FromDiscord<Elegantbeef> So Google's making a C++ successor that's curly braced Nim 😄
23:50:33FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/999100965028368434/image.png
23:51:44*duuude quit (Ping timeout: 272 seconds)
23:51:51FromDiscord<Prestige> What language is that
23:51:59FromDiscord<Elegantbeef> Google's experimental carbon
23:52:10FromDiscord<Prestige> really does look similar
23:52:28FromDiscord<Elegantbeef> It's google so it's going to die in a year or two probably
23:53:02FromDiscord<Elegantbeef> It's supposedly backwards compatible with C++ code bases
23:53:26FromDiscord<Prestige> Idk why anyone bothers with c++ tbh
23:53:28FromDiscord<Elegantbeef> But yea it's pretty much a Rust and Nim baby with 'seamless' C++ interop
23:53:49FromDiscord<Elegantbeef> Cause they have codebases in C++ and it's easier to make a compatible language than convert their code to something saner
23:54:20FromDiscord<Elegantbeef> > Unfortunately, the designs of these languages present significant barriers to adoption and migration from C++.
23:54:33qwrhttps://paste.debian.net/1247758/
23:54:41FromDiscord<Elegantbeef> The biggest issue with all new system languages is that it's not easy to use C++ code
23:54:43FromDiscord<Elegantbeef> I mean D and Nim are the only two "major" languages that can interop with C++
23:54:43qwrhere is the code with testcase
23:55:39FromDiscord<Elegantbeef> Google has a massive NIH complex so it had to make their own variant
23:55:55qwrand it actually wasn't even default value, as it writes into file "\0\0\0" - i didn't notice it from console log
23:56:08FromDiscord<Elegantbeef> I think i can guess the issue
23:56:15FromDiscord<Elegantbeef> you dont use `capture` or `closureScope`
23:57:26FromDiscord<Elegantbeef> Due to how iterators work you need to use `capture` or `closureScope` to capture iterator variables
23:57:45qwrdoes it needs to be done by hand, and i don't get any error/warning? it works with mm:refc ?
23:59:00FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=44RX
23:59:25FromDiscord<Elegantbeef> Here's an example