00:21:05 | FromDiscord | <exelotl> Wow that's cool |
00:24:20 | * | Zectbumo quit (Remote host closed the connection) |
00:34:30 | FromDiscord | <ShalokShalom> In reply to @Elegantbeef "https://nim-lang.org/docs/distros.html": Thats super cool. That reminds me, what about a section somewhere that says 'hidden gems' or something of that sorts? |
00:34:47 | FromDiscord | <ShalokShalom> Like neat little tricks and special features of Nim, that are less known? |
00:41:07 | FromDiscord | <ShalokShalom> Would find that a cool additon |
00:50:50 | FromDiscord | <demotomohiro> You might find cool libraries like distros module in https://nim-lang.org/docs/lib.html↵or https://nim-lang.github.io/Nim/lib.html |
00:51:23 | FromDiscord | <Elegantbeef> The most nuggety is https://nim-lang.org/docs/browsers.html |
00:52:28 | * | GreaseMonkey quit (Remote host closed the connection) |
00:53:35 | * | greaser|q joined #nim |
00:59:54 | FromDiscord | <huantian> wait I just realized I could probably use std/cookies.parseCookies for content disposition |
01:00:18 | FromDiscord | <huantian> If i want to be lazy |
01:00:53 | nrds | <Prestige99> Elegantbeef: How do you check if the type of an object is Foo ? |
01:00:58 | nrds | <Prestige99> I thought if foo is Foo |
01:01:25 | FromDiscord | <huantian> use `of` for runtime check |
01:01:43 | nrds | <Prestige99> foo of Foo? |
01:01:50 | FromDiscord | <huantian> correct |
01:02:32 | nrds | <Prestige99> ty |
01:03:18 | FromDiscord | <Elegantbeef> Imagine using inheritance 😄 |
01:04:08 | * | duuude joined #nim |
01:06:30 | * | Gustavo6046 joined #nim |
01:07:04 | FromDiscord | <exelotl> > this post was made by the bounded polymorphism gang |
01:09:16 | * | vicfred quit (Quit: Leaving) |
01:29:29 | FromDiscord | <Hamid_Bluri> what is this weird generic syntax? ↵↵colon `:` before type↵https://mashingan.github.io/excelin/src/htmldocs/excelin.html#getCell%2CRow%2Cstring%2Ctypeof%28nil%29 |
01:30:06 | FromDiscord | <Elegantbeef> It's generic call + method call syntax |
01:30:23 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax |
01:31:04 | FromDiscord | <Hamid_Bluri> beef knows everything |
01:31:09 | FromDiscord | <Hamid_Bluri> thanks |
01:31:45 | FromDiscord | <Elegantbeef> Wait it's not there |
01:32:47 | FromDiscord | <Hamid_Bluri> no |
01:33:24 | FromDiscord | <Elegantbeef> Eitherway it's just for resolving ambiguity |
01:33:41 | FromDiscord | <Hamid_Bluri> what ambiguity here? |
01:34:32 | FromDiscord | <Hamid_Bluri> isn't `[string]` enough? |
01:34:40 | FromDiscord | <Hamid_Bluri> why `[:string]` |
01:34:40 | FromDiscord | <Elegantbeef> `row.getCell[string]` is parsed as `[](row.getCell, string` |
01:34:55 | FromDiscord | <Elegantbeef> `row.getCell[: string]` is parsed as a generic instantiation of `getCell` |
01:35:08 | FromDiscord | <Hamid_Bluri> oh God |
01:37:03 | FromDiscord | <Elegantbeef> Ah it's explained here https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
01:37:43 | FromDiscord | <Hamid_Bluri> thanks |
01:43:46 | FromDiscord | <huantian> Thinking about making a wrapper over enum indexed arrays with a table-like API |
01:43:59 | FromDiscord | <huantian> Not sure how useful it would be |
01:44:05 | FromDiscord | <Hamid_Bluri> ? |
01:46:04 | FromDiscord | <Elegantbeef> Using `Option[T]` for the value for a table equivlent? |
01:46:09 | FromDiscord | <huantian> Mhm |
01:48:40 | FromDiscord | <huantian> I was thinking about using two arrays but that just felt unnecessary |
01:49:34 | FromDiscord | <huantian> It shouldn’t be too complicated |
01:49:59 | FromDiscord | <Elegantbeef> You can just use a `set[Enum]` for values |
01:50:04 | FromDiscord | <Elegantbeef> Much more efficient |
01:50:19 | FromDiscord | <Elegantbeef> `hasKey` is `key in myBitSet` |
01:52:56 | FromDiscord | <huantian> How would that be more efficient? |
01:53:24 | FromDiscord | <Elegantbeef> it's more memory efficient |
01:53:51 | FromDiscord | <Elegantbeef> with 8 enums you have 8 bits vs 64bits for `Option[T]` |
01:54:18 | FromDiscord | <huantian> oh are `Option`s that big? |
01:54:44 | FromDiscord | <Elegantbeef> Well it's 1 extra byte per value since it's a union delimited by `bool` |
01:54:52 | FromDiscord | <Elegantbeef> Unless it's `Option[ref]` |
01:54:53 | FromDiscord | <huantian> oh yeah |
01:54:59 | FromDiscord | <huantian> that makes sense |
01:55:01 | FromDiscord | <Elegantbeef> Then it's just an alias for the type |
01:55:38 | FromDiscord | <huantian> I guess this won't be as memory efficient when compared to a normal table anyways |
01:57:01 | FromDiscord | <Elegantbeef> It's about being faster and with the same functionality though 😄 |
01:57:06 | FromDiscord | <huantian> yep! |
01:57:23 | FromDiscord | <Elegantbeef> You can have the same logic for `Option[ref]` |
01:57:33 | FromDiscord | <Elegantbeef> Where you just use `isNil` instead of `inMySet` |
02:00:26 | FromDiscord | <huantian> yeah that seems good |
02:10:55 | * | marcinaj joined #nim |
02:14:56 | madprops | https://news.ycombinator.com/item?id=31149332 |
02:15:15 | madprops | "Includes: Parser/Compiler, REPL, Virtual Machine, Bytecode Disassembler" |
02:16:43 | FromDiscord | <VideoCarp> is there a Qt6 (not QML) binding for Nim?↵If not, what good GUI libs can I use for Nim? |
02:32:09 | * | duuude quit (Remote host closed the connection) |
02:32:25 | FromDiscord | <Elegantbeef> @VideoCarp\: i dont really know what's the best but there is a small list here https://github.com/xflywind/awesome-nim#gui |
02:32:35 | * | duuude joined #nim |
02:35:29 | FromDiscord | <huantian> In reply to @Elegantbeef "Where you just use": this won't work if someone wants to store a `nil` though right |
02:35:43 | FromDiscord | <Elegantbeef> Correct |
02:36:40 | FromDiscord | <VideoCarp> I looked and it seems they only have QML bindings for Qt.↵And most of these are either Electron, mono-platform or not very well documented. So I'm wondering if there is a full Qt6 binding because I'm familiar with it. |
02:39:50 | FromDiscord | <Elegantbeef> I don't there there are qt6 bindings, isnt it relatively new? |
02:46:18 | FromDiscord | <VideoCarp> no it was released dec 8 2020 |
02:49:23 | * | marcinaj quit (Quit: Client closed) |
02:53:27 | termer | that's recent in gui toolkit world |
02:54:20 | FromDiscord | <VideoCarp> well are there any Qt5 bindings? it was released dec 12 2012. |
02:58:48 | FromDiscord | <Elegantbeef> Doesnt seem so |
03:03:47 | FromDiscord | <VideoCarp> well, Fidget looks promising but I can't tell if it's CLI, web or desktop |
03:04:03 | FromDiscord | <Elegantbeef> It's both web/desktop/mobile |
03:04:15 | FromDiscord | <Elegantbeef> Well all 3 😄 |
03:04:57 | FromDiscord | <VideoCarp> thanks |
03:05:33 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9059 might also interest you |
03:09:29 | FromDiscord | <VideoCarp> I think I'll define them myself, I don't like the paradigm that uses very much. |
03:10:22 | FromDiscord | <VideoCarp> But this looks great. I had no idea Nim could do things like this, it's like you can just embed a declarative language, even though that's not happening. |
03:12:03 | FromDiscord | <Elegantbeef> Yea owlkettle is also pretty nifty in that regard |
03:12:07 | FromDiscord | <Elegantbeef> Declarative GUI is nice |
03:12:19 | FromDiscord | <VideoCarp> owlkettle? |
03:13:32 | FromDiscord | <Elegantbeef> https://github.com/can-lehmann/owlkettle/tree/main/examples |
03:13:49 | FromDiscord | <Elegantbeef> It uses gtk but could technically be used for anything with a bit of modification |
03:17:06 | FromDiscord | <VideoCarp> looks quite clean |
03:21:03 | * | v9fk quit (Remote host closed the connection) |
03:21:46 | * | v9fk joined #nim |
03:24:43 | * | Zectbumo joined #nim |
03:33:03 | FromDiscord | <huantian> https://play.nim-lang.org/#ix=3Wah↵why does this compile when there's no chance SomeObject will have a field named asdf |
03:33:31 | FromDiscord | <huantian> is that just how generics work |
03:34:07 | FromDiscord | <huantian> since each type is not generated if it's not used |
03:34:15 | FromDiscord | <Elegantbeef> `asdf` can be a procedure |
03:34:35 | FromDiscord | <huantian> true |
03:35:29 | FromDiscord | <huantian> still feels kinda weird |
03:36:28 | FromDiscord | <huantian> it breaks --styleCheck 😔 |
03:39:46 | FromDiscord | <huantian> huh does that mean then all the type checking can only happen if I use the proc? |
04:29:48 | FromDiscord | <Prestige> https://play.nim-lang.org/#ix=3War why does this not work? (the last bit) |
04:30:03 | FromDiscord | <Prestige> I thought this worked previously but maybe I'm crazy |
04:30:43 | FromDiscord | <Elegantbeef> Literals convert numerics dont |
04:30:49 | termer | you're trying to add an int with a float |
04:30:53 | FromDiscord | <Elegantbeef> \`import std/leniantops" if you want conversions like this |
04:30:54 | FromDiscord | <Prestige> Either way, gets annoying having to cast ints all the time when a param type takes a float |
04:30:54 | termer | remember that `+` is a proc |
04:30:58 | FromDiscord | <Prestige> ah cool |
04:31:08 | FromDiscord | <Prestige> I'll try `import std/leniantops` |
04:31:10 | termer | you can make your own `+` if you want that does the conversion for you |
04:31:17 | termer | oh |
04:31:23 | termer | I guess leniantops works too lol |
04:32:37 | FromDiscord | <Prestige> neat ty |
04:32:41 | FromDiscord | <Prestige> I will use this everywhere |
04:33:49 | FromDiscord | <Prestige> Is there a way to just globally enable that with a compiler flag? |
04:34:06 | FromDiscord | <Elegantbeef> `--import:"std/leniantops"` |
04:34:14 | FromDiscord | <Elegantbeef> Not great for portable code but yea it works |
04:34:25 | FromDiscord | <Elegantbeef> Throw that in your `nim.config` and there you go |
04:35:15 | FromDiscord | <Prestige> ty ty |
05:14:54 | * | slowButPresent quit (Quit: leaving) |
05:37:23 | * | jjido joined #nim |
05:37:31 | FromDiscord | <Prestige> Can you have an iterator that can be overridden with inheritance? |
05:37:40 | FromDiscord | <Prestige> like both a method and an iterator |
05:37:55 | FromDiscord | <Elegantbeef> Iterators are inlined so no |
05:38:29 | FromDiscord | <Elegantbeef> You could use a method to generate an inline iterator then iterator on that i think |
05:40:52 | FromDiscord | <Prestige> How about a concept, so a method returns something that can be iterated over? |
05:41:34 | FromDiscord | <Prestige> Like a something could return a seq, array, or HashSet |
05:41:50 | FromDiscord | <Elegantbeef> I think the return type of a method has to match |
05:41:50 | FromDiscord | <Prestige> so long as it has an iterator that returns T |
05:41:54 | FromDiscord | <Prestige> hmm |
05:42:54 | FromDiscord | <Elegantbeef> It still needs to be delimited at compile time |
05:42:54 | FromDiscord | <Elegantbeef> You can make a for loop macro if you must |
05:57:56 | FromDiscord | <Rika> beef your picostdlib readme is funny |
05:57:57 | FromDiscord | <Rika> "Please contribute." |
05:58:13 | FromDiscord | <Elegantbeef> Dont recall who added that |
05:58:18 | FromDiscord | <Elegantbeef> Laugh at casey or auxym |
05:58:20 | FromDiscord | <Rika> git blame |
05:58:44 | FromDiscord | <Rika> you added it you fucker |
05:58:54 | FromDiscord | <Elegantbeef> I did? |
05:59:02 | FromDiscord | <Rika> says on the blame its you |
05:59:47 | FromDiscord | <Elegantbeef> Nah casey added it in https://github.com/beef331/picostdlib/commit/ff346704eb85d49ef4965590a0a32a5be332e7c7 |
06:00:18 | FromDiscord | <Rika> boo |
06:00:23 | FromDiscord | <Elegantbeef> Speaking of auxym.... they never got back to me with how autoimporting worked |
06:00:26 | FromDiscord | <Rika> beef being boring as usual |
06:00:35 | FromDiscord | <Elegantbeef> Fuck yea |
06:01:42 | FromDiscord | <Elegantbeef> Lol kate's fold coding is eating my code |
06:02:02 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/968029098628747264/image.png |
06:02:07 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/968029119629656104/image.png |
06:02:17 | FromDiscord | <Elegantbeef> Me think it's fucked up |
06:02:27 | FromDiscord | <Rika> your folding is fucked up yes |
06:02:52 | FromDiscord | <Elegantbeef> Dont even think i can disable code folding |
06:03:25 | FromDiscord | <Solitude> epic editor |
06:13:14 | * | neurocyte8614492 joined #nim |
06:24:06 | * | duuude quit (Ping timeout: 250 seconds) |
06:29:18 | * | duuude joined #nim |
06:29:31 | * | nsyd joined #nim |
06:31:54 | * | PMunch joined #nim |
06:50:23 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
06:50:29 | * | def- quit (Quit: -) |
06:50:59 | FromDiscord | <SirElephant> what language was nim made in? |
06:51:16 | * | def- joined #nim |
06:51:37 | FromDiscord | <SirElephant> In reply to @Elegantbeef "image.png": what theme? |
06:53:08 | FromDiscord | <Elegantbeef> Nim was originally written in object pascal it's now selfhosted |
06:54:17 | FromDiscord | <SirElephant> bruh i forgot that nim as written in nim eheheheh |
06:54:27 | FromDiscord | <SirElephant> In reply to @Elegantbeef "Nim was originally written": wut theme are you using? |
06:54:34 | FromDiscord | <Elegantbeef> ayu mirage |
06:54:50 | FromDiscord | <SirElephant> https://tenor.com/view/pink-city-pop-pink-gif-23314592 |
06:54:56 | FromDiscord | <SirElephant> asethetic |
06:55:00 | FromDiscord | <SirElephant> (edit) "asethetic" => "assthetic" |
06:59:19 | * | jmdaemon quit (Ping timeout: 272 seconds) |
07:39:28 | * | krux02 joined #nim |
07:42:37 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected]) |
07:54:00 | PMunch | @SirElephant, one benefit of compiling to C. Nim is written in Nim, but also hosts a csources repo which is just a compiled to C version that can be used to build a Nim compiler which can build the newest Nim compiler |
07:56:51 | * | jjido joined #nim |
08:07:49 | FromDiscord | <d4rckh> Is there any way I can read the stdin if the user didn't press enter yet? |
08:08:11 | FromDiscord | <Elegantbeef> `stdin.readChar` for blocking |
08:08:45 | FromDiscord | <Elegantbeef> also `getCh` if you dont want to print it |
08:09:35 | FromDiscord | <d4rckh> Thanks, I want to have a cli interface which also logs stuff pretty quickly so i want to save the stdin and restore it every time i print a new log |
08:14:29 | PMunch | Ah, in order to avoid half typed messages scrolling up the screen? |
08:14:51 | FromDiscord | <TryAngle> does a standalone llvm ir bindings library exist? |
08:16:08 | FromDiscord | <Rika> What do you mean |
08:17:00 | FromDiscord | <TryAngle> In reply to @Rika "What do you mean": https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.html |
08:17:31 | FromDiscord | <TryAngle> sent a code paste, see https://paste.rs/2F6 |
08:19:07 | FromDiscord | <Rika> Maybe the Nim LLVM backend has some |
08:19:44 | FromDiscord | <TryAngle> In reply to @Rika "Maybe the Nim LLVM": I know it has that↵that's why I ask for standalone 😭 |
08:20:07 | FromDiscord | <TryAngle> so I can `nimble install llvm` or smth like that |
08:20:26 | FromDiscord | <Rika> Just pull it out of the repo? |
08:21:52 | FromDiscord | <TryAngle> In reply to @Rika "Just pull it out": it's MIT license lol I thought it was unlicensed |
08:22:01 | FromDiscord | <TryAngle> ok hippity hoppity ur code is now my property |
08:23:14 | FromDiscord | <TryAngle> or wait, I'm actually on a linux system now so things like this should be easy manually I try that first... |
08:33:59 | FromDiscord | <d4rckh> sent a long message, see http://ix.io/3Wbe |
08:41:02 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:42:56 | * | Zectbumo quit (Remote host closed the connection) |
08:52:39 | FromDiscord | <N00nehere> j |
08:52:48 | FromDiscord | <Elegantbeef> a |
08:53:32 | FromDiscord | <Solitude> v |
08:54:05 | PMunch | e |
09:04:29 | FromDiscord | <Rika> Why |
09:07:04 | * | neurocyte8614492 quit (Quit: The Lounge - https://thelounge.chat) |
09:18:36 | * | duuude quit (Ping timeout: 240 seconds) |
09:21:38 | * | neurocyte8614492 joined #nim |
09:21:50 | * | krux02 quit (Remote host closed the connection) |
09:24:36 | * | nsyd quit (Ping timeout: 240 seconds) |
09:34:59 | FromDiscord | <N00nehere> b |
09:40:08 | FromDiscord | <enthus1ast> @d4rckh\: you want readline/linenoise like behaviour? |
09:40:48 | FromDiscord | <d4rckh> Yeah |
09:41:18 | FromDiscord | <enthus1ast> but you do not want to patch existing applications ? |
09:41:58 | FromDiscord | <d4rckh> what do you mean patch an existing app? |
09:42:33 | FromDiscord | <d4rckh> I just need to save the stdin, and restore it |
09:43:06 | FromDiscord | <enthus1ast> i dont think thats neccesary for what you want↵(@d4rckh) |
09:43:15 | FromDiscord | <d4rckh> Oh |
09:43:22 | FromDiscord | <enthus1ast> if i understand correctly what you want of course \:) |
09:43:34 | FromDiscord | <d4rckh> In reply to @PMunch "Ah, in order to": I want to avoid this |
09:43:55 | FromDiscord | <d4rckh> My program reads commands, and sometimes logs things |
09:44:25 | FromDiscord | <enthus1ast> try something like this then\: https://github.com/jangko/nim-noise |
09:44:33 | FromDiscord | <d4rckh> And if you type something, and then there's a log, it gets printed over what you typed |
09:44:51 | FromDiscord | <enthus1ast> yes, but the stdin is still as it was before this↵(@d4rckh) |
09:51:25 | FromDiscord | <enthus1ast> @d4rckh\: another question |
09:51:38 | FromDiscord | <enthus1ast> is your app printing from another thread? |
09:51:57 | FromDiscord | <d4rckh> No, it's async |
09:52:21 | FromDiscord | <enthus1ast> how do you then readLine without blocking? |
09:52:31 | FromDiscord | <d4rckh> One sec |
09:52:43 | PMunch | ~*magic*~ |
09:56:22 | * | jjido joined #nim |
09:57:05 | FromDiscord | <Rika> You set the terminal mode to raw xd |
09:57:17 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3WbE |
09:57:18 | FromDiscord | <d4rckh> In reply to @enthus1ast "how do you then": something like this |
09:57:22 | FromDiscord | <Rika> It’s a lot of work actually |
09:57:25 | FromDiscord | <Rika> I mean if you don’t do that |
09:57:29 | FromDiscord | <enthus1ast> this is a thread |
09:57:43 | FromDiscord | <d4rckh> oh yeah, right |
09:57:46 | FromDiscord | <d4rckh> `spawn` |
09:57:48 | FromDiscord | <d4rckh> sorry |
09:57:49 | FromDiscord | <Rika> In reply to @enthus1ast "this is a thread": Well it’s not wrong still |
09:57:55 | FromDiscord | <enthus1ast> no |
09:57:57 | FromDiscord | <d4rckh> wrote this last night |
09:58:10 | FromDiscord | <d4rckh> its working completely fine tho |
09:58:42 | FromDiscord | <enthus1ast> yes, actually i'm not sure if nim-noise can help, but its worth a try |
09:59:20 | FromDiscord | <d4rckh> hmm |
09:59:47 | FromDiscord | <d4rckh> is there any other way which i can achieve this? |
10:00:06 | FromDiscord | <enthus1ast> with async reading chars (eg with illwill) |
10:00:35 | FromDiscord | <enthus1ast> but then you must build a line input yourself |
10:01:34 | FromDiscord | <enthus1ast> i would try nim-noise / lineoise etc first \:) |
10:02:02 | FromDiscord | <enthus1ast> and please report back if it works (if you go this route), would also interest me |
10:02:10 | FromDiscord | <d4rckh> history would be my logs in nim-noise? |
10:02:44 | FromDiscord | <enthus1ast> history is the command history imho |
10:03:04 | FromDiscord | <enthus1ast> like pressing the arrow up, and arrow down in normal terminal |
10:03:40 | FromDiscord | <d4rckh> oh yeah |
10:05:27 | FromDiscord | <d4rckh> can i use nim noise with threads |
10:05:28 | FromDiscord | <d4rckh> (edit) "threads" => "threads?" |
10:13:59 | FromDiscord | <jmgomez> hey guys, how would you covert a string like this "2022-04-25T11:12:44.5285705Z" into a DateTime in nim? |
10:14:51 | FromDiscord | <enthus1ast> with times parse() |
10:15:41 | FromDiscord | <jmgomez> ohh I was looking at parseTime, will give that a shot |
10:19:29 | FromDiscord | <d4rckh> Okay i was able to implement Nim noise, it's pretty cool! How can I make it threaded tho, so it doesn't interrupt my other stuff |
10:20:27 | FromDiscord | <enthus1ast> you could start it in a thread and send the commands to the worker via channels |
10:24:16 | FromDiscord | <d4rckh> hmm, i will do that |
10:24:24 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3WbN |
10:26:56 | FromDiscord | <ambient> It either SEGV or complains that the variable can't be captured, if I do it like a constructor it says "cannot be captured as it would violate memory safety" |
10:29:10 | FromDiscord | <d4rckh> looks like noise's functions arent gcsafe and i cant really call them in a thread? `Error: 'procStdin' is not GC-safe as it calls 'readLine'` |
10:30:32 | FromDiscord | <Solitude> In reply to @ambient "I'm having a hard": try this maybe? https://nim-lang.org/docs/sugar.html#capture.m%2Cvarargs%5Btyped%5D%2Cuntyped |
10:32:26 | FromDiscord | <Solitude> In reply to @ambient "I'm having a hard": probably wont help, this jus doesnt look right at all |
10:35:03 | FromDiscord | <aph> have anyone got nim running on console (like nintendo, ps5, or whatever) btw |
10:35:43 | FromDiscord | <Rika> There’s a Nintendo switch compile path |
10:35:54 | FromDiscord | <aph> wow i didnt know it existed lol |
10:36:06 | FromDiscord | <aph> should've took a look in the docs. might've listed |
10:37:41 | FromDiscord | <ajusa> I've got it running on 3DS, exelotl has it running on GBA |
10:37:49 | FromDiscord | <exelotl> yee |
10:38:10 | FromDiscord | <d4rckh> In reply to @enthus1ast "yes, actually i'm not": okay, nim noise is not working for me, but its very cool |
10:38:17 | FromDiscord | <exelotl> I still find the switch support in the compiler to be really odd, why did this need to be in the compiler? is there something I'm missing? |
10:39:05 | FromDiscord | <Elias> Hello. When I download https://nim-lang.org/download/nim-1.6.4_x64.zip using a browser it works, but when I use pythons urllib it does not work. I get a 403. |
10:40:17 | FromDiscord | <Elias> is there something to block downloads that are not from browsers? |
10:40:38 | FromDiscord | <Solitude> wget works, so no |
10:40:44 | FromDiscord | <Elias> strange |
10:41:16 | FromDiscord | <Elias> sent a code paste, see https://paste.rs/ONz |
10:41:18 | FromDiscord | <ajusa> In reply to @exelotl "I still find the": No clue, here's the PR for more context https://github.com/nim-lang/Nim/pull/8069 |
10:41:21 | FromDiscord | <Elias> other urls work |
10:41:31 | FromDiscord | <Solitude> ask in python chat? |
10:41:52 | FromDiscord | <ajusa> Looking at it now I think I may have found the issue I had on 3ds with memory alignments |
10:42:00 | FromDiscord | <Elias> In reply to @Solitude "ask in python chat?": probably smart, just wanted to check if there were blocking stuff first |
10:43:57 | FromDiscord | <aph> maybe use choosenim? idk if it works on windows though |
10:44:06 | NimEventer | New thread by Krakengore: How to iterate a slice of children of a NimNode ?, see https://forum.nim-lang.org/t/9125 |
10:44:14 | FromDiscord | <aph> In reply to @ajusa "I've got it running": good news, might make some console games later with nim |
10:44:28 | FromDiscord | <exelotl> In reply to @ajusa "No clue, here's the": it's annoying because it seems coupled to devkitPro which would mean I can't use it with the official switch SDK anyways 😅 |
10:45:07 | FromDiscord | <exelotl> I should be able to try it out with the official SDK later in the year though |
10:45:07 | FromDiscord | <ajusa> In reply to @exelotl "it's annoying because it": Oh right forgot you were planning on making an official release of good boy galaxy. To be fair, there is no way official support would land in the Nim compiler |
10:45:29 | FromDiscord | <ajusa> I wonder if futhark would work for that though? |
10:46:11 | FromDiscord | <Elias> In reply to @aph "maybe use choosenim? idk": ill look into that. Seems to make things easier |
10:46:52 | FromDiscord | <exelotl> afaik the official SDK comes with a bog standard GCC and you can use SDL2 and other normal libraries with it |
10:47:13 | FromDiscord | <exelotl> so it should be possible to add "official" support without actually baking in any confidential stuff |
10:48:16 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3WbX |
10:48:20 | FromDiscord | <d4rckh> (edit) "https://paste.rs/2qQ" => "https://paste.rs/kVb" |
10:50:22 | FromDiscord | <ambient> Ok, the problem was I missed app.run(), so GTK dumped on me. Wasn't a Nim issue after all 🙂 |
10:51:20 | FromDiscord | <ambient> would have solved this much quicker if I just dutifully went through the _entire_ stacktrace |
10:52:38 | FromDiscord | <enthus1ast> You could cast gcsafe or put the other stuff in a thread↵(@d4rckh) |
10:53:05 | FromDiscord | <d4rckh> well i put everything in a thread and it still complains about that function |
10:53:22 | FromDiscord | <d4rckh> now it looks something like this |
10:53:23 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3WbY |
10:53:40 | FromDiscord | <d4rckh> this errors with `Error: 'thr' is not GC-safe as it calls 'readLine'` |
10:53:51 | FromDiscord | <d4rckh> thats the only readLine in the thr pro |
10:53:52 | FromDiscord | <d4rckh> (edit) "pro" => "proc" |
10:58:03 | FromDiscord | <Yardanico> In reply to @d4rckh "this errors with `Error:": lemme check nim-noise |
10:58:13 | FromDiscord | <d4rckh> https://github.dev/jangko/nim-noise |
10:58:21 | FromDiscord | <Yardanico> yeah i know, already cloned |
10:58:42 | FromDiscord | <d4rckh> sure |
11:01:45 | PMunch | @ajusa, Futhark requires clang and that clang is able to understand the sources you're wrapping. If you need to use a special compiler for your C code then it's quite likely Futhark won't work unfortunately. |
11:02:22 | FromDiscord | <Yardanico> @d4rckh the full stack trace: |
11:02:30 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/P50 |
11:02:48 | FromDiscord | <Yardanico> if you don't care about editProc, then you can just cast the gcsafe error away |
11:03:44 | * | vicecea quit (Remote host closed the connection) |
11:03:48 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Wc1 |
11:04:16 | * | vicecea joined #nim |
11:04:33 | PMunch | Yardanico, there is a [] slice operator for NimNodes in the macros module ;) |
11:04:41 | FromDiscord | <Yardanico> :D |
11:04:46 | FromDiscord | <Yardanico> i thought there already was macros import |
11:05:24 | FromDiscord | <d4rckh> cool, lets see if this solves my original problem |
11:05:43 | PMunch | Yeah I was thrown for a second as well, I just wrote code like he used a couple minutes ago so I didn't see why his code wouldn't work :P |
11:09:53 | PMunch | Hmm, I have two symbols, both are symKind == nskType. But calling getTypeImpl on on returns typedesc[MySymbol] and the other returns the full object definition.. |
11:13:02 | PMunch | And comparing the two symbols with sameType returns false.. |
11:16:50 | PMunch | Hmm, but I can run getImpl on the first node and get a definition.. |
11:18:04 | * | neurocyte8614492 quit (Quit: The Lounge - https://thelounge.chat) |
11:19:52 | * | neurocyte8614492 joined #nim |
11:23:15 | PMunch | Is it just me who finds this weird? https://play.nim-lang.org/#ix=3Wc8 |
11:23:48 | FromDiscord | <ajusa> In reply to @PMunch "<@102899813149855744>, Futhark requires clang": Well it should be fairly normal C code, just on an ARM target but I see your point |
11:23:55 | FromDiscord | <Morvalds> is there a nim interpreter? |
11:24:17 | PMunch | @Morvalds, define interpreter |
11:24:33 | FromDiscord | <Yardanico> not in the strict sense of it @Morvalds , but nim compiler has a VM embedded into it |
11:24:35 | FromDiscord | <Morvalds> In reply to @PMunch "@Morvalds, define interpreter": opposite of compiler |
11:24:36 | PMunch | @ajusa, I had some trouble using it for AVR chips for example |
11:24:44 | FromDiscord | <Rika> In reply to @Morvalds "opposite of compiler": Now define compiler 😄 |
11:24:45 | FromDiscord | <Yardanico> @Morvalds that's a wrong definition :) |
11:24:51 | FromDiscord | <Yardanico> a lot of stuff is the same in interpreters and compilers |
11:24:57 | PMunch | @Morvalds, opposite of a compiler would be a decompiler |
11:25:13 | FromDiscord | <Morvalds> In reply to @PMunch "@Morvalds, opposite of a": decompilers dont exist, only disassemblers |
11:25:16 | PMunch | There is `nim secret` which works like the Python REPL |
11:25:17 | FromDiscord | <Yardanico> they do exist |
11:25:29 | FromDiscord | <Yardanico> for languages that are compiled into bytecode like C#, Java, etc |
11:25:36 | FromDiscord | <Rika> Aren’t we digressing |
11:25:38 | FromDiscord | <Yardanico> but anyway, let's not argue about that |
11:25:48 | FromDiscord | <Yardanico> @Morvalds the closest thing to what you want is probably NimScript |
11:25:56 | FromDiscord | <Yardanico> any reason you'd want "interpreted" Nim though? |
11:26:11 | PMunch | @Morvalds, you can also embed the NimScript interpreter into your own Nim programs, see e.g. Nimscripter |
11:26:36 | FromDiscord | <Yardanico> if you just want to write nim like a script, you can then just add a shebang to make it automatically compile and run just |
11:26:38 | FromDiscord | <Yardanico> (edit) removed " just" |
11:26:42 | * | neurocyte8614492 quit (Quit: The Lounge - https://thelounge.chat) |
11:26:45 | FromDiscord | <Morvalds> In reply to @Yardanico "any reason you'd want": because i hate generating files |
11:26:51 | FromDiscord | <Yardanico> huh? |
11:27:08 | FromDiscord | <Morvalds> no program should ever touch files |
11:27:10 | FromDiscord | <Yardanico> that's really weird reasoning - if you don't like files, just throw them to somewhere you don't see |
11:27:12 | FromDiscord | <Rika> There’s a sub command that doesn’t pollute your current working directory |
11:27:18 | FromDiscord | <Yardanico> In reply to @Morvalds "no program should ever": but they all do |
11:27:55 | FromDiscord | <Morvalds> oh and also compiling an entire app takes a lot of time im willing to sacrifice speed to stop compiling apps |
11:28:01 | PMunch | @Morvalds, have a look at nimcr |
11:28:20 | FromDiscord | <Yardanico> In reply to @Morvalds "oh and also compiling": maybe you should use Python then (a serious question) |
11:28:28 | FromDiscord | <Yardanico> while there's nimscript, Nim is made to be compiled |
11:28:32 | PMunch | @Morvalds, the Nim compiler is silly fast |
11:28:40 | FromDiscord | <d4rckh> how can i pass things to a thread by reference? |
11:28:46 | FromDiscord | <Morvalds> In reply to @Yardanico "maybe you should use": would never do that |
11:29:13 | FromDiscord | <Rika> In reply to @d4rckh "how can i pass": I think with ARC you do it normally |
11:29:38 | FromDiscord | <Yardanico> In reply to @d4rckh "how can i pass": you can with ARC, but you still need to ensure that there are no data races possible |
11:29:59 | PMunch | @Morvalds, it's no like compiling C++ programs which can take days :P |
11:30:15 | FromDiscord | <Morvalds> well |
11:30:55 | FromDiscord | <d4rckh> In reply to @Yardanico "you can with ARC,": i switched to arc, how do i pass it now? |
11:31:07 | FromDiscord | <Yardanico> if it's a global you just use it there |
11:32:12 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Wcb |
11:32:25 | FromDiscord | <Rika> Sequences are by value |
11:32:36 | FromDiscord | <Yardanico> In reply to @Rika "Sequences are by value": but he's passing Server which i assume is a ref object |
11:32:42 | FromDiscord | <Rika> I didn’t assume that |
11:32:44 | FromDiscord | <d4rckh> In reply to @Yardanico "but he's passing Server": yes, correct |
11:32:58 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/Qi6 |
11:33:19 | FromDiscord | <Rika> Threads might still be deep copying parameters then perhaps |
11:34:33 | FromDiscord | <d4rckh> why? 🤔 |
11:35:08 | FromDiscord | <Yardanico> hm, not sure then |
11:35:13 | FromDiscord | <Yardanico> but you can make it work by making server a global :P |
11:38:46 | FromDiscord | <d4rckh> wouldnt it complain about it not being gcsafe and stuff? |
11:39:24 | FromDiscord | <Yardanico> In reply to @d4rckh "wouldnt it complain about": you can make it not complain, although you still need to make sure you're not accessing the same sequence from multiple threads at the same time |
11:39:35 | FromDiscord | <dom96> Hm, why the need for threads @d4rckh? |
11:40:05 | FromDiscord | <dom96> If you need it for libnoise or whatever I would recommend keeping the data you transfer between thread to a minimum |
11:40:20 | FromDiscord | <dom96> i.e. just transfer the stdin, why passing the whole server? |
11:42:20 | FromDiscord | <d4rckh> In reply to @dom96 "If you need it": well, im just trying to have the logs print while i can input commands |
11:42:34 | FromDiscord | <d4rckh> and i was told noise can help me with this 🤔 |
11:43:56 | FromDiscord | <d4rckh> but with noise i need to use threads like this |
11:44:01 | FromDiscord | <d4rckh> because i cant just spawn the readline function |
11:44:02 | FromDiscord | <d4rckh> like i did before |
11:44:06 | FromDiscord | <d4rckh> and now im in a rabbithole |
11:47:22 | FromDiscord | <dom96> hmm, in that case perhaps you should dedicate a thread to libnoise and send what you want printed to the thread and send back the commands that are input by the user |
11:48:02 | FromDiscord | <dom96> that way you only need to send strings back and forward, if you want more strictness you can create an object variant modelling a command |
11:48:20 | FromDiscord | <d4rckh> this is getting really complicated |
11:48:25 | FromDiscord | <d4rckh> isnt there an easier way of doing this? |
11:49:23 | * | duuude joined #nim |
11:50:17 | FromDiscord | <dom96> oh, nim-noise is implemented in Nim |
11:50:20 | FromDiscord | <dom96> that gives you more options |
11:50:58 | FromDiscord | <dom96> if you find the procs inside that library which do the stdin reading you can replace them with an async-compatible proc which does what you are already doing for stdin reading |
11:51:04 | FromDiscord | <dom96> would be a nice PR for that library |
11:51:46 | FromDiscord | <dom96> although it might not be that easy, I guess the library needs to handle inputs like up-arrow, down-arrow etc. |
11:54:42 | FromDiscord | <d4rckh> sent a long message, see https://paste.rs/ilT |
11:55:35 | FromDiscord | <dom96> maybe, give it a try, I don't know exactly what your goal is 🙂 |
11:57:48 | * | rockcavera joined #nim |
11:57:48 | * | rockcavera quit (Changing host) |
11:57:48 | * | rockcavera joined #nim |
12:04:04 | FromDiscord | <d4rckh> im trying to my socket server print new stuff while i receive commansd |
12:04:06 | FromDiscord | <d4rckh> (edit) "commansd" => "commands" |
12:05:11 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/968120483646148618/unknown.png |
12:05:28 | FromDiscord | <d4rckh> i want to avoid this |
12:05:32 | FromDiscord | <d4rckh> where it prints stuff while im typing |
12:22:56 | FromDiscord | <enthus1ast> @d4rckh\: maybe write a real gui? |
12:23:13 | FromDiscord | <enthus1ast> Or do the printing yourself with illwill |
12:24:00 | FromDiscord | <enthus1ast> Or, put the output of the thread in a queue and print them only after pressing enter |
12:25:02 | FromDiscord | <enthus1ast> Or split your app in two, connect via network, then have two windows with tmux |
12:25:28 | FromDiscord | <enthus1ast> What kind of application you want to do? |
12:27:56 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/8J3 |
12:29:29 | FromDiscord | <d4rckh> In reply to @enthus1ast "What kind of application": It's some sort of a remote control app |
12:32:55 | FromDiscord | <enthus1ast> Map it to irc and use your favourite irc client ;) |
12:34:09 | FromDiscord | <jmgomez> In reply to @jmgomez "Hey guys, I have": ohh Im a noob it is but I wasnt importing times |
12:35:37 | PMunch | @Elegantbeef, assuming you will see this when you wake up, here is my current working version of the autorouter/deriveable types: http://ix.io/3Wcs/nim |
12:37:33 | PMunch | I'm probably going to split the logic in two, one library that just does the derivable types part (which is what the above does). Then another "autorouter" which just tries to minimize the boilerplate of binding it to Jester/Prologue routes |
12:37:47 | * | v9fk quit (Remote host closed the connection) |
12:40:26 | * | slowButPresent joined #nim |
12:40:28 | FromDiscord | <d4rckh> In reply to @enthus1ast "<@648552095531663361>\: maybe write a": i think i might try to make a web ui oof |
12:40:40 | FromDiscord | <d4rckh> and connect the UI using websocket |
12:40:41 | FromDiscord | <d4rckh> (edit) "websocket" => "websockets" |
12:49:20 | FromDiscord | <enthus1ast> the irc stuff was no joke actually, for "some kind of remote control app" i actually like to do this |
12:49:40 | FromDiscord | <enthus1ast> thats the reason i've build a small irc server in nim |
12:50:33 | FromDiscord | <enthus1ast> what you also "could" do is, to make a gui popup for connections |
12:51:05 | FromDiscord | <jmgomez> What would be the date format for the round trip O in nim? https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings#Roundtrip |
12:54:38 | * | v9fk joined #nim |
12:58:06 | FromDiscord | <d4rckh> In reply to @enthus1ast "what you also "could"": i could do that, but i want it to be cli only |
12:59:03 | FromDiscord | <Morvalds> In reply to @d4rckh "i could do that,": well then print info to stdout |
12:59:46 | FromDiscord | <d4rckh> In reply to @d4rckh "": thats what i am doing already, but i want to avoid when its printing while im typing |
12:59:52 | FromDiscord | <d4rckh> but still get updates in real time |
13:00:49 | FromDiscord | <Morvalds> hmm |
13:00:50 | PMunch | And the problem is that you're unable to read what the user types before they hit enter? |
13:02:01 | * | kayabaNerve quit (Read error: Connection reset by peer) |
13:02:10 | * | kayabaNerve_ joined #nim |
13:03:36 | FromDiscord | <Morvalds> i have an idea but its stupid |
13:04:02 | FromDiscord | <Morvalds> take input everytime they press a key |
13:04:20 | FromDiscord | <Morvalds> and just render the same thing they typed there, and let them continue typing |
13:04:26 | FromDiscord | <Morvalds> like this |
13:05:43 | FromDiscord | <Morvalds> sent a code paste, see https://paste.rs/e1W |
13:05:56 | FromDiscord | <Morvalds> genius |
13:10:38 | PMunch | Problem is getting what someone type without them having to hit enter |
13:11:12 | FromDiscord | <Morvalds> hmm |
13:11:14 | FromDiscord | <Morvalds> map every key to enter |
13:14:43 | PMunch | I think this would be pretty easy on Linux, seeing how you can read asynchronously |
13:15:02 | FromDiscord | <Morvalds> In reply to @PMunch "I think this would": never used any distro that lets that happen |
13:15:04 | PMunch | Hmm, well you still need to enter old legacy mode first.. |
13:15:20 | PMunch | @Morvalds, if you run something like bluetoothctl it does this |
13:15:29 | FromDiscord | <Morvalds> and i know for a fact that redhat doesnt let you do that |
13:15:36 | FromDiscord | <Morvalds> and rhel is the most popular server distro |
13:15:46 | PMunch | You run "scan on" and it starts scanning and writes out lines, pushing your prompt further down the screen |
13:15:50 | PMunch | So it certainly isn't impossible |
13:16:11 | PMunch | What do you mean "doesn't let you do that" |
13:16:19 | PMunch | It's Linux, you can do pretty much whatever you want :P |
13:16:57 | FromDiscord | <dom96> In reply to @d4rckh "and connect the UI": Yeah. That’s a great option. |
13:17:10 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:18:35 | FromDiscord | <enthus1ast> the issue is, that you then need to support ansi terminal commands |
13:18:36 | FromDiscord | <enthus1ast> if you want to use them |
13:18:36 | FromDiscord | <enthus1ast> if its only text then ok |
13:18:41 | FromDiscord | <enthus1ast> but stuff like ctrl+c etc will not work there (so easily) |
13:18:57 | FromDiscord | <d4rckh> hmm, tell me more |
13:19:16 | FromDiscord | <enthus1ast> or even vim |
13:20:19 | FromDiscord | <enthus1ast> https://xtermjs.org/ |
13:20:42 | FromDiscord | <enthus1ast> xtermjs is fully featured (i use it quite often in proxmox) |
13:21:03 | FromDiscord | <enthus1ast> but only as a user, never have looked into embedding it |
13:21:42 | FromDiscord | <enthus1ast> maybe you can leverage on this and have a full terminal (but then you might have the same issues like before , but only on the web....) |
13:21:57 | FromDiscord | <enthus1ast> so i guess you could do multiple channels |
13:22:12 | FromDiscord | <enthus1ast> for status mesage, and a command channel for terminal input |
13:24:18 | FromDiscord | <Knedlik> Hey guys, how easy is it to make a modular nim app? |
13:26:21 | FromDiscord | <Entikan> I was wondering this too. Nimble should make it pretty easy. |
13:26:58 | FromDiscord | <Knedlik> How tho? I'm thinking DLCs and mods, that load dynamically |
13:27:16 | FromDiscord | <enthus1ast> but depending on how featureful your "some kind of remote control" app is, you might either want to create custom guils for controlling your machines |
13:27:16 | FromDiscord | <enthus1ast> @Knedlik\: what does modular mean? |
13:27:37 | FromDiscord | <Knedlik> An app that loads all mods/DLCs in a directory |
13:27:55 | FromDiscord | <Entikan> oh |
13:28:10 | FromDiscord | <Entikan> I thought you meant breaking up large software into smaller independent parts |
13:28:55 | FromDiscord | <Entikan> mods/DLC depends greatly on how you write your game |
13:29:09 | FromDiscord | <Knedlik> I know that Java has modules, but what about Nim? T |
13:29:28 | FromDiscord | <Knedlik> (edit) "T" => "What Java calls modules is essentially "Load if present"" |
13:30:36 | FromDiscord | <Entikan> nim has nimble |
13:31:21 | FromDiscord | <Entikan> and instead of modules, it calls it packages |
13:31:35 | FromDiscord | <enthus1ast> i've done it like this for a small module system\: https://play.nim-lang.org/#ix=3WcN |
13:31:45 | FromDiscord | <Knedlik> I mean... is it possible to use a nim-built .dll if it is present and not if it's not? |
13:31:46 | FromDiscord | <enthus1ast> something like this could work |
13:32:21 | FromDiscord | <enthus1ast> modPoll i call periodically somewhere else, because it drives async code inside the module |
13:33:10 | FromDiscord | <Knedlik> What exactly is dynlib? |
13:33:26 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/dynlib.html |
13:33:58 | FromDiscord | <Knedlik> This seems hella useful |
13:34:38 | FromDiscord | <Knedlik> Now I need to somehow get a list of folders in a folder... |
13:35:17 | PMunch | walkFiles is probably your friend |
13:35:24 | PMunch | Or walkFilesRec or whatever it is called |
13:35:54 | PMunch | By the way, you probably want to use ARC if you plan on loading dynamic libraries |
13:37:16 | FromDiscord | <clippy_droid> what would be the nim implementation of a java `IdentityHashMap`?↵here java api link for it <https://docs.oracle.com/javase/7/docs/api/java/util/IdentityHashMap.html> |
13:37:21 | FromDiscord | <clippy_droid> (edit) "<https://docs.oracle.com/javase/7/docs/api/java/util/IdentityHashMap.html>" => "https://docs.oracle.com/javase/7/docs/api/java/util/IdentityHashMap.html" |
13:38:24 | FromDiscord | <Knedlik> Is that just normal hashmap? |
13:38:30 | FromDiscord | <enthus1ast> table? |
13:38:32 | FromDiscord | <Entikan> Table |
13:40:18 | FromDiscord | <clippy_droid> In reply to @Knedlik "Is that just normal": no not really↵`IdentityHashMap` uses `==` for comparing keys and values inside `Map` while `HashMap` uses equals method for comparing keys and values. |
13:41:37 | FromDiscord | <enthus1ast> thats, quite unhelpful |
13:41:57 | FromDiscord | <enthus1ast> withouth knowing java at least |
13:42:05 | FromDiscord | <Knedlik> I do know Java |
13:42:26 | FromDiscord | <enthus1ast> i guess because you cannot overload == in java? |
13:42:34 | FromDiscord | <Knedlik> don't think so |
13:43:05 | FromDiscord | <Knedlik> I'm not sure if you can overload any operator |
13:43:33 | FromDiscord | <clippy_droid> is there a hashmap package for nim |
13:46:12 | FromDiscord | <enthus1ast> I think in nim the hash function of your type controls the table behavior in this case |
13:47:01 | FromDiscord | <d4rckh> In reply to @enthus1ast "https://xtermjs.org/": interesting |
13:47:47 | FromDiscord | <d4rckh> whats a cool web server for nim, that i can run asynchronously |
13:48:10 | FromDiscord | <enthus1ast> Asynchttpserver, prologue, jester |
13:48:23 | FromDiscord | <d4rckh> i think ill give jester a try |
13:48:51 | FromDiscord | <d4rckh> actually, ill go with prologue |
13:49:18 | * | PMunch quit (Quit: Leaving) |
13:49:52 | FromDiscord | <enthus1ast> Both are good, I personally use prologue more often but I also have some projects with jester and asynchttpserver |
13:52:35 | FromDiscord | <Knedlik> Hmmm, if I put Type1 into a seq of Type0, where Type1 inherits Type0, and I access the Type1 from the seq, I should get all it's variables in the previous state, right? |
13:53:36 | FromDiscord | <dom96> In reply to @d4rckh "actually, ill go with": if you just need websockets I would go with an http server like httpbeast and a websockets lib |
13:53:50 | * | arkurious joined #nim |
13:55:29 | FromDiscord | <dom96> use the lightest dependency you can 🙂 |
14:00:52 | NimEventer | New thread by Jmgomez: Datetime parse format for round-trip "O", see https://forum.nim-lang.org/t/9126 |
14:04:04 | FromDiscord | <d4rckh> In reply to @dom96 "if you just need": i think ill stay with prologue |
14:04:33 | FromDiscord | <d4rckh> if i have a sequence of objects, how can i modify a specific object's property? trying to update my client's properties |
14:12:47 | FromDiscord | <Yardanico> In reply to @d4rckh "if i have a": seq[idx].field = 5 |
14:13:34 | FromDiscord | <d4rckh> Hmm, right, thanks |
14:14:06 | FromDiscord | <Knedlik> uhh guys can I somehow redefine a field of a type without anyone complaining? |
14:14:19 | FromDiscord | <Knedlik> Or is it just extending and I can't? |
14:15:56 | FromDiscord | <Yardanico> In reply to @Knedlik "uhh guys can I": huh? |
14:17:16 | FromDiscord | <Knedlik> sent a code paste, see https://paste.rs/WiI |
14:17:47 | FromDiscord | <Knedlik> Can I change it so that in a type inheriting `something`, the `objVar` is of a different type, let's say `int`? |
14:19:37 | FromDiscord | <Knedlik> sent a code paste, see https://paste.rs/zSl |
14:20:12 | FromDiscord | <Knedlik> (edit) "https://paste.rs/rmw" => "https://play.nim-lang.org/#ix=3Wd8" |
14:23:14 | FromDiscord | <Knedlik> I guess no now that I think about it, since it would cause problems when converting |
14:46:25 | FromDiscord | <d4rckh> the example from ws' readme is not working 🤔 ↵https://github.com/treeform/ws |
14:46:35 | FromDiscord | <d4rckh> its complaining about `connections` not being gc safe |
14:47:09 | FromDiscord | <d4rckh> `C:\nim-1.6.4\lib\pure\asyncmacro.nim(200, 31) Error: 'cbIter' is not GC-safe as it accesses 'connections' which is a global using GC'ed memoryPS` |
14:50:41 | FromDiscord | <enthus1ast> @d4rckh\: put a {.gcsafe.} on your async proc |
14:51:09 | * | rb quit (Quit: ZNC - https://znc.in) |
14:51:29 | FromDiscord | <d4rckh> I have it put, it's just like the example |
14:51:29 | FromDiscord | <enthus1ast> (and make sure that you only access connections with one thread at the same time, prolly witch locks) |
14:52:18 | FromDiscord | <enthus1ast> do you call it from somewhere ? |
14:52:24 | * | fallback quit (Ping timeout: 250 seconds) |
14:52:30 | FromDiscord | <enthus1ast> that is not gcSafe yet? |
14:53:29 | FromDiscord | <enthus1ast> i get the same message, but for me its a warning |
14:53:57 | FromDiscord | <enthus1ast> and it runs and compiles |
14:55:06 | FromDiscord | <enthus1ast> it compiles with both 1.6.4 and 1.7.1 (?) for me |
14:57:57 | FromDiscord | <d4rckh> In reply to @enthus1ast "(and make sure that": https://media.discordapp.net/attachments/371759389889003532/968163966540980294/unknown.png |
14:57:59 | FromDiscord | <d4rckh> this is my code |
14:58:09 | * | rwb joined #nim |
15:00:04 | FromDiscord | <d4rckh> not very different from the example |
15:00:06 | FromDiscord | <enthus1ast> yes the ws example |
15:00:26 | FromDiscord | <enthus1ast> which nim version do you use? |
15:00:36 | FromDiscord | <d4rckh> 1.6.4 |
15:02:12 | FromDiscord | <enthus1ast> ok strange |
15:02:18 | FromDiscord | <enthus1ast> and the example as it is? |
15:02:25 | FromDiscord | <enthus1ast> same gcunsafe error? |
15:02:57 | * | fallback joined #nim |
15:15:15 | FromDiscord | <dom96> Wrap the code in a proc to get rid of the global |
15:17:51 | FromDiscord | <huantian> It still feels like it’ll give a gc error |
15:35:05 | * | jjido joined #nim |
15:49:13 | FromDiscord | <d4rckh> In reply to @enthus1ast "and the example as": the only change i made was change waitFor to asyncCheck |
15:49:15 | FromDiscord | <d4rckh> thats all |
15:54:44 | FromDiscord | <huantian> I’ve found async is weird when capturing other variables |
15:55:02 | FromDiscord | <huantian> Though actually that was just me being bad |
15:55:38 | FromDiscord | <d4rckh> `C:\nim-1.6.4\lib\pure\asyncmacro.nim(200, 31) Error: 'cbIter' is not GC-safe as it accesses 'connections' which is a global using GC'ed memory` |
15:55:41 | FromDiscord | <d4rckh> this is the error btw |
16:02:34 | * | PMunch joined #nim |
16:19:08 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
16:28:49 | FromDiscord | <SirOlaf> Is it possible to check if a generic type is passed by value |
16:29:07 | FromDiscord | <SirOlaf> So anything from int to non-ref object |
16:30:22 | * | vicfred joined #nim |
16:32:41 | FromDiscord | <Yardanico> In reply to @SirOlaf "Is it possible to": hmm, I don't think there's a builtin to do that |
16:32:46 | FromDiscord | <Yardanico> the closest would be https://nim-lang.org/docs/typetraits.html#supportsCopyMem%2Ctypedesc but it's a bit different |
16:33:23 | FromDiscord | <Yardanico> In reply to @SirOlaf "Is it possible to": also nim doesn't guarantee "pass by value" for non-ref objects in procedures |
16:33:33 | FromDiscord | <Yardanico> unless you use byref/bycopy for that object's definition |
16:33:42 | FromDiscord | <SirOlaf> Well I just mean that I can cast it to bytes without accidentally breaking the structure |
16:33:57 | FromDiscord | <SirOlaf> So anything with ref would be bad |
16:35:02 | FromDiscord | <Solitude> T: not ref |
16:35:08 | FromDiscord | <Yardanico> well I think building upon supportsCopyMem might be a good start |
16:35:10 | FromDiscord | <SirOlaf> sent a code paste, see https://paste.rs/TFm |
16:35:16 | FromDiscord | <Yardanico> In reply to @Solitude "T: not ref": what if it's a normal object that contains a ref |
16:35:18 | FromDiscord | <Yardanico> supportsCopyMem handles those cases |
16:35:42 | FromDiscord | <Solitude> epic |
16:35:49 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3WdV |
16:36:07 | FromDiscord | <Yardanico> it'll also return false for sequences and strings |
16:36:20 | FromDiscord | <Yardanico> because those also have an internal structure |
16:36:25 | FromDiscord | <Solitude> what a stupid name |
16:36:56 | FromDiscord | <Yardanico> In reply to @Solitude "what a stupid name": rather we're abusing it for another use :) |
16:36:58 | FromDiscord | <SirOlaf> That solution is perfect |
16:37:18 | FromDiscord | <SirOlaf> Needed that to avoid accidentally converting trash |
16:37:20 | FromDiscord | <SirOlaf> So thanks |
16:37:22 | FromDiscord | <Yardanico> also @SirOlaf there's a problem with supportsCopyMem |
16:37:26 | FromDiscord | <SirOlaf> Yeah? |
16:37:35 | FromDiscord | <Solitude> no, the name is stupid. you can describe the process generally, but its named after some specific usecase |
16:37:37 | FromDiscord | <Yardanico> it's made for one specific use-case so it'll also return false for normal non-ref objects that have a destructor defined |
16:37:44 | FromDiscord | <Yardanico> this is the implementation in the compiler: |
16:37:48 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/u1o |
16:38:02 | FromDiscord | <Yardanico> it's made specifically for use in destructors |
16:38:11 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/search?q=supportsCopyMem |
16:38:18 | FromDiscord | <Solitude> oh, its a magic |
16:38:20 | FromDiscord | <Yardanico> yes |
16:38:24 | FromDiscord | <Solitude> epic |
16:39:14 | FromDiscord | <SirOlaf> Why would I have a destructor |
16:39:21 | FromDiscord | <SirOlaf> Sounds like a non-issue |
16:39:27 | FromDiscord | <Yardanico> other code might have a destructor 🤔 |
16:39:41 | FromDiscord | <Yardanico> like if you specifically want the proc to be generic so I assume it would be used by the users of your library |
16:39:43 | FromDiscord | <SirOlaf> Yeah but don't you only really need them for pointers and stuff |
16:39:59 | FromDiscord | <Yardanico> you also use destructors if you want custom semantics for your object |
16:40:36 | FromDiscord | <SirOlaf> Guess so |
16:40:45 | FromDiscord | <SirOlaf> So why supportsCopyMem does check for it |
16:40:51 | FromDiscord | <SirOlaf> (edit) "So why ... supportsCopyMem" added "does" | removed "does" |
16:41:03 | FromDiscord | <Yardanico> because, as I said, it's not made for the purpose you want :) |
16:41:08 | FromDiscord | <Yardanico> it's made to be used in destructors |
16:41:20 | FromDiscord | <SirOlaf> No I get that, but how is the object turned complex because it has a destructor |
16:41:50 | FromDiscord | <Yardanico> so you can't just blindly copy its memory without calling its sink or destroy? |
16:42:27 | FromDiscord | <SirOlaf> But that's the whole point of copying |
16:42:33 | FromDiscord | <SirOlaf> That it doesn't matter |
16:42:53 | FromDiscord | <Solitude> no one stops you |
16:42:56 | FromDiscord | <Yardanico> ehm, you can define =copy for your own object so you expect it to be called |
16:43:21 | FromDiscord | <Yardanico> but yeah i don't see other easy way without having to write a macro that has to recurse over the type definition and check each field recursively if it's a ref (or string or seq) |
16:43:32 | FromDiscord | <Yardanico> maybe there's some proc for that, but I don't remember |
16:43:59 | FromDiscord | <SirOlaf> It seems like the type of thing someone would have needed by now |
16:44:15 | FromDiscord | <Yardanico> it depends on the usecase |
16:44:21 | FromDiscord | <Yardanico> arraymancer has this |
16:44:22 | FromDiscord | <Yardanico> `KnownSupportsCopyMem = SomeNumber | char | Complex[float64] | Complex[float32] | bool` |
16:44:26 | FromDiscord | <Yardanico> and it's enough for arraymancer |
16:45:04 | * | duuude quit (Ping timeout: 250 seconds) |
16:45:08 | FromDiscord | <Yardanico> (yeah, there's also an issue related to supportsCopyMem here) https://media.discordapp.net/attachments/371759389889003532/968190934841970748/unknown.png |
16:47:09 | FromDiscord | <d4rckh> what's the easiest way to get the hostname of the computer? |
16:47:48 | FromDiscord | <Yardanico> In reply to @d4rckh "what's the easiest way": good question |
16:47:53 | * | duuude joined #nim |
16:47:55 | FromDiscord | <Solitude> https://nim-lang.org/docs/nativesockets.html#getHostname |
16:47:57 | FromDiscord | <Yardanico> if you mean the network one, then https://nim-lang.org/docs/nativesockets.html#getHostname seems to work for me at least |
16:48:00 | FromDiscord | <Yardanico> on loonix |
16:48:20 | FromDiscord | <Yardanico> ah yeah it's the one, should work on posix and windows at least |
16:48:43 | FromDiscord | <d4rckh> i was thinking using winim 🤔 |
16:48:53 | FromDiscord | <Yardanico> why |
16:48:56 | FromDiscord | <Yardanico> nim stdlib isn't as small as you think |
16:49:05 | FromDiscord | <Solitude> ugh, what the hell is this shit https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/private/gitutils.nim |
16:49:41 | FromDiscord | <Yardanico> In reply to @Solitude "ugh, what the hell": bad name probably again |
16:49:41 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/search?q=diffFiles |
16:50:13 | FromDiscord | <Yardanico> ah nvm it uses git |
16:50:14 | FromDiscord | <Yardanico> lol |
16:50:26 | FromDiscord | <d4rckh> that works. thank you! @Yardanico |
16:58:48 | FromDiscord | <SirOlaf> https://github.com/disruptek/frosty this does some pretty similar stuff to what I want |
16:58:52 | FromDiscord | <SirOlaf> So yeah this is macro hell |
17:03:36 | * | jjido joined #nim |
17:03:58 | FromDiscord | <d4rckh> okay, illwill and terminal libraries conflict a bit |
17:04:25 | FromDiscord | <d4rckh> i think they both have the `fg..` `bg..` consts defined |
17:04:43 | FromDiscord | <Yardanico> that doesn't make them conflict though |
17:04:59 | FromDiscord | <Yardanico> you can always refer to symbols including the module they're coming from to disambiguate |
17:05:13 | FromDiscord | <Yardanico> `illwill.fgBlack` instead of just fgBlack |
17:05:14 | FromDiscord | <d4rckh> okay i can use `terminal.ForegroundColor.fgWhite` |
17:05:15 | FromDiscord | <Yardanico> or same for terminal |
17:05:19 | FromDiscord | <d4rckh> (edit) "okay i can use `terminal.ForegroundColor.fgWhite` ... " added "for terminal" |
17:05:23 | FromDiscord | <d4rckh> thats a bit ugly but it works ig |
17:05:23 | FromDiscord | <Yardanico> In reply to @d4rckh "okay i can use": no need for ForegroundColor here though |
17:21:35 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:39:27 | FromDiscord | <d4rckh> worked, thanks |
17:40:12 | * | duuude quit (Ping timeout: 240 seconds) |
17:43:00 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Wei |
17:43:22 | FromDiscord | <d4rckh> (edit) "https://play.nim-lang.org/#ix=3Wei" => "https://play.nim-lang.org/#ix=3Wej" |
17:57:11 | FromDiscord | <demotomohiro> Dir is actually not a program just a command of cmd.exe. |
17:58:35 | FromDiscord | <demotomohiro> If I remember correctly, "cmd /k dir" would work. |
17:58:36 | FromDiscord | <d4rckh> oh, right |
17:58:57 | FromDiscord | <demotomohiro> Not /k, "cmd /c dir". |
17:59:03 | FromDiscord | <d4rckh> it dir 😄 |
17:59:08 | FromDiscord | <d4rckh> (edit) "dir" => "did" |
17:59:10 | FromDiscord | <d4rckh> /k worked 🤔 |
17:59:18 | FromDiscord | <d4rckh> /c didnt |
17:59:27 | FromDiscord | <d4rckh> wait, both worked |
17:59:28 | FromDiscord | <Yardanico> btw, instead of `dir` you can just use os.walkDir |
17:59:45 | * | xet7 quit (Remote host closed the connection) |
17:59:48 | FromDiscord | <Yardanico> https://nim-lang.org/docs/os.html#walkDir.i%2Cstring |
18:00:04 | FromDiscord | <choltreppe> hey there, is there any way to run a comand at compiletime? I suppose there isnt, because that is always a impure proc, but maybe I missed something |
18:00:34 | FromDiscord | <demotomohiro> There is `staticExec`. |
18:00:37 | FromDiscord | <Yardanico> yep |
18:00:41 | FromDiscord | <choltreppe> oh nice |
18:01:03 | FromDiscord | <demotomohiro> !eval echo static: staticExec("uname") |
18:01:05 | NimBot | Compile failed: /usercode/in.nim(1, 24) Error: 'staticExec' can only be used in compile-time context |
18:01:22 | FromDiscord | <Yardanico> !eval const t = staticExec("uname"); echo t |
18:01:24 | NimBot | Linux |
18:01:39 | FromDiscord | <Yardanico> In reply to @demotomohiro "!eval echo static: staticExec("uname")": nimbot doesn't output compile-time messages anyway |
18:02:42 | FromDiscord | <demotomohiro> !eval echo static staticExec("uname") |
18:02:45 | NimBot | Linux |
18:02:49 | FromDiscord | <choltreppe> thx |
18:03:02 | FromDiscord | <Yardanico> In reply to @demotomohiro "!eval echo static staticExec("uname")": no need for static here though |
18:03:07 | * | duuude joined #nim |
18:03:14 | FromDiscord | <Yardanico> oh there is, nvm |
18:03:48 | FromDiscord | <demotomohiro> In reply to @Yardanico "no need for static": `echo staticExec("uname")` is compile error. |
18:03:57 | FromDiscord | <Yardanico> In reply to @Yardanico "oh there is, nvm": ^ but yes |
18:04:49 | FromDiscord | <d4rckh> is there something similar to `await asyncdispatch.sleepAsync(100)` that waits until a function is called from another async function? for example i could do `await waitForClientResponse()` in my main async while loop and in another async while loop which listens for client response call something like `receivedResponse()` which would let the first while loop continue executing? |
18:04:57 | FromDiscord | <d4rckh> (edit) "executing?" => "executing" |
18:05:25 | FromDiscord | <Yardanico> In reply to @d4rckh "is there something similar": "waits until a function is called from another async function?" not sure what you mean here |
18:05:28 | FromDiscord | <Yardanico> maybe what you want is futures? |
18:05:38 | FromDiscord | <Yardanico> you can create an arbitrary future and wait for its completion from one async proc |
18:05:42 | FromDiscord | <Yardanico> and complete it from another async proc |
18:05:43 | FromDiscord | <Tyrone Biggums> In reply to @Yardanico ""waits until a function": wait nim has async? |
18:05:46 | FromDiscord | <Yardanico> of course? |
18:05:48 | FromDiscord | <Rika> In reply to @Tyrone Biggums "wait nim has async?": Yes? |
18:05:51 | FromDiscord | <Yardanico> https://nim-lang.org/docs/asyncdispatch.html |
18:05:53 | FromDiscord | <d4rckh> In reply to @Yardanico "you can create an": yes, something like this |
18:05:58 | FromDiscord | <Yardanico> In reply to @d4rckh "yes, something like this": yeah just use `Future` |
18:05:59 | FromDiscord | <Tyrone Biggums> i aint ever seen a language that can do that |
18:06:09 | FromDiscord | <Rika> In reply to @Tyrone Biggums "i aint ever seen": Every modern language can do this |
18:06:26 | FromDiscord | <d4rckh> In reply to @Yardanico "yeah just use `Future`": are there any examples? |
18:06:27 | FromDiscord | <Tyrone Biggums> In reply to @Rika "Every modern language can": really cuz i heard javascript gets a lot of flak for not being able to do that |
18:06:35 | FromDiscord | <Rika> In reply to @Tyrone Biggums "really cuz i heard": JavaScript has async |
18:06:36 | FromDiscord | <Rika> What |
18:06:45 | FromDiscord | <Yardanico> light trolling? 🤔 |
18:06:47 | FromDiscord | <Rika> JavaScript has one of the larger async ecosystems |
18:06:51 | FromDiscord | <Tyrone Biggums> does c have asynce |
18:06:52 | FromDiscord | <Rika> In reply to @Yardanico "light trolling? 🤔": Probably not |
18:06:54 | FromDiscord | <Tyrone Biggums> (edit) "asynce" => "async" |
18:07:00 | FromDiscord | <Rika> In reply to @Tyrone Biggums "does c have async": Yes but it’s not nice |
18:07:07 | FromDiscord | <Yardanico> In reply to @d4rckh "are there any examples?": i have one example in ircord, although it's not the cleanest |
18:07:09 | FromDiscord | <Tyrone Biggums> really |
18:07:12 | FromDiscord | <Yardanico> and it's for a different purpose |
18:07:13 | FromDiscord | <Tyrone Biggums> hmm |
18:07:24 | FromDiscord | <Yardanico> https://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L111-L114 @d4rckh |
18:07:26 | FromDiscord | <Rika> Of course, how else would Nim have async if C couldn’t model it |
18:07:34 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/968211681132032030/unknown.png |
18:07:41 | FromDiscord | <Tyrone Biggums> In reply to @Rika "Of course, how else": cpp |
18:07:44 | FromDiscord | <Yardanico> here I am making it so that only one handleIrcCmd can execute at the same time |
18:07:45 | FromDiscord | <Yardanico> via a future |
18:07:48 | FromDiscord | <Rika> In reply to @Tyrone Biggums "cpp": Same story |
18:08:04 | FromDiscord | <Yardanico> well actually i complete it from a different place https://media.discordapp.net/attachments/371759389889003532/968211808806649976/unknown.png |
18:08:07 | FromDiscord | <Tyrone Biggums> idk cpp has ventured so far from c it might aswell be a different language |
18:08:12 | FromDiscord | <Yardanico> so it's waiting for a response from another async proc |
18:08:14 | FromDiscord | <Yardanico> via a future |
18:08:27 | FromDiscord | <Yardanico> and this way you can share data between async procedures as well |
18:08:36 | FromDiscord | <d4rckh> should ircAccResp be global? |
18:08:50 | FromDiscord | <Rika> In reply to @Tyrone Biggums "idk cpp has ventured": I don’t see what stops it from having async though |
18:08:55 | FromDiscord | <Yardanico> well it doesn't have to be global, you can instead pass it around in your async procs |
18:08:57 | FromDiscord | <Yardanico> because Future is a ref |
18:09:01 | FromDiscord | <Rika> Well this is a digression so |
18:10:48 | FromDiscord | <d4rckh> how should i define that? something like this doesnt work `var clResp: Future` |
18:10:57 | FromDiscord | <Yardanico> Future[void] |
18:11:09 | FromDiscord | <Yardanico> or Future[bool] if you want to check for success/failure of something |
18:11:12 | FromDiscord | <d4rckh> oh thanks |
18:11:15 | FromDiscord | <Yardanico> you can create a future of any type |
18:11:23 | FromDiscord | <Tyrone Wiggums> so should i learn nim? |
18:11:40 | FromDiscord | <2F42BBA1> In reply to @Tyrone Wiggums "so should i learn": depends on your goals |
18:11:42 | FromDiscord | <d4rckh> In reply to @Tyrone Wiggums "so should i learn": maybe try javascript first |
18:11:44 | FromDiscord | <2F42BBA1> i use rust and nim |
18:11:55 | FromDiscord | <Tyrone Wiggums> In reply to @d4rckh "maybe try javascript first": i used its dad, java |
18:12:06 | FromDiscord | <Tyrone Wiggums> used a bit of c and like ruby |
18:12:24 | FromDiscord | <Yardanico> In reply to @Tyrone Wiggums "i used its dad,": good joke, but old |
18:13:33 | FromDiscord | <d4rckh> wow thanks @Yardanico!! |
18:13:34 | FromDiscord | <d4rckh> it worked |
18:14:05 | FromDiscord | <d4rckh> `Error: unhandled exception: An attempt was made to complete a Future more than once. Details:` |
18:14:10 | FromDiscord | <d4rckh> what should i do after i complete it? |
18:14:35 | FromDiscord | <Yardanico> not sure, if you want to reuse it you can set it to a new one again |
18:14:56 | FromDiscord | <d4rckh> ill just set it to nil |
18:15:05 | FromDiscord | <Yardanico> well you can't complete a `nil` future |
18:15:24 | FromDiscord | <Yardanico> so maybe then check if it was already completed, although I don't know how your code is structured |
18:15:30 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3WeC |
18:15:31 | FromDiscord | <d4rckh> i just do this |
18:15:34 | FromDiscord | <d4rckh> similarly to how you did it |
18:15:41 | FromDiscord | <Yardanico> ah okay |
18:15:46 | FromDiscord | <Yardanico> if that works for you it's fine :) |
18:15:58 | FromDiscord | <Yardanico> ah @d4rckh there's a better way apparently |
18:15:59 | FromDiscord | <Yardanico> `clean` |
18:16:06 | FromDiscord | <Yardanico> just do `clResp.clean()` and then await it |
18:16:18 | FromDiscord | <Yardanico> err, sorry, that's for FutureVar |
18:18:03 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3WeD |
18:18:09 | FromDiscord | <Yardanico> In reply to @2F42BBA1 "i have a simple": can't help without code |
18:18:15 | FromDiscord | <Yardanico> you have a syntax error |
18:18:16 | FromDiscord | <2F42BBA1> hold on |
18:18:19 | FromDiscord | <2F42BBA1> let me find it |
18:18:21 | FromDiscord | <d4rckh> In reply to @Yardanico "err, sorry, that's for": haha np |
18:18:31 | FromDiscord | <Yardanico> In reply to @2F42BBA1 "let me find it": just port the part of the code where it errors |
18:19:33 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3WeE |
18:19:39 | FromDiscord | <Rika> True is lowercase in Nim |
18:19:42 | FromDiscord | <Yardanico> that's not how you define procedures in nim |
18:19:45 | FromDiscord | <Rika> Also yeah |
18:19:48 | FromDiscord | <Yardanico> `proc trolleybus(msg, webhook) = ` |
18:19:53 | FromDiscord | <2F42BBA1> FUCK |
18:19:59 | FromDiscord | <2F42BBA1> I forgot about that |
18:19:59 | FromDiscord | <Rika> Misspelled except as expect |
18:20:03 | FromDiscord | <Yardanico> xd |
18:20:09 | FromDiscord | <ynfle> You need the types of the parameters also |
18:20:33 | FromDiscord | <Yardanico> that too |
18:20:36 | FromDiscord | <Yardanico> Nim is not Python |
18:20:39 | FromDiscord | <Yardanico> :) |
18:21:05 | FromDiscord | <Tyrone Wiggums> In reply to @Yardanico "Nim is not Python": this truly is an interesting development |
18:21:07 | FromDiscord | <Yardanico> yes |
18:21:12 | FromDiscord | <2F42BBA1> In reply to @Rika "Misspelled except as expect": I used nano while writing that xD |
18:21:24 | FromDiscord | <Yardanico> well, that doesn't really matter though |
18:21:25 | FromDiscord | <ynfle> In reply to @2F42BBA1 "I used nano while": Sorry to hear that |
18:21:31 | FromDiscord | <Yardanico> I doubt anyone has a spell checker in their code editor |
18:21:43 | FromDiscord | <Yardanico> instead people use syntax checkers |
18:21:54 | FromDiscord | <ynfle> In reply to @Yardanico "I doubt anyone has": I have one in VSCode, but I usually use vim |
18:21:56 | FromDiscord | <Tyrone Wiggums> In reply to @Yardanico "I doubt anyone has": is that a bad thjing |
18:22:01 | FromDiscord | <Yardanico> just not usual |
18:22:01 | FromDiscord | <Rika> In reply to @Yardanico "I doubt anyone has": I would have one if I wasn’t lazy |
18:24:30 | FromDiscord | <Tyrone Wiggums> the weird thing is |
18:24:40 | FromDiscord | <Tyrone Wiggums> i have a spell checker but no syntax checker |
18:28:26 | FromDiscord | <Yardanico> @2F42BBA1 generally there's a very useful command to check for syntax errors if your editor doesn't do that |
18:28:28 | FromDiscord | <Yardanico> `nim check file.nim` |
18:28:41 | FromDiscord | <Yardanico> it doesn't stop on the first error unlike the compiler |
18:29:55 | FromDiscord | <0000> i farded |
18:32:13 | FromDiscord | <0000> https://tenor.com/view/tang916-happy-easter-easter-bunny-dancing-dancing-bunny-gif-25366607 |
18:32:17 | FromDiscord | <0000> embed fail |
18:34:15 | * | jjido joined #nim |
18:37:11 | FromDiscord | <d4rckh> okay, if i made my future local (passed using an argument in my proc), how can i reset it? @Yardanico |
18:37:33 | FromDiscord | <d4rckh> wait, if i define it as `clResp: var Future[void]` will it work? |
18:38:10 | FromDiscord | <d4rckh> negative |
18:38:10 | FromDiscord | <Yardanico> no, you can't pass `var` to async procs |
18:38:24 | FromDiscord | <d4rckh> what can i do about it then? |
18:39:21 | FromDiscord | <choltreppe> Can someone explain why this works: |
18:39:56 | FromDiscord | <Yardanico> @choltreppe deleting is generally useless, as this chat is relayed to IRC where messages don't get deleted |
18:40:04 | FromDiscord | <Yardanico> just fyi :) |
18:40:19 | FromDiscord | <Yardanico> In reply to @d4rckh "what can i do": not really sure |
18:40:30 | FromDiscord | <d4rckh> A pointer or something? |
18:40:38 | FromDiscord | <Yardanico> one way would be to cast it to the internal future type and "clean" it, but that's a slight hack |
18:40:52 | FromDiscord | <Yardanico> or cast it to FutureVar and clean |
18:41:08 | FromDiscord | <d4rckh> I want to pass it via an argument to my proc so i can have that huge proc in a different file |
18:41:49 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/LLa |
18:42:15 | FromDiscord | <Yardanico> ah nvm it doesn't |
18:42:22 | FromDiscord | <Yardanico> or does it |
18:43:11 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3WeL |
18:43:27 | FromDiscord | <2F42BBA1> i am pretty sure i fucked up somewhere |
18:43:49 | FromDiscord | <Yardanico> because you're using readLine right after your first echo? |
18:44:01 | FromDiscord | <Yardanico> that's not how you use readLine |
18:44:17 | FromDiscord | <2F42BBA1> Then how do I use it properly for this? |
18:45:00 | FromDiscord | <Yardanico> and please don't use `fmt` and parenthesis for `echo` where you don't need to |
18:45:08 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3WeN |
18:45:29 | FromDiscord | <Yardanico> stdout.write doesn't output a newline so the thing user inputs is displayed right after the colon with a space |
18:45:58 | FromDiscord | <Yardanico> `fmt` in Nim is only needed for string interpolation, if you just have a normal string you don't need it |
18:46:09 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3WeQ |
18:46:31 | FromDiscord | <Yardanico> well you can actually make it a ref Future |
18:46:37 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3WeR |
18:46:38 | FromDiscord | <Yardanico> In reply to @2F42BBA1 "Thanks works as intended": huh? |
18:46:38 | FromDiscord | <2F42BBA1> 👍 |
18:46:47 | FromDiscord | <Yardanico> you only need to change to `var` if you plan on modifying the value later |
18:47:01 | FromDiscord | <2F42BBA1> In reply to @Yardanico "you only need to": i meant the var's name |
18:47:03 | FromDiscord | <Yardanico> In reply to @Yardanico "well you can actually": it'll just be double pointer indirection, so not that pretty |
18:47:18 | FromDiscord | <2F42BBA1> because in my proc i specified it will read msg and webhook vars |
18:47:43 | FromDiscord | <d4rckh> In reply to @Yardanico "well you can actually": ref Future? |
18:48:03 | FromDiscord | <d4rckh> oh |
18:48:03 | FromDiscord | <Yardanico> yes |
18:48:04 | FromDiscord | <d4rckh> okay |
18:49:26 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3WeT |
18:49:28 | FromDiscord | <Yardanico> but again, this is a bit ugly |
18:50:08 | * | duuude quit (Ping timeout: 260 seconds) |
18:51:12 | FromDiscord | <d4rckh> weird syntax but it works |
18:51:17 | FromDiscord | <d4rckh> (edit) removed "but it works" |
18:51:29 | FromDiscord | <Yardanico> `[]` is a dereferencing operator in Nim |
18:51:39 | FromDiscord | <d4rckh> and it works 😄 |
18:52:35 | FromDiscord | <Yardanico> actually there's a much simpler way without double indirection or futures, you just make a normal `ref int` or `ref bool` and just pass that around and change it |
18:55:38 | FromDiscord | <Yardanico> but then you can have races between completing the future and modifying it in the async proc |
18:55:42 | FromDiscord | <Yardanico> even with the simple ref bool approach |
18:58:34 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3WeW |
18:58:48 | FromDiscord | <Yardanico> this is what I mean, but if you have big enough intervals before making the future "complete" again then it'll work |
18:59:08 | FromDiscord | <Yardanico> without the `await sleepAsync(10)` call in the main proc waitAndLoop will forever wait for second `await` |
18:59:43 | FromDiscord | <Yardanico> @d4rckh ^ idk if you prefer this approach to futures |
18:59:48 | FromDiscord | <Yardanico> but at least this has less overhead :P |
19:06:12 | FromDiscord | <2F42BBA1> what nim doesn't like here....↵`Error: expression 'trolleybus(msg, webhook)' is of type 'Future[system.void]' and has to be used (or discarded)` |
19:06:35 | FromDiscord | <2F42BBA1> sent a code paste, see https://play.nim-lang.org/#ix=3WeY |
19:06:41 | FromDiscord | <Yardanico> because if it's an async proc, you need to `await` it |
19:06:49 | FromDiscord | <Yardanico> or `waitFor` or `asyncCheck`, but in your case `await` |
19:06:57 | FromDiscord | <Yardanico> https://nim-lang.org/docs/asyncdispatch.html read some async docs there |
19:07:09 | FromDiscord | <2F42BBA1> well async check worked for me |
19:07:12 | FromDiscord | <2F42BBA1> await one didn't |
19:07:18 | FromDiscord | <Yardanico> and this https://peterme.net/asynchronous-programming-in-nim.html |
19:07:19 | FromDiscord | <2F42BBA1> proc is already asynced |
19:07:29 | FromDiscord | <Yardanico> In reply to @2F42BBA1 "await one didn't": you should make your main proc async as weell then |
19:07:39 | FromDiscord | <2F42BBA1> `proc trolleybus(msg: string, webhook: string) {.async.} =` |
19:07:42 | FromDiscord | <2F42BBA1> well it is already |
19:07:43 | FromDiscord | <Yardanico> yes |
19:07:48 | FromDiscord | <Yardanico> but I meant the main proc |
19:07:52 | FromDiscord | <Yardanico> the one that calls trolleybus |
19:07:56 | FromDiscord | <Yardanico> it needs to be `async` as well |
19:08:08 | FromDiscord | <2F42BBA1> okie |
19:08:16 | FromDiscord | <2F42BBA1> 🚎 |
19:08:45 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Wf0 |
19:09:20 | FromDiscord | <2F42BBA1> finally |
19:09:26 | FromDiscord | <2F42BBA1> i made my first nim thing |
19:09:38 | FromDiscord | <2F42BBA1> hooray |
19:11:09 | FromDiscord | <Tyrone Wiggums> In reply to @2F42BBA1 "i made my first": Nice! |
19:16:06 | FromDiscord | <choltreppe> sent a code paste, see https://play.nim-lang.org/#ix=3Wf3 |
19:18:01 | FromDiscord | <Tyrone Wiggums> Why is nim used for servers so much |
19:18:23 | * | duuude joined #nim |
19:19:09 | FromDiscord | <Tyrone Wiggums> I've seen 2 ppl with servers and clients in their code |
19:19:36 | FromDiscord | <choltreppe> I dont know I like nim and wanted to do that 🤷♂️ |
19:20:07 | FromDiscord | <Tyrone Wiggums> thats 2 more pppl than i have friends |
19:20:08 | FromDiscord | <Tyrone Wiggums> :( |
19:20:34 | FromDiscord | <choltreppe> 😂 |
19:20:58 | FromDiscord | <Tyrone Wiggums> sorry i was one off |
19:21:01 | FromDiscord | <Tyrone Wiggums> 3 more people than i have friends |
19:21:25 | FromDiscord | <Tyrone Wiggums> that moment when you have -1 friends |
19:23:11 | PMunch | @choltreppe, wild guess is that Nim doesn't wait for staticExec to complete |
19:23:51 | PMunch | Try to store the result of the `nim js` compilation in a const as well and print that out, maybe Nim will wait if it figures you wanted the result.. |
19:24:21 | PMunch | @Tyrone_Biggums, fast but still expressive language |
19:24:38 | PMunch | Tends to draw in people who wants to do stuff that requires speed, or who just wants to write nice code |
19:24:49 | FromDiscord | <Yardanico> In reply to @choltreppe "does someone know why": btw, any reason you overcomplicated this instead of just using a block of code? lemme show |
19:24:50 | FromDiscord | <Tyrone Wiggums> java code is nice |
19:25:01 | PMunch | @Tyrone_Biggums, to each their own I guess |
19:25:09 | FromDiscord | <Tyrone Wiggums> even better asm code |
19:25:28 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Wf7 |
19:25:29 | PMunch | Someone likes dripping molten wax into their eyes, someone likes to program in Java, I'm not going to tell people what to do |
19:25:36 | FromDiscord | <Yardanico> won't this work for you? @choltreppe |
19:25:52 | FromDiscord | <choltreppe> ah yes that looks cleaner |
19:26:00 | FromDiscord | <Tyrone Wiggums> In reply to @PMunch "Someone likes dripping molten": dont compare programming in java and dripping motel wax into your eyes |
19:26:16 | FromDiscord | <Tyrone Wiggums> you dont want it with james gosling |
19:26:22 | FromDiscord | <Tyrone Wiggums> ask nas, he dont want it with james gosling |
19:26:50 | FromDiscord | <choltreppe> fortunatly does work |
19:26:57 | FromDiscord | <Tyrone Wiggums> In reply to @choltreppe "fortunatly does work": fortunetly |
19:27:05 | FromDiscord | <choltreppe> what pmunch sugested |
19:27:21 | FromDiscord | <choltreppe> dont understand how to reply propery |
19:27:38 | FromDiscord | <choltreppe> (edit) "fortunatly does" => "fortunetly doesnt" |
19:27:48 | PMunch | @choltreppe good to know |
19:28:04 | PMunch | @Tyrone_Biggums, I'm half kidding, Java isn't half bad. Lot's of boilerplate though |
19:28:54 | FromDiscord | <choltreppe> but why would nim just not wait for execution anyways? |
19:29:08 | FromDiscord | <Tyrone Wiggums> In reply to @PMunch "@Tyrone_Biggums, I'm half kidding,": i mean james gosling did say he wanted to create a boilerplate driven programming language for microsystems |
19:29:41 | PMunch | @choltreppe, if you don't actually want the results of the execution why would it? |
19:30:07 | PMunch | I mean in this case it means you have to not discard output, in other cases it means the compiler is faster |
19:30:46 | PMunch | @Tyrone_Biggums, boilerplate-driven? Now that's a concept I've never heard of |
19:30:56 | FromDiscord | <Tyrone Wiggums> its what james gosling wanted |
19:31:00 | PMunch | Why on earth would you want that? Is James sponsored by big-RSI |
19:31:05 | FromDiscord | <Tyrone Wiggums> no |
19:31:07 | FromDiscord | <Tyrone Wiggums> he just |
19:31:12 | FromDiscord | <Tyrone Wiggums> really likes boilerplate |
19:31:15 | FromDiscord | <Tyrone Wiggums> i mean i understand it |
19:31:20 | FromDiscord | <Tyrone Wiggums> boilerplate is downtime |
19:31:29 | FromDiscord | <Tyrone Wiggums> where you dont have to think too much about errors |
19:35:06 | * | jmdaemon joined #nim |
19:57:02 | PMunch | I like programming, I don't like writing code |
19:58:52 | FromDiscord | <choltreppe> 🙌 it works now. I dont realy know why. I tried out a bunch of stuff and am now back to pretty much what I started with but it works. thanks for the help anyways |
20:00:49 | FromDiscord | <Prestige> In reply to @PMunch "I like programming, I": True that |
20:01:01 | FromDiscord | <Tyrone Wiggums> In reply to @PMunch "I like programming, I": :( |
20:01:24 | * | Zectbumo joined #nim |
20:05:07 | FromDiscord | <Prestige> Do we have a system where I could pay one of the devs to fix an issue I've opened with nimsuggest? |
20:05:43 | PMunch | Bountysource? |
20:05:52 | PMunch | Or whatever the thing is called |
20:05:58 | PMunch | What's the issue? |
20:06:11 | FromDiscord | <Prestige> https://github.com/nim-lang/Nim/issues/19371 |
20:07:06 | PMunch | Hmm |
20:07:33 | FromDiscord | <Prestige> Just made the editor experience much worse for me since 1.6 |
20:08:12 | FromDiscord | <Tyrone Wiggums> In reply to @Avahe "Just made the editor": so sad |
20:08:17 | FromDiscord | <Prestige> Fingers crossed IC brings stable/good editing support |
20:14:06 | FromDiscord | <Elegantbeef> @Prestige\: not ideal but you can use that one bodge fix I had to build nimsuggest |
20:14:32 | FromDiscord | <Elegantbeef> Where we make a `==` that compares if the ids of `PType`/`PSym` aswell as pointers |
20:20:11 | nrds | <Prestige99> Would that potentially break other things? |
20:20:14 | NimEventer | New thread by Krakengore: Introspection over a proc type, see https://forum.nim-lang.org/t/9127 |
20:22:24 | FromDiscord | <Elegantbeef> No prestige it should just work |
20:22:31 | FromDiscord | <Elegantbeef> It'll slow it down slightly but it'll work |
20:23:17 | FromDiscord | <Elegantbeef> Negligibly slow it down only an extra int comparison |
20:23:29 | FromDiscord | <Elegantbeef> It's just a bodge though and doesnt resolve the actual issue which is why there is no PR for it |
20:23:32 | nrds | <Prestige99> tbh I think it should just be accepted and merged till a "proper" fix is added |
20:23:42 | nrds | <Prestige99> since they broke it |
20:23:46 | FromDiscord | <Elegantbeef> Feel free to PR it |
20:25:43 | FromDiscord | <Elegantbeef> I think it shouldnt break anything just add some tests and PR it if you want it PR'd |
20:26:26 | nrds | <Prestige99> I'm just going to comment on your PR my recommendation to merge |
20:27:22 | * | Zectbumo quit (Remote host closed the connection) |
20:28:08 | FromDiscord | <Elegantbeef> That PR doesnt have the proper fix iirc |
20:28:57 | FromDiscord | <Elegantbeef> Yea that PR doesnt have the `==` operator override i just documented it |
20:29:30 | FromDiscord | <Elegantbeef> I'll look at it again today |
20:29:54 | nrds | <Prestige99> Tyvm |
20:31:21 | FromDiscord | <Elegantbeef> It's just an odd bug that for some reason old types/symbols arent being reused, it's probably due to IC comically enough |
20:41:33 | * | vicfred quit (Quit: Leaving) |
20:50:45 | PMunch | Oh hi @Elegantbeef, did you see the message I sent you earlier? |
20:51:22 | PMunch | Well, not sent you, but tagged you in |
20:54:24 | FromDiscord | <Elegantbeef> nope |
20:54:47 | PMunch | https://irclogs.nim-lang.org/25-04-2022.html#12:35:37 |
20:59:25 | FromDiscord | <clippy_droid> what would `isinstance()` from python look like in nim |
21:00:20 | PMunch | Well it would probably be `isInstance()` |
21:00:51 | FromDiscord | <clippy_droid> no like i need its implementation |
21:01:02 | PMunch | I figured, just messing with you |
21:01:12 | PMunch | `typeof(x) == int` |
21:01:33 | FromDiscord | <clippy_droid> 👍 |
21:02:18 | PMunch | Oh sorry it has be is |
21:02:21 | * | kayabaNerve_ quit (Ping timeout: 276 seconds) |
21:02:39 | PMunch | !eval echo typeof(5) is int |
21:02:42 | NimBot | true |
21:04:24 | FromDiscord | <clippy_droid> oh |
21:04:40 | FromDiscord | <clippy_droid> also how do i turn a string into a byte string |
21:05:01 | PMunch | Define byte string |
21:05:07 | PMunch | All strings are made up of bytes |
21:05:21 | PMunch | In fact, everything on your computer is made up of bytes |
21:05:51 | PMunch | Well, there might be some loose bits hanging around, but typically you don't have to worry about those |
21:05:59 | FromDiscord | <clippy_droid> ok so `"hello"` should become `b"hello"` in python |
21:06:22 | FromDiscord | <Rika> the concept doesnt exist in nim |
21:06:29 | PMunch | !eval echo "b\" & "my string" & "\"" |
21:06:31 | NimBot | Compile failed: /usercode/in.nim(1, 14) Error: undeclared identifier: 'my' |
21:06:43 | PMunch | !eval echo "b\"" & "my string" & "\"" |
21:06:45 | NimBot | b"my string" |
21:06:53 | PMunch | There you go |
21:06:59 | FromDiscord | <Rika> thats not what he means |
21:07:06 | PMunch | I know :P |
21:07:24 | FromDiscord | <Rika> damn bro you got the whole room laughing |
21:07:24 | FromDiscord | <clippy_droid> In reply to @Rika "the concept doesnt exist": ah damn |
21:07:27 | PMunch | I'm just trying to tease them into being more precise in their questions |
21:07:59 | FromDiscord | <Rika> wow its working so well |
21:08:06 | * | nsyd joined #nim |
21:08:29 | PMunch | Well saying that Nim doesn't have byte strings is a bit incorrect, it's more like every string in Nim is a byte string |
21:08:41 | PMunch | Nim doesn't have an abstract non-byte-related string concept |
21:10:08 | PMunch | @clippy_droid, what do you think you need a byte string for? |
21:10:39 | FromDiscord | <Rika> thats what i meant by the concept |
21:10:56 | FromDiscord | <Rika> im just a bit busy to word |
21:10:57 | FromDiscord | <Rika> (edit) "im just a bit busy to word ... " added "it" |
21:11:10 | * | Gustavo6046 joined #nim |
21:12:20 | * | Gustavo6046 quit (Remote host closed the connection) |
21:12:46 | * | Gustavo6046 joined #nim |
21:14:07 | FromDiscord | <sheerluck> In reply to @PMunch "@clippy_droid, what do you": to get `b'\xe3\x82\x8a\xe3\x81\x8b'` out of `"りか".encode("utf-8")` |
21:14:35 | PMunch | But that's just "りか" in Nim isn't it? |
21:15:50 | FromDiscord | <sheerluck> okay I have to go to sleep bye |
21:15:52 | PMunch | !eval import strutils; let x = "りか"; echo x.toHex |
21:15:56 | NimBot | E3828AE3818B |
21:16:03 | PMunch | Eh, same |
21:16:26 | PMunch | I was just waiting around to see if @Elegantbeef would comment on my little project, but apparently not :( |
21:17:01 | * | PMunch quit (Quit: leaving) |
21:19:30 | FromDiscord | <dom96> I can comment |
21:19:34 | FromDiscord | <dom96> just tell me what it is |
21:24:07 | nrds | <Prestige99> Want to comment on my nimsuggest issue dom96? :P |
21:28:30 | FromDiscord | <!Patitotective> In reply to @PMunch "But that's just "りか"": リカ 💀 |
21:30:40 | FromDiscord | <Elegantbeef> Eh sorry pmunch went for a dog walk |
21:34:40 | FromDiscord | <Elegantbeef> Anyway pmunch i stand by the "would be nice if we could do this without annotations" 😄 |
21:35:36 | FromDiscord | <dom96> Prestige: I can comment on anything you like |
21:36:22 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/pull/19624#issuecomment-1109008668 this PR is what he wants commented on |
21:36:29 | FromDiscord | <Elegantbeef> Not much the PR but the "Hey fix the nimsuggest" |
21:36:53 | * | greaser|q quit (Changing host) |
21:36:53 | * | greaser|q joined #nim |
21:37:04 | FromDiscord | <Elegantbeef> There is what i'd consider a showstopper wiht nimsuggest in that it thinks some code is error ridden but is not |
21:37:09 | * | greaser|q is now known as GreaseMonkey |
21:37:22 | FromDiscord | <Elegantbeef> Which ruins nimlsp and nimsuggest's check |
21:40:39 | FromDiscord | <Elegantbeef> I've looked into it prior but have not found the culprit, it's very much some phantom pointers being made |
21:57:37 | * | vicfred joined #nim |
21:59:21 | * | Zectbumo joined #nim |
22:03:26 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:04:10 | * | kayabaNerve joined #nim |
22:04:26 | FromDiscord | <SirOlaf> I got a related question, why does my nimsuggest.log contain thousands of `internal error: D:\a\nightlies\nightlies\nim-1.7.1\compiler\vmgen.nim(1653, 23)` |
22:05:27 | FromDiscord | <Rika> That means what it means, the compiler had an internal error |
22:05:27 | FromDiscord | <Elegantbeef> Probably cause an optimization caused a crash in vmgen |
22:06:40 | FromDiscord | <SirOlaf> Well it's not good, I think it's related to my install of the nimsaem extension being painfully slow |
22:10:22 | nrds | <Prestige99> probably. nimsuggest bogs down my whole computer |
22:10:26 | nrds | <Prestige99> so I have it turned off now |
22:20:08 | FromDiscord | <SirOlaf> Yeah so I'm gonna need to figure out why this error happens |
22:20:14 | FromDiscord | <SirOlaf> Extension works perfectly until that appears |
22:22:22 | FromDiscord | <ynfle> You can try nimlsp |
22:22:49 | FromDiscord | <ynfle> I use it with vim. It works well except for goto definition, but that could be my config's fault |
22:24:00 | nrds | <Prestige99> I'm using it with neovim, but have issues with nimsuggest there as well |
22:24:12 | nrds | <Prestige99> so actually I'm no longer using nimlsp for that reason |
22:37:45 | FromDiscord | <Elegantbeef> Yea the issue effects nimsuggest which is what nimlsp uses so by extension it effects "all" tooling |
22:37:55 | FromDiscord | <SirOlaf> Turns out commenting that line makes it better to some extent but it also gives wrong output |
22:37:55 | FromDiscord | <Elegantbeef> Think the vscode extension by default uses `nim check` |
22:38:19 | FromDiscord | <SirOlaf> But much more usable even with that wrong output |
22:47:21 | FromDiscord | <SirOlaf> What are the odds of this commit having caused damage https://github.com/nim-lang/Nim/commit/a9ae5fe5be783c7b7923f377b0cf7d4abc806e81 |
22:48:08 | FromDiscord | <Elegantbeef> Dont think it should since it just grows it |
22:48:44 | FromDiscord | <SirOlaf> Well something must have broken at some point |
22:48:49 | FromDiscord | <SirOlaf> This is a pretty good candidate |
22:49:27 | FromDiscord | <Elegantbeef> Git bisect |
22:49:27 | FromDiscord | <Elegantbeef> Though it's' tedious to do if it's between 1.4 and 1.6 |
22:51:20 | FromDiscord | <SirOlaf> Would probably die of old age by the time I find it that way, but you're probably right |
22:51:47 | FromDiscord | <Elegantbeef> Well you can test the commit before of course |
22:52:35 | FromDiscord | <Tyrone Wiggums> can you embed nim in other apps |
22:52:57 | FromDiscord | <huantian> Define other apps |
22:53:00 | FromDiscord | <Elegantbeef> You mean the VM or the compiled program? |
22:53:08 | FromDiscord | <Tyrone Wiggums> the VM |
22:53:12 | FromDiscord | <Elegantbeef> You can make system libraries, and you can embed the VM |
22:53:13 | FromDiscord | <Tyrone Wiggums> i want to be able to execute nim code |
22:53:20 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter |
22:53:22 | FromDiscord | <Tyrone Wiggums> withinside another app |
22:57:38 | FromDiscord | <Elegantbeef> Remember that nimscript is a subset of Nim so it may not be capable of what you want to do, and my bridge doesnt handle reference/mutable code presently |
23:28:30 | FromDiscord | <Elegantbeef> Prestige you about? |
23:30:40 | nrds | <Prestige99> Yeah |
23:30:47 | nrds | <Prestige99> What's up Elegantbeef |
23:31:01 | FromDiscord | <Elegantbeef> Eh i forgot the second issue, but remembered it after pinging |
23:31:08 | nrds | <Prestige99> oh ok |
23:31:10 | FromDiscord | <Elegantbeef> Going to make the PR for you to pester people about 😛 |
23:31:16 | nrds | <Prestige99> I love you |
23:31:36 | nrds | <Prestige99> side question, can we use `collect` to create an array at compile time? instead of a seq |
23:31:58 | FromDiscord | <Elegantbeef> I'd use collect then an `unpack` macro that converts it to an array |
23:32:04 | FromDiscord | <Elegantbeef> You can in theory use any collection iirc |
23:33:24 | FromDiscord | <Elegantbeef> that macro of course doesnt exist 😄 |
23:34:35 | FromDiscord | <huantian> I mean it can't be that hardd |
23:34:37 | nrds | <Prestige99> hmm okay |
23:34:43 | FromDiscord | <Elegantbeef> To do what? |
23:35:02 | nrds | <Prestige99> I actually need a seq now that I think about it, so it's fine |
23:35:04 | FromDiscord | <huantian> to make the macro that odesn't exist |
23:35:11 | FromDiscord | <Elegantbeef> Ah |
23:43:02 | FromDiscord | <Elegantbeef> There you go presetige |
23:59:07 | * | nsyd quit (Ping timeout: 240 seconds) |