<< 29-05-2023 >>

00:16:31FromDiscord<Dudugz> If Nim had the support that JS has with VSCode it would be wonderful. Nimsuggest isn't bad but I still think an LSP would integrate better with vscode.
00:19:13FromDiscord<TurtleP> Heya, I'm trying to figure out why some of my users can't load "libcrypto-1_1-x64". I do compile the binary statically with -d:ssl. Works for me on Windows 11, though.. any help would be appreciated! https://github.com/lovebrew/lovebrew/issues/27
00:20:51FromDiscord<Dudugz> Just one example of nimsuggest failing: importing times and typing ``now().`` doesn't show the procs and properties returned by now in some cases, and ``now().toTime().`` you might forget that will show nothing even though it is possible to use .toUnix and other procs.
00:21:21FromDiscord<Dudugz> (edit) "forget" => "forgive,"
00:21:41FromDiscord<Dudugz> (edit) "forgive," => "give up,"
00:26:19FromDiscord<Dudugz> In reply to @TurtleP "Heya, I'm trying to": Did they add the openssl folder to the environment variables? The dll name can also be different since the installation can be done by several sources, each one naming the dll in its own way.
00:27:33FromDiscord<michaelb.eth> In reply to @TurtleP "Heya, I'm trying to": That .dll is probably missing altogether or at least not in PATH
00:27:45FromDiscord<Elegantbeef> They do not understand static linking
00:28:07FromDiscord<Elegantbeef> You need to ship `.dll`s if you did not static link and no `-d:ssl` does not static link it
00:29:05FromDiscord<TurtleP> I'm aware
00:29:11FromDiscord<TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=4wXu
00:29:19FromDiscord<TurtleP> this is my config.nims
00:29:28FromDiscord<Elegantbeef> you need `dynliboverride`
00:29:31FromDiscord<TurtleP> unless something changed in recent nim versions and this file isn't used
00:29:38FromDiscord<michaelb.eth> To statically link OpenSSL on Windows you have to hold your fingers crossed in a very certain way, with your upper lip twisted in just the right way, at the exact right time after you press enter
00:29:39FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimc.html#dynliboverride
00:30:15FromDiscord<TurtleP> so.. `nim c --dynlibOverride:ssl`?
00:30:33FromDiscord<Dudugz> config.nims is still used
00:32:52FromDiscord<Elegantbeef> Of course
00:32:58FromDiscord<TurtleP> or rather, my config.nims looks like:
00:33:05FromDiscord<TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=4wXv
00:33:06FromDiscord<TurtleP> correct?
00:35:30FromDiscord<Elegantbeef> nope
00:35:38FromDiscord<Elegantbeef> you need to override all the dlls used
00:35:59FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/issues/15220
00:37:55FromDiscord<TurtleP> the only other one in there is crypto?
00:38:15*krux02 quit (Remote host closed the connection)
00:56:09FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4wXy
00:57:12FromDiscord<michaelb.eth> might also need `passC:-static --passL:static`
00:57:43FromDiscord<michaelb.eth> (edit) "https://play.nim-lang.org/#ix=4wXy" => "https://play.nim-lang.org/#ix=4wXz"
01:03:41FromDiscord<TurtleP> In reply to @michaelb.eth "fwiw, in a project": I need this on all 3 platforms, though
01:05:00FromDiscord<michaelb.eth> In reply to @TurtleP "I need this on": I did too (if you mean Linux, macOS, and Windows). I eventually got it to work
01:05:09FromDiscord<TurtleP> yes, that is what I mean
01:05:24FromDiscord<TurtleP> not sure why you need to specify windows here, though
01:06:04FromDiscord<michaelb.eth> because, at the time at least, on Windows it required hacky sht params to be passed to the compiler
01:06:36FromDiscord<TurtleP> gotcha.. playing with the config stuff now, having people test it
01:06:45FromDiscord<TurtleP> sadly I can't test it because it works
01:07:07FromDiscord<michaelb.eth> note the trailing `-` in the dynliberOverride I pasted above, didn't work without those
01:08:01FromDiscord<michaelb.eth> and `--define:sslVersion:"("` ............. bleh, so awful
01:08:14FromDiscord<TurtleP> :thonk:
01:08:25FromDiscord<TurtleP> that one I don't see really why you'd need it.. at least at this point
01:09:43FromDiscord<TurtleP> heh.. `undefined reference to SSL_read'`
01:10:02FromDiscord<TurtleP> fwiw..
01:10:09FromDiscord<TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=4wXC
01:10:13FromDiscord<michaelb.eth> Well, I was thorough at the time (it was about 2.5 years ago, so maybe things have changed). I would compile the program in a Windows 10 VM, and then copy the binary to a fresh instance of a Windows 7 VM, and it would run as expected.
01:10:28FromDiscord<TurtleP> (edit) "SSL_read'`" => "'SSL_read'`"
01:11:28FromDiscord<TurtleP> `switch("define", "sslVersion:\"(\"")` pff makes it build
01:16:40FromDiscord<TurtleP> but it's not right, so hm
01:25:17FromDiscord<michaelb.eth> In reply to @TurtleP "but it's not right,": `--passC:static` ?
01:25:31FromDiscord<Elegantbeef> `--passC:static` doesnt make any sense
01:25:37FromDiscord<Elegantbeef> Atleast as far as i know
01:26:03FromDiscord<Elegantbeef> `-static` tells the linker to link the following libraries statically, no?
01:26:34FromDiscord<michaelb.eth> I agree, but it was part of the formula, that, at the time, was required to make the damn thing compile and run
01:28:01FromDiscord<michaelb.eth> I even left a note in code review (not public) telling the manager that I hated his guts for making me deal with that sht.
01:28:05FromDiscord<TurtleP> In reply to @TurtleP "but it's not right,": which causes `could not load: libssl-"(".dll`
03:46:47FromDiscord<etra> so in Nim, if you want to have something similar to 'methods', like, having a `self` argument, should that object _always_ be a ref object?
03:47:08FromDiscord<etra> (edit) removed "so in Nim,"
03:48:22FromDiscord<Graveflo> yea pmuch. I think the limiting factor is the stack allocation. If you have different sized data structures the outer procs that move the objects around will truncate them killing the polymorphism on a low level
03:48:51FromDiscord<Elegantbeef> Depends what you're doing
03:48:56FromDiscord<Graveflo> but im very curious about this topic too. I'm new and that is the way I came to understand it
03:49:12FromDiscord<Elegantbeef> If you're using dynamic dispatch(`method`) yes you should use `ref object`
03:49:23FromDiscord<Elegantbeef> If you do not know what you're doing that's a safe bet
03:52:03FromDiscord<Graveflo> I would think that you might be able to use a base classes members to assign proc slots manually and just have different initialization methods, but I think the stack will prohibit additional members in sub classes from being accessible. Beyond that generics can do stuff like that but its just fancy codegen.
03:53:46FromDiscord<Graveflo> idk tho, beef, is it true that when you pass a non-ref object to a non-generic proc you are hard limited by the sizeof the static type of the parameter?
03:53:51FromDiscord<Elegantbeef> I'm a bit dense, monomorphic generics generally are just fancy codegen
03:54:17FromDiscord<Elegantbeef> Nope Nim passes inheritance objects by ref always
03:54:50FromDiscord<Elegantbeef> you can also do `proc doThing[T: Base](arg: T)` and have static overloadable methods
03:55:05FromDiscord<Elegantbeef> "methods"
03:57:24FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4wXY
03:57:29FromDiscord<Elegantbeef> An example of what that enables
03:58:06FromDiscord<Elegantbeef> Notice we can override `doThing` functionality, but get type specific `doThing` behaviour by default since it doesnt convert to `Base`
04:02:18FromDiscord<Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4wY1
04:02:55FromDiscord<Graveflo> not that it is an actual example of how to do that. It's yet another toy example.
04:03:33FromDiscord<Elegantbeef> Why are you `cast`ing there
04:03:51FromDiscord<Graveflo> oh, btw etra, definitely just use methods if that is what you are trying to do. Thats what they are for
04:04:01FromDiscord<Graveflo> bc if I don't I can't access `member3`
04:04:40FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/WUxOI
04:05:04FromDiscord<Graveflo> now that's evil
04:05:20FromDiscord<Elegantbeef> You cannot for obviously reasons down cast stack objects
04:05:37FromDiscord<Elegantbeef> Actually I'm wrong
04:05:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wY3
04:06:04FromDiscord<Elegantbeef> `cast[SubClass](obj)` does not change type informatiion
04:06:10FromDiscord<Elegantbeef> As such it causes the error
04:06:33FromDiscord<Elegantbeef> If you're using `cast` in Nim, you best know why you're casting
04:07:15FromDiscord<Graveflo> that was just the only way I knew to tell the compiler to stop being a stickler about types except for generics
04:07:29FromDiscord<Graveflo> but I'm seeing it now
04:07:32FromDiscord<Elegantbeef> Well now you know type conversions exist
04:08:02FromDiscord<Elegantbeef> Type conversions are safe mechanisms to convert between types, cast is a bit cast
04:08:22FromDiscord<Graveflo> so the example you just posted doesn't make a generic? This makes much more sense now. I was trying to figure out how to do that for a long time LOL
04:08:32FromDiscord<Elegantbeef> No it's not a generic
04:08:41FromDiscord<Elegantbeef> It just up casts to `Base` and passes by pointer
04:08:48FromDiscord<Elegantbeef> All inheritance is passed by reference afaict
04:09:05FromDiscord<Elegantbeef> Which means there's a nice hidden `ptr` that allows this to work
04:09:07FromDiscord<Graveflo> yea that makes sense
04:09:24FromDiscord<etra> In reply to @Graveflo "oh, btw etra, definitely": yeah I was not in need of dynamic dispatch, I was just asking method as-in some sort of function owned by a class/struct
04:09:34FromDiscord<etra> I'm not messing with inheritance and all that stuff, but I get it
04:09:49FromDiscord<etra> I think I'll just go with a ref object because this specific object it's more suitable for the heap
04:10:40FromDiscord<Elegantbeef> No Nim is procedural
04:10:46FromDiscord<Elegantbeef> You use `ref` if you need ref semantics and that's it
04:11:52FromDiscord<Elegantbeef> Especially with Orc you really do not need `ref` for anything but `ref` semantics. Ownership can be given up which means 0 copy code can exist without `ref`
04:12:24FromDiscord<etra> hmm, can you elaborate on what are `ref` semantics
04:12:25FromDiscord<Elegantbeef> And if you use a `self` parameter I will find a way to ensure that your water always tastes a little off
04:12:47FromDiscord<Elegantbeef> Many to one views, heap allocated, reference counted
04:12:57FromDiscord<etra> In reply to @Elegantbeef "And if you use": I am in a third world country, water simply cannot taste worst
04:13:12FromDiscord<Elegantbeef> Your will always be wet
04:13:16FromDiscord<Elegantbeef> your socks\
04:13:25FromDiscord<etra> ok that's just rude
04:13:37FromDiscord<etra> In reply to @Elegantbeef "Many to one views,": I see
04:13:40FromDiscord<Elegantbeef> So is using `self` or `this` as a parameter name 😄
04:14:19FromDiscord<Graveflo> should the name mirror it's type or something?
04:14:27FromDiscord<Elegantbeef> I mean in my world yes
04:14:33FromDiscord<etra> In reply to @Elegantbeef "So is using `self`": but, but... my ufcs!
04:14:35FromDiscord<Elegantbeef> Others prefer `this` or `self`
04:14:53FromDiscord<Elegantbeef> Cool I use UFCS but don't use `self` cause what the fuck type is `self`
04:15:16FromDiscord<Graveflo> oh god it can be anything
04:15:21FromDiscord<Elegantbeef> We are not in a 1 object 1 file world like C# or Python
04:15:51FromDiscord<etra> In reply to @Elegantbeef "Cool I use UFCS": that's a deep question, though. if I were describing myself I wouldn't know what type I am either
04:16:15FromDiscord<Elegantbeef> Glad you understand why it's a bad parameter name!
04:16:59FromDiscord<etra> I just tried some small async stuff + zig cc to compile for armv6 and it did work surprisingly well
04:17:05FromDiscord<Elegantbeef> This is of course my own view and not enforced or even suggested by NEP1
04:26:42*rockcavera quit (Remote host closed the connection)
04:41:00FromDiscord<Graveflo> sent a code paste, see https://paste.rs/5zndt
04:41:48FromDiscord<Elegantbeef> I mean that generally if you're asking "Should I use ref for methods" you should use `ref`
04:43:56FromDiscord<Graveflo> oh just bc ref is more forgiving
04:45:04FromDiscord<Elegantbeef> When it comes to stack based inheritance there is generally no reason to use methods
04:45:05FromDiscord<Elegantbeef> In the above you've possibly introduced a method dispatch where a static proc could be invoked
04:45:06FromDiscord<Elegantbeef> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-when-to-use-ref-object-vs-plain-object-qmark
04:45:06FromDiscord<Elegantbeef> Like I said though the object doesnt need to be on the heap with Orc
04:45:07FromDiscord<Elegantbeef> That's what i mean by the ref
04:45:07FromDiscord<Elegantbeef> `ref object` is a reference type and `object` is a value type they have different semantics
04:46:10FromDiscord<Elegantbeef> For instance
04:46:13FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/iusk6
04:46:14FromDiscord<Elegantbeef> There is no copy of `s` here
04:46:32FromDiscord<Elegantbeef> Only value types need to be copied so you could make this a `object` and have your large data on the heap
04:57:45FromDiscord<Graveflo> yea makes sense. Thanks for explaining all that. I just have one more question. Is it Orc, specifically not arc, that is needed? Is there a circular reference bound to happen somewhere as a consequence?
05:02:24FromDiscord<Elegantbeef> It's either, but for general code I'd never suggest just Arc
05:02:45FromDiscord<Elegantbeef> Only in the world of embedded does Arc make much sense
05:03:55FromDiscord<Elegantbeef> Leo you'll be happy to know I'm going to try your work, assuming I can make it work
05:04:33*arkurious quit (Quit: Leaving)
05:04:38FromDiscord<Elegantbeef> Git is cloning the repo at 220kb/s so that's ... nice
05:07:15FromDiscord<Graveflo> embedded was one of the reasons I jumped on learning nim in the first place. I'm only worried about stdlib and compiler introducing circular references. I almost never explicitly do that
05:07:54FromDiscord<Elegantbeef> I dont think the stdlib has anything that you wouldnt expect to be cyclic being cyclic
05:09:10FromDiscord<Graveflo> well that is re-assuring. I got spooked by async needing orc
05:09:27FromDiscord<Elegantbeef> Right that's the exception
05:09:39FromDiscord<Elegantbeef> chronos doesnt create cycles
05:11:11*junaid_ joined #nim
05:12:17FromDiscord<Elegantbeef> Araq didnt seem to oppose having a `-d:ensureAcyclic` that'd insert a cycled detector and error if a cycle was created
05:12:35*ntat joined #nim
05:16:45FromDiscord<Graveflo> that would be nice to have
05:22:11FromDiscord<Elegantbeef> leorize now to bug you, what does one need in their lua config to get your stuff to work, followed the adding custom parsers, is that it? Seems like there might be more
06:00:14*Lord_Nightmare quit (*.net *.split)
06:00:14*acidsys quit (*.net *.split)
06:00:14*oz quit (*.net *.split)
06:02:46*ox joined #nim
06:02:48*Lord_Nightmare joined #nim
06:02:56*acidsys joined #nim
07:17:00FromDiscord<leorize> I take it that you wanted to use tree-sitter-nim?
07:17:33FromDiscord<Elegantbeef> Yea
07:18:10FromDiscord<leorize> sent a code paste, see https://paste.rs/UrOgk
07:18:15FromDiscord<leorize> after that you can use `:TSInstall nim` to install the parser
07:18:41FromDiscord<leorize> now for the queries, create `queries/nim` in your nvim config folder
07:18:57FromDiscord<leorize> then copy the queries from the repository to that folder
07:27:17FromDiscord<Elegantbeef> Cheers
07:37:06FromDiscord<leorize> lol it got some random pastes in it, just fixed
07:38:39FromDiscord<Elegantbeef> I'm really thrashing your parse in my gui code
07:38:56FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1112646241814335498/image.png
07:40:18FromDiscord<leorize> if you have any code that the parser couldn't parse (ie. no highlighting after), just open an issue in tree-sitter-nim
07:40:40FromDiscord<Elegantbeef> Will do
07:42:26FromDiscord<Elegantbeef> Same for if the highlighter just doesnt highly segments of code it should?
07:45:42FromDiscord<leorize> sure
07:46:02FromDiscord<leorize> if you have the tree-sitter cli tool, you can clone the repo and try `tree-sitter parse <file>`
07:46:15FromDiscord<Elegantbeef> Though I assume there is no real way to highlight that code since you need type information
07:46:45FromDiscord<leorize> if you think you can infer something from the syntax tree, we can make a query to highlight that
07:47:44FromDiscord<leorize> ah I figured out your issue
07:47:55FromDiscord<leorize> it's just that I didn't write a query to highlight that case \:P
07:48:02FromDiscord<Elegantbeef> Ah
07:48:23FromDiscord<Elegantbeef> No clue how tree sitter works, but i figured it'd be challenging to know whether it's an instantiation or index
07:48:49FromDiscord<leorize> in case you're interested in query writing\: https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries
07:48:54FromDiscord<Elegantbeef> The only differentiation is `a: b` in the `()`, but inside `[]` can be normal identifiers and friends
07:49:19FromDiscord<leorize> I just use "the most probable interpretation" as the guide
07:49:39FromDiscord<Elegantbeef> Ah right I'm too silly for perfect
07:49:47FromDiscord<leorize> sent a code paste, see https://paste.rs/ZBf7N
07:49:48FromDiscord<leorize> this is the snippet for type highlighting
07:49:48FromDiscord<Elegantbeef> `A[B](c)` can just be assumed as a generic instantiation
07:50:12FromDiscord<Elegantbeef> Does that mean you just do highlighting based off first letter, if it's capital you assume it's a type?
07:50:28FromDiscord<leorize> no, but I can do that
07:51:28FromDiscord<leorize> as you can see from that query, I used context to provide type highlighting
07:51:29FromDiscord<Elegantbeef> Right
07:52:04FromDiscord<Elegantbeef> Such an impossible syntax to highlight 'perfectly' without type information
07:52:22FromDiscord<leorize> yea, but I only have to fill in "enough"
07:52:38FromDiscord<leorize> stuff like my plugin can then fill the extras using nimsuggest
07:53:56FromDiscord<leorize> tree-sitter is like 1000x faster than the compiler, so you get the benefit of real-time "good enough" highlighting
07:54:18FromDiscord<Elegantbeef> IC when
07:54:30FromDiscord<leorize> then a plugin can query the LSP or nimsuggest for the "fancy" data
07:54:44FromDiscord<leorize> I actually don't know if nimlangserver provides semantics token
07:54:51FromDiscord<leorize> clangd does and it's pretty cool
07:55:08FromDiscord<leorize> tree-sitter have IC btw
07:55:17FromDiscord<leorize> I'm already ahead of the IC curve with this xd
07:56:31FromDiscord<Elegantbeef> Nim IC would aid in your highlighting, without being awful performance, assuming it doesnt take 30 minutes to unpack the rod files
07:57:16FromDiscord<leorize> one can only hope
07:59:23*Notxor joined #nim
07:59:43FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=4wYy
08:00:03FromDiscord<leorize> basically I made the right side optional so it will at least highlight the base type name
08:01:04FromDiscord<leorize> eventually I hope I get to a "good enough" query to submit to nvim-treesitter so you don't have to do juggling like this
08:01:57FromDiscord<Elegantbeef> Lol my GUI code still says no
08:02:32FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/examples/guitest.nim if you want it as a test subject
08:02:45FromDiscord<Elegantbeef> It does some odd things
08:04:32FromDiscord<leorize> it does parse, so that's great
08:05:10FromDiscord<leorize> yea the missing highlights is just missing queries
08:06:09FromDiscord<leorize> so there'd have to be a query for `(call function: <copy the type stuff here> (colon_expression))`
08:06:40FromDiscord<Elegantbeef> The one benefit of Nim using `:` for object construction
08:08:52FromDiscord<leorize> sent a code paste, see https://paste.rs/6vr5D
08:08:53FromDiscord<leorize> give that a try, just put it at the end of the type section
08:09:37FromDiscord<Elegantbeef> Yea that's got the type highlighted now
08:10:44FromDiscord<leorize> there's a lot of inference that you can do when you're armed with the syntax tree \:P
08:41:45*pharonix71 quit (Remote host closed the connection)
08:42:22*pharonix71 joined #nim
09:27:12om3gacan thread params be mutable?
09:28:13om3gamy attempts to modify params are not wery sucessful
09:28:49FromDiscord<that_dude> You have to mark the with var
09:29:17FromDiscord<that_dude> Im pretty sure you can look up var params and you'll get some examples
09:29:28om3gaI nah
09:29:34om3ga*nah
09:29:59FromDiscord<Arathanis> can you show a code example?
09:30:07om3galooks like thread local heap allocs cannot be assigned to the var params
09:30:44om3gamaybe because all that will be destroyed when thread exits
09:30:49FromDiscord<that_dude> https://nim-lang.org/docs/tut1.html#procedures-parameters
09:30:58FromDiscord<that_dude> Ah yeah gl
09:31:19om3gaArathanis, unfortunately not right now, it's a part of huge code
09:33:30om3gathat_dude, yeah, so all variables are thread local, or the sharedMem should be used
09:34:20FromDiscord<that_dude> I don't know enough about threading lol. Gl
09:34:30om3gasomehow I made it pass nim compiler, but then C compiler printed errors
09:34:58FromDiscord<Arathanis> can you show us a contrived example since you cant share the actual code?
09:35:05om3gathat_dude, thnx, well, ponters and copyMem...
09:36:22om3gaArathanis, I need to type compact version, it will take some time. I'll be back with the code little bit later
09:36:38FromDiscord<Arathanis> 👍
09:47:45*junaid_ quit (Remote host closed the connection)
10:02:10*xaltsc quit (Ping timeout: 265 seconds)
10:57:46om3gaArathanis, https://play.nim-lang.org/#ix=4wZ2
10:58:03om3gahere is how I fooled nim compiler
10:58:19om3gaof course it not works :)
11:02:53*derpydoo joined #nim
11:08:35om3gathis is working code with use of haredHeap: https://play.nim-lang.org/#ix=4wZ6
11:10:20om3ganow linter reports weird text: template/generic instantiation of `createThread` from here
11:11:29om3gathe most popular linter for VsCode is very buggy, while this is third one available, but it reports the same "error"
11:12:17*boxuser joined #nim
11:13:01FromDiscord<Arathanis> i get an illegal storage access with the "working" code
11:20:27*boxuser left #nim (#nim)
11:20:32*boxuser joined #nim
11:20:46*boxuser left #nim (#nim)
11:27:29om3gawhich GC you specified?
11:27:55FromDiscord<Arathanis> oh, whatever the default one is, i always forget which it is
11:28:01om3ganot all of them support sharedHeap
11:28:35FromDiscord<Arathanis> switched it to ORC and it works just fine
11:32:24om3ganice. And I found why first example pass the nim compiler. When I specify explicitly the type of attr, then nim compiler points on the error
11:35:04*boxuser joined #nim
11:36:00*Notxor quit (Ping timeout: 248 seconds)
11:43:51*derpydoo quit (Quit: derpydoo)
12:28:32FromDiscord<ieltan> Is it possible to use Nim's effect system to prevent calling the same proc twice?
12:28:58FromDiscord<ieltan> Or any proc with the effect we don't want to get twice?
12:38:31Amun-Rasomething like this? https://nim-lang.org/docs/system.html#once.t%2Cuntyped
12:53:01FromDiscord<ieltan> In reply to @Amun-Ra "something like this? https://nim-lang.org/docs/syst": Sounds like this will do, thanks for the tip
13:13:26NimEventerNew Nimble package! facedetect - A face detection, pupil/eyes localization and facial landmark points detection library, see https://github.com/deNULL/facedetect
13:14:31FromDiscord<filipemtx> just a quick question...↵I used nigui for gui developing with nim but it is a little limited.↵what do you guys recommend for windows gui developing?↵any delphi-like editor for nim?
13:14:37FromDiscord<filipemtx> (edit) "developing?↵any" => "developing?↵also, is there any"
13:18:06*Notxor joined #nim
13:20:47FromDiscord<ieltan> In reply to @Amun-Ra "something like this? https://nim-lang.org/docs/syst": tested it and it doesnt seem to do what i want it to..
13:31:27*rockcavera joined #nim
14:02:29FromDiscord<MetuMortis> how should I fix it? If I import system/threads it is fixed but I know that I shouldn't import it (code works) https://media.discordapp.net/attachments/371759389889003532/1112742766385045514/image.png
14:11:45*hernan_ joined #nim
14:11:48*boxuser quit (Read error: Connection reset by peer)
14:12:33*tk quit (Read error: Connection reset by peer)
14:13:34*Mister_Magister_ joined #nim
14:14:00*hernan quit (Ping timeout: 265 seconds)
14:14:20*Mister_Magister quit (Read error: Connection reset by peer)
14:15:55FromDiscord<Rika> compile with `--threads:on`?
14:16:20FromDiscord<Rika> add it to project's config
14:16:41FromDiscord<MetuMortis> In reply to @Rika "compile with `--threads:on`?": that means my projects is supposed to have a config :d
14:16:53FromDiscord<Rika> if you want to use threads, yes
14:17:08*Mister_Magister_ is now known as Mister_Magister
14:17:26FromDiscord<MetuMortis> is there any doc for creating a project with config or any command like `npm init` (which creates a Node project)
14:17:39*tk joined #nim
14:19:08FromDiscord<voidwalker> anyone use allographer ? Is there any way to INSERT without using json node as intermediate ? I wonder why they chose json node for that, doens't it add overhead ?
14:19:52FromDiscord<Rika> https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files see 4th or 5th choice
14:20:14FromDiscord<Rika> contents should literally just be `--threads:on` iirc
14:39:54FromDiscord<MetuMortis> In reply to @Rika "contents should literally just": it works and I can compile with nim c only but nimsuggest still doesn't like it
14:40:53FromDiscord<Rika> reopen kate
14:40:56FromDiscord<Rika> iirc
14:41:10FromDiscord<Rika> not too sure how it works tho
14:41:22FromDiscord<Rika> maybe use the parent config method instead if that doesnt work
14:42:59FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wZF
14:43:35FromDiscord<voidwalker> what's that supposed to mean, that I can't open a db connection inside a proc ?
14:45:27FromDiscord<Rika> no you're exporting something that isnt at the top level (asterisk after flDb)
14:45:41FromDiscord<Rika> remove it
14:46:01FromDiscord<voidwalker> oh crap didn't notice that : )
14:52:08FromDiscord<xTrayambak> Does Nim not have fields for enums?
14:52:46FromDiscord<chmod222> What do you mean by fields for enums?
14:52:56FromDiscord<Rika> no, enums are not ADTs in nim
14:53:00FromDiscord<xTrayambak> Oh.
14:53:07FromDiscord<xTrayambak> Are there any workarounds anyone has made?
14:53:12FromDiscord<chmod222> Like rust's `enum { A { field: ... } }`?
14:53:16FromDiscord<xTrayambak> Yep.
14:53:23FromDiscord<Rika> uh yes a few
14:53:25FromDiscord<Rika> wait here
14:53:26FromDiscord<chmod222> Well, you can act like they do using normal functions
14:53:39FromDiscord<xTrayambak> In reply to @chmod222 "Well, you can act": do you think I am a smart human being
14:53:41FromDiscord<chmod222> `proc getStuff(myEnum: E) = ...`
14:53:48FromDiscord<chmod222> `enumFoobar.getStuff()`
14:54:00FromDiscord<Rika> https://github.com/beef331/fungus perhaps
14:54:02FromDiscord<chmod222> Er well, `.getStuff` because no paranetheses are sexy
14:54:07FromDiscord<jmgomez> In reply to @MetuMortis "it works and I": nimsuggest is a modified version of the compiler. You need to specify it in a `config.nims` near your entry point or `nim.cfg`
14:54:37FromDiscord<xTrayambak> In reply to @Rika "https://github.com/beef331/fungus perhaps": Yep. Exactly what I needed. Atleast it seems like it. I'll tinker with it for a while. Thanks!
14:54:54FromDiscord<chmod222> I wish Rust hadn't called their ADTs enums, it really sows confusion
14:55:05FromDiscord<jmgomez> In reply to @voidwalker "anyone use allographer ?": there is no such "overhead" you're IO bound anyways
14:55:08FromDiscord<Rika> yes
14:55:17FromDiscord<Rika> i mean yes to chmod\
14:55:18FromDiscord<Rika> (edit) "chmod\" => "chmod"
14:55:38FromDiscord<voidwalker> what do you mean, % is 0 cost ? 🙂
14:56:12FromDiscord<xTrayambak> In reply to @chmod222 "I wish Rust hadn't": They are confusing but look really convenient
14:56:18FromDiscord<chmod222> No money is deducted from your bank account for using it
14:56:22FromDiscord<jmgomez> I ment that the cost is talking to the db
14:56:34FromDiscord<Rika> In reply to @xTrayambak "They are confusing but": they are, they just need a different name
14:56:42FromDiscord<Rika> In reply to @jmgomez "I ment that the": most of it is at least
14:56:46*xet7 joined #nim
14:56:53FromDiscord<chmod222> I mean they objectively are amazing at many things and are useful
14:56:54FromDiscord<chmod222> Just badly named
14:56:59FromDiscord<voidwalker> right, I am still puzzled why they didn't implement another way to insert, not using json, in allographer. or maybe I am missing something
14:57:38FromDiscord<jmgomez> not sure if there is a way or not, didnt use the library much. But the source is there, you can check it out
14:57:48FromDiscord<voidwalker> cause at a glance it seems the best designed out of them out there (norm, gatabase etc)
15:00:04FromDiscord<voidwalker> and I see they have surrealdb integration in the works
15:04:00FromDiscord<MetuMortis> In reply to @jmgomez "nimsuggest is a modified": how can I specify it in config.nims file? just doing the same thing adding --threads:on to file?
15:07:53*boxuser joined #nim
15:15:19*boxuser quit (Read error: Connection reset by peer)
15:27:34FromDiscord<jmgomez> yes, or `switch("threads")`
15:43:02*ox is now known as oz
16:10:32*xet7 quit (Quit: Leaving)
16:40:07FromDiscord<voidwalker> I want to parse a date time string, but the parse proc has a timezone param that defaults to a call to local() or utc(), which has side effects, thefore I must have a proc instead of func. :\
16:42:17FromDiscord<voidwalker> `The times module only supplies implementations for the system's local time and UTC.`
17:27:30FromDiscord<chmod222> Is there some manner of replicating what C++ does with its variadic template parameters? As in, I want to accept a variable number of arguments of any type but without boxing them up and also without going fully macro just for that purpose
17:28:44FromDiscord<chmod222> i.e. I have my `registerFunction[P: proc]` proc that I can give any old procedure type but then I also would like to pass in a seq/tuple/whatever of default values for various function parameters
17:30:46FromDiscord<chmod222> I could hack around the lack of such a thing if need be, but I'd like to keep macro abuse down if possible because I'm already living too magically
17:30:54FromDiscord<Dudugz> In reply to @jmgomez "not sure if there": I don't think so, I'm using it with postgres but the only option is to use json, probably because it's the only way the language offers to dynamically create objects at runtime
17:32:46FromDiscord<jmgomez> In reply to @Dudugz "I don't think so,": I see. Well, no. You can have an object that represents types at runtime just like JsonNode does
17:33:13FromDiscord<jmgomez> In reply to @voidwalker "I want to parse": `{.cast(noSideEffect).}:`
17:33:30FromDiscord<jmgomez> In reply to @chmod222 "Is there some manner": AFAIK no, macro is the only way
17:34:34FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4x0K
17:35:19FromDiscord<voidwalker> ` Hint: 'parseTorrentHtml' calls `.sideEffect` 'parseHtml'`
17:35:39FromDiscord<voidwalker> why does parseHtml have side effects :-?
17:36:07FromDiscord<voidwalker> simply cause it's a proc ?
17:38:13FromDiscord<jmgomez> In reply to @Dudugz "You can but I": Not sure how it is implemented, but if you said so.. I meant, you cant create Nim types at runtime but you definitely can represent Nim types at runtime (exactly how std/json works)
17:38:46FromDiscord<jmgomez> For instance, in NUE I have a runtime type that goes from Unreal to NimScript through native Nim
17:39:01FromDiscord<jmgomez> So the user doest have to recompile
17:39:07FromDiscord<Dudugz> Yea, you can just like std/json did, creating variants of the types that represent them.
17:39:52FromDiscord<jmgomez> In reply to @voidwalker "simply cause it's a": because it probably uses something that has sideEffects, it propagates in usage
17:41:06FromDiscord<Dudugz> :v What exactly is the sideEffects pragma for? So far I've never had to use it.
17:41:41FromDiscord<jmgomez> In reply to @Dudugz ":v What exactly is": https://nim-lang.org/docs/manual.html#effect-system-side-effects
17:48:41*xaltsc joined #nim
18:39:25*xaltsc quit (Quit: WeeChat 3.8)
18:40:44*xaltsc joined #nim
18:46:19FromDiscord<Chronos [She/Her]> Nim 2.0 has default values for object/types, right?
18:46:27FromDiscord<Elegantbeef> Right
18:46:32FromDiscord<Chronos [She/Her]> Sweeeet
18:46:49FromDiscord<Chronos [She/Her]> No more tedious proc stuff
18:46:55FromDiscord<Chronos [She/Her]> I hope
18:47:07FromDiscord<Elegantbeef> Only constant expressions are supposed to be supported
18:47:19FromDiscord<Elegantbeef> So constructor still might have a reason to exist
18:48:25FromDiscord<Chronos [She/Her]> Makes sense
18:48:42FromDiscord<Chronos [She/Her]> how would i do this in Nimble? :p↵`requires "https://github.com/Yu-Vitaqua-fer-Chronos/pg.git >= 0.1.1 #2.0-update"`
18:49:11FromDiscord<Elegantbeef> What?
18:49:26FromDiscord<Chronos [She/Her]> Since it still says (on VSC) that it's relying on 0.1.0 and I can't do `nimble uninstall pg` because the project doesn't support it, despite my code compiling with my patched version of the library
18:49:59FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "What?": I want to use pg 0.1.1, with my branch `2.0-update`
18:50:45FromDiscord<Elegantbeef> The `#` goes on the url
18:51:25FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4x1c
18:51:47FromDiscord<Elegantbeef> Well no clue
18:51:50FromDiscord<Chronos [She/Her]> I hope atlas solves this :p
18:52:14FromDiscord<Elegantbeef> The real solution is to just push a new tag that is `0.2`
18:52:17FromDiscord<Elegantbeef> or i guess `1.0`
18:54:47FromDiscord<Chronos [She/Her]> 0.1.1 is the new tag tho, unless you mean pushing a new major/minor instead of a patch?
18:55:27FromDiscord<Elegantbeef> If you have a git tag on that branch why do you need the branch in the url?
18:55:32FromDiscord<Chronos [She/Her]> Anyway I fixed it by purging it manually from nimbledata.json and nimbledata2.json, as well as from `pkgs2`...
18:55:58FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "If you have a": I don't, was trying to get it to update the patch version but nimble refuses
18:56:44FromDiscord<Elegantbeef> the tag tags to a specific commit in the repo
18:57:22FromDiscord<Elegantbeef> Your repo has 0 git tags
18:57:52FromDiscord<Elegantbeef> Well your repo has no tags
18:57:54FromDiscord<Chronos [She/Her]> I'd still expect for pulling from a branch to always try using the latest commit from it, though?
18:57:56FromDiscord<Elegantbeef> So that's why 😄
18:58:07FromDiscord<Chronos [She/Her]> But also makes sense there
18:58:07FromDiscord<Elegantbeef> No always earliest
18:58:21FromDiscord<Chronos [She/Her]> That's irritating
18:58:25FromDiscord<Elegantbeef> Versioning should always use the earliest to be sensible imo
19:00:28FromDiscord<Elegantbeef> Perhaps, though I reason that if you do `>= 0.1.1` you want the earliest but if you did `< 0.2` you'd want the latest
19:00:37FromDiscord<Elegantbeef> Not that nimble works this way
19:01:58FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4x1d
19:02:18FromDiscord<Elegantbeef> You know `parseTime` exists?
19:02:59FromDiscord<Elegantbeef> Alternatively use strscans like a sane person
19:03:09FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Perhaps, though I reason": Fair
19:03:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4x1e
19:04:25FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4x1f
19:05:08FromDiscord<voidwalker> oh so Time is like unix time, since it represents a point in time ?
19:09:03FromDiscord<voidwalker> woah the strscans thing worked. it starts from the right ? I expected it to push the minutes into the hours var for the `mm:ss` case
19:09:31FromDiscord<Elegantbeef> It only matches for `x:y:z`
19:09:58FromDiscord<Elegantbeef> If `success` is false you did not parse what you wanted
19:10:15*xaltsc quit (Quit: WeeChat 3.8)
19:10:52FromDiscord<voidwalker> ah wait no, it actually does, for `14:21` I get `14 hours and 21 minutes` instead of 14 minutes and 21 seconds
19:11:52FromDiscord<Elegantbeef> Of course cause it fails after the minute parsing
19:12:05FromDiscord<Elegantbeef> You should not use the variables if it didnt succeed
19:12:14FromDiscord<Dudugz> I would rely on .parseTime
19:12:22FromDiscord<Elegantbeef> ^
19:13:00FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4x1i
19:13:10FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=4x1i" => "https://play.nim-lang.org/#ix=4x1j"
19:13:25FromDiscord<Dudugz> https://nim-lang.org/docs/times.html#parseTime%2Cstring%2Cstring%2CTimezone
19:13:29FromDiscord<Elegantbeef> God that's awful
19:14:03FromDiscord<voidwalker> i'd rather use parsetimes indeed cause I am already importing times
19:15:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4x1k
19:16:33FromDiscord<voidwalker> `Failed to parse '14:21' with format 'hh:mm:ss'. Parsing ended but there was still patterns remaining [TimeParseError]`
19:16:35*xaltsc joined #nim
19:16:48FromDiscord<Elegantbeef> Right you need to know which pattern to use
19:16:49FromDiscord<voidwalker> I just can't oneline this : D
19:16:55FromDiscord<Elegantbeef> Good
19:17:03FromDiscord<Elegantbeef> Onelining is awful and you should feel bad
19:19:14FromDiscord<Dudugz> In reality you can, but it will look ugly and not pleasant, even more so because nim does not use ternary but if expression
19:19:30FromDiscord<Elegantbeef> Hardly the issue
19:19:39FromDiscord<Elegantbeef> I consider that a feature!
19:19:52FromDiscord<Elegantbeef> Also dudugz did you see my sdl gui stuffs?
19:20:08FromDiscord<Dudugz> >.> I consider it a downgrade, ifs for me are statements.
19:20:27FromDiscord<Dudugz> In reply to @Elegantbeef "Also dudugz did you": I didn't see it, what's the repo?
19:20:31FromDiscord<Elegantbeef> An expressionful language is nicer than ternary
19:20:56FromDiscord<Elegantbeef> I mean it's not an sdl specific GUI it's a general GUI https://github.com/beef331/gooey/
19:21:14FromDiscord<Elegantbeef> simplescreenrecorder-2023-05-26\_21.18.28.mp4 https://media.discordapp.net/attachments/371759389889003532/1112822981983490170/simplescreenrecorder-2023-05-26_21.18.28.mp4
19:21:19FromDiscord<Dudugz> In reply to @Elegantbeef "An expressionful language is": With that there is nothing to disagree with, the clearer the easier to understand.
19:21:25FromDiscord<Elegantbeef> It's mainly meant for my game, but sokam showed interest so I made it completely renderer/vector agnostic
19:23:04FromDiscord<voidwalker> that's pretty cool
19:23:07FromDiscord<Dudugz> In reply to @Elegantbeef "I mean it's not": I mean, it's not bad, it's a start. I would start that way as well to develop the basic features and then move on to developing everything else.
19:23:53FromDiscord<Elegantbeef> I mean I only need basic features it's GUI for a videogam
19:24:18FromDiscord<voidwalker> are there any other SDL based gui frameworks for nim ?
19:24:46FromDiscord<Elegantbeef> other
19:24:53FromDiscord<Elegantbeef> That's not even sdl based
19:25:00FromDiscord<voidwalker> oh ? I thought you said sdl
19:25:06FromDiscord<Elegantbeef> I did
19:25:11FromDiscord<Elegantbeef> But that's an sdl implementation of my gui
19:25:17FromDiscord<Elegantbeef> Like i said the core is agnostic
19:25:43FromDiscord<Elegantbeef> It dont do anything
19:25:43FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1112824105780117697/image.png
19:25:58FromDiscord<Dudugz> In fact, I just read the code, it's not specifically aimed at SDL, it can be used in other frameworks
19:26:14FromDiscord<Elegantbeef> I mean yea I use it for my game and render it with opengl
19:27:38FromDiscord<Dudugz> This is really cool, me and some friends are going to develop the core of our game in a way that is not geared towards any specific engine. We will make all the base systems of an indie/rpg game.
19:28:29FromDiscord<Dudugz> Entity, AI, Inventory, Dialogue, etc... all engine-agnostic
19:28:51FromDiscord<Elegantbeef> It's the way it should be 😛
19:30:25FromDiscord<Dudugz> Yup, we think so too, this gives us the freedom to choose whatever engine we want for the game. As the core will be done in C# it is compatible with most engines. Just not UE since it uses C++.
19:32:29FromDiscord<voidwalker> `parseTime("14:21", if durStr.len == 5: "mm:ss" else: "hh:mm:ss", local())` oneliner but, it seems you cannot substract Time from DateTime, like I planned with Duration. And there's no parseDuration :\
19:34:48FromDiscord<voidwalker> maybe cast it to Duration ?
19:36:09FromDiscord<Dudugz> You can get the duration of Time if i'm not mistaken
19:39:08FromDiscord<Dudugz> And you can substract a duration from time https://media.discordapp.net/attachments/371759389889003532/1112827485336371210/Screenshots_2023-05-29-15-38-31.png
19:39:16FromDiscord<Dudugz> (edit) "substract" => "subtract"
19:39:55FromDiscord<voidwalker> ``-`(a, b: Time): Duration `I was just looking at this. So I should substract a 0 length time to get the duration ? ;\
19:40:00FromDiscord<voidwalker> (edit) "``-`(a," => "`-`(a,"
19:41:08*dooptydoo90x joined #nim
19:41:55FromDiscord<Dudugz> I think to convert a Time to duration you will have to get the time from the Time and use initDuration
19:42:58FromDiscord<Dudugz> Not sure since the only thing I'm currently using is timestamp to store some points of time in db
19:43:17FromDiscord<voidwalker> back to strscan idea
19:43:30FromDiscord<Dudugz> lol
19:43:41FromDiscord<Dudugz> You can get millis, seconds, hours and minutes from Time
19:43:57FromDiscord<Dudugz> that's not what's needed for initDuration?
19:44:15FromDiscord<voidwalker> yes, but how ? it doesn't have a "toParts" proc as I see
19:46:59FromDiscord<System64 ~ Flandre Scarlet> Hi↵Is it normal some people have 0xC000007B error with my Nim programs?
19:47:38FromDiscord<Dudugz> https://nim-lang.org/docs/times.html#initDuration%2Cint64%2Cint64%2Cint64%2Cint64%2Cint64%2Cint64%2Cint64%2Cint64↵https://nim-lang.org/docs/times.html#Time
19:48:28FromDiscord<Dudugz> In reply to @System64 "Hi Is it normal": I don't know the error, but I don't think it would be normal for someone to have errors running a program... Have you checked what is causing the error?
19:48:47FromDiscord<voidwalker> yeah only TIme's fields are not public
19:48:55FromDiscord<voidwalker> (edit) "TIme's" => "Time's"
19:49:00FromDiscord<System64 ~ Flandre Scarlet> In reply to @Dudugz "I don't know the": It's due to missing C++ redis or .NET framework↵But my friend have both
19:49:06FromDiscord<System64 ~ Flandre Scarlet> but me, I don't have any problems
19:49:32FromDiscord<Dudugz> In reply to @voidwalker "yeah only Time's fields": Oh :v I thought it was but there must be some proc so why do I use now().toTime().toUnix() to get the current time millis
19:49:39FromDiscord<System64 ~ Flandre Scarlet> I use NimGL btw
19:49:47FromDiscord<Dudugz> (edit) "why do I" => "bc i"
19:50:29FromDiscord<Graveflo> I'm assuming 0xC000007B is a windows error due to it's verbosity. It looks like that error is associated with cpu architecture compatibility issues.
19:51:23FromDiscord<Chronos [She/Her]> For a multiline SQL statement is it fine to just do `sql"""a"""`?
19:52:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @Graveflo "I'm assuming 0xC000007B is": We both have 64-bits CPU
19:52:21FromDiscord<Chronos [She/Her]> Just in case it has a bad effect on the effect of the SQL code
19:53:12FromDiscord<Graveflo> In reply to @System64 "We both have 64-bits": maybe you could try and get more info about what is causing the error. Idk if this is the right tool, especially for .NET but something like this maybe: https://learn.microsoft.com/en-us/sysinternals/downloads/debugview
19:59:27FromDiscord<Dudugz> In reply to @Hourglass, When the Hour Strikes "Just in case it": I don't think it makes much of a difference, but the question is whether your query is really that big that it needs to break into multiple lines.↵↵I'm currently using allographer (for PostGres because MySQL is buggy) and honestly I really like the query builder, it makes it easier to visualize what's going on.
19:59:43*ntat quit (Quit: Leaving)
20:01:52FromDiscord<Graveflo> In reply to @System64 "We both have 64-bits": btw, I just want to add that just because you both have a 64bit cpu doesn't mean that there isn't a cpu architecture problem because of dynamic linking and the .NET runtime. If I were trying to figure this out I would compare any of these things that could be different, like the runetime versions and any dynamically linked library.
20:02:44FromDiscord<Chronos [She/Her]> In reply to @Dudugz "I don't think it": It's just me needing to use a bigger font to code bc eyesight
20:03:23FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4x1I
20:03:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @Graveflo "btw, I just want": And is there a way to compile without Windows stuff?↵Like, only GCC stuff
20:03:52FromDiscord<Chronos [She/Her]> Fairly short, but yeah
20:04:24FromDiscord<Chronos [She/Her]> In reply to @System64 "And is there a": Clang could do it, idk about gcc
20:04:29FromDiscord<Graveflo> not easily when there is a dependency that uses .NET
20:05:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @Graveflo "not easily when there": I use NimGL
20:05:31FromDiscord<System64 ~ Flandre Scarlet> that's the only thing I use I think
20:06:11FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4x1K
20:06:59FromDiscord<Chronos [She/Her]> Oki
20:09:41*dooptydoo90x quit (Quit: WeeChat 3.5)
20:15:48FromDiscord<Takemichi Hanagaki> In reply to @Elegantbeef "image.png": what is the font?
20:16:29FromDiscord<Elegantbeef> Github's code font
20:16:30FromDiscord<Elegantbeef> Whatever that is
20:21:51FromDiscord<jmgomez> cant recall the experimental pragma thing for dynamic bind, what was the name?
20:22:08FromDiscord<jmgomez> bindSym I mean
20:22:23*lucasta joined #nim
20:24:28FromDiscord<jmgomez> `dynamicBindSym`
20:29:35*myrix quit (Ping timeout: 240 seconds)
20:42:28FromDiscord<etra> are there channels but for async code?
20:42:42FromDiscord<etra> from what I understand in the manual, the default ones are for multithread?
20:43:16FromDiscord<Elegantbeef> A sequence suffices for async code
20:43:54FromDiscord<etra> wait, can the async runtime be multithreaded?
20:43:58FromDiscord<etra> what would happen in those cases?
20:44:16FromDiscord<Elegantbeef> Each thread would have it's own dispatcher
20:45:08FromDiscord<etra> so does that means that seqs would still be safe?
20:45:35FromDiscord<Elegantbeef> If you are not modifying the sequences across threads of course
20:45:58FromDiscord<etra> hmm
20:46:49FromDiscord<etra> not that I need it now, but, I thought async runtimes could be just 'automatically' set between singlethread/multithread hence why channels would be useful I guess
20:47:01FromDiscord<etra> (automatically, as in, a flag)
20:47:51FromDiscord<Elegantbeef> No clue what you mean
20:49:52FromDiscord<etra> well, in rust's tokio, you can set if the runtime will be single threaded or multithreaded with a single line of code, and you wouldn't need to change anything if you were already using async types (like channels, async mutex, etc). In here, if I would use a single threaded runtime, I can use seq as some sort of channel, but if I want to change it to multi-thread, I'd need to change the type and make sure they're not shared across threads
20:50:14*lucasta quit (Quit: Leaving)
20:50:18FromDiscord<etra> (I'm not complaining, just trying to understand if I'm seeing this correctly)
20:50:52FromDiscord<Elegantbeef> No real clue myself I generally do single threaded code, I believe it's not possible to transfer futures across threads
20:53:18*derpydoo joined #nim
21:17:09FromDiscord<System64 ~ Flandre Scarlet> Wow the Debug builds are slow!
22:06:48*arkanoid quit (Ping timeout: 250 seconds)
22:33:49*Notxor quit (Remote host closed the connection)
22:44:36*arkanoid joined #nim
22:53:52FromDiscord<Ayy Lmao> Is there a way to compare typedescs?
22:54:07FromDiscord<Elegantbeef> `is`
22:54:07FromDiscord<Elegantbeef> `isnot`
22:54:48FromDiscord<Ayy Lmao> That doesn't seem to be working for me for some reason.
22:54:55FromDiscord<Elegantbeef> Well what are you doing?
22:55:19FromDiscord<Ayy Lmao> Hmmm, I think it's because I need to distinguish between base and a child type
22:55:41FromDiscord<Ayy Lmao> I need to be able to know when a type is the raw base and not a descendent
22:57:58FromDiscord<Elegantbeef> Code?
22:58:27FromDiscord<Ayy Lmao> sent a code paste, see https://paste.rs/VKlra
22:58:58FromDiscord<Elegantbeef> Yea do not do that
22:59:21FromDiscord<Ayy Lmao> What is an alternative?
23:01:01FromDiscord<Elegantbeef> Well one do not use `if`
23:01:26FromDiscord<Elegantbeef> Secondly why does it take a typedesc and not just an instance
23:01:36FromDiscord<Elegantbeef> Thirdly why are you casting
23:01:45FromDiscord<Elegantbeef> `T(widget).update()` works just fine
23:02:04FromDiscord<Ayy Lmao> I was using `if` to see if it had different behavior from `when`.
23:02:27FromDiscord<Ayy Lmao> I have been in the habit of casting because of doing T(widget) randomly not working and complaining.
23:02:41FromDiscord<Elegantbeef> Well stop using cast 😛
23:03:12FromDiscord<Ayy Lmao> And it takes a typedesc because there is certain initialization code I want to abstract from the user.
23:03:22FromDiscord<Ayy Lmao> (edit) "And it takes a typedesc because there is certain initialization code I want to abstract ... from" added "away"
23:03:38FromDiscord<Ayy Lmao> I guess it could still take an instance maybe
23:03:57FromDiscord<Ayy Lmao> Also what is the difference between casting and just doing T(widget)?
23:04:12FromDiscord<Ayy Lmao> Is it mainly a safety thing?
23:04:31FromDiscord<Elegantbeef> One is a type conversion and the other is a cast
23:04:38FromDiscord<Elegantbeef> Bitcasts are unsafe and ugly
23:05:39FromDiscord<Ayy Lmao> So is there no way to check if an object is the base instead of a descendent?
23:06:04FromDiscord<Elegantbeef> There is no way cause all base types are the parent type for dispatch reasons
23:06:17FromDiscord<Elegantbeef> As such you need to do a hacky thing of `compiles((var a: targ = Widget()))`
23:06:26FromDiscord<vastik> ello
23:06:29FromDiscord<Elegantbeef> Or make that a concept and it's no longer hacky looking
23:08:12FromDiscord<vastik> very general question, but what is nim usually used for, practically? what does it offer someone that's interested in systems programming?
23:08:21FromDiscord<Elegantbeef> Anything
23:08:27FromDiscord<Elegantbeef> It offers a ton of learning
23:09:13FromDiscord<Elegantbeef> instance\
23:09:13FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/5W8VM
23:09:42FromDiscord<Elegantbeef> The issue is for dispatch reasons all descendants need to be convertible to their parent which means `Child is Widget` has to pass
23:11:39FromDiscord<Ayy Lmao> Seems to work
23:11:41FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4x2k
23:12:23FromDiscord<Elegantbeef> Sure but uhhh the concept way is uhhh more convoluted!
23:12:40FromDiscord<Elegantbeef> Plus you can use it to dispatch only for base widget
23:13:19FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/QRzUb
23:13:21FromDiscord<Elegantbeef> And not have a fugly `when`
23:14:02FromDiscord<Ayy Lmao> Hmmm, I'll keep it in mind but my eyes glaze over with concepts still.
23:17:49FromDiscord<Ayy Lmao> In reply to @vastik "very general question, but": It has its warts but so far it is my favorite language, and I've tried a lot. It has a huge range of capability. I have interacted with javascript libraries in the browser by using the javascript backend, interacted with c and c++ code in the browser using webassembly, written audio plugins and extensions for a DAW, all with a syntax that is very similar to python.
23:18:04FromDiscord<vastik> nice.
23:20:27FromDiscord<Ayy Lmao> The struggles are no cyclical imports, large differences in style because of so many ways to do things, very hard to find best practices, and a small user base. There are a few clunky things here and there in the language as well.
23:24:44FromDiscord<Ayy Lmao> I always find myself coming back though when I try other things.
23:25:35FromDiscord<Elegantbeef> Meanwhile I only use Nim cause I have no reason to use anything else
23:26:14FromDiscord<etra> In reply to @Elegantbeef "No real clue myself": for the sake of reference, I think this threads sums up what I was wondering about: <https://forum.nim-lang.org/t/6352>
23:26:34FromDiscord<Ayy Lmao> In reply to @Elegantbeef "Meanwhile I only use": And you are probably like in the top 3 for deepest knowledge of the language.