<< 04-11-2021 >>

00:58:34FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3DVp
01:01:47FromDiscord<codic> how can I return nth element of a seq by ref?
01:02:07FromDiscord<Elegantbeef> return `var Client`
01:02:26FromDiscord<Elegantbeef> use `std/decls.byaddr` to hold onto a pointer to that
01:02:35FromDiscord<Elegantbeef> I do the same in my WM
01:03:28FromDiscord<Elegantbeef> https://github.com/beef331/goodwm/blob/6c48f78b85c29d986462211f8f022c8101ce93a7/src/goodwm/desktops.nim#L20
01:03:29FromDiscord<Elegantbeef> If you want reference
01:07:49FromDiscord<Elegantbeef> Though if you hold onto it longer than you should it'll error
01:08:05FromDiscord<Elegantbeef> Not error but cause bugs since it'll be a dangling pointer
01:41:31FromDiscord<codic> 👍
01:43:20FromDiscord<codic> cool nice
01:43:24FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3DVy
01:43:34FromDiscord<Elegantbeef> That's not going to work
01:44:02FromDiscord<Elegantbeef> `Option` wrapping a `var Client` is not valid since it can outlive the life of the wm
01:44:33FromDiscord<Elegantbeef> You're either going to need views, or use a ptr here and manually manage the lifetimes
01:50:01*xet7 joined #nim
01:59:23FromDiscord<evoalg> @ElegantBeef I'm just checking ... if I never want to use nim for interfacing with C libs (or another non-nim libs), can I get away with not learning pointers & ref's, or will I be limited? (I don't know if I'm explaining myself well)
02:00:05FromDiscord<Elegantbeef> Well you'll want to learn ref semantics and the like, but you might be able to. I wouldnt be scared of them Nim makes them quite easy to use
02:00:22FromDiscord<Elegantbeef> Nim has some of the better pointer semantics imo
02:01:04FromDiscord<evoalg> what are ref's good for? ... I've seen them in the docs, but it doesn't really say what I'd need them? Sorry for the noob questions I keep asking
02:01:06FromDiscord<Elegantbeef> Pointers afterall are just integers they're not that scary
02:02:01FromDiscord<Elegantbeef> Refer to this writeup https://forum.nim-lang.org/t/8426#54529
02:02:09FromDiscord<Elegantbeef> It probably should be expanded and added to the manual
02:02:27FromDiscord<evoalg> Hehe I guess reading people having problems with pointers in this channel was scaring me. OK I'll ready that - thank you! 🙂
02:03:19FromDiscord<Elegantbeef> Pointers are legitmately just an address to memory, they're not that scary in Nim since we know that they're not an array or are an array thanks to the type system
02:03:49FromDiscord<Elegantbeef> In C you might have a `char` which is a ptr to a char, but you can do `yourCharPtr[3]` wheras in nim it'd be a `ptr UncheckedArray[char]` to be able to do that
02:04:07FromDiscord<Elegantbeef> A `ptr char` cannot be indexed in Nim
02:04:13FromDiscord<Elegantbeef> Many modern languages do this though
02:05:15FromDiscord<Elegantbeef> if you've ever used a `var T` parameter in a procedure you've already used pointers btw
02:05:42FromDiscord<evoalg> In reply to @Elegantbeef "if you've ever used": Oh! ok hehe
02:06:05FromDiscord<Elegantbeef> Though these pointers are special in that they're ensured they do not outlive the proc
02:06:28FromDiscord<Elegantbeef> Which is for a safety reason that you might have a pointer to the stack that becomes a dangling pointer
02:07:05FromDiscord<Elegantbeef> What language do you come from again?
02:07:09FromDiscord<evoalg> "dangling pointer" <-- see what I mean about these scary words? 😉
02:07:23FromDiscord<evoalg> python ... but I'm not expert in python
02:07:36FromDiscord<impbox [ftsf]> a pointer to memory that's no longer valid
02:07:40FromDiscord<Elegantbeef> Well it's not that scary since nim doesnt allow you to do it unless you do it "unsafely"
02:08:04FromDiscord<impbox [ftsf]> but yeah, pointers are a lot less scary in nim
02:08:38FromDiscord<Elegantbeef> I learned pointers in Nim and yea they're nice here
02:08:41FromDiscord<Elegantbeef> You dont have ambiguity
02:08:41FromDiscord<impbox [ftsf]> you can still mess yourself up with them, but you rarely need to do unsafe things unless you're interfacing with C
02:09:08FromDiscord<Elegantbeef> Or getting around the language safety rails
02:11:21FromDiscord<codic> In reply to @Elegantbeef "`Option` wrapping a `var": oh
02:11:24FromDiscord<codic> that's sad
02:11:26FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3DVF
02:11:30FromDiscord<Elegantbeef> Like i said codic you cannot capute `var` without views
02:11:35FromDiscord<Elegantbeef> You can make it a `ptr Client`
02:11:45FromDiscord<Elegantbeef> Assuming you know it's safe to do
02:12:13FromDiscord<Elegantbeef> To be safe `WM` will not be destroyed whilst the `Option[ptr Client]` exists
02:12:21FromDiscord<Elegantbeef> or just `ptr Client` exists
02:13:11FromDiscord<Elegantbeef> And i guess you dont resize clients whilst it's open
02:13:16FromDiscord<Elegantbeef> whilst it exists\
02:13:23FromDiscord<codic> It won't be destroyed
02:13:42FromDiscord<codic> Yeah I'll use raw pointers
02:13:47FromDiscord<Elegantbeef> Well if you remove entries it will be throttled aswell
02:13:53FromDiscord<codic> ?
02:14:08FromDiscord<Elegantbeef> So be extra certain you do not mutate the `clients` whilst you have that ptr
02:14:30FromDiscord<codic> what if I want to mutate the clients while I have the pointer, what can I do then?
02:14:54FromDiscord<codic> what if I don't use the pointer
02:14:55FromDiscord<codic> eg
02:15:01FromDiscord<Elegantbeef> hmmm `seq[ref Client]`
02:15:09FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3DVH
02:15:10FromDiscord<codic> is this ok for a seq[Client]?
02:15:20FromDiscord<Elegantbeef> Yea should be fine
02:15:29FromDiscord<codic> (edit) "https://play.nim-lang.org/#ix=3DVH" => "https://play.nim-lang.org/#ix=3DVI"
02:15:31FromDiscord<codic> yeah thats all I need to do as far as removing 👍
02:15:40FromDiscord<Elegantbeef> Enabling views has the compiler handle it for you btw 😀
02:15:42FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3DVJ
02:15:58FromDiscord<codic> views look epic
02:15:59FromDiscord<codic> but experimental sad
02:16:07FromDiscord<Elegantbeef> Indeed
02:16:26FromDiscord<Elegantbeef> The compiler is much better at reasoning lifetimes than mere mortals sadly
02:16:34FromDiscord<Rika> I cut myself on the edge of experimental once
02:16:44FromDiscord<Elegantbeef> Damn was it bleeding?
02:16:55FromDiscord<Rika> Yeah
02:16:58FromDiscord<codic> I'll use raw pointers then when it makes it into stable I'll rewrite to use far superior lent
02:17:09FromDiscord<codic> I'm rewriting my rust wm rn because rust sucks
02:17:21FromDiscord<Rika> Why do you think so
02:17:38FromDiscord<Rika> Ah writing it sucks I guess
02:17:55FromDiscord<Rika> Otherwise it’s pretty good as long as it’s not me who’s writing it 🙂
02:17:56FromDiscord<codic> you have to prove to compiler that stuff is safe in twisted ways
02:18:00FromDiscord<codic> lol yeah
02:18:22FromDiscord<codic> for example I can't store &'a mut Client or something so I had to store an index instead and index into the Vec every time
02:18:39FromDiscord<codic> or I couldn't return mutable reference from function while other functions in the caller function mutably borrow
02:18:47FromDiscord<codic> it's just shit to write
02:19:00FromDiscord<codic> but in some aspects its really awesome
02:19:06FromDiscord<codic> https://github.com/codic12/worm/blob/main/src/wm.rs this was the code
02:19:10FromDiscord<Rika> It’s probably a conceptual difference between how you think and what the compiler was made for or so
02:19:55FromDiscord<codic> Yeah but there are just some things Rust can't do safely that logically makes sense
02:20:18FromDiscord<codic> The ultimate task can still be achieved you just have to do it in a way that makes the borrow checker happy rather than the way that makes you happy
02:20:31FromDiscord<codic> I wanted to write this in Zig but Zig's standard library changes too much for me atm
02:20:37FromDiscord<Elegantbeef> Or you enter `unsafe` and then get flamed by the armchair programmers
02:21:53FromDiscord<codic> yes
02:22:22FromDiscord<codic> Really if Rust was `unsafe` by default and had a `safe` keyword I would consider it the best language in the world
02:22:40FromDiscord<Elegantbeef> And people wouldnt use it
02:23:11FromDiscord<codic> People would still use it
02:23:15FromDiscord<codic> People use Nim
02:23:26FromDiscord<Rika> Much less than now
02:23:35FromDiscord<Rika> Rust has a different goal from Nim’s
02:23:45FromDiscord<Rika> Rust’s point is safety
02:24:08FromDiscord<codic> sure, and I might write my rocket system in Rust
02:24:25FromDiscord<codic> although if I was writing a rocket system, I might use even safer Ada
02:24:41FromDiscord<codic> or if I was writing google's servers, I might want to use rust
02:24:55FromDiscord<Rika> I really wish the formal proving system in Nim didn’t die
02:24:56FromDiscord<codic> but if I'm just writing code to use on people's computers for fun, I don't need the focus on safety and the costs that come with it
02:25:02FromDiscord<codic> sounds cool what was that
02:25:16FromDiscord<codic> isn't there that dr nim thing which does thta
02:25:17FromDiscord<codic> (edit) "thta" => "that"
02:25:25FromDiscord<Rika> Same thing that makes Ada safe I would say
02:25:54FromDiscord<Elegantbeef> it's not dead as much as not developed 😛
02:26:29FromDiscord<Rika> Essentially dead to me
02:26:39FromDiscord<Rika> I’m working on figuring out how to help
02:26:47FromDiscord<Elegantbeef> I want some intelligent value/type narrowing
02:27:03FromDiscord<Rika> That would be nice too
02:28:04FromDiscord<Elegantbeef> making the CT smarter will give some aspects of the prover, not a guarantee but more CT errors!
02:48:05FromDiscord<codic> nim is awesomely productive , chad
02:59:54*neurocyte0132889 quit (Ping timeout: 268 seconds)
03:02:57*krux02 quit (Remote host closed the connection)
03:08:09*rockcavera quit (Remote host closed the connection)
03:42:25*arkurious quit (Quit: Leaving)
03:56:59*CyberTailor joined #nim
03:57:55CyberTailorare there any specifications (like python PEPs) regarding nim packaging and distribution?
04:06:02*supakeen quit (Quit: WeeChat 3.3)
04:06:32*supakeen joined #nim
04:15:53FromDiscord<huantian> there's some info in the nimble readme
04:55:47FromDiscord<creatable> hey there, i'm trying to use nimgl's imgui package but when i use the C++ target and try to distribute a compiled version of my project it depends on libgcc, and when i use the C target i have to distribute my exe with a cimgui dll included alongside it. is there any way to either statically link cimgui with nimgl/imgui, or to statically link libgcc so i can only distribute the exe?
05:23:16FromDiscord<creatable> this also occurs when i include the dll anywhere else: https://media.discordapp.net/attachments/371759389889003532/905688624425762856/unknown.png
05:23:23FromDiscord<creatable> (edit) "anywhere else:" => "on another computer:"
05:25:02FromDiscord<impbox [ftsf]> it's pretty normal to include dlls alongside your app on windows
05:25:48FromDiscord<impbox [ftsf]> you can probably build a static cimgui
05:27:16FromDiscord<impbox [ftsf]> yeah, pretty easy to make cimgui.a
05:27:51FromDiscord<impbox [ftsf]> just edit the CMakeCache.txt and set `IMGUI_STATIC:STRING=yes` then run `make`
06:00:14NimEventerNew Nimble package! config - A library for working with the CFG configuration format, see https://docs.red-dove.com/cfg/index.html
06:05:11NimEventerNew thread by Kobi: Survey Question: flow research, see https://forum.nim-lang.org/t/8590
07:28:14FromDiscord<haxscramper> Not going into the "why another format", but damn they have a good docs and test↵(<@709044657232936960_=4eim=45venter=5b=49=52=43=5d>)
07:28:53FromDiscord<haxscramper> Almost impossible to find GitHub link though, I had to to go the PR to nimble package list - https://github.com/vsajip/nim-cfg-lib
07:30:07FromDiscord<haxscramper> It is find of similar to the https://dhall-lang.org/ in terms of features as I can see
07:32:05FromDiscord<Elegantbeef> The accessing environment variables is a bit off though
07:35:18FromDiscord<Rika> Well it’s implementation dependent
07:40:18FromDiscord<haxscramper> It is kind of close to the .cfg that compiler implements
07:40:27FromDiscord<haxscramper> No conditional configuration
07:40:36FromDiscord<haxscramper> But environment variables are ok
07:40:47FromDiscord<haxscramper> Though I would also prefer some special syntax for this
07:41:02FromDiscord<haxscramper> At least something like $env\:home
08:11:56*mahlon quit (Ping timeout: 268 seconds)
08:13:19*mahlon joined #nim
08:39:00FromDiscord<evoalg> wait ... there is inim interactive nim?
08:39:35FromDiscord<Elegantbeef> inim is a user made repl for Nim
08:39:42FromDiscord<Elegantbeef> There is also `nim secret` but it's using the VM
08:40:22FromDiscord<evoalg> oh I need to look up nim secret
08:40:31FromDiscord<Elegantbeef> As the name imples it's a secret
08:40:39FromDiscord<Elegantbeef> you just do `nim secret` and get a VM reepl
08:42:21FromDiscord<evoalg> why is it a secret?
08:43:13*mahlon_ joined #nim
08:43:42FromDiscord<Elegantbeef> I think it's not as developed as desired, i dont know
08:44:02*mahlon quit (Ping timeout: 260 seconds)
08:44:36FromDiscord<evoalg> ok I'll follow the first rule 😉
08:45:37FromDiscord<Elegantbeef> This isnt fight club
08:45:46FromDiscord<Elegantbeef> It's not a hush hush thing 😛
08:48:56*mahlon_ quit (Ping timeout: 268 seconds)
08:59:03FromDiscord<evoalg> when you want to test sometime quickly, do you use "nim --eval" ?
08:59:35FromDiscord<evoalg> something
08:59:35FromDiscord<Elegantbeef> Nope i do `nvim /tmp/some.nim`
09:00:09*Theodore[m] quit (Quit: You have been kicked for being idle)
09:04:59*mahlon_ joined #nim
09:19:47*vicecea quit (Remote host closed the connection)
09:20:18*vicecea joined #nim
09:56:30FromDiscord<Zajt> I get `(74, 1) Error: nestable statement requires indentation` here - but I don't see what's wrong indentation here https://media.discordapp.net/attachments/371759389889003532/905757390039826432/unknown.png
10:05:20FromDiscord<Rika> Probably needs more context
10:10:38*Vladar joined #nim
10:42:27FromDiscord<Zajt> What more context do you need?
10:42:41FromDiscord<Zajt> It says the line number there I think but nothing more
10:42:46FromDiscord<Zajt> (edit) "It says the line number there I think but nothing more ... " added "than what I pasted"
10:44:08FromDiscord<Rika> Above the lines and below the lines
10:44:18FromDiscord<Rika> There is still one indent level
10:47:51FromDiscord<Zajt> Here is the full function https://media.discordapp.net/attachments/371759389889003532/905770308894597180/unknown.png
10:48:28FromDiscord<Zajt> On line 77 there, a new function starts
10:48:38FromDiscord<Zajt> (edit) "starts" => "starts, but it's on line 74 it says the indendation is wrong"
10:48:50FromDiscord<Zajt> (edit) "indendation" => "indentation"
10:51:27FromDiscord<Rika> It looks correct really
10:52:24FromDiscord<Rika> Yeah I don’t see anything wrong
11:06:43FromDiscord<federico3> https://blog.sesse.net/blog/tech/2021-11-04-09-48_superopt.html
11:08:26FromDiscord<Rika> ?
11:15:08FromDiscord<demotomohiro> @evoalg I use this plugin to test a short nim code from nvim.↵https://github.com/rhysd/wandbox-vim↵So I don't need to save a code to storage and I can use a devel nim without compiling it myself.↵But I cannot use a nimble packages.
11:15:44FromDiscord<evoalg> interesting
11:25:55FromDiscord<qb> In reply to @treeform "You can use Color": Thanks. I'm trying to render that screenshot now with glfw with no success. I'm able to render your `readtime_glfw` example but not that screenshot. Do you might know whats going on? https://play.nim-lang.org/#ix=3DYe
11:44:24FromDiscord<Zajt> In reply to @Rika "It looks correct really": Yeah I even confirmed now and it's only tabs and not spaces before each line
11:44:52FromDiscord<Rika> Oh
11:44:57FromDiscord<Rika> Lol Nim doesn’t work with tabs
11:51:09FromDiscord<enthus1ast> Comment stuff out until the error is gone↵(@Zajt)
11:51:33FromDiscord<enthus1ast> Then you know what causes the issue
11:53:43FromDiscord<enthus1ast> I would start with the defer
11:54:43FromDiscord<Zajt> https://media.discordapp.net/attachments/371759389889003532/905787138497445928/unknown.png
11:54:54FromDiscord<Zajt> `out.nim(54, 1) Error: nestable statement requires indentation`
11:55:07FromDiscord<Zajt> so it says indentation is wrong on a line that is outcommented, wtf
11:55:35FromDiscord<enthus1ast> Ok that's weird
11:56:15FromDiscord<enthus1ast> Then I guess the error is at the top of your file
11:56:46FromDiscord<enthus1ast> Can you share the whole file in a nim playground?
11:59:30FromDiscord<enthus1ast> I bet there is a '\:' somewhere that causes the issue
12:02:31FromDiscord<willyboar> i believe the problem is tabs or 4 spaces
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:04FromDiscord<Zajt> shouldn't you use 4 spaces if tabs are not allowed?
12:06:13FromDiscord<enthus1ast> I use 2
12:06:31*supakeen joined #nim
12:06:48FromDiscord<enthus1ast> But the error message would be different if you mix both
12:07:19FromDiscord<enthus1ast> You can see it with vscode when you select everything
12:07:35FromDiscord<enthus1ast> Tab is -\> space is .
12:07:48FromDiscord<Zajt> I guess I'll rewrite everything in a new file and see if that works
12:13:38FromDiscord<enthus1ast> And I would also let your editor autoconvert tabs to spaces
12:13:42FromDiscord<enthus1ast> https://stackoverflow.com/questions/36814642/visual-studio-code-convert-spaces-to-tabs
12:13:50FromDiscord<enthus1ast> But I guess this is not the issue
12:31:39FromDiscord<Zajt> I rewrote it and don't have that error right now so it seemed to be fix. But I'm getting this error `out.nim(81, 9) Error: expected: ')', but got: 'status'` https://media.discordapp.net/attachments/371759389889003532/905796429610631178/unknown.png
12:32:09FromDiscord<Zajt> What's wrong here? I don't see any paranthesis missing
12:50:04FromDiscord<Zajt> I got this part of the code but get this error `out.nim(81, 9) Error: expected: ')', but got: 'status'`↵But I don't see that any paranthesis is missing there, what is wrong here? https://media.discordapp.net/attachments/371759389889003532/905801068217253928/unknown.png
12:53:46FromDiscord<enthus1ast> What is '&'? Should be addr imho
12:54:03FromDiscord<enthus1ast> Or some overload i do not know
12:55:54*rockcavera joined #nim
12:55:55*rockcavera quit (Changing host)
12:55:55*rockcavera joined #nim
12:58:18FromDiscord<Zajt> reference to a variable
12:58:54FromDiscord<Rika> & doesnt exist in nim
12:58:57FromDiscord<Rika> use addr
12:59:13FromDiscord<Rika> `addr sectionHandle`
12:59:46FromDiscord<el__maco> does NULL exist in Nim?
13:01:50FromDiscord<haxscramper> `nil`
13:03:41FromDiscord<Rika> afaik defined by winim prolly
13:05:59FromDiscord<Zajt> I removed all & and replaced with `addr` but still get that same error on that line
13:19:41FromDiscord<exelotl> In reply to @Zajt "I removed all &": it's also `or` instead of `|`
13:21:13FromDiscord<Zajt> In reply to @exelotl "it's also `or` instead": ah okay I fixed that, but still same error
13:22:27FromDiscord<Rika> more context please, upper lines
13:22:34FromDiscord<Rika> until the indent level
13:43:42FromDiscord<Zajt> https://media.discordapp.net/attachments/371759389889003532/905814563566542848/unknown.png
13:43:55FromDiscord<Zajt> and still error `out.nim(81, 9) Error: expected: ')', but got: 'status'`
13:44:41FromDiscord<Zajt> Anything there which looks like wrong syntax?
13:59:09FromDiscord<dangbinghoo> is there any way to use `concepts` in nim 1.6 ?
14:06:43*arkurious joined #nim
14:19:04FromDiscord<enthus1ast> @Zajt\: i think it will be best when you just share the code on eg https://play.nim-lang.org/
14:20:05FromDiscord<enthus1ast> what i do spot though, is `sectionSize = { size }` propably wrong but who knows \:)
14:20:31FromDiscord<Zajt> In reply to @enthus1ast "<@290456415963709440>\: i think": https://play.nim-lang.org/#ix=3DZc here it is
14:21:06FromDiscord<Zajt> In reply to @enthus1ast "what i do spot": how can that be written? I basically wanted to translate this line from cpp to Nim `LARGE_INTEGER sectionSize = { size };`
14:22:05FromDiscord<vindaar> @dangbinghoo\: yeah, sure. Are you thinking about the old or new concepts? The latter still miss a bunch of features, as far as I know
14:29:30FromDiscord<lytedev> Quick question for y'all wizards:↵↵I'm using this library (https://nimble.directory/pkg/nimrcon) which seems to be failing to export to export the main type
14:30:52FromDiscord<enthus1ast> @Zajt\: there are so many things in your code
14:31:03*CyberTailor left #nim (Konversation terminated!)
14:31:30FromDiscord<enthus1ast> i think you should go step by step and fix them
14:31:31FromDiscord<enthus1ast> eg
14:32:40FromDiscord<enthus1ast> memcopy ( should be copyMem in nim), ↵NtCreateSection, NtCreateSection etc not defined (when theyre not in winim you must define them yourself)
14:33:22FromDiscord<enthus1ast> never seend this before\: @(str.toOpenArrayByte(0, str.high))
14:33:25FromDiscord<enthus1ast> prolly @[]
14:33:43FromDiscord<enthus1ast> strformat not imported
14:35:54FromDiscord<Zajt> NtCreateSection are defined in another file
14:37:01FromDiscord<Zajt> In reply to @enthus1ast "prolly @[]": should it be @[(str.toOpenArrayByte(0, str.high] instead or?
14:37:14FromDiscord<lytedev> sent a code paste, see https://paste.rs/nPO
14:37:48FromDiscord<lytedev> (edit) "https://play.nim-lang.org/#ix=3DZr" => "https://play.nim-lang.org/#ix=3DZq"
14:39:37FromDiscord<enthus1ast> think you can just write\:↵↵str.toOpenArrayByte(0, str.high)
14:40:20FromDiscord<enthus1ast> should it be just a openarray or a seq that contains a openarray
14:40:21FromDiscord<enthus1ast> ?
14:40:31FromDiscord<enthus1ast> (which i think does not work)
14:44:28FromDiscord<enthus1ast> @Zajt\: sleepAndCheck not defined
14:45:22FromDiscord<enthus1ast> maybe, just maybe you should write a little not so l33t code to lean a little nim ;)
14:46:47FromDiscord<enthus1ast> what does this do in c?↵`LARGE_INTEGER sectionSize = { size };`
14:47:20FromDiscord<enthus1ast> is {} not a array constructor?
14:48:08FromDiscord<el__maco> its also a struct initializer
14:48:19FromDiscord<el__maco> LARGE_INTEGER seems to be an enum
14:48:25FromDiscord<el__maco> (edit) "enum" => "union"
14:48:51FromDiscord<el__maco> (edit) "an" => "a"
14:49:51FromDiscord<enthus1ast> then LARGE\_INTEGER should be an nim object
14:50:12FromDiscord<enthus1ast> but this i do not know for sure
14:50:26FromDiscord<enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/905830084114522202): maybe, just maybe you should write a little not so l33t code to learn a little nim ;)
14:50:51FromDiscord<dangbinghoo> In reply to @vindaar "<@737477820288204881>\: yeah, sure. Are": the only thing I need to do is to constaint a type has/impl a several set of procs (like interface in D or traits in rust)
14:51:00FromDiscord<el__maco> I think instead of LARGE_INTEGER you could use a regular Nim int perhaps?
14:51:16FromDiscord<enthus1ast> yeah
14:51:21FromDiscord<el__maco> it seems to me that LARGE_INTEGER is just a 64 bit integer
14:51:36FromDiscord<el__maco> and some clunky boilerplate for systems that don't support it
14:52:11FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3DZy
14:52:46FromDiscord<enthus1ast> maybe you can use the asyncFd as a hash
14:52:58FromDiscord<el__maco> oh boy, using pointers as hash values. Wouldn't recommend
14:54:33FromDiscord<ajusa> In reply to @enthus1ast "maybe you can use": can't do that because it's a private field in Nim :/↵https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncnet.nim#L113
14:54:56FromDiscord<enthus1ast> at least for me it was working with the asyncFd as a hash, but i just wanted to store connections back then, but i think the better solution would be if you assign a generated identifier (uuid?)
14:55:06FromDiscord<Zajt> In reply to @el__maco "I think instead of": I'll try to use a regular int instead
14:55:52FromDiscord<enthus1ast> @lytedev\: fork it and make a pr
14:56:01FromDiscord<ajusa> In reply to @enthus1ast "at least for me": Well when a connection exits I wanted to be able to remove it in O(1) time rather than iterating and searching for the UUID
14:56:06FromDiscord<Zajt> But it's really weird nim doesn't tell me where the error is but instead outputs some bullshit that a paranthesis is missing
14:56:13FromDiscord<Zajt> (edit) "But it's really weird nim doesn't tell me where the error is but instead outputs some bullshit that a paranthesis is missing ... " added "which is not the case"
14:56:18FromDiscord<Zajt> (edit) "case" => "case. This makes it difficult to debug"
14:56:28FromDiscord<enthus1ast> your code is full of errors↵(@Zajt)
14:56:28FromDiscord<lytedev> That's what I'm thinking. Thank you!
14:56:52FromDiscord<Zajt> In reply to @enthus1ast "your code is full": yeah it might be, but the error message still makes no sense
14:57:57FromDiscord<enthus1ast> yes if you JUST want to store the Websocket, then i would go with hashing the asyncFd of the websocket, but i can imagine, that the Websocket is just one part of your client.↵(@ajusa)
14:59:20FromDiscord<enthus1ast> sent a long message, see https://paste.rs/evW
14:59:58FromDiscord<ajusa> In reply to @enthus1ast "so eg\: ● client": Got it. I was trying to do table[client, user data] which might be somewhat backwards. I'll try that and see how it works, thanks!
15:00:58FromDiscord<Shikata Ga Nai> Hello, I'm a noob programmer and I'm trying to go through the Nim Basics exercises... I know there can be multiple solutions or ways to go about it but are there solutions to be found anywhere? I'm stuck and would like to see another person's code as hint.
15:01:12FromDiscord<Shikata Ga Nai> https://media.discordapp.net/attachments/371759389889003532/905834064525803520/unknown.png
15:01:42FromDiscord<Shikata Ga Nai> is where I'm at https://media.discordapp.net/attachments/371759389889003532/905834190312972360/unknown.png
15:03:34FromDiscord<enthus1ast> you cannot just add to an array, for this you need a sequence.
15:03:43FromDiscord<enthus1ast> what you can do is\:↵↵a[0] = 10
15:03:50FromDiscord<enthus1ast> a[idx] = myNum
15:04:17nrds<Prestige99> for countup can you get the value and index back? Like for (i, val) in countup(10, 100, 10)
15:04:53nrds<Prestige99> hm guess not
15:04:59FromDiscord<dom96> In reply to @enthus1ast "yes if you JUST": +1 to this, it's likely you have other data that is associated with each client
15:07:00FromDiscord<treeform> In reply to @qb "Thanks. I'm trying to": Does the `#shot.writeFile("screenshot.png")` write correct thing?
15:07:36FromDiscord<enthus1ast> imho paris SHOULD work \:)
15:09:22FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3E07
15:09:50FromDiscord<enthus1ast> but toSeq should not be needed here, one should open an issue
15:17:28FromDiscord<Shikata Ga Nai> yeah your workaround def works, thanks!↵should be able to complete this exercise without importing any modules... question indicates it should be able to be completed by filling an array using a for loop so idk
15:18:08FromDiscord<qb> In reply to @treeform "Does the `#shot.writeFile("screenshot.png")` write": Yea the `writeFile` saves a perfect screenshot. Boxy looks perfect for my case except that I need the mousebutton passthrough which the current glfw build supports and nimgl aswell: https://github.com/nimgl/nimgl/blob/master/src/nimgl/glfw.nim#L653
15:19:01FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3E0a
15:19:03FromDiscord<Rika> im not sure if i fucked something up there but
15:19:56FromDiscord<treeform> In reply to @qb "Yea the `writeFile` saves": Can you display an image that is not a screenshot, but some thing you just load? I think openGL code might have an issue then.
15:20:19FromDiscord<treeform> I never done mousebutton passthrough or transparent windows
15:21:23FromDiscord<qb> Oh I could actually use boxy with nimgl right
15:21:47FromDiscord<enthus1ast> yes Rika's solution is the best
15:22:07FromDiscord<enthus1ast> but pairs should also work \:)
15:28:42FromDiscord<Rika> pairs should work but why would you do that, it has an extra heap alloc prolly
15:28:46FromDiscord<Rika> use std/enumerate if you really want
15:29:24FromDiscord<Rika> https://nim-lang.org/docs/enumerate.html
15:33:58FromDiscord<treeform> In reply to @qb "Oh I could actually": In theory yes, I have never done so.
15:36:58FromDiscord<enthus1ast> strange that we have pairs and enumerate
15:37:23FromDiscord<Rika> enumerate came much later than pair
15:37:24FromDiscord<Rika> s
15:56:22FromDiscord<qb> In reply to @treeform "In theory yes, I": This works. Feels pretty hacky. Boxy requires `loadExtensions` by the opengl library so I can't use nimgl's opengl bindings. When exactly does boxy call `glClear`? Also could I use boxy alone to create the screenshot image? I feel like I've imported a lot of power in that code 😄 https://play.nim-lang.org/#ix=3E0q
15:58:37FromDiscord<treeform> boxy calls glClear when you `beginFrame`
15:59:04FromDiscord<treeform> boxy uses pixie, what do you mean by alone?
15:59:28FromDiscord<treeform> I don't think you need line 42 to line 48, boxy does all that
15:59:43FromDiscord<treeform> Ideally you would not need to import any opengl bindings if you use boxy
16:00:25FromDiscord<qb> I want that 0, 0 is lower left. Is that how boxy sets it up?
16:01:00FromDiscord<treeform> no boxy is 0,0 is top left
16:01:56FromDiscord<treeform> you could probably apply boxy scale and translate to get to lower left coordinate system but I think its more trouble then its worth.
16:02:25FromDiscord<qb> https://media.discordapp.net/attachments/371759389889003532/905849474243498004/Bildschirmfoto_von_2021-11-04_17-02-08.png
16:02:26FromDiscord<qb> 😄
16:02:57FromDiscord<qb> Pretty happy with it thanks a lot
16:04:09FromDiscord<qb> Not sure why it works now without 42-48 since I've used `bxy.drawImage("shot", vec2(0, 0))` it should render from top left right? Sorry, I'm still new to all that
16:04:52FromDiscord<treeform> 0,0 is top left
16:05:05FromDiscord<treeform> and images draw in x+ y+ direction?
16:09:07*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
16:12:20*tiorock joined #nim
16:12:21*tiorock quit (Changing host)
16:12:21*tiorock joined #nim
16:12:21*rockcavera quit (Killed (strontium.libera.chat (Nickname regained by services)))
16:12:21*tiorock is now known as rockcavera
16:25:03FromDiscord<qb> Well I just killed my de with it. Gonna play with it some other day. Thanks a lot again. Would be cool if it would be possible to setup a own matrix in combination with boxy.
16:25:27FromDiscord<qb> In reply to @treeform "boxy uses pixie, what": Was wondering if I still need to import pixie. But seems like boxy includes pixie
16:28:45*tiorock joined #nim
16:28:45*tiorock quit (Changing host)
16:28:45*tiorock joined #nim
16:28:45*rockcavera is now known as Guest8853
16:28:45*Guest8853 quit (Killed (lithium.libera.chat (Nickname regained by services)))
16:28:45*tiorock is now known as rockcavera
16:33:02*tiorock joined #nim
16:33:02*tiorock quit (Changing host)
16:33:02*tiorock joined #nim
16:33:02*rockcavera is now known as Guest5232
16:33:02*Guest5232 quit (Killed (tungsten.libera.chat (Nickname regained by services)))
16:33:02*tiorock is now known as rockcavera
16:47:51FromDiscord<Professor Actual Factual> When calling on C code that needs to be free'd, is it best to put it in a try-catch in case the program crashes?↵Do program crashes in C code cause memory leaks?
16:48:57FromDiscord<Yardanico> In reply to @Professor Actual Factual "When calling on C": try/except won't work if the C side errors crashes (with SIGSEGV or something similar) to begin with
16:49:32FromDiscord<Professor Actual Factual> In reply to @Yardanico "try/except won't work if": Whats the best way to go about this then?
16:49:34FromDiscord<Yardanico> try/except only works with Nim exceptions (and C++ exceptions when compiled with the C++ backend)
16:49:56FromDiscord<Yardanico> In reply to @Professor Actual Factual "Whats the best way": ensure that you're not calling the C code in an erroneous way?
16:50:18FromDiscord<tandy> sorry, went to bed \:) tictactoe with an AI player using the minimax algorithm
16:50:40FromDiscord<Yardanico> In reply to @Professor Actual Factual "Whats the best way": can you provide some more info about what C code are you trying to call and why is it crashing on free?
16:52:38FromDiscord<Professor Actual Factual> In reply to @Yardanico "can you provide some": just wrapping a DB implementation from C.↵Im kind of worried that if a user does CRTL+C midway through the process or run out of disk space they will get memory leak.↵Wanted to know the best way to avoid this.
16:52:58Amun-Rause defer
16:53:18FromDiscord<Yardanico> even better - wrap your C stuff in objects and use destructors :)
16:53:35FromDiscord<Yardanico> @Professor Actual Factual also, not sure I understand - if a user does Ctrl+C midway, then the program will terminate and all the process memory will be automatically free'd anyway
16:54:02FromDiscord<Professor Actual Factual> The C code has to be free'd manually for this one.
16:54:08Amun-Rayes, but freeing memory the proper way is good practice
16:54:48FromDiscord<Professor Actual Factual> Does C code get free'd from a CRTL-C or other errors? I thought not.
16:55:33Amun-Rayes, OS will take care of that (you shouldn't leak mem anyway tho)
16:56:59FromDiscord<el__maco> there is an argument to be made to avoid freeing memory at the end of your program, because the OS will do that, and it will do it more efficiently than you
16:57:14Amun-RaI finished supporting another old format for my image viewer in Nim: https://postimg.cc/vcBNDjyT
16:57:21FromDiscord<Professor Actual Factual> Ok thats good to know. Thanks everyone 🙂
16:57:50Amun-RaProfessor: I'm using defer for those situations
16:58:07FromDiscord<Yardanico> @Amun-Ra that's fine, but IMO destructors are cleaner and better to use :)
16:58:13FromDiscord<Yardanico> they especially work amazing with ARC
16:58:27FromDiscord<Yardanico> (that said, they work with refc too)
16:58:43Amun-RaYardanico: right, they are; I don't use ref that much personally
16:58:52FromDiscord<Yardanico> not sure I understand
16:58:55FromDiscord<Yardanico> destructors don't need `ref`
16:59:02Amun-Rahmm
16:59:04FromDiscord<Yardanico> You can have a normal `object` and have a destructor defined for it
16:59:53Amun-RaI must have missed that detail, thanks
17:00:48FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3E0U
17:01:40FromDiscord<Yardanico> and then you can also test memory leaks with `--gc:orc` (or arc if you're sure you don't have cycles) and `-d:useMalloc`
17:01:43FromDiscord<Yardanico> then valgrind will work just fine
17:02:55FromDiscord<Yardanico> see https://nim-lang.org/docs/destructors.html
17:33:54FromDiscord<Professor Actual Factual> Can you explain what cycles are via code example? Or possibly share some resources on the topic? Much appreciated
17:39:30FromDiscord<haxscramper> first points to second
17:39:31FromDiscord<haxscramper> sent a code paste, see https://paste.rs/wjR
17:39:33FromDiscord<haxscramper> second points to first
17:43:12FromDiscord<Professor Actual Factual> Ah i see, thank you 🙂
17:44:17FromDiscord<hmmm> halooooo
17:44:26FromDiscord<hmmm> who is experienced with wnim here :3
17:45:37FromDiscord<hmmm> this emote is cute :nimAngry:
18:01:37*mahlon_ is now known as mahlon
18:04:08*vicfred joined #nim
18:34:03*vicfred quit (Quit: Leaving)
19:07:14FromDiscord<Shikata Ga Nai> Noob's back! I completed all the previous collatz sequence exercises without issue, but struggling here. I'd like to see one of you wrinkly brains tackle this so I see where I'm going wrong. Thanks in advance https://media.discordapp.net/attachments/371759389889003532/905895981894225930/unknown.png
19:08:43FromDiscord<Shikata Ga Nai> https://media.discordapp.net/attachments/371759389889003532/905896354755264542/unknown.png
19:32:21FromDiscord<enthus1ast> a little↵(@hmmm)
19:33:56FromDiscord<hmmm> ha! my boy
19:34:01FromDiscord<hmmm> wtf is a bitlist
19:34:26FromDiscord<enthus1ast> mh which context?
19:34:37FromDiscord<demotomohiro> If you have a procedure or function that calculate a length of collatz sequence, it should not be so hard to find max length.
19:34:48FromDiscord<enthus1ast> or'ed flags maybe ? @hmmm
19:35:16*krux02 joined #nim
19:35:20FromDiscord<hmmm> and to put into context we are talking about the setitem proc of this: https://khchen.github.io/wNim/wListCtrl.html
19:35:24*anjovi quit (Ping timeout: 276 seconds)
19:36:08FromDiscord<hmmm> setitem works correctly, if I call it and set a status it will set, what it's not working is the getstate proc, that will always return 3 lol
19:36:26FromDiscord<hmmm> so I thought it has to do with the fact that I have no idea what a bitlist is
19:36:58*anjovi joined #nim
19:37:12FromDiscord<enthus1ast> ah yes, these are just or'd flags
19:37:17FromDiscord<enthus1ast> really common in winapi
19:37:24FromDiscord<hmmm> wtf is an ord flag D:
19:37:38Amun-Raor'd as in bitwise-OR
19:37:40FromDiscord<enthus1ast> basically its just an integer, but you can store multiple "flags" in the integer
19:37:43FromDiscord<hmmm> and why it returns 3 😩
19:38:03FromDiscord<tandy> is it possible to find an instance of an object in a seq? i used find when looking for a `(int, int)` but now that I am looking for an instance of a OOLib class it won't ever find it..
19:38:12FromDiscord<enthus1ast> maybe the default flags of the item is 3
19:38:29FromDiscord<enthus1ast> what do you want to achive?
19:38:34FromDiscord<hmmm> all the item return 3 and an item I've just changed a flag of will return 3
19:38:37FromDiscord<hmmm> 3 is the answer
19:39:00FromDiscord<hmmm> I'm trying to make an item turn bright
19:39:27FromDiscord<hmmm> there is the flag wListStateDropHighlighted that does just that
19:40:02FromDiscord<enthus1ast> then i think the way to go is to get the current state and `or` it with wListStateDropHighlighted
19:40:05FromDiscord<hmmm> but after turning it bright I want to turn it normal, and I need to check the state first and to do that getstate has to work and not just spit 3 lol
19:41:00FromDiscord<garuse> In reply to @Shikata Ga Nai "Noob's back! I completed": https://play.nim-lang.org/#ix=3E1X
19:43:24Amun-Ratandy: traverse a seq and compare it with 'of'
19:44:39FromDiscord<enthus1ast> @hmmm\: the winapi flag is actually called `LVIS_DROPHILITED`
19:44:45FromDiscord<enthus1ast> maybe you can find more information
19:44:58FromDiscord<hmmm> I'm dropping the hmmm here
19:45:02FromDiscord<hmmm> hmmmm
19:45:17FromDiscord<enthus1ast> it could be that its only valid with certain combinations of other flags
19:45:47FromDiscord<enthus1ast> eg\: https://forums.codeguru.com/showthread.php?435322-How-to-get-the-LVIS_DROPHILITED-state-of-item
19:45:57FromDiscord<enthus1ast> `1. If you're running with version 6 or higher of comctl32.dll, you can use the LVS_EX_DOUBLEBUFFER style. `
19:49:56FromDiscord<hmmm> also related to wnim in general: control have styles, sometimes I want to have a control in two styles at the same time but it never works. Something like x=TextCtrl(panel, style=wTeMultiLine and wTeReadOnly) but it never works for me. I've seen people using or but that doesn't work for me too
19:50:42FromDiscord<hmmm> I'm confus :nimAngry:
19:52:06FromDiscord<enthus1ast> https://blog.podkalicki.com/bit-level-operations-bit-flags-and-bit-masks/
19:52:23FromDiscord<enthus1ast> `To set a flag, we use bitwise OR equals operator (|=). It allows turning individual bits on.`
19:52:38FromDiscord<enthus1ast> so they must be `or` ed instead of and
19:53:10FromDiscord<hmmm> wow this article is golden
19:53:14FromDiscord<enthus1ast> so this might work\:↵`x=TextCtrl(panel, style=wTeMultiLine orwTeReadOnly)`
19:54:17FromDiscord<hmmm> why would people ever use something that arcane when I could just call a flag is beyond me
19:54:21FromDiscord<enthus1ast> if you figure out the autolayout dsl let me know \:D
19:54:28FromDiscord<hmmm> lol no way
19:55:12FromDiscord<enthus1ast> it might be very smart and clever, unfortunately too clever for me
19:56:10FromDiscord<hmmm> I'm prodigiously clever when I sleep, when I wake I lose my superpowers :<
20:06:33FromDiscord<Rika> so, you never sleep then
20:37:11NimEventerNew Nimble package! odsreader - OpenDocument Spreadhseet reader, see https://github.com/dariolah/odsreader
20:40:33*MightyJoe is now known as cyraxjoe
21:05:30*Vladar quit (Quit: Leaving)
21:37:15NimEventerNew Nimble package! gene - Gene - a general purpose language, see https://github.com/gcao/gene-new
21:43:34FromDiscord<Rika> huh
22:32:10FromDiscord<tandy> huh↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>)
22:32:16FromDiscord<tandy> how do you mean of
22:32:28FromDiscord<tandy> i wrote this
22:32:31FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3E2R
22:32:37FromDiscord<tandy> but it doesnt work
22:33:47FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3E2U
22:33:54FromDiscord<codic> But after the "finished dispatching" the program just doesn't go to get the next event
22:33:56FromDiscord<codic> weird
22:34:35FromDiscord<Elegantbeef> You dont need to enumerator positions 😀
22:35:00FromDiscord<Elegantbeef> there's a built in `seq.find`
22:35:13FromDiscord<tandy> yee i used this, but it didnt work
22:35:23FromDiscord<tandy> I'm comparing instances of OOlib classes
22:35:35FromDiscord<tandy> Position is a class
22:35:40FromDiscord<Elegantbeef> Ah then you want `Position of B`
22:35:43FromDiscord<Elegantbeef> No it's not a class!
22:35:48FromDiscord<Elegantbeef> I'll hunt you down for saying that! 😛
22:36:00FromDiscord<tandy> lol
22:36:03FromDiscord<tandy> whats B?
22:36:25FromDiscord<Elegantbeef> Whatever type you want to see if it's type of
22:36:32FromDiscord<tandy> i dont want to see if its a type
22:36:33FromDiscord<Elegantbeef> So you have your `instance of Type`
22:36:44FromDiscord<tandy> i want to see whether the two instances have hte same values
22:36:57FromDiscord<codic> In reply to @codic "I am runniing into": This might be like a nim compiler bug because only thing I can think of is XGrabPointer is called even if ev.subwindow == None and the early return doesnt work
22:37:01FromDiscord<Elegantbeef> Can you make your own `==` proc
22:37:21FromDiscord<tandy> hmm good idea
22:39:05FromDiscord<Elegantbeef> Codic it's highly unlikely to be a nim compiler bug
22:39:14FromDiscord<Elegantbeef> It's vastly more likely to be an xlib api issue
22:39:44FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3E2X
22:39:46FromDiscord<tandy> is this how it should look
22:39:59FromDiscord<Elegantbeef> What event type do you get?
22:40:15FromDiscord<Elegantbeef> No it's not how it should look
22:40:26FromDiscord<tandy> damn ok il look at the nim src then
22:40:31FromDiscord<codic> For some reason I don't get any MotionNotify or ButtonPress events after the proc early returns
22:40:35FromDiscord<Elegantbeef> That's how it should look 😀
22:40:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3E2Y
22:40:45FromDiscord<codic> But that makes no sense
22:40:56FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Xmp
22:40:59FromDiscord<tandy> lmao thank u
22:41:04FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3E30
22:41:45FromDiscord<codic> I updated it to just check if it's a client; aka the exact same thing, but still same issue
22:41:52FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3E31
22:43:03FromDiscord<Elegantbeef> You really like making code hard to follow dont you 😛
22:43:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3E32
22:44:39FromDiscord<codic> What's hard to follow about that?
22:44:53FromDiscord<Elegantbeef> You do early returns which hides intent
22:44:54FromDiscord<codic> I think early break/continue is easier to follow personally
22:45:10FromDiscord<Elegantbeef> You dont care that it's not success you care that it is success
22:46:14FromDiscord<codic> I care that it's not success because if it's not success then I should not handle whatever garbage is in self.currEv
22:46:26FromDiscord<codic> Or I care if it's success because if it is I can execute what I want to
22:46:30FromDiscord<codic> You can argue either way really
22:46:45FromDiscord<Elegantbeef> I mean you care that it's successful
22:46:52FromDiscord<Elegantbeef> You're only running code when it's successful
22:47:00FromDiscord<codic> yea
22:47:14FromDiscord<codic> anyways I don't understand anything which could possibly cause this
22:47:17FromDiscord<Elegantbeef> Isnt it e.window not e.subwindow?
22:47:51FromDiscord<Elegantbeef> Actually i guess you're framing
22:47:54FromDiscord<codic> but I'm pretty sure it's x11 not nim because the wm handles other events just not motionnotify / buttonpress
22:47:57FromDiscord<codic> yeah ,tho that doesn't matter
22:48:02FromDiscord<codic> because any way it would early return
22:48:10FromDiscord<codic> (edit) "return" => "return, problem is after that it doesn't work"
22:48:21FromDiscord<codic> `if ev.subwindow == None` this case is hit when it should be hit
22:48:28FromDiscord<Elegantbeef> Sounds like you're forgetting to set some listen flags maybe
22:50:03FromDiscord<Elegantbeef> Also you're not using all events
22:50:07FromDiscord<codic> Oh I think I figured it out 1 sec
22:50:08FromDiscord<codic> wdym?
22:50:23FromDiscord<Elegantbeef> you should have something like https://github.com/beef331/goodwm/blob/master/src/goodwm.nim#L70-L71
22:50:36FromDiscord<codic> nvm didn't figure it out
22:50:40FromDiscord<Elegantbeef> Where you iterate through all queued events
22:50:46FromDiscord<codic> hmm
22:51:05FromDiscord<Elegantbeef> Though that loop is different
22:51:32FromDiscord<codic> no change
22:51:36FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3E34
22:51:37FromDiscord<Elegantbeef> It runs indefinitely like yours except it uses a blocking selector to stop the loop inbetween processing
22:51:53FromDiscord<Elegantbeef> Yea didnt expect it to cahnge
22:51:56FromDiscord<codic> https://www.toptal.com/developers/hastebin/ukujakadod.swift here's the full code to put it in context
22:51:56FromDiscord<codic> ah
22:52:03FromDiscord<codic> lol hastebin thinks nim = swift
22:53:02FromDiscord<Elegantbeef> Debugging x isnt fun 😀
22:54:31FromDiscord<codic> I agree
22:54:57FromDiscord<Elegantbeef> You dont create a screen
22:55:05FromDiscord<Elegantbeef> That might be an issue?
22:55:13FromDiscord<Elegantbeef> I'm just comparing to my WM at this point
22:55:49FromDiscord<codic> nah shouldnt be an issue
22:55:57FromDiscord<codic> What I see is happening is I get a ButtonPress but not a ButtonRelease
22:56:04FromDiscord<codic> Which is what causes the sisue
22:56:21FromDiscord<codic> but why???
22:56:35FromDiscord<Elegantbeef> Cause you grab the pointer
22:56:37FromDiscord<Elegantbeef> I think
22:56:51FromDiscord<Elegantbeef> line 79
22:57:36FromDiscord<codic> Pointer should be ungrabbed in ButtonRelease, that wouldn't stop me from getting the event
22:57:37FromDiscord<Elegantbeef> I dont know what's correct but my root window is the onlything that grabs the pointer
22:57:43FromDiscord<codic> But also if subwindow == None then I don't grab the pointer
22:57:51FromDiscord<codic> so no, that cant be related
22:58:00FromDiscord<codic> yeah thats for moving/resizing
22:58:32FromDiscord<Elegantbeef> [tandy](https://matrix.to/#/@tandy1000:matrix.org)\: so did the `==` work?
22:58:41FromDiscord<tandy> no \:(
22:58:49FromDiscord<Elegantbeef> What is Position?
22:58:58FromDiscord<Elegantbeef> A ref object or a normal object?
22:59:10FromDiscord<tandy> im using OOlib
22:59:14FromDiscord<Elegantbeef> Ok that doesnt help
22:59:16FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3E36
22:59:19FromDiscord<tandy> il have a look at the src
22:59:23FromDiscord<Elegantbeef> Is it a reference object or a normal object 😀
22:59:32FromDiscord<Elegantbeef> I'm guessing a reference
23:00:55FromDiscord<tandy> i think ref yeah
23:01:04FromDiscord<tandy> source is a lil hard to understand but i only see ref objects being defined
23:01:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3E39
23:01:31FromDiscord<Elegantbeef> You can always just do `assert A is ref object`
23:01:43FromDiscord<tandy> oh smart
23:01:51FromDiscord<Elegantbeef> But i assume it is
23:02:03FromDiscord<Elegantbeef> What's the issue now?
23:02:35FromDiscord<Elegantbeef> Yea sorry codic I cannot help much, aside from looking at mine or prestiges WM and going "You dont do X like us" 😀
23:04:39FromDiscord<codic> lol
23:04:50FromDiscord<codic> meh im too lazy im just gonna use my old rust version
23:04:57FromDiscord<codic> ill try to fix it later
23:05:41FromDiscord<Elegantbeef> Uh oh we lost tandy!
23:05:55FromDiscord<treeform> how to check if --threads:on or not was passed?
23:06:13FromDiscord<tandy> oh sorry beef, im hunting a bug, will test very soon \:)
23:07:08FromDiscord<amadan> sent a code paste, see https://paste.rs/S1y
23:07:25FromDiscord<Elegantbeef> You can also do `const threadsOn {.booldefine.} = false` afaik
23:07:35FromDiscord<Elegantbeef> that should be `threads`
23:07:58FromDiscord<amadan> Oh neat
23:08:18FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
23:08:22FromDiscord<Elegantbeef> Works for int, bool and str
23:08:55FromDiscord<Elegantbeef> Actually that might not work
23:08:59FromDiscord<tandy> it works \:))) thank u
23:09:03FromDiscord<Elegantbeef> SInce threads isnt a define
23:09:15FromDiscord<treeform> sent a code paste, see https://paste.rs/6Bd
23:10:07FromDiscord<Elegantbeef> Yep i was right in that it wouldnt work
23:12:05FromDiscord<treeform> I am trying to test my lib with both threads on and off:
23:12:06FromDiscord<treeform> https://media.discordapp.net/attachments/371759389889003532/905957607028695102/unknown.png
23:12:12FromDiscord<treeform> the compiler flag works for that
23:44:40FromDiscord<Goat> sent a long message, see http://ix.io/3E3j
23:44:55FromDiscord<Goat> (edit) "http://ix.io/3E3j" => "https://paste.rs/kdp"
23:45:52FromDiscord<Elegantbeef> What's the interesting library?
23:49:59FromDiscord<Goat> At the moment it's nimib and LiteStore
23:50:31FromDiscord<Goat> I want to make a web version of the Alone Against The Flames adventure for Call of Cthulhu
23:51:37FromDiscord<Goat> And I want to test out LiteStore as a db for stuff