<< 06-06-2023 >>

00:00:05FromDiscord<Elegantbeef> First usage is stretch, but you get the point
00:01:45FromDiscord<inv> I would like special edition of the book from @ElegantBeef ๐Ÿ™‚
00:04:52*nyeaa492842301 quit (Quit: Ping timeout (120 seconds))
00:05:10*nyeaa492842301 joined #nim
00:05:57FromDiscord<Elegantbeef> Too much work to write a book, I do not have enough shitty jokes
00:10:14FromDiscord<Elegantbeef> This reminds me that I should work on my website a bit to make my writeups accessible
00:46:08*derpydoo joined #nim
01:03:21*oldpcuser_ joined #nim
01:04:06*xet7 joined #nim
01:05:52*oldpcuser quit (Ping timeout: 265 seconds)
01:16:11FromDiscord<SkynWalker> Hey guys kinda programming related question here. How do I go about storing huge numbers. Iโ€™m trying to factor two 4 digit ints and itโ€™s obviously not working.
01:18:37*oldpcuser_ is now known as oldpcuser
01:19:46FromDiscord<Arathanis> can't store a 4 digit int??? only have 14 bit integers? ๐Ÿ˜‚
01:20:00FromDiscord<Arathanis> (edit) "14" => "13"
01:21:41FromDiscord<Prestige> I think he means factorial of a 4 digit int
01:22:42*via_ is now known as via
01:22:45FromDiscord<Prestige> maybe
01:26:42FromDiscord<Arathanis> that woudl do it!
01:26:52FromDiscord<Arathanis> factorial of a 4 digit int makes a lot more sense
01:27:08FromDiscord<SkynWalker> Yes
01:27:16FromDiscord<SkynWalker> Like 9999 ^ 9999
01:27:17FromDiscord<Prestige> that's going to be a veeerrrrry large number lol
01:27:25FromDiscord<SkynWalker> I am aware lol
01:27:28FromDiscord<Arathanis> well that is just extremely high powers
01:27:34FromDiscord<SkynWalker> Yes
01:27:37FromDiscord<Prestige> I thought he meant !9999
01:27:39FromDiscord<Arathanis> yummy tasty RAM
01:27:51FromDiscord<SkynWalker> Ikr
01:28:30FromDiscord<Arathanis> ... https://media.discordapp.net/attachments/371759389889003532/1115452120250994688/image.png
01:28:37FromDiscord<SkynWalker> Is there any way to do it. Iโ€™m fine with not storing it as is. I thought about dividing several times and having that division be a key to get back to the number
01:28:44FromDiscord<Arathanis> thats about 1/3 of the digits
01:28:49FromDiscord<SkynWalker> XD
01:29:01FromDiscord<Arathanis> not gonna take 3 more screen shots lol
01:29:06FromDiscord<SkynWalker> Lmaoo
01:29:19FromDiscord<SkynWalker> But any suggestions like I said Iโ€™m open to doing things a different way
01:29:33FromDiscord<Arathanis> do it in a language that supports it out of the box?
01:29:46FromDiscord<Arathanis> or find some kind of BigInt lib
01:29:51FromDiscord<Arathanis> or roll your own
01:30:01FromDiscord<SkynWalker> I only know nim lol
01:30:15FromDiscord<SkynWalker> Iโ€™m find rolling my own lib I just need a start on where to look
01:30:24FromDiscord<Arathanis> if you can do Nim syntax, you can do Python syntax and Python supports infinite precision ints out of the box
01:30:50FromDiscord<SkynWalker> I like compiled
01:30:59FromDiscord<SkynWalker> And sunk cost
01:31:02FromDiscord<SkynWalker> Iโ€™ve come this far
01:31:04FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/1115452766203170896/image.png
01:31:13FromDiscord<Prestige> yeah write your own library for it
01:31:22FromDiscord<SkynWalker> How would one go about that
01:31:33FromDiscord<SkynWalker> Not asking for a tutorial just a start on where to look
01:31:38FromDiscord<Arathanis> In reply to @SkynWalker "How would one go": basically you store your big ints as a sequence of ints
01:31:54FromDiscord<Arathanis> and each in in the sequence represents a different set of the digits
01:32:02*via is now known as via_
01:32:10FromDiscord<Arathanis> since digits in binary are bits
01:32:38FromDiscord<SkynWalker> Yes?
01:32:43FromDiscord<Arathanis> a len 4 seq is enough to store 256 binary digits
01:33:00FromDiscord<Arathanis> and so on and so forth
01:33:11FromDiscord<SkynWalker> How would I perform math on that such that it still acts as a full number
01:33:24FromDiscord<Arathanis> 1 int at a time, adjusting for potential carry
01:33:41FromDiscord<Arathanis> you my friend are one of today's luck 10,000 that get to look up how the adder in a CPU works
01:33:51FromDiscord<Arathanis> and then make one in software to support infinite precision integers
01:34:02FromDiscord<SkynWalker> That seems really fucking hard
01:34:07FromDiscord<Arathanis> not as hard as you think
01:34:17FromDiscord<SkynWalker> Aight
01:34:18FromDiscord<Arathanis> its all boolean logic under the hood
01:34:28FromDiscord<SkynWalker> This is becoming harder and harder by the day
01:34:37FromDiscord<SkynWalker> โ€œItโ€™ll be done by lunchโ€ four days later
01:34:51FromDiscord<Arathanis> at the core of it, CPU adders are just a chain of 1 bit adders
01:35:01FromDiscord<Arathanis> 1 bit adders have 2 inputs and 2 outputs
01:35:09FromDiscord<Arathanis> the 2 inputs are the bits to add
01:35:13*via_ is now known as via
01:35:18FromDiscord<Arathanis> and the outputs are a result digit and a carry
01:35:19FromDiscord<SkynWalker> Wait could I wrap Python code in nim
01:35:36FromDiscord<Arathanis> 0 + 0 = 0,0โ†ต0 + 1 = 1,0โ†ต1 + 0 = 1,0โ†ต1 + 1 = 0,1
01:35:50FromDiscord<Arathanis> the combine them, you include a 3rd input that is the previous carry bit
01:35:52FromDiscord<Arathanis> and chain them together
01:35:57FromDiscord<Arathanis> and that is how computers add
01:36:01FromDiscord<SkynWalker> Gotcha
01:36:14FromDiscord<Arathanis> In reply to @SkynWalker "Wait could I wrap": if you are going to wrap Python in Nim, just use Python
01:36:31FromDiscord<SkynWalker> But I wanna compile and not have to rewrite all my code
01:36:33FromDiscord<Arathanis> because you won't be able to bring your huge ints outside of Python without a big int library
01:36:44FromDiscord<Arathanis> so you are just going to be writing a bunch of nim code that statically compiles
01:36:49FromDiscord<Arathanis> and then just runs in the python interpreter
01:36:55FromDiscord<Arathanis> so you are basically going to do it all in python anyway
01:36:59FromDiscord<SkynWalker> Well shit
01:37:13FromDiscord<Arathanis> with the additional complexity of actually running it through Nim
01:37:26FromDiscord<SkynWalker> Damn
01:37:44FromDiscord<Arathanis> Python syntax and expressiveness is extremely similar to Nim
01:37:52FromDiscord<Arathanis> or more accuratly, Nim syntax is extremely similar to Python
01:37:55FromDiscord<Arathanis> you will gt it super fast
01:38:19FromDiscord<Arathanis> and im totally willing to help, I am a professional Python dev so I've got you, if you want it
01:38:31FromDiscord<Arathanis> (edit) "accuratly," => "accurately,"
01:38:34FromDiscord<Prestige> write your own library so we could all use it and avoid python
01:38:46FromDiscord<Arathanis> nothing is wrong with either language ๐Ÿ˜‚
01:38:55FromDiscord<SkynWalker> How bout someone else write cause Iโ€™m an idiot
01:39:48FromDiscord<SkynWalker> Alright boys
01:39:55FromDiscord<SkynWalker> Thanks for the lead imma see what I can do
01:40:02FromDiscord<Arathanis> GL
01:40:08FromDiscord<SkynWalker> Thank you
01:40:18FromDiscord<SkynWalker> See you in a couple hours when I get stuck again lol
01:46:33FromDiscord<Elegantbeef> Oh that explains it! ๐Ÿ˜›โ†ต(@Arathanis)
01:47:31FromDiscord<Arathanis> In reply to @Elegantbeef "Oh that explains it!": you can't hurt me when I was expecting your condescension ๐Ÿ˜Ž
01:48:09FromDiscord<Arathanis> some of my coworkers clown on me about Nim lol
01:49:25FromDiscord<Elegantbeef> Sure but if they could code they'd maybe understand what they were insulting
01:49:58FromDiscord<Arathanis> oh its not just Python devs.
01:50:14FromDiscord<Arathanis> they clown on me about it because I always bring it.
01:50:14FromDiscord<Elegantbeef> "Also JS devs"
01:50:23FromDiscord<Arathanis> C/C++/C# mostly
01:50:28FromDiscord<etra> In reply to @SkynWalker "Not asking for a": Crystal binds to GMP which seems to handle arbitrarily large numbers
01:50:39FromDiscord<Arathanis> no JS devs we all hate JS
01:50:52FromDiscord<Arathanis> is anyone a JS dev by choice?
01:51:08FromDiscord<Arathanis> (edit) "it." => "it up."
01:54:14FromDiscord<Arathanis> so to be clear everyone ive shown Nim to is interested and asks me for some links and direction which i do as best I can. The clowning comes cause I won't stop bringing it up ๐Ÿ˜‚
01:54:45FromDiscord<Arathanis> > Hmm, looks like we need something to do X, might be a significant lift...โ†ตโ†ตme:โ†ต> well if we just did it in Nim...
01:59:08*xet7 quit (Ping timeout: 246 seconds)
02:07:45*def- quit (Quit: -)
02:08:31*def- joined #nim
02:12:26*xet7 joined #nim
02:14:05FromDiscord<Graveflo> In reply to @Arathanis "C/C++/C# mostly": A python dev that shits on C is not a python dev they are a python apprentice
02:16:09FromDiscord<Arathanis> Where did I shit on C?
02:16:13FromDiscord<Graveflo> that being said I hate writing C especially for the build systems
02:16:21FromDiscord<Elegantbeef> How about a Nim dev that shits on C?
02:16:32FromDiscord<Graveflo> I didn't say you did. Didn't you say that your co-workers do?
02:16:42FromDiscord<Arathanis> no they arent shitting on anything
02:16:48FromDiscord<Arathanis> they are clowning on me for always bringing Nim up
02:16:54FromDiscord<Arathanis> except for maybe JS
02:17:01FromDiscord<Arathanis> but shitting on JS is part of being a SWE
02:17:04FromDiscord<Graveflo> well thats ok. I think Nim's posture is more overbearing on Cs existence then python is
02:17:37*rockcavera quit (Remote host closed the connection)
02:18:22FromDiscord<Graveflo> its not like python where eventually you will come crawling back to C when you need to. Nim is more like an attempt to bury C under itself instead of outgrow it
02:18:45FromDiscord<Arathanis> I replaced going to C when I need to with going to Nim when I need to ๐Ÿ˜‚
02:19:24FromDiscord<Graveflo> Yea that and embedded is why I am here. I think I might be in for more then I bargained for though
02:20:08FromDiscord<Arathanis> In reply to @Elegantbeef "How about a Nim": Wouldn't that be like praising the virtues of your brick and hard wood house and shitting on the inelgance of concrete while your house's foundation is indeed built upon concrete?
02:20:12FromDiscord<Graveflo> I hated python for a very long time when I first started using it. I don't think I would ever let it go now that I actually understand how to use it, but muh
02:20:44FromDiscord<Arathanis> I was part of the Python hate train until I actually gave it a chance, then it rapidly became my favorite language and I've made a career out of it.
02:20:59FromDiscord<Arathanis> turns out I was listening to idiots and taking their word for it when I should have formed my own opinions
02:21:01FromDiscord<Arathanis> who knew?
02:27:29FromDiscord<Elegantbeef> Nah @Arathanis you can rely on something but still say it's shit
02:28:12FromDiscord<Graveflo> words to live by the beef way
02:28:18*deadmarshal_ quit (Ping timeout: 250 seconds)
02:29:37FromDiscord<Arathanis> In reply to @Elegantbeef "Nah <@136570191038513152> you can": i dont disagree
02:29:55FromDiscord<Arathanis> like healthcare in the usa
02:44:13FromDiscord<Prestige> usa has great health care but you have to spend one leg to save the other
02:44:31FromDiscord<Prestige> Just like python
02:50:58*krux02 quit (Remote host closed the connection)
03:19:40*boxuser joined #nim
03:28:18FromDiscord<SkynWalker> Gentlemen
03:29:14FromDiscord<Graveflo> ๐Ÿ˜ถ
03:29:41FromDiscord<!&luke> I'm using owlkettle to create some apps, I came back to it after a couple weeks, but now it is taking much longer than usual to launch the app, is there any fix. I am on the head version
03:38:06FromDiscord<Elegantbeef> The program is slower or compilation is slower?
03:40:29*deadmarshal_ joined #nim
03:45:34FromDiscord<!&luke> Both actually although the compile time isn't that big of a problem for my usecase
03:46:32FromDiscord<Elegantbeef> Is your program doing anything that would slow the time between program start and the window being created?
03:50:04FromDiscord<!&luke> No I can send you my code if that would help
03:50:19FromDiscord<Elegantbeef> Sure
03:52:18FromDiscord<!&luke> https://media.discordapp.net/attachments/371759389889003532/1115488308479397888/message.txt
03:54:57FromDiscord<Elegantbeef> It's instant
03:55:40FromDiscord<Elegantbeef> Have you updated your packages, could it perhaps be an issue with some upstream gtk/adwaita?
03:55:58FromDiscord<Graveflo> In reply to @ripluke "": are you using XFCE4 on arch?
03:57:00FromDiscord<Graveflo> bc I've had gtk windows lag for a long ass time before opening in that environment. In kde and gnome they work fine
03:57:21FromDiscord<Arathanis> In reply to @ripluke "": you are making sure to compile with `-d:release` right?
04:05:48*deadmarshal_ quit (Ping timeout: 250 seconds)
04:10:54FromDiscord<!&luke> In reply to @Arathanis "you are making sure": yup
04:11:09FromDiscord<!&luke> In reply to @Elegantbeef "Have you updated your": ill try that
04:11:38FromDiscord<!&luke> In reply to @Graveflo "are you using XFCE4": i am on arch but dont even have xfce installed, im using a tiling wm
04:12:22FromDiscord<Graveflo> ok well xfce is the only wm I use with x11 and recently I've had some startup lag on certain gtk apps there. Prob not related but js
04:14:00FromDiscord<demotomohiro> In reply to @SkynWalker "Like 9999 ^ 9999": Doesn't this work for it? https://nimdocs.com/nim-lang/bigints/bigints.html#pow%2CBigInt%2CNatural
04:26:35*m5zs7k quit (Ping timeout: 250 seconds)
04:27:04*m5zs7k joined #nim
04:32:09FromDiscord<Stuffe> Does anyone have an idea why nim wont compile my project with the error `error: call to undeclared function 'NimMain';`
04:32:20FromDiscord<Stuffe> only when I compile with -d:release
04:32:28FromDiscord<Arathanis> compiling to c++?
04:32:39FromDiscord<Arathanis> is it a dll?
04:32:46FromDiscord<Stuffe> yes it is a dll
04:33:02FromDiscord<Arathanis> and cpp?
04:33:13FromDiscord<Stuffe> sent a code paste, see https://play.nim-lang.org/#ix=4xzj
04:33:19FromDiscord<Stuffe> (tried without the noMain thing)
04:33:29FromDiscord<Stuffe> In reply to @Arathanis "and cpp?": I thought nim used C?
04:33:36FromDiscord<Arathanis> it defaults to C
04:33:44FromDiscord<Arathanis> but it can do obj-c, cpp, and js
04:33:56FromDiscord<Arathanis> your best bet is to have a proc called "initialize" or "init"
04:34:00FromDiscord<Arathanis> for your lib
04:34:01FromDiscord<Arathanis> your choice
04:34:01FromDiscord<Arathanis> that you export
04:34:05FromDiscord<Arathanis> and inside it do
04:34:14FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xzk
04:34:25FromDiscord<Arathanis> this is how ive always done it
04:34:48FromDiscord<Stuffe> i am confused why it didn't happen before
04:34:53FromDiscord<Stuffe> but anyway let me try that
04:35:40FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xzl
04:35:48FromDiscord<Stuffe> ok thanks
04:35:51FromDiscord<Arathanis> yup
04:36:03FromDiscord<Arathanis> and if it still complains wait for beef to get back ๐Ÿ˜Ž
04:36:13FromDiscord<Elegantbeef> Back
04:36:16FromDiscord<Elegantbeef> I never leave!
04:36:42FromDiscord<Arathanis> In reply to @Stuffe "i am confused why": might be choice of GC?
04:36:57FromDiscord<Arathanis> NimMain is still a bit of a mystery to me, my understanding is it inits all the nim runtime stuff like the GC
04:37:10FromDiscord<Stuffe> I have no choice because I am using godot-nim
04:37:19FromDiscord<Stuffe> but it was working for like a year
04:37:22FromDiscord<Stuffe> until an hour ago
04:37:56FromDiscord<Stuffe> In reply to @Arathanis "your best bet is": sorry I didn't get it to work, could you show exactly what you mean so I can try and copy paste just in case
04:38:48FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4xzn
04:38:55FromDiscord<Arathanis> and before you do anything else with the lib you need to call that function
04:39:26FromDiscord<Arathanis> oh sorry, needs `exportc` pragma too
04:39:28FromDiscord<Stuffe> https://media.discordapp.net/attachments/371759389889003532/1115500176111587358/Screenshot_2023-06-06_at_11.39.07_AM.png
04:39:40FromDiscord<Stuffe> In reply to @Arathanis "and before you do": but it doesn't even compile
04:39:49FromDiscord<Arathanis> what is it complaining about?
04:39:53FromDiscord<Arathanis> still nim main?
04:40:04FromDiscord<Graveflo> i see an importc on nimmain
04:40:10FromDiscord<Stuffe> sent a code paste, see https://play.nim-lang.org/#ix=4xzo
04:40:15FromDiscord<Stuffe> sent a code paste, see https://play.nim-lang.org/#ix=
04:40:40FromDiscord<Arathanis> ive had to exportc on NimMain as well for mysterious reasons... could also try that
04:40:51*boxuser quit (Read error: Connection reset by peer)
04:41:09FromDiscord<Arathanis> but ive only had to do that with cpp
04:41:11FromDiscord<Arathanis> (edit) "but ive only had to do that with cpp ... " added "backend"
04:41:17FromDiscord<Arathanis> so i imagine that is not the issue here
04:42:07FromDiscord<Stuffe> sent a code paste, see https://play.nim-lang.org/#ix=4xzp
04:42:15FromDiscord<Stuffe> it didn't work either
04:42:16FromDiscord<Arathanis> you dont want to override what NimMain does
04:42:36FromDiscord<Stuffe> the thing is that it is a dynamic library, it isn't even supposed to have a main
04:42:46FromDiscord<Elegantbeef> Right but NimMain isnt main
04:42:55FromDiscord<Elegantbeef> It's the top level code that you need to call and things to intialise
04:42:58FromDiscord<Arathanis> yes but all of Nim's GC and runtime has to init
04:43:04FromDiscord<Arathanis> if you dont call it your app will explode
04:43:04FromDiscord<Stuffe> I see
04:43:10FromDiscord<Elegantbeef> "all of Nim's gc an runtime" isnt accurate
04:43:18FromDiscord<Elegantbeef> arc/orc do not require intialisation
04:43:22FromDiscord<Arathanis> please make it accurate
04:43:31FromDiscord<Arathanis> i just know it needs to happen for init reasons at some point
04:43:39FromDiscord<Arathanis> what exactly does it init so I can be accurate here
04:43:51FromDiscord<Arathanis> some point being: first thing lol
04:43:51FromDiscord<Elegantbeef> With arc/orc the only reason you need to call NimMain is to call top level code
04:43:53FromDiscord<Stuffe> In reply to @Arathanis "you dont want to": could you explain exactly what I should try then?
04:44:03FromDiscord<Elegantbeef> Use `--gc:orc`
04:44:13FromDiscord<Arathanis> ive given you how i solved my struggle, try what beef is suggesting. use the orc mm
04:44:25FromDiscord<Arathanis> In reply to @Elegantbeef "Use `--gc:orc`": isn't it technically `--mm:orc`
04:44:27FromDiscord<Elegantbeef> Ensure you're using modern nim and not nim 0.18.x
04:44:28FromDiscord<Stuffe> i can't, the library I am using is forcing me to use the real time gc thing :/
04:44:29FromDiscord<Arathanis> i always get deprecation complaints
04:44:40FromDiscord<Elegantbeef> it's mm now
04:44:46FromDiscord<Stuffe> In reply to @Elegantbeef "Ensure you're using modern": I am on 1.6.10
04:44:54FromDiscord<Elegantbeef> Go to stable nim
04:45:05FromDiscord<Arathanis> which one is realtime gc?
04:45:08FromDiscord<Elegantbeef> People will do anything but update their software
04:45:19FromDiscord<Arathanis> In reply to @Elegantbeef "People will do anything": i get pissed off when someone wont let me update
04:45:24FromDiscord<Arathanis> and will look for replacements
04:45:36FromDiscord<Arathanis> (edit) "someone" => "someone/something"
04:46:07FromDiscord<Elegantbeef> How to say you use arch without saying it
04:46:10FromDiscord<Elegantbeef> Or maybe gentoo
04:47:05FromDiscord<Stuffe> I am on version 1.6.12 now
04:47:09FromDiscord<Stuffe> still having the same issue
04:47:18FromDiscord<Elegantbeef> Compile with `-f`
04:47:23FromDiscord<Stuffe> ok
04:47:41FromDiscord<Elegantbeef> If that doesnt work, what godot library are you using?
04:47:57FromDiscord<Stuffe> it didn't work :/
04:48:01FromDiscord<Stuffe> I am using godot-nim
04:48:15FromDiscord<Elegantbeef> That doesnt require realtimegc iirc
04:48:30FromDiscord<Stuffe> it does, I guarantee you
04:48:36FromDiscord<Arathanis> which gc are you relying on?
04:48:37FromDiscord<Stuffe> I have been working with it for a year
04:48:37FromDiscord<Stuffe> every day
04:48:59FromDiscord<Elegantbeef> that's refc with some magic schtuffโ†ต(@Arathanis)
04:49:00FromDiscord<Stuffe> -d:useRealtimeGc
04:49:11FromDiscord<Elegantbeef> I swear i've used godot-nim with orc before
04:49:15FromDiscord<Elegantbeef> Might be a fever dream
04:49:18FromDiscord<Arathanis> ah got it so its refc + that flag
04:49:48FromDiscord<Stuffe> In reply to @Elegantbeef "I swear i've used": I think there are some hard coded hacks to get the 2 gcs to work
04:50:04FromDiscord<Stuffe> I really want to upgrade to godot 4 and use the new library being worked on here
04:50:25FromDiscord<Stuffe> and then switch to orc as well
04:50:35FromDiscord<Stuffe> but it isn't quite ready yet I think
04:50:58FromDiscord<Stuffe> however, its quite strange that this stopped working all of a sudden
04:51:02FromDiscord<Elegantbeef> Yea I do not know what to say there isnt any reason for this issue
04:51:06FromDiscord<Elegantbeef> Is the code open?
04:52:02FromDiscord<Stuffe> you mean open source? no sorry its a game
04:52:19FromDiscord<Stuffe> maybe the mac udpate updated clang or something, really have no idea
04:52:26FromDiscord<Elegantbeef> Meanwhile my game is open ๐Ÿ˜›
04:52:37FromDiscord<Stuffe> which game is that?
04:52:41FromDiscord<Elegantbeef> Yea no clue aside from clang changes really
04:52:48FromDiscord<Elegantbeef> Nothing as good as turing complete
04:53:01FromDiscord<Stuffe> thanks ๐Ÿ™‚
04:53:01FromDiscord<Elegantbeef> My in development gameplay lacking game
04:53:37FromDiscord<Stuffe> its quite hard to make a full time living with an open source game i think
04:53:58FromDiscord<Elegantbeef> You know you can still sell the game ๐Ÿ˜„
04:54:15FromDiscord<Stuffe> true I guess
04:54:23FromDiscord<Elegantbeef> mindustry for instance has a free java release but the steam release exists with steam api
04:54:25FromDiscord<Arathanis> just because you share the source doesn't mean you can't have a "fuck you pay me" license
04:54:37FromDiscord<Elegantbeef> barony is fully FOSS but the assets are paid on steam
04:54:45FromDiscord<Arathanis> i love barony
04:54:49FromDiscord<Elegantbeef> Meh arth that's not even the point
04:55:00FromDiscord<spotlightkid> I'm on Manjaro and after the latest round of package updates, suddenly all GTK programs (e.g. thunderbird and firefox) took \>20s to start up. After some online research, this turns out to be some problem/conflict with flatpack dbus "portals". I was able to fix the problem by de-installing the package `xdg-desktop-portal-gnome`.โ†ต(@!&luke)
04:55:13FromDiscord<huantian> I love beans
04:55:17FromDiscord<Elegantbeef> Even a gpl3 game like barony can be fully OSS cause it doesnt ship the assets
04:55:48FromDiscord<Elegantbeef> But mindustry ships precompiled java builds just without steam intergration on their github
04:56:12FromDiscord<Elegantbeef> So open source games can exist and sell, I'm just not a good metric since I do not have any finished games that I think are worth selling
04:56:46FromDiscord<Arathanis> the day beef decides they can make money by selling their Nim help is the day we are all collectively sent to back to the stoneage.
04:56:55FromDiscord<Elegantbeef> Lol
04:57:21FromDiscord<Elegantbeef> If only I had something marketable
04:57:21FromDiscord<Arathanis> > the nim help is free, the condescending remarks will cost you
04:57:39FromDiscord<Arathanis> ๐Ÿ˜›
04:57:59FromDiscord<Graveflo> if you tip him he might even throw in some sarcasm
04:58:11FromDiscord<Elegantbeef> I'd never
04:59:30*ntat joined #nim
05:04:57*derpydoo quit (Ping timeout: 268 seconds)
05:21:55FromDiscord<Graveflo> when I try to pass something into a macro in the same way you would specify a type for a generic I just get something that equates to "GenericParam" whatever that is. I can't seem to inspect it's type. It doesn't have an obvious way of utilizing the type that I used when calling the macro. What is that?
05:24:42FromDiscord<Elegantbeef> Best to just pass the type in as a parameter
05:25:18FromDiscord<Graveflo> its already way uglier then I would have hoped. I think it might be hideous if I do that
05:26:28*boxuser joined #nim
05:32:09FromDiscord<HitBlast> Is it possible to have multiple return types inside a Nim procedure?
05:32:41FromDiscord<Arathanis> you could use an object variant
05:32:43FromDiscord<demotomohiro> How about to use a tuple as return type.
05:33:37FromDiscord<demotomohiro> Multiple return types means you want to return them at same time or one of them at a time?
05:33:54FromDiscord<HitBlast> one of them at a time
05:34:01FromDiscord<Arathanis> object variant
05:34:48FromDiscord<demotomohiro> Or use type class like `string or int` if return type can be determined at compile time.
05:35:36*deadmarshal_ joined #nim
05:36:54FromDiscord<Arathanis> though usually wanting multiple return types is a sign you need to reconsider your design
05:36:57FromDiscord<Arathanis> but not every time
05:50:39*xaltsc quit (Ping timeout: 250 seconds)
06:04:11NimEventerNew thread by hunterbr: End of function in Nim binary, see https://forum.nim-lang.org/t/10250
06:07:23FromDiscord<Rika> :thinkDrops:
06:09:38FromDiscord<demotomohiro> Why they want end of function?
06:29:59FromDiscord<that_dude> sent a code paste, see https://play.nim-lang.org/#ix=4xzD
06:32:17*boxuser quit (Read error: Connection reset by peer)
06:32:28FromDiscord<Arathanis> you dont like SIGSEGV
06:32:32FromDiscord<Arathanis> (edit) "SIGSEGV" => "SIGSEGV?"
06:33:13FromDiscord<that_dude> It makes me try
06:33:16FromDiscord<that_dude> (edit) "try" => "cry"
06:33:46FromDiscord<Arathanis> yeah its not the best, but with experience you get used to it and can quickly pick out what happened
06:34:09FromDiscord<Elegantbeef> I mean I'm a bit lost at what the issue is ๐Ÿ˜„
06:34:19FromDiscord<Elegantbeef> You asked for a stack object, then changed it to a ref and it errored no?
06:34:40FromDiscord<Arathanis> In reply to @Elegantbeef "I mean I'm a": some people want the error message to be something like "you didnt init a Thing!"
06:34:47FromDiscord<that_dude> Bro I don't even care about stack vs heap. I just want it to work lol
06:35:11FromDiscord<Elegantbeef> For that to work would imply all references defaulting to allocated
06:35:23FromDiscord<Arathanis> with a little experience they will learn that SigSegV means "you tried to access memory that isn't yours" and that in turn means they forgot to init something (or access something that was already destroyed)
06:35:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xzG
06:36:05FromDiscord<Arathanis> im not arguing that it should work this way, its just what some people expect.
06:36:11FromDiscord<that_dude> ^
06:36:19FromDiscord<Elegantbeef> They said "I just want it to work"
06:36:20FromDiscord<Arathanis> i think SigSegV is totally fine
06:36:36FromDiscord<that_dude> Nah it's fine, you just have to understand the internals better
06:36:38FromDiscord<Arathanis> you foot gun yourself like this once and either choose to learn, or decide not too ๐Ÿ˜‚
06:36:59FromDiscord<Arathanis> (edit) "too" => "to"
06:37:33FromDiscord<that_dude> The thing was that the type was much more complex and I was initially getting the sigsegv when trying to iterate a seq
06:37:36FromDiscord<Arathanis> some people didn't learn staring with C and it shows ๐Ÿ˜
06:37:41FromDiscord<Arathanis> (edit) "staring" => "starting"
06:37:53FromDiscord<that_dude> batch -> python -> nim bb
06:37:58FromDiscord<Elegantbeef> Wait you can tell I have never wrote C?
06:37:59FromDiscord<Arathanis> batch
06:38:01FromDiscord<Arathanis> you poor soul
06:38:14FromDiscord<Arathanis> im so sorry
06:38:39FromDiscord<that_dude> I was in elementary lol. I never got to for loops, I wrote a pokemon battle sim-ish thing with nothing but global vars and gotos
06:38:43FromDiscord<Arathanis> In reply to @Elegantbeef "Wait you can tell": C as a stand in for "languages that make/let you do manual memory"
06:38:58FromDiscord<Elegantbeef> I've only seriously written C# and Nim
06:39:33FromDiscord<Arathanis> C# is interesting
06:41:26FromDiscord<Arathanis> wait, beef you did C#???
06:41:32FromDiscord<Arathanis> Did you use Visual Studio?????
06:41:38FromDiscord<Elegantbeef> No
06:42:02FromDiscord<Arathanis> whata toolchain did you use?
06:42:07FromDiscord<Elegantbeef> Yes my entry into programming was Unity, so I learned C#
06:43:02FromDiscord<Arathanis> ahhhhh
06:43:09FromDiscord<Arathanis> gotcha
06:44:11FromDiscord<Arathanis> exit
06:44:20FromDiscord<Arathanis> oops
06:44:22FromDiscord<Rika> heres your missing slash /
06:48:22FromDiscord<Graveflo> I loved C# when I found it, but at that time I only new vb6 well and I was reading about java
06:48:56*PMunch joined #nim
06:50:32FromDiscord<Arathanis> for every 2 or 3 things about C# I love
06:50:36FromDiscord<Arathanis> it has some horrible blemish
06:52:10FromDiscord<Graveflo> I ditched it before I knew enough to heavily scrutinize it
06:52:59*boxuser joined #nim
06:53:39FromDiscord<Graveflo> and also it's such a weird language. I think I can excuse C++s confused nature by the environment/time it was built for. A little bit of that with C# but honestly they should have known better
06:57:54*ntat_ joined #nim
06:58:07*ntat quit (Ping timeout: 240 seconds)
07:07:32PMunchWeren't they just desperately copying Java at the time it was created?
07:08:30FromDiscord<Graveflo> I've heard people say that. I guess its the jit and it heavily object oriented
07:10:20FromDiscord<Elegantbeef> C# started off as J#
07:10:24FromDiscord<Elegantbeef> It was microsoft's java
07:10:41FromDiscord<Graveflo> oh so it was literally
07:11:09FromDiscord<Elegantbeef> Yes but now it's in a much better place than java
07:11:21FromDiscord<Elegantbeef> Having structs and non 32bit sized primitives ๐Ÿ˜„
07:11:57FromDiscord<Graveflo> that's not saying much. I think js is my most disliked language I've ever had the displeasure of spending a lot of time in, but id say modern js is better then C#
07:12:36FromDiscord<Elegantbeef> I disagree, C# is statically typed and can be fast ๐Ÿ˜„
07:12:51FromDiscord<Graveflo> but there are better languages for that
07:14:26FromDiscord<Graveflo> and I would be very surprised if it does that better then C, Rust or Nim
07:22:18PMunch"can be fast"
07:23:21PMunchIt's mostly all the cruft that's built on top for you typical OO/C# application which is the issue for speed. It also makes the codebase really hard to read..
07:26:01FromDiscord<Graveflo> I'm curious how a nim codebase could be considered easy to read when procs can bind in so many places? To be clear no one likes tangled inheritance spaghetti but at least it does a good job of keeping things in predictable places... usually. I would like to get a tip for reading nim code if you have one ๐Ÿ˜œ
07:28:24FromDiscord<Elegantbeef> It's very easy to read you import modules then just read code, does it really matter where a proc comes from when you're reading?
07:30:23FromDiscord<Graveflo> well if you are reading it you know where it is bc ur looking at it. I'm saying its hard to know exactly where a proc call will jump to in a given scenario
07:30:41FromDiscord<Graveflo> or it can be
07:30:42FromDiscord<Elegantbeef> That's where tooling is supposed to be
07:30:48FromDiscord<Graveflo> I KNOW T>T
07:30:55FromDiscord<lyhokia> sent a code paste, see https://play.nim-lang.org/#ix=4xzS
07:31:15FromDiscord<Elegantbeef> Generate an entire type section in your macro
07:31:33FromDiscord<lyhokia> I'm not the writer of the libirary so probably that's hard to do as well
07:32:01FromDiscord<leorize> alternatively you can use generics
07:32:36FromDiscord<lyhokia> The type is actually recursive in the real use case so I can't strip one type out to be a generic
07:33:00FromDiscord<Elegantbeef> Then the solution is to PR the library
07:33:25FromDiscord<lyhokia> Okay looks like I have to abandon the library in favor of something else
07:33:29FromDiscord<lyhokia> Thank you tho
07:33:34FromDiscord<Elegantbeef> What library is it?
07:35:12FromDiscord<lyhokia> andreaferretti/patty
07:35:42FromDiscord<lyhokia> They have an [issue](https://github.com/andreaferretti/patty/issues/14) already opened, seeems interesting, I may take a look at it
07:36:27FromDiscord<lyhokia> Is there any alternative that works well with the type block?
07:37:27FromDiscord<Elegantbeef> Nope my variant library explicitly doesnt use a typesection due to how that works
07:37:33FromDiscord<Elegantbeef> You can use a generic like leo said though
07:38:14FromDiscord<leorize> plugging my library\: https://github.com/alaviss/union
07:38:45FromDiscord<lyhokia> Thanks, I'll take a look
07:38:49FromDiscord<Elegantbeef> Going to have 30 different variant libraries soon
07:39:45FromDiscord<leorize> not that I've ever tested recursion with my library
07:39:54FromDiscord<lyhokia> Why the language doesn't have variant built in if this is useful?
07:40:06FromDiscord<Elegantbeef> It does have variant built in
07:40:15FromDiscord<leorize> it doesn't have ADTs
07:40:15FromDiscord<Elegantbeef> Object variants exist and are how all of these libraries work
07:40:33FromDiscord<lyhokia> I am aware of that but that's cumbersome to use
07:40:33FromDiscord<Elegantbeef> Well actually it does have ADTs just not the one people want ๐Ÿ˜›
07:40:36FromDiscord<leorize> and the only thing ever talked about in RFCs are pattern matching, which is never the point of ADT
07:40:53FromDiscord<leorize> variants are not ADTs
07:41:08FromDiscord<Elegantbeef> ADTs are a generic term that can mean just structs
07:41:17FromDiscord<lyhokia> Yeah I actually need ADT but for now I'm just simulating it with variants
07:41:35PMunchGraveflo, wait, that's exactly the thing I like about Nim. You know where the program flows, because it says right there
07:41:41FromDiscord<Elegantbeef> https://github.com/beef331/fungus
07:42:03FromDiscord<Elegantbeef> Closest Nim has to "ADT"s
07:42:07FromDiscord<Elegantbeef> God i hate that term
07:42:22FromDiscord<Graveflo> In reply to @PMunch "<@200775012796334081>, wait, that's exactly": you speak in riddles. I'll figure it out I guess LOL
07:42:30PMunchUnlike something like C# which pseudo-magically registers a bunch of random files and the main part of your program is just "runProgram()" and somehow that ruffles through your code and finds something to run
07:42:34FromDiscord<leorize> you just have to embrace the algebraic nature of it beef
07:42:42FromDiscord<Elegantbeef> Lol
07:42:54FromDiscord<Elegantbeef> It's such a pointless term cause it includes product and sum types
07:43:00FromDiscord<Elegantbeef> As such tuples and records are ADTs
07:43:09FromDiscord<Elegantbeef> But no one means those when they write ADTs for some reason
07:43:17FromDiscord<leorize> only tuples tbh
07:43:21FromDiscord<leorize> records are identified by name
07:43:36FromDiscord<Elegantbeef> They're a product type
07:43:40FromDiscord<lyhokia> @ElegantBeef your lib also doesn't work if I need recursive variants, because it's generating a whole type block as well right?
07:43:54FromDiscord<Elegantbeef> It works with recursive if you use generics
07:43:56FromDiscord<leorize> yea but the identity is the name, not the product
07:44:12FromDiscord<Elegantbeef> Dont argue with me argue with wikipedia
07:44:38FromDiscord<lyhokia> Don't understand... Could you make an example?
07:44:44FromDiscord<leorize> I'm so gonna call mine ADTS where S stands for strict lol
07:45:17FromDiscord<leorize> and like strictFuncs, it also doesn't work
07:45:33FromDiscord<Elegantbeef> Should compile
07:45:35FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/G6hCq
07:45:46FromDiscord<Graveflo> In reply to @PMunch "Unlike something like C#": I don't remember what C# was like, but I guess there could be a similar issue with finding base classes or something. Other than that methods are stuck to their defining classes and classes explicitly tell you where their super-classes logic is. In nim all that depends on context. I don't dislike it but it really does need tooling to direct you to the proper control flow unless you are al
07:46:15FromDiscord<Elegantbeef> How is that different with C# where interfaces exist
07:46:30FromDiscord<Elegantbeef> You do not know what type something is just that it implements X
07:46:34FromDiscord<lyhokia> That looks interesting, thank you Elegantbeef
07:46:49FromDiscord<Elegantbeef> The same might work with patty aswell, no clue
07:47:54FromDiscord<Elegantbeef> Compiles
07:47:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4xzU
07:48:06FromDiscord<Elegantbeef> No clue if you want it `ref T` inside `MyName` or wherever
07:48:20FromDiscord<Graveflo> In reply to @Elegantbeef "How is that different": I'm not worried about which objects are being subjected to the code. I would worry about "given this type of object at this call where do I go" the point of abstraction is that you don't have to care about specifics like that unless you are tracking a particular instance
07:48:40FromDiscord<leorize> beef I think nimnode is a good one as an example
07:48:59FromDiscord<Elegantbeef> What do you mean?
07:49:08FromDiscord<leorize> it's recursive
07:49:24FromDiscord<leorize> oh wait it's not an issue with your style of nodes
07:49:24FromDiscord<Elegantbeef> Right
07:51:15FromDiscord<Elegantbeef> Who knows, it'd be nice if JJ's RFC is accepted and fungus can be axed
07:52:05FromDiscord<leorize> I like union style more but I'm too tired to make an RFC for it
07:52:07PMunchGraveflo, when I first started using C# commercially I had an engineer come over to try and explain the program to me. I asked him where the logic was hidden, because all I could find was orchestration stuff. He looked at me like I had asked him where the narwhales bacons at midnight. I tried another way saying where does the program start, he cheered up and told me in Startup.cs. Looking at Startup.cs there was still no trace of any actual programming logic,
07:52:07PMunchso I asked him where stuff was happening in this program, and although slightly confused looking he told me that the program continues from Startup.cs to Program.cs. I thought fine, I guess we'll go through the entire flow then. Program.cs turned out to be just more orchestration stuff, and after having gone through 5 more files we finally found a tiny piece of actual logic, starting a webserver! You see my problem with this?
07:52:19FromDiscord<Elegantbeef> Well they're two different solutions
07:52:38FromDiscord<Elegantbeef> To two different problems i'd say
07:52:54FromDiscord<Elegantbeef> "narwhales bacon at midnight"
07:53:03FromDiscord<Elegantbeef> Frying some bacon in the ocean like the chads they are
07:53:22PMunchWith Nim you open the file with the same name as the binary you produced (unless your Nimble file or other build system says otherwise) and it more often than not contains the actual program
07:53:27FromDiscord<Graveflo> In reply to @PMunch "so I asked him": xD I most certainly do. Not advocating for that
07:54:07FromDiscord<Elegantbeef> I mean the only difference is that Nim's implementations can be in any file you import, which is a non issue with properly named code
07:54:22FromDiscord<Graveflo> I get that. Yea... idk I'm a worry wart. I always think of the worst case scenario
07:54:23FromDiscord<Elegantbeef> If you see someone do`import truss3D/instancemodels` and then do `loadInstancedModel[T](...)` you probably can reason that procedure is inside that module
07:54:25PMunchIf you find a function you wonder where comes from (and it isn't obvious from the name) look at the first type it takes, this will typically belong to a certain module.
07:54:42FromDiscord<Elegantbeef> You can arguably do the same with C# since it has extension methods
07:54:54FromDiscord<Elegantbeef> So you have to look in two places for static methods
07:55:03FromDiscord<Elegantbeef> actually N places
07:55:10FromDiscord<Elegantbeef> since you can implement an extension method in any file
07:55:35FromDiscord<Graveflo> wanna talk about stuff like that lets not forget that python is basically modular programming with OOP built on top of it without restrictions
07:55:39PMunchGraveflo, that's a great way to preemptively optimise for problems that don't actual exist, and then end up in a scenario where you've built the most entangled system you could imagine to solve a trivial non-problem
07:55:48FromDiscord<Elegantbeef> The only real difference between Nim and C# here is that Nim says "extension methods can be applied to instances and not just static types"
07:56:12FromDiscord<Elegantbeef> I've never seriously used python so i cannot say anything about it's actual usage
07:56:18FromDiscord<Graveflo> but theres always a bad way to do it. I'm just imagining properly made logic that is scaling in complexity out of necessity. Perhaps like the compiler
07:56:29*boxuser quit (Read error: Connection reset by peer)
07:56:44FromDiscord<Elegantbeef> Bad code will always be bad code
07:57:02PMunchGranted sometimes you end up greping through files, but it's not often. And tools like nimsuggest/nimlsp helps as well
07:57:10FromDiscord<Elegantbeef> Thinking that bad code can exist is a fools errand it'll always exist
07:57:27FromDiscord<Graveflo> In reply to @PMunch "<@200775012796334081>, that's a great": I'm not trying to solve anything. I'm just wondering how people wrap their head around the compiler tbh. I havent tried much but I need to either triple my memory IQ or figure out some tooling or I might be cooked
07:58:17PMunchHaha, well the compiler is probably about the most complex piece of Nim code out there. So you've chosen a rough place to start
07:58:27FromDiscord<Elegantbeef> The modules are named after what they do
07:58:30FromDiscord<Elegantbeef> It's not too bad
07:58:35PMunchIt's easy to get lost in the weeds in there though
07:58:45FromDiscord<Elegantbeef> It's bad code but the organisation of modules and procedures is fine
07:58:54PMunchLike trying to find the implementation of a magic which takes you across a couple different files
08:00:21FromDiscord<leorize> the compiler is also written using the worst style of nim possible so there's that
08:01:12FromDiscord<Graveflo> LOL this turned into a compiler roast
08:02:27*boxuser joined #nim
08:02:56FromDiscord<leorize> the best tool for nim compiler dev is `grep`
08:05:37*m5zs7k quit (Ping timeout: 240 seconds)
08:06:06*m5zs7k joined #nim
08:15:26FromDiscord<ieltan> Why can't you do `dirname/[some, module] except symbol` ?
08:15:51FromDiscord<ieltan> (edit) "`dirname/[some," => "`import dirname/[some,"
08:17:19FromDiscord<Graveflo> maybe because its not specific which module the symbol is redacted from.. idk why it doesn't just do both
08:20:07FromDiscord<ieltan> hmm
08:21:00FromDiscord<lyhokia> Hello all, is it possble to add a git repo as my dependency rather than letting nimble resolve it for me? I'm forking a repo and I want to test it
08:22:04FromDiscord<lyhokia> For example in crystal shards they have this:
08:22:34FromDiscord<lyhokia> sent a code paste, see https://play.nim-lang.org/#ix=4xA4
08:23:17FromDiscord<ieltan> In reply to @Graveflo "maybe because its not": what about `except some.symbol`
08:23:39FromDiscord<ieltan> well this probably doesn't help if there are overloaded functions
08:23:41FromDiscord<ieltan> hmm
08:24:02FromDiscord<ieltan> wait how does it work with overloaded functions anyways does it yeet them all ?
08:24:21FromDiscord<demotomohiro> iirc, you can specify git repo url as dependency in nimble.
08:24:49FromDiscord<Graveflo> In reply to @lyhokia "For example in crystal": try running `nimble setup` after having the right configuration
08:25:25PMunchieltan, yes it removes all of the overloads
08:25:35FromDiscord<Graveflo> also I think it helps to make sure you are running the main module in case you are not doing that. like `nim r src/mypkg.nim`
08:26:06FromDiscord<lyhokia> @demotomohiro could you write a simple example please? I don't find the spec for nimble file so it would also help if someone know if there is one
08:26:39FromDiscord<lyhokia> Oh I find this: https://github.com/nim-lang/nimble/blob/7484582e52b3201d3c0a510ed2feeb5d7a8c3491/tests/issue432/issue432.nimble#L12
08:26:40FromDiscord<lyhokia> Thanks
08:27:22FromDiscord<demotomohiro> In reply to @lyhokia "<@288750616510201856> could you write": here is another example: https://github.com/nim-lang/nimble#creating-packages
08:27:51*ntat_ is now known as ntat
09:14:21*junaid_ joined #nim
09:16:50*junaid__ joined #nim
09:21:50*junaid__ quit (Quit: leaving)
09:40:26*boxuser quit (Ping timeout: 246 seconds)
09:42:25*boxuser joined #nim
09:53:07*boxuser quit (Ping timeout: 240 seconds)
09:54:59*boxuser joined #nim
09:55:43*deadmarshal_ quit (Ping timeout: 256 seconds)
09:56:00FromDiscord<voidwalker> can anyone experienced parsing html give me a hand ? just wasted a few hours trying to find elements by tags, then I did `html[2][1][3][1][9][2][1][17][0][0][5][10]` only to find out this doesn't hold true for the next html file with the same structure :\
09:56:28FromDiscord<Graveflo> woa there
09:57:03FromDiscord<Graveflo> you need to do just a little bit of land marking if you are trying to get something slightly more robust
09:57:24FromDiscord<voidwalker> I'm thinking I should look into xpath or css selectors
09:57:50FromDiscord<Graveflo> do the html elements not have ids?
09:58:58FromDiscord<voidwalker> https://media.discordapp.net/attachments/371759389889003532/1115580584203390976/image.png
09:59:46FromDiscord<voidwalker> It's a text element, interestingly firefox doesn't have any css/xpath selector option right clicking on it
09:59:57FromDiscord<Graveflo> so things like <b>Uploaded by</b> and maybe a css class or html id or distinct patterns of tags. These are things you can use to landmark the html
10:01:08FromDiscord<voidwalker> I was hoping I can get away with parsehtml unit, I managed so far, this is the last one I have to do. But it doesn't have recursive traversal of elements
10:02:16FromDiscord<Graveflo> you can't just recurse them with recursion?
10:02:25FromDiscord<Graveflo> or even a while loop would work
10:02:47FromDiscord<Graveflo> you are just going through them until you find a pattern that you recognize
10:03:59FromDiscord<voidwalker> indeed what I need is to get the distinctive element location in the tree, and then what I want is relative to that
10:04:52FromDiscord<Graveflo> lets say you wanted to get that image at the bottom. You could write a loop that looks for a `div` in a `div` that has `<b>Uploaded by</b>` in it and then return the next `img` tag. I would get some sample html strings and use them to test the loop while you are writing it
10:06:28FromDiscord<voidwalker> I think I'm going to switch to `parsexml`, that one has a `.next` operator
10:06:59FromDiscord<Graveflo> alright
10:07:43FromDiscord<voidwalker> findAll from html gets me the distinctive elements I want, but it filters out the "next" data I need
10:07:47FromDiscord<voidwalker> so it's useless
10:08:42FromDiscord<Graveflo> in the xml parser?
10:08:54FromDiscord<voidwalker> in `parsehtml`
10:10:28FromDiscord<voidwalker> img is (one of) the distinctive tag I have, all the data has a little icon next to it. But if I findall("img"), I lose the data. If I findAll("div"), then I am completely lost how to search downwards, too many divs
10:18:19*boxuser quit (Ping timeout: 265 seconds)
10:19:43*boxuser joined #nim
10:22:12FromDiscord<voidwalker> Ah I think I got it
10:22:15FromDiscord<voidwalker> `for i, x in html.findAll("div").filterIt(it.attr("style") == "width:25%;float:left;"):`
10:22:33FromDiscord<voidwalker> now much easier to dig in
10:25:02FromDiscord<voidwalker> I'd like to find the "best" way to do this crap in the future though
10:26:08FromDiscord<voidwalker> https://github.com/weskerfoot/NimPath - this one looks like the only way to use xpath in nim, but it needs .so (.dll works also maybe?)
10:26:17FromDiscord<voidwalker> and there's this : https://github.com/cyluxx/robula-plus
10:26:17FromDiscord<Graveflo> yea there are libraries for stuff like this. I don't know the nim ones. I usually just write a custom loop or recursion and do the detection the old fashioned way
10:43:34FromDiscord<ricky> In reply to @Graveflo "yea there are libraries": as it should be
11:04:20FromDiscord<voidwalker> https://media.discordapp.net/attachments/371759389889003532/1115597033038958652/image.png
11:05:41FromDiscord<voidwalker> shouldn't all this block be in the same XmlNode ? in nim it gets cut before the <form, and I cant' access data below it. It seems it parsed that one as part of the higher parent div for some reason :\
11:08:30*deadmarshal_ joined #nim
11:16:22FromDiscord<spotlightkid> What is the syntax for `nimble install`ing from the HEAD of a remote git repo (without manually checking it out)?
11:18:15*boxuser quit (Ping timeout: 265 seconds)
11:20:04FromDiscord<voidwalker> I think `nimble install https://github.com/ying32/nim-vcl@#head`
11:20:10FromDiscord<Rika> Yes
11:20:25*boxuser joined #nim
11:21:39FromDiscord<spotlightkid> Right, thanks! Tried different things but didn't think of adding a `#`.
11:34:17*boxuser quit (Ping timeout: 250 seconds)
11:36:01*boxuser joined #nim
11:42:22FromDiscord<chmod222> Fun, my segfault goes away when I use the C++ backend as well as when I compile with debug infos
11:42:24FromDiscord<chmod222> This keeps getting weirder
11:52:07*PMunch quit (Quit: Leaving)
11:55:14FromDiscord<Rika> valgrind/asan time it sounds like
11:56:09FromDiscord<chmod222> Valgrind doesn't tell me anything new except that something is nil but it cannot tell me what that thing is, and everything apparently is not nil from what I'm logging
11:57:01FromDiscord<chmod222> Can I instruct nim to pass -fsanitize=address to gcc?
11:57:10FromDiscord<chmod222> Apparently I can, let's see
11:58:45FromDiscord<Rika> In reply to @chmod222 "Valgrind doesn't tell me": add -g to nim's args maybe? debugger info
11:58:49FromDiscord<Rika> (edit) "In reply to @chmod222 "Valgrind doesn't tell me": add -g to nim's args maybe? ... debugger" added "for"
11:59:21FromDiscord<chmod222> Once I include debug infos, the segfault disappears
11:59:30FromDiscord<chmod222> Which is why this is yanking my chain so much
12:00:30FromDiscord<Rika> mmmmmmmmmmm
12:00:30FromDiscord<chmod222> It works in C -d\:danger, in C with debug symbols, in C++ no matter what but in default C development debug mode without debug symbols, it dies
12:00:31FromDiscord<Rika> fun
12:00:43FromDiscord<chmod222> Very fun
12:03:02FromDiscord<chmod222> Also goes away with asan \:)
12:03:14FromDiscord<chmod222> Of course
12:05:58FromDiscord<chmod222> I think that's the most heisenbug I've ever had, it literally goes away when you want to observe it
12:12:59FromDiscord<voidwalker> so parsehtml seems to use parsexml under the hood, which doesn't correctly parse my html. What hope do I have ? :\
12:15:15FromDiscord<chmod222> Writing an HTML parser if you're up for a 5 minute adventure that may take you 4 years
12:15:38FromDiscord<voidwalker> yeah, I'm pretty much more than a day now at this
12:15:48*lucasta joined #nim
12:16:03FromDiscord<chmod222> Binding a preexisting HTML parser may be less painful
12:16:05FromDiscord<chmod222> https://curl.se/libcurl/c/htmltidy.html
12:16:18*lucasta quit (Remote host closed the connection)
12:16:57FromDiscord<voidwalker> I don't know how to bindings, it will probably take me a few days just to figure that out
12:17:04*lucasta joined #nim
12:17:56FromDiscord<voidwalker> maybe I will go string/regex way for this ;\
12:18:29FromDiscord<chmod222> As long as it's a self contained snippet you want to extract, that's completely fine imo
12:19:24FromDiscord<chmod222> Just don't try to write an HTML parser in regex, lest someone copy pastes the infamous stackoverflow comment
12:26:10FromDiscord<chmod222> By god, I found the segfault
12:26:16FromDiscord<chmod222> I can sleep again
12:26:24*boxuser quit (Ping timeout: 265 seconds)
12:27:02FromDiscord<sOkam!> In reply to @voidwalker "I don't know how": its not difficult. its just a lot of `importc`
12:27:16FromDiscord<voidwalker> this is already a rabbit hole, i'd rather not open another one
12:27:21FromDiscord<sOkam!> fair
12:27:55FromDiscord<voidwalker> if someone familiar with the xml parser is here to take a look, this might be a nim bug
12:28:21*boxuser joined #nim
12:29:18FromDiscord<voidwalker> Might be related to this: https://github.com/nim-lang/Nim/pull/12205
12:29:19FromDiscord<sOkam!> to give some perspective on the bindings thing (for future reference), if you have ever done any type of C buildsystem, bindings a lot easier. much easier than cmake even. just different and takes a bit to grasp how, but once you do the tools are really easy and clean to use
12:29:25FromDiscord<voidwalker> that pull request was not merged, right ?
12:30:49FromDiscord<Rika> In reply to @chmod222 "I think that's the": schrodinbug
12:31:21FromDiscord<chmod222> It was of course completely unrelated to what I was actually looking for, all my pointers were in fact valid
12:31:30FromDiscord<spotlightkid> sent a code paste, see https://play.nim-lang.org/#ix=4xAZ
12:31:35FromDiscord<chmod222> But buffer overflows don't care and will tear through anything
12:31:37FromDiscord<Rika> wait so what happened
12:31:38FromDiscord<Rika> oh
12:31:50FromDiscord<Rika> buffer overflow, maybe msan would have caught that
12:32:09FromDiscord<chmod222> It crossed the FFI boundary so I'm not entirely sure
12:32:12FromDiscord<chmod222> Raw pointers subvert everything
12:32:37FromDiscord<chmod222> A method that I believe would write an int32 wrote in fact int64
12:35:36*krux02 joined #nim
12:36:34FromDiscord<sOkam!> In reply to @spotlightkid "Is there a nicer": you could make it a template
12:36:36FromDiscord<that_dude> Spotlight kid, look into result or options? May be what your looking for
12:36:36FromDiscord<chmod222> What would interest me is why it fails now and not a week ago
12:36:40FromDiscord<chmod222> But buffer overflows are cheeky
12:38:00FromDiscord<that_dude> (edit) "result" => "nim-results"
12:42:20FromDiscord<spotlightkid> @that_dude\: ok, I'll read up on those. A template would be overkill, since it's only one function,
12:43:59*junaid_ quit (Remote host closed the connection)
13:04:32*junaid_ joined #nim
13:06:05*beholders_eye joined #nim
13:17:03*beholders_eye quit (Ping timeout: 268 seconds)
13:18:30*lucasta quit (Remote host closed the connection)
13:18:46*PMunch joined #nim
13:18:53*lucasta joined #nim
13:25:36om3gahave you used GoLang-s GC? resulting binary reported there is no libgo.so in the sys
13:25:58om3gaofc I installed go's compiler :)
13:26:38om3gaoh I found it, please ignore
13:27:30om3gawhy, why they choose such paths : /usr/lib/gcc/x86_64-linux-gnu/11/libgo.so
13:28:51om3ga/usr/lib/gcc/x86_64-linux-gnu/11/libgo.so: undefined symbol: __go_init_main
13:31:38FromDiscord<Chronos [She/Her]> Why are you using Go's Gc?
13:32:21FromDiscord<Chronos [She/Her]> Isn't refc much more suitable than the outputted binary size because of the Go GC?
13:32:30FromDiscord<Chronos [She/Her]> Unless you're doing some funky interop with Go?
13:35:12om3gaChronos: For test
13:35:31*ntat quit (Ping timeout: 265 seconds)
13:36:19om3gaI have issues with the memory management, seems I will have to use no GC at all
13:50:37FromDiscord<mratsim> In reply to @om3ga "I have issues with": what issues?
13:57:48*FromDiscord quit (Remote host closed the connection)
13:58:00*FromDiscord joined #nim
13:59:16om3gamratsim: https://forum.nim-lang.org/t/10243
13:59:32FromDiscord<Chronos [She/Her]> In reply to @om3ga "I have issues with": Is arc not suitable?
14:00:36FromDiscord<Chronos [She/Her]> In reply to @om3ga "<@570268431522201601>: https://forum.nim-lang.org/t": That seems unrelated...?
14:01:01om3gaChronos, unfortunately no. Growing heap holding is dangerous in my case
14:01:24om3gaoh sorry, wrong link
14:01:33om3gamratsim: https://forum.nim-lang.org/t/10248
14:01:35FromDiscord<Chronos [She/Her]> It's also possible to release memory back to the OS iirc, can't remember who talked about it
14:01:52om3gaChronos, please check the ling above
14:02:57FromDiscord<mratsim> In reply to @om3ga "<@570268431522201601>: https://forum.nim-lang.org/t": is your real final use-case with strings?
14:02:58om3gaChronos, it seems was me, but I was wrong. once I used properly sharedRam, all heap allocated inside the thread being hold by gc
14:03:05*PMunch quit (Quit: Leaving)
14:03:31FromDiscord<mratsim> like if heap is an issue, it's weird to use strings.
14:03:36FromDiscord<Chronos [She/Her]> In reply to @om3ga "Chronos, please check the": Ah hm
14:03:54om3gamratsim, it's just example. In real program there is a lot of stuff going
14:04:20om3gaobjects, seq[char]'s, ref seq[char]'s, ref obj
14:05:18FromDiscord<mratsim> In reply to @om3ga "<@570268431522201601>, it's just example.": that's why I'm asking, if you don't give use the real types we can tell you anything about memory management because memory management in Nim is per-type
14:05:23om3gaI did ref things to optimize gc, it saved a lot of ram (reduced usage from 21GB to 11.2), but still
14:05:42FromDiscord<mratsim> ref doesn't optimize, it stresses the GC more
14:06:07om3gamratsim: example code I posted on the forum recreates the issue
14:06:14FromDiscord<mratsim> it might remove copies but it only makes sense if you know if you want value or reference semantics
14:06:38FromDiscord<mratsim> The issue is that the code doesn't match what you want to do in the end and you didn't give use enough context
14:06:50FromDiscord<mratsim> why are you using threads?
14:06:55om3gamratsim, but it has same issue
14:06:58FromDiscord<mratsim> why do you use a shared table?
14:07:06FromDiscord<mratsim> doesn't matter.
14:07:16om3gashared table used because I have to share data between threads
14:07:36om3gaI doubt we have other option here
14:07:48FromDiscord<mratsim> what kind of relationship do your threads have? producer-consumer? are they long-running? is it scientific data? strings?
14:07:50om3gaand I don't want to use channel
14:08:10om3gamratsim, it's not related to the issue with GC
14:08:24om3gagc not returns back the allocated ram
14:08:26om3gato the os
14:08:56FromDiscord<mratsim> it does for large alloc, under a certain threshold it keeps it, like Java, Python, javascript and all GC-ed language
14:08:58om3gathe example code exactly recreates this issue
14:09:23om3gamratsim, 11.2GB of allocs, can be considered as large amount
14:09:32FromDiscord<mratsim> returning to the OS would slow down significantly small allocs/deallocs
14:09:33om3gaor you mean one large alloc?
14:09:45FromDiscord<mratsim> over a couble MB should be returned to the OS
14:09:51FromDiscord<mratsim> couple
14:09:57om3gamratsim, not returning alloc'd heap to the os can destroy working server
14:10:36om3gaI think you will agree, performance here is not the main thing
14:10:48*boxuser quit (Ping timeout: 265 seconds)
14:11:29FromDiscord<mratsim> In reply to @om3ga "<@570268431522201601>, not returning alloc'd": C++ or Rust would not return the allocated memory in this situation either
14:11:47om3gamy program processes the data from file, with intense alloc (dynamic seq[char]) It holds three times more heap than input file
14:11:51om3gathis is ridiculous
14:11:51FromDiscord<mratsim> seauences/vectors (which are what the tables are built on) never shrink
14:12:02FromDiscord<mratsim> they only grow in size.
14:12:19om3gamratsim, I understand that other collectors can not do that too
14:12:27*boxuser joined #nim
14:12:28om3gabut who needs such dynamic MM?
14:12:49om3gaGC should be not only fast, but secure too
14:13:11om3gafor example why there is not max heap limit option?
14:13:18om3gajava's GC has such
14:13:46FromDiscord<mratsim> just create your own container that counts the number of items and blocks if there is too much
14:13:59FromDiscord<mratsim> security is different
14:14:00om3gaalso in my personal opinion, some kin of forceCollectAndReturnToOs() proc should exist
14:14:22om3gamratsim, this is workaround not the solution
14:14:29om3gamratsim, secure == safe
14:15:14FromDiscord<mratsim> also how are you measuring the GC usage?โ†ตbecause in your link `size` is the number of items before you use `GC_fullCollect`
14:15:33om3gaimagine mission critical server where a lot of data processors work, and some process eats more than 2/3 of the ram?
14:15:55om3gamratsim: I measure Resident ram usage in OS
14:16:13om3gaall that explained in forum theme I opened
14:16:47FromDiscord<mratsim> In reply to @om3ga "imagine mission critical server": you use queues and channels with limited size and backpressure to slowdown the producer?
14:16:51om3ganone of existing GC's return back used chunks of ram
14:17:15om3gamratsim, I use standard lang tools only
14:17:39FromDiscord<mratsim> They do, I've been developping deep learning code that uses multiple gigabytes of RAM that was returned.
14:18:12FromDiscord<mratsim> In reply to @om3ga "<@570268431522201601>, I use standard": `import std/deque` will give you a queue that you can use to implement backpressure
14:18:15om3gamratsim, but I posted the case where GC not does that
14:18:51om3gamratsim, I don't want to use queues and other extra stuff in the real code
14:19:04FromDiscord<mratsim> In reply to @om3ga "<@570268431522201601>, but I posted": and your example lacks context because you also use threading and a shared table
14:19:19om3gacontext is clear
14:19:25om3gaI can explain here too
14:19:37FromDiscord<mratsim> In reply to @om3ga "<@570268431522201601>, I don't want": If you don't want to learn proper architecture and give context i can't help you
14:19:47om3gathread has seq[string], sharedRam used in global
14:20:00FromDiscord<mratsim> no, your real app doesn't use strings
14:20:17om3gaall that allocs remain even if I free shared ram and threads exits, even if I call GcFullCollect
14:20:19FromDiscord<mratsim> you use sharedTable which are explicitly mentioned has being discouraged and just an unblocker
14:20:32FromDiscord<mratsim> you use raw threads and don't explain why and what for
14:20:45*boxuser quit (Ping timeout: 240 seconds)
14:20:56om3gamratsim, my real app uses seq[char] and has the same issue with it
14:21:32om3gamratsim I use threads to achieve better performance of data processing in parallell
14:21:52FromDiscord<mratsim> what algorithm are you trying to parallelize? What kind of processing?
14:22:06om3gaI doubt re-arranging my code design will help to solve issues by freeing alloc'd chings to the os
14:22:13om3gafreeing == releasing
14:22:27om3gamratsim: still not related to the issue
14:22:39FromDiscord<mratsim> that's what you think
14:22:55FromDiscord<mratsim> do you know if your algorithm is memory bound or compute-bound?
14:22:57*boxuser joined #nim
14:23:26om3gamratsim: what you suggest? to match my processing to the possible workaround where GC will work little bit better?
14:24:35om3gaI think this is conterproductive
14:25:02FromDiscord<mratsim> What can I suggest, I have not enough data. I only know that you use SharedTable, which is the worst performance decision you can have for a multithreading algorithm
14:25:33om3gamratsim, you can try to solve example on the forum
14:25:54om3gabut I doubt such exists
14:26:20om3gaif it would exist, I believe Araq would mention it
14:26:56FromDiscord<mratsim> I'm not going to spend more time on your issues if you don't give me more context.โ†ตโ†ตI can help you on optimization, I can help you on multithreading, reducing memory usage, but I can't help you if you don't tell me what you're trying to do.
14:30:47om3gamratsim, I can tell that the issue is the same as in example provided on the forum
14:31:37om3gaI can't share my code, for some reasons, but the issue described couple of times will persist
14:37:55*beholders_eye joined #nim
14:39:25FromDiscord<mratsim> I'm not asking for the code, but the end problem you are trying to solve, the constraint and the approach you are taking.
14:39:31FromDiscord<!&luke> In reply to @spotlightkid "I'm on Manjaro and": Oh thx
14:40:24*krux02_ joined #nim
14:43:19om3gamratsim the flow of my code is absolutely the same. only there is many threads in parallel
14:43:49om3gatypes can differ, but the same sequences, and other stuff in heap
14:44:55om3gafor convinience, I use dynamic MM to not have all that pain with static buffers
14:45:13om3gaand it turns that this comvinience cost too much :)
14:46:35om3gastill, if you will manage to solve the issue with saving the flow used in example on the forum, it will solve all other possible issues too
14:48:17FromDiscord<chmod222> Does casting a pointer to a reference increase the reference count?
14:48:23FromDiscord<chmod222> I suppose not, but supposing isn't knowing sadly
14:49:27FromDiscord<mratsim> In reply to @chmod222 "Does casting a pointer": don't do it
14:49:40FromDiscord<chmod222> Well I have to
14:49:49FromDiscord<mratsim> the GC assumes specific things about references that don't hold for pointers and your program will crash
14:50:09FromDiscord<mratsim> you don't have to crash, there is another way
14:50:09FromDiscord<chmod222> I'm working with FFI so I have no choice but to subvert the GC temporarily
14:50:31FromDiscord<mratsim> no there is no need
14:50:54FromDiscord<mratsim> you can use destructors or finalizers if you want to ensure garbage collection
14:52:11FromDiscord<chmod222> The issue is not memory management, the issue is that with refs I cannot use dynamic dispatch
14:52:26FromDiscord<mratsim> for example if you wrap your pointer in a ref you can ensure it's freed when out of scope even if it's GPU mem: https://github.com/mratsim/Arraymancer/blob/e297e6d5dcad70f3a39c44d8c79e2bb171fc2bd6/src/arraymancer/tensor/backend/opencl_backend.nim#L34-L52
14:52:33FromDiscord<chmod222> ptr objects don't play well
14:52:55FromDiscord<Nerve> How much of the standard library is dependent on memory management being enabled? I've been able to write a fairly large application without touching any `ref`s or `ptr`s so I'm curious if it's really been necessary for `std`.
14:53:04FromDiscord<mratsim> the wrapped lib has dynamic dispatch or you want to add that on top?
14:53:24FromDiscord<mratsim> In reply to @Nerve "How much of the": everything that uses sequences or strings need memory management
14:53:28om3gain my opinion, ref shoild be less memory-vise expensive
14:53:57om3gait's like ponter that links to another pointer that links to the data
14:54:11om3gaand you have only one data allocation
14:54:16FromDiscord<mratsim> ref only points to the data directly, it's a single indirection
14:54:42om3gahmm, and ref ptr string?
14:55:18FromDiscord<mratsim> don't mix ptr and seq or strings and ref, only point to plain old data
14:55:24om3gaanyway if it points to the real data, then it;s beter
14:55:35om3gamratsim, but I can do that?
14:55:40om3gawhy I should not to do so?
14:55:41FromDiscord<mratsim> yes you can
14:56:01FromDiscord<chmod222> I'm wrapping Godot and Godot exposes its class hierarchy over FFI, so I need to generate a bunch of dummy classes that dispatch the correct pointers and yada yada, but the issue is that they expose virtual methods that I would like to actually expose as virtual methods and that cannot be done without ref because without ref I cannot use dynamic dispatch
14:56:30FromDiscord<chmod222> I have done all the working around I can without ref by generated my own vtables but it's just terrible user experience
14:56:45FromDiscord<mratsim> because ptr means manual memory management, and seq and strings are automatically managed. The compiler will not take into account your `ptr` to evaluate those seq/strigns lifetimes and you will end up with a use-after-free
14:56:48FromDiscord<chmod222> So I want to get actual references working
14:56:48FromDiscord<Nerve> In reply to @mratsim "everything that uses sequences": But Andreas already confirmed to me that seqs and strings, when not allocated via a ref, are basically just stack pointers to the heap memory; so when the stack frame pops the memory should be freed. So I guess, does it not deallocate immediately? It just leaves the reference for the memory manager to handle?
14:57:33FromDiscord<mratsim> In reply to @Nerve "But Andreas already confirmed": the stack frame frees the stack not the heap
14:57:59FromDiscord<chmod222> And Godot gives me the proper callbacks to notify me if I should increase or decrease my reference count, so in theory all is well
14:57:59FromDiscord<chmod222> So I just need to know if casting a pointer to a ref increases its reference count and need to compensate for that
14:58:18FromDiscord<mratsim> the compiler inserts a call to free it it it was the last reference or move it where it's needed before the function returns
14:58:42FromDiscord<mratsim> In reply to @chmod222 "So I just need": it doesn't and it's wrong and you'll get bugs
14:58:56*boxuser quit (Ping timeout: 246 seconds)
14:59:07FromDiscord<mratsim> In reply to @chmod222 "I'm wrapping Godot and": is it C++ or C?
14:59:07FromDiscord<Nerve> That's what I mean then, if the compiler frees the memory after the stack frame is popped, then it shouldn't require a GC or RC to clean up after it. If anything that's an optimization that should be guaranteed.
14:59:16FromDiscord<Nerve> (edit) "That's what I mean then, if the compiler frees the ... memory" added "heap"
14:59:46FromDiscord<mratsim> In reply to @chmod222 "I'm wrapping Godot and": If it's C you can emulate any dynamic dispatch with a closure tuple (function, env)
14:59:57FromDiscord<chmod222> It doesn't matter because I don't bind to actual class instances but a flattened C ABI
15:00:47FromDiscord<mratsim> In reply to @Nerve "That's what I mean": yes it is guaranteed
15:01:11FromDiscord<mratsim> it only involves the allocator, no MM/GC except for seq tagged `{.shallow.}`
15:02:10FromDiscord<Nerve> Right on. So I guess back to my original question, I guess I'm wondering just how much of the standard library has to be dependent on explicit heap allocation.
15:03:35FromDiscord<mratsim> sent a long message, see http://ix.io/4xBZ
15:05:06FromDiscord<Nerve> That's a pretty constrained subset of the standard library
15:06:57FromDiscord<mratsim> thing is, networking is a big chunk of interesting libraries.
15:06:59om3gathe problem with threads is also with mandatory usage of shared heap. You need somehow to share the data between the thread
15:07:44FromDiscord<mratsim> And go is popular in part due to its async/networking focus
15:08:10FromDiscord<mratsim> but you need workaround when that's not your interest (say numerical/scientific computing)
15:08:26FromDiscord<Nerve> I guess I should frame my question: I'm wondering how much of `std` needs memory management for embedded, without networking and without lots of dynamic data structures being thrown around. How much of `std` would a small-chip device have access to with GC/RC disabled?
15:08:47FromDiscord<Nerve> (edit) "for embedded," => "in an embedded context,"
15:09:11FromDiscord<mratsim> because their multithreading is IO first, because no generics, because `interface` are fine when your data is polymorphic most of the time (i.e. serialized for networking) but meh otherwise.
15:10:42om3gaUnpdate GoLang compiler, and it still returns /lib/x86_64-linux-gnu/libgo.so: undefined symbol: __go_init_main
15:11:01FromDiscord<mratsim> In reply to @Nerve "I guess I should": iirc there is a blog post about recommendations, and the #embedded channel and the awesome-nim section about embedded.โ†ตโ†ตAnd even though sequtils/strutils only use seq or strings, the way they use it introduces too much temporaries for embedded
15:11:04om3gaseems nim code points to the non existing symbol
15:30:50*FromDiscord quit (Remote host closed the connection)
15:31:03*FromDiscord joined #nim
15:32:47*zgasma quit (Quit: leaving)
15:49:08*lucasta quit (Ping timeout: 240 seconds)
15:51:53*oldpcuser quit (Remote host closed the connection)
15:57:28FromDiscord<windowsboy111> is nim 1.9.3 even a thing
15:57:56FromDiscord<windowsboy111> this can't get more confusing https://media.discordapp.net/attachments/371759389889003532/1115670922221846629/apPSqHL.png
16:01:00*boxuser joined #nim
16:01:23FromDiscord<Kermithos> In reply to @windowsboy111 "this can't get more": afaik its the current dev version
16:03:22FromDiscord<windowsboy111> interesting
16:03:29FromDiscord<windowsboy111> I can't find the tag for it
16:04:22NimEventerNew thread by Ivansete: Nim library interoperability with other GC languages (NodeJs, Golang), see https://forum.nim-lang.org/t/10251
16:06:16FromDiscord<Kermithos> In reply to @windowsboy111 "I can't find the": the version should be defined hereโ†ตโ†ตhttps://github.com/nim-lang/Nim/blob/2e4ba4ad93c6d9021b6de975cf7ac78e67acba26/lib/system/compilation.nim
16:06:29FromDiscord<Kermithos> (edit) "hereโ†ตโ†ตhttps://github.com/nim-lang/Nim/blob/2e4ba4ad93c6d9021b6de975cf7ac78e67acba26/lib/system/compilation.nim" => "hereโ†ตโ†ตhttps://github.com/nim-lang/Nim/blob/devel/lib/system/compilation.nim"
16:06:49FromDiscord<windowsboy111> :O
16:11:34FromDiscord<sOkam!> In reply to @windowsboy111 "is nim 1.9.3 even": 2.0rc2 version was accidentally published to choosenim as stable. that's when that got introduced
16:13:15FromDiscord<windowsboy111> In reply to @sOkam! "2.0rc2 version was accidentally": I see
16:19:05*beholders_eye quit (Ping timeout: 246 seconds)
16:19:58*junaid_ quit (Remote host closed the connection)
16:20:31*boxuser quit (Ping timeout: 240 seconds)
16:28:54*cedb joined #nim
16:30:06*beholders_eye joined #nim
16:47:38*rockcavera joined #nim
16:54:10FromDiscord<System64 ~ Flandre Scarlet> Is there a way to turn an array of bytes into a string?
17:04:22FromDiscord<voidwalker> maybe in a few years: https://github.com/nim-lang/Nim/issues/14810
17:07:49*ntat joined #nim
17:12:37*beholders_eye quit (Ping timeout: 268 seconds)
17:12:38FromDiscord<juan_carlos> In reply to @System64 "Is there a way": func that takes openArray[char] also takes string directly too, if thats what you need.
17:19:01FromDiscord<voidwalker> wouldn't it be nice to be able to have a separate incrementable int variable when running a for loop ? Without needing a pairs iterator
17:19:13FromDiscord<voidwalker> save 2 lines of code declaring and then incrementing it
17:21:07FromDiscord<juan_carlos> In reply to @voidwalker "wouldn't it be nice": `enumerate` ?
17:22:11FromDiscord<Chronos [She/Her]> In reply to @System64 "Is there a way": I'm trying to think of a way that doesn't involve casting aha
17:22:43FromDiscord<Chronos [She/Her]> Well, for super quick method
17:22:48FromDiscord<Chronos [She/Her]> But you can easily just do:
17:22:54FromDiscord<voidwalker> hm ok, didn't know of enumerate, but that takes importing std/enumerate, and it yield a tuple, which must be unpacked ;\
17:24:04FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/ksvhc
17:25:31FromDiscord<chmod222> You don't really need to unpack it yourself, what with the whole `for i, elem in enumerate(something)` thing
17:27:02FromDiscord<that_dude> I thought I read somewhere that you don't even need the enumerate part?
17:27:22FromDiscord<that_dude> I might be still asleep tho
17:27:52FromDiscord<that_dude> `for I, elem in thing`
17:27:57*cm_ joined #nim
17:28:20*cm quit (Ping timeout: 250 seconds)
17:28:20*cm_ is now known as cm
17:29:05FromDiscord<chmod222> That sounds fantastical and I will test it right now
17:29:23FromDiscord<chmod222> It absolutely works
17:29:32FromDiscord<chmod222> At least for string
17:29:56FromDiscord<chmod222> But it's defined for everything else as well, fancy that
17:30:53FromDiscord<that_dude> I jest tested it too lol. Never typing code on phone again
17:31:37FromDiscord<chmod222> I have quite some code to clean up then, I use it a few times in my project
17:31:47FromDiscord<that_dude> Actually, why does enumerate exist when that works?
17:31:57FromDiscord<chmod222> For custom Iterators I recon
17:32:14FromDiscord<that_dude> Ig
17:32:27FromDiscord<chmod222> It's not a magical property of for, system.nim just defines a couple of `iterator mpairs(a: var string): tuple[key: int, val: var char]` overloads
17:32:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @juan_carlos "func that takes openArray[char]": Bruhโ†ตWhen I write a seq of bytes...โ†ตI expect it to write it byte to byte, not a string representation of it https://media.discordapp.net/attachments/371759389889003532/1115694761999863808/image.png
17:32:59FromDiscord<that_dude> LOL
17:33:41FromDiscord<that_dude> Hope you don't need cast
17:34:15FromDiscord<chmod222> It did what you told it to, not what you meant
17:34:15FromDiscord<chmod222> Malicious compliance if I've ever seen it
17:35:06FromDiscord<that_dude> I would love to see a lang designed around malicious compliance
17:48:20*krux02_ quit (Remote host closed the connection)
17:48:33*krux02_ joined #nim
18:07:40*beholders_eye joined #nim
18:11:13FromDiscord<chmod222> I think that's C
18:12:02FromDiscord<chmod222> It will helpfully assume that once you triggered undefined behaviour it is free to completely ignore your invariants because nothing is real anymore
18:12:46FromDiscord<chmod222> Will it do so or will it wait until the perfect moment to do so? Who knows! That's part of the experience.
18:13:13*cedb quit (Quit: WeeChat 3.8)
18:19:29*beholders_eye quit (Ping timeout: 256 seconds)
18:43:52FromDiscord<dlesnoff> There this compilation of bad designs in programming languages in one programmin language https://m.youtube.com/watch%3Fv%3DvcFBwt1nu2U&ved=2ahUKEwio5cXxn6AhUEUKQEHX4UDa4QwqsBegQIERAE&usg=AOvVaw2h4wFDN3wHiuK2z3ExKkd2โ†ตโ†ตIt lacked malicious compliance though
18:47:41*ced2 joined #nim
18:47:45*ced2 is now known as cedb
19:15:42*oldpcuser joined #nim
19:37:45*beholders_eye joined #nim
19:45:30*ntat quit (Quit: Leaving)
20:05:18FromDiscord<voidwalker> how can I merge a literal json node made with % to another one ?
20:05:32FromDiscord<voidwalker> (edit) "to" => "with"
20:15:32FromDiscord<guttural666> any automatic way to find out what has to be public in a module and what doesn't have to be?
20:19:46FromDiscord<Elegantbeef> That makes 0 sense
20:19:52FromDiscord<Graveflo> In reply to @guttural666 "any automatic way to": that's not possible without knowing how the client code wants to use it
20:19:54FromDiscord<Elegantbeef> How does any automated tool know what's required to expose
20:20:11FromDiscord<Graveflo> just hide anything that would be bad if used from the outside. everything else public
20:20:59FromDiscord<guttural666> sure it does, check what internal other modules rely on proc X to be public, if that number is zero, it doesn't have to be public
20:21:51FromDiscord<Graveflo> thats not a good idea because you shouldn't me minimally public you should be minimally private
20:21:51FromDiscord<guttural666> In reply to @Graveflo "just hide anything that": obviously, but with heavy refactoring you might have a lot of stuff exposed that doesn't have to be
20:21:59FromDiscord<Elegantbeef> But what if it's like sequtils
20:22:08FromDiscord<Elegantbeef> Where all the procedures are utillities
20:22:21FromDiscord<Elegantbeef> You cannot automatically reason the accessibility of anything
20:22:32FromDiscord<Graveflo> wait why do you think something being public when it doesn't have to be is bad?
20:22:32FromDiscord<guttural666> strictly talking about the files in my project folder
20:23:01FromDiscord<guttural666> In reply to @Graveflo "wait why do you": potential collisions and LSP confusion
20:23:17FromDiscord<Elegantbeef> neither of those are reasonable
20:23:25FromDiscord<Elegantbeef> `import x except collision`
20:23:35FromDiscord<Elegantbeef> Lsp confusion makes 0 sense
20:23:37FromDiscord<Graveflo> yea I figured you would say that. I cant argue with that because its kinda true but you should instead adjust your import mechanisms and organization
20:23:39FromDiscord<guttural666> okay, then why not make everything public in the language by default
20:23:48FromDiscord<Graveflo> I wish they did
20:24:03FromDiscord<Elegantbeef> Cause accessibility controls implementation
20:24:04FromDiscord<Elegantbeef> You should only export the parts you want users to touch
20:24:08FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4xDB
20:24:34FromDiscord<Elegantbeef> void on the quest for making the most unreadable code
20:24:44FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=4xDB" => "https://play.nim-lang.org/#ix=4xDC"
20:24:45FromDiscord<guttural666> In reply to @Elegantbeef "You should only export": that is what I want and that is why I am asking if there are any ways to clean that up, apparently not
20:25:01FromDiscord<Elegantbeef> How can any tooling know what should be exported though is my question
20:25:17FromDiscord<Elegantbeef> Just cause a procedure isnt used does not mean it shouldnt be exported
20:25:19FromDiscord<voidwalker> Elegantbeef feel free to rewrite as long as it keeps the intent
20:25:37FromDiscord<Graveflo> he gave mechanics for it. Im sure that is not implemented anywhere guttual sry
20:25:42FromDiscord<guttural666> where-used analysis
20:25:58FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/p5wKO
20:26:13FromDiscord<Graveflo> It's hard enough to find a simple hack that makes everything public let alone conditionally across the scope of a project
20:26:21FromDiscord<Elegantbeef> That analysis fails to work on like 99% of code ๐Ÿ˜„
20:26:48FromDiscord<voidwalker> so it's not possible to keep the same syntax ? I'm willing to assing it to a variable if needed, but having two kinds of syntax for fields doesn't feel right :\
20:26:58FromDiscord<guttural666> In reply to @Elegantbeef "How can any tooling": tooling can look at the files in your project, detect that no file relies on proc X in module A being public -> doesn't have to be public
20:27:04FromDiscord<Elegantbeef> No clue I do not use json
20:27:16FromDiscord<Elegantbeef> Sure but that only works if you have 100% code coverage
20:27:26FromDiscord<voidwalker> I don't either, but this db lib I picked does, so I have no choice
20:27:27FromDiscord<guttural666> but it's fine was just asking out of curiousity
20:27:29FromDiscord<Elegantbeef> You might have a utility function that is public and only used conditionally
20:27:46*oldpcuser_ joined #nim
20:28:07FromDiscord<guttural666> then it would be required, anything that is compile time known to be potentially used is used
20:28:21FromDiscord<guttural666> anyway, not that important
20:28:31FromDiscord<Elegantbeef> To be clear I'm not dismissing the idea, just do not see how it'd actually work
20:28:41FromDiscord<Graveflo> so then before this check everything is public? because the binding rules would have to be greedy
20:28:46FromDiscord<guttural666> just like reference counting ๐Ÿ˜›
20:28:54*oldpcuser quit (Killed (NickServ (GHOST command used by oldpcuser_)))
20:28:58*oldpcuser_ is now known as oldpcuse
20:29:00*oldpcuse is now known as oldpcuser
20:29:40FromDiscord<Graveflo> youll get your name clashing problem internally before what is to be make public or private is hashed out by the automation
20:29:42FromDiscord<Elegantbeef> That just doesnt seem sensible any utillity library would make procedures private
20:30:06FromDiscord<Elegantbeef> I feel like exporting is an explicit action anyway
20:30:15FromDiscord<guttural666> In reply to @Elegantbeef "That just doesnt seem": I know you can reason about this yourself obviously ๐Ÿ˜„
20:30:42FromDiscord<guttural666> forget it ๐Ÿ˜„
20:31:10FromDiscord<Elegantbeef> Well the reason I can reason it, is cause I'm the one defining the public API of my code
20:32:42FromDiscord<Graveflo> What I don't understand is that what guttural is saying... could would albeit with weirdness on a personal use only project, but for public facing APIs I dont understand why private is implicit and pbulic is explicit. Shouldn't a public facing API be able to handle most of its procs and data being manipulated without it shitting the bed? It just encourages bad APIs
20:33:10FromDiscord<Graveflo> (edit) "would" => "work"
20:33:31FromDiscord<guttural666> think private, const, compile time if possible etc. is de way
20:35:02FromDiscord<guttural666> (meaning should be the default)
20:39:52FromDiscord<Graveflo> well I agree with compile time and const but private is more like "dont touch that its not finished" or namespace pollution I guess. Pollution should be solved with module org though. It is what it is though, there isn't anything special that I know of that can manipulate how we define access control
20:41:03FromDiscord<guttural666> I think it also has compiler implications in terms of performance doesn't it?
20:41:33FromDiscord<Graveflo> no it doesn't matter if things are public or private. The compiler takes only what it needs. Except when you use method
20:41:39FromDiscord<Graveflo> those always get compiled no matter what
20:41:48FromDiscord<guttural666> ah okay
20:47:11FromDiscord<Elegantbeef> Nim has dead code elimination, only what is used is what is included
20:48:08FromDiscord<Graveflo> Is library compilation an exception to this?
20:48:16FromDiscord<Elegantbeef> Nope
20:48:19FromDiscord<Elegantbeef> `exportC` is used
20:48:26FromDiscord<Graveflo> oh that makes sense
20:48:35FromDiscord<Graveflo> you just saved me 20 min of testing thx
20:48:53FromDiscord<guttural666> In reply to @Elegantbeef "Nim has dead code": that is what I was thinking of
20:49:32FromDiscord<Elegantbeef> Who knew `nm -gD` took 20 mins ๐Ÿ˜›
20:49:53FromDiscord<Graveflo> you underestimate my dumbness
20:50:30FromDiscord<Elegantbeef> You were going to use `std/dynlib`?
20:50:48FromDiscord<Graveflo> I was going to try everything under the sun bc I dont know what I'm doing
20:55:38FromDiscord<guttural666> does slicing and passing that to an OpenArray ever make sense if you're just reading if you don't need the specific bounds from outside? doesn't seem to save anything in terms of memory or performance
20:56:48FromDiscord<guttural666> for regex it would matter I guess
20:56:57FromDiscord<guttural666> maybe not even that
20:57:11FromDiscord<Graveflo> slicing a string?
20:57:15FromDiscord<guttural666> yeah
20:57:37FromDiscord<Graveflo> I think there are no-copy slices and copy slices
20:59:25FromDiscord<Graveflo> it should be more performant to pass an immutable view to the outside as opposed to copying the slice
20:59:35FromDiscord<huantian> you said the word openarray and beef didn't immediately answer? the bridge must be down or something
20:59:49FromDiscord<Graveflo> or copying the slice-of I guess the slice is technically its own entity
20:59:54FromDiscord<guttural666> ๐Ÿคฃ
21:01:31FromDiscord<Graveflo> also make sure you are measuring performance in release mode and you can always test stuff like that by looking at the addresses.... except for the fact that `seq` and `string` can make it a little difficult to get their actual heap address but I have complained enough about that here
21:20:02FromDiscord<voidwalker> `Exception message: assignment to discriminant changes object branch`
21:20:33FromDiscord<voidwalker> what could be wrong ? All I am doing is set `result.kind = list` on the first page of a proc that returns that object type
21:22:02FromDiscord<Graveflo> what type is `result` what type is `list`
21:22:04FromDiscord<voidwalker> and that proc is called by another that returns a seq[] of that object type
21:22:34FromDiscord<voidwalker> `list` is enum, result is object variant with kind of that enum type
21:23:15FromDiscord<Graveflo> okay I've never seen this error before but typically `kind` is reserved for an enum that often interacts with an "object variant" after the variable is initialized it cannot change it's type
21:23:40FromDiscord<voidwalker> ohhh maybe result initialized it to a default (the first enum) ?
21:24:01FromDiscord<Graveflo> You have to set that when it's being initialized
21:24:01FromDiscord<voidwalker> although this would be a bug i'd say
21:24:21FromDiscord<voidwalker> well it is created in the proc.. and I set it on the first line, where I get the error
21:24:46FromDiscord<voidwalker> it doesn't have to be a ref, no ?
21:25:10FromDiscord<Graveflo> no that is the main advantage to that form I believe: https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
21:25:39FromDiscord<voidwalker> ` echo result.kind` : media
21:25:52FromDiscord<voidwalker> hah so it does initialize it with the first enum.. how do I get around this ?
21:26:28FromDiscord<Graveflo> in the example I posted there is a `var n = Node(kind: nkFloat, floatVal: 1.0)` replace `kind` with what you want when the object is being created
21:26:40FromDiscord<voidwalker> so I can't use result ?
21:27:15FromDiscord<Graveflo> yea that might not work because it's going to be setup in a place you can't control
21:27:33FromDiscord<Graveflo> or at least I dont know how to control `result`s initialization
21:28:09*xet7 quit (Remote host closed the connection)
21:28:13FromDiscord<Graveflo> and ofc you can just say `result = n`
21:29:14FromDiscord<voidwalker> object types should generally start with capital letter, right ?
21:30:00FromDiscord<Graveflo> yes
21:39:18*oldpcuser quit (Quit: "mIRC sucks because is non-free software" Richard Stallman)
21:40:57*xet7 joined #nim
21:42:19*oldpcuser joined #nim
21:43:14FromDiscord<Elegantbeef> @huantian\: i was too busy doing real life things
21:43:39FromDiscord<Elegantbeef> Fixing a free electric mower, watering my plants, playing with my dogs, all more important than openArrays! ๐Ÿ˜›
21:44:28FromDiscord<Elegantbeef> Right this is what `toOpenArray` isโ†ต(@Graveflo)
21:48:49*oldpcuser quit (Remote host closed the connection)
21:51:14*oldpcuser joined #nim
22:03:12*oldpcuser quit (Remote host closed the connection)
22:03:54*oldpcuser joined #nim
22:15:25*beholders_eye quit (Ping timeout: 240 seconds)
22:20:35FromDiscord<guttural666> shouldn't the compiler be able to deduce the type on the right? it's find to do it on the left https://media.discordapp.net/attachments/371759389889003532/1115767217410293890/image.png
22:27:03FromDiscord<Graveflo> missing a `:` ?
22:28:15FromDiscord<Graveflo> I also dont see how it finds it on the left
22:33:13FromDiscord<guttural666> don't think so case doesn't need a : (although it accepts writing one weirdly enough)
22:34:01FromDiscord<Graveflo> idk it just seems like `move` isnt a valid name in `TokenKind` I dont see how the left implies that it is
22:34:05FromDiscord<guttural666> this will force it and this compile, but sometimes the compiler will see this which is very strange https://media.discordapp.net/attachments/371759389889003532/1115770615937384538/image.png
22:34:24FromDiscord<Graveflo> oh then move is shadowed
22:34:31FromDiscord<guttural666> maybe move shadows something ๐Ÿ˜ฎ
22:34:59FromDiscord<Graveflo> yea thats actually a documented thing. I dont remember why I read it. I just use pre enums all the time anyways
22:35:09FromDiscord<Graveflo> but yea you can only do that when there is no conflict of names
22:35:51FromDiscord<guttural666> I always {.pure.} my enums but maybe there is something in std/re or std/strutils
22:36:22FromDiscord<Elegantbeef> `move` is a keyword
22:36:25FromDiscord<Elegantbeef> Or a procedure i guess
22:36:34FromDiscord<Elegantbeef> It forces movement of memory
22:37:02FromDiscord<guttural666> interesting, probably is system move https://nim-lang.org/docs/system.html#move%2CT
22:37:20FromDiscord<guttural666> compiler error was shite tho
22:37:47*void09 quit (Remote host closed the connection)
22:38:55FromDiscord<guttural666> https://media.discordapp.net/attachments/371759389889003532/1115771828103807056/image.png
22:38:55FromDiscord<guttural666> meh
22:39:02*void09 joined #nim
22:39:26FromDiscord<Graveflo> yea not great but it did tell you that move is a proc
22:39:44FromDiscord<guttural666> I guess it did
22:39:50FromDiscord<Graveflo> I put this in `nim.cf` for projects to get more info `declaredLocs:on`
22:40:01FromDiscord<Graveflo> (edit) "`nim.cf`" => "`nim.cfg`"
22:40:22om3gamratsim: scroll at the bottom of the page https://forum.nim-lang.org/t/10248
22:40:54FromDiscord<guttural666> In reply to @Graveflo "I put this in": what does that do?
22:42:16FromDiscord<Graveflo> in some instances itll tell you where things are. I might have told you that `move` was declared in `system.nim`
22:42:27om3gamratsim, understanding how OS works is more important than high level abstractions. So I was right in this case.
22:42:47FromDiscord<Graveflo> and I add to local `.cfg` not the global one for that. You can also just use a CLI switch if you have a good memory
22:59:33FromDiscord<Elegantbeef> @Verdagon Zoom just Pr'd to your site, but if you have any question about Nim concepts, feel free to ask ๐Ÿ˜›
23:01:37FromDiscord<Elegantbeef> Wait it was an issue ๐Ÿ˜„
23:01:38FromDiscord<Zoom> I was so rude I haven't even PR a fix, just complained.
23:01:38FromDiscord<Elegantbeef> Eh no big deal I got them to update to reference how Nim does cyclical collection in one of their posts
23:01:39FromDiscord<Elegantbeef> Always fun to talk about this stuff
23:01:43FromDiscord<Zoom> I don't think a public apology written by me would have been merged.
23:01:59FromDiscord<Zoom> (I'm kidding)
23:03:33FromDiscord<Elegantbeef> "I was wrong and promise to never be wrong again"
23:19:43*oldpcuser quit (Remote host closed the connection)
23:20:07*oldpcuser joined #nim
23:20:10*oldpcuser quit (Remote host closed the connection)
23:20:31*oldpcuser joined #nim
23:32:16*jmd_ joined #nim
23:33:19*krux02_ quit (Quit: Leaving)
23:55:30*derpydoo joined #nim