<< 07-07-2022 >>

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