<< 23-05-2023 >>

00:00:44FromDiscord<inv> it works, thank you @ElegantBeef
00:02:09FromDiscord<juan_carlos> If we have `=sink`, why not `=latrine` ?. 🤔
00:02:10FromDiscord<Elegantbeef> Nim has cursor inference and has some pretty good algorithims to remove destructors
00:02:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wtU
00:04:45FromDiscord<Elegantbeef> Cause if we add latrine we also need a faucet
00:10:19*xet7 joined #nim
00:24:01*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
00:24:21*antranigv joined #nim
00:57:20FromDiscord<Yepoleb> Does nim handle plumbing now?
00:57:39FromDiscord<Elegantbeef> It's Rust free
01:00:04*antranigv quit (Ping timeout: 268 seconds)
01:00:28FromDiscord<juan_carlos> Rust is in the `=latrine`.
01:09:03*antranigv joined #nim
01:25:01*derpydoo joined #nim
01:45:00*fallback quit (Ping timeout: 250 seconds)
02:02:46FromDiscord<Rika> let that sink in
02:02:56FromDiscord<Elegantbeef> Ok there elon
02:09:10*Nam_ joined #nim
02:45:17*fallback joined #nim
02:48:25NimEventerNew Nimble package! nats - Nim wrapper for the nats.c - NATS client library, see https://github.com/deem0n/nim-nats
03:18:21*azimut_ quit (Remote host closed the connection)
03:18:57*azimut joined #nim
03:31:59*lucasta quit (Remote host closed the connection)
03:32:21*lucasta joined #nim
03:47:46*lucasta quit (Quit: Leaving)
05:16:18*arkurious quit (Quit: Leaving)
06:02:59*advesperacit joined #nim
06:37:52*PMunch joined #nim
06:40:12FromDiscord<Sh1be> Hello, im pretty new to nim and it looks super promising. I come from a C# / py / TS background and would love to try the language out in action, however I am not quite sure what I should make. Does anybody have any project ideas?
06:40:29*nanxiao joined #nim
06:41:57FromDiscord<Elegantbeef> Basic command line programs is always a goto suggestion of mine
06:42:03FromDiscord<Elegantbeef> Or making games using Nico
06:42:19FromDiscord<Sh1be> In reply to @Elegantbeef "Basic command line programs": what could they be doing?
06:43:17FromDiscord<Elegantbeef> A basic choose your own adventure game, or a program that you've written in another language
06:44:04FromDiscord<Rika> When I was newer I wrote an image dithering program
06:44:12*Nam_ quit (Read error: Connection reset by peer)
06:44:34*Nam_ joined #nim
06:46:49FromDiscord<Sh1be> I will try to implement those then, thanks for the suggestions!
06:49:11PMunchRika, I still have PTSD from my image dithering stuff :P
06:49:26PMunchThey're fun though
06:49:47FromDiscord<Rika> PTSD? Why?
06:49:51FromDiscord<Rika> I still use my program
06:49:59FromDiscord<Rika> For my e-reader stuff
06:50:31FromDiscord<Rika> But I wish I could apply it globally while the e-reader runs like a shader over android somehow
06:53:47PMunchRika, well I just spent way too much time dithering stuff
06:53:58PMunchImplemented just about every algorithm out there
06:54:10PMunchAnd started playing around with parameters and such
06:54:50*nanxiao quit (Quit: Client closed)
06:55:33FromDiscord<Sh1be> In reply to @Rika "But I wish I": I think that's possible though, no? From what I know you need the `SYSTEM_ALERT_WINDOW` permission to draw over other apps
06:57:11PMunchI've implemented mine through the X protocol
06:58:12PMunchBasically I create a dummy display that only exists as a writing buffer, then I use the damages X extension to pull changes to the screen and then I dither and feed them to the display over USB
06:59:40*rockcavera quit (Remote host closed the connection)
07:04:01FromDiscord<Rika> In reply to @Sh1be "I think that's possible": I’d like to not need to make my own program and just write a shader into a pre-made thing yeah
07:04:21FromDiscord<Rika> It needs to be able to read what’s under it though since it’s a shader and all
07:05:50FromDiscord<Sh1be> In reply to @Rika "I’d like to not": that doesn't exist from what I know
07:06:01FromDiscord<Rika> no problem if I need root though since it’s only for me
07:06:05*Nam__ joined #nim
07:06:10FromDiscord<Rika> https://reddit.com/r/androiddev/comments/3u4l32/_/cxbvo9a/?context=1 seems like someone already discussed a bit
07:06:40FromDiscord<Sh1be> oh with root everything is possible
07:07:45FromDiscord<Rika> Definitely, but I don’t know where to start
07:08:04FromDiscord<huantian> switch to wayland then cry
07:08:35FromDiscord<Sh1be> In reply to @Rika "Definitely, but I don’t": I suggest asking in the r/androidroot server maybe
07:09:36FromDiscord<Sh1be> or r/android_mods
07:09:52*Nam_ quit (Ping timeout: 248 seconds)
07:09:55FromDiscord<Sh1be> (edit) "r/android_mods" => "r/android"
07:10:57FromDiscord<Sh1be> there are probably more specific servers for that though
07:12:21FromDiscord<Rika> Okay thanks
07:15:30FromDiscord<Ras> so, how exactly does "vendoring" code work? let's say i have a package/library i want to use, but i need to make some tiny modifications to it before using it. In Go, I would simply "vendor" the code into my own project and modify it there, at which point my own package will use the vendored version that I already have locally instead of pulling it via git or whatever. How does this generally look like in Nim?
07:15:37FromDiscord<Ras> hope i'm being clear here, not really sure how to explain it
07:16:41*Notxor joined #nim
07:16:56FromDiscord<Ras> more specifically, i'm trying to use https://github.com/zielmicha/nim-dbus, but i need to remove the `dynlib` pragmas because i'm linking against libdbus statically
07:17:00FromDiscord<Rika> Before nimble 0.14 or whatever the version was called, there was a feature called nimble develop where if you ran that in a folder, it would be installed but not copied so any modifications in that folder would carry into any other modules that had it as a dependency
07:17:00FromDiscord<Ras> and otherwise it fails at runtime
07:17:01FromDiscord<Elegantbeef> Fork the package and depend on it inside your nimble file
07:17:52FromDiscord<Elegantbeef> `nimble develop` is still the way to do it
07:18:05FromDiscord<Elegantbeef> Personally i just fork and rely on my own fork until changes are made upstream
07:18:29PMunchAren't there also the dynliboverride flag which can be used to solve this specific problem?
07:18:36FromDiscord<Ras> really?
07:18:37FromDiscord<Elegantbeef> Yep
07:18:42FromDiscord<Rika> In reply to @Elegantbeef "`nimble develop` is": I believe it changed in the newest version so
07:18:53FromDiscord<Elegantbeef> `nimble develop --global` installs globally
07:19:20FromDiscord<Ras> In reply to @PMunch "Aren't there also the": that seems to be exactly what i'm looking for, actually
07:19:21FromDiscord<Ras> thank you!
07:27:08FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wuL
07:34:15FromDiscord<Rika> In reply to @Sh1be "I suggest asking in": Maybe it would be easier just to rebuild the app I want the shader in the most lol
07:35:30FromDiscord<sOkam!> oh fk me. my `ngpu.Buffer[T]` was clashing with `wgpu.Buffer`, so it was resolving incorrectly and the compiler didn't know how to say that↵error messages sometimes are .... 😔
07:54:10FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wuQ
07:57:56*ntat joined #nim
07:59:20FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wuR
08:10:36*nanxiao joined #nim
08:12:50FromDiscord<mratsim> In reply to @Ras "more specifically, i'm trying": compile with dynlibOverride
08:13:21FromDiscord<Ras> yup, already got it working, thanks!
08:16:36*Notxor quit (Remote host closed the connection)
08:18:33FromDiscord<Elegantbeef> compile with a debug compiler↵(@sOkam!)
08:18:52FromDiscord<sOkam!> In reply to @Elegantbeef "compile with a debug": how does one do that?
08:19:14FromDiscord<Elegantbeef> clone then `./build_all` and then `./koch temp c ....`
08:22:10FromDiscord<sOkam!> whats koch temp c doing?
08:22:21FromDiscord<sOkam!> is that `...` for my code or what exactly?
08:35:45FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wv2
08:37:06FromDiscord<Elegantbeef> it's just a Nim compiler after `c`
08:37:52FromDiscord<sOkam!> where am i supposed to run it from?
08:38:16*Notxor joined #nim
08:38:22FromDiscord<sOkam!> im calling for the absolute path where it is, and its erroring with that, which i have no clue what it means
08:38:55FromDiscord<Elegantbeef> I call it locally from the Nim directory
08:40:00FromDiscord<sOkam!> oh the inverse. i was trying from the local folder. seems like the inverse does work
08:43:56FromDiscord<sOkam!> most confusing error i've encountered to this date by far ⚰️
08:46:45FromDiscord<sOkam!> @ElegantBeef does koch resolve dependencies differently than nimble and nimc? its failing to find a function that I defined in another lib
08:47:56FromDiscord<Elegantbeef> Should resolve the same as nim
08:49:11FromDiscord<sOkam!> how does it deal with `--patch:"...."`?
08:49:16FromDiscord<sOkam!> (edit) "`--patch:"...."`?" => "`--path:"...."`?"
08:49:52FromDiscord<Elegantbeef> It's just a nim compiler when you use `temp c`
08:50:00FromDiscord<sOkam!> meaning, does it read the `config.nims` and `nim.cfg` files?
08:50:08FromDiscord<sOkam!> because i have the paths there, but they are not being read
08:58:44FromDiscord<Elegantbeef> You can also use `./bin/nim_temp` directly
09:04:13FromDiscord<Elegantbeef> It's inside `isObjectSubtype` so seems it's a bug dispatching on a base type
09:05:26FromDiscord<sOkam!> finally managed to make it not choke when solving some functions named `set`↵but the output is not very helpful for me either. maybe you understand whats happening with this @ElegantBeef ? 🤔 https://media.discordapp.net/attachments/371759389889003532/1110493682441912350/err.txt
09:05:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wva
09:06:47FromDiscord<Elegantbeef> Yea that stack trace just gives you the error path, which is helpful if you want to fix it, if you want to see what's causing it and work around it you can do what I said
09:06:57FromDiscord<Elegantbeef> It'll show you precisely what code is erroring
09:07:22FromDiscord<sOkam!> In reply to @Elegantbeef "Once you get it": do i recompile koch, or does it do that auto?
09:07:42FromDiscord<Elegantbeef> `./koch temp` builds a debug version of the compiler then uses it
09:07:54FromDiscord<Elegantbeef> It's very easy to work on the Nim compiler in my experience
09:08:05FromDiscord<Elegantbeef> Not that the compiler is that easy to work on
09:08:19FromDiscord<Elegantbeef> The tooling is sufficient to work on it, the compiler is an eldritch horror
09:08:27FromDiscord<sOkam!> ic
09:08:52FromDiscord<Elegantbeef> But now before the assert you should get `actual, formal, formalGenericOrigin`
09:09:16FromDiscord<Elegantbeef> Actual being what's passed, formal what's expected and formalGenericOrigin likely the root generic type
09:09:43FromDiscord<Elegantbeef> I foresee some inheritance issue
09:11:28FromDiscord<sOkam!> thats a bit better at least`MeshIndices:ObjectType MeshAttribute:ObjectType MeshAttribute[new.T]`
09:11:31FromDiscord<sOkam!> its something
09:11:41FromDiscord<sOkam!> (edit) "least`MeshIndices:ObjectType" => "least `MeshIndices:ObjectType"
09:12:02FromDiscord<Elegantbeef> Does Indices inherit from Attribute?
09:12:39FromDiscord<sOkam!> no, it inherits from component
09:12:48FromDiscord<Elegantbeef> Well there you go
09:13:09FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wvc
09:13:12FromDiscord<Elegantbeef> You have a `new` that expects `Attribute` getting `Indices`
09:13:43FromDiscord<sOkam!> oh, but indices doesn't have a parameter. its generic without [T] 🤦‍♂️
09:13:59FromDiscord<sOkam!> could explain it
09:14:04FromDiscord<Elegantbeef> That's technically fine
09:14:39FromDiscord<Elegantbeef> Just means `MeshAttrType` is a generic
09:14:39FromDiscord<Elegantbeef> you can do `type MeshAttrType = (ref or seq or ptr)`
09:14:57FromDiscord<Elegantbeef> I'd assume the issue is you have a new that's like `proc new(_: typedesc[MeshAttrType], ...)`
09:14:59FromDiscord<Elegantbeef> or similar
09:15:04FromDiscord<sOkam!> ye
09:15:13FromDiscord<sOkam!> was trying to match both supertypes
09:15:21FromDiscord<Elegantbeef> Try `proc new[T:MessAtrrType](_: typedesc[T]`
09:15:22FromDiscord<sOkam!> because the inner syntax is literally the same
09:15:39FromDiscord<Elegantbeef> These are subtly different
09:15:40FromDiscord<sOkam!> will do ✍️
09:15:59FromDiscord<Elegantbeef> Now if you didnt write code with such inane shorthand aliases
09:16:43FromDiscord<sOkam!> where is the shorthand alias here? 🤔
09:16:49FromDiscord<Elegantbeef> `u64`
09:16:52FromDiscord<sOkam!> ah
09:17:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wve
09:18:05FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wvf
09:18:12FromDiscord<sOkam!> thats the only place where i use that type
09:18:39FromDiscord<Elegantbeef> I mean it's' saying the parameter is `new.T`
09:18:47FromDiscord<sOkam!> i figure i should just be using the base type, instead of aliasing though
09:19:03FromDiscord<Elegantbeef> Yes `MeshComponent` is better
09:19:07FromDiscord<Elegantbeef> You can overload if neccesary
09:19:23FromDiscord<Elegantbeef> Though with generics you might need to do `[T: MeshComponent]`
09:19:43FromDiscord<Elegantbeef> Anyway too late for me to attempt to reason this error into existence, if you can do minimise it 😄
09:21:58FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wvh
09:21:59FromDiscord<sOkam!> back to the same 🤔
09:22:25FromDiscord<sOkam!> sent a code paste, see https://paste.rs/73pkD
09:23:24FromDiscord<Elegantbeef> Like I said there is a `new` getting a `MeshIndices` somewhere
09:26:20FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wvi
09:27:29FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4wvi" => "https://play.nim-lang.org/#ix=4wvj"
09:31:55FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wvl
09:40:19FromDiscord<sOkam!> the day im able to read i'll make a celebration party, i swear ⚰️ https://media.discordapp.net/attachments/371759389889003532/1110502460520415302/image.png
09:41:45FromDiscord<sOkam!> MeshIndices was indeed not specifying [T] in its new proc. i was just getting confused by that dat-data typo
09:42:44FromDiscord<sOkam!> In reply to @Elegantbeef "Once you get it": Should I report this as a bug in the Nim's repo?↵Seems like this information should be there in some way, instead of just blindly crashing 🤔
09:42:59FromDiscord<sOkam!> (edit) "In reply to @Elegantbeef "Once you get it": Should I report this as a bug in the Nim's repo?↵Seems like this information should be there in some way, instead of just blindly crashing ... 🤔" added "on that assert"
09:54:36*nanxiao quit (Quit: Client closed)
09:54:54om3gaIs it safe to use deallocHeap(runFinalizers = true, allowGcAfterwards = true) ?
09:58:12om3gaoh man, it will not help...
09:59:21om3gaThe only way seems for me is to switch on manual memory management... unfortunately
10:34:03NimEventerNew Nimble package! nico_font_tool - A tool for converting fonts to NICO Game Framework format fonts., see https://github.com/TakWolf/nico-font-tool
10:41:30*krux02 joined #nim
11:11:46*derpydoo quit (Read error: Connection reset by peer)
11:55:10FromDiscord<Sh1be> In reply to @Rika "Maybe it would be": yes, in nim if that's possible↵would be a good exercise nonetheless and you could add your own features as well
11:55:25FromDiscord<Sh1be> I should get into reading as well
13:28:51*Notxor quit (Remote host closed the connection)
13:49:59*ntat quit (Remote host closed the connection)
13:51:12*ntat joined #nim
14:05:45*progranner joined #nim
14:16:27*PMunch quit (Quit: Leaving)
14:18:28*ntat quit (Remote host closed the connection)
14:18:47*ntat joined #nim
14:25:58*ntat quit (Remote host closed the connection)
15:03:59*Notxor joined #nim
15:12:36*dza quit (Quit: Ping timeout (120 seconds))
15:14:35*dza joined #nim
15:19:28NimEventerNew Nimble package! perceptual - A library for computing and comparing perceptual hashes in Nim, see https://github.com/deNULL/perceptual
15:32:06*krux02_ joined #nim
15:53:15FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wwK
16:10:58FromDiscord<Saint> Does anyone know if there is treesitter support for nim?
16:12:38FromDiscord<JJ> yes
16:13:10FromDiscord<JJ> aMOPel/tree-sitter-nim and alaviss/tree-sitter-nim
16:14:24FromDiscord<Saint> Ty very much
16:18:20*arkurious joined #nim
16:23:02*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:24:05*progranner joined #nim
16:25:10*progranner quit (Client Quit)
16:32:19*progranner joined #nim
16:48:53*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:49:57*progranner joined #nim
17:00:32*arkurious quit (Quit: Leaving)
17:05:32*Notxor quit (Remote host closed the connection)
17:06:22*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:08:25FromDiscord<System64 ~ Flandre Scarlet> What is that? https://media.discordapp.net/attachments/371759389889003532/1110615228821012582/message.txt
17:13:58FromDiscord<demotomohiro> It seems your program calls proc recursively.
17:16:14*rockcavera joined #nim
17:17:09*progranner joined #nim
17:18:49*progranner quit (Client Quit)
17:20:31NimEventerNew thread by IvanS: How to create modular program (like main with future addons) ?, see https://forum.nim-lang.org/t/10220
17:21:52*progranner joined #nim
17:38:57FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wx4
17:39:40FromDiscord<sOkam!> I would use a proc, but i need the pointers created in the template to be alive after the template finishes
17:56:13FromDiscord<treeform> Am I dumb, does Nim not have a `func delete/remove[T](s: var seq[T]; element: T)`?
18:05:33FromDiscord<Chronos [She/Her]> Okay so I'm going to be using Python to a project but I definitely want to end up switching it to Nim, Python just makes it easier to prototype stuff, would Nimpy be suitable for this or would it be better to do a full rewrite?
18:09:09FromDiscord<jtv> @treeform Yes, it does, but in the sequtils module
18:12:31*Notxor joined #nim
18:28:15*noeontheend quit (Remote host closed the connection)
18:28:15*mronetwo quit (Remote host closed the connection)
18:28:16*casaca quit (Write error: Connection reset by peer)
18:28:16*henrytill quit (Remote host closed the connection)
18:28:17*adigitoleo quit (Remote host closed the connection)
18:28:22*oddish quit (Remote host closed the connection)
18:29:49*adigitoleo joined #nim
18:30:03FromDiscord<sOkam!> How do you make a variable inside a template accessible outside of the template?↵I'm using `{.inject.}`, but the code is complaining of that injected variable not existing
18:30:04*mronetwo joined #nim
18:30:04*oddish joined #nim
18:31:03*noeontheend joined #nim
18:31:07FromDiscord<Elegantbeef> inject is correct
18:31:33*henrytill joined #nim
18:31:37*casaca joined #nim
18:32:39FromDiscord<Elegantbeef> You also can mark the template `{.dirty.}`
18:32:41FromDiscord<Elegantbeef> Works just fine
18:32:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wxk
18:33:27FromDiscord<sOkam!> why could it be complaining about it not existing, though?
18:34:17FromDiscord<jtv> It's probably some other problem leading to that.
18:35:04FromDiscord<sOkam!> oh a problem inside the template itself. that could be
18:50:57FromDiscord<treeform> In reply to @jtv "<@107140179025735680> Yes, it does,": Sorry, I am dumb, can you link it to me? I am only finding the index version not the element version?
18:51:12FromDiscord<mratsim> In reply to @sOkam! "How do you make": When there is an error in template or macro, there is often"foo is undefined" because due to the error, the template/macro cannot define foo
18:51:32FromDiscord<Elegantbeef> There is no `deleteFirst`
18:52:04FromDiscord<jtv> Oh, I thought deleting by index solved your issue. First one is index 0 😉
18:52:19FromDiscord<mratsim> In reply to @treeform "Sorry, I am dumb,": Maybe find in std/algorithm + delete by index
18:53:31FromDiscord<Elegantbeef> there is a find already
18:54:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wxq
19:31:59*Notxor quit (Ping timeout: 240 seconds)
19:42:34*Notxor joined #nim
20:13:51*tiorock joined #nim
20:13:52*tiorock quit (Changing host)
20:13:52*tiorock joined #nim
20:13:52*rockcavera quit (Killed (copper.libera.chat (Nickname regained by services)))
20:13:52*tiorock is now known as rockcavera
20:37:40FromDiscord<ranok (Jacob Torrey)> Is there a way to check if the dom document.getElementById() returns a jsNull?
20:37:54FromDiscord<ranok (Jacob Torrey)> perhaps .isnil?
21:00:10FromDiscord<Arathanis> In reply to @ranok (Jacob Torrey) "perhaps .isnil?": yes
21:16:24*lucasta joined #nim
21:27:56FromDiscord<guttural666> how do I escape this bad boy here? https://media.discordapp.net/attachments/371759389889003532/1110680538508955739/image.png
21:28:15FromDiscord<guttural666> should be a char '
21:29:59FromDiscord<guttural666> Error: invalid order in enum 'squote'
21:30:07FromDiscord<Arathanis> In reply to @guttural666 "how do I escape": its because enums need ot be ordered
21:30:24FromDiscord<Arathanis> `'`is lexicographically before `m` and `t`
21:30:30FromDiscord<Arathanis> move it above `move`
21:30:52FromDiscord<guttural666> don't ask what do can do for your compiler, ask what the compiler can do for you
21:31:24FromDiscord<sOkam!> how do you check that all fields of an object (with arbitrary content) are aligned to a certain value?
21:31:26FromDiscord<guttural666> wtf, why is that a thing
21:31:53FromDiscord<sOkam!> In reply to @guttural666 "wtf, why is that": probably because characters are just numbers, and enums are based on numbers
21:32:24FromDiscord<guttural666> thought the assignment was just an alias for the actual numbers
21:32:45FromDiscord<guttural666> but now I understand
21:33:14FromDiscord<Arathanis> i think Enum's have to be ordinal and they must be in order
21:33:23FromDiscord<guttural666> enum, first = "pls" will do the same thing then? seems string aliases are fine? they don't complain
21:33:40FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/1110681980745551982/image.png
21:34:13FromDiscord<guttural666> In reply to @Arathanis "": yeah now this makes sense, still I think the compiler should just do the stupid stuff for me
21:34:23FromDiscord<Arathanis> you could make a macro that does this!
21:34:54FromDiscord<guttural666> In reply to @Arathanis "you could make a": probably yeah haha, you could do anything with a macro 😛
21:34:58FromDiscord<Arathanis> there might be some edge case that prevents reordering by the compiler from making sense
21:35:05FromDiscord<Arathanis> In reply to @guttural666 "probably yeah haha, you": you could even write a macro!
21:35:09FromDiscord<sOkam!> In reply to @guttural666 "yeah now this makes": that would be implicit functionality, specially one thats hidden behind a compiler. i'd rather not become cpp-like 🙈
21:35:36FromDiscord<Arathanis> In reply to @sOkam! "that would be implicit": you dont like precision lasers taped to unruly donkeys?
21:35:56FromDiscord<guttural666> with other words I'm just a stupid noob and don't know the basics, I humbly accept the rebuke xDD
21:36:06FromDiscord<sOkam!> In reply to @Arathanis "you dont like precision": you bring a fair point. i do like those. gotta revisit my lang choices 😔
21:36:08FromDiscord<sOkam!> 😄
21:36:28FromDiscord<guttural666> get it, thanks for the explanation 🥰
21:37:21FromDiscord<guttural666> wonder how Nim deals with strings then though
21:37:53FromDiscord<guttural666> string aliases for enum vals that is, never had a problem with those
21:37:57FromDiscord<sOkam!> ordered pointers, maybe? 🤔↵actually dont know, but might make sense
21:39:40FromDiscord<guttural666> yeah, order by pointers to const string data? should be compile time known
21:40:24FromDiscord<guttural666> interesting
21:41:47FromDiscord<guttural666> this works https://media.discordapp.net/attachments/371759389889003532/1110684023258362006/image.png
21:42:18FromDiscord<guttural666> char to "MOVE" seems to be a big boy
21:55:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wxZ
21:56:29FromDiscord<guttural666> would be a map? or tuple
21:56:44FromDiscord<Elegantbeef> What?
21:56:46FromDiscord<Elegantbeef> It's an array
21:56:48FromDiscord<Elegantbeef> It says so right there
21:56:55FromDiscord<guttural666> array of...
21:57:06FromDiscord<Elegantbeef> constant strings
21:57:13FromDiscord<Elegantbeef> With which orc/arc are copy on write strings
21:57:31FromDiscord<huantian> da cows
21:57:41FromDiscord<Elegantbeef> Moo
21:58:44FromDiscord<Elegantbeef> In Nim it's generally best to just use enums as named ordinals then use enum indexed arrays for any relational data
21:58:48FromDiscord<Elegantbeef> In your case you could of course just rename the enums using the `name = ""` syntax
21:59:21FromDiscord<Elegantbeef> Using a string not character
21:59:29FromDiscord<Elegantbeef> Characters are ordinals so it takes the value of the character
22:01:12FromDiscord<guttural666> In reply to @Elegantbeef "Characters are ordinals so": think I understand that, so 'c' would be interpreted as a value between 0 and 255
22:01:24*advesperacit quit ()
22:01:56FromDiscord<Elegantbeef> Yes
22:02:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wy3
22:02:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wy4
22:03:08FromDiscord<Elegantbeef> `= string` renames the enum and is used for things like `$`, `= char` is no different to `= 0`
22:03:15FromDiscord<Elegantbeef> It sets the value for the enum
22:05:22*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
22:09:22FromDiscord<guttural666> makes sense, thanks!
22:09:35FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4wy6
22:09:50FromDiscord<guttural666> async?
22:10:20FromDiscord<Elegantbeef> I'd suggest using illwill or nimwave for a tui program
22:10:22FromDiscord<Elegantbeef> Nah you need to reopen stdin as async, it's a whole mess
22:10:36FromDiscord<Elegantbeef> Best just to use an existing solution
22:10:39FromDiscord<wick3dr0se> I tried async but it isn't simple for me lol
22:11:52FromDiscord<guttural666> stdin as async is also no longer available I think
22:12:35FromDiscord<guttural666> think I solved this with threads
22:13:33FromDiscord<Elegantbeef> Given you have a while loop I'm guessing you want to make a game or interactive program, so illwill and nimwave will be grand for you
22:13:47FromDiscord<wick3dr0se> Thats what I was thinking, putting it in a seperate thread.. I wasn't sure what is easiest. I'm not really wanting to use a full TUI framework like curses, illwill, notcurses, etc
22:14:37FromDiscord<Elegantbeef> Why not?
22:14:48FromDiscord<wick3dr0se> It's a snake game. It's stupid simple and I've already written it in bash. It'll be under 500 LOC finished
22:15:09FromDiscord<guttural666> listen to Elegantbeef, he knows what he's talking about
22:15:10FromDiscord<wick3dr0se> Its pretty much done other than needing to avoid waiting for the input
22:18:21FromDiscord<Elegantbeef> Aw shucks, people think I know things now↵(@guttural666)
22:18:37FromDiscord<wick3dr0se> I already wrote a small lib just for basic things that works for all 3 TUI's I'm writing. They are all super basic. I mainly just wrote this little library and documentation for myself rn, so I'll change stuff later if it grows. https://github.com/wick3dr0se/term
22:18:53FromDiscord<jtv> The most impressive TUI lib I've seen recently is actually in Python... textualize.io (and is OSS). I'm using it as a front end to some Nim stuff 🙂
22:19:10FromDiscord<jtv> It even does CSS for widgets
22:19:19FromDiscord<Elegantbeef> Really doing a lot of pointless meandering of taming the terminal
22:19:29FromDiscord<wick3dr0se> But I don't need something like curses. Raw ANSI escapes really aren't that hard to use and I know all the common ones
22:19:55FromDiscord<Elegantbeef> Then use illwill just for input
22:20:01FromDiscord<Elegantbeef> Or look at how it does input and copy that
22:20:02FromDiscord<Arathanis> In reply to @wick3dr0se "I already wrote a": asciimatics is also very good
22:20:47FromDiscord<Elegantbeef> Little known fact you can indeed do `from illwill import getKey, Key`
22:22:18FromDiscord<jtv> illwill was def my choice before I found textualize, which has saved a ton of time
22:22:20FromDiscord<guttural666> In reply to @Elegantbeef "Really doing a lot": think a lot of people want to learn an DIY
22:22:23FromDiscord<jtv> It's very nice
22:22:27FromDiscord<jtv> (illwill is)
22:22:48FromDiscord<Elegantbeef> Well then those people can look at illwill's getKeyAsync and copy paste it and say "I did it myself with this MIT license"
22:23:14FromDiscord<guttural666> In reply to @Elegantbeef "Well then those people": you know that's not the same 😛
22:24:00FromDiscord<jtv> I def commend people for wanting to explore under the hood, just would be nice for all if it were in more meaningful places
22:24:37FromDiscord<Elegantbeef> Yea don't get me wrong learning is great, but the question was "how do i get ch non blocking"
22:24:43FromDiscord<Elegantbeef> Use illwill is the simplest answer
22:25:07FromDiscord<Elegantbeef> If you want to learn how to do it yourself go search how to do it in C
22:25:10FromDiscord<jtv> Yeah, linux ptys are super complex
22:25:19FromDiscord<jtv> It's not even fun to do in C
22:25:36FromDiscord<Elegantbeef> Sure but it's easy to convert a C implementation to Nim
22:25:50FromDiscord<jtv> It's all complicated enough that there's a reason why no 'expect' library has ever been better than the original 'expect'
22:25:59FromDiscord<wick3dr0se> My entire GitHub is pointless meandering with the terminal really. All I did is write shit for fun that made Arch more simple to use for me. Just ended up evolving to an addiction of writing useless stuff. I like writing everything from scratch if possible but I try not to be to obsessive with it..
22:26:02FromDiscord<jtv> Sure, yes
22:26:41FromDiscord<jtv> Well, avoiding dependencies when possible does have some advantages. I can't say that isn't a consideration for me on most stuff.
22:27:54FromDiscord<guttural666> In reply to @wick3dr0se "My entire GitHub is": wasn't pointless if you learned something
22:29:22FromDiscord<Elegantbeef> I'm not one to talk really I'm writing a game from 'scratch' 😄
22:31:31FromDiscord<Elegantbeef> I say 'scratch' cause it's mostly gluing sdl2 + opengl + miniaudio + assimp like a pretend from scratch dev
22:32:02FromDiscord<wick3dr0se> That was my obsession with using bash. Just because it's usually installed but the limitations and performance are hard to get over. I put the snake game as the first public project for an org I made if you guys want to see how simple it is https://github.com/opensource-force/snake
22:32:17FromDiscord<wick3dr0se> That's way beyond anything I could ever do
22:32:48*Notxor quit (Remote host closed the connection)
22:34:41FromDiscord<Elegantbeef> ps you ca do `rand(1 .. cols - 1)`
22:35:41FromDiscord<Elegantbeef> \Also challenge you to remove `snakeX`/`snakeY` and to only use integers for positions 😄
22:35:50FromDiscord<wick3dr0se> Sweet. I was wondering if there was a way to not start from 0
22:36:44FromDiscord<wick3dr0se> That def sounds challenging rn lol. I have to think about that for a min
22:37:38FromDiscord<wick3dr0se> I have to also consider how I'm going to pass the last direction back to getch() or some other way so the snake keeps moving on it's own. Was much easier in bash lol
22:37:46FromDiscord<Elegantbeef> https://www.jasonbeetham.com/snake/nicoscripter.html this version of snake does that(code on right so only look at the game window) 😄
22:38:08FromDiscord<Elegantbeef> It's simpler if you do not use `continue`
22:38:46FromDiscord<Elegantbeef> `keyMap` could return the input where input is `type Input enum nothing, left, right, up, down`
22:40:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wyf
22:41:05FromDiscord<jmgomez> In reply to @Elegantbeef "https://www.jasonbeetham.com/snake/nicoscripter.htm": quite cool that you can change the code, you would get an A+ if you would added syntax highlighting to it though 😛
22:41:30FromDiscord<Elegantbeef> Damn an A+ I've never seen that!
22:41:49FromDiscord<guttural666> In reply to @Elegantbeef "I say 'scratch' cause": Vulkan nao
22:41:51FromDiscord<Elegantbeef> If only I didnt have 30000 different projects juan
22:41:59FromDiscord<Elegantbeef> Fuck using vulkan directly
22:42:10FromDiscord<Elegantbeef> Modern opengl is capable as fuck and fun to use
22:42:54FromDiscord<guttural666> In reply to @Elegantbeef "Modern opengl is capable": gotta go fast brrrrr
22:42:56FromDiscord<wick3dr0se> I was thinking how I could use types for left, right, up, down. Just couldn't figure in how I'd make use of it. The keys returning both char and string make things difficult. Originally I made it return chars as string type but I took it out to avoid using the wrong types lol
22:43:17FromDiscord<Elegantbeef> I mean vulkan doesnt inherently go any faster than modern opengl
22:43:18FromDiscord<jmgomez> In reply to @Elegantbeef "If only I didnt": I know, jk. Cool stuff. Do you picture yourself finishing the game any time soon? I feel like you are closer than me though
22:43:30FromDiscord<Elegantbeef> Yes it can be multi-threaded, yes it encourages better design.... but cmon, it's not magic
22:43:36FromDiscord<guttural666> In reply to @Elegantbeef "I mean vulkan doesnt": doesn't it? I think it did
22:43:59FromDiscord<Elegantbeef> The examples of it going faster are done by people that could also likely get good performance from opengl
22:44:12FromDiscord<Elegantbeef> Modern opengl has plenty of features that makes it capable
22:44:25FromDiscord<Elegantbeef> Like my gui is rendered in a single drawcall
22:44:29FromDiscord<Elegantbeef> without uniforms
22:44:38FromDiscord<guttural666> yeah yeah, Doom go fast because they know wtf they are doing but I thought it had inherent perf advantages
22:44:58FromDiscord<Elegantbeef> It's comparing oranges to potatoes imo
22:45:26FromDiscord<guttural666> oh god, "modern opengl" sounds like those "modern C++" talks, GTFO 😄
22:45:45FromDiscord<guttural666> the latter trying to turn a turd into gold
22:45:45FromDiscord<Elegantbeef> I mean most opengl you hear and read about is 3.3
22:46:20FromDiscord<Elegantbeef> My gui uses 0 uniforms to render, it's simply making an SSBO and sending it to the gpu
22:47:27FromDiscord<Elegantbeef> Opengl is completely sufficient to make a game, and it's not like my game needs to run faster thank 10kfps
22:48:01FromDiscord<guttural666> gotta go AFAP as fast as possible at any time
22:48:16FromDiscord<guttural666> 😛
22:48:17FromDiscord<Elegantbeef> Yea need to really tear across my 60hz panel
22:48:44FromDiscord<guttural666> attitude like that gives me sluggish Teams performance at my job, cmon dude
22:48:53FromDiscord<Elegantbeef> If you cannot see screen tearing are you even rendering
22:48:56FromDiscord<Elegantbeef> Lol
22:49:16FromDiscord<guttural666> the fastness has to be blazing or it is not fast
22:49:22FromDiscord<Elegantbeef> Who knows, I don't even know what finishing my game looks like 😄↵(@jmgomez)
22:51:54FromDiscord<jmgomez> In reply to @Elegantbeef "Who knows, I don't": I feel you
22:52:34FromDiscord<wick3dr0se> In reply to @Elegantbeef "Who knows, I don't": Although I enjoy learning things as I go; Feel free to play with mine lmao
22:52:42FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4wyk
22:52:43FromDiscord<Elegantbeef> This does remind me I havent @Dudugz to annoy about "when you making that sdl2 ui, I already made one"
22:52:57FromDiscord<Elegantbeef> juan if you show me cpp generated code again I might say hurtful names
22:53:46FromDiscord<jmgomez> I mean, it's pretty much the same for C 👀
22:54:11FromDiscord<Elegantbeef> Well I only do semantic analysis code
22:55:18FromDiscord<jmgomez> will bother you more down the road them 😛
22:55:31FromDiscord<Elegantbeef> Fuuuuck
22:55:44FromDiscord<jmgomez> (edit) "them" => "then"
23:18:00FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4wyq
23:18:51FromDiscord<Ayy Lmao> Say I wanted to split up user implementation and api implementation into different files, and perhaps have the user do an import and then be able to define some functions.
23:19:59FromDiscord<Elegantbeef> Generic interfaces perhaps
23:20:21FromDiscord<Chronos [She/Her]> Doesn't the streams module do this?
23:20:58FromDiscord<Ayy Lmao> In reply to @Elegantbeef "Generic interfaces perhaps": I'm not sure what that would look like, can you go into more detail?
23:21:26FromDiscord<Elegantbeef> https://www.jasonbeetham.com/codereuse.html
23:21:40FromDiscord<Elegantbeef> Scroll down to `Unconstrained generics`
23:21:53FromDiscord<Elegantbeef> Nimib still doesnt create linkable headers
23:21:55FromDiscord<Elegantbeef> Te animals!
23:24:23FromDiscord<Ayy Lmao> Ok I need to take some time and digest this page. Looks like a lot of interesting stuff.
23:26:05FromDiscord<Elegantbeef> Practically generic interfaces allow you to statically include code inside of a procedure declared in another module
23:27:46FromDiscord<Ayy Lmao> That sounds like what I am looking for.
23:29:17FromDiscord<Ayy Lmao> What would you do in the case where there could be more than one type of user plugin in my example? I might not try to do that but I am just curious.
23:29:37FromDiscord<Elegantbeef> Same thing
23:29:55FromDiscord<Ayy Lmao> Don't you need dynamic dispatch though?
23:30:04FromDiscord<Ayy Lmao> Or is it possible to somehow statically dispatch it?
23:30:06FromDiscord<Elegantbeef> Wait there'd still be only a single entry
23:30:20FromDiscord<Ayy Lmao> Yeah one entry with multiple plugin types
23:30:30FromDiscord<Elegantbeef> Hmmm
23:30:33FromDiscord<Ayy Lmao> Ideally it would be statically dispatched but I have no idea how
23:30:38FromDiscord<Elegantbeef> Object variant I guess would be best
23:31:15FromDiscord<Ayy Lmao> I might for the sake of sanity just not do multiple plugins in the same dll though.
23:32:26FromDiscord<Ayy Lmao> Do you actually use concepts?
23:32:37FromDiscord<Elegantbeef> Yes
23:32:41FromDiscord<Ayy Lmao> The last time I tried I was running into tons of compiler bugs but that was a while ago
23:35:37FromDiscord<Ayy Lmao> So are you suggesting to make the `cdecl` functions in my example generic?
23:35:45*jmdaemon joined #nim
23:35:46FromDiscord<Ayy Lmao> I'm not sure what needs to be generic
23:40:29FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4wyu
23:42:24FromDiscord<Elegantbeef> To the concept remarks. https://github.com/beef331/gooey/ uses concepts to make itself pretty much fully agnostic
23:42:39FromDiscord<Elegantbeef> You can technically use the stuff declared there with any graphics library or rendering backend
23:47:14FromDiscord<Ayy Lmao> Thank you for the example. I'll try to see if I can adapt that to work how I want. I'll study your gui code too, that's something I'm interested in.
23:47:43FromDiscord<Elegantbeef> Still dont know if I'd call it GUI code. Really on the fence what it is really
23:47:55FromDiscord<Ayy Lmao> Can you try to drill into my head what mixin actually does? It's not clicking for me for some reason.
23:47:59FromDiscord<Elegantbeef> It's probably a primitive layout engine and GUI scaffold 😄
23:48:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wyv
23:49:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wyw
23:49:38FromDiscord<Elegantbeef> Whoops `doThing(10)`
23:50:01FromDiscord<Ayy Lmao> So you can do it without a generic too?
23:50:17FromDiscord<Elegantbeef> Except without a generic means it binds to any procedure
23:50:24FromDiscord<Elegantbeef> And you still need it to be a generic
23:50:32FromDiscord<Elegantbeef> `a: auto` makes the proc a generic
23:51:03FromDiscord<Ayy Lmao> So is that shorthand for `proc doThing[T](a: T)`?
23:51:10FromDiscord<Elegantbeef> You also could use pointer procs and convert a raw pointer just like you did for this API if you really wanted to
23:51:11FromDiscord<Elegantbeef> Yes
23:52:59FromDiscord<Ayy Lmao> So mixin basically tells the compiler to look around in the calling scope for a definition
23:53:31FromDiscord<Elegantbeef> Yes
23:53:38FromDiscord<Ayy Lmao> I was doing this sort of thing with templates this whole time
23:53:44FromDiscord<Elegantbeef> Well both the scope of instantiation and declaration
23:53:56FromDiscord<Elegantbeef> There is an important note that the compiler only instantiates a generic once
23:54:11FromDiscord<Elegantbeef> So templates have to be used if you want every single scope to be a concern
23:54:34FromDiscord<Elegantbeef> Also I realise now that generics are sufficient for your multi plugin in a single DLL
23:54:39FromDiscord<Elegantbeef> So have fun
23:55:11FromDiscord<Ayy Lmao> Once per type right?
23:55:31FromDiscord<Elegantbeef> Yes
23:56:01FromDiscord<Ayy Lmao> Alright cool, this seems like it might be what I want.
23:58:12FromDiscord<Elegantbeef> Designing code around using this premise of "generic interface" really makes your code very reusable
23:58:55FromDiscord<Elegantbeef> Something you could do for your "multiple plugins per dll" is simply use a tuple
23:59:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wyy
23:59:31FromDiscord<Elegantbeef> Then you could have a `process` and the like for the specific tuples
23:59:53FromDiscord<Elegantbeef> This is basically what I do for my GUI to have statically typed collections that are ergonomic