<< 22-04-2022 >>

00:07:12*duuude joined #nim
00:12:09*nsyd joined #nim
00:23:41*vicfred quit (Quit: Leaving)
01:14:11*neurocyte8614492 quit (Ping timeout: 272 seconds)
01:27:39*duuude quit (Ping timeout: 260 seconds)
01:28:12*duuude joined #nim
01:34:17FromDiscord<!Patitotective> šŸ’€ https://media.discordapp.net/attachments/371759389889003532/966874550325346304/ImAppImage.mp4
01:34:36FromDiscord<!Patitotective> screenshots dont like to be displayed
01:37:03FromDiscord<Elegantbeef> `drawAboutModal` taking in a `var App` is fucking comical
01:38:47FromDiscord<!Patitotective> :[ i-i forget about that things
01:39:00FromDiscord<!Patitotective> i need nimwarning
01:39:15FromDiscord<impbox [ftsf]> hmm async http client, seems that requires manually closing it after use yeah or it'll leak files?
01:39:45FromDiscord<Elegantbeef> Yep
01:39:50FromDiscord<impbox [ftsf]> aha
01:40:08FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VKD
01:40:18FromDiscord<Elegantbeef> Ok cool
01:40:28FromDiscord<Elegantbeef> Dont know why you brought up you were
01:41:17FromDiscord<!Patitotective> i was going to reply to imbox but he sent a message so the message went up and i clicked reply to your message hehe
01:41:33FromDiscord<impbox [ftsf]> thanks
01:49:33FromDiscord<ajusa> In reply to @Rika "anyone know a lib": huh I'm looking for one too
01:50:04FromDiscord<ajusa> but looks like there are three abandoned implementations of reactivex in Nim, which is a bit of a shame as I'm sure macros would make it very fast
01:50:10FromDiscord<ajusa> like zero-functional
02:32:05NimEventerNew Nimble package! hpx - Nim wrapper for STE||AR HPX, a high performance computing (HPC), distributed memory runtime system, providing parallelism and asynchronous global address space support., see https://github.com/ct-clmsn/nim-hpx/
02:42:14*duuude quit (Remote host closed the connection)
02:48:48*arkurious quit (Quit: Leaving)
02:49:21*duuude joined #nim
02:50:05*nsyd quit (Quit: WeeChat 3.5)
03:35:32FromDiscord<Arathanis> when nimble is set in --localdeps mode how do you get imports to resolve?↵↵I am using VS Code and when nim is in `--localdeps` mode all the installed dependency imports fail in VS code with "cannot open file" error and builds do not work
03:38:16FromDiscord<Elegantbeef> did it create a folder named `nimbledeps`?
03:38:25FromDiscord<Elegantbeef> and are all the deps in it
03:39:20FromDiscord<Arathanis> yes
03:40:25FromDiscord<Elegantbeef> What module isnt it capable of finding?
03:40:43FromDiscord<Arathanis> winim
03:41:15FromDiscord<Arathanis> but i tested with `fusion` as well
03:41:15FromDiscord<Elegantbeef> Is it in the nimbledeps folder and is it properly cloned?
03:41:47FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/966906637870825512/unknown.png
03:44:32FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3VKL
03:45:59FromDiscord<Arathanis> how do you know they aren't interleaving? do the ones in your actual codebase have some kind of output?
03:46:12FromDiscord<impbox [ftsf]> yeah the real one have output
03:47:05FromDiscord<impbox [ftsf]> the logs show only "doing thing 1" repeating
03:47:25FromDiscord<huantian> Don’t await in onReady
03:47:45FromDiscord<huantian> Or rather don’t await them individually
03:48:03FromDiscord<huantian> I think you can use `all()` to await both at the same time
03:48:25FromDiscord<Arathanis> ohhh duh
03:48:25FromDiscord<huantian> Or just asyncCheck them
03:48:30FromDiscord<Arathanis> `await` is the same as `waitFor`
03:48:42FromDiscord<Arathanis> it thinks you want to wait for that to finish
03:49:00FromDiscord<huantian> Not exactly the same but yes
03:49:01FromDiscord<impbox [ftsf]> yeah, i want them to run interleaved not wait for each other
03:49:04FromDiscord<Arathanis> sent a code paste, see https://paste.rs/Mj3
03:49:21FromDiscord<Arathanis> so it goes into first, hits the event loop
03:49:28FromDiscord<Arathanis> but you dont get to second until first finishes
03:49:55FromDiscord<impbox [ftsf]> yep, i understand, but i'm not sure how to avoid that
03:49:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3VKM
03:50:07FromDiscord<impbox [ftsf]> i'll try that
03:51:02FromDiscord<Arathanis> i think you can also use `callSoon`
03:51:10FromDiscord<Arathanis> but `asyncCheck` causes exceptions when things blow up
03:51:30FromDiscord<Elegantbeef> Also can just hold onto the futures and pass them up
03:51:46FromDiscord<Arathanis> uhg i dont want to have to use global dependency installation to make this work, what is going on with this lol
03:51:50FromDiscord<huantian> In reply to @Arathanis "but `asyncCheck` causes exceptions": Which is good
03:52:04FromDiscord<impbox [ftsf]> asyncCheck seems to be working \o/
03:53:15FromDiscord<Arathanis> In reply to @huantian "Which is good": agreed, though i bet there are edge cases where ignoring failure is fine or preferrable
03:53:40FromDiscord<huantian> Ignoring failure is fine if you know you’re doing it
03:53:47FromDiscord<Arathanis> yes
03:55:43*slowButPresent quit (Quit: leaving)
04:11:17FromDiscord<Arathanis> seems like it might just be VS Code's extension but i dont remember it behaving this way before
04:58:10FromDiscord<Rika> In reply to @ajusa "huh I'm looking for": damn thats an old reply lmao, i'm no longer really in need for onw
05:05:28*duuude quit (Ping timeout: 246 seconds)
05:06:12*duuude joined #nim
06:00:44FromDiscord<JSONBash> Is anyone using an arbitrary precision library for decimals?
06:03:34FromDiscord<Rika> anything to aid in bitops for arbitrary bytes? ex: array[T, byte] or so
06:04:10FromDiscord<Yardanico> In reply to @Rika "anything to aid in": there was a PR (rejected) trying to add that lib to stdlib, but the code wasn't really ready and there was no RFC
06:04:13FromDiscord<Yardanico> you can still look at it though'
06:04:24FromDiscord<Yardanico> if I find it
06:04:26FromDiscord<Elegantbeef> It's just wrappings over `openArray[byte]`
06:04:30FromDiscord<Yardanico> yeah
06:04:36FromDiscord<Elegantbeef> I mean there the nwas a RFC and it was rejected šŸ˜„
06:04:36FromDiscord<Yardanico> but I assume this is what rika needs
06:05:01FromDiscord<Yardanico> @Rika https://github.com/archnim/bseq/blob/main/bseq.nim if you want to take a llok
06:05:02FromDiscord<Yardanico> (edit) "<@259277943275126785>" => "@Rika" | "llok" => "look"
06:51:51FromDiscord<Yardanico> https://github.blog/changelog/2022-04-21-private-profiles/ since htis chat isn't active right now anyway :)
06:51:55FromDiscord<Yardanico> "Users now have the ability to turn their GitHub profile ā€œprivateā€, which gives users controls over features that share user data across the GitHub platform. "
06:52:51FromDiscord<Yardanico> (edit) "htis" => "this"
06:54:08FromDiscord<Elias> How does nim use mingw? I am figuring out how to use futhark on windows and have tried to install this thing https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/LLVM-13.0.1-win64.exe. And also installing clang with pacman in the MSYS terminal that came with mingw
06:54:27FromDiscord<Elias> (edit) "mingw" => "mingw. But it can still not find libclang"
06:54:29*PMunch joined #nim
06:54:29FromDiscord<Yardanico> In reply to @Elias "How does nim use": nim doesn't use mingw specifically, it just calls whatever `gcc` you have in PATH by default
06:54:46FromDiscord<Yardanico> In reply to @Elias "How does nim use": have you added the bin folder of your installed LLVM to your PATH?
06:55:30FromDiscord<Elias> Apart from checking "Add to path for all users" I have just added the `lib` folder manually
06:55:40FromDiscord<Elias> (edit) "Apart from checking "Add to path for all users" ... I" added "(with the installer)"
06:56:18FromDiscord<Yardanico> you've seen https://github.com/PMunch/futhark#installation right ?
06:56:22FromDiscord<Yardanico> passL
06:56:38FromDiscord<Yardanico> i can try myself to see if I can install it via this I guess
06:57:09FromDiscord<Elias> Actually no, just added it to my nimble file once I heard about it. Then I got problems...
06:57:15FromDiscord<Elias> Should probably read it
07:01:02FromDiscord<Yardanico> yeah it just works, I installed LLVM with add to path option, then just `nimble install --passL:"-LC:\LLVM\lib\" futhark` (i installed LLVM to C:\LLVM)
07:03:33FromDiscord<Elias> https://media.discordapp.net/attachments/371759389889003532/966957414740004884/unknown.png
07:04:04FromDiscord<Yardanico> try adding \ at the end
07:04:18FromDiscord<Yardanico> ah, the problem can also be due to Program Files, since there's a space in the name
07:05:19FromDiscord<Elias> hehe `nimble install --passL:'-L"C:\Program Files\LLVM\lib\"' futhark`
07:05:27FromDiscord<Elias> maybe?
07:05:37FromDiscord<Yardanico> i don't know, I don't use windows for development much
07:05:44FromDiscord<Elias> same
07:06:16FromDiscord<Elias> just want my project to build on it and then go back to linux when I am done at school
07:07:26FromDiscord<Elias> But do you get the same project structure errors?
07:08:58FromDiscord<Yardanico> yes, but those are _warnings_
07:09:18FromDiscord<Yardanico> it's due to how futhark repo is structured, nimble doesn't like when you don't follow its hierarchy
07:10:22FromDiscord<Elias> Ok
07:10:47FromDiscord<Elias> Either ill come up with some hack or force people to install it straight on C: or something
07:11:09FromDiscord<Elias> pyautogui perhaps...
07:15:56*rockcavera quit (Remote host closed the connection)
07:23:04FromDiscord<Phil> Out of curiosity, compared to just using HTML/CSS/JS, how much more cumbersome is using QT/GTK/whatever android uses?
07:25:27FromDiscord<Yardanico> it's not usually more "cumbersome", people just tend to use html/css/js nowadays because there are more people working with them
07:25:27FromDiscord<Phil> Given that I'm feasibly nearing completion of my backend within a couple months, I'm contemplating ideas for my next sideproject and building e.g. a native client for funsies could be interesting. Not that there'd be much of a point, it'd still be basically a webpage, but it would render really fast!↵However, if it's multiple times the effort to get stuff working, I'd likely reconsider because that wouldn't really sound like fun.
07:25:45FromDiscord<Yardanico> Qt has its own QSS that are quite similar to CSS
07:25:49FromDiscord<Yardanico> and scripting too
07:25:53*fredrikhr joined #nim
07:26:07FromDiscord<Yardanico> GTK has stylesheets as well, and you can write GTK apps in e.g. Python (same applies for Qt)
07:27:49FromDiscord<Phil> So you define elements still, style them with whatever CSS-analogue there is and attach procs to elements to make them interactive?
07:28:25FromDiscord<Yardanico> more or less, isn't that how almost any UI works?
07:29:03FromDiscord<Phil> I have no idea, I've only done webdev so I only know how HTML/CSS/JS works and can imagine how a more general abstraction of that would look like
07:29:17PMunch@Elias, I believe the path handling for Futhark on Windows is a bit broken (I don't have any Windows machines to test it on). Try to install LLVM to a path without spaces, that seems to help.
07:29:33FromDiscord<Yardanico> https://www.qt.io/product/qt6/qml-book/ch02-start-hello-world
07:29:47FromDiscord<Rika> In reply to @Isofruit "I have no idea,": XML + style sheets + general programming language
07:29:57PMunchOnce I can find someone on Windows who wants to help out those bugs should be really easy to fix..
07:30:07FromDiscord<Rika> Not even XML, just any mark up language
07:30:53FromDiscord<Yardanico> In reply to @PMunch "Once I can find": i'm on windows right now, if you have time now we can try
07:31:01FromDiscord<Yardanico> i'm trying to generate sciter bindings with futhar kon windows
07:31:03FromDiscord<Yardanico> (edit) "futhar kon" => "futhark on"
07:31:33FromDiscord<Yardanico> I couldn't really succeed with using tdm-gcc's includes - clang seems to fail when parsing them (in opir i mean)
07:31:41FromDiscord<Yardanico> now trying with clang's includes + windows sdk
07:31:46FromDiscord<Phil> Wait, QML? Do these things come with their own language ? Oof
07:31:55FromDiscord<Yardanico> of course, Qt is a really big thing
07:32:22FromDiscord<Yardanico> they even have their own compiler on top of C++ for Qt specific stuff, and the Qt library generally has tons of different modules
07:32:30FromDiscord<Yardanico> because a lot of it was written before C++ stdlib got those
07:33:01FromDiscord<Phil> So basically, assuming I made a native application using, e.g. QT, that would basically be its entirely own separate project which wouldn't really interface with nim, wouldn't it?
07:33:23FromDiscord<Phil> (edit) "nim," => "nim as it would use its own language,"
07:33:25FromDiscord<Yardanico> you can make Qt apps with Nim, but not the truly native Qt way
07:33:34FromDiscord<Yardanico> https://github.com/filcuc/nimqml
07:33:40FromDiscord<Phil> Would it be nim compiling to qml?
07:33:45FromDiscord<Yardanico> no?
07:34:12FromDiscord<Yardanico> https://github.com/levovix0/DMusic for example this is made with nimqml + nim
07:34:30PMunchYardanico, that would be great! I'm trying to find the issue for Windows trouble
07:34:33FromDiscord<Yardanico> ah wait maybe actually not nimqml
07:35:07FromDiscord<Yardanico> they're actually wrapping a small part of qt it seems like https://github.com/levovix0/DMusic/blob/master/src/qt.nim
07:35:14FromDiscord<Yardanico> In reply to @PMunch "<@177365113899057152>, that would be": what issue specifically?
07:36:18PMunchYardanico, that is what I'm trying to find
07:36:41FromDiscord<Yardanico> well for example i don't know how to quote paths with spaces in `sysPath` on windows :P
07:36:50FromDiscord<Yardanico> since futhark doesn't quote them then passing to opir
07:36:56FromDiscord<Yardanico> i guess i can just add " myself in the string
07:37:06*mahlon quit (Ping timeout: 252 seconds)
07:37:16PMunchDamn it, now that I think about it it might've just been someone asking here on IRC
07:37:45PMunchBut yes, most of the issues are about escaping paths and how Futhark/Opir hands arguments around
07:38:13FromDiscord<Phil> I think I'll have to look at this when I get to it. From a glance over e.g. the qtl.nim or other nim files in the repo I don't quite get how the nim code and the qml code work together to build the frontend. Digging into that seems like it might need more than a cursory glance
07:38:27FromDiscord<Phil> (edit) "qtl.nim" => "qt.nim"
07:42:09FromDiscord<2F42BBA1> In reply to @Yardanico "https://github.com/levovix0/DMusic for example this": That's impressive damn
07:42:12*jmdaemon quit (Ping timeout: 250 seconds)
07:43:19PMunchHuh, never seen that, impressive indeed!
07:46:59FromDiscord<2F42BBA1> It would be nice to see differences between Python's API and Nim's API.
07:47:40FromDiscord<TryAngle> do ppl aside from haxscramper already use nimskull?
07:48:35FromDiscord<2F42BBA1> In reply to @TryAngle "do ppl aside from": I insatlled it yesterday on Linux
07:48:45FromDiscord<2F42BBA1> (edit) "insatlled" => "installed"
07:49:12FromDiscord<Predator> Just installed nim
07:49:14FromDiscord<TryAngle> (edit) "do ppl aside from haxscramper already use nimskull? ... " added "(not meant negative, just curious about the community size)"
07:49:56FromDiscord<2F42BBA1> If it will work good then I will keep it for now.
07:50:06FromDiscord<2F42BBA1> Look forward to Windows binaries for it.
07:50:12FromDiscord<Predator> Can I make a discord bot using Nim lol
07:50:19FromDiscord<TryAngle> In reply to @Predator "Can I make a": dimscord
07:50:20FromDiscord<Elias> In reply to @PMunch "<@390570241903689728>, I believe the": Yep, it works when I put it on C:
07:50:29PMunch@2F42BBA1, it's still close enough to Nim that it can be used with Nim libraries right?
07:50:42FromDiscord<TryAngle> In reply to @PMunch "@2F42BBA1, it's still close": just wanted to ask the same lol
07:50:44FromDiscord<Predator> In reply to @TryAngle "dimscord": Sounds cool
07:50:48PMunch@Predator, yup that's how I'm talking to you
07:50:55FromDiscord<Elegantbeef> Not all libraries will work it doesnt have async
07:51:02PMunchThrough a IRC <-> Discord bot
07:51:08PMunch@Elegantbeef, it doesn't have async?
07:51:17PMunchBut, async is just a macro?
07:51:20FromDiscord<Elegantbeef> Nope they stripped it out due to wanting CPS uses
07:51:29FromDiscord<TryAngle> what is cps?
07:51:32FromDiscord<Elegantbeef> used\
07:51:50PMunchAh right, so it would work if you used --import and supplied the Nim standard library async implementation?
07:51:57FromDiscord<Predator> In reply to @PMunch "@Predator, yup that's how": Very cool
07:52:00PMunch@TryAngle, Continuation Passing Style
07:52:10FromDiscord<2F42BBA1> In reply to @PMunch "@2F42BBA1, it's still close": Yeah. At least for my stuff it works.
07:52:23FromDiscord<Predator> I'm gonna try to make a discord bot in Nim
07:52:24FromDiscord<TryAngle> In reply to @PMunch "<@147447489316913152>, Continuation Passing Style": doesn't tell me much 🄺
07:52:35FromDiscord<Elias> In reply to @Yardanico "passL": But (trying to make stuff automatic) why does it not work when I put `--passL:"-LC:/LLVM/lib/"` in my nim.cfg file?
07:52:41FromDiscord<TryAngle> In reply to @Predator "I'm gonna try to": good luck šŸ‘
07:52:45FromDiscord<Predator> Thanks
07:52:46FromDiscord<2F42BBA1> In reply to @Predator "I'm gonna try to": Share the source code. I am shit at writing them xD
07:52:54PMunch@Elias, right, so Yardanico it seems the first issue is figuring out how to link to libclang :P
07:53:03FromDiscord<Predator> Haha sure, I've only gone past echo "hello world" but I'll get there
07:53:33FromDiscord<2F42BBA1> In reply to @Predator "Haha sure, I've only": I wrote simple stuff and a thing to calculate some stuff.
07:53:43FromDiscord<2F42BBA1> Nim is comfy than Rust.
07:53:43FromDiscord<Predator> Sweet
07:53:50FromDiscord<Elegantbeef> https://github.com/nim-works/cps/tree/master/docs#what-is-this-and-why-should-i-care
07:53:52PMunch@TryAngle, I just gave you some Google-feed, if you find a Google search bar you can feed it those words and it will grow magnificent search results
07:53:54FromDiscord<Elias> In reply to @PMunch "<@390570241903689728>, right, so Yardanico": How is it done now? Just directly with gcc?
07:54:02PMunch(Just be sure to water it and give it plenty of sun)
07:54:07FromDiscord<TryAngle> In reply to @PMunch "<@147447489316913152>, I just gave": hahhaha
07:54:07FromDiscord<TryAngle> sure
07:54:21FromDiscord<Elegantbeef> Or tryangle read my link
07:54:31FromDiscord<TryAngle> ok will do both ty 🄺
07:55:39PMunch@Elias, which nim.cfg? It is only Opir which needs libclang, once that is compiled you don't need to use passL any more
07:56:10PMunchYour project doesn't depend on libclang unless it's being built from source (and you can always ship the cache as well).
07:56:24FromDiscord<Elias> The one in my project root (laziness)
07:56:49PMunchYeah that one won't have any effect on the compilation of Opir (which is part of the Futhark package)
07:57:00FromDiscord<Elias> Aah
07:57:55PMunchBasically Futhark comes with a tool called Opir. Opir links to libclang and reads C files and spits out a JSON definition. Then Futhark (a Nim macro) reads this JSON output and generates Nim code.
07:58:07FromDiscord<Elias> sent a code paste, see https://play.nim-lang.org/#ix=3VLo
07:58:20PMunchWhen installing Futhark it will build Opir, and that's when it needs to link to libclang
07:58:25FromDiscord<Elias> In reply to @PMunch "Basically Futhark comes with": Ok, then I understand
07:59:11PMunchNimble build disables packages that aren't listed in the .nimble file. So in order to use Futhark you must list Futhark as a dependency to use nimble build.
07:59:56FromDiscord<Elias> So, if I understand. The problem is that libclang can be anywhere on a windows machine since it has no package manager. And therefore there needs to be installed and passed manually (for now)
08:00:08FromDiscord<Elias> (edit) "there" => "it"
08:00:14FromDiscord<Elias> (edit) "manually" => "manually?"
08:00:43FromDiscord<Elias> (edit) "So, if I understand. The problem is that libclang can ... be" added "(potentially)"
08:01:10PMunchYes
08:01:12PMunchKinda
08:02:20FromDiscord<TryAngle> so cps basically schrinks the stack to a more "linear" form instead of tree?↵and nimcps does that for u instead of thinking about that yourself?
08:02:40FromDiscord<Elias> In reply to @PMunch "Yes": Tried looking, but could not find a cli installer for llvm. If that existed it would be helpful for running stuff to predefined paths.
08:03:02PMunchOn Linux you have the LD_LIBRARY_PATH, which is the path where it will go and look for dynamic libraries. You (typically) install things with your package manager, and the dynamic libraries are placed in this folder and everything which wants to use that library can find it there. On Windows you just install things into semi-random folders and the loading technique is (to the best of my knowledge) a mix of anarchy and chaos.
08:03:20FromDiscord<Elias> In reply to @PMunch "On Linux you have": yep
08:03:44FromDiscord<Elegantbeef> Well it gives you a lot of power to represent more complex things relatively simply↵(@TryAngle)
08:04:07FromDiscord<TryAngle> and I read it is already in library form for nim as macros, why rewrite nim as a fork bc of that?
08:04:26FromDiscord<Elegantbeef> That's not the reason to fork nim
08:04:31FromDiscord<Elegantbeef> That's the reason to remove async from the stdlib
08:04:38FromDiscord<TryAngle> ah I see ok
08:04:53FromDiscord<Elegantbeef> They nimskull people pretty explicitly state why they're a fork
08:04:58FromDiscord<Elegantbeef> There is no mystery
08:05:21FromDiscord<Elias> What I have done so far is make a script that tries a nimble build (in the random case everything works with some preinstalled clang) and if (when) it fails, it downloads and run the llvm installer. After that I tried running `nimble install --passL:"-LC:\LLVM\lib\" futhark` from the script but had some escaping problems..
08:05:42FromDiscord<Elias> (edit)
08:06:02FromDiscord<Elias> (edit) "I tried running" => "it tries to run"
08:06:38FromDiscord<Elias> The problem is if someone does not install it in ``C:\LLVM`
08:06:47FromDiscord<Elias> (edit) "in" => "at"
08:06:52FromDiscord<Elias> (edit) "``C:\LLVM`" => "`C:\LLVM`"
08:06:52*Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected])
08:12:53FromDiscord<tandy> \:o
08:13:05FromDiscord<Elegantbeef> There's the response i've waited all day forr šŸ˜„
08:13:18FromDiscord<Elegantbeef> Bit of a slow burn that one
08:32:09*dtomato quit (Quit: Ping timeout (120 seconds))
09:15:18FromDiscord<Tanguy> To be fair, a big chunk of the async is actually in the compiler, not the stdlib (the closure iterator transformation)↵And it does have bugs / inefficiencies
09:16:02FromDiscord<Tanguy> Having a full macro (like CPS afaict) would be very nice, since we could improve it outside of the compiler release schedule
09:17:06PMunchOh sure, but I assume closure iterators haven't been removed from NimSkull?
09:17:22FromDiscord<Elegantbeef> No they've not been
09:17:50FromDiscord<Elegantbeef> Knowing them they'll consider making them stack allocators to try to make them faster
09:18:41FromDiscord<Tanguy> That seems a bit pointless (as far as async goes), since most async procedures will call other async procedures, so you have to use the heap
09:19:11FromDiscord<Elegantbeef> I mean closures al to gether
09:19:18FromDiscord<Elegantbeef> They've removed the stdlib's async macro
09:20:28FromDiscord<Elegantbeef> I've been toying with them recently and they've let me down a bit
09:20:46FromDiscord<Rika> Just like how they’ve been let down by Nim?
09:20:59FromDiscord<Tanguy> With nimskull or with closures?
09:21:07FromDiscord<Elegantbeef> Closures
09:21:41FromDiscord<Elegantbeef> I'm technically apart of Nimskull, though i've never actually used it's compiler
09:22:20FromDiscord<Elegantbeef> Eh rika i've got a few benchmarks and aside from me being dumb there are some oddities
09:22:45FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/966992444900130816/image.png
09:22:54FromDiscord<Elegantbeef> The latter one here is \~10% faster
09:23:05FromDiscord<Elegantbeef> But who the fuck wants to manually move iterators
09:23:22FromDiscord<Tanguy> Thanks to move?
09:23:37FromDiscord<Rika> If we’re talking about iterators then I’m assuming they’re gonna improve over time of course
09:24:01FromDiscord<Elegantbeef> Yea my hypothesis is it moves the iterator's environment which moves the ownership of the string instead of copying it
09:24:19FromDiscord<Elegantbeef> Well they're closure iterators šŸ˜„
09:24:30FromDiscord<Rika> That’s what I meant
09:24:49FromDiscord<Elegantbeef> Perhaps, it's odd that the Nim stdlib doesnt have a `asClosure` equivlent
09:25:16FromDiscord<Rika> You can always implement it as well no?
09:25:27FromDiscord<Elegantbeef> I mean i did implement it
09:25:33FromDiscord<Elegantbeef> It gives a lot of nice functionality
09:25:47FromDiscord<Tanguy> Yeah, in big async programs you spend half your time copying buffers to each async proc, a bit annoying↵But sink is supposed to work on closure iterators, no?
09:26:05FromDiscord<Elegantbeef> It does but it doesnt seem to work with the environment
09:26:22FromDiscord<Elegantbeef> I have to look into it more but the manual moving of iterators is faster
09:26:45FromDiscord<Elegantbeef> It's still slower than sequtils which is the real kick in the ribs
09:27:54FromDiscord<Elegantbeef> Something 2ms slower which is \~20% of the sequtils runtime with this benchmark
09:28:02FromDiscord<Elegantbeef> 9ms vs 11ms vs 12ms
09:28:36FromDiscord<Elegantbeef> Manual is 7ms, which is of course what my 0 cost `chain` macro also does šŸ˜„
09:29:08FromDiscord<Tanguy> Ok, too bad, I was expecting to good perfs with the new runtime in async world
09:29:30FromDiscord<Elegantbeef> I mean to be fair my example isnt really demonstrating any benefit of closure over other methods
09:31:10FromDiscord<Elegantbeef> Perhaps there's a way to encourage the move with nested iterators that my benchmarking isnt enabling
09:32:51FromDiscord<Elegantbeef> Alternatively there is a different cause to this issue i'm missing
09:33:27*dtomato joined #nim
09:38:14FromDiscord<2F42BBA1> I am bad at Nim :/↵Is there any way to get better at it?
09:38:39FromDiscord<2F42BBA1> Syntax is fine, but I can only write something simple.
09:39:34FromDiscord<Elegantbeef> Write more of it šŸ˜„
09:39:41FromDiscord<Elegantbeef> Ask questions here
09:39:54FromDiscord<Elegantbeef> Read the manual/forum/stackoverflow šŸ˜„
09:40:22FromDiscord<Elegantbeef> Then eventually you'll contribute to the compiler
09:41:37FromDiscord<Rika> That last point is highly unlikely
09:42:33FromDiscord<2F42BBA1> In reply to @Elegantbeef "Then eventually you'll contribute": I dpn't have a big brain.
09:42:45FromDiscord<Elegantbeef> Me either but i do it
09:42:59FromDiscord<2F42BBA1> I just use Nim so I can without less pain use WinAPI and write CLI software.
09:43:07FromDiscord<Rika> In reply to @Elegantbeef "Me either but i": Most people don’t want to
09:43:11FromDiscord<2F42BBA1> Though there are examples of GUI ones.
09:44:58FromDiscord<Tanguy> Finally found the comment I was looking for: https://github.com/nim-lang/RFCs/issues/16#issuecomment-626875867↵So with sink, it should not copy, AFAICT
09:45:20FromDiscord<Elegantbeef> I think with nested ones it still does
09:45:49FromDiscord<Elegantbeef> I might be wrong
09:46:35FromDiscord<Tanguy> Ohh, ok by nested you mean chained↵Yeah, probably
09:46:53FromDiscord<Elegantbeef> Yea in my above example it generates a single iterator in the end
09:47:34FromDiscord<Elegantbeef> so it's `data.items.asClosure.map.filter.map` which turns into a single `iterator: int`
09:48:42FromDiscord<Tanguy> Not familiar with the new runtime, but it looks to me like the move should be inferred, since you don't use them afterwards
09:48:52FromDiscord<Elegantbeef> You're right
09:49:03FromDiscord<Elegantbeef> Perhaps a bug, or me being dumb again
09:52:35FromDiscord<Elegantbeef> I was considering moving my mesh gen api to use closure iterators but given they're this much slower than inline iterators i guess i keep iterable for now
09:53:06FromDiscord<Elegantbeef> But anyway it's late so i'll stop talking about closure iterators for a bit šŸ˜›
09:59:24FromDiscord<2F42BBA1> https://media.discordapp.net/attachments/371759389889003532/967001670317928468/toIpsUGX21I3xQifjlz4obymZp02rzr0wlqKUglgDqu3GY23kGHETU8gsvi3O0q_nF04AcRzdNrr78v1-dlnqMG-.jpg
10:00:11FromDiscord<2F42BBA1> I should try TCC
10:00:21FromDiscord<2F42BBA1> Though it seems not maintained much
10:25:05*crameleon quit (Quit: I love you.)
10:35:13PMunch@2F42BBA1, why do you want to try TCC?
10:38:10*acidsys joined #nim
10:49:06FromDiscord<Knedlik> I’m trying to install nim on another computer, but after installing thru choosenim, my dependency installer says it can’t find the nim binary…. Any idea why?
10:51:20FromDiscord<Yardanico> antivirus?
10:52:06FromDiscord<Knedlik> The only thing I have on this potato is windows defender
10:54:35FromDiscord<Knedlik> And disabling virus prot doesn’t make it work
10:55:04FromDiscord<Rika> Check quarantined
10:56:31FromDiscord<Knedlik> Where even is that in defender
10:56:43FromDiscord<Rika> I don’t know I don’t use windows
10:57:13FromDiscord<Knedlik> Although nim.exe is in the .nimble/bin folder as normal
10:57:20PMunchsudo apt remove windows-defender
10:57:23PMunchOh wait..
10:57:39PMunchCan you run that file?
10:57:52PMunchAnd what dependency installer?
10:58:00FromDiscord<Rika> Did you put it in your path haha
10:59:13FromDiscord<Knedlik> I have both .nimble/bin and .nimble/bin/nim.exe in my path
11:00:01FromDiscord<Knedlik> And nim.exe does open up a console windows
11:00:04FromDiscord<Knedlik> (edit) "windows" => "window"
11:04:03FromDiscord<Rika> Restart the console?
11:04:23FromDiscord<Knedlik> > And what dependency installer?↵I made a dependency installer for my repo, basically a bunch of nimble installs
11:04:28FromDiscord<Knedlik> I did restart cmd
11:05:39NimEventerNew post on r/nim by 576f6e64657269: Can't seem to install Nim on Fedora 35. What am I doing wrong?, see https://reddit.com/r/nim/comments/u9c05q/cant_seem_to_install_nim_on_fedora_35_what_am_i/
11:06:55FromDiscord<Rika> So what happens exactly when you try running Nim in the command line
11:07:37FromDiscord<Knedlik> Hmm, when I try to use `—nim`, it says unhandled exception access is denied
11:08:47FromDiscord<Rika> Can you show the output
11:10:04FromDiscord<Knedlik> https://media.discordapp.net/attachments/371759389889003532/967019453445443644/unknown.png
11:10:17FromDiscord<Knedlik> Might it be because my user contains diacritics?
11:10:50FromDiscord<Rika> Yes
11:11:55*slowButPresent joined #nim
11:14:33FromDiscord<Knedlik> Would moving .nimble do it?
11:15:31FromDiscord<Knedlik> Because after doing that and changing the path, it still throws that error
11:20:44PMunchFirst try this
11:20:57PMunchOpen a command line, cd to the folder where you have installed nim
11:21:04PMunchRun `./nim.exe --version`
11:23:33FromDiscord<Knedlik> sent a long message, see http://ix.io/3VM6
11:29:16PMunchOkay so Nim (the devel version) is there and executable
11:30:02FromDiscord<TryAngle> does something like this exist / make sense in nim? Maybe with arc?↵https://docs.rs/drop_bomb/latest/drop_bomb/
11:30:15PMunchThe last error you shared was truncated, does that come from running Nimble?
11:30:39FromDiscord<Yardanico> In reply to @TryAngle "does something like this": what does this specifically do?
11:31:07FromDiscord<TryAngle> In reply to @Yardanico "what does this specifically": Basically a way to be sure when the destructor of that object is called the object is already marked that it may be destroyed / is finished
11:31:40PMunchI don't know if anything like that already exists, but it should be possible to create with a destructor
11:31:49FromDiscord<TryAngle> the example shows this with a buffered writer↵the writer must be closed before it gets destroyed
11:31:56FromDiscord<Yardanico> In reply to @TryAngle "Basically a way to": it is possible with an extra field in the object
11:32:10FromDiscord<Yardanico> In reply to @TryAngle "the example shows this": why won't it just get closed automatically?
11:33:27FromDiscord<TryAngle> In reply to @Yardanico "why won't it just": wdym exactly?
11:33:44FromDiscord<TryAngle> that it closes itself when the destructor is called?
11:33:49FromDiscord<Yardanico> yes?
11:34:00FromDiscord<Yardanico> why close explicitly if it can close itself automatically on scope exit
11:34:48FromDiscord<TryAngle> this works in this case but there are cases where this does not work
11:35:21PMunchSomething like this: https://play.nim-lang.org/#ix=3VMa
11:35:24FromDiscord<2F42BBA1> In reply to @PMunch "@2F42BBA1, why do you": Why not? I like to experiment with compilers
11:35:26FromDiscord<TryAngle> the example I would use it for basically is a parser that is made "via markers"
11:35:57PMunch@2F42BBA1, oh sure, I just wanted to make sure it wasn't for some poor reason. But experimentation is always fun :)
11:36:33FromDiscord<2F42BBA1> One time I experimented with milking performance from sample Flask app.
11:36:42FromDiscord<TryAngle> In reply to @PMunch "Something like this: https://play.nim-lang.org/#ix=": thanks
11:37:29PMunchYardanico, because you can have an error during flush, so they want that to be handled before it is destroyed. Of course in Nim that would just raise an exception which could then be caught just the same
11:37:30FromDiscord<2F42BBA1> I got gunicorn and pypy installed and on other hand same stuff but with Python 3.8 I think? In my experiment I found that Flask with PyPy was winning in performance.
11:37:39PMunchBut I guess it might be useful in other scenarios
11:37:55FromDiscord<Yardanico> In reply to @2F42BBA1 "One time I experimented": with nim compiled with tcc with -d:danger ?
11:38:03FromDiscord<Yardanico> i mean it makes sense for tcc
11:38:35PMunchWell -d:danger is still slower to compile than debug right?
11:38:40FromDiscord<2F42BBA1> In reply to @Yardanico "with nim compiled with": The language itself compiled via tcc? Never tried that xD
11:38:49FromDiscord<Yardanico> i mean nim with tcc
11:38:53FromDiscord<2F42BBA1> Oh
11:38:56PMunchMaybe a mode which just enables the dangerous features but none of the optimisations :P
11:39:08FromDiscord<Yardanico> nim compiles to C which is then compiled to native binaries with c compilers
11:39:09PMunchOh right
11:39:22FromDiscord<Yardanico> In reply to @PMunch "Well -d:danger is still": -d:danger just disables all runtime safety checks, otherwise it's equal to -d:release
11:39:25PMunchYou wanted a super fast Nim compiler to use with TCC
11:39:43FromDiscord<2F42BBA1> i need to make an utility with wNim and winim. So I can make a simple WinGui app
11:39:54PMunchI was thinking of making a typical Nim compile faster before feeding it to TCC
11:40:04PMunchAnd in that case -d:danger would just slow the compile down
11:40:29FromDiscord<Yardanico> @PMunch if you think about it, actually maybe not
11:40:34FromDiscord<Yardanico> because nim itself doesn't do many optimizations
11:40:48FromDiscord<Yardanico> instead with -d:danger a lot of runtime safety checks, etc are disabled so nim doesn't have to generate them
11:41:02FromDiscord<Yardanico> you just have to remove the -O3 flag that is implied with -d:danger so the C compiler doesn't take long to compile the file
11:41:14FromDiscord<TryAngle> @Yardanico it is basically another "safety" check the code works correctly
11:41:49FromDiscord<TryAngle> but I'm not sure, when are destructors being called in nim?
11:42:03FromDiscord<Yardanico> when something gets out of scope or gets refcount == 0
11:42:17FromDiscord<Yardanico> but nim destructors aren't guaranteed to only run once for one object instance, so you need to check if the object was destroyed yourself
11:42:47FromDiscord<TryAngle> In reply to @Yardanico "but nim destructors aren't": I don't need that aspect only check if the object was "destroyed safely"
11:43:01FromDiscord<Yardanico> i still don't know what that really means
11:43:16FromDiscord<TryAngle> In reply to @Yardanico "but nim destructors aren't": arc is more deterministic in that aspect right?
11:43:21FromDiscord<enthus1ast> it also depends on refc or arc/orc, in my tests arc/orc calls them quite timely, while the old refc took a moment
11:43:24FromDiscord<Yardanico> no, i was talking about arc specifically
11:43:32FromDiscord<TryAngle> oh ok
11:43:44FromDiscord<Yardanico> and yes, refc is not guaranteed to run destructors right after scope exit
11:43:56FromDiscord<Yardanico> since it's more of a traditional GC in the way it works
11:44:12PMunchHuh, ARC doesn't only call them once?
11:44:18PMunchThat might cause me some trouble..
11:44:24FromDiscord<enthus1ast> refc also did not call the destructor at all if you application quites too fast \:)
11:44:42FromDiscord<Yardanico> In reply to @PMunch "Huh, ARC doesn't only": yeah
11:45:59FromDiscord<Rika> In reply to @Yardanico "yeah": Why?
11:47:51FromDiscord<Yardanico> In reply to @Rika "Why?": not sure, but i think it has to do with objects that also get moved, etc
11:47:57FromDiscord<Yardanico> but i can't give a precise answer
11:48:22FromDiscord<TryAngle> @Yardanico https://github.com/mun-lang/mun/blob/25156ebf1cef960cd1015510c5c5ba2b75a1382f/crates/mun_syntax/src/parsing/grammar/expressions.rs#L55↵this is an example from a programming language that is made in rust.↵Because there are a lot of recursive calls and different functions sometimes m.complete() might be forgotten to be written, so a destructor like this is a great additional safety check
11:48:37FromDiscord<TryAngle> (edit) "@Yardanico https://github.com/mun-lang/mun/blob/25156ebf1cef960cd1015510c5c5ba2b75a1382f/crates/mun_syntax/src/parsing/grammar/expressions.rs#L55↵this is an example from a programming language ... that" added "parser"
11:48:56FromDiscord<Yardanico> well, as I said, you can do the same in nim, just check if the object was destroyed in the destructor, and if it didn't, show an error or something
11:48:57FromDiscord<TryAngle> (edit) "written," => "written or written in wrong place etc.,"
11:49:27FromDiscord<TryAngle> ye pmunch linked a great example how to do this, was not sure how to work wtih destructors in nim and how deterministic they are
11:49:47FromDiscord<Rika> They are deterministic when used with ARC
11:49:49FromDiscord<Yardanico> yes
11:50:03PMunch(and ORC)
11:50:04FromDiscord<Rika> What does it mean to be ā€œslightly deterministicā€
11:50:05PMunchI assume
11:50:25PMunch60% of the time it works every time
11:50:37FromDiscord<Yardanico> In reply to @Rika "What does it mean": ?
11:51:02FromDiscord<Rika> He asked ā€œhow deterministicā€ as if it were a gradient
11:51:11FromDiscord<Rika> Is determinism a gradient or black and white?
11:51:20FromDiscord<Yardanico> for me it just sounded like a normal question
11:51:21FromDiscord<Rika> Can you be partially deterministic? What would that mean?
11:51:26FromDiscord<Yardanico> "how deterministic" - deterministic or not
11:51:45FromDiscord<Yardanico> in this specific case :)
11:51:50FromDiscord<Yardanico> In reply to @Rika "Can you be partially": yes, this is true for ORC actually btw
11:51:52FromDiscord<Rika> I guess I just wouldn’t word it that way
11:52:05FromDiscord<Yardanico> in ORC with ref objects destructor can be called later than just scope exit
11:52:08FromDiscord<Yardanico> because of how ORC works
11:52:13FromDiscord<Rika> In reply to @Yardanico "yes, this is true": I wouldn’t mix ā€œpartiallyā€ with ā€œsometimesā€
11:52:19FromDiscord<Yardanico> but it's generally still better than with refc
11:52:47FromDiscord<TryAngle> well I worded it like that because determinism being a gradient may be possible in this case no? I have no clue, so I open worded it
11:53:10FromDiscord<Rika> I also don’t know
11:54:27FromDiscord<TryAngle> look what crazy things were done with Java or Go gcs, no clue how nim's gc works aside from ref counting
11:55:17FromDiscord<Yardanico> In reply to @TryAngle "look what crazy things": with refc it's also very "interesting" :)
11:55:23FromDiscord<Yardanico> stack scanning
11:55:37FromDiscord<Yardanico> with ARC it's destructors that get injected, move semantics, and refcounting, nothing else
11:55:49FromDiscord<Yardanico> with ORC you get an additional algorithm on top of ARC that deals with cycles for refs
11:56:33FromDiscord<Yardanico> if you haven't read them yet, you can go and see https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html and https://nim-lang.org/blog/2020/12/08/introducing-orc.html
11:56:36*duuude quit (Ping timeout: 240 seconds)
11:57:18*duuude joined #nim
11:58:13FromDiscord<TryAngle> In reply to @Yardanico "if you haven't read": already read that but now rereading that again.. why is the whole thing in a try finally? why not just put it at the end regardless?
11:58:26FromDiscord<Yardanico> In reply to @TryAngle "already read that but": so that in case of an exception stuff still gets cleaned up
11:58:43FromDiscord<TryAngle> !
11:58:43FromDiscord<Yardanico> otherwise you'll leak memory on exceptions
11:58:44FromDiscord<TryAngle> true
12:00:07FromDiscord<TryAngle> oh you wrote that article o_O
12:00:15FromDiscord<TryAngle> good article thanks
12:00:36FromDiscord<Yardanico> thanks, but others also helped, especially with grammar :)
12:01:54FromDiscord<2F42BBA1> boehm gc is a good one
12:02:58FromDiscord<Yardanico> maybe, but I think almost no one uses it for Nim anymore :)
12:03:05FromDiscord<Yardanico> i don't even know if destructors work with boehm :P
12:03:20FromDiscord<2F42BBA1> Jus
12:03:54FromDiscord<2F42BBA1> Just we can try to get example code and profit
12:04:03FromDiscord<2F42BBA1> We will see if it works or not
12:04:38FromDiscord<Yardanico> i just don't see why use boehm if refc (if you want battle-tested over the years) or orc (newer, better, etc :P) are already there
12:05:22FromDiscord<2F42BBA1> Boehm is maintained still tho
12:05:46FromDiscord<Yardanico> yes, but so is orc šŸ¤”
12:06:02FromDiscord<Yardanico> nim also has support for Go GC btw, for when you want to closely interface with Go code
12:08:13FromDiscord<2F42BBA1> In reply to @Yardanico "yes, but so is": orc is stable now?
12:08:23FromDiscord<Yardanico> "stable" is a broad definition :)
12:08:38FromDiscord<Yardanico> it still has bugs, and not the default, but for the majority of tasks it's stable, yes
12:10:19FromDiscord<2F42BBA1> In reply to @Yardanico "it still has bugs,": I had quite shit experience with it, so that's why i sticked with Boehm.
12:10:33FromDiscord<Yardanico> whatever works best for you I guess
12:10:38FromDiscord<2F42BBA1> Kinda
12:13:26FromDiscord<2F42BBA1> I wish Nimskull had Windows support.
12:14:38NimEventerNew Nimble package! excelin - Create and read Excel purely in Nim, see https://github.com/mashingan/excelin
12:16:04FromDiscord<Yardanico> In reply to @2F42BBA1 "I wish Nimskull had": it has almost no differences compared to mainline Nim in relation to ORC
12:19:59*blackbeard420 joined #nim
12:33:05FromDiscord<Knedlik> In reply to @PMunch "The last error you": Yes, nimble install
12:37:27FromDiscord<jmgomez> sent a code paste, see https://paste.rs/JrM
12:38:09FromDiscord<Yardanico> sent a code paste, see https://paste.rs/gK7
12:39:08FromDiscord<jmgomez> yes, I was wondering if that would work if not what's the utility of having it in from of object in the declaration?
12:39:21FromDiscord<Yardanico> this will of course owrk
12:39:22FromDiscord<Yardanico> (edit) "owrk" => "work"
12:39:44FromDiscord<jmgomez> Im not referring to the alias but to the import as ptr object
12:39:58PMunchImport as ptr object?
12:40:14FromDiscord<jmgomez> yes, it's allowed by the compiler
12:40:25PMunch@Knedlik, and what package are you trying to `nimble install`
12:40:30FromDiscord<jmgomez> if it doenst work as I exposed, why is it allowed?
12:40:36FromDiscord<jmgomez> I mean, what's the utility of it
12:40:44PMunchAnd does the Nimble directory exist and is writeable?
12:41:06PMunch@jmgomez, `import as ptr object` is definitely not allowed in Nim
12:41:59PMunchWhat exactly is the code you're trying to use?
12:42:46FromDiscord<Knedlik> Nible directory does exist, but for some reason I can’t mark it as writeable?
12:42:48FromDiscord<jmgomez> hmm code is fine with it, the compiler only complains when trying to link
12:43:50FromDiscord<jmgomez> because it doesnt detect it as a ptr but as something else and the names mangled but it does seem to be an allowed expression
12:45:00PMunch@jmgomez, the code is definitely not fine with it: https://play.nim-lang.org/#ix=3VMq
12:45:06FromDiscord<jmgomez> I just rollback then changes I did and will go with @Yardanico suggestion
12:45:27PMunchYou still haven't actually told us what you're trying to do..
12:45:32FromDiscord<jmgomez> In reply to @PMunch "<@726017160115126333>, the code is": ohh I was using it like so
12:46:04FromDiscord<Knedlik> So I ran CMD as admin and it worked… simplest solutions at work again
12:46:11PMunchOh I see, it's the bridge messing up..
12:46:16FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3VMr
12:46:24PMunchYour code snippets aren't sent to IRC -_-
12:46:51FromDiscord<Yardanico> :(
12:46:52PMunch@Knedlik, you probably installed with administrator and that is now the only user allowed to use the files or something like that
12:46:54FromDiscord<jmgomez> In reply to @jmgomez "I think I did": and expecting to autogenerate an alias which again is not a problem that it doesnt work like that. But it does compile
12:46:58FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/967043834573881404/unknown.png
12:47:07FromDiscord<jmgomez> ouch
12:48:05FromDiscord<jmgomez> without the quote it was: "type UFunction {.importcpp: "UFunction", inheritable, pure, header: "UObject/Class.h".} = ptr object"
12:48:15PMunchYeah I got it open in Matrix now
12:49:12PMunchThat code will only work if you always have to deal with `UFunction*`
12:49:32PMunchAnd even then it probably won't work quite right
12:49:53PMunchYou shouldn't tell Nim that something is a pointer if it isn't a pointer, that will only make it spit out code that isn't valid
12:50:15FromDiscord<jmgomez> thats the case I can deref when not but it does not export the objects as proper pointers
12:50:26PMunchNim doesn't know what UFunction is, that is why you have to tell it. If you lie to the Nim compiler it will trust you and generate weird code
12:51:06FromDiscord<jmgomez> Yes, that I know
12:51:12PMunchYou should always just describe the C/C++ code when using `importc.*`
12:51:18FromDiscord<Knedlik> So dependencies are okay-ish… it for some reason can’t install nake
12:51:32PMunchWell apparently not since you tried to tell it something that isn't a pointer is a pointer :P
12:51:56PMunch@Knedlik, nake is super old, it might just be broken on new Nim versions
12:52:25PMunchOh huh, apparently it was committed to 3 months ago
12:52:32PMunchSo maybe it's still up to date then
12:52:43FromDiscord<jmgomez> I mean if I use it as a pointer everywhere it should not matter isnt it?
12:52:46FromDiscord<Knedlik> That’s bad, I’m pretty sure nim-godot bindings require it
12:53:06PMunch@jmgomez, yes it will
12:53:29PMunchBecause whenever you use it Nim will generate code as if it was a pointer, and since it isn't that code will be incorrect
12:53:52PMunch@Knedlik, no I had a look at it and it seems to still be up to date
12:54:00PMunchWhen was the error when you tried to install it?
12:54:41FromDiscord<Knedlik> Stdlib_dollars.nim.c: invalid argument
12:54:59PMunch@jmgomez, what you do in this case is first describe accurately what the C/C++ type is, then you create an alias in Nim if you want to make it more ergonomic.
12:55:20PMunch@Knedlik, that seems like a C compiler bug
12:55:51PMunchWhich could be caused by your username, although it could be something else
12:55:53FromDiscord<jmgomez> yes, that's what Im doing now but it's a bit confuse that nim doesnt treat it like a pointer to something if it's
12:58:34PMunch@jmgomez, not quire sure what you mean
12:58:46PMunchIf you importc and call it ptr object Nim will treat that as a pointer
12:59:09PMunchBut Nim doesn't know whether it is right or wrong, it just trust that you know what you're doing
12:59:20PMunchSo if you lie about types it does the wrong thing
12:59:40PMunchWhich is part of the reason I wrote Futhark
12:59:50FromDiscord<jmgomez> I tried to export it afterwards via FFI and got a linker problem. However it did work fine if I just set the ptr in the function declaration (as opposite to in the object)
13:00:04PMunchFocus on just telling Nim exactly what C types are, then I can wrap those into more comfortable types in Nim afterwards
13:01:14FromDiscord<jmgomez> Does Futhark works with C++ at all? (even if it required tweaking afterwards?)
13:01:15PMunchA recent project I did with Futhark: http://ix.io/3VMu/nim
13:01:25PMunchNot really
13:01:34PMunchIt only reads C headers
13:01:56PMunchBut if you have a C header to a C++ library then you should be fine
13:02:11FromDiscord<mori> sent a code paste, see https://paste.rs/Ta5
13:02:27FromDiscord<jmgomez> In reply to @PMunch "A recent project I": looks good
13:02:36FromDiscord<mori> how can i concatenate strings at compile time?
13:02:40PMunchE.g. something like this would work just fine I believe: https://github.com/gtoubassi/femtozip/blob/master/cpp/libfz/src/femtozip.h
13:02:44PMunch@mori, `&`
13:02:47FromDiscord<jmgomez> In reply to @PMunch "But if you have": not the case, it's some part of UE that Im binding
13:03:18FromDiscord<jmgomez> It shouldnt be too much anyways, the idea is to bind the minimum necessary and the generate types using ue reflection system
13:03:37FromDiscord<mori> In reply to @PMunch "@mori, `&`": am i not doing just that?
13:03:43PMunch@mori, https://play.nim-lang.org/#ix=3VMv
13:03:49FromDiscord<Rika> sent a code paste, see https://paste.rs/KCw
13:03:51PMunchYour for loop is not run on compile-time
13:03:52FromDiscord<mori> oh...
13:04:07PMunchSo the `i` isn't available on compile-time, and hence can't be used for staticExec
13:04:10FromDiscord<mori> just got into nim, few minutes ago
13:04:21FromDiscord<mori> somehow its hard to find relevant information
13:04:26FromDiscord<mori> im googling compile time loops in nim
13:04:49FromDiscord<mori> spent 5 minutes and couldn't find that static keyword/block
13:05:00PMunch@mori, in general what you would do is place them in a procedure and mark that with the {.compileTime.} pragma, or use them from a macro
13:05:40FromDiscord<mori> tried searching here too https://nim-lang.org/docs/tut1.html
13:05:46FromDiscord<mori> In reply to @PMunch "@mori, in general what": i see, thank you
13:06:30FromDiscord<enthus1ast> also stuff that is assigned to const is compiletime↵(@mori)
13:06:45FromDiscord<enthus1ast> const foo = 10 + 20
13:08:22*arkurious joined #nim
13:08:54PMunch@mori, something like this for example https://play.nim-lang.org/#ix=3VMw
13:09:24PMunchThat macro creates aResult and bResult which are the result of running `a --option` and `b --option` respectively
13:10:01PMunch@mori, in general compile-time execution isn't considered a "Tutorial 1" topic
13:11:01FromDiscord<SirOlaf> Good news, this kinda does nothing https://github.com/nim-lang/Nim/pull/19717
13:11:14PMunchPart 3 has a lot more detail on compile-time execution and macros: https://nim-lang.org/docs/tut3.html
13:11:50PMunch@SirOlaf, does nothing?
13:12:08FromDiscord<SirOlaf> I'm trying to use a stream at compiletime
13:12:16FromDiscord<SirOlaf> But it insists on using prepareMutation in the vm
13:12:23FromDiscord<SirOlaf> That PR should have fixed it
13:13:04PMunchAnd you're sure that you have a version which includes that fix?
13:13:17PMunchnim --version should contain a git hash
13:13:39FromDiscord<SirOlaf> Does not contain a git hash
13:14:00FromDiscord<SirOlaf> But is version 1.7.1 and compiled at 2022-04-22
13:14:02PMunchWhat does it contain then?
13:14:22PMunchCompilation date doesn't really matter, I can compile an 0.13.0 today and it still wouldn't have that fix :P
13:14:35FromDiscord<SirOlaf> Well yeah, but I used choosenim
13:14:38FromDiscord<SirOlaf> That should just work
13:14:43PMunchWell..
13:14:53PMunchchoosenim devel will grab the latest nightly
13:15:26PMunchAnd it might be prevented from building for some reason
13:15:34PMunchThat's why I wanted you to verify the version
13:15:36FromDiscord<SirOlaf> No, looks pretty recent
13:15:44FromDiscord<SirOlaf> https://github.com/nim-lang/nightlies/releases/tag/2022-04-22-devel-bb839029d5065bcd8367661802bf04e1e7eebb58
13:15:47FromDiscord<SirOlaf> This references the newest commit
13:17:00FromDiscord<SirOlaf> And I can verify that it is that build because I added an echo into streams.nim
13:17:22PMunch@SirOlaf, I tried to run your test case for the issue on the latest devel and it works fine here
13:18:07FromDiscord<SirOlaf> Did you run with arc
13:18:16FromDiscord<SirOlaf> Because this is a arc bug
13:18:33PMunchAh, I did not
13:18:41PMunchCan confirm that it does indeed crash with ARC
13:19:27FromDiscord<Solitude> epic test
13:19:40FromDiscord<Solitude> why the ci was green then
13:20:01FromDiscord<SirOlaf> Is compiler even tested with arc
13:20:15FromDiscord<SirOlaf> Or stdlib in this case
13:23:21PMunchIt doesn't appear so
13:23:43FromDiscord<Solitude> lol
13:25:24FromDiscord<SirOlaf> Alternative fix also doesn't work because nimscript is not defined, so that's pretty cool
13:30:22FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3VMD
13:31:38PMunch@SirOlaf, better to put these comments on the issue/PR
13:31:51FromDiscord<SirOlaf> True
13:32:01PMunchThey quickly get lost if you only share them here and the right people doesn't see them
13:33:53FromDiscord<SirOlaf> Well, at least I can compile now. Kinda wild how often the same thing can fail
13:57:54*PMunch quit (Quit: Leaving)
14:04:17FromDiscord<TryAngle> I'm curious how does nim generate the C code? May somebody link me to the module?
14:04:38FromDiscord<TryAngle> I looked for 10 min but I seem to be too stupid to find lol
14:06:47FromDiscord<Yardanico> In reply to @TryAngle "I'm curious how does": check the files that start with "ccg" in the compiler folder
14:07:04FromDiscord<Yardanico> and cgen.nim of course
14:07:05FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/967063999520833576/unknown.png
14:07:07FromDiscord<Yardanico> those
14:07:11FromDiscord<ratapenado> Hello, is there somewhere a roadmap of the planned features or libraries ? Not something too technical
14:07:21FromDiscord<Yardanico> In reply to @ratapenado "Hello, is there somewhere": not really, especially not for libraries
14:07:37FromDiscord<Yardanico> there's https://github.com/nim-lang/RFCs/issues/437 for nim itself
14:10:22FromDiscord<ratapenado> Thanks!
14:20:13FromDiscord<d4rckh> favorite gui library?
14:29:08*rockcavera joined #nim
14:29:08*rockcavera quit (Changing host)
14:29:09*rockcavera joined #nim
14:31:11*jmdaemon joined #nim
14:32:32FromDiscord<Zoom> Depends on your needs. But be conservative with your expectations in any case. Last time I checked, if you need something super simple asap, NiGui worked fine.↵(@d4rckh)
14:35:18FromDiscord<d4rckh> currently trying nimx
14:36:19*duuude quit (Ping timeout: 240 seconds)
14:39:28FromDiscord<TryAngle> In reply to @Yardanico "check the files that": Thanks 😊
14:41:17FromDiscord<d4rckh> nimx's docs are top
14:41:19FromDiscord<d4rckh> (edit) "top" => "amazing"
14:44:17*pro joined #nim
14:58:30*v9fk quit (Remote host closed the connection)
15:12:55*v9fk joined #nim
15:30:22FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3VR2
15:34:09FromDiscord<Knedlik> Hey guys, there continues my journey in pushing through errors… Why am I getting `Can’t load font data/ttf/Nasa21.ttf: Library not initialized` and `Can’t load image data/gfx/BtS-Background.png: Invalid renderer` when trying to load font and image respectively?
15:36:43FromDiscord<TryAngle> In reply to @Knedlik "Hey guys, there continues": what library u use?
15:36:53FromDiscord<Knedlik> Nimgame2
15:37:13FromDiscord<Knedlik> Which uses SDL for rendering afaik
15:37:54FromDiscord<SirElephant> just out of curiosity, is Andreas Rumpf German?
15:38:46FromDiscord<TryAngle> In reply to @Knedlik "Nimgame2": did u init the scene and made a newTextureGraphic?
15:39:25FromDiscord<Knedlik> I’m pretty sure I did
15:39:46FromDiscord<Knedlik> Yes, I did
15:40:09FromDiscord<TryAngle> is also the direction correct?↵like first the init than the image loading?↵I had that issue in a similar library once and struggled šŸ™ƒ
15:41:21FromDiscord<Knedlik> What? I have the image initial loading in data.nim, which is executed before the scene init, because scene init relies on data.nim in order to use those loaded variables
15:41:50NimEventerNew thread by Jmgomez: C++ binding variadic template, see https://forum.nim-lang.org/t/9122
15:42:06FromDiscord<spoon> is the image path in the same location as the executable?
15:42:11*fredrikhr quit (Quit: Disconnecting)
15:42:38FromDiscord<Knedlik> No, data is parallel to src as per nimgame tutorial
15:42:50FromDiscord<Knedlik> (Data the folder)
15:42:53FromDiscord<spoon> ah.
15:44:32FromDiscord<TryAngle> In reply to @Knedlik "What? I have the": hmm nimgame is first initing the scene and then load the image in all their demos
15:45:19FromDiscord<Knedlik> If by load you mean variable.load(), then not in the bounce tutorial
15:46:18FromDiscord<Knedlik> Although, I’m only 100% sure about fonts
15:47:18FromDiscord<Knedlik> And I’m also getting Can’t render nil font
15:47:35FromDiscord<TryAngle> In reply to @Knedlik "If by load you": https://github.com/Vladar4/nimgame2/blob/afd289aefd84aa4f89435f5fa0306da62f2023cc/demos/demo7/mainscene.nim#L34
15:47:59FromDiscord<TryAngle> they even discard it šŸ¤”
15:49:13FromDiscord<Knedlik> That’s weird, because the tutorial is completely different
15:53:18FromDiscord<TryAngle> In reply to @Knedlik "That’s weird, because the": hmm their tutorials are 5 years old
15:53:22FromDiscord<TryAngle> maybe they changed
15:54:46FromDiscord<TryAngle> but true, their tutorials are different to their demos that's sus
15:55:43FromDiscord<Knedlik> Yep, your suggestion to change the order worked
15:56:21FromDiscord<TryAngle> šŸ‘
16:14:59FromDiscord<spoon> aren't `slurp`/`staticRead` supposed to return a string? at least according to the docs, i'm getting `but expression 'bg' is of type: template (a: GVec234[bg.T]): GVec2[bg.T]`, even using the `$` proc
16:17:11FromDiscord<Rika> whats the code?
16:18:20*neceve joined #nim
16:18:58FromDiscord<spoon> actually, i think it's because i'm using `static:`, how do i properly do this?
16:18:59FromDiscord<spoon> actually, i think it's because i'm using `static:`, how do i properly do this?
16:19:23FromDiscord<spoon> home internet died oops, cant copy paste
16:26:24FromDiscord<TryAngle> In reply to @spoon "home internet died oops,": Germany šŸ˜‚?
16:28:14FromDiscord<spoon> In reply to @TryAngle "Germany šŸ˜‚?": nah, just my equipment
16:30:56FromDiscord<spoon> solved by using `const`, using `static:` just spammed my console with like every method from every library when i tried to print a string from there
16:32:16*vicfred joined #nim
16:39:23*mahlon joined #nim
16:53:26*xet7 quit (Remote host closed the connection)
17:00:25FromDiscord<codic> Given an enum indexed array[E, string] so basically a sort of key value pair, how do I check if say, the array contains a value corresponding to E.x?
17:00:30FromDiscord<codic> (edit) "E.x?" => "E.EnumMember?"
17:00:58FromDiscord<Rika> arrays will always have a value corresponding to all enum members
17:01:09FromDiscord<Rika> it may just be the default value though šŸ™‚
17:01:19FromDiscord<Rika> so if you need "unset by default" use options
17:02:51FromDiscord<codic> oh true
17:02:54FromDiscord<codic> oh well
17:02:55FromDiscord<codic> ugh
17:02:59FromDiscord<codic> pain
17:17:59FromDiscord<kevin> Anyone know if there is a Nim library to take packet captures from an interface?
17:18:12FromDiscord<kevin> Similar to https://github.com/google/gopacket/blob/master/pcapgo/capture.go (except this is in Golang)
17:18:35FromDiscord<kevin> Only found this: https://github.com/PMunch/nim-pcap which is for parsing pcaps, not for taking them
17:27:41*duuude joined #nim
17:43:48FromDiscord<konsumlamm> In reply to @Rika "so if you need": @codic or just use a table instead
18:02:21FromDiscord<codic> Yeah I figured out a way to do it without using either (not that specific thing, but ultimately achieves the same behavior)
18:02:32FromDiscord<codic> I just didn't want to change my code too much lol
18:02:35FromDiscord<codic> Feeling lazy
18:05:35*xet7 joined #nim
18:36:45*vicfred quit (Quit: Leaving)
18:51:12FromDiscord<Knedlik> Hey guys, any idea why a texture graphic doesn’t show in nimgame, alternatively a good tutorial on how to use texture graphics?
18:51:31FromDiscord<Knedlik> (edit) "doesn’t" => "wouldn’t"
19:17:26*Gustavo6046 joined #nim
19:59:16FromDiscord<Knedlik> So I’m not sure how, but I fixed it
20:01:36FromDiscord<Knedlik> Is there a proper and safe way to wait a set amount of time in Nim?
20:05:49FromDiscord<!Patitotective> https://nim-lang.org/docs/os.html#sleep%2Cint ?
20:06:23FromDiscord<Knedlik> Seems good, thanks
20:10:43FromDiscord<JSONBash> is there a nim job board site?
20:11:59*duuude quit (Ping timeout: 240 seconds)
20:17:58FromDiscord<dom96> the #jobs channel
20:18:14FromDiscord<dom96> which reminds me, it's time to clean it up
20:21:50prowe have #jobs?
20:22:35nrds<Prestige99> on discord, yeah
20:23:53FromDiscord<JSONBash> In reply to @dom96 "the <#845770858470965258> channel": would it be worth a separate site? something I would gladly work on
20:24:14nrds<Prestige99> I think that would be cool to have
20:24:38FromDiscord<dom96> I don't think we have quite enough job postings for that right now
20:25:45FromDiscord<JSONBash> yeah I don't think so either. Would it be worse to have a site though?
20:26:01nrds<Prestige99> It could help draw in postings
20:26:04prois there some non discordy way of using discord?
20:27:01nrds<Prestige99> the irc bridge is about it afaik
20:29:39prohttps://github.com/terminal-discord/weechat-discord was thinking more like this
20:30:03nrds<Prestige99> There's also cordless but it's not actively maintained anymore
20:30:21nrds<Prestige99> https://github.com/Bios-Marcel/cordless
20:35:15FromDiscord<Knedlik> Uhhh guys can I somehow package my resources (font, gfx…) with the exe?
20:35:23FromDiscord<Knedlik> Like in the exe?
20:36:55FromDiscord<Knedlik> And with that, can I make/access files by the directory the exe is in?
20:38:19FromDiscord<2F42BBA1> In reply to @Knedlik "Uhhh guys can I": It's somewhere in Nimble file
20:38:22FromDiscord<2F42BBA1> I think
20:38:27FromDiscord<dom96> `const myFont = staticRead("font.tft")`
20:39:05FromDiscord<dom96> In reply to @Knedlik "And with that, can": for this you can use getAppDir https://nim-lang.org/docs/os.html#getAppDir
20:39:18FromDiscord<Knedlik> Thank you so much
20:40:46nrds<Prestige99> Would be cool if you could do that with lib dependencies
20:41:56FromDiscord<Ayy Lmao> Is anyone extensively using concepts? I keep finding compiler bugs, and when you do something wrong you usually get spammed with like 100 lines of extremely verbose output.
20:42:17FromDiscord<Ayy Lmao> I'm wondering if it's worth even going down that road.
20:44:42FromDiscord<dom96> I personally don't bother with them
20:44:55FromDiscord<dom96> They are also still due a redesign
20:45:24nrds<Prestige99> Are they being worked on?
20:45:32FromDiscord<dom96> no idea
20:46:42FromDiscord<Ayy Lmao> I like the idea of them, but they seem barely usable at the moment.
20:46:54nrds<Prestige99> Yeah they're pretty broken
20:47:09nrds<Prestige99> the new redesign looks nice, but it's not a thing yet
20:47:46FromDiscord<Knedlik> Uhh so I tried staticRead and I’m getting errors of can’t load image
20:48:09nrds<Prestige99> incorrect path maybe?
20:48:31FromDiscord<Knedlik> Should be correct, afterall was usable before when running out of source directory
20:48:55FromDiscord<dom96> diff the contents of the two files
20:49:07FromDiscord<Knedlik> What two files?
20:49:39FromDiscord<Knedlik> Also they’re .pngs so I’m not sure how
20:52:41FromDiscord<SirOlaf> Why aren't concepts treated like generics anyways
20:54:33FromDiscord<dom96> In reply to @Knedlik "What two files?": the one on disk and the one you've embedded in the exe
20:54:42FromDiscord<dom96> In reply to @SirOlaf "Why aren't concepts treated": what do you mean?
20:55:39FromDiscord<SirOlaf> Well I don't know too much about how concepts work, but I would think that treating functions that use them as generic would be good
20:55:54FromDiscord<Knedlik> In reply to @dom96 "the one on disk": I’m not sure how
20:56:11FromDiscord<SirOlaf> In reply to @SirOlaf "Well I don't know": Because the type is not concrete so a new function of concept type C should be instantiated
20:57:58FromDiscord<dom96> functions using them are treated as generics afaik
20:58:09FromDiscord<dom96> the problem with concepts is that they are too flexible
20:58:19FromDiscord<dom96> the body of a concept is evaluated by the Nim VM
20:58:33FromDiscord<dom96> which makes their surface area for bugs far too high
20:58:45FromDiscord<dom96> (but that's I guess mainly my opinion)
20:59:36FromDiscord<SirOlaf> Actually you're right they do seem to be treated similar to generics
21:01:47FromDiscord<SirOlaf> Nice recursive error
21:01:47FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3VYL
21:03:24FromDiscord<Knedlik> @dom96 so I tried to diff, but it throws an error that it can’t access the file that’s not staticRead
21:03:40FromDiscord<Knedlik> For some weird reason, but yes, the path is correct
21:05:37*vicfred joined #nim
21:08:31nrds<Prestige99> I wonder if it expects a different path?
21:08:50FromDiscord<Knedlik> ?
21:09:44*neceve quit (Remote host closed the connection)
21:09:45FromDiscord<Knedlik> And now it doesn’t work either way… how nice
21:17:50FromDiscord<Knedlik> I’m lost tbh
21:18:28FromDiscord<Elegantbeef> They are↵(@SirOlaf)
21:19:03FromDiscord<SirOlaf> Yeah you're both right
21:19:09FromDiscord<SirOlaf> But I got some great news for you. Streams still aren't fixed
21:19:24FromDiscord<Elegantbeef> I mean they're parity with before my change
21:19:43FromDiscord<SirOlaf> Yep, still pretty crazy how much can go wrong for something like this
21:19:48FromDiscord<Elegantbeef> or not
21:19:49FromDiscord<Elegantbeef> I just give up at this point
21:20:19FromDiscord<SirOlaf> Well I'm just using this when nimvm stuff for my local version
21:20:22FromDiscord<SirOlaf> Works well enough
21:20:30FromDiscord<SirOlaf> (edit) "when nimvm" => "`when nimvm`"
21:20:39FromDiscord<Elegantbeef> The issue here is that `prepareMutation` is declared in the scope of the `static` and it needs a `when not nimVm` ontop of that `when declared(prepareMutation)`
21:20:49FromDiscord<Elegantbeef> So do you want to PR yet another fix?
21:21:02FromDiscord<SirOlaf> Oh I'd love a third fix
21:21:40FromDiscord<Elegantbeef> Would've been nice to have it pointed out to me the test doesnt actually fucking test all three GC methods
21:21:48FromDiscord<Knedlik> Nimassets looks pretty tasty
21:22:05FromDiscord<Elegantbeef> But who ever accepted it apparently didnt feel it was important to mention
21:35:15*pro quit (Quit: pro)
21:37:40*neurocyte8614492 joined #nim
22:01:32*slowButPresent quit (Ping timeout: 246 seconds)
22:03:24*slowButPresent joined #nim
22:12:33FromDiscord<Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3VYZ
22:12:48FromDiscord<Elegantbeef> make it a `let` instead of `const`
22:13:19FromDiscord<Elegantbeef> `const` is for compile time constants and `getAppDir` is certainly not a constant
22:14:15FromDiscord<Knedlik> It’s a var
22:14:28FromDiscord<Elegantbeef> Well give more code
22:16:11FromDiscord<Knedlik> sent a code paste, see https://play.nim-lang.org/#ix=3VZ0
22:16:38FromDiscord<Knedlik> maybe those two consts at the bottom?
22:16:39FromDiscord<Elegantbeef> you're attempting to use a runtime value for a compile time value
22:16:44FromDiscord<Elegantbeef> change that const to `let`
22:17:54FromDiscord<Knedlik> Looks good now, thanks
22:28:43*toulene quit (Quit: The Lounge - https://thelounge.chat)
22:36:33*toulene joined #nim
22:36:48*toulene quit (Remote host closed the connection)
22:37:37*flynn joined #nim
22:41:55*toluene joined #nim
22:43:16*flynn quit (Read error: Connection reset by peer)
23:05:50*xet7 quit (Remote host closed the connection)
23:06:58*xet7 joined #nim