<< 19-03-2022 >>

00:10:10FromDiscord<huantian> Mine was much simpler lol, just checked that the owner of the symbol was an iterator of the correct return type
00:10:48FromDiscord<Elegantbeef> That doesnt work inside blocks or similar
00:11:19FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/WGq
00:12:30FromDiscord<huantian> Ah true, so you have to travel up the owners to find a proc or iterator
00:12:38FromDiscord<Elegantbeef> Yep
00:20:05FromDiscord<huantian> too bad compiles doesn't work with yield
00:20:22FromDiscord<Elegantbeef> I mean it doesnt help anyway
00:20:36FromDiscord<Elegantbeef> `"Invalid usuage of await"` or w/e you'd give isnt helpful
00:21:28FromDiscord<huantian> I mean all the error messages boil down to "can only use await in async proc"
00:21:41FromDiscord<Elegantbeef> Sure but you can be more helpful
00:22:12FromDiscord<Elegantbeef> I dont know, my view is that when you can provide a more accurate error you should
00:22:48FromDiscord<Elegantbeef> Like yes technically "You can only use await in an async proc" is accurate, but we can always just point to the exact issue
00:22:51FromDiscord<Elegantbeef> I dont know i might be an idiot
00:26:04FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3SNS though it's not too hard to change it
00:32:57*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
00:36:44FromDiscord<huantian> Maybe combine both messages? idk
00:36:52*ltriant joined #nim
00:37:21FromDiscord<Elegantbeef> What?
00:37:40FromDiscord<huantian> like uh "Await can only be used in async, not macro/top-level"
00:38:06*ltriant_ quit (Ping timeout: 252 seconds)
00:40:02FromDiscord<TennisBowling> sent a code paste, see https://play.nim-lang.org/#ix=3SNW
00:40:13FromDiscord<Elegantbeef> `if r.code == HttpCode200`
00:40:22FromDiscord<TennisBowling> oh
00:40:24FromDiscord<TennisBowling> thank you!
00:40:32FromDiscord<Elegantbeef> `if r.code in HttpCode200..HttpCode299`
00:41:01FromDiscord<huantian> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=3SNS though it's not": shouldn't it loop until it sees a nskMacro or nskIterator as well?
00:41:19FromDiscord<Elegantbeef> Cant async inside a macro
00:41:40FromDiscord<huantian> yeah so if it gets to a macro before an iterator, then it should error right
00:42:09FromDiscord<Elegantbeef> \TIL macros can be declared not at toplevel
00:42:21FromDiscord<TennisBowling> wait but then
00:42:42FromDiscord<TennisBowling> sent a code paste, see https://play.nim-lang.org/#ix=3SNY
00:43:00FromDiscord<huantian> is self a `var` type?
00:43:09FromDiscord<TennisBowling> no it's an object
00:43:14FromDiscord<Elegantbeef> `let r`
00:43:14FromDiscord<Elegantbeef> Also why would you change the status
00:43:24FromDiscord<TennisBowling> sent a code paste, see https://play.nim-lang.org/#ix=3SNZ
00:43:31FromDiscord<Elegantbeef> Should be `var r`
00:43:32FromDiscord<TennisBowling> In reply to @Elegantbeef "Also why would you": it to store if the node is alive or not
00:43:49FromDiscord<huantian> In reply to @Elegantbeef "Should be `var r`": nono self is a separate object from r
00:43:54FromDiscord<TennisBowling> yeah
00:44:14FromDiscord<Elegantbeef> Either way it's a mutabillity issue
00:44:14FromDiscord<Elegantbeef> pass in `self` as `var NodeInstance`
00:44:34FromDiscord<Elegantbeef> I'm probably in the minority, but i destest `self`
00:44:47FromDiscord<TennisBowling> cool that worked
00:44:52FromDiscord<TennisBowling> then what do you use?
00:44:53FromDiscord<TennisBowling> this?
00:45:01FromDiscord<Elegantbeef> `nodeInstance`
00:45:04FromDiscord<Elegantbeef> `node`
00:45:12FromDiscord<Elegantbeef> Anything that's not pretending Nim is OOP 😛
00:45:56FromDiscord<TennisBowling> I come from oop languages so just a habit
00:47:57FromDiscord<Elegantbeef> Yea you can use whatever you want, i'm just an odd person
00:56:20pchhttps://media.discordapp.net/attachments/362945838366064651/954543462483623946/fuckoffcompiler.png nim 1.6 packaged in debian (haha stable btw)
00:57:16FromDiscord<Elegantbeef> What's the code?
00:57:37pchscattered across 4 files thanks
00:58:24pchit's hitting error trying to match MultiElementBuffer[0] (an array type) to MultiElementBuffer (the same array type but without its size specified)
00:59:19pchhttps://media.discordapp.net/attachments/362945838366064651/954544539367006228/fuckoffcompiler2.png
00:59:46FromDiscord<TennisBowling> how do I do a return type of something that could be two things
00:59:52FromDiscord<TennisBowling> thing1 | thing2
00:59:54FromDiscord<TennisBowling> ?
01:00:07FromDiscord<Elegantbeef> Is it two seperate things at runtime or compile time?
01:00:16FromDiscord<Elegantbeef> If it's at runtime you need to use an object variant
01:01:17FromDiscord<Elegantbeef> is `intris` the same type as the `attemlems` specialized type?
01:02:53pchyes, they're element types for storing reference to array positions
01:03:25pchit's not two separate things, the code does detect the length of the given MultiElementBuffer though
01:03:37FromDiscord<Elegantbeef> That might be the issue
01:04:16FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SO5
01:04:35FromDiscord<Elegantbeef> put `distinct MultiElementBuffer`
01:04:46FromDiscord<huantian> https://play.nim-lang.org/#ix=3SO6↵does something like this work? just shuffled it around a bit
01:06:18pchthere's no derivative type based on the multielementbuffer
01:06:25FromDiscord<Elegantbeef> Do not know, dont really like the solution since though
01:06:33FromDiscord<Elegantbeef> What do you mean PCH?
01:06:49pchim just using multielementbuffer directly
01:06:55pchlemme screenshot the erroring code next
01:06:58FromDiscord<Elegantbeef> You said the specialized type of the attemlems is not the same as the first
01:07:07pchno they're the exact same type
01:08:15pchive defined "testNorms" with the line `var testNorms: MultiElementBuffer[0]` specifically so that the code skips the normal interpolation
01:08:39pchI put it into the function I've taken a screenshot of, and receive the error I entered with
01:08:55pchin the postion of "normelem"
01:09:31FromDiscord<Elegantbeef> If all of the `MultiElementBuffer`s are the same type the issue i thought it was wasnt it
01:10:42FromDiscord<Elegantbeef> you may need to do `[T: static int]` ... `MultiElementBuffer[T]`
01:11:00pchMultiElementBuffer is defined as
01:11:26pch`MultiElementBuffer*[size: static int] = array[size, TrianglePointer]
01:11:29pcher
01:11:32pch`MultiElementBuffer*[size: static int] = array[size, TrianglePointer]`
01:11:43FromDiscord<Elegantbeef> Yes i dont care about that
01:11:47FromDiscord<Elegantbeef> The issue is the call site
01:11:54FromDiscord<Elegantbeef> What's the call site look liike
01:13:23pch`drawReadyElements(testTriElem, testTriTrans, depthbuf, defaultPSveccol, interiorcolbuf, os, testNorms, trestTriBuf, @[testTriElem], testTriCol)`
01:13:42pchlots of reuse because of mandatory fields I haven't worked on making non-mandatory yet
01:13:59pchjust have detections to see if the field is representing an empty variable
01:14:10FromDiscord<Elegantbeef> what's `testTriElem` declared as?
01:14:18pchMultiElementBuffer
01:14:36FromDiscord<Elegantbeef> The entire type
01:15:12pch`var testTriElem: MultiElementBuffer[1] = [vec3(0.uint32,1,2)]`
01:15:24FromDiscord<Elegantbeef> There is your fucking issue!
01:15:25FromDiscord<Elegantbeef> Like i said
01:15:43FromDiscord<Elegantbeef> Put distinct before anything that isnt supposed to match the first `MultiElementBuffer`
01:15:45FromDiscord<huantian> In reply to @huantian "https://play.nim-lang.org/#ix=3SO6 does something l": wups it has to be "Future" not "FutureBase"
01:15:51FromDiscord<huantian> (edit) "In reply to @huantian "https://play.nim-lang.org/#ix=3SO6 does something l": wups it has to be ... "Future"" added ""FutureBase" not" | removed "not "FutureBase""
01:16:01FromDiscord<Elegantbeef> Nim's composite type classes bind to the first type they're provided
01:16:08FromDiscord<Elegantbeef> You need to put distinct before it to resolve that mismatch
01:16:15pchwell that's an issue
01:16:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SO9
01:17:17FromDiscord<huantian> huh I didn't even know you could have plain `seq` as a param type
01:17:24FromDiscord<Elegantbeef> Composite typeclass
01:17:27FromDiscord<Elegantbeef> It applies to all generics
01:19:27pchhttps://cdn.discordapp.com/attachments/362945838366064651/954549605318672515/AAAA.png
01:20:04FromDiscord<Elegantbeef> Past the procedure definition please
01:20:11FromDiscord<Elegantbeef> So i can edit it to what it needs to be
01:20:57NimEventerNew question by Big Man: Nim stack overflow in recursive loop, see https://stackoverflow.com/questions/71534666/nim-stack-overflow-in-recursive-loop
01:21:19pch`proc drawReadyElements* (intris: MultiElementBuffer, tribuf: V3Buffer, dbuf: var ScalarBuffer2D, shad: PShadingCallback, outbound: var ColourInnerBufferINTE, outsize: BufRESprefloat, normelem: distinct MultiElementBuffer, normatt: distinct V3Buffer, attelems: seq[MultiElementBuffer], attachments: varargs[array])`
01:24:25FromDiscord<Elegantbeef> So many typeclasses this is a fun bug
01:25:12FromDiscord<Elegantbeef> `proc drawReadyElements[T,Y: static int](intris: MultiElementBuffer[T], tribuf: V3Buffer, dbuf: var ScalarBuffer2D, shad: PShadingCallback, outbound: var ColourInnerBufferINTE, outsize: BufRESprefloat, normelem: MultiElementBuffer[Y], normatt: distinct V3Buffer, attelems: seq[MultiElementBuffer[T]], attachments: varargs[array])`↵might work
01:25:53pchthey both house the same type though?
01:26:01FromDiscord<Elegantbeef> Yes it's a workaround, but it's a very very large generic param list so hard to reason though
01:26:05FromDiscord<Elegantbeef> What do you mean?
01:26:43pchintris, normelem, and attelems' members all house the exact same type
01:26:55FromDiscord<Elegantbeef> Not at your call site
01:27:12FromDiscord<Elegantbeef> `var testTriElem: MultiElementBuffer[1] = [vec3(0.uint32,1,2)]` is the first arg
01:27:41pchyes, the type held within a MultiElementBuffer never changes
01:27:54pchit's always a TrianglePointer, which is always a Vec3[uint32]
01:28:11FromDiscord<Elegantbeef> Your passing a `MutliElementBuffer[0]` to `normelem`
01:28:19FromDiscord<Elegantbeef> If they're supposed to be the same type, pass the same type
01:28:30FromDiscord<Elegantbeef> Is there anyway i can see the entire code?
01:28:36pchthey're the same type though but of different sizes?
01:28:45FromDiscord<Elegantbeef> Yes
01:28:48pchI haven't put it up on VCS yet
01:28:58pchtrying to make sure it renders out first before I do
01:29:15FromDiscord<Elegantbeef> Nim's static types are distinct
01:29:19FromDiscord<Elegantbeef> `array[0, uint32] is not array[1, uint32]`
01:29:24pchah
01:29:31pchimmediately see the issue then
01:29:32FromDiscord<Elegantbeef> rather `array[0, uint32] isnot array[1, uint32]`
01:29:48FromDiscord<Elegantbeef> This is where the `distinct` goes
01:30:26pchalright, I'll use a slight variation of your fix then
01:30:28pchthanks
01:30:48FromDiscord<huantian> do macros have default return values?
01:31:05FromDiscord<Elegantbeef> `nnkNilLit` or `nnkEmpty` dont recall
01:31:43FromDiscord<huantian> kk
01:32:18FromDiscord<Elegantbeef> Are you still working on the async stuff?
01:32:42FromDiscord<huantian> yeah
01:33:07FromDiscord<huantian> was going to see if there could be a better error message for improper multisync
01:33:57FromDiscord<huantian> and perhaps more testing would be good
01:34:22FromDiscord<huantian> /adding test case
01:47:57FromDiscord<huantian> this is what I have rn <https://play.nim-lang.org/#ix=3SOd>
01:48:59*Gustavo6046 quit (Remote host closed the connection)
01:49:02FromDiscord<Elegantbeef> Seems good
02:14:21*lumo_e quit (Ping timeout: 252 seconds)
02:19:24FromDiscord<huantian> sent a code paste, see https://paste.rs/SHj
02:20:26FromDiscord<Elegantbeef> I'd add tests anywhere there might be an issue
02:20:40FromDiscord<Elegantbeef> It's better to test for behaviour that might fail than assume you have coverage
02:22:20FromDiscord<huantian> is there a way to get testament check for multiple errors in the same file?
02:23:49FromDiscord<huantian> or should I just split it into multiple files
02:23:50FromDiscord<Elegantbeef> `nim check`
02:25:15FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/tests/generics/tstatic_constrained.nim an example
02:26:05FromDiscord<huantian> hm ok
02:44:07FromDiscord<TennisBowling> sent a code paste, see https://play.nim-lang.org/#ix=3SOs
02:44:58FromDiscord<huantian> you probably want std/option
02:45:06FromDiscord<TennisBowling> what do you mean?
02:45:11FromDiscord<huantian> void is special and can't be used like that
02:45:23FromDiscord<Elegantbeef> Nim's typeclasses are for generics instantiation not runtime unions
02:46:25FromDiscord<Elegantbeef> `void | NodeInstance` means "This procedure can be instantiated in such a way it can return `void`, but also can be instantitated so it can return `NodeInstance`"
02:46:43FromDiscord<Elegantbeef> It does not mean "It can return `void` or `NodeInstance` dynamically at runtime
02:47:51FromDiscord<Elegantbeef> For instance
02:47:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SOt
02:48:57FromDiscord<Elegantbeef> Though Araq generally says "Typeclasses are only for parameters, not for return values, use `auto`"
02:49:54FromDiscord<Elegantbeef> Hopefully that makes sense
02:52:51FromDiscord<Elegantbeef> The way to do dynamic values is https://nim-lang.org/docs/manual.html#types-object-variants or with libraries like https://github.com/alaviss/union
03:00:22pchhmm, can't seem to access sdl Surface.pixels property
03:00:42pchtrying to cast it to an uncheckedarray (which is what it is) results in a compile-time error about non-concrete types
03:01:12pchtrying to use it directly doesn't work since it's just defined as a `pointer` type
03:01:17FromDiscord<Bubblie> I got the nim plugin for Clion
03:01:18FromDiscord<Bubblie> however
03:01:25FromDiscord<Bubblie> its having issues with the nim.exe?
03:01:48FromDiscord<Bubblie> its asking for the nim.exe
03:01:57FromDiscord<Bubblie> but thats already in bin
03:03:22FromDiscord<Elegantbeef> pch `cast[ptr UncheckedArray[YourType]](surface.pixels)`
03:03:34pchi
03:03:35pchthanks
03:04:16FromDiscord<Elegantbeef> Dont know what to say bubblie, jetbrains addon isnt the greatest since they're writing from the ground up, but then again Nim tooling isnt that great 😛
03:04:26FromDiscord<Bubblie> oh
03:04:47FromDiscord<Bubblie> what do you use for nim development?
03:04:50FromDiscord<Bubblie> vscode?
03:04:58FromDiscord<Elegantbeef> I've been using Kate recently, but I generally use vscode
03:05:06FromDiscord<Bubblie> 👀 never heard of kate
03:06:20FromDiscord<Elegantbeef> Eh it's just an OSS text editor that now has LSP support
03:06:40FromDiscord<Elegantbeef> Slight issue presently in that it doesnt show errors, which i need to investigate
03:07:13FromDiscord<Bubblie> now it is saying there is no nim binary?
03:07:14FromDiscord<Bubblie> weird
03:07:35FromDiscord<Elegantbeef> Is your path getting throttled by something?
03:07:46FromDiscord<Bubblie> not sure
03:07:57FromDiscord<Bubblie> the nim path should be in the path of User Variables right
03:08:01FromDiscord<Bubblie> or should it be in environmental as well
03:08:18nrds<Prestige99> Elegantbeef have you had issues with false errors being reported? I've brought it up before but, haven't heard anyone else talking about it
03:08:23FromDiscord<Elegantbeef> Not a windows user it should be in your `PATH` variable
03:08:25FromDiscord<Elegantbeef> Whatever the equivlent is for windows
03:08:38FromDiscord<Elegantbeef> I've seen it a few times, but havent had it in a while
03:08:40termerpath is in win
03:08:53FromDiscord<Bubblie> there is path in user and in environmental
03:08:59FromDiscord<Elegantbeef> Generally it seems like it's the project causing the bug
03:08:59termerthere's a local path and global path if I remember correctly but it's the same concept as in linux
03:09:01FromDiscord<Bubblie> nim auto added it to user
03:09:02FromDiscord<Elegantbeef> Oh hey termer
03:09:04termerhey dude
03:09:06*om3ga quit (Ping timeout: 250 seconds)
03:09:17FromDiscord<Elegantbeef> Time to destroy your project 😛
03:09:20termeruh oph
03:09:25termerwhat did you find
03:09:31*ozzz joined #nim
03:09:39FromDiscord<Elegantbeef> A few things to clean it up
03:10:21nrds<Prestige99> Elegantbeef https://github.com/nim-lang/Nim/issues/19371 zero replies so uh, maybe I put the error in the wrong repo
03:10:35nrds<Prestige99> It's quite annoying maybe I should make a forum post
03:10:40FromDiscord<Elegantbeef> I'll look at it a minute
03:11:53FromDiscord<Bubblie> ok yeah
03:12:00FromDiscord<Elegantbeef> https://github.com/termermc/argon2-highlevel/blob/master/argon2_highlevel/async.nim#L99-L100 `except Exception as e: job.fail(e, e.msg)`
03:12:08FromDiscord<Bubblie> nim is being added to the user variable
03:12:13FromDiscord<Bubblie> but why isn't vscode recognizing it
03:12:24FromDiscord<Bubblie> thats so weird
03:13:07FromDiscord<Elegantbeef> Have you restarted since installing?
03:13:14FromDiscord<Elegantbeef> Window's environmental variables suck
03:13:17FromDiscord<Bubblie> that may be it
03:13:21FromDiscord<Bubblie> In reply to @Elegantbeef "Window's environmental variables suck": oh yeah
03:13:29termerElegantbeef what's this issue on this line
03:13:31FromDiscord<Bubblie> 100% I hate windows, I want to move to fedora linux but uh
03:13:39FromDiscord<Bubblie> I cant dual boot atm
03:13:48FromDiscord<Bubblie> so I might just run fedora in QEMU or something
03:14:01FromDiscord<Elegantbeef> you're using `getCurrentException` and `getCurrentExceptionMsg` it's code smell
03:14:04termervirtualizing is more pain than it is useful
03:14:08FromDiscord<Elegantbeef> Just use what i suggested
03:14:12FromDiscord<Elegantbeef> It's cleaner
03:14:20FromDiscord<Bubblie> In reply to @termer "virtualizing is more pain": Probably
03:14:24termerElegantbeef I didn't see your suggestion
03:14:26FromDiscord<Bubblie> I might have enough on my d drive for fedora
03:14:27FromDiscord<Bubblie> Or
03:14:35FromDiscord<Bubblie> i might use an external hard drive
03:14:38FromDiscord<Bubblie> Just to use fedora
03:14:39termerwas it to just except CatchableError as err or something?
03:14:39FromDiscord<Elegantbeef> It's after the link
03:14:49FromDiscord<Elegantbeef> https://irclogs.nim-lang.org/19-03-2022.html#03:12:00
03:14:56termeroh sorry
03:14:56FromDiscord<Elegantbeef> Yes it was
03:15:02termerI'm a bit tired
03:15:08termerI'll update it right now
03:15:12termeris there anything else you noticed
03:15:32FromDiscord<Elegantbeef> line 156 you're using a for loop iterating indicies instead of just `for thread in hasher.threads.mitems`
03:16:15termermore beautiful 2am code
03:16:18FromDiscord<Elegantbeef> There was another issue that was bigger i swear
03:16:20termerthanks lol
03:16:29*arkurious quit (Quit: Leaving)
03:18:02FromDiscord<huantian> In reply to @Elegantbeef "Well get at it": I have the get at it-ed
03:18:05FromDiscord<Elegantbeef> Oh yes `https://github.com/termermc/argon2-highlevel/blob/master/argon2_highlevel/private/utils.nim#L19-L24` this!
03:18:45termerwuh oh
03:18:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SOA
03:19:21termerthat's my first time seeing the {.global.} pragma
03:19:34termerdoes that create a var in global scope the first time it's run?
03:19:34FromDiscord<Elegantbeef> I say bigger issue, but i'm just weird
03:19:39pchas it turns out the canoncial way to write to a pixel array in sdl is with memset
03:19:45pchand i cant get any other way to work
03:19:49FromDiscord<Elegantbeef> It does what you did, just Nim scopes it to `genId`
03:20:05FromDiscord<Elegantbeef> What's the type of the `pixels`?
03:20:10termerin a way this seems weirder other than being inside of the proc
03:20:29termerby the way I noticed you removed the inline pragma, I'm guessing I didn't really need it, right
03:20:33pchElegantbeef internally-formatted byte array
03:21:25FromDiscord<Elegantbeef> I mean you can inline it if you want, if calling a procedure that increments is a slowdown to your programi think you're in a great state
03:21:32FromDiscord<Elegantbeef> Plus the compiler may already attempt to inline it
03:21:42FromDiscord<Elegantbeef> Ok so you have a pointer and you know the data it holds?
03:22:02pchthe "proper" way to write to a surface in SDL is to import it as an image then blit it to the new surface with an SDL command
03:22:16termerI have one more question, you removed the "return" keyword and just referenced the variable at the end. Is this an implicit return then
03:22:25termerit looks very weird to me coming from basically everything besides nim
03:22:25FromDiscord<Elegantbeef> Yes
03:22:31termeris that standard
03:22:36FromDiscord<Elegantbeef> All statements can be expressions so `return` is almost never needed
03:22:49FromDiscord<Elegantbeef> It's pretty idiomatic to disregard `return`
03:22:55termerok noted
03:23:06termeralthough it seems a bit ambiguous compared to typing return
03:23:22FromDiscord<Elegantbeef> Perhaps if you're new, i heavily use expressions
03:23:32termerjust in genera;
03:23:34termer*general
03:24:01FromDiscord<Elegantbeef> It's an expression it's not ambigous to me
03:24:14FromDiscord<Elegantbeef> The procedure has a return type and the last statement is a variable
03:24:23termerhmm fair enough I suppose
03:25:02termerwait a minute
03:25:12termeryou mentioned doing for thread in hasher.threads.mitems
03:25:16termerI've never used mitems
03:25:27FromDiscord<Elegantbeef> It's 'mutable items'
03:25:28pchreturn can be useful for quick exit
03:25:30termerthe reason I was using an index was because I wanted to assign to the thread arr at that idx
03:25:37termerpch well of course
03:25:51pchso you're passing return instead of break, which should behave more predictably
03:26:17termeryeah I do use return to exit out of a proc early often
03:26:22FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3SOC this might help you pch
03:26:32FromDiscord<Elegantbeef> I generally never use return unless I need to
03:26:40FromDiscord<Elegantbeef> For performance or logic reasons
03:26:55termeris there actually a performance hit with using return
03:26:59termerI've never heard of that
03:27:09FromDiscord<Elegantbeef> termer `mitems` iterates over the collection yielding a pointer to the element since you dont use `i` there is no difference
03:27:20FromDiscord<Elegantbeef> No i meant performance in the other way
03:27:28termeroh
03:27:41FromDiscord<Elegantbeef> iterating over a collection to find an element for instance you can either do `result = true;break` or `return true`
03:28:07FromDiscord<Elegantbeef> It yields a `var T` which is a mutable reference or a 'pointer' 😀
03:28:13termercould you show me how you'd write that bit with the threads array
03:28:56FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3SOD
03:29:18termeroh I'm retarded
03:29:23termerthat makes perfect sense LOL
03:29:52termerI'd like to blame all my bad code on lack of sleep but seeing as I only have time to write nim when it's late I really can't keep using that excuse
03:32:22FromDiscord<Elegantbeef> You also can use `https://nim-lang.org/docs/system.html#createShared%2Ctypedesc` instead of `allocShared0`
03:32:52termerwhat's the benefit of that over allocShared0
03:33:03FromDiscord<Elegantbeef> no needing to type `sizeof` 😛
03:34:46FromDiscord<Elegantbeef> I'd also do `type ThreadMessage = (ref AsyncArgon2, ptr Channel[Job], ptr Channel[JobRes])` or declare an object to save on typing
03:36:24FromDiscord<Elegantbeef> For createshared you dont need to cast it to a ptr on top of it
03:36:33termerthat figures
03:36:59termerok I'll do that stuff tomorrow
03:37:03termerI appreciate your advice
03:37:04FromDiscord<Elegantbeef> so you get a much more readable `hasher.jobChan = createShared(Channel[Job])`
03:38:34*ltriant quit (Ping timeout: 250 seconds)
03:39:29*ozzz quit (Ping timeout: 256 seconds)
03:42:58FromDiscord<TennisBowling> In reply to @Elegantbeef "Though Araq generally says": but with auto I have problems for when I set a variable to that function
03:43:10termerpushed changes
03:43:16FromDiscord<Elegantbeef> What?
03:43:27FromDiscord<Elegantbeef> Auto means the compiler will resolve the type
03:43:52*ozzz joined #nim
03:44:22FromDiscord<Elegantbeef> Tennis what's the code
03:45:44FromDiscord<TennisBowling> if I set the return instance to auto, then functions that call it like↵let x = theFunc()↵say that the type is ambiguous↵which makes sense but what do I do
03:46:00FromDiscord<Elegantbeef> what's `theFunc`?
03:46:10FromDiscord<Elegantbeef> the return type being `auto` doesnt mean it's ambiguousu
03:46:29FromDiscord<TennisBowling> sent a code paste, see https://paste.rs/yQL
03:46:34FromDiscord<Elegantbeef> Nim's statically typed, there is no way you can write `theFunc` to be ambigous
03:46:47FromDiscord<Elegantbeef> There is no ambiguity
03:46:48FromDiscord<TennisBowling> (edit) "https://paste.rs/ROC" => "https://paste.rs/ZAE"
03:47:00FromDiscord<Elegantbeef> `outOfAlivenodes` is a `Node` as is `node`
03:47:14FromDiscord<TennisBowling> `Error: type mismatch: got 'NodeInstance' for 'node' but expected 'typedesc[outOfAliveNodes]'`
03:47:31FromDiscord<Elegantbeef> what is `outOfAliveNodes`?
03:47:46FromDiscord<TennisBowling> `type outOfAliveNodes = void↵`
03:47:49FromDiscord<Elegantbeef> Like i said Nim doesnt have dynamic typing
03:48:05FromDiscord<Elegantbeef> the procedure should return `void` then
03:48:23FromDiscord<TennisBowling> right but it can return NodeInstance
03:48:38FromDiscord<Elegantbeef> node is not `void`
03:48:43FromDiscord<Elegantbeef> Like was said you want to use options
03:49:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SOO
03:49:35FromDiscord<Elegantbeef> You cannot return two types from a single instance of a procedure
03:49:40FromDiscord<TennisBowling> ah I see
03:49:40FromDiscord<huantian> I think you have an extra `result = ` beef
03:49:41FromDiscord<Elegantbeef> It either returns one or the other
03:49:51FromDiscord<Elegantbeef> yes
03:50:52FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/1cO
03:51:36FromDiscord<huantian> 😈
03:53:02FromDiscord<TennisBowling> hmm
03:53:21FromDiscord<Elegantbeef> https://nim-lang.org/docs/options.html#basic-usage
03:53:29FromDiscord<TennisBowling> with that I get ↵`Error: expression 'none(NodeInstance)' is of type 'Option[consensusbackup.NodeInstance]' and has to be used (or discarded)`
03:53:36FromDiscord<TennisBowling> on the if thing
03:53:39FromDiscord<TennisBowling> (first if)
03:54:11FromDiscord<Elegantbeef> Both expressions have an implicit result so make sure you indented properly
03:54:22*slowButPresent quit (Quit: leaving)
03:54:33FromDiscord<Elegantbeef> also `typeof(node) is NodeInstance`?
03:54:40FromDiscord<TennisBowling> yes
03:54:58FromDiscord<Elegantbeef> What's your entire code now?
03:55:03FromDiscord<TennisBowling> sent a code paste, see https://paste.rs/Bq8
03:55:19FromDiscord<TennisBowling> sent a code paste, see https://paste.rs/BHA
03:55:53FromDiscord<Elegantbeef> i guess do `result = none(NodeInstance)` and same for the `result = some(node)`
03:56:10FromDiscord<Elegantbeef> I dont see where the exprression is falling through
03:56:13FromDiscord<huantian> you could also use the default result value too and be more implicit
03:57:11FromDiscord<TennisBowling> sent a code paste, see https://play.nim-lang.org/#ix=3SOQ
03:57:30FromDiscord<Elegantbeef> You're doing `getAlive == outOfAlive`
03:57:36FromDiscord<Elegantbeef> it's `getAliveNode.isSome`
03:57:44FromDiscord<Elegantbeef> or `getAlive Node.isNone`
03:57:49FromDiscord<TennisBowling> ahhhh
03:58:18FromDiscord<Bubblie> can I add breakpoints in nim
03:58:26FromDiscord<Bubblie> when debugging
03:58:33FromDiscord<Elegantbeef> Yes with GDB setup properly
03:58:41FromDiscord<Bubblie> how do I set up gdb?
03:58:44FromDiscord<TennisBowling> cool that worked
03:58:46FromDiscord<TennisBowling> thanks!
03:58:47FromDiscord<Elegantbeef> Fuck if i know
03:58:49FromDiscord<Bubblie> LMAO
03:58:52FromDiscord<Elegantbeef> I dont debug using debuggers
03:59:02FromDiscord<Bubblie> oh I see
03:59:04FromDiscord<huantian> cool kids use treeform print
03:59:12FromDiscord<Bubblie> or just, systout
03:59:17FromDiscord<Bubblie> (edit) "systout" => "sysout"
03:59:22FromDiscord<Elegantbeef> You can follow https://github.com/saem/vscode-nim#debugging
03:59:39FromDiscord<Elegantbeef> I know the author of GDB frontend got ok results using that
03:59:50FromDiscord<Elegantbeef> Gdb frontend that is
03:59:56FromDiscord<Elegantbeef> https://github.com/rohanrhu/gdb-frontend this thingy
04:00:28FromDiscord<Bubblie> 👀
04:00:31FromDiscord<Bubblie> cool ill look into it
04:00:59FromDiscord<Bubblie> oh wait
04:01:02FromDiscord<Elegantbeef> This old doc exists but i wouldnt suggest nimprof https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html
04:01:03FromDiscord<Bubblie> CLion works now LETS GOOOOO
04:01:11FromDiscord<Bubblie> I can debug with CLion right off the bat
04:01:21FromDiscord<Bubblie> god this is awesome
04:01:40FromDiscord<huantian> is the variable viewer thingy good? on clion?
04:01:46FromDiscord<Bubblie> not sure
04:01:52FromDiscord<huantian> I don't know what that's called tbh
04:01:52FromDiscord<Bubblie> what do you mean by variable viewer thingy
04:01:55FromDiscord<Bubblie> like
04:01:58FromDiscord<Bubblie> the breakpoint information?
04:02:01FromDiscord<huantian> uh
04:02:01FromDiscord<huantian> ig
04:02:10FromDiscord<Elegantbeef> Doubt any will be good they lack all the information of types, so a `set[char]` will be like debugging an array of ints↵(@huantian)
04:02:40FromDiscord<Bubblie> I mean im testing it right now hold on
04:02:44FromDiscord<Elegantbeef> Same with a `set[enum]`
04:02:56FromDiscord<Bubblie> does nim have Algebraic data types?
04:03:05FromDiscord<Bubblie> like sum types and stuff
04:03:06FromDiscord<Elegantbeef> I answered this yesterday
04:03:13FromDiscord<Elegantbeef> It has object variants
04:03:18FromDiscord<Elegantbeef> Which are just tagged unions
04:03:29FromDiscord<Elegantbeef> Though https://github.com/alaviss/union exists
04:03:34FromDiscord<Bubblie> oh I didn't see that
04:03:37FromDiscord<Elegantbeef> Considerr reading https://nim-lang.org/docs/manual.html
04:03:54FromDiscord<Bubblie> also the debugging is actually pretty good
04:03:56FromDiscord<Bubblie> in CLion
04:04:09FromDiscord<Bubblie> its telling me info, not sure about types though
04:04:25FromDiscord<Bubblie> alright
04:04:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SOV
04:04:30FromDiscord<Bubblie> where do you want the breakpoints
04:04:35FromDiscord<Bubblie> on the type Color right?
04:04:39FromDiscord<Elegantbeef> 3 and 4 the only running code
04:05:09FromDiscord<Elegantbeef> i'm 99% certain it'll show `a` as `3` and then `7`
04:05:52FromDiscord<Elegantbeef> I dont imagine it'll show `{red, green}` then `{red, green, blue}`
04:07:03FromDiscord<Bubblie> you may be right
04:07:38FromDiscord<Bubblie> might set up vim in vscode then
04:07:51FromDiscord<Elegantbeef> Well no debugger shows the actual enum values
04:08:02FromDiscord<Elegantbeef> Either it's not possible or someone needs to fix the nim-gdb script
04:08:16FromDiscord<Bubblie> maybe
04:08:30FromDiscord<Bubblie> I might just, debug without breakpoints maybe
04:08:35FromDiscord<Bubblie> but im so use to breakpoint debugging
04:08:36FromDiscord<Bubblie> LMAO
04:08:42FromDiscord<Elegantbeef> `echo a` does print `{red, green, blue`
04:08:55FromDiscord<Bubblie> yes
04:08:58FromDiscord<Bubblie> echo will print it
04:09:06FromDiscord<Bubblie> but with a normal break point it doesn't show red,green,blue
04:09:11FromDiscord<Elegantbeef> Echo prints 'all' 😛
04:09:14FromDiscord<Bubblie> which as you said is to be expected
04:09:23FromDiscord<huantian> this is what vscode shows https://media.discordapp.net/attachments/371759389889003532/954592394819539014/unknown.png
04:09:32FromDiscord<Bubblie> thats what I go too
04:09:33FromDiscord<Elegantbeef> Well if you want to make debugging better go hammer your head into `nim-gdb.py`
04:09:36FromDiscord<Bubblie> (edit) "go" => "got"
04:09:50FromDiscord<Bubblie> also, clion was able to show me the disassembly file
04:09:52FromDiscord<Bubblie> which was like
04:09:55FromDiscord<Bubblie> LMAO
04:09:57FromDiscord<Bubblie> not sure why
04:10:10FromDiscord<huantian> nah it's the same elsewhere
04:10:12FromDiscord<Elegantbeef> did you compile with `--debugger:native` huan?
04:10:24FromDiscord<huantian> yep
04:10:38FromDiscord<Bubblie> does clion support assembly?
04:10:39FromDiscord<Bubblie> I wonder
04:10:50FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/tools/nim-gdb.py is where that python file exists if anyone wants to take a shot 😛
04:11:05FromDiscord<Bubblie> oh holy fuck
04:11:08FromDiscord<Bubblie> clion supports NASM?
04:11:10FromDiscord<Bubblie> YOOOO
04:11:18FromDiscord<Bubblie> how good is it though
04:11:30FromDiscord<huantian> In reply to @Elegantbeef "https://github.com/nim-lang/Nim/blob/devel/tools/ni": why does my python not have type hints
04:11:45FromDiscord<huantian> also I think I was using lldb on vscode because lazy
04:11:54FromDiscord<Elegantbeef> Python fucking sucks that's why
04:12:03FromDiscord<Bubblie> never heard a truer statement
04:12:13FromDiscord<Bubblie> I use to use python a lot
04:12:18FromDiscord<Bubblie> I still use it sometimes
04:12:19FromDiscord<Bubblie> but jesus
04:12:22FromDiscord<huantian> well python can't enforce type hints
04:12:33FromDiscord<Elegantbeef> Not with that attitude
04:12:37FromDiscord<huantian> true!
04:12:41FromDiscord<Bubblie> LOL
04:13:01FromDiscord<Bubblie> im glad CLion supports NASM
04:13:07FromDiscord<Elegantbeef> python 4 start enforcing static typing in code not written inside a `fuckingIdioticBlock`
04:13:19FromDiscord<Elegantbeef> Then eventually you're golden and all your code will be static typed
04:13:26FromDiscord<Elegantbeef> 10/10 trust me i'm a genius
04:14:12FromDiscord<huantian> also maybe they should add less leaky scoping
04:14:24FromDiscord<Elegantbeef> Maybe we shouldnt use it
04:14:43FromDiscord<Elegantbeef> "And other things a perpetually unemployed programmer can say"
04:15:12*ltriant joined #nim
04:15:21FromDiscord<Bubblie> maybe python shouldn't be shit
04:16:46FromDiscord<huantian> ok but can your language do `a, b = a[:] = [[]], []`
04:16:57FromDiscord<Bubblie> LMAO
04:17:14FromDiscord<Bubblie> nim actually made me like indentation langs
04:17:26FromDiscord<Bubblie> nim is like the first language ive seen that does indentation right
04:17:27FromDiscord<Elegantbeef> Well it's whitespace isnt silly
04:17:34FromDiscord<Bubblie> fr
04:17:39FromDiscord<Bubblie> holy shit its like a breathe of fresh air
04:17:47FromDiscord<Bubblie> ruby and python are just
04:17:48FromDiscord<Bubblie> oh my god
04:17:51FromDiscord<Elegantbeef> You can do that you need `\`
04:17:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SP1
04:18:15FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3SP2
04:18:17FromDiscord<Elegantbeef> Lol
04:18:22FromDiscord<Elegantbeef> That's ambiguous though
04:18:29FromDiscord<Elegantbeef> Is it unary is it binary who knows!
04:18:44FromDiscord<Bubblie> can you make nim compile to things other than an exe
04:18:46FromDiscord<Elegantbeef> Also that's horizontally aligned code, so it's fucking tedious
04:18:52FromDiscord<Elegantbeef> You can write libraries yes
04:18:57FromDiscord<Elegantbeef> `--app:lib` goes brr
04:19:07FromDiscord<Bubblie> so like, how would I make an executeable for mac
04:19:17FromDiscord<Elegantbeef> You'd cross compile for mac
04:19:26FromDiscord<Elegantbeef> Which is tedious and damn near impossible if you arent on mac
04:19:30FromDiscord<Elegantbeef> Atleast afaik
04:19:31FromDiscord<Bubblie> I have a mac
04:19:32FromDiscord<Bubblie> so
04:19:35FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3SP4
04:19:38FromDiscord<Bubblie> it shouldn't be that bad
04:19:40FromDiscord<Bubblie> but
04:19:44FromDiscord<Bubblie> I say that but mac development is hell
04:19:44FromDiscord<huantian> In reply to @Elegantbeef "Which is tedious and": because apple is dum dum
04:19:47FromDiscord<Elegantbeef> Just compile locally on the mac then
04:19:49FromDiscord<Bubblie> does nim work on m1?
04:19:53FromDiscord<Elegantbeef> Yes
04:19:56FromDiscord<Bubblie> perfect
04:19:59FromDiscord<Bubblie> my mac is an m1
04:20:02FromDiscord<Elegantbeef> I think Araq uses a M1
04:20:14FromDiscord<Bubblie> as soon as I get fedora linux I will be the master of all elements
04:20:21FromDiscord<huantian> araq uses macos? time to stop using nim
04:20:34FromDiscord<Elegantbeef> Agreed
04:20:49FromDiscord<Bubblie> I keep putting semi colons in nim like its java 💀
04:20:53FromDiscord<Elegantbeef> I'm going to fork it and just make it so it doesnt compile for mac
04:20:57FromDiscord<Bubblie> this is what java does to a person
04:21:10FromDiscord<Elegantbeef> When i write shaders i do the same
04:21:17FromDiscord<Elegantbeef> Start religiously putting semicolons and crying
04:21:23FromDiscord<Elegantbeef> "They're redundant" i scream
04:21:25FromDiscord<huantian> whenever I write semicolon langs I always write the code and then when it doesn't compile I put all my semicolons in
04:21:47FromDiscord<Elegantbeef> I've got so many "expected ;" errors working inbetween shader and game codee
04:22:02FromDiscord<Elegantbeef> Shady needs UBO/SSBO support before i can use it
04:22:19FromDiscord<huantian> ~~also why does unity not have init only properties grumble grumble~~
04:22:34FromDiscord<Elegantbeef> The fuck is a Unity 😛
04:22:40FromDiscord<huantian> it's that uh
04:22:43FromDiscord<huantian> one desktop environment
04:22:47FromDiscord<huantian> and that one song by the fat rat
04:22:57FromDiscord<Elegantbeef> And that game engine
04:23:24FromDiscord<Bubblie> also I love how nim uses var and not val
04:23:25FromDiscord<Elegantbeef> Let's see if i can get any game dev done or if my brain will run off into "oh look a squirrel mode"
04:23:31FromDiscord<Bubblie> idk I like var better
04:23:35FromDiscord<Bubblie> also I dislike let
04:23:46FromDiscord<Elegantbeef> But nim uses `let`
04:23:55FromDiscord<Bubblie> but nim uses var?
04:24:05FromDiscord<Elegantbeef> Nim uses `var` `let` and `const`
04:24:06FromDiscord<Bubblie> does it have both?
04:24:07FromDiscord<Bubblie> OH SHIT
04:24:12FromDiscord<Elegantbeef> `let` is immutable
04:24:12FromDiscord<Bubblie> okay thats fine
04:24:22FromDiscord<Bubblie> ah okay
04:24:25FromDiscord<Bubblie> makes sense
04:24:25FromDiscord<Elegantbeef> `var` is mutable and i'll let you guess what `const` is
04:24:30FromDiscord<huantian> I was writing some c# and I was like "dang I wish c# had macros"
04:24:33FromDiscord<Bubblie> const is self explanatory
04:24:46FromDiscord<Elegantbeef> Rosyln source code generators is the best they can do
04:25:45FromDiscord<huantian> why can't I just put my entire game in `static:` and have it run at build time unity smh
04:26:07FromDiscord<Elegantbeef> Huan you're also a gamedev?
04:26:30FromDiscord<Bubblie> so just to refresh my memory, let can be assigned once just like const, except const cannot be assigned to something like input
04:26:31FromDiscord<Bubblie> let can
04:26:41FromDiscord<Elegantbeef> `const` is compiletime constant
04:26:46FromDiscord<Bubblie> its still assigned once but it isn't enforced in compile time
04:26:49FromDiscord<Elegantbeef> `let` is runtime 'constant'
04:26:50FromDiscord<Bubblie> In reply to @Elegantbeef "`const` is compiletime constant": yeah
04:26:54FromDiscord<Elegantbeef> Var is 100% mutable
04:27:13FromDiscord<huantian> In reply to @Elegantbeef "Huan you're also a": I do some coding for Rhythm Doctor ye
04:27:18FromDiscord<Bubblie> 👀
04:27:24FromDiscord<Bubblie> wait
04:27:25FromDiscord<Bubblie> like
04:27:28FromDiscord<Bubblie> rhythm doctor mods
04:27:30FromDiscord<Elegantbeef> Nim has compile time evaluation so you can do something like `const myShader = staticRead"myDir/shader"`
04:27:30FromDiscord<Bubblie> or the actual game
04:27:38FromDiscord<huantian> actual game
04:27:41FromDiscord<Bubblie> 👀
04:27:44FromDiscord<Bubblie> holy shit
04:27:53FromDiscord<huantian> ~~yall should play it it's a good game unbiased opinion~~
04:27:56FromDiscord<Bubblie> I love rhythm doctor
04:28:09FromDiscord<Bubblie> I didn't think I would meet an actual rhythm doctor dev
04:28:12FromDiscord<Elegantbeef> literally unplayable
04:28:13FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/954597133619699752/image.png
04:28:34FromDiscord<Bubblie> In reply to @Elegantbeef "Nim has compile time": ah okay
04:28:46FromDiscord<Bubblie> so a good time to use const is when I never assign anything at run time
04:28:49FromDiscord<Bubblie> only at compile time
04:29:05FromDiscord<huantian> nim's `var` `let` `const` is so much better than js's lmao
04:29:08FromDiscord<Elegantbeef> Const is as the name implies for constants
04:29:35FromDiscord<Elegantbeef> If something is constant and unchanging use `const` if something loads from runtime values but is otherwise constant use `let`, finally use \`var
04:29:42FromDiscord<Bubblie> yes
04:29:44FromDiscord<Bubblie> alright good
04:29:45FromDiscord<Elegantbeef> That's the order i take when making variables
04:29:47FromDiscord<Bubblie> my brain is functional
04:29:59FromDiscord<Bubblie> In reply to @huantian "nim's `var` `let` `const`": they are
04:30:00FromDiscord<Elegantbeef> The most immutable program is the best program imo
04:30:14FromDiscord<Bubblie> I mean, I would assume it depends on the program right
04:30:18FromDiscord<Bubblie> depending on what tools would be used
04:30:21FromDiscord<huantian> In reply to @Bubblie "I didn't think I": I only joined end of last year lol, suprised you're not in the Rhythm docto discord server
04:30:27FromDiscord<huantian> (edit) "Rhythm docto" => "rhythm doctor"
04:30:29FromDiscord<Elegantbeef> No the smallest mutable state is the best
04:30:46FromDiscord<Bubblie> In reply to @huantian "I only joined end": I never joined, I should
04:30:47FromDiscord<Elegantbeef> i'm not going to sound off like a FP programmer saying everything has to be pure, but when it can be it should be
04:30:54FromDiscord<Bubblie> Its just im at the max discord server limit
04:31:02FromDiscord<Bubblie> don't ask why im in 100 programming servers
04:31:09FromDiscord<Bubblie> and inactive in 90 of them
04:31:14FromDiscord<Elegantbeef> Well you have nim now so leave 99 of them
04:31:21FromDiscord<Bubblie> LMAO
04:31:36FromDiscord<huantian> yeah I have to leave a server each time I join a new one
04:31:47FromDiscord<Bubblie> im in a bunch of minecraft mod dev servers
04:31:51FromDiscord<Bubblie> so I think that adds to it
04:32:07FromDiscord<huantian> In reply to @Elegantbeef "i'm not going to": yeah I think recently I've been too functional and immutable...
04:32:14FromDiscord<huantian> maybe I should go code some js or something
04:32:53FromDiscord<Bubblie> code js...?
04:32:58FromDiscord<Bubblie> why would you do that to yourself
04:33:41FromDiscord<Bubblie> I envy people who can actually enjoy JS
04:33:43FromDiscord<Bubblie> I cant
04:34:16FromDiscord<huantian> In reply to @Elegantbeef "image.png": soon™️
04:34:34FromDiscord<huantian> I do wish c# had object variants tho
04:35:08FromDiscord<Elegantbeef> Dont lie you wish it was Nim
04:35:24FromDiscord<Bubblie> C# feels like java, so for me it is easy to use
04:36:00FromDiscord<Bubblie> I wonder how good I can make an entity component system in nim
04:36:12FromDiscord<huantian> and this doesn't work
04:36:13FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3SP9
04:36:15nrds<Prestige99> There are a few out there
04:36:20FromDiscord<huantian> and I'm just like fuming
04:36:50FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3SP9" => "https://paste.rs/88r"
04:36:50FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3SPa" => "https://paste.rs/8rw"
04:37:01FromDiscord<Elegantbeef> Oh right i was going to look at that errror
04:37:24FromDiscord<Elegantbeef> Prestige can you repost the link?
04:37:48nrds<Prestige99> Elegantbeef https://github.com/nim-lang/Nim/issues/19371 this?
04:37:55FromDiscord<Elegantbeef> danke
04:38:10nrds<Prestige99> Thanks for looking into it
04:40:08nrds<Prestige99> Hmm can you write a case statement for a union type?
04:40:36FromDiscord<Elegantbeef> What?
04:40:40FromDiscord<huantian> union type?
04:41:03FromDiscord<Elegantbeef> No error reported here with nvim
04:41:31FromDiscord<Elegantbeef> You're using the LSP right?
04:45:16FromDiscord<Elegantbeef> Yea it's related to nimlsp afaict
04:49:07FromDiscord<Elegantbeef> Yep saem's extension using nimsuggest doesnt error but bung's extension using lsp does
04:49:16FromDiscord<Elegantbeef> So it's something the lsp is doing to get that error
04:49:46FromDiscord<Elegantbeef> prestige that was all for you so you best respond
04:54:08pchaha i got it working
04:54:27FromDiscord<Elegantbeef> Congrats
04:54:27pchnext up for the api: attempt to implement frame pacing
04:57:47nrds<Prestige99> Elegantbeef hmm let me check something
04:58:45nrds<Prestige99> Yeah Elegantbeef if you just put that code into a file and directly run nimsuggest on it, it will show that error I reported
04:59:29nrds<Prestige99> nimsuggest foo.nim then chk 1
05:00:42FromDiscord<Elegantbeef> Ah you're right
05:00:55FromDiscord<Elegantbeef> nvim/vscode worked fine
05:01:04nrds<Prestige99> I wonder why
05:02:22FromDiscord<Elegantbeef> Only way to learn is to debug it 😛
05:08:21nrds<Prestige99> I'm getting those errors from within nvim actually so yeah
05:14:07FromDiscord<Elegantbeef> Well we're using different error services so yea
05:14:13FromDiscord<Elegantbeef> I was just saying with my setup of nvim it didnt error
05:20:56nrds<Prestige99> Yours doesn't use nimsuggest then I take it
05:21:43FromDiscord<Elegantbeef> Yes it does
05:21:45nrds<Prestige99> It seems like nobody really cares that nimsuggest is essentially broken
05:22:28FromDiscord<Elegantbeef> Actually you're right it might use nimcheck
05:22:56FromDiscord<Elegantbeef> Well i mean you seem to care, but arent trying to fix it so checkmate
05:23:41nrds<Prestige99> I mean if I wanted to write and work on a new language I'd be doing that instead lol
05:24:55FromDiscord<Elegantbeef> I'll take a look at it, knowing the compiler it's just missing a flag 😛
05:28:45FromDiscord<Elegantbeef> Also how dare you not actually make a min repro
05:29:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SPo
05:30:43nrds<Prestige99> Lol
05:30:45nrds<Prestige99> Thanks for looking
05:33:23FromDiscord<Elegantbeef> `semIdeForTemplateOrGenericCheck` hmm this stuff might be related
05:33:52*rawrrr quit (Quit: Connection closed for inactivity)
05:36:47FromDiscord<Elegantbeef> Holy shit the issue is that the type and proc are exported
05:37:45FromDiscord<Elegantbeef> Remove the export from the proc and it works
05:38:15FromDiscord<Elegantbeef> It's just that the proc is exported, so that limits the scope down a bit
05:42:04nrds<Prestige99> hmm
05:42:29nrds<Prestige99> well if I _want_ it exported, that shouldn't cause this issue I'd think
05:42:45FromDiscord<Elegantbeef> What?
05:42:57nrds<Prestige99> like, this error being reported is still false
05:43:09FromDiscord<Elegantbeef> The issue is a exported generic causes this bug, it limits the scope of the issue down quite a bit
05:43:34FromDiscord<Elegantbeef> We went from "Why the fuck does this happen" to "Ok it's just an exported generic procedure"
05:43:41FromDiscord<Elegantbeef> Which makes me wonder if a constrained generic also does
05:45:06FromDiscord<Elegantbeef> It's even more percise now
05:45:31FromDiscord<Elegantbeef> an exported inferred generic procedure is the culprit
05:46:09FromDiscord<Elegantbeef> if you instead do `doThing[string](BinaryTree[string]())` it goes away
05:46:41nrds<Prestige99> Interesting...
05:47:02nrds<Prestige99> So it's unable to intepret the correct function based on the param type?
05:47:19FromDiscord<Elegantbeef> There is a nimsuggest generic optimization which is causing this i believe
05:47:56FromDiscord<Elegantbeef> I dont know where it is yet, but i'm thinking either in `qualifiedLookup`,`seminst`, `semtypeinst` though those dont have special casing for nimsuggest
05:48:32nrds<Prestige99> It started after 1.4.8 if that helps at all
05:51:23FromDiscord<Elegantbeef> Going to add my findings to that issue anyway
05:57:22nrds<Prestige99> ty
06:01:09FromDiscord<Elegantbeef> Now if i can reason why and how to fix it is another thing
07:07:31FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3SPJ
07:08:02FromDiscord<Elegantbeef> `--cc:tcc`
07:08:21FromDiscord<creikey> I think it's mostly because of nimble
07:08:36FromDiscord<Elegantbeef> Until `IC` we're stuck with compile times
07:08:42FromDiscord<Rika> Then maybe don’t use nimble since aside from improving the code…
07:08:52FromDiscord<creikey> In reply to @Rika "Then maybe don’t use": yeah just `nim r` seems a lot faster
07:08:58FromDiscord<creikey> don't know why I didn't try that in the first place
07:09:14FromDiscord<Elegantbeef> Then yea just use `nimble` for ensuring it's a reproducible build
07:09:15FromDiscord<Rika> Nimble probably does some sort of checks from the network
07:09:23FromDiscord<Rika> Cuz packages
07:09:39FromDiscord<Elegantbeef> Doesnt `nimble run` make a release build?
07:09:51FromDiscord<Elegantbeef> `nimble run -d:debug` might be fasteer
07:10:05FromDiscord<Rika> Run does not pass switches
07:10:25FromDiscord<Rika> which is a bug
07:10:51FromDiscord<creikey> just had to explain to my rooommate what irc was
07:11:55FromDiscord<creikey> In reply to @Elegantbeef "`nimble run -d:debug` might": same amount of time proving it's just scanning the deps
07:12:02FromDiscord<Elegantbeef> Odd
07:12:11FromDiscord<Elegantbeef> Make a new task then i guess
07:12:15FromDiscord<creikey> yeah
07:12:17FromDiscord<creikey> oh wait
07:12:18FromDiscord<creikey> nimble task
07:12:38FromDiscord<creikey> In reply to @Elegantbeef "Odd": I'm using windy which depends on everything treeform so it's all his code but spread across like 20 dependencies
07:12:59FromDiscord<creikey> https://media.discordapp.net/attachments/371759389889003532/954638601176641556/unknown.png
07:13:25FromDiscord<Elegantbeef> Ah
07:13:43pchhttps://github.com/kinkinkijkin/nimsgp on public VCS now
07:15:08FromDiscord<Elegantbeef> Oh yet another canuck
07:15:18FromDiscord<Rika> When will people stop naming Nim projects with “Nim” in it
07:15:39FromDiscord<Elegantbeef> Never
07:15:55pchI put nim in it because I need to describe that it's specifically for usage with the nim language
07:16:10pchyou know, like 90% of libraries that aren't just C do
07:16:30nrds<Prestige99> I've definitely never done that 😅
07:17:00FromDiscord<Rika> Well at least give it a catchier name than “SGP”
07:17:37FromDiscord<huantian> How about tenderchart
07:18:08pchnames mean very little and I'm currently dealing with extremely much more important things in my life than whether my free software is marketable
07:18:13FromDiscord<Rika> Okay
07:18:27FromDiscord<Elegantbeef> Your comments rant make me laugh a bit
07:19:12pchI even removed arbitrary attachements at some point after I wrote that
07:19:20pchlike, they're not there any more at all
07:19:22pchI gave up
07:21:23FromDiscord<Elegantbeef> 10/10 on the proper spelling of colour
07:29:25FromDiscord<Elegantbeef> Well prestige no luck in fixing it so far
07:29:44FromDiscord<Elegantbeef> An hour of scrolling code and testing is enough for the night 😀
07:30:01nrds<Prestige99> thanks for the effort, I appreciate ya
07:32:43FromDiscord<Elegantbeef> It's pretty clear it's in the semoverloadedCall branch, just dont know exactly where
07:55:27*jjido joined #nim
08:00:30pchmaintainer of sdl2 bindings for nim: the bindings hard-search for libSDL2.so
08:00:50pchon haiku the so is named "libSDL2-2.0.so.0"
08:01:33nrds<Prestige99> I see both on my system (linux) so that's interesting
08:01:55FromDiscord<Rika> Probably best to raise an issue
08:04:04pchissue raised
08:08:20*Gustavo6046 joined #nim
08:09:50*acidsys quit (Excess Flood)
08:10:04*Gustavo6046 quit (Remote host closed the connection)
08:10:24*acidsys joined #nim
08:10:26*acidsys quit (Excess Flood)
08:11:05*acidsys joined #nim
08:12:12*Gustavo6046 joined #nim
08:13:08*Gustavo6046 quit (Remote host closed the connection)
08:13:28*Gustavo6046 joined #nim
08:22:18*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:35:37pchtested renderer with a fix to the sdl2 bindings for haiku, confirmed working
09:12:47FromDiscord<Goel> How to create an array starting with Index 1 instead of 0?
09:13:37FromDiscord<Elegantbeef> `array[1..EndIndex, YourType]`
09:33:04FromDiscord<Shinyzenith> Hi what's the difference between `<ptr mytype>` and `ptr mytype`? https://media.discordapp.net/attachments/371759389889003532/954673852082946048/unknown.png
09:44:43*lumo_e joined #nim
09:44:51FromDiscord<Rika> Nothing, full error is needed
09:46:06FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954677136030052352/unknown.png
09:46:35FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3SQa
09:48:07FromDiscord<Shinyzenith> futhark is being really wonky
09:55:34FromDiscord<Shinyzenith> In reply to @Shinyzenith "": very odd error code
09:55:36FromDiscord<Shinyzenith> :/
10:07:17*ozzz is now known as om3ga
10:36:08FromDiscord<nariod> Hello !↵Is it possible to call native Win32 API using winim ? I already use this lib for high level API such VirtualAllocEx, but API such as NtCreateSection does not seem to be implemented.
10:48:53FromDiscord<demotomohiro> @nariod I think you can manually import Win32 APIs with header pragma: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma
10:49:49FromDiscord<demotomohiro> Or dynlib pragma: https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import
10:51:22FromDiscord<demotomohiro> winlean module is a good example to use these pragmas: https://github.com/nim-lang/Nim/blob/devel/lib/windows/winlean.nim
10:52:39FromDiscord<nariod> In reply to @demotomohiro "<@410127425956085770> I think you": Nice, thanks!
11:09:35FromDiscord<hmmm> broski is there in existance somewhere a counter that start from 0 and builds up using all alphanumeric? Something like uuid4 but not 36 char from the start, it should build up from zero
11:14:09FromDiscord<Rika> a counter
11:14:20FromDiscord<Rika> thats called "a counter"
11:14:42FromDiscord<Rika> theres a veeeeeery good reason UUID is not sequential
11:17:35FromDiscord<hmmm> yea but a counter that works like 8,9,a .. , z, 10, 11 ... zz, 100
11:18:50FromDiscord<hmmm> I need to store a bunch of them and want the counter as compact as possible
11:19:20FromDiscord<Rika> just use a number then convert it into "base36"
11:19:31FromDiscord<hmmm> hmmm
11:19:55FromDiscord<hmmm> semms like an reasonable way to go around it
11:20:40FromDiscord<Rika> a reasonable
11:21:36FromDiscord<demotomohiro> Storing counters as binary or msgpack form would be more compact.
11:21:53FromDiscord<hmmm> oh yes?
11:21:59FromDiscord<hmmm> what libraries do we have for that
11:22:21FromDiscord<hmmm> no wait I need the counter to work for id too
11:22:32FromDiscord<Rika> please do not use a sequential counter for IDs
11:22:52FromDiscord<hmmm> but I was using uuid4 and I get monstrous sizes
11:22:57FromDiscord<hmmm> I need something more compact
11:24:07FromDiscord<hmmm> I'll try the base36 rika method(TM)
11:24:22FromDiscord<demotomohiro> https://github.com/jangko/msgpack4nim
11:24:32FromDiscord<Rika> https://github.com/ai/nanoid
11:24:42FromDiscord<Rika> https://github.com/icyphox/nanoid.nim
11:25:43FromDiscord<hmmm> hmm 21 vs 36 is already much better
11:26:29FromDiscord<Rika> https://github.com/ai/nanoid#custom-alphabet-or-size
11:26:57FromDiscord<Rika> you can configure size to whatever you want, given that the collision chance is acceptable for you
11:27:27FromDiscord<hmmm> hmm why do I need to have a collision chance when I can just use a progessive counter that ensures that?
11:28:22FromDiscord<Rika> progressive counter means it is easy to guess what the next counter is
11:28:38FromDiscord<hmmm> oh that's entirely not a problem lol
11:28:50FromDiscord<Rika> if it is not then go ahead with the counter, whats this for anyway
11:29:13FromDiscord<hmmm> storing some kind of weird tree I made
11:29:29FromDiscord<Rika> why does the string representation matter here
11:30:00FromDiscord<hmmm> hmm elements of the trees have an id lol
11:30:28FromDiscord<Rika> yes, and theyre just numbers
11:30:34FromDiscord<Rika> why does the string representation matter
11:30:41FromDiscord<Rika> are you saving it to a file?
11:30:44FromDiscord<hmmm> yes
11:30:47FromDiscord<Rika> just binary pack the whole type then
11:30:54FromDiscord<hmmm> wot
11:30:56FromDiscord<hmmm> I'm using json
11:30:59FromDiscord<Rika> why
11:31:09FromDiscord<hmmm> idk it seemed the easiest thing
11:31:20FromDiscord<Rika> and the most inefficient choice?
11:31:23FromDiscord<hmmm> hmm
11:31:29FromDiscord<hmmm> msgpack?
11:32:49FromDiscord<demotomohiro> https://en.m.wikipedia.org/wiki/MessagePack
11:33:17FromDiscord<Rika> https://github.com/disruptek/frosty could work too if you dont care about language interoperability
11:34:02FromDiscord<hmmm> what about https://github.com/treeform/flatty
11:36:49FromDiscord<Rika> whichever
11:37:11FromDiscord<Valdar> I use this one, https://github.com/jangko/msgpack4nim, but flatty should be good. I haven't gotten around to trying it.
11:41:39FromDiscord<enthus1ast> We need a wrapper for this https://github.com/magiblot/tvision
11:43:58FromDiscord<hmmm> thats so cool
11:58:20FromDiscord<Phil> Out of curiosity, anyone have an idea what exactly nimibook does that is so insanely expensive in terms of calculations?
12:02:02FromDiscord<Forest> Anyone know how i could define an API that could be used in plain C?
12:02:56FromDiscord<Forest> So i wanna define some functions in Nim, then have someone just include the library if they wanna use it with `#include "library.h`
12:03:00FromDiscord<Forest> (edit) ""library.h`" => ""library.h"`"
12:03:05FromDiscord<Rika> exportc maytbe?
12:03:38FromDiscord<Forest> Oki, but how would i get the header file then?
12:03:48FromDiscord<Forest> Since didn't Nim drop support for that?
12:16:54FromDiscord<hmmm> what's our version of isinstance(thingy, int)
12:18:17FromDiscord<Rika> `thing is int`? `typeof thing == int`?
12:18:20FromDiscord<Rika> idk which is right
12:18:50FromDiscord<hmmm> yea I think it's that
12:19:05FromDiscord<hmmm> can I restrict it to naturals and it will work too?
12:23:32FromDiscord<Phil> typeof will be the death of me
12:23:42FromDiscord<Phil> I can never keep straight which language has that and which doesn't
12:25:00FromDiscord<hmmm> what is this daemon speak I hear about, there is only a language and it's nim 🧐
12:25:49FromDiscord<Phil> Please, if there was only nim people could neither flame about rust, nor stare at me horrified when I once more reveal the well known fact I code in java at work
12:27:14FromDiscord<hmmm> hehe
12:28:12FromDiscord<hmmm> java must be a comfy boomer lang if you can stomach the boilerplate
12:28:32FromDiscord<hmmm> and whatever brings the dinner on the table I guess 😊
12:28:48FromDiscord<Phil> Ehhh it's... I'd give it a C. What is most painful about it is that for the most trivial thing I immediately throws 50 layers of abstractions on it
12:28:57FromDiscord<Phil> (edit) "I" => "it"
12:29:25FromDiscord<hmmm> as someone writing java a lot you must feel plenty good writing nim
12:29:44FromDiscord<Phil> For the boilerplate there's code generators in the IDE and otherwise java has a lot of nice finished packages
12:31:19FromDiscord<Phil> depends. The language is clearly superior. I'm really liking the concepts I have access to in nim.↵What's obviously missing is the sheer variety of packages. Java has its own package for integrating elasticsearch for pete's sake, and another for fetching docker containers for absolutely trivial integration-testing when you have an elasticsearch backend, making "implementing" it and integration testing trivial
12:32:09FromDiscord<Phil> That's all stuff I'd have to wire up myself in nim. There's a reason I'm contributing left and right the tooling that I insist on having for my application.
12:32:56FromDiscord<hmmm> yea we just need 10% of rust community and we are set
12:33:10FromDiscord<hmmm> more eyeballs more libraries better libraries
12:35:50FromDiscord<coal <3> In reply to @hmmm "more eyeballs more libraries": better libraries more eyeballs, etc etc
12:36:49FromDiscord<coal <3> (edit) "In reply to @hmmm "more eyeballs more libraries": better libraries ... more" added "->"
12:37:01FromDiscord<hmmm> it's a snake eating it's tail, we must cut the snake in half with the flaming sword of Araq, it is placed on a dungeon 50 floors into the ground, only 1 hero can do it
12:55:52*acidsys quit (Excess Flood)
12:56:26*acidsys joined #nim
12:56:29*acidsys quit (Excess Flood)
12:57:07*acidsys joined #nim
12:59:13FromDiscord<Forest> What's the simplest websocket library in Nim? I wanna just have like, two procs
12:59:35FromDiscord<Forest> One that recieves and processes data, and the other that sends data
13:08:10FromDiscord<auxym> In reply to @Forest "Oki, but how would": https://github.com/treeform/genny
13:16:31*slowButPresent joined #nim
13:32:14*lumo_e quit (Ping timeout: 250 seconds)
13:45:14FromDiscord<Forest> Neat, thanks!
13:55:03FromDiscord<Jakraes> Hey guys, quick question, how do I use a character as a proc name? I've seen it somewhere but I forgot where and I have no idea how to implement it
13:55:29FromDiscord<Jakraes> Like this
13:56:32FromDiscord<Jakraes> proc ^(number1, number2) = number1 number2
13:56:39FromDiscord<Jakraes> And then it'd be used as something like this
13:56:44FromDiscord<Jakraes> number1^number2
14:00:14FromDiscord<Phil> Backticks when you define the char
14:00:25FromDiscord<Phil> https://play.nim-lang.org/#ix=3SR7
14:00:34FromDiscord<Phil> @Jakraes
14:00:55FromDiscord<Jakraes> Great, thank you so much!
14:01:04FromDiscord<Jakraes> It works, nice
14:01:31FromDiscord<Phil> Sidenote to myself: I really need to keep in mind to import std/sugar more often when I want JS style anonymous procs
14:02:09FromDiscord<Phil> Just had to troubleshoot for 3 minute only to figure out that my "=>" proc didn't work because sugar wasn't imported
14:13:50*arkurious joined #nim
14:18:40*lumo_e joined #nim
14:23:50FromDiscord<Shinyzenith> can someone tell me what this cryptic error code means ? https://media.discordapp.net/attachments/371759389889003532/954747027240140830/unknown.png
14:29:34*lumo_e quit (Quit: Quit)
14:38:16FromDiscord<auxym> well it's a type mismatch... the cryptic type names are probably auto generated, by futhark perhaps? In any case I'd assume it's a bug in the "herb" package
14:38:45FromDiscord<Daniel> https://gankra.github.io/blah/c-isnt-a-language/
14:39:32FromDiscord<Shinyzenith> In reply to @auxym "well it's a type": it is futhark
14:39:37FromDiscord<Shinyzenith> herb is the package I'm writing
14:39:42FromDiscord<Shinyzenith> (edit) "package" => "binary"
14:39:52FromDiscord<auxym> oh
14:39:54FromDiscord<Shinyzenith> this just doesn't make sense
14:39:55FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3SRg
14:39:58FromDiscord<Shinyzenith> the type names are the same
14:40:05FromDiscord<Shinyzenith> one is wrapped in `<>` and one is not
14:40:07FromDiscord<Shinyzenith> like wtf
14:40:16FromDiscord<auxym> yeah didn't notice that tbh :/
14:40:20FromDiscord<auxym> weird
14:40:24FromDiscord<Shinyzenith> very very weird
14:40:26FromDiscord<Shinyzenith> 😔
14:40:44FromDiscord<auxym> maybe @pmunch could help if he's around
14:40:58FromDiscord<Shinyzenith> Oh I didn't know they had a discord acc
14:41:13FromDiscord<Shinyzenith> I opened a gh issue regarding some other stuff, no reply yet so I assume they're busy
14:42:01FromDiscord<Shinyzenith> but when i echo .type on my variable, none of the <> bs shows up https://media.discordapp.net/attachments/371759389889003532/954751603288711229/unknown.png
14:42:02FromDiscord<Shinyzenith> 🥲
14:42:47FromDiscord<Shinyzenith> so I have no idea why it's conflicting
14:51:23FromDiscord<Rika> show the code you used with futhark
14:51:28FromDiscord<Rika> overrides and whatnot
14:52:40FromDiscord<Shinyzenith> sent a code paste, see https://paste.rs/vQV
14:53:03FromDiscord<Rika> you dont need to do ` Re-defining a few type names because the ones from futhark are terrible.`1
14:53:14FromDiscord<Shinyzenith> sent a code paste, see https://paste.rs/1X5
14:54:36FromDiscord<Shinyzenith> In reply to @Rika "you dont need to": so I should use the odd numbered ones?
14:55:06FromDiscord<Shinyzenith> (edit) "https://play.nim-lang.org/#ix=3SRl" => "https://paste.rs/7Kw"
14:55:50FromDiscord<Rika> no, you dont need to use the numbered ones...
14:55:56FromDiscord<Rika> why did you think you needed to?
14:56:26FromDiscord<Shinyzenith> cuz when I searched up the type names, they showed up 🥲
14:57:40FromDiscord<Rika> well if you read the relatively messy generated code you'd see that further down theres another define
14:58:02FromDiscord<Shinyzenith> Oh
14:58:07FromDiscord<Shinyzenith> I'll read it
14:58:21FromDiscord<Shinyzenith> so i can just remove the funky numbers?
14:58:47FromDiscord<Shinyzenith> yep removing them fixed it
14:58:54FromDiscord<Shinyzenith> ' https://media.discordapp.net/attachments/371759389889003532/954755849920872448/unknown.png
14:58:59FromDiscord<Shinyzenith> thank you so much rika!
15:15:29termerI know this was pretty far back in message history, but I recommend MessagePack
15:15:38termerit works well
15:16:35termeryou can also use ProtocolBuffers. There's an interesting protobuf library in nim but I couldn't use it because the writer generator didn't support async sockets. Could've modified it but was too lazy
15:41:13FromDiscord<System64 ~ Flandre Scarlet> Is there a fixed point type?
15:45:45FromDiscord<TennisBowling> sent a code paste, see https://play.nim-lang.org/#ix=3SRU
15:55:08FromDiscord<Rika> `node.get.httpClient`...
15:55:18FromDiscord<Rika> nim does not have flow typing
16:03:16FromDiscord<TennisBowling> ah I see
16:14:06FromDiscord<TennisBowling> sent a code paste, see https://paste.rs/zWU
16:14:29FromDiscord<TennisBowling> sent a code paste, see https://play.nim-lang.org/#ix=3SS3
16:15:48FromDiscord<Rika> how do you use doRequest
16:17:02FromDiscord<TennisBowling> ohhhh
16:17:06FromDiscord<TennisBowling> there it's set as a table
16:17:14FromDiscord<TennisBowling> in the function that calls it
16:17:30*toulene joined #nim
16:18:20FromDiscord<TennisBowling> sent a code paste, see https://play.nim-lang.org/#ix=3SS9
16:18:25FromDiscord<TennisBowling> however it still throws that error
16:29:52FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3SSd
16:30:54FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3SSd" => "https://play.nim-lang.org/#ix=3SSe"
16:31:02FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3SSe" => "https://play.nim-lang.org/#ix=3SSf"
16:37:17FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3SSi
16:37:47FromDiscord<Rika> In reply to @Isofruit "Do callback-procs in a": single line if =>, multiline is possible otherwise
16:38:08FromDiscord<Phil> In reply to @Rika "single line if =>,": So I just need to use `proc` instead?
16:38:14FromDiscord<Phil> Let me try that
16:38:22FromDiscord<Rika> sent a code paste, see https://paste.rs/0lW
16:38:41FromDiscord<Rika> In reply to @Isofruit "So I just need": im honestly not sure if => is single line only even
16:38:45FromDiscord<Rika> i know proc() works thoug
16:38:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "use `result` variable in": what does it do?
16:38:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3SSm
16:39:04FromDiscord<Phil> Whatever is in result will be returned as the output
16:39:08FromDiscord<Phil> return X is actually a hidden result = x
16:39:17FromDiscord<Rika> In reply to @System64 "what does it do?": you dont need `var operator: operator` anymore
16:39:22FromDiscord<Rika> also capitalise your type names
16:39:31FromDiscord<System64 ~ Flandre Scarlet> like OPERATOR?
16:39:35FromDiscord<Rika> `Operator`
16:39:40FromDiscord<System64 ~ Flandre Scarlet> ah alright like Java
16:39:54FromDiscord<Rika> like pretty much all modern programming languages
16:39:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3SSo
16:40:00FromDiscord<System64 ~ Flandre Scarlet> yeah, sorry
16:40:13FromDiscord<System64 ~ Flandre Scarlet> and any exemple for result?
16:40:26FromDiscord<Phil> The proc above for example uses result
16:40:43FromDiscord<Phil> The only reason the inner proc uses return is because I dunno about result in anonymous functions
16:41:13FromDiscord<System64 ~ Flandre Scarlet> ah alright↵↵and it returns an empty object?
16:41:44FromDiscord<Phil> Remember how, when you define a variable, there's strangely something in that variable that you can access?
16:41:59FromDiscord<Phil> like, when you do var x: int, you can do echo x and it'll show a value
16:42:23FromDiscord<System64 ~ Flandre Scarlet> Operator is going wrong https://media.discordapp.net/attachments/371759389889003532/954781893327454278/unknown.png
16:42:34FromDiscord<Rika> you messed up the indentation
16:42:41FromDiscord<Phil> nim initializes types to a certain degree for you (I say to a certain degree because the DateTime type for example will straight up error out if you try to access a DateTime field without the object being properly instantiated)
16:42:42FromDiscord<Rika> `adsr: Adsr`
16:42:47FromDiscord<Rika> `interpolation: Interpolation`
16:42:55FromDiscord<Phil> (edit) "nim initializes types to a certain degree for you ... (I" added "just when you set up the variable"
16:43:23FromDiscord<System64 ~ Flandre Scarlet> Still exploding https://media.discordapp.net/attachments/371759389889003532/954782142473338910/unknown.png
16:43:23FromDiscord<Phil> So basically you can treat result as if it were a variable that had already been declared with the type that is the return type of your proc
16:43:31FromDiscord<Rika> indentation
16:43:33FromDiscord<Rika> i said it above
16:43:37FromDiscord<Rika> you fucked the indentation
16:43:44pchquestion for nimble maintainers
16:44:00FromDiscord<System64 ~ Flandre Scarlet> ah now it's better
16:44:00FromDiscord<Phil> @System64 ~ Flandre Scarlet See how Interpolation is indented compared to "Operator"
16:44:10pchcan you please not error-enforce a very specific folder structure and just have a "source folder" variable
16:44:12FromDiscord<Phil> And see on which indentation level your "type" keyword is
16:44:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "you messed up the": ah didn't saw this message, sorry
16:45:20pchex I want to make a git repo with a macrolibrary split into multiple sublibraries and this is just the first step to being able to do so with nimble
16:45:48pchand nimble is complaining that I don't have a perfectly flat folder structure and saying it will error out in the future
16:54:57FromDiscord<Shinyzenith> sent a long message, see http://ix.io/3SSr
16:55:41FromDiscord<Shinyzenith> (edit) "http://ix.io/3SSr" => "http://ix.io/3SSs"
16:56:48FromDiscord<Rika> what does "parent object" refer to
16:57:11FromDiscord<Phil> I am now sad, turns out I can't properly use strformat to insert stuff into a json string
16:57:31FromDiscord<Shinyzenith> In reply to @Rika "what does "parent object"": https://media.discordapp.net/attachments/371759389889003532/954785703433236530/unknown.png
16:57:37FromDiscord<Shinyzenith> that's the zig one
16:57:41FromDiscord<Shinyzenith> do you want the nim definition?
16:57:58FromDiscord<System64 ~ Flandre Scarlet> Why does it do that? https://media.discordapp.net/attachments/371759389889003532/954785817493143602/unknown.png
16:59:02FromDiscord<Rika> i is not an index
16:59:07FromDiscord<Phil> Generally showing the exact compilation error does help. That loop also seems wrong
16:59:09FromDiscord<Rika> its an object
16:59:22FromDiscord<Rika> In reply to @Shinyzenith "": i dont know what im looking at
16:59:26FromDiscord<Phil> Are you familiar with "for in" loops as opposed to regular forloops @System64 ~ Flandre Scarlet ?
16:59:54FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "Are you familiar with": a bit, used ths in JS, but yeah I'm dumb lol
17:01:05FromDiscord<Phil> In reply to @System64 "a bit, used ths": basically for <some var name> in <some seq> gives you, in order, the entries in the seq into the var name, no indexing required. ↵If you want to go the full java functional way, sequtils have `map`, `filter` etc. procs to work with
17:01:43FromDiscord<Shinyzenith> In reply to @Rika "i dont know what": Uhh Ok I'll rewrite it in nim and try to explain properly, i'll brb
17:02:00FromDiscord<Phil> and with std/sugar that can look almost exactly like JS, for example↵`let myNewOperators = operators.map(operator => newOperator())`
17:02:08FromDiscord<Rika> im still unsure what a "parent object" is
17:02:32FromDiscord<Rika> OH
17:02:36FromDiscord<Rika> YOU WANT TO DEREFERENCE THE POINTER
17:02:39FromDiscord<Rika> is that what?
17:02:39FromDiscord<Phil> (edit) "myNewOperators" => "myNewOperators: seq[Operator]"
17:03:11FromDiscord<Rika> `var wlr_output: wlr output = cast[ptr wlr_output](data)[]`
17:03:13FromDiscord<Rika> i think?
17:03:19FromDiscord<Rika> whoops i used space by mistak
17:03:29FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "and with std/sugar that": Oh beautiful
17:04:26FromDiscord<Phil> In reply to @System64 "Oh beautiful": The key difference that the above has to your code is that the "map" operator creates a new array, while you were using an existing array and putting an operator in it... I think
17:04:35FromDiscord<Phil> (edit) "array," => "seq,"
17:04:39FromDiscord<Rika> sent a code paste, see https://paste.rs/Fao
17:04:45FromDiscord<Rika> @Shinyzenith come baaaaaack i think i get what you mean
17:05:16FromDiscord<Phil> (edit) "think" => "think↵Also for that to work you'll need to import `std/[sequtils, sugar]`"
17:05:34FromDiscord<Shinyzenith> In reply to @Rika "if you really want": uhhh this might be what I'm looking for
17:05:39FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3SSA
17:05:44FromDiscord<Shinyzenith> I'll test and let you know
17:05:51FromDiscord<System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#ix=3SSA" => "https://paste.rs/LCc"
17:05:53FromDiscord<Shinyzenith> it's not exactly dereferencing the pointer
17:05:54FromDiscord<Rika> yeah i think i understood what you wanted
17:05:54FromDiscord<Shinyzenith> but its' close
17:06:15FromDiscord<Rika> idk then
17:06:21FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3SSD
17:06:23FromDiscord<Rika> im not sure what a "parent objcet" is still
17:07:27FromDiscord<Shinyzenith> In reply to @Rika "im not sure what": https://ziglang.org/documentation/master/#fieldParentPtr maybe this can help
17:08:00FromDiscord<Rika> i will read one moment
17:08:06FromDiscord<Shinyzenith> thank you
17:08:07FromDiscord<Shinyzenith> !
17:08:41FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3SSK
17:09:01FromDiscord<Phil> 1..4 is a range from 1 to 4, including 1 and 4, so 1,2,3,4
17:09:05FromDiscord<huantian> sent a code paste, see https://paste.rs/jH7
17:09:05FromDiscord<System64 ~ Flandre Scarlet> not 0..4?
17:09:11FromDiscord<System64 ~ Flandre Scarlet> arrays starts at 0
17:09:16FromDiscord<System64 ~ Flandre Scarlet> (edit) "0..4?" => "0..3?"
17:09:16FromDiscord<huantian> I should not try to write code on mobile agh
17:09:50FromDiscord<Phil> In reply to @System64 "not 0..3?": Oh right, you use an array not a seq, if you want to use the number as an index then yeah, you can go 0..3
17:10:02FromDiscord<System64 ~ Flandre Scarlet> wait, seq starts at 1?
17:10:02FromDiscord<Rika> i honestly still have no idea
17:10:14FromDiscord<Phil> In reply to @System64 "wait, seq starts at": No, in a seq I'd just have done x.add("bla")
17:10:15FromDiscord<Rika> no
17:10:20FromDiscord<System64 ~ Flandre Scarlet> ah alright
17:10:20FromDiscord<Rika> seqs start at 0 always
17:10:23FromDiscord<Phil> Which means the index wuoldn't have mattered
17:10:35FromDiscord<Phil> (edit) "wuoldn't" => "wouldn't"
17:10:54FromDiscord<huantian> With a seq you would just do newSeqWith
17:10:54FromDiscord<Phil> I very, very rarely ever use arrays tbh
17:11:31FromDiscord<Shinyzenith> In reply to @Rika "i honestly still have": :PepeKek: Ok i'll try again
17:12:19*pch quit (Remote host closed the connection)
17:12:31FromDiscord<Shinyzenith> such as field 3
17:12:32FromDiscord<Shinyzenith> sent a long message, see http://ix.io/3SSO
17:13:01FromDiscord<Rika> oh man okay that sounds cursed
17:13:19FromDiscord<Shinyzenith>
17:13:26FromDiscord<Rika> i can think of something upo
17:13:27FromDiscord<Shinyzenith> it's really useful in wayland callback design
17:13:39FromDiscord<Shinyzenith> In reply to @Rika "i can think of": So no stdlib implementations? QwQ
17:13:43FromDiscord<Rika> no
17:13:46FromDiscord<Shinyzenith> 😔
17:13:51FromDiscord<Shinyzenith> that's a really useful macro tho!!
17:14:01FromDiscord<Shinyzenith> I'll make a github issue with feature request I guess
17:14:02FromDiscord<Shinyzenith> 👁️
17:14:03FromDiscord<Rika> i dont know anyone who has used it
17:14:17FromDiscord<Shinyzenith> 🥲
17:15:11FromDiscord<Rika> i get what it does now though
17:15:25FromDiscord<Shinyzenith> 🙏 Glad I could explain it
17:17:36FromDiscord<demotomohiro> @Shinyzenith Why dont you pass a pointer to `MyObject` instead of the field? Then you can easily access any fields of `MyObject` without using `fieldParentPtr`.
17:18:03FromDiscord<Shinyzenith> thing is, any sane person would do that
17:18:26FromDiscord<Shinyzenith> but the wl_listener notify field only accepts a wlr_listener(t) type
17:18:29FromDiscord<Shinyzenith> (edit) "wlr_listener(t)" => "wlr_listener(T)"
17:18:44FromDiscord<Shinyzenith> (edit) "wlr_listener(T)" => "wl_signal(T)"
17:19:12FromDiscord<Shinyzenith> libwayland created wl_container_of to counter this but it's a function style macro which futhark doesn't support yet
17:19:55*pch joined #nim
17:20:53FromDiscord<Rika> @Shinyzenith WAIT
17:20:56FromDiscord<Rika> I FOUND SOMETHING
17:21:07FromDiscord<Rika> its prolly not that long of a function
17:22:58FromDiscord<Rika> probably????
17:23:01FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3SSR
17:25:21FromDiscord<Rika> ah
17:25:22FromDiscord<Rika> cast
17:25:24FromDiscord<Rika> not convert
17:25:44FromDiscord<Rika> `cast[ptr T](cast[int](data) - offsetOf(T, field))[]`
17:25:47FromDiscord<Rika> its 2 am
17:25:50FromDiscord<Shinyzenith> Hmmm I don't understand it too well since I'm still not that good at nim↵but I guess the only way to find out is to stick it in the file lol↵i'll try when on pc <a:aPES_Fedora:493676570255294464>
17:25:51FromDiscord<Rika> im dead in the brain
17:26:02FromDiscord<Rika> you too tomohiro you should sleep XD
17:26:28FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3SSS
17:26:33FromDiscord<Rika> yeah i think that should work...?
17:26:59FromDiscord<Rika> `fieldParentPtr[SomeType](fieldnameNoQuotes, data)`
17:27:02FromDiscord<Rika> smth like that for usage
17:27:30FromDiscord<Shinyzenith> Ok i'll test it
17:27:34FromDiscord<demotomohiro> I think `cast[ptr T](cast[uint](data) - offsetOf(T, field).uint)[]`.
17:27:58FromDiscord<Rika> i guess that works "safer"
17:28:17FromDiscord<Shinyzenith> In reply to @Rika "`fieldParentPtr[SomeType](fieldnameNoQuotes, data)`": so the name of the field i'm passing as the data?
17:28:26FromDiscord<Rika> yes
17:28:47FromDiscord<Shinyzenith> Ok I'm gonna edit the server struct rq and get back to you
17:34:20FromDiscord<TennisBowling> has anyone used nim-presto?
17:35:31FromDiscord<Jakraes> Is there some sort of terminal event listener in nim?
17:35:44FromDiscord<Jakraes> Like, listening to key presses in terminal
17:37:45FromDiscord<Rika> set terminal to raw mode and you will get key presses as they are done
17:37:59FromDiscord<Rika> dont ask me how to do that, i did it a long time ago and it was legitimately painful
17:45:04FromDiscord<Phil> And here I thought I could save myself the "serialization" step in the data-line db-data --> nim object --> serialization --> json↵Turns out even if I have jsony, I still want to have special logic here and there and fields in a different name than the object fields are, so I still need a "serialization" step, I just create objects that jsony then serializes >_>
17:45:55FromDiscord<huantian> I do wish there was a way to create custom field hooks for specific object fields
17:46:37FromDiscord<Phil> Nim to define a whole lot of types for final serialization and conversion procs of my model-types into those serialization types
17:46:41FromDiscord<Phil> (edit) "Nim" => "Time"
17:52:17FromDiscord<Phil> Oh lord I have several levels of nested types
17:52:22FromDiscord<Phil> Gods this will be painful
18:07:28FromDiscord<Shinyzenith> @Rika https://media.discordapp.net/attachments/371759389889003532/954803307178774658/unknown.png
18:07:51FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954803402947321876/unknown.png
18:14:10*krux02 joined #nim
18:15:01FromDiscord<Rika> usage?
18:15:13FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954805259904110782/unknown.png
18:15:31FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3ST1
18:16:03FromDiscord<Shinyzenith> (edit) "https://play.nim-lang.org/#ix=3ST1" => "https://play.nim-lang.org/#ix=3ST2"
18:16:38FromDiscord<demotomohiro> You need to pass type for `[T]` like `fieldParentPtr[FooType](...)`
18:17:16FromDiscord<Shinyzenith> passing the type returns this] https://media.discordapp.net/attachments/371759389889003532/954805775249862677/unknown.png
18:17:38FromDiscord<Rika> AH im dumb 🙂
18:17:40FromDiscord<Elegantbeef> Nice a compiler error
18:17:53FromDiscord<Rika> no no im dumb, i passed an untyped to something expecting a sym
18:18:07FromDiscord<Rika> beef fix it its too late for me rn
18:18:33FromDiscord<Rika> prolly needs a macro at this point because i dont know how to get the symbol from a field name
18:18:53FromDiscord<Rika> the casts are unavoidable in this case as well btw
18:18:55FromDiscord<Elegantbeef> The hell are we doing?
18:19:06FromDiscord<Shinyzenith> Oh get some sleep! I'm sorry for the ping!
18:19:21FromDiscord<Rika> getting the address of a main object given a pointer to one of its fields
18:19:27FromDiscord<Rika> and the type of the main object
18:20:08FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3ST3
18:20:13FromDiscord<Rika> field shouldnt be untyped
18:20:18FromDiscord<Rika> offsetOf takes a sym
18:20:22FromDiscord<Elegantbeef> That wont change anything
18:20:25FromDiscord<Rika> ah wait no
18:20:42FromDiscord<Rika> it takes an untyped i think i mistook offsetof for the one in macros
18:20:45FromDiscord<Elegantbeef> the issue is you're passing `a.field` into `offsetOf`
18:20:47FromDiscord<Rika> yeah this should work
18:20:57FromDiscord<Elegantbeef> Doesnt matter if it takes or untyped
18:21:03FromDiscord<Rika> this offsetOf is the system one not macros
18:21:23FromDiscord<Elegantbeef> Nim sems code after the template expands so doesnt matter what the code takes
18:21:29FromDiscord<Rika> `var herb_server = fieldParentPtr(new_output, listener);` is his usage, aside from the missing [] its right isnt it?
18:21:41FromDiscord<Elegantbeef> The issue here is that you need to supply just the field name to `offsetOf`
18:21:49FromDiscord<Elegantbeef> Since it uses the `offsetOf` magic
18:22:00FromDiscord<Rika> he does...
18:22:04FromDiscord<Shinyzenith> O_O I'll read up about all this, cuz rn it's going all over my head
18:22:09FromDiscord<Rika> what are you on about
18:22:17FromDiscord<Elegantbeef> I misread the usage
18:22:18FromDiscord<Rika> this is exactly whats happening
18:22:19FromDiscord<Rika> xd
18:22:43FromDiscord<Solitude> matrix bridge scrambles parameters in codeblocks
18:22:47FromDiscord<Rika> okay
18:22:51FromDiscord<Rika> unfortunate
18:23:12FromDiscord<Elegantbeef> It doesnt of course it's just what we're going with
18:23:23FromDiscord<Shinyzenith> sent a long message, see http://ix.io/3ST7
18:23:28FromDiscord<Shinyzenith> that's what I was trying to achieve
18:27:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3STb
18:27:08FromDiscord<Elegantbeef> Issue is that generic parameters are fucky in templates
18:28:05FromDiscord<Elegantbeef> `echo fieldParentPtr(b, obj.b.addr, MyObject)`
18:28:10FromDiscord<Rika> unfortunate
18:28:15FromDiscord<Elegantbeef> No redundant call
18:28:41FromDiscord<Rika> if you want to make it like the one in zig the order of params would be `T: typedesc, field: untyped, data: pointer`
18:36:12FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3STj
18:36:25FromDiscord<Shinyzenith> In reply to @Rika "if you want to": well if it works, it works 😆
18:38:08FromDiscord<Shinyzenith> Thank you beef and Rika !! It works flawlessly!
18:38:11FromDiscord<Shinyzenith> just like the one in zig
18:38:20FromDiscord<Shinyzenith> I'll read up about templates to understand this :D
19:41:37FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3STF
19:45:23FromDiscord<Phil> I'm actually not sure jsony can do JSON --> Table,
19:45:31FromDiscord<Phil> Or even JSON --> JsonNode
19:45:44FromDiscord<ajusa> JSON --> JsonNode should work, it has that in its readme I think
19:46:02FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3STH
19:46:07FromDiscord<Phil> In the jsony examples it has Table --> JSON, the other way around I haven't seen
19:46:47FromDiscord<ajusa> Hm, maybe. Also @Phil, did you try doing something like `import chronicles except toJson` for https://github.com/treeform/jsony/issues/47?
19:46:55FromDiscord<ajusa> (edit) "https://github.com/treeform/jsony/issues/47?" => "https://github.com/treeform/jsony/issues/47 ?"
19:47:43FromDiscord<ajusa> also the readme seems to have a table parsing example, not sure how I'm screwing this up in my code
19:53:32FromDiscord<Phil> In reply to @ajusa "Hm, maybe. Also <@!180601887916163073>,": That works as well, doesn't fix the underlying issue though that it shouldn't be the case that code within jsony explodes in such a scenario
19:54:50FromDiscord<Phil> In this scenario I don't need the "toJson" proc from another package, in other scenarios I might and then I'll still have to adjust jsony's code because the template within can't ensure it calls primarily the procs from the same module as the template
19:55:46FromDiscord<ajusa> fair point. You are probably right in that jsony should prefix internal calls with jsony.whatever, but it's also just a strange issue
19:56:19FromDiscord<Phil> I mean, for the most part it's because nim doesn't have a lot of large-ish application which would want to do a ton of logging
19:57:36FromDiscord<Phil> Given how funkily logging behaves for me (I e.g. get no longer the error outputs of prologue/norm when an error occurs for some utterly obscure reason) I'm not a terribly large fan of what we have for logging currently either way
19:58:26FromDiscord<ajusa> yeah, logging could be better in Nim land, I agree. too many solutions as well imo
20:02:23FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3STI
20:13:27*kayabaNerve quit (Ping timeout: 252 seconds)
20:19:21*jjido joined #nim
20:26:52*kayabaNerve joined #nim
20:36:33*kayabaNerve quit (Ping timeout: 252 seconds)
20:42:10FromDiscord<hmmm> hoy what's our nim way of python int(string,base)
20:43:21FromDiscord<Elegantbeef> What does that do?
20:43:36FromDiscord<hmmm> takes a string and makes it int but in the preferred base
20:44:11FromDiscord<Elegantbeef> preferred base meaning?
20:44:33FromDiscord<Phil> as in base 2, base 4
20:44:40FromDiscord<hmmm> like hmm binary base ten
20:45:23FromDiscord<Elegantbeef> Nim has just normal parse methods
20:45:41FromDiscord<Phil> if nim has a log proc and the inverse of a log proc you can do that calculation
20:46:02FromDiscord<hmmm> hmm
20:46:03FromDiscord<Phil> I'd need to check up on the formula again for converting into a base of your choosing
20:46:09FromDiscord<Elegantbeef> `parseHexInt`, `parseBinInt`, `parseInt`
20:46:26FromDiscord<hmmm> the base should be 36 lol
20:46:36FromDiscord<Elegantbeef> If you need base 36 you're in hell
20:46:40FromDiscord<Phil> but if you can get the logarithm of a number in any way you can calculate stuff to base 36
20:46:55FromDiscord<hmmm> 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
20:47:01FromDiscord<hmmm> lol
20:47:37FromDiscord<Elegantbeef> You also could always write your own silly base parser
20:47:49FromDiscord<hmmm> I'll probably need to
20:47:56FromDiscord<Elegantbeef> Why do you have base 36?
20:48:00FromDiscord<hmmm> need to brush my pity maths
20:48:17FromDiscord<hmmm> It's for a stupid attempt I'm doing it won't probably amount to much
20:49:26FromDiscord<hmmm> part1 of the plan is encoding and decoding base 36
20:50:04FromDiscord<Elegantbeef> Well 0 to Z is a terrible format for base
20:50:26FromDiscord<hmmm> encode part was just translating the python thing on nim, but the decoding part python has the battery included thingy
20:57:10FromDiscord<Elegantbeef> The downsized of `0-9`, 'A-Z' is that there is no easy to reason bit op 😀
20:57:24FromDiscord<tandy> hmm, my library isnt importing↵it has \_ in the name could that be why?
20:57:34FromDiscord<Elegantbeef> what's the module name?
20:57:36FromDiscord<tandy> https://github.com/tandy-1000/simple-matrix-client
20:57:40FromDiscord<Elegantbeef> how are you importing
20:57:41FromDiscord<tandy> simple\_matrix\_client
20:57:52FromDiscord<tandy> import pkg/simple\_matrix\_client
20:57:53FromDiscord<Elegantbeef> That's not a file in the module
20:58:21FromDiscord<Elegantbeef> `simple_matrix_client/client`?
20:58:23FromDiscord<tandy> tru, but i tried `import pkg/simple_matrix_client/client`
20:58:35FromDiscord<Elegantbeef> How are you compiling?
20:58:43FromDiscord<tandy> no luck
20:58:44FromDiscord<Elegantbeef> How have you installed the package
20:58:50FromDiscord<Elegantbeef> How are you compiling, not are you
20:58:58FromDiscord<tandy> `nim js`
20:59:03FromDiscord<tandy> nimble install in directory
20:59:52FromDiscord<Elegantbeef> Ok so you have `.nimble/pkgs/[email protected]/simple_matrix_client` or w/e?
21:00:51FromDiscord<tandy> hmm no i have bin/client.js
21:01:35FromDiscord<Elegantbeef> This isnt a hybrid directory
21:01:42FromDiscord<Elegantbeef> hybrid package\
21:01:46FromDiscord<tandy> ok i removed bin from nimble
21:01:57FromDiscord<tandy> i have this yes
21:02:07FromDiscord<Elegantbeef> So you've fixed it?
21:02:16FromDiscord<tandy> still cant open file
21:02:37FromDiscord<Elegantbeef> fine i'll get it working here
21:02:46FromDiscord<tandy> thanks beef
21:04:23FromDiscord<Elegantbeef> https://github.com/nim-lang/nimble#hybrids
21:07:26FromDiscord<tandy> i read this
21:08:35FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3STU
21:10:23FromDiscord<tandy> i pushed some changes to make it hybrid package
21:11:21FromDiscord<Elegantbeef> the `src` might be the issue
21:12:45FromDiscord<tandy> i mean im confused \:o
21:12:49FromDiscord<Elegantbeef> Well use more words
21:13:02FromDiscord<Elegantbeef> Yea
21:13:21FromDiscord<Elegantbeef> If you look at the install it's installing the src at root
21:14:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3STW
21:14:38FromDiscord<Elegantbeef> As such all files at the root of `src` are added first class
21:14:46FromDiscord<tandy> ahh yeah
21:15:15FromDiscord<Elegantbeef> so either add a new folder or make Nimble like your structure
21:15:28FromDiscord<Elegantbeef> It's up to you if you want to bitch about being forced into a file structure, that one's a freebie
21:15:31FromDiscord<tandy> i just need to rename client.nim to simple\_matrix\_client.nim
21:16:01FromDiscord<Elegantbeef> Well you also should move the sub modules into a sub folder if you want to import using `import simple_matrix_client/server`
21:17:54FromDiscord<tandy> nah i just want to import client.nim
21:18:10FromDiscord<Elegantbeef> You can currently 😛
21:18:25FromDiscord<Elegantbeef> Though that pollutes all other packages
21:18:42FromDiscord<tandy> yea i want to do `import simple_matrix_client/client`
21:19:28FromDiscord<Elegantbeef> Well look at balls' nimble https://github.com/disruptek/balls/blob/master/balls.nimble
21:22:03FromDiscord<hmmm> can we haz disruptek back?
21:22:10FromDiscord<hmmm> I miss the old geezer
21:23:15FromDiscord<Elegantbeef> Prestige it's bug search part deux 😛
21:25:00*ltriant quit (Ping timeout: 250 seconds)
21:27:42FromDiscord<tandy> tysm beef
21:27:45FromDiscord<tandy> that took a whie
21:27:53FromDiscord<Elegantbeef> No problem
21:30:26FromDiscord<Elegantbeef> Oh boy is kate + nimlsp is lovely for compiler developing, fast symbol look up and searching
21:31:17FromDiscord<Elegantbeef> Compared to vscode atleast
21:33:26*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:42:30FromDiscord<Mysterysib> Do ya'll prefer coding on a white background or a black one?
21:42:32FromDiscord<Mysterysib> I can't decide
21:42:35*wyrd quit (Ping timeout: 240 seconds)
21:43:06FromDiscord<Elegantbeef> ayu mirage
21:46:19FromDiscord<iencec> is there way to run just a specific proc as sudo?
21:46:21*kayabaNerve joined #nim
21:47:06FromDiscord<Elegantbeef> I dont imagine you can raise a small part of a program to elevated privilege, though i could be wrong, what're you trying to do?
21:47:36FromDiscord<Generic> Elegantbeef, I think this could be related: https://github.com/saem/vscode-nim/issues/82
21:48:17FromDiscord<Elegantbeef> Yea it probably is it
21:48:23FromDiscord<Elegantbeef> Though the searching is just vscode
21:48:55FromDiscord<iencec> [Elegantbeef](https://matrix.to/#/%40elegantbeef%3Amatrix.org) it is live linux startup script most config is done as user, but a few things need sudo
21:49:22FromDiscord<iencec> so far I had two separate cli binaries
21:49:26FromDiscord<Elegantbeef> Run everything that doesnt need sudo then prompt for sudo password when you need it is what i'd do
21:49:36FromDiscord<iencec> called the second with sudo.
21:49:44*wyrd joined #nim
21:50:16FromDiscord<Elegantbeef> I dont know the proper way to do this so i should shush
21:50:45FromDiscord<iencec> [Elegantbeef](https://matrix.to/#/%40elegantbeef%3Amatrix.org) but in two separate binaries? or within one?
21:51:16FromDiscord<Elegantbeef> I'd do it in one binaries, but like i said I know nothing
21:51:17FromDiscord<iencec> with two it works already, but feels clunky.
21:51:44FromDiscord<iencec> yeah, one single binary would be great.
21:53:00FromDiscord<Elegantbeef> There is `osproc.startProcess` and https://nim-lang.org/docs/terminal.html#readPasswordFromStdin%2Cstring%2Cstring
21:53:31FromDiscord<Elegantbeef> So you can exec the process then if the program requires `password` you can enter it, though no clue how this is properly done
21:53:44FromDiscord<Elegantbeef> Probably smarter to elevate the process if possiblee
21:53:54FromDiscord<iencec> thx! will have a look.
21:59:20FromDiscord<Elegantbeef> Well I seemed to have found the bug with nimsuggest, `==` is not the same as `sameType` 😛
22:08:20FromDiscord<Shinyzenith> @beef @Rika I think I'm getting the wrong pointer or something↵not entirely sure
22:08:58FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954864082194931752/unknown.png
22:09:11FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954864136276295710/unknown.png
22:09:30FromDiscord<Shinyzenith> Since I'm not getting the same struct data, wlr_output_init_render call isn't working
22:11:18FromDiscord<Shinyzenith> (edit) "working" => "working↵↵and the socket data is different too"
22:13:41FromDiscord<Elegantbeef> Uhhh i'm uncertain here
22:14:32FromDiscord<Elegantbeef> What's the typedef of the HerbServer?
22:14:38FromDiscord<Shinyzenith> That's the struct
22:15:14FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954865658292736000/unknown.png
22:17:41FromDiscord<Elegantbeef> That's not what i asked
22:19:45FromDiscord<Shinyzenith> Oh sorry Didn't read it completely
22:19:51FromDiscord<Shinyzenith> 4am brain does that to me
22:19:52FromDiscord<Shinyzenith> 🥴
22:20:03FromDiscord<Shinyzenith> In reply to @Elegantbeef "What's the typedef of": https://media.discordapp.net/attachments/371759389889003532/954866870400479312/unknown.png
22:20:31FromDiscord<Elegantbeef> No problem, just wanted to make sure nothing was unsafe
22:20:36FromDiscord<Elegantbeef> Well "unsafe"
22:20:43FromDiscord<Shinyzenith> :PepeKek: got it
22:23:38FromDiscord<Elegantbeef> Hmm is there any chance you're not getting the object's address passed?
22:24:27FromDiscord<Elegantbeef> on the side that calls this proc do `echo cast[int](myHerbServer.newOutput.addr)` and inside the callback do `echo cast[int](data)`
22:26:41FromDiscord<Shinyzenith> Ok will do
22:26:51FromDiscord<Shinyzenith> shouldn't it be new_output?
22:27:05FromDiscord<Elegantbeef> Nim is style insensitive
22:27:11FromDiscord<Elegantbeef> I dont write snakecase
22:27:18FromDiscord<Shinyzenith> In reply to @Elegantbeef "Nim is style insensitive": Did not know that
22:27:27FromDiscord<Shinyzenith> interesting
22:27:33FromDiscord<Shinyzenith> 93914817010384
22:27:34FromDiscord<Shinyzenith> i got that
22:27:37FromDiscord<Shinyzenith> on the side that calls the proc
22:27:38FromDiscord<Elegantbeef> Much like the first book of the bible, the snake leads you to sin 😛
22:27:45FromDiscord<Shinyzenith> :PepeKek:
22:27:48FromDiscord<Elegantbeef> And other silly jokes you can tell yourself
22:28:19FromDiscord<Elegantbeef> And inside thee callback?
22:28:34FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954869012251172864/unknown.png
22:28:42FromDiscord<Shinyzenith> looks like the values of the pointers are different
22:28:54FromDiscord<Shinyzenith> (edit) "values" => "addrs"
22:29:02FromDiscord<Elegantbeef> Which means you're not getting a pointer to `newOutput`
22:29:06FromDiscord<Elegantbeef> So either the API doesnt work as you expect or you're doing somethiing wrong
22:29:31FromDiscord<Shinyzenith> 😓
22:29:55FromDiscord<Elegantbeef> Do you have the place where you pass the `newOutput` to the callback?
22:30:08FromDiscord<Shinyzenith> Yes
22:30:20FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954869459175239690/unknown.png
22:30:58FromDiscord<Shinyzenith> oh
22:31:05FromDiscord<Shinyzenith> they are supposed to be different
22:31:08FromDiscord<Shinyzenith> we're checking 2 different entities
22:31:15FromDiscord<Shinyzenith> new_output is a callback↵data is a just a void pointer
22:31:23FromDiscord<Shinyzenith> ofc they have different pointers
22:31:38FromDiscord<Shinyzenith> on logging the pointer to the server struct from both outside and inside the callback I get the same address
22:31:44FromDiscord<Elegantbeef> Well give me the code that passes `newOutput`
22:31:49FromDiscord<Shinyzenith> oh nvm I still don't
22:32:01FromDiscord<Shinyzenith> In reply to @Elegantbeef "Well give me the": I'll push to a branch and send the link
22:32:06FromDiscord<Elegantbeef> Thanks
22:32:33FromDiscord<Elegantbeef> Less pulling of teeth is always better
22:32:51FromDiscord<Shinyzenith> yep
22:32:55FromDiscord<Shinyzenith> https://github.com/waycrate/nim-wl/tree/devel
22:33:09FromDiscord<Shinyzenith> you're gonna need clang and futhark installed
22:33:16FromDiscord<Shinyzenith> edit the path of clang according to your version number
22:33:19*Gustavo6046 quit (Remote host closed the connection)
22:33:22FromDiscord<Shinyzenith> if on arch, the one I have set right now should work fine
22:33:44FromDiscord<Elegantbeef> Eh i'm not running it
22:33:51FromDiscord<Shinyzenith> Oh all cool
22:33:57FromDiscord<Shinyzenith> thank you for helping tho 🙏
22:34:02FromDiscord<Shinyzenith> I appreciate you taking the time ;w;
22:34:10FromDiscord<Elegantbeef> `wl_signal_add` takes a pointer to the signal and a pointer to the listener
22:34:39FromDiscord<Shinyzenith> you mean in libwayland or in the wrapper I wrote?
22:34:41*Gustavo6046 joined #nim
22:34:43FromDiscord<Elegantbeef> `herb_server.new_output.addr` on line 13
22:35:03FromDiscord<Elegantbeef> Yea your wrapper assumes something
22:35:20FromDiscord<Elegantbeef> It assumes `wl_listener` is passed by ref
22:35:37FromDiscord<Elegantbeef> `proc wl_signal_add(wl_signal: wl_signal, wl_listener: wl_listener)` turn this into `proc wl_signal_add(wl_signal: wl_signal, wl_listener: var wl_listener)`
22:36:03FromDiscord<Elegantbeef> If it's passed by copy you've got something unsafe
22:36:12FromDiscord<Shinyzenith> Ok will do
22:36:15FromDiscord<Elegantbeef> Which is probably the issue
22:36:15*jjido joined #nim
22:36:39FromDiscord<Shinyzenith> well it reports the correct pointers now
22:36:46FromDiscord<Elegantbeef> Good
22:36:49FromDiscord<Elegantbeef> Solved the issue
22:37:19FromDiscord<Shinyzenith> but it still doesn't work....hmm which means output.allocator or allocator is still remaining null which shouldn't happen↵↵I will try and debug this on my own
22:37:19FromDiscord<Shinyzenith> thanks
22:37:52FromDiscord<Elegantbeef> ` cast[ptr T](cast[int](data) - offsetOf(T, field))[]` is also wrong then i think
22:38:20FromDiscord<Elegantbeef> Actually nvm i'm dumb
22:38:24FromDiscord<Shinyzenith> I don't think so because this time on calling herbServer.socket ↵it returns the same value both inside and inside of the callback
22:38:25FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954871493282631730/unknown.png
22:38:33FromDiscord<Elegantbeef> Yea i was being dumb
22:38:40FromDiscord<Shinyzenith> https://media.discordapp.net/attachments/371759389889003532/954871557824581652/unknown.png
22:38:49FromDiscord<Shinyzenith> hmmm interesting error
22:38:57FromDiscord<Shinyzenith> never encountered this in zig/c ↵i'm probably doing someting wrong
22:39:56FromDiscord<Elegantbeef> Is it line 64 in server causing the issue?
22:41:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SUi
22:41:27FromDiscord<Elegantbeef> Dont need the return at the end and the code is cleaner imo
22:42:14FromDiscord<Elegantbeef> The issue is on line 64
22:42:27FromDiscord<Elegantbeef> `var herb_server = fieldParentPtr(HerbServer,new_output, listener);` makes a copy
22:42:53FromDiscord<Elegantbeef> Or atleast possibly the issue
22:42:57FromDiscord<Shinyzenith> In reply to @Elegantbeef "also do yourself a": Oh didn't know about this notation
22:42:57FromDiscord<Shinyzenith> will do
22:43:05FromDiscord<Elegantbeef> I say about 100 dumb things before a smart thing comes out so we're going to be here a while 😛
22:43:13FromDiscord<Shinyzenith> In reply to @Elegantbeef "Is it line 64": if (not wlr_output_init_render(wlr_output.addr, herb_server.allocator, herb_server.renderer)): ↵↵this line
22:43:14FromDiscord<Elegantbeef> Nim has a implicit result variable
22:43:40FromDiscord<Shinyzenith> In reply to @Shinyzenith "if (not wlr_output_init_render(wlr_output.addr, her": and this line throws the error because of:
22:43:59FromDiscord<Shinyzenith> 1 sec, searching for the line
22:44:15FromDiscord<Shinyzenith> this line https://media.discordapp.net/attachments/371759389889003532/954872960353726504/unknown.png
22:45:12FromDiscord<Elegantbeef> So we know the right hand isnt null, but the left hand is
22:45:34FromDiscord<Elegantbeef> So for some reason `wlrOutput`'s allocator/renderer is not nil
22:45:59FromDiscord<Elegantbeef> `var wlr_output = cast[wlr_output](data);` this is wrong
22:46:05FromDiscord<Elegantbeef> data is a `ptr`
22:46:26FromDiscord<Elegantbeef> that should be `var wlrOutput = cast[ptr wlrOutput](data)`
22:46:34FromDiscord<Shinyzenith> hm I'll try
22:47:31FromDiscord<Shinyzenith> better now? https://media.discordapp.net/attachments/371759389889003532/954873781678145616/unknown.png
22:47:39FromDiscord<Elegantbeef> I mean i know for a certainty there is a very low chance that you get lucky enough to get multiple 0'd bytes from a pointer 😛
22:47:39FromDiscord<Elegantbeef> So this will work
22:47:58FromDiscord<Elegantbeef> Less redundant yes
22:48:09FromDiscord<Shinyzenith> aaaa https://media.discordapp.net/attachments/371759389889003532/954873943817355304/unknown.png
22:48:12FromDiscord<Shinyzenith> :dead:
22:48:18FromDiscord<Shinyzenith> 1 sec i'll clean itup
22:48:23FromDiscord<Elegantbeef> got a useless comma
22:48:30FromDiscord<Shinyzenith> oh yes.
22:50:08FromDiscord<Shinyzenith> Final iteration
22:50:10FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=3SUl
22:50:10FromDiscord<Shinyzenith> time to compile
22:50:26FromDiscord<Shinyzenith> oof got an extra pointer somewhere https://media.discordapp.net/attachments/371759389889003532/954874519082897458/unknown.png
22:50:34FromDiscord<Shinyzenith> found it
22:50:48FromDiscord<Elegantbeef> Yea the compiler told you where
22:51:07FromDiscord<Shinyzenith> WOO IT WORKS
22:51:13FromDiscord<Elegantbeef> If you couldnt find it i'd make a PR to disallow anyone with the user name `aakash` from using NIm
22:51:17FromDiscord<Shinyzenith> WTF I'VE BEEN TRYING TO FIX THIS FOR HOURS 😭
22:51:23FromDiscord<Shinyzenith> In reply to @Elegantbeef "If you couldnt find": :PepeKek:
22:51:38FromDiscord<Shinyzenith> In reply to @Shinyzenith "WTF I'VE BEEN TRYING": How did you know the pointer was the issue?
22:51:43FromDiscord<Shinyzenith> I mean I'm calling addr again
22:51:49FromDiscord<Shinyzenith> so technically I should get the same pointer
22:51:50FromDiscord<Shinyzenith> right?
22:51:52FromDiscord<Elegantbeef> \`Error\: Someone noticed you cant read compiler issues"
22:51:54FromDiscord<Elegantbeef> No
22:52:00FromDiscord<Shinyzenith> In reply to @Elegantbeef "\`Error\: Someone noticed you": 🤣
22:52:01FromDiscord<Elegantbeef> Addr of a pointer is double indirection
22:52:12FromDiscord<Shinyzenith> In reply to @Elegantbeef "Addr of a pointer": Oh
22:52:18FromDiscord<Shinyzenith> Right
22:52:21FromDiscord<Shinyzenith> I'll remember this
22:52:52FromDiscord<Elegantbeef> Pointers are fun
22:52:57FromDiscord<Shinyzenith> and painful
22:53:18FromDiscord<Shinyzenith> rust pointers feel the most comfy
22:53:47FromDiscord<Elegantbeef> Nim pointers are nice if you ask me
22:54:26FromDiscord<Shinyzenith> I guess I'm still too inexperienced, we'll see in a few months after I finish herb...hopefully by then I'll know a bit more.
22:54:32FromDiscord<Elegantbeef> Throwing cast haphazardly around to get the type system happy isnt how you use pointers
22:54:52FromDiscord<Shinyzenith> well yes but if I don't libwayland gets angry 🥲
22:54:58FromDiscord<Elegantbeef> Is herb a herbsluftwm inspired WM for wayland
22:55:11FromDiscord<Elegantbeef> Sure but you dont want to make it happy you want to make sure it makes sense
22:56:02FromDiscord<Shinyzenith> sent a long message, see http://ix.io/3SUn
22:56:12FromDiscord<Shinyzenith> bspwm because I already cloned sxhkd for wayland 😜
22:56:25FromDiscord<Shinyzenith> In reply to @Elegantbeef "Sure but you dont": Yep, understood :salute:
22:56:43FromDiscord<Elegantbeef> It's 4am for you so i'll excuse the illogical casting
22:56:55FromDiscord<Shinyzenith> 🤣 🤣 thank you
22:57:04FromDiscord<Shinyzenith> 4:30 now 🤣
22:57:11FromDiscord<Shinyzenith> I appreciate the help 🥰
22:57:18FromDiscord<Elegantbeef> Imagine living in a half timezone
22:57:19FromDiscord<Shinyzenith> Do you have a github I can follow?
22:57:31FromDiscord<Alea> does nim have a pass statement like in python?
22:57:42FromDiscord<Elegantbeef> `discard`
22:57:56FromDiscord<Alea> ah didn't know that can work for this
22:57:57FromDiscord<Elegantbeef> https://github.com/beef331 is my github
22:58:07FromDiscord<Elegantbeef> I mean you dont need a pass statement in nim
22:58:10FromDiscord<Elegantbeef> You just need some ast
22:58:27FromDiscord<Elegantbeef> so `discard` `##` both work
22:58:33FromDiscord<Shinyzenith> Followed 😉
22:58:55FromDiscord<Elegantbeef> Oh boy i'm famous
22:59:40FromDiscord<Shinyzenith> 🤣
23:01:09FromDiscord<Elegantbeef> I dont get github following for the most part
23:01:34FromDiscord<Elegantbeef> It's such a weird thing, some people do the whole follow to get a follow stuff and it's just fucking weird
23:01:37FromDiscord<Shinyzenith> basically tells me what other people are writing / what's the hot new tech people are starring↵basically keeps me upto date
23:01:40FromDiscord<Elegantbeef> Why do you want to follow 300000 developers
23:02:08FromDiscord<Elegantbeef> I only follow people i know in real life or people writing stuff I like
23:02:22FromDiscord<Elegantbeef> I dont play it like a social media platform, then again I dont use social media platforms
23:02:38FromDiscord<Shinyzenith> Same
23:02:46FromDiscord<Shinyzenith> I just use element for work stuff
23:02:51FromDiscord<Elegantbeef> Continues to rant about people that have like 2000 follows that randomly follow me
23:03:00FromDiscord<Shinyzenith> 🤣 🤣
23:03:07FromDiscord<Elegantbeef> Yet you're not using matrix to talk here?
23:03:11FromDiscord<Elegantbeef> 0/10 matrix user
23:03:19FromDiscord<Shinyzenith> I don't know the matrix chat room link QwQ
23:03:39FromDiscord<Elegantbeef> https://matrix.to/#/#nim:envs.net
23:03:41FromDiscord<Shinyzenith> and most of my wayland developer friends are here so it's just easier for me to copy paste this
23:03:44FromDiscord<Shinyzenith> (edit) "this" => "stuff"
23:03:45FromDiscord<Shinyzenith> and discuss
23:03:51FromDiscord<Shinyzenith> In reply to @Elegantbeef "https://matrix.to/#/#nim:envs.net": omw
23:04:12FromDiscord<Bubblie> I like rust a lot but I have a problem using it because of its syntax, my brain is very weird and its hard for me to comprehend languages who have syntax that relies on symbol usage that heavily, its not haskell of course but its still hard for me ig
23:04:15FromDiscord<Elegantbeef> Ah i've been trying to use matrix more, sadly doesnt have channelled voip yet so not great
23:04:21FromDiscord<Bubblie> its more of a me problem
23:04:24FromDiscord<Elegantbeef> Ever since teamspeak i love my chalnelled voip!
23:04:26FromDiscord<Bubblie> rather than rust being the problem
23:04:38FromDiscord<Shinyzenith> In reply to @Elegantbeef "Ever since teamspeak i": O
23:04:38FromDiscord<Bubblie> becuase rust isn't the problem its just me not being able to read it properly
23:04:48FromDiscord<Elegantbeef> I think rust is a good language for everything but ergonomics and readabillity
23:04:48FromDiscord<Shinyzenith> In reply to @Bubblie "becuase rust isn't the": I struggled with that too
23:04:56FromDiscord<Bubblie> In reply to @Elegantbeef "I think rust is": same
23:05:17FromDiscord<Elegantbeef> Prestige got a PR to fix your bug, hopefully it's acceepted
23:05:21FromDiscord<Shinyzenith> In reply to @Shinyzenith "I struggled with that": I just tried writing more and more programs till it stuck with me↵but I still get intimidated by huge repos such as smithay
23:05:28FromDiscord<Bubblie> its an amazing language but so hard to read and utilize at times, its why I was looking for ways I could do low level programming without heavy usage of the three titans C/C++/Rust
23:05:30FromDiscord<Bubblie> and then I found nim
23:05:42FromDiscord<Bubblie> which allowed me to use C and C++ libraries a lot more easier
23:05:43FromDiscord<Elegantbeef> I mean i've never written Rust properly, i just cant get into it
23:05:50FromDiscord<Elegantbeef> It's just such a mess to read for me
23:05:52FromDiscord<Bubblie> Same
23:06:25FromDiscord<Bubblie> In reply to @Shinyzenith "I just tried writing": huge repos in rust are the bane of my existence
23:06:25FromDiscord<Shinyzenith> In reply to @Elegantbeef "I mean i've never": I got into it with my first rust program actually lol https://github.com/waycrate/swhkd↵it hit all the points for the language I needed so I stuck with it for a few days and it felt amazing for a small project like this
23:06:32FromDiscord<Shinyzenith> In reply to @Bubblie "huge repos in rust": absolutely
23:06:41FromDiscord<Bubblie> like, in other languages its somewhat comprehensive right
23:06:47FromDiscord<Bubblie> but when I look at complicated rust repos
23:06:48FromDiscord<Bubblie> I just
23:06:48FromDiscord<Bubblie> die
23:06:50FromDiscord<Bubblie> and disspiate
23:06:54FromDiscord<Bubblie> (edit) "disspiate" => "dissipate"
23:06:59FromDiscord<Elegantbeef> Plus I'm already capable of bug fixes with Nim, cant wast that effort 😛
23:07:04FromDiscord<Shinyzenith> I think repos such as smithay are comprehensive, just too comprehensive sometimes
23:07:10FromDiscord<Shinyzenith> traits, implementations, turbofish
23:07:12FromDiscord<Shinyzenith> what not
23:07:20FromDiscord<Shinyzenith> too much shit to remember!! :PepeKek:
23:07:26FromDiscord<Bubblie> so like, its too comprehensive that it becomes too hard to read
23:07:28FromDiscord<Bubblie> is what you mean
23:07:32FromDiscord<Shinyzenith> yes
23:07:37FromDiscord<Bubblie> very very relateable
23:07:45FromDiscord<Bubblie> Im glad I found nim truly
23:07:49FromDiscord<Elegantbeef> I still should finish my X WM eventually
23:07:51FromDiscord<Bubblie> I am experimenting with nim pointers
23:07:54FromDiscord<Bubblie> they are pretty good ngl
23:07:57FromDiscord<Elegantbeef> I got it relatively far but gave up
23:08:14FromDiscord<Elegantbeef> The biggest thing is they're distinct from collections
23:08:17FromDiscord<Shinyzenith> try wlroots!
23:08:20FromDiscord<Elegantbeef> Fuck no
23:08:22FromDiscord<Shinyzenith> Xorg is legacy!!
23:08:24FromDiscord<Bubblie> LMAO
23:08:34FromDiscord<Shinyzenith> I say fuck yes 😎
23:08:43FromDiscord<Elegantbeef> I've heard too many issues with wayland and gaming
23:08:47FromDiscord<Elegantbeef> So i'll hold off for now
23:08:49FromDiscord<Shinyzenith> casually hopping platforms
23:09:07FromDiscord<Elegantbeef> Plus i dont really feel like doing it
23:09:15FromDiscord<Shinyzenith> If i'm not mistaken the steam deck uses wayland for the gaming mode and xorg for desktop mode
23:09:16FromDiscord<Shinyzenith> so
23:09:42FromDiscord<Elegantbeef> Doesnt change what i've seen/heard
23:09:44FromDiscord<Elegantbeef> I thought it only used pipewire and still uses X
23:09:44FromDiscord<Shinyzenith> Understandable
23:09:50FromDiscord<Shinyzenith> what's the name of your wm?
23:10:03FromDiscord<Elegantbeef> "GoodWm" since it's not awesome 😛
23:10:06FromDiscord<Shinyzenith> I know a dude who wrote a Xwm in nim , maybe you'd like to take a look?
23:10:14FromDiscord<Shinyzenith> O
23:10:16FromDiscord<Elegantbeef> Are you talking about nimdow
23:10:20FromDiscord<Shinyzenith> Nope
23:10:23FromDiscord<Elegantbeef> Ah
23:10:26FromDiscord<Shinyzenith> it's a dynamic tag based window manager
23:10:40FromDiscord<Elegantbeef> https://github.com/beef331/goodwm is my shitty WM
23:10:48FromDiscord<Shinyzenith> https://github.com/codic12/worm
23:10:52FromDiscord<Elegantbeef> Undoccumented and terribly layed out
23:10:53FromDiscord<Elegantbeef> Ah i've helped codic
23:10:55FromDiscord<Bubblie> I am going to make a boid simulation in nim and vulkan
23:11:01FromDiscord<Bubblie> boids are flock simulations
23:11:03FromDiscord<Shinyzenith> well we all start somewhere lmao
23:11:13FromDiscord<Bubblie> this will give me a decent idea on how to use nim well
23:11:14FromDiscord<Bubblie> I think
23:11:19FromDiscord<Bubblie> it seems like a nice project to do
23:11:43FromDiscord<Bubblie> vulkan requires me to write like
23:11:48FromDiscord<Bubblie> 500 lines initially though
23:11:50FromDiscord<Bubblie> then it gets easier
23:11:51FromDiscord<Bubblie> LMAO
23:12:03FromDiscord<Elegantbeef> I still say just use opengl
23:12:04FromDiscord<Shinyzenith> Anyways, my bed is too eager for me to lay down 🥴 5 am
23:12:05FromDiscord<Bubblie> (edit) "500" => "1000+"
23:12:11FromDiscord<Bubblie> In reply to @Elegantbeef "I still say just": Im never dealing with state again
23:12:12FromDiscord<Shinyzenith> gn!
23:12:13FromDiscord<Elegantbeef> State machine sucks, but man is it easier 😛
23:12:13FromDiscord<Elegantbeef> Buh bye
23:12:14FromDiscord<Bubblie> horrible experience
23:12:19FromDiscord<Bubblie> In reply to @Elegantbeef "State machine sucks, but": true
23:12:20FromDiscord<Shinyzenith> 👋
23:12:25FromDiscord<Bubblie> gn
23:13:34FromDiscord<Bubblie> I do need to get better at vulkan
23:13:53FromDiscord<Bubblie> Its verbose as shit right
23:13:54FromDiscord<Bubblie> But
23:14:00FromDiscord<Bubblie> It has a lot of stuff to compensate for it
23:14:14FromDiscord<Elegantbeef> My understanding is you can use macros/templates to really make it easier to use
23:14:20FromDiscord<Bubblie> Yeah
23:14:23FromDiscord<Elegantbeef> But i've not used vulkan so no clue how true that is
23:14:55FromDiscord<Bubblie> Im gonna have to read the vulkan c++ tutorial again and convert it to code I can use in nim
23:15:31FromDiscord<Bubblie> Might not be too hard
23:15:36FromDiscord<Bubblie> I say that now
23:15:47FromDiscord<Bubblie> To help others ill make it a github repo
23:15:58FromDiscord<Elegantbeef> Eh the Nim code will be nicer i'm certain!
23:16:09FromDiscord<Elegantbeef> Port a tutorial to Nim and document it 😛
23:16:44FromDiscord<Elegantbeef> Anything you dont know you can then replace with "I asked some fucker on the real time chat and he said '...'"
23:17:03FromDiscord<Bubblie> LOL
23:17:41FromDiscord<Bubblie> I think the problem is in how I write the nim code since im reading a tutorial thats C++
23:18:08FromDiscord<Elegantbeef> You write it the same way then ask someone that knows Nim to suggest how to make it idiomatic is one way
23:18:36FromDiscord<Bubblie> Yeah
23:18:59FromDiscord<Elegantbeef> Or just write it idiomatically to start with
23:19:19FromDiscord<Bubblie> I mean yall can review it once i finish it 😄
23:19:25FromDiscord<Bubblie> If you want
23:19:27FromDiscord<Bubblie> Of course
23:19:38FromDiscord<Bubblie> Ill post the github when its done
23:19:45FromDiscord<Bubblie> So people can make prs
23:20:16FromDiscord<Shinyzenith> Screenshot\_20220320-044920\_DuckDuckGo.jpg https://media.discordapp.net/attachments/371759389889003532/954882028103426058/Screenshot_20220320-044920_DuckDuckGo.jpg
23:20:18FromDiscord<Shinyzenith> Before i leave
23:20:31FromDiscord<Shinyzenith> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: can you explain the reasoning for this?
23:20:33FromDiscord<Elegantbeef> `var` is a mutable reference
23:20:47FromDiscord<Shinyzenith> Why do we need a mutable reference here
23:20:56FromDiscord<Shinyzenith> I didn't see it in the header
23:21:01FromDiscord<Elegantbeef> Cause `wl_listener` is small enough it's passed by copy
23:21:20FromDiscord<Shinyzenith> Huh I see
23:21:31FromDiscord<Shinyzenith> Is there anyway to check for this condition?
23:21:39FromDiscord<Elegantbeef> Nim has an optimization that anything smaller than 3floats is passed by copy,
23:21:58FromDiscord<Shinyzenith> I see↵And what if instead of var I used ptr?
23:22:06FromDiscord<Shinyzenith> Would that be a possible fix too?
23:22:09FromDiscord<Elegantbeef> you've done nothing to abstract it
23:22:17FromDiscord<Elegantbeef> It'd fix it but you've done nothing to abstract the function
23:22:30FromDiscord<Shinyzenith> I see
23:22:39FromDiscord<Elegantbeef> You could make it a template
23:22:44FromDiscord<Elegantbeef> then drop the `var`
23:23:06FromDiscord<Shinyzenith> I honestly don't understand templates completely just yet
23:23:10FromDiscord<Elegantbeef> Templates are code subsitution
23:23:11FromDiscord<Elegantbeef> That's it
23:23:14FromDiscord<Shinyzenith> So a macro?
23:23:18FromDiscord<Elegantbeef> No
23:23:21FromDiscord<Elegantbeef> Macros are introspective
23:23:42FromDiscord<Elegantbeef> templates just take the arguments and paste them every place they appear inside the body
23:24:09FromDiscord<Elegantbeef> every is bolded cause it's every place, they do not take any semantics into account on the pasting
23:24:22FromDiscord<Shinyzenith> I don't get how that's different from a proc
23:24:36FromDiscord<Shinyzenith> If I take a as a param
23:24:41FromDiscord<Shinyzenith> a will be used everywhere I call 8t
23:24:42FromDiscord<Elegantbeef> templates are expanded at compile time
23:24:47FromDiscord<Shinyzenith> Oh I see
23:25:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SUr
23:25:40FromDiscord<Elegantbeef> So they're like C macros, but they're strongly typed
23:25:56FromDiscord<Elegantbeef> you cannot do `doThing"hello"`
23:25:56FromDiscord<Shinyzenith> Makes sense now, got it.
23:26:19FromDiscord<Shinyzenith> Ik I'm asking a lot of questions ahah but would you mind explaining one last thing?
23:26:36FromDiscord<Elegantbeef> That's kinda what i do here
23:26:37FromDiscord<Elegantbeef> Fix Nim bugs, write shitty code and answer questions
23:26:51FromDiscord<Shinyzenith> 🤣
23:27:07FromDiscord<Bubblie> I love this community
23:27:09FromDiscord<Shinyzenith> Well then\: can you explain the fieldparentptr template you made today ?
23:27:21FromDiscord<Elegantbeef> What's to be explained
23:27:44FromDiscord<Shinyzenith> I don't completely understand how it works.↵I'll take a ss 1 sex
23:27:47FromDiscord<Shinyzenith> Sex
23:27:48FromDiscord<Shinyzenith> Sec
23:27:49FromDiscord<Shinyzenith> My Gos
23:27:50FromDiscord<Bubblie> LMAO
23:28:28FromDiscord<Elegantbeef> `fieldParentPtr(HerbServer,new_output, listener)` is turned into `cast[ptr HerbServer](cast[int](listener) - offsetOf(HerbServer, new_output))`
23:28:54FromDiscord<Shinyzenith> Screenshot\_20220320-045831\_DuckDuckGo.jpg https://media.discordapp.net/attachments/371759389889003532/954884198869663744/Screenshot_20220320-045831_DuckDuckGo.jpg
23:28:59FromDiscord<Shinyzenith> This snippet
23:29:14FromDiscord<Bubblie> Question, if a variable is assigned based on a pointer, must I use a pointer in nim to access it?
23:29:16FromDiscord<Elegantbeef> What dont you understand?
23:29:17FromDiscord<Shinyzenith> Why turn it to int and then back to pointer of t
23:29:26FromDiscord<Bubblie> (edit) "pointer," => "pointer in the c/c++ code,"
23:29:28FromDiscord<Elegantbeef> Cause Nim doesnt have built in pointer atithmetic
23:29:48FromDiscord<Bubblie> Shouldnt that be a thing they could add?
23:30:03FromDiscord<Elegantbeef> A lot of Nim is done in userspace so yes
23:30:03FromDiscord<Shinyzenith> So what does that line achieve
23:30:07FromDiscord<Elegantbeef> I dont like pointer arithmetic
23:30:16FromDiscord<Shinyzenith> Same
23:30:18FromDiscord<Elegantbeef> Say you have pointer 10
23:30:20FromDiscord<Bubblie> Me neither
23:30:29FromDiscord<Bubblie> But it may be beneficial in nim maybe
23:30:34FromDiscord<Elegantbeef> that will offset that 10 by the field offset of `field`
23:30:39FromDiscord<Elegantbeef> so say that offset is 5
23:30:49FromDiscord<Elegantbeef> we go back 5 bytes then convert that to a pointer of the base type
23:30:50FromDiscord<Bubblie> In reply to @Shinyzenith "Screenshot\_20220320-045831\_DuckDuckGo.jpg": Because this kind of looks messy
23:30:58FromDiscord<Elegantbeef> Sure but that's not how you'd do it
23:30:59FromDiscord<Shinyzenith> Ahh
23:31:04FromDiscord<Shinyzenith> Got it
23:31:10FromDiscord<Bubblie> In reply to @Elegantbeef "Sure but that's not": Oh
23:31:14FromDiscord<Bubblie> So there is a different way
23:31:20FromDiscord<Elegantbeef> Normal Nim doesnt really use pointers only low level does
23:31:33FromDiscord<Elegantbeef> If you want to use ptr math you can do https://github.com/kaushalmodi/ptr_math
23:31:41FromDiscord<Bubblie> 👀
23:31:46FromDiscord<Elegantbeef> I personally hate it
23:31:48FromDiscord<abdu> sent a code paste, see https://play.nim-lang.org/#ix=3SUt
23:31:59FromDiscord<Bubblie> I get that
23:32:04FromDiscord<Elegantbeef> But like i said Nim is a heavily extensible language which can mostly be done in userspace
23:32:20FromDiscord<Elegantbeef> There is no reason for the stdlib to have ptr math imo
23:32:58FromDiscord<Shinyzenith> So basically ↵Turn t to int -\> get offset between field and t -\> walk back those bytes and then convert back to base type pointer
23:33:01FromDiscord<Elegantbeef> Hell reverse indexing is 100% user space so if you wanted to do `3` for backwards index you coulld
23:33:04FromDiscord<Elegantbeef> Yep
23:33:06FromDiscord<Elegantbeef> You've got it
23:33:15FromDiscord<Shinyzenith> Thanks!!
23:33:15FromDiscord<abdu> How do we have a function static variable, just like in C function static variable ?
23:33:21FromDiscord<Elegantbeef> You have the pointer to the field and want the pointer to the object
23:33:33FromDiscord<Elegantbeef> `var myVar {.global.} = defaultValue`
23:33:45FromDiscord<Elegantbeef> It's not a `static` but it's a global state just like `static`
23:34:53FromDiscord<Elegantbeef> Generally buublie you can do `cast[ptr UncheckedArray[T]](myPointer)` then just treat it liike an array
23:35:38FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SUv
23:36:01FromDiscord<Elegantbeef> Maybe with a proper cast
23:36:18FromDiscord<Elegantbeef> But eitherway that's how you generally get around pointer arithmetic in a cleaner way
23:36:56FromDiscord<Elegantbeef> But for Nim native types we also have `openArray` which is a slice
23:38:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3SUw