<< 26-02-2021 >>

00:01:36FromDiscord<Rika> i think clear is for clearing the virtual buffer, and it does the diff when you tb.display
00:01:54FromDiscord<Rika> so you clear, rewrite everything, then display will diff with the current
00:05:08*krux02`` quit (Remote host closed the connection)
00:06:15*aenesidemus quit (Quit: Leaving)
00:06:48FromDiscord<ajusa> hm, maybe? I feel like tb.clear() would be mentioned then in the examples. And it still seems pretty wasteful to have run all the code I would have to redraw the entire screen every time there is any user input...
00:09:06FromDiscord<ajusa> https://github.com/johnnovak/illwill/issues/11 here it seems to say that I just need to clear the bits that were actually deleted by hand, guess I'll try that
00:09:18FromDiscord<ajusa> (edit) "https://github.com/johnnovak/illwill/issues/11 here it seems to say that I just need to clear ... the" added "(by writing)"
00:11:28*krux02 quit (Remote host closed the connection)
00:11:48FromDiscord<Rika> In reply to @ajusa "hm, maybe? I feel": welcome to immediate mode ui
00:12:17FromDiscord<Rika> though actually i dont think this is inherent in im ui
00:15:33FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2QSA
00:17:49*gangstacat quit (Ping timeout: 272 seconds)
00:20:38*Tanger joined #nim
00:32:13*gangstacat joined #nim
00:37:57FromDiscord<Rika> does nim have saturated math?
00:38:15FromDiscord<Rika> i already checked the stdlib and github, just asking in case i missed something somehow
00:40:16FromDiscord<Rika> https://github.com/nim-lang/Nim/blob/devel/compiler/saturate.nim cursed you not-exposed-to-stdlib module
00:40:35FromDiscord<Rika> is it safe to import this?
00:52:39FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2QSE
00:53:05*NimBot joined #nim
00:54:26FromDiscord<ShadowElf37> ah `static[int]` 🤦‍♂️
00:54:36FromDiscord<ShadowElf37> the error message really ought to be more helpful
00:55:43FromDiscord<dk> it's an actual internal error, not a message
00:55:50FromDiscord<InventorMatt> Make it a static int
00:56:19FromDiscord<konsumlamm> you should make a bug report though, internal errors shouldn't happen
00:56:34FromDiscord<dk> I'm surprised it crashes even with unspecified N (`Vector[N] = object`)
00:56:54FromDiscord<Rika> In reply to @dk "it's an actual internal": except usually it says `internal error` in the exception if it is, prolly a missed case in this case
00:57:09FromDiscord<Rika> unspecified N does not infer static i believe
00:58:06FromDiscord<ShadowElf37> i think its not bad that it doesnt infer static, but the fact that there's no helpful error is bad i think
00:58:43FromDiscord<Rika> https://nim-lang.org/docs/algorithm.html#binarySearch%2CopenArray%5BT%5D%2CK%2Cproc%28T%2CK%29 this was a very confusing proc, because "binary search" implies that the sequence must be sorted, but apparently it can do that even when the data is not sorted?
00:59:17FromDiscord<Rika> might be better to rename it?
00:59:28FromDiscord<konsumlamm> In reply to @ShadowElf37 "i think its not": again, it's an internal assertion failure, not a normal error message
00:59:52FromDiscord<Rika> In reply to @konsumlamm "again, it's an internal": and they know that, hence the "no" in "no helpful error"
01:00:25FromDiscord<konsumlamm> In reply to @Rika "https://nim-lang.org/docs/algorithm.html#binarySear": actually, it assumes that the seq is sorted...
01:00:26FromDiscord<Rika> its an uncaught edge case
01:00:31FromDiscord<konsumlamm> :P
01:00:37FromDiscord<konsumlamm> i fixed the example on devel
01:00:38FromDiscord<Rika> `assert binarySearch(["a", "b", "d", "c"], "d", system.cmp[string]) == 2`?
01:00:44FromDiscord<Rika> what the fuck then lmao
01:00:52FromDiscord<konsumlamm> that is just an edge case where it happens to work correctly
01:01:29FromDiscord<Rika> what do i use to search if its unsorted then? save for "implement it yourself" of course
01:01:34FromDiscord<konsumlamm> In reply to @Rika "and they know that,": i mean, it should be obvious that an internal error is bad, but whatever
01:02:00FromDiscord<konsumlamm> linear search
01:02:03FromDiscord<ShadowElf37> yeah but i, as the user of the language, am not going into the compiler code to fix the assertion lol
01:02:06FromDiscord<konsumlamm> just iterate over it ig
01:02:26FromDiscord<Rika> i mean yeah im just asking if there's anything already
01:02:35FromDiscord<konsumlamm> In reply to @ShadowElf37 "yeah but i, as": noone wants you to, just open an issue on github
01:04:08FromDiscord<konsumlamm> In reply to @Rika "i mean yeah im": https://nim-lang.org/docs/system.html#find%2CT%2CS
01:04:32FromDiscord<konsumlamm> just remembered that, that should do what you want
01:06:07FromDiscord<Rika> ok thanks
01:11:28*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:11:46*njoseph joined #nim
01:21:31FromDiscord<shirleyquirk> In reply to @konsumlamm "that is just an": it's not an edge case finding 'd', because the seq is sorted until that point. `binarySearch("abdc",'c')` fails to find c, of course
01:22:18FromDiscord<Rika> i keep on thinking youre mratsim btw
01:22:31FromDiscord<shirleyquirk> default icon
01:22:35FromDiscord<Rika> and if you're thinking "arent they different colors", i'm colorblind
01:23:17FromDiscord<shirleyquirk> both red as well!
01:23:31FromDiscord<Rika> huh ok then perhaps i am just stupid
01:23:48FromDiscord<Rika> just too paranoid about whether two colors are different or not ig
01:24:06FromDiscord<Rika> because i legitimately cant tell most of the time unless theyre obviously different
01:24:14FromDiscord<shirleyquirk> must be rubbish buying pesto
01:24:49FromDiscord<Rika> its rubbish buying anything thats only distinguished by another thing by whether its green or orange
01:24:54FromDiscord<Rika> red and gree
01:24:55FromDiscord<Rika> (edit) "gree" => "green"
01:24:58FromDiscord<Rika> blue and purple
01:25:05FromDiscord<Rika> pink and grey sometimes
01:25:28FromDiscord<shirleyquirk> oh man. that's next level colorblind
01:25:55FromDiscord<Rika> idk they say its just mild and tests just keep on saying its just mild red green but this shit doesnt sound mild
01:26:24FromDiscord<shirleyquirk> now i want to know what syntax highlighting theme you use
01:26:38FromDiscord<Rika> solarized dark
01:26:50FromDiscord<Rika> the colors are obviously different
01:27:11FromDiscord<Rika> to me, i dont know if it is to you
01:27:18ForumUpdaterBotNew thread by Treeform: Show Nim: Pixie, a fast 2D vector graphics library we are excited to share!, see https://forum.nim-lang.org/t/7559
01:27:36FromDiscord<shirleyquirk> solarized makes sense. makes my eyes hurt
01:28:19FromDiscord<Rika> oh wow pixie at 1.0 huh
01:28:23FromDiscord<Rika> congrats
01:28:25*abm quit (Read error: Connection reset by peer)
01:28:30FromDiscord<treeform> yes 🙂
01:28:31FromDiscord<Rika> oh WOW simd
01:28:32FromDiscord<treeform> thank you!
01:29:10*theelous3 quit (Read error: Connection reset by peer)
01:29:13FromDiscord<shirleyquirk> nice work treeform! spent today playing with fidget
01:29:15FromDiscord<Rika> yeah there was that one dude who asked for an image manip lib and someone else gave two options pixie and imageman and i said that i recommend imageman because i didnt know pixie xdddd
01:30:21FromDiscord<treeform> well now you know!
01:30:26FromDiscord<treeform> pixie for the win!
01:30:59FromDiscord<treeform> In reply to @shirleyquirk "nice work treeform! spent": thank you!, if you like fidget you will like what we have planned next 🙂
01:31:40FromDiscord<shirleyquirk> what's in the works?
01:31:57FromDiscord<Rika> ya got lanczos? if so i'll be sure to use pixie in the futue
01:33:24FromDiscord<treeform> No sorry, we don't do complex resampling yet. Just the basic one.
01:33:32FromDiscord<Rika> aya okay
01:33:36FromDiscord<guzba> (it is smooth though not blocky)
01:34:06FromDiscord<Rika> well ig yalls mainly focusing on vector
01:34:11FromDiscord<Rika> i'm in it for them raster yo
01:34:38FromDiscord<Rika> ah, i am speaking in difficult english again
01:35:52FromDiscord<treeform> we basically do mip map linear right now, its good enough for now, but it will get better.
01:36:20FromDiscord<Rika> its good enough for vector yeah but if i'm rescaling something thats already raster... 😛
01:37:37FromDiscord<treeform> what lib do you use?
01:38:05FromDiscord<Rika> i think it was imageman, and i patched in lanczos myself
01:38:57FromDiscord<Rika> yup imageman with my own lanczos
01:42:23FromDiscord<ElegantBeef> In reply to @treeform "thank you!, if you": Hmm sounds like a full pure nim GUI tk 😛
01:42:37FromDiscord<Ninjaa> In reply to @zero signal "its possible that you've": ah you're right forgot to account for this, I have it in my `.bashrc`. will have to see if this is only interactive/non-interactive or what
02:10:14FromDiscord<flywind> https://hisham.hm/2021/02/25/compiler-versus-transpiler-what-is-a-compiler-anyway
02:21:40FromDiscord<Rika> ?
02:21:54FromDiscord<Rika> a transpiler is a compiler
02:22:36FromGitter<xflywind> yeah, they mentioned Nim.
02:23:32FromDiscord<Rika> oh i didnt notice
02:23:36FromDiscord<Rika> i was still halfway
02:24:54FromDiscord<Rika> this is a nice article
02:25:03FromDiscord<Rika> thought it would have been one of those hn-rant shits or w/e
02:25:42FromDiscord<Rika> wait is this the dude who made htop or something
02:25:46*asdflkj quit (Quit: WeeChat 2.8)
02:26:06*asdflkj_ joined #nim
02:26:06FromDiscord<Rika> oh it fuckin is
02:29:41FromDiscord<exelotl> wow htop is so good
02:32:57*asdflkj_ quit (Ping timeout: 264 seconds)
02:41:17*blackpawn_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in)
02:42:34*blackpawn joined #nim
02:51:18FromDiscord<Pixtum> what's the difference between func and proc?
02:52:45FromDiscord<juan_carlos> `func` does not like side-effects, checks for side-effects at compile time, stuff like IO, mutating globals, etc.
02:53:26FromDiscord<juan_carlos> Like a math function.
02:53:29FromDiscord<Pixtum> ah
03:07:32FromDiscord<ajusa> another potential issue with illwill? Sometimes when I exit the program, some of the terminal styling stays? When I exit I do call `resetAttributes()` so I'm not sure why this is happening? https://media.discordapp.net/attachments/371759389889003532/814695113754279956/unknown.png
03:10:28FromDiscord<dk> Try resetting with https://nim-lang.org/docs/exitprocs.html#addExitProc,proc
03:13:24FromDiscord<ajusa> I might be missing something, I get `Error: cannot open file: exitprocs` when trying to import it. Is it only in devel or something? Nim 1.4.2
03:15:01FromDiscord<ajusa> jk turns out I should google for an issue before I ask for help, it is `std/exitprocs`
03:15:29FromDiscord<ajusa> Original issue still happens, doing `addExitProc(resetAttributes)`
03:15:34FromDiscord<Rika> yeah there should be an indication when you have to prefix with std or not
03:15:53FromDiscord<Rika> are you sure your terminal is not mishandling?
03:16:00FromDiscord<flywind> always use `std` 🙂
03:16:18FromDiscord<ajusa> In reply to @Rika "are you sure your": wdym? like is my terminal the one at fault, not my code?
03:17:18FromDiscord<ajusa> I can get it to happen in both rxvt-unicode and alacritty, so I don't think it is the terminal's fault
03:18:59FromDiscord<Rika> In reply to @ajusa "wdym? like is my": yeah sometimes terminals can be weird, but it doesnt seem so in your case
03:20:07FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2QTa
03:25:01FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2QTd
03:25:20FromDiscord<PizzaFox> (edit) "https://play.nim-lang.org/#ix=2QTd" => "https://play.nim-lang.org/#ix=2QTe"
03:28:39FromDiscord<ElegantBeef> `T: string | SomeNumber ` `T: string or SomeNumber` both are valid
03:30:14FromDiscord<ElegantBeef> Though i believe that in TS you can have a container of `Model` the nim version doesnt give that
03:30:45FromDiscord<PizzaFox> that's fine i'm just trying to represent a json blob that stores a number as `int` or `string`
03:30:53*muffindrake quit (Ping timeout: 260 seconds)
03:32:46*muffindrake joined #nim
03:35:24FromDiscord<PizzaFox> speaking of json
03:35:59FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2QTf
03:36:17FromDiscord<PizzaFox> how should i raise an exception that has that info in it
03:36:19FromDiscord<PizzaFox> (edit) "it" => "it?"
03:36:54FromDiscord<ElegantBeef> I believe you want to inherit from `CatchableError`
03:38:30FromDiscord<PizzaFox> would i have to set each field when creating my custom error object?
03:39:19FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2QTg
03:45:30FromDiscord<dk> putting spaces inside braces cringe or not? ex. `{ a: 1, b: 2, c: 3 }` instead of `{a: 1, b: 2, c: 3}`
03:45:44FromDiscord<dk> this is very important, I must know
03:48:21FromDiscord<ElegantBeef> The latter is what i do
03:51:30ForumUpdaterBotNew thread by YesDrX: Wrapper for GSL - GNU Scientific Library, see https://forum.nim-lang.org/t/7560
04:22:21FromDiscord<バロザード> is anybody trying to make a complier for nim that goes to straight assembly instead of c
04:22:38FromDiscord<ElegantBeef> There is nlvm which uses llvm instead of C
04:23:06FromDiscord<バロザード> is it good?
04:23:11FromDiscord<ElegantBeef> I dont use it
04:23:22FromDiscord<ElegantBeef> Not much benefit to using it afaik
04:24:59FromDiscord<バロザード> i seeee
04:30:05*spiderstew_ joined #nim
04:30:17*rockcavera quit (Remote host closed the connection)
04:32:43*spiderstew quit (Ping timeout: 276 seconds)
04:51:16FromDiscord<ajusa> Can someone help me figure out object inheritance here? https://play.nim-lang.org/#ix=2QTq↵I spent around 15 minutes searching around to see if I could find anything online for this. Basically, inheritance works as expected, but once I wrap a class in a seq it doesn't work.
04:57:05FromDiscord<Rika> In reply to @ElegantBeef "Not much benefit to": ~~just as much benefit as asking for a c compiler that goes straight to machine code than asm~~
05:03:14FromDiscord<ElegantBeef> @ajusa https://play.nim-lang.org/#ix=2QTt
05:03:34FromDiscord<ElegantBeef> You need to convert the first element to the type you want the seq to be else it takes whatever is there
05:09:36FromDiscord<ajusa> In reply to @ElegantBeef "You need to convert": Thank you so much, I understand how that works now!
05:10:01FromDiscord<ElegantBeef> The real question is always do you need inheritance or can you just use variants 😛
05:11:35FromDiscord<ajusa> In the case that I am trying to fill, I think inheritance makes since. It is a UI library that allows the user to specify a subtype of the base UI class, so that they can create `Car` and have it be compatible with all of the internal UI code.
05:15:10FromDiscord<ElegantBeef> Ah yea Nimx does something similar with inheritance 😄
05:16:34FromDiscord<ajusa> Thanks for the tip! I see that they have `Checkbox = ref object of Button` which is very similar to the idea I was trying to implement. This'll be a useful reference
05:17:51FromDiscord<PizzaFox> In reply to @バロザード "is anybody trying to": it this at all related to what you had in mind https://nim-lang.org/docs/nimc.html#compiler-usage-commandminusline-switches:~:text=%2D%2Dasm
05:18:07FromDiscord<PizzaFox> i asked before about what it does and didn't get a solid response
05:18:51FromDiscord<バロザード> that sounds right but also doesnt sound right lol
05:19:27*a_chou joined #nim
05:20:08FromDiscord<PizzaFox> it still emits a binary
05:20:16FromDiscord<PizzaFox> but with ✨ asm ✨
05:22:02FromDiscord<flywind> The asm codes generated by C compiler.
05:22:37FromDiscord<ElegantBeef> Yep, anything you find on the Nim compiler docs is going to be related to the compiler that nim invokes
05:22:57FromDiscord<flywind> You can use https://godbolt.org to view asm codesonline
05:25:59*a_chou quit (Remote host closed the connection)
05:26:27FromDiscord<flywind> https://godbolt.org/z/e61hTa
05:30:07FromDiscord<Rika> nice updated
05:33:26FromDiscord<flywind> In reply to @PizzaFox "i asked before about": PR is welcome to make docs clear.
06:16:24*antranigv_ quit (Ping timeout: 272 seconds)
06:26:27*narimiran joined #nim
06:45:13*hyiltiz__ quit (Quit: hyiltiz__)
07:02:08*krux02 joined #nim
07:06:51*krux02` joined #nim
07:11:10*Cthalupa- quit (Read error: Connection reset by peer)
07:11:28*Cthalupa joined #nim
07:48:38*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
07:48:54*bozaloshtsh joined #nim
07:48:55*bozaloshtsh quit (Changing host)
07:48:55*bozaloshtsh joined #nim
07:55:41*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
07:55:55*bozaloshtsh joined #nim
07:55:55*bozaloshtsh quit (Changing host)
07:55:55*bozaloshtsh joined #nim
07:58:35FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/814768357877219338/unknown.png
07:59:37FromDiscord<hamidb80> file descriptor?! @treeform
08:00:16FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/814768780227379230/unknown.png
08:01:04FromDiscord<hamidb80> is that wrong that i want to use async in thread?
08:19:23*PMunch joined #nim
08:22:31*krux02` quit (Remote host closed the connection)
08:22:31*krux02 quit (Remote host closed the connection)
08:36:25*MarderIII joined #nim
09:14:08*kitech1- quit (Quit: ZNC 1.7.5 - https://znc.in)
09:14:28*kitech1 joined #nim
09:19:11*antranigv joined #nim
09:49:40FromDiscord<Varriount> @hamidb80 Have you read any of the documentation on Nim's threading model?
09:50:08FromDiscord<Varriount> Araq: This might be of interest to you: https://storage.googleapis.com/justine/cosmopolitan/index.html
09:50:44FromDiscord<hamidb80> In reply to @Varriount "<@745944009918251010> Have you read": I didn't see anything about "threading model"
09:51:38FromDiscord<hamidb80> In reply to @hamidb80 "": Myble i should use `ref`
09:51:52FromDiscord<hamidb80> (edit) "Myble" => "Maybe"
09:52:07FromDiscord<Rika> https://nim-lang.org/docs/threads.html
09:52:15FromDiscord<Rika> https://nim-lang.org/docs/channels.html
09:52:24FromDiscord<Varriount> https://nim-lang.org/docs/manual.html#threads
09:52:34FromDiscord<Rika> https://nim-lang.org/docs/threadpool.html
09:52:58FromDiscord<hamidb80> In reply to @Rika "https://nim-lang.org/docs/channels.html": That's not threading model
09:53:12FromDiscord<Rika> its part
09:53:14FromDiscord<Rika> read it please
09:54:11FromDiscord<Varriount> Read the manual link first, then the other ones.
09:54:56FromDiscord<Varriount> > One day, while studying old code, I found out that it's possible to encode Windows Portable Executable files as a UNIX Sixth Edition shell script, due to the fact that the Thompson Shell didn't use a shebang line.
09:57:01FromDiscord<Rika> sounds cursed to me
09:57:05FromDiscord<Rika> oh its cosmopolitan
09:57:06FromDiscord<Varriount> sent a long message, see http://ix.io/2QUE
09:57:08FromDiscord<Rika> heard its a massive hack
09:57:48FromDiscord<Varriount> I don't know whether to be amazed or horrified
09:58:01FromDiscord<Rika> is it impossible to be both?
09:58:42FromDiscord<Varriount> Amazingly horrified? Horrifically amazed? Eh, I guess the latter makes sense.
09:58:59FromDiscord<Varriount> (edit)
10:13:48FromDiscord<shirleyquirk> poc||gtfo have done loads of crazy shit like that
10:15:11FromDiscord<Rika> ?
10:15:19FromDiscord<Rika> who? what?
10:15:28FromDiscord<shirleyquirk> issue 14 was a combined zip file, pdf, and nes rom
10:16:16FromDiscord<shirleyquirk> https://www.alchemistowl.org/pocorgtfo/pocorgtfo14.pdf
10:17:10FromDiscord<shirleyquirk> i think one was a laser display file
10:18:02*MarderIII quit (Ping timeout: 264 seconds)
10:18:22*MarderIII joined #nim
10:20:39FromDiscord<shirleyquirk> https://github.com/Polydet/polyglot-database
10:30:10*abm joined #nim
10:35:55FromDiscord<hamidb80> In reply to @hamidb80 "": sent a long message, see http://ix.io/2QV8
10:36:53FromDiscord<hamidb80> (edit) "http://ix.io/2QV8" => "http://ix.io/2QV9"
10:37:27FromDiscord<hamidb80> (edit) "http://ix.io/2QV9" => "http://ix.io/2QVc"
10:42:48FromDiscord<Varriount> In reply to @hamidb80 "can anyone check these": I'm about to go to bed, but it looks like you need to register the socket with the asynchronous dispatcher.↵Someone had some similar troubles a while back: https://gitter.im/nim-lang/Nim?at=5de6fa47f65fec1c8eb98220
10:43:45*abm quit (Ping timeout: 264 seconds)
10:43:51FromDiscord<Varriount> Anyway, good night! Don't let the polyglot programs bite. 😴
11:04:30*Tlangir joined #nim
11:06:47*Warkruid joined #nim
11:07:55*Tanger quit (Ping timeout: 276 seconds)
11:10:14*MarderIII quit (Ping timeout: 264 seconds)
11:10:41*ddl_smurf joined #nim
11:13:38FromDiscord<Yardanico> @Varriount fyi - you need to use @ to ping Araq since he's on Discord nowadays. And cosmopolitan has been posted at least 5 times already :P
11:15:10PMunchThat zipping thing reminds me of an old trick to hide things
11:15:49PMunchCreate a zip file, then grab a jpg image, concatenate the zip file on the end of the jpg image et voila
11:17:00PMunchImage viewers typically don't have a problem just showing the image, but there are only certain zip applications that actually follow the spec and read it as a valid zip file.
11:18:25PMunchOoh, the official FOSDEM video of my talk is up: http://bofh.nikhef.nl/events/FOSDEM/2021/D.declarative.minimalistic/nimdsl.webm
11:18:49PMunchIf you for some reason want to watch a re-encoded version with the sponsors of FOSDEM added as a last slide
11:20:27*Tlanger joined #nim
11:23:17*Tlangir quit (Ping timeout: 256 seconds)
11:49:31*narimiran quit (Ping timeout: 276 seconds)
12:04:26*Warkruid quit (Ping timeout: 240 seconds)
12:34:24*rockcavera joined #nim
12:46:34*Warkruid joined #nim
12:48:41*enneman__ joined #nim
12:52:24*Warkruid quit (Ping timeout: 240 seconds)
13:04:07*wasted_youth2 joined #nim
13:16:31FromDiscord<zetashift> Huh, I googled my error message: `Error: implicit object field construction requires a .partial object` and found my answer on a Gitter message from mratsim in 2018!
13:32:34*xet7 quit (Quit: Leaving)
13:32:53*Fake-Face quit (Ping timeout: 260 seconds)
13:34:02*xet7 joined #nim
13:38:58FromDiscord<carpal> drawentity https://media.discordapp.net/attachments/371759389889003532/814854016843382824/unknown.png
13:39:45FromDiscord<carpal> (edit) "drawentity ... https://media.discordapp.net/attachments/371759389889003532/814854016843382824/unknown.png" added "requires ColoredSquare = ref object of Entity"
13:39:51FromDiscord<carpal> and it is a method
13:41:29*vegai joined #nim
13:47:27PMunch@zetashift good thing the channel is logged :)
13:48:56PMunch@carpal, is Entity also ref object?
13:49:13PMunchBut that does sound a bit odd
13:49:26PMunchWait, it might be that Entity isn't exported or something like that
13:49:47FromDiscord<carpal> In reply to @PMunch "<@699146708466008115>, is Entity also": ref object of rootobj
13:50:04PMunchRight
13:50:23PMunchAnd is this all one file? Or do you have it split and imported?
13:51:39FromDiscord<carpal> yes
13:51:44FromDiscord<carpal> all in one
13:52:07PMunchThen I'm out of ideas :(
13:52:35FromDiscord<carpal> lol ahah
14:03:50*abm joined #nim
14:04:21ForumUpdaterBotNew post on r/nim by Kiloneie: Nim for Beginners video tutorial series, see https://reddit.com/r/nim/comments/lsy9rg/nim_for_beginners_video_tutorial_series/
14:11:53*Fish-Face joined #nim
14:12:12FromDiscord<mratsim> In reply to @zetashift "Huh, I googled my": I don't remember this error
14:12:43FromDiscord<mratsim> that's probably one of the most confusing error message in Nim
14:14:11*enneman__ quit (Quit: Leaving)
14:18:04FromDiscord<Araq> the real problem is that nobody knows what a .partial object is, I think
14:18:27FromDiscord<Araq> (well, ok, I do know, but I doubt it ever made it into the manual)
14:19:51FromDiscord<Araq> .partial objects and .liftlocals were designed to work together
14:20:16FromDiscord<Araq> and are the building blocks for "closures via macros"
14:21:13FromDiscord<Araq> it still seems like a good feature except for the lack of polish
14:21:54FromDiscord<zetashift> Yea I didn't get what a partial object was either, my fault was `var foo.bar = "blabla"` but it should have been just `foo.bar = "blabla"` silly mistake of mine but that error got me all confused
14:22:08FromDiscord<mratsim> you will have to explain because when i read partial I think about the object slicing error.
14:23:07FromDiscord<Araq> `var foo.bar = "x"` means "add a field of type string named 'bar' to the 'foo's object type"
14:23:24FromDiscord<Araq> "and then set its value to "x""
14:23:59FromDiscord<Araq> for this foo's object type must have been marked as `.partial`
14:24:13FromDiscord<Araq> so that it remains "open" for field additions
14:24:14FromDiscord<zetashift> Ah yea that wasn't what I intended to do ofcourse 😩
14:24:45FromDiscord<zetashift> but explained like that the error makes 100% sense
14:25:24FromDiscord<zetashift> But my first reaction is, what am I doing implicitly and what is a .partial object?
14:25:58FromDiscord<mratsim> that's interesting, but likely would need a RFC.
14:26:09FromDiscord<Araq> agreed.
14:26:10FromDiscord<mratsim> or ome document like the destructors decoument
14:26:19FromDiscord<mratsim> (edit) "ome" => "some" | "decoument" => "document"
14:27:02FromDiscord<Araq> years later the idea still looks like a very good one
14:27:07FromDiscord<Araq> so I shall write the RFC
14:27:24FromDiscord<Kiloneie> That is interesting, level editor/game engine hot swap coding usage comes to mind.
14:28:09FromDiscord<Araq> @Kiloneie unlikely to be useful for that, the object is eventually sealed, it's still all done at compile-time
14:30:19FromDiscord<Kiloneie> Idk ive seen some nimscripter or some other module be able to do some neat things with hot swap code. One day i will get to that. I wanna make a game in Nim one day. I think PMunch??? 's pure nim graphical library will be useful.
14:30:39ForumUpdaterBotNew thread by RainbowAsteroids: 'b' is not the first parameter, see https://forum.nim-lang.org/t/7561
14:31:07PMunchHuh?
14:31:18PMunchDo I have a pure Nim graphical library?
14:31:35*narimiran joined #nim
14:31:36FromDiscord<Yardanico> define "graphical"?
14:31:36FromDiscord<Kiloneie> Someone posted it a few days ago i cant remember
14:31:41FromDiscord<Araq> I think it's treeform et al
14:31:44FromDiscord<Yardanico> there are pixie, imageman and more I know of
14:31:47FromDiscord<Yardanico> https://github.com/treeform/pixie
14:31:50FromDiscord<Kiloneie> Ah yes treeform
14:32:43PMunchOh damn, that's cool
14:33:21PMunch@treeform, are you making all these cool libraries through work?
14:33:34FromDiscord<Yardanico> yes, he is
14:33:51FromDiscord<Yardanico> he and guzba are in the process of making some big undisclosed (yet) project and they are making all those libraries for it in the process
14:35:47FromDiscord<Kiloneie> Really nice
14:38:24PMunch@treeform, let me know if you need more people :)
14:40:40ForumUpdaterBotNew thread by Miran: New blog post: Multithreading flavors, see https://forum.nim-lang.org/t/7562
14:42:29FromDiscord<Araq> https://www.zdnet.com/article/ai-can-write-a-passing-college-paper-in-20-minutes/
14:46:53idfthat explains the duinocoin paper
14:57:53*haxscramper joined #nim
15:30:19FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/814882042319077376/unknown.png
15:30:41FromDiscord<carpal> I don't understand this runtime errore
15:30:43FromDiscord<carpal> (edit) "errore" => "error"
15:31:48FromDiscord<carpal> this happens only if I set the type on non ref
15:33:44*gpanders joined #nim
15:34:11FromDiscord<konsumlamm> you set the type?
15:37:23FromDiscord<carpal> assigned?
15:39:14FromDiscord<konsumlamm> it would be helpful if you just showed us the code
15:42:01FromDiscord<carpal> there's nothing to show, it is a type with a seq into it
15:42:43FromDiscord<carpal> In reply to @carpal "drawentity requires ColoredSquare =": moreover help me with this if you can
15:44:34FromDiscord<konsumlamm> there is nothing to show, but you get an error 🤔
15:45:03FromDiscord<konsumlamm> In reply to @carpal "moreover help me with": can't you show the full code?
15:45:37FromDiscord<carpal> I fixed it with ref object
15:45:45FromDiscord<carpal> I can think why it happens
15:45:55FromDiscord<carpal> In reply to @carpal "moreover help me with": this is more important
15:46:56FromDiscord<konsumlamm> In reply to @konsumlamm "can't you show the": ...
15:48:25Oddmongeras a neovim user, i've installed ale with nimlsp, which is great … most of the time
15:48:52Oddmongersometimes , i suddenly get errors in the editor, with no real reasons
15:49:23Oddmongerwhatever i do (removing and retyping, saving, reloading…) , the «fake» error doesn't go away
15:49:50Oddmongeronly solution: saving nvim session, and then relauching « nvim -S session »
15:50:00FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=2QWQ
15:50:14FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=2QWQ" => "https://play.nim-lang.org/#ix=2QWR"
15:50:32Oddmongeram i alone to have this problem ? It's completely random, sometimes even appears when loading a 3rd party source
15:51:28Oddmongerohh legacy opengl, isn't that cute
15:51:51FromDiscord<konsumlamm> In reply to @carpal "drawentity requires ColoredSquare =": nvm, you can't pass an `Entity` when it expects a `ColoredSquare` (or a subtype)
15:51:53FromDiscord<carpal> In reply to @Oddmonger "as a neovim user,": I've never used neovim or vim
15:52:42FromDiscord<carpal> In reply to @konsumlamm "nvm, you can't pass": ColoredSquare https://media.discordapp.net/attachments/371759389889003532/814887673981304852/unknown.png
15:52:43FromDiscord<carpal> gameitem https://media.discordapp.net/attachments/371759389889003532/814887678876057630/unknown.png
15:53:27FromDiscord<konsumlamm> and you try to pass a `GameItem` to `drawEntity`?
15:53:46FromDiscord<carpal> yes
15:53:54FromDiscord<konsumlamm> and why do you expect that to work?
15:54:13FromDiscord<carpal> because inherit works so
15:54:17FromDiscord<carpal> in c# it works lol
15:54:24FromDiscord<konsumlamm> it shouldn't
15:54:42FromDiscord<carpal> no toxic please
15:54:51FromDiscord<konsumlamm> i'm trying not to
15:55:05FromDiscord<konsumlamm> what happens if your `GameObject` is no `ColoredSquare`?
15:55:29FromDiscord<carpal> runtime error
15:55:44FromDiscord<carpal> okay so how to use `method`?
15:55:53FromDiscord<konsumlamm> i'm pretty sure that this wouldn't compile in C# either...
15:55:53FromDiscord<carpal> https://forum.nim-lang.org/t/3100
15:56:05FromDiscord<konsumlamm> you need to make an implementation for `GameObject`
15:56:15FromDiscord<carpal> I based my compiler all on inherit
15:56:17FromDiscord<konsumlamm> that works for any `GameObject`
15:56:32FromDiscord<konsumlamm> and then you can have a specialize implementation for `ColoredSquare`
15:57:50FromDiscord<carpal> In reply to @konsumlamm "you need to make": what are you talking about?
15:59:03FromDiscord<konsumlamm> sent a code paste, see https://paste.rs/KaF
15:59:15FromDiscord<carpal> ahhhh
15:59:24FromDiscord<carpal> just explain 😂
16:01:25FromDiscord<konsumlamm> that's what i tried lol
16:03:00FromDiscord<konsumlamm> i'm not sure what the `{.base.}` is for, but i would assume that it's only needed for `method drawEntity(entity: GameItem)`, i.e. only for the base case
16:05:49FromDiscord<carpal> yes
16:06:04FromDiscord<carpal> compiler said me to mantain it only in GameItem
16:07:24FromDiscord<konsumlamm> a small example of methods: <https://play.nim-lang.org/#ix=2QWW>
16:14:29*smitop joined #nim
16:18:02FromDiscord<carpal> thanks
16:31:19FromDiscord<konsumlamm> is there any documentation for new-style concepts?
16:41:41FromDiscord<Yardanico> @konsumlamm you can check the test file https://github.com/nim-lang/Nim/blob/devel/tests/concepts/tspec.nim and the RFC https://github.com/nim-lang/RFCs/issues/168
16:42:15FromDiscord<konsumlamm> ty
16:50:51ForumUpdaterBotNew thread by Comibat: Mixing Threads and Async, see https://forum.nim-lang.org/t/7563
16:52:41FromDiscord<treeform> In reply to @PMunch "Oh damn, that's cool": Unfortunately only some libraries are through work. Most are personal projects.
16:53:10PMunchBeats no libraries
16:53:43PMunchWell, I shouldn't complain too much. I am using some Nim at work
16:56:44FromDiscord<carpal> is there a way to make a ref object of rootobj to inherit from multiple ref objects?
16:57:03FromDiscord<carpal> something like this https://media.discordapp.net/attachments/371759389889003532/814903867099316234/unknown.png
16:57:42FromDiscord<Yardanico> multiple inheritance is not supported
16:57:48FromDiscord<Yardanico> and in that code example you don't need "RootObj" anyway
16:58:34FromDiscord<carpal> gameitem is inherited from other objects
16:58:36FromDiscord<carpal> so yes
16:58:41FromDiscord<carpal> (edit) "from other" => "byother"
16:58:45FromDiscord<carpal> (edit) "byother" => "by other"
16:59:33PMunchNo
17:00:13PMunchDimension inherits from RootObj then GameItem can inherit from Dimension and that can be inherited by other objects just fine
17:01:59FromDiscord<carpal> a bit annoying
17:02:22PMunchWhy?
17:05:28*PMunch quit (Quit: leaving)
17:06:32FromDiscord<hamidb80> In reply to @hamidb80 "can anyone check these": @treeform , do you have any idea?
17:08:42*letto_ quit (Quit: Konversation terminated!)
17:09:50FromDiscord<konsumlamm> iirc threads and async don't play well together in general
17:10:24FromDiscord<hamidb80> In reply to @konsumlamm "iirc threads and async": i don't think my code has problems
17:10:32FromDiscord<hamidb80> (edit) "In reply to @konsumlamm "iirc threads and async": i don't think my code has ... problems" added "any"
17:10:37*letto joined #nim
17:10:41FromDiscord<konsumlamm> and yet it throws an exception
17:11:15FromDiscord<treeform> yeah don't use threads or async together async is not thread safe
17:11:23FromDiscord<Yardanico> you can do it with manual code
17:11:25FromDiscord<Yardanico> like httpbeast
17:11:36FromDiscord<treeform> you are using ptr to pass websockets around, I don't think that works either
17:12:08FromDiscord<hamidb80> In reply to @hamidb80 "": this code doesn't word too
17:12:16FromDiscord<hamidb80> (edit) "word" => "work"
17:12:35FromDiscord<treeform> The way httpbeast is kind of "cheating" in a good way. It just starts an async reactor per thread. Like as if you just started multiple programs.
17:13:25FromDiscord<treeform> yeah async/waitFor can't work instead {.thread.}
17:13:42FromDiscord<treeform> (edit) "instead" => "inside"
17:13:46FromDiscord<hamidb80> thanks
17:14:03FromDiscord<treeform> You could do what httpbeast, but its way complex
17:14:31FromDiscord<treeform> you are better off running multiple nodes and have them communicate via DB like postgress or redis.
17:14:39FromDiscord<treeform> then you are multi machine too, not just multi thread
17:14:43FromDiscord<treeform> (that is what I do at work)
17:18:17FromDiscord<treeform> redis is async and has channels you can communicate between your nodes that way
17:18:43FromDiscord<treeform> instead of sending stuff to a nim channel and reading from a nim channel you do that with redis.
17:40:27*vicfred joined #nim
17:46:01FromDiscord<hamidb80> parallelism is more complex than i thougth
18:09:30FromDiscord<dom96> you barely ever need parallelism
18:09:43FromDiscord<mratsim> depends on what you do
18:10:22FromDiscord<dom96> well yes, but the cases where it is necessary are far less common than some think
18:10:34FromDiscord<dom96> and most people think they need parallelism when they don't
18:13:51FromDiscord<mratsim> You can't just say that, if you are just doing pipes copying data everywhere, sure. If you actually transform the data you might have CPU bound workflow.
18:14:24FromDiscord<mratsim> Even for network, encrypting/decrypting is something that can be tawing with lots of connections.
18:14:41FromDiscord<mratsim> but parallelism != concurrency != multithreading.
18:14:55FromDiscord<mratsim> and IO tasks != CPU tasks
18:14:59FromDiscord<mratsim> that is true.
18:15:21FromDiscord<mratsim> (edit) "tawing" => "struggling"
18:30:01*ddl_smurf quit (Quit: ddl_smurf)
18:34:37FromDiscord<zetashift> Maybe what dom was trying to say is that not a crazy amount of developers will ever hit the "lots of connections" phase?
18:38:57FromDiscord<zetashift> Is there anything like Elixirs atom(https://elixir-lang.org/getting-started/basic-types.html#atoms) in Nim?
18:42:06*asdflkj_ joined #nim
18:42:47FromDiscord<dom96> In reply to @mratsim "You can't just say": I don't see why I can't say that 🙂
18:43:02*asdflkj_ is now known as asdflkj
18:43:26FromDiscord<dom96> In reply to @zetashift "Maybe what dom was": yeah, that's a fair way to portray what I meant
18:47:32*asdflkj quit (Quit: WeeChat 2.8)
18:47:52*asdflkj_ joined #nim
18:57:57FromDiscord<j-james> So I'm a little confused about templates
18:59:02FromDiscord<j-james> If I'd like to do something like `#define echo print`, do I need to go through and find `echo`'s parameters, like so?
18:59:11FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2QXV
18:59:43FromDiscord<hamidb80> template print(x: untyped) =↵ echo x
18:59:47FromDiscord<hamidb80> i think
19:00:15FromDiscord<hamidb80> (edit) "template print(x: untyped) =↵ echo x" => "sent a code paste, see https://play.nim-lang.org/#ix=2QXW"
19:00:52FromDiscord<haxscramper> it is not possible to iterate over `varargs` using template, you need to either step up, (macro), or step down (proc)
19:01:22*asdflkj_ quit (Quit: WeeChat 2.8)
19:01:39*asdflkj joined #nim
19:01:39FromDiscord<haxscramper> `` proc print(x: varargs[string, `$`]) = echo x``
19:02:48FromDiscord<haxscramper> Nim templates do not allow for text-based substitutions like C, so you need to think in of them like functions basically, not token-based replacements
19:03:56*smitop quit (Quit: Connection closed for inactivity)
19:04:14*literal quit (Read error: Connection reset by peer)
19:07:34FromDiscord<Araq> `varargs` are a bit broken because we the type conversion rules are defective and predate macros.unpackVarargs
19:08:14FromDiscord<Araq> to make matters worse we don't have an RFC how to fix them (but it likely involves simply removing code from the compiler)
19:08:59FromDiscord<Araq> unpackVarargs works well though
19:09:27FromDiscord<j-james> Thanks @hamidb80 , I forgot about `untyped`
19:10:39FromDiscord<Araq> sent a code paste, see https://play.nim-lang.org/#ix=2QY3
19:12:17*idf left #nim ("ERC (IRC client for Emacs 27.1)")
19:18:57*superbia joined #nim
19:22:23*hyiltiz joined #nim
19:33:07FromDiscord<memebob> if i wanted to store some values on a cli tool in nim securely on a linux host (ltotp keys/secrets) what would be the best option? i.e an encrypted file
19:33:53FromDiscord<memebob> it's not nim specific per se, but i don't know what libraries to use or how to approach this
19:36:24FromDiscord<Araq> me neither but you can look at how Firefox stores passwords, iirc it's well documented
19:37:06FromDiscord<memebob> ok i'll check it out, thanks
19:38:56FromDiscord<carpal> has anyone some idea about how to convert nanoseconds to seconds and nanoseconds?
19:39:30FromDiscord<carpal> something like↵nanoseconds = 1000023...↵result = 1.00023..
19:41:07FromDiscord<Anonymous Poet> just multiply them? whats the issue?
19:41:33FromDiscord<Anonymous Poet> does anyone know if nim supports assignment + checking in the while loop condition?
19:42:05FromDiscord<Yardanico> if I understood you correctly, yes
19:42:34FromDiscord<carpal> In reply to @Anonymous Poet "just multiply them? whats": multiply what?
19:42:53FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2QYB
19:42:57FromDiscord<Yardanico> @carpal multiply the value
19:43:09FromDiscord<Yardanico> just multiply nanoseconds by 1_000_000_000 and you will get seconds
19:43:13FromDiscord<Yardanico> and vice-versa
19:43:20FromDiscord<Anonymous Poet> yeah
19:43:24FromDiscord<Yardanico> nano is the SI prefix for 10^-9
19:43:34FromDiscord<carpal> In reply to @Anonymous Poet "like ```nim while let": while (var obj: type; obj).isSome() ?
19:43:36FromDiscord<carpal> (edit) "obj).isSome()" => "obj).isSome"
19:43:49FromDiscord<carpal> In reply to @Yardanico "just multiply nanoseconds by": divide?
19:43:59FromDiscord<Yardanico> multiply nanoseconds by this value to get seconds
19:44:04FromDiscord<Yardanico> divide seconds by this value to get nanoseconds
19:44:05FromDiscord<Yardanico> basic math :)
19:44:14FromDiscord<carpal> but how ... what?
19:44:17FromDiscord<Yardanico> ????????????????
19:44:18FromDiscord<carpal> divide lol
19:44:21FromDiscord<Yardanico> `/`
19:44:32FromDiscord<carpal> not multiply
19:44:46FromDiscord<carpal> anyway, I need a float
19:44:49FromDiscord<Yardanico> you probably haven't slept for too long
19:45:19FromDiscord<carpal> I've this, and now? https://media.discordapp.net/attachments/371759389889003532/814946214319489034/unknown.png
19:45:22FromDiscord<carpal> I need seconds
19:45:36FromDiscord<hamidb80> 😕
19:45:55FromDiscord<Yardanico> @carpal are you actually ok? :P
19:46:00FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2QYD
19:46:02FromDiscord<carpal> brooo
19:46:12FromDiscord<carpal> you didn't understand what I need
19:46:22FromDiscord<Yardanico> "has anyone some idea about how to convert nanoseconds to seconds and nanoseconds?"
19:46:26FromDiscord<Yardanico> you already get nanoseconds for free
19:46:31FromDiscord<Yardanico> argh
19:46:32FromDiscord<Yardanico> look
19:46:34FromDiscord<Yardanico> its simple math still
19:46:45FromDiscord<carpal> In reply to @Yardanico ""has anyone some idea": nanoseconds -> seconds.nanoseconds
19:47:28FromDiscord<carpal> nanoseconds = 100001↵result I want = 1.0001 (seconds.nanoseconds)
19:47:29FromDiscord<hamidb80> In reply to @carpal "nanoseconds -> seconds.nanoseconds": what's that
19:47:52FromDiscord<Solitude> ????
19:47:58FromDiscord<hamidb80> In reply to @carpal "nanoseconds = 100001 result": that's not nanoseconds
19:48:16FromDiscord<Yardanico> @carpal explain what do you need those for
19:48:20FromDiscord<Yardanico> it seems like an x y problem
19:48:30FromDiscord<carpal> I need the a float reppresenting the seconds dot milli, micro, nanos
19:48:37FromDiscord<Yardanico> you already get one
19:48:38FromDiscord<Yardanico> for free
19:48:47FromDiscord<Yardanico> it's in the seconds already
19:48:52FromDiscord<Yardanico> since it's a FLOAT
19:48:53FromDiscord<carpal> yes...
19:48:55FromDiscord<Yardanico> yes
19:48:59FromDiscord<Yardanico> do you need one float or multiple floats?
19:49:23FromDiscord<hamidb80> > I need the a float reppresenting the seconds dot milli, micro, nanos
19:49:37FromDiscord<carpal> but I need a float where the part before the comma is the second and after the comma the milliseconds
19:49:51FromDiscord<Yardanico> but why
19:49:53FromDiscord<Yardanico> i mean
19:49:56FromDiscord<Yardanico> it already is like that by default
19:50:05FromDiscord<Solitude> In reply to @carpal "but I need a": thats not how floats work
19:50:07FromDiscord<Yardanico> let seconds = 1.0101 # 1 second and 101 ms
19:50:19FromDiscord<Yardanico> sorry 10 ms
19:50:25FromDiscord<Yardanico> 10.1 ms
19:50:27FromDiscord<carpal> In reply to @Yardanico "let seconds = 1.0101": yea ok
19:50:30FromDiscord<carpal> I need this
19:50:33FromDiscord<Yardanico> ?????????????
19:50:51FromDiscord<Yardanico> I honestly have no clue what are you trying to get :P
19:50:55FromDiscord<hamidb80> In reply to @carpal "I need this": you need what
19:50:55FromDiscord<carpal> like delta time
19:51:10FromDiscord<Yardanico> let deltaTime = newSeconds - oldSeconds
19:51:25FromDiscord<carpal> but it is not accurate
19:51:36FromDiscord<carpal> seconds are int
19:51:37FromDiscord<Yardanico> for accurate representation use timeinterval from times
19:51:38FromDiscord<Solitude> let deltaTime = newTime - oldTime
19:51:47FromDiscord<carpal> yes...
19:51:51FromDiscord<Yardanico> use timeinternval
19:51:54FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/814947868573171762/unknown.png
19:51:58FromDiscord<carpal> I already did this
19:52:12FromDiscord<Solitude> so, whats the problem?
19:52:31FromDiscord<hamidb80> i can't even guess your problem
19:52:51FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2QYH
19:52:55FromDiscord<Yardanico> deltaTime is a TimeInterval object then
19:52:57FromDiscord<Yardanico> https://nim-lang.org/docs/times.html#TimeInterval
19:53:13FromDiscord<Yardanico> in your case you don't need to do `initTimeInterval` just save oldTime and newTime, and calculate `deltaTime` as the difference between the two
19:53:44FromDiscord<carpal> In reply to @Yardanico "<@!699146708466008115> ```nim import": why + 3 seconds 5 nanos and 15 millis?
19:53:50FromDiscord<Yardanico> JUST TO SHOW HOW IT WORKS
19:53:54FromDiscord<Yardanico> In reply to @Yardanico "in your case you": ^
19:54:04FromDiscord<carpal> yes... I just tried it
19:54:11FromDiscord<carpal> but it is not what I nedd
19:54:12FromDiscord<carpal> (edit) "nedd" => "nee"
19:54:13FromDiscord<carpal> (edit) "nee" => "need"
19:54:16FromDiscord<Yardanico> but what do you actually need
19:54:23FromDiscord<carpal> do you know how delta time works?
19:54:24FromDiscord<Yardanico> 3 people failed to understand the actual problem you're facing
19:54:31FromDiscord<Solitude> In reply to @carpal "do you know how": do you?
19:54:36FromDiscord<carpal> ahha
19:54:53FromDiscord<Yardanico> @carpal delta time is Δtime = newTime - oldTime
19:54:56FromDiscord<Yardanico> that's why it's DELTA
19:55:02FromDiscord<Yardanico> "difference" (-) between two values
19:55:21FromDiscord<carpal> yes okay, if it is so simple show me in playground echo delta
19:55:32*idf joined #nim
19:55:42FromDiscord<Yardanico> sent a code paste, see https://paste.rs/toB
19:55:43FromDiscord<Yardanico> here you go, `deltaTime` is actually delta time
19:56:46FromDiscord<carpal> this is not a float delta time https://media.discordapp.net/attachments/371759389889003532/814949096598667284/unknown.png
19:57:04FromDiscord<Yardanico> ok, I give up, maybe others will be able to help you but not me, I have no clue about your issue :)
19:57:06FromDiscord<carpal> void onupdate(float delta) {↵↵}
19:58:32FromDiscord<hamidb80> In reply to @Yardanico "ok, I give up,": good try
20:00:20FromDiscord<hamidb80> In reply to @carpal "void onupdate(float delta) {": turn it into float
20:00:27FromDiscord<carpal> ahhah duration?
20:00:35FromDiscord<carpal> okay how to?
20:01:08FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2QYL
20:02:19FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2QYM
20:02:42FromDiscord<hamidb80> In reply to @hamidb80 "```nim Duration = object": https://nim-lang.org/docs/times.html#Duration
20:03:16FromDiscord<hamidb80> i really dont know what you are trying to do
20:03:38FromDiscord<hamidb80> but if you wanna convert `Duration` to `float` that works
20:03:54FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=2QYM" => "https://play.nim-lang.org/#ix=2QYN"
20:04:08FromDiscord<carpal> In reply to @hamidb80 "```nim func duration2float (du:": proc seconds requires an int
20:04:21FromDiscord<carpal> ah inSeconds maybe
20:04:34FromDiscord<hamidb80> In reply to @carpal "proc seconds requires an": ?!
20:05:02FromDiscord<hamidb80> In reply to @hamidb80 "```nim Duration = object": `seconds` is not a proc, it's a property
20:05:11FromDiscord<carpal> ah, it does not work
20:05:51FromDiscord<carpal> maybe it is private
20:07:49FromDiscord<hamidb80> In reply to @hamidb80 "```nim Duration = object": you're write it's private
20:09:09FromDiscord<hamidb80> (edit) "write" => "right"
20:18:25FromDiscord<carpal> ok it worked
20:24:32*JustASlacker joined #nim
20:26:14JustASlackerhello peoples of nim
20:26:35asdflkjhi
20:26:38JustASlackerdo I have to declare each and every field of an object with * to export it?
20:26:43*JustASlacker waves
20:26:54FromDiscord<Yardanico> yes, you do
20:26:59JustASlackerbummer
20:27:01FromDiscord<Yardanico> because usually you don't want to export a lot of fields
20:27:35*asdflkj wonders if CTCP actions are bridged to Discord and Gitter
20:27:39JustASlackeris that so? I just declared an object Certificate, which just holds data about x509 certs
20:27:56JustASlackerand pretty much any field should be accessible
20:28:02FromDiscord<Yardanico> @asdflkj without the special me stuff, but they are
20:28:04FromDiscord<Yardanico> to discord at least
20:28:32JustASlackerisnt gitter matrix now
20:28:37FromDiscord<Yardanico> not really
20:28:59asdflkjhttps://matrix.org/blog/2020/12/07/gitter-now-speaks-matrix
20:29:02FromDiscord<Yardanico> like you can connect to Gitter rooms from Matrix, but you still can't bridge Gitter as if it would just been Matrix
20:29:10FromDiscord<Yardanico> that's why we're still using that FromGitter bridge
20:29:34asdflkjgitter is going to become matrix, but only when matrix has all of gitter's features (IIUC)
20:31:05*superbia quit (Quit: WeeChat 3.0)
20:33:45haxscramperHow I can create `ref seq[T]` using `newSeq[T]()`? I know that `ref seq` is really strange, but I think I have specific reasons to use that (or `ptr` which is probably worse overall in my case).
20:35:22JustASlackerwell I kinda like gitte but matrix looks nice
20:35:23FromDiscord<Yardanico> var myRefSeq: ref seq[int]; myRefSeq[] = newSeq[int]()
20:35:37FromDiscord<Yardanico> ah actually wait
20:35:54FromDiscord<Yardanico> var myRefSeq = new(seq[int])
20:35:55FromDiscord<Yardanico> just this is enough
20:36:25FromDiscord<Yardanico> !eval var myRefSeq = new(seq[int]); myRefSeq[].add(5); echo myRefSeq[]
20:36:27NimBot@[5]
20:36:36haxscramperNo your first answer was perfect, I actually need `newSeq` with number of elements
20:36:47haxscramperThanks, I completely forgot about assign to dereference
20:36:59FromDiscord<Yardanico> well my first example is invalid because you need to allocate it first anyway
20:37:08FromDiscord<Yardanico> so if you want with number of elements its
20:37:13FromDiscord<Yardanico> var myRefSeq = new(seq[int]); myRefSeq[] = newSeq[int]()
20:37:50FromDiscord<Yardanico> Nim does automatic dereference for dot access but not for seqs :)
20:38:18FromDiscord<Yardanico> err, actually no, it's because add is a proc and not a field
20:38:45haxscramperAutomatic dereference for procs is experimental IIRC
20:39:01FromDiscord<Yardanico> yeah, it's behind an experimental switch
20:39:09haxscramperBut semcheck tries all overload twice, at least if I remember that part correctly
20:40:12haxscramperAh, yes `elif implicitDeref in c.features and canDeref(n):` < only with that one, so yes, only with experimental implicit deref
20:41:59FromDiscord<Yardanico> you could've just read the manual to get the same info :P
20:42:55haxscramperActually with sourcetrail it is faster
20:43:04FromDiscord<hamidb80> i don't think the problem is from using `async` in a `thread`, I think it's a problem with websocket library↵↵this code works fine. https://media.discordapp.net/attachments/371759389889003532/814960743589216326/unknown.png
20:43:56FromDiscord<konsumlamm> just because async in thread works fine sometimes, doesn't mean it works together in general
20:44:11haxscramperThis is basically Ctrl+F, but since I remember this is a `semOverloadedCall`, it took me a couple secons overall. But I don't have experimental manual link quickly and have to google this each time, so
20:44:15FromDiscord<hamidb80> In reply to @hamidb80 "": .
20:44:26*Vladar joined #nim
20:44:49FromDiscord<Yardanico> @hamidb80 as people said multiple times, async doesn't actually work with threads the way you want it to work
20:44:57FromDiscord<Yardanico> you can't await a future from another thread for example
20:45:12FromDiscord<Yardanico> since the async dispatcher is thread local
20:47:00*ForumUpdaterBot quit (Remote host closed the connection)
20:47:12*ForumUpdaterBot joined #nim
20:48:02FromDiscord<treeform> I wish threads+async in Nim was easier to use.
20:48:21FromDiscord<treeform> Even just threads without async easier to use...
20:48:39FromDiscord<XxDiCaprioxX> hey, does anyone here by chance know what a DiscordFile is? if not that's also fine
20:49:01FromDiscord<treeform> When you send a file through the Discord app?
20:49:26FromDiscord<XxDiCaprioxX> but is the type the same for all languages or like a nim exclusive thing?
20:49:28FromDiscord<Yardanico> @XxDiCaprioxX maybe you can provide more context?
20:49:36FromDiscord<Yardanico> is that about dimscord?
20:49:54FromDiscord<XxDiCaprioxX> In reply to @Yardanico "is that about dimscord?": if I reply with yes, will you tell me to ask in the dimscord dc server?
20:50:29FromDiscord<XxDiCaprioxX> because yes it is
20:50:30FromDiscord<Solitude> In reply to @XxDiCaprioxX "if I reply with": read the docs
20:50:47FromDiscord<Yardanico> @XxDiCaprioxX if I were you I'd just check dimscord src to see how it uses DiscordFile
20:50:59FromDiscord<hamidb80> In reply to @treeform "I wish threads+async in": could you implement something like `tryReceivePacket` like channels?
20:51:01FromDiscord<XxDiCaprioxX> I read the docs but I must have somehow skipped over it by accident cuz I was unable to find it
20:51:12FromDiscord<XxDiCaprioxX> but I'll just have a look again
20:51:21FromDiscord<Yardanico> and to answer the question - yes, that's dimscord specific
20:51:22FromDiscord<Solitude> by docs i mean source, and by read i mean ctrl+f
20:51:30FromDiscord<Yardanico> it's an abstraction over discord's executewebhook
20:51:32FromDiscord<Yardanico> https://discord.com/developers/docs/resources/webhook#execute-webhook
20:51:37FromDiscord<Yardanico> https://github.com/krisppurg/dimscord/blob/master/dimscord/restapi/message.nim#L204
20:51:46FromDiscord<Yardanico> easy to find even with github's search
20:51:55FromDiscord<XxDiCaprioxX> In reply to @Yardanico "and to answer the": okay thanks
20:52:10FromDiscord<XxDiCaprioxX> In reply to @Solitude "by docs i mean": yeah I know that, prolly skipped a file by accident before
20:52:48FromDiscord<XxDiCaprioxX> what is a `refObject`?
20:52:57*krux02 joined #nim
20:53:08FromDiscord<Yardanico> `ref object` is a heap-allocated object
20:53:19FromDiscord<Yardanico> have you read nim's tutorials and nim basics?
20:53:26FromDiscord<XxDiCaprioxX> yes and no
20:53:44FromDiscord<Yardanico> https://nim-lang.org/docs/tut1.html#advanced-types-reference-and-pointer-types
20:53:56FromDiscord<XxDiCaprioxX> I know some stuff but idk what heap-allocated object means for example. anyways I assume I dont need to know it to make the application work
20:54:52FromDiscord<XxDiCaprioxX> hmmm, discord file has `name, body: string` as attributes. assuming body is the content, do I need some kind of conversion to turn my file into a string?
20:55:19FromDiscord<XxDiCaprioxX> (edit) "I" => "~~I" | "work" => "work~~ aight I know that now, too"
21:08:42*asdflkj quit (Ping timeout: 246 seconds)
21:12:42*rauss joined #nim
21:13:19FromDiscord<treeform> In reply to @hamidb80 "could you implement something": sorry i don't know the async/threading that well, i would not be the right person to implement that
21:32:03*narimiran quit (Quit: leaving)
21:38:10FromDiscord<mratsim> no ones know
21:38:14FromDiscord<mratsim> it's a mystery
21:38:24FromDiscord<Rika> spooky
21:38:36*JustASlacker quit (Ping timeout: 240 seconds)
21:55:51*haxscramper quit (Remote host closed the connection)
22:23:25*krux02` joined #nim
22:31:52*theelous3 joined #nim
22:43:41*krux02`` joined #nim
22:47:36*krux02` quit (Remote host closed the connection)
22:47:52*krux02` joined #nim
22:52:29FromDiscord<バロザード> so whats the differences between matrix and discord
22:52:42*Vladar quit (Quit: Leaving)
22:54:08liblq-devmatrix is free and open-source and discord is proprietary
22:54:12liblq-devis one way to put it
22:55:10FromDiscord<バロザード> do they have the same features
22:55:19nxnl[m]matrix is also federated and a protocol implemented by several clients and at least two server
22:57:05FromDiscord<バロザード> so if discord shuts down tomorrow, everyone could move over to matrix clients and nothing much would change?
22:57:08FromDiscord<ElegantBeef> Element is mostly on feature parity as discord
22:57:27FromDiscord<ElegantBeef> The major issue is just that it lacks a channelled voip solution intergrated
22:57:47FromDiscord<バロザード> by that you mean?
22:58:37liblq-devgood voice chat.
22:58:48FromDiscord<ElegantBeef> I mean it doesnt have anything like mumble or discord voip intergrated
22:58:55liblq-devit also lacks the discord notion of "servers"
22:59:06liblq-devthere are communities but they're a bit half-baked
22:59:16liblq-devand they're working on something new
22:59:31FromDiscord<バロザード> aw man
22:59:39FromDiscord<バロザード> voice chat is what makes discord discord
23:00:35*xet7 quit (Remote host closed the connection)
23:00:59FromDiscord<ElegantBeef> Well element has voip but it's currently using jitsi for group calls so it's very meh
23:02:51liblq-devyeah
23:03:15liblq-devthe experience can be summarized as "meh" compared to discord, but bear in mind that discord has a commercial company working behind it.
23:03:51liblq-devalso, the arguably worse experience prevents you from peeking at your chat client every 8 seconds, so that's a win for me.
23:19:14*krux02`` quit (Remote host closed the connection)
23:24:30FromDiscord<ElegantBeef> Well Element is commercial company as well just smaller, though they're just a first party implementation of the matrix protocol
23:38:30*krux02` quit (Remote host closed the connection)
23:41:56*krux02 quit (Remote host closed the connection)
23:42:57FromDiscord<Yardanico> made this work
23:43:02FromDiscord<Yardanico> sent a code paste, see https://paste.rs/OQx
23:43:17FromDiscord<Yardanico> its just a macro bro 👀
23:44:06FromDiscord<ElegantBeef> Well of course
23:44:57*antranigv quit (Ping timeout: 264 seconds)
23:46:28FromDiscord<Yardanico> my implementation is very cursed though, but it works
23:56:03FromDiscord<exelotl> me gusta
23:56:36*theelous3 quit (Read error: Connection reset by peer)
23:57:03*theelous3 joined #nim
23:58:51*antranigv joined #nim