00:01:36 | FromDiscord | <Rika> i think clear is for clearing the virtual buffer, and it does the diff when you tb.display |
00:01:54 | FromDiscord | <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:48 | FromDiscord | <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:06 | FromDiscord | <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:18 | FromDiscord | <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:48 | FromDiscord | <Rika> In reply to @ajusa "hm, maybe? I feel": welcome to immediate mode ui |
00:12:17 | FromDiscord | <Rika> though actually i dont think this is inherent in im ui |
00:15:33 | FromDiscord | <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:57 | FromDiscord | <Rika> does nim have saturated math? |
00:38:15 | FromDiscord | <Rika> i already checked the stdlib and github, just asking in case i missed something somehow |
00:40:16 | FromDiscord | <Rika> https://github.com/nim-lang/Nim/blob/devel/compiler/saturate.nim cursed you not-exposed-to-stdlib module |
00:40:35 | FromDiscord | <Rika> is it safe to import this? |
00:52:39 | FromDiscord | <ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2QSE |
00:53:05 | * | NimBot joined #nim |
00:54:26 | FromDiscord | <ShadowElf37> ah `static[int]` 🤦♂️ |
00:54:36 | FromDiscord | <ShadowElf37> the error message really ought to be more helpful |
00:55:43 | FromDiscord | <dk> it's an actual internal error, not a message |
00:55:50 | FromDiscord | <InventorMatt> Make it a static int |
00:56:19 | FromDiscord | <konsumlamm> you should make a bug report though, internal errors shouldn't happen |
00:56:34 | FromDiscord | <dk> I'm surprised it crashes even with unspecified N (`Vector[N] = object`) |
00:56:54 | FromDiscord | <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:09 | FromDiscord | <Rika> unspecified N does not infer static i believe |
00:58:06 | FromDiscord | <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:43 | FromDiscord | <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:17 | FromDiscord | <Rika> might be better to rename it? |
00:59:28 | FromDiscord | <konsumlamm> In reply to @ShadowElf37 "i think its not": again, it's an internal assertion failure, not a normal error message |
00:59:52 | FromDiscord | <Rika> In reply to @konsumlamm "again, it's an internal": and they know that, hence the "no" in "no helpful error" |
01:00:25 | FromDiscord | <konsumlamm> In reply to @Rika "https://nim-lang.org/docs/algorithm.html#binarySear": actually, it assumes that the seq is sorted... |
01:00:26 | FromDiscord | <Rika> its an uncaught edge case |
01:00:31 | FromDiscord | <konsumlamm> :P |
01:00:37 | FromDiscord | <konsumlamm> i fixed the example on devel |
01:00:38 | FromDiscord | <Rika> `assert binarySearch(["a", "b", "d", "c"], "d", system.cmp[string]) == 2`? |
01:00:44 | FromDiscord | <Rika> what the fuck then lmao |
01:00:52 | FromDiscord | <konsumlamm> that is just an edge case where it happens to work correctly |
01:01:29 | FromDiscord | <Rika> what do i use to search if its unsorted then? save for "implement it yourself" of course |
01:01:34 | FromDiscord | <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:00 | FromDiscord | <konsumlamm> linear search |
01:02:03 | FromDiscord | <ShadowElf37> yeah but i, as the user of the language, am not going into the compiler code to fix the assertion lol |
01:02:06 | FromDiscord | <konsumlamm> just iterate over it ig |
01:02:26 | FromDiscord | <Rika> i mean yeah im just asking if there's anything already |
01:02:35 | FromDiscord | <konsumlamm> In reply to @ShadowElf37 "yeah but i, as": noone wants you to, just open an issue on github |
01:04:08 | FromDiscord | <konsumlamm> In reply to @Rika "i mean yeah im": https://nim-lang.org/docs/system.html#find%2CT%2CS |
01:04:32 | FromDiscord | <konsumlamm> just remembered that, that should do what you want |
01:06:07 | FromDiscord | <Rika> ok thanks |
01:11:28 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:11:46 | * | njoseph joined #nim |
01:21:31 | FromDiscord | <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:18 | FromDiscord | <Rika> i keep on thinking youre mratsim btw |
01:22:31 | FromDiscord | <shirleyquirk> default icon |
01:22:35 | FromDiscord | <Rika> and if you're thinking "arent they different colors", i'm colorblind |
01:23:17 | FromDiscord | <shirleyquirk> both red as well! |
01:23:31 | FromDiscord | <Rika> huh ok then perhaps i am just stupid |
01:23:48 | FromDiscord | <Rika> just too paranoid about whether two colors are different or not ig |
01:24:06 | FromDiscord | <Rika> because i legitimately cant tell most of the time unless theyre obviously different |
01:24:14 | FromDiscord | <shirleyquirk> must be rubbish buying pesto |
01:24:49 | FromDiscord | <Rika> its rubbish buying anything thats only distinguished by another thing by whether its green or orange |
01:24:54 | FromDiscord | <Rika> red and gree |
01:24:55 | FromDiscord | <Rika> (edit) "gree" => "green" |
01:24:58 | FromDiscord | <Rika> blue and purple |
01:25:05 | FromDiscord | <Rika> pink and grey sometimes |
01:25:28 | FromDiscord | <shirleyquirk> oh man. that's next level colorblind |
01:25:55 | FromDiscord | <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:24 | FromDiscord | <shirleyquirk> now i want to know what syntax highlighting theme you use |
01:26:38 | FromDiscord | <Rika> solarized dark |
01:26:50 | FromDiscord | <Rika> the colors are obviously different |
01:27:11 | FromDiscord | <Rika> to me, i dont know if it is to you |
01:27:18 | ForumUpdaterBot | New 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:36 | FromDiscord | <shirleyquirk> solarized makes sense. makes my eyes hurt |
01:28:19 | FromDiscord | <Rika> oh wow pixie at 1.0 huh |
01:28:23 | FromDiscord | <Rika> congrats |
01:28:25 | * | abm quit (Read error: Connection reset by peer) |
01:28:30 | FromDiscord | <treeform> yes 🙂 |
01:28:31 | FromDiscord | <Rika> oh WOW simd |
01:28:32 | FromDiscord | <treeform> thank you! |
01:29:10 | * | theelous3 quit (Read error: Connection reset by peer) |
01:29:13 | FromDiscord | <shirleyquirk> nice work treeform! spent today playing with fidget |
01:29:15 | FromDiscord | <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:21 | FromDiscord | <treeform> well now you know! |
01:30:26 | FromDiscord | <treeform> pixie for the win! |
01:30:59 | FromDiscord | <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:40 | FromDiscord | <shirleyquirk> what's in the works? |
01:31:57 | FromDiscord | <Rika> ya got lanczos? if so i'll be sure to use pixie in the futue |
01:33:24 | FromDiscord | <treeform> No sorry, we don't do complex resampling yet. Just the basic one. |
01:33:32 | FromDiscord | <Rika> aya okay |
01:33:36 | FromDiscord | <guzba> (it is smooth though not blocky) |
01:34:06 | FromDiscord | <Rika> well ig yalls mainly focusing on vector |
01:34:11 | FromDiscord | <Rika> i'm in it for them raster yo |
01:34:38 | FromDiscord | <Rika> ah, i am speaking in difficult english again |
01:35:52 | FromDiscord | <treeform> we basically do mip map linear right now, its good enough for now, but it will get better. |
01:36:20 | FromDiscord | <Rika> its good enough for vector yeah but if i'm rescaling something thats already raster... 😛 |
01:37:37 | FromDiscord | <treeform> what lib do you use? |
01:38:05 | FromDiscord | <Rika> i think it was imageman, and i patched in lanczos myself |
01:38:57 | FromDiscord | <Rika> yup imageman with my own lanczos |
01:42:23 | FromDiscord | <ElegantBeef> In reply to @treeform "thank you!, if you": Hmm sounds like a full pure nim GUI tk 😛 |
01:42:37 | FromDiscord | <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:14 | FromDiscord | <flywind> https://hisham.hm/2021/02/25/compiler-versus-transpiler-what-is-a-compiler-anyway |
02:21:40 | FromDiscord | <Rika> ? |
02:21:54 | FromDiscord | <Rika> a transpiler is a compiler |
02:22:36 | FromGitter | <xflywind> yeah, they mentioned Nim. |
02:23:32 | FromDiscord | <Rika> oh i didnt notice |
02:23:36 | FromDiscord | <Rika> i was still halfway |
02:24:54 | FromDiscord | <Rika> this is a nice article |
02:25:03 | FromDiscord | <Rika> thought it would have been one of those hn-rant shits or w/e |
02:25:42 | FromDiscord | <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:06 | FromDiscord | <Rika> oh it fuckin is |
02:29:41 | FromDiscord | <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:18 | FromDiscord | <Pixtum> what's the difference between func and proc? |
02:52:45 | FromDiscord | <juan_carlos> `func` does not like side-effects, checks for side-effects at compile time, stuff like IO, mutating globals, etc. |
02:53:26 | FromDiscord | <juan_carlos> Like a math function. |
02:53:29 | FromDiscord | <Pixtum> ah |
03:07:32 | FromDiscord | <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:28 | FromDiscord | <dk> Try resetting with https://nim-lang.org/docs/exitprocs.html#addExitProc,proc |
03:13:24 | FromDiscord | <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:01 | FromDiscord | <ajusa> jk turns out I should google for an issue before I ask for help, it is `std/exitprocs` |
03:15:29 | FromDiscord | <ajusa> Original issue still happens, doing `addExitProc(resetAttributes)` |
03:15:34 | FromDiscord | <Rika> yeah there should be an indication when you have to prefix with std or not |
03:15:53 | FromDiscord | <Rika> are you sure your terminal is not mishandling? |
03:16:00 | FromDiscord | <flywind> always use `std` 🙂 |
03:16:18 | FromDiscord | <ajusa> In reply to @Rika "are you sure your": wdym? like is my terminal the one at fault, not my code? |
03:17:18 | FromDiscord | <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:59 | FromDiscord | <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:07 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2QTa |
03:25:01 | FromDiscord | <PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2QTd |
03:25:20 | FromDiscord | <PizzaFox> (edit) "https://play.nim-lang.org/#ix=2QTd" => "https://play.nim-lang.org/#ix=2QTe" |
03:28:39 | FromDiscord | <ElegantBeef> `T: string | SomeNumber ` `T: string or SomeNumber` both are valid |
03:30:14 | FromDiscord | <ElegantBeef> Though i believe that in TS you can have a container of `Model` the nim version doesnt give that |
03:30:45 | FromDiscord | <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:24 | FromDiscord | <PizzaFox> speaking of json |
03:35:59 | FromDiscord | <PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2QTf |
03:36:17 | FromDiscord | <PizzaFox> how should i raise an exception that has that info in it |
03:36:19 | FromDiscord | <PizzaFox> (edit) "it" => "it?" |
03:36:54 | FromDiscord | <ElegantBeef> I believe you want to inherit from `CatchableError` |
03:38:30 | FromDiscord | <PizzaFox> would i have to set each field when creating my custom error object? |
03:39:19 | FromDiscord | <PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2QTg |
03:45:30 | FromDiscord | <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:44 | FromDiscord | <dk> this is very important, I must know |
03:48:21 | FromDiscord | <ElegantBeef> The latter is what i do |
03:51:30 | ForumUpdaterBot | New thread by YesDrX: Wrapper for GSL - GNU Scientific Library, see https://forum.nim-lang.org/t/7560 |
04:22:21 | FromDiscord | <バロザード> is anybody trying to make a complier for nim that goes to straight assembly instead of c |
04:22:38 | FromDiscord | <ElegantBeef> There is nlvm which uses llvm instead of C |
04:23:06 | FromDiscord | <バロザード> is it good? |
04:23:11 | FromDiscord | <ElegantBeef> I dont use it |
04:23:22 | FromDiscord | <ElegantBeef> Not much benefit to using it afaik |
04:24:59 | FromDiscord | <バロザード> 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:16 | FromDiscord | <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:05 | FromDiscord | <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:14 | FromDiscord | <ElegantBeef> @ajusa https://play.nim-lang.org/#ix=2QTt |
05:03:34 | FromDiscord | <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:36 | FromDiscord | <ajusa> In reply to @ElegantBeef "You need to convert": Thank you so much, I understand how that works now! |
05:10:01 | FromDiscord | <ElegantBeef> The real question is always do you need inheritance or can you just use variants 😛 |
05:11:35 | FromDiscord | <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:10 | FromDiscord | <ElegantBeef> Ah yea Nimx does something similar with inheritance 😄 |
05:16:34 | FromDiscord | <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:51 | FromDiscord | <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:07 | FromDiscord | <PizzaFox> i asked before about what it does and didn't get a solid response |
05:18:51 | FromDiscord | <バロザード> that sounds right but also doesnt sound right lol |
05:19:27 | * | a_chou joined #nim |
05:20:08 | FromDiscord | <PizzaFox> it still emits a binary |
05:20:16 | FromDiscord | <PizzaFox> but with ✨ asm ✨ |
05:22:02 | FromDiscord | <flywind> The asm codes generated by C compiler. |
05:22:37 | FromDiscord | <ElegantBeef> Yep, anything you find on the Nim compiler docs is going to be related to the compiler that nim invokes |
05:22:57 | FromDiscord | <flywind> You can use https://godbolt.org to view asm codesonline |
05:25:59 | * | a_chou quit (Remote host closed the connection) |
05:26:27 | FromDiscord | <flywind> https://godbolt.org/z/e61hTa |
05:30:07 | FromDiscord | <Rika> nice updated |
05:33:26 | FromDiscord | <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:35 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/814768357877219338/unknown.png |
07:59:37 | FromDiscord | <hamidb80> file descriptor?! @treeform |
08:00:16 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/814768780227379230/unknown.png |
08:01:04 | FromDiscord | <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:40 | FromDiscord | <Varriount> @hamidb80 Have you read any of the documentation on Nim's threading model? |
09:50:08 | FromDiscord | <Varriount> Araq: This might be of interest to you: https://storage.googleapis.com/justine/cosmopolitan/index.html |
09:50:44 | FromDiscord | <hamidb80> In reply to @Varriount "<@745944009918251010> Have you read": I didn't see anything about "threading model" |
09:51:38 | FromDiscord | <hamidb80> In reply to @hamidb80 "": Myble i should use `ref` |
09:51:52 | FromDiscord | <hamidb80> (edit) "Myble" => "Maybe" |
09:52:07 | FromDiscord | <Rika> https://nim-lang.org/docs/threads.html |
09:52:15 | FromDiscord | <Rika> https://nim-lang.org/docs/channels.html |
09:52:24 | FromDiscord | <Varriount> https://nim-lang.org/docs/manual.html#threads |
09:52:34 | FromDiscord | <Rika> https://nim-lang.org/docs/threadpool.html |
09:52:58 | FromDiscord | <hamidb80> In reply to @Rika "https://nim-lang.org/docs/channels.html": That's not threading model |
09:53:12 | FromDiscord | <Rika> its part |
09:53:14 | FromDiscord | <Rika> read it please |
09:54:11 | FromDiscord | <Varriount> Read the manual link first, then the other ones. |
09:54:56 | FromDiscord | <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:01 | FromDiscord | <Rika> sounds cursed to me |
09:57:05 | FromDiscord | <Rika> oh its cosmopolitan |
09:57:06 | FromDiscord | <Varriount> sent a long message, see http://ix.io/2QUE |
09:57:08 | FromDiscord | <Rika> heard its a massive hack |
09:57:48 | FromDiscord | <Varriount> I don't know whether to be amazed or horrified |
09:58:01 | FromDiscord | <Rika> is it impossible to be both? |
09:58:42 | FromDiscord | <Varriount> Amazingly horrified? Horrifically amazed? Eh, I guess the latter makes sense. |
09:58:59 | FromDiscord | <Varriount> (edit) |
10:13:48 | FromDiscord | <shirleyquirk> poc||gtfo have done loads of crazy shit like that |
10:15:11 | FromDiscord | <Rika> ? |
10:15:19 | FromDiscord | <Rika> who? what? |
10:15:28 | FromDiscord | <shirleyquirk> issue 14 was a combined zip file, pdf, and nes rom |
10:16:16 | FromDiscord | <shirleyquirk> https://www.alchemistowl.org/pocorgtfo/pocorgtfo14.pdf |
10:17:10 | FromDiscord | <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:39 | FromDiscord | <shirleyquirk> https://github.com/Polydet/polyglot-database |
10:30:10 | * | abm joined #nim |
10:35:55 | FromDiscord | <hamidb80> In reply to @hamidb80 "": sent a long message, see http://ix.io/2QV8 |
10:36:53 | FromDiscord | <hamidb80> (edit) "http://ix.io/2QV8" => "http://ix.io/2QV9" |
10:37:27 | FromDiscord | <hamidb80> (edit) "http://ix.io/2QV9" => "http://ix.io/2QVc" |
10:42:48 | FromDiscord | <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:51 | FromDiscord | <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:38 | FromDiscord | <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:10 | PMunch | That zipping thing reminds me of an old trick to hide things |
11:15:49 | PMunch | Create a zip file, then grab a jpg image, concatenate the zip file on the end of the jpg image et voila |
11:17:00 | PMunch | Image 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:25 | PMunch | Ooh, the official FOSDEM video of my talk is up: http://bofh.nikhef.nl/events/FOSDEM/2021/D.declarative.minimalistic/nimdsl.webm |
11:18:49 | PMunch | If 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:31 | FromDiscord | <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:58 | FromDiscord | <carpal> drawentity https://media.discordapp.net/attachments/371759389889003532/814854016843382824/unknown.png |
13:39:45 | FromDiscord | <carpal> (edit) "drawentity ... https://media.discordapp.net/attachments/371759389889003532/814854016843382824/unknown.png" added "requires ColoredSquare = ref object of Entity" |
13:39:51 | FromDiscord | <carpal> and it is a method |
13:41:29 | * | vegai joined #nim |
13:47:27 | PMunch | @zetashift good thing the channel is logged :) |
13:48:56 | PMunch | @carpal, is Entity also ref object? |
13:49:13 | PMunch | But that does sound a bit odd |
13:49:26 | PMunch | Wait, it might be that Entity isn't exported or something like that |
13:49:47 | FromDiscord | <carpal> In reply to @PMunch "<@699146708466008115>, is Entity also": ref object of rootobj |
13:50:04 | PMunch | Right |
13:50:23 | PMunch | And is this all one file? Or do you have it split and imported? |
13:51:39 | FromDiscord | <carpal> yes |
13:51:44 | FromDiscord | <carpal> all in one |
13:52:07 | PMunch | Then I'm out of ideas :( |
13:52:35 | FromDiscord | <carpal> lol ahah |
14:03:50 | * | abm joined #nim |
14:04:21 | ForumUpdaterBot | New 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:12 | FromDiscord | <mratsim> In reply to @zetashift "Huh, I googled my": I don't remember this error |
14:12:43 | FromDiscord | <mratsim> that's probably one of the most confusing error message in Nim |
14:14:11 | * | enneman__ quit (Quit: Leaving) |
14:18:04 | FromDiscord | <Araq> the real problem is that nobody knows what a .partial object is, I think |
14:18:27 | FromDiscord | <Araq> (well, ok, I do know, but I doubt it ever made it into the manual) |
14:19:51 | FromDiscord | <Araq> .partial objects and .liftlocals were designed to work together |
14:20:16 | FromDiscord | <Araq> and are the building blocks for "closures via macros" |
14:21:13 | FromDiscord | <Araq> it still seems like a good feature except for the lack of polish |
14:21:54 | FromDiscord | <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:08 | FromDiscord | <mratsim> you will have to explain because when i read partial I think about the object slicing error. |
14:23:07 | FromDiscord | <Araq> `var foo.bar = "x"` means "add a field of type string named 'bar' to the 'foo's object type" |
14:23:24 | FromDiscord | <Araq> "and then set its value to "x"" |
14:23:59 | FromDiscord | <Araq> for this foo's object type must have been marked as `.partial` |
14:24:13 | FromDiscord | <Araq> so that it remains "open" for field additions |
14:24:14 | FromDiscord | <zetashift> Ah yea that wasn't what I intended to do ofcourse 😩 |
14:24:45 | FromDiscord | <zetashift> but explained like that the error makes 100% sense |
14:25:24 | FromDiscord | <zetashift> But my first reaction is, what am I doing implicitly and what is a .partial object? |
14:25:58 | FromDiscord | <mratsim> that's interesting, but likely would need a RFC. |
14:26:09 | FromDiscord | <Araq> agreed. |
14:26:10 | FromDiscord | <mratsim> or ome document like the destructors decoument |
14:26:19 | FromDiscord | <mratsim> (edit) "ome" => "some" | "decoument" => "document" |
14:27:02 | FromDiscord | <Araq> years later the idea still looks like a very good one |
14:27:07 | FromDiscord | <Araq> so I shall write the RFC |
14:27:24 | FromDiscord | <Kiloneie> That is interesting, level editor/game engine hot swap coding usage comes to mind. |
14:28:09 | FromDiscord | <Araq> @Kiloneie unlikely to be useful for that, the object is eventually sealed, it's still all done at compile-time |
14:30:19 | FromDiscord | <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:39 | ForumUpdaterBot | New thread by RainbowAsteroids: 'b' is not the first parameter, see https://forum.nim-lang.org/t/7561 |
14:31:07 | PMunch | Huh? |
14:31:18 | PMunch | Do I have a pure Nim graphical library? |
14:31:35 | * | narimiran joined #nim |
14:31:36 | FromDiscord | <Yardanico> define "graphical"? |
14:31:36 | FromDiscord | <Kiloneie> Someone posted it a few days ago i cant remember |
14:31:41 | FromDiscord | <Araq> I think it's treeform et al |
14:31:44 | FromDiscord | <Yardanico> there are pixie, imageman and more I know of |
14:31:47 | FromDiscord | <Yardanico> https://github.com/treeform/pixie |
14:31:50 | FromDiscord | <Kiloneie> Ah yes treeform |
14:32:43 | PMunch | Oh damn, that's cool |
14:33:21 | PMunch | @treeform, are you making all these cool libraries through work? |
14:33:34 | FromDiscord | <Yardanico> yes, he is |
14:33:51 | FromDiscord | <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:47 | FromDiscord | <Kiloneie> Really nice |
14:38:24 | PMunch | @treeform, let me know if you need more people :) |
14:40:40 | ForumUpdaterBot | New thread by Miran: New blog post: Multithreading flavors, see https://forum.nim-lang.org/t/7562 |
14:42:29 | FromDiscord | <Araq> https://www.zdnet.com/article/ai-can-write-a-passing-college-paper-in-20-minutes/ |
14:46:53 | idf | that explains the duinocoin paper |
14:57:53 | * | haxscramper joined #nim |
15:30:19 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/814882042319077376/unknown.png |
15:30:41 | FromDiscord | <carpal> I don't understand this runtime errore |
15:30:43 | FromDiscord | <carpal> (edit) "errore" => "error" |
15:31:48 | FromDiscord | <carpal> this happens only if I set the type on non ref |
15:33:44 | * | gpanders joined #nim |
15:34:11 | FromDiscord | <konsumlamm> you set the type? |
15:37:23 | FromDiscord | <carpal> assigned? |
15:39:14 | FromDiscord | <konsumlamm> it would be helpful if you just showed us the code |
15:42:01 | FromDiscord | <carpal> there's nothing to show, it is a type with a seq into it |
15:42:43 | FromDiscord | <carpal> In reply to @carpal "drawentity requires ColoredSquare =": moreover help me with this if you can |
15:44:34 | FromDiscord | <konsumlamm> there is nothing to show, but you get an error 🤔 |
15:45:03 | FromDiscord | <konsumlamm> In reply to @carpal "moreover help me with": can't you show the full code? |
15:45:37 | FromDiscord | <carpal> I fixed it with ref object |
15:45:45 | FromDiscord | <carpal> I can think why it happens |
15:45:55 | FromDiscord | <carpal> In reply to @carpal "moreover help me with": this is more important |
15:46:56 | FromDiscord | <konsumlamm> In reply to @konsumlamm "can't you show the": ... |
15:48:25 | Oddmonger | as a neovim user, i've installed ale with nimlsp, which is great … most of the time |
15:48:52 | Oddmonger | sometimes , i suddenly get errors in the editor, with no real reasons |
15:49:23 | Oddmonger | whatever i do (removing and retyping, saving, reloading…) , the «fake» error doesn't go away |
15:49:50 | Oddmonger | only solution: saving nvim session, and then relauching « nvim -S session » |
15:50:00 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=2QWQ |
15:50:14 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=2QWQ" => "https://play.nim-lang.org/#ix=2QWR" |
15:50:32 | Oddmonger | am i alone to have this problem ? It's completely random, sometimes even appears when loading a 3rd party source |
15:51:28 | Oddmonger | ohh legacy opengl, isn't that cute |
15:51:51 | FromDiscord | <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:53 | FromDiscord | <carpal> In reply to @Oddmonger "as a neovim user,": I've never used neovim or vim |
15:52:42 | FromDiscord | <carpal> In reply to @konsumlamm "nvm, you can't pass": ColoredSquare https://media.discordapp.net/attachments/371759389889003532/814887673981304852/unknown.png |
15:52:43 | FromDiscord | <carpal> gameitem https://media.discordapp.net/attachments/371759389889003532/814887678876057630/unknown.png |
15:53:27 | FromDiscord | <konsumlamm> and you try to pass a `GameItem` to `drawEntity`? |
15:53:46 | FromDiscord | <carpal> yes |
15:53:54 | FromDiscord | <konsumlamm> and why do you expect that to work? |
15:54:13 | FromDiscord | <carpal> because inherit works so |
15:54:17 | FromDiscord | <carpal> in c# it works lol |
15:54:24 | FromDiscord | <konsumlamm> it shouldn't |
15:54:42 | FromDiscord | <carpal> no toxic please |
15:54:51 | FromDiscord | <konsumlamm> i'm trying not to |
15:55:05 | FromDiscord | <konsumlamm> what happens if your `GameObject` is no `ColoredSquare`? |
15:55:29 | FromDiscord | <carpal> runtime error |
15:55:44 | FromDiscord | <carpal> okay so how to use `method`? |
15:55:53 | FromDiscord | <konsumlamm> i'm pretty sure that this wouldn't compile in C# either... |
15:55:53 | FromDiscord | <carpal> https://forum.nim-lang.org/t/3100 |
15:56:05 | FromDiscord | <konsumlamm> you need to make an implementation for `GameObject` |
15:56:15 | FromDiscord | <carpal> I based my compiler all on inherit |
15:56:17 | FromDiscord | <konsumlamm> that works for any `GameObject` |
15:56:32 | FromDiscord | <konsumlamm> and then you can have a specialize implementation for `ColoredSquare` |
15:57:50 | FromDiscord | <carpal> In reply to @konsumlamm "you need to make": what are you talking about? |
15:59:03 | FromDiscord | <konsumlamm> sent a code paste, see https://paste.rs/KaF |
15:59:15 | FromDiscord | <carpal> ahhhh |
15:59:24 | FromDiscord | <carpal> just explain 😂 |
16:01:25 | FromDiscord | <konsumlamm> that's what i tried lol |
16:03:00 | FromDiscord | <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:49 | FromDiscord | <carpal> yes |
16:06:04 | FromDiscord | <carpal> compiler said me to mantain it only in GameItem |
16:07:24 | FromDiscord | <konsumlamm> a small example of methods: <https://play.nim-lang.org/#ix=2QWW> |
16:14:29 | * | smitop joined #nim |
16:18:02 | FromDiscord | <carpal> thanks |
16:31:19 | FromDiscord | <konsumlamm> is there any documentation for new-style concepts? |
16:41:41 | FromDiscord | <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:15 | FromDiscord | <konsumlamm> ty |
16:50:51 | ForumUpdaterBot | New thread by Comibat: Mixing Threads and Async, see https://forum.nim-lang.org/t/7563 |
16:52:41 | FromDiscord | <treeform> In reply to @PMunch "Oh damn, that's cool": Unfortunately only some libraries are through work. Most are personal projects. |
16:53:10 | PMunch | Beats no libraries |
16:53:43 | PMunch | Well, I shouldn't complain too much. I am using some Nim at work |
16:56:44 | FromDiscord | <carpal> is there a way to make a ref object of rootobj to inherit from multiple ref objects? |
16:57:03 | FromDiscord | <carpal> something like this https://media.discordapp.net/attachments/371759389889003532/814903867099316234/unknown.png |
16:57:42 | FromDiscord | <Yardanico> multiple inheritance is not supported |
16:57:48 | FromDiscord | <Yardanico> and in that code example you don't need "RootObj" anyway |
16:58:34 | FromDiscord | <carpal> gameitem is inherited from other objects |
16:58:36 | FromDiscord | <carpal> so yes |
16:58:41 | FromDiscord | <carpal> (edit) "from other" => "byother" |
16:58:45 | FromDiscord | <carpal> (edit) "byother" => "by other" |
16:59:33 | PMunch | No |
17:00:13 | PMunch | Dimension inherits from RootObj then GameItem can inherit from Dimension and that can be inherited by other objects just fine |
17:01:59 | FromDiscord | <carpal> a bit annoying |
17:02:22 | PMunch | Why? |
17:05:28 | * | PMunch quit (Quit: leaving) |
17:06:32 | FromDiscord | <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:50 | FromDiscord | <konsumlamm> iirc threads and async don't play well together in general |
17:10:24 | FromDiscord | <hamidb80> In reply to @konsumlamm "iirc threads and async": i don't think my code has problems |
17:10:32 | FromDiscord | <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:41 | FromDiscord | <konsumlamm> and yet it throws an exception |
17:11:15 | FromDiscord | <treeform> yeah don't use threads or async together async is not thread safe |
17:11:23 | FromDiscord | <Yardanico> you can do it with manual code |
17:11:25 | FromDiscord | <Yardanico> like httpbeast |
17:11:36 | FromDiscord | <treeform> you are using ptr to pass websockets around, I don't think that works either |
17:12:08 | FromDiscord | <hamidb80> In reply to @hamidb80 "": this code doesn't word too |
17:12:16 | FromDiscord | <hamidb80> (edit) "word" => "work" |
17:12:35 | FromDiscord | <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:25 | FromDiscord | <treeform> yeah async/waitFor can't work instead {.thread.} |
17:13:42 | FromDiscord | <treeform> (edit) "instead" => "inside" |
17:13:46 | FromDiscord | <hamidb80> thanks |
17:14:03 | FromDiscord | <treeform> You could do what httpbeast, but its way complex |
17:14:31 | FromDiscord | <treeform> you are better off running multiple nodes and have them communicate via DB like postgress or redis. |
17:14:39 | FromDiscord | <treeform> then you are multi machine too, not just multi thread |
17:14:43 | FromDiscord | <treeform> (that is what I do at work) |
17:18:17 | FromDiscord | <treeform> redis is async and has channels you can communicate between your nodes that way |
17:18:43 | FromDiscord | <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:01 | FromDiscord | <hamidb80> parallelism is more complex than i thougth |
18:09:30 | FromDiscord | <dom96> you barely ever need parallelism |
18:09:43 | FromDiscord | <mratsim> depends on what you do |
18:10:22 | FromDiscord | <dom96> well yes, but the cases where it is necessary are far less common than some think |
18:10:34 | FromDiscord | <dom96> and most people think they need parallelism when they don't |
18:13:51 | FromDiscord | <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:24 | FromDiscord | <mratsim> Even for network, encrypting/decrypting is something that can be tawing with lots of connections. |
18:14:41 | FromDiscord | <mratsim> but parallelism != concurrency != multithreading. |
18:14:55 | FromDiscord | <mratsim> and IO tasks != CPU tasks |
18:14:59 | FromDiscord | <mratsim> that is true. |
18:15:21 | FromDiscord | <mratsim> (edit) "tawing" => "struggling" |
18:30:01 | * | ddl_smurf quit (Quit: ddl_smurf) |
18:34:37 | FromDiscord | <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:57 | FromDiscord | <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:47 | FromDiscord | <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:26 | FromDiscord | <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:57 | FromDiscord | <j-james> So I'm a little confused about templates |
18:59:02 | FromDiscord | <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:11 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2QXV |
18:59:43 | FromDiscord | <hamidb80> template print(x: untyped) =↵ echo x |
18:59:47 | FromDiscord | <hamidb80> i think |
19:00:15 | FromDiscord | <hamidb80> (edit) "template print(x: untyped) =↵ echo x" => "sent a code paste, see https://play.nim-lang.org/#ix=2QXW" |
19:00:52 | FromDiscord | <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:39 | FromDiscord | <haxscramper> `` proc print(x: varargs[string, `$`]) = echo x`` |
19:02:48 | FromDiscord | <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:34 | FromDiscord | <Araq> `varargs` are a bit broken because we the type conversion rules are defective and predate macros.unpackVarargs |
19:08:14 | FromDiscord | <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:59 | FromDiscord | <Araq> unpackVarargs works well though |
19:09:27 | FromDiscord | <j-james> Thanks @hamidb80 , I forgot about `untyped` |
19:10:39 | FromDiscord | <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:07 | FromDiscord | <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:53 | FromDiscord | <memebob> it's not nim specific per se, but i don't know what libraries to use or how to approach this |
19:36:24 | FromDiscord | <Araq> me neither but you can look at how Firefox stores passwords, iirc it's well documented |
19:37:06 | FromDiscord | <memebob> ok i'll check it out, thanks |
19:38:56 | FromDiscord | <carpal> has anyone some idea about how to convert nanoseconds to seconds and nanoseconds? |
19:39:30 | FromDiscord | <carpal> something like↵nanoseconds = 1000023...↵result = 1.00023.. |
19:41:07 | FromDiscord | <Anonymous Poet> just multiply them? whats the issue? |
19:41:33 | FromDiscord | <Anonymous Poet> does anyone know if nim supports assignment + checking in the while loop condition? |
19:42:05 | FromDiscord | <Yardanico> if I understood you correctly, yes |
19:42:34 | FromDiscord | <carpal> In reply to @Anonymous Poet "just multiply them? whats": multiply what? |
19:42:53 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2QYB |
19:42:57 | FromDiscord | <Yardanico> @carpal multiply the value |
19:43:09 | FromDiscord | <Yardanico> just multiply nanoseconds by 1_000_000_000 and you will get seconds |
19:43:13 | FromDiscord | <Yardanico> and vice-versa |
19:43:20 | FromDiscord | <Anonymous Poet> yeah |
19:43:24 | FromDiscord | <Yardanico> nano is the SI prefix for 10^-9 |
19:43:34 | FromDiscord | <carpal> In reply to @Anonymous Poet "like ```nim while let": while (var obj: type; obj).isSome() ? |
19:43:36 | FromDiscord | <carpal> (edit) "obj).isSome()" => "obj).isSome" |
19:43:49 | FromDiscord | <carpal> In reply to @Yardanico "just multiply nanoseconds by": divide? |
19:43:59 | FromDiscord | <Yardanico> multiply nanoseconds by this value to get seconds |
19:44:04 | FromDiscord | <Yardanico> divide seconds by this value to get nanoseconds |
19:44:05 | FromDiscord | <Yardanico> basic math :) |
19:44:14 | FromDiscord | <carpal> but how ... what? |
19:44:17 | FromDiscord | <Yardanico> ???????????????? |
19:44:18 | FromDiscord | <carpal> divide lol |
19:44:21 | FromDiscord | <Yardanico> `/` |
19:44:32 | FromDiscord | <carpal> not multiply |
19:44:46 | FromDiscord | <carpal> anyway, I need a float |
19:44:49 | FromDiscord | <Yardanico> you probably haven't slept for too long |
19:45:19 | FromDiscord | <carpal> I've this, and now? https://media.discordapp.net/attachments/371759389889003532/814946214319489034/unknown.png |
19:45:22 | FromDiscord | <carpal> I need seconds |
19:45:36 | FromDiscord | <hamidb80> 😕 |
19:45:55 | FromDiscord | <Yardanico> @carpal are you actually ok? :P |
19:46:00 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2QYD |
19:46:02 | FromDiscord | <carpal> brooo |
19:46:12 | FromDiscord | <carpal> you didn't understand what I need |
19:46:22 | FromDiscord | <Yardanico> "has anyone some idea about how to convert nanoseconds to seconds and nanoseconds?" |
19:46:26 | FromDiscord | <Yardanico> you already get nanoseconds for free |
19:46:31 | FromDiscord | <Yardanico> argh |
19:46:32 | FromDiscord | <Yardanico> look |
19:46:34 | FromDiscord | <Yardanico> its simple math still |
19:46:45 | FromDiscord | <carpal> In reply to @Yardanico ""has anyone some idea": nanoseconds -> seconds.nanoseconds |
19:47:28 | FromDiscord | <carpal> nanoseconds = 100001↵result I want = 1.0001 (seconds.nanoseconds) |
19:47:29 | FromDiscord | <hamidb80> In reply to @carpal "nanoseconds -> seconds.nanoseconds": what's that |
19:47:52 | FromDiscord | <Solitude> ???? |
19:47:58 | FromDiscord | <hamidb80> In reply to @carpal "nanoseconds = 100001 result": that's not nanoseconds |
19:48:16 | FromDiscord | <Yardanico> @carpal explain what do you need those for |
19:48:20 | FromDiscord | <Yardanico> it seems like an x y problem |
19:48:30 | FromDiscord | <carpal> I need the a float reppresenting the seconds dot milli, micro, nanos |
19:48:37 | FromDiscord | <Yardanico> you already get one |
19:48:38 | FromDiscord | <Yardanico> for free |
19:48:47 | FromDiscord | <Yardanico> it's in the seconds already |
19:48:52 | FromDiscord | <Yardanico> since it's a FLOAT |
19:48:53 | FromDiscord | <carpal> yes... |
19:48:55 | FromDiscord | <Yardanico> yes |
19:48:59 | FromDiscord | <Yardanico> do you need one float or multiple floats? |
19:49:23 | FromDiscord | <hamidb80> > I need the a float reppresenting the seconds dot milli, micro, nanos |
19:49:37 | FromDiscord | <carpal> but I need a float where the part before the comma is the second and after the comma the milliseconds |
19:49:51 | FromDiscord | <Yardanico> but why |
19:49:53 | FromDiscord | <Yardanico> i mean |
19:49:56 | FromDiscord | <Yardanico> it already is like that by default |
19:50:05 | FromDiscord | <Solitude> In reply to @carpal "but I need a": thats not how floats work |
19:50:07 | FromDiscord | <Yardanico> let seconds = 1.0101 # 1 second and 101 ms |
19:50:19 | FromDiscord | <Yardanico> sorry 10 ms |
19:50:25 | FromDiscord | <Yardanico> 10.1 ms |
19:50:27 | FromDiscord | <carpal> In reply to @Yardanico "let seconds = 1.0101": yea ok |
19:50:30 | FromDiscord | <carpal> I need this |
19:50:33 | FromDiscord | <Yardanico> ????????????? |
19:50:51 | FromDiscord | <Yardanico> I honestly have no clue what are you trying to get :P |
19:50:55 | FromDiscord | <hamidb80> In reply to @carpal "I need this": you need what |
19:50:55 | FromDiscord | <carpal> like delta time |
19:51:10 | FromDiscord | <Yardanico> let deltaTime = newSeconds - oldSeconds |
19:51:25 | FromDiscord | <carpal> but it is not accurate |
19:51:36 | FromDiscord | <carpal> seconds are int |
19:51:37 | FromDiscord | <Yardanico> for accurate representation use timeinterval from times |
19:51:38 | FromDiscord | <Solitude> let deltaTime = newTime - oldTime |
19:51:47 | FromDiscord | <carpal> yes... |
19:51:51 | FromDiscord | <Yardanico> use timeinternval |
19:51:54 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/814947868573171762/unknown.png |
19:51:58 | FromDiscord | <carpal> I already did this |
19:52:12 | FromDiscord | <Solitude> so, whats the problem? |
19:52:31 | FromDiscord | <hamidb80> i can't even guess your problem |
19:52:51 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2QYH |
19:52:55 | FromDiscord | <Yardanico> deltaTime is a TimeInterval object then |
19:52:57 | FromDiscord | <Yardanico> https://nim-lang.org/docs/times.html#TimeInterval |
19:53:13 | FromDiscord | <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:44 | FromDiscord | <carpal> In reply to @Yardanico "<@!699146708466008115> ```nim import": why + 3 seconds 5 nanos and 15 millis? |
19:53:50 | FromDiscord | <Yardanico> JUST TO SHOW HOW IT WORKS |
19:53:54 | FromDiscord | <Yardanico> In reply to @Yardanico "in your case you": ^ |
19:54:04 | FromDiscord | <carpal> yes... I just tried it |
19:54:11 | FromDiscord | <carpal> but it is not what I nedd |
19:54:12 | FromDiscord | <carpal> (edit) "nedd" => "nee" |
19:54:13 | FromDiscord | <carpal> (edit) "nee" => "need" |
19:54:16 | FromDiscord | <Yardanico> but what do you actually need |
19:54:23 | FromDiscord | <carpal> do you know how delta time works? |
19:54:24 | FromDiscord | <Yardanico> 3 people failed to understand the actual problem you're facing |
19:54:31 | FromDiscord | <Solitude> In reply to @carpal "do you know how": do you? |
19:54:36 | FromDiscord | <carpal> ahha |
19:54:53 | FromDiscord | <Yardanico> @carpal delta time is Δtime = newTime - oldTime |
19:54:56 | FromDiscord | <Yardanico> that's why it's DELTA |
19:55:02 | FromDiscord | <Yardanico> "difference" (-) between two values |
19:55:21 | FromDiscord | <carpal> yes okay, if it is so simple show me in playground echo delta |
19:55:32 | * | idf joined #nim |
19:55:42 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/toB |
19:55:43 | FromDiscord | <Yardanico> here you go, `deltaTime` is actually delta time |
19:56:46 | FromDiscord | <carpal> this is not a float delta time https://media.discordapp.net/attachments/371759389889003532/814949096598667284/unknown.png |
19:57:04 | FromDiscord | <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:06 | FromDiscord | <carpal> void onupdate(float delta) {↵↵} |
19:58:32 | FromDiscord | <hamidb80> In reply to @Yardanico "ok, I give up,": good try |
20:00:20 | FromDiscord | <hamidb80> In reply to @carpal "void onupdate(float delta) {": turn it into float |
20:00:27 | FromDiscord | <carpal> ahhah duration? |
20:00:35 | FromDiscord | <carpal> okay how to? |
20:01:08 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2QYL |
20:02:19 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=2QYM |
20:02:42 | FromDiscord | <hamidb80> In reply to @hamidb80 "```nim Duration = object": https://nim-lang.org/docs/times.html#Duration |
20:03:16 | FromDiscord | <hamidb80> i really dont know what you are trying to do |
20:03:38 | FromDiscord | <hamidb80> but if you wanna convert `Duration` to `float` that works |
20:03:54 | FromDiscord | <hamidb80> (edit) "https://play.nim-lang.org/#ix=2QYM" => "https://play.nim-lang.org/#ix=2QYN" |
20:04:08 | FromDiscord | <carpal> In reply to @hamidb80 "```nim func duration2float (du:": proc seconds requires an int |
20:04:21 | FromDiscord | <carpal> ah inSeconds maybe |
20:04:34 | FromDiscord | <hamidb80> In reply to @carpal "proc seconds requires an": ?! |
20:05:02 | FromDiscord | <hamidb80> In reply to @hamidb80 "```nim Duration = object": `seconds` is not a proc, it's a property |
20:05:11 | FromDiscord | <carpal> ah, it does not work |
20:05:51 | FromDiscord | <carpal> maybe it is private |
20:07:49 | FromDiscord | <hamidb80> In reply to @hamidb80 "```nim Duration = object": you're write it's private |
20:09:09 | FromDiscord | <hamidb80> (edit) "write" => "right" |
20:18:25 | FromDiscord | <carpal> ok it worked |
20:24:32 | * | JustASlacker joined #nim |
20:26:14 | JustASlacker | hello peoples of nim |
20:26:35 | asdflkj | hi |
20:26:38 | JustASlacker | do I have to declare each and every field of an object with * to export it? |
20:26:43 | * | JustASlacker waves |
20:26:54 | FromDiscord | <Yardanico> yes, you do |
20:26:59 | JustASlacker | bummer |
20:27:01 | FromDiscord | <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:39 | JustASlacker | is that so? I just declared an object Certificate, which just holds data about x509 certs |
20:27:56 | JustASlacker | and pretty much any field should be accessible |
20:28:02 | FromDiscord | <Yardanico> @asdflkj without the special me stuff, but they are |
20:28:04 | FromDiscord | <Yardanico> to discord at least |
20:28:32 | JustASlacker | isnt gitter matrix now |
20:28:37 | FromDiscord | <Yardanico> not really |
20:28:59 | asdflkj | https://matrix.org/blog/2020/12/07/gitter-now-speaks-matrix |
20:29:02 | FromDiscord | <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:10 | FromDiscord | <Yardanico> that's why we're still using that FromGitter bridge |
20:29:34 | asdflkj | gitter 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:45 | haxscramper | How 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:22 | JustASlacker | well I kinda like gitte but matrix looks nice |
20:35:23 | FromDiscord | <Yardanico> var myRefSeq: ref seq[int]; myRefSeq[] = newSeq[int]() |
20:35:37 | FromDiscord | <Yardanico> ah actually wait |
20:35:54 | FromDiscord | <Yardanico> var myRefSeq = new(seq[int]) |
20:35:55 | FromDiscord | <Yardanico> just this is enough |
20:36:25 | FromDiscord | <Yardanico> !eval var myRefSeq = new(seq[int]); myRefSeq[].add(5); echo myRefSeq[] |
20:36:27 | NimBot | @[5] |
20:36:36 | haxscramper | No your first answer was perfect, I actually need `newSeq` with number of elements |
20:36:47 | haxscramper | Thanks, I completely forgot about assign to dereference |
20:36:59 | FromDiscord | <Yardanico> well my first example is invalid because you need to allocate it first anyway |
20:37:08 | FromDiscord | <Yardanico> so if you want with number of elements its |
20:37:13 | FromDiscord | <Yardanico> var myRefSeq = new(seq[int]); myRefSeq[] = newSeq[int]() |
20:37:50 | FromDiscord | <Yardanico> Nim does automatic dereference for dot access but not for seqs :) |
20:38:18 | FromDiscord | <Yardanico> err, actually no, it's because add is a proc and not a field |
20:38:45 | haxscramper | Automatic dereference for procs is experimental IIRC |
20:39:01 | FromDiscord | <Yardanico> yeah, it's behind an experimental switch |
20:39:09 | haxscramper | But semcheck tries all overload twice, at least if I remember that part correctly |
20:40:12 | haxscramper | Ah, yes `elif implicitDeref in c.features and canDeref(n):` < only with that one, so yes, only with experimental implicit deref |
20:41:59 | FromDiscord | <Yardanico> you could've just read the manual to get the same info :P |
20:42:55 | haxscramper | Actually with sourcetrail it is faster |
20:43:04 | FromDiscord | <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:56 | FromDiscord | <konsumlamm> just because async in thread works fine sometimes, doesn't mean it works together in general |
20:44:11 | haxscramper | This 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:15 | FromDiscord | <hamidb80> In reply to @hamidb80 "": . |
20:44:26 | * | Vladar joined #nim |
20:44:49 | FromDiscord | <Yardanico> @hamidb80 as people said multiple times, async doesn't actually work with threads the way you want it to work |
20:44:57 | FromDiscord | <Yardanico> you can't await a future from another thread for example |
20:45:12 | FromDiscord | <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:02 | FromDiscord | <treeform> I wish threads+async in Nim was easier to use. |
20:48:21 | FromDiscord | <treeform> Even just threads without async easier to use... |
20:48:39 | FromDiscord | <XxDiCaprioxX> hey, does anyone here by chance know what a DiscordFile is? if not that's also fine |
20:49:01 | FromDiscord | <treeform> When you send a file through the Discord app? |
20:49:26 | FromDiscord | <XxDiCaprioxX> but is the type the same for all languages or like a nim exclusive thing? |
20:49:28 | FromDiscord | <Yardanico> @XxDiCaprioxX maybe you can provide more context? |
20:49:36 | FromDiscord | <Yardanico> is that about dimscord? |
20:49:54 | FromDiscord | <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:29 | FromDiscord | <XxDiCaprioxX> because yes it is |
20:50:30 | FromDiscord | <Solitude> In reply to @XxDiCaprioxX "if I reply with": read the docs |
20:50:47 | FromDiscord | <Yardanico> @XxDiCaprioxX if I were you I'd just check dimscord src to see how it uses DiscordFile |
20:50:59 | FromDiscord | <hamidb80> In reply to @treeform "I wish threads+async in": could you implement something like `tryReceivePacket` like channels? |
20:51:01 | FromDiscord | <XxDiCaprioxX> I read the docs but I must have somehow skipped over it by accident cuz I was unable to find it |
20:51:12 | FromDiscord | <XxDiCaprioxX> but I'll just have a look again |
20:51:21 | FromDiscord | <Yardanico> and to answer the question - yes, that's dimscord specific |
20:51:22 | FromDiscord | <Solitude> by docs i mean source, and by read i mean ctrl+f |
20:51:30 | FromDiscord | <Yardanico> it's an abstraction over discord's executewebhook |
20:51:32 | FromDiscord | <Yardanico> https://discord.com/developers/docs/resources/webhook#execute-webhook |
20:51:37 | FromDiscord | <Yardanico> https://github.com/krisppurg/dimscord/blob/master/dimscord/restapi/message.nim#L204 |
20:51:46 | FromDiscord | <Yardanico> easy to find even with github's search |
20:51:55 | FromDiscord | <XxDiCaprioxX> In reply to @Yardanico "and to answer the": okay thanks |
20:52:10 | FromDiscord | <XxDiCaprioxX> In reply to @Solitude "by docs i mean": yeah I know that, prolly skipped a file by accident before |
20:52:48 | FromDiscord | <XxDiCaprioxX> what is a `refObject`? |
20:52:57 | * | krux02 joined #nim |
20:53:08 | FromDiscord | <Yardanico> `ref object` is a heap-allocated object |
20:53:19 | FromDiscord | <Yardanico> have you read nim's tutorials and nim basics? |
20:53:26 | FromDiscord | <XxDiCaprioxX> yes and no |
20:53:44 | FromDiscord | <Yardanico> https://nim-lang.org/docs/tut1.html#advanced-types-reference-and-pointer-types |
20:53:56 | FromDiscord | <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:52 | FromDiscord | <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:19 | FromDiscord | <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:19 | FromDiscord | <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:10 | FromDiscord | <mratsim> no ones know |
21:38:14 | FromDiscord | <mratsim> it's a mystery |
21:38:24 | FromDiscord | <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:29 | FromDiscord | <バロザード> so whats the differences between matrix and discord |
22:52:42 | * | Vladar quit (Quit: Leaving) |
22:54:08 | liblq-dev | matrix is free and open-source and discord is proprietary |
22:54:12 | liblq-dev | is one way to put it |
22:55:10 | FromDiscord | <バロザード> do they have the same features |
22:55:19 | nxnl[m] | matrix is also federated and a protocol implemented by several clients and at least two server |
22:57:05 | FromDiscord | <バロザード> so if discord shuts down tomorrow, everyone could move over to matrix clients and nothing much would change? |
22:57:08 | FromDiscord | <ElegantBeef> Element is mostly on feature parity as discord |
22:57:27 | FromDiscord | <ElegantBeef> The major issue is just that it lacks a channelled voip solution intergrated |
22:57:47 | FromDiscord | <バロザード> by that you mean? |
22:58:37 | liblq-dev | good voice chat. |
22:58:48 | FromDiscord | <ElegantBeef> I mean it doesnt have anything like mumble or discord voip intergrated |
22:58:55 | liblq-dev | it also lacks the discord notion of "servers" |
22:59:06 | liblq-dev | there are communities but they're a bit half-baked |
22:59:16 | liblq-dev | and they're working on something new |
22:59:31 | FromDiscord | <バロザード> aw man |
22:59:39 | FromDiscord | <バロザード> voice chat is what makes discord discord |
23:00:35 | * | xet7 quit (Remote host closed the connection) |
23:00:59 | FromDiscord | <ElegantBeef> Well element has voip but it's currently using jitsi for group calls so it's very meh |
23:02:51 | liblq-dev | yeah |
23:03:15 | liblq-dev | the experience can be summarized as "meh" compared to discord, but bear in mind that discord has a commercial company working behind it. |
23:03:51 | liblq-dev | also, 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:30 | FromDiscord | <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:57 | FromDiscord | <Yardanico> made this work |
23:43:02 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/OQx |
23:43:17 | FromDiscord | <Yardanico> its just a macro bro 👀 |
23:44:06 | FromDiscord | <ElegantBeef> Well of course |
23:44:57 | * | antranigv quit (Ping timeout: 264 seconds) |
23:46:28 | FromDiscord | <Yardanico> my implementation is very cursed though, but it works |
23:56:03 | FromDiscord | <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 |