<< 11-03-2023 >>

00:10:23*cyraxjoe quit (Ping timeout: 264 seconds)
00:10:34*cyraxjoe joined #nim
00:30:00*zgasma quit (Quit: leaving)
00:38:45FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4quE
00:48:04FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4quF
00:48:07FromDiscord<Nilts> please help
00:49:46FromDiscord<huantian> the last index in your string is `istr.len - 1`
00:49:58FromDiscord<huantian> so `istr.len - 2` will give you the second to last character
00:50:13FromDiscord<huantian> you can do `istr[^1]` to get the last character as well
00:51:20FromDiscord<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:01FromDiscord<Nilts> thanks btw
01:29:04FromDiscord<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:15NimEventerNew thread by Naterlarsen: Fstring and Split to Variable Error, see https://forum.nim-lang.org/t/9980
02:17:50FromDiscord<huantian> Elegantbeef can you fix the code in this thread too?
02:18:58FromDiscord<Elegantbeef> Uhhh i do not know what that code is since someone didnt write it properly 😛
02:19:51termerit 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:21FromDiscord<Elegantbeef> I mean the code isnt written in the forum post properly
02:20:31FromDiscord<Elegantbeef> It's lacking proper formatting
02:20:40FromDiscord<huantian> Use your imagination
02:22:00termerI'm joking around
02:22:25FromDiscord<Elegantbeef> Hey i know, but it's also some amount of non satirical commentary
02:22:46termerI assure you it's fully satirical
02:24:10termerif there's someone to antagonize about not helping people out, it would certainly not be you
02:24:17termeryou're here 24/7 somehow
02:25:04*lumo_e quit (Quit: Quit)
02:28:19FromDiscord<Rika> Nah he’s sometimes not here when I’m here
02:28:28FromDiscord<Rika> Then again people say I’m him so
02:34:04*derpydoo quit (Quit: derpydoo)
02:35:03FromDiscord<Elegantbeef> You're not me?!
02:35:07FromDiscord<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:06FromDiscord<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:03FromDiscord<Elegantbeef> It depends
04:59:02FromDiscord<Prestige> Can you elaborate? I'm confused why this is happening
05:00:41FromDiscord<Elegantbeef> How is the template declared, and how are you using it?
05:01:54FromDiscord<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:21FromDiscord<Prestige> Template is `template set(this: UIComponent, start, length: float)` and I'm using it like `child.set(0.3, 0.8)`
05:03:16FromDiscord<Elegantbeef> does it work with `set(child, 0.3, 0.8)`?
05:04:17FromDiscord<Prestige> still complains
05:04:38FromDiscord<Elegantbeef> Well it might be https://github.com/nim-lang/Nim/pull/21405/files
05:05:19FromDiscord<Elegantbeef> Or maybe https://github.com/nim-lang/Nim/commit/19dd56f018fdacebeaf6605e5915defc66d88d0f
05:05:31FromDiscord<Prestige> hmm 🤔
05:05:45FromDiscord<Elegantbeef> Luckily there are only 50 commits to bisect
05:06:14FromDiscord<Prestige> should I make a minpro and open an issue
05:06:28FromDiscord<Elegantbeef> You should just git bisect imo
05:06:38FromDiscord<Prestige> ok
05:06:40FromDiscord<Prestige> maybe
05:10:07FromDiscord<Elegantbeef> After you find the commit that causes it a min repro would be great
05:10:18FromDiscord<Elegantbeef> I might even take a look at it right now depending on the commit 😄
05:11:44FromDiscord<Prestige> I gotta look into building nim again lol
05:12:19FromDiscord<Elegantbeef> Clone the repo then `nim c ./koch` then you can do `./koch temp c ./mynim`
05:13:47FromDiscord<Prestige> `Error: cannot open file: std/paths`
05:13:57FromDiscord<Prestige> from nim c koch
05:14:26FromDiscord<Elegantbeef> Have you build Nim before from source?
05:14:28FromDiscord<Elegantbeef> If so clear your nim cache for koch
05:14:52FromDiscord<ringabout> Did you use the template `set` in a template?
05:15:09FromDiscord<Prestige> nah
05:16:40FromDiscord<ringabout> sent a code paste, see https://paste.rs/VC8
05:17:19FromDiscord<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:28FromDiscord<Elegantbeef> Jeez who'd have though Rust like enums would be simple if implemented like Rust does theirs 😄
07:01:44FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/fungus.nim#L194-L215 if anyone is curious
08:01:53*Notxor joined #nim
08:09:14FromDiscord<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:46FromDiscord<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:43FromDiscord<caravaggio> In nim why are single quotes used for escaping?
08:57:23FromDiscord<caravaggio> sent a code paste, see https://play.nim-lang.org/#ix=4qvZ
09:00:01FromDiscord<amadan> back ticks (`) are used for escaping
09:00:02FromDiscord<Phil> ?↵Backticks are used, not single quotes
09:00:26FromDiscord<amadan> This section in the manual talks about it https://nim-lang.org/docs/manual.html#lexical-analysis-keywords-as-identifiers
09:00:48FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qw3
09:40:15FromDiscord<Phil> Okay, question, are "Routers" a normal thing in native GUI applications as well or is that a frontend web framework concept?
09:42:26FromDiscord<Elegantbeef> I'd say that's very much a web thing, most GUI just use a basic state machine 😄
09:49:20FromDiscord<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:43FromDiscord<Elegantbeef> Depends on the program I guess
09:50:09FromDiscord<Elegantbeef> A stacked FSM is probably sufficient for most things
09:50:20FromDiscord<Phil> FSM?
09:50:28FromDiscord<Elegantbeef> Finite state machine
09:51:15FromDiscord<Elegantbeef> Clearly i havent done much GUI development so i should shush
09:52:43FromDiscord<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:55FromDiscord<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:12FromDiscord<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:34FromDiscord<Phil> (edit) "fetch data" => "trigger data-fetching that then happens either" | "trigger data-fetching that then happens eitherbefore ... showing" added "or while"
09:57:44FromDiscord<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:00FromDiscord<Phil> Though in webdev you'd have tons of different pages so eh
09:58:06FromDiscord<Elegantbeef> Yea native apps are way more strict
09:58:24FromDiscord<Elegantbeef> You do not have as much dynamism so it's easy and generally fine to limit it statically
09:58:45FromDiscord<Elegantbeef> Like blueman for instance is
09:58:46FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1084052791384875119/image.png
09:58:56FromDiscord<Elegantbeef> There literally is no reason for any page 😄
10:00:08FromDiscord<Elegantbeef> Atleast if a program follows the unix philosophy I do not think it needs any of what your mentioned
10:01:06FromDiscord<Elegantbeef> I do realise now i do not use many gui tools 😄
10:02:26FromDiscord<Elegantbeef> Obs studio, KdenLive, blueman, they all do not need any sort of pages, resolver, route guard
10:06:15FromDiscord<Phil> TBF they just launch a new window often times for stuff like settings
10:06:25FromDiscord<Phil> Which is kinda like a page
10:06:50FromDiscord<Elegantbeef> It's practically a self contained program that can access your programs information!
10:09:46FromDiscord<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:14FromDiscord<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:41FromDiscord<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:18FromDiscord<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:13FromDiscord<Elegantbeef> Do you not know what a FSM is?
10:17:14FromDiscord<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:21FromDiscord<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:48FromDiscord<jmgomez> (edit) "a" => "and"
10:17:52FromDiscord<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:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qwj
10:21:51FromDiscord<Elegantbeef> This can also be represented with more complex things like inheritance or pointer procedures
10:22:18FromDiscord<Phil> sent a long message, see http://ix.io/4qwk
10:22:55FromDiscord<Phil> Though I guess if you have limited views, having a "Back" button makes no sense anyway, making the point kinda moot
10:24:20FromDiscord<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:31FromDiscord<Phil> Ohhh not a static stack of all pages that exist, but a dynamic stack of pages you visisted
10:25:34FromDiscord<Phil> (edit) "visisted" => "visited"
10:25:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qwl
10:26:31FromDiscord<Elegantbeef> Yea i can see GUI on mobile using something like the above pseudo code for their 'pages'
10:26:46FromDiscord<Elegantbeef> Especially with nested navigation
10:27:39FromDiscord<Phil> I think on mobile its kinda mandatory, since all phones have a back button intrinsically
10:27:42FromDiscord<Elegantbeef> If the gui is stateful it also means that you get things like scroll progress and things like that for free
10:29:15FromDiscord<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:26FromDiscord<Elegantbeef> Though like i said most GUI programs i use do not have any odd navigation
10:29:40FromDiscord<Elegantbeef> I still stand by the whole "Do one thing well"
10:29:44FromDiscord<Phil> That's the reason why I was thinking about it
10:29:56FromDiscord<Phil> Because I pretty much have the entire window-body under a kind of navigation component
10:29:58FromDiscord<Phil> Got a page enum
10:30:07FromDiscord<Phil> Based on that enum I show one of my widgets
10:30:31FromDiscord<Phil> I was mostly contemplating whether that makes sense to have in a widget-library or not
10:30:32FromDiscord<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:01FromDiscord<Elegantbeef> A StackNavigator might be nice
10:31:48FromDiscord<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:12FromDiscord<Elegantbeef> This sicko using a `Table[enum, T]`
10:32:18FromDiscord<Elegantbeef> !ban phil
10:32:29FromDiscord<Phil> Could have a hidden `widgetStack` or something that you just push entries to as the route changes
10:32:42FromDiscord<Phil> Sorry, not route changes, as you re-navigate
10:33:04FromDiscord<Elegantbeef> `array[enum, T]` is right there my guy!
10:33:36FromDiscord<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:57FromDiscord<Phil> Not sure how you'd do a "back" thingy on that one though
10:34:12FromDiscord<Elegantbeef> Anyway i'm off so talk GUI with the wall
10:34:27FromDiscord<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:14NimEventerNew 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:44deadmarshal_Hi, how can I make a set of char from a string?
11:34:02*PMunch joined #nim
11:41:42FromDiscord<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:43FromDiscord<Phil> (edit) "`std/sequtils.toSeq" => "`std/sequtils.toSeq`"
11:42:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qwD
12:18:23FromDiscord<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:23deadmarshal_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:38FromDiscord<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:10FromDiscord<elvodqa> Which one is recently updated?
16:44:53FromDiscord<Yepoleb> In reply to @System64 "I want to try": @planetis always shills his 😄
16:45:25FromDiscord<planetis> that's right, that's right
16:45:42FromDiscord<planetis> I should do an advertisement with a pornstar next
16:45:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @Yepoleb "<@915614219364368394> always shills his": wdym?
16:46:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @elvodqa "Which one is recently": The third one, then the first one, then the second one
16:48:01FromDiscord<Yepoleb> In reply to @System64 "wdym?": planetis likes to praise his version, but i have not tried any
16:48:33FromDiscord<elvodqa> In reply to @System64 "The third one, then": Naylib seems really good
16:48:39FromDiscord<elvodqa> Go for it
16:49:24FromDiscord<Yepoleb> you probably can't go wrong with either nimraylib_now or naylib
16:49:56NimEventerNew post on r/nim by Xar94: Excel and Nim, see https://reddit.com/r/nim/comments/11oot9o/excel_and_nim/
17:05:34FromDiscord<System64 ~ Flandre Scarlet> What is the latest Nim version?
17:06:53FromDiscord<planetis> In reply to @System64 "What is the latest": v1.6.12
17:07:03FromDiscord<planetis> In reply to @elvodqa "Naylib seems really good": thanks for the kind words!
17:07:44FromDiscord<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:31FromDiscord<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:15FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qyn
17:10:24FromDiscord<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:12FromDiscord<System64 ~ Flandre Scarlet> wtf puppy 2.0.3 is already installed????
17:12:18FromDiscord<System64 ~ Flandre Scarlet> That doesn't make sense?? https://media.discordapp.net/attachments/371759389889003532/1084161892106371194/message.txt
17:13:34FromDiscord<auxym> you probably have some version conflict, ie one package requires puppy < 2.0 and the other requires puppy >= 2.0
17:14:27FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "you probably have some": So what should I do?
17:15:18FromDiscord<auxym> I don't know, does nimble have any debugging option like printing out the full dependency tree?
17:15:55FromDiscord<auxym> Otherwise you'll have to look at your dependencies (including transitive) one-by-one to find the ones that require puppy
17:16:14FromDiscord<System64 ~ Flandre Scarlet> Oh my god pain
17:16:30FromDiscord<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:45FromDiscord<System64 ~ Flandre Scarlet> and is there a pre-built version of choosenim?
17:17:39FromDiscord<System64 ~ Flandre Scarlet> I have both so what's the problem?? https://media.discordapp.net/attachments/371759389889003532/1084163237492305937/image.png
17:17:48FromDiscord<auxym> windows, yes, IIRC. not sure for linux, I have it installed via AUR (so built from source)
17:18:20FromDiscord<auxym> yeah but I don't think nim/nimble supports compiling against two different versions of a same package
17:19:59FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qyu
17:20:12FromDiscord<System64 ~ Flandre Scarlet> Why tf does it need BOTH versions??
17:22:49FromDiscord<planetis> you can open nimbledata.json from your nimble directory
17:23:01FromDiscord<System64 ~ Flandre Scarlet> I installed from the exe
17:23:10FromDiscord<System64 ~ Flandre Scarlet> can I switch to Nim 2 with that?
17:23:39FromDiscord<planetis> what exe?
17:24:08FromDiscord<System64 ~ Flandre Scarlet> https://github.com/dom96/choosenim/releases/tag/v0.8.4↵That
17:24:16FromDiscord<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:36FromDiscord<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:09FromDiscord<planetis> wtf did he casually changed the license to BSD?
17:28:43FromDiscord<System64 ~ Flandre Scarlet> wdym?
17:29:21FromDiscord<planetis> of choosenim
17:29:30FromDiscord<turbo> how do I escape `{` in a `&""`?
17:30:56FromDiscord<planetis> oh it was always BSD, just fixed the .nimble file
17:31:07FromDiscord<System64 ~ Flandre Scarlet> Finally I installed naylib
17:36:09FromDiscord<exelotl> In reply to @turbo "how do I escape": I think you do it like `{{`
17:36:48FromDiscord<turbo> In reply to @exelotl "I think you do": Ah yes that works. Was worried because it breaks syntax highlighting in VSCode
17:38:46FromDiscord<System64 ~ Flandre Scarlet> @planetis is it normal? https://media.discordapp.net/attachments/371759389889003532/1084168551365095454/message.txt
17:40:33FromDiscord<System64 ~ Flandre Scarlet> https://github.com/planetis-m/raylib-examples/blob/main/core/basic_window.nim↵I copied this sample
17:42:39FromDiscord<planetis> damn, no I couldn't reproduce in the vm but I know what it is
17:43:38FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qyE
17:43:52FromDiscord<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:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @planetis "from where did you": Nim is supposed to use the mingw bundled with Nim
17:44:58FromDiscord<System64 ~ Flandre Scarlet> and now it didn't found GCC??? WTF??↵I used Choosenim
17:45:08FromDiscord<System64 ~ Flandre Scarlet> so it should be bundled?
17:45:41FromDiscord<planetis> no, its a separate archive, you need to have both in the path
17:46:21FromDiscord<planetis> no idea if nim is supposed to use that specific mingw from the download page for windows
17:47:11FromDiscord<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:11FromDiscord<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:10FromDiscord<System64 ~ Flandre Scarlet> WTF
17:54:04FromDiscord<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:44FromDiscord<System64 ~ Flandre Scarlet> And where should I put this mingw? I don't want to conflict with others ones
17:55:20FromDiscord<planetis> Can you build the raylib static library without errors btw? https://github.com/raysan5/raylib/wiki/Working-on-Windows
17:55:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @planetis "Can you build the": I never tried, why?
17:56:22FromDiscord<planetis> In reply to @System64 "And where should I": because I am curious if it's nim specific error
17:59:03FromDiscord<planetis> Don't bother nim must include windows.h somewhere in system. But
18:00:11FromDiscord<planetis> that archive must have a slimmed down version of windows.h that doesn't include wingdi.h
18:00:39FromDiscord<System64 ~ Flandre Scarlet> That's confusing :/
18:01:05FromDiscord<planetis> i just inferred in from the error message
18:02:17FromDiscord<planetis> it's a wild guess but it might be related to -DWIN32_LEAN_AND_MEAN
18:02:50FromDiscord<System64 ~ Flandre Scarlet> what does it mean?
18:04:17FromDiscord<System64 ~ Flandre Scarlet> I generated the lib through official raylib repo https://media.discordapp.net/attachments/371759389889003532/1084174973511405578/image.png
18:04:43FromDiscord<planetis> that's a C define passed in the command line and has an #ifndef WIN32_LEAN_AND_MEAN in windows.h
18:05:14FromDiscord<planetis> can you gist C:/msys64/mingw64/include/windows.h please?
18:05:24FromDiscord<planetis> need to compare them
18:06:08FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/1084175437724405760/windows.h
18:07:38FromDiscord<planetis> nope they are exactly the same
18:07:51FromDiscord<System64 ~ Flandre Scarlet> sus
18:08:24FromDiscord<System64 ~ Flandre Scarlet> This is so weird↵So this is not windows.h
18:11:35FromDiscord<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:54FromDiscord<System64 ~ Flandre Scarlet> So I need to put them?
18:14:03FromDiscord<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:59FromDiscord<planetis> If that doesn't work I go the route of mangling the Rectangle names in the raylib.h unfortunately.
18:15:38FromDiscord<System64 ~ Flandre Scarlet> In reply to @planetis "Can you try extracting": Wdym? The archive from Nim?
18:16:48FromDiscord<planetis> https://nim-lang.org/install_windows.html mingw64.7z
18:17:15FromDiscord<System64 ~ Flandre Scarlet> I downloaded this one
18:24:42FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=4qyX
18:25:11FromDiscord<planetis> and if it works I will push a fix in naylib immediately
18:26:35FromDiscord<planetis> and I am sorry for the trouble I put you into today, I hope it's worth it
18:31:09FromDiscord<planetis> hmm it might not work
18:31:45FromDiscord<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:43FromDiscord<System64 ~ Flandre Scarlet> what is your idea?
18:41:15*junaid__1 joined #nim
18:44:17FromDiscord<planetis> it's again related to emit, so all wrappers have an issue with the order of includes
18:44:57FromDiscord<planetis> sometimes #include "raymath.h" is generated before #include "raylib.h"
18:45:45FromDiscord<planetis> hopefully I might be able to fix those issues by not using the .header pragma at all
18:47:05FromDiscord<planetis> it should emit #undef Rectangle then #include "raylib.h"
18:47:21FromDiscord<planetis> that's it
18:54:59FromDiscord<Coachonko> If I pass a table to a function, is it passed by reference?
18:55:53FromDiscord<Coachonko> And if they are passed by reference, is there a deep copy proc?
19:08:07FromDiscord<caravaggio> How do I navigate to the file where a Proc raised an error?
19:08:35FromDiscord<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:48FromDiscord<Phil> In reply to @caravaggio "How do I navigate": Runtime error or compile time error?
19:12:59FromDiscord<Phil> Compile time should leave a clickable link in the vscode terminal
19:13:28FromDiscord<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:30NimEventerNew thread by dlesnoff: The Algorithms In Nim, see https://forum.nim-lang.org/t/9982
19:23:27PMunchOoh, that's fun
19:23:53PMunchCould be an interesting dataset for LOC counts as well :)
19:38:57Zevv_how is that different from rosetta
19:40:10*rmt quit (Ping timeout: 276 seconds)
19:46:35PMunchPurely a focus on classic algorithms I guess
19:49:46FromDiscord<Nilts> How does my adapted npeg json parser look?
19:49:55FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4qzj
19:52:39Zevv_so, what are you using that for?
19:52:46Zevv_Nim has better and faster json parsers :)
19:53:18Zevv_early versions of NPeg used to have primitives to capture into Nim JSON objects
19:53:33Zevv_so the json parser actually parsed and captured json.
19:55:45FromDiscord<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:57FromDiscord<Nilts> What is the go-to way to collect data in modern versions of npeg?
19:57:31Zevv_well, the reason I dropped the JSon-node capturing is that I found that every parser has specific needs for just that
19:57:40Zevv_parsing is fun and all, but what do you want to do with the data?
19:57:58Zevv_so the default thing NPeg does for you is just stash it in a seq
19:58:21Zevv_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:26Zevv_which is basically what you are doing now
19:58:44Zevv_I also mad parsers for a script like language that just execute the script straight away in the code blocsk
19:58:54Zevv_so nothing is 'collected', as such.
19:59:23Zevv_there is no single best way to do this, so npeg just hands you the tools and gets out of your way
19:59:31FromDiscord<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:57Zevv_well, *usually* might be true for parsing a programming language.
20:00:40Zevv_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:47FromDiscord<Nilts> yeah, i guess if you were parsing, for example, a csv, it would not matter. But what about more complicated things.
20:01:06Zevv_look at the rod example, that's the most generic way how I usually do it
20:01:09FromDiscord<Nilts> (edit) "matter." => "be in tree format."
20:01:14Zevv_I have some form of AST in sum types
20:01:36Zevv_and I keep a little stack that the different matches operate on
20:01:47Zevv_like 'parse an int and put it in the parent `kids` list`
20:02:36Zevv_https://github.com/zevv/npeg/blob/master/misc/rod.nim
20:03:12Zevv_this scheme feels most comfortable to me, and performs pretty wel
20:04:42FromDiscord<Nilts> what do you do when you finish parsing the parent?
20:05:21Zevv_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:40Zevv_if you have more then one top-level things in your source, these are just entries on the stack.
20:05:46Zevv_it works out pretty nice.
20:06:54FromDiscord<Nilts> I guess that works
20:07:36Zevv_it might, or might not, depending on what you're trying to do :)
20:08:07Zevv_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:23Zevv_some things do well without having an AST or IR, you can just "do the work" inside the parser.
20:08:45Zevv_the only gotcha is still that code blocks always run, even if they get backtracked.
20:09:08FromDiscord<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:12Zevv_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:37FromDiscord<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:55FromDiscord<Nilts> (edit) "version" => "versions"
20:10:04Zevv_yeah, but it's still a bit of a pita.
20:10:22Zevv_npeg *could* defer calling your code until it's sure
20:10:29Zevv_but that gives totally different semantics
20:10:45Zevv_so basically what I'd hope to find one day is a nice way to support both
20:11:25FromDiscord<Nilts> sounds like a good idea
20:11:51Zevv_https://github.com/zevv/npeg/issues/14
20:15:28FromDiscord<System64 ~ Flandre Scarlet> In reply to @planetis "it should emit #undef": Oh alright↵So what can I do for now?
20:15:46FromDiscord<Nilts> yeah, i saw that. Actually, the deprecated ast tree captures inspired me to make my own npeg util lib.
20:15:54PMunchCrap.. I need a mix of runeSubStr and an ANSI aware substring function..
20:16:53Zevv_Nilts: makes sense; if you come up with something consistent and reusable let me know
20:18:04Zevv_PMunch: that's a common misconception. you do *not* need a mix of runeSubStr and an ANSI aware substring function
20:18:11PMunchHaha :P
20:19:10PMunchI have ANSI coloured braille characters in a string, and I want to print it out along with another string
20:19:23PMunchFilling the width of the terminal
20:19:32FromDiscord<Nilts> what defines "consistent"?
20:19:44FromDiscord<Nilts> in this case
20:21:19Zevv_yeah, good question; bad formulation
20:22:00Zevv_I mean something flexible that suits a lot of different cases.
20:22:23Zevv_PMunch: we've all been there man. I feel for you.
20:23:15FromDiscord<Nilts> It suits alot of tree cases, but nothing else really. So i guess not consistent
20:24:05Zevv_but still, if it provides something that makes working with ASTs simple and easy, it might come handy right
20:24:12Zevv_PMunch: what are you *really* trying to do
20:25:55PMunchZevv_, I'm trying to plot stuff from stdin. Take each number, colour them differently and draw them with drawille
20:26:02FromDiscord<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:06PMunchThen add a labels to the left
20:27:31Zevv_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:51PMunchHaven't you seen my ansiparse library ;)
20:28:10Zevv_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:11PMunchI mean this only deals with colour codes
20:28:27PMunchOoh, that's indeed not a bad hack
20:28:29Zevv_so just letting it spill and later cleaning up the mess.
20:28:40PMunchI want to drop the first N characters though
20:28:43PMunchNot the last..
20:28:49PMunchOtherwise that would be perfect
20:30:38Zevv_hmm
20:31:35Zevv_I think you might need a mix of runeSubStr and an ANSI aware substring function
20:32:45Zevv_if you can live with not using the top line
20:33:05Zevv_you can go to one line above and N chars left of the screen width
20:33:37Zevv_print your stuff, the first N chars ending up on the first line, the rest below that
20:33:45Zevv_and build your screen bottom to top, erase the first line when done.
20:35:26Zevv_renders you speechless eh
20:35:30PMunchOh actually
20:36:00PMunchI 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:10PMunchJust write the whole thing first, then write the labels on top
20:36:32PMunchOf course while we've been talking about this I've already implemented my ansi aware runeSubStr function..
20:37:15Zevv_then why did you come here whining about it in the first place
20:37:25Zevv_you know where your towel is at
20:37:57PMunchOnly problem now is that it's super flickery..
20:38:13PMunchMy terminal emulator apparently doesn't like drawing this many ANSI characters :P
20:38:29Zevv_try syncing it with your saccades
20:38:33Zevv_that hides the flickering
20:38:51PMunchHmm, getSaccades isn't defined for my terminal..
20:39:01Zevv_dang
20:39:30FromDiscord<caravaggio> In reply to @Isofruit "Compile time should leave": Thanks man
20:39:35Zevv_render to an offscreen buffer first
20:39:42FromDiscord<caravaggio> I was compiling from cmd directly
20:39:46Zevv_and before you know it, you are reimplemnting curses
20:39:56FromDiscord<caravaggio> Instead of vs code terminal, hence why it wasn't click able
20:40:51PMunchOh actually, since I'm drawing full lines I could just do `stdout.write` instead of echo
20:41:03PMunchAnd 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:55Zevv_I find myself using less and less from the Nim stdlib and more building on std/posix
20:43:57FromDiscord<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:01Zevv_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:19PMunchEh, for 90% of what I use echo for a flushing echo is fine
20:45:36PMunchIf 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:01FromDiscord<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:12FromDiscord<Livid> sent a code paste, see https://play.nim-lang.org/#ix=4qzw
20:51:53FromDiscord<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:22PMunchHmm, new fun issue. The drawing code is slower than the rate I expect to get data
20:54:59PMunchSo I need to read from stdin and store it, then update the screen as fast as possible..
20:56:11FromDiscord<caravaggio> In reply to @Isofruit "In that case, this": Through configs!
20:56:16FromDiscord<caravaggio> (edit) "configs!" => "configs?"
20:56:28FromDiscord<caravaggio> I found the error but it's not making sense
20:56:35FromDiscord<caravaggio> It's saying connection refused
20:56:48FromDiscord<caravaggio> My other nim test app was opening ports at will
20:57:00FromDiscord<Phil> In reply to @caravaggio "Through configs?": Through a "tasks.json" file
20:57:05FromDiscord<caravaggio> I even manually opened the ports for this app and still srrors
20:57:45FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qzz
20:58:01FromDiscord<Phil> with cwd being my project-folder that contains the nimble file
20:58:56FromDiscord<caravaggio> I see thanks
20:59:00FromDiscord<caravaggio> I'll try that
20:59:02FromDiscord<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:06FromDiscord<caravaggio> Wow I found my error
20:59:15FromDiscord<caravaggio> My fix I mean
20:59:31FromDiscord<caravaggio> I was being egotistical thinking I could slosh through nim
20:59:38FromDiscord<caravaggio> Turns out I didn't have the server running
20:59:47FromDiscord<caravaggio> 😂So my client couldn't connect
20:59:58FromDiscord<Phil> I have been told having the server running may be important for connecting to it
21:00:03FromDiscord<Phil> Not sure, may be a rumor 😛
21:01:36FromDiscord<caravaggio> Always read documentation 😂
21:02:10FromDiscord<caravaggio> When is such a cool concept in nim
21:04:47FromDiscord<Elegantbeef> Make a macro that calls the proc↵(@Livid)
21:04:50FromDiscord<Elegantbeef> It's the easiest thing to do
21:10:49FromDiscord<Livid> I haven't made a macro before, but I can take a stab at it
21:13:24FromDiscord<Hourglass [She/Her]> Not sure how I'm supposed to overlay an image with Pixie
21:13:31FromDiscord<Hourglass [She/Her]> Wait nvm
21:14:57PMunchI guess this would need threading..
21:15:31PMunchOr wait, if I could read the buffered stdin I could just empty the buffer between each drawn frame
21:15:42PMunchCan I do that in Nim?
21:27:01FromDiscord<jtv> You can unbuffer stdin for sure. SetStdIoUnbuffered()
21:27:32FromDiscord<jtv> Or you can call down into the posix api to do it just for stdin
21:27:44PMunchWell I want it buffered
21:28:06PMunchBasically I'm reading from a pipe and displaying the data
21:28:28PMunchBut displaying the data takes more time than the time between the samples I get over the pipe
21:28:57PMunchSo I want to read all the buffered input, then draw it, then read all the newly buffered input, then draw that, etc.
21:29:59FromDiscord<jtv> Well, the OS still buffers it, “unbuffered” means non-line buffered
21:30:20FromDiscord<jtv> It’ll give you what’s available if unbuffered instead of blocking till a new line
21:30:39FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4qzH
21:30:42PMunchHmm, I guess I want a mix, because I need to read full lines..
21:30:52FromDiscord<Hourglass [She/Her]> Seems like `nbPlugin` isn't defined in my code when compiling?
21:31:11FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4qzI
21:31:14FromDiscord<Hourglass [She/Her]> Raises an error when compiling
21:31:33FromDiscord<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:28FromDiscord<jtv> So you’re better off unbuffering and parsing lines yourself
21:33:10FromDiscord<Hourglass [She/Her]> Wait im just an idiot
21:33:22FromDiscord<Hourglass [She/Her]> when, not if
21:34:04FromDiscord<Hourglass [She/Her]> Uh how do I make it so Nimsuggest can pass that though
21:34:11FromDiscord<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:35FromDiscord<turbo> (edit) "an" => "nimble to" | removed "of" | "via" => "at"
21:34:46PMunchnimble install karax#@head
21:34:49PMunchOr something like that
21:35:30FromDiscord<turbo> sent a code paste, see https://play.nim-lang.org/#ix=4qzM
21:36:26PMunchHave you read the nimble documentation?
21:36:34PMunchI'm pretty sure it says somewhere in there
21:36:39FromDiscord<turbo> Ah, it's `@#` not `#@`
21:37:22FromDiscord<turbo> Except it doesn't do what it's supposed to, it still does `Installing [email protected]`
21:38:54FromDiscord<Hourglass [She/Her]> Ah, nimcheck was getting defined
21:39:08PMunchI just tried `nimble install karax@#master` and it seems to work fine
21:39:40FromDiscord<Elegantbeef> Nimble does behave differently for devel vs. stable
21:40:17FromDiscord<turbo> Ah I see @Phil had the same problem: https://github.com/nim-lang/nimble/issues/1067 😄
21:41:03FromDiscord<Elegantbeef> Yea fairly certain nimble's version fetching was changed, hell one is supposed to make a git tag per release now
21:41:23PMunchWasn't that always the case @Elegantbeef?
21:41:31FromDiscord<Elegantbeef> Nope
21:41:43PMunchHow else did it find the correct version?
21:41:47FromDiscord<Elegantbeef> Previously nimble was capable of looking at the nimble file to reason versions
21:41:53PMunchHuh
21:42:29PMunchBut that means running the nimble file of each commit until it matches :S
21:42:48FromDiscord<turbo> `choosenim`ing back to stable to install and back again "worked"
21:42:49FromDiscord<Elegantbeef> Sure, but what's the point of the nimble version in a nimble file then?
21:43:18FromDiscord<Elegantbeef> It seems inane to have to `git tag` and to have a nimble file version
21:44:13FromDiscord<huantian> Tbh you should have both
21:44:27FromDiscord<Elegantbeef> I do not see why both
21:44:35FromDiscord<Elegantbeef> It's just another source of error in my view
21:45:16FromDiscord<Elegantbeef> Though I treat every commit as a version
21:45:16FromDiscord<Elegantbeef> So.... yea
21:46:59FromDiscord<Elegantbeef> Seems like i was wrong about nimble being able to fetch just by nimble file version
21:47:07FromDiscord<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:23FromDiscord<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:05FromDiscord<AmjadHD> Why is `prev` declared with `{.cursor.}` in https://github.com/nim-lang/Nim/blob/46d2161c23c2aa1905571512b9a1ef7d61ae670e/lib/pure/collections/lists.nim#L71
22:05:28FromDiscord<Elegantbeef> Cause it does not own the prev field
22:06:05FromDiscord<Elegantbeef> Cursor annotation is a similar to a weak reference in C++
22:07:06FromDiscord<AmjadHD> In reply to @Elegantbeef "Cause it does not": Thanks.
22:07:59FromDiscord<Gumbercules> @ElegantBeef I think it's your turn to write a Nim book.
22:08:25FromDiscord<Yepoleb> you have been banned from the global conference for promoting data inconsistency
22:08:38FromDiscord<Elegantbeef> https://www.jasonbeetham.com/codereuse.html Hey i have a few writeups
22:08:43FromDiscord<Elegantbeef> Nowhere near book worthy
22:09:01FromDiscord<Elegantbeef> Oh noes if only i didnt have to make a tag and tick a nimble file every single commit
22:09:13FromDiscord<Elegantbeef> But i'll write some code to rectify this
22:09:31NimEventerNew thread by jpalomaki: Make Nim docker images official?, see https://forum.nim-lang.org/t/9983
22:09:34FromDiscord<Gumbercules> Your homepage on mobile makes me want to gouge my eyes out of their sockets
22:09:55FromDiscord<AmjadHD> In reply to @Elegantbeef "Cause it does not": What would happen if I removed it.
22:09:59FromDiscord<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:15FromDiscord<Elegantbeef> Possibly a double free i do not know
22:10:34FromDiscord<Gumbercules> I don't believe in mobile either. So many land lines at my residence.
22:10:56FromDiscord<Gumbercules> In reply to @AmjadHD "What would happen if": You don't want to find out...
22:11:13FromDiscord<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:43FromDiscord<Gumbercules> Don't have a kid then. That's the only way I get my internet fix lately.
22:12:16FromDiscord<Elegantbeef> Telling an unemployed schmuck not to have a kid is just sound advice 😄
22:19:27FromDiscord<Yepoleb> please reproduce
22:20:03FromDiscord<Yepoleb> nimble is definitely in my top 10 nim package managers
22:25:32PMunchHaha :P
22:37:11FromDiscord<Elegantbeef> Ehhh automated git tagging based off my nimble files! 😄
22:37:30FromDiscord<Elegantbeef> https://github.com/beef331/micros/tags
22:39:12PMunchDon't we have channels in the stdlib any longer?
22:39:39FromDiscord<Elegantbeef> We do
22:39:40FromDiscord<Elegantbeef> `channels_builtin` now in the docs
22:39:40FromDiscord<Yepoleb> how did you automate it so quickly?
22:40:00PMunchAh right
22:40:17FromDiscord<Elegantbeef> I wrote nim code
22:40:24FromDiscord<Elegantbeef> 😛
22:40:31*Notxor quit (Remote host closed the connection)
22:40:52FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4qA0
22:40:55FromDiscord<Elegantbeef> It's 30 lines of code
22:42:42FromDiscord<Elegantbeef> There we go i now have tags for all my packages
22:44:27FromDiscord<Elegantbeef> Now i wonder how difficult it would be to automate this further using a github action or similar
22:45:28FromDiscord<huantian> you could probably do it with some bash scripting and github actions
22:45:33FromDiscord<huantian> but bash scripting is pain
22:45:38FromDiscord<Elegantbeef> What is this "bash" you speak of
22:45:47FromDiscord<huantian> it's what you do with your head
22:46:56FromDiscord<Elegantbeef> I am quite chuffed with how simple it was to get tags though
22:47:13FromDiscord<Elegantbeef> It does help that I religiously treat each commit as a new tag
22:47:18FromDiscord<Elegantbeef> well new version
22:48:02FromDiscord<AmjadHD> sent a long message, see http://ix.io/4qA4
22:48:49FromDiscord<Elegantbeef> Nah it still kicks in since it's a cyclical type
22:48:58FromDiscord<Elegantbeef> The point of cursor is to not traverse the tree twice afaik
22:49:23FromDiscord<Elegantbeef> If you remove cursor the cycle collector sees two seperate fields which could be cyclical
22:49:43FromDiscord<Elegantbeef> But since it's an unowned reference it only has to collect downward instead of downward and upward
22:50:38FromDiscord<Elegantbeef> If you think about how a doubly linked list is used only next is important for GC
22:51:03FromDiscord<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:18PMunchNice, chucked a bit of multi-threading at the problem and now everything appears to work fine :)
22:53:16PMunchWait.. Why does this work..
22:53:33PMunchI added a channel which sends information to a thread which just does the drawing part
22:54:06PMunchAnd then the main thread just reads stdin and passes "images" to the drawing thread
22:54:17PMunchI guess it just works because it kinda got twice as fast..
22:54:41PMunchAnd a channel really isn't the right tool here, since I want the drawer to just grab the latest frame
22:55:26PMunchI guess a lock around a shared string is what I would need. But does that even work in Nim?
22:55:43NimEventerNew thread by Naterlarsen: Windows Screen Capture Help, see https://forum.nim-lang.org/t/9984
22:56:25FromDiscord<Elegantbeef> It does with orc/arc
22:56:35PMunchReally?
22:56:50PMunchI can just have a global variable which I protect with a lock and it will work?
22:56:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qA5
22:57:07FromDiscord<Elegantbeef> I mean heap memory is shared now
22:57:07FromDiscord<Elegantbeef> I guess you might need a `ref string`
22:57:22FromDiscord<Elegantbeef> You will need to do `{.cast(gcSafe).}:` around the global access
22:57:36FromDiscord<Elegantbeef> Since it's technically not gcsafe
22:59:30FromDiscord<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:14FromDiscord<Elegantbeef> Of course it is, macros emit code where they're called
23:04:00FromDiscord<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:07PMunchNice, got it working on my first try
23:04:15PMunchMan, threading in Nim has gotten a lot easier
23:04:25FromDiscord<Elegantbeef> arc/orc are nice
23:04:33FromDiscord<Elegantbeef> Did you use the guard syntax though 😛
23:04:41PMunchIt would be super neat though if `withLock` could auto-detect the gcsafe cast condition
23:04:44PMunchYup
23:06:13FromDiscord<huantian> I feel like gcsafe is in a very weird state rn lol
23:07:41FromDiscord<Elegantbeef> It is
23:08:17FromDiscord<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:17FromDiscord<Elegantbeef> This especially is an issue with orc afaik
23:21:11*joast joined #nim
23:30:51NimEventerNew thread by WizardUli: Difference between generics and templates, see https://forum.nim-lang.org/t/9985
23:36:24FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4qAb
23:38:59FromDiscord<Elegantbeef> Ok so what i generally say is "write out the human written version of what you want your macro to do"
23:39:09FromDiscord<Elegantbeef> In this case it's the version that you'd manually write
23:41:19PMunchHas `for i, data in myseq` stopped working for sequences?
23:41:39FromDiscord<Elegantbeef> Nope `pairs` still works implicitly
23:41:51PMunchHmm, I just keep getting "wrong number of variables"
23:42:11FromDiscord<Elegantbeef> does `for i, data in mySeq.pairs` work?
23:42:20PMunch`for i, data in input.split():`
23:42:49FromDiscord<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:49PMunchUhm, it gets an "iterable[string]"
23:43:00FromDiscord<Elegantbeef> split is an iterator
23:43:05FromDiscord<Elegantbeef> https://nim-lang.org/docs/strutils.html#split.i%2Cstring%2Cchar%2Cint
23:43:14FromDiscord<Elegantbeef> `for i, data in enumerate input.split`
23:43:32FromDiscord<Elegantbeef> Are you using gensym for the proc name?↵(@Andreas)
23:43:33PMunchHuh? https://nim-lang.org/docs/strutils.html#split%2Cstring%2Cset%5Bchar%5D%2Cint
23:43:51FromDiscord<Elegantbeef> If you allow the procedure name to be gensym'd it is not accessbile any other way
23:43:59FromDiscord<Elegantbeef> Yes pmunc iterators \> procedures
23:44:19FromDiscord<Elegantbeef> Inside of a for loop iterators are preferred for good reason
23:44:25PMunchAah
23:44:26PMunchI see
23:44:35FromDiscord<Elegantbeef> `for i, x in input.split()` is needlessly allocaty 😄
23:44:53PMunchWell then iterable[string] should also have a pairs defined for it..
23:44:58FromDiscord<Elegantbeef> it also allows free performance boosts from https://github.com/beef331/slicerator/blob/master/src/slicerator.nim#L5-L13
23:45:07PMunchBecause you wouldn't really need pairs anywhere else..
23:45:16FromDiscord<Elegantbeef> What?
23:45:29FromDiscord<Elegantbeef> Honestly enumerate is just nicer
23:45:39FromDiscord<Elegantbeef> It's explicit and works on all iterators
23:45:53PMunchWhere is enumerate found?
23:46:02FromDiscord<Elegantbeef> `std/enumerate`
23:46:16FromDiscord<Elegantbeef> It's a for loop macro which adds a counter
23:46:34FromDiscord<Elegantbeef> It's a better solution than a manual pairs variation for all types
23:47:02FromDiscord<Elegantbeef> also remember iterable[T] is not a real type, it's a hacked in type
23:47:10FromDiscord<Elegantbeef> You cannot write an iterator that takes it, only templates can actually use it
23:47:31FromDiscord<Andreas> In reply to @Elegantbeef "Are you using gensym": no, i use `newProc`
23:47:40FromDiscord<Elegantbeef> Andreas no clue how complicated the macro is, but share it
23:47:55PMunchHmm, still think it shouldn't be required to use an import and type `enumerate` to add an index variable for your loop
23:47:55FromDiscord<Elegantbeef> This is much easier to find the issue then pulling teeth through question period
23:48:20FromDiscord<Elegantbeef> I mean it's not
23:48:37FromDiscord<Elegantbeef> I might be wrong but iterators i do think use return value inference
23:48:56FromDiscord<Elegantbeef> Actaully that's clearly wrong
23:49:21FromDiscord<Elegantbeef> since `for x in myIter()` and `for x, y in myIter()` both work with a tuple returning iterator
23:50:02PMunchI 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:02FromDiscord<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:25PMunchBeing able to do `let input = try: stdin.readLine except EOFError: break` is fantastic
23:50:35FromDiscord<Elegantbeef> Yep it's lovely
23:50:47FromDiscord<Elegantbeef> Speaking of break, this reminds me I should add that named iterator to slicerator
23:50:52PMunchEh, I feel enumerate is just noise
23:51:07PMunchHaha, I thought you where going to say that you need a berak
23:51:10PMunchbreak even
23:51:26FromDiscord<Elegantbeef> I disagree given that it allows even things that do not yield something that would work with pairs it's lovely
23:51:41FromDiscord<Elegantbeef> The thing is pmunch `for x, y in z` is just a fancy tuple unpack
23:51:55FromDiscord<Elegantbeef> So you cannot distinguish between whether it's a tuple unpack or actually requesting a count
23:52:19FromDiscord<Elegantbeef> Unless you force `for (x, y)` for unpack and `for x, y` for count
23:52:55FromDiscord<Elegantbeef> But that'd require a change in the language
23:53:02FromDiscord<Elegantbeef> Ergo enumerate is lovely
23:53:08PMunchWell I'd be happy with a simple "do we have a pairs procedure, if not use enumerate" approach
23:53:25FromDiscord<Elegantbeef> But that's not always what you want
23:53:33PMunchAnd then you can force enumerate if you don't want to use the pairs thing
23:53:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qAe
23:53:49PMunchWhen would I rather have my program not compile instead of giving me a count?
23:54:01FromDiscord<Elegantbeef> Right there
23:54:13FromDiscord<Elegantbeef> You want `x` and `y` to be the fields yielded from `doThing`
23:54:18FromDiscord<Elegantbeef> You do not want `y` to be a tuple
23:54:19PMunchRight
23:54:44FromDiscord<Elegantbeef> You do not want `x` to be a count
23:54:59FromDiscord<Elegantbeef> `for i, (x, y) in doThing()` would be fine for the implicit enumerate
23:55:00PMunchSo the logic would be "does the iterator return something which can be unpacked? do we have pairs? if not use enumerate"
23:55:45PMunchExactly, 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:35FromDiscord<Elegantbeef> The way i see it though enumerate is the easiest and lowest cost solution 😄
23:57:18FromDiscord<Elegantbeef> It already exists, does not change semantics of the language, and it works!