00:01:34 | FromDiscord | <Rika> In reply to @bulan2 "<@229378547419054080> No": Only on compliant terminals, of course |
00:08:28 | * | CyberTailor quit (Excess Flood) |
00:11:19 | * | CyberTailor joined #nim |
00:11:39 | FromDiscord | <Zectbumo> In reply to @Patitotective "better name for `addOrAdd`?": `addToSeq` and not worry about expressing `orPut` it's just an easy to use interface that "just works". |
00:28:29 | NimEventer | New Nimble package! libdeflate_gzip - A wrapper for libdeflate, see https://github.com/radekm/nim_libdeflate_gzip |
00:36:16 | FromDiscord | <!Patitotective> the forum should really have some kind of notifications system |
00:36:44 | FromDiscord | <!Patitotective> its really annoying not being able to know when someone answered you or to follow a thread |
00:43:23 | FromDiscord | <leorize> ~~maybe we should switch to discourse~~ |
00:43:29 | FromDiscord | <Elegantbeef> "PRs welcome" |
00:43:57 | FromDiscord | <!Patitotective> PR #2033: delete this repo and use github discussions |
00:44:19 | FromDiscord | <Elegantbeef> Eh github forums lock you to github |
00:44:39 | FromDiscord | <!Patitotective> /j |
00:46:14 | FromDiscord | <!Patitotective> actually yeah, why not just use discourse? |
00:47:21 | FromDiscord | <auxym> I like the idea that nimforum doubles as a good showcase project for nim, but in practice no-one seems to be stepping up to maintain it, so not sure. I remember it getting some flak on some HN post or another that made front page. Discourse works. |
01:03:35 | FromDiscord | <bun> thank you to @ElegantBeef and @bulan2 for the help, its really basic atm and has a lot of quirks but after trying to learn to program for years nim seems like a nice fit 😊 https://media.discordapp.net/attachments/371759389889003532/1010715757937688646/Screen_Recording_2022-08-20_at_8.58.34_PM.mov |
01:04:12 | FromDiscord | <Elegantbeef> yet another rogue clone? 😄 |
01:07:11 | FromDiscord | <bun> just some practice 🙂 can always do with one more |
01:07:32 | FromDiscord | <bun> a lot harder than it looks doing it from scratch |
01:07:38 | FromDiscord | <!Patitotective> In reply to @bun "thank you to <@145405730571288577>": really cool |
01:08:09 | FromDiscord | <bun> thank u 😊 |
02:34:09 | * | arkurious quit (Quit: Leaving) |
04:10:23 | * | xcodz-dot joined #nim |
04:14:13 | xcodz-dot | Good morning/evening/night gentlemen/gentlewomen. I am here to kindly request for a cli library that will keep me from going insane. Lately, my options have included parseopt, cligen, docopt, therapist (its a library). None of them are quite as good as Python's argparse. |
04:15:28 | FromDiscord | <leorize> have you tried nim-argparse? |
04:15:48 | xcodz-dot | Well, yes and its has a infuriating bug |
04:15:52 | xcodz-dot | it |
04:15:54 | xcodz-dot | it* |
04:17:18 | FromDiscord | <leorize> if you've tried everything, maybe it's time to roll your own or fix one of those you tried |
04:17:44 | FromDiscord | <Elegantbeef> Yea arg parsers are generally meh to me 😄 |
04:18:21 | FromDiscord | <Elegantbeef> I have a few attempts at them, but much like anything user facing it's a pain in my experience |
04:18:31 | xcodz-dot | Well, I have tried rolling out my own, but I have a infuriating bug which I can not fix. It is only 50 lines long when I encountered the bug. |
04:18:41 | FromDiscord | <leorize> just make a clap clone \:p |
04:18:48 | FromDiscord | <leorize> what bug is that? |
04:18:56 | xcodz-dot | Wait, I will send the code paste |
04:19:20 | FromDiscord | <Elegantbeef> Leo i dont think clap is close to the API i want 😄 |
04:19:39 | FromDiscord | <Elegantbeef> I was playing around with this type of API https://github.com/beef331/nimtrest/blob/master/parser.nim#L199-L221 |
04:20:02 | xcodz-dot | https://play.nim-lang.org/#ix=48dt |
04:20:49 | FromDiscord | <Elegantbeef> you need to make `Argument` generic |
04:20:55 | FromDiscord | <Elegantbeef> Since `PositionalArg` is generic |
04:21:09 | FromDiscord | <Elegantbeef> This wont really work though cause generics are not capable of being homogenous |
04:21:37 | FromDiscord | <Elegantbeef> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark may help you |
04:21:45 | xcodz-dot | So, I think I would just use the strings without converters for now. |
04:22:17 | xcodz-dot | And instead of generic converters, I would now use a `proc verify(value: string): bool` to verify |
04:22:41 | FromDiscord | <Elegantbeef> At that point you may consider inheritance as a solution to arguments |
04:23:18 | xcodz-dot | What? Inheritance is a thing in Nim? A link to documentation please. |
04:23:30 | FromDiscord | <Elegantbeef> Refer to the link i sent |
04:23:36 | xcodz-dot | k |
04:23:46 | FromDiscord | <Elegantbeef> It shows inheritance without methods |
04:23:55 | FromDiscord | <Elegantbeef> But yes nim has single parent inheritance and dynamic dispatch |
04:24:03 | FromDiscord | <Elegantbeef> Look in the tutorial for `method` |
04:24:27 | FromDiscord | <Elegantbeef> Not that anyone asked but i really hate CLI parsers, i always feel like they dont solve the solution elegantly |
04:24:41 | FromDiscord | <Elegantbeef> solve the problem 😄 |
04:24:52 | xcodz-dot | I have already swept through that. Never really got the idea but now I do. |
04:25:05 | FromDiscord | <huantian> they don't have enough beef for elegance |
04:25:26 | xcodz-dot | Well, cli has been a hate point for me as a Python dev. But given how GUI condition is, I wont complaint |
04:25:30 | xcodz-dot | complain* |
04:25:34 | FromDiscord | <Elegantbeef> I dont know they always either seem to be just calling functions or lack the flexibility to just load directly into a config |
04:26:48 | xcodz-dot | Well, see ya next week if I manage to get a running parser. This is a good opportunity to farm some github stars. Never really got those |
04:27:02 | FromDiscord | <Elegantbeef> Oddly i have a couple |
04:27:17 | xcodz-dot | How long have ya been on github? |
04:27:20 | FromDiscord | <Elegantbeef> It's odd cause i dont get many issues, which makes me think no one actually uses the software |
04:27:30 | FromDiscord | <Elegantbeef> A few years now |
04:27:40 | xcodz-dot | That has been well how I started out. |
04:28:05 | FromDiscord | <leorize> dunno if it helps, but this is how I structured my cli\: https://github.com/nim-works/nimskull/blob/837238f3cbebb6d52be6c328624f6f5598b44788/tools/release_manifest.nim#L308-L574 |
04:28:12 | FromDiscord | <leorize> not a library though, manual parsing for the most part |
04:29:13 | FromDiscord | <Sabena Sema> something to be said for the getopt style approach |
04:29:36 | FromDiscord | <Sabena Sema> In reply to @xcodz-dot "Well, cli has been": python's gtk binding is extremely good btw |
04:29:40 | FromDiscord | <Elegantbeef> Dont know if it's just me but the whole table solution for command parser is lackluster, if i'm loading a config i just want an object 😄 |
04:29:46 | FromDiscord | <Sabena Sema> I have used it "in anger" (for stuff I was paid for)' |
04:29:47 | FromDiscord | <Sabena Sema> (edit) "for)'" => "for)" |
04:30:25 | FromDiscord | <Sabena Sema> I really don't love the stuff like rust's clap that requires defining stuff beforehand |
04:30:36 | xcodz-dot | I have infact written a lil bit of libAdwaita/Gtk4 app in Python. |
04:30:42 | FromDiscord | <Sabena Sema> clap has a more "as you go" api too though (it's not great...) |
04:31:04 | xcodz-dot | Are you guys talking about clap from `rust`? |
04:31:08 | FromDiscord | <Sabena Sema> In reply to @xcodz-dot "I have infact written": yeah I used it back in gtk3, it really is quite nice in any lang that supports composite widget templates |
04:31:12 | FromDiscord | <Sabena Sema> which python does |
04:31:13 | FromDiscord | <Elegantbeef> I really like my idea above, but there are some sharp edges that need worked on |
04:31:21 | FromDiscord | <Elegantbeef> Luckily it's not a suggested to use library |
04:31:45 | xcodz-dot | clap from rust or clap from python? Which one? |
04:31:51 | FromDiscord | <Sabena Sema> rust |
04:32:01 | FromDiscord | <Sabena Sema> idk about pyton argparsing, I just use argparse |
04:32:06 | FromDiscord | <Sabena Sema> (edit) "pyton" => "python" |
04:32:19 | FromDiscord | <Sabena Sema> and in C and C++ I usually use either gflags or getopt_long |
04:32:35 | xcodz-dot | Rust is horrible. I never got rust code to compile on first try, even a simple helloworld program. |
04:32:46 | xcodz-dot | Its a opinion, take it lightly |
04:32:48 | FromDiscord | <Sabena Sema> yeah, I find rust does a ton of asinine stuff |
04:32:58 | FromDiscord | <Sabena Sema> and the syntax appears to take all the bad parts of C++ |
04:33:12 | FromDiscord | <Sabena Sema> except I guess the whole < and << could be a binary operator or a bracket |
04:33:14 | FromDiscord | <Elegantbeef> This isnt a rust real time chat xcodz no one is going to flame you for insulting rust |
04:33:31 | FromDiscord | <Sabena Sema> I keep bouncing off rust |
04:33:41 | FromDiscord | <Sabena Sema> but their standard library is _extremely_ high quality |
04:33:42 | FromDiscord | <Elegantbeef> Rust has many nice things, but i really dislike the package it's in |
04:33:48 | FromDiscord | <Sabena Sema> yes |
04:33:52 | xcodz-dot | Its precautionary, I see that people seem to like rust and a lot of people are multilingual here. |
04:34:35 | FromDiscord | <Sabena Sema> it inherits a lot of cultural baggage from C++ that imo nim is very, very good at discarding, despite nim being much closer to C++ semantically than rust |
04:34:52 | FromDiscord | <Sabena Sema> like namespaces and people just qual::ify::ing::every::thing |
04:35:10 | xcodz-dot | Nim really has a great learning curve, hasn't it? Even with lesser documentation about nim than rust. It barely took me a week when I wrote neural networks from scratch in nim |
04:35:25 | FromDiscord | <Sabena Sema> yeah, you get off the ground really fast |
04:35:46 | FromDiscord | <Elegantbeef> I love the idea of traits, but oh boy do i hate that `derive` 😄 |
04:35:59 | FromDiscord | <Sabena Sema> rust has some nice stuff though, like no type based aliasing (nim presumably inherits Cs rules here) |
04:36:13 | FromDiscord | <Sabena Sema> yeah derive is annoying |
04:36:17 | FromDiscord | <Sabena Sema> and the orphan rule is asinine |
04:36:43 | FromDiscord | <creikey> In reply to @Elegantbeef "I love the idea": Yeah and it's needed everywhere. Rust has so much noise to me, very messy syntax and way of doing things |
04:36:45 | FromDiscord | <Elegantbeef> I think if concepts were ensured you only accessed what you declared it'd be so much nicer than traits |
04:37:03 | FromDiscord | <Sabena Sema> proc macros are nice to have, but nim's macro system is essentially equivalent from a compiler impl perspective and probably much, much faster |
04:37:18 | FromDiscord | <Elegantbeef> Cause then you dont have to explicitly say "Hey this is has trait X" you just call something that takes trait X and it works |
04:37:20 | FromDiscord | <Sabena Sema> In reply to @Elegantbeef "I think if concepts": isn't that the idea of new style concepts |
04:37:25 | FromDiscord | <Sabena Sema> still, though, old style can be useful |
04:37:29 | FromDiscord | <Elegantbeef> Well they're not checked at runtime |
04:37:35 | FromDiscord | <Sabena Sema> like "Hashable" is difficult to write in rust |
04:37:35 | FromDiscord | <Elegantbeef> i mean at instantiation |
04:37:38 | FromDiscord | <Sabena Sema> I think |
04:37:55 | FromDiscord | <Sabena Sema> I though the idea of new concepts was to allow checking at definition |
04:38:01 | FromDiscord | <Elegantbeef> No clue if concepts will be checked at call site, but it'd be nice |
04:38:05 | xcodz-dot | Rust has an issue with its productivity. Its hard to read as well as to write. |
04:38:12 | FromDiscord | <Sabena Sema> old style concepts are checked at instanciation |
04:38:13 | FromDiscord | <Elegantbeef> declaration is what i mean to say |
04:38:15 | FromDiscord | <Elegantbeef> Jesus i cannot type today |
04:38:17 | FromDiscord | <Sabena Sema> (edit) "instanciation" => "instantiation" |
04:38:23 | xcodz-dot | The error handling in rust is worst of all |
04:38:32 | FromDiscord | <Sabena Sema> In reply to @xcodz-dot "Rust has an issue": yeah, and it feels less flexible stylistically |
04:38:34 | FromDiscord | <Rika> Huh really |
04:38:44 | FromDiscord | <Sabena Sema> like everyone involved has always followed some draconian c++ style guide |
04:38:56 | FromDiscord | <Elegantbeef> Exception handling is best error handling, change my mind |
04:39:05 | FromDiscord | <Sabena Sema> yeah the error handling situation is not great |
04:39:05 | FromDiscord | <creikey> In reply to @xcodz-dot "Rust has an issue": Sometime I think about if I spent another couple years with rust along with the year I've already done, I would be just as fast as I am in other languages |
04:39:06 | FromDiscord | <Rika> In reply to @Sabena Sema "yeah, and it feels": There’s a good amount of people who would say that that is a benefit |
04:39:16 | FromDiscord | <Sabena Sema> In reply to @Rika "There’s a good amount": they are wrong 😄 |
04:39:34 | FromDiscord | <Rika> I’d say so too but I don’t have any good arguments for why they are wrong lol |
04:39:34 | FromDiscord | <creikey> In reply to @Elegantbeef "Exception handling is best": I don't know how to change your mind other than to say it makes the path of execution confusing for me |
04:39:35 | FromDiscord | <Sabena Sema> you can use different styles depending on what you want the reader to notivce |
04:39:36 | FromDiscord | <Sabena Sema> (edit) "notivce" => "notice" |
04:39:58 | FromDiscord | <Sabena Sema> also in rust people end up using anyhow which is just exceptions but worse |
04:40:08 | FromDiscord | <Sabena Sema> personally I really like quirky exceptions, I think they are neat |
04:40:11 | FromDiscord | <Rika> In reply to @creikey "Sometime I think about": Are you sure? |
04:40:32 | FromDiscord | <Sabena Sema> I honestly feel more productive in C |
04:40:34 | FromDiscord | <Elegantbeef> Eh criekey i personally find myself using raises on procedures and then the flow is very simple(not in async) |
04:40:38 | FromDiscord | <Sabena Sema> although I surely write more memory bugs 😄 |
04:40:56 | xcodz-dot | I sure know that I am not touching C for a while. |
04:40:56 | FromDiscord | <Rika> In reply to @Elegantbeef "Eh criekey i": If you start to deal with async please fix everything for us |
04:40:59 | FromDiscord | <Rika> Shits hell over there |
04:40:59 | FromDiscord | <Sabena Sema> also: I really like Ada's exception handling |
04:41:09 | FromDiscord | <Rika> It’s like a gimped version of Nim |
04:41:09 | FromDiscord | <Sabena Sema> it's much much much simpler than what C++ does |
04:41:23 | FromDiscord | <Sabena Sema> I like C |
04:41:27 | xcodz-dot | And, yeah, Do not even get me started on rust compile times |
04:41:30 | FromDiscord | <Sabena Sema> as long as I can use clang or gcc |
04:41:30 | FromDiscord | <Elegantbeef> I really like the tracked exception raising Nim has and the fact you can just say "We have no exceptions here" 😄 |
04:42:01 | FromDiscord | <Rika> Just remove defects and we’re pretty much golden |
04:42:02 | FromDiscord | <Sabena Sema> C with attribute((cleanup)), VLAs, and statement expressions (and maybe GCC's cursed lambda extension) is pretty usable |
04:42:11 | FromDiscord | <Sabena Sema> anyway I gotta go |
04:42:11 | xcodz-dot | *Enters MSVC* |
04:42:38 | FromDiscord | <Sabena Sema> yeah, I've been banging the gong with the msvc frontend folks to implement VLAs |
04:42:39 | FromDiscord | <Elegantbeef> I dont know what one replaces defects with after removing |
04:42:41 | FromDiscord | <Elegantbeef> Just an `assert` 😄 |
04:42:48 | xcodz-dot | well, aren't defects catchable? |
04:42:52 | FromDiscord | <Elegantbeef> No |
04:42:57 | FromDiscord | <Rika> Technically |
04:42:57 | FromDiscord | <Elegantbeef> in some dialects they are |
04:43:20 | xcodz-dot | Then there is something wrong because I am actually able to catch IndexDefects. |
04:43:20 | FromDiscord | <Rika> They’re not tracked like other exceptions are |
04:43:22 | FromDiscord | <Elegantbeef> you can play with the `--panics` to make them catchable |
04:43:28 | FromDiscord | <Rika> So you don’t get the nice raises stuff |
04:43:33 | FromDiscord | <Elegantbeef> Debug allows you to catch them |
04:43:37 | FromDiscord | <Elegantbeef> Which is a silly thing |
04:43:47 | * | wallabra quit (Ping timeout: 268 seconds) |
04:43:50 | FromDiscord | <Elegantbeef> But `-d:release` with stock settings you will not catch defects |
04:43:55 | xcodz-dot | No, not really. It is great to be able to catch defects at debug time. |
04:44:08 | FromDiscord | <Rika> What why |
04:44:15 | xcodz-dot | maybe, I never really tried |
04:44:15 | FromDiscord | <creikey> In reply to @Rika "Are you sure?": No |
04:44:21 | FromDiscord | <Elegantbeef> Ah yes my program runs fine in debug, but when i run release it crashes |
04:44:34 | FromDiscord | <Elegantbeef> That sentence should never be that way |
04:44:37 | FromDiscord | <creikey> In reply to @Elegantbeef "I really like the": Yeah I like this |
04:45:01 | FromDiscord | <Sabena Sema> wait what's a defect |
04:45:03 | FromDiscord | <creikey> In reply to @Rika "Shits hell over there": Honestly now that I know how async works it's not so bad |
04:45:08 | xcodz-dot | Fun fact, this is what happened with me when using nim-argparse. I use release mode and the output is blank on windows. I use release mode on linux, it works. I use debug on both it works. |
04:45:12 | FromDiscord | <creikey> You gotta watch that talk from the guy who wrote nim in action |
04:45:16 | FromDiscord | <Rika> In reply to @creikey "Honestly now that I": That’s not what I mean |
04:45:21 | FromDiscord | <creikey> And then understand how function callbacks works |
04:45:26 | FromDiscord | <Elegantbeef> A defect is considered a logical error that is raised when you do something wrong |
04:45:29 | FromDiscord | <creikey> Anonymous function callbacks |
04:45:30 | FromDiscord | <Rika> There’s a good amount of Nim features that you don’t have on async |
04:45:40 | * | wallabra joined #nim |
04:45:40 | FromDiscord | <creikey> In reply to @Rika "There’s a good amount": Oh interesting never encountered these yet |
04:45:43 | FromDiscord | <Rika> Mainly related to exceptions |
04:45:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48dB |
04:45:44 | FromDiscord | <Elegantbeef> That will raise a `RaiseDefect` |
04:45:46 | FromDiscord | <Rika> You have |
04:45:54 | FromDiscord | <Sabena Sema> In reply to @Elegantbeef "A defect is considered": oh, it's a debug assert basically |
04:45:56 | FromDiscord | <Rika> In reply to @Elegantbeef "That will raise a": Range |
04:45:57 | FromDiscord | <Elegantbeef> They're not meant to be caught but are meant to signify a logical issue |
04:45:58 | FromDiscord | <Rika> Range defect |
04:46:00 | FromDiscord | <Sabena Sema> but one you might want to keep on in prod |
04:46:06 | FromDiscord | <Elegantbeef> Yea sorry i'm a dumb dumb rika |
04:46:22 | FromDiscord | <Rika> Happens to all of us, just more often with you it seems xd |
04:46:23 | FromDiscord | <Sabena Sema> do they just abort or do they unwind (or just generate a stack trace) |
04:46:25 | FromDiscord | <Elegantbeef> I actually did some programming today so really melted my brain it seems |
04:46:34 | FromDiscord | <Sabena Sema> I guess in prod you might not be able to get a good stack trace |
04:46:38 | FromDiscord | <creikey> In reply to @Rika "You have": Oh I was just doing something wrong |
04:46:40 | FromDiscord | <Elegantbeef> Defects close the program |
04:46:44 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/issues/6639 {.async.} doesn't work with {.raises:[].} |
04:46:49 | FromDiscord | <Elegantbeef> They're considered a bug |
04:47:00 | FromDiscord | <Sabena Sema> is failing to allocate a defect? |
04:47:03 | FromDiscord | <Sabena Sema> that's the real question |
04:47:10 | FromDiscord | <Sabena Sema> imo it should be on desktop systems |
04:47:13 | FromDiscord | <Rika> Not really, isn’t that a signal? |
04:47:22 | FromDiscord | <Elegantbeef> You're generally fucked 😄 |
04:47:31 | FromDiscord | <Sabena Sema> well, malloc can return null on linux if you ask for a huge quantity of memory |
04:47:52 | FromDiscord | <Sabena Sema> on windows it just returns null, windows won't overcommit (annoyingly) |
04:48:05 | FromDiscord | <Sabena Sema> but if you're _ACTUALLY_ OOM just handling errors from malloc is not sufficient |
04:48:07 | FromDiscord | <Sabena Sema> at least on linux |
04:48:23 | FromDiscord | <Sabena Sema> since you could hit the stack guard page and allocate memory that way |
04:48:29 | FromDiscord | <Sabena Sema> which just kills the process |
04:48:39 | FromDiscord | <Sabena Sema> or, it generates a segfault that's very hard to handle |
04:48:52 | xcodz-dot | Windows really needs some sort of standardized package manager that handles dependencies. Like really, microsoft needs to do that. |
04:48:59 | FromDiscord | <Rika> Well you don’t really have a way to gracefully exit from those |
04:49:00 | FromDiscord | <Sabena Sema> vcpkg |
04:49:02 | FromDiscord | <Sabena Sema> it's vcpkg |
04:49:02 | xcodz-dot | C dependencies are painful |
04:49:10 | xcodz-dot | really? |
04:49:27 | xcodz-dot | vcpkg is a thing? But does it work with gcc mingw? |
04:49:31 | FromDiscord | <Sabena Sema> yes |
04:49:43 | FromDiscord | <Sabena Sema> though not all packages do |
04:50:10 | FromDiscord | <Sabena Sema> and the whole "building debug and release" thing is asinine for mingw, since libstdc++ is compatible in debug and release |
04:50:26 | FromDiscord | <Sabena Sema> msys2 packages are usually higher quality / more working for mingw |
04:50:46 | FromDiscord | <Sabena Sema> actually IMHO you should never build debug mode in msvc |
04:50:48 | FromDiscord | <Sabena Sema> basically |
04:50:51 | xcodz-dot | does msys2 integerate with nim? |
04:50:55 | FromDiscord | <Sabena Sema> sure |
04:51:03 | FromDiscord | <Sabena Sema> nim can use the gcc from msys21 |
04:51:04 | FromDiscord | <Sabena Sema> (edit) "msys21" => "msys2" |
04:51:19 | xcodz-dot | and do the dependencies installed with msys2 work with nim? |
04:51:30 | FromDiscord | <Sabena Sema> the cygwin environment (msys2, as opposed to ucrt64) is not officially supported, but I think you can acutally get nim to link to cygwin |
04:51:34 | FromDiscord | <Sabena Sema> syre |
04:51:38 | FromDiscord | <Sabena Sema> nim just loads them |
04:51:57 | FromDiscord | <Sabena Sema> you can bootstrap nim as you would on a linux system from a msys2 ucrt64 shell and things work fine |
04:52:05 | xcodz-dot | hmm, is there a plugin for vscode to integrate with Msys2 console? |
04:52:13 | FromDiscord | <Sabena Sema> well, most things, some stuff assumes msvcrt, but that needs fixing |
04:52:20 | FromDiscord | <Sabena Sema> In reply to @xcodz-dot "hmm, is there a": don't need one |
04:52:26 | xcodz-dot | How? |
04:52:36 | FromDiscord | <Sabena Sema> you can set the console to use bash, you might want to start through msys2 |
04:52:48 | FromDiscord | <Sabena Sema> you can just launch code.exe from msys2 bash |
04:52:51 | FromDiscord | <Sabena Sema> and everything is there |
04:53:14 | FromDiscord | <Sabena Sema> you can set the shell to bash too if you want that |
04:53:25 | FromDiscord | <Sabena Sema> but you can also run the mingw tools from powershell OK |
04:53:27 | xcodz-dot | Will get right away to install msys2, I am dumb for having installed mingw manually. |
04:54:11 | FromDiscord | <Sabena Sema> msys2 _is_ the modern mingw (there are others, like STL's mingw is up to date I think) |
04:54:26 | FromDiscord | <Sabena Sema> but the old mingw32 download is like 15 years old and cursed |
04:54:31 | FromDiscord | <Sabena Sema> also msys2 has the ucrt64 env |
04:54:38 | FromDiscord | <Sabena Sema> which uses the ucrt instead of msvcrt |
04:54:39 | xcodz-dot | idk about C really. I just installed mingw earlier for Rust and now for nim. |
04:54:45 | FromDiscord | <Sabena Sema> msvcrt is the crt from Visual C++ 6.0 |
04:54:57 | xcodz-dot | rt means Runtime? |
04:55:04 | FromDiscord | <Sabena Sema> it's libc |
04:55:13 | xcodz-dot | that is the C runtime? |
04:55:20 | FromDiscord | <Sabena Sema> yeah |
04:55:26 | FromDiscord | <Sabena Sema> it's not part of the core system on windows |
04:55:38 | FromDiscord | <Sabena Sema> (although the ucrt and msvcrt are shipped inside windows) |
04:56:12 | xcodz-dot | that is great. I think I will zone out for a while as I work with moving my system to use msys2 instead. |
05:18:18 | * | xcodz-dot quit (Quit: Leaving) |
05:38:02 | FromDiscord | <leorize> you should never use the builtin msvcrt, though |
05:38:18 | FromDiscord | <leorize> the ABI is unstable and you can't link with anything that's made with msvc |
05:38:58 | FromDiscord | <leorize> typically the deal with mingw/msys is that you want to debug and develop on mingw but release your software compiled with msvc |
05:59:39 | FromDiscord | <4zv4l> I just saw this |
05:59:41 | FromDiscord | <4zv4l> https://media.discordapp.net/attachments/371759389889003532/1010790276220080188/unknown.png |
05:59:47 | FromDiscord | <4zv4l> it's possible to achieve the same without macros right ? |
06:00:13 | FromDiscord | <Elegantbeef> Everything macros do you can write manually if that's what you mean |
06:00:15 | FromDiscord | <4zv4l> it says it's nice because it's ran at compile time but I don't get why he needs macro for that |
06:00:31 | FromDiscord | <Elegantbeef> You can use a compile time procedure for that example |
06:00:45 | FromDiscord | <4zv4l> compile time procedure ? how ? |
06:02:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48dQ |
06:02:07 | FromDiscord | <Elegantbeef> Lol that's dumb |
06:02:11 | FromDiscord | <Elegantbeef> `toSeq` on a seq |
06:02:20 | FromDiscord | <Elegantbeef> Fuck I'm scared of the code quality i'm making |
06:03:30 | FromDiscord | <4zv4l> oh so const variable are made at compile time |
06:03:35 | FromDiscord | <Elegantbeef> Yes |
06:03:58 | FromDiscord | <4zv4l> if I want an immutable variable but at runtime them I have to use `let` right ? |
06:04:05 | FromDiscord | <Elegantbeef> Correct |
06:04:15 | FromDiscord | <4zv4l> thanks ^^ |
06:13:57 | * | kenran joined #nim |
06:17:21 | FromDiscord | <j-james> are there any other file extensions for nim code aside from `.nim` and `.nimble`? |
06:17:35 | FromDiscord | <Elegantbeef> `.nims` |
06:17:51 | FromDiscord | <Elegantbeef> `.nim.cfg` occasionally |
06:26:39 | FromDiscord | <j-james> ty 👍 |
06:33:27 | FromDiscord | <bun> update on 'yet another rogue clone': you can loop around now! https://media.discordapp.net/attachments/371759389889003532/1010798770507755520/Screen_Recording_2022-08-21_at_2.31.37_AM.mov |
06:34:00 | FromDiscord | <Elegantbeef> Nice rogue didnt have wrapping so you're atleast 30 years ahead |
06:34:00 | * | xcodz-dot joined #nim |
06:34:04 | * | xcodz-dot quit (Quit: Leaving) |
06:34:07 | FromDiscord | <bun> the future in now |
06:34:13 | FromDiscord | <bun> (edit) "in" => "is" |
06:38:05 | FromDiscord | <Elegantbeef> If you get tilesets you'll be in the super feature |
06:40:03 | * | genpaku quit (Remote host closed the connection) |
06:40:43 | * | genpaku joined #nim |
06:41:01 | FromDiscord | <j-james> do any tree-sitter "tree queries" (syntax highlighting stuff) exist for nim? |
06:41:07 | FromDiscord | <j-james> a la https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries |
06:41:09 | * | kenran quit (Ping timeout: 256 seconds) |
07:11:50 | FromDiscord | <4zv4l> is there a kind of `pause` like windows batch in Nim ? |
07:11:53 | FromDiscord | <4zv4l> because for now I use this |
07:12:05 | FromDiscord | <4zv4l> not sure if that's the best way |
07:12:07 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=48e7 |
07:12:33 | FromDiscord | <4zv4l> because when I share my cli program to friends well they don't open a terminal to run the program so it closes directly when the program ends |
07:26:27 | FromDiscord | <Prestige> In reply to @apropos "do any tree-sitter "tree": Nope |
07:26:36 | FromDiscord | <Prestige> It's been deemed too difficult |
07:29:34 | FromDiscord | <leorize> I actually found one on github the other day |
07:29:52 | FromDiscord | <Prestige> Doesn't work afaik |
07:30:00 | FromDiscord | <leorize> https://github.com/aMOPel/tree-sitter-nim |
07:30:27 | FromDiscord | <leorize> but it's possible to write one given enough time, just that no one is attempting one full-time yet |
07:30:35 | FromDiscord | <j-james> In reply to @Avahe "It's been deemed too": not the grammars, but raw queries |
07:31:08 | FromDiscord | <leorize> you need to write a grammar to generate the concrete syntax tree that you can query from |
07:31:47 | FromDiscord | <leorize> you can't use the nim parser for this, because tree sitter parser is a totally different type of parser |
07:34:21 | FromDiscord | <j-james> oh interesting |
07:34:56 | FromDiscord | <Prestige> I don't think it's possible to write a grammar for it to be honest, you would have to hook directly into the nim compiler I think |
07:35:16 | FromDiscord | <leorize> eh, nim is not an eldritch horror to parse \:p |
07:36:08 | FromDiscord | <leorize> a concrete syntax tree is just the file as it is written translated into a tree |
07:36:49 | FromDiscord | <leorize> nim have a kind of abnf(?) grammar defined in the manual, and you can absolutely create a parser from just that |
07:37:24 | FromDiscord | <leorize> off-side rule needs a bit of special support, but since a tree-sitter python grammar exist, so could one be written for nim |
07:40:05 | * | Vladar joined #nim |
07:42:26 | * | kenran joined #nim |
07:49:30 | FromDiscord | <Prestige> Doubt it without using or basically rewriting the compiler |
07:49:39 | FromDiscord | <Prestige> But you're welcome to try |
07:51:49 | FromDiscord | <Elegantbeef> If you're after semantic highlighting you will need the compilers semantic analysis |
07:51:58 | FromDiscord | <Elegantbeef> But otherwise you can just highlight using a grammar |
07:55:20 | * | krux02 joined #nim |
07:57:29 | FromDiscord | <Elegantbeef> I dont know why Nim would be any more complicated than Rust, Zig, or Odin |
07:58:38 | FromDiscord | <Elegantbeef> well within reason |
08:14:19 | FromDiscord | <Phil> TFW you want to give "nimview" a try but you can't find the proper package name for pacman to install the libwebkit2gtk4 package (as it is called on apt) |
08:19:33 | * | wallabra_ joined #nim |
08:19:33 | FromDiscord | <leorize> it's simply webkitgtk iirc |
08:19:47 | * | wallabra quit (Ping timeout: 248 seconds) |
08:21:27 | FromDiscord | <leorize> you gotta use `newAsyncHttpClient` |
08:21:39 | * | wallabra_ is now known as wallabra |
08:21:58 | FromDiscord | <Phil> Isn't that package dead as a doornail? |
08:22:07 | FromDiscord | <Bennyelg (Benny Elgazar)> thanks! |
08:22:23 | FromDiscord | <Elegantbeef> You also need to close the client after you're done using it |
08:22:39 | FromDiscord | <Sabena Sema> In reply to @leorize "the ABI is unstable": msvcrt has a stable ABI, we have not updated it since 1998, so its stable |
08:23:09 | FromDiscord | <Phil> Or am I mixing that up with another asynchttpclient package? I recall looking at a package of somebody else recently that made use of asynchttpclient and that hasn't been maintained in 6 years |
08:23:22 | FromDiscord | <leorize> eh, oldnewthing blog said it's whatever the windows team needed↵(@Sabena Sema) |
08:23:40 | FromDiscord | <enthus1ast> @Phil\: prolly asyncftp |
08:24:21 | FromDiscord | <Phil> Also no webkitgtk in the default repos, there is AUR stuff, but there's like 6 different packages and none of them are the devel kind that nimview wants |
08:24:39 | FromDiscord | <leorize> webkit2gtk is what it is called↵(@Phil) |
08:24:56 | FromDiscord | <Bennyelg (Benny Elgazar)> anyone knows how I mimic the python asyncio.gather([List Of tasks?]) |
08:24:59 | FromDiscord | <leorize> you can search with `pacman -Ss` |
08:25:16 | FromDiscord | <leorize> asyncfutures.all seems to be what you want |
08:25:30 | FromDiscord | <Phil> In reply to @leorize "webkit2gtk is what it": Ahhh there we go, yeah that found it |
08:26:13 | FromDiscord | <Phil> I google with webkit2gtk4 the entire time and never found anything >_>↵Package names are painful sometimes |
08:26:33 | FromDiscord | <leorize> try smaller pieces next time \:p |
08:26:37 | FromDiscord | <Phil> In reply to @leorize "you can search with": TIme to alias that because there's no way I'll recall that flag in 5 minutes |
08:27:05 | * | krux02 quit (Quit: Leaving) |
08:27:20 | FromDiscord | <leorize> btw, you can also use the `pacman -Fs` feature if you know the file name and want to find a package providing it |
08:30:43 | FromDiscord | <Bennyelg (Benny Elgazar)> thanks! |
09:02:00 | FromDiscord | <Bung> anyone use `memlib` , when i call maped proc I got `C:\Users\crc32\.nimble\pkgs\memlib-1.2.0\memlib.nim(1029) CreateCoreWebView2EnvironmentWithOptions↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
09:05:27 | FromDiscord | <enthus1ast> could be that ↵ sym\: LPCSTR↵↵is nil |
09:07:11 | FromDiscord | <enthus1ast> maybe the procname is mangled, since c++? |
09:08:21 | FromDiscord | <Bung> no c++ , pure nim project |
09:08:39 | FromDiscord | <enthus1ast> this ist from webview CreateCoreWebView2EnvironmentWithOptions |
09:08:43 | FromDiscord | <enthus1ast> right? |
09:08:47 | FromDiscord | <Bung> `var h = wv.environmentCompletedHandler()↵ let r1 = CreateCoreWebView2EnvironmentWithOptions("", dataPath, NULL, h.addr)` |
09:09:15 | FromDiscord | <Bung> problem passing proc ? |
09:10:00 | FromDiscord | <Bung> it's in WebView2Loader.dll |
09:10:27 | FromDiscord | <Bung> I've also maped GetAvailableCoreWebView2BrowserVersionString works find |
09:10:32 | FromDiscord | <Bung> (edit) "find" => "fine" |
09:10:36 | FromDiscord | <enthus1ast> my guess was that maybe since i thought its c++ that the name of the proc is not CreateCoreWebView2EnvironmentWithOptions but CreateCoreWebView2EnvironmentWithOptions\_someMangledStuff |
09:10:40 | FromDiscord | <enthus1ast> but yeah \:) |
09:11:38 | FromDiscord | <Bung> I've use dllexp check the dll exports, name is exactly CreateCoreWebView2EnvironmentWithOptions |
09:17:01 | * | kenran quit (Quit: WeeChat info:version) |
09:20:09 | FromDiscord | <Ras> In reply to @Isofruit "TIme to alias that": yep... |
09:20:12 | FromDiscord | <Ras> https://media.discordapp.net/attachments/371759389889003532/1010840734854815795/unknown.png |
09:21:03 | madprops | been re-inventing bookmarks https://i.imgur.com/JksRhlG.gif |
09:21:08 | madprops | not nim, but a firefox addon |
09:23:37 | FromDiscord | <Phil> I just played around a bit with nimview.↵So basically it creates a JS object that sends requests to the backend (I assume HTTP requests), where you basically define a bunch of callbacks to execute on being called.↵↵It's... kinda just like writing a single-page webapplication but the server is local. |
09:23:59 | FromDiscord | <Phil> And you don't have to care about various things such as "login", "authentication" etc. |
09:24:39 | * | wallabra_ joined #nim |
09:24:57 | * | wallabra quit (Ping timeout: 244 seconds) |
09:25:03 | FromDiscord | <Phil> The more I think about it, the more I start believing that this is basically how tauri operates |
09:26:37 | * | wallabra_ is now known as wallabra |
09:29:32 | madprops | tauri gtk web view, what even is that. it was broken in some ways, didn't like it |
09:29:36 | madprops | tuari uses* |
09:30:05 | FromDiscord | <Bung> js <-> nim interop is not through http, I dont deep look nimview, but other webview just use map obj map proc at compile time ,and pass arguments as json |
09:30:12 | madprops | i've been thinking of distributing web apps just be placing the files in /opt and make it open with the browser |
09:30:42 | FromDiscord | <Bung> that's already done by some nim projects |
09:31:47 | FromDiscord | <Bung> I think the improvment direction is making webview2 binding, that's what am currently doing |
09:31:53 | FromDiscord | <Phil> Just checked, nimview definitely does it through HTTP, in dev mode you can just start the server up and have it rendered by any browser |
09:32:34 | FromDiscord | <Phil> That's building after the example provided https://media.discordapp.net/attachments/371759389889003532/1010843846940315648/unknown.png |
09:33:17 | FromDiscord | <Phil> It sends a POST request for interaction containing the name of the proc to fire and the params to fire it with |
09:33:34 | FromDiscord | <Bung> that's weird , since it can use hook call it directly |
09:33:53 | FromDiscord | <Phil> If there are other projects to work with webview and a nim backend I'm open to looking at them |
09:34:30 | * | wallabra_ joined #nim |
09:34:59 | FromDiscord | <Bung> you can check https://github.com/juancarlospaco/webgui and https://github.com/bung87/crowngui |
09:35:07 | * | wallabra quit (Ping timeout: 256 seconds) |
09:35:52 | FromDiscord | <Phil> While waiting for moigagoo to give me feedback on norm and with the full release of the stable diffusion AI for image generation fast approaching I've been wanting to learn a bit about webview and doing """native""" apps with them before I go from there to trying the same with straight up using gnome |
09:35:54 | FromDiscord | <Bung> mine goal is rewrite with managable nim code and some improvements |
09:35:57 | FromDiscord | <Phil> (edit) "gnome" => "gtk" |
09:36:25 | FromDiscord | <Bung> also with building tools |
09:36:46 | * | wallabra_ is now known as wallabra |
09:37:25 | FromDiscord | <Bung> I've fullly rewrite macos part code to pure nim |
09:37:53 | FromDiscord | <Phil> first things first, what's the webgui approach? |
09:38:52 | FromDiscord | <Phil> I'm seeing a lot of screenshots on the github but not if the idea is "you get a JS object that sends calls to the backend" or "Your nim code will get compiled to js and it all runs on node" or somesuch |
09:38:57 | FromDiscord | <Bung> in short term, it's single header webview's binding with builtin themes |
09:40:04 | FromDiscord | <Bung> it means the webview can be url, string of html content, js file path, or nim file path |
09:40:21 | FromDiscord | <Bung> when it is nim file path it will compile to js first |
09:40:38 | FromDiscord | <Bung> (edit) "it means the webview ... can" added " entry" |
09:42:11 | FromDiscord | <Phil> Does it still have the (apparently standard? I've seen this architecture multiple times now) general idea of "JS+HTML+CSS Frontend, backend in another language"?↵So there is a "server" component that does the potentially computation heavy stuff or stuff like storing files on the PC etc? |
09:42:15 | * | wallabra_ joined #nim |
09:43:02 | * | wallabra quit (Ping timeout: 244 seconds) |
09:43:15 | FromDiscord | <Bung> the original webview c project does not have server , so does webgui |
09:43:17 | FromDiscord | <Phil> Basically, I haven't written anything with webview before, I'm approaching this from a bog standard webdev perspective and trying to find the analogies |
09:44:04 | FromDiscord | <Bung> https://github.com/bung87/crowngui can have server, but bundle file in exe , so there's no file access |
09:44:06 | FromDiscord | <Phil> And I've roughly understood how Electron and Tauri work, which both appear to subscribe to a "There's a frontend and the backend is node/rust) |
09:44:09 | FromDiscord | <Phil> (edit) "node/rust)" => "node/rust"" |
09:44:24 | FromDiscord | <Phil> (edit) "And I've roughly understood how Electron and Tauri work, which both appear to subscribe to a "There's a ... frontend" added "webview" |
09:44:42 | * | wallabra_ is now known as wallabra |
09:49:54 | FromDiscord | <Phil> Ohhh wait, might be it only does HTTP when not compiling releases:↵> This project uses Webview to render Desktop applications and an integrated HttpServer for Development and Cloud. It doesn't use the latest version, as the latest version stopped working with file urls. |
09:49:57 | FromDiscord | <Phil> (nimview I mean) |
09:51:11 | FromDiscord | <Bung> oh , so it is for debugging easier |
09:53:43 | FromDiscord | <Phil> Still, what I'm getting out of this is:↵Write your frontend with a JS Framework as an SPA.↵For compiling, compile your frontend, copy paste it to the resources folder of your nimview project, then compile nimview |
09:54:15 | FromDiscord | <djazz> I wish the wxWidgets bindings were better for Nim. Then you could use that to make a main menu bar and modern webview |
09:55:06 | FromDiscord | <djazz> Tried to generate bindings for latest wx, but couldn’t do it. Too much C++ stuff not easy to translate |
09:56:07 | * | wallabra_ joined #nim |
09:56:51 | * | wallabra quit (Ping timeout: 248 seconds) |
09:58:15 | * | wallabra_ is now known as wallabra |
09:59:15 | FromDiscord | <Bung> In reply to @Isofruit "Still, what I'm getting": this is basic feature these kind of frameworks have |
10:01:02 | FromDiscord | <Phil> I'm mostly trying to wrap my head around how to use them at all, not really evaluating their feature richness, I'm not at the level yet where I can actually comprehend that.↵I'm trying to get proficient at basic usage first basically 😛 |
10:02:48 | FromDiscord | <Bung> I have two basic web based gui app, you can check them out https://github.com/bung87/crown_excel https://github.com/bung87/gamode |
10:18:59 | * | PMunch joined #nim |
10:25:29 | FromDiscord | <Phil> Before I invest time into that, how high are my chances of getting that to work with a frontend written in Angular? |
10:26:40 | FromDiscord | <Bung> I think the most work is on Angular based web side |
10:27:22 | FromDiscord | <Phil> ~~Because in nimview that is proving to be a pain due to how the package does not provide typing for typescript~~ |
10:28:09 | FromDiscord | <Bung> I've use number of this kind of frameworks , even very tiny project does this well |
10:29:09 | FromDiscord | <Bung> first you will need compile your web that the platform web engine supported |
10:29:14 | FromDiscord | <Phil> In reply to @Bung "I've use number of": Could you rephrase that sentence, I'm not entirely sure what you mean |
10:30:26 | FromDiscord | <Bung> most web based gui framework can bundle your web assets as well. |
10:31:09 | FromDiscord | <Phil> Ah, the bundling is not the problem, the problem might be that if there is a JS component that must be imported, than that import can proove to be a massive pain |
10:31:39 | FromDiscord | <Phil> E.g. nimview:↵Wants you to use a JS object through which you call your backend - In Angular that is a problem because the package has some kind of issue |
10:32:15 | NimEventer | New question by dromologue: Can't evaluate at compile time - NIM, see https://stackoverflow.com/questions/73433576/cant-evaluate-at-compile-time-nim |
10:33:51 | FromDiscord | <Bung> in webgui there's bindProc |
10:34:37 | FromDiscord | <Bung> like this https://github.com/bung87/gamode/blob/8eb5cdaeff9900b5909d2105bdd17488c098a6ca/src/gamode.nim#L166 |
10:36:51 | FromDiscord | <Bung> am not sure this is what you asking for |
11:05:11 | * | wallabra_ joined #nim |
11:06:21 | * | wallabra quit (Ping timeout: 256 seconds) |
11:07:16 | * | wallabra_ is now known as wallabra |
11:12:04 | * | kenran joined #nim |
11:47:45 | * | toluene quit (Read error: Connection reset by peer) |
11:47:54 | * | toluene joined #nim |
11:53:01 | FromDiscord | <Phil> sent a long message, see http://ix.io/48f0 |
11:53:22 | FromDiscord | <4zv4l> I try to make a nim program that fetch `getnews.tech` but it doesn't work↵but with `curl` it does work↵any idea how I could do ? |
11:54:08 | FromDiscord | <Phil> code or it didn't happen xP |
11:54:35 | FromDiscord | <4zv4l> it says 404 not found but with curl it works |
11:54:53 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=48f2 |
11:55:12 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=48f3 |
11:55:39 | FromDiscord | <Phil> I mean, the browser reacts fundamentally identical in that it throws a 404, not sure what curl downloads |
11:56:26 | FromDiscord | <Phil> Could you show your curl command? |
11:56:53 | FromDiscord | <Phil> My first idea is that either they're not both targetting the same URL or curl also returns 404 but in a non obvious way |
11:57:45 | FromDiscord | <4zv4l> `curl http://getnews.tech` |
11:57:54 | FromDiscord | <4zv4l> did you try with curl ? |
12:00:51 | FromDiscord | <Phil> Fascianting. The url does not work on a browser, nor with nim's client |
12:00:55 | FromDiscord | <Phil> only curl |
12:01:18 | FromDiscord | <Phil> There's no JS that gets executed, best I can guess is that they somehow figure out as part of the request if it was sent via curl? |
12:01:40 | FromDiscord | <Bung> In reply to @Isofruit "My understanding is that": it's like when you bind procs, you will have a object have methods on js and nim side |
12:02:18 | FromDiscord | <4zv4l> because then except making a bash script which I dont want to↵I can't find how to make it work xD |
12:02:40 | FromDiscord | <Phil> In reply to @4zv4l "because then except making": Call curl from nim |
12:03:00 | FromDiscord | <4zv4l> is there an easy way to do it ? |
12:03:08 | FromDiscord | <4zv4l> haven't check how to call system program yet |
12:03:31 | FromDiscord | <Phil> In reply to @Bung "it's like when you": So it will generate an object that will have the methods and if you call the function in that JS object it will send a message with what's needed to the nim backend where the pre-defined nim proc as native binary code gets executed? |
12:03:43 | FromDiscord | <Phil> In reply to @4zv4l "haven't check how to": Should be pretty straightforward, iirc it was the os module, one sec |
12:04:49 | FromDiscord | <Bung> it does not send message , it is under web engine hook |
12:05:03 | FromDiscord | <fredrikhr> Something has happened, suddenly lots of people are starring my nimble package... Should I be worried? 🤔 |
12:05:56 | FromDiscord | <fredrikhr> (especially since I haven't touched it for 3 years... :D) |
12:05:57 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=48f6 |
12:06:33 | FromDiscord | <Phil> In reply to @Bung "it does not send": So the nim code gets compiled into JS code that has the entire functionality.↵When your JS code calls code on that object, it is still JS code that gets executed and nothing else? |
12:07:04 | FromDiscord | <Phil> I have no concept of web engine hooks so I'm struggling here |
12:07:27 | FromDiscord | <Phil> Like what bits are JS, what bits are not JS, where is the transition if there is one, how does that transition look like |
12:07:33 | FromDiscord | <Bung> when you say copmiled to js , it's webgui feature, it treats as normal js assets |
12:07:46 | FromDiscord | <Phil> Okay, so basically the entire program is 100% JS |
12:09:08 | FromDiscord | <Bung> it's another topic, like some developers dont prefer write in nim then compile to js , so they dont write js as web assets |
12:09:21 | FromDiscord | <Bung> (edit) removed "dont" |
12:09:50 | FromDiscord | <Phil> I have no such hindrances. If I write code where JS is involved I just write typescript |
12:09:59 | FromDiscord | <Phil> In that case my question is why I'm using nim for anything |
12:10:26 | FromDiscord | <Bung> so your repo on github will show 100% nim code |
12:11:34 | FromDiscord | <Phil> Like, nimviews draw is that you can use JS for the simple stuff and offload anything non-graphical to nim-code which runs faster since its compiled into a binary |
12:12:01 | FromDiscord | <Phil> (edit) "non-graphical" => "non-GUI" |
12:12:30 | FromDiscord | <Phil> For example, stable diffusion ai will soon go open, I'd like to make it a nice little sideproject to make a GUI over it where you can locally generate as many images from your prompt as you want |
12:13:22 | FromDiscord | <Phil> So I'd want a JS/HTML/CSS frontend that at one point sends a "generateImage" call to my backend, which then triggers the AI through whatever pathways will be available, stores the image on the drive and tells the frontend which paths the files are under |
12:13:43 | FromDiscord | <Phil> So that the frontend then can display the generated images. |
12:14:06 | FromDiscord | <Phil> I'd prefer not to deal with interacting with that AI code through nim compiled to JS |
12:14:08 | FromDiscord | <Bung> yeah, you can do hard work on nim side , show gui progress on web |
12:14:38 | FromDiscord | <Phil> But that nim-side is still being turned into JS code, no? |
12:15:14 | FromDiscord | <Bung> no, cant do that |
12:16:10 | FromDiscord | <Bung> since your nim code will do system level task, your js under web engine woun't let you do on js side |
12:16:16 | FromDiscord | <4zv4l> `let repl = if choice == 2: '_' else '+'`↵is there something similar in nim ? |
12:16:39 | FromDiscord | <Phil> Okay, so there is a nim-server and your webview which is powered by your OS webengine HTML/JS/CSS! |
12:16:51 | FromDiscord | <Phil> So then there must be some sort of messaging between that server and the webengine! |
12:16:52 | PMunch | @4zv4l, what do you mean, you can do exactly that in Nim already? |
12:17:06 | PMunch | Well, you need a colon after the else but apart from that your code is valid Nim |
12:17:11 | * | jmdaemon quit (Ping timeout: 256 seconds) |
12:17:24 | FromDiscord | <Bung> that's not the conclusion, you can still have local file html,js ,css |
12:17:42 | FromDiscord | <Bung> does not need http server actually |
12:18:08 | NimEventer | New post on r/nim by themoregames: Efficient 2D graphics on GPU with a tiling atlas texture ("Pixie"), see https://reddit.com/r/nim/comments/wty7u1/efficient_2d_graphics_on_gpu_with_a_tiling_atlas/ |
12:18:20 | FromDiscord | <Phil> I'm not saying that the nim-server is the thing that serves the HTML/JS/CSS files or an HTTP server, I'm saying there's a separate thread, process, whatever that is doing system-level stuff |
12:18:42 | FromDiscord | <Phil> I'm calling it server because a bunch of applications I've seen call this second thread that isn't the frontend the "Backend" |
12:18:51 | FromDiscord | <4zv4l> In reply to @PMunch "<@329196212282458112>, what do you": oooh yes right my bad xD |
12:19:11 | FromDiscord | <Phil> In reply to @fredrikhr "Something has happened, suddenly": Which one 😛 ? |
12:19:57 | FromDiscord | <Phil> Like, theres one process that is the frontend aka the webview where your HTML/CSS/JS is and then there's a second process which is where your nim code is and the two must communicate somehow |
12:20:03 | FromDiscord | <Bung> okay, I get your point, still you can do all your task in single thread, but js executing is controled under web engine, it will use another thread |
12:20:18 | FromDiscord | <fredrikhr> @Phil https://github.com/fredrikhr/nim-importc-helpers |
12:21:07 | FromDiscord | <fredrikhr> foxoman, mratsim, planetis-m and elcritch all starred it in the last 48 hours 😄 |
12:21:37 | FromDiscord | <Bung> no, that's not. all you need care about is your task is heavy or not |
12:22:18 | FromDiscord | <Bung> your nim code runs on main ui thread , so if you task is heavy you may need another thread do your task |
12:22:21 | FromDiscord | <Phil> In reply to @Bung "okay, I get your": Is the default way of crowngui having 2 threads or does crowngui do it all in 1 thread that is basically the webengine executing a bunch of code (I have to assume that a webengine only executes JS and WASM, I'm not aware of anything else they do other than maybe parse HTML/CSS but I think there's separate things for that) |
12:23:04 | FromDiscord | <Bung> crowngui and webgui dont do this way |
12:23:29 | FromDiscord | <Bung> https://github.com/bung87/gamode/blob/8eb5cdaeff9900b5909d2105bdd17488c098a6ca/src/gamode.nim#L130 you can check here |
12:24:15 | FromDiscord | <Bung> my task do system management task , so it's heavy , I create thread and use channel to do the task |
12:24:45 | FromDiscord | <Bung> otherwise you'll block main ui thread |
12:25:58 | FromDiscord | <Bung> eg. under windows your gui app main proc will have loop receive system message |
12:27:36 | FromDiscord | <Phil> I read, but I do not understand. For the most part I do not understand what the scope of the webview is and who does what.↵I think I'll play around a bit more with nimview and see if I can get the import working |
12:27:47 | FromDiscord | <Bung> you better have sub thread do the real task since it's gui app, you dont want user get stucked |
12:29:31 | FromDiscord | <Phil> Like, I understand the principles that you have your UI and whatever heavy task you want to do on separate threads to avoid making the UI non-responsive.↵AFAIK that's why even Electron has 2 threads, one for the backend one for the frontend.↵But I'm not understanding the communication |
12:30:34 | FromDiscord | <Phil> Like in nimview the order of operations is fairly straightforward |
12:33:27 | FromDiscord | <Phil> sent a long message, see http://ix.io/48fa |
12:33:50 | FromDiscord | <Phil> (edit) "http://ix.io/48fa" => "http://ix.io/48fb" |
12:34:49 | FromDiscord | <Phil> (edit) "http://ix.io/48fb" => "http://ix.io/48fc" |
12:35:14 | FromDiscord | <Phil> (edit) "http://ix.io/48fc" => "http://ix.io/48fd" |
12:35:42 | FromDiscord | <Bung> it can be more simpler, do you know android js bridge |
12:36:52 | FromDiscord | <Phil> I don't, I have never coded for android |
12:38:02 | FromDiscord | <Bung> like you write object on native side, and export it to web engine, window.xx.proc() will do the work |
12:38:48 | FromDiscord | <Phil> What does "exporting an object to web engine" mean |
12:39:20 | FromDiscord | <Phil> Is that basically running code as WASM?↵Is that compiling code to JS so that it runs on a web engine? |
12:39:31 | FromDiscord | <Phil> In my head web engine means JS engine |
12:39:43 | FromDiscord | <Phil> JS and WASM engine |
12:40:35 | FromDiscord | <Phil> Or are we talking java webengine which is a class? |
12:40:45 | FromDiscord | <Bung> like webengine.inject(yourJsBridgeObj) |
12:41:41 | FromDiscord | <Phil> That looks like java |
12:41:55 | FromDiscord | <Phil> So https://html.duckduckgo.com/html/ ? |
12:42:04 | FromDiscord | <Phil> (edit) "https://html.duckduckgo.com/html/" => "https://docs.oracle.com/javase/8/javafx/api/javafx/scene/web/WebEngine.html" |
12:43:26 | FromDiscord | <Bung> yeah, same theory |
12:44:41 | FromDiscord | <Phil> ... you know what, I just give up, I don't get it and I think I'm fundamentally missing one thing, the larger context of what you're trying to explain to me on how things work just keeps escaping me and we've been at this for easily 2-3 hours now. |
12:45:50 | FromDiscord | <Bung> maybe you just need try some framework and develope a simple app. |
12:50:11 | FromDiscord | <Phil> Possibly, I'll see, time to make a first draft |
13:08:08 | NimEventer | New thread by EnteryName: Fidget and its alternatives, see https://forum.nim-lang.org/t/9396 |
13:08:50 | * | Vladar quit (Quit: Leaving) |
13:24:01 | * | kenran quit (Quit: WeeChat info:version) |
13:36:21 | PMunch | Hmm, what would be a nice Nim abstraction for interrupts |
13:38:56 | FromDiscord | <auxym> you mean for ISRs? Not sure, in ARM world, in C, it is common that default ISRs are defined as weak functions that do nothing, which you can then easily re-define. Not sure what the best way would be to implement something similar |
13:39:17 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48fn |
13:39:30 | FromDiscord | <aruZeta> (edit) "https://play.nim-lang.org/#ix=48fn" => "https://play.nim-lang.org/#ix=48fo" |
13:39:31 | FromDiscord | <auxym> like "just define a func with this name and signature and it will be magically triggered by an interrupt" |
13:40:11 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48fp |
13:41:54 | FromDiscord | <Rika> Not that way, no |
13:42:30 | FromDiscord | <auxym> In reply to @auxym "like "just define a": maybe some sort of template or macro that defines the proc for you but then also modifies the correct entry in the vector table? |
13:42:33 | PMunch | @auxym, yeah I'm thinking interrupts for microcontrollers |
13:43:05 | PMunch | Yeah I know how it's done in C, but is that the best way of doing it? |
13:43:44 | FromDiscord | <auxym> yeah. I meant to clarify, abstractions for enabling or disabling or clearing or setting interrupt priority should be pretty straightforward. but setting handlers could be tricky |
13:43:47 | PMunch | Basically they have a procedure somewhere that just gets called by the interrupt if it is enabled |
13:44:22 | FromDiscord | <auxym> yeah, its a function pointer at some fixed position in memory calle the vector table, at least in ARM |
13:44:27 | PMunch | I was considering to write something like `registerInterrupt` that takes an interrupt and a procedure and registers it |
13:44:39 | PMunch | Yeah same thing for AVR |
13:44:40 | FromDiscord | <aruZeta> In reply to @Rika "Not that way, no": so no way then, maybe with a template tho |
13:44:50 | FromDiscord | <aruZeta> (edit) "template" => "template/macro" |
13:45:04 | PMunch | The question is just, would that even be possible? |
13:45:51 | PMunch | Well, it would be possible if the function in the interrupt table is actually a function which calls whatever function pointer which is stored in a global variable |
13:46:07 | PMunch | But this means that there is a second level of indirection and more overhead |
13:46:32 | FromDiscord | <!!sharpcdf!!> `Error: unhandled exception: cannot open: /home/sharpcdf/.jitter/nerve/odin-lang::odin::dev-2022-08/core/odin/printer/ [IOError]` after trying to unzip latest odin-lang/odin release with zippy, any idea why? |
13:47:46 | * | arkurious joined #nim |
13:48:40 | PMunch | I'll probably end up with just a `interrupt` macro which takes a name and a body |
13:58:13 | FromDiscord | <auxym> In reply to @PMunch "Well, it would be": Would it not be possible to modify the function pointer directly in the vector table? Here's an (ARM) example: https://github.com/auxym/nim-on-samd21/blob/master/lib/atmel/samd21a/gcc/gcc/startup_samd21.c#L109 |
13:58:39 | FromDiscord | <4zv4l> how can I return this `["url1","url2"]` as a sequence ? |
13:58:45 | FromDiscord | <4zv4l> and not as array |
13:58:47 | FromDiscord | <Rika> @[] |
13:58:51 | FromDiscord | <auxym> its const though, I still don't understand C enough to know what this means in this means. can the fields be modified? |
13:58:56 | FromDiscord | <Rika> Add the @ before the brackets |
13:59:47 | FromDiscord | <aruZeta> `[]` array↵`@[]` seq |
14:00:00 | FromDiscord | <aruZeta> (edit) "seq" => "seq↵`{}` set" |
14:00:08 | FromDiscord | <aruZeta> (edit) "set" => "set↵`()` tuple" |
14:01:00 | FromDiscord | <4zv4l> thaaaaanks↵named is it easy to make a named tuple ? |
14:01:19 | FromDiscord | <4zv4l> (edit) "thaaaaanks↵named is" => "thaaaaanks↵is" |
14:01:39 | FromDiscord | <aruZeta> what do you mean? |
14:01:59 | FromDiscord | <aruZeta> a tuple is like an object, you need to name it's content |
14:02:30 | FromDiscord | <Rika> You don’t need to |
14:02:56 | FromDiscord | <Rika> (1, 2) is an anonymous tuple |
14:02:58 | FromDiscord | <aruZeta> `let myTuple: tuple[a: string, b: string] = (a: "foo", b: "bar")` |
14:03:04 | FromDiscord | <aruZeta> In reply to @Rika "(1, 2) is an": ah yh |
14:03:10 | FromDiscord | <4zv4l> just then instead of doing↵`tuple[0]` I can do `tuple.url` |
14:03:14 | FromDiscord | <Rika> yes |
14:03:17 | FromDiscord | <aruZeta> yep |
14:03:26 | FromDiscord | <4zv4l> alright thanks !!! |
14:03:31 | FromDiscord | <4zv4l> damn that language is amazing xD |
14:04:07 | PMunch | @auxym, possible? Maybe, but not easy. The thing is that its really only possible to write to program memory from the boot block in AVR |
14:04:24 | FromDiscord | <4zv4l> if you have time to loose↵I'm rewriting this : https://github.com/SaigoNoo/jpscanvf↵in nim here : https://github.com/4zv4l/jpscanvf↵there is one TODO left |
14:04:33 | FromDiscord | <auxym> In reply to @auxym "Would it not be": actually @PMunch the ARM core headers have a C function to do just that, set the func pointer (vector) for a giver interrupt: https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS/Core/Include/core_cm0plus.h#L950 |
14:04:53 | FromDiscord | <aruZeta> btw, should I use const for some big arrays (like 160 elements) or a let with {.compileTime.}? |
14:05:03 | PMunch | Most USB-reprogrammable chips have a bootloader that runs as the first thing, checks for any upload commands, and writes new memory. But from a running program this command doesn't do anything. |
14:05:39 | FromDiscord | <auxym> so yeah, I thin `registerInterrupt` would be a fine abstraction over that. |
14:06:17 | PMunch | What? |
14:06:18 | FromDiscord | <aruZeta> In reply to @4zv4l "if you have time": yet another repo with a README not in english so I don't understand shit |
14:06:20 | FromDiscord | <Rika> In reply to @aruZeta "btw, should I use": Const will “copy” the value in every usage |
14:06:39 | FromDiscord | <aruZeta> In reply to @Rika "Const will “copy” the": it's used a LOT, so I guess better use the pragma |
14:06:39 | FromDiscord | <Rika> Let will use memory, may still copy as well depending on usage |
14:06:50 | PMunch | The problem is that only the bootloader can write these interrupts. Ratel doesn't ship its own bootloader |
14:07:01 | PMunch | So I have no way of doing that |
14:07:12 | FromDiscord | <4zv4l> In reply to @aruZeta "yet another repo with": mine is in English tho xD↵google trad is here also xD |
14:07:23 | FromDiscord | <Rika> In reply to @aruZeta "yet another repo with": Looks like a manga site ripper |
14:07:27 | FromDiscord | <aruZeta> yh |
14:07:43 | FromDiscord | <Rika> In reply to @4zv4l "mine is in English": The English of traducion is translation |
14:08:49 | FromDiscord | <auxym> In reply to @PMunch "The problem is that": the vector table can be modified at runtime though, no? at least that's what the SetVector thing seems to be doing |
14:09:22 | FromDiscord | <auxym> so a user could just register the ISR at any time |
14:09:47 | PMunch | @auxym, not in AVR |
14:09:54 | FromDiscord | <auxym> ah |
14:11:05 | FromDiscord | <auxym> then I don't see a way to do it at runtime, but at compile time maybe a template or macro that `exportC`s a proc with the correct C name to shadow the weak C func? |
14:13:11 | FromDiscord | <aruZeta> In reply to @Rika "Const will “copy” the": but a question I have is, when the const value is copied to every location where I used and the program is run, won't the copied array be put in memory to get the index I requested? I don't actually know how it works |
14:13:27 | FromDiscord | <Rika> Constants don’t exist past compile time |
14:13:37 | FromDiscord | <aruZeta> yh I get that |
14:13:43 | FromDiscord | <Rika> It will look like you copied the value into the areas manually |
14:14:00 | FromDiscord | <Rika> Of course whatever memory implications those have applied to constants too |
14:14:09 | FromDiscord | <Rika> (edit) "applied" => "apply" |
14:14:26 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48fI |
14:14:42 | FromDiscord | <aruZeta> right |
14:14:44 | FromDiscord | <aruZeta> (edit) "right" => "right?" |
14:14:45 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48fJ |
14:14:53 | FromDiscord | <Rika> Yeah |
14:15:08 | FromDiscord | <aruZeta> so then, to get the index of that array, that array will be put in memory |
14:15:23 | FromDiscord | <Rika> Yes, I did say that in some roundabout way |
14:15:55 | FromDiscord | <aruZeta> so then if I use that const let's say 100 times, it would be better for it to be put in there once and not 100 times |
14:16:39 | FromDiscord | <Rika> I’m not sure about the compiler and it’s optimisations but it might just do that if you use a const |
14:16:55 | FromDiscord | <aruZeta> hmm |
14:16:55 | FromDiscord | <Rika> Perhaps it doesn’t though |
14:17:05 | FromDiscord | <Rika> As always, it’s best to test |
14:17:06 | * | wallabra_ joined #nim |
14:18:22 | FromDiscord | <aruZeta> it would be about 2-3KB of memory in total anyway |
14:18:27 | * | wallabra quit (Ping timeout: 256 seconds) |
14:18:41 | FromDiscord | <auxym> In reply to @auxym "then I don't see": @PMunch an abstraction that only allows compile-time definition of ISRs seems quite reasonable to me. runtime ISR modifications seems like a really niche usecase and if someone really wants that they could just drop out of ratel to a lower level, platform-dependent code. |
14:19:08 | PMunch | @auxym, yeah that's what I'm thinking as well |
14:19:49 | FromDiscord | <aruZeta> In reply to @Rika "As always, it’s best": And with that,↵`101517 lines; 1.451s; 182.234MiB peakmem`↵Is peakmem what the compiler calculates to be the max memory the program would use if every variable was filled ? |
14:20:02 | FromDiscord | <retkid> i need to define a type but in order to define that type another type must exist |
14:20:05 | FromDiscord | <aruZeta> (edit) "with" => "about" |
14:20:08 | FromDiscord | <retkid> i would like to define them both at the same time |
14:20:11 | FromDiscord | <retkid> i forget how to do this |
14:20:33 | FromDiscord | <auxym> In reply to @PMunch "<@882793909246369864>, yeah that's what": we do something like that to define "callbacks" for the tinyusb wrapper in picostdlib: https://github.com/EmbeddedNim/picostdlib/blob/master/src/picostdlib/tusb.nim#L677 |
14:20:41 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48fL |
14:20:47 | FromDiscord | <aruZeta> like this you mean? @retkid |
14:20:56 | FromDiscord | <retkid> yes |
14:21:05 | FromDiscord | <retkid> kinda |
14:21:06 | FromDiscord | <Rika> In reply to @aruZeta "And about that, `101517": No |
14:21:15 | FromDiscord | <Rika> It’s how much memory the compiler used, the peak |
14:21:18 | FromDiscord | <retkid> if i can replace A that would be fine |
14:21:20 | FromDiscord | <aruZeta> ah lol |
14:21:27 | PMunch | @auxym, ooh, I like that called twice guard |
14:21:32 | FromDiscord | <aruZeta> any benchmark lib for nim lol? |
14:21:41 | FromDiscord | <retkid> theres one in the stdlib |
14:21:44 | PMunch | benchy comes to mind @aruZeta |
14:21:46 | FromDiscord | <retkid> alternatively |
14:21:47 | FromDiscord | <aruZeta> benchy? |
14:21:54 | PMunch | And there's stuff in the stdlib as well |
14:22:01 | * | wallabra joined #nim |
14:22:05 | FromDiscord | <aruZeta> I saw it before used in some pixie line but didn't know it was in std |
14:22:15 | FromDiscord | <auxym> In reply to @PMunch "<@882793909246369864>, ooh, I like": credit goes to beef for that one IIRC |
14:22:31 | FromDiscord | <retkid> is invalid |
14:22:39 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=48fM |
14:22:44 | FromDiscord | <retkid> i forget how to do this as well |
14:23:27 | FromDiscord | <retkid> no |
14:23:31 | FromDiscord | <aruZeta> you did not name it |
14:23:31 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48fN |
14:23:31 | FromDiscord | <retkid> as a type |
14:23:33 | * | wallabra_ quit (Ping timeout: 256 seconds) |
14:23:40 | FromDiscord | <aruZeta> T is a type |
14:23:40 | FromDiscord | <retkid> you dont name a static proc type |
14:23:58 | FromDiscord | <4zv4l> any idea how I could easily list all folder on a http server ?↵the http server allows to browse the folder so is there any easy way to do that ? |
14:24:21 | FromDiscord | <retkid> as in |
14:24:26 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=48fQ |
14:24:44 | FromDiscord | <aruZeta> a paramater being another proc you mean |
14:24:52 | FromDiscord | <retkid> uh sure |
14:24:56 | FromDiscord | <Rika> Bare proc types cannot be generic |
14:25:00 | FromDiscord | <retkid> pain |
14:25:01 | FromDiscord | <aruZeta> my bad, didn't understand |
14:25:14 | FromDiscord | <retkid> can i alternatively make a bare templte |
14:25:21 | FromDiscord | <Rika> ??? |
14:25:22 | FromDiscord | <retkid> (edit) "templte" => "template" |
14:25:34 | FromDiscord | <retkid> i need to define these two types together |
14:25:39 | FromDiscord | <retkid> because they are interconnected |
14:25:41 | FromDiscord | <Rika> Templates can’t be stored in runtime variables, I’ve never seen anyone do it for const but I bet it wouldn’t work |
14:25:53 | FromDiscord | <Rika> Define it in the same block then I don’t get it |
14:26:00 | FromDiscord | <retkid> wait |
14:26:53 | FromDiscord | <retkid> yea i forgot you can do that |
14:26:59 | FromDiscord | <retkid> ありがと |
14:27:08 | FromDiscord | <Rika> :widepepe: |
14:27:55 | PMunch | Hmm, I have a little dilemma with my laptop project. The Teensy 2.0 doesn't have enough IO pins for both the keyboard and the mouse |
14:28:02 | PMunch | I wonder if I can multiplex it.. |
14:28:44 | PMunch | Basically read the mouse when I'm not scanning the keyboard, and if the mouse is moved away from its resting position disable keyboard scanning until it is returned |
14:28:59 | PMunch | I might actually try that |
14:29:41 | FromDiscord | <Rika> If someone is already typing then tries to move the mouse? |
14:29:54 | FromDiscord | <Rika> Just use a shift register if you really need more pins |
14:30:04 | FromDiscord | <Rika> Not expensive to add unless you’re mass producing this |
14:30:11 | FromDiscord | <Rika> Costs dev time though |
14:30:50 | FromDiscord | <Rika> 74HC165 or 164 |
14:31:18 | FromDiscord | <Rika> Piss common |
14:31:29 | FromDiscord | <aruZeta> I have a spare pro micro atmega32u4, would like to make some project with it one day |
14:31:41 | FromDiscord | <aruZeta> any cool ideas? |
14:34:03 | FromDiscord | <Rika> A keyboard :OMEGALUL: |
14:34:12 | FromDiscord | <aruZeta> already have one lol |
14:34:17 | FromDiscord | <aruZeta> a crkbd |
14:34:21 | FromDiscord | <Rika> Make one more |
14:34:26 | FromDiscord | <aruZeta> one moar |
14:34:49 | FromDiscord | <aruZeta> In reply to @aruZeta "I have a spare": (funny that I ordered one to replace the one in my keyboard which I fried and 2 arrived, so 1 for free lol) |
14:40:11 | FromDiscord | <aruZeta> does `nimble test` search for `test` files under subdirectories in `/test`? |
14:40:53 | * | kenran joined #nim |
14:46:21 | NimEventer | New thread by Enjoysmath: Can't get basic example of creating reference objects to work. Compilation errors., see https://forum.nim-lang.org/t/9397 |
14:49:18 | FromDiscord | <retkid> rate my code |
14:49:33 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=48fW |
14:49:50 | FromDiscord | <aruZeta> rating: -2, no colors |
14:50:02 | FromDiscord | <auxym> In reply to @PMunch "Hmm, I have a": You mean you're working on an integrated keyboard/trackpad thing? |
14:50:05 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=48fW" => "https://play.nim-lang.org/#ix=48fX" |
14:50:09 | FromDiscord | <auxym> cool |
14:50:09 | FromDiscord | <retkid> fixed |
14:50:16 | FromDiscord | <aruZeta> hahaha |
14:50:59 | FromDiscord | <retkid> the status ref stuff is a tad sketchy |
14:51:15 | FromDiscord | <retkid> i did it because it would be a circular definition if it gave itself |
14:51:29 | FromDiscord | <aruZeta> just a question since I have never used inheritance in nim (well maybe to create a defect) but why would one want to `ref object of RootObj` ? |
14:51:42 | FromDiscord | <retkid> well |
14:51:47 | FromDiscord | <auxym> In reply to @Rika "Just use a shift": or an i2c/spi IO expander, which IIRC he was already using in badger, so I'm not sure I understand the issue |
14:51:53 | FromDiscord | <retkid> you need a root to start from |
14:52:05 | FromDiscord | <retkid> you can do inheriatance by changing rootObj to something |
14:52:10 | FromDiscord | <retkid> pretty sure |
14:52:23 | FromDiscord | <retkid> this stuff is relatively typed and stuff, but it would make sense for a game |
14:52:29 | FromDiscord | <retkid> which is what this system is referencing |
14:53:04 | FromDiscord | <retkid> i did it to prove i could probably code the combat system to his favorite game in an afternoon. |
14:53:17 | FromDiscord | <retkid> which doesn't actually say much |
14:54:04 | FromDiscord | <dom96> your types should start with a capital letter |
14:54:16 | FromDiscord | <dom96> also only space after the `:` |
14:54:29 | FromDiscord | <retkid> I am the master of my own formatting |
14:54:52 | FromDiscord | <dom96> and your indentation is so inconsistent 🙈 |
14:55:10 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48g0 |
14:55:20 | FromDiscord | <Rika> In reply to @auxym "or an i2c/spi IO": Sure but those are more expensive. Much easier to use though |
14:55:51 | FromDiscord | <retkid> In reply to @aruZeta "why `bleed` has `a:": Because that's how you instanciate types in him |
14:56:03 | FromDiscord | <aruZeta> In reply to @aruZeta "why `bleed` has `a:": `ref object`'s params can be changed without it being a var |
14:56:07 | FromDiscord | <retkid> Oh that |
14:56:16 | FromDiscord | <retkid> Because otherwise it wouldn't be mutable |
14:56:27 | FromDiscord | <retkid> And I need to reduce the hp |
14:56:33 | FromDiscord | <aruZeta> it is mutable |
14:56:44 | FromDiscord | <dom96> `ref`s are always mutable |
14:56:48 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48g1 |
14:56:49 | FromDiscord | <retkid> Til |
14:56:54 | FromDiscord | <retkid> Wait |
14:57:10 | FromDiscord | <retkid> Ah |
14:57:15 | FromDiscord | <retkid> I didn't know that |
14:57:28 | FromDiscord | <aruZeta> you only need a type to be `var` (mutable) when it is a `object`, not `ref object` |
14:57:45 | FromDiscord | <Rika> In reply to @dom96 "`ref`s are always mutable": Until strict functions |
14:57:51 | FromDiscord | <aruZeta> since a `ref object` stores the reference to that object's location in the heap |
14:58:01 | FromDiscord | <retkid> I kinda got that |
14:58:13 | FromDiscord | <retkid> Thanks for the clarification though |
14:58:19 | FromDiscord | <aruZeta> np :) |
15:00:12 | * | CyberTailor quit (Remote host closed the connection) |
15:13:08 | NimEventer | New question by Philipp Doerner: How do I use nimview together with Angular?, see https://stackoverflow.com/questions/73435668/how-do-i-use-nimview-together-with-angular |
15:13:57 | FromDiscord | <Phil> No need to answer, I answered it myself already |
15:14:03 | FromDiscord | <Phil> Figured out the solution earlier |
15:16:14 | PMunch | @auxym, I'm working on an eInk laptop, so I need to integrate the trackpoint and keyboard of the case I'm using |
15:19:12 | FromDiscord | <Bung> is there something I should notice when pass object to dll's proc on windows ? I got nil access , but echo repr shows not nil |
15:24:43 | * | kenran quit (Quit: WeeChat info:version) |
15:25:21 | * | kenran joined #nim |
15:25:31 | * | kenran quit (Client Quit) |
15:31:06 | FromDiscord | <Rika> In reply to @PMunch "<@882793909246369864>, I'm working on": I’m not sure what combining the two has to do with the e ink part lol |
15:41:54 | FromDiscord | <retkid> the trick is not using windows |
15:42:01 | FromDiscord | <retkid> that has helped me avoid dll issues |
15:44:05 | FromDiscord | <Bung> the project is for windows |
15:53:40 | FromDiscord | <Phil> That merely sounds like a challenge! |
15:59:35 | FromDiscord | <4zv4l> would that be a good idea to load the whole web server tree and make a search with auto completion on the terminal ? with something like `readline` but that works on both windows and linux ? |
15:59:54 | FromDiscord | <4zv4l> or idk if the dude search for an anime but the name doesn't exactly match the folder idk how to handle that |
16:02:09 | FromDiscord | <Bung> sounds like devdocs-app but a gui app |
16:04:07 | FromDiscord | <4zv4l> `readLineFromStdin` but with auto completion |
16:06:35 | FromDiscord | <Rika> Does line noise not work on windows? |
16:06:50 | FromDiscord | <Rika> In reply to @4zv4l "or idk if the": Fuzzy search |
16:08:24 | FromDiscord | <4zv4l> how can I get fuzzy search on nim ? |
16:08:30 | FromDiscord | <4zv4l> https://github.com/genotrance/nimfuzzy is it a good lib for that ? |
16:21:53 | FromDiscord | <auxym> looks good |
16:54:14 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=48gF |
16:54:45 | FromDiscord | <Bung> (edit) "https://play.nim-lang.org/#ix=48gF" => "https://play.nim-lang.org/#ix=48gG" |
17:04:47 | * | wallabra_ joined #nim |
17:05:37 | * | wallabra quit (Ping timeout: 256 seconds) |
17:07:08 | * | wallabra_ is now known as wallabra |
17:14:37 | * | wallabra_ joined #nim |
17:14:56 | * | wallabra quit (Remote host closed the connection) |
17:16:54 | * | wallabra_ is now known as wallabra |
17:17:24 | FromDiscord | <Forest> How do i build the Nim compiler with koch? Cloned from source with tag v1.6.6 |
17:17:53 | FromDiscord | <Forest> `./koch boot` gives this: `not all cases are covered; missing: {mm}` |
17:17:56 | FromDiscord | <Forest> Then says failure |
17:18:21 | FromDiscord | <Forest> The compiler version i have installed system-wide is `1.7.1` |
17:19:29 | FromDiscord | <Forest> I haven't modified anything yet either |
17:21:37 | FromDiscord | <aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=48gN |
17:22:49 | FromDiscord | <huantian> Hm you should just be able to run build-all.sh or whatever it’s called |
17:24:46 | FromDiscord | <Forest> Ah |
17:25:07 | FromDiscord | <Forest> I want a way to build the compiler fast tbh since I'm doing many small modifications |
18:03:11 | FromDiscord | <Forest> What's Nim `jsonscript`? |
18:11:27 | FromDiscord | <yrashk> I am curious, `concepts` being experimental, is there any expectation that they'll be overhauled significantly in the future? |
18:23:56 | * | derpydoo joined #nim |
18:24:54 | FromDiscord | <Phil> Not to my knowledge, Elegantbeef may know more, but from what I've noticed it's unlikely.↵They're afaik closer the "release" bit than the "experimental" bit |
18:44:44 | FromDiscord | <dom96> from what I know they are in fact being overhauled |
18:45:14 | FromDiscord | <dom96> https://github.com/nim-lang/RFCs/issues/168 |
18:49:39 | FromDiscord | <Phil> Wasn't that more refinement than changing principles? |
18:49:56 | FromDiscord | <Phil> Like, the last activity from beef looks like handling edge-cases |
18:50:27 | FromDiscord | <dom96> it's changing completely how concepts are written |
18:50:47 | FromDiscord | <Phil> Ohhhh wait, as in that's the redesign being discussed and that's not yet implemented |
18:59:33 | FromDiscord | <Phil> could've sworn that had already been done,welp |
19:20:21 | FromDiscord | <Forest> Before i recreate the wheel... Is there any library that like, takes the Nim AST and spits it out in an easy to read way? |
19:21:08 | FromDiscord | <treeform> In reply to @Forest "Before i recreate the": dumpTree? |
19:21:15 | FromDiscord | <treeform> https://nim-lang.org/docs/macros.html#dumpTree.m%2Cuntyped |
19:21:56 | FromDiscord | <Forest> Yeah thanks |
19:22:15 | FromDiscord | <Forest> Wonder how easily i could use that instead of forking Nim because honestly i hate that lmao |
19:24:40 | * | jmdaemon joined #nim |
19:30:19 | FromDiscord | <Phil> ... has anyone figured out how to get a look at messages when there's an error in the JS a webview is supposed to run on Linux? |
19:46:20 | PMunch | @Rika, well it's a laptop, so it needs a keyboard and a mouse integrated. But if I just said I was creating my own laptop I'd get questions like "why don't you just buy one, like literally everyone else", that's why I was qualifying with eInk :P |
19:46:42 | FromDiscord | <EyeCon> Does someone know of an XID implementation in Nim? A quick search revealed nothing. The XID is a time-sortable kind of nonce used as ID, designed to be generated independently with minimal risk of collusion, like Snowflake: https://github.com/rs/xid |
19:47:18 | FromDiscord | <EyeCon> (edit) "XID" => "xid" |
19:51:42 | PMunch | There are OIDS which are also mentioned to be extracted from MongoDB and is 12 bytes |
19:51:43 | * | PMunch quit (Quit: leaving) |
19:54:12 | FromDiscord | <EyeCon> That would have been my second choice, is there a Nim implementation you know of? |
19:55:00 | FromDiscord | <EyeCon> If not, I will implement that since it's so easy |
20:14:50 | FromDiscord | <Bung> still have no idea why this https://github.com/bung87/webview2/blob/d51e6bba84aef345be8447a4e2ba9f317e437ad6/src/webview2/browser.nim#L52 cause `C:\Users\crc32\.nimble\pkgs\memlib-1.2.0\memlib.nim(1029) CreateCoreWebView2EnvironmentWithOptions↵SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
20:36:12 | FromDiscord | <EyeCon> In reply to @EyeCon "If not, I will": https://github.com/EyeCon/mongoobjectid |
20:36:34 | FromDiscord | <EyeCon> I hope there are no glaring mistakes, I'm open to suggestions |
20:39:22 | FromDiscord | <Forest> Is there a way to go through all nodes in a Nim file? |
20:39:40 | FromDiscord | <Forest> I don't really understand how I'm supposed to do that with the macro library lol |
20:39:46 | FromDiscord | <Forest> Unless I'm looking in the wrong place |
20:41:00 | FromDiscord | <EyeCon> Do you really want to iterate all nodes in a file? Most macros take a tiny piece of code |
20:41:23 | FromDiscord | <Forest> In reply to @EyeCon "Do you really want": Yeah, I'm doing it to generate a representation of a Nim file in JSON |
20:41:52 | FromDiscord | <EyeCon> Understood, interesting, I'd like to see the result of that |
20:42:36 | FromDiscord | <Forest> I was originally gonna modify the Nim JS backend but I can't understand it so.... Time to do cursed stuff that people will curse me for aha |
20:46:16 | FromDiscord | <Bung> parseStmt does not fit your needs? |
20:46:46 | FromDiscord | <Forest> In reply to @Bung "parseStmt does not fit": Can that parse entire Nim files and give me a completed AST? |
20:46:48 | FromDiscord | <Forest> Tree |
20:47:16 | FromDiscord | <Forest> Hm... Reading that rn |
20:47:29 | FromDiscord | <Bung> Compiles the passed string to its AST representation. Expects one or more statements. |
20:47:53 | FromDiscord | <Forest> That looks really useful actually |
20:47:58 | FromDiscord | <Forest> Thanks for pointing it out! |
20:49:31 | FromDiscord | <Forest> Where can i find all of NimNode's properties? Will it be in PNimNode (or whatever it's called) |
20:53:00 | FromDiscord | <Bung> it's documented in first section |
20:53:09 | FromDiscord | <amadan> In reply to @EyeCon "I hope there are": Any reason you used std/random instead of std/sysrand? |
20:56:32 | FromDiscord | <Forest> In reply to @Bung "it's documented in first": Ah okay |
20:57:02 | FromDiscord | <Forest> Also I can't figure out how to actually use parseStmt? Just throws compile time errors but i don't know how to use the code at compile time aha |
20:57:13 | FromDiscord | <Forest> Also it'd be better if i could use it at runtime |
20:57:19 | FromDiscord | <Forest> ...maybe NimScript could save me |
20:58:43 | FromDiscord | <Bung> you can use staticRead |
20:59:39 | NimEventer | New thread by Bung: Use memlib call dll proc face nil access, see https://forum.nim-lang.org/t/9398 |
21:02:06 | FromDiscord | <Forest> Oh? |
21:02:28 | FromDiscord | <Forest> Slurp lmao |
21:02:38 | FromDiscord | <Forest> Oh sweet that's amazing |
21:07:48 | FromDiscord | <EyeCon> In reply to @amadan "Any reason you used": That I forgot about it 🙂 |
21:08:12 | FromDiscord | <EyeCon> And the OID's random numbers can be pseudorandom anyway, it's not supposed to be a CSPRNG |
21:27:21 | FromDiscord | <Forest> For some reason I can't echo the NimNode without getting `invalid node kind nnkStmtList for macros.×$×` |
21:27:31 | FromDiscord | <Forest> Replacing ` with × because discord formatting |
21:27:53 | FromDiscord | <Elegantbeef> `echo myNode.repr` or `echo myNode.treeRepr` |
21:27:58 | FromDiscord | <EyeCon> I think \\ works as an escape character: \` |
21:28:08 | FromDiscord | <Forest> In reply to @EyeCon "I think \\ works": Not in code blocks |
21:28:15 | FromDiscord | <Forest> In reply to @Elegantbeef "`echo myNode.repr` or `echo": Oh that makes sense lmao |
21:33:38 | FromDiscord | <Forest> I feel like doing this at compile time will impact my goals because this is meant to be a program users can run on any nim file |
21:34:16 | FromDiscord | <Bung> then use readFile |
21:34:37 | FromDiscord | <Elegantbeef> I mean you're attempting to reimplement the Nim compiler |
21:35:34 | FromDiscord | <Forest> All i need is to get an AST tree that i can iterate through, can that not be done with NimScript? Why would it be a bad idea? |
21:36:14 | FromDiscord | <Elegantbeef> Nimscript isnt capable of everything Nim is |
21:36:37 | FromDiscord | <Forest> It isn't capable of providing me a workable AST tree? |
21:36:49 | FromDiscord | <Forest> So i could use that within my Nim program |
21:36:54 | FromDiscord | <Elegantbeef> I mean if you use any part that isnt supported in nimscript it'll error |
21:37:25 | FromDiscord | <Forest> Hm |
21:37:40 | FromDiscord | <Elegantbeef> Either forking the compiler or using it as a library is the sane thing to do |
21:37:42 | FromDiscord | <Forest> Is there a list of what isn't supported? |
21:38:04 | FromDiscord | <Elegantbeef> It's a subset of Nim there isnt a complete list of what's not supported |
21:38:17 | FromDiscord | <Bung> there's list it supported |
21:38:45 | FromDiscord | <Forest> In reply to @Elegantbeef "Either forking the compiler": I don't know how to use it as a library tbh, it isn't easy to understand Nim or Cyo's core code, that's my issue lmao |
21:38:59 | FromDiscord | <Forest> I just want the Nim AST from a file that the user passes to me |
21:39:01 | FromDiscord | <Elegantbeef> A small list is↵● Many casts are disallowed↵● Closures do not work↵● Anything that requires importC does not work |
21:39:39 | FromDiscord | <EyeCon> @ElegantBeef I'm trying to understand how I can implement some Matrix endpoints in your new and very elegant way, but I couldn't completely understand what happens in the `createRequest` as it is a bit too macro-ey for me. Could you point me to the part where the requested output tuple is constructed? Does it get the values automagically from the response JSON? What happens if the requested values are too deep in the response? |
21:40:00 | * | derpydoo quit (Quit: derpydoo) |
21:40:25 | FromDiscord | <Elegantbeef> The output tuple is just a tuple generated by the output block of your code |
21:40:53 | FromDiscord | <Forest> In reply to @Elegantbeef "A small list is": That isn't really an issue to me, only thing i really need is the syntax and the core libraries such as `tables`, which I'm sure can be polyfilled |
21:41:24 | FromDiscord | <Elegantbeef> Well then use the compiler as a library and replicate what it's `main` does |
21:41:24 | FromDiscord | <EyeCon> In reply to @Elegantbeef "The output tuple is": But I'm looking at, say, `login` and I fail to see where it constructs the output. Specifically, where it parses the JSON to find the values |
21:41:32 | FromDiscord | <EyeCon> Am I missing something big here? |
21:41:59 | * | adium quit (Ping timeout: 252 seconds) |
21:42:15 | FromDiscord | <Elegantbeef> Have you done `--expandMacro:createRequest`? |
21:42:24 | FromDiscord | <Forest> Main.nim in `compiler`? |
21:42:32 | FromDiscord | <Elegantbeef> https://github.com/tandy-1000/matrix-nim-sdk/blob/v1.3/src/matrix/utils/endgen.nim#L177 it's right here though |
21:42:51 | FromDiscord | <Elegantbeef> Yes main.nim |
21:43:37 | FromDiscord | <Forest> Aight, thanks! |
21:43:51 | FromDiscord | <Elegantbeef> That an main.nim |
21:43:55 | FromDiscord | <Elegantbeef> nim.nim i mean |
21:44:00 | FromDiscord | <EyeCon> In reply to @Elegantbeef "Have you done `--expandMacro:createRequest`?": Is it a switch of the Nim compiler? Let me check |
21:44:12 | FromDiscord | <Elegantbeef> Yes it is↵(@EyeCon) |
21:44:29 | FromDiscord | <Elegantbeef> eyecon in the case of `login` it doesnt generate a tuple |
21:44:47 | FromDiscord | <Elegantbeef> Sorry i mean logout |
21:45:22 | FromDiscord | <EyeCon> But it does in the case of login, right? |
21:45:37 | FromDiscord | <Elegantbeef> for login it generates a `type LoginReqData = (userData, accessToken, deviceId: string, wellKnown: Option[DiscoveryInfo])` |
21:45:39 | FromDiscord | <Elegantbeef> Indeed |
21:46:07 | FromDiscord | <Forest> In reply to @Elegantbeef "nim.nim i mean": Aight |
21:46:16 | FromDiscord | <Elegantbeef> If the output is a type it Needs a responsehandler |
21:46:17 | FromDiscord | <Elegantbeef> Otherwise it creates a tuple and parses to it |
21:46:18 | FromDiscord | <EyeCon> In reply to @Elegantbeef "https://github.com/tandy-1000/matrix-nim-sdk/blob/v": I found that, but what I couldn't find is where it assigns the response data to the result |
21:46:28 | FromDiscord | <Elegantbeef> It does it right there |
21:46:41 | FromDiscord | <Elegantbeef> `res` is result in genast |
21:46:50 | FromDiscord | <Elegantbeef> I didnt use `result` as i didnt want to overload the macro logic |
21:47:11 | FromDiscord | <Elegantbeef> `result = a` inside genast may be misconstrued for assigning the result of the macro |
21:47:32 | FromDiscord | <Elegantbeef> `res = ident"result"` is a genast parameter |
21:48:26 | FromDiscord | <Forest> I don't understand what i should be looking at ngl |
21:48:37 | FromDiscord | <Forest> Reading `mainCommand` of main.nim rn lmao |
21:48:40 | FromDiscord | <Elegantbeef> Well i'm not going to write it for you |
21:49:12 | FromDiscord | <Elegantbeef> You need to use the nim compiler as a library and get it to compile the code to AST then you take that module graph and can do whatever you want with it instead of outputting the backend |
21:49:25 | FromDiscord | <Forest> In reply to @Elegantbeef "Well i'm not going": Wouldn't expect that at all lmao |
21:49:57 | FromDiscord | <Forest> In reply to @Elegantbeef "You need to use": Ohhhh that makes sense |
21:50:25 | FromDiscord | <EyeCon> In reply to @Elegantbeef "`res` is result in": This is becoming an XY problem because I know so little about macros, so let me ask my original question: let's say the server responds with a huge JSON. Can I use your macro to write an endpoint which returns a single, possibly deeply nested value in the response? |
21:50:25 | * | toluene quit (Ping timeout: 252 seconds) |
21:50:52 | FromDiscord | <Elegantbeef> If the json parser can handle it of course |
21:51:40 | FromDiscord | <Elegantbeef> the macro just emits a procedure which sends a request to the end point then does `result = response.body.fromJson(typeof(result))` |
21:52:07 | FromDiscord | <Elegantbeef> Atleast if you make it generate a type |
21:52:16 | FromDiscord | <Elegantbeef> Otherwise you can operate on the response directly and do whatever you want |
21:52:18 | FromDiscord | <Elegantbeef> So it should work to solve any problem |
21:52:28 | FromDiscord | <EyeCon> But this means that the whole response is parsed in the first case, right? |
21:52:40 | FromDiscord | <EyeCon> So I should write a handler to extract the data in my case |
21:52:47 | FromDiscord | <Elegantbeef> No clue what parser is used |
21:53:19 | FromDiscord | <Elegantbeef> Whether the entire response is parsed is down to what parser is used and what fields match |
21:53:31 | FromDiscord | <Elegantbeef> But yea if you need custom logic go for the manual handler |
21:53:51 | FromDiscord | <EyeCon> In reply to @Elegantbeef "Whether the entire response": Ah, that was the missing part. The JSON parser ignores the missing parts? |
21:54:06 | FromDiscord | <EyeCon> So you construct a tuple with just the bits you're interested in |
21:54:10 | FromDiscord | <Elegantbeef> No clue which parser it is so it might |
21:54:15 | FromDiscord | <EyeCon> And you try to deserialize from the JSON |
21:54:22 | FromDiscord | <EyeCon> If I understood correctly |
21:54:34 | FromDiscord | <Elegantbeef> That's the idea |
21:54:36 | FromDiscord | <EyeCon> OK, makes sense, thank you |
21:54:43 | FromDiscord | <Elegantbeef> If it doesnt work that way blame the json parser used |
21:54:52 | FromDiscord | <EyeCon> In reply to @Elegantbeef "If it doesnt work": Will do |
21:55:15 | FromDiscord | <Elegantbeef> Do look at the expanded macro it'll make life a bit easier |
21:56:38 | FromDiscord | <EyeCon> I should add the switch to the compiler in my nimble file ideally, right? Standalone doesn't make any sense |
21:56:41 | FromDiscord | <EyeCon> Let me try |
21:56:52 | FromDiscord | <EyeCon> Ah, I meant config file, not nimble |
21:57:05 | FromDiscord | <Elegantbeef> I mean it's just for testing so yea you can just use it through the cli |
21:59:18 | FromDiscord | <!&luke> How can I have a webserver that can run in the background |
21:59:26 | FromDiscord | <!&luke> With something like prologue |
21:59:36 | FromDiscord | <EyeCon> Wait, where does it "dump" to? |
21:59:47 | FromDiscord | <Elegantbeef> The terminal |
21:59:48 | FromDiscord | <EyeCon> I added `switch("expandMacro", "createRequest")` into the config.nims file |
22:00:16 | FromDiscord | <!&luke> In reply to @ripluke "With something like prologue": I want to have a webserver with my discord bot, so both the bot and the website work |
22:00:23 | FromDiscord | <!&luke> In reply to @Elegantbeef "The terminal": What |
22:01:02 | FromDiscord | <Bung> just use another thread run your web server |
22:01:39 | FromDiscord | <!&luke> In reply to @Bung "just use another thread": Yea but how |
22:02:29 | FromDiscord | <Bung> createThread pass your work proc, in your work proc run your server forever |
22:02:55 | FromDiscord | <!&luke> Ok |
22:09:54 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=48hD |
22:10:16 | FromDiscord | <amadan> (edit) "https://play.nim-lang.org/#ix=48hD" => "https://play.nim-lang.org/#ix=48hE" |
22:14:03 | NimEventer | New thread by Templatedperson: Nim without libc?, see https://forum.nim-lang.org/t/9399 |
22:19:37 | FromDiscord | <Forest> Aha... How does `nim.nim` or `main.nim` tell the compiler that "hey! A file has been passed!" |
22:21:49 | FromDiscord | <Forest> I've stripped it down a lot but i may of stripped something needed? I don't understand what though |
22:22:19 | FromDiscord | <Forest> Hold on |
22:22:31 | FromDiscord | <Forest> https://hastebin.com/emibolufev.nim |
23:12:15 | FromDiscord | <!&luke> In reply to @amadan "Could also start the": Ok |
23:21:05 | FromDiscord | <Bung> https://forum.nim-lang.org/t/9398 anyone help me out?I can't get it out of my head , it costs me hours already |
23:26:48 | * | adium joined #nim |
23:31:29 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=48hP |
23:37:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48hQ |
23:40:35 | FromDiscord | <Zectbumo> well that's interesting. I swore I just tried that... |
23:42:23 | FromDiscord | <Zectbumo> that checks that box. I'm happy to see. As for the second part, I've seen others use the `reallyDoThis()` pattern. Any tips there? |
23:44:01 | FromDiscord | <Zectbumo> hmm, maybe use a module eg. `internalModule.verifyName(name)` |
23:48:33 | FromDiscord | <Elegantbeef> Dont know what you mean |
23:51:52 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=48hS |
23:52:10 | FromDiscord | <Elegantbeef> This is why Nim has distinct types imo |
23:53:45 | FromDiscord | <Zectbumo> oh so I make a `verifyName(name: cleansedName)` or something? |
23:54:00 | FromDiscord | <huantian> I usually use impl instead of really 😛 |
23:54:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=48hT |
23:54:27 | FromDiscord | <Elegantbeef> I dont know exactly what you're after but i like using distinct for this disambiguation if possible |
23:54:46 | FromDiscord | <Zectbumo> yes, I see now. Very nice |
23:56:16 | FromDiscord | <Zectbumo> thx, I think that helped rewire my brain a bit |
23:56:26 | * | Figworm quit (Quit: Figworm) |
23:56:57 | FromDiscord | <Elegantbeef> If you're talking about the distinct type solution, distinct types are amazing when used well |
23:57:15 | FromDiscord | <Elegantbeef> Some people avoid them, and those people are what i call wrong |
23:57:40 | FromDiscord | <Zectbumo> 😁 yeah the distinct solution is clean |