<< 01-03-2022 >>

00:11:37*krux02 quit (Remote host closed the connection)
00:17:31*krux02 joined #nim
00:24:36*jmdaemon quit (Ping timeout: 240 seconds)
00:26:09*jmdaemon joined #nim
00:27:57girvoHah "using in anger" is a turn of phrase, no actual anger, just means "for real" :)
00:28:21girvoUsing it to build our IoT platforms firmware on the ESP32 platform with our custom boards
00:29:32FromDiscord<Elegantbeef> Ah sounds fun
00:30:09girvoChallenging for sure, as ESP-IDF's compilers are... um... not great haha. But beats the crap out of doing it in raw C or god forbid C++
00:43:06girvoFun challenge. So nimbase.h for 1.6.4 seems to complain when I'm trying to use it within ESP-IDF
00:43:13girvo// Test to see if Nim and the C compiler agree on the size of a pointer.
00:43:16girvoNIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
00:45:58girvoNim/this C compiles int size doesn't match the pointer size I guess? Can I fix that somehow?
00:46:32FromDiscord<Elegantbeef> are you compiling with the right flags?
00:46:46FromDiscord<Elegantbeef> inotherwords is your `arch` set properly?
00:47:18girvoGreat question actually, let me check
00:47:43girvoThough in this case, Nim isn't delegating to the toolchain, PlatformIO runs the C toolchain -- I'm outputting compileOnly C files instead
00:48:20FromDiscord<Elegantbeef> Sure but if Nim assumes the arch you're compiling for is 64bit but the target is 32bit that'll cause the issue afaik
00:49:19girvoYeah bang on :)
00:49:23girvoI'm looking into that now, cheers
00:50:20girvoHah thank the guy who added --cpu:esp -- its working :)
00:50:34girvoCheers mate!
00:51:04FromDiscord<Elegantbeef> Cant tell if aussie or brit, either no problem 😛
00:52:50girvoAussie ;)
00:53:08girvoMy firmware built, deployed, and is now yelling "another test" at me over serial lol
00:55:15FromDiscord<Elegantbeef> Test failed successfully
01:01:54*Gustavo6046 quit (Ping timeout: 252 seconds)
01:03:27*Gustavo6046 joined #nim
01:12:42girvoSo I'm currently trying to write a dodgy build task, to make the constant "cd src/ && nim c main.nim (now repeat for every nim file)" but its been a long while since I tried to
01:13:10girvoI've quickly attempted to within the `project.nimble` file as a task build_example -- but getParams, and other nimscript API things I expected are apparently not there?
01:14:46FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Bhn
01:15:12FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimscript.html will have the api you need to use
01:16:07girvoI can write an `import` within the core project.nimble no worries? per-task, or above it?
01:16:14girvoAnd yeah that's the API I was trying to use :)
01:16:26FromDiscord<Elegantbeef> you will need to write it at top level
01:16:29FromDiscord<Elegantbeef> Imports have to be top level
01:18:59*jmdaemon quit (Ping timeout: 272 seconds)
01:20:42*jmdaemon joined #nim
01:24:53girvoOkay sweet
01:25:01girvoBeen ages since I did any Nimble/nimscript work
01:30:37*jmdaemon quit (Ping timeout: 240 seconds)
01:32:30FromDiscord<Patitotective> I don't know why but when I try to generate the documentation for my code there's an error with the `runnableExamples` saying that `toOrderedTable` identifier is not defined and I'm not sure why since if I run the "example" in that file it works and it is importing `std/tables`↵(Not sure if the error message is helpful, here it is https://play.nim-lang.org/#ix=3R35)
01:33:19FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/KTE
01:33:26FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3R36
01:33:54FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3R37
01:33:58FromDiscord<Elegantbeef> It very much should
01:34:00FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3R37" => "https://paste.rs/Hbv"
01:34:12FromDiscord<Elegantbeef> `bindSym"toOrderedTable"`
01:34:23FromDiscord<Elegantbeef> make sure that file with that macro imports tables
01:37:14FromDiscord<Patitotective> sent a code paste, see https://paste.rs/C2k
01:37:28FromDiscord<Elegantbeef> Nice private repo
01:37:42FromDiscord<Patitotective> LOL
01:37:42FromDiscord<Patitotective> sorry
01:37:45FromDiscord<Patitotective> 😢
01:38:26FromDiscord<Patitotective> done 🙃
01:39:07FromDiscord<Patitotective> oh, and here is the line https://github.com/Patitotective/niprefs/blob/main/src/niprefs/prefsnode.nim#L151↵sorry
01:40:02FromDiscord<Elegantbeef> What does teh file it generate look like?
01:40:12FromDiscord<Elegantbeef> `/home/cristobal/.cache/nim/niprefs_d/runnableExamples/prefsnode_examples_1.nim`
01:41:03FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3R38
01:47:57*ltriant quit (Ping timeout: 256 seconds)
01:49:29FromDiscord<Elegantbeef> No clue why it's erroring then, perhaps just use codeblock
01:50:03girvoHah I just realised my mistake. I was trying to call a non-exported proc from nimscriptapi
01:50:28*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
01:52:52FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3R3a
01:53:14FromDiscord<Elegantbeef> No there is proper codeblocks
01:53:17FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3R3a" => "https://paste.rs/a8N"
01:53:45FromDiscord<Patitotective> 😕
01:53:56FromDiscord<Patitotective> (edit) "😕" => "+😕"
01:55:14FromDiscord<Patitotective> how?
01:55:55FromDiscord<Elegantbeef> How what
01:56:28FromDiscord<Patitotective> what are codeblocks?
01:56:39FromDiscord<Elegantbeef> What i just showed you
01:57:09FromDiscord<Patitotective> huh? what did you show me 😕
01:57:17FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/lib/system.nim#L2325-L2333
01:57:22FromDiscord<Elegantbeef> Matrix bridge didnt like it
01:58:18FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3R3b
01:58:24FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3R3b" => "https://paste.rs/rGr"
01:58:28FromDiscord<Elegantbeef> No codeblocks like i showed render like runnable examples
01:58:45FromDiscord<Elegantbeef> What you showed shows as a doc comment not rendered code
02:11:43FromDiscord<Patitotective> worked thanks 🙃
02:15:32FromDiscord<Patitotective> the search section in the generated docs needs something to work? it's not working for me locally 😕
02:15:35girvoHooray. PlatformIO integration is now working wonderfully. Can in theory work with _any_ arch that Nim supports for embedded work. Bit of extra stuff to add and wrap up but its working well
02:31:20*jmdaemon joined #nim
02:40:10*vicfred quit (Quit: Leaving)
02:40:42*krux02 quit (Remote host closed the connection)
03:04:38*ltriant joined #nim
03:05:31*girvo quit (Remote host closed the connection)
03:06:37*girvo joined #nim
04:06:02*supakeen quit (Quit: WeeChat 3.4)
04:06:32*supakeen joined #nim
04:19:11*arkurious quit (Quit: Leaving)
04:19:49*jmdaemon quit (Ping timeout: 256 seconds)
04:31:47*cornfeedhobo quit (Quit: ZNC - https://znc.in)
04:52:17*jmdaemon joined #nim
05:41:53*slowButPresent quit (Quit: leaving)
05:42:53*ltriant quit (Ping timeout: 256 seconds)
05:43:09*ltriant joined #nim
05:43:42*wyrd quit (Read error: Connection reset by peer)
05:48:54*wyrd joined #nim
06:17:41*ltriant quit (Ping timeout: 256 seconds)
06:20:37*wyrd quit (Remote host closed the connection)
06:20:51*wyrd joined #nim
06:44:39*kenran joined #nim
06:54:18*ltriant joined #nim
07:00:20*ltriant quit (Ping timeout: 272 seconds)
07:07:16FromDiscord<Sense> I wish Nim docs were a bit better.
07:11:03FromDiscord<Elegantbeef> Do they have you stymied ?
07:11:35FromDiscord<congusbongus> I usually learn new languages by asking dumb questions on stack overflow
07:30:01*ltriant joined #nim
07:34:37*ltriant quit (Ping timeout: 240 seconds)
07:35:42*icebattle quit (Ping timeout: 252 seconds)
07:35:55*icebattle joined #nim
07:45:24FromDiscord<retkid> hey so
07:45:46FromDiscord<retkid> whats happening with my async?
07:46:04FromDiscord<retkid> its automatically waiting for it to complete which is making its asyncness completely irrelevant
07:46:16*girvo quit (Read error: Connection reset by peer)
07:46:22FromDiscord<Elegantbeef> Ah looking at your code the issue is clear
07:46:25FromDiscord<Rika> On first call the async is run until the first yield
07:46:45FromDiscord<Rika> I don’t know why exactly that is done but it is
07:47:37FromDiscord<retkid> In reply to @Rika "On first call the": no but all of them in the loop are
07:47:46FromDiscord<Rika> What
07:48:11FromDiscord<enthus1ast> i dont see his code \:/
07:48:18FromDiscord<Elegantbeef> That's the joke
07:48:24FromDiscord<enthus1ast> ah ok
07:48:32FromDiscord<retkid> not in an async proc
07:48:32FromDiscord<Rika> Your joke is not obvious that it is
07:48:34FromDiscord<retkid> sent a code paste, see https://paste.rs/PMx
07:48:37FromDiscord<retkid> No i got it
07:49:18FromDiscord<retkid> between the echo it does not wait
07:49:27FromDiscord<retkid> (edit) "it does not wait" => "waits"
07:49:29FromDiscord<enthus1ast> but sleep there
07:49:32FromDiscord<enthus1ast> pu
07:49:32FromDiscord<enthus1ast> t
07:49:37FromDiscord<retkid> thats not............
07:49:45FromDiscord<Rika> What is the async proc
07:49:59FromDiscord<Rika> If there’s a lot of code before the first time you await in the proc, then that’s why
07:50:01FromDiscord<retkid> some http stuff
07:50:02FromDiscord<enthus1ast> or↵for idx in 0..10000\: shasum("troll?")
07:50:06FromDiscord<Rika> That part before the first await is still run
07:50:22FromDiscord<enthus1ast> thats called busy wait ya know
07:50:41FromDiscord<Rika> I do not know what your point is enthusiast
07:51:00FromDiscord<retkid> no theres no code between each execution apart form the async function itself
07:51:10FromDiscord<retkid> thats literally the entire loop
07:51:24FromDiscord<Rika> Yes what is the async proc
07:51:25FromDiscord<retkid> sent a code paste, see https://paste.rs/7Y1
07:51:41FromDiscord<retkid> http code
07:51:46FromDiscord<retkid> just fetches websites
07:51:48FromDiscord<retkid> nothing big
07:51:57FromDiscord<retkid> though there is time to wait
07:51:58FromDiscord<Rika> From the top of that proc down to the first time you await in the proc, that is still run in the loop
07:52:58FromDiscord<retkid> if all the code is being run in a completely non parallel way then why am i doing async at all
07:53:00*PMunch joined #nim
07:53:05FromDiscord<Rika> It’s not parallel
07:53:08FromDiscord<Rika> Async is not parallel
07:53:22FromDiscord<retkid> im aware its not parallel i just dont know the word of the top of my head to describe it
07:53:26FromDiscord<Rika> Concurrent?
07:53:27FromDiscord<enthus1ast> @Rika\: i think the bridge did not work, i just don't see any code
07:53:32*icebattle quit (Ping timeout: 240 seconds)
07:53:35FromDiscord<retkid> yes
07:53:46FromDiscord<Rika> It won’t make any difference if the code above the await was run in the loop or not really
07:53:46*icebattle joined #nim
07:53:53FromDiscord<Rika> in this case
07:54:10FromDiscord<Rika> It will still run one by one until each proc awaits
07:54:42FromDiscord<retkid> well, I dont want it to run in a loop obviously, i want it to que up the procs then wait for all of them to be complete
07:54:45FromDiscord<Rika> It’s still concurrent
07:54:57FromDiscord<Rika> Yes it’s still gonna be concurrent in the end
07:55:16PMunchAs long as the http fetching code is done correctly*
07:55:33FromDiscord<Rika> I assumed that was a given
07:55:34FromDiscord<enthus1ast> loop through the futures, check if theire done, if done await the result; in an endless loop
07:55:44FromDiscord<Rika> You don’t need to do that
07:55:55FromDiscord<enthus1ast> this way you can always add new stuff
07:56:18FromDiscord<retkid> In reply to @Rika "I assumed that was": even though instead of just adding the future to the sequence then continuing, its waiting for the code to return to then move onto the next one, it is somehow still concurrent?
07:56:20FromDiscord<Rika> If that’s what is desired then sure
07:56:29FromDiscord<Rika> In reply to @retkid "even though instead of": Yes
07:56:39FromDiscord<Rika> It isn’t waiting to return
07:56:43FromDiscord<Rika> It’s waiting to yield
07:57:19FromDiscord<retkid> so this is suppose to make any difference to my code in any way how?
07:57:34FromDiscord<retkid> sorry i might just be to dumb to understand how this isn't sequential
07:57:51FromDiscord<Rika> I’d draw if I could but I do not have my tablet
07:58:09PMunchHave you seen this @retkid https://peterme.net/asynchronous-programming-in-nim.html
07:58:52FromDiscord<Elegantbeef> Who's this peterme guy, probably a weirdo
07:59:03FromDiscord<retkid> i wonder
07:59:04FromDiscord<retkid> hmmmmm
07:59:57FromDiscord<retkid> alright I'm never touching async again and I'll just thread it
08:00:07PMunch@retkid, the way async works is that when you call `helloRika` it will run all the code until the first `await`.
08:00:17FromDiscord<Rika> That’s what I have been saying
08:00:30*krux02 joined #nim
08:00:32PMunchMulti-threading this kind of network access won't really give you much of a benefit though
08:00:40FromDiscord<Rika> I think you just need to understand the difference between concurrency and parallelism
08:00:43PMunchSo you'd rather learn how to use both
08:01:17FromDiscord<fbpyr> sent a code paste, see https://play.nim-lang.org/#ix=3R4h
08:01:34PMunchOnce it hits the first await, it takes the handle of the thing it is awaiting, adds it to the async dispatcher, and yields the control back to the caller.
08:01:42FromDiscord<retkid> In reply to @PMunch "Multi-threading this kind of": I dunno man, every single other language I have had no problems grasping asynchronous tasks,.
08:01:53FromDiscord<Elegantbeef> The first example shows how fbpyr https://github.com/disruptek/gittyup#usage
08:02:02FromDiscord<Rika> In reply to @retkid "I dunno man, every": And I assure you this is the same behaviour
08:02:09PMunch@retkid, asynchronous != multi-threaded
08:02:09FromDiscord<fbpyr> the example does not compile here.
08:02:10FromDiscord<retkid> even with pythons funky language shenanigans I was able to grasp it
08:02:16FromDiscord<retkid> In reply to @PMunch "<@217459674700578816>, asynchronous != multi-thread": I am aware of this
08:02:17FromDiscord<Elegantbeef> well `.get`
08:02:19FromDiscord<fbpyr> as in issue 2.
08:02:31FromDiscord<Rika> In reply to @retkid "even with pythons funky": Then I am unsure what the issue is here
08:02:53FromDiscord<Rika> Nothing major changed here
08:03:04PMunch@retkid, I'm not sure what you find particularly challenging with Nims async system, it works pretty much the same way as every other such system
08:03:33FromDiscord<fbpyr> sry, as in this issue\: https://github.com/disruptek/gittyup/issues/17
08:03:44FromDiscord<retkid> I am as well because I dont quite understand why an asynchronous function would need to wait to complete a procs function before continuing in the host proc even though I've never encountered that in any other asynchronous situation
08:04:12FromDiscord<Elegantbeef> gittyup is using https://github.com/disruptek/badresults fbpyr
08:04:17FromDiscord<fbpyr> ..maybe I also misunderstood the "walrus opreator" there..
08:04:20FromDiscord<retkid> that soungs much less like async and much more like a then b then c then d rather than a then b then a then c
08:04:27FromDiscord<Rika> It is just a slight difference in Nim. It is the same behaviour otherwise in Python and other languages
08:04:33FromDiscord<fbpyr> ahh thank you for the pointer [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org) ! 🙂
08:04:49FromDiscord<Rika> In reply to @Rika "It is just a": The behaviour is equivalent, I mean
08:04:50FromDiscord<Rika> Wholly
08:04:57FromDiscord<Elegantbeef> the `:=` afaict handles the error and assignment
08:05:26PMunch@retkid, try to throw in a small `await sleepAsync(0)` at the beginning of your `helloRika` procedure
08:05:29FromDiscord<Rika> There is no difference between running the first part of an async proc in the loop versus running the parts in the dispatcher
08:05:46FromDiscord<Rika> Since they will run one by one either way
08:05:54FromDiscord<Rika> And there is no time benefit
08:06:04PMunchThat should make your procedure return control immediately, before running any more code
08:06:18PMunchI guess some frameworks might do this by default, but that seems a bit odd
08:06:34FromDiscord<Rika> It is
08:06:38FromDiscord<Rika> I found it odd at first
08:07:01PMunchThat Nim doesn't do it, or that some languages do it?
08:07:13FromDiscord<Rika> Former
08:07:41PMunchAh, I guess it all depends on what you're expecting
08:08:38FromDiscord<retkid> In reply to @PMunch "<@217459674700578816>, try to throw": that works however they are still returning separately with no cpu usage meaning that even though it skipped everything its still being executed sequentially
08:08:43FromDiscord<retkid> though
08:08:45FromDiscord<retkid> i can be wrong
08:08:47FromDiscord<Rika> ?
08:08:55FromDiscord<Rika> Of course they are you’re making them sequentially
08:08:57FromDiscord<Rika> I don’t get it
08:08:59FromDiscord<Elegantbeef> fbpyr i'd probably suggest using the walrus op given the conventions
08:09:27FromDiscord<retkid> In reply to @Rika "Of course they are": then how would i cause them to execute concurrently and not sequentially?
08:09:37FromDiscord<Rika> Those are not mutually exclusive.
08:09:39PMunch@retkid, again I'm not 100% sure you actually understand the difference between async and threading. Async will only run on a single thread, and if it is waiting for IO bound tasks it can easily end up just idling your CPU
08:09:47FromDiscord<retkid> yes
08:09:57PMunchIf you don't have work to do for the CPU there is no reason for it to do anything
08:10:24FromDiscord<retkid> In reply to @PMunch "<@217459674700578816>, again I'm not": > waiting for IO bound tasks it can easily end up just idling your CPU↵Unless it is an OS / cpu level issue there should be no IO level bottleneck but i will check top
08:10:30FromDiscord<Rika> What?
08:10:34FromDiscord<fbpyr> walrus op, it looked elegant in the example(and I like it in python, too),↵but this is where I get the compile error - so trying it now with badresults.. 🙂
08:10:39FromDiscord<Rika> A network call is an IO bottleneck
08:11:05PMunchIf you don't have an IO bottleneck then async isn't what you're supposed to do
08:11:06FromDiscord<Elegantbeef> The walrus op is apart of gittyup
08:11:18FromDiscord<Rika> I’m confused
08:11:21PMunchThe whole point of async is getting around IO bottlenecks
08:11:39FromDiscord<retkid> In reply to @Rika "A network call is": But didn't you tell me a while ago that I shouldn't crawl with threads?
08:11:54FromDiscord<retkid> if a network call is an io bottleneck shouldn't it be a threaded task?
08:11:55PMunchAnd by IO bottleneck I mean everything from file reads to network access
08:11:59PMunchNo?
08:12:05FromDiscord<Rika> No?
08:12:10FromDiscord<Rika> IO -> async
08:12:12PMunchAgain, the entire point of async is to get around IO bottlenecks
08:12:21PMunchThreads are for getting around CPU bottlenecks
08:12:24FromDiscord<retkid> alright this is going in circles and is completely pointless ¯\_(ツ)_/¯
08:12:32FromDiscord<Rika> Well
08:12:38FromDiscord<Rika> If you say so, I guess
08:12:39PMunchThrowing more CPU power onto an IO bound problem will do nothing more than heat up your room
08:12:58FromDiscord<Rika> In reply to @PMunch "Throwing more CPU power": Not just your own room when it’s a network call 😄
08:13:00FromDiscord<retkid> In reply to @PMunch "Throwing more CPU power": I dont know why you're telling me this when i explicitly said my cpu usage is low meaning that is not the bottleneck
08:13:01FromDiscord<Elegantbeef> It's a win win, i get my information at the same speed and my room is warm
08:13:16FromDiscord<Elegantbeef> You do know it's a single threaded operation
08:13:20FromDiscord<retkid> REALLY
08:13:21FromDiscord<Rika> In reply to @Elegantbeef "It's a win win,": True, sometimes that’s a win lol
08:13:23FromDiscord<retkid> you dont say?
08:13:29FromDiscord<Rika> In reply to @Elegantbeef "It's a win win,": But power usage isn’t
08:13:30FromDiscord<Elegantbeef> Meaning at most you can use 1 core, and in my case it's 12.5% of the entire cpu
08:13:34FromDiscord<retkid> holy shit
08:13:37FromDiscord<retkid> i never knew that
08:13:43FromDiscord<Elegantbeef> Nice sarcasm
08:13:51FromDiscord<Rika> Okay
08:13:56FromDiscord<Elegantbeef> Now just maybe channel it to someone else that actually wants to take it
08:14:00FromDiscord<Rika> This is getting a bit heated heh
08:14:01FromDiscord<Rika> But really
08:14:04PMunchOkay, let's take a step back here
08:14:20FromDiscord<Rika> You’re making a network call right? CPU isn’t the bottleneck here, as you say
08:14:22FromDiscord<retkid> my point was is that if the tasks are executing together at once on 1 cpu i'd be able to see the botlte neck by looking for any CPU being above like 75%
08:14:27FromDiscord<Elegantbeef> Nah i never retreat, into the breach is what i say
08:14:30FromDiscord<Rika> It’s IO right? Can we agree on this at least
08:14:37PMunchNot really
08:15:00FromDiscord<Rika> In reply to @retkid "my point was is": If the code isn’t saturating a single core then no
08:15:06PMunchBasically your OS gets interrupts from the network card when packets come in
08:15:11FromDiscord<Rika> Which is usually the case when doing networking stuff
08:15:28FromDiscord<Rika> In reply to @PMunch "Basically your OS gets": Oh man here we go semi-low-level stuff
08:15:31FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/948131357152911370/unknown.png
08:15:32PMunchSo if all you're doing is sitting there waiting for network traffic the CPU will sit idle until the network card pings it with new data
08:16:06FromDiscord<Rika> In reply to @retkid "": What is your point with this image
08:16:07PMunch@retkid, not quite sure what you wanted to show with that screenshot
08:16:12FromDiscord<Rika> Me neither..
08:16:40PMunchOkay, let me type up a long-winded explanation for how all this works which will hopefully help us all get on the same page.
08:17:02FromDiscord<retkid> The os has to delegate packs, and sometimes this results in waiting on a single cpu? correcty
08:17:03FromDiscord<Elegantbeef> Ah nifty he's going to write a book so we can all get on the same page
08:17:04FromDiscord<retkid> (edit) "correcty" => "correct?"
08:17:13FromDiscord<Rika> Sorry if anything was rude lol I have been told by many that I speak like a robot half of the time
08:17:37FromDiscord<retkid> https://www.youtube.com/watch?v=JxlZ4i3VjXY
08:17:43FromDiscord<Rika> In reply to @retkid "The os has to": Waiting means the CPU isn’t being overwhelmed meaning it is not a CPU bottleneck?
08:17:46FromDiscord<retkid> this is pretty much how this conversation feels
08:18:20*jjido joined #nim
08:18:48FromDiscord<fbpyr> sent a long message, see http://ix.io/3R4m
08:19:01FromDiscord<retkid> In reply to @Rika "Waiting means the CPU": yes
08:19:03FromDiscord<retkid> it is idle
08:19:08FromDiscord<fbpyr> so is there a wa to ask for `Some()` ?
08:19:15FromDiscord<Rika> Yes so the bottleneck is elsewhere
08:19:27FromDiscord<retkid> this has been the entire point of my conversation, its not a cpu issue
08:19:31FromDiscord<Rika> Yes
08:19:59FromDiscord<Rika> And threads is a CPU bottleneck solver, so it isn’t appropriate for this issue
08:20:22FromDiscord<retkid> as is why im not using threads
08:20:28FromDiscord<retkid> because thats way overkill
08:20:32FromDiscord<Rika> Okay honestly I have to stop speaking I have no idea what we are arguing about anymore
08:20:42FromDiscord<Rika> What are you arguing against
08:21:28FromDiscord<retkid> why am I calling an asynchronous function, and they are executing in the order in which they were received rather than returning (yielding) in clumps
08:22:07FromDiscord<retkid> it is the same speed as me executing it in serial
08:22:25FromDiscord<retkid> ~~specifically cinnamon toast crunch~~
08:22:31FromDiscord<Rika> Perhaps because your IO is quick
08:22:35FromDiscord<Elegantbeef> No fbpyr the issue is that you dont have `import std/[uri, logging]`
08:22:38FromDiscord<Rika> And you aren’t having internet issues
08:22:52FromDiscord<Elegantbeef> `error` there is to write to the stdout and close the program "gracefully"
08:23:16FromDiscord<fbpyr> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: thanks! uri I added, but not logging - let ..me try
08:23:39FromDiscord<Elegantbeef> There might be another `error` procedure that does it, i dont know
08:23:44FromDiscord<Rika> The best that async can get in terms of speed is the speed of sequential sync code with the IO delay removed
08:23:49FromDiscord<Rika> It cannot get any quicker than that
08:24:05FromDiscord<Rika> Because single core
08:24:09FromDiscord<fbpyr> ahaa! now the complaints are gone! 😀
08:24:24FromDiscord<retkid> so async cannot get any faster than a single core
08:24:25FromDiscord<fbpyr> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: thank you so much!
08:24:40FromDiscord<Rika> If for some reason (you probably do have a good reason since this is a scraper) you need quicker speeds then I assume threads are now appropriate
08:25:06FromDiscord<retkid> yes im doing this soley for speed
08:25:10FromDiscord<Rika> By the way you can run threads AND async combined
08:25:13FromDiscord<Elegantbeef> So i'd say leave the issue but with the added information
08:25:18FromDiscord<retkid> In reply to @Rika "By the way you": im aware of this
08:25:26FromDiscord<Rika> Making sure
08:25:26FromDiscord<retkid> its in the asyncserver module
08:25:29FromDiscord<Rika> Some people aren’t
08:25:36FromDiscord<retkid> whats the proper name uh
08:25:45FromDiscord<retkid> asynchttpserver
08:26:19FromDiscord<retkid> somewhere it is (was?) "theoretically you can use this with threads and async"
08:26:20FromDiscord<retkid> etc
08:27:11FromDiscord<Rika> I remember having this problem now
08:27:23FromDiscord<Rika> The http client is kind of slow setting up its code
08:27:26FromDiscord<Rika> From what I recall
08:27:40FromDiscord<Rika> Might need optimisation in some way
08:28:16FromDiscord<retkid> im the women for the job
08:28:21FromDiscord<retkid> time to butcher the code >:)
08:32:06*Gustavo6046 quit (Quit: Leaving)
08:46:56*ltriant joined #nim
08:48:26FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/948139637837271060/unknown.png
08:49:02PMunch@retkid, ready for wall-of-text time?
08:49:05PMunchhttp://ix.io/3R4o
08:52:08*ltriant quit (Ping timeout: 252 seconds)
09:04:53*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:49:20FromDiscord<fbpyr> hmm.. 🤔 ↵now trying to compile some nim that uses gittyup on a windows box (it compiles fine on debian after installing libgit2-dev). on windows though, it understandably complains about the missing gitlib headers (which do not seem to be included in portable git). ↵is there somewhere where I can read up on how to get the git headers for win and get them to be recognized by nim compiler? ↵or would cross-compiling from linux to win
09:52:08*acidsys quit (Excess Flood)
09:52:41*acidsys joined #nim
09:54:44FromDiscord<Elegantbeef> I do not know where to get the windows headers
09:59:48PMunchI'd guess the libgit website is a good way to start: https://libgit2.org/
09:59:58FromDiscord<fbpyr> so far for the solutions for git on windows, I have only seen it either via mingw (portable git) or via this .net library libgt2sharp.dll ↵the latter I successfully used at some earlier point from python via pythonnet. ↵maybe I should look into using it, and if it works figure out how I can bundle the dll with the nim program.
10:00:09PMunchYou should be able to just download them from there and hand them to Windows by using --passL I guess
10:02:13*shalokshalom joined #nim
10:05:19*ltriant joined #nim
10:08:06FromDiscord<fbpyr> oh wow - https://github.com/libgit2/libgit2 just built - I take that as a good sign.. 🙂
10:10:23FromDiscord<0ffh> In your opinion, what's the best ressource/tutorial on how to make/generate bindings for a C++ library?↵I've found some stuff, but I'm not sure there's nothing better out there.
10:13:04*ltriant quit (Ping timeout: 250 seconds)
10:13:52NimEventerNew thread by Flajr: Static musl compilation with db_mysql module and external libraries mysqlclient and openssl, see https://forum.nim-lang.org/t/8966
10:23:54FromDiscord<fbpyr> sent a long message, see http://ix.io/3R4G
10:26:02FromDiscord<fbpyr> nvm I found `--cincludes` with that it finds the headers. but now complains about `could not load: libgit2.so`
10:35:58FromDiscord<retkid> i need to make thread arrays that are not of a set compile time size
10:36:01FromDiscord<retkid> how can i do that?
10:36:01FromDiscord<fbpyr> hmm.. 🤔 even when passing cincludes and clibdir like this\:↵`nim c -d:release --cincludes:c:/tools/libgit2/include --clibdir:c:/tools/libgit2/lib -r installer.nim`↵it still insists\: `could not load: libgit2.so` (even when I tried to copy `git2.dll` to `git2.so`) .. so close.. 🙁
10:36:15FromDiscord<Elegantbeef> seq↵(@retkid)
10:36:30FromDiscord<retkid> In reply to @Elegantbeef "seq (<@217459674700578816>)": i can initiate a seq the same way i can an array?
10:36:42FromDiscord<Elegantbeef> What do you mean?
10:37:08FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=
10:37:30FromDiscord<Elegantbeef> `seq[Thread[...]]`
10:38:11FromDiscord<retkid> In reply to @Elegantbeef "`seq[Thread[...]]`": but then its not of any size?
10:38:22FromDiscord<Elegantbeef> What?
10:38:33FromDiscord<retkid> its not defined to a size like the array
10:38:44FromDiscord<retkid> i cant iterate over it
10:38:55FromDiscord<retkid> to use in create thread
10:39:01FromDiscord<retkid> createThread
10:39:02FromDiscord<Elegantbeef> `var myColl = newSeq[Thread[void]](10)`
10:39:51FromDiscord<retkid> thank you :3
10:43:22*ltriant joined #nim
10:48:13*ltriant quit (Ping timeout: 240 seconds)
10:53:37*jjido joined #nim
11:35:42*jmdaemon quit (Read error: Connection reset by peer)
11:36:52*jmdaemon joined #nim
11:40:03*jmdaemon quit (Excess Flood)
11:44:08*jmdaemon joined #nim
11:54:12*icebattle quit (Ping timeout: 240 seconds)
11:55:58PMunchHmm, is there a way to parse timestamps with variable sub-second precision
11:56:56PMunchI have a format that sometimes returns things like both: 12:54:18.5062643 and 12:54:04.253155
11:57:06PMunchSo either 6 or 7 characters
11:59:56*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:01:27*icebattle joined #nim
12:06:02*supakeen quit (Quit: WeeChat 3.4)
12:06:32*supakeen joined #nim
12:23:52*jjido joined #nim
12:25:23FromDiscord<fbpyr> ghaa.. that is frustrating\: after adjusting PATH for a while, to prevent mingw-confusion.↵it finally compiled with\: `nim c -d:release --cincludes:c:/tools/libgit2/include --verbosity:3 installer.nim`↵...BUT\: when I try to run it, it says\: `could not load: libgit2.so` 😦↵there is a way to instead statically compile this, right?
12:31:55FromDiscord<retkid> I've completely forgotton how to make objects with sequences
12:32:10PMunchI think you then first need to make the static library `cmake -DBUILD_SHARED_LIBS=OFF` or something like that
12:32:13PMunchAnd then link with that
12:32:24PMunch@retkid, objects with sequences?
12:33:00FromDiscord<retkid> thats sounds weird, its not the sequences in the type thats the problem
12:33:02FromDiscord<retkid> 🤔
12:33:30FromDiscord<retkid> cant compile when i have these sequences in there but if i remove the other ones they're fine
12:33:59FromDiscord<auxym> can you make a minimal example that reproduces the problem?
12:34:30*ltriant joined #nim
12:34:40FromDiscord<whisperdev> Hi. What is that lib which I can use for ssl so I dont have to ship (libcrypto-1_1-x64|libeay64).dll with the binary?
12:36:13FromDiscord<retkid> In reply to @auxym "can you make a": its unrelated to that
12:36:17FromDiscord<retkid> its a compiler problem?
12:36:24FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3R4X
12:36:52FromDiscord<retkid> I found it
12:36:52FromDiscord<retkid> lol
12:36:54FromDiscord<auxym> In reply to @whisperdev "Hi. What is that": Assuming you mean "for https", this? https://github.com/treeform/puppy
12:36:55FromDiscord<retkid> typo
12:42:25FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/948198521423679558/unknown.png
12:42:43FromDiscord<retkid> the things that you think should be really resource light always are the most intensive
12:44:15FromDiscord<whisperdev> In reply to @auxym "Assuming you mean "for": Oh I think so.
12:44:22FromDiscord<whisperdev> How do I download a file with this?
12:45:53FromDiscord<retkid> In reply to @retkid "": 😔 had 500 chromiums running
12:47:33FromDiscord<auxym> In reply to @whisperdev "How do I download": never used it, but I assume the raw bytes would be in the `Response.body` string, then you can just dump them to a file. Hoping you're not downloading from multi-gb files
12:47:56*FromDiscord quit (Remote host closed the connection)
12:48:09*FromDiscord joined #nim
12:50:07FromDiscord<ShalokShalom> Who here tried Nim > LLVM > GraalVM already?
12:50:22FromDiscord<whisperdev> In reply to @auxym "never used it, but": Ah thanks I guess i can just do what downloadFile does from httpclient
12:59:04*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:59:27*jmdaemon quit (Ping timeout: 256 seconds)
13:18:21*shalokshalom quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
13:24:01FromDiscord<fbpyr> sent a long message, see https://paste.rs/Mvf
13:51:12FromDiscord<0ffh> In reply to @0ffh "In your opinion, what's": Okay this one seems to be the nicest guide I've found so far.↵https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f
14:07:37FromDiscord<Sense> hej, dudes can anyone give me compiler args for nim which are compressing to the smallest size
14:08:26FromDiscord<ynfle> In reply to @Sense "hej, dudes can anyone": `--opt:size -d:danger`? Not sure what you mean
14:09:12FromDiscord<Sense> In reply to @ynfle "`--opt:size -d:danger`? Not sure": this is what i use actually xd
14:11:17Amun-Ra-d=release --passL=-flto etc.
14:11:46PMunch@retkid, what are you doing now? If those numbers are from a web scraper you are probably doing something wrong.. Higher CPU != more good
14:12:12FromDiscord<retkid> In reply to @PMunch "<@217459674700578816>, what are you": nah im pretty sure bigger is always bette
14:12:12FromDiscord<retkid> (edit) "bette" => "better"
14:12:16FromDiscord<retkid> anyway
14:12:21PMunch@Sense, what kind of target are you compiling for?
14:12:25FromDiscord<retkid> no i just had like 500 chrome tabs open because selenium
14:12:35*kenran quit (Quit: WeeChat info:version)
14:13:00FromDiscord<Sense> In reply to @PMunch "<@790153860130799616>, what kind of": I am compiling for Windows x64, my aim is to make the most tiny executable which could work without any issues.
14:13:08FromDiscord<Sense> Let me put my current args rn
14:13:16PMunchIn general `-d:danger --gc:arc --opt:size --passL:"-flto" would give a fairly low size
14:14:02PMunch@retkid, `while true: echo "No it's not"` run that and watch it 100% peg a CPU core without getting anything done :P
14:14:04FromDiscord<ynfle> danger removes all runtime checks though
14:14:13FromDiscord<Sense> `nim c -d:danger --gc:arc --debuginfo:off --opt:size --passc=-flto --passl=-flto --app:gui --panics:on <file>.nim`
14:14:30PMunchBut yeah 500 chrome tabs will do that to your CPU :P
14:14:30FromDiscord<retkid> why are panics on?
14:14:33Amun-Raand -passl=-s
14:15:00PMunchAnd --app:gui?
14:15:23PMunch--debuginfo:off should be on when compiling with -d:danger
14:15:36PMunchBy the way, once it's done you might also want to strip the executable
14:15:46FromDiscord<0ffh> In reply to @PMunch "<@217459674700578816>, `while true: echo": Well if you pay the CPU, then according to Keynsianism, economic value is created.
14:15:57PMunch@Sense, this might interest you: https://hookrace.net/blog/nim-binary-size/
14:15:58FromDiscord<Sense> In reply to @PMunch "By the way, once": Does stripping breaks executables no?
14:16:04PMunchNo?
14:16:16PMunchIf it broke executable why would anyone do it :P
14:16:18FromDiscord<Sense> Uh... OK?
14:16:45FromDiscord<Sense> Also, I found out that when I try to build to `cpp` instead of `c` it seems that executable doesn't work afterwards xD
14:16:57PMunch@0ffh, haha yay capitalism!
14:17:11PMunch@Sense, then you probably did something else wrong
14:17:32PMunchBuilding with C++ should work just fine
14:18:15PMunchBy the way they use `-d:release` in that article, that switch was renamed to `-d:danger` and a new slightly less aggressive switch was introduced and called `-d:release`
14:19:07PMunchOf course if you want the smallest program you quite possibly need to do some things with your program as well
14:19:13PMunchSwitches will only get you so far
14:20:49FromDiscord<A_Person> is there any implementations of rdp/vnc in nim?
14:21:43*arkurious joined #nim
14:25:54FromDiscord<Sense> In reply to @PMunch "Building with C++ should": Hehe, what I meant here is that C++ binary works on Windows, but if you try to run through Wine on Linux it will not just work.
14:28:44FromDiscord<auxym> that might be more of an issue with WINE configuration... Why are you not compiling natively for linux?
14:29:37FromDiscord<Sense> In reply to @auxym "that might be more": My software is unironically Windows only. And I test it on my Windows 10 VM and through Wine to ensure everything works.
14:31:22FromDiscord<auxym> from what I know about wine (very little), it has a thousand compatibility settings that you have to tweak just right for each executable
14:32:04FromDiscord<Sense> well by default winecfg is on win 10
14:36:20PMunch@auxym, haha it's not quite that bad
14:37:34FromDiscord<Sense> In reply to @PMunch "<@882793909246369864>, haha it's not": Btw, I checked the compiler guide and I have seen three things. ARC, ORC, and useMalloc. What these means?
14:37:44FromDiscord<Sense> Also, what's difference between these?
14:39:22PMunchWell useMalloc is just a general thing for all the garbage collectors
14:39:45PMunchIt basically tells the compiler to just use malloc and the other basic memory allocation calls and not try to do anything fancy
14:40:04PMunchBy default Nim will grab a chunk of memory and then handle that chunk itself
14:40:23PMunchWhich leads to better performance, but it makes it harder to profile, and might not work on all platforms (e.g. an Arduino)
14:41:01PMunchARC and ORC are memory management siblings meant to replace the current deferred reference counting algorithm
14:41:46PMunchARC is automatic reference counting, ORC is ARC but with a cycle collector added in (by default ARC will leak cyclic data).
14:43:01FromDiscord<Sense> Hm... so it's doesn't really matter what to choose right?
14:43:14PMunchWell, it definitely matters
14:43:23PMunchBut in the end they all do sort of the same thing
14:43:28*shalokshalom joined #nim
14:43:42FromDiscord<Sense> Just as I said my main aim is to have a very tiny executable
14:44:06PMunchI mean if you really want to have a tiny executable --gc:none is what you want
14:44:26PMunchBut --gc:arc turns into --gc:none if you don't have any garbage collected memory
14:44:53PMunchWhy are you aiming for tiny executables exactly?
14:45:27PMunchApart from viruses and microcontrollers being very aggressive about program size doesn't really make much sense nowadays
14:45:40FromDiscord<Sense> When I was doing some programming on Rust and Golang they were both producing pretty large executables.
14:45:44FromDiscord<Sense> Ever heard of demoscene?
14:46:15PMunchOh right, well Nim should by default be quite a bit smaller than either of those
14:46:40PMunchdemoscene, that's the keygen music/cool visualisation thingies right?
14:46:47FromDiscord<Sense> In reply to @PMunch "demoscene, that's the keygen": Das right
14:47:06FromDiscord<Sense> I think that Nim will be the best choice for this kind of stuff
14:47:16PMunchShould certainly be a good fit
14:49:06FromDiscord<Sense> In reply to @PMunch "Should certainly be a": It will not pain in the ass to write, and will not produce large executables.
14:54:02FromDiscord<fbpyr> is there a good place to read up on using c# .net dll in from nim?
14:54:07PMunchI guess that's why Nim is so popular with virus creators. Easy to work with, tiny standalone binaries
14:54:51PMunch@fbpyr, this might be a good start: https://forum.nim-lang.org/t/7265
14:56:00FromDiscord<fbpyr> looks very good - thank you so much! 🙂
14:56:07PMunchOh well, I've gotta go
14:56:09*PMunch quit (Quit: Leaving)
15:29:00FromDiscord<mratsim> In reply to @PMunch "Well useMalloc is just": useMalloc is only available for arc/orc iirc
15:29:23FromDiscord<mratsim> I opened a feature request a year ago or so to have it on the classic GC
15:29:55*icebattle quit (Ping timeout: 256 seconds)
15:31:58*Guest71 joined #nim
15:38:28FromDiscord<dom96> In reply to @Sense "Ever heard of demoscene?": I love the Demoscene, plz make some Nim demos 😄
15:42:53FromDiscord<0ffh> In reply to @Sense "Ever heard of demoscene?": As a demo only has limited time to allocate garbage you might get away with no GC. But then you should test what the minimum free memory requirement is and make sure it's below free memory on the presentation machine.
15:49:34FromDiscord<Sense> In reply to @dom96 "I love the Demoscene,": Same, but I dumbass in terms of graphics xD
15:51:42*icebattle joined #nim
15:52:30FromDiscord<Waldecir Santos> Can someone help me with generics I'm doing this https://play.nim-lang.org, but for some reason the add inside `solve` is expecting string 🤔
16:07:29*Guest71 quit (Quit: Client closed)
16:12:58*shalokshalom quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:28:43FromDiscord<ynfle> In reply to @Waldecir Santos "Can someone help me": The link doesn't have code
16:28:57FromDiscord<Waldecir Santos> Sorry https://play.nim-lang.org/#ix=3R5M
16:29:36FromDiscord<ynfle> I needs to be var
16:31:14FromDiscord<Phil> In reply to @Elegantbeef "<@180601887916163073>\: there are multiple": I'm starting to believe that templates might actually be a better call for making essentially entirely generic modules, as long as your parameters are very limited. ↵What were the limitations you ran into while using templates, since you noted you played around with that approach
16:31:37FromDiscord<Waldecir Santos> In reply to @ynfle "I needs to be": what is `I`. ? can you show me ?
16:37:37*Gustavo6046 joined #nim
16:52:38FromDiscord<ynfle> it
16:53:06FromDiscord<ynfle> It can't be generic, because you are adding an int to a seq that may not be of int
16:54:44FromDiscord<ynfle> In reply to @Waldecir Santos "what is `I`. ?": https://play.nim-lang.org/#ix=3R69
16:57:34FromDiscord<Waldecir Santos> Oh my example was also wrong it needs to be `obj.list.add` and not `obj.add` too, https://play.nim-lang.org/#ix=t%20wr without var, not sure if this is right tho
16:59:48*jjido joined #nim
17:00:00*slowButPresent joined #nim
17:01:15FromDiscord<ynfle> In reply to @Waldecir Santos "Oh my example was": I'm pretty sure that's not the link you intended
17:01:24FromDiscord<ynfle> But yes, you don't need var because it's a ref object
17:01:37FromDiscord<Waldecir Santos> generated it again https://play.nim-lang.org/#ix=3xc6
17:01:40FromDiscord<ynfle> I personally would avoid something like that and enable strictFuncs
17:03:14FromDiscord<Waldecir Santos> Got it for that I just add this `{.experimental: "strictFuncs".}` to the top of the file, right ?
17:03:55FromDiscord<ynfle> Ya and use a func instead of a proc. I'm sure many would be ok with that, and I'm definitely not an expert programmer
17:05:51FromDiscord<Waldecir Santos> Got it, I did the example to show the same issue I'm having with my code, but the still failing on my code, not sure how to create a small reproducible project
17:06:15FromDiscord<ynfle> In reply to @Waldecir Santos "Got it, I did": Is the code online?
17:06:33FromDiscord<Waldecir Santos> nope
17:06:50FromDiscord<Waldecir Santos> let me see if I can share one file
17:09:59FromDiscord<ynfle> What is the error?
17:10:10FromDiscord<Waldecir Santos> https://play.nim-lang.org/#ix=3R6j
17:10:22FromDiscord<Waldecir Santos> sent a code paste, see https://play.nim-lang.org/#ix=3R6k
17:12:00FromDiscord<Waldecir Santos> I'm using this project to also learn nim so pardon any dumb mistake 😄
17:12:05FromDiscord<ynfle> It's not var
17:18:59FromDiscord<Waldecir Santos> I'm not sure how exactly convert this to use `var` could you show me ?
17:25:19FromDiscord<ynfle> In reply to @Waldecir Santos "I'm not sure how": I can't see you code
17:25:35FromDiscord<Waldecir Santos> https://play.nim-lang.org/#ix=3R6j this ?
17:28:20FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3R6p
17:28:21FromDiscord<ynfle> See the 2 above changes
17:30:36*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:31:05FromDiscord<Waldecir Santos> Oh it worked, thank you, what was the culprit to you based on the error message ?
17:33:10FromDiscord<ynfle> `but expression 'queryset.result_cache' is immutable, not 'var'`
17:33:40FromDiscord<ynfle> `.add` modifies the seq. Seqs can't be modified if that aren't var
17:37:13FromDiscord<Waldecir Santos> queryset being var is enough to make `result_cache` mutable ?
17:52:10FromDiscord<auxym> the default `result` is always var, so `result.result_cache` is mutable
17:58:11FromDiscord<ynfle> In reply to @auxym "the default `result` is": That's not what we are talking about
17:58:21FromDiscord<ynfle> In reply to @Waldecir Santos "queryset being var is": Yes. The whole object is now mutable
17:59:32FromDiscord<auxym> oh, I ctrl-f'd in that playground link for `result_cache`, and the first one that came up is `result.result_cache`
18:03:03*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
18:04:05*ehmry joined #nim
18:10:20FromDiscord<Waldecir Santos> Thank you guys I'm back on track !
18:10:27FromDiscord<ynfle> 👍
18:15:02FromDiscord<Sense> wtf https://media.discordapp.net/attachments/371759389889003532/948282231636525136/unknown.png
18:15:21FromDiscord<Sense> i compiled the executable as cpp one and have this
18:18:27FromDiscord<Sense> solution: pass `--passl="-static-libgcc -static-libstdc++ -flto"`
18:26:28*neurocyte0917090 joined #nim
18:30:58*jjido joined #nim
18:37:30FromDiscord<ynfle> Interesting
19:03:00FromDiscord<Sense> just fucking great... https://media.discordapp.net/attachments/371759389889003532/948294302071660564/unknown.png
19:03:37*kayabaNerve_ quit (Ping timeout: 240 seconds)
19:06:04FromDiscord<ynfle> Compile without -d:release or dange
19:12:35FromDiscord<Sense> In reply to @ynfle "Compile without -d:release or": ok
19:13:44NimEventerNew thread by Dlesnoff: Factorial computation in Nim, see https://forum.nim-lang.org/t/8967
19:19:06FromDiscord<Sense> hm... thanks it seems to be issues with regex library
19:19:09FromDiscord<Sense> ffs
19:40:29FromDiscord<Waldecir Santos> Is it possible to make a property of a object be iterable through the object like in here ?
19:40:35FromDiscord<Waldecir Santos> sent a code paste, see https://play.nim-lang.org/#ix=3R6U
19:40:48FromDiscord<Waldecir Santos> (edit) "https://play.nim-lang.org/#ix=3R6U" => "https://play.nim-lang.org/#ix=3R6V"
19:40:53FromDiscord<Waldecir Santos> (edit)
19:41:23FromDiscord<Sense> ??? https://media.discordapp.net/attachments/371759389889003532/948303959368544306/unknown.png
19:41:39FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3R6W
19:41:54FromDiscord<Waldecir Santos> so the for loop calls items internally, right ?
19:42:14FromDiscord<ynfle> In reply to @Waldecir Santos "so the for loop": Yup
19:42:17FromDiscord<Waldecir Santos> Ty @ynfle I'll try out
19:42:26FromDiscord<ynfle> and pairs if there are two variables
19:44:00*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:59:11*nrds quit (Remote host closed the connection)
19:59:33*madprops quit (Ping timeout: 250 seconds)
20:04:12*madprops joined #nim
20:04:12*madprops quit (Changing host)
20:04:12*madprops joined #nim
20:04:22*xaltsc joined #nim
20:09:06*Gustavo6046_ joined #nim
20:10:01*neurocyte0917090 quit (Quit: The Lounge - https://thelounge.chat)
20:11:06*Gustavo6046 quit (Ping timeout: 268 seconds)
20:12:55*neurocyte0917090 joined #nim
20:20:06*dtomato quit (Quit: Ping timeout (120 seconds))
20:20:25*dtomato joined #nim
20:22:32*Gustavo6046_ quit (Quit: Leaving)
20:22:52*Gustavo6046 joined #nim
20:27:06FromDiscord<b4mbus> What is the nim way of defining an abstract (interface) type, that cannot be instantiated in any way, but it can be referenced in function parameters and derived from so I have some kind of virtual functions?
20:30:09FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#methods
20:35:51FromDiscord<konsumlamm> i'd say concepts are a better fit for that (methods are rarely used), albeit still being experimental: https://nim-lang.github.io/Nim/manual_experimental.html#concepts
20:36:36FromDiscord<konsumlamm> for new-styled concepts (which are even more experimental), see https://github.com/nim-lang/RFCs/issues/168
20:38:07FromDiscord<demotomohiro> But concept doesn't work like virtual function.
20:39:05FromDiscord<konsumlamm> they're the right tool for defining abstract interfaces though
20:39:16FromDiscord<konsumlamm> i'm not sure they actually need virtual functions
20:41:45FromDiscord<demotomohiro> Concept determines which procedure is called at compile time but `method` determines at runtime.
20:47:32*jjido joined #nim
21:01:45FromDiscord<ynfle> They doesn't want that. They want some way to refer to types with out haven't to specify too much.
21:07:44*fowl9 joined #nim
21:09:38*fowl quit (Ping timeout: 272 seconds)
21:09:39*fowl9 is now known as fowl
21:13:45*Gustavo6046_ joined #nim
21:16:28*Gustavo6046 quit (Ping timeout: 268 seconds)
21:24:30*vicfred joined #nim
21:32:00*Gustavo6046__ joined #nim
21:34:27*Gustavo6046_ quit (Ping timeout: 252 seconds)
21:38:07*Gustavo6046__ is now known as Gustavo6046
21:39:04*nrds joined #nim
21:42:15*wyrd quit (Ping timeout: 240 seconds)
21:44:14*Gustavo6046_ joined #nim
21:46:41*Gustavo6046 quit (Ping timeout: 268 seconds)
21:49:21*wyrd joined #nim
21:53:32*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:56:26*jjido joined #nim
22:00:44*jjido quit (Client Quit)
22:22:12*Gustavo6046_ is now known as Gustavo6046
22:29:25*Gustavo6046_ joined #nim
22:30:01*Gustavo6046_ quit (Client Quit)
22:31:42*Gustavo6046 quit (Ping timeout: 268 seconds)
22:48:16*tinytoast joined #nim
22:49:16*blackbeard420_ joined #nim
22:49:28*ltriant_ joined #nim
22:49:36*flynn8 joined #nim
22:50:13*syl_ joined #nim
22:50:13*lumidify quit (Ping timeout: 256 seconds)
22:50:47*ltriant quit (Ping timeout: 256 seconds)
22:50:47*systemdsucks quit (Ping timeout: 256 seconds)
22:50:47*blackbeard420 quit (Ping timeout: 256 seconds)
22:50:47*syl quit (Ping timeout: 256 seconds)
22:50:47*tinystoat quit (Ping timeout: 256 seconds)
22:50:47*flynn quit (Ping timeout: 256 seconds)
22:50:51*flynn8 is now known as flynn
22:51:53*lumidify joined #nim
22:52:19*systemdsucks joined #nim
22:52:28*def- quit (Quit: -)
22:52:39*def- joined #nim
23:05:42*blackbeard420_ quit (Quit: ZNC 1.8.2 - https://znc.in)
23:05:53*blackbeard420 joined #nim
23:07:00FromDiscord<Nick.> Is there something in nim to open a binary file, seek the address and get x bytes. When I open it in a hex editor I know that I need to jump to 0x1006F921
23:07:19FromDiscord<Nick.> Or can point me in the right direction?
23:07:55FromDiscord<Elegantbeef> you can use the stream api or the file api in Nim
23:08:09FromDiscord<Elegantbeef> Both have the abillity to seek to a specific position
23:08:51FromDiscord<Elegantbeef> for streams you'd use `setPosition` for the fileApi you'd use `setFilePos`
23:09:07*neurocyte0917090 quit (Read error: Connection reset by peer)
23:09:38*neurocyte0917090 joined #nim
23:10:42FromDiscord<Nick.> that I've figured but the address 0x1006F921 its in int and I get no results back.
23:10:56FromDiscord<Elegantbeef> Is it perhaps in big endian and you're going too far?
23:11:33FromDiscord<Nick.> Hmm, how would I do that? Not really familiar with that.
23:12:36FromDiscord<Elegantbeef> Try `0x21F90610` instead
23:15:41FromDiscord<Nick.> doesnt work
23:17:29FromDiscord<Nick.> echo(fmt"{a:x}") trying to get the hex value but just returning nothing
23:23:55FromDiscord<Elegantbeef> Could i see the code and the file?
23:25:47FromDiscord<Nick.> sent a code paste, see https://play.nim-lang.org/#ix=3R7J
23:27:11FromDiscord<Elegantbeef> `0x21F90610` is not 4091
23:27:14FromDiscord<Nick.> So im trying to jump to that address and get get 4091 bytes
23:27:41FromDiscord<Elegantbeef> sure and what you're doing now is jumpoing to position `1` and reading 7 bytes
23:28:04FromDiscord<Nick.> Yes, I was testing
23:29:07FromDiscord<Elegantbeef> so you should be doing `strm.setPosition` then `strm.readData` or `strm.readStr`
23:29:35*Gustavo6046 joined #nim
23:31:58FromDiscord<Nick.> With strm.readData how would I work with the buffer pointer?
23:32:00FromDiscord<Rika> I’m confused
23:32:18FromDiscord<Rika> You two seem to not understand each other, it reads like
23:32:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3R7L
23:33:01FromDiscord<Elegantbeef> My understanding rika is they want to offset a file position and read a buffer of data to an array
23:33:23FromDiscord<Rika> Okay
23:34:34FromDiscord<Nick.> I'm trying to read a malicious file read the 4019 bytes at a position and grab the data to xor to get the config. In python I would import pefile.
23:34:39FromDiscord<Nick.> that's basically it.
23:34:50FromDiscord<Elegantbeef> So seems what i said should be fine
23:34:53FromDiscord<Nick.> (edit) "file" => "file."
23:35:39FromDiscord<Rika> Just change the array size lol
23:35:51FromDiscord<Rika> Make it a byte array too
23:36:58FromDiscord<Elegantbeef> ^
23:37:47FromDiscord<Nick.> Error: expression 'readData(strm, unsafeAddr(buff[0]), len(buff))' is of type 'int' and has to be used (or discarded);
23:37:58FromDiscord<Rika> Discard it too
23:38:34FromDiscord<Elegantbeef> Nim forces handling of returned values unless the procedure is marked discardable
23:38:39FromDiscord<Elegantbeef> It's an nice feature imo
23:39:28FromDiscord<Nick.> How would I make it a byte array?
23:39:34FromDiscord<Rika> Change char for byte
23:39:39FromDiscord<Elegantbeef> `array[4019, byte]`
23:39:46FromDiscord<Elegantbeef> Cmon it's right there 😛
23:39:54NimEventerNew question by nimlang: PTR DWORD in nim lang, see https://stackoverflow.com/questions/71315840/ptr-dword-in-nim-lang
23:40:58FromDiscord<Elegantbeef> Damn matrix bridge making me look siilly
23:43:30FromDiscord<Rika> Haha dum
23:43:31FromDiscord<Elegantbeef> Damn yardanico beat me
23:43:39FromDiscord<Rika> What
23:43:48FromDiscord<Elegantbeef> Yardanico responded to the SO post
23:43:58FromDiscord<Elegantbeef> Somehow the person lied about their runtime eitherway
23:44:36FromDiscord<Elegantbeef> passing `cast[pointer](zeroInitedInt)` to a procedure didnt result in a nil error is just a plain lie, i refuse to believe otherwise