<< 01-02-2022 >>

00:05:09FromDiscord<Patitotective> In reply to @Elegantbeef "For system notifications linux": I was able to create an app image, I guess I'm going to use app images instead
00:05:22FromDiscord<Patitotective> In reply to @Patitotective "How con I convert": I was able to create an app image, I guess I'm going to use app images instead
00:25:12*noeontheend joined #nim
00:26:21*jmdaemon quit (Ping timeout: 268 seconds)
00:33:26*jmdaemon joined #nim
01:02:48*krux02 quit (Ping timeout: 250 seconds)
01:15:06*l1x quit (Quit: Connection closed for inactivity)
01:17:03*kayabaNerve quit (Remote host closed the connection)
01:17:23*kayabaNerve joined #nim
01:18:54*krux02 joined #nim
01:20:00*xet7 quit (Ping timeout: 268 seconds)
01:22:09*xet7 joined #nim
01:30:00*jmdaemon quit (Ping timeout: 256 seconds)
01:34:35*jmdaemon joined #nim
01:43:50FromDiscord<Patitotective> I created this template for creating app images from a nim package 🙃 ↵what do you think? https://github.com/Patitotective/nim-appimage-template
01:56:25*noeontheend quit (Ping timeout: 256 seconds)
02:00:47FromDiscord<iffy (Matt Haggard)> Thank you! That worked perfectly.
02:02:08FromDiscord<Elegantbeef> No problem
02:17:58*neurocyte0917090 quit (Ping timeout: 268 seconds)
02:28:27*jmdaemon quit (Ping timeout: 268 seconds)
02:38:03*jmdaemon joined #nim
02:54:36*cyraxjoe quit (Ping timeout: 250 seconds)
03:04:18*arkurious quit (Quit: Leaving)
03:06:13*cyraxjoe joined #nim
03:15:45*cyraxjoe quit (Ping timeout: 256 seconds)
03:34:20FromDiscord<gnu+linux user> https://media.discordapp.net/attachments/371759389889003532/937913734502973450/Screenshot_2022-02-01-09-00-06-034_mark.via.gp.jpg
03:34:53FromDiscord<Rika> ?
03:35:37FromDiscord<gnu+linux user> 0..max is violet
03:36:07FromDiscord<Rika> Ah the highlighting is wrong lol one hell of a catch
03:39:33*jmdaemon quit (Ping timeout: 256 seconds)
03:47:42*arkanoid quit (Read error: Connection reset by peer)
03:53:30*arkanoid joined #nim
03:56:33*rienske quit (Ping timeout: 256 seconds)
03:57:40*Gustavo6046 joined #nim
03:57:57*cyraxjoe joined #nim
03:59:00*arkanoid quit (Read error: Connection reset by peer)
03:59:28*jmdaemon joined #nim
04:05:47*arkanoid joined #nim
04:19:04FromDiscord<Arathanis> anyone know what the deal with this is? https://media.discordapp.net/attachments/371759389889003532/937924989506695218/unknown.png
04:19:32FromDiscord<Elegantbeef> The hash wasnt stored in the binary when built
04:20:11FromDiscord<Rika> It’s not to worry about
04:20:17FromDiscord<Arathanis> ah, so it will just mention that forever? but is otherwise just cosmetically annoying instead of functionally annoying
04:20:19FromDiscord<Arathanis> (edit) "annoying" => "bad"
04:20:28FromDiscord<Arathanis> good to know
04:22:29FromDiscord<Arathanis> thank you
04:42:34*rockcavera quit (Remote host closed the connection)
05:10:35*Gustavo6046 quit (Read error: Connection reset by peer)
05:34:57*Gustavo6046 joined #nim
06:20:59*krux02 quit (Remote host closed the connection)
06:21:33*cyraxjoe quit (Ping timeout: 268 seconds)
06:21:33*MightyJoe joined #nim
06:25:52*Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.)
06:32:39*Ekho joined #nim
06:32:59FromDiscord<haolian9 (高浩亮)> sent a code paste, see https://play.nim-lang.org/#ix=3Of0
06:35:25FromDiscord<Elegantbeef> It's due to how the let is expanded
06:35:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Of1
06:36:24FromDiscord<Elegantbeef> Due to being at main scope
06:37:11FromDiscord<Rika> should it be like that?
06:38:19FromDiscord<Elegantbeef> Probably not
06:39:14FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Iny
06:39:45FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/tG8
06:40:20FromDiscord<Elegantbeef> Personally i'd argue for `let x, y =` it should only be allowed for static expressions
06:40:58FromDiscord<Elegantbeef> There is just no empirical right answer 😀
06:41:32FromDiscord<Elegantbeef> Trying use async and oh boy am I falling flat
06:41:44FromDiscord<Elegantbeef> How the fuck can i read data from a socket without freezing my god damn main loop
06:43:30FromDiscord<Rika> can i see
06:43:39FromDiscord<Rika> i can prolly try helping
06:43:55NimEventerNew thread by Haoliang: A question about block used in assignment, see https://forum.nim-lang.org/t/8857
06:46:37FromDiscord<haolian9 (高浩亮)> i was post this question on forum first, but my account was moderated, and i did not how long would it take, so i post it here again, sorry for the duplication
06:46:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Of6
06:46:57FromDiscord<Elegantbeef> The latter needs to be async but i cannot call it without freezing my game's update loop
06:47:08FromDiscord<Elegantbeef> Yea no problem, for a second thought you ignored me
06:47:15FromDiscord<Rika> test
06:47:19FromDiscord<Rika> okay im alive
06:47:31FromDiscord<Rika> is your game loop async too
06:47:36FromDiscord<Elegantbeef> No
06:47:58FromDiscord<Rika> what kinda freezing do you mean? as in freezing until the thing completes?
06:48:01FromDiscord<Rika> do you use poll()?
06:48:23FromDiscord<Rika> do you call the thing within your non-async game loop somehow
06:48:59FromDiscord<Elegantbeef> Yes
06:49:07FromDiscord<Elegantbeef> So it's just going to be a thread day methinks
06:49:26FromDiscord<Rika> well
06:49:49FromDiscord<Rika> cant you make your game loop async
06:50:28FromDiscord<Elegantbeef> If i make the game loop async afaik can it not run the procedure multiple times in a single frame?
06:50:35FromDiscord<Rika> you can run it many times
06:50:38FromDiscord<Rika> just dont await it
06:50:56FromDiscord<Rika> you do more of smth like `await all @[future1, future2, future3]`
06:51:09FromDiscord<Rika> or if you have a `futures` seq
06:51:12FromDiscord<Rika> it reads really nicely
06:51:15FromDiscord<Rika> `await all futures`
06:52:07FromDiscord<Rika> basically this is how i think of it
06:52:15FromDiscord<Rika> a future can be a "thread" kinda i guess
06:52:53FromDiscord<Elegantbeef> Ehh, i guess i just need to read from a socket so async isnt needed
06:53:12FromDiscord<Elegantbeef> Thought it'd be the cool way but seems like it's just over complicating it
06:53:51FromDiscord<Hamid_Bluri> sent a code paste, see https://paste.rs/98u
06:54:29FromDiscord<Elegantbeef> Try to write that type def out 😛
06:54:37FromDiscord<Hamid_Bluri> how
06:55:11FromDiscord<Elegantbeef> You fill in the rest
06:55:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Ofe
06:55:28FromDiscord<Rika> ~~Option[]~~
06:55:42FromDiscord<Elegantbeef> That doesnt even solve the issue
06:55:48FromDiscord<Elegantbeef> It's a recursive type def
06:55:57FromDiscord<Rika> actually hmm yeah
06:56:43FromDiscord<Rika> brain really thinks differently once you know formal languages damn @_@\
06:57:08FromDiscord<Hamid_Bluri> thanks beef, I think I got the point
06:57:32FromDiscord<Elegantbeef> Hopefully my joke educational response was more educational than offensive 😜
06:58:12FromDiscord<Rika> im offended
06:58:17FromDiscord<Elegantbeef> Good
06:58:23FromDiscord<Hamid_Bluri> lol
06:58:30FromDiscord<Rika> how could you say async is overcomplicated
06:58:32FromDiscord<Rika> i cant believe it
06:58:34FromDiscord<Rika> im so mad
06:58:41FromDiscord<Elegantbeef> I mean it's overcomplicated for this issue
06:58:48FromDiscord<Elegantbeef> I just thought i'd try it but it doesnt fit here
07:00:24*PMunch joined #nim
07:04:36FromDiscord<narimiran> there is 1.6.4 RC2 available, please give it a try: https://forum.nim-lang.org/t/8839#57814
07:06:23FromDiscord<haolian9 (高浩亮)> a late thanks; i was thought so too, but i did not found a word about this in official docs
07:14:14FromDiscord<Michal Maršálek> How can I make a proc, template or a macro inside my template a gensymed symbol rather than injected symbol?
07:14:39FromDiscord<Elegantbeef> `proc doThing {.gensym}`
07:20:43FromDiscord<Michal Maršálek> Thanks, I was trying that pragma, but I was putting it at a wrong place
07:34:00FromDiscord<rishavs (Rishav Sharan)> sent a code paste, see https://paste.rs/9Mj
07:36:03FromDiscord<Elegantbeef> You're going to need something like a json node since that's not homogenous
07:37:42PMunchOr your own object with a kind field
07:38:30FromDiscord<Elegantbeef> "Something like" 😛
07:38:31PMunchI mean this seems to be the same kind of object so you'd only need a kind with two states, sequence of T or T
07:38:41FromDiscord<Rika> That is indeed something like a JSON node type
07:39:04PMunchYeah I'm not saying that JSON wouldn't work for this
07:39:33PMunchI was just saying that you don't necessarilly need to use JSON for it
07:39:47FromDiscord<Elegantbeef> No one said you had to 🙂
07:40:13FromDiscord<Elegantbeef> I'm getting mad at this socket faff so pedantry is my break from disapointment
07:40:57FromDiscord<rishavs (Rishav Sharan)> sent a code paste, see https://paste.rs/QiA
07:42:11PMunch@Elegantbeef, socket faff?
07:42:13FromDiscord<Rika> think so, yeah
07:42:34FromDiscord<Elegantbeef> Working on making my level editor using a socket for ipc
07:42:44PMunchWhat is that `se/q` syntax?
07:42:56PMunchAha.. Why?
07:43:08FromDiscord<Rika> wait there's a /?
07:43:11FromDiscord<Rika> i dont see any
07:43:18PMunchHuh?
07:43:19FromDiscord<Rika> i just see `se<span class="string">q` lmfao thanks bridge
07:43:29PMunchNo that's what I see as well
07:43:42PMunchI was wondering what kind of syntax all of that was
07:43:45FromDiscord<Elegantbeef> Cause I didnt want to spend a lot of time making UI for my editor 😀
07:45:21PMunchOh wait, their syntax is all kinds of messed up from the bridge :P
07:45:25FromDiscord<Rika> pm
07:45:26FromDiscord<Rika> idk why
07:45:55FromDiscord<Elegantbeef> Turns out my one issue was i accidently sent the data twice
07:45:56PMunch@Elegantbeef, but what is the ipc going to connect to?
07:46:04FromDiscord<Elegantbeef> My game client?
07:46:25FromDiscord<Elegantbeef> https://streamable.com/46dxh5
07:46:31FromDiscord<Elegantbeef> There is a shitty first prototype
07:46:32PMunchI don't think i understand what you're doing :P
07:47:07PMunchAnd rishavs_(Rishav_Sharan) your message through the bridge looked like this: https://paste.rs/QiA and the first one like this https://paste.rs/9Mj which is why we've been a bit confused
07:47:07FromDiscord<Rika> me neither
07:47:19FromDiscord<Elegantbeef> The video should clear it up
07:47:27FromDiscord<Rika> it doesnt
07:47:27FromDiscord<Rika> lol
07:47:33FromDiscord<Rika> i still have no idea whats happening
07:47:36NimEventerNew post on r/nim by mavavilj: Is it reasonable to attempt to utilize JVM from Nim using e.g. jnim?, see https://reddit.com/r/nim/comments/shpfs1/is_it_reasonable_to_attempt_to_utilize_jvm_from/
07:47:38PMunchrishavs_(Rishav_Sharan), and have a look at https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants if you want to do variants properly
07:47:53FromDiscord<Elegantbeef> I have a level editor that can connect to my game and feed the level i'm creating into the game so i can test it while making it
07:48:23FromDiscord<Elegantbeef> So I get a usable UI without having to make one and can inspect tiles intuitively instead of annoyingly
07:48:34PMunchAha, so instead of creating a UI just reusing all your assets you want to have all the same functionality bit work blindly? :P
07:48:45PMunchOr are you planning on embedding the game in that gray window?
07:49:05FromDiscord<Elegantbeef> The gray window will render the sprites of the tiles yes
07:49:39PMunchRight..
07:49:41FromDiscord<Elegantbeef> I havent got around to automating the rendering of those yet though
07:50:03FromDiscord<Elegantbeef> The editor will work independently of the game, this is just to make my life easier
07:50:29FromDiscord<pmunch> [rishavs (Rishav Sharan)](https://matrix.to/#/@rishavs-58046952d73408ce4f2ebf0c:gitter.im)\: see my past couple messages, apparently tagging doesn't work over the bridge either..
07:56:42FromDiscord<rishavs (Rishav Sharan)> o.0↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
07:57:19FromDiscord<Elegantbeef> gitter.im really likes adding html styling to messages
07:57:33FromDiscord<rishavs (Rishav Sharan)> Thanks @\_discord\_392962235737047041\:t2bot.io , gonna read up on the link you shared. btw there is a discord server for nim?
07:57:39FromDiscord<Rika> yes
07:57:44FromDiscord<Rika> the invite is nim afaik
07:57:49FromDiscord<Rika> if not then its prolly nimlang
07:57:54FromDiscord<Elegantbeef> Move to matrix if you want to use the same protocol but not suffer 😀
07:58:09FromDiscord<Rika> i mean depends on you really
07:58:19FromDiscord<Rika> if you use mainly discord stuff then discord, if you dont then matrix
07:58:36FromDiscord<Rika> i cant imagine moving to matrix since theres a tonne of discord communities i am pretty much integral to already
07:58:40FromDiscord<Elegantbeef> Well if you're using gitter and dont want to move to a different protocol just chat client
07:59:02FromDiscord<Rika> for all we know he could be a discord user that thought there wasnt a server, dunno
07:59:16PMunchOr join me here on the dark side with IRC
07:59:37FromDiscord<Elegantbeef> It's 2022 IRC has been dead for 30 years 😛
07:59:58PMunchNever! There are dozens of us IRC users, dozens!
08:01:35*Vladar joined #nim
08:02:01FromDiscord<Elegantbeef> And pmunch just to be certain nimlsp doesnt need anything special to report diagnostics right?
08:06:36*neurocyte0917090 joined #nim
08:08:44PMunchWhat do you mean?
08:09:09FromDiscord<Elegantbeef> Just making sure i dont need any special flags or anything to diagnostics
08:10:30PMunchNope
08:10:48FromDiscord<Elegantbeef> Ok so i guess tomorrow i should debug why Kate doesnt get them
08:16:00PMunchWhat do you mean by diagnostics?
08:16:45FromDiscord<Elegantbeef> Syntax/compilation errors
08:33:07PMunchAh, that should happen on saves automatically I believe
08:34:25FromDiscord<Elegantbeef> Hmm it's not so I guess something's not getting the memo
08:35:11PMunchYou can make a debug build and read the logs
08:50:36*jjido joined #nim
09:12:22NimEventerNew thread by Miran: This Month with Nim: February, see https://forum.nim-lang.org/t/8858
09:19:49PMunchWait, surely that should be "This month with Nim: January"
09:20:14FromDiscord<Elegantbeef> Yea
09:20:18FromDiscord<Elegantbeef> I dun goofed
09:20:45FromDiscord<Elegantbeef> miiiiiiran where art thou!
09:21:23FromDiscord<Elegantbeef> narimiran narimiran narimiran, it's like beetlejuice right?
09:23:32FromDiscord<lantos> maybe say something that is upsetting?
09:23:41FromDiscord<lantos> proof of stake is a scam?
09:23:56FromDiscord<Elegantbeef> NFTs are beanie babies for idiots
09:24:05FromDiscord<lantos> ahahaha
09:24:55*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:27:10*jjido joined #nim
09:37:48FromDiscord<narimiran> In reply to @Elegantbeef "narimiran narimiran narimiran,": ok ok, we'll change it 🙂
09:39:16FromDiscord<narimiran> here you go 🙂
09:39:50FromDiscord<Elegantbeef> Hey last yea you fubbed with the year and this year i fubbed with the month
09:40:03FromDiscord<Elegantbeef> Next year i'll fubb with language
09:40:23FromDiscord<Elegantbeef> I'll collect Rust/Zig/Odin libraries/tools
09:40:29FromDiscord<narimiran> you also misspelled your branch name 😉
09:40:49FromDiscord<narimiran> i was stumped why i cannot push to `tmwn` like i usually can
09:41:29FromDiscord<narimiran> but after some git-cursing, a careful read solved that one 🙂
09:42:00FromDiscord<Elegantbeef> Ah whoops pushed to the wrong repo when i rebased 😀
09:42:00FromDiscord<planetis> thanks this helped me find the reason, it was strutils.% causing it
09:42:12FromDiscord<Elegantbeef> No problem
09:42:28FromDiscord<Elegantbeef> Also planetis want a working implementation of that versioned stuff to grok? 😛
09:42:38FromDiscord<planetis> sure
09:43:15FromDiscord<Elegantbeef> It assumes a lot right now but it's a base
09:43:16FromDiscord<Elegantbeef> v
09:43:18FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Oga
09:43:27FromDiscord<Elegantbeef> Yes i hit v instead of ctrl+v and hit enter
09:43:55FromDiscord<planetis> nice
09:44:08PMunchI really should submit Futhark to one of these monthlies..
09:44:43FromDiscord<Elegantbeef> I'll bug you for feburaries
09:45:13FromDiscord<Elegantbeef> Jesus it's February's
09:45:14FromDiscord<Elegantbeef> I'm not tired you are
09:45:23FromDiscord<planetis> so fieldPairs doesn't work with when?
09:45:34FromDiscord<Elegantbeef> It doesnt?
09:45:42FromDiscord<Elegantbeef> It should work
09:46:18FromDiscord<Elegantbeef> It works
09:46:37FromDiscord<planetis> oh I saw the macro and assumed you wrote it because fieldpairs didn't work
09:46:58FromDiscord<Elegantbeef> Which macro?
09:47:24FromDiscord<Elegantbeef> `migrateData`?
09:47:50PMunch@Elegantbeef, I've got another nice project coming up for February ;)
09:47:59FromDiscord<Phil> How did I express "only positive number" as a type again if I don't really want to specify an upper limit?
09:48:04FromDiscord<planetis> yes
09:48:12FromDiscord<Phil> I know I could use a range but that means myself stating "at most up to this number"
09:48:19FromDiscord<Elegantbeef> `a: Positive`
09:48:39FromDiscord<Phil> Thanks!
09:49:05FromDiscord<Elegantbeef> `migrateData` calls `migrate` until it gets to `MyType[Ver.High]`
09:49:11FromDiscord<Elegantbeef> This is how it works statically
09:49:34FromDiscord<Elegantbeef> That can be changed but the when statement was the simplest
09:50:23FromDiscord<Elegantbeef> so in the case of `ver00` `migrateData` is turned into `migrate(migrate(personData))`
09:50:57FromDiscord<planetis> yes I thought of having when outside the object declaration but then you will have too many duplicate versions for objects
09:51:02PMunchI mean Positive still has a limit, but probably one you won't find
09:51:42FromDiscord<Elegantbeef> Yea i mean you can do it eitherway, but doing when outside of the object declaration doesnt really allow you to have this easy system
09:51:49FromDiscord<Elegantbeef> Each type would be versioned by name instead i suppose
09:52:37FromDiscord<Elegantbeef> This was just the idea i had last night, might clean it up, but i dont know
09:53:25FromDiscord<Elegantbeef> I do really like the simplicity of how this versions
09:54:19FromDiscord<planetis> its nicely done
09:55:23FromDiscord<planetis> is it rellated to your fosdem talk?↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
10:10:57*Jjp137 quit (Ping timeout: 240 seconds)
10:11:57*ecs quit (Ping timeout: 240 seconds)
10:12:05*blackbeard420_ joined #nim
10:12:10*ecs joined #nim
10:12:17*GreaseMonkey quit (Ping timeout: 240 seconds)
10:12:34*tinystoat is now known as typoholic
10:12:37*blackbeard420 quit (Ping timeout: 240 seconds)
10:12:49*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:13:04*greaser|q joined #nim
10:21:54PMunchIs it just me or should this definition be rewritten: https://nim-lang.org/docs/os.html#walkDirRec.i%2Cstring
10:22:02*jjido joined #nim
10:22:28PMunchSays that it yields for each file or directory in `dir`, but I'm pretty sure it now only yields for files with the default `yieldFilter`
10:25:16FromDiscord<Elegantbeef> I concur
10:27:27FromDiscord<Rika> Do you
10:27:58FromDiscord<Phil> Wait positive does not include null I just realizd
10:28:00FromDiscord<Phil> (edit) "realizd" => "realized"
10:28:24FromDiscord<Elegantbeef> Numbers arent nilable
10:28:41FromDiscord<Phil> Sorry, my german slipped through, I meant null as in 0
10:28:44Amun-Raand if by null you mean 0 → Natural
10:29:23FromDiscord<Phil> Ahh check, thanks Amun, yeh that's what I was looking for
10:32:55*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:35:23FromDiscord<evoalg> I suspect beefy is technically right, because zero isn't a positive number, and so when you ask for positive only...
10:35:49FromDiscord<Rika> Lmao
10:35:57FromDiscord<Rika> Also god you actually did switch to matrix
10:36:15FromDiscord<Elegantbeef> evo defending me now, damn the cult of me has begun!
10:36:38FromDiscord<evoalg> and don't call me god, call beefy god instead↵(@Rika)
10:37:15FromDiscord<Rika> You’ll have to waterboard me to make me do that
10:39:33FromDiscord<Phil> I've played around with it, just not really a reason so far to stick with it
10:43:22*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
10:46:55*happycorsair[m] quit (Ping timeout: 250 seconds)
10:46:55*crem1 quit (Ping timeout: 250 seconds)
10:47:17*Yardanico_ joined #nim
10:47:21*Yardanico quit (Ping timeout: 250 seconds)
10:48:57*crem1 joined #nim
11:06:21*happycorsair[m] joined #nim
11:31:07*jjido joined #nim
11:33:36*xiamx quit (Quit: Bridge terminating on SIGTERM)
11:33:39*cheer[m] quit (Quit: Bridge terminating on SIGTERM)
11:33:40*nixfreaknim[m] quit (Quit: Bridge terminating on SIGTERM)
11:33:41*happycorsair[m] quit (Quit: Bridge terminating on SIGTERM)
11:41:57*cheer[m] joined #nim
11:42:42*typoholic is now known as tinystoat
11:45:19FromDiscord<dom96> In case anyone's interested: https://twitter.com/d0m96/status/1488478416546455555
11:45:23*happycorsair[m] joined #nim
11:45:39*xiamx joined #nim
11:45:41*nixfreaknim[m] joined #nim
11:47:42*xiamx quit (Remote host closed the connection)
11:47:42*cheer[m] quit (Read error: Connection reset by peer)
11:47:42*happycorsair[m] quit (Read error: Connection reset by peer)
11:47:43*nixfreaknim[m] quit (Remote host closed the connection)
11:50:16PMunchHmm, anyone know of a good place to get some free icons?
11:51:23*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:55:36FromDiscord<planetis> there are google material icons and bootstrap icons
11:55:59FromDiscord<BhamidipatiNikhil> In reply to @PMunch "Hmm, anyone know of": What kind of icons do you want??
11:56:10FromDiscord<enthus1ast> https://fontawesome.com/v5.15/icons?d=gallery&p=2
11:56:49FromDiscord<planetis> if you need colored icons then kde icons
11:57:03PMunchI need some icons for a website, basically just illustration stuff
11:57:15PMunchSorry, I should've been more specific
11:58:01FromDiscord<enthus1ast> then have a look at fontawesome for scientific icons there is another "community" fontawesome
11:58:36FromDiscord<enthus1ast> https://jpswalsh.github.io/academicons/
12:01:31FromDiscord<keks> Hi! I want to convert an array of float literals which has 64bit precision by default into a 32bit array at compile time. Does it mean I have to mess around with macros, or there is an easier approach?
12:01:37*cheer[m] joined #nim
12:02:43*cheer[m] quit (Remote host closed the connection)
12:03:00NimEventerNew thread by Neodim: Defer within async dispatch, see https://forum.nim-lang.org/t/8859
12:04:24FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Ohb
12:04:38FromDiscord<enthus1ast> since its a const, its on compile time
12:09:07*cheer[m] joined #nim
12:14:23FromDiscord<auxym> @PMunch https://www.svgrepo.com/
12:14:35*happycorsair[m] joined #nim
12:14:47*xiamx joined #nim
12:14:47*nixfreaknim[m] joined #nim
12:19:51FromDiscord<tandy> can a Nim object be cast to a JsObject?
12:21:25FromDiscord<tandy> yes with jsffi
12:22:03*Jjp137 joined #nim
12:22:47FromDiscord<keks> sent a code paste, see https://play.nim-lang.org/#ix=3Ohg
12:32:46FromDiscord<mratsim> In reply to @keks "Thanks, this looks much": use for loops
12:35:45FromDiscord<keks> In reply to @mratsim "use for loops": I want to do the conversion at compile time for small size vectors (length 3 or 4).
12:35:49*nixfreaknim[m] quit (Quit: Client limit exceeded: 20000)
12:36:40*cheer[m] quit (Quit: Client limit exceeded: 20000)
12:36:46*happycorsair[m] quit (Quit: Client limit exceeded: 20000)
12:40:50FromDiscord<elo88> can someone who work with winapi could suggest why this code https://play.nim-lang.org/#ix=3Ocv↵reports error 187? I writed same code in go and worked fine, what am i doing wrong?
12:40:59FromDiscord<Rika> You can use for loops on compile time
12:41:04*cheer[m] joined #nim
12:41:18*happycorsair[m] joined #nim
12:41:18*nixfreaknim[m] joined #nim
12:44:25FromDiscord<keks> In reply to @Rika "You can use for": I see, I need compile time function evaluation.
12:44:34*blackbeard420_ quit (Remote host closed the connection)
12:44:45*blackbeard420 joined #nim
12:47:15*xiamx quit (Quit: Client limit exceeded: 20000)
12:48:43FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Ohl
12:48:55*xiamx joined #nim
12:55:32PMunch@keks, you can do this: https://play.nim-lang.org/#ix=3Oho
12:58:18FromDiscord<keks> Thank you @mratsim @enthus1ast @PMunch! This is exactly what I wanted 🙂
12:58:23*rockcavera joined #nim
12:58:23*rockcavera quit (Changing host)
12:58:23*rockcavera joined #nim
13:01:47FromDiscord<Hamid_Bluri> In reply to @PMunch "Hmm, anyone know of": very icon
13:01:52FromDiscord<Hamid_Bluri> https://www.veryicon.com/
13:01:58FromDiscord<Hamid_Bluri> @PMunch
13:02:06PMunch@elo88, not familiar with WinAPI, but in line ten you're passing it a buffer of size 0, and tells it that it is size 0
13:02:23PMunchSo you won't have anywhere to put your base name
13:02:34PMunchNot sure if that is the issue or not though
13:06:05*Gustavo6046 quit (Ping timeout: 268 seconds)
13:16:15*jjido joined #nim
13:17:14FromDiscord<rishavs (Rishav Sharan)> What would be a good way to remove the first char from any string in-situ?↵I tried removePrefix, but it removes all occurrences of the argument character. For example, removePrefix removes `v` and `vvv` from `var` or `vvvvar`
13:18:03PMunchrishavs_(Rishav_Sharan), `if str.len > 0: str[1..^1] else: str`
13:21:46FromDiscord<rishavs (Rishav Sharan)> https://simpleicons.org/ has corporate icons as well↵(@Hamid_Bluri)
13:21:52FromDiscord<rishavs (Rishav Sharan)> Thanks!
13:43:20*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:57:46*jjido joined #nim
14:06:21*rockcavera quit (Remote host closed the connection)
14:09:28FromDiscord<Patitotective> sent a code paste, see https://paste.rs/1Qw
14:09:33FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3OhU" => "https://play.nim-lang.org/#ix=3OhV"
14:10:11FromDiscord<Rika> the regular way, use a flag
14:10:16FromDiscord<Rika> (edit) "the regular way, use a flag ... " added "variable"
14:10:56FromDiscord<Patitotective> In reply to @Rika "the regular way, use": what is that?
14:11:33FromDiscord<Rika> uh literally just a boolean that you set if you "break" and not if you "finish"
14:11:36FromDiscord<Rika> or vice versa
14:12:09FromDiscord<Patitotective> :/ok
14:17:42PMunchYou can also do this @Patitotective https://play.nim-lang.org/#ix=3OhY
14:18:03FromDiscord<Patitotective> In reply to @PMunch "You can also do": :o
14:18:05FromDiscord<Patitotective> Thanks 🙃
14:20:26PMunch(I like blocks)
14:21:55FromDiscord<Rika> oh yeah that works too, i forgot
14:22:04FromDiscord<Rika> i had it inverted in my brain and concluded it didnt work
14:22:20FromDiscord<Rika> tbf i thought about it for a split second only
14:24:17PMunchBlocks are great, such a versatile little thing :P
14:28:58FromDiscord<Patitotective> Which iterator is called when I do `for i in @[1, 2]`?
14:29:34FromDiscord<enthus1ast> should be `items`
14:30:09FromDiscord<Patitotective> Which https://nim-lang.org/docs/iterators.html#items.i%2Ccstring ?
14:30:16FromDiscord<Patitotective> 😕
14:30:31FromDiscord<Patitotective> this https://nim-lang.org/docs/iterators.html#items.i%2CopenArray%5BT%5D?
14:30:32FromDiscord<Patitotective> (edit) "https://nim-lang.org/docs/iterators.html#items.i%2CopenArray%5BT%5D?" => "https://nim-lang.org/docs/iterators.html#items.i%2CopenArray%5BT%5D ?"
14:30:52FromDiscord<Patitotective> or this https://nim-lang.org/docs/iterators.html#items.i%2Cseq%5BT%5D ?
14:33:57FromDiscord<Rika> seq, its the more specific one
14:33:58FromDiscord<Rika> i believe
14:35:09FromDiscord<Patitotective> 👍
14:40:58FromDiscord<Patitotective> What do you guys think on creating a PR for this feature https://play.nim-lang.org/#ix=3Oib ?
14:42:12FromDiscord<BhamidipatiNikhil> In reply to @Patitotective "What do you guys": But isn't there countup and countdown already there?
14:43:36FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Oig
14:44:16FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Oih
14:51:15*arkurious joined #nim
14:54:57*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:26:21FromDiscord<Patitotective> https://github.com/nim-lang/Nim/pull/19480 🙃
15:37:33FromDiscord<ajusa> In reply to @Patitotective "https://github.com/nim-lang/Nim/pull/19480 🙃": https://github.com/nim-lang/Nim/issues/2457#issuecomment-91880150
15:37:41FromDiscord<ajusa> maybe Araq's changed his view after 7 years, maybe not
15:44:27FromDiscord<haxscramper> In reply to @Patitotective "https://github.com/nim-lang/Nim/pull/19480 🙃": the naming, is kind of meh (commented on the PR in more details), but `ritems` and `rpairs` that I wrote for myself were really useful,
15:45:40FromDiscord<haxscramper> In reply to @ajusa "https://github.com/nim-lang/Nim/issues/2457#issueco": `items` covers "iterate strictly from left to right" + "iterate over whatever", and `ritems` extends the built-in set of operations to "iterate from right to left", so I bet in this case we would see similar response - the functionality extension is not especially big
15:45:55FromDiscord<konsumlamm> what would the mutable version be then? `mritems`?
15:46:05FromDiscord<ajusa> hey there mr. items
15:46:12FromDiscord<haxscramper> ir `rmitems`
15:46:20FromDiscord<haxscramper> yes, `sudo rm items`
15:47:05FromDiscord<haxscramper> `reversed` already exists in the `std/algorithm`, and returns a revesed copy
15:47:13FromDiscord<ajusa> I think a reversed iterator would look better
15:47:49FromDiscord<haxscramper> reversed/sorted and other. "ed" parts already imply the modified copy, IIRC that is even in the naming guide
15:48:03FromDiscord<haxscramper> also, they mirror `items` and `pairs`, so naming should reflect that as well
15:48:38FromDiscord<haxscramper> sent a long message, see http://ix.io/3OiV
15:49:01FromDiscord<konsumlamm> except `pairs` shouldn't really be used anymore
15:49:05FromDiscord<ajusa> I feel like dup should be used to implemented the copied versions though
15:49:11FromDiscord<haxscramper> In reply to @konsumlamm "except `pairs` shouldn't really": why?
15:49:21FromDiscord<konsumlamm> because we have `std/enumerate`
15:49:32FromDiscord<ajusa> isn't the whole point of `dup` that it converts an inplace algorithm to a copy?
15:49:37FromDiscord<konsumlamm> which doesn't require newly implementing it for everything
15:50:41FromDiscord<haxscramper> maybe `ritems` and `rpairs` can be a generic iterator
15:50:53FromDiscord<haxscramper> and `items` for that matter as well
15:52:08FromDiscord<haxscramper> well, whatever, not like I especially care about the naming here, so
15:52:44FromDiscord<Patitotective> In reply to @ajusa "https://github.com/nim-lang/Nim/issues/2457#issueco": what about `iterutils`?
15:52:47FromDiscord<haxscramper> I just find `pairs` for sequence a lot more useful than importing `enumerate` all over the place
15:53:11FromDiscord<haxscramper> but enumerate is more generic
15:54:57FromDiscord<Patitotective> In reply to @haxscramper "the naming, is kind": Yea, I prefer them, it sounds like right-to-left
16:03:20FromDiscord<Patitotective> I let `mritems` for now
16:03:47FromDiscord<Patitotective> (edit) "I let `mritems` for now ... " added "🧐"
16:04:45FromDiscord<IsaacPaul> I like nim as a language.. but it's very DIY which is good and bad I guess, but it leaves the language in limbo and pieces.
16:05:27FromDiscord<IsaacPaul> I guess this affords you the opportunity to recreate the leftpad incident lol. Just make a package reverseIterator then delete a few years later. lol
16:06:15FromDiscord<haxscramper> It should be easy to pull in random one-file packages in for that to work properly
16:06:32FromDiscord<Patitotective> there should be a _extra_ library for nim, like a nimble package made by the community with all these features
16:07:45FromDiscord<Rika> we tried
16:07:53FromDiscord<Rika> fusion could have been that
16:07:55FromDiscord<Rika> but it was mishandled
16:09:10FromDiscord<haxscramper> muffled curses
16:10:13nrds<Prestige99> Who was handling it?
16:10:50FromDiscord<haxscramper> That is the first question that anyone would need to ask, right
16:10:59FromDiscord<haxscramper> And the answer to it is - no idea
16:11:00FromDiscord<Rika> thats the thing
16:11:02FromDiscord<Rika> yeah
16:11:09FromDiscord<Rika> who the fuck was handling it
16:13:39FromDiscord<Patitotective> what about one of you handle it? 🙃
16:14:33FromDiscord<Rika> its dead now
16:16:06nrds<Prestige99> 🤔
16:16:23FromDiscord<haxscramper> In reply to @Patitotective "what about one of": Oh yeah I sort of tried to handle a part of fusion
16:16:23FromDiscord<Patitotective> In reply to @Rika "its dead now": isn't the code somwhere?
16:16:35FromDiscord<haxscramper> Aka "official pattern matching for nim"
16:16:51FromDiscord<demotomohiro> https://github.com/nim-lang/fusion
16:17:08FromDiscord<haxscramper> It is installable from nimble, no issues here
16:17:51FromDiscord<haxscramper> The package itself didn't disappear, just nobody even tags it properly, looks into issues or PRs and so on
16:18:54FromDiscord<ajusa> In reply to @haxscramper "*muffled curses*": Poor hax
16:19:04FromDiscord<haxscramper> but there are a few useful libraries, like binary trees, pattern matching, and couple others
16:19:30FromDiscord<haxscramper> so even if it is sort of neglected you can still depend on it via nimble etc.
16:19:58FromDiscord<Patitotective> "we" can start a new one (outside nim-lang), copy the working ones from fusion and add these features that get removed later (mritems)
16:19:59FromDiscord<haxscramper> it was tested in 1.0.0 compatibility in mind, so the code is relatively stable
16:20:24FromDiscord<IsaacPaul> call it fusion2
16:20:35FromDiscord<Patitotective> In reply to @IsaacPaul "call it fusion2": naah
16:20:41FromDiscord<Rika> call it fused
16:20:44FromDiscord<haxscramper> In reply to @Patitotective ""we" can start a": there is a status' stdlib extension library, maybe it has something similar
16:20:46FromDiscord<Patitotective> nim++ lol
16:21:01FromDiscord<haxscramper> nimskll
16:21:03FromDiscord<Patitotective> plus-nim
16:21:04FromDiscord<Rika> infusion
16:21:11FromDiscord<IsaacPaul> In reply to @Rika "call it fused": splash in some latin.. we can call it nim con fused
16:21:12FromDiscord<Patitotective> In reply to @Rika "infusion": a cup of tea?
16:21:20FromDiscord<Rika> lmao
16:22:10FromDiscord<Patitotective> In reply to @IsaacPaul "splash in some latin..": it could be called that way if it will get messy
16:22:33FromDiscord<Patitotective> (edit) "will" => "would"
16:22:56FromDiscord<Patitotective> what about nimrod lol
16:23:40FromDiscord<ajusa> In reply to @Patitotective "what about nimrod lol": that's what Nim used to be called though
16:23:49FromDiscord<Patitotective> In reply to @ajusa "that's what Nim used": thats the point
16:23:59FromDiscord<ajusa> but that would be... confusing?
16:24:08FromDiscord<Patitotective> well yea
16:24:12FromDiscord<Patitotective> _nimiety_
16:33:30arkanoid"Exception message: No SSL/TLS CA certificates found" on ubuntu 20.04 on request(AsyncHttpClient)
16:35:31arkanoidproject uses switch("define","ssl") and ubuntu has openssl package installed
16:37:34FromDiscord<ajusa> In reply to @arkanoid ""Exception message: No SSL/TLS": I've gotten that on Windows before (cacert.pem) but never on Linux, weird
16:39:42arkanoidmy fault, forgot to add ca-certificates to Dockerfile
16:40:00*krux02 joined #nim
16:49:26*jjido joined #nim
17:04:37nrds<testtor/freenode99> rasengan places a new sign in #freenode: THE SWAMP WILL BE DRAINED TODAY! <rasengan> Decision has been made. <rasengan> We have to drain this swamp. rasengan sets #freenode +m moderated rasengan unsets #freenode -z <rasengan> We are draining the swamp. <rasengan> Classic tried to go on for the sake of the community, but the community has made it loud and clear - they want freenode classic to end, to
17:04:45nrds<testtor/freenode99> <rasengan> #MFGA rasengan adds !@* to the #freenode +q founder list <rasengan> Everyone thinks they can just say whatever they want. Lesson #1 for IRC: Think before you type. <rasengan> Consequences are real. Treat things you care about with respect. Appreciate it. Help it. Cultivate it. And don't try to destroy it - because if you wish for its destruction, you're going to get it. <rasengan> Classic
17:04:50nrds<testtor/freenode99> had a special part in my heart and everyone else's. It's the saddest and hardest thing I've done, in a long time - but I <rasengan> am giving the directive to shut it down. <rasengan> Goodbye freenode classic. <rasengan> This is your queue to go to libera and oftc if you dont like waht we're doing. <rasengan> Do it. If you don't like what we're doing - go do it better. <rasengan> They need help. <ra
17:04:56nrds<testtor/freenode99> So does OFTC. <rasengan> I hope you'll all contribute hands. If you hate me so much anyway, it's a good use of energy to try to do everything ya'll can to cultivate other IRC networks to cause freenode to not matter.
17:05:44FromDiscord<dom96> amazing
17:07:18FromDiscord<huantian> Man that was so hard to read on mobile
17:07:20nrds<Prestige99> damn trolls
17:10:25FromDiscord<dom96> btw fusion was a strange idea from the start, still don't get the point
17:17:11FromDiscord<Patitotective> In reply to @dom96 "btw fusion was a": i dont understand the readme yet 😂
17:19:27FromDiscord<haxscramper> In reply to @dom96 "btw fusion was a": Stdlib where things get to die less under backward compatibility
17:19:40FromDiscord<haxscramper> (edit) "In reply to @dom96 "btw fusion was a": Stdlib where things get to die less under backward compatibility ... " added "requirements"
17:19:45FromDiscord<haxscramper> In theory
17:22:55FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3OjX
17:22:57FromDiscord<tandy> set two vars in one line?
17:24:46FromDiscord<dom96> In reply to @haxscramper "Stdlib where things get": did it ever end up being bundled with Nim?
17:25:19FromDiscord<haxscramper> It was UNbundled later on if you forgot
17:25:41FromDiscord<haxscramper> Citing release cycle mismatches etc.
17:26:55FromDiscord<dom96> Tbh I kinda ignored the whole thing, so yeah, probably my opinion doesn't matter much
17:27:40FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3Ok2
17:29:57FromDiscord<Rika> Why are you using then instead of another await?
17:31:45FromDiscord<Rika> Actually what is then?
17:32:39FromDiscord<Phil> That looks like JS to me
17:32:47FromDiscord<Phil> Or JS-style code
17:33:28FromDiscord<Phil> At which point I'll assume that's a promise and "then" means "execute this callback once the promise resolves and you have a value", the first parameter would be the contents of the promise
17:35:12FromDiscord<Phil> Anyone up for brainstorming on how to implement an equivalent to Django's "signals" in nim?
17:38:10nrds<Prestige99> No idea what that is
17:38:14FromDiscord<Phil> Or rather, other way around, is there a way that I can "forbid" any other module to use a specific piece of code, even if it imports it?↵Specifically I want to have only one module that is permitted to call the `norm.update/delte/create` procs.↵These are all part of norm/sqlite, but I can't just not import that package, I need it also for read operations
17:40:07FromDiscord<Rika> Don’t export it 😄
17:40:35FromDiscord<Rika> Oh
17:40:39FromDiscord<Rika> Any other module?
17:40:46FromDiscord<Rika> No, just don’t use it
17:40:57FromDiscord<Rika> Or import except
17:41:12FromDiscord<Rika> `import this except that, these`
17:41:43FromDiscord<tandy> im using both \:)↵(@Rika)
17:41:49FromDiscord<tandy> then lets me callback
17:41:57FromDiscord<tandy> https://nim-lang.org/docs/asyncjs.html
17:42:00FromDiscord<tandy> then is experimenal
17:42:53FromDiscord<Rika> I said “another” specifically because you’re using both
17:43:17FromDiscord<Rika> Is there a real difference to then and just another await in your case
17:46:22*rp1 quit (Ping timeout: 256 seconds)
17:47:06FromDiscord<Phil> Import X except? I'll need to look that syntax up, that does look promising though
17:47:51*rp1 joined #nim
17:48:24FromDiscord<Phil> Oh more like "import this module but without feature X", hmmm
17:49:01FromDiscord<Phil> In reply to @tandy "im using both \:)": If you can use await, only use await. That syntax is so much easier, particularly once it gets complex.
17:50:39FromDiscord<Phil> JS has so many answers to the entire async problem, async-await is the only one I'd give an A.↵The "Then" callback chaining I'd say is B. It's still somewhat useful if you have async await if you're in the situation where you want to fire multiple async callbacks at once instead of firing one, waiting for it to complete, then fire the second, then wait for that to complete etc...
17:51:18FromDiscord<Phil> (edit) "JS has so many answers to the entire async problem, async-await is the only one I'd give an A.↵The "Then" callback chaining I'd say is B. It's still somewhat useful if you have async await if you're in the situation where you want to fire multiple async callbacks at once instead of firing one, waiting for it to complete, then fire the second, then wait for that to complete etc..." => "sent a long message, see https://paste.rs/23q
17:51:52FromDiscord<Phil> (edit) "http://ix.io/3Oke" => "http://ix.io/3Okg"
17:52:40*PMunch quit (Quit: leaving)
17:53:20FromDiscord<tandy> in this case though, im going to use `.catch` to handle errors eventually↵(@Rika)
17:53:54FromDiscord<Phil> Try-catch does the same job and is going to be likely easier to reason about. Specifically if your error-handling becomes complicated
17:54:51FromDiscord<Phil> Actually, scratch that, not reason about, in terms of comprehension they're about both the same I'd say, I do find try-catch easier to read if contrasted with a `.then().catch()` block
17:55:04FromDiscord<Phil> (edit) "Actually, scratch that, not reason about, in terms of comprehension they're about both the same I'd say, I do find try-catch easier to read if contrasted with a `.then().catch()` block ... " added "though"
17:55:53FromDiscord<Rika> I need to go, it is 3 am
17:56:49FromDiscord<Phil> Sleep tight! Also sadly import except didn't quite do what I wanted it to, but I'll have to likely think on that more
17:58:09FromDiscord<Phil> In reply to @nrds "<Prestige> No idea what": Django's signal system is essentially a way to define a list of actions that should be performed every time an entry of a particular model is created/deleted/updated
17:58:42FromDiscord<Phil> You define functions, associate them with a given model of Django's ORM and define whether to execute that action before or after the event happens
17:58:53FromDiscord<Phil> (edit) "action" => "function"
18:02:00FromDiscord<Phil> sent a long message, see http://ix.io/3Okj
18:02:34FromDiscord<Phil> (edit) "http://ix.io/3Okj" => "http://ix.io/3Okk"
18:05:24FromDiscord<Phil> The only thing I can think of is having some kind of Hashmap of Hashmap of Lists with every list being a list of procs
18:06:20FromDiscord<Phil> (edit) "of" => "where they key is model and the value is another" | "of Lists with every list being" => "where the key is "pre/post create/update/delete" and the value is" | "list" => "List" | "Hashmapwhere the key is "pre/post create/update/delete" and the value isaListof procs ... " added "to execute if for that particular model that particular action occurs"
18:09:07FromDiscord<Phil> Can you make a seq of procs?
18:10:48FromDiscord<konsumlamm> sure
18:13:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Okp
18:14:29*rp1 quit (Ping timeout: 256 seconds)
18:15:59*rp1 joined #nim
18:16:54FromDiscord<Phil> effectively, I'd want a list of procs with this signature: ↵`proc postCreateSignal[T: Model](connection: DbConn, modelInstance: T) =`↵Well, that proc in 6 variations, all combinations of post/pre and create/update/delete
18:26:20NimEventerNew post on r/nim by thindil: [Nim Blog] This Month with Nim: January 2022, see https://reddit.com/r/nim/comments/si1sel/nim_blog_this_month_with_nim_january_2022/
18:39:59*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:40:58FromDiscord<konsumlamm> In reply to @Isofruit "effectively, I'd want a": i don't think you can have procs with generic parameters, but `seq[proc(connection: DbConn, modelInstance: Model)]` should work
18:41:19*jmdaemon joined #nim
18:42:39*jjido joined #nim
18:43:15FromDiscord<Phil> That's fine, the above would be more the general form of the signature, the actual procs would be more like `proc(connection: DbConn, modelInstance: Creature)` Hmmm, I wonder why I the above example runs into
18:43:28FromDiscord<Phil> `/usercode/in.nim(4, 5) Error: invalid type: 'proc' in this context: 'seq[proc]' for var`↵I'll see what happens if I enter a parameter
18:44:36FromDiscord<konsumlamm> did you write what i wrote or `seq[proc]`?
18:44:49FromDiscord<konsumlamm> `proc` isn't a specific proc type
18:44:57FromDiscord<Phil> Ohhhh
18:47:26FromDiscord<Phil> In reply to @konsumlamm "`proc` isn't a specific": Yep, that works, now I just need to meditate over whether I'm too lazy to fully implement this or not
18:49:17*neurocyte0917090 quit (Ping timeout: 240 seconds)
18:50:10FromDiscord<Patitotective> In reply to @haxscramper "the naming, is kind": what about reversed?
18:50:34*neurocyte0917090 joined #nim
18:50:52FromDiscord<haxscramper> In reply to @haxscramper "reversed/sorted and other. "ed"": already exists, means different thing
18:58:00*rockcavera joined #nim
18:58:00*rockcavera quit (Changing host)
18:58:00*rockcavera joined #nim
19:09:47*jmdaemon quit (Ping timeout: 250 seconds)
19:24:47FromDiscord<Waldecir Santos> can someone help with a cryptic message ? and why open a file and executing a regex would need to convert to int32 🤔 https://media.discordapp.net/attachments/371759389889003532/938152922695467008/unknown.png
19:25:23FromDiscord<haxscramper> you can't use `re` from `std/re` at compile time
19:25:49FromDiscord<haxscramper> specifically this message means that implementation uses `cast[]` somewhere and vm can't evaluate it
19:26:30FromDiscord<Waldecir Santos> Oh I see, I cannot use const here, right ?
19:27:24FromDiscord<konsumlamm> `const` makes stuff run at compile time
19:27:28FromDiscord<konsumlamm> so no
19:27:48FromDiscord<Waldecir Santos> Yeah it works with let, but still, would be nice to have a better message, thank you @haxscramper
19:27:51FromDiscord<haxscramper> use `let` instead, it is also immutable
19:29:35FromDiscord<konsumlamm> the whole module should probably have a `when nimvm: {.error: "'std/re' module doesn't work at compile time".}` or something
19:30:00FromDiscord<haxscramper> this is a vmgen error
19:30:24FromDiscord<enthus1ast> is std/re the one that uses pcre?
19:30:31FromDiscord<haxscramper> the module can't have a "usable in vm" or "not usable in vm" property
19:30:54FromDiscord<haxscramper> Only proc can, and only in cases where it's implementation has some magic
19:30:57FromDiscord<haxscramper> `cast[]` etc.
19:31:19FromDiscord<haxscramper> So technically if it was a different cast, or some other magic, the `std/re` would've been usable at compile-time
19:31:23FromDiscord<konsumlamm> hmm, wdym? the error would get triggered when importing it, or am i missing something?
19:31:25FromDiscord<Yepoleb> is cast not allowed for security reasons?
19:31:26FromDiscord<Waldecir Santos> Another funny behaviour `re.split` works differently from `nre.split` is this expected ?
19:31:47FromDiscord<haxscramper> In reply to @Yepoleb "is cast not allowed": cast is not disallowed, just not cast are supported
19:32:03FromDiscord<haxscramper> you can do some basic casting with integer types
19:32:21FromDiscord<Yepoleb> but is that lack of support intentional?
19:32:28*vicfred joined #nim
19:32:33FromDiscord<haxscramper> no,
19:32:47FromDiscord<konsumlamm> it's more that noone bothered to make it work at compile time
19:32:48FromDiscord<haxscramper> there is no real reason to limit the cast in the vm
19:34:07FromDiscord<konsumlamm> though `std/re` uses PCRE (i.e. C FFI) anyway, so i doubt there's any hope that it'll ever work in the VM
19:37:19FromDiscord<konsumlamm> In reply to @konsumlamm "the whole module should": @haxscramper can you elaborate why this wouldn't work?
19:38:03FromDiscord<konsumlamm> or would that get triggered when compiling the module?
19:38:07FromDiscord<haxscramper> first of all, does this work?
19:39:14FromDiscord<konsumlamm> huh, `illegal context for 'nimvm' magic`
19:39:19FromDiscord<konsumlamm> haven't seen that one before
19:39:29FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3OkN
19:40:13FromDiscord<haxscramper> `when nimvm` is a special magic that behaves differently during codegen part of the compilation IIRC, so it can trigger only when the actual evaluation happens
19:40:51FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3OkO
19:41:48FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3OkP
19:43:02*greaser|q quit (Changing host)
19:43:02*greaser|q joined #nim
19:43:05*greaser|q is now known as GreaseMonkey
19:44:30FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3OkQ
19:47:14*Vladar quit (Quit: Leaving)
19:49:15FromDiscord<haxscramper> Good error message for this can probably be achieved by tracking vm codegen stack, and then creating something like "XX cannot be done in VM, error found during genration of A which calls B which calls C which calls D which has troubles"
19:51:32FromDiscord<haxscramper> this is doable, in theory, but I'm not all too well familliar with the VM internals to give a concrete suggestions on how this can be implemented,
19:53:22FromDiscord<konsumlamm> i'm completely lost rn, why can i suddenly not use `when nimvm` in a proc?
19:53:36FromDiscord<haxscramper> you can
19:53:41FromDiscord<haxscramper> that is the only place where you can use it
19:54:12FromDiscord<haxscramper> and in a couple of similar places probably
19:54:21FromDiscord<haxscramper> but not on the module toplevel
19:54:39FromDiscord<haxscramper> because module as a whole is not subject to the vm generation
19:55:00FromDiscord<haxscramper> For example, you can have a `echo 1` and `static: echo 1`, but only latter one will be generated to the vm
19:55:15FromDiscord<haxscramper> and executed
19:55:28FromDiscord<haxscramper> first one will go into the C/js/cxx codegen and executed at runtime
19:55:32FromDiscord<konsumlamm> just doing `when nimvm: discard` and i'm getting `illegal context for 'nimvm' magic`
19:55:42FromDiscord<haxscramper> in what context
19:55:48FromDiscord<haxscramper> full code
19:55:49FromDiscord<konsumlamm> as proc body
19:56:04FromDiscord<konsumlamm> sent a code paste, see https://play.nim-lang.org/#ix=3OkT
19:56:16FromDiscord<keks> Is there a substitute for `pairs` that works with iterators? I'm trying to run a for loop with indices over an iterator, but it doesn't work.
19:56:16FromDiscord<IsaacPaul> you're missing the code for when there isn't a nimvm?
19:56:34FromDiscord<haxscramper> @konsumlamm maybe `else` is required
19:56:35FromDiscord<konsumlamm> oh lol, you need an `else`
19:56:39FromDiscord<haxscramper> I don't exactly remember
19:56:47FromDiscord<konsumlamm> would be too easy to write that in the error message, eh
19:56:57*jmdaemon joined #nim
19:57:27FromDiscord<konsumlamm> and here i was, doubting my sanity
19:59:05FromDiscord<konsumlamm> there's an issue for it: https://github.com/nim-lang/Nim/issues/12517
19:59:21FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3OkW
19:59:41FromDiscord<haxscramper> in general the "error in context of X" turned out a lot more ugly to properly implement than I originally anticipated
20:01:00FromDiscord<haxscramper> `nimvm` is a special magic symbol, so it has to go through a couple more hoops and jumps
20:01:20FromDiscord<haxscramper> https://github.com/nim-lang/Nim/issues/12517#issuecomment-559791231
20:09:08FromDiscord<shirleyquirk> how do i wrap a c++ iterator with a Nim iterator? put a different way: how do i dereference a c++ iterator in nim?
20:10:03FromDiscord<shirleyquirk> trying to wrap this `View` class: http://wiki.ros.org/rosbag/Code%20API
20:16:27nrds<enyc99> ACTION meows
20:17:46*fvs left #nim (WeeChat 3.4)
20:25:40FromDiscord<Phil> Boah organizing code without running into circular dependencies while seemingly staying elegant is hard
20:25:53*pch quit (Remote host closed the connection)
20:33:17*vicfred quit (Quit: Leaving)
20:42:59FromDiscord<kevin> Is there a way to convert a cstring back into a string?
20:43:19FromDiscord<kevin> is it just `var myString = $myCstring` ?
20:43:31FromDiscord<kevin> I keep getting segfault in that case 😠
20:44:24nrds<Prestige99> iirc you can just use a cstring in place of a string
20:45:42FromDiscord<enthus1ast> $ should work
20:46:39FromDiscord<enthus1ast> do you do some pointer magic with your cstring? maybe thats the reason
20:55:03FromDiscord<kevin> I'm wrapping a C function with prototype `char myFunction(int outsize);`
20:56:03FromDiscord<kevin> Nim equivalent should just be: `proc myFunction(outsize: ptr int): cstring {.importc: "myFunction", nodecl.}` , right?
20:58:37FromDiscord<kevin> Or maybe instead of trying to automatically convert, is there a Nim way to create a new string of length `outsize` and then just copy `outsize` number bytes to the new string?
21:04:45*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:10:34*jjido joined #nim
21:12:44FromDiscord<elo88> In reply to @PMunch "<@752421389209698344>, not familiar with": good point, now returns access denied. Even after I gave it all the rights and run it as admin. https://play.nim-lang.org/#ix=3Olo ↵I didn't have to do this in go, so I'm wondering, it could be related with compilation process?
21:18:18*sagax quit (Ping timeout: 260 seconds)
21:38:23FromDiscord<Waldecir Santos> What does this `case` do here in the `type`. block https://github.com/fenekku/moustachu/blob/master/src/moustachupkg/context.nim#L15-L22. ?
21:39:09FromDiscord<Waldecir Santos> is that some time of "constructor" ?
21:39:16FromDiscord<Waldecir Santos> (edit) "time" => "type"
21:43:17FromDiscord<Waldecir Santos> Oh found it https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
22:12:31*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:21:03FromDiscord<Waldecir Santos> How can I have a table where the value can have multiple types e.g: strings, ints and even other tables ?
22:22:01FromDiscord<konsumlamm> usually you make a variant type
22:22:34FromDiscord<Waldecir Santos> Ok and use the `object case` as I posted before right ?
22:22:43FromDiscord<konsumlamm> yes
22:23:27FromDiscord<Elegantbeef> Tagged unions or ADT is just how you have to do it in a statically typed language, or make everything a reference like in C# land 😀
22:38:54FromDiscord<IsaacPaul> or you could use method / inheritance.. but that would require a ref and method dispatch is slow on arc
22:41:10FromDiscord<IsaacPaul> On my todo list is to investigate some of these other libraries:↵https://github.com/itsumura-h/nim-interface-implements - Macro to build a tuple↵https://github.com/andreaferretti/interfaced - Go Like vtable
22:49:59Amun-Racan I use concept in this case? https://play.nim-lang.org/#ix=3OlJ
22:50:35FromDiscord<Elegantbeef> You can use concepts but you're doing it wrong
22:52:02FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3OlK
22:53:34Amun-Rathanks Elegantbeef
23:00:04FromDiscord<tandy> `to(objStore, Table[objStore.userId, User])` is this legal?
23:00:30FromDiscord<tandy> im trying to make a hashtable of `User` objects, indexed by `userId: string`
23:01:04Amun-RaElegantbeef: can I use var Self in concepts? as in: https://play.nim-lang.org/#ix=3OlN
23:01:35FromDiscord<tandy> initially i was doing this `storedUsers = to(objStore, seq[User])`, maybe its easier to convert seq to table..
23:01:45FromDiscord<Elegantbeef> You can use Self inside new concepts
23:02:04FromDiscord<Elegantbeef> oh you said `var Self`
23:02:29FromDiscord<Elegantbeef> I dont know if new concepts support this
23:02:44FromDiscord<tandy> so i guess my question is now\:
23:03:06FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3OlO i think the best you can do is
23:03:15FromDiscord<tandy> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/938207770686156820): so i guess my question is now\:↵how to convert `seq[User]` to `Table[User.userId: string, User]`
23:06:32FromDiscord<tandy> i figured
23:06:34FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3OlR
23:06:59Amun-RaElegantbeef: yes, looks like it works that way in old concepts, thanks again https://play.nim-lang.org/#ix=3OlO
23:08:14*rp1 quit (Ping timeout: 256 seconds)
23:08:45FromDiscord<tandy> nvm, cant do that to tables
23:11:50FromDiscord<huantian> In reply to @tandy "[Edit](https://discord.com/channels/371759389889003": You could use collect from std/sugar
23:13:05FromDiscord<tandy> ooo↵(@huantian)
23:13:09FromDiscord<tandy> leme peep the documentation
23:22:06FromDiscord<kevin> Any idea why Nim would be treating a pointer as a 32 bit value?
23:22:08FromDiscord<kevin> https://media.discordapp.net/attachments/371759389889003532/938212653212504094/unknown.png
23:22:18FromDiscord<kevin> Top one is from C, bottom is a Nim ptr
23:22:33FromDiscord<Elegantbeef> What's the code?
23:24:13FromDiscord<leorize> it's likely colored
23:24:22FromDiscord<kevin> sent a code paste, see https://play.nim-lang.org/#ix=3OlV
23:24:46FromDiscord<leorize> what is this GetOutputData of yours?
23:24:53FromDiscord<kevin> sent a code paste, see https://play.nim-lang.org/#ix=3OlW
23:25:10FromDiscord<kevin> (edit) "https://play.nim-lang.org/#ix=3OlW" => "https://paste.rs/eJk"
23:25:19FromDiscord<Elegantbeef> the C code?
23:25:28FromDiscord<leorize> `nodecl`? that's sus
23:25:42FromDiscord<leorize> are you using any form of `#include`?
23:25:48FromDiscord<Elegantbeef> If you notice the lower half of the Nim output is the same
23:26:13FromDiscord<Elegantbeef> So something is "properly" working
23:26:16FromDiscord<kevin> I'm trying to basically just create a wrapper for this C function
23:26:27FromDiscord<kevin> so it returns a string instead of a cstring
23:26:29FromDiscord<Elegantbeef> Sure what's the C function
23:27:03FromDiscord<kevin> https://github.com/trustedsec/COFFLoader/blob/main/beacon_compatibility.c#L338
23:27:29FromDiscord<leorize> can you try changing nodecl to cdecl?
23:27:34FromDiscord<kevin> ok
23:28:21FromDiscord<kevin> nah still the same
23:28:22FromDiscord<leorize> btw your outputsize parameter is wrong, it should be `ptr cint`
23:30:02NimEventerNew thread by Wils: Problem compiling ASM code with vars in Mac M1, see https://forum.nim-lang.org/t/8860
23:30:21FromDiscord<kevin> I can try ptr cint I guess
23:30:48FromDiscord<kevin> The thing is Nim is cutting off half of my pointer value ... maybe something with the way I'm importing my function Nim thinks it's a 32 bit return value? idk
23:31:27FromDiscord<Elegantbeef> No `ptr char` is `sizeof(int)`
23:31:53FromDiscord<Elegantbeef> So unless your C code you're calling magiically converts your PC to 32 bit temporarily i think it's off
23:33:40FromDiscord<leorize> it's unlikely, `ffffffff` is too magical to be a cut-off
23:34:56FromDiscord<leorize> can you try printing with `echo cast[int](output).toHex()`?
23:34:58FromDiscord<leorize> you will have to import `strutils`
23:35:19FromDiscord<kevin> sent a code paste, see https://play.nim-lang.org/#ix=3OlZ
23:35:20FromDiscord<kevin> something like that is what I get
23:35:35FromDiscord<kevin> clearly the Nim ptr value is cut off from the C ptr
23:37:58FromDiscord<leorize> can you try `--nimcache:pick/a/folder` and check the generated C for the module you're compiling?
23:38:57Amun-Rakevin: can you paste nim code that calls the function?
23:39:28FromDiscord<leorize> just look for a `Blah_` in the C file and you should be able to find the function
23:44:52FromDiscord<kevin> sent a code paste, see https://play.nim-lang.org/#ix=3Om7
23:45:10FromDiscord<kevin> C code for GetOutputData is https://github.com/trustedsec/COFFLoader/blob/main/beacon_compatibility.c#L338
23:49:56Amun-Rakevin: does that work? https://play.nim-lang.org/#ix=3Oma
23:50:57termerHow would I import a module that's in the parent directory of the current module?
23:51:00termerI can't seem to use ../
23:51:23Amun-Ratermer: that should work
23:51:38termerimport ../[utils]
23:51:48termercannto open file: ../[utils]
23:51:48FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=3Omb
23:52:24FromDiscord<leorize> the return type `NCSTRING` is defined as `typedef char NCSTRING;` in `nimbase.h`
23:53:00termerIs there a way to import multiple packages from a relative path?
23:53:05termerusing [] in it makes it fail
23:53:32FromDiscord<kevin> In reply to @Amun-Ra "<@281679831119167489>: does that work?": Yeah actually this does work! 🥳
23:53:36FromDiscord<Elegantbeef> I think `".."/[utils, thingA]` works
23:55:02Amun-Rakevin: \o/
23:55:29termerElegantbeef it doesn't work
23:55:43termerimport ../[objects, client]
23:55:49termercannot open file: ../[objects, client]
23:55:51termerIs that a bug
23:55:57termerbecause ../objects works
23:56:00termerand ../client also does
23:56:08FromDiscord<Elegantbeef> Did you do the string thing?
23:56:15FromDiscord<Elegantbeef> It's a known issue with `../` iirc
23:56:46termerthe string thing?
23:57:05FromDiscord<Elegantbeef> Make `..` a string literal
23:57:12FromDiscord<Elegantbeef> so it's `".."/[client, objects]`
23:57:24termerhmm, that seems to work
23:57:26termerodd but I'll take it
23:57:32termerthanks
23:57:42FromDiscord<Elegantbeef> I think the issue is `../` is taken as an operator and doesnt play with `[]`
23:58:01termerthat makes sense but definitely should be changed
23:58:15FromDiscord<abenedic (Alex Benedict)> Hello, I am probably trying to do something really stupid, but I am porting some of my C++ code that uses X macros to nim to learn the language. Currently I am trying something like https://play.nim-lang.org/#ix=3Omc and I would like to be able to return an `of` for a case statement from a template, but that doesn't seem to work. Should I use a macro for that or I am I going about this in entirely the wrong way?
23:59:26FromDiscord<Elegantbeef> Macro
23:59:38FromDiscord<Elegantbeef> `of x: y` isnt valid AST
23:59:46FromDiscord<Elegantbeef> So you need a macro to handle your input and turn it into your output