00:10:23 | * | cyraxjoe quit (Ping timeout: 264 seconds) |
00:10:34 | * | cyraxjoe joined #nim |
00:30:00 | * | zgasma quit (Quit: leaving) |
00:38:45 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4quE |
00:48:04 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4quF |
00:48:07 | FromDiscord | <Nilts> please help |
00:49:46 | FromDiscord | <huantian> the last index in your string is `istr.len - 1` |
00:49:58 | FromDiscord | <huantian> so `istr.len - 2` will give you the second to last character |
00:50:13 | FromDiscord | <huantian> you can do `istr[^1]` to get the last character as well |
00:51:20 | FromDiscord | <Nilts> In reply to @huantian "you can do `istr[^1]`": no, i tired that i think. It does not work on cstrings. I forgot strip stripped \n therfore it should be - 1 instead of -2 |
00:53:01 | FromDiscord | <Nilts> thanks btw |
01:29:04 | FromDiscord | <Nilts> Ok, now i have a deep recursion, how would i debug it? It revolves around strings that are supposed to be empty not being empty |
01:41:15 | NimEventer | New thread by Naterlarsen: Fstring and Split to Variable Error, see https://forum.nim-lang.org/t/9980 |
02:17:50 | FromDiscord | <huantian> Elegantbeef can you fix the code in this thread too? |
02:18:58 | FromDiscord | <Elegantbeef> Uhhh i do not know what that code is since someone didnt write it properly 😛 |
02:19:51 | termer | it has a bug, I can't fix it man sorry next time you need me to fix code please make sure the code is bug-free and works right |
02:20:21 | FromDiscord | <Elegantbeef> I mean the code isnt written in the forum post properly |
02:20:31 | FromDiscord | <Elegantbeef> It's lacking proper formatting |
02:20:40 | FromDiscord | <huantian> Use your imagination |
02:22:00 | termer | I'm joking around |
02:22:25 | FromDiscord | <Elegantbeef> Hey i know, but it's also some amount of non satirical commentary |
02:22:46 | termer | I assure you it's fully satirical |
02:24:10 | termer | if there's someone to antagonize about not helping people out, it would certainly not be you |
02:24:17 | termer | you're here 24/7 somehow |
02:25:04 | * | lumo_e quit (Quit: Quit) |
02:28:19 | FromDiscord | <Rika> Nah he’s sometimes not here when I’m here |
02:28:28 | FromDiscord | <Rika> Then again people say I’m him so |
02:34:04 | * | derpydoo quit (Quit: derpydoo) |
02:35:03 | FromDiscord | <Elegantbeef> You're not me?! |
02:35:07 | FromDiscord | <Elegantbeef> First i'm hearing of it |
03:13:32 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
03:13:56 | * | pbsds joined #nim |
04:44:58 | * | arkurious quit (Quit: Leaving) |
04:55:06 | FromDiscord | <Prestige> I've had a template in my code called `set` that's now having an error with 1.6.12, saying it's an ambiguous identifier because of `system.set: set` - but since the params are different, shouldn't the compiler know which function I'm wanting to call? |
04:56:03 | FromDiscord | <Elegantbeef> It depends |
04:59:02 | FromDiscord | <Prestige> Can you elaborate? I'm confused why this is happening |
05:00:41 | FromDiscord | <Elegantbeef> How is the template declared, and how are you using it? |
05:01:54 | FromDiscord | <Elegantbeef> I can only really say git biset using https://github.com/nim-lang/Nim/compare/v1.6.10...v1.6.12 as a reference |
05:02:21 | FromDiscord | <Prestige> Template is `template set(this: UIComponent, start, length: float)` and I'm using it like `child.set(0.3, 0.8)` |
05:03:16 | FromDiscord | <Elegantbeef> does it work with `set(child, 0.3, 0.8)`? |
05:04:17 | FromDiscord | <Prestige> still complains |
05:04:38 | FromDiscord | <Elegantbeef> Well it might be https://github.com/nim-lang/Nim/pull/21405/files |
05:05:19 | FromDiscord | <Elegantbeef> Or maybe https://github.com/nim-lang/Nim/commit/19dd56f018fdacebeaf6605e5915defc66d88d0f |
05:05:31 | FromDiscord | <Prestige> hmm 🤔 |
05:05:45 | FromDiscord | <Elegantbeef> Luckily there are only 50 commits to bisect |
05:06:14 | FromDiscord | <Prestige> should I make a minpro and open an issue |
05:06:28 | FromDiscord | <Elegantbeef> You should just git bisect imo |
05:06:38 | FromDiscord | <Prestige> ok |
05:06:40 | FromDiscord | <Prestige> maybe |
05:10:07 | FromDiscord | <Elegantbeef> After you find the commit that causes it a min repro would be great |
05:10:18 | FromDiscord | <Elegantbeef> I might even take a look at it right now depending on the commit 😄 |
05:11:44 | FromDiscord | <Prestige> I gotta look into building nim again lol |
05:12:19 | FromDiscord | <Elegantbeef> Clone the repo then `nim c ./koch` then you can do `./koch temp c ./mynim` |
05:13:47 | FromDiscord | <Prestige> `Error: cannot open file: std/paths` |
05:13:57 | FromDiscord | <Prestige> from nim c koch |
05:14:26 | FromDiscord | <Elegantbeef> Have you build Nim before from source? |
05:14:28 | FromDiscord | <Elegantbeef> If so clear your nim cache for koch |
05:14:52 | FromDiscord | <ringabout> Did you use the template `set` in a template? |
05:15:09 | FromDiscord | <Prestige> nah |
05:16:40 | FromDiscord | <ringabout> sent a code paste, see https://paste.rs/VC8 |
05:17:19 | FromDiscord | <Prestige> ty |
05:27:35 | * | derpydoo joined #nim |
06:39:24 | * | menace joined #nim |
06:40:47 | * | menace quit (Quit: menace) |
06:52:53 | * | rmt joined #nim |
07:01:28 | FromDiscord | <Elegantbeef> Jeez who'd have though Rust like enums would be simple if implemented like Rust does theirs 😄 |
07:01:44 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/blob/master/fungus.nim#L194-L215 if anyone is curious |
08:01:53 | * | Notxor joined #nim |
08:09:14 | FromDiscord | <RMT> @Ayy Lmao , any luck? I'm also planning to look into CLAP plugins at some point. Perhaps you need to define clap_plugin_descriptor_t too? |
08:20:46 | FromDiscord | <RMT> I was following Jürgen Moßgraber's series here to do it in C, and the C version works fine: https://www.youtube.com/watch?v=oko5xJDY39E .. a little more complicated .. but I can imagine that most DAW's will try to do more during a first/one-time scan just to get at the description. |
08:24:16 | * | derpydoo quit (Quit: derpydoo) |
08:56:43 | FromDiscord | <caravaggio> In nim why are single quotes used for escaping? |
08:57:23 | FromDiscord | <caravaggio> sent a code paste, see https://play.nim-lang.org/#ix=4qvZ |
09:00:01 | FromDiscord | <amadan> back ticks (`) are used for escaping |
09:00:02 | FromDiscord | <Phil> ?↵Backticks are used, not single quotes |
09:00:26 | FromDiscord | <amadan> This section in the manual talks about it https://nim-lang.org/docs/manual.html#lexical-analysis-keywords-as-identifiers |
09:00:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qw3 |
09:40:15 | FromDiscord | <Phil> Okay, question, are "Routers" a normal thing in native GUI applications as well or is that a frontend web framework concept? |
09:42:26 | FromDiscord | <Elegantbeef> I'd say that's very much a web thing, most GUI just use a basic state machine 😄 |
09:49:20 | FromDiscord | <Phil> Yeah but you'd want to show different "Pages" right? So you'd want to direct users through those and thus would want to have a mechanism that does that handling for you, no? |
09:49:43 | FromDiscord | <Elegantbeef> Depends on the program I guess |
09:50:09 | FromDiscord | <Elegantbeef> A stacked FSM is probably sufficient for most things |
09:50:20 | FromDiscord | <Phil> FSM? |
09:50:28 | FromDiscord | <Elegantbeef> Finite state machine |
09:51:15 | FromDiscord | <Elegantbeef> Clearly i havent done much GUI development so i should shush |
09:52:43 | FromDiscord | <Phil> Basically there's a couple concepts that I'd have assumed would be generally useful and thus wasn't sure if native GUI had those concepts before, copied them from webdev since or has different approaches |
09:53:55 | FromDiscord | <Elegantbeef> I'd say most native applications do not work like web apps where you can go from point A to point N |
09:54:12 | FromDiscord | <Phil> Those would be:↵- Mechanisms that handle which page currently should be displayed (in webdev: A router)↵- Mechanisms that handle whether you have permission to access a page (in webdev-Angular: A route-guard)↵- Mechanisms to fetch data before showing a page (in webdev-Angular: resolvers) |
09:54:34 | FromDiscord | <Phil> (edit) "fetch data" => "trigger data-fetching that then happens either" | "trigger data-fetching that then happens eitherbefore ... showing" added "or while" |
09:57:44 | FromDiscord | <Phil> Hmmm I'd say native apps have less pages thinking about it, in webdev everything is a page kinda, in native apps e.g. thunderbird or calendar have 3+ different pages |
09:58:00 | FromDiscord | <Phil> Though in webdev you'd have tons of different pages so eh |
09:58:06 | FromDiscord | <Elegantbeef> Yea native apps are way more strict |
09:58:24 | FromDiscord | <Elegantbeef> You do not have as much dynamism so it's easy and generally fine to limit it statically |
09:58:45 | FromDiscord | <Elegantbeef> Like blueman for instance is |
09:58:46 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1084052791384875119/image.png |
09:58:56 | FromDiscord | <Elegantbeef> There literally is no reason for any page 😄 |
10:00:08 | FromDiscord | <Elegantbeef> Atleast if a program follows the unix philosophy I do not think it needs any of what your mentioned |
10:01:06 | FromDiscord | <Elegantbeef> I do realise now i do not use many gui tools 😄 |
10:02:26 | FromDiscord | <Elegantbeef> Obs studio, KdenLive, blueman, they all do not need any sort of pages, resolver, route guard |
10:06:15 | FromDiscord | <Phil> TBF they just launch a new window often times for stuff like settings |
10:06:25 | FromDiscord | <Phil> Which is kinda like a page |
10:06:50 | FromDiscord | <Elegantbeef> It's practically a self contained program that can access your programs information! |
10:09:46 | FromDiscord | <jmgomez> In reply to @Isofruit "Hmmm I'd say native": usually UIs frameworks have the concept of stack/nav stack (i.e. mvp, ios, android..) nothing stops you to build a "router" on top of it if you want separation of concerns but beef is right, with the stack + a small FMS you should be fine. Although code wise is more and less the same amount of code |
10:11:14 | FromDiscord | <Phil> In reply to @jmgomez "usually UIs frameworks have": It's called stack I assume because basically all pages get rendered in a sense, they just all are stacked on top of one another and the mental model is that the user just gets moved n layers up or down the nav-stack when a different page should be displayed? |
10:13:41 | FromDiscord | <Elegantbeef> I imagine it's called a stack cause it's like a stack data type in that it's FILO if you hit "back" |
10:14:18 | FromDiscord | <Phil> Wait is it FSM in contrast to e.g. in webdev where you can have the same page infinite amounts of time depending on the kind of "route-params" in the URL that determine the data-set used to render the page? |
10:16:13 | FromDiscord | <Elegantbeef> Do you not know what a FSM is? |
10:17:14 | FromDiscord | <jmgomez> In reply to @Isofruit "Wait is it FSM": The issue with webdev is that spas uses the same "semantics" than traditional server side. But you dont really need to pass parameters over a route in order to represent different state in a page neither in a SPA or in a native UI, you can just pass an object that represent the state of the whole thing a render that |
10:17:21 | FromDiscord | <Phil> Not in practical terms. ↵The basic concept I'm aware of is that X can only be in a limited sets of states.↵Which has no meaning because that can be such a large number you might as well develop as if it had infinite possibilities |
10:17:48 | FromDiscord | <jmgomez> (edit) "a" => "and" |
10:17:52 | FromDiscord | <Elegantbeef> I mean the most basic FSM is just a single value that you use a case statement to move between |
10:18:22 | * | junaid_ joined #nim |
10:20:51 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qwj |
10:21:51 | FromDiscord | <Elegantbeef> This can also be represented with more complex things like inheritance or pointer procedures |
10:22:18 | FromDiscord | <Phil> sent a long message, see http://ix.io/4qwk |
10:22:55 | FromDiscord | <Phil> Though I guess if you have limited views, having a "Back" button makes no sense anyway, making the point kinda moot |
10:24:20 | FromDiscord | <Elegantbeef> I mean if it was a stack based design, going to 1 then 3 would make it so 1 was on your highest stack 😛 |
10:25:31 | FromDiscord | <Phil> Ohhh not a static stack of all pages that exist, but a dynamic stack of pages you visisted |
10:25:34 | FromDiscord | <Phil> (edit) "visisted" => "visited" |
10:25:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qwl |
10:26:31 | FromDiscord | <Elegantbeef> Yea i can see GUI on mobile using something like the above pseudo code for their 'pages' |
10:26:46 | FromDiscord | <Elegantbeef> Especially with nested navigation |
10:27:39 | FromDiscord | <Phil> I think on mobile its kinda mandatory, since all phones have a back button intrinsically |
10:27:42 | FromDiscord | <Elegantbeef> If the gui is stateful it also means that you get things like scroll progress and things like that for free |
10:29:15 | FromDiscord | <Elegantbeef> You can do the same thing with owlkettle since like i said it's stateful, so depending on what you're doing(an installer is pretty much just a stack) it could work for you |
10:29:26 | FromDiscord | <Elegantbeef> Though like i said most GUI programs i use do not have any odd navigation |
10:29:40 | FromDiscord | <Elegantbeef> I still stand by the whole "Do one thing well" |
10:29:44 | FromDiscord | <Phil> That's the reason why I was thinking about it |
10:29:56 | FromDiscord | <Phil> Because I pretty much have the entire window-body under a kind of navigation component |
10:29:58 | FromDiscord | <Phil> Got a page enum |
10:30:07 | FromDiscord | <Phil> Based on that enum I show one of my widgets |
10:30:31 | FromDiscord | <Phil> I was mostly contemplating whether that makes sense to have in a widget-library or not |
10:30:32 | FromDiscord | <Elegantbeef> Yea if you want it to be more dynamic the stack might be better, it's less work to add to atleast 😄 |
10:31:01 | FromDiscord | <Elegantbeef> A StackNavigator might be nice |
10:31:48 | FromDiscord | <Phil> Because such a navigation widget could simply accept a `Table[SomeEnum, Widget]` and `someEnumVal` (with someEnumVal being a ref-type so that changes elsewhere in the application can be noticed here). |
10:32:12 | FromDiscord | <Elegantbeef> This sicko using a `Table[enum, T]` |
10:32:18 | FromDiscord | <Elegantbeef> !ban phil |
10:32:29 | FromDiscord | <Phil> Could have a hidden `widgetStack` or something that you just push entries to as the route changes |
10:32:42 | FromDiscord | <Phil> Sorry, not route changes, as you re-navigate |
10:33:04 | FromDiscord | <Elegantbeef> `array[enum, T]` is right there my guy! |
10:33:36 | FromDiscord | <Phil> Basically every time you re-render you check if `someEnumVal` changed and if it did you push the new enum value to `widgetStack` |
10:33:57 | FromDiscord | <Phil> Not sure how you'd do a "back" thingy on that one though |
10:34:12 | FromDiscord | <Elegantbeef> Anyway i'm off so talk GUI with the wall |
10:34:27 | FromDiscord | <Phil> Beef off to start beef elsewhere |
10:43:34 | * | junaid_ quit (Remote host closed the connection) |
10:47:34 | * | junaid_ joined #nim |
10:49:46 | * | junaid_ quit (Client Quit) |
10:57:50 | * | junaid_ joined #nim |
11:05:14 | NimEventer | New thread by alexeypetrushin: Shared global var in ORC?, see https://forum.nim-lang.org/t/9981 |
11:15:43 | * | junaid_ quit (Remote host closed the connection) |
11:28:44 | deadmarshal_ | Hi, how can I make a set of char from a string? |
11:34:02 | * | PMunch joined #nim |
11:41:42 | FromDiscord | <Phil> Do you need that data-type in particular or do you just want to iterate over it?↵Because you can just iterate over a string and it'll hand you out chars.↵Other than that, there's `std/sequtils.toSeq |
11:41:43 | FromDiscord | <Phil> (edit) "`std/sequtils.toSeq" => "`std/sequtils.toSeq`" |
11:42:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qwD |
12:18:23 | FromDiscord | <kots> sent a code paste, see https://play.nim-lang.org/#ix=4qwN |
12:59:46 | * | rockcavera quit (Remote host closed the connection) |
13:01:23 | deadmarshal_ | Phil: thanks |
15:18:12 | * | xaltsc joined #nim |
15:26:00 | * | arkurious joined #nim |
15:44:43 | * | Evolver is now known as Revolver |
16:37:38 | FromDiscord | <System64 ~ Flandre Scarlet> I want to try RayLib but there is 3 bindings for Nim, do you know which binding should I use? https://media.discordapp.net/attachments/371759389889003532/1084153169040384000/image.png |
16:44:10 | FromDiscord | <elvodqa> Which one is recently updated? |
16:44:53 | FromDiscord | <Yepoleb> In reply to @System64 "I want to try": @planetis always shills his 😄 |
16:45:25 | FromDiscord | <planetis> that's right, that's right |
16:45:42 | FromDiscord | <planetis> I should do an advertisement with a pornstar next |
16:45:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Yepoleb "<@915614219364368394> always shills his": wdym? |
16:46:10 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @elvodqa "Which one is recently": The third one, then the first one, then the second one |
16:48:01 | FromDiscord | <Yepoleb> In reply to @System64 "wdym?": planetis likes to praise his version, but i have not tried any |
16:48:33 | FromDiscord | <elvodqa> In reply to @System64 "The third one, then": Naylib seems really good |
16:48:39 | FromDiscord | <elvodqa> Go for it |
16:49:24 | FromDiscord | <Yepoleb> you probably can't go wrong with either nimraylib_now or naylib |
16:49:56 | NimEventer | New post on r/nim by Xar94: Excel and Nim, see https://reddit.com/r/nim/comments/11oot9o/excel_and_nim/ |
17:05:34 | FromDiscord | <System64 ~ Flandre Scarlet> What is the latest Nim version? |
17:06:53 | FromDiscord | <planetis> In reply to @System64 "What is the latest": v1.6.12 |
17:07:03 | FromDiscord | <planetis> In reply to @elvodqa "Naylib seems really good": thanks for the kind words! |
17:07:44 | FromDiscord | <planetis> @System64 ~ Flandre Scarlet have you seen this warning https://github.com/planetis-m/naylib#naylib---your-nimble-companion-for-game-development-adventures |
17:09:31 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @planetis "<@380360389377916939> have you seen": Oh so I need Nim 2? It is an unstable build no? |
17:10:15 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qyn |
17:10:24 | FromDiscord | <planetis> well it's a release candidate, there is only two showstoppers left https://github.com/nim-lang/Nim/labels/Showstopper and one has already a fix |
17:11:12 | FromDiscord | <System64 ~ Flandre Scarlet> wtf puppy 2.0.3 is already installed???? |
17:12:18 | FromDiscord | <System64 ~ Flandre Scarlet> That doesn't make sense?? https://media.discordapp.net/attachments/371759389889003532/1084161892106371194/message.txt |
17:13:34 | FromDiscord | <auxym> you probably have some version conflict, ie one package requires puppy < 2.0 and the other requires puppy >= 2.0 |
17:14:27 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "you probably have some": So what should I do? |
17:15:18 | FromDiscord | <auxym> I don't know, does nimble have any debugging option like printing out the full dependency tree? |
17:15:55 | FromDiscord | <auxym> Otherwise you'll have to look at your dependencies (including transitive) one-by-one to find the ones that require puppy |
17:16:14 | FromDiscord | <System64 ~ Flandre Scarlet> Oh my god pain |
17:16:30 | FromDiscord | <auxym> figure out which one conflicts, then figure out what you want to do about it (eg fork it or PR to update the required version of puppy) |
17:16:45 | FromDiscord | <System64 ~ Flandre Scarlet> and is there a pre-built version of choosenim? |
17:17:39 | FromDiscord | <System64 ~ Flandre Scarlet> I have both so what's the problem?? https://media.discordapp.net/attachments/371759389889003532/1084163237492305937/image.png |
17:17:48 | FromDiscord | <auxym> windows, yes, IIRC. not sure for linux, I have it installed via AUR (so built from source) |
17:18:20 | FromDiscord | <auxym> yeah but I don't think nim/nimble supports compiling against two different versions of a same package |
17:19:59 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qyu |
17:20:12 | FromDiscord | <System64 ~ Flandre Scarlet> Why tf does it need BOTH versions?? |
17:22:49 | FromDiscord | <planetis> you can open nimbledata.json from your nimble directory |
17:23:01 | FromDiscord | <System64 ~ Flandre Scarlet> I installed from the exe |
17:23:10 | FromDiscord | <System64 ~ Flandre Scarlet> can I switch to Nim 2 with that? |
17:23:39 | FromDiscord | <planetis> what exe? |
17:24:08 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/dom96/choosenim/releases/tag/v0.8.4↵That |
17:24:16 | FromDiscord | <planetis> sorry I don't know much about windows but I recently installed nim v2 in a virtual machine and it worked fine |
17:25:36 | FromDiscord | <planetis> no idea about choosynim, I just download the nim build artifact, the mingw compiler, put everything on the PATH and be done with it |
17:28:09 | FromDiscord | <planetis> wtf did he casually changed the license to BSD? |
17:28:43 | FromDiscord | <System64 ~ Flandre Scarlet> wdym? |
17:29:21 | FromDiscord | <planetis> of choosenim |
17:29:30 | FromDiscord | <turbo> how do I escape `{` in a `&""`? |
17:30:56 | FromDiscord | <planetis> oh it was always BSD, just fixed the .nimble file |
17:31:07 | FromDiscord | <System64 ~ Flandre Scarlet> Finally I installed naylib |
17:36:09 | FromDiscord | <exelotl> In reply to @turbo "how do I escape": I think you do it like `{{` |
17:36:48 | FromDiscord | <turbo> In reply to @exelotl "I think you do": Ah yes that works. Was worried because it breaks syntax highlighting in VSCode |
17:38:46 | FromDiscord | <System64 ~ Flandre Scarlet> @planetis is it normal? https://media.discordapp.net/attachments/371759389889003532/1084168551365095454/message.txt |
17:40:33 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/planetis-m/raylib-examples/blob/main/core/basic_window.nim↵I copied this sample |
17:42:39 | FromDiscord | <planetis> damn, no I couldn't reproduce in the vm but I know what it is |
17:43:38 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qyE |
17:43:52 | FromDiscord | <planetis> from where did you install mingw because i dont think the same happens with mingw from https://nim-lang.org/install_windows.html |
17:44:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @planetis "from where did you": Nim is supposed to use the mingw bundled with Nim |
17:44:58 | FromDiscord | <System64 ~ Flandre Scarlet> and now it didn't found GCC??? WTF??↵I used Choosenim |
17:45:08 | FromDiscord | <System64 ~ Flandre Scarlet> so it should be bundled? |
17:45:41 | FromDiscord | <planetis> no, its a separate archive, you need to have both in the path |
17:46:21 | FromDiscord | <planetis> no idea if nim is supposed to use that specific mingw from the download page for windows |
17:47:11 | FromDiscord | <System64 ~ Flandre Scarlet> I use one of the mingw in my PC, but why does it do this error??↵It's just a compiler |
17:48:11 | FromDiscord | <planetis> yes there is no wingdi.h in that archive. It defines a Rectangle type and it conflicts with the one provided by raylib |
17:50:10 | FromDiscord | <System64 ~ Flandre Scarlet> WTF |
17:54:04 | FromDiscord | <planetis> ...and there are more conflicts with CloseWindow and ShowCursor. Please use the mingw provided in the nim for windows download page until I figure it out |
17:54:44 | FromDiscord | <System64 ~ Flandre Scarlet> And where should I put this mingw? I don't want to conflict with others ones |
17:55:20 | FromDiscord | <planetis> Can you build the raylib static library without errors btw? https://github.com/raysan5/raylib/wiki/Working-on-Windows |
17:55:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @planetis "Can you build the": I never tried, why? |
17:56:22 | FromDiscord | <planetis> In reply to @System64 "And where should I": because I am curious if it's nim specific error |
17:59:03 | FromDiscord | <planetis> Don't bother nim must include windows.h somewhere in system. But |
18:00:11 | FromDiscord | <planetis> that archive must have a slimmed down version of windows.h that doesn't include wingdi.h |
18:00:39 | FromDiscord | <System64 ~ Flandre Scarlet> That's confusing :/ |
18:01:05 | FromDiscord | <planetis> i just inferred in from the error message |
18:02:17 | FromDiscord | <planetis> it's a wild guess but it might be related to -DWIN32_LEAN_AND_MEAN |
18:02:50 | FromDiscord | <System64 ~ Flandre Scarlet> what does it mean? |
18:04:17 | FromDiscord | <System64 ~ Flandre Scarlet> I generated the lib through official raylib repo https://media.discordapp.net/attachments/371759389889003532/1084174973511405578/image.png |
18:04:43 | FromDiscord | <planetis> that's a C define passed in the command line and has an #ifndef WIN32_LEAN_AND_MEAN in windows.h |
18:05:14 | FromDiscord | <planetis> can you gist C:/msys64/mingw64/include/windows.h please? |
18:05:24 | FromDiscord | <planetis> need to compare them |
18:06:08 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1084175437724405760/windows.h |
18:07:38 | FromDiscord | <planetis> nope they are exactly the same |
18:07:51 | FromDiscord | <System64 ~ Flandre Scarlet> sus |
18:08:24 | FromDiscord | <System64 ~ Flandre Scarlet> This is so weird↵So this is not windows.h |
18:11:35 | FromDiscord | <planetis> no windows.h includes wingdi.h and winuser.h, actually I have both files in directory mingw64/x86_64-w64-mingw32/include/ and not mingw64/include |
18:11:54 | FromDiscord | <System64 ~ Flandre Scarlet> So I need to put them? |
18:14:03 | FromDiscord | <planetis> Can you try extracting the archive in a directory putting mingw64/bin/ into your PATH before C:/msys64/mingw64/bin and try again? |
18:14:59 | FromDiscord | <planetis> If that doesn't work I go the route of mangling the Rectangle names in the raylib.h unfortunately. |
18:15:38 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @planetis "Can you try extracting": Wdym? The archive from Nim? |
18:16:48 | FromDiscord | <planetis> https://nim-lang.org/install_windows.html mingw64.7z |
18:17:15 | FromDiscord | <System64 ~ Flandre Scarlet> I downloaded this one |
18:24:42 | FromDiscord | <planetis> sent a code paste, see https://play.nim-lang.org/#ix=4qyX |
18:25:11 | FromDiscord | <planetis> and if it works I will push a fix in naylib immediately |
18:26:35 | FromDiscord | <planetis> and I am sorry for the trouble I put you into today, I hope it's worth it |
18:31:09 | FromDiscord | <planetis> hmm it might not work |
18:31:45 | FromDiscord | <planetis> I have a different idea |
18:36:39 | * | junaid_ joined #nim |
18:37:52 | * | junaid__ joined #nim |
18:39:50 | * | junaid___ joined #nim |
18:40:43 | FromDiscord | <System64 ~ Flandre Scarlet> what is your idea? |
18:41:15 | * | junaid__1 joined #nim |
18:44:17 | FromDiscord | <planetis> it's again related to emit, so all wrappers have an issue with the order of includes |
18:44:57 | FromDiscord | <planetis> sometimes #include "raymath.h" is generated before #include "raylib.h" |
18:45:45 | FromDiscord | <planetis> hopefully I might be able to fix those issues by not using the .header pragma at all |
18:47:05 | FromDiscord | <planetis> it should emit #undef Rectangle then #include "raylib.h" |
18:47:21 | FromDiscord | <planetis> that's it |
18:54:59 | FromDiscord | <Coachonko> If I pass a table to a function, is it passed by reference? |
18:55:53 | FromDiscord | <Coachonko> And if they are passed by reference, is there a deep copy proc? |
19:08:07 | FromDiscord | <caravaggio> How do I navigate to the file where a Proc raised an error? |
19:08:35 | FromDiscord | <caravaggio> Am on vscode and I just want to be able to navigate to the std/lib code |
19:11:14 | * | Revolver is now known as Evolver |
19:12:48 | FromDiscord | <Phil> In reply to @caravaggio "How do I navigate": Runtime error or compile time error? |
19:12:59 | FromDiscord | <Phil> Compile time should leave a clickable link in the vscode terminal |
19:13:28 | FromDiscord | <Phil> Runtime I'd look at the stacktrace for the file and then use CTRL+P to search for the filename and open it |
19:20:30 | NimEventer | New thread by dlesnoff: The Algorithms In Nim, see https://forum.nim-lang.org/t/9982 |
19:23:27 | PMunch | Ooh, that's fun |
19:23:53 | PMunch | Could be an interesting dataset for LOC counts as well :) |
19:38:57 | Zevv_ | how is that different from rosetta |
19:40:10 | * | rmt quit (Ping timeout: 276 seconds) |
19:46:35 | PMunch | Purely a focus on classic algorithms I guess |
19:49:46 | FromDiscord | <Nilts> How does my adapted npeg json parser look? |
19:49:55 | FromDiscord | <Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4qzj |
19:52:39 | Zevv_ | so, what are you using that for? |
19:52:46 | Zevv_ | Nim has better and faster json parsers :) |
19:53:18 | Zevv_ | early versions of NPeg used to have primitives to capture into Nim JSON objects |
19:53:33 | Zevv_ | so the json parser actually parsed and captured json. |
19:55:45 | FromDiscord | <Nilts> In reply to @Zevv_ "so, what are you": Just a test really, after i found that the example did not collect the data |
19:56:57 | FromDiscord | <Nilts> What is the go-to way to collect data in modern versions of npeg? |
19:57:31 | Zevv_ | well, the reason I dropped the JSon-node capturing is that I found that every parser has specific needs for just that |
19:57:40 | Zevv_ | parsing is fun and all, but what do you want to do with the data? |
19:57:58 | Zevv_ | so the default thing NPeg does for you is just stash it in a seq |
19:58:21 | Zevv_ | for anything else, it's up to you. You can pass your own data types to the match() proc and handle whatever you want to do in the code blocks |
19:58:26 | Zevv_ | which is basically what you are doing now |
19:58:44 | Zevv_ | I also mad parsers for a script like language that just execute the script straight away in the code blocsk |
19:58:54 | Zevv_ | so nothing is 'collected', as such. |
19:59:23 | Zevv_ | there is no single best way to do this, so npeg just hands you the tools and gets out of your way |
19:59:31 | FromDiscord | <Nilts> In reply to @Zevv_ "parsing is fun and": Usually, you want it in a tree structure. I used npeg to make my own programming language too, and i had to gather the syntax tree. |
19:59:57 | Zevv_ | well, *usually* might be true for parsing a programming language. |
20:00:40 | Zevv_ | but not for parsing SIP or RTSP data, GPS NMEA headers, SDP payload descriptions, M3U8 playlists, /etc/services, ini files and a tons of other things I have seen npeg used for |
20:00:47 | FromDiscord | <Nilts> yeah, i guess if you were parsing, for example, a csv, it would not matter. But what about more complicated things. |
20:01:06 | Zevv_ | look at the rod example, that's the most generic way how I usually do it |
20:01:09 | FromDiscord | <Nilts> (edit) "matter." => "be in tree format." |
20:01:14 | Zevv_ | I have some form of AST in sum types |
20:01:36 | Zevv_ | and I keep a little stack that the different matches operate on |
20:01:47 | Zevv_ | like 'parse an int and put it in the parent `kids` list` |
20:02:36 | Zevv_ | https://github.com/zevv/npeg/blob/master/misc/rod.nim |
20:03:12 | Zevv_ | this scheme feels most comfortable to me, and performs pretty wel |
20:04:42 | FromDiscord | <Nilts> what do you do when you finish parsing the parent? |
20:05:21 | Zevv_ | just leave it on the stack. If you have parsed a truly recursive grammar, the top level entry on your stack when you are done should contain everything |
20:05:40 | Zevv_ | if you have more then one top-level things in your source, these are just entries on the stack. |
20:05:46 | Zevv_ | it works out pretty nice. |
20:06:54 | FromDiscord | <Nilts> I guess that works |
20:07:36 | Zevv_ | it might, or might not, depending on what you're trying to do :) |
20:08:07 | Zevv_ | sometimes I keep two stacks and juggle with things. it just totally depends on what you're parsing and what you want to do. |
20:08:23 | Zevv_ | some things do well without having an AST or IR, you can just "do the work" inside the parser. |
20:08:45 | Zevv_ | the only gotcha is still that code blocks always run, even if they get backtracked. |
20:09:08 | FromDiscord | <Nilts> For me, if my parsing needs a tree result, I use my own utils lib, but if not I just use a seq. |
20:09:12 | Zevv_ | it's a common pitfall for which I still have no solution; but seeing that other peg parser generators have th esame issue, I'm not too ashamed of that. |
20:09:37 | FromDiscord | <Nilts> In reply to @Zevv_ "the only gotcha is": yeah, i have encountered that issue before, and it usually involves writing a non-collecting version for checks |
20:09:55 | FromDiscord | <Nilts> (edit) "version" => "versions" |
20:10:04 | Zevv_ | yeah, but it's still a bit of a pita. |
20:10:22 | Zevv_ | npeg *could* defer calling your code until it's sure |
20:10:29 | Zevv_ | but that gives totally different semantics |
20:10:45 | Zevv_ | so basically what I'd hope to find one day is a nice way to support both |
20:11:25 | FromDiscord | <Nilts> sounds like a good idea |
20:11:51 | Zevv_ | https://github.com/zevv/npeg/issues/14 |
20:15:28 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @planetis "it should emit #undef": Oh alright↵So what can I do for now? |
20:15:46 | FromDiscord | <Nilts> yeah, i saw that. Actually, the deprecated ast tree captures inspired me to make my own npeg util lib. |
20:15:54 | PMunch | Crap.. I need a mix of runeSubStr and an ANSI aware substring function.. |
20:16:53 | Zevv_ | Nilts: makes sense; if you come up with something consistent and reusable let me know |
20:18:04 | Zevv_ | PMunch: that's a common misconception. you do *not* need a mix of runeSubStr and an ANSI aware substring function |
20:18:11 | PMunch | Haha :P |
20:19:10 | PMunch | I have ANSI coloured braille characters in a string, and I want to print it out along with another string |
20:19:23 | PMunch | Filling the width of the terminal |
20:19:32 | FromDiscord | <Nilts> what defines "consistent"? |
20:19:44 | FromDiscord | <Nilts> in this case |
20:21:19 | Zevv_ | yeah, good question; bad formulation |
20:22:00 | Zevv_ | I mean something flexible that suits a lot of different cases. |
20:22:23 | Zevv_ | PMunch: we've all been there man. I feel for you. |
20:23:15 | FromDiscord | <Nilts> It suits alot of tree cases, but nothing else really. So i guess not consistent |
20:24:05 | Zevv_ | but still, if it provides something that makes working with ASTs simple and easy, it might come handy right |
20:24:12 | Zevv_ | PMunch: what are you *really* trying to do |
20:25:55 | PMunch | Zevv_, I'm trying to plot stuff from stdin. Take each number, colour them differently and draw them with drawille |
20:26:02 | FromDiscord | <Nilts> yeah. I was wondering if I should release it on nimble/make a forum post about it, but I don't know if it is useful enough. |
20:26:06 | PMunch | Then add a labels to the left |
20:27:31 | Zevv_ | PMunch: yeah, that's a pita; if you have a well defined set of ansi/vt100 codes it's not too hard to do, but afaik there is no 'generic' way of handling these escapes without implementing them all one by one |
20:27:51 | PMunch | Haven't you seen my ansiparse library ;) |
20:28:10 | Zevv_ | I sometimes hack stuff by just letting stuff wrap and then doing the next line at a fixed cursor pos, writing stuff followed by an 'erase to end of line' |
20:28:11 | PMunch | I mean this only deals with colour codes |
20:28:27 | PMunch | Ooh, that's indeed not a bad hack |
20:28:29 | Zevv_ | so just letting it spill and later cleaning up the mess. |
20:28:40 | PMunch | I want to drop the first N characters though |
20:28:43 | PMunch | Not the last.. |
20:28:49 | PMunch | Otherwise that would be perfect |
20:30:38 | Zevv_ | hmm |
20:31:35 | Zevv_ | I think you might need a mix of runeSubStr and an ANSI aware substring function |
20:32:45 | Zevv_ | if you can live with not using the top line |
20:33:05 | Zevv_ | you can go to one line above and N chars left of the screen width |
20:33:37 | Zevv_ | print your stuff, the first N chars ending up on the first line, the rest below that |
20:33:45 | Zevv_ | and build your screen bottom to top, erase the first line when done. |
20:35:26 | Zevv_ | renders you speechless eh |
20:35:30 | PMunch | Oh actually |
20:36:00 | PMunch | I could print out the whole thing, then move to first line first column, write my label, next line first column, write the next thing, etc. |
20:36:10 | PMunch | Just write the whole thing first, then write the labels on top |
20:36:32 | PMunch | Of course while we've been talking about this I've already implemented my ansi aware runeSubStr function.. |
20:37:15 | Zevv_ | then why did you come here whining about it in the first place |
20:37:25 | Zevv_ | you know where your towel is at |
20:37:57 | PMunch | Only problem now is that it's super flickery.. |
20:38:13 | PMunch | My terminal emulator apparently doesn't like drawing this many ANSI characters :P |
20:38:29 | Zevv_ | try syncing it with your saccades |
20:38:33 | Zevv_ | that hides the flickering |
20:38:51 | PMunch | Hmm, getSaccades isn't defined for my terminal.. |
20:39:01 | Zevv_ | dang |
20:39:30 | FromDiscord | <caravaggio> In reply to @Isofruit "Compile time should leave": Thanks man |
20:39:35 | Zevv_ | render to an offscreen buffer first |
20:39:42 | FromDiscord | <caravaggio> I was compiling from cmd directly |
20:39:46 | Zevv_ | and before you know it, you are reimplemnting curses |
20:39:56 | FromDiscord | <caravaggio> Instead of vs code terminal, hence why it wasn't click able |
20:40:51 | PMunch | Oh actually, since I'm drawing full lines I could just do `stdout.write` instead of echo |
20:41:03 | PMunch | And then throw a flushFile at the end |
20:41:24 | * | oprypin_ quit (*.net *.split) |
20:41:24 | * | joast quit (*.net *.split) |
20:41:24 | * | fallback quit (*.net *.split) |
20:41:25 | * | _________ quit (*.net *.split) |
20:41:25 | * | henrytill quit (*.net *.split) |
20:41:26 | * | noeontheend quit (*.net *.split) |
20:41:26 | * | leastrio quit (*.net *.split) |
20:41:26 | * | mronetwo quit (*.net *.split) |
20:41:34 | * | oprypin joined #nim |
20:43:50 | * | mronetwo joined #nim |
20:43:50 | * | leastrio joined #nim |
20:43:55 | Zevv_ | I find myself using less and less from the Nim stdlib and more building on std/posix |
20:43:57 | FromDiscord | <Phil> In reply to @caravaggio "I was compiling from": In that case, this may be useful to you:↵You can tell vscode to automatically compile whenever you save |
20:44:01 | Zevv_ | I don't want an echo that flushes, for example. |
20:44:03 | * | noeontheend joined #nim |
20:44:03 | * | henrytill joined #nim |
20:45:02 | * | _________ joined #nim |
20:45:19 | PMunch | Eh, for 90% of what I use echo for a flushing echo is fine |
20:45:36 | PMunch | If I need to reach for stdin.write for writing full-screen terminal applications I'm fine with that |
20:48:55 | * | fallback joined #nim |
20:50:01 | FromDiscord | <Livid> So, I'm trying to make a template that calls a function (given as an argument) and gives some explicit arguments, but also gives `varargs`. How would I do that? |
20:50:12 | FromDiscord | <Livid> sent a code paste, see https://play.nim-lang.org/#ix=4qzw |
20:51:53 | FromDiscord | <Livid> The problem with this is when you give no arguments for `args`, and when you do provide one or some, the args passed as a `varargs[untyped]`, rather being expanded. I need them to be expanded since the functions passed in do not take in `varargs` |
20:54:22 | PMunch | Hmm, new fun issue. The drawing code is slower than the rate I expect to get data |
20:54:59 | PMunch | So I need to read from stdin and store it, then update the screen as fast as possible.. |
20:56:11 | FromDiscord | <caravaggio> In reply to @Isofruit "In that case, this": Through configs! |
20:56:16 | FromDiscord | <caravaggio> (edit) "configs!" => "configs?" |
20:56:28 | FromDiscord | <caravaggio> I found the error but it's not making sense |
20:56:35 | FromDiscord | <caravaggio> It's saying connection refused |
20:56:48 | FromDiscord | <caravaggio> My other nim test app was opening ports at will |
20:57:00 | FromDiscord | <Phil> In reply to @caravaggio "Through configs?": Through a "tasks.json" file |
20:57:05 | FromDiscord | <caravaggio> I even manually opened the ports for this app and still srrors |
20:57:45 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qzz |
20:58:01 | FromDiscord | <Phil> with cwd being my project-folder that contains the nimble file |
20:58:56 | FromDiscord | <caravaggio> I see thanks |
20:59:00 | FromDiscord | <caravaggio> I'll try that |
20:59:02 | FromDiscord | <Phil> As for your error:↵None of us can read minds, posting a minimal example of the code that throws the erros + a copy paste of the error message helps 😛 |
20:59:06 | FromDiscord | <caravaggio> Wow I found my error |
20:59:15 | FromDiscord | <caravaggio> My fix I mean |
20:59:31 | FromDiscord | <caravaggio> I was being egotistical thinking I could slosh through nim |
20:59:38 | FromDiscord | <caravaggio> Turns out I didn't have the server running |
20:59:47 | FromDiscord | <caravaggio> 😂So my client couldn't connect |
20:59:58 | FromDiscord | <Phil> I have been told having the server running may be important for connecting to it |
21:00:03 | FromDiscord | <Phil> Not sure, may be a rumor 😛 |
21:01:36 | FromDiscord | <caravaggio> Always read documentation 😂 |
21:02:10 | FromDiscord | <caravaggio> When is such a cool concept in nim |
21:04:47 | FromDiscord | <Elegantbeef> Make a macro that calls the proc↵(@Livid) |
21:04:50 | FromDiscord | <Elegantbeef> It's the easiest thing to do |
21:10:49 | FromDiscord | <Livid> I haven't made a macro before, but I can take a stab at it |
21:13:24 | FromDiscord | <Hourglass [She/Her]> Not sure how I'm supposed to overlay an image with Pixie |
21:13:31 | FromDiscord | <Hourglass [She/Her]> Wait nvm |
21:14:57 | PMunch | I guess this would need threading.. |
21:15:31 | PMunch | Or wait, if I could read the buffered stdin I could just empty the buffer between each drawn frame |
21:15:42 | PMunch | Can I do that in Nim? |
21:27:01 | FromDiscord | <jtv> You can unbuffer stdin for sure. SetStdIoUnbuffered() |
21:27:32 | FromDiscord | <jtv> Or you can call down into the posix api to do it just for stdin |
21:27:44 | PMunch | Well I want it buffered |
21:28:06 | PMunch | Basically I'm reading from a pipe and displaying the data |
21:28:28 | PMunch | But displaying the data takes more time than the time between the samples I get over the pipe |
21:28:57 | PMunch | So I want to read all the buffered input, then draw it, then read all the newly buffered input, then draw that, etc. |
21:29:59 | FromDiscord | <jtv> Well, the OS still buffers it, “unbuffered” means non-line buffered |
21:30:20 | FromDiscord | <jtv> It’ll give you what’s available if unbuffered instead of blocking till a new line |
21:30:39 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4qzH |
21:30:42 | PMunch | Hmm, I guess I want a mix, because I need to read full lines.. |
21:30:52 | FromDiscord | <Hourglass [She/Her]> Seems like `nbPlugin` isn't defined in my code when compiling? |
21:31:11 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4qzI |
21:31:14 | FromDiscord | <Hourglass [She/Her]> Raises an error when compiling |
21:31:33 | FromDiscord | <jtv> The OS either will do “line buffered” or unbuffered, which is actually buffered in the sense that it doesn’t drop data |
21:32:28 | FromDiscord | <jtv> So you’re better off unbuffering and parsing lines yourself |
21:33:10 | FromDiscord | <Hourglass [She/Her]> Wait im just an idiot |
21:33:22 | FromDiscord | <Hourglass [She/Her]> when, not if |
21:34:04 | FromDiscord | <Hourglass [She/Her]> Uh how do I make it so Nimsuggest can pass that though |
21:34:11 | FromDiscord | <turbo> How can I force an install of a lib via git HEAD (or an update)? I need to update karax from the latest release to git HEAD at `https://github.com/karaxnim/karax` |
21:34:35 | FromDiscord | <turbo> (edit) "an" => "nimble to" | removed "of" | "via" => "at" |
21:34:46 | PMunch | nimble install karax#@head |
21:34:49 | PMunch | Or something like that |
21:35:30 | FromDiscord | <turbo> sent a code paste, see https://play.nim-lang.org/#ix=4qzM |
21:36:26 | PMunch | Have you read the nimble documentation? |
21:36:34 | PMunch | I'm pretty sure it says somewhere in there |
21:36:39 | FromDiscord | <turbo> Ah, it's `@#` not `#@` |
21:37:22 | FromDiscord | <turbo> Except it doesn't do what it's supposed to, it still does `Installing [email protected]` |
21:38:54 | FromDiscord | <Hourglass [She/Her]> Ah, nimcheck was getting defined |
21:39:08 | PMunch | I just tried `nimble install karax@#master` and it seems to work fine |
21:39:40 | FromDiscord | <Elegantbeef> Nimble does behave differently for devel vs. stable |
21:40:17 | FromDiscord | <turbo> Ah I see @Phil had the same problem: https://github.com/nim-lang/nimble/issues/1067 😄 |
21:41:03 | FromDiscord | <Elegantbeef> Yea fairly certain nimble's version fetching was changed, hell one is supposed to make a git tag per release now |
21:41:23 | PMunch | Wasn't that always the case @Elegantbeef? |
21:41:31 | FromDiscord | <Elegantbeef> Nope |
21:41:43 | PMunch | How else did it find the correct version? |
21:41:47 | FromDiscord | <Elegantbeef> Previously nimble was capable of looking at the nimble file to reason versions |
21:41:53 | PMunch | Huh |
21:42:29 | PMunch | But that means running the nimble file of each commit until it matches :S |
21:42:48 | FromDiscord | <turbo> `choosenim`ing back to stable to install and back again "worked" |
21:42:49 | FromDiscord | <Elegantbeef> Sure, but what's the point of the nimble version in a nimble file then? |
21:43:18 | FromDiscord | <Elegantbeef> It seems inane to have to `git tag` and to have a nimble file version |
21:44:13 | FromDiscord | <huantian> Tbh you should have both |
21:44:27 | FromDiscord | <Elegantbeef> I do not see why both |
21:44:35 | FromDiscord | <Elegantbeef> It's just another source of error in my view |
21:45:16 | FromDiscord | <Elegantbeef> Though I treat every commit as a version |
21:45:16 | FromDiscord | <Elegantbeef> So.... yea |
21:46:59 | FromDiscord | <Elegantbeef> Seems like i was wrong about nimble being able to fetch just by nimble file version |
21:47:07 | FromDiscord | <Elegantbeef> Could've sworn it worked before, guess i'm crazy |
21:48:57 | * | xet7 joined #nim |
21:51:49 | * | junaid_ quit (Remote host closed the connection) |
21:51:49 | * | junaid__ quit (Read error: Connection reset by peer) |
21:51:49 | * | junaid__1 quit (Remote host closed the connection) |
21:51:49 | * | junaid___ quit (Remote host closed the connection) |
21:57:23 | FromDiscord | <Elegantbeef> Well i guess so much for me properly semvering my repo, it's all a mess 😄 |
21:58:47 | * | xet7 quit (Remote host closed the connection) |
22:01:28 | * | xet7 joined #nim |
22:05:05 | FromDiscord | <AmjadHD> Why is `prev` declared with `{.cursor.}` in https://github.com/nim-lang/Nim/blob/46d2161c23c2aa1905571512b9a1ef7d61ae670e/lib/pure/collections/lists.nim#L71 |
22:05:28 | FromDiscord | <Elegantbeef> Cause it does not own the prev field |
22:06:05 | FromDiscord | <Elegantbeef> Cursor annotation is a similar to a weak reference in C++ |
22:07:06 | FromDiscord | <AmjadHD> In reply to @Elegantbeef "Cause it does not": Thanks. |
22:07:59 | FromDiscord | <Gumbercules> @ElegantBeef I think it's your turn to write a Nim book. |
22:08:25 | FromDiscord | <Yepoleb> you have been banned from the global conference for promoting data inconsistency |
22:08:38 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/codereuse.html Hey i have a few writeups |
22:08:43 | FromDiscord | <Elegantbeef> Nowhere near book worthy |
22:09:01 | FromDiscord | <Elegantbeef> Oh noes if only i didnt have to make a tag and tick a nimble file every single commit |
22:09:13 | FromDiscord | <Elegantbeef> But i'll write some code to rectify this |
22:09:31 | NimEventer | New thread by jpalomaki: Make Nim docker images official?, see https://forum.nim-lang.org/t/9983 |
22:09:34 | FromDiscord | <Gumbercules> Your homepage on mobile makes me want to gouge my eyes out of their sockets |
22:09:55 | FromDiscord | <AmjadHD> In reply to @Elegantbeef "Cause it does not": What would happen if I removed it. |
22:09:59 | FromDiscord | <Elegantbeef> Yea well i do not believe in mobile so kick rocks, or i just do not want to make a proper mobile site |
22:10:15 | FromDiscord | <Elegantbeef> Possibly a double free i do not know |
22:10:34 | FromDiscord | <Gumbercules> I don't believe in mobile either. So many land lines at my residence. |
22:10:56 | FromDiscord | <Gumbercules> In reply to @AmjadHD "What would happen if": You don't want to find out... |
22:11:13 | FromDiscord | <Elegantbeef> I mean i mostly joke, i do not browse the internet on a mobile device pretty much ever so I do not care too much |
22:11:43 | FromDiscord | <Gumbercules> Don't have a kid then. That's the only way I get my internet fix lately. |
22:12:16 | FromDiscord | <Elegantbeef> Telling an unemployed schmuck not to have a kid is just sound advice 😄 |
22:19:27 | FromDiscord | <Yepoleb> please reproduce |
22:20:03 | FromDiscord | <Yepoleb> nimble is definitely in my top 10 nim package managers |
22:25:32 | PMunch | Haha :P |
22:37:11 | FromDiscord | <Elegantbeef> Ehhh automated git tagging based off my nimble files! 😄 |
22:37:30 | FromDiscord | <Elegantbeef> https://github.com/beef331/micros/tags |
22:39:12 | PMunch | Don't we have channels in the stdlib any longer? |
22:39:39 | FromDiscord | <Elegantbeef> We do |
22:39:40 | FromDiscord | <Elegantbeef> `channels_builtin` now in the docs |
22:39:40 | FromDiscord | <Yepoleb> how did you automate it so quickly? |
22:40:00 | PMunch | Ah right |
22:40:17 | FromDiscord | <Elegantbeef> I wrote nim code |
22:40:24 | FromDiscord | <Elegantbeef> 😛 |
22:40:31 | * | Notxor quit (Remote host closed the connection) |
22:40:52 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4qA0 |
22:40:55 | FromDiscord | <Elegantbeef> It's 30 lines of code |
22:42:42 | FromDiscord | <Elegantbeef> There we go i now have tags for all my packages |
22:44:27 | FromDiscord | <Elegantbeef> Now i wonder how difficult it would be to automate this further using a github action or similar |
22:45:28 | FromDiscord | <huantian> you could probably do it with some bash scripting and github actions |
22:45:33 | FromDiscord | <huantian> but bash scripting is pain |
22:45:38 | FromDiscord | <Elegantbeef> What is this "bash" you speak of |
22:45:47 | FromDiscord | <huantian> it's what you do with your head |
22:46:56 | FromDiscord | <Elegantbeef> I am quite chuffed with how simple it was to get tags though |
22:47:13 | FromDiscord | <Elegantbeef> It does help that I religiously treat each commit as a new tag |
22:47:18 | FromDiscord | <Elegantbeef> well new version |
22:48:02 | FromDiscord | <AmjadHD> sent a long message, see http://ix.io/4qA4 |
22:48:49 | FromDiscord | <Elegantbeef> Nah it still kicks in since it's a cyclical type |
22:48:58 | FromDiscord | <Elegantbeef> The point of cursor is to not traverse the tree twice afaik |
22:49:23 | FromDiscord | <Elegantbeef> If you remove cursor the cycle collector sees two seperate fields which could be cyclical |
22:49:43 | FromDiscord | <Elegantbeef> But since it's an unowned reference it only has to collect downward instead of downward and upward |
22:50:38 | FromDiscord | <Elegantbeef> If you think about how a doubly linked list is used only next is important for GC |
22:51:03 | FromDiscord | <Elegantbeef> If you navigate to the bottom node in your cycle collection, why do you need to now navigate back to the first node |
22:52:18 | PMunch | Nice, chucked a bit of multi-threading at the problem and now everything appears to work fine :) |
22:53:16 | PMunch | Wait.. Why does this work.. |
22:53:33 | PMunch | I added a channel which sends information to a thread which just does the drawing part |
22:54:06 | PMunch | And then the main thread just reads stdin and passes "images" to the drawing thread |
22:54:17 | PMunch | I guess it just works because it kinda got twice as fast.. |
22:54:41 | PMunch | And a channel really isn't the right tool here, since I want the drawer to just grab the latest frame |
22:55:26 | PMunch | I guess a lock around a shared string is what I would need. But does that even work in Nim? |
22:55:43 | NimEventer | New thread by Naterlarsen: Windows Screen Capture Help, see https://forum.nim-lang.org/t/9984 |
22:56:25 | FromDiscord | <Elegantbeef> It does with orc/arc |
22:56:35 | PMunch | Really? |
22:56:50 | PMunch | I can just have a global variable which I protect with a lock and it will work? |
22:56:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qA5 |
22:57:07 | FromDiscord | <Elegantbeef> I mean heap memory is shared now |
22:57:07 | FromDiscord | <Elegantbeef> I guess you might need a `ref string` |
22:57:22 | FromDiscord | <Elegantbeef> You will need to do `{.cast(gcSafe).}:` around the global access |
22:57:36 | FromDiscord | <Elegantbeef> Since it's technically not gcsafe |
22:59:30 | FromDiscord | <Andreas> @ElegantBeef hi ho, is it possible to reference a macro-generated proc from regular code ? The macro creates a proc from a existing proc. I can access/reference that generated-proc from other macro-code, but not from 'regular-code ? Is there some bind/inject-magic possible ? |
23:03:14 | FromDiscord | <Elegantbeef> Of course it is, macros emit code where they're called |
23:04:00 | FromDiscord | <Elegantbeef> https://github.com/beef331/constructor/blob/master/src/constructor/constructor.nim#L4 for instance generates procedures is from https://github.com/beef331/constructor/blob/master/tests/tconstructor.nim#L11-L14 |
23:04:07 | PMunch | Nice, got it working on my first try |
23:04:15 | PMunch | Man, threading in Nim has gotten a lot easier |
23:04:25 | FromDiscord | <Elegantbeef> arc/orc are nice |
23:04:33 | FromDiscord | <Elegantbeef> Did you use the guard syntax though 😛 |
23:04:41 | PMunch | It would be super neat though if `withLock` could auto-detect the gcsafe cast condition |
23:04:44 | PMunch | Yup |
23:06:13 | FromDiscord | <huantian> I feel like gcsafe is in a very weird state rn lol |
23:07:41 | FromDiscord | <Elegantbeef> It is |
23:08:17 | FromDiscord | <Elegantbeef> The big thing with the RC's and `ref` is that you need to do `{.cursor.}` when accessing global references to prevent double frees |
23:08:17 | FromDiscord | <Elegantbeef> This especially is an issue with orc afaik |
23:21:11 | * | joast joined #nim |
23:30:51 | NimEventer | New thread by WizardUli: Difference between generics and templates, see https://forum.nim-lang.org/t/9985 |
23:36:24 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4qAb |
23:38:59 | FromDiscord | <Elegantbeef> Ok so what i generally say is "write out the human written version of what you want your macro to do" |
23:39:09 | FromDiscord | <Elegantbeef> In this case it's the version that you'd manually write |
23:41:19 | PMunch | Has `for i, data in myseq` stopped working for sequences? |
23:41:39 | FromDiscord | <Elegantbeef> Nope `pairs` still works implicitly |
23:41:51 | PMunch | Hmm, I just keep getting "wrong number of variables" |
23:42:11 | FromDiscord | <Elegantbeef> does `for i, data in mySeq.pairs` work? |
23:42:20 | PMunch | `for i, data in input.split():` |
23:42:49 | FromDiscord | <Andreas> In reply to @Elegantbeef "In this case it's": ic, the macro-transformations work perfectly. The thing i tried is to reference a macro-generated-proc from regular-code, from the same module. |
23:42:49 | PMunch | Uhm, it gets an "iterable[string]" |
23:43:00 | FromDiscord | <Elegantbeef> split is an iterator |
23:43:05 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/strutils.html#split.i%2Cstring%2Cchar%2Cint |
23:43:14 | FromDiscord | <Elegantbeef> `for i, data in enumerate input.split` |
23:43:32 | FromDiscord | <Elegantbeef> Are you using gensym for the proc name?↵(@Andreas) |
23:43:33 | PMunch | Huh? https://nim-lang.org/docs/strutils.html#split%2Cstring%2Cset%5Bchar%5D%2Cint |
23:43:51 | FromDiscord | <Elegantbeef> If you allow the procedure name to be gensym'd it is not accessbile any other way |
23:43:59 | FromDiscord | <Elegantbeef> Yes pmunc iterators \> procedures |
23:44:19 | FromDiscord | <Elegantbeef> Inside of a for loop iterators are preferred for good reason |
23:44:25 | PMunch | Aah |
23:44:26 | PMunch | I see |
23:44:35 | FromDiscord | <Elegantbeef> `for i, x in input.split()` is needlessly allocaty 😄 |
23:44:53 | PMunch | Well then iterable[string] should also have a pairs defined for it.. |
23:44:58 | FromDiscord | <Elegantbeef> it also allows free performance boosts from https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L5-L13 |
23:45:07 | PMunch | Because you wouldn't really need pairs anywhere else.. |
23:45:16 | FromDiscord | <Elegantbeef> What? |
23:45:29 | FromDiscord | <Elegantbeef> Honestly enumerate is just nicer |
23:45:39 | FromDiscord | <Elegantbeef> It's explicit and works on all iterators |
23:45:53 | PMunch | Where is enumerate found? |
23:46:02 | FromDiscord | <Elegantbeef> `std/enumerate` |
23:46:16 | FromDiscord | <Elegantbeef> It's a for loop macro which adds a counter |
23:46:34 | FromDiscord | <Elegantbeef> It's a better solution than a manual pairs variation for all types |
23:47:02 | FromDiscord | <Elegantbeef> also remember iterable[T] is not a real type, it's a hacked in type |
23:47:10 | FromDiscord | <Elegantbeef> You cannot write an iterator that takes it, only templates can actually use it |
23:47:31 | FromDiscord | <Andreas> In reply to @Elegantbeef "Are you using gensym": no, i use `newProc` |
23:47:40 | FromDiscord | <Elegantbeef> Andreas no clue how complicated the macro is, but share it |
23:47:55 | PMunch | Hmm, still think it shouldn't be required to use an import and type `enumerate` to add an index variable for your loop |
23:47:55 | FromDiscord | <Elegantbeef> This is much easier to find the issue then pulling teeth through question period |
23:48:20 | FromDiscord | <Elegantbeef> I mean it's not |
23:48:37 | FromDiscord | <Elegantbeef> I might be wrong but iterators i do think use return value inference |
23:48:56 | FromDiscord | <Elegantbeef> Actaully that's clearly wrong |
23:49:21 | FromDiscord | <Elegantbeef> since `for x in myIter()` and `for x, y in myIter()` both work with a tuple returning iterator |
23:50:02 | PMunch | I must say, I really love the fact that you can have an implicit return block with a break as one of the branches |
23:50:02 | FromDiscord | <Elegantbeef> I personally really find the use of enumerate quite nice, though i also write a shit load of iterators instead of procedures that return a collection |
23:50:25 | PMunch | Being able to do `let input = try: stdin.readLine except EOFError: break` is fantastic |
23:50:35 | FromDiscord | <Elegantbeef> Yep it's lovely |
23:50:47 | FromDiscord | <Elegantbeef> Speaking of break, this reminds me I should add that named iterator to slicerator |
23:50:52 | PMunch | Eh, I feel enumerate is just noise |
23:51:07 | PMunch | Haha, I thought you where going to say that you need a berak |
23:51:10 | PMunch | break even |
23:51:26 | FromDiscord | <Elegantbeef> I disagree given that it allows even things that do not yield something that would work with pairs it's lovely |
23:51:41 | FromDiscord | <Elegantbeef> The thing is pmunch `for x, y in z` is just a fancy tuple unpack |
23:51:55 | FromDiscord | <Elegantbeef> So you cannot distinguish between whether it's a tuple unpack or actually requesting a count |
23:52:19 | FromDiscord | <Elegantbeef> Unless you force `for (x, y)` for unpack and `for x, y` for count |
23:52:55 | FromDiscord | <Elegantbeef> But that'd require a change in the language |
23:53:02 | FromDiscord | <Elegantbeef> Ergo enumerate is lovely |
23:53:08 | PMunch | Well I'd be happy with a simple "do we have a pairs procedure, if not use enumerate" approach |
23:53:25 | FromDiscord | <Elegantbeef> But that's not always what you want |
23:53:33 | PMunch | And then you can force enumerate if you don't want to use the pairs thing |
23:53:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qAe |
23:53:49 | PMunch | When would I rather have my program not compile instead of giving me a count? |
23:54:01 | FromDiscord | <Elegantbeef> Right there |
23:54:13 | FromDiscord | <Elegantbeef> You want `x` and `y` to be the fields yielded from `doThing` |
23:54:18 | FromDiscord | <Elegantbeef> You do not want `y` to be a tuple |
23:54:19 | PMunch | Right |
23:54:44 | FromDiscord | <Elegantbeef> You do not want `x` to be a count |
23:54:59 | FromDiscord | <Elegantbeef> `for i, (x, y) in doThing()` would be fine for the implicit enumerate |
23:55:00 | PMunch | So the logic would be "does the iterator return something which can be unpacked? do we have pairs? if not use enumerate" |
23:55:45 | PMunch | Exactly, then you do that or `for i, myTuple in enumerate doThing():` if you want the count and the tuple but not the unpack |
23:56:35 | FromDiscord | <Elegantbeef> The way i see it though enumerate is the easiest and lowest cost solution 😄 |
23:57:18 | FromDiscord | <Elegantbeef> It already exists, does not change semantics of the language, and it works! |