00:03:41 | FromDiscord | <Yardanico> Why |
00:03:52 | FromDiscord | <Yardanico> You can have userbots in telegram |
00:06:34 | FromDiscord | <kaletaa> i'm not sure if any of the libraries support interacting with those buttons |
00:06:37 | FromDiscord | <kaletaa> and quizzes |
00:06:47 | FromDiscord | <kaletaa> and the other misc stuff durov jammed into telegram |
00:07:04 | FromDiscord | <kaletaa> v https://media.discordapp.net/attachments/371759389889003532/724415118842134596/unknown.png |
00:07:11 | FromDiscord | <kaletaa> https://media.discordapp.net/attachments/371759389889003532/724415148818956298/unknown.png |
00:07:14 | FromDiscord | <kaletaa> i'm not sure what you call those |
00:08:17 | FromDiscord | <Yardanico> @kaletaa yeah of course they do, not in Nim though (since I didn't make my telenim into something easily usable yet) |
00:08:25 | FromDiscord | <Yardanico> But you can check Python libs for example |
00:08:34 | FromDiscord | <Yardanico> Telethon, pyrogram, etc |
00:08:43 | FromDiscord | <kaletaa> yeah those have great support |
00:09:07 | FromDiscord | <Yardanico> Well they support the full user API too |
00:09:13 | FromDiscord | <kaletaa> yeah it doesn't seem like a hard task |
00:09:17 | FromDiscord | <kaletaa> it just seems tedious |
00:11:20 | * | vikfret quit (Quit: Leaving) |
00:12:31 | * | vicfred quit (Quit: Leaving) |
00:14:30 | * | vicfred joined #nim |
00:18:00 | FromDiscord | <j-james> Hmm so↵This is probably a dumb question↵But how can I call a different Nim program in the same directory |
00:18:35 | FromDiscord | <j-james> Is the only way to `import` it↵And call its functions |
00:22:05 | FromDiscord | <Yardanico> Not sure what you mean |
00:22:24 | FromDiscord | <Yardanico> You can compile the program into the binary and execute it as a binary instead if that's what you want |
00:22:35 | FromDiscord | <Yardanico> From another program |
00:25:49 | FromDiscord | <j-james> Yeah I phrased that badly |
00:26:09 | FromDiscord | <j-james> Can you import functions from other Nim files? |
00:26:26 | FromDiscord | <Yardanico> Yes? |
00:26:38 | FromDiscord | <Yardanico> you maybe mean you want to fully qualify the module name? |
00:26:55 | FromDiscord | <Yardanico> Like "module.work()" instead of "work()"? |
00:27:26 | FromDiscord | <j-james> Thanks↵I think I was just doing it wrong |
00:27:35 | FromDiscord | <j-james> (edit) 'I' => 'that was ' | removed 'that' |
00:33:23 | FromDiscord | <kaletaa> i didn't know about that `from module import nil` feature |
00:33:31 | FromDiscord | <kaletaa> it's epic |
00:37:11 | FromDiscord | <Yardanico> Well kinda |
00:37:17 | FromDiscord | <Yardanico> You know you can qualify even without that? |
00:37:42 | FromDiscord | <Yardanico> !eval import strutils; echo strutils.split("hello would") |
00:37:45 | NimBot | @["hello", "would"] |
00:37:54 | FromDiscord | <Yardanico> *world |
00:38:09 | zedeus | yeah it breaks operator overloading and UFCS while making your code longer, very epic |
00:38:17 | FromDiscord | <Yardanico> ^^ |
00:38:36 | FromDiscord | <kaletaa> lmao |
00:38:41 | FromDiscord | <Yardanico> You can just import the normal way and fully qualify for stuff you want |
00:39:58 | * | oddp quit (Ping timeout: 260 seconds) |
00:40:56 | * | dsrw joined #nim |
00:45:55 | * | dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:46:27 | FromDiscord | <Skaruts> is this how a sequence can be converted to a C array: `cast[ptr Vertex](vertices)`? |
00:46:30 | FromDiscord | <Skaruts> I'm trying to give it to this function: <https://github.com/oprypin/nim-csfml/blob/master/src/csfml/private/graphics_gen.nim#L5028> |
00:46:31 | FromDiscord | <Skaruts> which takes `ptr Vertex` |
00:46:41 | FromDiscord | <Skaruts> proc* |
00:47:29 | FromDiscord | <exelotl> @Skaruts cast[ptr UncheckedArray[Vertex]](vertices) ? |
00:47:50 | FromDiscord | <Skaruts> gonna try that |
00:48:09 | FromDiscord | <Yardanico> @Skaruts not like that |
00:48:22 | FromDiscord | <Yardanico> Nim sequence is by default len, cap, pointer to data |
00:48:26 | FromDiscord | <exelotl> Oh sorry, you just wanna do addr vertices[0] |
00:48:33 | FromDiscord | <Yardanico> Yeah, that'll work |
00:48:38 | FromDiscord | <Skaruts> oh |
00:48:43 | FromDiscord | <Skaruts> yea that makes sense |
00:48:44 | FromDiscord | <exelotl> But the thing I wrote is how they should've defined their function |
00:49:01 | FromDiscord | <exelotl> (probably) |
00:49:14 | FromDiscord | <exelotl> (Maybe) |
00:49:24 | FromDiscord | <Yardanico> csfml wasn't really updated for a few years but I think it still works |
00:49:37 | FromDiscord | <Skaruts> it does work, yea 🙂 |
00:52:06 | FromDiscord | <Skaruts> shouldn't wrappers abstract types though? Like, for example that proc could be defined to take `openarray` and do the conversion itself |
00:52:20 | FromDiscord | <Skaruts> abstract type conversions* |
00:52:49 | FromDiscord | <exelotl> Oh yeah you're right that would be way better |
00:53:21 | FromDiscord | <Skaruts> I find myself writing many templates to abstract stuff like this, also for int->cint conversions... |
00:53:36 | FromDiscord | <Skaruts> not just with csfml |
00:53:43 | FromDiscord | <Yardanico> Well it depends on the library |
00:53:53 | FromDiscord | <Yardanico> E.g. gintro abstracts quite a lot of stuff |
00:54:01 | FromDiscord | <Yardanico> It's much nicer than using the raw GTK api |
00:54:43 | FromDiscord | <Skaruts> imo it makes usage smoother |
00:55:13 | FromDiscord | <Skaruts> well the thing I'm doing still doesn't work... but at least I got the array thing sorted |
00:55:17 | FromDiscord | <Skaruts> thanks guys |
01:03:50 | * | ynfle joined #nim |
01:05:54 | ynfle | Is there a sane way to test macros? |
01:08:50 | ynfle | Or .compileTime procs |
01:14:54 | * | ynfle quit () |
01:52:25 | * | chemist69 quit (Ping timeout: 272 seconds) |
01:53:43 | * | chemist69 joined #nim |
02:28:11 | * | nikita_ joined #nim |
02:31:02 | * | nikita` quit (Ping timeout: 260 seconds) |
02:37:39 | * | endragor joined #nim |
02:38:12 | * | Zectbumo joined #nim |
02:47:19 | * | muffindrake quit (Ping timeout: 244 seconds) |
02:49:13 | FromDiscord | <Varriount> ynfle: Other than writing code that uses the macros? |
02:49:38 | * | muffindrake joined #nim |
02:59:33 | * | Senny quit (Ping timeout: 272 seconds) |
03:15:52 | * | casaca quit (Remote host closed the connection) |
03:16:40 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:24:45 | * | leorize joined #nim |
03:28:03 | FromDiscord | <Technisha Circuit> 1015 members in the discord rn |
03:28:08 | Yardanico | yes I know |
03:28:14 | Yardanico | we got more than 1k members after nimconf |
03:28:29 | Yardanico | anyway most of them don't really visit nim |
03:28:40 | Yardanico | it's the issue in all social networks/messengers - people join chats but forget about them |
03:30:05 | * | casaca joined #nim |
03:52:02 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:53:11 | * | chemist69 joined #nim |
04:00:27 | * | ynfle joined #nim |
04:01:54 | FromGitter | <ynfle> @ Varriount `unittest` doesn't work and the message with `doAssert` using `nimble test` aren't the best |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:39 | * | supakeen joined #nim |
04:08:07 | * | ftsf joined #nim |
04:13:03 | * | ynfle quit () |
04:24:36 | FromDiscord | <SeanOMik> I remember seeing something about proc prototypes in the tutorial pages but I cant find it anymore |
04:24:46 | FromDiscord | <SeanOMik> Maybe I'm dreaming it? |
04:24:57 | FromDiscord | <SeanOMik> Or am I not looking in the correct place |
04:25:10 | Yardanico | yes forward declarations |
04:25:19 | FromDiscord | <SeanOMik> Ah thats the name |
04:25:25 | FromDiscord | <SeanOMik> Found it |
04:25:29 | FromDiscord | <SeanOMik> https://nim-lang.org/docs/tut1.html#procedures-forward-declarations |
04:25:30 | FromDiscord | <SeanOMik> Thanks |
04:25:39 | Yardanico | hopefully in the future we won't need them :) |
04:25:46 | FromDiscord | <SeanOMik> Wdym? |
04:26:22 | Yardanico | well, right now one of the features on the "milestone" is to make code reordering work for all stuff |
04:26:37 | Yardanico | so you wouldn't even need forward declarations for recursive dependencies (when a calls b, b calls a) |
04:26:49 | Yardanico | but that's relatively far from now :P |
04:26:54 | FromDiscord | <SeanOMik> Yeah |
04:27:01 | FromDiscord | <SeanOMik> Sounds cool though |
04:27:19 | FromDiscord | <SeanOMik> I guess recursive includes are also probably far a way too then |
04:27:22 | FromDiscord | <SeanOMik> (edit) 'then' => 'then?' |
04:27:38 | FromDiscord | <Rika> i dont think we're adding cyclic imports if thats what you mean |
04:27:46 | FromDiscord | <SeanOMik> Yeah thats what I was meaning |
04:27:49 | Yardanico | @SeanOMik they already kinda work |
04:27:50 | FromDiscord | <SeanOMik> Why not? |
04:27:53 | Yardanico | you just have to structure your code properly |
04:27:57 | FromDiscord | <SeanOMik> Yeah |
04:28:00 | Yardanico | you can have recursive dependencies |
04:28:18 | FromDiscord | <SeanOMik> I guess cyclic imports could cause spaghetti code. |
04:28:34 | FromDiscord | <Rika> its more complicated for the compiler |
04:28:40 | FromDiscord | <Rika> might slow down compilation a lot |
04:28:44 | FromDiscord | <SeanOMik> Oh okay |
04:28:57 | FromDiscord | <SeanOMik> Well thanks for answering questions guys |
04:29:17 | FromDiscord | <Rika> ~~i'm here just to ask and answer questions~~ |
04:29:33 | Yardanico | well why would you be here otherwise :P |
04:30:45 | FromDiscord | <Rika> perhaps i wanted to advertise a program i made in nim |
04:30:55 | FromDiscord | <Rika> or i wanted to interact with the community |
04:31:09 | FromDiscord | <Rika> or i wanted to know about the newest news about nim |
04:31:09 | Yardanico | you're just answering questions before they're asked then :D |
04:31:15 | Yardanico | /s |
04:31:26 | FromDiscord | <Rika> that is true though |
04:32:04 | Yardanico | oh no |
04:32:04 | Yardanico | https://github.com/Zed-Inc/nim_braces |
04:32:07 | Yardanico | someone actually created it |
04:33:00 | FromDiscord | <Avatarfighter> I believe you mean oh yes |
04:33:06 | Yardanico | I mean oh no surely |
04:34:41 | FromDiscord | <Avatarfighter> almost as good as bython |
04:34:42 | FromDiscord | <Avatarfighter> https://github.com/mathialo/bython |
04:34:56 | Yardanico | good thing that it's abandoned |
04:35:02 | FromDiscord | <Avatarfighter> hahah fr |
04:35:37 | FromDiscord | <Avatarfighter> while looking for bython I typed brython and I found an implementation of python but for webpages wtf |
04:35:38 | FromDiscord | <Avatarfighter> https://brython.info/ |
04:35:39 | Yardanico | i wonder why github projects have so much daily git clones |
04:35:40 | Yardanico | bots? |
04:35:48 | Yardanico | @Avatarfighter oh yeah I know that one |
04:35:50 | * | B4s1l3 joined #nim |
04:36:39 | FromDiscord | <Avatarfighter> its actually really neat wow |
04:37:32 | * | B4s1l3 is now known as opDispatch |
04:37:43 | FromDiscord | <Avatarfighter> All we gotta do is wait for is nim running in a browser like brython haha |
04:37:47 | Yardanico | the problem with these things is compatibility with python itself |
04:37:50 | Yardanico | @Avatarfighter uhhh |
04:37:56 | Yardanico | nice joke :) |
04:38:27 | FromDiscord | <Avatarfighter> Haha |
04:38:30 | FromDiscord | <InventorMatt> you could probably embed nimscript into a webpage |
04:38:38 | FromDiscord | <Avatarfighter> oh i do not doubt that you couldn't |
04:38:44 | Yardanico | we have nim js too |
04:38:53 | Yardanico | but yeah, with emscripten you could probably embed the whole nim compiler on the web page |
04:38:57 | Yardanico | and compile to JS on the fly |
04:38:58 | FromDiscord | <Avatarfighter> oh wow |
04:39:00 | Yardanico | and run the JS |
04:39:03 | FromDiscord | <Avatarfighter> that's very cool |
04:58:55 | * | solitudesf joined #nim |
04:59:36 | Yardanico | ofc it's not really functional but still XDDhttps://i.imgur.com/bCQFWTz.png |
04:59:37 | Yardanico | https://i.imgur.com/bCQFWTz.png |
04:59:55 | Yardanico | yes that's nim compiler compiler to webassembly with emscripten (without any stdlib and stuff so it's basically useless rn) |
05:01:56 | Yardanico | well I did patch like 2-3 LOC |
05:02:41 | Yardanico | ah right |
05:02:59 | * | solitudesf quit (Remote host closed the connection) |
05:07:08 | Yardanico | actual nim tracebacks OOTB xd https://i.imgur.com/JW1SGFD.png |
05:16:49 | FromDiscord | <Zed> Yardinco, you dont like my braces transpiler? |
05:17:03 | Yardanico | you understand why people wouldn't like it :P |
05:17:15 | Yardanico | i mean its fine as a fun project |
05:17:27 | FromDiscord | <Zed> hey, im suprised it actually works |
05:18:27 | FromDiscord | <Zed> although now that i've gotten used to nims whitespace i cant get used to the braces XD |
05:19:09 | FromDiscord | <Rika> some people prefer one or the other, or dont even have a preference |
05:19:16 | FromDiscord | <Elegant Beef> Im in the latter! |
05:19:27 | FromDiscord | <Elegant Beef> Also rika you literally just said "People have feelings" |
05:19:33 | FromDiscord | <Zed> personally i prefer the '@' instead of braces |
05:19:48 | FromDiscord | <Zed> :P |
05:20:06 | Yardanico | ok I'm getting progress with emscripten |
05:20:07 | Yardanico | comp.html:1248 Error: cannot open '/lib/system.nim' |
05:20:15 | Yardanico | need to find out how to embed the stdlib |
05:20:26 | Yardanico | nim stdlib is only 2.7mb src btw |
05:20:48 | Yardanico | ah wait 4.4 |
05:21:17 | FromDiscord | <Zed> that's pretty small |
05:21:28 | FromDiscord | <Rika> aaaaaa https://nimble.directory/docs/optionsutils/optionsutils.html doesnt load lmaoooo |
05:23:38 | * | narimiran joined #nim |
05:30:03 | Yardanico | comp.html:1248 /lib/system.nim(26, 3) Error: invalid indentation lol |
05:41:28 | narimiran | finally a comment about style insensitivity, i was getting worried nobody would mention it! https://news.ycombinator.com/item?id=23591907 |
05:42:13 | FromDiscord | <Rika> congratulations |
05:59:20 | Yardanico | narimiran: also we god this https://www.reddit.com/r/nim/comments/hdgvxe/a_language_is_only_as_good_as_its_best_ide/ |
05:59:21 | Yardanico | got* |
06:01:56 | FromDiscord | <Elegant Beef> I could swear that breakpoint debugging is super easy to setup with nim |
06:01:59 | FromDiscord | <Elegant Beef> in vscode that is |
06:02:06 | Yardanico | well they are just lazy people |
06:02:14 | FromDiscord | <Zed> lol, he really doesn't want to use a terminal |
06:04:25 | FromDiscord | <Elegant Beef> His entire post history is comical |
06:04:29 | Yardanico | "It's 2020. Rockets are landing themselves and there are consumer grade 12 core processors on the market. Bloat isn't a thing anymore." |
06:04:36 | Yardanico | "Bloat isn't a thing anymore." AAAAAAAAAAAAAAAAAAAAAAAA |
06:05:37 | FromDiscord | <Rika> bet i can make a program that even a fucking supercomputer would chug on |
06:05:55 | FromDiscord | <Zed> haha |
06:06:09 | FromDiscord | <Elegant Beef> That makes no sense bloat isnt a thing anymore |
06:07:06 | Yardanico | imagine people who make simplest desktop apps with electron saying "BlOaT iSn'T a ThInG AnYmOrE" |
06:07:12 | FromDiscord | <Elegant Beef> Mods on r/CPP removed his ↵> It's 2020 and you have no excuse not to be using an IDE |
06:07:18 | FromDiscord | <Rika> LMAO |
06:07:39 | FromDiscord | <Elegant Beef> https://www.reddit.com/r/cpp/comments/ewtttx/its_2020_and_you_have_no_excuse_not_to_be_using/ |
06:07:41 | FromDiscord | <Elegant Beef> Gold |
06:07:42 | FromDiscord | <Rika> wait imma check if i know this dude i just argued with another dude in another server and he sounds p.much like this |
06:08:33 | FromDiscord | <Zed> is he just trying to make a really bad ide sales pitch? |
06:08:41 | FromDiscord | <Rika> `Why use CLion when - quoting their website - Code::Blocks is already "the IDE with all the features you need"?` LMAO |
06:08:48 | FromDiscord | <Rika> he's just a troll |
06:10:19 | FromDiscord | <Rika> so who's removing this post from reddit |
06:14:41 | FromDiscord | <Elegant Beef> He posts in so many circle jerky subreddits |
06:17:18 | FromDiscord | <Elegant Beef> Also best comment because of their name is↵> Telling people how to write code is central planning == communism. |
06:19:53 | * | marnix joined #nim |
06:31:57 | * | NimBot joined #nim |
06:33:53 | * | solitudesf joined #nim |
06:36:27 | * | PMunch joined #nim |
06:37:35 | FromDiscord | <Skaruts> can anyone get me this little test to work: https://play.nim-lang.org/#ix=2pQ3 |
06:37:52 | FromDiscord | <Skaruts> I keep getting errors no matter what I do, I dn't even know anymore... |
06:38:21 | FromDiscord | <Skaruts> the goal is just to assign a different `print_val` proc depending on which kind the object is |
06:40:18 | FromDiscord | <Skaruts> (I forgot to assign a value to val1 and val2, though) |
06:40:53 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2pQ4 |
06:41:41 | FromDiscord | <Rika> `print_proc` changed to this `print_proc:proc(self: Foo): string` and i fixed the `result.kind` stuff (dont do that basically) |
06:41:56 | FromDiscord | <Rika> then you have to re-pass in `f1` and `f2` to `print_proc` |
06:42:16 | FromDiscord | <Rika> since `f1.print_proc` returns the proc, it does not call the proc with `f1` |
06:42:18 | FromDiscord | <Rika> @Skaruts |
06:42:44 | FromDiscord | <Skaruts> oh, I always thought `new result` was equivalent to `result = Foo(kind: Foo1)` |
06:42:54 | FromDiscord | <Skaruts> thanks!! |
06:42:58 | FromDiscord | <Skaruts> 🙂 |
06:43:06 | FromDiscord | <Yardanico> It is |
06:43:13 | FromDiscord | <Yardanico> new result is redundant here |
06:43:25 | FromDiscord | <Rika> i didnt remove it lmao |
06:43:27 | FromDiscord | <Rika> sorry |
06:43:30 | FromDiscord | <Yardanico> It's okay |
06:43:38 | FromDiscord | <Rika> but you cant set `result.kind` since it discriminates |
06:43:50 | FromDiscord | <Rika> has to be part of the constructor `Foo(kind: value)` |
06:43:57 | FromDiscord | <Yardanico> You can :) |
06:44:03 | FromDiscord | <Rika> i mean, its not a great idea to |
06:44:04 | FromDiscord | <Skaruts> I always did it this way though |
06:44:23 | FromDiscord | <Yardanico> @Skaruts it's worse for the compiler and stuff |
06:44:43 | FromDiscord | <Yardanico> Object construction syntax is better since you don't need to care if it's a ref or not and stuff like that |
06:44:46 | FromDiscord | <Skaruts> so result = Foo(kind: Foo1) is preferable? |
06:44:51 | FromDiscord | <Yardanico> Yeah |
06:45:04 | FromDiscord | <Skaruts> nice to know |
06:45:06 | FromDiscord | <Yardanico> You can also split it over multiple lines |
06:45:23 | PMunch | @Yardanico, can you? I thought that was disallowed prior to 1.0 |
06:45:42 | FromDiscord | <Yardanico> Can do what? |
06:46:08 | FromDiscord | <Rika> you can still do it afaik |
06:46:29 | FromDiscord | <Yardanico> Yeah, there even was a PR which fixed it for arc |
06:46:33 | FromDiscord | <Skaruts> yea, you can, I've been doing it all along and had no complaints from the compiler so far |
06:46:35 | PMunch | Change the discriminator in a variant object |
06:46:41 | FromDiscord | <Yardanico> Yeah you can |
06:46:57 | * | nikita_ is now known as nikita` |
06:47:18 | FromDiscord | <Yardanico> With checks you will get a proper error if you access an invalid branch, without checks on - well, good luck xD |
06:47:37 | FromDiscord | <Yardanico> Actually maybe I'm wrong |
06:48:02 | FromDiscord | <Yardanico> Don't remember if it's a part of checks or an exception/defect |
06:48:42 | PMunch | This is what I was talking about: https://play.nim-lang.org/#ix=2pQ6 |
06:48:53 | PMunch | Error: unhandled exception: assignment to discriminant changes object branch; compile with -d:nimOldCaseObjects for a transition period [FieldError] |
06:49:52 | FromDiscord | <Yardanico> An right you can't change the kind only |
06:50:01 | FromDiscord | <Yardanico> You need to construct a new object |
06:50:09 | FromDiscord | <Yardanico> When you're changing the kind |
06:50:14 | PMunch | Yeah |
06:52:48 | FromDiscord | <Yardanico> Ah actually wait |
06:52:49 | FromDiscord | <Skaruts> actually, now that I think about it, I'm not sure about my last statement (that you can still do that), as my current project doesn't use any of this, and I only updated to latest nim two days ago... |
06:52:57 | FromDiscord | <Yardanico> It might be not allowed by default |
06:53:03 | FromDiscord | <Yardanico> But it's allowed with arc |
06:53:14 | FromDiscord | <Yardanico> See https://github.com/nim-lang/RFCs/issues/209 |
06:53:16 | disbot | ➥ Case objects in new runtime removing restrictions ; snippet at 12https://play.nim-lang.org/#ix=2pQ7 |
06:53:48 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/13995 |
06:53:49 | disbot | ➥ Implements RFCs #209 |
06:54:18 | FromDiscord | <Yardanico> An example of how arc makes more things possible :) |
06:55:08 | alehander92_ | oi |
06:55:41 | FromDiscord | <Skaruts> btw, I'd like to know if what I am doing is worth it: I'm doing that proc assignment thing to prevent having to use case/of when both kinds use the same proc to do different things (essentially mimicking dynamic dispatch, I guess, but still keeping it static) |
07:02:04 | Zevv | Araq: nothing is *wrong* with CPS per se, it's just that I can't seem to find the time nor the concentration to properly work at it. |
07:03:16 | Zevv | My plan was to methodically work through all the required transform rules, I guess it's about ten or fifteen or so, and then implement them incrementally. |
07:03:39 | alehander92_ | that's so many |
07:11:00 | Zevv | yah but its the typicall decreasing returns, or how do you call it |
07:11:13 | Zevv | two rules get you going with linear code with no control flow |
07:11:21 | Zevv | then one more allows basic whiles |
07:11:27 | Zevv | one more for the break |
07:11:38 | Zevv | one for break with label |
07:11:38 | Zevv | etc |
07:12:20 | Zevv | and also, this needs to go into the compiler because macros just cant go all the way |
07:24:28 | PMunch | How was everyones NimConf by the way? |
07:24:45 | PMunch | I had to leave early unfortunately, so I missed out on the live chats for the later talks |
07:24:56 | PMunch | (And I've still got a couple to watch) |
07:32:14 | bung | I watched all videos |
07:34:01 | PMunch | Live? |
07:35:22 | * | Vladar joined #nim |
07:43:12 | FromDiscord | <ikrima> is there a way to get the most derived type of an object? |
07:43:24 | FromDiscord | <Rika> are there locks for async or are the locks in the locks module suitable for async |
07:44:13 | FromDiscord | <ikrima> i'm trying to make a generic tree visitor but i can't get the function to be dispatched with the derived type |
07:46:45 | bung | archived videos |
07:49:09 | PMunch | @Rika, why would you need locks for async` |
07:49:20 | FromDiscord | <djazz> I enjoyed NimConf a lot! |
07:49:26 | FromDiscord | <djazz> I watched it all live |
07:49:33 | PMunch | Those in the locks module will work, but they won't be optimal |
07:49:33 | FromDiscord | <Rika> I'm just asking right now |
07:49:46 | FromDiscord | <Rika> I don't need them right now |
07:49:53 | PMunch | djazz, I really liked it as well. The parts I got to watch. So many good presentations |
07:50:15 | PMunch | (And interesting to see how many cool thing people have done in Nim that I've never heard about) |
07:50:49 | PMunch | @Rika, but what do you imagine using them for? Async doesn't run at the same time as such, so there is no reason to lock anything |
07:51:12 | PMunch | And if you don't use tryLock you will lock up your entire execution thread |
07:51:13 | FromDiscord | <Rika> but async can hit the same pieces of code at the same time |
07:51:18 | PMunch | No it can't |
07:51:29 | FromDiscord | <Rika> i mean, consecutively |
07:52:00 | PMunch | Only if you have yielded control |
07:52:01 | FromDiscord | <Rika> not *at the same time* per se, but one can enter an async section whilst there's something awaiting in that same section |
07:52:44 | PMunch | And since you don't need your "locks" to be thread-safe you can simply use a bool as a lock |
07:53:43 | PMunch | @ikrima, what do you mean the "most derived type"` |
07:53:46 | PMunch | ?* |
07:54:02 | PMunch | Could you write up a small sample of what you're trying to do? |
08:00:07 | alehander92_ | it seemed cool |
08:00:08 | FromDiscord | <ikrima> @PMunch yup! was just doing that |
08:00:12 | FromDiscord | <ikrima> sent a code paste, see http://ix.io/2pQj |
08:00:13 | alehander92_ | i also havent watched almost anything |
08:00:23 | FromDiscord | <ikrima> (edit) 'http://ix.io/2pQj' => 'http://ix.io/2pQk' |
08:02:15 | FromDiscord | <ikrima> other things i've tried that didnt work:↵- changing the passed in function to "method" but nim didn't like that. I couldn't figure out how to pass a `method` to a function↵- trying to use generics but couldn't get that to work |
08:16:18 | * | lritter joined #nim |
08:19:47 | * | brainbomb joined #nim |
08:21:22 | * | brainbomb quit (Client Quit) |
08:22:34 | FromDiscord | <Rika> use `of` maybe? |
08:23:05 | * | drdee joined #nim |
08:25:12 | * | brainbomb joined #nim |
08:34:53 | FromDiscord | <ikrima> @Rika ah that was it! |
08:42:49 | * | bung quit (Ping timeout: 264 seconds) |
08:47:01 | * | brainbomb quit (Quit: Leaving.) |
08:49:38 | * | bung joined #nim |
08:52:55 | * | dddddd quit (Ping timeout: 260 seconds) |
08:54:12 | * | bung quit (Ping timeout: 256 seconds) |
08:57:51 | FromDiscord | <mratsim> also when you start overloading, use methods |
08:58:09 | * | brainbomb joined #nim |
08:59:27 | FromDiscord | <mratsim> and you might want to use object algebra or tagless final instead of visitors @ikrima: those are my experiments with similar things https://github.com/mratsim/compute-graph-optim |
09:00:29 | FromDiscord | <ikrima> @mratsim heh, this is exactly what i'm building except for my main app and what drove me to nim to try to generate |
09:00:37 | FromDiscord | <mratsim> and lifted into a compile-time/runtime compiler implemented as macro: https://github.com/numforge/laser/tree/master/laser/lux_compiler↵https://github.com/numforge/laser/tree/master/laser/lux_compiler/core↵↵In particular the types: https://github.com/numforge/laser/blob/master/laser/lux_compiler/core/lux_types.nim#L14-L132 |
09:01:10 | FromDiscord | <ikrima> 👍 excellent; that'll be very helpful |
09:01:45 | FromDiscord | <mratsim> Note that I wanted something that worked at compile-time so I add extra restrictions:↵- no inheritance/methods so no visitors |
09:02:20 | FromDiscord | <ikrima> the inheritance was a compromise; i got frustrated trying to do simple things in Nim for a couple of days |
09:02:42 | FromDiscord | <mratsim> I've also gathered some references on DSL implementations techniques here: https://github.com/mratsim/compute-graph-optim/blob/master/arraymancer_discussion_347.md#semantic-pass-and-the-extension-problem |
09:02:57 | FromDiscord | <mratsim> though I didn't focus on visitors because they don't work at compile-time |
09:03:01 | FromDiscord | <ikrima> i wanted my parse tree to be irregular heterogenus (so named subfields) but I couldn't figure out how to do variant constraints in Nim? |
09:03:56 | FromDiscord | <ikrima> sent a code paste, see http://ix.io/2pQB |
09:04:23 | FromDiscord | <mratsim> it will be hidden behind variant |
09:04:58 | FromDiscord | <mratsim> there is something that you can do with NimNodes, proc foo(a:NimNode{nkIdent}) but it's no documented at all |
09:05:08 | FromDiscord | <mratsim> I don't know if it works for any variants either |
09:05:30 | FromDiscord | <ikrima> gotcha |
09:05:39 | FromDiscord | <mratsim> Also this might help you as well: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/support/emulate_classes_with_ADTs.nim |
09:05:55 | FromDiscord | <mratsim> it's for emulating classes with variants |
09:06:04 | FromDiscord | <ikrima> brilliant |
09:06:14 | FromDiscord | <mratsim> example usage: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/physics/materials.nim#L91-L96 |
09:06:34 | FromDiscord | <mratsim> and: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/physics/core.nim#L24-L28 |
09:15:44 | * | alehander92_ is now known as alexander92 |
09:15:56 | * | alexander92 is now known as alehander92_ |
09:17:06 | * | sagax joined #nim |
09:26:34 | * | bung joined #nim |
09:37:59 | * | Zectbumo quit (Remote host closed the connection) |
09:46:38 | * | oddp joined #nim |
10:05:32 | * | muffindrake quit (Quit: muffindrake) |
10:07:31 | * | krux02 joined #nim |
10:11:33 | * | arecaceae quit (Remote host closed the connection) |
10:11:56 | * | arecaceae joined #nim |
10:15:07 | * | muffindrake joined #nim |
10:21:05 | * | Vladar quit (Quit: Leaving) |
10:21:25 | * | tane joined #nim |
10:43:08 | FromGitter | <Bennyelg> Hi All, |
10:43:22 | FromGitter | <Bennyelg> does anyone worked with mongodb within him ? |
10:54:32 | FromGitter | <Bennyelg> nim* |
10:56:47 | * | Vladar joined #nim |
10:56:59 | FromGitter | <geotre> @Bennyelg John Dupuy is working on some mongodb stuff, I think repos are at https://github.com/JohnAD/ |
10:57:27 | FromGitter | <geotre> And there's a few packages on nimble: `nimble search mongodb` |
10:58:04 | FromGitter | <geotre> https://nimble.directory/search?query=mongo |
11:03:12 | * | abm joined #nim |
11:05:11 | FromDiscord | <Recruit_main707> sent a code paste, see http://ix.io/2pRb |
11:06:15 | FromDiscord | <lqdev> --multimethods:on |
11:06:45 | FromDiscord | <lqdev> by default methods only dispatch using the first parameter |
11:07:03 | FromDiscord | <lqdev> you can enable multiple dispatch using the --multimethods:on CLI param |
11:08:43 | FromDiscord | <Recruit_main707> thx |
11:10:17 | FromDiscord | <lqdev> what would be a good name for a proc that temporarily maps something to virtual memory? `map`? `access`? `mutate`? |
11:10:54 | FromDiscord | <lqdev> the proc accepts a callback with a pointer to the data and the size of the buffer |
11:12:34 | FromGitter | <antonkatz> looking into JS generation, it seems that a function even if marked with * is not exported. How would I go about using nim generated js inside a bigger js project? |
11:13:25 | FromDiscord | <Recruit_main707> antonkatz you probably also need to add `{.exportc.}` pragma |
11:27:22 | FromGitter | <antonkatz> @recruit_main707 Didn't work but led me to this page https://www.npmjs.com/package/nim-loader?activeTab=readme#caveats |
11:27:41 | FromGitter | <antonkatz> You have to literally mimic the common js export |
11:29:17 | * | ftsf quit (Ping timeout: 258 seconds) |
11:33:05 | * | ftsf joined #nim |
11:41:40 | Araq | ftsf: thanks for your talk. You're Nico's author, right? |
11:42:01 | ftsf | Araq, thanks! yep! |
11:58:36 | * | Vladar quit (Quit: Leaving) |
12:05:39 | FromDiscord | <😬🤣> is `setCommand "js"` creating a new, almost empty js file on each save of the .nim file of the same name a vscode extension bug? |
12:05:46 | FromDiscord | <😬🤣> or a nimcheck one |
12:05:49 | * | Kaivo joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:05 | * | Vladar joined #nim |
12:06:13 | FromDiscord | <😬🤣> I hope it's the latter because then there's a chance it will get fixed 🙂 |
12:06:41 | FromDiscord | <😬🤣> I can prevent the bug with `switch "o", "/dev/null"` (it doesn't affect `nimble build`), but it's really stupid |
12:06:42 | * | supakeen joined #nim |
12:09:08 | * | vsantana joined #nim |
12:19:18 | * | drdee quit (Remote host closed the connection) |
12:20:30 | * | drdee joined #nim |
12:27:29 | * | Trustable joined #nim |
12:30:20 | * | endragor quit (Remote host closed the connection) |
12:30:47 | * | endragor joined #nim |
12:35:13 | * | endragor quit (Ping timeout: 246 seconds) |
12:36:26 | * | brainbomb1 joined #nim |
12:37:14 | * | brainbomb quit (Ping timeout: 246 seconds) |
12:37:16 | * | narimiran quit (Remote host closed the connection) |
12:38:00 | FromDiscord | <Shucks> So I almost tried everything to debug a windows process which loads my nim library. Currently tried: `nim-gdb -p process_pid`, `br main.nim:50` and once my nim library is load it just won't hit any breakpoint. Ofcourse compiled with `--debuger:native` |
12:38:45 | alehander92_ | try to just use gdb |
12:39:03 | alehander92_ | and source tools/nim-gdb.py inside |
12:39:04 | alehander92_ | if needed |
12:40:17 | * | dsrw joined #nim |
12:40:17 | * | dsrw quit (Read error: Connection reset by peer) |
12:40:40 | FromDiscord | <Shucks> Yea already tried using gdb itself aswell |
12:48:44 | alehander92_ | so is it possible it stops before that |
12:49:11 | * | Romanson joined #nim |
13:07:35 | * | endragor joined #nim |
13:09:41 | * | leorize quit (Quit: WeeChat 2.8) |
13:14:02 | * | dr-dd joined #nim |
13:14:46 | * | endragor quit (Ping timeout: 246 seconds) |
13:16:34 | * | drdee quit (Quit: Leaving) |
13:16:54 | * | dr-dd quit (Client Quit) |
13:17:04 | * | dmi0 joined #nim |
13:17:07 | * | drdee joined #nim |
13:20:43 | * | marcpm quit (Quit: Connection closed for inactivity) |
13:28:37 | * | Vladar quit (Quit: Leaving) |
13:50:18 | FromGitter | <erhlee-bird> is there a way to express iterator types in concepts? ⏎ ⏎ ```type ⏎ Foo[T] = concept x ⏎ x.bar is iterator[T]``` [https://gitter.im/nim-lang/Nim?at=5ef0b71a613d3b3394fff22d] |
13:52:00 | * | brainbomb1 quit (Quit: Leaving.) |
13:56:49 | alehander92_ | for i in x: discard |
13:56:55 | alehander92_ | in x.bar * |
13:57:18 | alehander92_ | or for i in x.bar: i is T |
13:57:20 | alehander92_ | iirc |
13:58:10 | FromDiscord | <mratsim> "type(items(seq[x])) is x" ? |
13:58:24 | FromDiscord | <mratsim> otherwise I proposed an "Iterable" concept iirc |
13:58:32 | FromDiscord | <mratsim> and you can do "x is Iterable" |
13:58:43 | FromGitter | <erhlee-bird> awesome the first one works ⏎ I'll try the second one |
14:00:31 | alehander92_ | i think the first one is the way zah wanted the concepts to be used |
14:01:04 | alehander92_ | by using a similar syntax to the way the construct is used in real code, but this might be just my wrong impression |
14:01:27 | alehander92_ | otherwise Iterable seems to be going in stdlib mratsim soon |
14:02:01 | * | PMunch quit (Quit: Leaving) |
14:06:49 | FromDiscord | <dom96> Araq: shouldn't we prioritise stabilising concepts? In particular any new syntax that we may be adopting for them? |
14:07:54 | Araq | I'm working on a proposal so that we can finally stabilize 'static T' / 'typedesc' |
14:08:24 | Araq | and then we can think about 'concept' |
14:09:14 | FromGitter | <erhlee-bird> ```code paste, see link``` ⏎ ⏎ @mratsim neither of the approaches here seem to work [https://gitter.im/nim-lang/Nim?at=5ef0bb8a405be935cdb6dda0] |
14:11:46 | FromDiscord | <dom96> Araq: okay, looking forward to that |
14:25:19 | * | dddddd joined #nim |
14:32:42 | FromDiscord | <Recruit_main707> does c2nim work relatively well with C11? |
14:41:49 | * | waleee-cl joined #nim |
14:42:51 | Araq | no, C11 is a different beast |
14:43:06 | Araq | maybe if you're lucky and not many C11 features are used... |
14:47:36 | FromDiscord | <Recruit_main707> also, is c2nim abandoned? last commit was in 2019 |
14:49:10 | * | drdee quit (Remote host closed the connection) |
14:49:35 | Araq | no, it's not |
14:50:18 | FromDiscord | <Recruit_main707> hibernating then? :P |
14:51:04 | Araq | you can create PRs |
14:51:12 | Araq | and I'll review them |
14:52:11 | Araq | it worked well for all the big projects I wrapped |
14:52:15 | * | ftsf quit (Ping timeout: 260 seconds) |
14:52:58 | Araq | and if I had the need to wrap more, I would patch it further |
14:53:17 | FromDiscord | <Recruit_main707> reasonable |
14:55:37 | Araq | I'd probably look into C++2020 support though and not fucking C11 |
14:56:02 | Araq | at least C++2020 has modules now so we can wrap stuff without preprocessor junk |
15:04:14 | * | marnix quit (Ping timeout: 240 seconds) |
15:08:07 | * | Romanson quit (Quit: Connection closed for inactivity) |
15:15:14 | FromGitter | <ynfle> Why does `strtabs` not have `==` proc? |
15:17:03 | FromDiscord | <mratsim> One does not simply compare string tables |
15:17:48 | Araq | never needed it |
15:18:01 | FromGitter | <ynfle> Because of style insensitivity? |
15:18:13 | Araq | equality on hash tables is hard, you never know if the order should matter |
15:18:54 | FromGitter | <ynfle> I'm assuming that's why we have `OrderedTable` and `Table` |
15:19:02 | Araq | I mean, you would use an OrderedTable if the order matters, yes |
15:19:26 | Araq | but OrderedTable is often also used for convenience, see json.nim |
15:19:31 | FromGitter | <ynfle> Order doesn't matter but I wan't style insensitivity |
15:19:44 | Araq | so create a PR |
15:20:08 | Araq | but usually dicts are compared to {:} and to nothing else |
15:20:22 | Araq | which can be done with x.len == 0 |
15:20:24 | FromGitter | <ynfle> Would you accept one that compares based on order or not? |
15:20:38 | FromGitter | <ynfle> I know but I want specific mappings |
15:20:42 | Araq | well it's an unordered table so the order shouldn't map |
15:20:46 | Araq | *matter |
15:20:50 | FromGitter | <ynfle> Ok |
15:37:47 | * | Romanson joined #nim |
15:46:31 | * | gangstacat quit (Ping timeout: 272 seconds) |
15:47:18 | FromDiscord | <Isomorpheus> what can ref objects do that objects can't |
15:49:20 | * | Vladar joined #nim |
15:53:17 | FromDiscord | <Yardanico> not sure what do you mean by that :) it's the difference in how you access and modify them |
15:55:04 | FromDiscord | <Isomorpheus> what is a simple example of something which requires a ref object and can't be accomplished with an object |
15:55:34 | FromDiscord | <mratsim> inheritance |
15:55:47 | FromDiscord | <mratsim> also sharing an unique instance |
15:56:04 | FromDiscord | <mratsim> for example a file, a database access, GPU memory |
15:58:13 | FromDiscord | <dom96> resizeable memory |
15:58:25 | FromDiscord | <dom96> you cannot implement a `seq` with just an object |
16:00:18 | FromDiscord | <Isomorpheus> implementing seq not really simple. anyway, the sharing a unique instance example makes the best sense to me |
16:00:28 | FromDiscord | <Isomorpheus> thx |
16:11:17 | * | vicfred quit (Quit: Leaving) |
16:15:19 | * | bung quit (Quit: Lost terminal) |
16:16:22 | * | Jesin quit (Quit: Leaving) |
16:17:12 | FromDiscord | <Yardanico> @Isomorpheus if you're curious - implementation of seqs for new runtime (arc, etc) is in https://github.com/nim-lang/Nim/blob/devel/lib/system/seqs_v2.nim |
16:26:39 | FromGitter | <kdheepak> @genotrance the julia community is excited to see you are using the binaries in nim :) |
16:31:02 | shashlick | yep - they were considering getting rid of static libraries - probably that's not how they use the libs |
16:31:12 | shashlick | but it is valuable to us |
16:31:24 | shashlick | hopefully they expand their efforts |
16:31:46 | shashlick | i also looked into vcpkg but it doesn't work without VC++ on Windows |
16:32:02 | * | gangstacat joined #nim |
16:32:25 | shashlick | plus they don't really post prebuilt binaries so it is more about providing stable way to build locally |
16:33:05 | shashlick | @kdheepak where do you see this discussion |
16:34:54 | FromGitter | <kdheepak> On slack, the binary builder developers linked this issue of yours: https://github.com/JuliaBinaryWrappers/Zlib_jll.jl/issues/1#issuecomment-647008970 |
16:34:56 | disbot | ➥ zlib static binaries need to be recompiled with -fPIC to be compatible with PIE builds |
16:35:23 | FromGitter | <kdheepak> Why do you want static binaries? |
16:36:21 | FromGitter | <kdheepak> If you want to join the julia slack you can chat directly with them. They are a very knowledgeable group. |
16:36:58 | FromGitter | <kdheepak> And I'm happy to make introductions there / provide necessary context (based on my understanding). |
16:37:46 | shashlick | I'll join the slack - where is it |
16:37:49 | FromGitter | <kdheepak> In Julia everything is loaded only at runtime. This is equivalent to using `import dynlib; dynlib.loadLib` in nim. |
16:38:14 | FromGitter | <kdheepak> julialang.slack.com/ |
16:38:20 | shashlick | I figured, but in Nim people can statically link too to simplify distribution |
16:38:44 | * | Jesin joined #nim |
16:38:52 | FromGitter | <kdheepak> But I think statically linking will have other issues, right? |
16:39:03 | shashlick | I understand if they don't want that burden but will be great if they do cause it will benefit many beyond Nim as well |
16:39:06 | FromGitter | <kdheepak> You can't statically link the C / C++ runtime anyway. |
16:39:20 | FromGitter | <kdheepak> Worth having a conversation about it :) |
16:40:04 | shashlick | Typically you build on an old glibc |
16:40:21 | shashlick | Or there's musl as well and they do provide musl builds |
16:40:21 | FromGitter | <kdheepak> Once you join you should join the `#binarybuilder` slack channel / topic. |
16:40:30 | shashlick | Ok will do in a few minutes |
16:40:59 | Araq | static linking is completely misguided but very fashionable |
16:41:16 | Zevv | yeah and then you put it in a container |
16:41:24 | Zevv | because |
16:41:50 | Araq | there seems to be this idea that you can pretend your Linux OS is a JVM, well it isn't and it won't be one |
16:42:51 | Zevv | one can always try |
16:42:56 | shashlick | I agree, dealing with c/c++ dependencies is a nightmare |
16:43:35 | Araq | and all your friends you want to share your x86_64 ELF Linux binary with don't own PCs anymore but Android based phones :P |
16:44:07 | shashlick | But they are valuable nonetheless so it's worthwhile to accelerate the nim ecosystem |
16:44:36 | FromDiscord | <Rika> "so who's pinging technisha" |
16:45:07 | * | endragor joined #nim |
16:47:07 | * | endragor quit (Remote host closed the connection) |
16:51:18 | FromDiscord | <Yardanico> Microbenchmarks yet again but arc go brrr https://github.com/jabbalaci/SpeedTests |
16:52:01 | FromDiscord | <Rika> rust tho :EyesShaking: |
16:52:38 | FromDiscord | <Yardanico> Well it's unfair |
16:52:42 | FromDiscord | <Yardanico> Rust uses u32 |
16:52:53 | FromDiscord | <Yardanico> Nim version uses int which is int64 on x86_64 |
16:52:55 | FromDiscord | <Rika> *its pr time* |
16:53:28 | FromDiscord | <Yardanico> https://www.reddit.com/r/nim/comments/hdoks0/comparing_the_speed_of_c_and_nim/ Reddit thread |
16:53:31 | FromDiscord | <Recruit_main707> i guess we could call it.↵A speedrun |
16:53:37 | FromDiscord | <Recruit_main707> https://tenor.com/view/ba-dum-tsss-punchline-gif-7320811 |
16:53:46 | FromDiscord | <Rika> recruit why |
16:54:19 | FromDiscord | <Recruit_main707> too much questions |
16:54:28 | FromDiscord | <Recruit_main707> many* |
16:55:09 | FromDiscord | <Recruit_main707> arc even wins c++, impressive |
16:55:25 | Yardanico | well we have to consider that nim is using -O3 but he's using -O2 for C and C++ :) |
16:56:38 | Araq | unfortunately arc related bugfixes take away from arc related optimizations |
16:56:38 | Araq | you should really use LTO too, we don't inline well |
16:56:38 | FromDiscord | <Rika> O3 was shown to not really give a difference over O2 from what i remember reading on some shady ass website maybe |
16:56:45 | FromDiscord | <Recruit_main707> 0.4 is a considerable bit though, is O2/O3 the diference? |
16:56:56 | Yardanico | lemme check |
16:57:31 | Yardanico | C with O2 took ~3 sec for me |
16:57:34 | Yardanico | C with O3 - same :D |
16:58:14 | FromDiscord | <Recruit_main707> lmao get owned |
16:58:34 | FromDiscord | <Rika> so the shady ass website i read was correct |
16:59:11 | Araq | you can always use 'ptr' btw, last time I checked Nim v1.0 had that one too |
16:59:13 | FromDiscord | <mratsim> it is |
16:59:30 | FromDiscord | <mratsim> -03 matters mostly for loop-based call |
17:00:03 | FromDiscord | <mratsim> compilers can play with unroll, vectorization, deep hoisting and various things that led to increased codesize |
17:01:05 | FromDiscord | <mratsim> if you're doing an interpreter or cryptography it's no difference, if you do image processing or numerical computing you will have some |
17:01:11 | FromDiscord | <Recruit_main707> do we win rust using int32 though? |
17:01:17 | Yardanico | lemme try |
17:01:29 | Yardanico | with the code in the repo I get mean 2.587s, with using uint32 instead of "int" - 2.296s |
17:01:33 | Yardanico | lets see the results for rust on my machine |
17:01:35 | FromDiscord | <mratsim> Rust uses uint64 by default though |
17:01:43 | Yardanico | @mratsim in the code the author explicitly used u32 |
17:01:48 | Yardanico | and for C they used "int" |
17:01:52 | FromDiscord | <mratsim> ah |
17:02:26 | FromDiscord | <mratsim> using uint32 will remove all the overflow checks from the release build |
17:02:36 | Yardanico | I'm testing with -d:danger anyway :) |
17:02:49 | Yardanico | and rust version on my machine is mean 2.345s |
17:02:52 | Yardanico | slower than nim with u32 |
17:03:00 | FromDiscord | <Recruit_main707> ezz |
17:03:34 | FromDiscord | <Recruit_main707> also, python big oof, i bet my pc can even run it faster (i hope) |
17:03:59 | * | vikfret joined #nim |
17:04:19 | FromDiscord | <Rika> so whos making the pr 😉 |
17:04:20 | FromDiscord | <mratsim> also using unsigned would allow the compiler to use better optimizations for mod |
17:04:53 | FromDiscord | <mratsim> for example a compiler cannot transform div 2 to a shift right unless it proves that the variable is never negative |
17:04:55 | FromDiscord | <Recruit_main707> i love it when you guys start talking about optimizing this benchmarks |
17:04:57 | Yardanico | oh no, someone made a PR with parallel D version XD |
17:06:37 | Yardanico | maybe I should try with weave |
17:06:55 | FromDiscord | <mratsim> you can use OpenMP for this, but you need to make sure you use setupForeignTHreadGC or the strings will crash |
17:09:14 | FromDiscord | <KingDarBoja> > "so who's pinging technisha" ↵I could |
17:09:34 | FromDiscord | <Recruit_main707> would using an iterator improve performance? |
17:09:36 | Yardanico | With weave I easily get under 500ms |
17:09:38 | * | Vladar quit (Quit: Leaving) |
17:09:43 | FromDiscord | <Recruit_main707> damm |
17:09:45 | Yardanico | with string output |
17:10:06 | FromDiscord | <Rika> so weave's actually a library made by a magician |
17:10:09 | Yardanico | yes |
17:11:06 | Yardanico | well I get so fast because it actually seems to use all my 16 threads :) which is really gud |
17:11:54 | Araq | is it fair though to use multi-threading? C doesn't have a lib for it after all and we cannot use anything invented after 1970 |
17:12:07 | Yardanico | haha |
17:13:09 | FromDiscord | <Recruit_main707> how does weave work? |
17:13:26 | FromGitter | <ynfle> I'm trying to modify `unittest` to work at compile time and ran into an issue the compiler complains that `Error: cannot evaluate at compile time: formatters` in a `template` where it is introduced with a `bind` statement. Any way to get around this? |
17:13:51 | FromDiscord | <Rika> > how does weave work?↵@Recruit_main707 real life magic |
17:14:19 | Araq | just don't. use 'when isMainModule: static: doAssert(...)' |
17:14:49 | FromGitter | <ynfle> Handling the error messages and having clean output is a pain |
17:15:46 | Yardanico | D parallelised version seems to be a little bit slower than weave, but it uses dlang's stdlib parallelism |
17:16:18 | FromDiscord | <Recruit_main707> just add weave to stdlib :smart: |
17:16:41 | Araq | ha; I knew it. "mu mu, must not be a dependency" |
17:17:02 | * | Senny joined #nim |
17:17:02 | * | Vladar joined #nim |
17:17:13 | FromDiscord | <Rika> Yardanico: ez fix, make weave stdlib 😛 |
17:17:15 | Yardanico | well I won't PR it anyway since it's just a small benchmark, but yeah, weave is nice :) i have nothing against using "third-party" modules |
17:17:28 | Araq | won't be accepted |
17:17:43 | Araq | Yardanico: no, please do the PR |
17:18:14 | FromDiscord | <Rika> araq: i am joking T_T |
17:18:37 | Araq | ah ok |
17:18:55 | Araq | it's always hard to tell when you live in surreal programmer land |
17:19:15 | FromDiscord | <Rika> text makes it even hard to tell |
17:19:28 | FromDiscord | <Recruit_main707> hard-er |
17:20:06 | FromDiscord | <Rika> i apologize it is 1 am |
17:20:18 | FromDiscord | <Rika> ive woken up around 14ish hours ago by now |
17:22:43 | Yardanico | wait I didn't know weave works with arc lol |
17:22:55 | Yardanico | I just compiled with --gc:arc and it worked XD although a little bit slower |
17:27:31 | Yardanico | @mratsim do you know test_gc_arc in weave passes on latest devel? |
17:27:36 | Araq | does it even use arc related stuff? |
17:27:37 | Araq | weave does its own memory management |
17:27:53 | Araq | so any difference you measure might be noise |
17:27:57 | FromDiscord | <mratsim> No I didn't know that it passed |
17:28:22 | Yardanico | I just tested, full output - https://gist.github.com/Yardanico/13a2813ab7df46c6c63b2cbeae56e529 |
17:28:34 | FromDiscord | <mratsim> internally it doesn't use ARC, but it needs to at least pass the tests so that I can explore sending seq/strings in channels |
17:30:11 | FromDiscord | <mratsim> (.e. serializing seq/strings in tasks) |
17:31:25 | Yardanico | also Araq, with --sinkInference:off (without that it crashes in same fillBody thing) nim compiler can compile hello world with --gc:arc (something a bit more complex still fails) |
17:31:40 | Yardanico | I mean the compiler compiled with --gc:arc |
17:33:13 | Araq | cool, I'm working on #14402 fwiw |
17:33:16 | disbot | https://github.com/nim-lang/Nim/issues/14402 -- 3AsyncHttpClient segfaults with gc:orc, possibly memory corruption ; snippet at 12https://play.nim-lang.org/#ix=2pSW |
17:33:52 | Yardanico | and for us linux plebians ssl with arc is broken on devel :P |
17:34:01 | Yardanico | but yeah, cool :) |
17:34:20 | FromDiscord | <mratsim> btw I manage to put mentions of DrNim everywhere in the Rust concurrency thread (though apparently I gathered a lot of downvotes). It's sad that a large portion of the Rust community is so focused on memory safety and ignores the other issues introduced by threads |
17:34:35 | Yardanico | ah wait I'm wrong it works (?) |
17:35:22 | Yardanico | ah nvm, it still fails with that C compiler error, I thought it was the same as in #14240 but that's not the case |
17:35:23 | disbot | https://github.com/nim-lang/Nim/issues/14240 -- 5[exceptions:goto] C compiler error with dynlib pragma calling a proc ; snippet at 12https://play.nim-lang.org/#ix=2nzx |
17:35:38 | Araq | mratsim: well DrNim is still vaporware |
17:35:54 | Araq | help is appreciated |
17:36:23 | FromDiscord | <mratsim> Like VTable, it's documented Vaporware so we can get people excited about it 😉 |
17:36:58 | Araq | we have enough to get people excited about |
17:37:19 | Araq | we need more production-ready stuff |
17:37:35 | Araq | it's always the famous last 80% of work |
17:37:42 | FromDiscord | <mratsim> 😛 |
17:38:05 | FromDiscord | <mratsim> so regarding production ready stuff, afaik you didn't say if you saw this compiler fuzzer porject: https://github.com/agroce/afl-compiler-fuzzer |
17:39:07 | FromDiscord | <mratsim> one issue that will likely come up with our audits is that Nim itself is unaudited, but also not fuzzed |
17:40:08 | FromDiscord | <mratsim> this was even used to crash formal verification tools 😄 |
17:41:36 | Yardanico | well we already have quite a lot of low-priority compiler crash issues :) |
17:42:33 | FromDiscord | <mratsim> fuzzing might reveal a refactor needed to handle several early instead of monkey patching for a couple of bugs |
17:44:20 | * | marnix joined #nim |
17:45:32 | FromGitter | <ynfle> What does `<//>` do? |
17:46:06 | Yardanico | it's old deprecated syntax for owned ref (needed for bootstrapping I think), you shouldn't use it :) |
17:48:31 | FromGitter | <ynfle> `owned` instead or just leave it out |
17:51:25 | Yardanico | ? |
17:51:54 | FromDiscord | <mratsim> @Araq, is there an outline of stuf that needs implementation for Z3 integration? |
17:52:15 | FromDiscord | <mratsim> like is everything in teh DrNim page implemented? |
17:52:18 | Araq | I run DrNim on the Nim compiler and fix bugs when I work on it |
17:52:56 | ee7[m] | @ynfle see https://forum.nim-lang.org/t/6440 |
17:53:07 | Araq | most of it is implemented but 'forall' and 'exists' are not mapped to anything useful |
17:53:57 | Araq | mratsim: if fuzzing helps your audit we'll do it. if not, I won't anytime soon, terrible cost-benefit tradeoff |
17:54:17 | Araq | as we also have real users finding real bugs that affect them |
17:55:26 | FromDiscord | <Isomorpheus> what is up with the syntax highlighting in vscode? why are keywords like "let" and "import" the same color as identifiers? |
17:55:33 | Yardanico | not for me? |
17:55:36 | Yardanico | try to change the theme |
17:56:07 | FromDiscord | <Isomorpheus> yeah it was my Shades of Purple theme. hmmmmm |
17:56:33 | FromDiscord | <Isomorpheus> i wonder why? it's not a problem for my other code |
17:56:45 | FromDiscord | <KingDarBoja> share your settings |
17:57:06 | Yardanico | @Isomorpheus well I don't know either, I've used Monokai Vibrant theme for a very long time now and I like it a lot :) |
17:58:20 | FromDiscord | <mratsim> The compiler is out of scope of this initial audit |
17:58:34 | Yardanico | that's how monokai vibrant looks like (with fira code ofc) https://i.imgur.com/bq7qBig.png |
17:58:53 | Yardanico | also it's sad that only nim.nvim has semantic syntax highlighting (a nimsuggest feature) |
17:59:49 | FromDiscord | <Isomorpheus> whats that whitespace color extension |
18:01:21 | FromDiscord | <KingDarBoja> VSCode Default theme https://media.discordapp.net/attachments/371759389889003532/724685474278408252/unknown.png |
18:02:07 | Yardanico | @Isomorpheus indent-rainbow if you mean colors for indentation |
18:02:09 | * | Zectbumo joined #nim |
18:02:20 | Yardanico | I also have Guides extension, forgot to reconfigure it |
18:02:37 | FromDiscord | <Isomorpheus> @KingDarBoja https://marketplace.visualstudio.com/items?itemName=ahmadawais.shades-of-purple |
18:02:40 | FromDiscord | <Isomorpheus> try this one |
18:03:22 | Yardanico | https://i.imgur.com/4mophuO.png that's the guides extension |
18:03:33 | Yardanico | @Isomorpheus lemme try |
18:03:40 | FromDiscord | <KingDarBoja> @Isomorpheus ugh, too many purple to my eyes! |
18:03:55 | Yardanico | for me too |
18:03:56 | FromDiscord | <Isomorpheus> see if the syntax highlighting works properly |
18:03:58 | Yardanico | https://i.imgur.com/ertcwiM.png |
18:04:08 | Yardanico | yeah the theme is kinda broken I guess :P |
18:04:20 | FromDiscord | <Isomorpheus> not for my other languages: rust, typescript, python |
18:04:30 | Yardanico | well, most themes I tried work just fine for nim |
18:04:33 | FromDiscord | <KingDarBoja> I do use this extra setting to change the color of types |
18:04:39 | FromDiscord | <KingDarBoja> sent a code paste, see http://ix.io/2pT7 |
18:05:26 | FromDiscord | <Isomorpheus> unrelated but im trying to do string interpolation in nim but it's inserting the quotation marks...? can I just get a string within a string |
18:05:44 | Yardanico | how are you doing it? |
18:06:09 | Yardanico | !eval import strformat; let a = "hello"; echo fmt"{a} world!" |
18:06:13 | NimBot | hello world! |
18:06:39 | FromDiscord | <KingDarBoja> https://github.com/arcticicestudio/nord-visual-studio-code |
18:06:46 | FromDiscord | <KingDarBoja> I love this theme btw |
18:07:18 | Araq | try the "nim-alt" plugin |
18:07:25 | Araq | its highlighting is better |
18:07:25 | Yardanico | @KingDarBoja https://marketplace.visualstudio.com/items?itemName=s3gf4ult.monokai-vibrant is what I use |
18:07:51 | FromDiscord | <Isomorpheus> can I get a type at runtime |
18:07:59 | FromDiscord | <KingDarBoja> Oh the constract is high, which makes it easier to read |
18:08:07 | FromDiscord | <KingDarBoja> Nice choice Yard |
18:08:08 | Yardanico | @Isomorph "kinda" |
18:08:18 | Yardanico | types don't exist at runtime but you can use typeof(something) to get its type |
18:08:37 | Yardanico | why do you want types at runtime? |
18:08:50 | Yardanico | btw, there's also another vscode extension |
18:09:02 | Yardanico | https://github.com/bung87/vscode-nim-lsp uses nimlsp instead of directly using nimsuggest |
18:09:09 | FromDiscord | <KingDarBoja> I really love how it looks with Nord |
18:09:22 | FromDiscord | <KingDarBoja> https://media.discordapp.net/attachments/371759389889003532/724687487657836597/unknown.png |
18:09:25 | FromDiscord | <KingDarBoja> I am keeping it lol |
18:10:14 | shashlick | i prefer plain monokai, it's not too blue |
18:10:41 | FromDiscord | <Isomorpheus> onvm I had to use `getStr` on the json node first |
18:11:01 | FromDiscord | <KingDarBoja> Araq: this one? https://github.com/GaryM-exkage/vscode-nim-alt |
18:11:03 | shashlick | i wish there was a dull black theme, easier on the eyes |
18:11:21 | Yardanico | @King yeah |
18:11:42 | Yardanico | also KrispPugg released dimscord v1.0.0 today, I should update ircord :) |
18:11:56 | Yardanico | well, in devel |
18:12:02 | Yardanico | I mean in dimscord devel* |
18:12:03 | FromDiscord | <KingDarBoja> I have already installed it |
18:12:06 | FromDiscord | <Isomorpheus> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/724688170972741742 |
18:12:13 | FromDiscord | <KingDarBoja> That's the one with the customisation option |
18:12:45 | Yardanico | @Isomorpheus well, not really |
18:12:50 | Yardanico | there's "with" but it's different |
18:12:56 | Yardanico | and you can make your own withAs easily :P |
18:12:58 | FromDiscord | <KingDarBoja> Did my discord started updating out of nowhere? |
18:13:37 | FromDiscord | <Isomorpheus> well where is the with equivalent for this postgres connection code |
18:15:09 | FromDiscord | <Rika> make a macro yourself is what yardanico said i think |
18:15:26 | FromDiscord | <Isomorpheus> lol |
18:15:49 | Yardanico | something as simple as https://play.nim-lang.org/#ix=2pT8 can easily work |
18:16:28 | Yardanico | ah right forgot to add block |
18:16:48 | Yardanico | https://play.nim-lang.org/#ix=2pT9 so it opens a new scope |
18:18:01 | FromDiscord | <Isomorpheus> this is neat but feels like it should be built into something |
18:18:06 | FromDiscord | <Isomorpheus> the db_postgres library perhaps |
18:18:07 | * | Romanson quit (Quit: Connection closed for inactivity) |
18:18:08 | FromDiscord | <mratsim> I feel like Nim Discord is slowly turning into an anime image board with all those pics |
18:18:13 | FromDiscord | <Rika> rude |
18:18:15 | Yardanico | why? nim doesn't try to copy Python everywhere @Isomorpheus |
18:18:28 | FromDiscord | <Yardanico> @mratsim do you not like my profile picture in discord? 😄 |
18:18:45 | FromDiscord | <KingDarBoja> _are you calling us weebs?_ |
18:18:47 | FromDiscord | <mratsim> I didn't say it was, bad, I at least recognised on of the Ah My Goddess character and someone from Jojo's |
18:18:51 | FromDiscord | <KingDarBoja> Btw, Yardanicco -> https://github.com/tonsky/FiraCode |
18:18:56 | FromDiscord | <Yardanico> ? I use it already |
18:19:01 | FromDiscord | <Yardanico> I've used Fira Code for years |
18:19:03 | FromDiscord | <mratsim> don't know Yardanico or Rika's character though |
18:19:15 | FromDiscord | <Rika> @mratsim `Ah My Goddess`? |
18:19:23 | FromDiscord | <mratsim> @Isomorpheus |
18:19:52 | FromDiscord | <Rika> oh, niko? |
18:19:54 | FromDiscord | <mratsim> https://en.wikipedia.org/wiki/Oh_My_Goddess! |
18:20:08 | FromDiscord | <Rika> pretty sure thats niko in lovelive |
18:20:10 | FromDiscord | <Yardanico> yeah |
18:20:27 | FromDiscord | <Yardanico> https://www.youtube.com/watch?v=3oD8tj3eBls you can't mistake her |
18:20:36 | FromDiscord | <KingDarBoja> @Yardanico didn't know, just gonna install it 🙂 seems good combined with AtomDarkOne |
18:20:49 | FromDiscord | <KingDarBoja> Atom One Dark* |
18:20:50 | FromDiscord | <Yardanico> @KingDarBoja don't forget to enable font ligatures |
18:20:57 | FromDiscord | <KingDarBoja> Sir, yes sir |
18:21:04 | FromDiscord | <Yardanico> "editor.fontLigatures": true in your user settings json file |
18:21:23 | FromDiscord | <mratsim> I use Cascadia Code with ligatures |
18:21:31 | FromDiscord | <Yardanico> sent a code paste, see http://ix.io/2pTa |
18:21:38 | FromDiscord | <Rika> :EyesShaking: totally didnt move to neovim |
18:22:41 | FromDiscord | <KingDarBoja> Thank you sensei |
18:22:43 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/724690848528203856/unknown.png |
18:22:54 | FromDiscord | <mratsim> very important to get spaceships right |
18:22:57 | FromDiscord | <Yardanico> well yes fira code has these too |
18:23:10 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/724690964693778614/2020-06-22-21-23-05_grim.png |
18:23:11 | FromDiscord | <willyboar> !last disruptek |
18:23:12 | disbot | disruptek spoke in 12#nim-news 2 days ago |
18:23:33 | FromDiscord | <Yardanico> (they're italic because of my theme) |
18:23:52 | FromDiscord | <KingDarBoja> @mratsim it is Polnareff, the loyal french crusader |
18:24:35 | FromDiscord | <mratsim> Cascadia was heavily inspired by Fira |
18:24:46 | FromDiscord | <mratsim> https://github.com/microsoft/cascadia-code |
18:25:20 | FromDiscord | <mratsim> It has more stars than Nim oO |
18:25:43 | FromDiscord | <Yardanico> https://github.com/tonsky/FiraCode 48k stars 😛 |
18:25:48 | FromDiscord | <Rika> its from microsoft tho? |
18:25:52 | FromDiscord | <Yardanico> so wat? |
18:25:56 | FromDiscord | <djazz> I use cascadia font in vscode |
18:25:57 | FromDiscord | <Yardanico> vscode is from microsoft too |
18:26:01 | FromDiscord | <Yardanico> just FYI |
18:26:03 | FromDiscord | <djazz> Its great with ligatures |
18:26:50 | FromDiscord | <Rika> > so wat?↵@Yardanico ofc it would have more stars than nim |
18:27:18 | FromDiscord | <mratsim> it's from September 2019 though |
18:28:36 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
18:32:22 | FromDiscord | <KingDarBoja> I found my sweet spot with Fira Code Font and Atom One Dark ❤️ https://media.discordapp.net/attachments/371759389889003532/724693275138719894/unknown.png |
18:32:38 | FromDiscord | <KingDarBoja> And the nim-alt with custom foreground ofc |
18:32:46 | Yardanico | why not result instead of return :P |
18:33:13 | FromDiscord | <Clyybber> why not implicit :p |
18:34:18 | FromDiscord | <KingDarBoja> Staph lol |
18:34:30 | FromDiscord | <KingDarBoja> Let me live with return |
18:34:32 | Yardanico | ugh lol |
18:34:38 | Yardanico | ircord is broken on latest devel with latest dimscord |
18:34:40 | Yardanico | C compiler error |
18:34:48 | Yardanico | no arc |
18:34:58 | Yardanico | something to do with options |
18:35:37 | Yardanico | stuff like http://ix.io/2pTj/c |
18:35:51 | Yardanico | C compiler says that "error: no member named 'has' in 'struct tyObject_Option__HD0MN7kJw5giWZ8p9aWlT7w'" |
18:37:01 | FromDiscord | <Isomorpheus> if I'm using `db_postgres` trying to insert into a column with is of type `jsonb` can I insert a string or do I need a jsonnode or w/e |
18:38:19 | FromDiscord | <KingDarBoja> 🤔 |
18:38:20 | FromDiscord | <Rika> i think you need a string |
18:39:01 | FromDiscord | <KingDarBoja> If I recall, jsonb is a json-like structure, so probably you need to use a jsonnode, but haven't used the nim API |
18:39:03 | * | vsantana_ joined #nim |
18:39:21 | FromDiscord | <Technisha Circuit> @Yardanico why not tell Kris about it? |
18:39:27 | Yardanico | It's not his issue |
18:39:36 | Yardanico | it has to do with recent PR which added inline to options |
18:39:44 | Yardanico | well it's a nim bug after all I guess :P |
18:40:48 | Yardanico | hrmm |
18:40:58 | Yardanico | it doesn't seem to be related to inline |
18:41:42 | * | vsantana quit (Ping timeout: 260 seconds) |
18:42:57 | FromDiscord | <Technisha Circuit> O |
18:54:26 | FromDiscord | <Isomorpheus> whats the equiv of python's `pass` for defining a noop function |
18:54:33 | * | PMunch joined #nim |
18:54:35 | Yardanico | "discard" |
18:59:00 | FromDiscord | <Isomorpheus> what do I put for the return type of a noop |
18:59:06 | Yardanico | nothing |
18:59:10 | Yardanico | proc doNothing() = discard |
18:59:17 | Yardanico | or just proc doNothing = discard |
18:59:21 | FromDiscord | <Isomorpheus> expression has no type or is ambiguous |
18:59:25 | Yardanico | show code :) |
18:59:28 | * | abm quit (Ping timeout: 256 seconds) |
19:00:26 | * | narimiran joined #nim |
19:00:45 | FromDiscord | <Isomorpheus> i see. you cant discard a noop |
19:00:49 | Yardanico | yes |
19:01:11 | * | waleee-cl joined #nim |
19:01:14 | Yardanico | well you can make a template which will be able to do that, but there's no reason to :P |
19:01:38 | FromDiscord | <Rika> well whats there to discard |
19:02:48 | Yardanico | well I'm closer to minimizing this issue hmm |
19:03:27 | FromDiscord | <Rika> how hard would it be to make an http server that uses weave :ThonkDumb: |
19:03:49 | Yardanico | already WIP |
19:03:57 | FromDiscord | <Rika> ooh where |
19:04:25 | Yardanico | https://github.com/olliNiinivaara/GuildenStern |
19:06:54 | FromDiscord | <Rika> how well does it work :thonk: |
19:07:00 | Yardanico | idk, it's WIP |
19:07:11 | FromDiscord | <Rika> ill look into it :thinkOwO: |
19:07:56 | * | lritter quit (Quit: Leaving) |
19:10:48 | Yardanico | at this point I think that this might be a signature collision lol, still minimizing the thing |
19:16:11 | Yardanico | well look at this I minimized it :D |
19:16:13 | Yardanico | to one file even |
19:16:58 | FromDiscord | <Isomorpheus> JObject is implemented as an OrderedTable. how would I implement over the key, value pairs? |
19:17:07 | FromDiscord | <Isomorpheus> err iterate* |
19:17:29 | Yardanico | just "for elem in myjobj:" |
19:17:34 | Yardanico | It'll call https://nim-lang.org/docs/json.html#items.i%2CJsonNode |
19:17:38 | Yardanico | ah wait |
19:17:41 | Yardanico | https://github.com/nim-lang/Nim/tree/version-1-2/lib/pure/json.nim#L755 I mean |
19:18:19 | Yardanico | https://play.nim-lang.org/#ix=2pTu |
19:18:24 | FromDiscord | <Isomorpheus> not `for key, val in myobj:`? |
19:18:33 | Yardanico | check last link :) |
19:18:35 | * | abm joined #nim |
19:18:37 | Yardanico | yeah you're right |
19:20:40 | Yardanico | narimiran: about - nimWorkaround14447 - yes :D |
19:20:46 | Yardanico | lemme link you the PR |
19:21:06 | Yardanico | https://github.com/nim-lang/Nim/pull/14447 |
19:21:08 | disbot | ➥ fix #14421 items uses lent T ; snippet at 12https://play.nim-lang.org/#ix=2pTy |
19:21:12 | narimiran | lemme guess the author |
19:21:15 | Yardanico | XXDDDDD |
19:21:22 | FromDiscord | <Vindaar> does github work for you guys? |
19:21:23 | narimiran | oh, i guessed correctly |
19:21:27 | FromDiscord | <Vindaar> completely dead for me |
19:21:30 | narimiran | who would have thought |
19:21:30 | Yardanico | @Vindaar yes, works just fine |
19:21:35 | FromDiscord | <Vindaar> weird |
19:23:10 | Yardanico | lo and behold - weird options bug https://github.com/nim-lang/Nim/issues/14758 |
19:23:12 | disbot | ➥ C compiler error with options and a proc field in an object ; snippet at 12https://play.nim-lang.org/#ix=2pTz |
19:23:14 | Yardanico | will see if it's a regression |
19:23:35 | Yardanico | well it works just fine on 1.2.0 so surely it is :D |
19:26:00 | Yardanico | will run bisect on it |
19:29:40 | Araq | gah github down! |
19:29:49 | Yardanico | weird, not for me |
19:30:36 | Araq | so how can reproduce the arc ssl bug? |
19:30:51 | Araq | remember I cannot be bothered to start my linux vm |
19:30:57 | Yardanico | heh |
19:31:01 | FromDiscord | <Clyybber> Araq: Unfortunately not at all, even on linux |
19:31:10 | FromDiscord | <Clyybber> oh nevermind |
19:31:24 | FromDiscord | <Clyybber> I thought you were talking about the httpclient bug |
19:31:38 | Araq | the httpclient bug is easy to reproduce on OSX |
19:31:50 | Araq | via -d:nimDebugArc I always get a nil future |
19:32:06 | Araq | it's just that I don't understand the aliasing |
19:32:08 | Yardanico | the options bug is https://play.nim-lang.org/#ix=2pTC btw (if github is down :P) |
19:32:27 | Yardanico | the first bad commit is the PR which added inline to options, but of course it's not the root cause |
19:32:54 | nisstyre | I've been test driving an x window manager I wrote in Nim all day today and it is mostly good enough to actually use now |
19:38:48 | Yardanico | ok now let's try to see if the inline bug itself is a regression or not |
19:45:49 | FromDiscord | <mratsim> great Github is down |
19:45:55 | Yardanico | how?! |
19:45:56 | Yardanico | it's up for me lol |
19:46:40 | FromDiscord | <Rika> "it works on my machine" |
19:46:43 | FromDiscord | <Rika> https://www.githubstatus.com/ |
19:46:48 | * | Jesin quit (Quit: Leaving) |
19:46:48 | FromDiscord | <Rika> degraded |
19:46:55 | FromDiscord | <Kiloneie> why was there a 1 in red circle as in mention or smthing, i can't find anything relevant ... |
19:47:04 | Yardanico | https://i.imgur.com/3pJklbo.png |
19:47:04 | FromDiscord | <mratsim> I can't resolve their DNS |
19:47:30 | Yardanico | so apparently this inline options bug is caused by specializing genericReset ?? |
19:48:22 | FromGitter | <akavel> Hi! I'm trying `import pegs` then `const pegHex = charSet({'0'..'9', 'a'..'f', 'A'..'F'})`, and I'm getting: `Error: {} must have the set type` - any idea what's going on? the same seems to work if I replace `const` with `let` o_O |
19:51:03 | FromDiscord | <mratsim> hack: try using a "let foo {.compileTime.}" and then "const bar = static(foo)" |
19:52:57 | FromGitter | <akavel> :( ehhh, and I wanted to improve readability with PEGs :( |
19:53:11 | Yardanico | https://github.com/zevv/npeg also exists :P |
19:53:14 | * | marnix quit (Ping timeout: 240 seconds) |
19:53:41 | FromGitter | <akavel> oh oh oh oh oh!!! |
19:54:20 | FromGitter | <akavel> is it pure nim or requires some 3rdparty libs? |
19:54:25 | Yardanico | pure nim ofc |
19:54:35 | Yardanico | no dependencies |
19:54:38 | Yardanico | (except stdlib ofc) |
19:54:50 | FromDiscord | <Elegant Beef> Damn too quick yard i was going to go full pedant |
19:54:54 | FromGitter | <akavel> sweeeeet, thanks Yardanico!!! <3 <3 <3 |
19:55:14 | FromGitter | <akavel> up for one more try ;) |
19:55:55 | FromGitter | <xmonader> hello :) new chapter of nim days covering parser combinators https://xmonader.github.io/nimdays/day21_parsec.html |
19:56:04 | * | vikfret quit (Quit: Leaving) |
19:57:34 | FromGitter | <akavel> lol, speak about timing: if npeg won't work for me, maybe I'll try parser combinators ;P |
19:58:37 | FromGitter | <xmonader> > lol, speak about timing: if npeg won't work for me, maybe I'll try parser combinators ;P ⏎ ⏎ I'm sure there're tons of optimizations in npeg one, this is merely to explain the concept :) |
20:21:09 | FromDiscord | <willyboar> @xmonader great! |
20:21:39 | FromDiscord | <SeanOMik> Is there a tutorial on making a .nimble file for a library? |
20:21:52 | Yardanico | just do "nimble init" |
20:21:59 | Yardanico | it'll create directory structure |
20:22:09 | Yardanico | https://github.com/nim-lang/nimble#libraries |
20:22:09 | FromDiscord | <SeanOMik> Okay |
20:22:13 | Yardanico | and you can of course check other examples |
20:22:19 | FromDiscord | <SeanOMik> I've already created the directory structure |
20:22:23 | FromDiscord | <SeanOMik> So hopefully its correct |
20:22:27 | Yardanico | for something simple it's just this |
20:22:28 | Yardanico | https://github.com/Yardanico/nim-mathexpr/blob/master/mathexpr.nimble |
20:22:43 | FromDiscord | <willyboar> Do you mean simple nimble file or nimble tasks? |
20:22:45 | FromGitter | <akavel> Yardanico: about npeg, after doing `const foo = patt ...`, I don't seem to be able to use it in another `patt`? :( |
20:22:55 | Yardanico | ? |
20:23:05 | Yardanico | why do you want to use one patt in another patt? |
20:23:10 | Yardanico | just create a "parser" then |
20:23:29 | FromGitter | <akavel> by parser you mean `peg`, yes? |
20:23:32 | Yardanico | yes |
20:23:54 | FromGitter | <akavel> but then can I access sub-patterns from this parser? |
20:24:23 | Yardanico | wdym? |
20:24:35 | Yardanico | it's PEGs but with nim syntax |
20:24:37 | FromGitter | <akavel> i.e.: I want to reuse some patterns in other patterns, but I want to have several separate patterns, not just one "overlord" pattern |
20:24:50 | Yardanico | well it's not a "pattern" |
20:24:52 | Yardanico | it's a whole PEG parser |
20:24:57 | Yardanico | pattersn are "a <- thing" |
20:25:43 | FromGitter | <akavel> Nim core's peg seems to allow reusing patterns :/ |
20:25:49 | FromGitter | <akavel> my case: |
20:26:03 | FromGitter | <akavel> I want to declare a "helper" pattern pegUrlencoded |
20:26:07 | FromGitter | <akavel> which is non-trivial |
20:26:16 | Yardanico | btw ping Zevv ^ |
20:26:22 | FromGitter | <akavel> then I want to use it in a few places |
20:26:24 | Yardanico | and wdym by "nim core's peg allows it"? |
20:26:32 | Yardanico | how exactly? |
20:26:51 | FromGitter | <akavel> there are functions for composing Peg objects |
20:27:08 | zedeus | you can use the grammer feature to define "sub patterns" i think |
20:27:11 | zedeus | grammar* |
20:27:18 | Yardanico | ah right I forgot about that one |
20:27:20 | zedeus | https://github.com/zevv/npeg/blob/master/src/npeg/lib/uri.nim |
20:27:49 | Yardanico | exactly |
20:28:03 | zedeus | https://github.com/zevv/npeg#composing-grammars-with-libraries |
20:28:05 | zedeus | here |
20:28:56 | FromGitter | <akavel> oooh, ok, thanks!!! <3 :) :) |
20:31:01 | * | abm quit (Quit: Leaving) |
20:34:29 | FromDiscord | <SeanOMik> I have some questions about nimble project structure. My project will have this layout: https://media.discordapp.net/attachments/371759389889003532/724724009346007080/unknown.png |
20:34:33 | FromDiscord | <SeanOMik> Similar to it at least |
20:34:51 | FromDiscord | <SeanOMik> Will `foobar.nim` import everything in the `foobar` directory? |
20:34:57 | Yardanico | not by default |
20:35:02 | FromDiscord | <SeanOMik> Okay |
20:35:08 | FromDiscord | <Isomorpheus> does `nimble install` not mutate your `nimble` file? |
20:35:10 | FromDiscord | <SeanOMik> What does `foobar.nim` actually have in it then? |
20:35:15 | Yardanico | @Isomorpheus why would it? |
20:35:23 | FromDiscord | <Isomorpheus> ever used npm? |
20:35:28 | Yardanico | @SeanOMik because you might want to split stuff into modules |
20:35:37 | Yardanico | @Isomorpheus nimble doesn't change anything in your project |
20:35:48 | Yardanico | it only creates stuff in ~/.nimble (on *nix) |
20:35:55 | FromDiscord | <SeanOMik> And I do have stuff split into modules |
20:36:05 | FromDiscord | <SeanOMik> But I'm confused what I should put into `foobar.nim` |
20:36:08 | Yardanico | well that's what it's useful for - you have a couple submodules and main submodule |
20:36:18 | FromDiscord | <SeanOMik> Oh okay |
20:36:18 | Yardanico | or if you have a lot of separate submodules but want to export them all as one |
20:36:29 | Yardanico | e.g. https://github.com/krisppurg/dimscord/blob/master/dimscord.nim |
20:36:34 | FromDiscord | <SeanOMik> Yeah, thats how may project is layed out |
20:36:45 | Yardanico | sorry https://github.com/krisppurg/dimscord/blob/devel/dimscord.nim |
20:37:35 | FromDiscord | <SeanOMik> Okay thanks |
20:43:31 | * | Vladar quit (Quit: Leaving) |
20:46:13 | FromDiscord | <KingDarBoja> Lol I was asking something similar at #offtopic |
20:50:03 | * | NimBot joined #nim |
20:50:33 | FromDiscord | <SeanOMik> I'm trying to generate documentation for my project but I get this error: ```Error: unhandled exception: pathutils.nim(70, 11) `not isAbsolute(f.string)` C:\Users\sean_\.nimble\pkgs\websocket-0.4.1\websocket.html``` |
20:50:45 | FromDiscord | <SeanOMik> That `pathutils.nim` is not a file in my project |
20:51:09 | FromDiscord | <SeanOMik> `nim doc --project -o:docs/documentation.html src/project.nim` is the command I'm running |
20:51:57 | FromDiscord | <SeanOMik> Is there a way to not generate documentation for the websocket module? |
20:52:29 | Yardanico | if you just want to generate docs for 1 file just do "nim doc -o:docs/documentation.html src/project.nim" |
20:52:30 | Araq | Hmm, it’s caused by |
20:52:30 | Araq | future.cb = nil |
20:52:46 | FromDiscord | <SeanOMik> Okay |
20:52:58 | Araq | indicating that 'future.cb's refcount is off |
20:53:12 | FromDiscord | <SeanOMik> I'll just have to make a script to generate documentation for all my modules |
20:53:16 | * | nikita` quit (Quit: leaving) |
20:53:24 | FromDiscord | <KrispPurg> Are you trying to generate docs for every file one at a time? |
20:55:20 | PMunch | https://www.reddit.com/r/nim/comments/he0mj0/three_part_series_and_a_video_on_embedding/? |
20:57:41 | Yardanico | yay |
20:58:01 | Yardanico | your url in the article is broken though |
20:58:10 | Yardanico | "so if you’re sold on the idea [url https://peterme.net/how-to-embed-nimscript-into-a-nim-program-embedding-nimscript-pt-2.html]head over to part 2[/url]!" |
21:05:00 | PMunch | Ah.. |
21:11:13 | * | narimiran quit (Ping timeout: 265 seconds) |
21:13:28 | PMunch | There Yardanico all the links should be fixed now |
21:19:06 | * | casaca quit (Remote host closed the connection) |
21:20:01 | * | solitudesf quit (Ping timeout: 264 seconds) |
21:20:08 | FromDiscord | <gokr> I have a c2nim conundrum, the original header section I am wondering about is this: <https://github.com/gokr/orx/blob/master/code/include/math/orxVector.h#L67-L114> - as can be seen an orxVector is a struct of three unions. c2nim produced this: <https://github.com/gokr/orx/blob/master/code/include/math/orxVector.nim#L49-L89>. The reason I marked all the way to `pvVec.fX = fX` is because that code fails obviously because a Nim orxVECTOR has n |
21:21:10 | * | PMunch quit (Quit: leaving) |
21:21:16 | FromDiscord | <gokr> So AFAICT the C code uses the same struct type for cartesian, spherical, RGB, HSL and HSV spaces. No clue why though. |
21:36:48 | * | tane quit (Quit: Leaving) |
21:55:53 | FromDiscord | <gokr> So its apparently... a kinda C pattern I guess. Makes common code more readable, although... captures 5 different things in a single type. |
22:16:49 | Zevv | oh late to the party, anythig I can still help with, npegwise? |
22:20:00 | * | fowl joined #nim |
22:21:42 | * | fowl quit () |
22:21:45 | Zevv | @akavel: you good? |
22:22:00 | * | fowl joined #nim |
22:22:31 | FromDiscord | <Recruit_main707> dont know if someone noticed, but benchmarks changed↵https://github.com/jabbalaci/SpeedTests |
22:23:27 | FromDiscord | <--HA--> Can walkFiles be converted to a sequence? I tried to use toSeq from sequtils on it but I'm either doing it wrong or that does not work. |
22:27:11 | FromDiscord | <--HA--> Oh. `toSeq(walkFiles("*")) `works but not `walkFiles("*").toSeq` which I kept trying. I guess because it is a template? |
22:30:30 | FromDiscord | <Recruit_main707> That’s weird |
22:33:33 | FromDiscord | <juan_carlos> toSeq is template |
22:36:57 | FromDiscord | <--HA--> So it is expected? Templates can not be used with the "." call? |
22:38:07 | FromDiscord | <--HA--> https://play.nim-lang.org/#ix=2pUr |
22:39:10 | ee7[m] | See https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax |
22:40:36 | FromDiscord | <--HA--> Thank you |
22:45:36 | ee7[m] | You're welcome. |
22:54:06 | * | Zectbumo quit (Read error: Connection reset by peer) |
22:54:36 | * | mutanttu1key joined #nim |
22:54:58 | mutanttu1key | I am hoping to get a return code from a httpClient objet. I am using newHttpClient() then adding headers, and then getContent |
22:55:16 | mutanttu1key | I thought maybe I could do result = client.getContent() and check result.status or maybe client.status, neither seem right? |
22:55:20 | * | Zectbumo joined #nim |
22:55:29 | mutanttu1key | (to make sure the page exists with status == Http200 |
22:58:55 | FromDiscord | <juan_carlos> use get |
22:59:35 | mutanttu1key | OK then I have a fullresponse object? |
23:00:24 | FromDiscord | <juan_carlos> ye |
23:01:27 | * | drdee joined #nim |
23:06:11 | * | thomasross joined #nim |
23:10:28 | FromDiscord | <SeanOMik> How would I print colored text to console? |
23:10:41 | * | drdee quit (Quit: Leaving) |
23:12:09 | FromDiscord | <willyboar> https://nimble.directory/search?query=Terminal+colors |
23:13:44 | FromDiscord | <juan_carlos> `terminal.styledEcho(bgBlack, fgRed, "Hi")` |
23:14:56 | FromDiscord | <SeanOMik> Cool |
23:15:02 | FromDiscord | <SeanOMik> Thanks |
23:21:23 | * | Senny quit (Ping timeout: 260 seconds) |
23:30:15 | * | Zectbumo quit (Remote host closed the connection) |
23:46:08 | * | krux02_ joined #nim |
23:48:35 | * | Trustable quit (Remote host closed the connection) |
23:49:02 | * | krux02 quit (Ping timeout: 260 seconds) |
23:54:31 | * | vsantana_ quit (Quit: leaving) |