00:00:40 | FromDiscord | <ripluke> In reply to @j-james "because of their god": I mean it is a smart idea it’s just that the execution could be better |
00:00:52 | FromDiscord | <Elegantbeef> The seq/string isnt 100% accurate |
00:01:16 | FromDiscord | <ripluke> In reply to @ripluke "I mean it is": like rn if you scan the qrcode and u have 2fa enabled it just bypasses the 2fa |
00:01:26 | FromDiscord | <Elegantbeef> Oddly to see how much memory a variable uses you have to recurse all of it's fields to see if they're nil and then recurse that oh and if you have a recursive type tree have fun |
00:02:09 | FromDiscord | <retkid> In reply to @Elegantbeef "Oddly to see how": which is why i'll just just math |
00:02:09 | FromDiscord | <Elegantbeef> You probably need to pass a `ref HashSet[pointer]` along to make it so you can stop recursive trees |
00:02:33 | FromDiscord | <Elegantbeef> you'll just math? |
00:02:41 | FromDiscord | <Elegantbeef> There is no way to just use math to figure out how much every object definition uses |
00:02:52 | FromDiscord | <retkid> well i don't need super percision |
00:02:55 | FromDiscord | <retkid> (edit) "percision" => "precision" |
00:03:07 | FromDiscord | <Elegantbeef> I guess in the case of stack objects you're fine |
00:03:09 | FromDiscord | <retkid> array with 40 million int64 + the array def |
00:03:29 | FromDiscord | <retkid> (edit) "array with 40 million int64 + the array def ... " added "== approx size" |
00:05:31 | FromDiscord | <Elegantbeef> 3 pointers, one on the stack then two ints for the `len` and `cap` then the size of an element times the length |
00:06:11 | FromDiscord | <Elegantbeef> This does make me wonder if anyone has something like the above code |
00:19:26 | FromDiscord | <!Patitotective> In reply to @treeform "Do we even need": Do we even need beef? |
00:24:01 | FromDiscord | <Elegantbeef> Do you want the honest answer? |
00:25:38 | FromDiscord | <Elegantbeef> I'm needed here like you need a venereal disease |
00:27:19 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Do you want the": i was joking, im always joking |
00:27:31 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I'm needed here like": thats kinda seldom |
01:04:36 | FromDiscord | <!Patitotective> oh, playground is down :/ |
01:17:50 | * | noeontheend quit (Ping timeout: 240 seconds) |
01:28:28 | * | noeontheend joined #nim |
01:44:15 | * | noeontheend quit (Ping timeout: 244 seconds) |
02:20:13 | * | cyraxjoe quit (Ping timeout: 268 seconds) |
02:20:40 | * | cyraxjoe joined #nim |
02:24:41 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41Om |
02:25:14 | FromDiscord | <Yardanico> typeof(myseq[0]) |
02:25:16 | FromDiscord | <Yardanico> (edit) "typeof(myseq[0])" => "`typeof(myseq[0])`" |
02:25:29 | FromDiscord | <huantian> does uh |
02:25:39 | FromDiscord | <huantian> !eval echo seq[int].T |
02:25:42 | FromDiscord | <Yardanico> that's a compile-time operation, don't worry, you don't need to have 1 element in a seq |
02:25:56 | FromDiscord | <Yardanico> @huantian no |
02:26:19 | FromDiscord | <zhmtzhmt> nice |
02:26:27 | FromDiscord | <xflywind> https://nim-lang.org/docs/typetraits.html#elementType.t%2Cuntyped |
02:26:37 | FromDiscord | <zhmtzhmt> @Yardanico thank you! |
02:26:39 | NimBot | Compile failed: <no output> |
02:26:47 | FromDiscord | <Yardanico> In reply to @flywind "https://nim-lang.org/docs/typetraits.html#elementTy": true, but [0] for seqs specifically isn't much different :) |
02:27:15 | FromDiscord | <xflywind> Yeah |
02:27:41 | FromDiscord | <zhmtzhmt> @xflywind thank you , I have wasted a hour. 😂 |
02:29:26 | FromDiscord | <zhmtzhmt> I love compile reflection |
02:29:39 | FromDiscord | <zhmtzhmt> (edit) "compile" => "compile-time" |
02:29:45 | FromDiscord | <Yardanico> nim has full-blown compile-time code execution and metaprogramming |
02:29:51 | FromDiscord | <Elegantbeef> Compile time introspection is a great feature of Nim |
02:30:08 | FromDiscord | <Elegantbeef> you can do some quite interesting things without even going into macros 😄 |
02:30:39 | FromDiscord | <Yardanico> true, but with macros you can do very interesting things :P |
02:31:14 | FromDiscord | <zhmtzhmt> Yes , I am write serialization code, compile-time relfection helped me do it automatically. |
02:31:40 | FromDiscord | <Elegantbeef> Do we even call it reflection here? |
02:31:56 | FromDiscord | <Yardanico> no |
02:35:19 | FromDiscord | <Elegantbeef> A fun thing I realized with my toy ecs library is that you can introspect on the fields of a tuple in jusut a normal proc then use it in a concept |
02:36:05 | FromDiscord | <Elegantbeef> Like this stuff made me feel like a big brain https://github.com/beef331/nimtrest/blob/master/yeacs.nim#L5-L26 |
02:37:26 | FromDiscord | <Elegantbeef> I do now realize I forgot a break in the `fromComponent` |
02:38:59 | FromDiscord | <zhmtzhmt> it is compile time, maybe break is not needed. |
02:39:08 | FromDiscord | <Elegantbeef> No break is needed |
02:39:13 | FromDiscord | <Elegantbeef> Cause it overwrites the bool |
02:39:43 | FromDiscord | <zhmtzhmt> you are right |
02:40:30 | FromDiscord | <zhmtzhmt> you can add a when statement |
02:40:44 | FromDiscord | <Elegantbeef> What do you mean? |
02:41:15 | FromDiscord | <zhmtzhmt> break is better. |
02:41:31 | FromDiscord | <zhmtzhmt> the loop will stopped. |
02:41:42 | FromDiscord | <Elegantbeef> I can just do `if x isNot component: return false` |
02:42:32 | FromDiscord | <zhmtzhmt> yes |
02:42:41 | FromDiscord | <Elegantbeef> Wasnt asking |
02:54:14 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41Or |
02:54:37 | FromDiscord | <zhmtzhmt> for loop is extended, it is not a loop now. |
02:54:51 | FromDiscord | <Yardanico> beef knows |
02:55:00 | FromDiscord | <Elegantbeef> `fieldPairs` and `fields` is unrolled due to the iteration not being homogenous |
02:55:02 | FromDiscord | <Yardanico> I'm not sure what's your point here, it's documented that `fieldPairs` is unrolled at compile-time |
02:55:47 | FromDiscord | <Elegantbeef> It cannot be a loop cause there is no way to loop the fields in a type safe language |
02:56:08 | FromDiscord | <zhmtzhmt> yes, it is not a loop in runtime, it is more efficient. |
02:56:53 | FromDiscord | <Yardanico> this conversation is very weird |
02:57:00 | FromDiscord | <Elegantbeef> Indeed |
02:57:11 | FromDiscord | <Elegantbeef> Probably a mild language barrier |
02:58:05 | FromDiscord | <zhmtzhmt> I think your loop maybe is not a loop when compiled. |
02:58:22 | FromDiscord | <Elegantbeef> I know it's not |
02:58:24 | FromDiscord | <Elegantbeef> It's also not compiled |
02:58:56 | FromDiscord | <Yardanico> @zhmtzhmt beef is very experienced with Nim, he's mainly describing things that he does, he doesn't ask questions often |
02:59:14 | FromDiscord | <Yardanico> so you don't need to confirm the same thing he said |
02:59:15 | FromDiscord | <zhmtzhmt> I see |
03:00:09 | FromDiscord | <Elegantbeef> Shit i just got called very experienced, how the hell do i self deprecate now |
03:01:56 | FromDiscord | <zhmtzhmt> You guys helped me a lot, I appreciate it. |
03:03:13 | FromDiscord | <Rika> Beef you dumb |
03:03:21 | FromDiscord | <Rika> There, is that enough |
03:03:26 | FromDiscord | <Elegantbeef> There we go thanks rika i can always count on you! |
03:05:56 | FromDiscord | <Elegantbeef> For a split second i thought that was zhmt saying i was dumb so i was partially like "damn respect" |
03:06:20 | FromDiscord | <Elegantbeef> Both of you have blue icons here cause i think the bridge crashed when you changed your pfp last rika 😄 |
03:07:06 | FromDiscord | <Rika> The bridge is dumb |
03:07:13 | FromDiscord | <Elegantbeef> It is indeed |
03:07:18 | FromDiscord | <Rika> Glad to see you two have something in common |
03:07:36 | FromDiscord | <Elegantbeef> If it wasnt for discords TOS we wouldnt need a bridge |
03:21:04 | FromDiscord | <jan0809> a selfbot bridge 🙆 |
03:21:18 | FromDiscord | <Elegantbeef> Matrix calls them puppet bridges but yes |
03:21:36 | FromDiscord | <jan0809> they are a thing? |
03:21:48 | FromDiscord | <Elegantbeef> Yea they exist for other platforms and even discord |
03:22:05 | FromDiscord | <Elegantbeef> > Puppeting\: solves the problems of Bot-based bridging by "puppeting", meaning controlling, a user on the other side of the bridge. This means that to native users, they see messages as being sent from the correct sender. Double-puppeting means this is done in both directions of the bridge. This is the most preferred way of implementing a Matrix bridge. |
03:22:49 | FromDiscord | <jan0809> both ways? |
03:23:18 | FromDiscord | <jan0809> so like all ppl here would appear as actual matrix users? |
03:23:43 | FromDiscord | <Yardanico> In reply to @jan0809 "so like all ppl": yes, but this requires a different "account" for each matrix/irc user |
03:23:50 | FromDiscord | <Yardanico> or special support from the platform |
03:23:55 | FromDiscord | <Elegantbeef> Yep |
03:24:04 | FromDiscord | <jan0809> matrix is pretty easy about acc creation |
03:24:07 | FromDiscord | <Elegantbeef> Discord actually supports puppeting through "self bot" |
03:24:31 | FromDiscord | <Elegantbeef> Of course it does it's a federated open protocol 😄 |
03:24:45 | FromDiscord | <jan0809> hmm |
03:25:52 | FromDiscord | <jan0809> id like matrix alot, if it had the structure like discord or revolt, you know guilds with channels |
03:26:08 | FromDiscord | <Elegantbeef> I mean it kinda does the issue is more on the clients |
03:26:15 | FromDiscord | <Elegantbeef> It has spaces and rooms |
03:26:21 | FromDiscord | <jan0809> elements have |
03:27:25 | FromDiscord | <jan0809> hmm it would be pretty possible to write a client kinda looking like discord right? |
03:27:47 | FromDiscord | <Elegantbeef> I mean elements desktop already looks like discord |
03:28:20 | FromDiscord | <Elegantbeef> The representation of spaces/rooms is an issue with the client and could be represented similar to discord afaik |
03:28:35 | FromDiscord | <jan0809> In reply to @Elegantbeef "I mean elements desktop": really? gotta check that out again soon |
03:28:50 | FromDiscord | <Prestige> Yeah I wish it wasn't so weird looking |
03:29:03 | FromDiscord | <Prestige> I don't even use spaces |
03:29:07 | FromDiscord | <jan0809> did matrix offer openapi specs? |
03:29:34 | FromDiscord | <jan0809> or synapse / dendrite better said(?) |
03:29:45 | FromDiscord | <Elegantbeef> No clue |
03:30:21 | FromDiscord | <Elegantbeef> I very much do want to make a matrix client but it's a long list of things i very much want to make |
03:32:45 | FromDiscord | <jan0809> theres even a client for 3ds |
03:32:51 | FromDiscord | <jan0809> impressive |
03:32:56 | FromDiscord | <jan0809> and emacs(?) |
03:34:49 | FromDiscord | <Prestige> I dislike a lot of things about the element client, I should find an alternative |
03:38:57 | FromDiscord | <jan0809> <https://github.com/matrix-org/matrix-spec/releases/tag/v1.3>↵thzey do offer openapi specs |
04:13:12 | FromDiscord | <demotomohiro> !eval echo "test" |
04:14:12 | NimBot | Compile failed: <no output> |
04:16:07 | FromDiscord | <Prestige> Weird, why did that fail |
04:16:18 | FromDiscord | <Elegantbeef> Cause it uses the nim playground and she be gone |
04:16:33 | FromDiscord | <Prestige> :( |
04:16:59 | FromDiscord | <Prestige> Is that hosted by pmunch? |
04:17:04 | FromDiscord | <Elegantbeef> Yep |
04:17:17 | FromDiscord | <Elegantbeef> For all i know it's hosted on his north bridge |
04:17:24 | FromDiscord | <Elegantbeef> Given how much it dies 😄 |
04:17:27 | FromDiscord | <Prestige> lol |
04:17:37 | FromDiscord | <Prestige> Would be something nice to use like, aws lambda for. Maybe |
04:18:59 | FromDiscord | <Elegantbeef> No clue |
04:21:49 | * | ehmry quit (Remote host closed the connection) |
04:22:52 | * | arkurious quit (Quit: Leaving) |
04:23:00 | * | ehmry joined #nim |
04:28:53 | FromDiscord | <xflywind> After enabling threads, compiler booting increased 200 mb memory usages 🙁 |
04:31:34 | FromDiscord | <Araq> stop highlighting me, I'm not here |
04:32:23 | FromDiscord | <Araq> oh there is a setting for that |
04:46:08 | FromDiscord | <retkid> how much faster is -d:avx512 |
04:46:10 | FromDiscord | <retkid> i cant really test |
04:46:13 | FromDiscord | <retkid> i lack uh |
04:46:14 | FromDiscord | <retkid> the cpu |
04:46:24 | FromDiscord | <retkid> im debating if i should upgrade |
04:46:29 | FromDiscord | <retkid> (edit) "upgrade" => "upgrade, or look for a server with it" |
04:46:40 | FromDiscord | <retkid> (edit) "it" => "a compatible cpu" |
04:48:28 | FromDiscord | <retkid> linus seems to hate it but, these benchmarks are pretty important when you're doing the same things the benchmarks do but useful |
04:57:28 | FromDiscord | <retkid> nimplayground down 😭 |
05:09:38 | FromDiscord | <Prestige> inim still an option at least |
05:10:05 | FromDiscord | <Elegantbeef> so is `nvim /tmp/test.nim` 😄 |
05:10:32 | FromDiscord | <Prestige> true that |
05:12:27 | FromDiscord | <spoon> if only nim.nvim worked right on windows |
05:13:31 | FromDiscord | <Prestige> at least you have other options |
05:13:35 | FromDiscord | <Prestige> Like, Linux |
05:13:37 | FromDiscord | <spoon> for some reason linux works perfectly but windows stops highlighting after the cursors moved |
05:14:09 | FromDiscord | <spoon> In reply to @Avahe "Like, Linux": yeah i have both, my desktop pc is turning into a dual boot once i get a new ssd |
05:15:31 | FromDiscord | <retkid> im trying to optimize this function and the gods of gc are fighting me |
05:15:35 | FromDiscord | <spoon> idk how to debug that issue though, is it a nimsuggest issue or with nim.nbim specifically |
05:15:47 | FromDiscord | <spoon> In reply to @retkid "im trying to optimize": easy, manual memory management |
05:15:59 | FromDiscord | <retkid> i turned off gcc and its slower |
05:16:00 | FromDiscord | <retkid> lmao |
05:16:02 | FromDiscord | <retkid> which is expected |
05:16:27 | FromDiscord | <Prestige> What does the function do? |
05:16:33 | FromDiscord | <Elegantbeef> If only there was a way to profile code |
05:16:35 | FromDiscord | <retkid> 🤐 |
05:16:41 | FromDiscord | <retkid> In reply to @Elegantbeef "If only there was": which is what im doing |
05:16:47 | FromDiscord | <Elegantbeef> retkid is one of those programmers which dont show their code |
05:16:48 | FromDiscord | <retkid> its how i know im fighting the god of gc |
05:17:02 | FromDiscord | <Prestige> ah |
05:17:19 | FromDiscord | <retkid> I program in such a way that when i show my code |
05:17:21 | FromDiscord | <Elegantbeef> What's the profile graph then? |
05:17:22 | FromDiscord | <retkid> the only question is |
05:17:24 | FromDiscord | <retkid> "テクンケ |
05:17:31 | FromDiscord | <retkid> (edit) ""テクンケ" => ""WHY"" |
05:17:38 | FromDiscord | <retkid> (edit) ""WHY"" => ""WHY?!?!?"" |
05:18:21 | FromDiscord | <retkid> In reply to @Elegantbeef "What's the profile graph": im reading the profile results like a normal person |
05:18:51 | FromDiscord | <Elegantbeef> Time to share the code |
05:19:59 | FromDiscord | <Elegantbeef> If the GC is your slow down you're writing some badly allocating code |
05:20:48 | FromDiscord | <retkid> I'm trying to look at my allocations |
05:20:50 | FromDiscord | <retkid> and think |
05:20:51 | FromDiscord | <Elegantbeef> So share code if you dont know where the allocating is |
05:20:53 | FromDiscord | <retkid> "what would beef do" |
05:21:09 | FromDiscord | <retkid> and replace everything with movemem and copymem |
05:22:21 | FromDiscord | <Elegantbeef> I almost never use movemen/copymem |
05:22:30 | FromDiscord | <Elegantbeef> "movemen" ah yes |
05:22:44 | FromDiscord | <retkid> he do be movin men |
05:23:42 | FromDiscord | <TryAngle> is nimgl dead? |
05:24:09 | FromDiscord | <Elegantbeef> I'd reduce allocations |
05:24:10 | FromDiscord | <Elegantbeef> Avoiding any of the traps of allocations nim has like `sequtils` |
05:24:21 | FromDiscord | <Elegantbeef> Why do people ask this shit |
05:24:25 | FromDiscord | <Elegantbeef> "Is X dead" |
05:24:46 | FromDiscord | <Elegantbeef> It's a fucking open source project, if you think it's dead you can maintain it |
05:24:54 | FromDiscord | <retkid> x is either unmaintained or feature complete |
05:25:08 | FromDiscord | <Elegantbeef> Otherwise let the maintainer live their life and give them some money to make it worthwhile to maintain 😄 |
05:25:13 | FromDiscord | <retkid> if you wish to continue development you are free to do so |
05:25:16 | FromDiscord | <retkid> but dont complain |
05:25:17 | FromDiscord | <retkid> its free |
05:25:41 | madprops | x will never die. wayland doesn't work |
05:25:53 | FromDiscord | <Elegantbeef> Lol |
05:25:57 | FromDiscord | <Elegantbeef> Eh i kinda want to make a wayland compositor |
05:26:03 | FromDiscord | <retkid> In reply to @Elegantbeef "Avoiding any of the": every single nim file I've ever written with more than 20 lines has had sequtils |
05:26:05 | FromDiscord | <b1rdf00d> the in built nim profiler is pretty handy, I managed to get a 4x speed up of naively written code in about 15 minutes last night |
05:26:05 | FromDiscord | <Elegantbeef> It's a much nicer api than X atleast |
05:26:26 | FromDiscord | <Elegantbeef> Well then you're probably doing it wrong retkid |
05:26:37 | FromDiscord | <b1rdf00d> it's nice not needing to install a separate lib / app for it |
05:26:38 | FromDiscord | <Elegantbeef> sequtils is a memory trap if you use it to filter then iterate |
05:26:49 | FromDiscord | <Elegantbeef> I mean you can just `nimble install hottie` and you're golden |
05:26:52 | FromDiscord | <Elegantbeef> well sorta golden |
05:27:00 | FromDiscord | <Elegantbeef> I personally use kcachegrind + callgrind |
05:27:37 | FromDiscord | <b1rdf00d> ^ I looked at doing that, I can foresee me moving to it |
05:28:22 | FromDiscord | <b1rdf00d> but this was for code that sanitises lua code using pegs, so it was pretty basic. turns out creating pegs is slow |
05:28:27 | FromDiscord | <Elegantbeef> hottie is ok for basic stuff |
05:28:40 | FromDiscord | <Elegantbeef> Yea if you used Npeg you'd not have any of that overhead 😛 |
05:28:56 | FromDiscord | <Elegantbeef> Fairly certain it emits a parser at compile time so it's much more efficient there |
05:28:59 | FromDiscord | <Elegantbeef> Could be wrong about that |
05:29:06 | FromDiscord | <retkid> tbh this function is pretty baron its just slices |
05:29:17 | FromDiscord | <b1rdf00d> I'll move it to that as I couldn't get the stdlib stuff working intuitively |
05:29:24 | FromDiscord | <Elegantbeef> Just fucking show it ret, before i walk to your house and look at it behind you |
05:32:26 | FromDiscord | <Prestige> Lol |
05:32:56 | FromDiscord | <Elegantbeef> Atleast someone laughed at that |
05:34:19 | FromDiscord | <Phil> I wonder, do we have a lib with more efficient sequtils implementations, like jsony is to std/json ? |
05:34:41 | FromDiscord | <Phil> I recall you linking me one beef, I'm finally at the point in my project where I can start doing that sort of refactor overall |
05:34:45 | FromDiscord | <Elegantbeef> zero functional, itertools, slicerator |
05:36:37 | FromDiscord | <Josef> Is there an easy way to check the assembly representation of one function? |
05:37:07 | FromDiscord | <Elegantbeef> Godbolt |
05:37:43 | FromDiscord | <Elegantbeef> https://gcc.godbolt.org/z/ve8x3ar8j |
05:45:29 | FromDiscord | <Elegantbeef> So retkid how goes that optimising? Are we at the speed of light yet? |
05:45:46 | FromDiscord | <Rika> But beef, code always runs at the speed of light |
05:45:51 | FromDiscord | <retkid> i dont wanna talk about it |
05:45:59 | FromDiscord | <Phil> Lightning |
05:46:00 | FromDiscord | <Josef> What kind of bot do you use btw? |
05:46:02 | FromDiscord | <Phil> (edit) "Lightning" => "Lightning" |
05:46:04 | FromDiscord | <Elegantbeef> Speed of casuality in copper is not speed of light!↵(@Rika) |
05:46:06 | FromDiscord | <Josef> Matrix? |
05:46:14 | FromDiscord | <Elegantbeef> I'm a matrix user not a bot |
05:46:25 | FromDiscord | <Elegantbeef> Dont let them put me back in the box, stop them! |
05:46:37 | FromDiscord | <retkid> my code runs faster than the expansion of the universe |
05:46:56 | FromDiscord | <Phil> ~~So does mine and I use sequtils~~ |
05:47:07 | FromDiscord | <Elegantbeef> Phil you might use it properly |
05:47:15 | FromDiscord | <Rika> In reply to @retkid "my code runs faster": So you don’t have code, I see |
05:47:18 | FromDiscord | <Elegantbeef> The issue with sequtils is chaining/iterating it |
05:48:31 | FromDiscord | <Phil> Isn't that an issue inherently with functional programming?↵Like, putting 2 sequtils operations behind one another always means you loop twice, unless somewhere some magic appears and that code is reinterpreted as a single forloop with n operations inside of it |
05:49:04 | FromDiscord | <Phil> (edit) "sequtils" => "array" | "arrayoperations ... behind" added "(e.g map, then filter)" |
05:49:29 | FromDiscord | <retkid> can confirm am chain iterating distrbute |
05:49:32 | FromDiscord | <retkid> (edit) "distrbute" => "distribute" |
05:50:02 | FromDiscord | <Elegantbeef> I believe you can optimise chained iterations but not in Nim due to how `for x in y.map.apply` works |
05:50:08 | FromDiscord | <mratsim> In reply to @retkid "how much faster is": none if you don't use dedicated AVX512 code.↵↵Compilers avoid using it because it downclocks the CPU, AMD CPUs don't support it, new Intel CPU don't support it, old Intel CPU are split between those with only 1 AVX512 unit per core (while having 2 AVX, which makes AVX better) and 2 AVX512 per core. |
05:50:42 | FromDiscord | <Elegantbeef> Like i have my `chain` macro in slicerator that allows you to write simple FP like code without the overhead of Nim's allocations |
05:51:06 | FromDiscord | <Elegantbeef> Not that it's considerably nicer than the normal imperative way |
05:51:27 | FromDiscord | <Elegantbeef> Has that been our monthly allotted mratsim message? 😛 |
05:52:07 | FromDiscord | <mratsim> sent a long message, see http://ix.io/41OO |
05:52:33 | FromDiscord | <Phil> Ah, so there is magic and it has names! |
05:52:40 | FromDiscord | <mratsim> In reply to @Elegantbeef "Has that been our": wait 4 years until my baby girl starts learning Nim 😛 |
05:52:40 | FromDiscord | <Elegantbeef> Magic usually has names |
05:53:01 | FromDiscord | <mratsim> (edit) "http://ix.io/41OO" => "http://ix.io/41OP" |
05:53:06 | FromDiscord | <mratsim> In reply to @Isofruit "Ah, so there is": https://github.com/mratsim/Arraymancer/issues/347#issuecomment-461009747= |
05:53:44 | FromDiscord | <Elegantbeef> I did fight to try to reason Nim's iterators into being able to take iterators in as a parameter and allow iterator chaining |
05:53:50 | FromDiscord | <mratsim> https://sixty-north.com/blog/deriving-transducers-from-first-principles.html |
05:54:06 | FromDiscord | <mratsim> https://medium.com/@olxc/catamorphisms-and-f-algebras-b4e91380d134 |
05:54:28 | FromDiscord | <mratsim> In reply to @Elegantbeef "I did fight to": https://forum.nim-lang.org/t/2972 |
05:54:32 | FromDiscord | <Phil> In reply to @mratsim "https://github.com/mratsim/Arraymancer/issues/347#i": ML In that one is machine learning, right?↵What is DL? Deep Learning? |
05:54:39 | FromDiscord | <Rika> Slow down you’re gonna melt someone’s brain |
05:54:50 | FromDiscord | <mratsim> May 2017, wow I feel old |
05:55:08 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41OR |
05:55:10 | FromDiscord | <Elegantbeef> mratsim i know it doesnt work, i was playing with the compiler like i normally do |
05:55:13 | FromDiscord | <mratsim> In reply to @Isofruit "ML In that one": DL is deep learning yes, I need to autofuse tensor/matrix/vector transformations |
05:55:16 | FromDiscord | <Josef> In reply to @Isofruit "Isn't that an issue": You either use iterators, rewrite rules, or have sufficiently smart compiler. |
05:55:18 | FromDiscord | <zhmtzhmt> what is wrong with my code? |
05:55:27 | FromDiscord | <mratsim> In reply to @Elegantbeef "mratsim i know it": Timothee had something that worked |
05:55:33 | FromDiscord | <Elegantbeef> `f.getObject[: User]` |
05:55:46 | FromDiscord | <Elegantbeef> Method call syntax for generic arguments needs `: Type` |
05:55:47 | FromDiscord | <Rika> Don’t add the space that’s bad practice smh beef |
05:55:49 | FromDiscord | <mratsim> the "allow everything to alias" PR |
05:56:12 | FromDiscord | <Elegantbeef> Yea but that PR is ..... yea↵(@mratsim) |
05:56:18 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/pull/11992 |
05:56:19 | FromDiscord | <zhmtzhmt> @ElegantBeef thank you |
05:56:45 | FromDiscord | <Elegantbeef> Is it bad practice rika, i prefer it as it matches all other type annotations |
05:56:51 | FromDiscord | <zhmtzhmt> @Rika thank you |
05:57:20 | FromDiscord | <Elegantbeef> Yea mratsim the actual compiler changes were suspect to me but i'm an idiot so who knows |
05:59:22 | FromDiscord | <Rika> In reply to @Elegantbeef "Is it bad practice": It doesn’t really correspond to that since it’s just a bolted on syntax to accommodate generics in MCS |
05:59:35 | FromDiscord | <Elegantbeef> The thing is though mratsim we have `iterable` which if accepted in iterators could be used like a template and expand inside the inline iterator |
06:01:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41OU |
06:01:15 | FromDiscord | <Elegantbeef> Atleast my dumb mind thinks this is possible |
06:01:59 | FromDiscord | <Elegantbeef> Where you dont have any allocations but can chain inline iterators together |
06:02:23 | FromDiscord | <Elegantbeef> IIRC there is a logical issue but i cannot recall it |
06:04:24 | FromDiscord | <Elegantbeef> Wait the docs say they can be passed to inline iterators.... |
06:09:16 | FromDiscord | <Elegantbeef> The compiler presently doesnt like the inline iterator as an argument for an iterator, but i wonder if saying "Yes it's fine" actually generates usable code |
06:15:55 | FromDiscord | <Josef> Is there some way to mark a function, so that I can find it easily when browsing the binary file. |
06:16:12 | FromDiscord | <Josef> (edit) "browsing" => "inspecting" | "inspectingthe ... binary" added "compiled" |
06:16:16 | FromDiscord | <Elegantbeef> `{.exportC: "mySuperEasyToFindFunctionName".}` |
06:16:17 | FromDiscord | <retkid> well |
06:16:45 | FromDiscord | <retkid> i got it running about... 0.03 vs 0.30 |
06:17:14 | FromDiscord | <retkid> replaced the code with code i already had |
06:17:27 | FromDiscord | <retkid> (edit) "had" => "had, which was already optimized" |
06:17:43 | FromDiscord | <retkid> oh shit i forgot to implemented the long part |
06:18:09 | FromDiscord | <Josef> In reply to @Elegantbeef "`{.exportC: "mySuperEasyToFindFunctionName".}`": Will that create a comment or something? |
06:18:26 | FromDiscord | <Elegantbeef> That will name the procedure in the C file |
06:19:42 | FromDiscord | <Josef> I get only .exe file as an output. |
06:20:04 | FromDiscord | <Elegantbeef> Open it in ghidra or similar find the function name |
06:20:19 | FromDiscord | <Elegantbeef> Or use godbolt like i said |
06:21:15 | FromDiscord | <enthus1ast> Or this https://www.nirsoft.net/utils/dll_export_viewer.html |
06:21:37 | FromDiscord | <Elegantbeef> That's for DLLs though not for executables? |
06:21:52 | FromDiscord | <enthus1ast> That the same on windows |
06:22:49 | FromDiscord | <retkid> ok upon re implemented the slow stuff |
06:23:00 | FromDiscord | <retkid> we're about 0.15 vs 0.30 |
06:23:17 | FromDiscord | <Elegantbeef> Cmon ret show the code to your friendly neighbourhood |
06:23:33 | FromDiscord | <TryAngle> In reply to @Elegantbeef "It's a fucking open": normally I would agree to this |
06:23:43 | FromDiscord | <TryAngle> but the issue is, all the bindings are behind a script |
06:23:48 | FromDiscord | <TryAngle> that is not in the repo |
06:24:02 | FromDiscord | <TryAngle> (edit) "behind" => "from" | "froma ... script" added "generator" |
06:24:24 | FromDiscord | <Elegantbeef> Is it not just c2nim'd? |
06:25:01 | * | rockcavera quit (Remote host closed the connection) |
06:25:13 | FromDiscord | <TryAngle> ah nvm |
06:25:14 | FromDiscord | <TryAngle> it is |
06:25:19 | FromDiscord | <TryAngle> wtf, my phone didn't show it?? |
06:25:23 | FromDiscord | <TryAngle> never use git apps |
06:25:26 | FromDiscord | <TryAngle> always website |
06:25:30 | FromDiscord | <TryAngle> wtf is this shit |
06:25:44 | FromDiscord | <TryAngle> (edit) "never use git apps ... " added "again on mobile" |
06:26:01 | FromDiscord | <Elegantbeef> So are we all happy and good |
06:26:07 | FromDiscord | <TryAngle> yes 🥺 |
06:26:26 | FromDiscord | <Josef> In reply to @Elegantbeef "Open it in ghidra": Ghidra can't find it. |
06:26:44 | FromDiscord | <Josef> I used the `search program text` with `all fields`. |
06:26:56 | FromDiscord | <Elegantbeef> `--debugger:native`? |
06:29:28 | FromDiscord | <enthus1ast> If exportc is used, it is in the export table↵(@Josef) |
06:29:38 | FromDiscord | <enthus1ast> Of zu pe file |
06:30:17 | FromDiscord | <Josef> what is zu e file? |
06:30:48 | FromDiscord | <enthus1ast> Of the pe file |
06:30:57 | FromDiscord | <enthus1ast> Typo |
06:39:24 | * | Schnouki quit (Read error: Connection reset by peer) |
06:39:24 | * | xigoi quit (Read error: Connection reset by peer) |
06:39:24 | * | toothlessgear quit (Read error: Connection reset by peer) |
06:39:29 | FromDiscord | <enthus1ast> ahh, you're right, they do not show up with just exportc |
06:39:36 | * | xigoi joined #nim |
06:39:36 | * | Schnouki joined #nim |
06:39:42 | FromDiscord | <enthus1ast> proc foo() {.dynlib, exportc.} = |
06:39:50 | FromDiscord | <enthus1ast> please also add dynlib |
06:39:54 | * | toothlessgear joined #nim |
06:39:56 | FromDiscord | <enthus1ast> they they show up |
06:40:23 | FromDiscord | <enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/994493060903866418/image.png |
06:43:02 | FromDiscord | <Josef> Btw, what is the cdecl? |
06:43:06 | FromDiscord | <enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/994493748291584031/image.png |
06:43:15 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=41P1 |
06:43:18 | * | noeontheend joined #nim |
06:44:02 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=41P2 |
06:44:11 | FromDiscord | <Girvo> Thats the C code if it helps |
06:44:12 | FromDiscord | <Girvo> (edit) "https://play.nim-lang.org/#ix=41P2" => "https://play.nim-lang.org/#ix=41P3" |
06:44:30 | FromDiscord | <Girvo> Ah I am an idiot |
06:44:45 | FromDiscord | <Girvo> It should be `ptr SwSerial` lol |
06:44:51 | FromDiscord | <Elegantbeef> Lol |
06:45:04 | FromDiscord | <Elegantbeef> I was going to say it but you seemed smarter than that! 😛 |
06:45:11 | FromDiscord | <Girvo> Far out hahaha |
06:45:20 | FromDiscord | <Girvo> I swear sometimes just typing the question out is enough 😂 |
06:45:31 | FromDiscord | <enthus1ast> Rubber ducky channel |
06:45:40 | FromDiscord | <Elegantbeef> You know you dont need to importc parameters |
06:45:40 | FromDiscord | <Girvo> It really is lol |
06:45:45 | FromDiscord | <Girvo> Oh yeah lol |
06:45:51 | FromDiscord | <Elegantbeef> That's' a lot of typing for no benefit |
06:45:55 | FromDiscord | <Elegantbeef> Fuck i pity you |
06:45:57 | FromDiscord | <Girvo> c2nim did that coz I was too lazy to type all of them |
06:46:04 | FromDiscord | <Girvo> I didn't type it 😉 |
06:46:07 | FromDiscord | <Elegantbeef> Ah |
06:46:13 | FromDiscord | <Girvo> I did type all the function bindings though haha |
06:46:41 | FromDiscord | <Girvo> Wonder why c2nim puts it on the params |
06:47:33 | FromDiscord | <Elegantbeef> damn look at us saying parameters instead of fields |
06:47:39 | FromDiscord | <Elegantbeef> We're really fucking dumb |
06:48:06 | * | wallabra quit (Ping timeout: 264 seconds) |
06:48:10 | FromDiscord | <Girvo> I should've called 'em class members to really annoy people |
06:48:15 | FromDiscord | <Girvo> 😄 |
06:48:27 | FromDiscord | <enthus1ast> there is a nice table in the manual https://nim-lang.org/docs/manual.html#types-procedural-type↵(@Josef) |
06:53:54 | FromDiscord | <fbpyr> sent a code paste, see https://play.nim-lang.org/#ix=41P5 |
06:54:50 | FromDiscord | <Elegantbeef> `filetype.getStr == "dll"` is what you should do, but yes |
06:55:03 | FromDiscord | <Elegantbeef> Wait no |
06:55:10 | FromDiscord | <fbpyr> ah thx - let me try setStr |
06:55:58 | FromDiscord | <fbpyr> hah that works - thank you [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org) ! 😌 |
06:56:14 | FromDiscord | <fbpyr> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/994496785005428816): ah thx - let me try getStr |
06:58:24 | FromDiscord | <Josef> Ok I found it. It was just hard to find in the Ghidra Gui. |
06:58:26 | FromDiscord | <Josef> Thx everyone! |
06:59:34 | FromDiscord | <retkid> ok now im back down to 2x slower |
06:59:36 | FromDiscord | <retkid> 😭 |
06:59:46 | FromDiscord | <Elegantbeef> Just provide the code |
06:59:55 | FromDiscord | <Elegantbeef> I pinky promise to only focus on making it faster |
07:00:24 | FromDiscord | <retkid> fine |
07:02:17 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/994498571300773888/unknown.png |
07:02:54 | FromDiscord | <retkid> its not organized that way in the actual god but i organized it here :3 |
07:03:04 | FromDiscord | <retkid> the top two guys are somewhere else |
07:03:17 | FromDiscord | <Elegantbeef> `yield temp` what's temp |
07:03:40 | FromDiscord | <retkid> yield temp is preout i didn't wanna look dumb and have a var called temp so i edited it quickly |
07:03:48 | FromDiscord | <retkid> but forgot to edit yield |
07:04:16 | FromDiscord | <Elegantbeef> Ok so why do you yield a sequence? |
07:04:45 | FromDiscord | <Girvo> Hooray! It works, my nim binding for software serial for ESP-IDF works 😄 |
07:04:52 | FromDiscord | <Girvo> 💃 |
07:04:56 | FromDiscord | <Elegantbeef> Nice! |
07:05:07 | FromDiscord | <retkid> I yield a sequence because it needs to be in chunks |
07:05:13 | FromDiscord | <retkid> each one of those values will be assigned the same |
07:05:26 | FromDiscord | <Elegantbeef> Ok but cant you just have the iterator yield every coordinate? |
07:05:59 | FromDiscord | <retkid> it would be annoying because then i would have to have two iterators, ones for a separate variable |
07:06:14 | FromDiscord | <retkid> its prettier to just go for x in iter |
07:06:20 | FromDiscord | <retkid> (edit) "for" => "↵for" | "iter" => "iter:" |
07:07:08 | FromDiscord | <Josef> In reply to @enthus1ast "ahh, you're right, they": Actually, I had to add `cdecl`, to make it work. |
07:07:21 | FromDiscord | <Josef> But now the body of the function is complete nonsense. |
07:07:21 | FromDiscord | <Elegantbeef> You'd still just have a `for pixels in it` |
07:07:27 | FromDiscord | <Girvo> sent a code paste, see https://play.nim-lang.org/#ix=41P8 |
07:07:47 | FromDiscord | <retkid> : https://media.discordapp.net/attachments/371759389889003532/994499955844718672/unknown.png |
07:07:57 | FromDiscord | <retkid> then for is later |
07:08:01 | FromDiscord | <Elegantbeef> if `itPad` yielded `(int, int)` it'd behave identically without the sequence allocations/frees |
07:08:14 | FromDiscord | <ezquerra> I keep hearing that sequtils is a nim performance pitfall, but as somebody said earlier pretty much all nim programs require the functionality sequtils provides. Is there no way to optimize it in a backwards compatible way? What’s the problem? |
07:08:38 | FromDiscord | <Elegantbeef> The way sequtils works is operating on sequences so no there is not↵(@ezquerra) |
07:09:04 | FromDiscord | <retkid> In reply to @Elegantbeef "if `itPad` yielded `(int,": also theres an older version that looks like this but i think theres less i can optimize here https://media.discordapp.net/attachments/371759389889003532/994500280785829928/unknown.png |
07:09:15 | FromDiscord | <Elegantbeef> `@[10, 20, 30].mapIt($it).applyIt(it & "hello")` is allocation hell |
07:09:31 | * | wallabra joined #nim |
07:09:32 | FromDiscord | <Elegantbeef> I mean your present implementation is fine, drop the sequences since you dont need them |
07:10:06 | FromDiscord | <Elegantbeef> You're only using the sequences as an iterator which means your iterator could just yield the elements |
07:10:21 | FromDiscord | <Girvo> You should see the weird shit I'm doing with `bytesequtils` -- though that will all go away to actual statically allocated arrays of bytes instead. I was just lazy and we have the memory on this micro right now lol |
07:10:23 | FromDiscord | <ezquerra> In reply to @Elegantbeef "The way sequtils works": Not sure what you mean by “operating on sequences”. Isn’t that what sequtils is for? Or do you mean that it cannot operate on iterators? |
07:10:28 | FromDiscord | <Josef> This is what Ghidra gives me: https://media.discordapp.net/attachments/371759389889003532/994500632205602836/unknown.png |
07:10:34 | FromDiscord | <Josef> However, the definition is: https://media.discordapp.net/attachments/371759389889003532/994500657417556008/unknown.png |
07:11:08 | FromDiscord | <Elegantbeef> Yes that's what it's for, the issue is that people write code that is valid in FP due to optimizations in the compiler with their functions, that Nim cannot do |
07:11:27 | FromDiscord | <Elegantbeef> `apply` followed by a `filter` in Nim has to be done with 2 sequences |
07:11:34 | FromDiscord | <Elegantbeef> You cannot merge the functions together |
07:12:08 | FromDiscord | <Elegantbeef> So you iterate the sequence once apply the functor, then iterate that new sequence applying the filter |
07:12:33 | FromDiscord | <Elegantbeef> The issue is mostly that they're chainable and iteratble |
07:12:36 | FromDiscord | <Elegantbeef> iterable even |
07:12:49 | FromDiscord | <Elegantbeef> People use them in an iterator and it causes performance issues |
07:13:04 | FromDiscord | <Yardanico> In reply to @Josef "This is what Ghidra": How did you compile? |
07:13:08 | FromDiscord | <retkid> beef how do you suppose i replace the sequence with a clean solution |
07:13:10 | FromDiscord | <Yardanico> Debug mode adds a lot of checks |
07:13:15 | FromDiscord | <retkid> (edit) "beef how do you suppose i replace the sequence with a clean solution ... " added "to split things up" |
07:13:25 | FromDiscord | <Yardanico> For cleanest disassembly compile with -d:danger --gc:arc |
07:13:26 | FromDiscord | <Elegantbeef> Liiterally just drop the `seq[(int, int)]` |
07:13:35 | FromDiscord | <Elegantbeef> Your code works like 99% without it |
07:13:42 | FromDiscord | <retkid> yes but then i would need to replicate the seq[ness] |
07:13:50 | FromDiscord | <Elegantbeef> God damn |
07:13:53 | FromDiscord | <Elegantbeef> Post the actual code in text |
07:14:18 | FromDiscord | <Elegantbeef> You do not rely on the sequence you use it to contain the data, the iterator already does that |
07:14:41 | FromDiscord | <Elegantbeef> I dont even see why you're using a closure iterator |
07:14:47 | FromDiscord | <Elegantbeef> But provide the actual code please |
07:15:04 | FromDiscord | <Josef> In reply to @Yardanico "How did you compile?": `nim c --cc:vcc --cpu:i386 --app=lib --nomain` |
07:15:11 | FromDiscord | <Yardanico> That's full debug mode |
07:15:57 | FromDiscord | <Yardanico> The C compiler is called without any optimization flags and Nim itself adds a lot of runtime checks |
07:16:10 | FromDiscord | <Yardanico> So just add the options that I mentioned |
07:16:19 | FromDiscord | <Yardanico> or at least just -d:danger |
07:16:51 | FromDiscord | <Girvo> In reply to @Elegantbeef "Yes that's what it's": Yeah -- while I'm an absolute proponent of functional programming and working on curried functions on containers/arrays/sequences/etc. Nim is the wrong place for it 🙂 |
07:17:53 | FromDiscord | <Girvo> It can do it for sure, but if pure performance is what you're after (or in my case, making sure memory usage is very very low), then it's not right. `proc` is a good name: procedural thinking is the way to go to work with the compiler 🙂 |
07:18:18 | FromDiscord | <Elegantbeef> I mean i like the ideas in API that FP gives but i think nim can do it in a more imperative way |
07:18:25 | FromDiscord | <Girvo> Yeah definitely |
07:18:32 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
07:19:45 | FromDiscord | <Josef> In reply to @Yardanico "So just add the": Ok, that improved things significantly.↵Now I get this: `param_1 & 0xffffff00 | (byte )(param_1 + 5) & 0xffffff02;` |
07:19:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41Pc |
07:20:08 | FromDiscord | <Josef> (edit) "0xffffff02;`" => "0xffffff02;`↵However, I would like to see ` (byte )(param_1 + 5) & 0xffffff02` only.." |
07:20:13 | FromDiscord | <Girvo> Funnily enough, years and years ago I asked for something like `func` which didn't exist at the time lol. Now it does, and I think it's very useful for the sort of "architectural" ideas that FP can bring. Among other additions to the language |
07:20:49 | FromDiscord | <Elegantbeef> Yea Nim's effect/side effect tracking is quite a compelling idea |
07:21:12 | FromDiscord | <Josef> In reply to @Yardanico "So just add the": Do you have an idea why does it add the `param_1 & 0xffffff00 |`? |
07:21:23 | FromDiscord | <Elegantbeef> But yea this is how i think nim should encourage the FP life style https://github.com/beef331/slicerator/blob/master/tests/tchain.nim |
07:21:36 | FromDiscord | <Elegantbeef> Or something akin to this |
07:22:10 | * | noeontheend quit (Ping timeout: 240 seconds) |
07:23:10 | * | dtomato joined #nim |
07:23:36 | FromDiscord | <Girvo> Amusingly, I remember everyone saying "nah Nim doesn't need func" (well, I was asking for a "pure" pragma for procs, something to mark it as not having side effects) as it was a bit at odds with where the language was at at the time. 0.10 I think, if I remember correctly. Long time ago lol |
07:24:07 | FromDiscord | <Elegantbeef> Yea side effect analysis allows you to do many things 😄 |
07:24:10 | FromDiscord | <Girvo> In reply to @Elegantbeef "But yea this is": Yeah thats more in line! I think theres probably even more we can extract, in terms of patterns and processes to translate FP ideas to Nim that fits it |
07:25:56 | FromDiscord | <Elegantbeef> I did also play around with closure iterators for basic FP things but the speed is too slow to validate their usage |
07:25:59 | madprops | im supposed ot use pkg[...] when importing my modules right? |
07:26:19 | madprops | or is using std/... enough? |
07:26:23 | FromDiscord | <Elegantbeef> You can, no clue if it's the convention |
07:26:37 | FromDiscord | <Elegantbeef> I know i dont prefix pkg |
07:26:45 | FromDiscord | <Elegantbeef> So that's probably an indication you should |
07:26:52 | madprops | ok |
07:29:46 | FromDiscord | <Josef> Wait, so how is iteration done in Nim? |
07:29:52 | FromDiscord | <Josef> Is there nothing like rust iterators? |
07:30:09 | FromDiscord | <Elegantbeef> Nim has closure iterators |
07:30:17 | FromDiscord | <Elegantbeef> So it does have rust like iteraetors |
07:30:20 | FromDiscord | <Elegantbeef> iterators |
07:30:35 | FromDiscord | <Elegantbeef> It also has inlined iterators |
07:30:40 | FromDiscord | <Elegantbeef> It unlike rust has the idea seperated |
07:31:07 | FromDiscord | <Elegantbeef> Which means not all iterators can be stored in a variable |
07:31:47 | FromDiscord | <Elegantbeef> I guess i scared retkid away |
07:34:12 | madprops | oh pkg is for installed packages isn't it |
07:34:20 | madprops | not for my files |
07:34:25 | FromDiscord | <Elegantbeef> it's for external packages yes |
07:35:00 | FromDiscord | <Elegantbeef> You can use `myPackageName/submodules` |
07:35:58 | * | toluene quit (Read error: Connection reset by peer) |
07:36:30 | FromDiscord | <Q-Master> It might be better to use relative imports like ./othermodule or ../sub/module |
07:36:33 | FromDiscord | <Elegantbeef> A new matrix user is typing, i'm scared that it's the infamous crypto scam |
07:36:37 | FromDiscord | <Elegantbeef> Whew it was not |
07:37:59 | * | toluene joined #nim |
07:38:37 | FromDiscord | <Elegantbeef> Well hellow Q-Master |
07:41:16 | FromDiscord | <Q-Master> Hi \:) |
07:42:03 | FromDiscord | <Girvo> I use relative imports personally |
07:42:10 | FromDiscord | <Girvo> Habit from other languages, rather than any real reason lol |
07:42:14 | FromDiscord | <Elegantbeef> Dpends on where my file is |
07:42:28 | FromDiscord | <Elegantbeef> I fi t's a complex import for relative but easy for root relative i do root relative |
07:43:09 | FromDiscord | <Tattva> sent a code paste, see https://play.nim-lang.org/#ix=41Ph |
07:43:35 | FromDiscord | <Elegantbeef> `wsChar: static char` and↵`static: assert wsChar notin WhiteSpace` |
07:43:51 | FromDiscord | <Elegantbeef> or rwather `static: assert wsChar in Whitespace` |
07:44:05 | FromDiscord | <Tattva> In reply to @Elegantbeef "`wsChar: static char` and": Awesome, ty! |
07:47:46 | FromDiscord | <Elegantbeef> Actually... we can do better |
07:50:19 | FromDiscord | <Elegantbeef> There we go |
07:50:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41Pj |
07:50:35 | FromDiscord | <Elegantbeef> A descriptive error message better than an assertion |
08:04:26 | FromDiscord | <Girvo> Much better 🙂 |
08:04:38 | FromDiscord | <TryAngle> nim playground offline >. < |
08:04:49 | FromDiscord | <Elegantbeef> Yea pmunch isnt around to do the reboot |
08:05:07 | FromDiscord | <TryAngle> we truly live in a society 😔 |
08:05:27 | FromDiscord | <enthus1ast> systemd ftw |
08:07:49 | FromDiscord | <Elegantbeef> There is wandbox but some people's browser setup doesnt like all the trackers and shit |
08:08:03 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41Po |
08:08:12 | FromDiscord | <TryAngle> ah the bot also uses playground? |
08:08:27 | FromDiscord | <Elegantbeef> Yes it does and it doesnt eval code blocks |
08:08:34 | FromDiscord | <TryAngle> oh ok |
08:08:45 | FromDiscord | <TryAngle> I wanted to ask why this code is not working |
08:08:48 | FromDiscord | <Elegantbeef> That's not going to work there is no address for `B()` |
08:09:09 | FromDiscord | <TryAngle> is this something that could be in theory be allowed for nim 2.0 |
08:09:49 | FromDiscord | <Elegantbeef> There is some work to make some things addressable that should be, but the above is suspect |
08:11:22 | FromDiscord | <Prestige> Can you even do `addr` for stack allocated objects? |
08:11:26 | FromDiscord | <TryAngle> In reply to @Elegantbeef "There is some work": hmm maybe, some C-API's and especially rust code often does things like that↵or maybe ref should be used here? |
08:11:33 | FromDiscord | <Elegantbeef> Of course you can prestige |
08:11:36 | FromDiscord | <Elegantbeef> It's unsafe but it's valid |
08:11:37 | FromDiscord | <Prestige> huh |
08:11:57 | FromDiscord | <Elegantbeef> Do rust/C take the address of a constant expression? |
08:12:21 | FromDiscord | <TryAngle> rust yes, C idk, does C have a concept of constants relaly? |
08:12:37 | FromDiscord | <Elegantbeef> Can you even instantiate a type like that in C |
08:12:46 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Can you even instantiate": https://github.com/gfx-rs/wgpu-native/blob/master/examples/triangle/main.c |
08:12:51 | FromDiscord | <TryAngle> look line 82 |
08:12:52 | FromDiscord | <PMunch> In reply to @Elegantbeef "Yea pmunch isnt around": Just ping me and I'll reboot it :) |
08:13:08 | FromDiscord | <Elegantbeef> Ah you can |
08:13:16 | FromDiscord | <Elegantbeef> Just use a temporary variable |
08:13:38 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Just use a temporary": ye that's workaroundy, but for api's like those it looks 💩 |
08:13:50 | FromDiscord | <Elegantbeef> Cool dont write C |
08:14:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/LfU |
08:14:54 | FromDiscord | <Elegantbeef> I dont know how predeclaring a variable is uglier than that C but you do you |
08:15:07 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Cool dont write C": I don't agree, look at this how hot that looks |
08:15:15 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41Pr |
08:15:23 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=41Pr" => "https://play.nim-lang.org/#ix=41Ps" |
08:15:27 | FromDiscord | <Elegantbeef> That's awful |
08:15:50 | FromDiscord | <TryAngle> with this u can directly use, or take reference, see view field |
08:16:01 | FromDiscord | <PMunch> !eval echo "I'm back!" |
08:16:03 | NimBot | I'm back! |
08:17:22 | FromDiscord | <huantian> 👋 |
08:17:23 | FromDiscord | <Transparent> is it me or some of these accounts are bots too? |
08:17:36 | FromDiscord | <Elegantbeef> It's better if you use `ref T` anyway in Nim |
08:17:40 | FromDiscord | <huantian> The bots are everywhere |
08:17:43 | FromDiscord | <Transparent> sometimes i feel like the bots just be talking to each other. this server has to much bots just for help lol |
08:17:48 | FromDiscord | <Elegantbeef> Pointers to stack addresses are inherently unsafe |
08:17:54 | FromDiscord | <Elegantbeef> We're not bots we're humans |
08:17:56 | FromDiscord | <TryAngle> In reply to @Elegantbeef "Pointers to stack addresses": I agree |
08:18:07 | FromDiscord | <PMunch> @transgressor the bots bridge messages from other chat applications |
08:18:10 | FromDiscord | <TryAngle> so may we have this pattern but with ref in nim 2.0 uwu? |
08:18:11 | FromDiscord | <Elegantbeef> So make `B = ref object` then problem solved |
08:18:16 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=41Pv |
08:18:23 | FromDiscord | <PMunch> So those are users talking to each other on Matrix or IRC |
08:18:26 | FromDiscord | <Elegantbeef> Sure make an comment about it and a PR to add it↵(@TryAngle) |
08:18:41 | * | ggst joined #nim |
08:18:44 | FromDiscord | <PMunch> @Transparent ^ |
08:18:51 | FromDiscord | <Transparent> In reply to @PMunch "<@992225114542321884> ^": i see |
08:18:55 | FromDiscord | <Elegantbeef> Depends on the base type↵(@jmgomez) |
08:19:00 | FromDiscord | <PMunch> Pinged the wrong person.. |
08:19:01 | FromDiscord | <Elegantbeef> you can do `.intVal` on a NimNode |
08:19:04 | FromDiscord | <TryAngle> I have no idea I'm not lang dev lol↵just wanted to drop this idea, since I saw this nim 2.0 thread on nim forums yesterday |
08:19:07 | FromDiscord | <Transparent> how is that even done with rate limiting |
08:19:08 | FromDiscord | <Transparent> hmmmmmm |
08:19:27 | FromDiscord | <Elegantbeef> Well put it where it goes↵(@TryAngle) |
08:19:27 | FromDiscord | <Prestige> @PMunch how is the playground hosted btw? |
08:19:39 | FromDiscord | <jmgomez> In reply to @Elegantbeef "you can do `.intVal`": I see that, also str etc. But it's a UEType which is a "complex" type |
08:19:43 | FromDiscord | <Elegantbeef> nim-lang/rfcs |
08:19:53 | FromDiscord | <PMunch> It's a Digital Ocean VPS I believe |
08:20:12 | FromDiscord | <Prestige> Not auto-restarting when it goes down? |
08:20:23 | FromDiscord | <Elegantbeef> To convert the complex type to static you need to extract all the data from it |
08:20:41 | FromDiscord | <PMunch> Well, it doesn't go down per say. It just starves on resources and grinds to a halt |
08:20:42 | FromDiscord | <Rika> In reply to @Avahe "Not auto-restarting when it": It does but I assume he’s having the same log storage issue again |
08:20:53 | FromDiscord | <Prestige> Mem loak? |
08:20:56 | FromDiscord | <Prestige> ah |
08:21:02 | FromDiscord | <Prestige> leak |
08:21:17 | FromDiscord | <jmgomez> In reply to @Elegantbeef "To convert the complex": ouch, okay I will leave it as it is for now then |
08:21:31 | FromDiscord | <Elegantbeef> What are you actually trying to do? |
08:21:38 | FromDiscord | <PMunch> It's an issue with Docker. They've known about it for years but don't care enough to fix it.. |
08:21:45 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=41Pw |
08:21:56 | FromDiscord | <jmgomez> In reply to @Elegantbeef "What are you actually": is that question directed to me? |
08:21:56 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=41Pw" => "https://play.nim-lang.org/#ix=41Px" |
08:22:00 | FromDiscord | <Elegantbeef> Yes |
08:22:17 | FromDiscord | <Elegantbeef> Retkid is that you shrugging about the code? |
08:22:24 | FromDiscord | <retkid> no shrugging out of anger |
08:22:24 | FromDiscord | <Elegantbeef> Are you happy with how simple it was to turn into faster |
08:22:37 | FromDiscord | <retkid> well its like .2 slower than the weird old function |
08:22:44 | FromDiscord | <retkid> (edit) ".2" => ".2s" |
08:22:45 | FromDiscord | <Prestige> @PMunch maybe you could have some code checking the status of the container, and restart it if it's become unresponsive? |
08:22:46 | FromDiscord | <retkid> which |
08:22:47 | FromDiscord | <retkid> confuses me |
08:22:50 | FromDiscord | <retkid> i dont know how |
08:22:58 | FromDiscord | <Elegantbeef> My solution was slower? |
08:23:08 | FromDiscord | <retkid> i dont think its you |
08:23:14 | FromDiscord | <Elegantbeef> Are you sure you're benching this proper? |
08:23:17 | FromDiscord | <retkid> im not talking about the seq[] bit |
08:23:26 | FromDiscord | <retkid> im talking about thtis |
08:23:31 | FromDiscord | <Elegantbeef> `-d:release`? |
08:23:33 | FromDiscord | <Elegantbeef> `-d:lto` |
08:23:40 | FromDiscord | <retkid> In reply to @retkid "also theres an older": a |
08:23:51 | FromDiscord | <Transparent> . |
08:23:53 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=41Py |
08:23:54 | FromDiscord | <retkid> im doing danger |
08:24:26 | FromDiscord | <jmgomez> So I need that UEType in both, at compile time and as data/ident in runtime |
08:24:44 | FromDiscord | <Elegantbeef> Why do you take it twice though? |
08:25:00 | FromDiscord | <PMunch> @Prestige I guess that could work |
08:25:03 | * | daanb joined #nim |
08:25:06 | FromDiscord | <Elegantbeef> the static variable is`newLit(typeDef)` |
08:25:07 | FromDiscord | <jmgomez> that was the first question, how I can transform from static to non static/ident |
08:25:20 | FromDiscord | <PMunch> Super annoying if it detects it and a reboot doesn't fix the problem |
08:25:21 | FromDiscord | <Elegantbeef> You didnt say from static to NimNode |
08:25:52 | FromDiscord | <jmgomez> In reply to @Elegantbeef "the static variable is`newLit(typeDef)`": let me try that |
08:26:32 | FromDiscord | <Elegantbeef> ret the fact the iterative version i wrote is slower than the old method is astounding |
08:26:41 | FromDiscord | <Prestige> I don't see why a reboot wouldn't fix it |
08:27:04 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/994519909293895750/unknown.png |
08:27:06 | FromDiscord | <retkid> than this |
08:27:17 | FromDiscord | <Elegantbeef> Yes i know |
08:27:27 | FromDiscord | <retkid> i dont know how maybe something im doing on my end |
08:27:37 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=41Pz |
08:27:41 | FromDiscord | <Elegantbeef> Yes |
08:27:59 | FromDiscord | <Elegantbeef> Well without the code i'm not going to say much |
08:28:10 | FromDiscord | <jmgomez> it doesnt work because it expand the type right there |
08:28:31 | FromDiscord | <Elegantbeef> It'll paste what was required to make the `static T` there |
08:28:42 | FromDiscord | <retkid> before the big limit on the old function was the distrbute |
08:28:51 | FromDiscord | <retkid> i modified that buy just x4 |
08:29:03 | FromDiscord | <retkid> then mod 4 so i dont have to delete |
08:29:06 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=41PA |
08:29:24 | FromDiscord | <Elegantbeef> You can try `std/privateaccess` |
08:29:37 | FromDiscord | <Elegantbeef> sorry `importutils` |
08:32:04 | FromDiscord | <jmgomez> didnt worked out.. because going from an indent to a static is not possible right? |
08:32:21 | FromDiscord | <Elegantbeef> What? |
08:32:25 | * | daanbreur joined #nim |
08:33:39 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=41PB |
08:33:39 | * | daanbreur quit (Client Quit) |
08:34:37 | FromDiscord | <Elegantbeef> Could use an intermediate macro but no clue if it's worth the time |
08:35:36 | FromDiscord | <jmgomez> probably not, because the final user wont be calling it anyways.. |
08:35:36 | Amun-Ra | speaking of macros, I started writing macros thanks to Elegantbeef; I've created my first "serious" macro some time ago (https://github.com/amnr/dynlibutils) #shamelessplug |
08:35:44 | FromDiscord | <Elegantbeef> The newlit is the solution but it requires using importutils since you dont own all the types |
08:35:47 | FromDiscord | <Elegantbeef> Thanks to me?! |
08:36:32 | FromDiscord | <jmgomez> In reply to @Elegantbeef "The newlit is the": importutils should be on the call or definition of the macro? I place it in both and it still complained |
08:37:00 | FromDiscord | <Elegantbeef> It doesnt magically solve the issue you still need to set private access to all the types |
08:37:39 | FromDiscord | <jmgomez> seems more trouble that just letting two params though |
08:37:53 | FromDiscord | <Elegantbeef> Now amun if only you knew micros existed 😉 https://github.com/beef331/micros/ |
08:38:01 | FromDiscord | <Elegantbeef> I still dont have the best docs for micros |
08:38:11 | FromDiscord | <Elegantbeef> And it doesnt have total coverage of the Nim ast |
08:38:49 | Amun-Ra | Elegantbeef: oh, I haven't; but by using your code I wouldn't learn much in a process ;> |
08:39:13 | FromDiscord | <Elegantbeef> I guess but that's kinda the idea behind micros |
08:39:52 | FromDiscord | <Elegantbeef> It shouldnt be hard to write macros it should be easy the reason it's hard is cause of lacking good stdlib helper procedures/iterators |
08:40:12 | Amun-Ra | the one thing I have to change is to not rely on hardcoded library handle name |
08:40:44 | FromDiscord | <Elegantbeef> I assume you read my macro writeup which is why you thanked me initially? |
08:41:04 | Amun-Ra | that, and all the discussions here |
08:41:22 | FromDiscord | <Elegantbeef> People read the drivel i post here, sorry! |
08:41:32 | Amun-Ra | :P |
08:42:52 | FromDiscord | <Elegantbeef> I do always wonder how many people are more of the lurking type and actually read the chat |
08:43:40 | FromDiscord | <Rika> I’m the opposite |
08:49:21 | Amun-Ra | I'm ususally a lurker |
08:50:55 | FromDiscord | <Prestige> I mainly just talk to beef |
08:51:11 | FromDiscord | <Elegantbeef> I think everyone mainly talks to me 😛 |
08:51:34 | FromDiscord | <Elegantbeef> How much am i getting paid again... oh, i've got to go |
08:53:36 | ggst | hello, are there versions of min/max that return a default value if container is empty? I can write those, but maybe they exist already and I couldn't find them. |
08:54:05 | FromDiscord | <Elegantbeef> Prestige i'm inching slower and slower to a wayland compositor, i hate myself |
08:55:22 | FromDiscord | <Elegantbeef> Seems not ggst so i guess have fun with your `minOrDefault` |
08:56:57 | FromDiscord | <Prestige> You going to make one? |
08:57:31 | FromDiscord | <Elegantbeef> I really dont want to spend the time on it but I also very much want to spend the time on it |
08:58:33 | FromDiscord | <Elegantbeef> It doesnt help that i seen tinywl and other compositors and they're not that complicated |
08:59:08 | FromDiscord | <Elegantbeef> X is much more tedious/complicate afaict |
09:01:39 | * | lkioi joined #nim |
09:02:03 | * | lkioi quit (Client Quit) |
09:04:45 | FromDiscord | <Prestige> I'm down to help iterate on it, if you end up starting a project |
09:04:54 | FromDiscord | <Prestige> I'm slightly interested |
09:08:43 | FromDiscord | <Geiseric> Are there alternatives to build windows binaries without mingw? |
09:09:20 | FromDiscord | <Elegantbeef> You could use zig's c compiler |
09:09:31 | FromDiscord | <Geiseric> I've discovered that a different mingw version fucks things up pretty badly. Mingw 10 makes bigger binaries and doesn't even allow me to drop a binary on disk |
09:09:37 | FromDiscord | <Geiseric> While mingw 7 goes smooth clean |
09:13:46 | FromDiscord | <Elegantbeef> Dont know how easy clang is for cross compliation |
09:16:45 | FromDiscord | <Geiseric> found this https://github.com/arnetheduck/nlvm |
09:16:52 | FromDiscord | <Geiseric> testing it rn, could be game changing |
09:23:58 | FromDiscord | <Elegantbeef> I mean it's not compatible with all Nim code so it's not the best thing |
09:24:17 | FromDiscord | <Elegantbeef> But like i said Zig's C compilation should work |
09:28:45 | * | jmdaemon quit (Ping timeout: 244 seconds) |
09:33:21 | * | ggst quit (Quit: Client closed) |
09:45:26 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=41PJ |
09:45:39 | FromDiscord | <aph> thanks |
09:46:00 | FromDiscord | <aph> normal python worked, ive ran this in repl |
09:46:33 | FromDiscord | <aph> or maybe i should try py2nim |
09:52:15 | FromDiscord | <TryAngle> how do I write a macro that let's me define Enums partially? |
09:54:12 | NimEventer | New thread by Evilla: What to do with the handle from CreateNativeSocket?, see https://forum.nim-lang.org/t/9288 |
09:55:16 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41PL |
09:55:31 | FromDiscord | <TryAngle> something like that, idk just something that let's me combine them |
09:55:42 | FromDiscord | <TryAngle> (edit) "them" => "them, this is just an idea" |
09:56:39 | FromDiscord | <enthus1ast> thats a forkbomb .....↵(@aph) |
09:56:48 | FromDiscord | <enthus1ast> had to hard reset my machine |
09:57:20 | FromDiscord | <aph> In reply to @enthus1ast "thats a forkbomb .....": what the fuck, i didnt realize that, it worked when using python. guess i'll have to use another lib |
09:58:07 | FromDiscord | <enthus1ast> i mean not that it is malicious, but could be a programming mistake somewhere |
09:58:22 | FromDiscord | <aph> hmm ill check it, thanks |
10:00:49 | FromDiscord | <Geiseric> In reply to @Elegantbeef "But like i said": can zig compile a nim to windows from linux? |
10:00:55 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=41PP |
10:01:14 | FromDiscord | <TryAngle> In reply to @aph "do you need all": only the combination should exist at the end |
10:02:12 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41PQ |
10:02:18 | FromDiscord | <TryAngle> and the parsing easier |
10:02:35 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=41PR |
10:02:59 | FromDiscord | <jmgomez> Is there a way to maybe have an array of untyped params and to use the last one as body? |
10:09:34 | FromDiscord | <jmgomez> Okay, found a way |
10:11:53 | * | CyberTailor joined #nim |
10:12:34 | FromDiscord | <Prestige> Elegantbeef: okay let's do it. So long as we don't call it something like "beefland" |
10:14:02 | CyberTailor | (rant) Ughh... Araq and dom are sooo welcome to any contributions |
10:19:10 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=41PX |
10:19:30 | FromDiscord | <TryAngle> In reply to @aph "so uh will `test0`": what do you mean? their numeric value? |
10:19:36 | FromDiscord | <aph> In reply to @TryAngle "what do you mean?": yes |
10:19:53 | FromDiscord | <TryAngle> idc, tbh, in order increasing I'd say |
10:19:56 | FromDiscord | <TryAngle> I just ofudn the quote macro |
10:20:03 | FromDiscord | <TryAngle> can't I do it waht that? |
10:20:46 | FromDiscord | <aph> ¯\_(ツ)_/¯ |
10:21:01 | FromDiscord | <Geiseric> How would you guys compile a nim file with zig? |
10:21:11 | FromDiscord | <Geiseric> Can't find anything online |
10:21:13 | FromDiscord | <dom96> CyberTailor: huh? |
10:21:55 | FromDiscord | <dom96> What are you referring to? |
10:22:17 | CyberTailor | just in general, compared to other upstreams |
10:22:22 | FromDiscord | <aph> In reply to @Geiseric "How would you guys": zigcc? idk |
10:22:52 | FromDiscord | <Prestige> Are you suggesting they don't welcome contributions? |
10:24:06 | FromDiscord | <dom96> I’d love some examples. I don’t recall a PR to my repos from you. |
10:25:01 | FromDiscord | <dom96> If I rejected something incorrectly then I apologise. But I’d like to know what so I can improve :) |
10:26:54 | CyberTailor | it's different vision, like whether DESTDIR should be supported |
10:27:29 | FromDiscord | <xflywind> In reply to @Geiseric "Can't find anything online": @phil has written a simple introduction to use zig cc with Nim => https://planety.github.io/prologue/deployment/ |
10:28:12 | FromDiscord | <xflywind> see the last part |
10:29:19 | FromDiscord | <dom96> CyberTailor: you’ll need to be more specific. No idea what you’re talking about and how I’m involved |
10:29:29 | CyberTailor | nimble |
10:30:25 | FromDiscord | <Prestige> destDir like a build/output dir? |
10:30:37 | FromDiscord | <Prestige> I'm pretty sure that's supported |
10:30:47 | FromDiscord | <dom96> Yeah |
10:30:58 | FromDiscord | <Prestige> I use it for all my projects |
10:31:02 | FromDiscord | <dom96> You can specify binDir in your nimble file |
10:31:23 | CyberTailor | it's a temporary stage dir for e.g. `nimble install` |
10:32:06 | CyberTailor | so it installs not to "/opt/nimble" but to "/var/tmp/portage/dev-nim/package/image/opt/nimble" |
10:32:20 | FromDiscord | <Geiseric> In reply to @flywind "@phil has written a": Doesnt' seem to cover cross compiling tho. I also get weird errors which google doesn't know how to fix 😦 |
10:32:25 | CyberTailor | but finds deps in "/opt/nimble" |
10:32:49 | FromDiscord | <Prestige> In reply to @Geiseric "Doesnt' seem to cover": Can you provide more info? |
10:33:38 | FromDiscord | <Geiseric> sent a code paste, see https://play.nim-lang.org/#ix= |
10:34:03 | FromDiscord | <Geiseric> zigcc command not found |
10:35:07 | FromDiscord | <Prestige> Do you have zigcc? |
10:36:45 | FromDiscord | <Geiseric> i have zig |
10:36:48 | FromDiscord | <Geiseric> not zigcc |
10:37:08 | FromDiscord | <enthus1ast> @TryAngle\: i've build the macro |
10:37:19 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/uMv |
10:37:28 | FromDiscord | <enthus1ast> for getting more fluent in macros |
10:37:39 | FromDiscord | <Prestige> In reply to @Geiseric "not zigcc": I'm no zig doctor but it sounds like you need zigcc |
10:37:52 | FromDiscord | <Geiseric> there doesn't seem a way to install it tho |
10:38:09 | FromDiscord | <Geiseric> every google search is like "you meaning gcc?" |
10:38:48 | FromDiscord | <aru-hackZ> what distro/os you on? |
10:38:50 | FromDiscord | <Rika> "zigcc" is a shell script that just contains "zig cc" |
10:39:06 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41Q4 |
10:39:06 | FromDiscord | <Geiseric> In reply to @aru-hackZ "what distro/os you on?": debian |
10:39:33 | FromDiscord | <aru-hackZ> isn't there a package for `zig`? |
10:39:41 | FromDiscord | <Geiseric> Nope |
10:39:45 | FromDiscord | <aru-hackZ> I use NixOS so idk |
10:39:48 | FromDiscord | <Geiseric> I've installed it manually from the tarxz |
10:40:31 | FromDiscord | <aph> In reply to @Geiseric "zigcc command not found": copy the shell script prob |
10:41:41 | FromDiscord | <aph> for cross compiling probably use the `os` option, like `--os:windows` iirc, not sure haven't done cross compiling |
10:43:38 | FromDiscord | <enthus1ast> i think the generated enum must have {.pure.} pragma↵(@TryAngle) |
10:44:00 | FromDiscord | <enthus1ast> it would fail when the original enum has values |
10:44:33 | FromDiscord | <dom96> CyberTailor: sounds useful, I guess required for packaging? I still don’t understand what I did to deserve you suggesting I don’t welcome contributions though. Feel free to PM me (Discord) or email me if you don’t want to chat about this here. |
10:46:05 | CyberTailor | https://github.com/nim-lang/nimble/pull/965 |
10:46:24 | CyberTailor | although if i implemented it now, i'd make it an env variable |
10:46:38 | CyberTailor | to conform with how it's usually invoked |
10:48:59 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41Q6 |
10:51:41 | * | _________ joined #nim |
10:52:34 | FromDiscord | <TryAngle> oh no |
10:52:41 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41Q8 |
10:52:50 | FromDiscord | <TryAngle> I just noticed ths appraoch won't work rly in practice |
10:53:15 | FromDiscord | <TryAngle> because I would need to recursive depend on it 😐 |
10:53:25 | FromDiscord | <TryAngle> in the case I wanted to use that |
10:53:30 | FromDiscord | <enthus1ast> this i don't know \:) i was just practice macros↵(@TryAngle) |
10:57:57 | FromDiscord | <dom96> CyberTailor: Re-reading our discussion I think we’ve both agreed that supporting multiple nimble dirs is the right solution. Then you created a new PR and life happened. A classic lack of time/interest to merge PRs into Nimble. Lack of action on a PR shouldn’t be taken as “we don’t want your PR” or otherwise unwelcoming. |
10:58:42 | CyberTailor | got it |
11:00:35 | FromDiscord | <dom96> That said. It is a problem that I’m just about the only one active in Nimble PRs. After that project moved to the nim-lang repo I would have hoped others would have helped with development. Now that we have Status working on Nimble I think even more so it is in their hands. |
11:12:01 | FromDiscord | <Entikan> is there an example for downcasting in nim? |
11:12:27 | FromDiscord | <Entikan> I tried searching for "downcast nim" but I can't find anything |
11:13:14 | FromDiscord | <enthus1ast> think this make only sense with ref objects↵(@Entikan) |
11:18:57 | FromDiscord | <enthus1ast> there is an example\: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark |
11:27:48 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41Qd |
11:27:51 | FromDiscord | <zhmtzhmt> what is the difference? |
11:28:22 | FromDiscord | <zhmtzhmt> type Tmp = genericParams(N).get(0) failed to compile |
11:28:52 | FromDiscord | <Rika> I think there shouldn’t be a difference… |
11:28:53 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41Qe |
11:29:41 | FromDiscord | <enthus1ast> think the difference is typedesc |
11:29:53 | FromDiscord | <Rika> N is a typedesc too though |
11:30:13 | FromDiscord | <zhmtzhmt> Is there any way to fix it? |
11:31:31 | FromDiscord | <zhmtzhmt> my actual proc declarition is : |
11:31:51 | FromDiscord | <zhmtzhmt> sent a code paste, see https://paste.rs/J4p |
11:32:32 | FromDiscord | <zhmtzhmt> Is it possible convert typedesc to type |
11:32:41 | FromDiscord | <zhmtzhmt> (edit) "type" => "type?" |
11:34:59 | * | daanb quit (Quit: Leaving) |
11:39:59 | * | mronetwo joined #nim |
11:41:11 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41Ql |
12:03:05 | FromDiscord | <whisper> In reply to @enthus1ast "<@740841107117834330>\: a LPDWORD is": So how should I exactly do this? |
12:04:17 | * | xet7 joined #nim |
12:04:20 | FromDiscord | <soundmodel> does the JS backend allow so that one doesn't have to write JS? |
12:04:42 | FromDiscord | <soundmodel> (edit) "does the JS backend allow so that one doesn't have to write JS? ... " added "I.e. "write Nim, autogenerate JS"?" |
12:10:30 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41Qo |
12:11:24 | FromDiscord | <zhmtzhmt> copy data from cchar to nim string. |
12:26:50 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41Qr |
12:29:08 | FromDiscord | <enthus1ast> usually when the winapi wants a pointer to a dword, it is an output param, though. |
12:57:29 | madprops | expandSymlink(path) is throwing an error |
12:57:37 | madprops | Error: unhandled exception: Invalid argument |
12:57:39 | madprops | im just sending it a string |
12:57:47 | madprops | with a path |
13:00:09 | madprops | or whats' the best way to fully resolve a path |
13:00:13 | madprops | expand tilde and symlinks |
13:00:29 | madprops | i guess i don't need the symlink bit |
13:03:42 | madprops | also weird behavior with relative = true in walkDirRec |
13:03:50 | madprops | if i give it a custom path it won't work |
13:04:01 | madprops | i think it uses the current working directory somehow |
13:08:02 | madprops | i think it's a bug |
13:11:27 | madprops | might be my bad... |
13:12:38 | FromDiscord | <demotomohiro> `expandTilde(path).expandSymlink()` might work. |
13:20:47 | FromDiscord | <zhmtzhmt> I am using vscode, breakpoints in nim file don't work, but these ones in c file were hit. Any body knows why? |
13:21:51 | FromDiscord | <zhmtzhmt> Everything is ok two days ago. |
13:22:04 | FromDiscord | <zhmtzhmt> (edit) "is" => "was" |
13:26:50 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
13:27:11 | * | dtomato joined #nim |
13:32:06 | madprops | hmm |
13:32:27 | madprops | /some/path/sub fails if the symlink's root is /some/path |
13:32:34 | madprops | it doesn't consider it a symlink |
13:47:02 | * | krux02 joined #nim |
14:14:40 | FromDiscord | <whisper> sent a code paste, see https://play.nim-lang.org/#ix=41QQ |
14:15:16 | FromDiscord | <zhmtzhmt> what does the "-g" compiler option mean? |
14:16:04 | FromDiscord | <zhmtzhmt> cast[LPDWORD] (addr buffer) |
14:16:39 | FromDiscord | <zhmtzhmt> You should make sure addr buffer is writable. |
14:17:36 | FromDiscord | <whisper> oh wow that works |
14:17:41 | FromDiscord | <whisper> why is that so? |
14:19:58 | * | LuxuryMode joined #nim |
14:21:55 | * | kamuridesu joined #nim |
14:22:18 | FromDiscord | <jan0809> hey, what to use for non blocking (async) socket connections? can i just use `std/net` with async dispatch or chronos? |
14:22:43 | FromDiscord | <jan0809> or should one use `node` |
14:23:07 | * | kamuridesu quit (Client Quit) |
14:23:57 | * | kamuridesu joined #nim |
14:24:33 | * | kamuridesu quit (Client Quit) |
14:29:02 | * | arkurious joined #nim |
14:42:38 | NimEventer | New Nimble package! hangover - A game engine in Nim with an opengl backend, see https://github.com/bob16795/hangover |
14:53:33 | FromDiscord | <demotomohiro> @jan0809 Here is asyncnet tutorial: https://xmonader.github.io/nimdays/day15_tcprouter.html |
14:55:11 | FromDiscord | <jan0809> ty ❤️ |
14:55:32 | FromDiscord | <TryAngle> how do I get the typeId of a type? |
14:55:38 | FromDiscord | <TryAngle> I would like to do a singleton map |
14:55:58 | FromDiscord | <TryAngle> std/typInfo seems to be wrong? |
15:00:03 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41R3 |
15:05:16 | FromDiscord | <TryAngle> ah and the value should be any, not just string |
15:06:56 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=41Rf |
15:07:13 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=41Rf" => "https://play.nim-lang.org/#ix=41Rg" |
15:15:42 | NimEventer | New thread by Lancer: Is covariance supported?, see https://forum.nim-lang.org/t/9289 |
15:43:14 | * | gsalazar quit (Remote host closed the connection) |
15:55:33 | * | CyberTailor quit (Remote host closed the connection) |
15:56:24 | * | CyberTailor joined #nim |
16:27:03 | FromDiscord | <treeform> In reply to @lantos "<@107140179025735680> hey, with": `Optional[seq[string]]` or `ref seq[string]` |
16:58:05 | FromDiscord | <vindaar> I don't understand what you really want. can you clarify? Having a type as a table key like that definitely isn't possible though. Nor is storing different types as values↵(@TryAngle) |
16:58:35 | FromDiscord | <soundmodel> In reply to @soundmodel "does the JS backend": Still trying to understand the intended use of the JS backend |
17:11:41 | FromDiscord | <ripluke> with c2nim do i have to translate every header file that the file im translating needs? |
17:12:18 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41RN |
17:13:20 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=41RN" => "https://play.nim-lang.org/#ix=41RO" |
17:13:26 | FromDiscord | <TryAngle> resources is basically a global struct that handles thread safe access to to single existing structs |
17:13:47 | FromDiscord | <TryAngle> I want to use this in conjuction with polymorph |
17:14:12 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=41RO" => "https://play.nim-lang.org/#ix=41RP" |
17:16:28 | FromDiscord | <vindaar> will the "keys" be unique per type or might you have multiple keys of the same type? |
17:17:03 | FromDiscord | <TryAngle> In reply to @vindaar "will the "keys" be": unique per type |
17:18:04 | FromDiscord | <TryAngle> the point is to make parts of the engine easy accessible to the ECS and the engine itself without having everything as a global |
17:23:54 | * | pro joined #nim |
17:28:00 | * | pro quit (Client Quit) |
17:31:20 | FromDiscord | <vindaar> It depends a bit on how unsafe you're happy with. Given that you to store multiple types, you can either define a variant object in advance that is used internally by the `resources`. Or go the fully unsafe route and just store pointers to the data you store. or something in between.↵The unique per type part at least means your `insert` proc can just be a generic and you e.g. use the stringified name of the given input type as a key in |
17:32:47 | FromDiscord | <vindaar> or go the macro route and construct the type based on the given data such that it precisely has one field for each type. That's more work to implement and possibly has some usage drawbacks (e.g. might require you to either define all types you will use in the beginning once or otherwise possibly require to copy data) |
17:33:20 | FromDiscord | <vindaar> on the other hand that's as safe as hand written code using a custom object with fields for each |
17:35:08 | FromDiscord | <mattrb> Any idea why I might be seeing a segfault when using sdl audio callbacks? Not sure if I'm using sdl incorrectly or if something else is going on... Here's a gist with the cut down code and the segfault backtrace https://gist.github.com/mattrberry/1d8bd1a9b148ddf3261f5e1fb2c63e7c |
17:37:39 | FromDiscord | <TryAngle> In reply to @vindaar "It depends a bit": hmm, I hoped I can avoid any strings etc. so the best way would be to take the name of a type / string↵variant in advance doens't work because the point of this is to be as generic as possible |
17:39:19 | FromDiscord | <TryAngle> is typetraits type.name a big overhead when done often? |
17:39:34 | FromDiscord | <vindaar> well, the string conversion in theory could happen at CT and could be mapped to a simple integer index |
17:41:32 | FromDiscord | <vindaar> I think `Foo.name` simply generates a static string |
17:42:08 | FromDiscord | <TryAngle> In reply to @vindaar "I think `Foo.name` simply": hmm so it's generated at comptime? |
17:42:42 | FromDiscord | <vindaar> I'm not 100% certain, but it seems the simpler and smarter option. And there isn't much runtime type information to begin with nowadays anymore |
17:42:49 | FromDiscord | <zoefiri> hhiiiiiii,, |
17:43:17 | FromDiscord | <TryAngle> hmm so I understand that I can use static[string] for "indexing" now but how would I store different types there? |
17:43:44 | FromDiscord | <TryAngle> do I have to create "layouts" and then parse an any type via those layouts?? |
17:44:02 | FromDiscord | <vindaar> it really depends on your use case. This is a non trivial problem in general |
17:44:24 | FromDiscord | <TryAngle> 💀 |
17:45:17 | FromDiscord | <vindaar> e.g. are you fine copying data sometimes? does all data that is stored remain in scope? do you store a mix of ref or non ref objects? etc |
17:46:33 | FromDiscord | <vindaar> (I say this is complicated, because I'd love to move the datamancer logic to something fully generic "that just works" for data frames that support any input type. But it's just not easy for certain constraints) |
17:47:59 | FromDiscord | <TryAngle> well I want to use that for threadsafe access for engine parts basically, so all are ref I guess?↵for example call the Keyboard handling inside engine parts (window glfw -> key pressed -> input handler) and the ecs (input handler -> key pressed -> draw square on window 2) |
17:49:01 | * | xet7 quit (Quit: Leaving) |
17:51:46 | FromDiscord | <enthus1ast> does one know if i can display string reallocation, when they occur? |
17:55:26 | FromDiscord | <vindaar> hack something into `resize` in `lib/system/sysstr.nim` / `lib/system/strs_v2.nim` (whichever impl is used at the moment)? |
17:57:48 | FromDiscord | <enthus1ast> lib/system ; i guess i do not need to rebuild the compiler right? |
17:58:27 | FromDiscord | <vindaar> sent a long message, see http://ix.io/41RZ |
17:59:08 | FromDiscord | <vindaar> nope, the `lib/system` stuff is just a regular nim library. Just modify and go (as long as you're looking at the stdlib that you actually use) |
17:59:21 | FromDiscord | <enthus1ast> thank you [vindaar](https://matrix.to/#/@vindaar:matrix.org) |
17:59:43 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
17:59:47 | FromDiscord | <vindaar> you might have to use regular old `printf` (known as `cprintf` wrapped), because in some of those `system` libraries `echo` isn't defined yet |
18:00:02 | FromDiscord | <TryAngle> In reply to @vindaar "hmm, I don't think": u pointed me into the right direction I think ↵thanks 🥺 |
18:00:30 | FromDiscord | <TryAngle> also thanks for ur hdf5 library I think I will use that for uni soon 😂 |
18:01:02 | FromDiscord | <vindaar> haha, nice! feel free to ping me if you have questions about it then↵(@TryAngle) |
18:05:26 | FromDiscord | <TryAngle> In reply to @vindaar "haha, nice! feel free": 🥺 |
18:08:47 | * | krux02 quit (Remote host closed the connection) |
18:09:25 | * | krux02 joined #nim |
18:10:54 | FromDiscord | <ezquerra> In reply to @Elegantbeef "Yea Nim's effect/side effect": Yet, in a recent forum thread @Araq#0647 said that he considered the effect system a mistake (which is a bit odd given the coverage it gets it Araq’s book!) |
18:10:59 | FromDiscord | <vindaar> sent a code paste, see https://paste.rs/14R |
18:25:53 | FromDiscord | <ripluke> How can I sort in descending order? The sort function in std/algorithm sorts in ascending order |
18:27:12 | FromDiscord | <huantian> The order parameter in the sort proc |
18:27:33 | FromDiscord | <ripluke> What do I put there? |
18:27:48 | FromDiscord | <ripluke> Oh nvm |
19:02:15 | * | rockcavera joined #nim |
19:02:15 | * | rockcavera quit (Changing host) |
19:02:15 | * | rockcavera joined #nim |
19:08:19 | bigbyt | how does nim fit into athene's theory of everything? |
19:10:39 | FromDiscord | <huantian> I could never beat theory of everything even though it's like not too hard |
19:12:41 | * | jmdaemon joined #nim |
19:13:50 | * | Kiori joined #nim |
19:24:09 | FromDiscord | <enthus1ast> [vindaar](https://matrix.to/#/@vindaar:matrix.org)\: it seems that arc uses strs\_v2 while the default one uses sysstr |
19:27:22 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41St |
19:27:32 | FromDiscord | <enthus1ast> i guess thats pretty decent |
19:28:23 | FromDiscord | <enthus1ast> same (test) data, same output only compile time optimization |
19:30:48 | NimEventer | New thread by Severak: Does statically linking lua works?, see https://forum.nim-lang.org/t/9290 |
19:38:29 | FromDiscord | <kevin> Does anyone know how to capture console output to a variable in Nim? |
19:38:58 | FromDiscord | <kevin> sent a code paste, see https://play.nim-lang.org/#ix=41Sw |
19:39:30 | FromDiscord | <kevin> Wondering if there is something similar in Nim that can be used to redirect `echo` statements (or other console output) to a variable |
19:41:02 | FromDiscord | <enthus1ast> built in; not that i know |
19:41:25 | FromDiscord | <enthus1ast> but you maybe write a macro / term rewrite macro |
19:42:06 | FromDiscord | <enthus1ast> that replace `echo` with something else |
19:43:39 | FromDiscord | <kevin> macro wouldn't work for me in my case. Need to be able to redirect all forms of console output, including `printf`, `Console.WriteLine()`, etc |
19:45:39 | FromDiscord | <voidwalker> I still suck at tuple syntax.. pls let me know what's wrong with this: |
19:45:56 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=41SA |
19:46:26 | FromDiscord | <enthus1ast> availFiles.add( (fileName,fileSize) ) |
19:46:33 | FromDiscord | <voidwalker> availFiles.add((fileName,fileSize)) |
19:46:37 | FromDiscord | <voidwalker> hah just figured it out myself 😄 |
19:52:32 | CyberTailor | kevin: with python you can just set sys.stdout |
19:52:37 | FromDiscord | <voidwalker> how about writing/reading this sequence of tuples to a file ? |
19:53:28 | FromDiscord | <kevin> In reply to @CyberTailor "<@281679831119167489>: with python you": is there something similar in Nim where you can set the stdout? |
19:53:42 | FromDiscord | <enthus1ast> @voidwalker\: i would go for jsony and convert it to json |
19:54:13 | FromDiscord | <enthus1ast> std/json or jsony |
19:54:45 | FromDiscord | <voidwalker> jsony brags about being faster than all, so I will use that |
19:55:42 | FromDiscord | <enthus1ast> if you need this to be hyper fast, you can prolly roll it yourself |
19:55:47 | FromDiscord | <enthus1ast> for this one task |
19:55:56 | FromDiscord | <Q-Master> https://github.com/Q-Master/packets.nim arrayPacket might help.↵(@voidwalker) |
19:58:18 | * | Kiori quit (Ping timeout: 276 seconds) |
20:15:13 | FromDiscord | <TryAngle> is there a good channel alternative for many senders many recievers, that has to be explicitly cleared? |
20:15:39 | FromDiscord | <deeuu> In reply to @ezquerra "Yet, in a recent": Yep I thought the same. I'd love to here why |
20:16:48 | FromDiscord | <enthus1ast> maybe loony? https://github.com/nim-works/loony↵(@TryAngle) |
20:18:56 | FromDiscord | <enthus1ast> but have not used it, only toyed with it |
20:23:09 | FromDiscord | <TryAngle> In reply to @enthus1ast "but have not used": looks interesting, thanks for sharing |
20:23:32 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=41SK |
20:24:52 | * | Kiori joined #nim |
20:36:49 | FromDiscord | <huantian> In reply to @kevin "is there something similar": Yes but I cannot remember for the life of me what it is |
20:37:43 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/io.html#reopen%2CFile%2Cstring%2CFileMode |
20:37:58 | FromDiscord | <enthus1ast> this is interesting... |
20:39:32 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41SL |
20:39:37 | FromDiscord | <enthus1ast> this indeed works |
20:39:40 | FromDiscord | <enthus1ast> nice to know |
20:43:03 | FromDiscord | <zhmtzhmt> @whisper |
20:44:06 | FromDiscord | <zhmtzhmt> sent a code paste, see https://play.nim-lang.org/#ix=41SM |
20:45:03 | NimEventer | New thread by Mildred: Fidget: How does the layout system work (what is this orgBox?), see https://forum.nim-lang.org/t/9291 |
20:50:23 | FromDiscord | <zhmtzhmt> what does the compiler option "-g" mean? I found nothing about it in tutorial. |
20:50:38 | FromDiscord | <Phil> There's an option like that? Huh |
20:50:59 | FromDiscord | <zhmtzhmt> It make me can't debug without it? |
20:51:08 | FromDiscord | <zhmtzhmt> .... |
20:51:39 | FromDiscord | <huantian> It’s a shortcut for --debugger:native |
20:51:41 | FromDiscord | <zhmtzhmt> (edit) "it?" => "it." |
20:52:12 | FromDiscord | <zhmtzhmt> thank you |
20:52:54 | FromDiscord | <zhmtzhmt> there is nothing about it in the document |
20:53:02 | FromDiscord | <huantian> Yep |
20:54:03 | FromDiscord | <zhmtzhmt> 😂 |
20:55:14 | FromDiscord | <huantian> PRs welcome if you would like that to change |
21:02:14 | FromDiscord | <zhmtzhmt> @Phil Don't debug nim? Breakpoint will not be hit without it. |
21:02:33 | FromDiscord | <zhmtzhmt> (edit) "@Phil Don't ... debug" added " you" |
21:02:59 | FromDiscord | <Elegantbeef> Most people use `echo` to debug nim |
21:03:04 | FromDiscord | <Elegantbeef> Or treeform's printy |
21:03:25 | FromDiscord | <enthus1ast> its just called print |
21:03:30 | FromDiscord | <Elegantbeef> Breakpoint debugging exists and can be used, but in most cases it's not really needed |
21:03:41 | FromDiscord | <zhmtzhmt> I see, but it is not efficient. |
21:03:44 | FromDiscord | <Elegantbeef> He's let us all down |
21:03:46 | FromDiscord | <enthus1ast> yeah |
21:03:54 | FromDiscord | <Elegantbeef> How is it not efficient |
21:04:12 | FromDiscord | <Elegantbeef> It's literally the exact same thing in most cases |
21:04:39 | FromDiscord | <Elegantbeef> "I want to see the value this type holds" hmmm `echo myType` or setting up a debugger and breakpointing.... |
21:04:43 | FromDiscord | <zhmtzhmt> We have to write code to print, and compile then, and run. |
21:04:55 | FromDiscord | <enthus1ast> you can set breakpoints |
21:05:04 | FromDiscord | <Elegantbeef> I mean my compile times are like \<1s |
21:05:36 | FromDiscord | <Elegantbeef> Sorry my game compiles in 3 seconds i lied |
21:05:39 | FromDiscord | <zhmtzhmt> with debuging, click a break point, run, and we can see all variable's value now. |
21:05:55 | FromDiscord | <Elegantbeef> I mean you do you, i just know i dont often reach for a debugger |
21:06:01 | FromDiscord | <Elegantbeef> Even when dealing with things like the compiler |
21:06:14 | FromDiscord | <enthus1ast> its true the debugging ist by far not that nice as with eg c# |
21:06:31 | FromDiscord | <zhmtzhmt> I have been used to it. |
21:06:33 | FromDiscord | <Phil> In reply to @zhmtzhmt "<@180601887916163073> Don't ": Echo, echo everywhere, so much echo x.repr you wouldn't believe |
21:07:13 | FromDiscord | <Elegantbeef> I mean even when i wrote C# i never really reached for a debugger |
21:07:27 | FromDiscord | <Elegantbeef> The only time I used a debugger in C# was when i had a super recursive function |
21:08:34 | FromDiscord | <zhmtzhmt> I rely on debugger heavily. 😂 |
21:09:20 | FromDiscord | <zhmtzhmt> Maybe it's a different habit |
21:09:38 | FromDiscord | <Prestige> Just don't write bugs and you won't need to debug |
21:09:41 | FromDiscord | <fwsgonzo> Hey all, is there a convenience function to convert a number to kb/mb/gb? |
21:09:42 | FromDiscord | <Phil> Its the better habit, strictly speaking |
21:09:44 | FromDiscord | <fwsgonzo> (edit) "kb/mb/gb?" => "kb/mb/gb string?" |
21:09:47 | FromDiscord | <fwsgonzo> (edit) "Hey all, is there a convenience function to convert a number to kb/mb/gb ... string?" added "-size" |
21:10:14 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/strutils.html#formatSize%2Cint64%2Cchar |
21:10:52 | FromDiscord | <Elegantbeef> I mean it doesnt help that debuggers + Nim just dont work |
21:11:06 | FromDiscord | <Elegantbeef> If you have a bitset the debugger doesnt output anything useful |
21:11:22 | FromDiscord | <huantian> can't wait for a debugger actually made for nim |
21:11:34 | FromDiscord | <Elegantbeef> Ah yes it's `18`, now to figure out the fuck that means |
21:11:42 | FromDiscord | <enthus1ast> imho ist just a matter how much work is done in this nim debugger .py file |
21:11:56 | FromDiscord | <Elegantbeef> People have tried enthus, people have tried |
21:12:03 | FromDiscord | <Prestige> I've used gdb for some small stuff long ago, seemed alright. But I wasn't doing anything crazy |
21:12:06 | FromDiscord | <Elegantbeef> saem tried to get variant types to output properly and he couldnt |
21:12:21 | FromDiscord | <ripluke> With futhark does it automatically convert every file that's imported into the header file? |
21:12:32 | FromDiscord | <ripluke> Or do I do it manually |
21:12:35 | FromDiscord | <Elegantbeef> Yes |
21:12:41 | FromDiscord | <fwsgonzo> Thanks, @ElegantBeef |
21:12:45 | FromDiscord | <Elegantbeef> Remember how C is just including a big single file |
21:12:52 | FromDiscord | <zhmtzhmt> I am a newbie, debugger seems ok for now. |
21:13:01 | FromDiscord | <ripluke> This'll be fun af https://media.discordapp.net/attachments/371759389889003532/994712667979796540/20220707_12h22m12s_grim.png |
21:13:08 | FromDiscord | <Elegantbeef> Futhark uses a c compiler API to reason the types and everything |
21:13:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41SS |
21:13:39 | FromDiscord | <ripluke> In reply to @Elegantbeef "Futhark uses a c": Yea but what if your header file is just a bunch of includes |
21:13:53 | FromDiscord | <Elegantbeef> It'll wrap all that's in there |
21:13:58 | FromDiscord | <enthus1ast> @ripluke\: weh have gintro |
21:14:14 | FromDiscord | <ripluke> Does it support layershell tho |
21:14:23 | FromDiscord | <enthus1ast> no idea what that is |
21:14:53 | FromDiscord | <ripluke> It's kinda hard to explain |
21:15:25 | FromDiscord | <ripluke> But it's a Wayland thing which let's u make floating/overlapping windows with gtk |
21:15:43 | FromDiscord | <ripluke> So like most bars for Wayland use it |
21:15:55 | FromDiscord | <ripluke> Aswell as most wallpaper applications |
21:16:42 | FromDiscord | <enthus1ast> https://github.com/StefanSalewski/gintro/issues/110 |
21:16:56 | FromDiscord | <enthus1ast> it seems yes |
21:17:14 | FromDiscord | <ripluke> In reply to @enthus1ast "https://github.com/StefanSalewski/gintro/issues/110": Ok |
21:17:38 | FromDiscord | <ripluke> So thankfully I won't be spending 24+ hours converting headers |
21:18:29 | FromDiscord | <fwsgonzo> Does Nim have an equivalent of C++ string_view that has widespread support in the standard libraries? |
21:19:00 | FromDiscord | <fwsgonzo> I find myself constructing a lot of strings from (custom) system APIs in order to call into Nim functions |
21:20:50 | FromDiscord | <fwsgonzo> Imagine for example that we enter the code with a C function that is provided a 100MB PNG by pointer in memory, then the goal is to call into Nim using its own APIs |
21:24:08 | FromDiscord | <zhmtzhmt> slice |
21:24:10 | FromDiscord | <zhmtzhmt> https://nim-lang.org/docs/tut1.html#advanced-types-slices |
21:24:35 | FromDiscord | <zhmtzhmt> @fwsgonzo |
21:25:19 | FromDiscord | <Elegantbeef> No |
21:25:22 | FromDiscord | <Elegantbeef> `openArray[T]` |
21:26:08 | FromDiscord | <Elegantbeef> pointers, sequences, and strings have `toOpenArray` you can pass into procedures or iterate which is a 0 cost slice but cannot be held in a variable |
21:26:29 | FromDiscord | <Elegantbeef> well `ptr UncheckedArray[T]` has |
21:27:20 | FromDiscord | <fwsgonzo> Thanks, I will continue tomorrow but that sounds very promising!! |
21:27:49 | FromDiscord | <Elegantbeef> Really if you're making a procedure to operate on a collection of T openarray is the right type |
21:36:45 | FromDiscord | <byteface> sent a code paste, see https://play.nim-lang.org/#ix=41SY |
21:37:21 | FromDiscord | <Elegantbeef> You didnt provide an argument |
21:37:32 | FromDiscord | <Elegantbeef> also `div` is an operator not a procedure so it'd be `div myArg` |
21:38:12 | FromDiscord | <Zectbumo> maybe he wants his own thing named div, not really an "override" but a "replace" |
21:38:45 | FromDiscord | <byteface> i kinda wanted what that guy was suggesting |
21:39:09 | FromDiscord | <byteface> is there a way to replace it then? |
21:39:17 | FromDiscord | <Elegantbeef> Oh div might be a forced binary operator |
21:39:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41SZ |
21:39:58 | FromDiscord | <Elegantbeef> So yea `div` seems to be forced as a binary operator |
21:40:05 | FromDiscord | <enthus1ast> echo `div`("foo") |
21:40:15 | FromDiscord | <Elegantbeef> Yea you need to strop it for a call |
21:40:17 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/994719478954868946): `echo `div`("foo")` |
21:40:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41T0 |
21:40:35 | FromDiscord | <Elegantbeef> Byteface do you have a more elaborate case of what you want |
21:41:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41T1 |
21:41:29 | FromDiscord | <Elegantbeef> You just cannot use it as an unary operator |
21:42:12 | FromDiscord | <byteface> so i guess that post was misleading? |
21:42:18 | FromDiscord | <Elegantbeef> Not really |
21:42:26 | * | Kiori quit (Quit: Leaving) |
21:42:53 | FromDiscord | <Elegantbeef> You can override it but it seems mratsim didnt realize it was a forced unary operator |
21:42:58 | FromDiscord | <Elegantbeef> binary operator rather |
21:43:06 | FromDiscord | <byteface> sent a code paste, see https://play.nim-lang.org/#ix=41T2 |
21:43:12 | FromDiscord | <enthus1ast> you can call it like this \`\`\` `div`("foo") \`\`\`\` |
21:43:14 | FromDiscord | <Elegantbeef> well yea `'test'` isnt valid |
21:43:18 | FromDiscord | <enthus1ast> ahrgh |
21:43:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41T4 |
21:43:32 | FromDiscord | <Elegantbeef> There you go enthus |
21:43:44 | FromDiscord | <enthus1ast> yes |
21:44:10 | FromDiscord | <enthus1ast> karax for example avoids this and calls it kdiv (imho) |
21:44:33 | FromDiscord | <byteface> whats karax? |
21:44:57 | FromDiscord | <Elegantbeef> A library for making single page applications |
21:46:06 | FromDiscord | <byteface> right. ye i considered an underscore but that wasn't valid apparently |
21:46:25 | FromDiscord | <Elegantbeef> Nim doesnt allow underscore names to start and ignores them after |
21:46:41 | FromDiscord | <byteface> ignores them after? |
21:46:53 | FromDiscord | <Elegantbeef> yes `fooBar` == `foo_Bar` |
21:47:07 | FromDiscord | <byteface> so div == div_ ? |
21:47:17 | FromDiscord | <Elegantbeef> It's nim's style insensitivity |
21:47:20 | FromDiscord | <Elegantbeef> you cannot have a trailing underscore |
21:47:25 | FromDiscord | <enthus1ast> e\_C\_hO 1337 |
21:47:42 | FromDiscord | <Elegantbeef> Starting and trailing underscores are not allowed as identifiers |
21:47:57 | FromDiscord | <byteface> so can i wipeout the operator of 'div' and make it a proc instead |
21:48:14 | FromDiscord | <Elegantbeef> You cannot override Nim's syntax no |
21:48:18 | FromDiscord | <byteface> so that i don't have to `div` |
21:48:26 | FromDiscord | <byteface> with the quotes |
21:48:34 | FromDiscord | <Elegantbeef> you're better to just do what karax does and make a proc named `tdiv` |
21:48:40 | FromDiscord | <Elegantbeef> or whatever prefix you prefer |
21:49:00 | FromDiscord | <byteface> im quite happy to desotry div and replace it for a proc |
21:49:06 | FromDiscord | <byteface> if theres a way of nulling it |
21:49:17 | FromDiscord | <Elegantbeef> You cannot |
21:49:27 | FromDiscord | <Elegantbeef> Nim's syntax does not allow nullifying operators |
21:49:46 | FromDiscord | <Elegantbeef> It's already a proc it's just a proc that requires 2 operands |
21:49:55 | FromDiscord | <Elegantbeef> I dont know why it's forced as a binary operator but alas |
21:50:13 | FromDiscord | <byteface> is there a way to make it not a binary operator? |
21:50:35 | FromDiscord | <Elegantbeef> Aside from making a PR to the compiler no |
21:51:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41T6 |
21:51:30 | FromDiscord | <Zectbumo> In reply to @Elegantbeef "well yea `'test'` isnt": I was actually going to guess that he had a different problem from what he was asking for 🙂 I just got that feeling |
21:52:24 | FromDiscord | <Elegantbeef> I mean they want to use `div` as a unary operator or a procedure it's not valid |
21:52:26 | FromDiscord | <Elegantbeef> It's a reserved operator |
21:52:59 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=41T7 |
21:53:24 | FromDiscord | <Elegantbeef> What? |
21:53:25 | FromDiscord | <Elegantbeef> `/` is used for math aswell |
21:53:37 | FromDiscord | <Elegantbeef> The odd part is that it's capable of being used as a unary |
21:54:00 | FromDiscord | <Zectbumo> yeah, like `div` is too. but `div` is special, it seems from what you are saying |
21:54:13 | FromDiscord | <Zectbumo> (edit) "yeah, like `div` is ... too." added "used for math" |
21:54:32 | FromDiscord | <Zectbumo> In reply to @Elegantbeef "The odd part is": is this a special case you think? |
21:55:11 | FromDiscord | <Elegantbeef> Hopefully i left breadcrumbs cause i'm lost |
21:55:42 | FromDiscord | <Elegantbeef> Everything but the word operators and index operators can be used as binary or unary |
21:55:45 | FromDiscord | <byteface> sent a code paste, see https://play.nim-lang.org/#ix=41T8 |
21:55:51 | FromDiscord | <Elegantbeef> Jesus fucking christ |
21:56:01 | FromDiscord | <Elegantbeef> I said no you cannot change the Nim syntax how many times now |
21:56:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41Ta |
21:56:44 | FromDiscord | <byteface> sorry i didn't realise you were the authority on it. it could be your knowledge is limited. your answers were good. but they are not the solution im after. they are alternatives |
21:57:10 | FromDiscord | <enthus1ast> you could create a mini dsl, which is a macro that could filter out stuff like this |
21:57:19 | FromDiscord | <Elegantbeef> No you cannot |
21:57:39 | FromDiscord | <Elegantbeef> That doesnt compile |
21:57:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41Tb |
21:57:44 | FromDiscord | <Elegantbeef> Cause you cannot change the Nim syntax! |
21:58:21 | FromDiscord | <Elegantbeef> `Error: expression expected, but found 'keyword div'` is a parser error not a AST error |
21:58:34 | FromDiscord | <Elegantbeef> You cannot fix a parser error with a user defined AST pass |
21:58:39 | FromDiscord | <Zectbumo> yeah, macro won't help you here |
21:58:50 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=41Tc |
21:59:05 | FromDiscord | <Elegantbeef> Change your nim version down or up depending |
21:59:20 | FromDiscord | <enthus1ast> oh crazy did not know |
21:59:27 | FromDiscord | <ripluke> In reply to @Elegantbeef "Change your nim version": depending on what? |
21:59:39 | FromDiscord | <Elegantbeef> What version it is and what the library says you should have |
22:00:04 | FromDiscord | <Elegantbeef> You could possibly use a source code filter which replaces unary `div` with `tdiv` but i do not know if that's possible |
22:00:17 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/filters.html |
22:00:28 | FromDiscord | <ripluke> In reply to @Elegantbeef "What version it is": im on 1.66 how do i know what the library wants me to have |
22:01:22 | FromDiscord | <Elegantbeef> You're on 1.6.6 so move back to 1.4.8 and if that doesnt change anything keep regressing |
22:01:28 | FromDiscord | <ripluke> kk |
22:01:28 | FromDiscord | <Elegantbeef> https://github.com/StefanSalewski/gintro/blob/master/gintro.nimble#L11 is how you know what they want |
22:02:29 | FromDiscord | <ripluke> it needs 1.0 |
22:02:39 | FromDiscord | <Elegantbeef> \atleast |
22:02:41 | FromDiscord | <ripluke> is nim not reverse compatible? |
22:02:45 | FromDiscord | <ripluke> oh |
22:03:17 | FromDiscord | <Elegantbeef> I just installed it so it seems it's not related to nim |
22:03:33 | FromDiscord | <Elegantbeef> It might be an issue with your gtk version |
22:03:44 | FromDiscord | <Elegantbeef> I dont have gtk4 installed though |
22:03:57 | FromDiscord | <ripluke> i have both gtk-3 and layershell installed so idk |
22:04:03 | FromDiscord | <ripluke> In reply to @Elegantbeef "I dont have gtk4": neither do i |
22:04:12 | FromDiscord | <Elegantbeef> The issue is in the generated harfbuzz file |
22:04:31 | FromDiscord | <enthus1ast> @byteface\: when you want to generate html, maybe you like nimja (its like jinja2) https://github.com/enthus1ast/nimja |
22:04:38 | FromDiscord | <enthus1ast> (must whore my stuff) |
22:04:42 | FromDiscord | <ripluke> In reply to @Elegantbeef "The issue is in": ill see if i have some harfbuzz lib missing |
22:04:53 | FromDiscord | <Elegantbeef> No |
22:04:59 | FromDiscord | <Elegantbeef> the issue isnt with the library missing it's with the generated file |
22:05:00 | FromDiscord | <ripluke> oh? |
22:05:07 | FromDiscord | <ripluke> In reply to @Elegantbeef "the issue isnt with": oh |
22:05:09 | FromDiscord | <Elegantbeef> So your version might be incompatible with the version they used |
22:05:17 | FromDiscord | <Elegantbeef> What version is your gtk3? |
22:05:52 | FromDiscord | <ripluke> 1:3.24.34-1 |
22:06:01 | FromDiscord | <Elegantbeef> We have the same version |
22:06:04 | FromDiscord | <Elegantbeef> Mine had no issue |
22:06:13 | FromDiscord | <ripluke> In reply to @Elegantbeef "We have the same": hmm |
22:06:19 | FromDiscord | <ripluke> might try rebuilding |
22:06:46 | FromDiscord | <Elegantbeef> Could be having layershell installed |
22:06:55 | * | hc0re joined #nim |
22:07:53 | FromDiscord | <ripluke> i have that |
22:08:17 | FromDiscord | <Elegantbeef> Yes that's what i said |
22:08:23 | FromDiscord | <ripluke> oh |
22:08:24 | FromDiscord | <Elegantbeef> Am i not writing english today? |
22:08:31 | FromDiscord | <ripluke> i misread that |
22:08:41 | FromDiscord | <Zectbumo> I read it fine. but I can see how it can be misinterpreted |
22:08:43 | FromDiscord | <ripluke> what difference does it make having it installed |
22:09:02 | FromDiscord | <Elegantbeef> gintro might get more code to make a binding and fail |
22:09:13 | FromDiscord | <Elegantbeef> I just installed it so am testing it now |
22:09:45 | FromDiscord | <Elegantbeef> Atleast i think i installed it |
22:09:50 | FromDiscord | <ripluke> hmm i dont think i can get rid of layershell |
22:09:56 | FromDiscord | <Zectbumo> In reply to @Elegantbeef "Could be having layershell": this could mean, "I have layershell install, maybe that's why it works for me". If you included "I" or "you" then we would know better which way you meant. |
22:10:00 | FromDiscord | <Elegantbeef> Well worked fine here |
22:10:41 | FromDiscord | <Elegantbeef> Hey given that they said they had it installed it's pretty self evident to what that sentence meant |
22:10:51 | FromDiscord | <ripluke> yea at first i built the head branch |
22:10:51 | FromDiscord | <Zectbumo> 🙂 |
22:10:57 | FromDiscord | <ripluke> ill build main this time |
22:11:16 | FromDiscord | <Elegantbeef> the issue is in the generated harfbuzz file |
22:11:21 | FromDiscord | <Elegantbeef> So uhhh it's' probably unrelated |
22:13:07 | FromDiscord | <ripluke> it gets generated with no promblem |
22:13:19 | FromDiscord | <Elegantbeef> Well then make an issue |
22:13:33 | FromDiscord | <Elegantbeef> Though i just install gintro's #head |
22:14:57 | FromDiscord | <ripluke> sent a code paste, see https://play.nim-lang.org/#ix=41Th |
22:15:14 | FromDiscord | <huantian> nim! |
22:15:24 | FromDiscord | <ripluke> fixed it lol |
22:15:25 | FromDiscord | <ripluke> (edit) "https://play.nim-lang.org/#ix=41Th" => "https://play.nim-lang.org/#ix=41Ti" |
22:15:29 | FromDiscord | <Elegantbeef> "Undeclared identifier nim" |
22:15:44 | FromDiscord | <Elegantbeef> Runs fine |
22:15:47 | FromDiscord | <ripluke> In reply to @Elegantbeef ""Undeclared identifier nim"": nim doesnt know nim |
22:16:01 | FromDiscord | <ripluke> In reply to @Elegantbeef "Runs fine": hmm |
22:16:12 | FromDiscord | <ripluke> so i have something wrong with harfbuzz |
22:16:23 | FromDiscord | <Elegantbeef> Though i get `0` back |
22:17:07 | FromDiscord | <bariali07> How can I think like professional programmers |
22:17:23 | FromDiscord | <Elegantbeef> Spend the same amount of time as professional programmers writing code |
22:17:56 | FromDiscord | <ripluke> what version of harfbuzz do you have |
22:18:06 | FromDiscord | <ripluke> on arch pacman -Qi harfbuzz |
22:18:08 | FromDiscord | <Elegantbeef> 2.7.4 |
22:18:37 | FromDiscord | <Elegantbeef> Bold of you to assume i use arch |
22:18:44 | FromDiscord | <ripluke> im on 4.4.1-1 |
22:19:05 | FromDiscord | <ripluke> In reply to @Elegantbeef "Bold of you to": lol just saying that if u are on arch u can use it |
22:19:06 | FromDiscord | <!Patitotective> In reply to @bariali07 "How can I think": change your mind |
22:20:58 | FromDiscord | <ripluke> im going to install 2.7 |
22:21:10 | FromDiscord | <ripluke> hope i dont brick my system |
22:30:03 | * | hc0re quit (Ping timeout: 276 seconds) |
22:41:52 | FromDiscord | <mattrb> Any idea why I might be seeing a segfault when using sdl audio callbacks? Not sure if I'm using sdl incorrectly or if something else is going on... Here's a gist with the cut down code and the segfault backtrace https://gist.github.com/mattrberry/1d8bd1a9b148ddf3261f5e1fb2c63e7c |
22:43:06 | FromDiscord | <Elegantbeef> People make me chuckle 😄 |
22:43:23 | FromDiscord | <Elegantbeef> Unrelated to the problem just funny to see the `[]=` operator |
22:43:59 | FromDiscord | <Elegantbeef> should it not be `0..< min(obtainedSpec.samples.int, len)`? |
22:44:23 | FromDiscord | <Elegantbeef> also `var stream = cast[ptr UncheckedArray[float32]](stream)` |
22:44:32 | FromDiscord | <Elegantbeef> Removes the need for the `[]=` operator |
22:45:36 | FromDiscord | <Elegantbeef> Also should one check if `steam` is nil? |
22:48:22 | bigbyt | what is nim's most tempting footgun? |
22:48:42 | FromDiscord | <mattrb> Ah, forgot about UncheckedArray, thanks! It shouldn't be `min(obtainedSpec.samples.int, len)` since `len` is the length of the buffer in bytes and I'm writing in float32s. I guess I can add an assertion that `len == obtainedSpec.samples.int div 4` though |
22:49:37 | FromDiscord | <mattrb> (edit) "Ah, forgot about UncheckedArray, thanks! It shouldn't be `min(obtainedSpec.samples.int, len)` since `len` is the length of the buffer in bytes and I'm writing in float32s. I guess I can add an assertion that `len ... ==obtainedSpec.samples.int`" added "div 4" | "obtainedSpec.samples.int div 4`" => "obtainedSpec.samples.int`" |
22:55:00 | FromDiscord | <mattrb> Hmm so sometimes `len` is double what is should be (e.g. 8192 when `obtainedSpec.samples` is only 1024). I still segfault even when iterating over `len div 4` rather than `obtainedSpec.samples.int`, though.. |
22:55:45 | FromDiscord | <Elegantbeef> Does it segfault when you dont iterate? |
22:56:14 | FromDiscord | <mattrb> Yup |
22:56:16 | FromDiscord | <mattrb> Just tested again |
22:56:50 | FromDiscord | <Elegantbeef> So an empty audio callback errors, sounds odd |
23:01:04 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=41Tw |
23:01:20 | FromDiscord | <Elegantbeef> And it still segfaults? |
23:01:26 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=41Tx |
23:01:30 | FromDiscord | <mattrb> I'll move these into a gist again.. |
23:01:50 | FromDiscord | <Elegantbeef> I mean it's not like i can run the code 😄 |
23:02:16 | FromDiscord | <mattrb> https://gist.github.com/mattrberry/47fa782df4bbc175521523c4130502bf |
23:02:43 | FromDiscord | <mattrb> (edit) "https://play.nim-lang.org/#ix=41Tx" => "https://play.nim-lang.org/#ix=41Ty" |
23:03:20 | FromDiscord | <mattrb> I'm happy to throw this on a public branch if you're interested in running it! I'd appreciate a second set of eyes, even if I'm just doing something totally stupid |
23:03:33 | FromDiscord | <QuikSilver> how long will it take to learn nim |
23:04:42 | bigbyt | are there any security researchers doing virus research (development, inspection, etc.) with nim? |
23:04:51 | FromDiscord | <huantian> uh 2 fortnights and a day |
23:05:15 | bigbyt | @QuikSilver what's your current programming baseline? |
23:05:44 | FromDiscord | <Elegantbeef> There is a bunch of people makiing malware with Nim sadly |
23:05:51 | bigbyt | I'm like intermediate(?) in Python, nim's been a breeze to dip my toes into so far |
23:06:04 | FromDiscord | <QuikSilver> tf |
23:06:05 | bigbyt | @Elegantbeef is it black hat or white hat? |
23:06:07 | FromDiscord | <QuikSilver> is this actually a bot? |
23:06:16 | bigbyt | no |
23:06:23 | FromDiscord | <Elegantbeef> I say a bunch but it's enough that it causes AV to trip |
23:06:27 | bigbyt | it's just conveyed to you from IRC via a bot |
23:06:32 | FromDiscord | <QuikSilver> In reply to @bigbyt "<@721394893188104262> what's your current": C++ |
23:06:46 | FromDiscord | <Elegantbeef> Psh matrix \> IRC 😛 |
23:07:03 | FromDiscord | <QuikSilver> In reply to @bigbyt "it's just conveyed to": ah ok I see, was confused asf |
23:07:20 | FromDiscord | <QuikSilver> In reply to @bigbyt "<@721394893188104262> what's your current": to seriously answer this question then, I'm decent at C++ |
23:07:25 | bigbyt | yeah but I logged into a libertarian matrix that had a bunch of *cough* uncomfortable content *cough* so I avoid it now, out of fear |
23:07:38 | FromDiscord | <Elegantbeef> Well it's a libertarian matrix room |
23:07:47 | FromDiscord | <Elegantbeef> That's like actively walking into a cesspool |
23:07:58 | bigbyt | https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers |
23:08:09 | bigbyt | @QuikSilver have you seen this document yet? |
23:08:33 | FromDiscord | <Elegantbeef> That's not a comment on the political view and more just what they stand for and given it's encrypted channel of communication it doesnt bode well 😄 |
23:08:36 | bigbyt | the "Nim for Pythoners" is a high-quality resource IMO, not enough experience in C/C++ to speak on how good this one is |
23:08:55 | FromDiscord | <Elegantbeef> If you're a proficient C/C++ programmer Nim should be a breeze |
23:09:01 | bigbyt | Elegantbeef that's fair, but after that I've just wondered like... why not just stick to text-only media? |
23:09:29 | FromDiscord | <Elegantbeef> Cause images and videos exist and i like sharing them! |
23:09:43 | FromDiscord | <aru-hackZ> I'm new to nim (like a week ago more or less) and started by reading "nim in action" tho it's a but outdated |
23:09:46 | FromDiscord | <Elegantbeef> "Look at my game" isnt as cool when it's a fucking ascii video for a 3D rendered game! |
23:10:21 | FromDiscord | <mattrb> In reply to @mattrb "I'm happy to throw": Beef, lmk if you're open to this :) No worries if not, I'll keep poking at it |
23:10:43 | FromDiscord | <QuikSilver> In reply to @bigbyt "<@721394893188104262> have you seen": probably but it's been awhile since I toyed with the idea of Nim so I forgot which one of these esoteric programming languages were basically as simple as C and wasn't sure if Nim was one of them |
23:11:09 | bigbyt | "as simple as" is hard to judge imo |
23:11:15 | FromDiscord | <Elegantbeef> What do you mean, i cannot run the code you provided so it's down to you, does the seg fault exist for your program without the audio init'd↵(@mattrb) |
23:11:27 | FromDiscord | <Elegantbeef> You probably are thinking of Zig/Odin↵(@QuikSilver) |
23:11:29 | FromDiscord | <mattrb> You can't run it if I push it to a branch? |
23:11:33 | FromDiscord | <Elegantbeef> Zig/Odin are very akin to C |
23:11:50 | FromDiscord | <Elegantbeef> I mean i can if you push it to a branch you never said you were going as far as matrix says |
23:11:52 | FromDiscord | <QuikSilver> In reply to @Elegantbeef "You probably are thinking": ah yes it must of been this one. thanks |
23:11:56 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=41TB |
23:12:15 | FromDiscord | <Elegantbeef> you need `Happy[int]` |
23:12:25 | FromDiscord | <Elegantbeef> Nim's constructor does not to generic inference |
23:12:30 | bigbyt | Nim's syntactic sugar is very nice for me, and makes it very simple to not have to drop down into low-level details like malloc or free. I've never had to deal with stuff like that, so not having the *option* might make some things more difficult. It's all about trade-offs imo |
23:12:42 | FromDiscord | <mattrb> In reply to @Elegantbeef "I mean i can": Thanks, appreciate the help! The previous message says "I'm happy to throw this on a public branch if you're interested in running it! I'd appreciate a second set of eyes, even if I'm just doing something totally stupid" |
23:12:45 | FromDiscord | <dain> In reply to @Elegantbeef "you need `Happy[int]`": ooo okay thanksyou |
23:12:45 | FromDiscord | <Elegantbeef> Nim still gives you low level control |
23:12:47 | FromDiscord | <mattrb> I'll push it and send a link in a sec |
23:13:02 | FromDiscord | <Elegantbeef> You can leak memory if you want to while using `ref` |
23:13:10 | bigbyt | I come from LISP, OCaml, and Python; I like Nim's trade-offs, syntax, standard library, and semantic features. |
23:13:31 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=41TC |
23:13:36 | FromDiscord | <Elegantbeef> Without malloc we have a memory leak |
23:13:47 | bigbyt | oh real shit Elegantbeef? Didn't realize! I'll have to read more, my apologies! |
23:14:06 | FromDiscord | <QuikSilver> what space is nim competing in then. Is it with Python? and @bigbyt , so are you trying to "switch over" to Nim from Python |
23:14:12 | FromDiscord | <Elegantbeef> I have a bit of writeup for pointers in Nim and more idiomatic solutions not amazing https://www.jasonbeetham.com/pointerexplanation.html#References%20-%20the%20well%20dressed%20pointers |
23:14:17 | FromDiscord | <Elegantbeef> Nim is a system language |
23:14:23 | FromDiscord | <QuikSilver> oh |
23:14:31 | FromDiscord | <Elegantbeef> So it competes with C++/Rust/C/Zig/Odin/Crystal/Ada/Swift/.... |
23:14:47 | FromDiscord | <QuikSilver> hmmm i see |
23:14:51 | FromDiscord | <Elegantbeef> It just has modern features and automatic memory management |
23:15:10 | FromDiscord | <QuikSilver> even in comparison to Rust though? I'm also a fan of Rust |
23:15:27 | FromDiscord | <mattrb> Beef, here's a branch: https://github.com/mattrberry/gba/tree/beef |
23:16:01 | FromDiscord | <Elegantbeef> Nim and Rust do have similar goals of safe fast code that's more enjoyable to write |
23:16:03 | FromDiscord | <mattrb> I've been building with `nimble build --debugger:native` for use with nim-gdb. Requires you have sdl2 installed |
23:17:43 | FromDiscord | <QuikSilver> In reply to @Elegantbeef "Nim and Rust do": why do you like Nim instead of just abandoning it for Rust |
23:18:08 | FromDiscord | <Elegantbeef> Cause Rust is overly verbose, and does not appreciate macros |
23:18:29 | FromDiscord | <Elegantbeef> How do i run it mattrb? |
23:18:49 | FromDiscord | <Elegantbeef> Idiomatic Rust is very very annoying to me |
23:19:01 | FromDiscord | <Elegantbeef> Rust does have nice features but the language is very much not for me |
23:19:23 | bigbyt | I do really like the procedural programming paradigm too |
23:19:39 | FromDiscord | <QuikSilver> I see thanks |
23:21:40 | FromDiscord | <mattrb> Oh sorry, you need a gba bios and rom. There's a bios in the root of the project and you can use this rom since it won't crash the emulator :p https://github.com/destoer/armwrestler-gba-fixed/blob/master/armwrestler-gba-fixed.gba Just pass the bios and rom paths as command-line args |
23:28:15 | FromDiscord | <ElegantBeef> It seems to freeze at similar intervals to when it crashes without audio |
23:28:31 | bigbyt | will learning nim make me a 10x dev? |
23:29:24 | FromDiscord | <ElegantBeef> Atleast |
23:32:09 | bigbyt | damn @ElegantBeef, you seem like a cool entity. Will you sign my GPG key? |
23:33:35 | FromDiscord | <exelotl> I learned nim and now I'm a 590341x dev |
23:33:38 | xigoi | I don't know about 10x, but learning Nim definitely does make you a king/queen 👑 |
23:33:42 | FromDiscord | <mattrb> You mean when you fill the buffer compared to when you don't? |
23:34:01 | FromDiscord | <ElegantBeef> I mean even without the `pauseAudio` and `openAudio` it freezes consistently |
23:34:06 | FromDiscord | <mattrb> If the audio doesn't play (e.g. commenting out `pauseAudio(0)`) then it doesn't crash |
23:34:16 | FromDiscord | <mattrb> 🤔 |
23:34:25 | FromDiscord | <mattrb> Where do you see it freeze? |
23:34:48 | bigbyt | @xigoi damn friend say that shit more, we all royalty here :fingernail_polish: |
23:34:48 | FromDiscord | <mattrb> It it's running under 60fps then it doesn't register key presses properly. Maybe that's what you're seeing |
23:35:03 | FromDiscord | <mattrb> I still need to fix that :p |
23:36:21 | FromDiscord | <ElegantBeef> Well using the modern `openAudioDevice` doesnt segfault |
23:36:25 | FromDiscord | <ElegantBeef> But it also doesnt play audio |
23:37:58 | FromDiscord | <ElegantBeef> Ah nvm with the proper pauseaudio it still segfaults |
23:40:39 | FromDiscord | <ElegantBeef> Putting a sleep after the `pauseAudio` allows it to play audio fine |
23:41:15 | FromDiscord | <mattrb> It looks like it's working for me with `openAudioDevice` and `pauseAudioDevice`, but only in release mode.. |
23:42:15 | FromDiscord | <voidwalker> https://play.nim-lang.org/#ix=41TL - got a question about db_sqlite. What exactly happens on dbsql.exec(sql"COMMIT") ? |
23:42:53 | FromDiscord | <voidwalker> and why does it take 276ms, vs 8 second the actual loop where I do sql update |
23:43:39 | FromDiscord | <mattrb> And putting a sleep after `pauseAudioDevice` doesn't seem to work for me when not in release mode |
23:45:43 | FromDiscord | <ElegantBeef> Very much seems like you have a segfault issue somewhere, where do you touch pointers the most? |
23:45:55 | FromDiscord | <enthus1ast> https://www.sqlite.org/lang_transaction.html |
23:46:14 | FromDiscord | <mattrb> I'm also still seeing it segfault with a sleep after `pauseAudio` with it as it is on the branch |
23:46:24 | FromDiscord | <aru-hackZ> In reply to @voidwalker "https://play.nim-lang.org/#ix=41TL - got a": Correct me if I'm wrong, iirc in sql a commit is like a save button, and there is the rollback which is restoring the DB to the last time you used the save button (commit) |
23:46:47 | FromDiscord | <mattrb> I touch pointers all over the place.. Mostly they're calls through the `util.nim` file though |
23:47:25 | FromDiscord | <mattrb> So I'd say there and in `bus.nim` |
23:47:35 | FromDiscord | <mattrb> Neither of those ever showed up in a backtrace, though |
23:48:27 | FromDiscord | <b1rdf00d> sent a long message, see http://ix.io/41TO |
23:48:32 | FromDiscord | <enthus1ast> and i think it also generates the indexes etc, but this i think depends on the database↵(@aru-hackZ) |
23:48:38 | FromDiscord | <voidwalker> @enthus1ast ` Transactions can be started manually using the BEGIN command. Such transactions usually persist until the next COMMIT or ROLLBACK command. ` |
23:48:41 | FromDiscord | <mattrb> The backtraces almost always seemed to point to nim-1.6.6/lib/system/excpt.nim, although I have no idea whether that's just a red herring and I'm screwing something else up somewhere |
23:49:01 | FromDiscord | <voidwalker> so if I did that, does that mean, my code builds a giant transaction (10 million rows big), and then commits it all at once? |
23:49:24 | FromDiscord | <voidwalker> then 276 ms seems very fast to do that.. |
23:49:53 | FromDiscord | <enthus1ast> yeah looks quite good↵(@voidwalker) |
23:50:23 | FromDiscord | <voidwalker> huh, then i should optimize the code to build the transaction, if possible, that one takes 8 seconds |
23:51:10 | FromDiscord | <aru-hackZ> In reply to @enthus1ast "and i think it": Yh smth like that |
23:51:51 | FromDiscord | <voidwalker> I just modified the code to not have "BEGIN" / "COMMIT", so that each transaction gets commited after being entered.... sure takes a while 🙂 |
23:52:21 | FromDiscord | <enthus1ast> you could start by useing prepared statements https://nim-lang.org/docs/db_sqlite.html#prepare%2CDbConn%2Cstring↵(@voidwalker) |
23:52:29 | FromDiscord | <aru-hackZ> But why do you need to commit anyway |
23:53:05 | FromDiscord | <voidwalker> why do I need to commit ? |
23:53:25 | FromDiscord | <enthus1ast> i guess this would be much slower overall↵(@voidwalker) |
23:53:44 | FromDiscord | <voidwalker> yes.. almost 2 minutes now and still not finished, vs 8-9 seconds before |
23:55:06 | FromDiscord | <ElegantBeef> Well @mattrb I can only think the issue is not related to the audio, the audio just makes it happen consistently, i could be very much wrong though |
23:55:21 | FromDiscord | <voidwalker> so what would be the practical difference between doing "begin/ dbexec(update..) / commit", vs building that sql prepared statement ? |
23:56:11 | FromDiscord | <mattrb> In reply to @ElegantBeef "Well <@221832495367323648> I can": I remember about a year ago you helped me diagnose a similar issue, where adding a single field to an object caused a consistent segfault somewhere else entirely.. |
23:56:15 | FromDiscord | <enthus1ast> you still do begin and commit, but instead of parsing the sql every time, you prepare it in the database for faster access↵(@voidwalker) |
23:56:39 | FromDiscord | <mattrb> Any clue how you'd go about diagnosing short of double-checking ever single place that touches a pointer? |
23:57:00 | FromDiscord | <mattrb> I was hoping the gdb backtrace would be helpful, but it seems to not be.. |
23:58:08 | FromDiscord | <enthus1ast> @mattrb\: start commenting out features and code until it stops crashing \:/ |
23:58:48 | FromDiscord | <mattrb> That won't necessarily help me find the thing that's making it segfault, though, since the thing that's making it segfault is unrelated :/ |
23:59:02 | FromDiscord | <mattrb> Chances are I'll comment out something and it'll start working again by chance |
23:59:56 | FromDiscord | <enthus1ast> have you tried a different gc? Maybe with arc/orc it crashes more in time |