<< 20-10-2022 >>

00:02:05FromDiscord<Sabena Sema> it does, sortya
00:02:07FromDiscord<Sabena Sema> (edit) "sortya" => "sorta"
00:02:13FromDiscord<auxym> yeah same. what is hkt vs generics?
00:02:20FromDiscord<Sabena Sema> but those are like nim's `static[T]` (except they work more frequently than nim's)
00:02:30FromDiscord<Elegantbeef> And they're also more limited 😛
00:02:57FromDiscord<Elegantbeef> Nim's work for complex types aswell as primitives
00:07:08FromDiscord<Elegantbeef> I really need to stop talking about compiler related stuff, i'm bound to start my own language with blackjack and hookers
00:08:17FromDiscord<Rika> Also call it beef just to fuck with the other beef language
00:08:31FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=4dCF
00:09:04FromDiscord<Sabena Sema> In reply to @Elegantbeef "Nim's *work* for complex": _when they work_
00:09:25FromDiscord<Elegantbeef> Eh i generally havent had much issue with them
00:09:34FromDiscord<Sabena Sema> maybe I need to try them again
00:09:48FromDiscord<Elegantbeef> The worst issue is generally just procedure headers
00:09:54FromDiscord<Elegantbeef> So you need to get somewhat hacky to resolve
00:10:10FromDiscord<Sabena Sema> I think my problems have been mostly in trying to define matrix types, where they need to interact with subranges
00:10:28arkanoiddamn, I don't remember what's the idiomatic way to pass an array to C via ffi. I have a "let myarray = [1.cint, 2, 3]" to be passed to a importc proc, but I don't remember if I should declare the signature as proc foo(myarray: ptr intc) or proc foo(myarray: UncheckedArray[intc]), if I use myarray.unsafeAddr compiler complains "but expression 'unsafeAddr myarray' is of type: ptr array[0..2, cint]"
00:10:50FromDiscord<Elegantbeef> I'd say most of Nim's issues come from it's type system being held together with bubble gum
00:11:09FromDiscord<Elegantbeef> `ptr uncheckedArray[cint]`
00:11:25FromDiscord<Rika> Saying it is held by bubble gum is an overstatement
00:11:33FromDiscord<Rika> Feels more like held together by air
00:11:45FromDiscord<Elegantbeef> It very much is in an awful state
00:12:13arkanoidElegantbeef, do I have to use "cast" to convert array[0..2, cint] to UncheckedArray[intc] ? myarray.unsafeAddr doesn't work
00:12:16FromDiscord<Elegantbeef> And repairing it likely will cause a lot of code to either start or stop working 😄
00:12:23FromDiscord<Sabena Sema> sent a code paste, see https://play.nim-lang.org/#ix=4dCG
00:12:33FromDiscord<Sabena Sema> the type itself compiles but even now it's pretty easy to get into trouble with it
00:12:36FromDiscord<Bung> @ElegantBeef I just found the Thread field turns to ptr Thread[tillegaltyperecursion.TIRC]
00:12:46FromDiscord<Sabena Sema> I just wanna write Eigen 😄
00:12:50FromDiscord<Elegantbeef> Eh the issue here is array construction isnt smart
00:13:19FromDiscord<Elegantbeef> `array` is sem'd in the generic before instantiation and it cannot find `N` or `M` so it errors
00:13:24FromDiscord<Sabena Sema> yeah, a lot of the effort around rust's const generics was to get them to work with arrays properly
00:13:57FromDiscord<Elegantbeef> Personally i'd just like a better type system, something that doesnt have so many funny bugs
00:14:22FromDiscord<Elegantbeef> Well in the case of the above the 'proper' solution is to delay semming of arrays until instantiation
00:14:23FromDiscord<Elegantbeef> That way `M` and `N` can be inserted
00:14:24FromDiscord<Sabena Sema> yeah, the type system is quite ad-hoc. it feels like programming with older c++ compilers
00:14:34FromDiscord<Elegantbeef> But delaying errors is awful
00:14:37FromDiscord<Sabena Sema> again, that type actually sorta works
00:15:43arkanoidso I have to cast[UncheckedArray[cint]](myarray.unsafeAddr) for each argument?
00:17:14FromDiscord<Elegantbeef> Or just take a `cint` and do `myArray[0].addr`
00:17:30FromDiscord<Elegantbeef> I personally prefer taking `ptr UncheckedArray[T]` as it's more clear but you do you
00:18:10FromDiscord<Sabena Sema> huh, things actually seem to work OK for matrix now
00:18:11arkanoidisn't the address of myarr and myarr[0] equal?
00:18:33FromDiscord<Elegantbeef> Yes but one is `ptr array[range, T]` and the other is `ptr T`↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
00:18:52FromDiscord<Elegantbeef> so if the proc takes `ptr cint` you can just do `myArr[0].addr`
00:19:29FromDiscord<Elegantbeef> I actually made it so modulo types sorta even work↵(@Sabena Sema)
00:20:10FromDiscord<Sabena Sema> In reply to @Elegantbeef "I actually made it": damn you may have fixed my most annoying set of type bugs!
00:20:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dCJ
00:20:24FromDiscord<Sabena Sema> I guess I should try and modernize my linear algebra library again
00:20:58FromDiscord<Elegantbeef> I mean if you do run into issues i wouldnt mind looking at them, i'm not an amazing compiler dev, but i do have a soft spot for distinct and static
00:21:36FromDiscord<Sabena Sema> are those new style concepts
00:21:43FromDiscord<Elegantbeef> No that's old style
00:21:58FromDiscord<Elegantbeef> New style is `proc +(a, b: Self): Self`
00:22:26FromDiscord<Elegantbeef> A lot of my toy projects use either `static` or `distinct` be it sentinels or remoterefs here https://github.com/beef331/nimtrest/
00:22:45FromDiscord<Sabena Sema> oh, it's just been so long since I've used them and I assumed there were parentheses around the parameters
00:23:48FromDiscord<Elegantbeef> I'm very much the 'type system's worst enemy
00:24:32FromDiscord<Elegantbeef> Concepts, static, distincts, just pure abuse on the poorly implemented type system
00:25:30FromDiscord<Elegantbeef> I dont know if you know how PType works internally but some things actually are indistinguishable
00:26:08FromDiscord<Elegantbeef> Like `type S[T] = seq[T]` vs `type S[T] = distinct int` are both `tyGenericAlias` iirc
00:26:39FromDiscord<Elegantbeef> It's something like that, that is a menace especially for borrowing
00:27:48arkanoidElegantbeef, do you believe its something fixable, or is nim doomed to drag this forever?
00:31:02FromDiscord<Sabena Sema> it would take a lot of work on formalization, like both rust and c++ had to spend a bunch of time actually formalizing things, and nim's type system is about as ad-hoc as C++'s in terms of how it's grown (I think)
00:31:38FromDiscord<Elegantbeef> With enough time and effort it's likely fixable, i'm very much not a competent compiler dev, so take what i say with a grain of salt↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
00:36:38FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+generic almost a 5th of issues appear when you search 'generic' on the github issues
00:37:31FromDiscord<Elegantbeef> I forgot about this issue. It's quite funny https://github.com/nim-lang/Nim/issues/20268
01:00:30arkanoidI'm trying to ffi with a static library, running "nm -C mylib.a" I can see "T FBL_Algo(double, double, int, int*, double*)" which is the function I want to call, but proc FBL_Algo(...){.importcpp: "FB_Algo(@)".} results in "error: FBL_Algo was not declared in this scope"
01:01:14arkanoidI'm passing --passL: mylib.a to nim compiler
01:14:01FromDiscord<Elegantbeef> why are you using `imporcpp`?
01:14:39FromDiscord<Elegantbeef> I think it should be `--passL:"-lmyLib"`
01:25:36arkanoidbecause the source files from which I have compiled the .o and archived the .a are .cpp, and I've compiled with g++
01:26:33arkanoidbut I'm not really into C/C++, so I don't know if the exported functions are C like or CPP like
01:36:13*arkurious quit (Quit: Leaving)
01:38:17arkanoidno it's not. whatever combination I try, I keep getting ld cannot find
01:38:50arkanoidfile is named "libbehave.a" in same path of .nim wrapper and it's from where I am running "$ nim c"
01:39:33arkanoidI've tried: -lbehave.a, -llibbehave.a, -l:behave.a, -l:libbehave.a, -l<absolute path>
01:47:23FromDiscord<Sabena Sema> In reply to @arkanoid "because the source files": importcpp is what you want, probably
01:47:31FromDiscord<Sabena Sema> (edit) "In reply to @arkanoid "because the source files": importcpp is ... what" added "not"
01:47:55arkanoidsolved the link thing with --passL="-L. -l:libbehave.a"
01:48:09arkanoidbut I'm now getting lots of undefined references from other stuff
01:48:38arkanoidmbehavewrap.nim.cpp:(.text+0x596): undefined reference to `atmdotdotatsdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot8atslibatssystemdotnim_DatInit000()'
01:50:33arkanoidseems nim stuff to me, not external lib
01:54:17arkanoidif I go back to nim 1.4.2 I'm getting "@mbehavewrap.nim.cpp:(.text+0x50a): undefined reference to `systemDatInit000()'" instead
01:55:41arkanoidseems I'm dealing with https://github.com/nim-lang/Nim/issues/12002
01:57:11arkanoidbehavewrap: hidden symbol `_Z13systemInit000v' isn't defined
01:57:28arkanoidseems my static linking is messing up nim runtime (?)
02:16:23arkanoidsolved, I have to use nim cpp
02:20:19arkanoidgeneral question: why is "header" section of importcpp required?
02:29:48FromDiscord<Elegantbeef> Is it required?
02:44:09FromDiscord<Patitotective> do you guys know how am i supposed to write a markdown horizontal rule for docgen?↵with `## ---`, it complains `Error: new section expected (overline '---' is too short)`
02:44:21FromDiscord<Patitotective> is there some rst alternative?
02:45:56*derpydoo quit (Quit: derpydoo)
02:53:17FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4dD4
03:13:47FromDiscord<Patitotective> i was thinking about making kdl's parser be more efficient by using `openarray[char]`↵but i also saw std rst parser use `cstring` instead↵should i prefer one over the other? (actually to store the parser input buffer i would use `seq[char]`)
03:14:20FromDiscord<Elegantbeef> Prefer `openarray[char]` it's cleaner, you can always drop down to `cstring` if you need/want
03:14:54FromDiscord<Patitotective> :]
03:42:01FromDiscord<Patitotective> beef, have you made strutils recyclable?
03:48:38FromDiscord<Elegantbeef> No been working on implementing `toOpenArray` on the VM
03:50:30FromDiscord<Elegantbeef> If you want to help me and make a PR to recyclable so I can later PR it into the stdlib, that'd be grand, basically have to forward all calls to a procedure that takes `openArray[char]` like i have done for the parseutils PR i have open
04:00:11FromDiscord<Patitotective> In reply to @Elegantbeef "If you want to": you're copying the std modules from v1.6.8 or devel?
04:00:21FromDiscord<Patitotective> are they even different
04:03:10FromDiscord<Elegantbeef> devel since i'll be PRing them there
04:03:36FromDiscord<Elegantbeef> There shouldnt be any major differences, but it's just good practise to grab from there
04:05:21FromDiscord<Elegantbeef> The way i did unicode was bad I realise now. You want to have `openarray[char]` as a possible overload so someone can do `converter toString(s: MyType): string = string(s)` for distincts
04:06:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dDk
04:07:25FromDiscord<Patitotective> oh okay :]
04:07:27FromDiscord<Elegantbeef> I'll be axing recyclable after so yea the `rtl` and `extern` procedures names are fine
04:08:17FromDiscord<Elegantbeef> Actually it might be best to just get this setup in a PR to Nim itself
04:08:27FromDiscord<Elegantbeef> Since there is code in `strimpl` that needs to be changed
04:08:47FromDiscord<Elegantbeef> It then can be merged after my VM change is merged
04:09:28FromDiscord<Elegantbeef> Yes this does mean your new changes will be waiting on 2.0
04:09:41FromDiscord<Patitotective> also where should i keep the documentation comments? both or just the string overload?
04:09:54FromDiscord<Elegantbeef> In parse utils i kept them on both
04:10:08FromDiscord<Patitotective> In reply to @Elegantbeef "*Yes this does mean": like everyone changes 😁
04:10:44FromDiscord<Elegantbeef> I suppose you could modify strimpl and strutils and copy it to your project and import that if the version is not 2
04:11:06FromDiscord<Elegantbeef> But the stdlib depending on the language version is a pain
04:11:30FromDiscord<Patitotective> i actually just needed splitlines (yes, for the inefficient nice errors)
04:11:47FromDiscord<Elegantbeef> Then yea it's likely the least awful to copy that implementation
04:12:15FromDiscord<Elegantbeef> This is the type of things i hope to eliminate with my changes to the string using files
04:12:33FromDiscord<Patitotective> In reply to @Elegantbeef "In parse utils i": you sure you pushed it? i cloned recyclable and i dont see any overloads in parseutils↵just the openarray version
04:12:51FromDiscord<Elegantbeef> I didnt do any work on it on that repo
04:13:15FromDiscord<Elegantbeef> That repo is pretty much dead now, i was going to keep the files there but i realised some modules require compiler support(parseutils specifically)
04:13:37FromDiscord<Elegantbeef> Like I had to add functionality to the NimVm to be able to make parseutils use `openarray[char]`
04:14:04FromDiscord<Elegantbeef> I guess strutils and other modules wont need compiler support so it could be fine there
04:14:31FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/743ff2898feb99cfceef5bf3ca5723b307923426/lib/pure/parseutils.nim but yea i'm sure i have overloads 😄
04:14:33*fanta1 joined #nim
04:21:40FromDiscord<Patitotective> damn strutils is huge↵i guess ill continue tomorrow
04:21:42FromDiscord<Patitotective> 🌃
04:22:29FromDiscord<Elegantbeef> Buh bye
04:22:47FromDiscord<Elegantbeef> Converting is relatively simple, but it's a bit of a pain. Having to reason what should be allowed where
05:33:46*hochata quit (Ping timeout: 272 seconds)
06:11:55*rockcavera quit (Remote host closed the connection)
06:16:20*PMunch joined #nim
06:22:05*kenran` joined #nim
06:37:48FromDiscord<Bung> how to give a var type argument default value ?
06:38:22FromDiscord<Elegantbeef> `default(typeof(myVar))`?
06:38:49FromDiscord<Bung> let me try
07:59:25PMunchDamn it, my protobuf library only supports protobuf3, but now I want to read protobuf2 files from openstreetmap
07:59:59PMunchI looked at nim-protobuf-serialization, it supports protobuf2, but only if you write your own definition
08:00:26PMunchFigured I'd have a look at their implementation of protobuf3 parsing to expand it. Turns out they're just using my parsing :P
08:16:07FromDiscord<Horizon [She/Her]> Oop
08:17:07FromDiscord<Elegantbeef> Nah we do procedural here
08:26:36FromDiscord<chul_jing> sent a long message, see http://ix.io/4cn1
08:34:18PMunchI wonder if that crypto spam stuff has any return on investment
08:34:28PMunchI can't imagine anyone actually clicking on those
08:34:48PMunchI mean Matrix isn't exactly where your grandma hangs out
08:38:04FromDiscord<baalajimaestro> 😂😂
08:40:54FromDiscord<Elegantbeef> Yea it's confusing
08:41:00FromDiscord<Elegantbeef> Especially in a programming matrix
08:41:04FromDiscord<Elegantbeef> It's like the worst target
08:41:20FromDiscord<Elegantbeef> You have a subset of a subset
08:48:24PMunchMaybe we should write and distribute our own spamming tool
08:48:34PMunchWhich won't allow you to spam #nim channels :P
08:48:47PMunchJust fight the spammers with market share
08:49:37FromDiscord<Elegantbeef> I still dont think it's a bot, but alas
08:49:56FromDiscord<ChocolettePalette> Speaking of spamming tools. Is it possible that HttpClient has some kind of timeout between requests? Like, not allowing you to send another one if the delay was too long
08:50:26FromDiscord<Elegantbeef> There is a `timeout` parameter for `newHttpClient`
08:50:37FromDiscord<Elegantbeef> But that's for waiting X amount of time before giving up afaik
08:51:22FromDiscord<Elegantbeef> So i guess the answer is 'yes', but you use exceptions to handle that
08:55:02FromDiscord<ChocolettePalette> Ahhh, okay, thank you then
09:00:11FromDiscord<Elegantbeef> I just realised the dumbest part about this matrix spam is that they use the matrix homeserver
09:01:11PMunchWhy does that make it particularily dumb?
09:02:44FromDiscord<Elegantbeef> Cause that means they have to use a captcha and manually register these accounts
09:03:00FromDiscord<Elegantbeef> If they hosted their own homeserver they could automate that all
09:03:28FromDiscord<Elegantbeef> Oh shit i'm giving the bad guys ideas
09:08:37FromDiscord<ChocolettePalette> This server would simply get avoided in no time
09:08:48FromDiscord<Elegantbeef> Sure but domains are cheap 😛
09:09:19FromDiscord<Elegantbeef> If this was a successful scam, one would imagine it'd be worthwhile
09:14:49Amun-Rahmm, there was a way of including C code directly into Nim source but I cannot find it…
09:17:29Amun-Rabut I might be wrong
09:18:43FromDiscord<Elegantbeef> `{.emit:"""void function(){}""".}`
09:18:57FromDiscord<Elegantbeef> Or do you mean pmunch's futhark?
09:19:06*fanta1 quit (Quit: fanta1)
09:19:33*fanta1 joined #nim
09:21:13Amun-Raright, emit, thanks
09:31:22*jmdaemon quit (Ping timeout: 260 seconds)
09:36:41*fanta1 quit (Quit: fanta1)
09:44:11*wallabra quit (Ping timeout: 260 seconds)
09:44:38*wallabra joined #nim
10:04:27*xet7 joined #nim
10:17:46arkanoidFor a 100% nim project, is there any difference in using nim cpp instead of nim c?
10:19:45PMunchThere used to be a small speed benefit for certain scenarios
10:19:56PMunchBut nowadays I don't think they're that different
10:22:11FromDiscord<Takemichi Hanagaki> In reply to @arkanoid "For a 100% nim": Supports to external libs too.↵So, if you want to use Qt, for instance, that is written in Cpp, you must to use Cpp to it.
10:22:54PMunchI think that's why they specified 100% Nim
10:31:27arkanoidExactly. I mean 100% nim without importX anything
10:31:36arkanoidThanks PMunch
10:33:04arkanoidSo if I use nim c I can use importc only, but if I use nim cpp I can use both importc and importcpp?
10:33:52arkanoidI mean, I know that sqlite official wrapper works for both, so I bet it works like this
10:34:24FromDiscord<Horizon [She/Her]> In reply to @arkanoid "So if I use": Yeah, since `C++` compilers can compile most `C` code
10:34:51FromDiscord<Horizon [She/Her]> @Arkanoid
10:35:08FromDiscord<Horizon [She/Her]> Crap didn't mean to ping the user sorry
10:35:25FromDiscord<Horizon [She/Her]> Was trying to ping the IRC user (hoping the bot translates pings)
10:37:36arkanoidNp
10:49:13PMunchWhy is swapping endianess so cumbersome in Nim
10:51:41FromDiscord<exelotl> @Horizon [She/Her] on IRC you don't need @, you just say their name to ping them
10:57:00*PMunch quit (Quit: Leaving)
10:57:12*PMunch joined #nim
11:00:04FromDiscord<Horizon [She/Her]> Ah alright
11:05:36FromDiscord<ChocolettePalette> It is kinda strange doe\: for some reason my HttpClient throws an httpError if I wait 65 seconds before making another request, but if I make requests more often, it works perfectly... Even setting timeout to 90 seconds didn't work
11:06:46FromDiscord<ChocolettePalette> It might be server closing the connection though...
11:11:32FromDiscord<auxym> In reply to @PMunch "Why is swapping endianess": https://nim-lang.org/docs/endians.html ? But you might also be interested in https://justine.lol/endian.html
11:12:43FromDiscord<auxym> Why are people so concerned with endianness lately though? Last I checked there's almost nothing running big-endian, except IBM mainframes and maybe some MIPS router chips
11:14:20FromDiscord<auxym> (but I also made sure to make https://github.com/auxym/nim-tinyusb endian portable, for some reason)
11:18:39PMunch@auxym, well I'm reading a file format, and the size is for some reason written in the oposite order than what readInt from streams uses
11:18:56PMunchWhether that's Nims streams modules fault, or the formats fault I don't really care
11:19:01PMunchBut I had to switch the endianess
11:19:27PMunchAnd swapEndian from the endians module requires pointers, I just want to slap a `.swapEndian` at the end of my read statement
11:21:05FromDiscord<auxym> oh, yeah. makes sense. I wasn't aware of the endians module until someone (beef) pointed it out recently, so I just implemented something like the read/write macros in the blog post I linked, except in Nim. Should be pretty straightforward with a stream, too, reading or writing one byte at a time.
11:25:49FromDiscord<ChocolettePalette> Nvm this, found an issue on github
11:33:50PMunchUgh, why wasn't my byte streams merged..
11:34:03PMunchIt feels so dirty to cast a seq[uint8] to a string stream..
11:49:03*disso_peach quit (Remote host closed the connection)
11:55:16*fanta1 joined #nim
12:01:21NimEventerNew thread by ingo: Pegs?, see https://forum.nim-lang.org/t/9536
12:11:15PMunchHmm, is there a way to expand the `.` macros?
12:16:36PMunchHmm, is there a way for a template to avoid side-effects apart from `let cacheX = x` at the start?
12:35:00*arkurious joined #nim
12:47:49Amun-Racan I make a template that acts like this cxx macro? https://pastebin.com/ydebumc1
12:48:23PMunchNope
12:48:44PMunchIf I understand what that does correctly
12:49:21Amun-Rait inserts two array values with one call
12:49:39PMunchAh yes, that's not possible in the way you're doing that
12:49:56Amun-Ra{ 0, FOO(3) } becomes {0, 1, 3}
12:50:04Amun-RaI guess macro would be overkill, thanks
12:50:14Amun-Ra(overkill in my example)
12:51:35PMunchIt still wouldn't be possible with a macro
12:52:03PMunch[0, foo(3)] can't add a comma
12:52:23Amun-Raoh
13:00:38FromDiscord<Goel> So after using `s.del(2)` and deleting the string at index 2 of a SeqString, i noticed the original order of Seq elements is not mantained. So for now i have to call `sort(s)` everytime i modify it. Is there any other more optimized proc in the Std that does this automatically or with better performance?
13:04:19FromDiscord<planetis> delete
13:15:37FromDiscord<sOkam!> What's the simplest UI that one could possibly make with Nim?↵I know there are no really good answers for gui frameworks, but...↵what's something that can work, even if suboptimal or too simple?
13:18:03FromDiscord<ChocolettePalette> gtk2 is pretty simple and straightforward if you know gtk2
13:18:28FromDiscord<ChocolettePalette> (But it's a binding)
13:18:54FromDiscord<sOkam!> I would have to learn whatever framework, also idm if its a binding. Just something that I can create in not too much time
13:19:24PMunchimlib2 is dumb, but pretty simple
13:19:33PMunchI've already made the bindings
13:19:41PMunchIt's what I used for notifishower
13:20:12*derpydoo joined #nim
13:20:36PMunchDepending on how simple you want it you might get away with calling out to Zenity as well
13:22:03PMunchsOkam, ^
13:23:41FromDiscord<sOkam!> In reply to @PMunch "Depending on how simple": needs to be cross-platform though 😔
13:24:00PMunchZenity is cross platform
13:25:11PMunchMaybe NiGui would be enough https://github.com/simonkrauter/NiGui
13:26:11PMunchOr Nimx: https://github.com/yglukhov/nimx
13:27:38PMunchYou could also try the GenUI macro for WxWidgets: https://github.com/PMunch/wxnim#the-genui-macro
13:28:01Amun-Ragtk3, gtk2 is eol
13:30:46FromDiscord<auxym> btw, on the topic of gui, is there a reason we don't have bindings to tk? It's pure C so in theory should be pretty easy, and tk is a pretty straightforward way to make simple and lightweight guis
13:35:34FromDiscord<sOkam!> In reply to @PMunch "You could also try": tysm. will look into those
13:35:54FromDiscord<sOkam!> just for completion, are there bindings for gtk3?
13:36:14FromDiscord<auxym> gintro I think?
13:36:34FromDiscord<demotomohiro> https://github.com/StefanSalewski/gintro
13:36:51FromDiscord<sOkam!> kk tyty ✍️
13:36:55FromDiscord<demotomohiro> !repo gintro
13:38:32PMunch@auxym, maybe try it with Futhark?
13:41:58FromDiscord<auxym> yeah, probably will, some day (haha). Was just wondering if it had been tried and there was some sort of blocker
13:51:05FromDiscord<axyz> sent a code paste, see https://play.nim-lang.org/#ix=4dFr
13:58:56FromDiscord<huantian> I think there may be a way to do it but I’ve not found it personally
13:59:48FromDiscord<huantian> I do wish nimsuggest could be aware of which one you’re using too
14:01:36FromDiscord<axyz> yeah, I'd say suggestions would be a really good nice to have, but mostly I think this should fail to compile, otherwise would be really easy to possibly create bugs that would go unnoticed until runtime. Or maybe there are more idiomatic approaches to type safety that I am missing completely here
14:02:32FromDiscord<huantian> I think there’s a compile flag that makes you make sure it’s the right kind
14:02:49FromDiscord<huantian> But I do agree it would be better if it was always statically ensured
14:03:21*PMunch quit (Quit: Leaving)
14:13:38FromDiscord<Andycol> When using `.writefile` how can i use a variable within
14:13:39FromDiscord<Andycol> example
14:13:58FromDiscord<Andycol> sent a code paste, see https://play.nim-lang.org/#ix=4dFA
14:15:28FromDiscord<demotomohiro> https://nim-lang.org/docs/strformat.html
14:16:12FromDiscord<demotomohiro> !eval import strformat; let line = 12345; echo fmt"abcd {line} efgh"
14:16:19NimBotCompile failed: abcd 12345 efgh
14:21:19FromDiscord<Andycol> confused
14:23:52FromDiscord<auxym> nimbot was hacked 😛
14:23:58FromDiscord<ShalokShalom> In reply to @sOkam! "What's the simplest UI": KDialog https://develop.kde.org/deploy/kdialog/
14:24:22FromDiscord<Andycol> sent a code paste, see https://play.nim-lang.org/#ix=4dFB
14:24:46FromDiscord<ShalokShalom> In reply to @sOkam! "just for completion, are": Avoid GTK, if you want to keep your sanity. Particularly for cross platform stuff
14:25:16FromDiscord<sOkam!> In reply to @ShalokShalom "Avoid GTK, if you": why so? what's bad about it?
14:25:40FromDiscord<sOkam!> so far, as a user, i always tend to gravitate towards gtk. But might be missing something from the dev side of it
14:26:24FromDiscord<ShalokShalom> https://youtu.be/ON0A1dsQOV0
14:28:20FromDiscord<ShalokShalom> Its not made for cross platform, its own devs dont know how things work, and the chief head of Linux at Intel has problems coding with it.
14:29:10FromDiscord<sOkam!> ic. will watch for sure ✍️
14:29:43FromDiscord<ShalokShalom> sent a long message, see http://ix.io/4dFD
14:36:17FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4dFF
14:36:41FromDiscord<Andycol> can you show me an example @demotomohiro
14:37:22FromDiscord<demotomohiro> In reply to @Andycol "can you show me": There are sample codes in https://nim-lang.org/docs/strformat.html
14:37:28FromDiscord<Andycol> thanks!
14:42:13FromDiscord<Andycol> sent a code paste, see https://play.nim-lang.org/#ix=4dFH
14:42:41qwrgtk isn't too bad if you want to create bindings from another language, especially for dynamically typed languages
14:43:08qwrbut non-unix platforms are basically second-tier and the "native" C api is torture to use manually
14:44:31*qwr is actually amazed how many GTK applications have been written in C, but maybe the authors simply love C and didn't have much choice there
14:47:55NimEventerNew thread by axyz: Compile time safety for case object fields, see https://forum.nim-lang.org/t/9537
14:48:49qwras user on linux, many of the packaged qt applications tend to integrate with KDE, taking huge amount of dependencies, which is annoying if you don't use KDE - and therefore GTK applications are often more standalone
14:54:16*rez joined #nim
15:16:25FromDiscord<Andycol> In reply to @demotomohiro "You can put variable": seems to just ignore and write the variable as is with fmt etc
15:17:27FromDiscord<ShalokShalom> In reply to @qwr "is actually amazed how": There is also a lot of fanboyism, since gtk is basically the first open source GUI toolkit
15:18:22FromDiscord<demotomohiro> In reply to @Andycol "seems to just ignore": Did you import strformat?
15:18:24FromDiscord<ShalokShalom> In reply to @qwr "as user on linux,": That's not much longer true anymore. Qt5 and KDE Frameworks 5 did a lot on that front. ↵↵Also, why wouldn't you use Qt/KDE on the desktop 😛
15:18:36FromDiscord<Andycol> In reply to @demotomohiro "Did you import strformat?": Yea i did
15:18:49FromDiscord<Andycol> In reply to @demotomohiro "Did you import strformat?": Do you mind if i pm you?
15:19:23FromDiscord<demotomohiro> In reply to @Andycol "Do you mind if": Ok but why dont you ask question here?
15:19:39FromDiscord<Andycol> I can if you prefer here, i dont mind
15:20:52FromDiscord<Andycol> sent a code paste, see https://play.nim-lang.org/#ix=4dG1
15:21:21*fallback quit (Ping timeout: 260 seconds)
15:22:16FromDiscord<demotomohiro> Did you add that code inside `"""` string literal? you need to add fmt to `"""`.
15:23:24FromDiscord<demotomohiro> `fmt` and `&` in strformat module are macro and template and you cannot call them directly inside string literal.
15:23:45FromDiscord<Andycol> sent a code paste, see https://play.nim-lang.org/#ix=4dG2
15:25:02FromDiscord<demotomohiro> You need to write `"/etc/clickhouse-server/config.d/custom.xml".writefile(fmt"""<yandex>...`.
15:26:49FromDiscord<Andycol> sent a code paste, see https://play.nim-lang.org/#ix=4dG5
15:28:20FromDiscord<demotomohiro> yes
15:28:49FromDiscord<Andycol> that does the trick!!!
15:28:54FromDiscord<Andycol> thank you
15:28:55FromDiscord<demotomohiro> You don't need `\n` after `{clusterid}`.
15:29:01FromDiscord<Andycol> yea i see that
15:29:14FromDiscord<Andycol> id buy you a beer if i could, thank you!
15:29:28FromDiscord<demotomohiro> np
15:34:24*kenran` quit (Remote host closed the connection)
15:40:07*fallback joined #nim
15:41:25FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dGa
15:41:33FromDiscord<sOkam!> (edit)
15:42:00FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4dGa" => "https://play.nim-lang.org/#ix=4dGb"
15:43:18FromDiscord<sOkam!> I'm guessing `re` module will be the obvious, but is there something else to help with parsing?
15:48:40FromDiscord<qb> https://nim-lang.org/docs/strscans.html
15:50:54FromDiscord<sOkam!> In reply to @qb "https://nim-lang.org/docs/strscans.html": actually invaluable. lol. tysm!
16:08:32*rez quit (Quit: much snoozes...)
16:19:21*Goodbye_Vincent quit (Quit: Ping timeout (120 seconds))
16:20:42*al1ranger joined #nim
16:21:30*al1ranger quit (Client Quit)
16:24:27*rez joined #nim
16:26:41*rockcavera joined #nim
16:26:42*rockcavera quit (Changing host)
16:26:42*rockcavera joined #nim
16:28:56*Goodbye_Vincent joined #nim
16:32:58FromDiscord<Tanguy> sent a code paste, see https://play.nim-lang.org/#ix=4dGz
16:38:15FromDiscord<Tanguy> Looks like I had a weird `bin/nim` version, deleted it and using `./koch boot` from the `version-1-6` branch fixed it
16:51:56FromDiscord<Bung> it happens when I switch to 1.4
17:10:39NimEventerNew post on r/nim by angel__--__: Getting Nim running with an LSP in Vim?, see https://reddit.com/r/nim/comments/y93x4x/getting_nim_running_with_an_lsp_in_vim/
17:18:29NimEventerNew thread by EnteryName: Template untyped and typed as parameters and return type, see https://forum.nim-lang.org/t/9538
17:21:34*rez quit (Quit: much snoozes...)
17:36:35*rez joined #nim
17:41:26FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dGY
17:43:51FromDiscord<sOkam!> Position 6 seems to be the first `$f` right after `skip spaces ( skip spaces` 🤔↵But the error makes no sense, since vmath.Vec3 does store its components as float32
17:45:35FromDiscord<sOkam!> Can `parseFloat` only return `float`, instead of `float32`?
17:46:26*xet7 quit (Quit: Leaving)
17:48:53FromDiscord<auxym> convert it after? `str.parseFloat.float32`
17:49:03FromDiscord<sOkam!> In reply to @auxym "convert it after? `str.parseFloat.float32`": I don'
17:49:12FromDiscord<sOkam!> I don't own the parsefloat call, its part of the macro
17:49:27FromDiscord<sOkam!> (edit) "don'" => "don't own the parsefloat call, its part of the macro"
17:54:32*disso_peach joined #nim
17:56:16FromDiscord<leorize> time to make the macro float32-aware ig? \:p
17:56:17FromDiscord<leorize> similar problem with int\<size\> I assume
17:56:56FromDiscord<sOkam!> I have not confirmed that to be the issue. I was just asking if that's somestuff that could possibly happen
17:58:07FromDiscord<sOkam!> In reply to @leorize "time to make the": I don't own the macro. It is part of the implied functionality from `strscans.scanf()`
17:58:46FromDiscord<sOkam!> (edit) "`strscans.scanf()`" => "`std.strscans.scanf()`"
17:58:51FromDiscord<leorize> I meant putting it in a PR or so \:p
17:59:05FromDiscord<sOkam!> I don't even know if the problem is that
17:59:08FromDiscord<leorize> you can fork the macro too, it's only in that one file
18:01:34FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dH8
18:10:38FromDiscord<leorize> if you want a workaround, scanf supports custom parser
18:13:22FromDiscord<Kiloneie> Any good that work well with Nim spell checker extensions for VS Code ?↵googling suspicious words i have trouble with takes too much time
18:14:36*rez quit (Quit: l8r)
18:25:25*kenran joined #nim
18:35:31FromDiscord<sOkam!> Is there a way to define a seq that has between 4-6 items in it, and fails if its not in that range?
18:46:19*m33mt33n joined #nim
18:47:56m33mt33ncan someone help?
18:48:02m33mt33ntype SumType* = int or float or string
18:48:08m33mt33nvar Env: Table[string, SumType] # compile time error
18:54:01*m33mt33n quit (Remote host closed the connection)
18:59:33FromDiscord<planetis> you can't do that, it's not a concrete type
18:59:56FromDiscord<planetis> you could use std/json or rethink your code
19:16:40*fanta1 quit (Quit: fanta1)
19:18:41*kenran quit (Remote host closed the connection)
19:19:00FromDiscord<kevin> Are there any SocketIO client implementations in Nim out there?
19:19:13FromDiscord<kevin> quick google search doesn't show anything 🤷
19:25:20FromDiscord<leorize> shameless plug\: https\:&#47;&#47;github.com&#47;alaviss&#47;union↵(<@709044657232936960_m33mt33n=5b=49=52=43=5d>)
19:27:56FromDiscord<sOkam!> How do you declare an `std.tables.Table` type inside a custom object type?↵Or is there a better way to store key:value pairs inside a custom type instead?
19:32:07FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dHz
19:32:31FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4dHz" => "https://play.nim-lang.org/#ix=4dHA"
19:50:03FromDiscord<leorize> you need the generic parameters
19:50:45FromDiscord<Bubblie> how do I use split in nim
19:50:48FromDiscord<Bubblie> for strings
19:50:49FromDiscord<leorize> either Entity needs `[K, V]` or add a specified one to Table
19:51:26FromDiscord<leorize> !eval import strutils; echo "a,b,c".split(',')
19:51:34NimBotCompile failed: @["a", "b", "c"]
19:51:59FromDiscord<leorize> lolwut
19:52:01FromDiscord<Bubblie> yeah
19:52:08FromDiscord<Bubblie> i have no idea why thats not working
19:52:09FromDiscord<Bubblie> 😭
19:52:21FromDiscord<leorize> it's working, just playground being weird
19:52:29FromDiscord<Bubblie> weird
19:52:55FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=4dHB
19:53:21FromDiscord<leorize> oh it put out a `seq[string]`, not string
19:53:30FromDiscord<Bubblie> OH
19:53:31FromDiscord<Bubblie> got it
20:01:31FromDiscord<sOkam!> yeah, ty leorize. Solved it by randomnly trying to add the types with `Table[string, string]`, and it happened to work 🤷‍♂️
20:02:08FromDiscord<Bubblie> can I add multiple return values to a procedure?
20:03:47FromDiscord<sOkam!> you can return a tuple, afaik
20:05:03FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dHG
20:07:33FromDiscord<Bubblie> thats really cool
20:07:39FromDiscord<Bubblie> how do I make a proper nim object btw?
20:07:58FromDiscord<Bubblie> and like assign it to a var
20:08:16FromDiscord<Bubblie> so var timeObj = TimeObject(num, timeType)
20:11:04FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=4dHH
20:11:10FromDiscord<Bubblie> TimeType is an enum
20:11:48FromDiscord<sOkam!> that looks alright. is it throwing any errors?
20:12:30FromDiscord<Bubblie> says it has no type and is ambiguous
20:14:44FromDiscord<sOkam!> what exactly? can you share the code that errors?
20:15:36FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
20:16:55FromDiscord<leorize> when initializing an object, you have to specify the fields manually
20:17:24FromDiscord<leorize> so `TimeObject(num: n, timeType: typ)`
20:19:01FromDiscord<Bubblie> It says undeclared identifier
20:33:07FromDiscord<Bubblie> OH WAIT
20:33:09FromDiscord<Bubblie> I UNDERSTAND
20:33:13FromDiscord<Bubblie> sorry 😭
21:02:49*jmdaemon joined #nim
21:05:14FromDiscord<Bubblie> how can I take a DateTime variable and use sleep() so it executes only after it meets a specific amount of time
21:25:20arkanoidI have an object made of a lot of floats that represents let's say feets. I want to create twin object with same attributes but they represent meters. I need just to multiply each attribute. What's the nim idiomatic way to achieve this?
21:25:33arkanoid*feet
21:27:06FromDiscord<Bubblie> In reply to @Bubblie "how can I take": ah yeah I was wondering fi I could take an integer and then convert it to different times
21:27:40FromDiscord<Elegantbeef> Use generics?↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
21:33:00FromDiscord<Kiloneie> Is there a way to convert an object to another object(child to child) without a cast ?
21:33:34FromDiscord<Elegantbeef> `MyTypeB(myValue)` assuming it's a proper tree
21:34:37*derpydoo quit (Quit: derpydoo)
21:35:18FromDiscord<Kiloneie> i did this
21:35:19FromDiscord<Kiloneie> sent a code paste, see https://play.nim-lang.org/#ix=4dI1
21:35:37FromDiscord<Elegantbeef> Of course not, that's an unsafe conversion
21:35:56FromDiscord<Kiloneie> wdym ?
21:36:08FromDiscord<Elegantbeef> You can only convert up/down branches not across branches
21:36:39FromDiscord<Kiloneie> wait so, child to parent, parent to child, but not child to child ?
21:37:07FromDiscord<Elegantbeef> Yes
21:38:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dI3
21:39:20FromDiscord<Kiloneie> was just trying to see if conversion was possible without cast
21:41:48FromDiscord<Elegantbeef> Type conversions are only allowed up/down the tree if the type information is the same
21:42:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dI5
21:42:25FromDiscord<Elegantbeef> Converting from spider to outlaw is going to give you an incorrect string
21:43:23FromDiscord<Kiloneie> i get that
21:44:08FromDiscord<Kiloneie> though i must be doing something else wrong, i can't do the parent to child and reverse conversion.↵Can you give an example ?
21:45:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dI7
21:45:52FromDiscord<Elegantbeef> You can only convert to a type if the type information is correct
21:46:02arkanoidFound an answer https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CT
21:46:07FromDiscord<Elegantbeef> So you can only go up a branch and back down if you're converting to a type that is valid
21:51:35FromDiscord<Mike> Hey anybody know of a way to do `readLine(stdin)` asynchronously?
21:52:02FromDiscord<Mike> I know there's an `openFileAsync`, but I can't figure out a way to hook that up to stdin, if that even makes sense
22:02:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dI9
22:05:09FromDiscord<Mike> damn, that looks like what I wanted but yeah it blocks \:/
22:06:18FromDiscord<Kiloneie> Man that took way longer to understand than it should of, starving for 2-3 hours...
22:07:03FromDiscord<Kiloneie> Really wanted to finish what i am doing tonight, but it doesn't look like it will, time estimated 30-60 minutes, 3 hours later, still not done xD...
22:07:44FromDiscord<Mike> @Kiloneie\: if you actually are trying to model a game like in your example, I highly recommend looking into entity component systems
22:07:56FromDiscord<Mike> More or less what elegantbeef was suggesting
22:08:08FromDiscord<Elegantbeef> ECS is vastly different to what i suggested
22:08:20FromDiscord<Kiloneie> object variants is where i am at atm
22:08:36FromDiscord<Kiloneie> i did read some on components but i forgot just about everything
22:08:46FromDiscord<Mike> Well, it's bigger. But the composition aspect is the same
22:09:04FromDiscord<Elegantbeef> Yea composition is just better
22:09:26FromDiscord<Kiloneie> do you have a good link for that ? someone had a good one once...
22:09:57FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dIa
22:10:22FromDiscord<Mike> It's been a long time since I've worked on something like that, so I can't recommend anything beyond what I'd fine with google, same as you↵(@Kiloneie)
22:13:51FromDiscord<Elegantbeef> https://github.com/rlipsc/polymorph if you want ECS in Nim
22:14:22FromDiscord<Mike> Hey that's cool
22:14:22FromDiscord<Mike> Didn't know that existed
22:14:41FromDiscord<Patitotective> In reply to @sOkam! "Is there a simple": this would work for a single block https://nim-lang.org/docs/parseutils.html#captureBetween%2Cstring%2Cchar%2Cchar%2Cint↵dont think theres a way to split into multiple blocks
22:14:49FromDiscord<Elegantbeef> I personally dont really use ECS cause i find it complicates my games
22:15:54FromDiscord<sOkam!> In reply to @Patitotective "this would work for": nice one. problem is each block can contain subblocks 😔
22:16:08FromDiscord<Elegantbeef> You then need to implement a basic parser
22:16:43FromDiscord<sOkam!> kk. i can do that, i just thought that there might already be something similar in the libs, since there is so much cool and handy stuff
22:17:30FromDiscord<Bubblie> so is there any nim libraries that allow me to specify a duration of time and will execute code after it meets that duration of time
22:17:38FromDiscord<Bubblie> or is there any examples of this in general
22:17:52FromDiscord<Elegantbeef> Something like a cronjob is probably more sensible
22:18:05FromDiscord<huantian> or a systend timer
22:18:14FromDiscord<huantian> 😛
22:18:19FromDiscord<Elegantbeef> lol
22:18:30FromDiscord<Bubblie> https://github.com/soasme/nim-schedules I found this
22:18:39FromDiscord<Elegantbeef> See i'm such a bad linux user i dont really care about what i have running there
22:18:58FromDiscord<Bubblie> im really just trying to add remind functionality to my dimscord bot
22:19:01FromDiscord<Elegantbeef> That type of stuff is generally better to let your OS handle
22:19:57FromDiscord<huantian> In reply to @Bubblie "im really just trying": hm maybe you can do something with the async event loop
22:20:17FromDiscord<huantian> but I mean you can use a while loop and `asyncSleep`
22:20:36FromDiscord<huantian> (edit) "`asyncSleep`" => "`sleepAsync`"
22:20:50FromDiscord<Mike> This is probably not what you had in mind, but you could use [remind](https://www.linux.com/news/manage-your-time-remind/)
22:21:03FromDiscord<Mike> Like you'd write stuff to a file and then periodically run remind to see what needs doing
22:21:33FromDiscord<Elegantbeef> Oh shit i'm surprised md'd links transfer to discord through the bridge
22:22:17FromDiscord<Elegantbeef> this means discord supports markdown links... TIL 😄
22:22:26FromDiscord<Mike> Yeah Element and Discord usually play nice with markdown, surprisingly
22:22:33FromDiscord<huantian> yep they support it in embeds too, since like the beginning
22:22:38FromDiscord<huantian> they just dont' let users use it
22:23:07FromDiscord<Bubblie> is it possible to just make it not repeat
22:23:58FromDiscord<huantian> what's wrong with just `sleep`ing ?
22:24:08FromDiscord<Patitotective> for object fields, there is no advantage from using `openArray[char]` over `string` , right? it would still need to get copied
22:25:15FromDiscord<Bubblie> In reply to @huantian "what's wrong with just": if there are too many reminders and I use sleep everytime wouldn't that be an issue
22:25:50FromDiscord<Bubblie> also nim's sleep function takes it in milliseconds right
22:26:08FromDiscord<Bubblie> how would I take any integer and auto convert to milliseconds, should I just do math myself or does nim have a small function for that
22:26:20FromDiscord<huantian> what is your integer
22:26:31FromDiscord<huantian> you just multiply it by 1000 if it's in seconds
22:26:36FromDiscord<huantian> to make it miliseconds lmao
22:26:39FromDiscord<Bubblie> well yeah
22:26:43FromDiscord<Bubblie> but what if I took 1 day
22:26:47FromDiscord<Bubblie> as an inout
22:26:55FromDiscord<Bubblie> should I just convert 1 day to milliseconds too through a calculation
22:27:12FromDiscord<Patitotective> yea...
22:27:18FromDiscord<Bubblie> alright
22:27:39FromDiscord<Bubblie> would sleep cause issues though if there are many reminders
22:27:43FromDiscord<huantian> you can also just use the miliseconds property of `TimeInterval`if you've parsed your time
22:28:14FromDiscord<huantian> or `Duration`
22:28:17FromDiscord<Patitotective> you could use `times.Duration` and just call `inMilliseconds` https://nim-lang.org/docs/times.html#inMilliseconds%2CDuration
22:28:25FromDiscord<AmjadHD> In reply to @Mike "damn, that looks like": Are you on windows ?
22:28:37FromDiscord<Mike> nah I'm on linux↵(@AmjadHD)
22:29:28FromDiscord<huantian> In reply to @Bubblie "would sleep cause issues": it shouldn't
22:30:06FromDiscord<huantian> I haven't tested it or anything tho
22:35:17FromDiscord<ShalokShalom> In reply to @Kiloneie "Really wanted to finish": Sounds like normal programming 😅
22:36:24FromDiscord<ShalokShalom> In reply to @Elegantbeef "Yea composition is just": You mean 'composition' is a valid alternative to ECS?
22:36:36FromDiscord<ShalokShalom> It seems, that ECS is much more complex
22:36:45FromDiscord<ShalokShalom> So you dont think it's worth it
22:39:29FromDiscord<sOkam!> Errr... is there not a way to readLine from a string buffer, instead of from a file? 🤔
22:40:47FromDiscord<Elegantbeef> ECS is composition based
22:40:54FromDiscord<Elegantbeef> You can do composition many different ways
22:41:08FromDiscord<Elegantbeef> My games usually have simple mechanics so i hard code logic and composition doesnt help
22:41:27FromDiscord<Elegantbeef> Like my present game is a 2D puzzle game with very basic mechanics i do not really benefit much from composition
22:41:43*wallabra_ joined #nim
22:42:24FromDiscord<Mike> Yeah ECS takes a lot of effort to implement, but it manages the complexity of a game really well. So it's just a matter of how complex your game is going to be to determine if that tradeoff is worth it
22:42:35FromDiscord<Elegantbeef> Yep it makes it much easier to add logic/features
22:42:47FromDiscord<Elegantbeef> But given my game scope is really small it doesnt benefit me much
22:43:05FromDiscord<Patitotective> actually beef, wouldnt streams make my kdl parser much more usable? though the data is stored a string https://nim-lang.org/docs/streams.html#StringStreamObj
22:43:09FromDiscord<Elegantbeef> It also reduces complexity of many things cause you just add systems + components and it works
22:43:32FromDiscord<Elegantbeef> that's why you dont use `StringStream` pat you use `Stream`
22:43:37*wallabra quit (Ping timeout: 246 seconds)
22:43:38*wallabra_ is now known as wallabra
22:43:45FromDiscord<Elegantbeef> That way you can stream the data as you need it from a file and are not limited by system memory
22:43:56FromDiscord<ShalokShalom> In reply to @Mike "Yeah ECS takes a": You know Godot?
22:44:08FromDiscord<ShalokShalom> It has an ECS system called Godex
22:44:11FromDiscord<Elegantbeef> Anyway dog walk time
22:44:26FromDiscord<Elegantbeef> Godot uses EC by default to achieve composition
22:44:32FromDiscord<ShalokShalom> Greet them from me 😄
22:44:33FromDiscord<Patitotective> In reply to @Elegantbeef "that's why you dont": 🧠
22:44:38FromDiscord<huantian> Beefs owner is finally being responsible and walking him
22:44:48FromDiscord<ShalokShalom> In reply to @Elegantbeef "Godot uses EC by": Ahm, no?
22:45:18FromDiscord<ShalokShalom> Their devs are actually quite outspoken on how such data driven approaches are against their vision
22:45:24FromDiscord<ShalokShalom> There is even a blog post
22:45:35FromDiscord<Elegantbeef> EC not ECS
22:45:39FromDiscord<Elegantbeef> Please read before commenting
22:45:40FromDiscord<Elegantbeef> Thank you
22:46:16FromDiscord<Kiloneie> In reply to @ShalokShalom "It has an ECS": You mean the Node system ?
22:47:02FromDiscord<ShalokShalom> https://godotengine.org/article/why-isnt-godot-ecs-based-game-engine
22:47:09FromDiscord<ShalokShalom> In reply to @Kiloneie "You mean the Node": No
22:47:50FromDiscord<ShalokShalom> Third party
22:47:53FromDiscord<ShalokShalom> https://godotengine.org/article/why-isnt-godot-ecs-based-game-engine
22:48:28FromDiscord<ShalokShalom> In reply to @Elegantbeef "EC not ECS": Fair. What is EC? 😄
22:49:10FromDiscord<ShalokShalom> In reply to @huantian "Beefs owner is finally": Yeah, thought this as well 😅
22:50:53FromDiscord<Patitotective> huh, i have to find a way to keep parser's nice errors without having to copy the stream (since `Lexer`'s stream is copied to `Parser`)
22:57:52FromDiscord<sOkam!> how do you access the last element of a seq?↵cant find anything mentioning it 😔
22:58:17FromDiscord<sOkam!> can I just do `[-1]`?
22:59:52FromDiscord<Mike> I think it's `[^1]`
23:04:20FromDiscord<Patitotective> In reply to @sOkam! "how do you access": its called backwardsindex
23:04:22FromDiscord<Patitotective> (edit) "backwardsindex" => "backwards index"
23:09:11FromDiscord<ShalokShalom> What's the best parser ljbrary in Nim?
23:18:27FromDiscord<Patitotective> In reply to @ShalokShalom "What's the best parser": > _best_↵i recommend npeg, though i prefer writing my own parser
23:19:58FromDiscord<Elegantbeef> Npeg if you want something easy, parseutils if you want something more granular
23:20:31FromDiscord<Elegantbeef> EC is how Godot/Unreal do it you can extend an entity(Node in godot, actor in Unreal) and then add sub entities to that entity↵(@ShalokShalom)
23:20:47FromDiscord<Elegantbeef> It's also somewhat what Unity does, but Unity doesnt allow you to extend all base entities(GOs are sealed)
23:20:58FromDiscord<Elegantbeef> You use OOP to achieve composition instead of DOD
23:21:09FromDiscord<Elegantbeef> It's easier to write and reason, but slower due to pointer indirection
23:22:36FromDiscord<Patitotective> In reply to @Patitotective "huh, i have to": ill have to prioritize allocations over nice-looking-and-attractive-errors
23:23:50FromDiscord<Patitotective> (edit) "In reply to @Patitotective "huh, i have to": ill have to prioritize allocations over nice-looking-and-attractive-errors ... " added "💀 💀"
23:23:59FromDiscord<Elegantbeef> Eh you can take ownership of the stream
23:24:08FromDiscord<ShalokShalom> In reply to @Elegantbeef "EC is how Godot/Unreal": Ah. But ain't they gonna do that object orientied?
23:24:19FromDiscord<ShalokShalom> (edit) "orientied?" => "oriented?"
23:24:26FromDiscord<Elegantbeef> `sink Stream`
23:24:26FromDiscord<Elegantbeef> What?
23:24:41FromDiscord<ShalokShalom> Godot and Unreal
23:24:49FromDiscord<ShalokShalom> Abstract nodes and actors
23:24:52FromDiscord<Patitotective> In reply to @Elegantbeef "Eh you can take": take who? how do i do that
23:25:07FromDiscord<ShalokShalom> Is this composition based?
23:25:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dIl
23:25:24FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dIm
23:25:27FromDiscord<Elegantbeef> `proc parseKdl(stream: sink Stream): KDL`
23:25:47FromDiscord<ShalokShalom> In reply to @Elegantbeef "You use OOP to": DOD?
23:25:59FromDiscord<Elegantbeef> `sink` is Nim's move semantic for "give up ownership of resources"
23:25:59FromDiscord<Elegantbeef> Data oriented design
23:26:01FromDiscord<Elegantbeef> ECS is data oriented
23:26:07FromDiscord<ShalokShalom> Ah
23:26:11FromDiscord<Elegantbeef> It doesn use pointers much and does not use a complex inheritance tree
23:26:14FromDiscord<ShalokShalom> And EC?
23:26:18FromDiscord<ShalokShalom> In Godot
23:26:26FromDiscord<ShalokShalom> Is it OO?
23:26:34FromDiscord<ShalokShalom> Since that's, how I remind it.
23:26:35FromDiscord<Patitotective> In reply to @sOkam! "?? how is this": why do you do `id :type` instead of `id: type`↵who are you trying to make cry
23:26:50FromDiscord<Elegantbeef> Entity Component. In Godot you have a root Object Node and inherit/modify it as you go
23:26:54FromDiscord<Elegantbeef> So you get an inheritance tree
23:26:56FromDiscord<sOkam!> In reply to @Patitotective "why do you do": nobody, because i code for myself 🤷‍♂️
23:26:57FromDiscord<ShalokShalom> Yes
23:27:07FromDiscord<ShalokShalom> This is how I had it in my mind.
23:27:07FromDiscord<Elegantbeef> But they still use composition and avoid direct reference using signals
23:27:15FromDiscord<ShalokShalom> Hnn
23:27:19FromDiscord<ShalokShalom> So both
23:27:38FromDiscord<ShalokShalom> Signals are involved in Nodes as well?
23:27:38FromDiscord<Elegantbeef> Unity for instance has you directly referencing components which creates funky logic
23:27:41FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4dIn
23:27:51FromDiscord<ShalokShalom> Unity is ...
23:27:56FromDiscord<ShalokShalom> Not interesting.
23:28:06FromDiscord<Patitotective> In reply to @Elegantbeef "`sink` is Nim's move": ooooh nice :]
23:28:08FromDiscord<Elegantbeef> Well Signals are how godot communicates between nodes, it uses them to create disconnects between Nodes so you can just drop in replacements
23:28:18FromDiscord<Elegantbeef> So it's a much more composable API
23:28:19FromDiscord<ShalokShalom> There is a talk soon about Nim in Unreal
23:28:33FromDiscord<Elegantbeef> It means you're indexing outside the sequence↵(@sOkam!)
23:28:40FromDiscord<ShalokShalom> Considering UnrealCLR is broken at the moment, very interesting
23:28:49FromDiscord<ShalokShalom> No F# on 5 yet
23:28:52FromDiscord<sOkam!> In reply to @Elegantbeef "It means you're indexing": how is index 0 out of the sequence?
23:29:00FromDiscord<Elegantbeef> Sequences are default empty
23:29:07FromDiscord<Elegantbeef> So 0 is out of the sequence
23:29:08FromDiscord<sOkam!> oh
23:29:19FromDiscord<ShalokShalom> In reply to @Elegantbeef "Well Signals are how": Your a great help, always
23:29:34FromDiscord<ShalokShalom> Your dogs get probably a lot of professional walking as well
23:29:37FromDiscord<ShalokShalom> 😅
23:32:34FromDiscord<sOkam!> How do you store something at position 0 of an already initialized empty sequence?
23:32:53FromDiscord<Elegantbeef> `mySeq.add myValue`
23:37:26FromDiscord<ShalokShalom> @Elegantbeef#0000 Do you work for Nim?
23:37:31FromDiscord<ShalokShalom> I mean, do you get paid
23:37:33FromDiscord<Elegantbeef> I dont work for anything
23:37:42FromDiscord<ShalokShalom> Good idea
23:37:51FromDiscord<ShalokShalom> You should get paid anyway
23:37:55FromDiscord<ShalokShalom> Just saying.
23:38:18FromDiscord<Elegantbeef> Well petition someone to do such
23:44:21FromDiscord<Patitotective> beef is a full-time dog walker
23:46:21FromDiscord<SirOlaf> Beef I saw you in my pr, this is the file I'm mainly testing with for now if you're curious. Everything in there that isn't commented kinda works https://media.discordapp.net/attachments/371759389889003532/1032801983188439040/a.nim
23:47:43FromDiscord<SirOlaf> The whole void var construct is probably the most useless thing
23:51:10FromDiscord<Elegantbeef> Full time hobbyist dog walker↵(@Patitotective)