00:07:29 | FromDiscord | <Bubblie> well beef, the astericks are there and im out of ideas |
00:07:33 | FromDiscord | <Bubblie> its time to make my own shit |
00:08:53 | FromDiscord | <Elegantbeef> That's not a procedure in the bindings |
00:09:29 | FromDiscord | <Bubblie> oh no I got a new error |
00:09:30 | FromDiscord | <Bubblie> lol |
00:09:33 | FromDiscord | <Bubblie> forgot to say |
00:10:06 | FromDiscord | <Elegantbeef> What's the new issue? |
00:10:26 | FromDiscord | <Bubblie> OH WAIT I may have figured out something gimmie one second |
00:12:55 | * | acidsys quit (Excess Flood) |
00:13:27 | * | acidsys joined #nim |
00:13:39 | FromDiscord | <Bubblie> figured it out |
00:13:55 | FromDiscord | <Bubblie> okay, so essentially, it was a problem with the extensions, the extensions are just fucked |
00:14:11 | FromDiscord | <Bubblie> adding vulkan extensions here doesn't work cause that query thing in the example simply does not exist in any of the files |
00:14:28 | FromDiscord | <Bubblie> sorry, any of the places in the vulkan.nim I meant |
00:14:33 | FromDiscord | <Bubblie> deleting this fixes the issue |
00:14:49 | FromDiscord | <Bubblie> this can be a problem if I want vulkan extensions |
00:16:17 | FromDiscord | <Elegantbeef> What do you mean? |
00:19:13 | FromDiscord | <Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=3TdG |
00:19:30 | FromDiscord | <Elegantbeef> Now imagine contributing the fixes to the nimgl bindings to make that work |
00:20:06 | FromDiscord | <Bubblie> im working on it LMAO |
00:20:18 | FromDiscord | <Bubblie> im trying to see why it was just, flat out removed |
00:20:37 | FromDiscord | <Elegantbeef> eh i just see "its time to make my own shit" and go "ah yes open source software" |
00:21:59 | FromDiscord | <Bubblie> make my own shit can mean make own fix too lol, I was only going to think about making my own bindings because I assumed the bindings were just messed up on windows, nimgl probably works everywhere else (everywhere else meaning linux, im excluding mac) |
00:22:12 | FromDiscord | <Bubblie> but now, it seems like this may be an issue with its generator |
00:23:02 | * | noeontheend joined #nim |
00:23:21 | FromDiscord | <Bubblie> and in general, what ive noticed is that compared to other bindings, nimgl does this weird thing with glfwWindow, it may be restricting the freedom that comes from setting up a proper vulkan pipeline |
00:23:35 | FromDiscord | <Bubblie> Im gonna add that to my own fork, and pr it |
00:24:55 | FromDiscord | <Bubblie> okay yeah, loadVK_EXT_host_query_reset is not anywhere, not in the main repo not in the seperate repo and not in my project either |
00:24:58 | FromDiscord | <Bubblie> hmmmm |
00:25:11 | FromDiscord | <Bubblie> maybe its removal was an accident? Maybe they did something else that was also un documented? |
00:25:19 | FromDiscord | <Bubblie> let me look into the history |
00:26:33 | FromDiscord | <Bubblie> ... |
00:26:37 | FromDiscord | <Bubblie> its not even in the history |
00:31:12 | FromDiscord | <Elegantbeef> Well time to make an issue or make it in the history |
00:31:44 | FromDiscord | <Bubblie> yes, but my question is if it was never added to the vulkan.nim this entire time, how was the example even working? |
00:31:50 | FromDiscord | <Bubblie> maybe im being stupid ill keep looking |
00:33:55 | FromDiscord | <Bubblie> okay found something, it was here, now I need to find where it was removed |
01:58:10 | * | tiorock joined #nim |
01:58:10 | * | tiorock quit (Changing host) |
01:58:10 | * | tiorock joined #nim |
01:58:10 | * | rockcavera is now known as Guest1667 |
01:58:10 | * | tiorock is now known as rockcavera |
01:59:06 | * | Guest1667 quit (Ping timeout: 245 seconds) |
02:17:57 | * | noeontheend quit (Ping timeout: 240 seconds) |
02:29:04 | * | Gustavo6046 joined #nim |
02:31:05 | * | Gustavo6046 quit (Max SendQ exceeded) |
02:31:43 | * | Gustavo6046 joined #nim |
02:37:14 | * | neurocyte0917090 quit (Ping timeout: 268 seconds) |
03:05:30 | FromDiscord | <Hamid_Bluri> In reply to @Elegantbeef "<@121971538898452482> <@767093711112241162> i": amazing |
03:07:50 | FromDiscord | <Elegantbeef> Now if only we can get rid of the `DBConn` shit inside the `db_` modules 😛 |
03:14:20 | * | tiorock joined #nim |
03:14:20 | * | tiorock quit (Changing host) |
03:14:20 | * | tiorock joined #nim |
03:14:20 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
03:14:20 | * | tiorock is now known as rockcavera |
03:21:24 | FromDiscord | <dilawar (Dilawar Singh)> I thought since many NIM developers are there, I probably post it there and see. 😟/ |
03:21:42 | FromDiscord | <Elegantbeef> What's a NIM developer? |
03:23:21 | FromDiscord | <dilawar (Dilawar Singh)> I can't login to my account after I changed my nim-forum password. The error is always "wrong username or password". I change it again, try login again and same error again. Feeling a bit like https://www.youtube.com/watch?v=SHJQSRa02iQ. |
03:24:09 | FromDiscord | <Elegantbeef> I'd say ping someone that can actually do something |
03:24:22 | FromDiscord | <Elegantbeef> Dom or Miran probably |
03:24:38 | FromDiscord | <dilawar (Dilawar Singh)> Thanks. I'll ping them. Are they here? |
03:25:00 | FromDiscord | <dilawar (Dilawar Singh)> Sorry, autocorrect and my loose grip on English. |
03:25:43 | FromDiscord | <dilawar (Dilawar Singh)> I can't post anything on nim forum anymore. |
03:28:51 | * | rockcavera quit (Remote host closed the connection) |
03:29:51 | FromDiscord | <Elegantbeef> They are here dom96 is dom, think miran uses irc |
03:38:47 | FromDiscord | <Hamid_Bluri> https://play.nim-lang.org/#ix=3Teb |
03:38:53 | FromDiscord | <Hamid_Bluri> can't understand iterators |
03:39:32 | FromDiscord | <Hamid_Bluri> why the value of `x` is not equal to 10 |
03:39:54 | FromDiscord | <Hamid_Bluri> how do they work 😕 |
03:40:52 | FromDiscord | <Elegantbeef> This closure doesnt hold state |
03:41:23 | FromDiscord | <Elegantbeef> I mean it does 😛 |
03:41:43 | FromDiscord | <Hamid_Bluri> what |
03:42:34 | FromDiscord | <Elegantbeef> `x`'s state is stored in the proc |
03:42:36 | FromDiscord | <Elegantbeef> rather closure |
03:43:02 | FromDiscord | <Hamid_Bluri> Ah |
03:43:39 | FromDiscord | <Rika> first call does the x = a, then enters the loop and stops at the yield |
03:43:47 | FromDiscord | <Rika> next calls stay in the loop |
03:44:27 | FromDiscord | <Hamid_Bluri> what about `echo c(10, 13)` ? |
03:44:43 | FromDiscord | <Elegantbeef> it returns the `yield x` |
03:45:36 | FromDiscord | <Elegantbeef> `closure` iterators hold onto their state, which was intialized to `1` |
03:46:23 | FromDiscord | <Hamid_Bluri> but if you swap lines 12 & 13 |
03:46:28 | FromDiscord | <Hamid_Bluri> something strange happens |
03:46:52 | FromDiscord | <Elegantbeef> 10 \> 3 |
03:47:16 | FromDiscord | <Rika> well yeah, a doesnt change but b does |
03:47:53 | FromDiscord | <Hamid_Bluri> i kinda get it |
03:48:08 | FromDiscord | <Elegantbeef> This isnt a closure generator so the state has to be passed |
03:48:24 | FromDiscord | <Elegantbeef> If you want a closure generator look at slicerator's `asClosure` |
03:49:36 | FromDiscord | <Hamid_Bluri> ok |
03:49:37 | FromDiscord | <Hamid_Bluri> thanks you both |
03:49:42 | FromDiscord | <Hamid_Bluri> (edit) "thanks" => "thank" |
03:49:43 | FromDiscord | <Elegantbeef> This isnt even a property of iterators it's just closures |
03:50:16 | FromDiscord | <Elegantbeef> If you want to see how Nim implements closures https://nim-lang.org/docs/intern.html#code-generation-for-closures |
03:50:41 | FromDiscord | <Hamid_Bluri> thank u so much |
03:52:08 | * | slowButPresent quit (Quit: leaving) |
04:13:58 | * | arkurious quit (Quit: Leaving) |
04:18:27 | FromDiscord | <V0id_Matr1x> Is elegantbeef really a bot? |
04:18:35 | FromDiscord | <Elegantbeef> sadly not |
04:19:06 | FromDiscord | <huantian> why does everyone ask if beef is a bot and not anyone else |
04:19:11 | FromDiscord | <V0id_Matr1x> Oh lmao, I was like wow that is the craziest thing I have ever seen lol. |
04:19:37 | FromDiscord | <Elegantbeef> Cause i pass the butter |
04:20:57 | FromDiscord | <Rika> not the turing test it seems |
04:21:02 | FromDiscord | <huantian> I swear more people use Matrix right |
04:23:02 | FromDiscord | <Elegantbeef> Perhaps |
04:25:11 | FromDiscord | <huantian> hm I have no idea how to do the device verification thing with element |
04:26:00 | FromDiscord | <V0id_Matr1x> You need a pass phrase key for backup I think. |
04:26:26 | FromDiscord | <V0id_Matr1x> To verify if I remember correctly, I don't use it much. |
04:26:34 | FromDiscord | <Elegantbeef> It's in security settings i thiink |
04:26:40 | FromDiscord | <V0id_Matr1x> Yeah |
04:28:16 | * | pch_ joined #nim |
04:28:53 | FromDiscord | <huantian> Oh huh ok that makes sense |
04:29:08 | FromDiscord | <Equinox> In reply to @V0id_Matr1x "Oh lmao, I was": No they are a bot, one of the most advanced ai’s ever written |
04:29:26 | FromDiscord | <huantian> I have no idea what that actually did but cool |
04:29:44 | FromDiscord | <Elegantbeef> Would allow you to continue DMing people i think |
04:29:52 | FromDiscord | <Elegantbeef> in a E2E environment |
04:29:59 | * | pch quit (Ping timeout: 250 seconds) |
04:29:59 | FromDiscord | <V0id_Matr1x> No I looked it up, they logged in with a bot or something. It was like magic at first though lmfao. |
04:30:19 | FromDiscord | <Elegantbeef> It's just the matrix bridge |
04:30:25 | FromDiscord | <Elegantbeef> We're otherly located |
04:30:27 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3Tel |
04:30:43 | FromDiscord | <V0id_Matr1x> googled "how to get bot tag on discord" lol |
04:31:45 | FromDiscord | <V0id_Matr1x> In reply to @Elegantbeef "It's just the matrix": That makes sense. I will get myself the bot tag too lol. |
04:31:48 | FromDiscord | <Elegantbeef> Hamid that's an uninstantiatble distinct |
04:32:10 | FromDiscord | <Elegantbeef> `type CustomSlice = distinct HSlice` has no generic on the HSlice |
04:32:27 | FromDiscord | <Elegantbeef> Should be `type CustomSlice = distinct HSlice[int, BackwardsIndex]` in this example |
04:33:41 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://paste.rs/2Mp |
04:34:05 | FromDiscord | <Hamid_Bluri> but is there any way to get rid of `CustomSlice[int, int]( ... )` ? |
04:34:07 | FromDiscord | <Elegantbeef> Yes |
04:34:22 | FromDiscord | <Elegantbeef> A converter |
04:34:36 | FromDiscord | <Elegantbeef> But you'd need a converter for that specific generic |
04:34:39 | FromDiscord | <Elegantbeef> So to answer no |
04:34:48 | FromDiscord | <Hamid_Bluri> thanks |
04:35:54 | FromDiscord | <huantian> hey beef wanna meet up sometime and I verify each other's client xD |
04:36:00 | FromDiscord | <Elegantbeef> Works for instance |
04:36:03 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Ten |
04:36:15 | FromDiscord | <Elegantbeef> You coming to bumfuck nowhere Canada? |
04:36:52 | FromDiscord | <huantian> hm probably not seems cold |
04:36:57 | FromDiscord | <huantian> how about you visit arizona |
04:36:59 | FromDiscord | <Elegantbeef> It's warm today |
04:37:03 | FromDiscord | <Elegantbeef> It's +2C right now |
04:37:25 | FromDiscord | <Elegantbeef> Nope i'm good |
04:38:23 | FromDiscord | <huantian> it's around 30 highs over here rn |
04:38:35 | FromDiscord | <Elegantbeef> In real units? |
04:38:42 | FromDiscord | <huantian> yeah Celcius |
04:38:50 | FromDiscord | <Elegantbeef> Ah that's my summer temps |
04:38:59 | FromDiscord | <Elegantbeef> I prefer the -50 to that |
04:43:44 | FromDiscord | <huantian> hm what if we instead verify sessions via github issue |
04:44:26 | FromDiscord | <Elegantbeef> Speaking of github issues, thoughs on my async await message change? |
04:45:45 | FromDiscord | <Equinox> In reply to @Elegantbeef "Speaking of github issues,": What did you change |
04:45:55 | FromDiscord | <huantian> Yeah I think it's a good idea to mention waitFor in the error message |
04:46:43 | FromDiscord | <huantian> should the message mention asyncCheck as well? or is that use case not frequent enough to worry about |
04:46:52 | FromDiscord | <Elegantbeef> I didnt change anything i suggested the change to huan's pr |
04:47:05 | FromDiscord | <Elegantbeef> `asynCheck` is the `discard` equivlent |
04:47:15 | * | wyrd quit (Ping timeout: 240 seconds) |
04:47:19 | FromDiscord | <huantian> yeah, so it doesn't wait for the future to complete |
04:47:48 | FromDiscord | <Elegantbeef> So it doesnt relate to using await |
04:48:12 | FromDiscord | <huantian> true |
04:48:22 | FromDiscord | <huantian> there we go bigger cubes |
04:49:18 | * | wyrd joined #nim |
04:49:54 | FromDiscord | <huantian> Also the other error messages in asyncmacro seem to use "async proc" instead of "proc marked as 'async'" or "'async' marked proc."↵maybe it would be better to just say that |
04:50:09 | FromDiscord | <Elegantbeef> Perhaps |
04:52:11 | FromDiscord | <Elegantbeef> @Equinox\: this is what we're talking about https://github.com/nim-lang/Nim/pull/19622 |
04:53:09 | * | pch_ is now known as pch |
04:55:03 | FromDiscord | <Elegantbeef> Huan and i talked about it to remove the stupid error message of "yield can only be used in an iterator" |
04:55:31 | FromDiscord | <Elegantbeef> I havent used async much but it's the most seen error from people trying to use it heree |
04:57:02 | FromDiscord | <huantian> "If waiting" feels a tad awkward, maybe `"If intentional, use 'waitFor' to call a 'async' proc in non-async scope."` is better |
04:58:37 | FromDiscord | <huantian> But I think sticking with specifically saying marked is the move |
05:00:26 | FromDiscord | <huantian> Man words are hard |
05:02:12 | FromDiscord | <Elegantbeef> 'if calling' is better imo |
05:02:52 | FromDiscord | <Elegantbeef> "If calling an 'async' proc in a non-async scope use `waitfor`" |
05:04:53 | FromDiscord | <huantian> this is just wording but should we say "use waitFor" before saying if? |
05:04:58 | FromDiscord | <Elegantbeef> Probably |
05:05:20 | * | ltriant_ quit (Read error: Connection reset by peer) |
05:06:08 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3Tev |
05:06:08 | FromDiscord | <huantian> ok so `Can only 'await' inside a proc marked as 'async'. Use 'waitFor' when calling an 'async' proc in a non-async scope instead` |
05:06:22 | FromDiscord | <Elegantbeef> Sounds good to me |
05:07:54 | FromDiscord | <Elegantbeef> Hamid you bounded `A` and `B` to the same type |
05:08:10 | FromDiscord | <Hamid_Bluri> Oh |
05:08:11 | FromDiscord | <Elegantbeef> Wait nvm |
05:08:39 | FromDiscord | <Hamid_Bluri> it works with int, int |
05:08:45 | FromDiscord | <Hamid_Bluri> (edit) "int, int" => "[int, int]" |
05:09:10 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3Tew |
05:10:35 | * | ltriant joined #nim |
05:13:51 | FromDiscord | <Elegantbeef> It's a bug if i've ever seen one |
05:14:32 | FromDiscord | <Hamid_Bluri> intresting |
05:14:58 | FromDiscord | <Hamid_Bluri> that works |
05:15:02 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://paste.rs/ZyA |
05:15:35 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3TeA |
05:15:46 | FromDiscord | <huantian> oh yeah beef looking at this windows test, seems to be failing because of `\` and not `/` in paths↵https://github.com/nim-lang/Nim/pull/19622/checks?check_run_id=5609347020 |
05:17:50 | FromDiscord | <Elegantbeef> Well guess compiler dev right now |
05:20:03 | FromDiscord | <huantian> ah I see the issue, the example you sent doesn't use `nimoutFull: true` so it only checks for the parts of the error message that don't have paths |
05:20:31 | FromDiscord | <Elegantbeef> Ugh it's another typerel bug i think |
05:20:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/nBr |
05:26:47 | FromDiscord | <Hamid_Bluri> i'm sorry to call you "beef" |
05:26:57 | FromDiscord | <Hamid_Bluri> you're "Elegant beef" |
05:27:13 | FromDiscord | <Elegantbeef> I'm whatever the fuck i want to respond to 😛 |
05:27:25 | FromDiscord | <Hamid_Bluri> "Elegant beef" is distinct type of `beef` |
05:27:47 | * | Zectbumo joined #nim |
05:27:59 | FromDiscord | <Elegantbeef> I hate these distinct issues |
05:28:22 | FromDiscord | <Elegantbeef> It's actually not even a distinct issue, just a generic issue |
05:28:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TeC |
05:28:49 | FromDiscord | <Elegantbeef> For the same reason, typerel is being dumb |
05:28:56 | FromDiscord | <Hamid_Bluri> typerel? |
05:29:24 | FromDiscord | <Elegantbeef> It's the part of the compiler that reasons type relations |
05:30:18 | FromDiscord | <V0id_Matr1x> What is the butter everyone is referring too? |
05:33:11 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3TeD |
05:33:13 | FromDiscord | <Hamid_Bluri> only last one doesn't work |
05:41:11 | FromDiscord | <Elegantbeef> Oh i think i already see the issue |
05:46:20 | FromDiscord | <Elegantbeef> Nevermind i'm silly |
05:50:15 | FromDiscord | <V0id_Matr1x> Hey elegant, did you merge my pull request because after I told you I was waiting it merged. If so thanks! |
05:50:32 | FromDiscord | <Elegantbeef> What PR? |
05:51:16 | FromDiscord | <V0id_Matr1x> Oh then nevermind. Must be coincidence, what is your github name? |
05:51:25 | FromDiscord | <Elegantbeef> beef331 |
05:52:24 | FromDiscord | <Elegantbeef> I have no relation with `nim-lang` |
05:52:25 | FromDiscord | <V0id_Matr1x> Oh then no, it is definitely coincidence. I thought you were the guy merging` packages.json` |
05:53:28 | FromDiscord | <V0id_Matr1x> That makes sense, I figure your were more experienced in Nim than me, and had no idea who you were so I thought I would as for feedback. |
05:53:40 | FromDiscord | <V0id_Matr1x> (edit) "figure" => "figured" |
05:54:04 | FromDiscord | <Rika> He probably is…? |
05:54:10 | FromDiscord | <Rika> I don’t remember seeing you around here |
05:54:10 | FromDiscord | <V0id_Matr1x> OH he is lol |
05:54:19 | FromDiscord | <V0id_Matr1x> I am a noob to Nim |
05:54:29 | FromDiscord | <Rika> Yeah he likely is |
05:54:34 | FromDiscord | <V0id_Matr1x> It is my favorite lang now though |
05:54:46 | FromDiscord | <Elegantbeef> You forget, i'm an idiot↵(@Rika) |
05:55:10 | FromDiscord | <V0id_Matr1x> In reply to @Elegantbeef "You forget, i'm an": I don't believe that for a second lmao. |
05:56:04 | FromDiscord | <Elegantbeef> Someone wanna give me a CPU with a higher IPC so i can debug the compiler a tinge faster? |
05:56:41 | FromDiscord | <Rika> Go buy a Mac studio or something, it’s only just 4000 USD for the best CPU |
05:56:45 | FromDiscord | <Elegantbeef> Ah actually i think i dumbly have the compiler built ind ebug |
05:57:15 | FromDiscord | <Elegantbeef> I think that stands for everything i'm against |
05:57:43 | FromDiscord | <Elegantbeef> an unupgradable unrepairable lockedown computer |
06:02:46 | FromDiscord | <Rika> Then build one |
06:06:39 | FromDiscord | <V0id_Matr1x> Wait so Nim Lang is dead, and Nim Skull is the current project? code might be broken?? |
06:06:48 | FromDiscord | <Elegantbeef> No |
06:06:59 | FromDiscord | <Elegantbeef> Nim-lang is alive, nimskull is alive |
06:07:10 | FromDiscord | <V0id_Matr1x> I am so confused, can you elaborate please. |
06:07:18 | FromDiscord | <Phil> araq and co work on nim |
06:07:20 | FromDiscord | <Elegantbeef> Nimskull is a fork of nim |
06:07:29 | FromDiscord | <Phil> Other folks that split off of nim work on nimskull |
06:07:50 | FromDiscord | <Elegantbeef> I really should leave nimskull's organization |
06:07:59 | FromDiscord | <Elegantbeef> I'm equally associated with them as i am with nim-lan 😀 |
06:08:00 | FromDiscord | <V0id_Matr1x> WHy? |
06:08:21 | FromDiscord | <Phil> Differences over the codebase and the scope of the supported featureset IIRC |
06:08:21 | FromDiscord | <Elegantbeef> Cause I dont have any reason to be in it |
06:08:34 | FromDiscord | <V0id_Matr1x> Ok man |
06:08:35 | FromDiscord | <Phil> Ohhh why he's in the group, my bad |
06:08:40 | FromDiscord | <Elegantbeef> Why to the fork is read the readme of nimskull |
06:08:41 | FromDiscord | <Elegantbeef> It explains why it exists |
06:09:19 | FromDiscord | <V0id_Matr1x> I read it and that is where I got the impression Nim was dead, and got worried. |
06:09:52 | FromDiscord | <V0id_Matr1x> "↵We love the original vision behind nim-lang; we believe that an element of the vision was lost. We simply believe a different development process was needed to that which was being used and decided that the best way to see this vision materialize was to enforce that process ourselves. " |
06:10:10 | FromDiscord | <Rika> Nothing here implies the original is dead |
06:11:32 | FromDiscord | <V0id_Matr1x> No worries, thank you for making that clear. |
06:43:31 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/1oF |
06:44:00 | FromDiscord | <Phil> (edit) "https://paste.rs/F3M" => "https://play.nim-lang.org/#ix=3TeR" |
06:44:06 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=3TeR" => "https://play.nim-lang.org/#ix=3TeT" |
06:44:25 | FromDiscord | <Elegantbeef> `_: typedesc[T]` reduce the proc length |
06:44:35 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=3TeT" => "https://play.nim-lang.org/#ix=3TeU" |
06:44:58 | FromDiscord | <Elegantbeef> proc last so you can use the do syntax imo |
06:47:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ZeY |
06:47:23 | FromDiscord | <Phil> do-syntax? Is that a nim feature I over-read? |
06:47:31 | FromDiscord | <Rika> No |
06:47:44 | FromDiscord | <Rika> It’s in the experimental manual but it’s not actually very experimental |
06:47:51 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#do-notation |
06:48:09 | FromDiscord | <Phil> Ah, Do notation |
06:52:51 | FromDiscord | <Phil> So if I understood this right, when calling a proc this is a way of moving the proc-definition to outside of the params and underneath the proc-call, which can be useful for larger anonymous functions |
06:53:28 | FromDiscord | <Phil> I'll keep that in mind when writing procs that take proc params! Thanks! |
06:53:33 | FromDiscord | <Elegantbeef> Depends what you're doing but yes |
06:54:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TeX |
06:54:30 | FromDiscord | <Phil> You'd only use the do-syntax when creating anonymous procs right? I have a couple times where I invoke the proc and pass it a named proc from another module |
06:54:52 | FromDiscord | <Elegantbeef> Yea you'd use the do syntax for anonymous procs |
06:55:24 | FromDiscord | <Elegantbeef> for named procs you'd just pass them in |
07:07:55 | FromDiscord | <Phil> Check |
07:39:47 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
07:42:22 | FromDiscord | <untoreh> In reply to @demotomohiro "<@152784476701851648> Maybe `toStrLit` in": this one almost does it, but it adds whitespace, I guess I have to copy the tree recursion function and just remove the whitespace stuff |
07:42:38 | * | Lord_Nightmare joined #nim |
08:03:04 | * | acidsys quit (Excess Flood) |
08:03:37 | * | acidsys joined #nim |
08:03:41 | * | acidsys quit (Excess Flood) |
08:04:19 | * | acidsys joined #nim |
08:29:17 | FromDiscord | <enthus1ast> It seems when a loaded dll crashes/excepts (loaded via dynlib) i cannot get the error message in the host application, do you know how to do this? Or should my application do this somehow? |
08:29:43 | FromDiscord | <enthus1ast> Eg, try and catch in the dll and store the error in a table etc that my host retreives ? |
08:30:18 | FromDiscord | <enthus1ast> is maybe the reason that the dll does not have a stdout/strerr ? |
08:32:16 | FromDiscord | <Elegantbeef> Wrap the program in try except and propogate it bad with an error handler |
08:32:20 | FromDiscord | <Elegantbeef> it back\ |
08:32:35 | FromDiscord | <enthus1ast> yes sounds resonable |
08:32:37 | FromDiscord | <enthus1ast> thank you |
08:52:38 | FromDiscord | <wsantos> In reply to @Elegantbeef "<@121971538898452482> <@767093711112241162> i": @ElegantBeef this is amazing I'll need some time to digest it 😄 thank you so much |
08:57:04 | * | Zectbumo quit (Remote host closed the connection) |
09:05:20 | FromDiscord | <luteva> @wsantos just one more idea: I think what you are searching for was some kind of "interfaces" like in java or in go.↵There are interface implementations in/for nim: Maybe you may want to have a look at iface: https://github.com/yglukhov/iface↵this i s a go-like interface implementation. |
09:06:11 | FromDiscord | <Elegantbeef> I mean they only need iface if they want runtime interfaces |
09:06:18 | FromDiscord | <Elegantbeef> Concepts give them compiletime inferfaces |
09:10:11 | FromDiscord | <luteva> yes. that's definitvely a better solution if you can handle that at compiletime. but whenever not sure you may want to choose runtime interfaces (or maybe not... just an idea.....)↵also: using iface seems to be quite easy! concepts are still a bit more complicated in my opinion. |
09:11:51 | FromDiscord | <Elegantbeef> Eh it's a bit more complicated in this case cause of the odd matching needed |
09:12:23 | FromDiscord | <Elegantbeef> Otherwise they're more tame and `a.doThing(args) is T` |
09:12:58 | FromDiscord | <Phil> In reply to @Elegantbeef "<@121971538898452482> <@767093711112241162> i": This looks like something I should really steal for tinypool |
09:13:27 | FromDiscord | <Elegantbeef> It lets you get away from inheritance so I think so |
09:15:42 | FromDiscord | <Elegantbeef> I still want to see Norm without the inheritance requirement 😛 |
09:16:00 | FromDiscord | <Elegantbeef> Not that i'd be any more likely to use it, just dont like inheritance where it's not needed |
09:17:37 | FromDiscord | <Phil> Within the very, very limited scope that norm uses it I'm not a fan, but at least it doesn't bother me greatly.↵What does bother me is the requirement of an ID field which makes working with views/fts5 impossible as well as no way to write raw SQL if I wanted to |
09:18:02 | FromDiscord | <Phil> But that'd have to be solved with a different type, if it comes....ever |
09:19:18 | FromDiscord | <Elegantbeef> Yea i only know of Norm for looking at your code briefly and found the usage of `Model` suspect |
09:20:37 | FromDiscord | <enthus1ast> i like the way nisane composes, but it is a more manual way |
09:20:50 | FromDiscord | <Elegantbeef> I know nothing of any of this, so i dont comment further |
09:21:04 | FromDiscord | <enthus1ast> its a seq to object converter |
09:21:05 | FromDiscord | <Phil> nisane is essentially: Take seq[string], convert to object |
09:21:46 | FromDiscord | <Phil> Where the strings have to be in the order of the fields in the object |
09:21:47 | FromDiscord | <enthus1ast> BUT i guess the correct way is to patch the various db\_\ drivers to get types from the db and generate objects by themself |
09:22:25 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/3Tff |
09:23:44 | FromDiscord | <enthus1ast> this way you can collect any sql returns, withouth the id requirement in MyObj |
09:24:17 | FromDiscord | <enthus1ast> also if you you join some rows\:↵myRow.to(entryId, entry, userId, user) |
09:24:48 | FromDiscord | <Elegantbeef> Yea i dont DB |
09:24:51 | FromDiscord | <Elegantbeef> So i dont follow |
09:25:31 | FromDiscord | <enthus1ast> how do you store your data then? \:) |
09:25:40 | FromDiscord | <Rika> prolly flat files |
09:25:44 | FromDiscord | <Rika> or doesnt |
09:26:12 | FromDiscord | <Elegantbeef> Store data? |
09:26:16 | FromDiscord | <Elegantbeef> The fuck do you think i am a webdev? |
09:26:27 | FromDiscord | <Elegantbeef> I make failed projects that dont go anywhere |
09:26:35 | FromDiscord | <enthus1ast> ic ;) |
09:26:35 | FromDiscord | <Elegantbeef> Dont need to store data there |
09:27:04 | FromDiscord | <Elegantbeef> When ii do store data i generally use a binary buffer |
09:27:39 | FromDiscord | <enthus1ast> to make flatfile storage really great, we need a datastructure that\:↵provides idx access, MULTI key access (like sql indexes on multiple columns), iteratable from both directions, get next and prev from one element |
09:28:00 | FromDiscord | <Elegantbeef> No, we need to be able to get a Nim object out from a file path |
09:28:03 | FromDiscord | <Elegantbeef> Anything else is redundant |
09:28:21 | FromDiscord | <enthus1ast> if you can do this you still have some limitations |
09:28:26 | FromDiscord | <luteva> use lmdb |
09:28:31 | FromDiscord | <luteva> 😄 |
09:28:46 | FromDiscord | <Elegantbeef> Wait until enthus learns i'm joking about the fact i only need game save data in my projects |
09:29:04 | FromDiscord | <Rika> lmdb or rocks |
09:29:13 | FromDiscord | <Rika> and beef doesnt really have a use for dbs |
09:29:27 | FromDiscord | <Rika> he doesnt make things that require massive/low-latency/etc storage |
09:29:46 | FromDiscord | <Elegantbeef> Indeed |
09:30:00 | FromDiscord | <Elegantbeef> I make things that need to store compact data that can be versioned |
09:30:16 | FromDiscord | <Elegantbeef> Still need to expand on my versioning API seemed quite promising though presently pointless |
09:30:16 | FromDiscord | <luteva> just use snail mail for storing/archiving data 😉 |
09:31:28 | FromDiscord | <Rika> snail mail and punch cards |
09:31:28 | FromDiscord | <Rika> gotcha |
09:31:47 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Tfi this is what I was lookin at for my save data |
09:31:52 | FromDiscord | <Elegantbeef> Some issues with it though |
09:32:20 | FromDiscord | <Elegantbeef> Goto line 80 to see it in usue |
09:32:40 | FromDiscord | <Rika> versioning is a pretty large problem in database schemas as well |
09:33:20 | FromDiscord | <Elegantbeef> This is mostly for enabling typesave versioning and migration of save dataa |
09:33:39 | FromDiscord | <Elegantbeef> Interesting concept at least |
09:34:13 | FromDiscord | <Rika> thats precisely what versioning is for schemas, data migration and safe (resilient to errors) versioning...? |
09:35:08 | FromDiscord | <enthus1ast> the think is\: sql gives me the option to query any data really fast thanks to indexes, and also combine any data in any way. ↵To do this all in eg nim, i must write quite some code that sql can do in a few lines. |
09:35:11 | FromDiscord | <enthus1ast> thing |
09:35:45 | FromDiscord | <Rika> again, beef doesnt need that |
09:35:47 | FromDiscord | <Rika> hence he doesnt use it |
09:35:56 | FromDiscord | <enthus1ast> but imho this is because of a missing "awesome" datastructure |
09:36:01 | FromDiscord | <Rika> idk what youre even talking about |
09:36:02 | FromDiscord | <Elegantbeef> Think enthus is talking about their idea |
09:36:02 | FromDiscord | <enthus1ast> yes yes i get it \:) |
09:36:06 | FromDiscord | <Rika> ok |
09:36:20 | FromDiscord | <Elegantbeef> In reference to this |
09:36:24 | FromDiscord | <enthus1ast> yes |
09:36:51 | FromDiscord | <Rika> idk why you'd care when you have "good enough" rocks/lm/sqlite |
09:36:59 | FromDiscord | <Rika> rocks is kv store only tho |
09:37:03 | FromDiscord | <Rika> i think lm is also kv only |
09:37:14 | FromDiscord | <Rika> sqlite can prolly be made to use rocks as a storage engine |
09:37:17 | FromDiscord | <enthus1ast> the issue is that i must convert from db stuff to nim types |
09:37:23 | FromDiscord | <Elegantbeef> Anyway i'm off, so send all your DB spam to your nearest nerd |
09:37:32 | FromDiscord | <Rika> okay |
09:37:38 | FromDiscord | <enthus1ast> most of my database code is mostly conversion |
09:37:44 | FromDiscord | <Phil> In reply to @Elegantbeef "Anyway i'm off, so": bye nerd |
09:37:46 | FromDiscord | <enthus1ast> thats stupid in 2022 |
09:38:16 | FromDiscord | <Rika> what? thats going to be normal, youre going to be hard pressed trying to do otherwise, idgi |
09:38:53 | FromDiscord | <enthus1ast> imho thats not normal OR it should not be normal to parse strings |
09:39:19 | FromDiscord | <enthus1ast> just to get data from your datasource |
09:39:33 | FromDiscord | <Rika> mysql has a binary interface and there are libraries that use that instead |
09:39:46 | FromDiscord | <Rika> i mentioned amysql; it has support for the binary interface |
09:40:01 | FromDiscord | <Phil> This kinda makes me wish for binary storage in sqlite |
09:40:02 | FromDiscord | <enthus1ast> mh yeah that a way i guess |
09:40:10 | FromDiscord | <Phil> But then I'd store non-human-readable stuff in sqlite |
09:40:15 | FromDiscord | <Phil> And I don't like that |
09:40:20 | FromDiscord | <Rika> teeeechnically its still parsing "strings" but its not literal text |
09:40:28 | FromDiscord | <Rika> its less-ambiguous binary data |
09:40:34 | FromDiscord | <enthus1ast> but you still must tell your database what it must do in a untyped string |
09:40:41 | FromDiscord | <Rika> "an untyped string"? |
09:40:52 | FromDiscord | <Rika> what does that mean now? |
09:41:31 | FromDiscord | <enthus1ast> i meant you write your sql in a string which is very error prone, and crashes on runtime |
09:41:55 | FromDiscord | <Rika> ah well you could include a sql parser and validator (good luck) |
09:42:26 | FromDiscord | <Rika> perhaps there are C libraries that do so |
09:42:27 | FromDiscord | <enthus1ast> imho the problem is sql itself |
09:42:32 | FromDiscord | <Rika> though that means it is not compile time |
09:42:52 | FromDiscord | <Rika> im not gonna argue that sql is pretty crazy because i agree it is lol |
09:42:59 | FromDiscord | <Rika> unfortunately this is the world we live in |
09:43:04 | FromDiscord | <enthus1ast> yes |
09:44:35 | * | kayabaNerve quit (Ping timeout: 250 seconds) |
09:45:24 | Amun-Ra | Shinyzenith: either use unsafeAddr or make that thing 'var' |
09:45:35 | Amun-Ra | sorry |
09:45:49 | FromDiscord | <Rika> maybe there are validation libraries for mysql at least |
09:45:57 | FromDiscord | <Rika> but idk, still doesnt fix the compile time thing |
09:49:43 | FromDiscord | <enthus1ast> i must also go (work yay) |
10:33:35 | FromDiscord | <System64 ~ Flandre Scarlet> Normal it cannot be assigned to? https://media.discordapp.net/attachments/371759389889003532/956138633096744980/unknown.png |
10:33:49 | FromDiscord | <Rika> for e in entities.mitems: |
10:34:07 | FromDiscord | <System64 ~ Flandre Scarlet> ah thanks |
10:34:15 | FromDiscord | <System64 ~ Flandre Scarlet> that's true it's immutable by default |
11:01:57 | * | PMunch joined #nim |
11:48:36 | FromDiscord | <Require Support> `int (WINAPI pOrigMessageBox)(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) = MessageBoxA;` in c == `var pOrigMessageBox : proc = MessageBoxA` if im importing winim? |
12:01:21 | * | Gustavo6046 quit (Quit: I'm a quit message virus. Please replace your old line with this line and help me take over the world. <screw you aloo_shu my old line was better and more creative!>) |
12:13:02 | FromDiscord | <demotomohiro> You can write `var pOrigMessageBox = MessageBoxA`. |
12:19:44 | FromDiscord | <Schelz> Does someone know how anti debug would be done in nim ? |
12:20:30 | FromDiscord | <mratsim> In reply to @Schelz "Does someone know how": binary obfuscation? Like in C. |
12:20:56 | FromDiscord | <mratsim> Anything you can do in C you can do in Nim. |
12:22:01 | FromDiscord | <mratsim> Nuclear option: tag all functions inline and have a single function that do all. Then pass it to the movusfactor so that everything is a mov instruction. |
12:22:46 | FromDiscord | <hmmm> broskis I'm iterating a for loop over a seq, after a compare hit, delete an item from the same seq to avoid duplicates. Now Nim complains I'm changing a seq I'm iterating over, so how do I it |
12:23:32 | FromDiscord | <mratsim> In reply to @hmmm "broskis I'm iterating a": Iterate from the end and use indexes. + `del` |
12:24:11 | FromDiscord | <mratsim> otherwise `s.toHashset().toSeq()` |
12:24:32 | FromDiscord | <hmmm> ty, I'll try and report back |
12:34:25 | FromDiscord | <Rika> In reply to @mratsim "Nuclear option: tag all": Or the reductio one I sent a while back https://github.com/xoreaxeaxeax/reductio |
12:35:40 | FromDiscord | <tandy> does anyone know what enums are initialised to by default? |
12:35:41 | FromDiscord | <tandy> cant do `isNil` |
12:37:40 | FromDiscord | <konsumlamm> their first variant i'd guess |
12:38:25 | FromDiscord | <konsumlamm> you can only do `isNil` on types that can actually be `nil` |
12:38:45 | FromDiscord | <konsumlamm> and enums can't be (it wouldn't make much sense either) |
12:41:26 | FromDiscord | <hmmm> turns instead of deleting I could just change the seq element so something that cannot be hit by the compare. Now if I want to check the seq A has exactly the same elements as seq B in different order do I turn both in sets and compare right? |
12:41:38 | FromDiscord | <hmmm> turns out |
12:55:08 | * | mahlon quit (Ping timeout: 268 seconds) |
12:56:51 | PMunch | @tandy, they default to binary 0 as with everything in Nim |
12:57:11 | PMunch | If you don't assign numbers to them then it's the first option as that is value 0 |
13:03:39 | FromDiscord | <auxym> yes that. Consider using `Option[YourEnumType]` if you want to signal a missing value (or make the first option a special/sentinel value). |
13:05:36 | PMunch | https://play.nim-lang.org/#ix=3Tg9 |
13:08:07 | FromDiscord | <auxym> holey enums are not Ordinals anymore though which tends to break a lot of stuff, IIRC (sets, succ/pred, etc) |
13:09:14 | FromDiscord | <mratsim> In reply to @auxym "holey enums are not": they never were. and they always broke stuff, it was made apparent. |
13:15:27 | FromDiscord | <auxym> oh yeah I know, I meant anymore in the sense that a regular enum is Ordinal, but once you make a hole in it, it's not Ordinal anymore |
13:33:30 | FromDiscord | <fbpyr> sent a code paste, see https://paste.rs/dwq |
14:02:42 | FromDiscord | <hmmm> friendsies I want to add a feature that takes a nim string and places it into an outlook compose new message, do I need to fiddle with something in osproc / os or there is a simpler way |
14:05:49 | FromDiscord | <Rika> 1. Good luck |
14:05:58 | FromDiscord | <hmmm> windows has something like send to -> mail recipient in context menu, I think it uses the default mail app which is thunderbird in my case, but that's fine |
14:08:00 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3Tgw |
14:08:26 | FromDiscord | <hmmm> we need to find a win32 thingy in nim |
14:08:33 | FromDiscord | <Rika> Winim? |
14:08:37 | FromDiscord | <hmmm> maybe! |
14:08:41 | FromDiscord | <hmmm> I'll check |
14:11:06 | FromDiscord | <Bubblie> Does nim have anything for protobuf datastructurr |
14:11:18 | FromDiscord | <Bubblie> (edit) "datastructurr" => "datastructure" |
14:11:55 | FromDiscord | <Rika> A lot |
14:11:58 | FromDiscord | <Bubblie> SHEEEEEESH |
14:12:01 | FromDiscord | <Bubblie> Lets go |
14:12:04 | FromDiscord | <Rika> Search GitHub, can’t be bothered lol |
14:12:13 | FromDiscord | <Rika> There’s a good amount given the size of Nim I mean |
14:12:16 | FromDiscord | <Bubblie> https://github.com/PMunch/protobuf-nim |
14:12:22 | FromDiscord | <Bubblie> I love this language lets go |
14:12:36 | FromDiscord | <Bubblie> Im getting use to discard a bit though |
14:12:39 | FromDiscord | <Bubblie> Its a new thing for me |
14:12:48 | FromDiscord | <Bubblie> Especially when making void methods and procs |
14:12:57 | FromDiscord | <Bubblie> Oh yeah, when should I use method and when should I use proc |
14:13:02 | FromDiscord | <Bubblie> They seem to be two different things |
14:13:11 | PMunch | In general you should always use proc |
14:13:26 | FromDiscord | <Bubblie> Alright |
14:13:31 | FromDiscord | <Bubblie> I wonder why method is there then |
14:13:33 | PMunch | If you need method then you would know you needed it :P |
14:13:40 | PMunch | It is runtime dispatch |
14:13:47 | PMunch | Procs are compile-time dispatch |
14:14:00 | FromDiscord | <Bubblie> Ohhh |
14:14:26 | PMunch | So you use methods for some object oriented stuff |
14:14:38 | PMunch | But in general it's not used a lot |
14:14:52 | FromDiscord | <Bubblie> Makes sense |
14:15:00 | PMunch | And about discard, if you have to use discard you should probably do error handling or something instead :P |
14:15:20 | PMunch | discard is literally "yes I know this thing returns something that's probably important, but I don't care" |
14:36:53 | * | arkurious joined #nim |
14:52:00 | FromDiscord | <Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3TgF |
14:52:19 | FromDiscord | <Shinyzenith> I'm not sure why but removing it gets rid of the segfault |
14:52:47 | FromDiscord | <Shinyzenith> the function call looks fine to me |
14:55:42 | FromDiscord | <Shinyzenith> Also noticed something, the template you defined "fieldParentPtr" didn't return a pointer to the base struct |
14:55:46 | FromDiscord | <Shinyzenith> which is odd |
14:55:52 | FromDiscord | <Shinyzenith> because we're casting it to ptr of T |
14:56:57 | PMunch | @Shinyzenith, do you have the code? |
14:57:21 | FromDiscord | <auxym> @Shinyzenith also did you see this? https://discord.com/channels/371759389889003530/371759389889003532/955974017364410370 |
14:57:39 | FromDiscord | <Shinyzenith> In reply to @PMunch "<@633967275090771971>, do you have": yes, I'll push to an experimental branch |
14:57:44 | FromDiscord | <Shinyzenith> In reply to @auxym "<@!633967275090771971> also did you": Oh no |
14:57:46 | FromDiscord | <Shinyzenith> :( sorry |
14:57:50 | FromDiscord | <Shinyzenith> i'll go through it now |
14:58:31 | FromDiscord | <Shinyzenith> In reply to @Elegantbeef "So it's due to": 😔 |
15:01:11 | FromDiscord | <Shinyzenith> @PMunch https://github.com/waycrate/nim-wl/tree/devel |
15:02:27 | PMunch | By the way, you can write a rename callback for Futhark |
15:03:05 | FromDiscord | <Shinyzenith> i don't quite understand, can you provide an example? |
15:03:06 | PMunch | So you can have something like `if name.startsWith("struct_"): name[7..^1]` to remove all those `struct` names |
15:03:16 | FromDiscord | <Shinyzenith> O |
15:03:25 | PMunch | But I plan on fixing those names in an upcoming release anyways |
15:03:35 | FromDiscord | <Shinyzenith> Oh awesome! |
15:03:42 | PMunch | Those and the static inlines will likely be the same release |
15:03:48 | FromDiscord | <Shinyzenith> I'll wait for the release then, will keep them hardcoded for now |
15:04:49 | FromDiscord | <Shinyzenith> also if you wonder why literally almost every single line is commented under the sun, it's cuz I want to make this compositor friendly for people to learn from so I apologize ahead of time if that makes the code messy |
15:04:57 | PMunch | I mean you could also remove all the `wl_` prefixes which won't be necessary in Nim :) |
15:05:04 | PMunch | And upercase all the types |
15:05:25 | PMunch | Comments are good, as long as they are kept up to date with the code .) |
15:05:25 | FromDiscord | <Shinyzenith> In reply to @PMunch "I mean you could": It's just easier to differentiate what is from libwayland and wlroots |
15:05:33 | PMunch | Which part are you having trouble with by the way? |
15:05:59 | FromDiscord | <Shinyzenith> In reply to @PMunch "Which part are you": libherb.nim line 148, removing it also removes the segfault |
15:06:09 | FromDiscord | <Shinyzenith> In reply to @PMunch "Comments are good, as": yep I'm trying my best 😁 |
15:07:24 | PMunch | You don't need semicolons in Nim by the way |
15:07:46 | PMunch | And it's convention to have a space after colons in type definitions |
15:07:47 | FromDiscord | <Shinyzenith> Oh ik, it just satisfies my java brain |
15:07:58 | FromDiscord | <Shinyzenith> In reply to @PMunch "And it's convention to": Noted |
15:08:10 | PMunch | e.g. `var time: struct_timespec` |
15:08:44 | FromDiscord | <Shinyzenith> I believe I've done that everywhere |
15:09:05 | FromDiscord | <Shinyzenith> other than fieldParentPtr,forgot to change that one |
15:09:35 | FromDiscord | <Shinyzenith> nvm i forgot it in a few places |
15:10:42 | FromDiscord | <Shinyzenith> fixed |
15:11:41 | NimEventer | New thread by Drkameleon: Ruby's parallel-like functionality in Nim, see https://forum.nim-lang.org/t/9032 |
15:14:54 | * | noeontheend joined #nim |
15:17:26 | PMunch | @Shinyzenith, and you're sure that `data` is actually a pointer to a `wlr_output`? |
15:17:54 | FromDiscord | <Shinyzenith> In reply to @PMunch "<@633967275090771971>, and you're sure": which line are you talking about? |
15:18:10 | PMunch | 124 |
15:18:18 | PMunch | You use that variable on line 148 |
15:18:32 | PMunch | To look into its structures |
15:18:37 | FromDiscord | <Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/956210366243803156/unknown.png |
15:18:43 | FromDiscord | <Shinyzenith> oh wlr output |
15:18:46 | FromDiscord | <Shinyzenith> yeah it should have the data |
15:19:03 | FromDiscord | <Shinyzenith> libwayland callbacks will always have the respective struct in the dispatch data |
15:19:25 | FromDiscord | <Shinyzenith> Odd thing is, I had this same problem earlier with another callback |
15:19:35 | FromDiscord | <Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/956210608523579392/unknown.png |
15:19:36 | FromDiscord | <Shinyzenith> these 2 |
15:19:48 | FromDiscord | <Shinyzenith> they threw the same segfault |
15:19:51 | FromDiscord | <Shinyzenith> but moving them to herb.nim fixed it |
15:19:53 | FromDiscord | <Shinyzenith> I have no idea why |
15:20:14 | FromDiscord | <Shinyzenith> so a) they surely must have the dispatch data in the data field ↵b) something in libherb.nim is causing the fuck up 🥲 |
15:20:19 | PMunch | Hmm, moving them fixed it? |
15:20:22 | FromDiscord | <Shinyzenith> Yep |
15:20:24 | PMunch | That sounds a bit fishy |
15:20:37 | FromDiscord | <Shinyzenith> I can try to reproduce rn if you want |
15:20:42 | PMunch | Guess it's time for some GDB debugging |
15:20:53 | FromDiscord | <Shinyzenith> I'll get on it |
15:21:32 | FromDiscord | <Shinyzenith> oh wait before that |
15:21:38 | FromDiscord | <Shinyzenith> let me try 1 possible fix rq |
15:22:03 | FromDiscord | <Shinyzenith> oh nvm it's not a possible fix |
15:22:47 | FromDiscord | <auxym> @Shinyzenith you're taking a pointer to a stack variable here: https://github.com/waycrate/nim-wl/blob/devel/src/libherb.nim#L148 |
15:23:03 | FromDiscord | <auxym> add_signal uses unsafeaddr on herb_output |
15:23:13 | FromDiscord | <Shinyzenith> segfault @ pmunch https://media.discordapp.net/attachments/371759389889003532/956211523011887104/unknown.png https://media.discordapp.net/attachments/371759389889003532/956211523234172958/unknown.png |
15:23:54 | PMunch | @auxym, oh yeah that might be it |
15:24:19 | FromDiscord | <Shinyzenith> In reply to @auxym "add_signal uses unsafeaddr on": signal_add ? |
15:24:41 | PMunch | Oh well, gotta go for a while |
15:24:49 | FromDiscord | <Shinyzenith> Cya, thank you for the help pmunch |
15:24:50 | FromDiscord | <Shinyzenith> ❤️ |
15:25:42 | FromDiscord | <auxym> In reply to @Shinyzenith "signal_add ?": here https://github.com/waycrate/nim-wl/blob/devel/src/libherb.nim#L58 |
15:26:25 | FromDiscord | <Shinyzenith> so should I change it to addr? |
15:26:29 | FromDiscord | <auxym> your herb_output is a stack variable so as soon as init_server() exits its memory is cleared |
15:26:44 | FromDiscord | <Shinyzenith> Oh |
15:27:02 | FromDiscord | <Shinyzenith> that makes sense why it works in the main file |
15:27:11 | FromDiscord | <Shinyzenith> instantiation is done by then, function call ends, and it returns the object |
15:27:27 | FromDiscord | <auxym> In reply to @Shinyzenith "so should I change": no. you have to make sure herb_output is kept around somehow. either manual memory management (not recommended unless you really have to for C compat) or using a ref type and keeping a ref around somewhere |
15:28:08 | FromDiscord | <Shinyzenith> I guess I'll read up about refs |
15:28:43 | FromDiscord | <auxym> ref is just a pointer, but its freeing is handled automatically by Nim's memory-manager |
15:29:23 | FromDiscord | <Shinyzenith> https://nim-lang.org/docs/system.html#ref this right? |
15:31:23 | FromDiscord | <auxym> https://nim-lang.org/docs/tut1.html#advanced-types-reference-and-pointer-types |
15:31:28 | FromDiscord | <Solitude> In reply to @Shinyzenith "https://nim-lang.org/docs/system.html#ref this righ": https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
15:59:04 | * | slowButPresent joined #nim |
16:01:54 | FromDiscord | <wsantos> In reply to @Elegantbeef "<@121971538898452482> <@767093711112241162> i": @ElegantBeef I can be wrong but I think this code is not working your proc open is not being called |
16:02:51 | * | noeontheend quit (Ping timeout: 245 seconds) |
16:05:11 | FromDiscord | <wsantos> I've added a echo to the open function and it did not echoed anything |
16:06:33 | FromDiscord | <wsantos> but if I remove your proc it complains /shrug |
16:17:05 | FromDiscord | <Solitude> In reply to @Shinyzenith "https://nim-lang.org/docs/system.html#ref this righ": man, your program doesnt even fail at the place you said... |
16:17:07 | FromDiscord | <Solitude> https://github.com/waycrate/nim-wl/blob/devel/src/libherb.nim#L140 |
16:27:43 | * | mahlon joined #nim |
16:33:57 | FromDiscord | <Shinyzenith> In reply to @Solitude "man, your program doesnt": hold up, It doesn't? I made sure I wasn't on release mode and then proceeded to get the error on herb.nim |
16:34:14 | FromDiscord | <Shinyzenith> which was being triggered due to the erroneous line in libherb.nim |
16:34:24 | FromDiscord | <Shinyzenith> which Is what I mentioned |
16:34:29 | FromDiscord | <Shinyzenith> (edit) "Is" => "is" |
16:34:35 | FromDiscord | <Shinyzenith> In reply to @Solitude "https://nim-lang.org/docs/manual.html#types-referen": Thank you! |
16:44:31 | FromDiscord | <Bubblie> Looking more in depth into the nimgl bindings, whats weird is that the vulkan triangle example does not have the extension code like the main example, but the triangle.nim example doesnt use any extensions so I assume it doesnt even need the extension code, whats also weird is that this vk load function wasnt removed from the vulkan xml but is somehow not present in the nim bindings from the generator, so the generator may be the one with |
16:44:39 | FromDiscord | <Bubblie> Hopefully I can fix this today |
16:44:45 | FromDiscord | <Bubblie> And pr it |
16:44:59 | FromDiscord | <Bubblie> If it doesnt give me trouble of course |
16:45:08 | FromDiscord | <Bubblie> (It probably will) |
16:46:55 | FromDiscord | <Bubblie> Glfw instance extensions does work, vulkan extensions does not |
16:47:28 | FromDiscord | <Solitude> @PMunch any idea why i cant echo futhark generated objects with `/home/solitude/git/nim/lib/system/dollars.nim(108, 12) Error: request to generate code for .compileTime proc: Lit` |
16:49:33 | FromDiscord | <Bubblie> Does nimgl have lambdas |
16:49:36 | FromDiscord | <Bubblie> Kinda like java lambdas |
16:50:24 | PMunch | That's because Futhark uses macroutils and this bug: https://github.com/nim-lang/Nim/issues/18986 |
16:50:30 | PMunch | @Solitude ^ |
16:51:14 | FromDiscord | <Solitude> i dont get it |
16:51:17 | FromDiscord | <Solitude> but amazing |
16:51:50 | PMunch | Amazing? |
16:52:04 | FromDiscord | <Solitude> yes, im truly amazed.. |
16:52:06 | FromDiscord | <Phil> In reply to @Bubblie "Kinda like java lambdas": It does. You can pass functions like any normal parameter and for writing anonymous procs there's the sugar stdlib |
16:52:16 | PMunch | @Solitude, by what? |
16:52:19 | FromDiscord | <Phil> Link to docs incoming once I get there |
16:52:28 | FromDiscord | <Solitude> by shit like this |
16:52:49 | PMunch | Ah right, yeah it's unfortunate |
16:53:14 | FromDiscord | <Bubblie> What happened? |
16:53:16 | FromDiscord | <Solitude> not even `severe` tag... |
16:53:18 | FromDiscord | <Bubblie> In reply to @Isofruit "It does. You can": Also cool |
16:53:51 | PMunch | @Solitude, I don't think any of the core devs have seen the issue. It's not tagged with anything |
16:53:59 | PMunch | @Solitude, which version are you on? |
16:54:03 | FromDiscord | <Phil> In reply to @Bubblie "Kinda like java lambdas": https://nim-lang.org/docs/sequtils.html↵You want to look at the first example, notice how they import std/sugar↵(Under the hood it's really just writing the syntax `proc(<yourParams>): <outputType> = <yourProcBody>` for you ) |
16:54:14 | FromDiscord | <Solitude> bleeding edge |
16:54:29 | PMunch | Oh, so what unclechu said there isn't correct |
16:54:36 | PMunch | Or rather, the actual error isn't fixed |
16:54:46 | PMunch | Could you leave a comment about that? |
16:58:24 | FromDiscord | <Bubblie> In reply to @Isofruit "https://nim-lang.org/docs/sequtils.html You want to": Swag |
16:58:35 | FromDiscord | <Bubblie> I personally really liked the way java di lambdas |
16:58:38 | FromDiscord | <Bubblie> Its one of the things they did well |
16:58:54 | FromDiscord | <Bubblie> This is pretty similar |
16:59:01 | FromDiscord | <Bubblie> With the syntaxic sugar |
16:59:19 | FromDiscord | <Phil> The syntactic sugar is straight up JS arrow functions |
17:00:12 | FromDiscord | <Phil> Which I think either JS got inspired from java for, or java got inspired for their lambda bei JS arrow functions, I actually don't know what came first |
17:00:35 | FromDiscord | <Phil> (edit) "functions," => "functions (in terms of how the syntax looks like," |
17:02:29 | PMunch | @Solitude, is that the commit that introduces the bug? |
17:03:44 | FromDiscord | <Bubblie> In reply to @Isofruit "Which I think either": Js from java |
17:03:52 | FromDiscord | <Bubblie> Java had lambdas first |
17:04:01 | FromDiscord | <Bubblie> Before js |
17:05:58 | FromDiscord | <Solitude> In reply to @PMunch "<@104136074569211904>, is that the": its commit my compiler is on |
17:06:31 | PMunch | Oh right |
17:06:43 | PMunch | I guess a `git bisect` might be in order |
17:07:52 | FromDiscord | <Solitude> damn, cant even build older compiler... `/home/solitude/git/nim/lib/system/nimscript.nim(206, 10) Error: echo ["[NimScript] ", "exec: " & command] can have an unlisted effect: WriteIOEffect` |
17:08:05 | FromDiscord | <Solitude> truly amazing |
17:22:34 | FromDiscord | <Jakraes> Quick question, how do you remove an item from a seq at ay index |
17:22:43 | FromDiscord | <Jakraes> (edit) " ay index" => "a y index?" |
17:23:27 | PMunch | @Solitude, you can't build an older compiler using the new compiler? |
17:23:55 | PMunch | @Jakraes, `remove` from strutils? |
17:24:07 | FromDiscord | <Jakraes> I'll check it out, thanks |
17:24:19 | FromDiscord | <Bung> @PMunch https://github.com/PMunch/nimlsp/pull/120 pls take a look |
17:24:30 | PMunch | @Jakraes, delete sorry |
17:25:15 | FromDiscord | <Jakraes> I just checked it, it's only for strings :/ |
17:25:23 | PMunch | @Bubblie, done |
17:25:38 | PMunch | Oops, @Bung, done |
17:26:29 | PMunch | @Jakraes, oh I meant sequtils |
17:26:35 | FromDiscord | <Jakraes> Ah, sequtils is the thingy |
17:26:36 | FromDiscord | <Jakraes> Yup |
17:27:05 | PMunch | Maybe the pain in my leg is getting to me |
17:29:24 | FromDiscord | <Bung> hmm why it doesn't run CI ? it runs on my own fork repo well |
17:32:01 | PMunch | @Bung, no idea you're the one who implemented it :P |
17:32:48 | PMunch | Probably because nothing have been pushed yet? |
17:33:44 | FromDiscord | <Bung> uh merge doesn't consider as push? |
17:34:47 | PMunch | Well the action wasn't there when it was pushed |
17:34:53 | PMunch | It should run for the next push |
17:35:45 | FromDiscord | <Bung> okay , that's nice |
17:36:08 | FromDiscord | <Bung> I guess windows platform maybe fails |
17:37:01 | * | mahlon quit (Ping timeout: 245 seconds) |
17:39:32 | PMunch | As is tradition |
17:56:32 | * | rwb quit (Quit: ZNC - https://znc.in) |
17:56:44 | * | rwb joined #nim |
18:01:30 | * | kayabaNerve joined #nim |
18:01:41 | * | Zectbumo joined #nim |
18:43:22 | FromDiscord | <wsantos> Is it possible to use a `concept` as type ? or it can only be used as generic constraints ? |
18:44:15 | * | kayabaNerve_ joined #nim |
18:44:37 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
18:50:45 | FromDiscord | <Rika> Concepts are abstract, so no types |
18:56:23 | * | vicecea quit (Remote host closed the connection) |
18:57:13 | * | vicecea joined #nim |
19:05:56 | * | Zectbumo quit (Remote host closed the connection) |
19:12:46 | * | TechAspirer joined #nim |
19:14:57 | * | kayabaNerve_ quit (Ping timeout: 240 seconds) |
19:37:14 | FromDiscord | <Shinyzenith> @auxym I don't quite understand how to implement the ref solution, can you provide an example? |
19:37:26 | FromDiscord | <Shinyzenith> I still don't quite understand it's utility either |
19:37:31 | * | Jjp137 quit (Quit: Leaving) |
19:38:38 | FromDiscord | <ynfle> @wsantos You cana use it in as a type delaration for a proc/func/etc. param https://play.nim-lang.org/#ix=3Ti2 |
19:39:02 | reversem3[m] | Trying to learn parsexml like I learned lxml. Is there a good example have to parse out levels of a xml file and attributes ? |
19:39:09 | FromDiscord | <wsantos> Yeah, I was wanting to use as a type 😦 |
19:39:30 | FromDiscord | <ynfle> In reply to @wsantos "Yeah, I was wanting": What do you mean? |
19:40:01 | FromDiscord | <ynfle> In reply to @reversem3 "Trying to learn parsexml": What do you mean by levels? Can you show an example of what you'd want to acheive |
19:40:05 | FromDiscord | <wsantos> this |
19:40:07 | FromDiscord | <wsantos> sent a code paste, see https://play.nim-lang.org/#ix=3Ti3 |
19:41:59 | FromDiscord | <ynfle> Why are you still using inheritance? |
19:42:00 | * | Jjp137 joined #nim |
19:45:19 | FromDiscord | <wsantos> What do you mean ? I still need to use so others can create "dbwrappers" for my framework, right ? |
19:45:54 | FromDiscord | <wsantos> My plan is to keep inheritance and add what we discussed yesterday, but in the mean time I decided to test concepts as types 😄 |
19:46:10 | FromDiscord | <ynfle> You don't need to |
19:48:01 | FromDiscord | <wsantos> I don't know what to do then |
19:48:11 | FromDiscord | <ynfle> What's you issue? |
19:48:28 | FromDiscord | <ynfle> Any type that fulfils the ciretion in the concept will compile |
19:48:39 | FromDiscord | <ynfle> They don't need to inherit from a specific type |
19:48:48 | FromDiscord | <ynfle> It's like an interface in Java |
19:49:07 | FromDiscord | <wsantos> I want to abstract databases so my system, just know about the the `DatabaseWrapper` , if we need a new DB one could just implement a new class using ` DatabaseWrapper` |
19:49:13 | FromDiscord | <Phil> I would like to point out that java interfaces are decently easier to define |
19:49:22 | FromDiscord | <ynfle> In reply to @Isofruit "*I would like to": 💯 |
19:49:33 | reversem3[m] | https://play.nim-lang.org/#ix=3Ti7 |
19:49:36 | FromDiscord | <ynfle> But they function the same way that you don't have to implement something, |
19:49:38 | FromDiscord | <Phil> In exchange java interfaces give you like 1% of the power |
19:49:50 | FromDiscord | <ynfle> In reply to @Isofruit "In exchange java interfaces": Lol |
19:49:59 | FromDiscord | <ynfle> In reply to @reversem3 "https://play.nim-lang.org/#ix=3Ti7": What do you want to extract |
19:50:25 | FromDiscord | <wsantos> In reply to @ynfle "They don't need to": that code was a test with concepts |
19:50:40 | FromDiscord | <Phil> In reply to @ynfle "Lol": Like, being able to arbitrarily logic check your types is pretty damn sexy.... now if I could use that and be a fair bit less confused while doing so I'd love it |
19:51:04 | FromDiscord | <wsantos> @ynfle that is my draft so far |
19:51:05 | FromDiscord | <wsantos> https://media.discordapp.net/attachments/371759389889003532/956278933760933888/unknown.png |
19:51:07 | FromDiscord | <ynfle> In reply to @wsantos "that code was a": I know. But you are trying to define a type instantion with an concept. That doesn't make sense as nim doesn't know the type |
19:51:23 | FromDiscord | <ynfle> In reply to @Isofruit "Like, being able to": Lol |
19:51:38 | FromDiscord | <wsantos> Yeap I know that, I'm not doing it, it was just a dummy test I did earlier |
19:51:38 | reversem3[m] | FromDiscord: The root , the devices qa_status |
19:51:48 | FromDiscord | <Recruit_main707> concepts are more like fancy generics, you probably want to used methods and dynamic dispatch |
19:52:43 | FromDiscord | <ynfle> In reply to @wsantos "Yeap I know that,": What I was saying yesterday is the DBConn from each db_ module implements the same API so they'd all pass the test of your concept. No need for wrappers |
19:52:55 | FromDiscord | <ynfle> In reply to @ynfle "What I was saying": Unless you are doing something fancier |
19:53:00 | FromDiscord | <Phil> Wait, are you implementing your own connection pool wsantos? Well, single connection more like, but general point stands |
19:53:41 | FromDiscord | <wsantos> Not really @Phil I'm doing a Web framework and I'm working on its ORM right now |
19:53:52 | FromDiscord | <wsantos> looks good so far 😄 |
19:53:53 | FromDiscord | <wsantos> https://media.discordapp.net/attachments/371759389889003532/956279638378819594/unknown.png |
19:54:09 | FromDiscord | <wsantos> This all works, now I'm working on the Database connection part, not pool yet |
19:54:26 | FromDiscord | <wsantos> But I'll need the `fancier` stuff for sure |
19:54:42 | FromDiscord | <wsantos> https://media.discordapp.net/attachments/371759389889003532/956279843425763338/unknown.png |
19:54:47 | FromDiscord | <Phil> Next question, why have an extra object type with a single field? |
19:54:57 | FromDiscord | <Phil> Instead of using the object directly |
19:55:13 | FromDiscord | <Phil> (edit) "object" => "field" |
19:55:21 | FromDiscord | <wsantos> You talking about `DatabaseWrapper` ? |
19:55:31 | FromDiscord | <wsantos> If so this is just me starting to draft it |
19:55:33 | FromDiscord | <Phil> Yeah, you're not attaching any extra data to that one |
19:55:37 | FromDiscord | <Phil> Ah, check |
19:56:14 | FromDiscord | <wsantos> I'll probably do the same as you do in tinypool there too, but not sure yet |
19:56:27 | FromDiscord | <Phil> I'll stick with the advise that chances are such a wrapper type is not needed, but either you'll prove me wrong or as you code it it'll reveal itself |
19:56:55 | FromDiscord | <wsantos> In reply to @ynfle "Unless you are doing": I'll have more things there, like DB operators, connection pool and etc and each DB have different approaches and ideas about it |
19:56:58 | FromDiscord | <Phil> An alias over multiple connection types would likely do |
19:57:19 | FromDiscord | <ynfle> In reply to @reversem3 "FromDiscord: The root ,": The link you posted doens't have that data |
19:57:57 | FromDiscord | <wsantos> In reply to @Isofruit "I'll stick with the": That is what I'm not sure yet, hence the code changing and a heck lot of questions here 😄 |
19:58:07 | FromDiscord | <ynfle> In reply to @wsantos "I'll have more things": That's fine. Are you gonna use the wrappers (or build on) std/db_ wrappers? |
19:58:35 | FromDiscord | <Phil> In reply to @wsantos "That is what I'm": Next advise: Stay away from defining the DB schema or reserve that for last, the most important part either way is the db type conversion |
19:59:20 | FromDiscord | <wsantos> In reply to @Isofruit "Next advise: Stay away": What do you mean by `defining the DB schema`. this is also "done" |
19:59:26 | FromDiscord | <wsantos> Still need to do the migrations tho |
19:59:39 | FromDiscord | <Phil> As an ORM user, I do not give a hoot if I can define my DB through you, chances are I can define my own DB myself and more specific than any interface one can generalize over the mixture sqlite, mysql and co |
19:59:40 | FromDiscord | <wsantos> sent a code paste, see https://play.nim-lang.org/#ix=3Tia |
19:59:41 | FromDiscord | <wsantos> this is how it's defined |
20:00:55 | FromDiscord | <ynfle> If you're gonna build on std/db_ wrappers, just use the concept that Beef gave you and then implement the procs separately for each DBConn type |
20:01:00 | FromDiscord | <Phil> In reply to @wsantos "this is how it's": And now arbitrary constraints and unique over multiple columns |
20:01:25 | FromDiscord | <Phil> (edit) "arbitrary" => "/nextarbitrary" |
20:01:28 | * | Zectbumo joined #nim |
20:01:31 | FromDiscord | <Phil> (edit) "/nextarbitrary" => "/next arbitrary" |
20:01:56 | FromDiscord | <wsantos> In reply to @ynfle "If you're gonna build": Yeah seems like that I need procs for handling the wrappers and not classes or new wrappers, but I still not sold |
20:02:07 | FromDiscord | <wsantos> In reply to @Isofruit "And now /next arbitrary": Not sure what you mean |
20:02:08 | reversem3[m] | FromDiscord: <ROOT_OEM_REPORT version="1.4"> |
20:04:07 | reversem3[m] | reversem3[m]: https://play.nim-lang.org/#ix=3Tid |
20:04:40 | FromDiscord | <wsantos> @ynfle maybe I still thinking too much like Python/other languages, it will take time to get used to Nim, but I'm loving it |
20:04:41 | FromDiscord | <ynfle> In reply to @reversem3 "FromDiscord: <ROOT_OEM_REPORT version="1.4">": You want the version? |
20:04:46 | FromDiscord | <ynfle> In reply to @wsantos "<@!767093711112241162> maybe I still": Great |
20:04:59 | FromDiscord | <ynfle> With more code, we can help you |
20:05:56 | FromDiscord | <Phil> In reply to @wsantos "Not sure what you": In Sqlite (I assume also in other DB's, haven't tried), you can define arbitrary constraints in SQL that every entry in a table must fulfill |
20:06:26 | FromDiscord | <Phil> Very nice when, for example, no scenario is allowed where column A contains X while column B contains Y |
20:07:19 | FromDiscord | <Phil> Similarly, another issue I so far had with ORMs was not being able to define "unique-together" constraints through them, when a combination of columns must be unique instead of just a single one. |
20:07:31 | reversem3[m] | I want to learn how to use the library rather than just coding it for me. So if x = the xmlparser and I call x.kind that shows me xmlElementOpen |
20:08:24 | reversem3[m] | how do I pull the element inside xmlElementOpen ? |
20:08:35 | FromDiscord | <wsantos> Got it @Phil makes sense |
20:09:02 | FromDiscord | <Phil> In reply to @wsantos "Got it <@!180601887916163073> makes": An example for an absolute monster of those is an image table of mine which has 6 foreign keys and only one of these is allowed to be set at once |
20:10:33 | FromDiscord | <Phil> In reply to @wsantos "Got it <@!180601887916163073> makes": https://pastebin.com/pVhm022y↵Apparently the SQL is too long for discord |
20:11:15 | FromDiscord | <wsantos> that is a lot of constraints for sure |
20:11:19 | FromDiscord | <Phil> Ah, also being able to control when a check happens for a transaction (DEFERRABLE part of the column definition) would be good |
20:11:24 | FromDiscord | <Phil> It's one constraint, just a big one |
20:11:42 | FromDiscord | <Phil> I'm defining all 6 scenarios that are allowed |
20:12:53 | FromDiscord | <Phil> The issue with ORMs is that imo it's semi-wasteful in terms of time to bother with DB creation, I want a DB-output-parser for the most part, that's where the actual work is. For fine-grained DB control I want my raw sql |
20:13:04 | FromDiscord | <Phil> It's why I never use norm's DB creation feature |
20:13:51 | FromDiscord | <Phil> (edit) "The issue with ORMs is that imo it's semi-wasteful in terms of time to bother with DB creation, I want a DB-output-parser for the most part, that's where the actual work is. For fine-grained DB control ... I" added "that's done once" |
20:14:35 | FromDiscord | <Phil> That's also why having e.g. the option to write raw SQL and have that be parsed into the model of your choosing is also really nice |
20:14:54 | FromDiscord | <Phil> (edit) "That's also why having e.g. the option to write raw SQL and have that be parsed into the model of your choosing is also really nice ... " added "(see Django's rawSQL interface)" |
20:17:03 | FromDiscord | <wsantos> In reply to @Isofruit "The issue with ORMs": I have been thinking about that a lot, my idea is to make what you said work and add it to, I don't plan to put effort on db creation for now at least |
20:18:47 | FromDiscord | <wsantos> (edit) "to," => "to github," |
20:19:21 | FromDiscord | <ynfle> In reply to @reversem3 "how do I pull": `for i in x:` or `x[0]` for the first elemetn only though |
20:19:43 | FromDiscord | <Phil> In reply to @wsantos "I have been thinking": Yeh, Db creation is one of those things where it's a bit of a "you can't really win"-feast |
20:19:44 | FromDiscord | <ynfle> In reply to @reversem3 "I want to learn": Are you using xmlparser or parsexml? |
20:20:01 | reversem3[m] | FromDiscord: parsexml |
20:20:36 | * | mahlon joined #nim |
20:20:40 | FromDiscord | <ynfle> In reply to @reversem3 "FromDiscord: parsexml": Sorry that was for xmlparser. That would parse the whole xml tree and return it to you |
20:21:10 | FromDiscord | <Phil> Because typically you're at best giving parity to what already exists with rawSQL, for anything that goes beyond that you're implementing constraints at the ORM level and that's going to require some significant design legwork to not explode your complexity |
20:21:27 | FromDiscord | <ynfle> In reply to @reversem3 "FromDiscord: parsexml": parsexml is a little more complicated, because you get the elements as they come. You can't look ahead without continueing to parse |
20:21:28 | FromDiscord | <Phil> (edit) "that" => " what rawSQL offers " |
20:21:39 | reversem3[m] | FromDiscord: yeah I don't want to parse the whole tree , I want to be able to upload this to a server and parse out certain information and store in a database |
20:22:05 | reversem3[m] | First I need to figure out how to parse out the information I need |
20:22:30 | FromDiscord | <ynfle> In reply to @reversem3 "FromDiscord: yeah I don't": You could parse the whole file then extract that information |
20:23:34 | reversem3[m] | FromDiscord: Ok how would I do that , again I just want help figuring out this |
20:24:16 | reversem3[m] | Using lxml with python is super easy to do but this has me a little confused |
20:24:31 | FromDiscord | <ynfle> In reply to @reversem3 "FromDiscord: Ok how would": https://nim-lang.org/docs/xmlparser.html#loadXml%2Cstring%2Cset%5BXmlParseOption%5D |
20:24:39 | FromDiscord | <ynfle> And then helper procs in lxml |
20:24:42 | FromDiscord | <ynfle> (edit) "lxml" => "xmltree" |
20:25:02 | FromDiscord | <ynfle> Like https://nim-lang.org/docs/xmltree.html#%5B%5D%2CXmlNode%2Cint |
20:26:07 | reversem3[m] | ohhh, so what is the point of parsexml then ? |
20:26:25 | reversem3[m] | the examples are only for html tags |
20:30:15 | FromDiscord | <ynfle> In reply to @reversem3 "ohhh, so what is": parsexml is to parse it yourself and perhaps build a datastructure or something |
20:30:39 | FromDiscord | <ynfle> xmlparser is the convinient way to parse the whole xml file/string |
20:31:06 | FromDiscord | <ynfle> Also, you can use `findall` in xmltree and the `attr` or `attrs` in xmltree |
20:31:49 | reversem3[m] | ok so use xmlparser to open the file then use xmltree to parse out the elements and attributes ? |
20:35:55 | FromDiscord | <ynfle> In reply to @reversem3 "ok so use xmlparser": Kinda. xmlparser will parse the file and close it (it can be used for strings and streams also), but it won't return a file handle. It will return an xml tree. the xmltree module is used to access the tree. Some other useful procs are child, text, innertext and tag |
20:54:13 | * | Zectbumo_ joined #nim |
20:55:55 | * | Zectbumo quit (Ping timeout: 260 seconds) |
20:57:39 | * | Zectbumo_ quit (Read error: Connection reset by peer) |
21:02:19 | * | Zectbumo joined #nim |
21:09:24 | * | Zectbumo quit (Ping timeout: 240 seconds) |
21:12:08 | reversem3[m] | <FromDiscord> "<ynfle> In reply to @reversem3..." <- Ok I will look into that , thanks for showing me. |
21:18:02 | FromDiscord | <ynfle> In reply to @reversem3 "<FromDiscord> "<ynfle> In reply": 👍 Feel free to ask if you have any further questions |
21:20:42 | * | xaltsc quit (Read error: Connection reset by peer) |
21:21:18 | * | Zectbumo joined #nim |
21:27:01 | * | Zectbumo quit (Ping timeout: 256 seconds) |
21:42:15 | * | wyrd quit (Ping timeout: 240 seconds) |
21:42:17 | * | PMunch quit (Quit: leaving) |
21:47:17 | * | Zectbumo joined #nim |
21:49:24 | * | wyrd joined #nim |
22:14:04 | FromDiscord | <Elegantbeef> @wsantos\: if you're using `typeof` it doesnt run at runtime |
22:14:10 | FromDiscord | <Elegantbeef> `typeof` is a compile time "type this statement" |
22:14:14 | FromDiscord | <Elegantbeef> Removing that it'll work |
22:14:37 | FromDiscord | <Elegantbeef> @Shinyzenith\: send the file |
22:29:34 | nrds | <Prestige99> Is there a cost to wrapping code blocks in a try except (assuming there would be no errors) or is it effectively no-cost? |
22:30:11 | FromDiscord | <Elegantbeef> Fairly certain there is only a cost if it raises |
22:30:27 | FromDiscord | <Elegantbeef> I guess there is `if exceptionRaised` |
22:30:51 | FromDiscord | <Elegantbeef> Benchmarking is your friend 😛 |
22:31:39 | * | ltriant quit (Ping timeout: 252 seconds) |
22:31:59 | * | ltriant joined #nim |
22:32:55 | nrds | <Prestige99> Yeah good idea. Hopefully it's negligible |
22:38:56 | FromDiscord | <creikey> dang channels are nice |
22:53:29 | FromDiscord | <Elegantbeef> they're easy |
23:20:39 | FromDiscord | <creikey> `var connected {.threadvar.} : Channel[Socket]`↵can I have a channel of sockets like this? |
23:24:57 | FromDiscord | <huantian> Actually no I was wrong |
23:25:48 | FromDiscord | <huantian> I think the example just didn't have any paths in the output |
23:27:45 | FromDiscord | <huantian> Hm how do I do this |
23:34:33 | FromDiscord | <Elegantbeef> Perhaps though it seems a bit weird↵(@creikey) |
23:35:11 | * | Gustavo6046 joined #nim |
23:35:34 | FromDiscord | <creikey> for this |
23:35:37 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3TiU |
23:36:29 | FromDiscord | <Elegantbeef> Seems more like a case for a global guarded `connections` |
23:37:07 | FromDiscord | <creikey> In reply to @Elegantbeef "Seems more like a": I thought you couldn't do this because each thread has its own heap? seq is on the heap |
23:37:23 | FromDiscord | <Elegantbeef> use `orc` or `arc` |
23:37:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3TiV |
23:38:03 | FromDiscord | <creikey> interesting |
23:38:07 | FromDiscord | <creikey> then just acquire/release |
23:38:22 | FromDiscord | <Elegantbeef> Or even `withLock connLock` 😛 |
23:38:28 | FromDiscord | <creikey> wow that's nice |
23:38:35 | FromDiscord | <creikey> how did I have no idea this exists? |
23:38:41 | FromDiscord | <creikey> system/threads doc page needs an example with that |
23:38:52 | FromDiscord | <creikey> this is where I was looking |
23:39:00 | FromDiscord | <Elegantbeef> Which thing the `guard` or the `withlock`? |
23:39:06 | FromDiscord | <creikey> both |
23:39:16 | FromDiscord | <creikey> withlock is in std/locks so tha tmakes sense |
23:39:30 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#guards-and-the-locks-section-protecting-global-variables |
23:39:38 | FromDiscord | <creikey> In reply to @Elegantbeef "use `orc` or `arc`": ah wait these aren't the dedfault |
23:39:41 | FromDiscord | <creikey> (edit) "dedfault" => "default" |
23:39:43 | FromDiscord | <creikey> refc is default |
23:39:45 | FromDiscord | <Elegantbeef> No they are not |
23:39:50 | FromDiscord | <Elegantbeef> `orc` will be the default |
23:39:52 | FromDiscord | <Elegantbeef> Soon TM 😜 |
23:40:02 | FromDiscord | <Elegantbeef> For threading orc/arc are just better |
23:40:09 | FromDiscord | <creikey> built different |
23:40:18 | FromDiscord | <Elegantbeef> Well they're better all together reaally |
23:40:31 | FromDiscord | <huantian> can't wait for orc default |
23:40:36 | FromDiscord | <creikey> In reply to @Elegantbeef "Soon TM 😜": wht are we waiting for? |
23:40:38 | FromDiscord | <creikey> (edit) "wht" => "what" |
23:40:43 | FromDiscord | <creikey> "Unfortunately that makes its performance profile hard to reason about so it is less useful for hard realtime systems.↵" |
23:40:46 | FromDiscord | <Elegantbeef> Think the compiler to bootstrap with orc |
23:41:00 | FromDiscord | <creikey> In reply to @Elegantbeef "Think the compiler to": why can't it right now |
23:41:22 | FromDiscord | <Elegantbeef> Some issues/hacks with refc i think |
23:41:24 | FromDiscord | <Elegantbeef> Dont recall exactly |
23:41:30 | FromDiscord | <creikey> interesting |
23:41:32 | FromDiscord | <Elegantbeef> It'll be the default with 2.0 |
23:43:16 | NimEventer | New thread by Mardiyah: How do we preallocate string as element of array as this is.., see https://forum.nim-lang.org/t/9033 |