<< 25-12-2020 >>

00:01:16*Q-Master quit (Ping timeout: 240 seconds)
00:03:00FromDiscord<Cohjellah> If you receive a message and it echo's to the terminal as you're writing a message in the input line, it'll print whatever is in the input line + the received message
00:03:13FromDiscord<shadow.> are you making a chat app?
00:03:16FromDiscord<Cohjellah> correct
00:03:20FromDiscord<shadow.> same thing happened w me lol
00:03:38FromDiscord<shadow.> tbh id just use something like `illwill` if i were you before you go too far down the stdout path
00:03:49FromDiscord<Cohjellah> illwill
00:03:50FromDiscord<Cohjellah> nani
00:03:51FromDiscord<shadow.> also, try netty instead
00:03:59FromDiscord<shadow.> udp > tcp imo lol
00:04:03FromDiscord<shadow.> https://github.com/johnnovak/illwill
00:04:08FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/791818522190807060/nim-mod-1.png
00:04:13FromDiscord<shadow.> easy console graphics
00:04:26FromDiscord<shadow.> you can just make a typing box at the bottom and have a scrollable chat
00:05:20FromDiscord<Cohjellah> Interesting
00:05:27FromDiscord<Cohjellah> I don't want it to go too crazy
00:05:39FromDiscord<Cohjellah> I legit just want my messages to not be overwritten by received messages
00:05:42FromDiscord<Cohjellah> that's all ahaha.
00:05:53FromDiscord<shadow.> well the way that console works that's not really possible
00:06:08FromDiscord<Cohjellah> Yeah so I'm making it "hacky"
00:06:12FromDiscord<ElegantBeef> I gave a solution 😛
00:06:15FromDiscord<shadow.> you did?
00:06:17FromDiscord<shadow.> im interested, what was it
00:06:22FromDiscord<Cohjellah> yeah I can't implement the solution because I am trying to read the input line
00:06:23FromDiscord<Cohjellah> but it's borked
00:06:26*Q-Master joined #nim
00:06:35FromDiscord<Cohjellah> and if i write line back to the input line, I can't backspace the line, it's fixed
00:06:54FromDiscord<shadow.> hm
00:06:55FromDiscord<Cohjellah> That was my original solution, but I don't know any of the commands ahaha
00:06:58FromDiscord<Cohjellah> I could use the getch
00:07:11FromDiscord<shadow.> actually i might make an illwill chat client rn tbh
00:07:12FromDiscord<Cohjellah> but that seems.... Really unnecessarily long but I'll do it if it's the only option in the end.
00:07:12FromDiscord<shadow.> lol
00:07:19FromDiscord<shadow.> fair enough
00:07:50FromDiscord<Cohjellah> So, how would I read the input line without actually printing it to the terminal
00:08:02FromDiscord<Cohjellah> actually, maybe I will just print it to the terminal, read the line, then delete the line but I Don't really know how to do that either.
00:08:08FromDiscord<Cohjellah> eraseline actually doesn't do anything for me for some reason
00:09:58FromDiscord<ElegantBeef> I showed you how 😄
00:10:39FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Jnv
00:11:07FromDiscord<ElegantBeef> hitting 'c' emulates recieving a message whilst typing
00:11:33*krux02 quit (Remote host closed the connection)
00:12:26FromDiscord<Cohjellah> hitting run gives me an EOF reached error
00:12:41FromDiscord<ElegantBeef> on nim playground, yes
00:12:43FromDiscord<Cohjellah> ahk
00:12:45FromDiscord<Cohjellah> gotcha
00:12:46FromDiscord<Cohjellah> sec
00:14:04*mbomba joined #nim
00:14:11FromDiscord<ElegantBeef> the double c is cause im dumb
00:14:21FromDiscord<shadow.> f
00:14:47FromDiscord<Cohjellah> this is
00:14:50FromDiscord<Cohjellah> nice that this works
00:15:01FromDiscord<Cohjellah> idk why write is broken for me but works in your case ahaha
00:15:07FromDiscord<Cohjellah> when I use write it makes the string unusable
00:15:30FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2JrF fixes the c double print
00:16:04FromDiscord<ElegantBeef> but thats just an issue for me using the simulated print
00:19:07FromDiscord<Cohjellah> Iiinteresting
00:19:18FromDiscord<Cohjellah> I'll try implement this into my loop here
00:19:25FromDiscord<Cohjellah> might just have to do it with this method
00:31:10*mbomba quit (Quit: WeeChat 3.0)
00:32:14FromDiscord<Cohjellah> So I need to do this on an individual thread, would I just spawn it on the getch()?
00:34:55FromDiscord<ElegantBeef> This can be done single threaded
00:38:42FromDiscord<ElegantBeef> Depending on how you're networking this, you just check if you received a message before getting input
00:39:06FromDiscord<ElegantBeef> If you got a message you use that recievedMessage proc then manage your input
00:39:38FromDiscord<ElegantBeef> Although.... getch() blocks, no?
00:42:57FromDiscord<Cohjellah> I'm using asyncnet and there's a separate proc that awaits a received message
00:43:07FromDiscord<Cohjellah> But currently I just use a spawned thread on readline
00:43:26FromDiscord<ElegantBeef> Ah since it's async it's not a big deal that getch blocks then eh?
00:43:27FromDiscord<Cohjellah> As the main loop
00:43:51FromDiscord<Cohjellah> Not really but idk. To be fair I kind of know what's up, but I am following the Nim In Action book and he threads the readline
00:44:00FromDiscord<Cohjellah> Unsure why if there's an await on receiving a message
00:44:14FromDiscord<Cohjellah> I suppose it would stop you typing or something? Idk
00:44:31FromDiscord<ElegantBeef> I dont know, havent used async much
00:44:54FromDiscord<Cohjellah> Nifty.
00:45:08FromDiscord<Cohjellah> Hmm I'll play around with threading and without and see what's up
00:45:22FromDiscord<Cohjellah> This has been a good learning experience.↵Kind of salty there's no way to store the current line lol
00:46:40FromDiscord<ElegantBeef> Like i said yesterday the issue i believe is that to do that it requires reading until the end of the file and without a `\0` all the stdlib file.read procs will freeze
00:47:23FromDiscord<ElegantBeef> I'm just guessing though 😄
00:50:18FromGitter<ynfle> What's the main difference between an `object` & a `tuple`?
00:50:29FromDiscord<ElegantBeef> You're lazy
00:51:00FromDiscord<ElegantBeef> Tuples are turned into C structs regardless so they're identical, just indexed differently
00:51:37FromDiscord<ElegantBeef> Although tuples can be unpacked so it's a nice return type for some procs
00:52:47FromGitter<ynfle> So what's the advatage other than the initilization syntax?
00:53:34*nyaa8 joined #nim
00:53:55FromDiscord<ElegantBeef> I think the main thing is that atleast anonymous tuples are just so darn easy to make 😄
00:54:32FromGitter<ynfle> What the advantage of using an objec
00:54:36FromGitter<ynfle> *object?
00:54:40FromGitter<ynfle> I guess inheritance?
00:55:15FromDiscord<ElegantBeef> Well compared to an anonymous tuple, named fields, inheritance, no mismatching
00:56:06FromDiscord<ElegantBeef> I rarely use tuples as it just feels lazy
00:56:49FromDiscord<ElegantBeef> For instance this is probably the most compelling reason i've ever had for a tuple
00:56:50FromDiscord<ElegantBeef> https://nim-lang.github.io/Nim/strscans.html#scanTuple.m%2Cuntyped%2Cstatic%5Bstring%5D%2Cvarargs%5Buntyped%5D
00:57:43FromDiscord<ElegantBeef> Unpacking them to variables is just some nice sugar
00:58:06FromGitter<ynfle> Or returning mutiple values from a recursive call
00:58:09FromDiscord<ajusa> Might be a really dumb question, but how can I turn a table into a sequence of tuples? I tried doing `myTable.pairs.toSeq` but that doesn't seem to compile, undeclared field pairs.
00:58:15FromGitter<ynfle> `var` params are just annoying
00:58:23FromDiscord<ajusa> (edit) "table" => "countTable"
00:58:37FromGitter<ynfle> @ajusa `toSeq(myTable.pairs)`
00:58:58FromDiscord<ElegantBeef> It's an issue that i think may be resolved eventually
00:59:22FromDiscord<ajusa> Thanks, that worked! I guess I can't chain that like I thought I could
00:59:26FromGitter<ynfle> @ajusa https://nim-lang.github.io/Nim/manual.html#templates-limitations-of-the-method-call-syntax This will help to explain why
00:59:33FromGitter<ynfle> It's unique to iterators
00:59:41FromGitter<ynfle> They can't be used in that way
01:00:16FromDiscord<ajusa> Cool, I learned something today!
01:00:42FromGitter<ynfle> 👍
01:03:33*not_lum quit (Quit: Lum: Bye!)
01:05:23*lum joined #nim
01:07:47*lum quit (Client Quit)
01:09:46*lum joined #nim
01:10:37FromDiscord<Cohjellah> Learning new things, and on Christmas too
01:10:38FromDiscord<Cohjellah> How jolly
01:11:09FromDiscord<ElegantBeef> It's not cringlesticks yet
01:11:09*lum quit (Client Quit)
01:11:37*lum joined #nim
01:11:39FromDiscord<Cohjellah> It is in upsidedown land
01:12:15FromDiscord<Cohjellah> Also with the notation ^ for threading. Does the thread sit on that spot until it's filled and the main thread does whatever in the meantime?
01:12:33FromDiscord<ElegantBeef> If getch is blocking yes 😄
01:12:38FromDiscord<Cohjellah> Ahahahhaha yep ok
01:12:50FromDiscord<Cohjellah> Fantastic. I actually learnt more doing it your way than what I was thinking
01:12:58FromDiscord<Cohjellah> Introduced me to new things. Thanks for that btw
01:13:10FromDiscord<Cohjellah> I probably sounded a little grumpy yesterday, just bad sleep. Cheers though!
01:13:26FromDiscord<ElegantBeef> Eh, didnt notice
01:13:30FromDiscord<Cohjellah> Ez
01:13:48FromDiscord<Cohjellah> God Nim is damn nice. Hoping it catches on so bad - that's my wish for 2021 ty
01:14:49FromDiscord<ElegantBeef> We need to embed it into corona so it surefire catches on
01:16:44FromDiscord<Cohjellah> Pump it into the vaccine
01:16:47FromDiscord<Cohjellah> That's sure to work
01:17:10FromDiscord<Cohjellah> Into the chips Bill Gates is inserting. Upload straight to the neurons that Nim is the shit
01:19:34*lum quit (Quit: Lum: Bye!)
01:22:36*lum joined #nim
01:24:10*lum quit (Client Quit)
01:24:31FromDiscord<ElegantBeef> Well the things Nim really needs to take off is better tooling and less unreadable errors 😛
01:26:51FromDiscord<ElegantBeef> Both of which i believe are getting worked on afaik
01:27:17*lum joined #nim
01:27:50FromDiscord<Cohjellah> Better tooling, like?
01:28:00FromDiscord<ElegantBeef> Less crashing nimsuggest
01:28:12FromDiscord<ElegantBeef> Less resource hogging nimsuggest
01:28:34*lum quit (Client Quit)
01:28:52*lum joined #nim
01:29:35*lum quit (Client Quit)
01:31:45FromDiscord<Quibono> Readable errors would be delightful
01:31:52FromDiscord<ElegantBeef> Yea i'm on it 😛
01:32:17FromDiscord<ElegantBeef> Already got a measurable improvement https://media.discordapp.net/attachments/371759389889003532/791840708549017640/unknown.png
01:33:08FromDiscord<ElegantBeef> I dont feel like the errors are really that bad, more just hard to parse
01:34:43FromDiscord<ElegantBeef> plus there is `--hint:source` which is very nice
01:52:32FromDiscord<exelotl> does copyNimNode produce a shallow copy of the node?
01:52:55FromDiscord<exelotl> (i.e. doesn't clone the whole tree? just the top level node)
01:53:29FromDiscord<ElegantBeef> I assume since there is also a copyTree that it only does the single node
01:54:43FromDiscord<exelotl> hmm that'd be good
01:57:39FromDiscord<ElegantBeef> Yep only that node
01:59:01FromDiscord<exelotl> that's perfect, I should submit some docs for it 😅
01:59:18FromDiscord<ElegantBeef> Yep you should
02:03:52FromDiscord<exelotl> tomorrow :P
02:15:02*klaufir_ quit (Ping timeout: 265 seconds)
02:16:21FromDiscord<Deleted User 5bd78114> And tomorrow never comes -
02:17:44*lum joined #nim
02:18:06FromDiscord<Avatarfighter> Happy holidays everyone thanks for making this year enjoyable 🙂
02:19:16FromDiscord<ElegantBeef> Where's my present?
02:20:26FromDiscord<Deleted User 5bd78114> It's me being here for once-
02:20:36FromDiscord<ElegantBeef> Ah i'd like a reciept
02:20:52FromDiscord<Deleted User 5bd78114> Fair enough I also want a refund on my wasted life
02:21:03FromDiscord<Deleted User 5bd78114> But beggars can't be choosers now can they-
02:21:21FromDiscord<ElegantBeef> Oh it's you
02:21:33FromDiscord<ElegantBeef> Hello
02:21:39FromDiscord<Deleted User 5bd78114> Pfft-
02:21:44FromDiscord<Deleted User 5bd78114> Hi
02:23:29FromDiscord<Deleted User 5bd78114> This is awkward now-
02:24:39FromDiscord<Deleted User 5bd78114> Welp, anyway is it possible to make a Minecraft plugin in Nim somehow?
02:27:41Prestigehow do you normally make a minecraft plugin?
02:28:04FromDiscord<Deleted User 5bd78114> Java -
02:28:08FromDiscord<Rika> what is a minecraft plugin
02:28:16FromDiscord<Deleted User 5bd78114> I know there's a way to call the JVM from Nim
02:28:19FromDiscord<Rika> do you mean a spigot plugin or a minecraft mod
02:28:33FromDiscord<Deleted User 5bd78114> A spigot plugin
02:30:04FromDiscord<Deleted User 5bd78114> I'm thinking that it'd probably have to have a loaded made in java that loads Nim .so/dll files
02:30:32FromDiscord<Deleted User 5bd78114> Then I'd also have to find a way to expose specific functions, but I have no idea how to dp.that-
02:32:43FromDiscord<ElegantBeef> Nisha back at it again, trying to abuse Nim 😛
02:33:03FromDiscord<Deleted User 5bd78114> Also excuse my spellig.and grammar mistakes, I'm using my sister's kindle.fire.7 to code-
02:33:06FromDiscord<ElegantBeef> Doesnt Java have a CFFI so it'd be identical
02:33:16FromDiscord<Deleted User 5bd78114> Thank you :3and
02:33:40FromDiscord<ElegantBeef> mark your exposed procs with `exportC` then you should be able to call the Nim code from the jvm if it's anything like C#
02:33:49FromDiscord<Deleted User 5bd78114> And yeah it does
02:34:10FromDiscord<Deleted User 5bd78114> Thanks, but I'm struggling because.I have no idea how I'd actually make it do stuff-
02:34:24FromDiscord<Deleted User 5bd78114> I can use the file, sure
02:34:24FromDiscord<Rika> why the fuck do you use the most RANDOM of devices to program in
02:34:44FromDiscord<ElegantBeef> Oh shut up programming keyboard 😉
02:34:52FromDiscord<Rika> smh lmao
02:35:01FromDiscord<Rika> i can program just not accurately
02:35:15FromDiscord<Deleted User 5bd78114> Because this is my talent UvU
02:35:18FromDiscord<ElegantBeef> It's an upgrade from nisha using their phone
02:35:33FromDiscord<Rika> i'll be impressed if you could somehow get to program on a convenience store atm
02:36:57FromDiscord<Deleted User 5bd78114> DON'T TEMPT ME-
02:37:16FromDiscord<Deleted User 5bd78114> I'LL EVEN USE DISCORD ON IT TOO-
02:37:24FromDiscord<Rika> do it
02:37:30PrestigeHow do you end up with - at the end of each sentence
02:37:38FromDiscord<Rika> totallynotaploytogettechnishaarrested
02:37:49FromDiscord<Rika> prestige it is for emphasis
02:37:52FromDiscord<Deleted User 5bd78114> XD
02:38:05FromDiscord<Deleted User 5bd78114> ^^^ Yup
02:38:12Prestigeoh, just looks weird
02:38:23FromDiscord<ElegantBeef> You look weird yet no one he was pointing it out
02:38:26FromDiscord<Deleted User 5bd78114> It's to basically show the fact I'm giggling my ass off-
02:38:34FromDiscord<Deleted User 5bd78114> XD
02:38:48Prestige- means giggling?
02:38:59FromDiscord<ElegantBeef> Apparently, new age abbreviation
02:39:02FromDiscord<Deleted User 5bd78114> It's because I'm a roleplayer so I make EVERY message show emotion-
02:39:13FromDiscord<Deleted User 5bd78114> No it depends on the context-
02:39:26FromDiscord<Deleted User 5bd78114> What do you mean?
02:39:42FromDiscord<ElegantBeef> - is the new version of lol, clearly
02:39:51FromDiscord<Deleted User 5bd78114> Oh-
02:40:02FromDiscord<Deleted User 5bd78114> also that was an example of context
02:40:20PrestigeWeird lol
02:40:43FromDiscord<Deleted User 5bd78114> "Oh-" as in something I didn't know "I WILL DO IT DON'T TEMPT ME-" shows I'm actual psychopath
02:41:05FromDiscord<Deleted User 5bd78114> That
02:45:02FromDiscord<Deleted User 5bd78114> So what are some good libraries for working with the JVM in Nim? Everything is pain on this tablet
02:45:12FromDiscord<Deleted User 5bd78114> It's slow and laggy as duck and barely works-
02:45:30FromDiscord<Deleted User 5bd78114> Not to mention AUTOCORRECT
02:45:38FromDiscord<ElegantBeef> For Java calling nim, there is none, just make a system library
02:45:48FromDiscord<ElegantBeef> For nim calling java you have jnim
02:46:22FromDiscord<Deleted User 5bd78114> Thanks!
02:47:25FromDiscord<Deleted User 5bd78114> I wonder if it's possible to get the JVM to send functions and Java types to Nim directly
02:47:42FromDiscord<Deleted User 5bd78114> I'll figure it out and probably make a shifty lib for it
02:47:48FromDiscord<ElegantBeef> Again that's just using the C ffi
02:47:53FromDiscord<Deleted User 5bd78114> Shitty
02:48:07FromDiscord<Deleted User 5bd78114> I'm stupid -
02:48:16FromDiscord<Deleted User 5bd78114> My sleep deprivation is getting to me
02:49:11FromDiscord<ElegantBeef> You could always make a macro to output java classes for you to use to make it a bit less tedious
02:49:30FromDiscord<Deleted User 5bd78114> Hmm, thanks!
02:49:55FromDiscord<Deleted User 5bd78114> I'll probably leave it until I can actually get back to my PC-
02:52:21FromDiscord<Deleted User 5bd78114> Since I'm already in enough pain
02:58:46FromDiscord<Chimyx> sent a code paste, see https://play.nim-lang.org/#ix=2Jsa
02:59:19FromDiscord<ElegantBeef> single lining like that isnt nice to read
03:00:26FromDiscord<ElegantBeef> sent a code paste, see https://paste.rs/5Mj
03:00:40FromDiscord<Chimyx> yeah, makes sense
03:00:49FromDiscord<ElegantBeef> Also it's Nim, not Vim 😛
03:01:32FromDiscord<Chimyx> lol, my muscle memory isn't used to typing nim yet
03:02:45FromDiscord<Chimyx> well thanks for your answer 😉
03:58:52*muffindrake quit (Ping timeout: 260 seconds)
03:59:12FromDiscord<Deleted User 5bd78114> Now I'm curious if Minecraft mods in Nim are feasible-
03:59:18FromDiscord<Deleted User 5bd78114> Would people use it?-
03:59:39FromDiscord<Deleted User 5bd78114> And how the fuck would it even work -
04:00:22FromDiscord<Rika> i believe someone tried already
04:00:25FromDiscord<Rika> i do not know who
04:00:50FromDiscord<Deleted User 5bd78114> Oh crap really?
04:00:53FromDiscord<Deleted User 5bd78114> Welp
04:00:57*muffindrake joined #nim
04:01:10FromDiscord<Deleted User 5bd78114> Time to reinvent the broken and old wheel!-
04:01:24FromDiscord<Deleted User 5bd78114> I don't know don't judge me I'm sleep-drunk
04:02:38FromDiscord<Rika> dont worry you sound too young to be drunk
04:02:50FromDiscord<Deleted User 5bd78114> I'm 16-
04:02:56FromDiscord<Deleted User 5bd78114> Just two years -
04:03:15FromDiscord<Deleted User 5bd78114> I might as well get drunk for the giggles in school- (jk)
04:03:46FromDiscord<Deleted User 5bd78114> (edit) "I might as well get drunk for the ... giggles" added "shits and"
04:04:41FromDiscord<Rika> 4 years in a certain country
04:05:03FromDiscord<Deleted User 5bd78114> Anyway, the main issues I can think of is now would think of are:↵ - The structure of the code↵ - And the dependencies
04:05:48FromDiscord<Deleted User 5bd78114> For example if I wanted to use Thaumcraft in my Nim mod for some godforsaken reason
04:07:40FromDiscord<Deleted User 5bd78114> And if I wanted to hook into Forge's RF System
04:08:01FromDiscord<Deleted User 5bd78114> And how would any other mod depend on this monstrosity -
04:08:44FromDiscord<Deleted User 5bd78114> Goddamn my twisted mind
04:09:05FromDiscord<Deleted User 5bd78114> This is what I'm going to be set on once I have access to my computer again-
04:09:09FromDiscord<ElegantBeef> The answer is you basically want to make a java backend
04:09:28FromDiscord<Deleted User 5bd78114> ........
04:09:38FromDiscord<Deleted User 5bd78114> FUCK MY LIFE
04:10:21FromDiscord<Deleted User 5bd78114> Does Minecraft Java Edition run on Arch and other architects besides x86?-
04:10:33FromDiscord<Deleted User 5bd78114> If so I'm actually fucked-
04:10:40FromDiscord<ElegantBeef> It's java so it should run on arm
04:10:50FromDiscord<Deleted User 5bd78114> DAMN IT
04:11:14FromDiscord<Deleted User 5bd78114> I'm gonna have to set up so much shit for this but it'll be worth it for my college portfolio-
04:12:45FromDiscord<Deleted User 5bd78114> I really hope I can mAke a flimsy wrapper in Java and just use CFFI to use Nom code too with a few modifications -
04:12:57FromDiscord<Rika> man at that point just use kotlin
04:13:09FromDiscord<Rika> or find a way to compile nim into jvm bytecode
04:13:16FromDiscord<Deleted User 5bd78114> NOPE I WANNA TORTURE MYSELF-
04:13:35FromDiscord<Deleted User 5bd78114> Isn't there C to JVM Bytecode compilers?
04:16:43FromDiscord<Deleted User 5bd78114> if it's out there, theoretically o have most of the ground laid.out
04:23:03FromDiscord<Deleted User 5bd78114> I found this: https://stackoverflow.com/a/4221644
04:23:34FromDiscord<Deleted User 5bd78114> But the only issue with that is that there's no way to actually properly interact with the JVM and have to JVM interact with it too
04:23:44FromDiscord<Deleted User 5bd78114> And I can't imagine how slow it'd be-
04:24:51FromDiscord<Deleted User 5bd78114> Though JNim should be good enough
04:25:07FromDiscord<ElegantBeef> Clearly you just use https://www.minecraft.net/en-us/article/scripting-api-now-public-beta
04:25:39FromDiscord<Deleted User 5bd78114> Wait what
04:26:31FromDiscord<ElegantBeef> It's the native minecraft
04:26:39FromDiscord<ElegantBeef> It has a scripting API
04:27:35FromDiscord<Deleted User 5bd78114> That's only Minecraft Win 10 edition for now, and this is for a Java Forge mos
04:27:37FromDiscord<Deleted User 5bd78114> Mod
04:27:46FromDiscord<ElegantBeef> I know, my point is you wont be able to use nim
04:28:01FromDiscord<Deleted User 5bd78114> And maybe Minecraft spigot plugins in Nim
04:28:13FromDiscord<Deleted User 5bd78114> It's possible and I shall do it-
04:28:32FromDiscord<Deleted User 5bd78114> (I totally don't say this for everything and never do it-)
04:30:47FromDiscord<Deleted User 5bd78114> But it is 100% possible
04:31:02FromDiscord<Deleted User 5bd78114> Everything is here, all I need is the motivation to get off of.my ass
04:33:45*narimiran joined #nim
04:33:54FromDiscord<CodeHz> I'm going to build server side plugin for Minecraft Bedrock edition in nim (I've tried it in c++ before, but due to some complexity management issue i give up...)
04:34:34FromDiscord<Deleted User 5bd78114> What server software are you going to use? I'm curious if I'm allowed to ask
04:34:56FromDiscord<CodeHz> Repo: github.com/Element-0/ElementZeroR
04:35:09FromDiscord<CodeHz> Official bds server
04:35:22FromDiscord<Deleted User 5bd78114> Ah, okay, thanks!
04:35:36FromDiscord<Deleted User 5bd78114> http://github.com/Element-0/ElementZeroR
04:36:27FromDiscord<CodeHz> (original version is written in c++, but it get too complicated to add new features...
04:36:33FromDiscord<Deleted User 5bd78114> Looks neat!
04:37:01FromDiscord<Deleted User 5bd78114> And the complication is most likely due to not organising the code and adding helped options
04:38:03*vicfred joined #nim
04:38:51FromDiscord<CodeHz> (the primary problem for me is lacks of abstraction layer)↵The origin api in bds is really bad for modding
04:43:49FromDiscord<Deleted User 5bd78114> Ah, alright
04:44:04FromDiscord<Deleted User 5bd78114> MAkes sense
04:48:01*spiderstew_ joined #nim
04:49:31disruptekt'was the night before christmas, and all through the house, not a creature was stirring
04:49:35disruptekexcept some prick on irc.
04:50:52FromDiscord<Deleted User 5bd78114> Pfft-
04:50:58*spiderstew quit (Ping timeout: 272 seconds)
04:51:01FromDiscord<Deleted User 5bd78114> Heya Disruptek
04:51:12disruptekcoulda sworn i deleted user 5bd78114.
04:52:09FromDiscord<Deleted User 5bd78114> Wha-
04:52:27FromDiscord<Deleted User 5bd78114> It's me, Technisha-
04:52:36FromDiscord<ElegantBeef> Nicknames dont share
04:55:56disruptekit'd be confusing if we shared nicks.
04:56:34miprihttps://irclogs.nim-lang.org/25-12-2020.html#04:09:38
04:56:50*acidx quit (Ping timeout: 260 seconds)
04:57:06disrupteknow i remember why i deleted you.
04:57:23*acidx joined #nim
05:02:23FromDiscord<Deleted User 5bd78114> ????
05:03:47disruptekyou make me feel better about myself and that's confusing for my depression and anxiety.
05:05:36FromDiscord<Deleted User 5bd78114> Yeah I tend to do that
05:05:53FromDiscord<Deleted User 5bd78114> Alot.more than I shoukd
05:08:50FromDiscord<Deleted User 5bd78114> Just gonna say that I'm a...
05:08:58FromDiscord<Deleted User 5bd78114> QUARANTEEN
05:09:10FromDiscord<Deleted User 5bd78114> Aka growing up.in this he'll of a virus-
05:09:13FromDiscord<Deleted User 5bd78114> Wrong channel
05:09:21disruptekprobably.
05:09:24FromDiscord<Deleted User 5bd78114> Ignore what I said-
05:10:11*mipri left #nim (#nim)
05:10:13FromDiscord<Rika> go to sleep
05:10:44FromDiscord<Deleted User 5bd78114> No-
05:10:48FromDiscord<Deleted User 5bd78114> One more hour-
05:10:55FromDiscord<Deleted User 5bd78114> It's only 5 am-
05:20:50FromDiscord<Rika> go to sleep
05:23:19FromDiscord<Deleted User 5bd78114> No-
05:23:25FromDiscord<Deleted User 5bd78114> I can't -
05:23:35FromDiscord<Deleted User 5bd78114> I struggle too much anyway
05:23:41FromDiscord<Deleted User 5bd78114> What's the point
05:23:46FromDiscord<Deleted User 5bd78114> It's only an hour
05:29:25disruptekmratsim: https://github.com/disruptek/cps/discussions/40
05:29:58disruptekdisbot: you feel like learning how to deal with a new github feature tonight?
05:29:59disbotas i see it, yes.
05:30:05disruptekaight buddy.
05:30:40FromDiscord<Deleted User 5bd78114> I'm finally done with what I was doing, goodnight everyone, hope I'm dead tomorrow
05:34:11disruptekpeace.
06:05:40*vicfred quit (Quit: Leaving)
06:10:41*vicfred joined #nim
06:17:49*waleee-cl quit (Quit: Connection closed for inactivity)
06:29:52*saem joined #nim
06:30:31*vicfred quit (Quit: Leaving)
06:57:49*letto_ quit (Ping timeout: 264 seconds)
06:57:53*mipri joined #nim
06:58:29*letto_ joined #nim
07:14:22*habamax joined #nim
07:33:59FromDiscord<juan_carlos> So Ruby is JIT and Typed now. 🤔
07:34:46Prestigeinteresting
07:36:01FromDiscord<Rika> Is there a blog post about it?
07:36:40FromDiscord<juan_carlos> https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released
07:38:24*Edwin joined #nim
07:39:04FromDiscord<Cohjellah> oh boy lads and lasses
07:39:07FromDiscord<Cohjellah> the plight continues
07:39:18FromDiscord<Cohjellah> terminal chat app hump be 'uge
07:40:11FromDiscord<Cohjellah> is there an equivalent of .isReady for getCh() or like, any functions?
07:40:16FromDiscord<Cohjellah> Just trying to work with threads and it's doing me head in
07:40:32Prestigeterminal chat app?
07:41:10FromDiscord<Cohjellah> correct. Did the Nim In Action chat app and I'm taking it to the next level - mad road hump where when you receive a message it just echo's whatever you're currently typing
07:41:19Prestigeoh
07:42:27FromDiscord<Cohjellah> So current solution is to use getCh()
07:42:51mipriif you're using threads have one block on input, and place any "has there been input?" logic in another thread, on the other side of a chan
07:43:49FromDiscord<Cohjellah> HMM
07:43:59FromDiscord<Cohjellah> chan?
07:44:10miprialthough asking that question ever is probably wrong.
07:44:30FromDiscord<Cohjellah> huh
07:44:33miprihttps://nim-lang.org/docs/channels.html
07:44:38FromDiscord<Cohjellah> ah, you meant channels
07:45:14FromDiscord<Cohjellah> oh boy
07:45:19FromDiscord<Cohjellah> ok so I have to do something a bit more complicated than spawn
07:48:13FromDiscord<Cohjellah> so for instance the prior main loop created a string variable using spawn for readline, and then there's a .isReady() method of the string variable
07:48:20FromDiscord<Cohjellah> is that attached to readLine or string objects?
07:49:22mipriFlowVars have an .isReady
07:49:37FromDiscord<Cohjellah> riiiiight
07:49:38FromDiscord<Cohjellah> ok I see
07:50:19FromDiscord<juan_carlos> So is interesting that the most Dynamic langs are all rushing to get typed :p Bugs were winning
07:50:28Prestigeyep! haha
07:53:24miprirather, the big choice is to A) follow the CS consensus, B) rebel against the CS consensus, or C) be an ill-conceived hack that is only accidentally divergent from the CS consensus.
07:53:36FromDiscord<Cohjellah> yo is there an "Also" in an if else
07:53:36mipriwhat you're seeing is a bunch of category C languages moving to category A
07:53:46FromDiscord<Cohjellah> so like, I want something to happen on every iteration of the if
07:53:52FromDiscord<Cohjellah> but I don't want to re-type it on every branch
07:54:07FromDiscord<Rika> CS consensus?
07:54:23FromDiscord<Rika> What?
07:54:29mipri'if' don't have iterations. You can put code before or after the 'if' and have code that runs each time before or after that code.
07:55:22FromDiscord<Cohjellah> I understand there's no interations
07:55:28FromDiscord<Cohjellah> I'm interating over it using a while loop
07:55:38FromDiscord<Cohjellah> everytime it chooses a branch I want it to respawn the getCh()
07:55:49FromDiscord<Cohjellah> But I don't want to write chFlow = spawn getCh() on every branch
07:55:53FromDiscord<Cohjellah> I can, but surely there's shorthand
07:56:01FromDiscord<Rika> Do it after the if else?
07:56:05FromDiscord<Cohjellah> wow I'm stupid
07:56:07FromDiscord<Cohjellah> thanks
07:56:18FromDiscord<Cohjellah> It's the Christmas cheer and tiredness. Thanks ahahahahha
07:56:30FromDiscord<Rika> Lol
07:56:42FromDiscord<Cohjellah> wait I kind of did think of that nvm
07:56:45FromDiscord<Rika> Might be dehydration
07:56:47FromDiscord<Cohjellah> if I had it after the if statement
07:56:53FromDiscord<Cohjellah> so the if is checking .isReady()
07:56:54FromDiscord<Rika> What's the issue then?
07:57:01FromDiscord<Cohjellah> if it keeps respawning the same chFlow variable
07:57:08FromDiscord<Cohjellah> it kind of stuffs with my program as it's polling at hte bottom
07:57:12FromDiscord<Cohjellah> I get a ton of missed inputs
07:57:31FromDiscord<Rika> Might be taking too long to process
07:57:43FromDiscord<Rika> Compile as danger maybe
07:57:46FromDiscord<Cohjellah> let me hard code this in before I decide I need this, and then I'll shorten it if possible
07:58:23*Edwin quit (Remote host closed the connection)
08:00:53FromDiscord<Cohjellah> nah, I'm lost
08:00:59FromDiscord<Cohjellah> I'll just keep tinkering away and see what happens lol
08:01:14FromDiscord<Cohjellah> At the least, I'll learn something lol
08:02:51FromDiscord<Edwin> sent a code paste, see https://play.nim-lang.org/#ix=2Jt2
08:06:28mipriyou're writing NimScript and NimScript doesn't have that proc. There's nothing you can do with attributes or backends to get it back.
08:06:51mipriI suggest writing Nim instead, and using nimcr or similar to make it work like a script
08:06:58mipri!repo nimcr
08:06:59disbothttps://github.com/cheatfate/nimcrypto -- 9nimcrypto: 11Nim cryptographic library 15 82⭐ 10🍴 7& 3 more...
08:07:05miprinot that one.
08:07:28FromDiscord<ElegantBeef> Well there is also using nimscript interop, but that's more work than they probably want
08:07:35mipri'nimble search shebang' pulls two up.
08:07:49FromDiscord<ElegantBeef> !repo nim-cr
08:07:50disbothttps://github.com/LemonBoy/criterion.nim -- 9criterion.nim: 11Statistic-driven micro-benchmark framework 15 37⭐ 3🍴 7& 8 more...
08:07:53FromDiscord<ElegantBeef> lol
08:07:56miprihttps://github.com/PMunch/nimcr
08:10:46FromDiscord<Edwin> oh i see - thank you!
08:14:14FromDiscord<Cohjellah> @ElegantBeef hey beef. I actually got it working with threading and stuff, but I think it's... Not threadsafe with polling?
08:14:31FromDiscord<Cohjellah> For instance it's really laggy and spamming "asd asd asd" puts letters back and forth and all that good stuff
08:15:12FromDiscord<bark> I've got a dummy question, assuming this situation: https://play.nim-lang.org/#ix=2Jt8 how to bind into the GC calls to clean up the ptr field in the example?
08:15:38FromDiscord<bark> (edit) "https://play.nim-lang.org/#ix=2Jt8" => "https://play.nim-lang.org/#ix=2Jt9"
08:15:52mipriyes it'll leak.
08:16:11FromDiscord<Rika> Rename your destroy into "<backtick>=destroy<backtick>"
08:16:12FromDiscord<Rika> ?
08:16:40FromDiscord<Cohjellah> THE PLIGHT CONTINUES! ↵↵I think I'm spending way too much time on this silly little problem
08:17:16FromDiscord<Rika> Perhaps, try drinking water or taking a bath or whatever
08:17:24FromDiscord<Cohjellah> yeah I'll go soak myself
08:17:28FromDiscord<Cohjellah> go roll in some mud or something
08:17:47FromDiscord<bark> so that binds into the gc calls
08:17:50FromDiscord<Rika> Relax for a while and come back to it some other time
08:18:01FromDiscord<Rika> Not sure if it does on refc
08:18:05miprihttps://play.nim-lang.org/#ix=2Jtb - using destructors for A
08:18:23FromDiscord<Cohjellah> How do I make codeblocks in Discord?
08:18:32FromDiscord<bark> three backticks to start/end
08:18:42FromDiscord<bark> like in markdown
08:18:55FromDiscord<Cohjellah> sent a code paste, see https://play.nim-lang.org/#ix=2Jtc
08:19:16FromDiscord<Cohjellah> oh no pretty colours. But this is my ugly ass code atm. The polling is causing it to be all over the place
08:19:23mipriusing GC'd refs instead of ptr: https://play.nim-lang.org/#ix=2Jtd
08:19:23FromDiscord<Cohjellah> I'm definitely doing something wrong, but unsure what to do next
08:19:43FromDiscord<bark> you can add the language name directly after the first three backticks to add syntax coloring
08:19:57FromDiscord<bark> sent a code paste, see https://play.nim-lang.org/#ix=2Jte
08:20:28FromDiscord<Cohjellah> pretty
08:20:29FromDiscord<Cohjellah> (edit)
08:20:31mipriCohjellah: that isn't complete code. where are your imports?
08:20:41FromDiscord<Cohjellah> I can send the whole thing if you'd like
08:20:57FromDiscord<Cohjellah> but parts aren't being used. This is my WIP trying to get this to work safely and non-laggy
08:21:10FromDiscord<bark> mipri, thanks for your code examples, I'll play with them but the first seems to be what I'm looking for
08:22:59FromDiscord<Cohjellah> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2Jtf
08:23:03FromDiscord<Cohjellah> put the imports at the top
08:24:06FromDiscord<Cohjellah> (edit) sent a code paste, see https://play.nim-lang.org/#ix=2Jtg
08:24:39FromDiscord<bark> editing your message resends it to irc afaik
08:24:51FromDiscord<Cohjellah> I'm editing to add more things I think are useful
08:24:55FromDiscord<Cohjellah> soz if it's spamming to the poor IRC folk
08:24:56FromDiscord<bark> and (long) code blocks get (re)uploaded to play.nim-lang.org
08:25:28miprithis still isn't a complete example. where's protocol?
08:25:55FromDiscord<Cohjellah> protocol is a separate file, and I know it seems related, but all my problems are in the code block originally posted, which is why I only included it
08:26:34*bananaapple joined #nim
08:26:40FromDiscord<Cohjellah> it's to do with the whole threading problem, I'm unsure.↵When you spawn a readLine, you can already asynchronously type into the terminal and then when you press enter readLine is ready right. I need to recreate that in the terminal using getCh
08:27:00FromDiscord<Cohjellah> but it seems every time you hit a key, getCh is ready now, so it goes through the branches, and it doesn't work well with asyncdispatch.poll
08:27:12FromDiscord<Cohjellah> I mean, yeah that is how it;s coded. But I thought it would work somewhat smoothly
08:27:54FromDiscord<Cohjellah> If you really need protocol, I Can paste it too
08:28:07miprithis is getch: https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/terminal.nim#L749
08:28:40miprithis is not actually what you want unless you want to do a lot more with the terminal
08:28:58miprito start, this does not at all work like you just described
08:29:16mipri"input is ready when the user hits enter" is a behavior that getch is trying to avoid.
08:29:36FromDiscord<Cohjellah> Well, maybe you can provide me a cleaner solution because this is really hacky
08:29:44mipriif you want lines of input at a time from the user, just use readLine
08:29:44FromDiscord<Cohjellah> Hold up, let me pull you up the OG code before I hacked it up
08:29:53FromDiscord<Cohjellah> correct, but this is for a chat app
08:30:02miprido you not want lines of input at a time from the user?
08:30:04FromDiscord<Cohjellah> when the terminal app receives a message, echo pastes whatever the user is currently typing into the terminal
08:30:19FromDiscord<Cohjellah> to avoid that, this is trying to capture what the user is typing
08:30:38mipriok, so you indeed want to do a lot more with the terminal, so that you can have a nice UI and not have network output stomp over what the user is typing.
08:30:43FromDiscord<Cohjellah> then when a message is received, clear the input line, echo the received message, then write back to the input line what was being typed
08:30:56FromDiscord<Cohjellah> yeah no network stomp as you put it
08:31:10FromDiscord<Cohjellah> This is my only real hurdle haha and it' sdriving me insane. I can't really find a solution
08:31:13mipriin that case, getch can still be part of a solution, but you need to understand that it's going to return right away. There's no "wait until enter is pressed". You've thrown that whole behavior away
08:31:41FromDiscord<Cohjellah> right, so even if I spawn getCh(), isReady() instantly activates?
08:31:49miprireally what I'd suggest is to go through an ncurses tutorial. Just find one that uses C, like the official one, and follow along with a nim library.
08:31:50FromDiscord<Cohjellah> it doesn't wait for a value?
08:32:04mipriisReady() is a FlowVar method. I'm talking about getch.
08:32:30FromDiscord<ElegantBeef> We've got illwill aswell, although dont recall if it's documented well
08:32:35mipriif what your program is doing is seting the FlowVar to what getch returns, then yeah that's to return as soon as any key is typed
08:33:04FromDiscord<Cohjellah> yeah that's kind of what I want... when I comment out polling it's super smooth
08:33:48FromDiscord<Cohjellah> IS there really absolutely no way to read the line just above the cursor?
08:34:07FromDiscord<Cohjellah> because I can just echo what the user is writing, copy that line, erase it and then write it after the message received is pasted
08:34:11mipriwhat do you even by "read the line" there?
08:34:21FromDiscord<Cohjellah> copy it, receive it as input
08:34:27FromDiscord<Cohjellah> read it from the terminal and put it into a variable
08:34:34miprino. what's displayed on the terminal isn't something you can read from.
08:34:38FromDiscord<Cohjellah> hmm
08:34:42mipriyou can read user input, and you can print to the terminal. that's it.
08:34:42FromDiscord<Cohjellah> ok so getCh is very necessary
08:34:43FromDiscord<Cohjellah> sad times
08:34:57FromDiscord<Cohjellah> Thank you for clearing that up for me
08:35:20mipri'man console_codes' will tell you about a lot of interesting commands that you can send, and that even extends to input 'from the terminal' with some queries, but there's absolutely no reading what's on the screen.
08:35:35FromDiscord<Cohjellah> strange
08:35:55FromDiscord<Cohjellah> Ok. So is there a better way to do what I'm doing above? Perhaps first task to tackle is the fact that it's not really thread safe
08:36:00mipriyes. use ncurses.
08:36:02FromDiscord<Cohjellah> if I spam multiple keys it puts them in weird orders
08:36:05FromDiscord<Cohjellah> ncurses
08:36:05FromDiscord<Cohjellah> ok
08:36:53mipriyou probably don't really have a problem with thread safety. You're probably just interacting very strangely with the terminal.
08:37:38FromDiscord<Cohjellah> I'd think it's a thread problem because I'm spawning multiple threads with every key I press and then it pauses at polling so when it returns to the top of the loop, whatever thread beats the other prints first
08:37:42FromDiscord<Cohjellah> That's what I'd assume anyway
08:37:52miprithe non-ncurses way to do this is to save cursor location and set the scrolling region every single time you output to the terminal so that you're printing above where the user will be typing, then restore cursor location and set scrolling region to only where the user is typing.
08:37:53FromDiscord<Cohjellah> because without polling it's 100% smooth and there's no characters going into weird places
08:38:29miprilogical deducation really requires more understanding of the problem that you have here.
08:38:33mipri*deduction
08:38:40FromDiscord<Cohjellah> Amen
08:39:17FromDiscord<Cohjellah> Yeah that solution is interesting
08:39:25FromDiscord<Cohjellah> HMM
08:39:47miprido a few exercises with ncurses to learn it, then make a UI with a separate input area. It's a very, very common use of ncurses and it'll work well in a lot of edge cases where even a very polished ad-hoc solution with getch and console codes will screw up.
08:40:10mipriand you can have all the interactions with ncurses in a dedicated UI thread.
08:40:29FromDiscord<bark> doesn't ncurses use character codes inside?
08:41:00mipriI don't know what you're asking with that.
08:41:17FromDiscord<Cohjellah> I really don't understand this ncurses. So it's a library for C
08:41:28FromDiscord<Cohjellah> so I'll need to find exactly what I'm looking for, read it in C and interpret it into Nim?
08:41:35FromDiscord<bark> isn't ncurses just doing what you described in the non-ncurses solution in the inside?
08:41:44FromDiscord<bark> there are ncurses bindings @Cohjellah
08:41:51miprincurses doesn't have its own special snowflake access to the terminal, right.
08:43:03FromDiscord<bark> https://github.com/rnowley/nim-ncurses is the main ncurses binding for nim, right?
08:43:28FromDiscord<bark> also, does ncurses might not work on windows
08:43:33FromDiscord<bark> (edit) removed "does"
08:43:54FromDiscord<Cohjellah> Interesting
08:44:09mipriuh, going along with ncurses indeed doing the same stuff you would do with scrolling regions et al., is that those also won't work on windows
08:44:39miprialthough there are Unix-like terminals for windows.
08:45:08FromDiscord<Cohjellah> Haha okay so I Can't use that solution then anyway
08:45:30mipriwhat? why were you even considering a terminal UI for windows?
08:45:52FromDiscord<Cohjellah> This is literally a dead simple fun project that I can put on a server and have a few chats with friends before I don't touch it again ahaha
08:45:54FromDiscord<Cohjellah> it's not even a UI
08:45:59FromDiscord<Cohjellah> it's just a simple I type, they receive
08:46:01FromDiscord<Cohjellah> I mean it's a UI
08:46:02mipriit is, in fact, a UI.
08:46:05FromDiscord<bark> I'd personally keep a representation of the terminal screen in memory (let's call it buffer), and write to the buffer. The buffer could keep all the changes inside. And every time there's a wait for an event, just redraw all the changes.
08:46:05FromDiscord<Cohjellah> but I Don't want it to be super crazy
08:46:15FromDiscord<bark> TUI = terminal user interface
08:46:20FromDiscord<bark> ;)
08:47:20mipriwell, here is the lazy way to do it: open two terminals. use one for output from your program, and use the other for input to your program. Now you can go back to readLine and not having to any terminal-UI stuff like ncurses or getch.
08:47:26*vicfred joined #nim
08:48:18FromDiscord<Cohjellah> Well, if I Can't get past getCh I might just try the lazy
08:48:37FromDiscord<Cohjellah> But I'll keep tinkering with the getCh solution for now
08:48:49FromDiscord<Cohjellah> Need to read more on the threading library because I'm probably doing something wrong
08:48:53mipriif you're still considering using getch when you don't know how terminals work or why getch has all the code it's doing and are balking at ncurses when that's enormously easier than getch, then...
08:49:21FromDiscord<Cohjellah> Well, this is helping me learn how terminals work
08:49:23FromDiscord<bark> ncurses and easy in the same sentence :O
08:49:36miprifive seconds ago: haha this just a lazy little program I don't want to do much
08:50:27miprincurses is easy as soon as you want to do anything hard.
08:50:41FromDiscord<Cohjellah> Correct - the current implementation is working, but I have two problems. Lag, funky character placements, need to pass a changing variable to an async'd procedure which I'm not sure how
08:50:51miprigetch is good for Tetris in Terminals where you clear the screen on every single refresh and just want arrow key input.
08:50:55FromDiscord<Cohjellah> But just above it was said I can't use ncurses for Windows?
08:51:17FromDiscord<Cohjellah> (edit) "Correct - the current implementation is working, but I have two problems. Lag, funky character placements, ... need" added "and I"
08:51:36FromDiscord<Cohjellah> Actually might have a solution to my changing variable passing to the procedure.
08:51:46FromDiscord<bark> you can, but you'd need to install ncurses and have a terminal emulator compatible with it
08:52:29FromDiscord<Cohjellah> Interesting. Thank you Bark and Mipri for your assistance
08:52:38FromDiscord<Cohjellah> going down a weird rabbit hole, but I'm learning things.
08:53:13FromDiscord<Cohjellah> Also yes, a lazy little program where I don't want interesting terminal graphics, colours, whatever. Just to have the user input not be ruined by received messages
08:53:55FromDiscord<bark> what about my buffer solution?
08:54:04FromDiscord<Cohjellah> Not sure how to implement, but will look into it
08:54:18FromDiscord<Cohjellah> I wanted your solution originally
08:54:23FromDiscord<Cohjellah> but Mipri said there's no way to read the terminal
08:54:25FromDiscord<Cohjellah> only write to it
08:54:56FromDiscord<Cohjellah> Oh
08:54:59FromDiscord<Cohjellah> I see what you mean
08:55:19FromDiscord<Cohjellah> INTERESTING that sounds kind of fun too
09:01:57FromDiscord<bark> can I add you as friend and DM you my solution Cohjellah? just for fun, I've kinda became interested
09:02:09FromDiscord<Cohjellah> ❤️
09:02:12FromDiscord<bark> @Cohjellah
09:02:28FromDiscord<bark> thanks
09:06:32FromDiscord<Rika> Might help to look at tui spinner and progress bar libraries because they do some funky shit on the terminal as well
09:15:25*klaufir_ joined #nim
09:25:02*letto_ quit (Quit: Konversation terminated!)
09:25:39*letto joined #nim
09:29:16*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:34:11*vicfred quit (Quit: Leaving)
09:38:19*saem quit (Remote host closed the connection)
09:53:58*Arrrrrrrr joined #nim
10:05:11*NimBot joined #nim
10:48:00*NimBot joined #nim
10:51:04*Torro joined #nim
10:52:23FromDiscord<alehander42> merry Christmas ❤️
10:52:49FromDiscord<alehander42> how are you gius
10:52:52FromDiscord<alehander42> guys
10:56:00*waleee-cl joined #nim
11:00:02FromDiscord<Ardek> merry Christmas
12:30:38FromDiscord<Cohjellah> What time is it in America land?
12:30:50*PMunch joined #nim
12:36:59ZevvAmerica Land is a Great Country
12:37:04ZevvIt has soo many times
12:37:10ZevvIt has the most times of any country in the world
12:37:40PMunchMerry Christmas everyone :)
12:37:57ZevvSame to you PMunch!
12:38:00PMunchGoing to stream my two last days of AoC now if anyone is up for it
12:38:18Zevvremember kids, bees also live in a 3D world
12:38:27PMunchHaha, what? :P
12:38:38FromDiscord<bark> they also live in minecraft?
12:38:42FromDiscord<bark> good to know
12:38:51ZevvJust a slice of minecraft, actually
12:39:04PMunch@bark, well Minecraft actually has bees now
12:39:36PMunchhttps://www.twitch.tv/pmunche https://www.youtube.com/watch?v=iw34Ya2raOM
12:40:02*bananaapple quit (Quit: leaving)
12:40:24FromDiscord<bark> im watching the stream, but I don't have a youtube account to chat :'(
12:40:51PMunchDon't worry, you can chat to me here
12:44:56FromDiscord<Shucks> I'm trying to pass openArray's to `write`. This doesn't works because openArrays doesn't have the size of regular arrays. Anyone a idea how I could solve that? https://play.nim-lang.org/#ix=2Jug
12:47:23FromDiscord<mratsim> use len, not sizeof
12:47:36FromDiscord<mratsim> the size of an openarray is 16 (ptr + len)
12:47:51FromDiscord<mratsim> @Shucks
12:47:56*narimiran quit (Ping timeout: 240 seconds)
12:49:45FromDiscord<Shucks> len would work in that case for bytes. But if I would pass an openArray[float32] with 3 floats it should be 12 not 3
12:51:11mipri.len * float32.sizeof
12:53:24FromDiscord<mratsim> sizeof(T) len is what every C library does in malloc
12:54:56FromDiscord<Shucks> https://play.nim-lang.org/#ix=2Juo
12:54:58FromDiscord<Shucks> thanks guys
13:07:19*Torro quit (Quit: bye)
13:15:10*Torro joined #nim
13:45:51FromGitter<deech> Long shot, but does Nim have a "read-only" `ptr`? That's a pointer address you can deference but not assign to?
13:46:55FromGitter<deech> Think maybe I could wrap it up in a `distinct` type and not support assignment.
13:48:08disrupteknot sure that would work, but i would try it.
13:48:54disruptekthe user could simply cast it to another pointer and assign that.
13:49:50disruptekthat reminds me of another addition to my style guide:
13:49:55FromGitter<deech> I guess that expires the warrany.
13:50:05disruptekyou can't create distinct tuples.
13:51:39FromDiscord<bark> why is that any good
13:51:54disruptekwhat?
13:52:16FromDiscord<bark> I don't know why would distinct tuples be a problem for readability
13:52:30FromDiscord<haxscramper> Because they can't be unpacked, so just use object instead
13:52:31disruptekit's not a readability issue.
13:52:38disruptekthey don't work. 😁
13:53:25disruptekmy tuples section advises against using them for most cases.
13:53:31FromDiscord<bark> is it possible to borrow the unpacking? 🤔
13:53:39FromDiscord<haxscramper> not sure, probably no
13:53:42Zevvi only use tuples when i want to be quick&dirty
13:53:52FromDiscord<haxscramper> I use tuples for multiple return values
13:53:53Zevvor for multiple assignment
13:54:11Zevvlet (a,b) = (10,30)
13:54:37disrupteki guess i should note that deconstruction assignment is fair game.
13:55:44FromDiscord<haxscramper> I think if you return tuple from function/iterator is is almost mandatory for it to not be anonymous
13:57:13FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2JuH
13:57:50disrupteki don't have dns right now. what does it say?
13:57:56FromDiscord<haxscramper> With pattern matching from fusion you should be able to write custom unpackers though
13:58:01FromDiscord<bark> proc getFields(declEn: CDecl, conf: WrapConfig): tuple[↵ namedvals: Table[string, BiggestInt],↵ enfields: seq[tuple[name: string, value: Option[EnFieldVal]]]↵ ] =
13:58:04disruptekyeah, that's madness.
13:58:49FromDiscord<bark> i am thinking, is there any benefit to using tuples over objects for anything, if you're not allowed to unpack
13:58:55FromDiscord<haxscramper> https://github.com/haxscramper/fusion/blob/matching/tests/tmatching.nim#L1318
13:58:57disrupteki do define `type KeyVal = tuple[key: ...; val: ...]` but..
13:59:02disruptekthat's about it.
13:59:22FromDiscord<haxscramper> You don't need to define named tuple, and you /can/ unpack single layer
13:59:40FromDiscord<haxscramper> This is precisely what I'd want to use tuples for
13:59:41FromDiscord<bark> yeah, but besides from multiple return values
13:59:53disrupteknot really, no.
14:00:04FromDiscord<haxscramper> When you need one-time grouping for several different types
14:00:08*theelous3 joined #nim
14:00:14FromDiscord<bark> I guess you don't need to define which parts of it are public
14:00:34disruptekthe subtle benefits, if any, are outweighed by the meatspace problems.
14:00:43FromDiscord<haxscramper> Like tuples are a throwaway concept really, if you find yourself using them too much
14:00:59Zevvso, lets deprecate
14:01:15FromDiscord<haxscramper> E.g making tuples that live through multiple layers of code, just use proper object
14:01:40FromDiscord<haxscramper> Especially with support for custom unpackers
14:01:45disruptekthey might have a role to play in the "partial object" optimization, i dunno.
14:02:16disrupteki think education is the best solution.
14:05:56*Q-Master quit (Ping timeout: 240 seconds)
14:19:11FromDiscord<mratsim> @disruptek, @zevv, ergonomics discussion: https://github.com/disruptek/cps/discussions/42
14:21:10*PMunch quit (Quit: leaving)
14:21:50FromDiscord<Vindaar> @deech that's also the idea behind https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/laser/tensor/datatypes.nim#L19
14:22:21*kenran joined #nim
14:27:27FromDiscord<mratsim> I wonder if I can use `distinct openarray` and `distinct var openarray` now.
14:27:43FromDiscord<mratsim> Want to crash the compiler @Vindaar ? :p
14:32:42*Q-Master joined #nim
14:37:20FromDiscord<Vindaar> of course, always!
14:44:26FromDiscord<CodeHz> what's the purpose of the generic macro, is this useless? https://media.discordapp.net/attachments/371759389889003532/792040060912140288/unknown.png
14:53:10FromDiscord<mratsim> don't use generics macros
14:53:48FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2Jv6
14:53:57FromDiscord<mratsim> if you have to, here be dragons (note, I do use them but in one case out of all the macro code I wrote)
14:54:16TorroHappy holidays all
14:54:18*Torro left #nim ("bye")
14:54:18FromDiscord<haxscramper> Something like this, though I never needed to use, and there are some very strange things going on with them as @mratsim just said
14:55:09FromDiscord<mratsim> macro can handle generic and typedesc argument, though it's sometimes tricky to navigate, so generics macro are seldom useful
15:07:59*Vladar joined #nim
15:15:42FromDiscord<sealmove> happy holidays everyone
15:15:56FromDiscord<mratsim> sent a long message, see http://ix.io/2Jvw
15:36:27Oddmongercan you define colors with illwill lib ?
15:36:40Oddmongeri see only terminal colors in the doc
15:37:45*habamax quit (Ping timeout: 240 seconds)
16:09:19*narimiran joined #nim
16:21:34FromDiscord<mratsim> @oddmonger, terminals have broken color scheme
16:22:46Oddmongeri mean, only color definition for 16 colors
16:22:59ForumUpdaterBotNew post on r/nim by cincilator: I think Nim community should focus more on Godot engine., see https://www.reddit.com/r/nim/comments/kk1k7s/i_think_nim_community_should_focus_more_on_godot/
16:23:35Oddmongerwell, if he thinks so…
16:24:36FromDiscord<mratsim> I remember looking into light blue cyan magenta and others
16:24:50FromDiscord<mratsim> and the color scheme was completely different between powershell and bash
16:25:10Oddmongerfor illwill, i was thinking defining its own colors was maybe possible (reading the documention), but then i've read that: https://github.com/johnnovak/illwill/issues/16
16:25:11disbotSupport wide characters and true color
16:26:07Oddmongermaybe i could send myself escape sequences, for at least linux support
16:26:57FromDiscord<mratsim> ah I forgot to save the webpage I use with the color comparison between terminals
16:27:00Oddmongermratsim : even in linux, you have color differences if you use 256 colors indexing mode
16:27:17FromDiscord<mratsim> spent a lot of time trying to have something that was OK for logging here: https://github.com/status-im/nim-chronicles/pull/89
16:27:18disbotupdate color scheme
16:28:45Oddmongernim-chronicles : nice name for a logger
16:29:30Oddmongerbut anyway, my #1 problem for now is to output wasm bytecode from nim
16:29:50Oddmongerwhich is another story
16:39:25FromDiscord<mratsim> https://github.com/status-im/nimplay
16:39:42*NimBot joined #nim
16:40:01FromDiscord<mratsim> don't ask me the full inner stuff but it does output WASM
16:40:15FromDiscord<mratsim> otherwise there is emscipten and clang WASM flag
16:41:00FromDiscord<mratsim> https://github.com/status-im/nimplay/blob/master/Makefile#L5-L19
16:43:40Oddmongermratsim, thank you. And just for you, my last procrastination: for ((r=0; r<255; r+=10)); do for ((g=0; g<255; g+=10)); do for ((b=0; b<255; b+=10)); do printf "\033[48;2;${r};${g};${b}m "; done; done; done
16:44:00Oddmongeri think illwill will accept this
16:44:41Oddmongeri'm using alacritty terminal, i don't think the above will work with urxvt
16:45:23Oddmongerah nimplay is using nlvm for compiling
16:45:27Oddmongerto wasm
16:48:17Oddmongeri was more thinking of something like this (i've just found this, otherwise i wouldn't have asked here before trying): https://github.com/nim-lang/Nim/issues/8713#issuecomment-586028783
16:48:17disbotAdd Emscripten compiler support
16:52:48FromGitter<deech> Vindaar: Nice! Can I ask why you're using `distinctBase` instead of `{.borrow.}`?
16:58:38*habamax joined #nim
17:16:18FromDiscord<mratsim> @oddmonger you have multiple script, nlvm or clang or others I think
17:17:29FromDiscord<mratsim> @Zevv, starting from this time this is quite interesting: https://youtu.be/KUhSjfSbINE?t=1460↵there are 5 min about the problem I have in Weave that continuation solve in a cleaner way than a memory pool.↵And it's directly followed by CSP and rendez-vous channels.
17:17:48FromDiscord<mratsim> (at the 26min mark)
17:19:29FromDiscord<mratsim> 30 nanosec to push a number across 100M coroutines using CSP 😮
17:19:50FromDiscord<mratsim> I think he meant microsec though because nanosec sounds crazy low
17:20:27disruptekit doesn't really matter; the point is that there's nothing comparable. i try to explain this but it's like i'm talking to myself.
17:20:33FromDiscord<mratsim> ah 30 nanosec per step
17:22:03FromDiscord<mratsim> @disruptek, nothing comparable to continuations? I think that's because you didn't use the relevant examples
17:22:30disruptekit's possible.
17:22:34FromDiscord<mratsim> coroutines can get you very far and closure iterators are very similar to coroutines
17:22:57FromDiscord<mratsim> I have put relevant examples here: https://github.com/disruptek/cps/discussions/42
17:23:14disrupteki'm just finishing my rebuttal. 😀
17:26:53disruptekwhat i care about is composition ergonomics; this is the main problem i have with the coroutines i've used.
17:27:13disrupteki don't use nim because it's fast. if i wanted speed, i'd use C.
17:28:25disruptekwhy don't you use C instead, by the way?
17:30:38FromDiscord<mratsim> When I want speed, Nim allows me to be faster than C
17:31:17FromDiscord<mratsim> whether in cryptography or scientific computing, my Nim code reaches Assembly speed.
17:31:45FromDiscord<mratsim> ref don't compose
17:32:04FromDiscord<mratsim> you can't use them in no GC environment, you can't pass them to C libraries
17:32:15FromDiscord<mratsim> you can't use a custom allocator with them when you want them on the heap
17:32:33disruptekthey don't compose /for your application/.
17:32:37FromDiscord<mratsim> they give you convenience, they don't give you composition
17:32:40disruptekthey compose perfectly well for me.
17:32:58disruptekconvenience is the reason i use nim.
17:33:28FromDiscord<mratsim> as i said, put the object in a ref object of RootObj in your scheduler
17:33:29disruptekanyway, i don't need a custom allocator to put them on the heap.
17:33:42FromDiscord<mratsim> and then you have the same semantics.
17:34:00disruptekas i said, write the code. 😉
17:34:06disruptekthen i'll have the same semantics.
17:34:28disruptekbecause, at present, i have the same semantics if i just continue to use the cps that already exists today.
17:34:59disrupteklet us not bikeshed that which doesn't even exist. it's a poor practice in the nim community.
17:36:26FromDiscord<mratsim> So what scheduler do you want me to write exactly?
17:36:48disrupteki don't care. i think you want to use work-stealing. is that wrong?
17:36:52FromDiscord<mratsim> because for my purpose, I know I can adapt Weave for my needs with continuation
17:37:00disrupteksweet.
17:37:08disrupteki think weave is good stuff and i look forward to using it with cps.
17:37:12FromDiscord<mratsim> I plan to write a PoC for IO with continuation as well
17:37:28FromDiscord<mratsim> but I don't understand your ergonomics for your own scheduler?
17:37:48disruptekwhat do you mean?
17:38:31FromDiscord<mratsim> You mention limitations in the compiler and doubt we can achieve what you can with a ref object of RootObj, if I use a plain object and wrap it in a ref object of RootObj
17:39:02FromDiscord<mratsim> also regarding↵> Uh, no. The point of arc is reference counting. It's a garbage-free garbage collector, as Microsoft calls it. Don't conflate arc, GC, the heap, and the stack and think that no one is going to notice. laughing↵↵I disagree, one of the main draw of arc is to remove the need of --gc:none.
17:39:04disruptekif you wrap it, it's practically the same from a scheduler perspective, right?
17:39:27FromDiscord<mratsim> and make the standard library that uses string and seq widely, usable in most contexts.
17:39:32*theelous3 quit (Read error: Connection reset by peer)
17:39:47FromDiscord<mratsim> Yes if you wrap it it's the same from a scheduler perspective.
17:40:36FromDiscord<mratsim> but you have an escape hatch when your scheduler or use-case requires you not to use the heap.
17:41:01disrupteki need cps to compose my continuations correctly without regard to changing data types; for example, i want to throw away a large continuation and return a smaller one.
17:41:05FromDiscord<mratsim> this is basically splitting memory management from CPS and give people flexibility on that.
17:41:14disruptekas i said, i'm in favor of it.
17:41:23disruptekbut i'm not willing to put the time in on the development.
17:41:40disrupteki really don't have time for this. i couldn't pay my phone bill last month.
17:41:47FromDiscord<mratsim> so, if I change main.nim and eventqueue that's OK?
17:41:48disrupteki need paying work.
17:41:57disruptekof course. i trust your work.
17:42:04FromDiscord<mratsim> I think those are the last one to compile.
17:42:07disruptekyou can change anything you want in the project.
17:42:19FromDiscord<mratsim> well really it's a very minimal change, I would be surprised if it takes more than 20 lines
17:42:38disruptekgood. i don't want to waste your time, either.
17:42:52FromDiscord<mratsim> the change to {.union.} is more invasive but that's not needed for the "ref based scheduler"
17:43:18FromDiscord<mratsim> also one limitation of union currently is that {.union.} are broken on javascript.
17:43:42disruptekyeah, that's a problem, too.
17:43:48FromDiscord<mratsim> well you trust my code but I still don't understand 80% of what is going on in the codebase
17:44:10disruptekwe had some false starts and rewrites; it's not as clean as it could be.
17:44:36FromDiscord<mratsim> one question i had is, can try/finally wrap a suspension point/cps call?
17:44:52disruptekwrap it? no.
17:44:52FromDiscord<mratsim> because in C++ or Kotlin, don't remember, they forbid that for their coroutines.
17:45:06disruptekbut you can always do it.
17:45:09FromDiscord<mratsim> and in Chronos we have issues with try/finally
17:45:16FromDiscord<mratsim> around yield
17:45:32FromDiscord<exelotl> heyy is it possible to make a table mapping NimNodes to NimNodes?
17:45:34disrupteki mean, it can be done. it just takes a shimming rewrite.
17:45:47FromDiscord<mratsim> okay, so it's not a fundamental limitation
17:45:49disrupteksimilar to how `let x = cpsCall()` works.
17:45:53FromDiscord<mratsim> @exelotl yes
17:45:58disruptekyes, we "can do it".
17:46:28*a_chou joined #nim
17:46:47FromDiscord<mratsim> here you go: https://github.com/mratsim/compute-graph-optim/blob/master/e07_part1_var_ADTs_tables.nim#L5-L13
17:47:48FromDiscord<exelotl> ah I need to make my own hash for syms then (since I want to map syms to syms instead of idents to idents)
17:47:56FromDiscord<mratsim> yes
17:48:11FromDiscord<exelotl> cheers
17:48:18FromDiscord<mratsim> that said, since then Nim added a proc to derive an unique identifer from a NimNode
17:48:28disruptekexelotl: hey, did you catch covid?
17:48:46FromDiscord<exelotl> nooo not afaik
17:49:09disruptekhmm, there's someone in your neck of the woods that i think got sick but i can't remember who it was.
17:50:01FromDiscord<exelotl> hmm I hope they're okay :s
17:50:11FromDiscord<exelotl> oh yeah thanks for pointing me at nimcrypto the other day, it seems great
17:50:18disruptekoh, good.
17:50:30disruptekit's pretty stable.
17:51:49FromDiscord<mratsim> not that for cryptosecure RNG we don't use the one in nimcrypto
17:51:56FromDiscord<mratsim> we switched to BearSSL
17:52:31disruptekright, that's why.
17:53:09FromDiscord<mratsim> for example to generate private keys for crypto: https://github.com/status-im/nim-libp2p/blob/0f2435f551ab6d947d1927c6eef373eef435c942/libp2p/crypto/secp.nim#L37-L42
17:53:22FromDiscord<mratsim> I'm not fan of the callback but well ...
17:53:37FromDiscord<mratsim> That said, nimcrypto's RNG has been audited as well
17:54:42*a_chou quit (Remote host closed the connection)
17:55:26FromDiscord<exelotl> I just wanted to use it for salting + hashing passwords for "my first notes app" so I'm not super worried about the RNG
17:55:37FromDiscord<exelotl> if it just uses whatever the OS provides that's fine by me
18:19:59FromDiscord<exelotl> https://play.nim-lang.org/#ix=2JwA man this error message sucks xD
18:20:30FromDiscord<exelotl> it should be "unexpected )"
18:26:55FromDiscord<Vindaar> @deech: tbh I'm not sure. @mratsim wrote that code (I only made some changes to the file on a PR). I assume it might be because `[]` should be a template instead of a proc? Or that `[]` for `ptr UncheckedArray` cannot be borrowed?
18:39:42FromDiscord<mratsim> what was the question?
18:45:34FromDiscord<Filipe Duarte> Hey guys, why use ’’ after proc’s name? Is this related to the reference?
18:46:22FromDiscord<Rika> export marker
18:48:10*vicfred joined #nim
18:49:28*hnOsmium0001 joined #nim
18:49:46FromDiscord<Filipe Duarte> I’m new to Nim and do not understand this concept. When should I use it?
18:51:58FromDiscord<Filipe Duarte> (edit) I’m new to Nim and do not understand this concept. When should I use it? Used for export the procedure?
18:53:02FromDiscord<Filipe Duarte> (edit) I’m new to Nim and do not understand this concept. When should I use it? to export the procedure?
18:53:34FromDiscord<haxscramper> yes
18:53:36FromDiscord<mratsim> if you want the procedure to be public
18:53:44FromDiscord<mratsim> usable from other files
18:54:13FromDiscord<Filipe Duarte> So are the procedures private by default?
18:54:17FromDiscord<mratsim> yes
18:54:28FromDiscord<mratsim> types and fields as well
18:54:33FromDiscord<Filipe Duarte> Thanks
19:04:35FromDiscord<dk> is there an obvious way to refer to a manually cloned lib as `import lib` instead of `import lib/src/lib`?
19:13:19FromDiscord<haxscramper> IIRC you can use `--path:lib/src`, and if you have `project/src/project.nim` it should just be able to `import project` without any additional effort
19:15:20ForumUpdaterBotNew thread by Jseb: Terminal.nim says i don't have a true color term (but it's wrong), see https://forum.nim-lang.org/t/7291
19:29:06FromDiscord<dk> ty
19:47:35*klaufir_ quit (Read error: Connection reset by peer)
19:50:12FromDiscord<Vindaar> @mratsim it was about the raw view types / why they use `[]` templates with `distinctBase` instead of just using `{.borrow.}` on the originals `[]`
19:53:01*habamax quit (Ping timeout: 264 seconds)
20:11:19*kenran quit (Quit: leaving)
20:15:25*Vladar quit (Read error: Connection reset by peer)
20:19:39ForumUpdaterBotNew thread by D3zd3z: Making a closure iterator out of a non-closure one, see https://forum.nim-lang.org/t/7292
20:24:45*qwr joined #nim
20:28:15*qwr quit (Client Quit)
20:30:54FromDiscord<Deleted User 5bd78114> Okay, so, I could write a C compiler that compiles C files to JVM byteco de, in Nim, right? Asking for a friend -
20:31:19FromDiscord<Recruit_main707> you could
20:31:39FromDiscord<Deleted User 5bd78114> Nice, this'll be a hell of a project-
20:32:10FromDiscord<Recruit_main707> does the jvm allow you to manage your own memory?
20:32:18FromDiscord<Recruit_main707> raw pointers etc?
20:32:24FromDiscord<Deleted User 5bd78114> Pretty sure it does
20:32:28FromDiscord<Deleted User 5bd78114> I can't remember
20:37:36*qwr joined #nim
20:37:44FromDiscord<Deleted User 5bd78114> I'm going to hate myself so much-
20:38:19FromDiscord<Deleted User 5bd78114> Is this good for my college portfolio?
20:42:37disruptekyeah; colleges love self-loathing, ironically.
20:45:24FromDiscord<shadow.> uhhhh
20:45:27FromDiscord<shadow.> debatable
20:45:40FromDiscord<shadow.> maybe something more useful would be better for a portfolio 💀
20:46:15FromDiscord<shadow.> said differently, why would someone want jvm byecode from c
20:48:17FromDiscord<ElegantBeef> Especially since you want minecraft mods, it just makes more sense to work on a backend to output java code, than use C -> jvm
20:48:43FromDiscord<shadow.> oh this is for mc mods?
20:48:50FromDiscord<ElegantBeef> That was their intent as of last night
20:48:53FromDiscord<shadow.> why not make a java backend for nim then?
20:48:56FromDiscord<shadow.> that'd be sick
20:48:58FromDiscord<shadow.> lol
20:49:07*narimiran quit (Ping timeout: 265 seconds)
20:52:09FromDiscord<Filipe Duarte> Guys, another question: what's the role of {.final.} @mratsim have this example. Also, ref object of Gate[TT] is the reference for this object? https://media.discordapp.net/attachments/371759389889003532/792132596187267084/image0.png
20:52:40FromDiscord<ElegantBeef> Final means it cannot be inherited from
20:52:55FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#pragmas-final-pragma
20:53:44FromDiscord<ElegantBeef> `object of` is inheritance, `ref` means it's a reference object at `Gate[TT]` is what it
20:53:51FromDiscord<ElegantBeef> 's inheriting from
20:54:42FromDiscord<Filipe Duarte> Which means it only works for Gate objects?
20:54:52FromDiscord<ElegantBeef> No
20:55:09FromDiscord<ElegantBeef> `object of` means it inherits the fields of the parent object
20:55:25FromDiscord<ElegantBeef> it being a ref means it also can use the methods/procs of the parent object
20:55:45FromDiscord<ElegantBeef> (edit) "object" => "object, without manual conversion afaik"
20:55:59FromDiscord<ElegantBeef> What other language do you know?
20:58:01FromDiscord<Filipe Duarte> Is it works like Python Inheritance? Parent classes?
20:58:10FromDiscord<ElegantBeef> Yes it's inheritance
20:58:21FromDiscord<ElegantBeef> `object of T` means the object is inheriting from T
20:58:47FromDiscord<ElegantBeef> `ref` tells you it's reference object which means it lives on the heap
20:59:05FromDiscord<ElegantBeef> So like C#/Java classes
21:00:02FromDiscord<Filipe Duarte> I have to study this reference object. I understand the ”object of”
21:01:17FromDiscord<Filipe Duarte> it seems interesting for me
21:04:16FromDiscord<ElegantBeef> Arent python objects reference types?
21:04:19FromDiscord<Avatarfighter> @Filipe Duarte reference objects work like python objects
21:04:21FromDiscord<Avatarfighter> yeah they are
21:04:50FromDiscord<ElegantBeef> Then yea, just like python objects you assign a variable it doesnt copy but shares the reference
21:05:13FromDiscord<ElegantBeef> non reference objects work like integers where they are copy on assign, and do not mutate the source
21:05:31FromDiscord<ElegantBeef> They're actually typically called value types
21:07:29FromDiscord<ElegantBeef> This should explain the difference https://play.nim-lang.org/#ix=2Jxi
21:08:14FromDiscord<ElegantBeef> Didnt realize this would've worked https://play.nim-lang.org/#ix=2Jxk
21:16:31FromDiscord<lqdev> it's actually not called a "reference object" but rather a traced pointer. noone prevents you from doing `ref int` if you really wanna
21:16:54FromDiscord<ElegantBeef> Well yea ref is the "managed pointer" keyword
21:17:09FromDiscord<lqdev> iirc the `ref` stands for "reference counted" but i personally think "reference to heap memory" is a better name
21:17:43FromDiscord<ElegantBeef> I just think of it as a fancy `ptr` 😄
21:19:46FromDiscord<Goel> Is there any book or more references for NiGui? I would like to learn it to make a windows app but i don't know where to study it
21:20:04FromDiscord<ElegantBeef> https://github.com/trustable-code/NiGui/tree/master/examples
21:20:08FromDiscord<ElegantBeef> Closest you'll get
21:20:15FromDiscord<lqdev> @Goel sorry to say that but the state of Nim app development is pretty sad atm so don't expect great documentation
21:20:56FromDiscord<ElegantBeef> It's not that sad, as much as just requires you to dig around to figure out how things work
21:21:08FromDiscord<lqdev> it is sad
21:21:17FromDiscord<lqdev> docs aren't great and libraries are generally quite poor
21:21:28FromDiscord<lqdev> maybe with the exception of gintro but that thing is a beast
21:21:42FromDiscord<lqdev> it slows down compilation considerably
21:26:45FromDiscord<Goel> The examples given in NiGui are nice, i tried them all and they do exactly what i want, but when i try to make my own simple app there are always a lot of questions or stuff that i dont know how to handle. Maybe i should just study the basics of the GUI from some other book. Any suggestion?
21:27:26FromDiscord<ElegantBeef> For using nigui i can only suggest looking at the source code for what you're using to see what it does
21:27:59FromDiscord<Deleted User 5bd78114> I'm thinking of making a Java backend instead she since after thinking about it, it'd be a lot more useful to other people too
21:28:49FromDiscord<Deleted User 5bd78114> Is it something that people.would like?
21:29:28FromDiscord<mratsim> Ah, distinct is broken with generics, you can't borrow, if it was fixed it's only very recently
21:30:56FromDiscord<ElegantBeef> Being able to export JVM compatible code would interest someone i imagine
21:31:45*saem joined #nim
21:33:25*saem waves
21:35:25FromDiscord<Deleted User 5bd78114> Yeah, and probably with some extra functions for Java specific stuff
21:35:25Clonkk[m]<FromDiscord "<ElegantBeef> Being able to expo"> Graal VM has a LLVM run time
21:35:45FromDiscord<Deleted User 5bd78114> Oh I know GraalVM
21:36:21FromDiscord<ElegantBeef> Sure, but i dont see how that relates 😄
21:37:39FromDiscord<Deleted User 5bd78114> We could just use clang to generate LLVM code
21:37:46Clonkk[m]Well with NLVM you can probably emit LLVM IR and run it with graal VM
21:37:50Clonkk[m]Or clang
21:38:03FromDiscord<ElegantBeef> Yea but that doesnt really help, when you want to have java code that can be relied on
21:38:24FromDiscord<ElegantBeef> Remember nisha's usecase is for minecraft mods
21:38:39FromDiscord<ElegantBeef> So have to be able to depend on/be depended on
21:38:51Clonkk[m]Ah I just thought you wanted to interact with Java.
21:38:58FromDiscord<Deleted User 5bd78114> Yeah
21:39:00FromDiscord<ElegantBeef> We've got jnim for that
21:39:31FromDiscord<Deleted User 5bd78114> I wanted to actually make a JVM backend because why not :3
21:39:43FromDiscord<ElegantBeef> The nice thing about java is it's statically typed without anything overly complex so you could make a analyser to output bindings
21:41:53FromDiscord<haxscramper> There is a tree-sitter java parser https://haxscramper.github.io/htsparse/src/htsparse/java/java_wrapper.html#parseJavaString%2Cstring
21:43:04FromDiscord<haxscramper> For a split second I thought about recommending reading nimscript vm, but I remembered it is a register-based one, while jvm uses stack-based, so you'd probably need to change quite a lot of things if you were to take this approach
21:47:11FromDiscord<ElegantBeef> I mean you'd be better off looking at jsgen
21:48:36FromDiscord<Deleted User 5bd78114> Hm
21:48:59*Arrrrrrrr quit (Remote host closed the connection)
21:49:05FromDiscord<Deleted User 5bd78114> My end goal for this is for it to run most current Nim programs in Java
21:49:36FromDiscord<Deleted User 5bd78114> So like the Doom Nim reimplementation
21:49:49FromDiscord<Deleted User 5bd78114> And maybe other small programs
21:50:21FromDiscord<ElegantBeef> Only pure nim code should work
21:50:28FromDiscord<ElegantBeef> Anything that relies on libraries would require extra work
21:50:42FromDiscord<ElegantBeef> Your current goal should just be reading jsgen to understand how it works
21:54:32FromDiscord<Deleted User 5bd78114> I will!
21:54:33*Arrrrrrrr joined #nim
22:04:39Prestigesaem: hey, I hear you're working on nimsuggest or editor support?
22:05:51saemTrying to. :D
22:06:34PrestigeAny room for assistance? I'd like to help, with what I can
22:06:58saemVS Code Extension ported from TS to Nim + some miscellaneous improvements. Writing tests for nimsuggest so I can then start making changes with some hope of a regression test suite (https://github.com/nim-lang/Nim/pull/16401), right now I'm trying to figure out workspace/folder stuff
22:06:58disbotSaem nimsuggest re-enable tests
22:07:13saemI'd love help in improving tooling.
22:07:39PrestigeExcellent
22:08:06saemDo you have something in mind or would you like to figure out "where to start?"
22:10:00PrestigeNo idea where to start yet, would just like to see editor support refined. I'm not super advanced with Nim yet, but if I could see a few issues maybe I'll be able do resolve a few
22:11:05saemHave you had a chance to read/skim the extension code base? https://github.com/saem/vscode-nim
22:11:52PrestigeNope (I use nvim) but I'll read through it when I get home, soon
22:12:12PrestigeI can install vscode and try in out
22:12:27Prestigeit*, phone typing is hard
22:13:04FromDiscord<ElegantBeef> Saem have you submitted your version to the OSS extensions place?
22:13:04saemSounds good -- long term I'd like to see more inside a language server, especially for folks who like to work in other editors such as yourself, but it first needs a bunch of clean-up and refining.
22:13:43saem@ElegantBeef I have, I added links in the readme recently, you can find it here: https://open-vsx.org/extension/nimsaem/nimvscode
22:13:53FromDiscord<ElegantBeef> Ah nice
22:13:55saemaside, it has more downloads there than on VSCode marketplace
22:14:11FromDiscord<ElegantBeef> Probably cause there are 5 different nim extensions on vscodes 😄
22:14:38saemThat's definitely part of it.
22:16:10FromDiscord<ElegantBeef> I'm currently using the lsp extension but it doesnt like the compiler
22:16:17FromDiscord<ElegantBeef> Never actually survives
22:17:15saemThe one written by bung?
22:17:20FromDiscord<ElegantBeef> Yea
22:17:32FromDiscord<ElegantBeef> The LSP seems to die with figuring out the compiler
22:18:23saemI've been meaning to look at that again, I think the whole way packages/artifacts are declared makes this stuff really tricky. Leaves too many things as implicit so without human intervention everywhere it's really hard for a tool to figure out the intention.
22:18:33saemWhich code base is it dying on?
22:18:40FromDiscord<ElegantBeef> The compiler
22:19:04saemSorry, I parsed that poorly.
22:19:14FromDiscord<ElegantBeef> No problem
22:19:35FromDiscord<ElegantBeef> Adding colouring to the compiler with just syntax highlighting is a fun thing to do
22:20:04FromDiscord<ElegantBeef> Tons of searching manually and looking around by hand
22:20:07saemYeah, mine has some issues there as well. I did make a tweak recently to help (need to release that) and then also made a change in my local settings that *might* improve suggestions.
22:20:59FromDiscord<ElegantBeef> Yea for some reason the lsp server cannot resolve viable code then just poops itself to death
22:21:01saemOoph, I can imagine, writing tests for nimsuggest alone I've run into a bunch of can't click through on things. THough it seemed to get better after the tweaks.
22:21:46saemSome times that's because of the file it assumes as the project file.
22:22:35saemThen there is the whole cfg/nims/nimble/koch and flags are everywhere so it's not making good decisions.
22:23:28saemOf course, this doesn't even get to issues with suggest.
22:25:41*kwilczynski quit (Ping timeout: 268 seconds)
22:32:19*kwilczynski joined #nim
22:42:21disruptekefforts are being made to remove configuration and divorce compiler environment from package manager.
22:43:09disruptekbasically, you want to trend as close as possible to the compiler. the core tooling all should follow these codepaths and when they don't, well, it's probably an oversight.
22:46:27FromDiscord<mratsim> @disruptek, hopefully ma latest post on the "next steps for CPS" thread will convince people
22:46:31FromDiscord<mratsim> going to sleep now
22:54:14saem@disruptek I'm glad to hear it. I'm hoping that results in compiler can be run with an explicitly specified cfg rather than only by a naming convention.
22:54:45disruptekmratsim: nighty night
22:55:07disrupteksaem: the compiler can be run with specified configs.
22:55:24disruptekin future, the goal is to embed the config in the code, for obvious reasons.
22:55:25saem@disruptek then I'm failing at reading the docs.
22:55:34disrupteksee `nim --fullhelp`
22:58:59saemI've been going off this: https://nim-lang.org/docs/nimc.html
23:01:25disruptekit seems fairly complete.
23:01:39disruptekso what's the problem, exactly?
23:02:09saemSorry still not seeing it, nim.cfg in the various dirs, and $project.nim.cfg is all I've found. I want to be able to to do something like nim c --config:bar.nim.cfg foo.nim
23:06:52*Arrrrrrrr quit (Quit: Arrrrrrrr)
23:07:05saemMaybe that's not acceptable, but I gather when someone wants to target multiple platforms, and the support for it is a combination of tell the compiler to do things and in the code itself, having many cfgs to support the overall build matrix would help a lot.
23:08:07saemThe part I'm less sure about is the ability to include another cfg, so common parts of a build matrix can be factored out.
23:14:03FromGitter<gogolxdong> @saem does your plugin fix nimsgguest issue?
23:14:53FromGitter<gogolxdong> which exhausts memory.
23:15:04saem@gogolxdong only partially, the most noticeable thing it does is pass the backend explicitly, which helps in JS projects especially.
23:16:00saem@gogolxdong is this for the compiler or another code base?
23:16:37saemIn fairness, it sounds like a fundamental nimsuggest issue, which the vscode extension contributes nothing to.
23:17:25FromGitter<gogolxdong> not sure.it just resa
23:18:02FromGitter<gogolxdong> restarts many nimsuggest processes.
23:19:19saemIs this for a public code base on github I can take a quick look at or ... ?
23:20:41*fanta1 quit (Remote host closed the connection)
23:27:18*krux02 joined #nim
23:30:11FromGitter<gogolxdong> (https://files.gitter.im/5602f03e0fc9f982beb19f61/rShN/nimsuggest.png)
23:31:05FromDiscord<ElegantBeef> iirc one of the vscode implementations opens a nimsuggest per file in specific cases
23:32:21FromGitter<gogolxdong> (https://files.gitter.im/5602f03e0fc9f982beb19f61/jAdN/image.png)
23:32:34FromGitter<gogolxdong> yes, I'm using your plugin :)
23:33:03FromGitter<gogolxdong> (https://files.gitter.im/5602f03e0fc9f982beb19f61/7niR/image.png)
23:33:14FromGitter<gogolxdong> Is this should be checked?
23:36:57saem@gogolxdong you can specify settings for either nim.project to reduce the number of nimsuggest processes, the default is per file as ElegantBeef indicated.
23:38:41saemCheck the options here: https://github.com/saem/vscode-nim#options
23:39:03saemI'm trying to figure out a way to make that something that can be autodetected more, but various things make that very difficult
23:40:54FromGitter<gogolxdong> I'll try again.
23:43:18FromDiscord<ElegantBeef> Ah will be nice when you can just use nimsuggest as was intended 😄
23:43:32saemIt really will
23:44:42FromGitter<gogolxdong> @mratsim where is your last post ?
23:45:56FromGitter<gogolxdong> Is async/await going to be replaced by CPS?
23:51:05FromDiscord<notchris> merry holidays friends
23:53:09FromDiscord<Deleted User 5bd78114> Merry Xmas/Holidays to you too!
23:53:41miprimratsim's post is in https://github.com/nim-lang/RFCs/issues/295 ; async/await will just be using CPS
23:53:42disbotnext steps for CPS ; snippet at 12https://play.nim-lang.org/#ix=2Gti