<< 27-05-2024 >>

00:08:33FromDiscord<amarevite> i tried and cant get it to work↡im giving up on this part of my project im not having fun or making progress
00:10:23FromDiscord<Elegantbeef> What was your issue?
00:12:14FromDiscord<danielsokil> My dad left me when I was young
00:12:38FromDiscord<Elegantbeef> Right I forgot Nim got an emotional compiler phase
00:12:44FromDiscord<Elegantbeef> Really devastated code
00:13:33FromDiscord<Robyn [She/Her]> In reply to @danielsokil "My dad left me": Should've walked out first smh
00:13:49FromDiscord<danielsokil> In reply to @chronos.vitaqua "Should've walked out first": Crawled
00:15:02*beholders_eye quit (Read error: Connection reset by peer)
00:15:45FromDiscord<amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=NgLZIgRo
00:16:14FromDiscord<Robyn [She/Her]> In reply to @danielsokil "Crawled": Hobbled
00:20:34FromDiscord<Elegantbeef> you need to convert it
00:21:06*beholders_eye joined #nim
00:21:11FromDiscord<Elegantbeef> `result.add thisItem as yourUnion`
00:22:45FromDiscord<Robyn [She/Her]> Hey Beef, how did your init proc look like for your sum types impl?
00:23:20FromDiscord<Elegantbeef> `proc init(_: typedesc[Type], ...): Type`
00:24:39FromDiscord<Elegantbeef> In the case of `Rectangle: tuple[x, y, z: int]` it'd be `proc init(_: typedesc[Rectangle), x, y, z: int): Rectangle`
00:24:58FromDiscord<Robyn [She/Her]> How would that work for a generic though?
00:25:20*disso-peach joined #nim
00:25:31FromDiscord<Elegantbeef> The same way
00:25:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=pdjSDjTJ
00:26:20FromDiscord<Robyn [She/Her]> Ah not too difficult then, should be easy to do, even if repetitive
00:27:10FromDiscord<Robyn [She/Her]> I do hope the instantiation issue doesn't happen with this though, it'd suck
01:03:41*def- quit (Quit: -)
01:04:23*def- joined #nim
01:09:01*lucasta quit (Quit: Leaving)
01:26:55*krux02 quit (Remote host closed the connection)
01:29:42FromDiscord<grumblygibson> There's no way to effectively copy an iterator with its state, is there?
01:32:49*beholders_eye quit (Read error: Connection reset by peer)
01:35:08FromDiscord<odexine> Which kind of iterator?
01:35:50FromDiscord<odexine> I believe closure iterators can be copied? Not too sure though
01:36:31*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
01:36:40*SchweinDeBurg joined #nim
01:37:53FromDiscord<Robyn [She/Her]> In reply to @grumblygibson "There's no way to": What do you mean it's state? Do you mean so you can pause and resume it or something?
01:40:34*beholders_eye joined #nim
01:44:13FromDiscord<aryzen> Is it unwise to use blocks to subdivide my code?
01:49:57FromDiscord<polylokh_39446> it's fine. Useful if you want to limit the lifetimes of some intermediate variables.
01:50:16*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
01:52:10*xutaxkamay joined #nim
01:52:36*xutaxkamay quit (Remote host closed the connection)
01:53:27*xutaxkamay joined #nim
01:56:54FromDiscord<Robyn [She/Her]> In reply to @aryzen "Is it unwise to": Why would it be unwise?
01:56:54FromDiscord<grumblygibson> @Robyn [She/Her] I mean, iterators have internal state (they 'capture' variables)
01:56:54*def- quit (Quit: -)
01:57:28*def- joined #nim
01:57:46FromDiscord<grumblygibson> I decided it's not possible, and to go the way of creating an iterator where I can init its internal state properly.
01:57:46FromDiscord<aryzen> In reply to @chronos.vitaqua "Why would it be": It feels slightly like an abuse, is all
01:58:09FromDiscord<grumblygibson> @aryzen It indents your code for no good reason. Maybe a comment?
01:58:36FromDiscord<aryzen> I mean… People kinda go hysterical for use #regions in csharp, and that’s their intended use. Though regions can be put in really shit spots
01:58:57FromDiscord<aryzen> Yeah wasting horizontal space is kinda the big one
01:59:13FromDiscord<aryzen> (edit) "use" => "using"
02:00:05FromDiscord<grumblygibson> For the same price you could make an inline func, proc or even a template, to leverage separation and composition instead.
02:00:30FromDiscord<aryzen> Fair enough
02:01:18*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
02:07:45FromDiscord<Robyn [She/Her]> In reply to @grumblygibson "<@524288464422830095> I mean, iterators": Don't think it can be done in an easy way, but using macros to transform the code might help?
02:08:14*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
02:08:37FromDiscord<grumblygibson> If I had a bunch, maybe πŸ˜‰ Luckily it's just a single iterator.
02:09:21*xutaxkamay joined #nim
02:12:04FromDiscord<Elegantbeef> Might be able to with `--deepCopy:on` do `deepCopy`
02:20:01*def- quit (Quit: -)
02:26:32*def- joined #nim
02:33:53*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
02:34:44*xutaxkamay joined #nim
02:40:53*def- quit (Quit: -)
02:41:04*def- joined #nim
02:51:24*def- quit (Quit: -)
02:51:55*def- joined #nim
03:21:56*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
03:21:56*def- quit (Quit: -)
03:23:15*def- joined #nim
03:23:58*xutaxkamay joined #nim
03:28:12*xutaxkamay quit (Client Quit)
03:29:26*xutaxkamay joined #nim
03:41:02*SchweinDeBurg joined #nim
04:00:31*def- quit (Quit: -)
04:19:34*def- joined #nim
04:41:01*deadmarshal_ quit (Remote host closed the connection)
04:45:34*def- quit (Quit: -)
04:58:48*def- joined #nim
05:02:31*deadmarshal_ joined #nim
05:28:25FromDiscord<ambient3332> Hi, I would like to design a cross-platform UI for a software synth. I'm thinking something like Boxy by @treeform I just need to figure mouse and keyboard input somehow
05:28:35FromDiscord<ambient3332> Is there anything more suitable for the task?
05:30:28FromDiscord<ambient3332> (there's not need for windowing or designing for overlap)
05:30:41FromDiscord<ambient3332> Just nice looking unique graphics
05:32:32FromDiscord<demotomohiro> In reply to @ambient3332 "Hi, I would like": https://github.com/treeform/windy↡It seems this library handles mouse and keyboard input.
05:38:54FromDiscord<demotomohiro> Here is a list of GUI libraries: https://github.com/ringabout/awesome-nim?tab=readme-ov-file#gui
05:40:14FromDiscord<ambient3332> I don't think any of those support custom interfaces to the extent a synth-interface would look like. https://media.discordapp.net/attachments/371759389889003532/1244525553273540688/Best-Synth-Plugins-652x435-7c072442-1920w.webp?ex=66556e3e&is=66541cbe&hm=d177ea5298a547957d764ed3c63c17fffa3e95faa341d70698cab44272a10e9e&
05:42:31FromDiscord<ambient3332> Here's an example of a style I'm probably going for: https://media.discordapp.net/attachments/371759389889003532/1244526123908337690/CRq7PKZrZFnEZjiGaQ8dXC-768-80.jpg.webp?ex=66556ec6&is=66541d46&hm=f49c1c335f5b1f7a184872a4b6f5eb9d3926f3c3143910ee0e6f050d73a464aa&
05:43:28FromDiscord<ambient3332> (edit) "for:" => "for, so default GUI libraries probably aren't flexible enough for that"
05:44:16FromDiscord<ambient3332> Plus if I have to wrap the plugin into something like VST3 or CLAP, it's best to stick as close to possible to OpenGL or something like that
05:45:14FromDiscord<ambient3332> Plus the visualization part will be GL shaders most likely
05:47:16*cnx quit (Ping timeout: 268 seconds)
05:53:02*cnx joined #nim
05:56:16FromDiscord<albassort> is there an e---
05:56:25FromDiscord<albassort> why did you post a screenshot of an arturia vst
05:57:02FromDiscord<albassort> In reply to @ambient3332 "Here's an example of": This style has three background tones, defined in blocks
05:57:19FromDiscord<albassort> this is probably css? or grtk
05:57:20FromDiscord<albassort> (edit) "grtk" => "gtk4"
05:57:40FromDiscord<albassort> the gui is probably pretty hard to build but the theming is the easy part here
05:57:51FromDiscord<odexine> In reply to @albassort "why did you post": Because that’s the style of UI they’re going for?
05:58:03FromDiscord<ambient3332> You're thinking too complex. It's just simple lines and maybe a few pngs
05:58:15FromDiscord<ambient3332> Plus font rendering and boxes
05:58:33FromDiscord<odexine> Oftentimes VST GUIs are uhh
05:58:49FromDiscord<odexine> Boutique is the only word coming to mind but you know what I mean
05:59:16FromDiscord<ambient3332> It's more work to learn a new GUI library than do it manually πŸ€·β€β™‚οΈ
05:59:32FromDiscord<albassort> uhhhh
05:59:35FromDiscord<albassort> idk about that one cheif
05:59:37FromDiscord<albassort> (edit) "cheif" => "chief"
05:59:52FromDiscord<odexine> I think that’s especially true with the custom graphs needed for certain types of settings
05:59:55FromDiscord<ambient3332> like i said, there's no windowing or overlap
05:59:58FromDiscord<ambient3332> so trivial
06:00:02*PMunch joined #nim
06:00:11FromDiscord<ambient3332> shaders are simple to do
06:00:26FromDiscord<albassort> I have never met anyone say that who didn't immediately regret it
06:00:37FromDiscord<ambient3332> shaders or windowing?
06:00:41FromDiscord<albassort> the entire thing
06:00:49FromDiscord<albassort> windowing is esp pita because of Wayland
06:01:05FromDiscord<ambient3332> I'm not going to touch anything native like Wayland
06:01:25FromDiscord<ambient3332> The current plan is all boxy + windy
06:01:30FromDiscord<albassort> i think i didn't read far up enough
06:01:38FromDiscord<odexine> I thought they were basically delegating windowing to a library
06:01:42FromDiscord<odexine> Yeah
06:02:09FromDiscord<odexine> Basically only concern is the render part no?
06:02:21FromDiscord<ambient3332> What's the concern?
06:04:43*def- quit (Quit: -)
06:05:58*def- joined #nim
06:07:41FromDiscord<ambient3332> Technically there's https://github.com/steinbergmedia/vstgui but I want to also support standalone and CLAP
06:08:32FromDiscord<ambient3332> Plus wrapping a C++/CMake project is not something I enjoy greatly
06:12:15FromDiscord<ambient3332> Ideally, I would design the entire interface with something like Figma and https://github.com/treeform/fidget but given their proprietary nature, it's eh...
06:12:37FromDiscord<ambient3332> (edit) "Ideally, I would design the entire interface ... with" added "separately"
06:12:42FromDiscord<Elegantbeef> Making a UI library is not a small feat πŸ˜„
06:12:56FromDiscord<ambient3332> It is if you have a well defined goal
06:12:59*beholders_eye quit (Read error: Connection reset by peer)
06:13:01FromDiscord<ambient3332> and you use it only for one app
06:16:24FromDiscord<ambient3332> Also I don't think I have any options given the goals of the project
06:18:53*beholders_eye joined #nim
06:35:28*rockcavera quit (Remote host closed the connection)
06:46:37*def- quit (Quit: -)
06:46:50*def- joined #nim
07:27:49*dtomato9 joined #nim
07:29:59*dtomato quit (Ping timeout: 264 seconds)
07:29:59*dtomato9 is now known as dtomato
07:45:57*def- quit (Quit: -)
07:46:20*def- joined #nim
07:51:02*def- quit (Client Quit)
07:53:44*def- joined #nim
08:07:28*def- quit (Quit: -)
08:08:16*def- joined #nim
08:12:34*def- quit (Client Quit)
08:20:55FromDiscord<albassort> Beef are you aware of a pgp wrapper in nim?
08:21:14FromDiscord<albassort> theres one but Its too low level and I don't like it for no particular reason
08:21:28FromDiscord<albassort> its too old, dont think it'll compile on 2.0
08:21:41FromDiscord<albassort> (edit) "its too ... old,without" added "6 years" | "6 yearsold, dont think it'll compile on 2.0 ... " added "without changes"
08:21:49FromDiscord<albassort> (edit) removed "too"
08:22:23FromDiscord<albassort> I might wrap this https://github.com/square/gpgmeh
08:22:35FromDiscord<albassort> oh its rubty
08:22:39FromDiscord<albassort> (edit) "rubty" => "ruby, i thought it was c"
08:22:43FromDiscord<albassort> AAAAAAAAAAAAAAAAAA
08:22:44FromDiscord<Elegantbeef> Pgp more like uhhh yea
08:22:59FromDiscord<albassort> i don't get it
08:24:41FromDiscord<Elegantbeef> I used nimble directory and found https://github.com/ba0f3/sequoia.nim
08:24:43FromDiscord<Elegantbeef> So yea
08:26:57FromDiscord<albassort> yeah i didn't like that one
08:27:00FromDiscord<albassort> i must make my own
08:27:13FromDiscord<Elegantbeef> Why?
08:27:38FromDiscord<Elegantbeef> Ah nvm I see it has two libraries statically copied in
08:28:52FromDiscord<albassort> sent a long message, see https://pasty.ee/dRdNNaNi
08:29:03FromDiscord<albassort> also just bad vibes
08:29:21FromDiscord<albassort> (edit) "https://pasty.ee/wRwWIryr" => "https://pasty.ee/yQCCooKl"
08:29:27FromDiscord<Elegantbeef> You commenting on styling issues
08:29:40FromDiscord<albassort> my code is pretty and elegant
08:29:46FromDiscord<nnsee> lol
08:29:50FromDiscord<albassort> >:(
08:29:55FromDiscord<Elegantbeef> `no : its): void`
08:30:06FromDiscord<Elegantbeef> Wait do you do `: void` annotations or is that just a sokamism
08:30:24FromDiscord<Elegantbeef> I know both of you do the objectively incorrect `a : b`
08:30:46*def- joined #nim
08:30:54FromDiscord<albassort> what do you do `a : b`
08:30:56FromDiscord<albassort> (edit) "`a : b`" => "`a:b`"
08:31:06FromDiscord<Elegantbeef> `a: b` of course
08:31:24FromDiscord<albassort> silly
08:31:39FromDiscord<Elegantbeef> You're right you are
08:32:10FromDiscord<albassort> nim has no easy formatter, so the official styling recommendations are seen as a guideline
08:32:14FromDiscord<albassort> but your actions here, are silly
08:32:22FromDiscord<albassort> (edit) "formatter," => "formatter for vscode,"
08:32:54FromDiscord<Elegantbeef> Uh huh
08:33:11FromDiscord<albassort> anyway, openpgp's written in C++ and its last commit was 5 years ago
08:33:17FromDiscord<albassort> i think gnupg is the way to go here
08:33:36FromDiscord<Elegantbeef> I mean who cares when the last commit was unless there are open security issues
08:34:10FromDiscord<nnsee> In reply to @albassort "nim has no easy": uh hello? nimpretty called
08:34:26FromDiscord<nnsee> (and yes, nimpretty corrects `a : b` to `a: b`
08:34:30FromDiscord<nnsee> (edit) "b`" => "b`)"
08:34:36FromDiscord<albassort> well, pgp's greatness weakness is its implementation and its randomness. Yes, if its very solid then its fine but I'd rather more eyes on it
08:34:49FromDiscord<albassort> I think my brain has so much nim formatting in it, I don't even wanna use a formatter
08:35:42FromDiscord<Elegantbeef> I'm scared at how little Nim formatting your brain has
08:35:54FromDiscord<nnsee> huh, i now have type annotations displayed in neovim for some reason
08:35:56FromDiscord<nnsee> https://media.discordapp.net/attachments/371759389889003532/1244569766065078403/image.png?ex=6655976b&is=665445eb&hm=ae0b304fe98c2d27354a4b60529c1a9eccaafb0aaab8668058253ccdd84e1e0d&
08:36:06FromDiscord<Elegantbeef> updated the nim lang server?
08:36:18FromDiscord<Elegantbeef> LSPs have type hint support
08:36:19FromDiscord<nnsee> maybe
08:36:44FromDiscord<Elegantbeef> It's hilarious inside my gooey stuff
08:37:00FromDiscord<Elegantbeef> No that didn't come out wrong
08:37:17*def- quit (Quit: -)
08:38:21FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1244570376642494545/image.png?ex=665597fc&is=6654467c&hm=eda17985ac6c9896320e13f78f4d44767682cb2a19db8482996990687b106d93&
08:38:34FromDiscord<nnsee> oh my
08:39:24FromDiscord<Elegantbeef> Yea maybe a fully statically dispatched GUI system was not the smartest thing
08:39:35*def- joined #nim
08:46:29FromDiscord<albassort> beef doing gtk activities
08:46:35FromDiscord<albassort> why are you remaking bad software
08:46:49FromDiscord<Elegantbeef> Gtk is not statically dispatched
08:46:54FromDiscord<Elegantbeef> GTK is a big user of gobject
08:47:36FromDiscord<Elegantbeef> It's my UI layout and interaction API
08:48:19FromDiscord<Elegantbeef> I wrote it to be backend agnostic, statically dispatched and not rely on inheritance, but it might not have went as well as one would plan πŸ˜„
08:48:47FromDiscord<Elegantbeef> Well it relies on inheritance for boxing but not dispatch
08:49:14FromDiscord<Elegantbeef> https://github.com/beef331/gooey/blob/master/example/sdlimpl.nim#L309-L433 but cmon for actively not wanting to use macros it turned out ok
08:51:05FromDiscord<albassort> i still dont know how to use macros
08:51:10FromDiscord<albassort> they are weird magic
08:51:13FromDiscord<albassort> (edit) "they are weird magic ... " added "to me"
08:51:38FromDiscord<nnsee> me neither
08:51:51FromDiscord<nnsee> every time people talk about macros I feel stupid
08:51:53FromDiscord<Elegantbeef> I don't either
08:52:16FromDiscord<albassort> honestly, you should very much avoid anything besides procs and iterators. If possible. templates and macros make things get very complicated very quickly and are difficult to debug
08:52:42FromDiscord<Elegantbeef> Except writing a UI using imperative code sucks
08:53:23FromDiscord<nnsee> just don't write UIs
08:53:25FromDiscord<albassort> macros make sense there
08:53:34FromDiscord<Elegantbeef> There are plenty of places where macros are what one should use so I'm not going to say you should never reach for the, but yes they're the place of static analysis
08:53:49FromDiscord<Elegantbeef> I mean I needed a UI for a level edditor
08:53:53FromDiscord<Elegantbeef> editor\
08:53:59FromDiscord<Elegantbeef> It's hard to make a level editor diagetically
08:55:17FromDiscord<albassort> I don't understand macros so i dont see where they are useful
08:55:28FromDiscord<Elegantbeef> Lol
08:55:29FromDiscord<albassort> when you have a tool in your toolbox, you see places where it can be used
08:55:33FromDiscord<albassort> before that, you don't
08:55:51FromDiscord<albassort> unless you run into a specific problem with only 1 solution
08:56:03FromDiscord<Elegantbeef> Of course I was laughing at the view you posted followed by "I don't understand macros"
08:56:21FromDiscord<albassort> i was saying that my lack of understanding is a bad thing
08:56:35FromDiscord<albassort> and it prevents me from seeing its utility
08:57:45FromDiscord<nnsee> i mean i wouldn't say i don't understand macros
08:57:59FromDiscord<nnsee> i've just never really felt the need to fuck wit da ast
08:58:28FromDiscord<Elegantbeef> Well you also have pretty good type introspection
08:58:45FromDiscord<Elegantbeef> Though I'd much prefer things to be proceduralized using macros
09:00:14FromDiscord<Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/introspection.nim this kind of stuff is rad
09:03:44PMunchHmm, given a sequence of inherited objects, is there any way to get the full type?
09:04:00FromDiscord<Elegantbeef> "Full type"?
09:04:35PMunch`type Full = object of Parent`, then while iterating over `seq[Parent]` is there a way to get `Full`?
09:04:42PMunchSorry, it's early :P
09:04:53FromDiscord<Elegantbeef> `myVal of Full`
09:04:58PMunchOf!
09:05:00FromDiscord<Elegantbeef> `of` is for runtime checking
09:05:06PMunchI was trying with `is`
09:07:10FromDiscord<nnsee> In reply to @Elegantbeef "https://github.com/beef331/micros/blob/master/src/m": can you explain to me like i'm 5
09:07:26FromDiscord<nnsee> what this does or why i would want to use this
09:07:36FromDiscord<albassort> you guys might find this funny
09:07:48FromDiscord<albassort> so gpgme is the high level implementation of gnupg
09:08:14FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=ZfUSCYGh
09:08:21FromDiscord<albassort> (edit) "https://play.nim-lang.org/#pasty=ZIXkGpLA" => "https://play.nim-lang.org/#pasty=HtZkvDNP"
09:08:24FromDiscord<Elegantbeef> @nnsee inside other code like concepts πŸ˜„
09:08:32FromDiscord<albassort> it takes XML as input
09:08:38FromDiscord<Elegantbeef> https://github.com/beef331/traitor/blob/master/traitor.nim#L99-L108
09:08:40FromDiscord<Elegantbeef> for instance
09:09:35*beholders_eye quit (Read error: Connection reset by peer)
09:13:16FromDiscord<nnsee> fascinating
09:13:27FromDiscord<nnsee> i wouldn't say i'm a heavy user of concepts either
09:13:41FromDiscord<nnsee> i just... don't write code like that
09:13:48FromDiscord<nnsee> i'm a bit too stupid for that
09:15:15*beholders_eye joined #nim
09:22:14PMunchDoes anyone know of a simple utility to run a program multiple times and get the average runtime?
09:22:25PMunchJust some very light benchmarking
09:25:00FromDiscord<Elegantbeef> hyperfine
09:27:06FromDiscord<nnsee> +1, hyperfine does exactly what you want
09:27:22FromDiscord<nnsee> i love hyperfine
09:27:30FromDiscord<Elegantbeef> It's hyper fine
09:27:33PMunchAh, exactly what I need!
09:39:37FromDiscord<goerge_lsd> is it possible to call an iterator to yield just one value, not in a for loop ?
09:39:38*nazgulsenpai quit (Ping timeout: 252 seconds)
09:40:05FromDiscord<odexine> If the iterator is declared as a closure
09:40:28FromDiscord<odexine> Otherwise you’re gonna need a for loop in any case
09:42:10FromDiscord<goerge_lsd> I was thinking to wrap building a file checksum sequentially with HashContext living inside the iterator, and calling it with the next data, although now that I think of it, not sure it makes much sense
09:42:20*nazgulsenpai joined #nim
09:55:30*beholders_eye quit (Ping timeout: 256 seconds)
09:59:58*beholders_eye joined #nim
10:44:26FromDiscord<goerge_lsd> hey @ElegantBeef and ElegantBeef APP, based on your previous suggestion, would something like this be a good idea/work ? https://play.nim-lang.org/#pasty=YWxtyBKs I am having trouble figuring out the generics syntax when returning this very generic object. Or if it's even possible
10:46:03*deadmarshal_ quit (Remote host closed the connection)
11:28:44*fallback quit (Read error: Connection reset by peer)
11:32:17*fallback joined #nim
11:46:26FromDiscord<albassort> how can i import a header in futhark and export the generated nim to a file
11:51:25FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=KoPOluFn
11:56:22FromDiscord<albassort> @pmunch
11:58:01FromDiscord<pmunch> Not exactly sure what you mean?
11:58:27FromDiscord<albassort> I want to export all of the warppings generated by futhark
11:58:29FromDiscord<albassort> to a file
11:58:33FromDiscord<albassort> so i can look at it and edit it
11:58:55PMunchWell, first of that is not recommended
11:59:04PMunchJust a small warning
11:59:13FromDiscord<albassort> why is this
11:59:19PMunchBut the code you shared does exactly what you ask
11:59:26PMunchWhich is why I'm confused
11:59:40FromDiscord<albassort> but it doesn't go to a file? I ran it and there is no "generated".nim anywhere
12:00:42PMunchWell the whole idea of Futhark is to be able to automatically generate bindings. The code it produces is not meant for human consumption (it's a bit like looking at Nims generated C code). And if you make changes to the output then what do you do if the library is updated?
12:00:52PMunchNow you need to remember all the changes you made and do them again
12:01:01PMunchWhich certainly isn't great
12:01:07FromDiscord<albassort> the main reason why i want this is because I cant actually understand the .h file
12:01:09FromDiscord<albassort> its too archaic and gnu
12:01:26FromDiscord<albassort> and there are so many functions
12:01:33*def- quit (Quit: -)
12:01:35PMunchHaha, you probably won't have much more luck with the output of Futhark :P
12:01:35FromDiscord<albassort> it would be easier just to cut down the generated code i think
12:01:55PMunchI assume that you run the program with `-d:useFuthark`?
12:02:02FromDiscord<albassort> no...
12:02:02PMunchOtherwise that block won't get entered at all
12:02:20*def- joined #nim
12:02:32PMunchYou do see that `when defined(useFuthark)...:` part of the snippet you shared?
12:02:47PMunchThat means that the code won't run if you don't define that flag..
12:03:29FromDiscord<albassort> yeah my brain was off
12:03:42FromDiscord<albassort> when i declare useFuthark, it cannot import itsel
12:03:45FromDiscord<albassort> (edit) "itsel" => "itself"
12:04:00FromDiscord<pmunch> In reply to @albassort "yeah my brain was": Happens to the best of us
12:04:11FromDiscord<pmunch> What do you mean it can't import itself?
12:05:06FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=AmCqzUvx
12:05:29FromDiscord<albassort> Error: module 'futhark' cannot import itself
12:05:36FromDiscord<albassort> (edit) "Error:" => "`Error:" | "itself" => "itself`"
12:05:47FromDiscord<albassort> nim c -d:useFuthark
12:05:55PMunchHave you by any chance called your module `futhark`?
12:06:17FromDiscord<albassort> ...
12:06:51FromDiscord<albassort> embarrassing lol
12:07:07FromDiscord<dissolved.girl> Similar to calling your project `nim` πŸ˜…
12:07:14FromDiscord<dissolved.girl> (I've been there)
12:09:07PMunchOh, and by the way, don't try to wrap the `.h.in` file. Run `./configure` and wrap the `src/gpgme.h` instead
12:09:27PMunchAnd `path` should be the path to where the `.h` file is, not the `.h` file itself
12:09:49PMunchCode should look something like this: https://play.nim-lang.org/#pasty=EPsijMUE
12:10:49FromDiscord<albassort> something happens when you're tired and focused where your brain no longer does human language and goes caveman
12:11:25FromDiscord<albassort> In reply to @PMunch "Oh, and by the": im working on it i don't normally handle gnu projects
12:12:05*def- quit (Quit: -)
12:13:24*def- joined #nim
12:13:33FromDiscord<albassort> oh thank goodness, 3000 lines of nonsenese
12:13:48FromDiscord<albassort> joking, i just wanted the proc declarations
12:14:47PMunchYou could throw in a `-d:nodeclguards` to get some prettier output
12:14:53PMunchIt might fail though :P
12:16:22FromDiscord<albassort> like yes, it is nonsense, but all i need to do is change around the types and then it makes sense
12:16:26FromDiscord<albassort> lol
12:19:35PMunchYou might want to have a look at the retype functionality
13:05:50*def- quit (Quit: -)
13:06:13*def- joined #nim
13:19:00*rockcavera joined #nim
13:20:10*def- quit (Quit: -)
13:20:49*def- joined #nim
13:34:18*def- quit (Quit: -)
13:38:08FromDiscord<danielsokil> In go, there is embed, that allows you to embed a file or directly into the binary, and read it as a file system.↡↡If I remember correctly, there is a macro to read files at compile time in Nim?
13:38:19*def- joined #nim
13:38:29FromDiscord<danielsokil> (edit) "system.↡↡If" => "system during run time.↡↡If"
13:41:33FromDiscord<kots> There's staticRead
13:42:51FromDiscord<danielsokil> Perfect, danke
13:58:28FromDiscord<Robyn [She/Her]> It's also called `slurp` :)
14:03:34*krux02 joined #nim
14:16:36FromDiscord<arthurmiiengineering> i gotta say
14:16:41FromDiscord<arthurmiiengineering> coming from python... wow
14:16:53FromDiscord<arthurmiiengineering> also thanks for all the great resources for learning :p
14:17:01FromDiscord<arthurmiiengineering> this language is amazing!
14:17:29FromDiscord<arthurmiiengineering> do we have a guide for how to build packages or organize code in a standardized way?
14:17:37FromDiscord<arthurmiiengineering> or something like venv?
14:18:40FromDiscord<danielsokil> In reply to @arthurmiiengineering "do we have a": From what I can tell, this will be difficult, since Nim is so powerful, you can write functional code, OOP, imperative, declarative, it's up to you.
14:19:03strogon14https://nim-lang.github.io/nimble/create-packages.html
14:19:03strogon14https://github.com/nim-lang/packages/?tab=readme-ov-file#adding-your-own-package
14:19:35strogon14https://status-im.github.io/nim-style-guide/
14:19:42FromDiscord<arthurmiiengineering> sent a code paste, see https://play.nim-lang.org/#pasty=ZLxciCTf
14:20:08FromDiscord<arthurmiiengineering> In reply to @strogon14 "https://status-im.github.io/nim-style-guide/": :0 whoa! thanks bud
14:20:35FromDiscord<threefour> Other than following the structure that Nimble requires, if you're building a Nimble package, no.
14:20:56strogon14Note that this is from a third-party, though (an important one for the Nim ecosystem, though).
14:20:56FromDiscord<danielsokil> In reply to @strogon14 "https://status-im.github.io/nim-style-guide/": Thanks for this
14:21:30FromDiscord<danielsokil> This is the best way to start the document: `With great power comes great responsibility`
14:21:47FromDiscord<Phil> In reply to @arthurmiiengineering "ah, fair. so noones": Call whatever dir contains the packages source code src
14:21:55FromDiscord<Phil> Also an examples dir
14:22:15FromDiscord<arthurmiiengineering> In reply to @isofruit "Call whatever dir contains": perfect, thanks. in python its package, gotta unlearn that i guess :p
14:22:18FromDiscord<Phil> Implying I want you to write examples πŸ˜„
14:22:34FromDiscord<arthurmiiengineering> In reply to @isofruit "Implying I want you": yep, got it πŸ˜…
14:22:38FromDiscord<danielsokil> Instead of examples, I add a `when IsMainModule` to most my files
14:23:02FromDiscord<arthurmiiengineering> In reply to @danielsokil "Instead of examples, I": https://tenor.com/view/the-road-to-el-dorado-both-both-is-good-gif-8304204
14:23:14FromDiscord<Phil> In reply to @arthurmiiengineering "perfect, thanks. in python": Actually let me double check
14:23:18FromDiscord<arthurmiiengineering> In reply to @danielsokil "Instead of examples, I": both? i say both. both is good
14:23:30FromDiscord<arthurmiiengineering> (edit) "In reply to @danielsokil "Instead of examples, I": both? i say both. both is good ... " added "πŸ‘"
14:23:38FromDiscord<Phil> I just did coding in ts , that might fog up my memory
14:24:42FromDiscord<Phil> I stand corrected: have a <Projectname>.Nim and a <Projectname> dir
14:24:59FromDiscord<Phil> The Nim file should only define your public API
14:25:19FromDiscord<Phil> So import and export what is needed
14:25:35FromDiscord<Phil> (edit) "So import and export what is needed ... " added "from the directory"
14:26:00*PMunch quit (Quit: Leaving)
14:26:45FromDiscord<arthurmiiengineering> sent a code paste, see https://play.nim-lang.org/#pasty=Vmwtsbrx
14:27:12FromDiscord<Phil> Replace Projectname with the name of your lib, but yeah
14:27:38FromDiscord<Phil> Could also make a contributing.md and license file in the root dir
14:28:23FromDiscord<arthurmiiengineering> (edit) "https://play.nim-lang.org/#pasty=bRfGGbPP" => "https://play.nim-lang.org/#pasty=BWsqUWFB"
14:28:40FromDiscord<arthurmiiengineering> In reply to @isofruit "Could also make a": i like to have seperate sections in the docs for users and contributors
14:29:01FromDiscord<arthurmiiengineering> so i normally just put it there
14:29:18FromDiscord<Phil> Fair πŸ˜„
14:29:53FromDiscord<goerge_lsd> Can someone please take a look at this code and tell me how I should go about creating a proc that returns a generic object based on an enum. Can't figure out when I need to use when or case. https://play.nim-lang.org/#pasty=YWxtyBKs
14:30:06strogon14arthurmiiengineering: https://nim-lang.github.io/nimble/create-packages.html#project-structure
14:30:40strogon14i.e. "mkdir src; mv projectname* src"
14:30:42FromDiscord<goerge_lsd> Want to create an object that holds all the needed checksums procs to pass to a thread, so that it can do the hashing.
14:30:55FromDiscord<goerge_lsd> (edit) "checksums" => "" | "procs ... to" added "of a checksum algorithm"
14:32:25FromDiscord<arthurmiiengineering> In reply to @strogon14 "arthurmiiengineering: https://nim-lang.github.io/ni": oh amazing, thanks
14:37:17*beholders_eye quit (Ping timeout: 240 seconds)
15:00:11*lucasta joined #nim
15:24:30*def- quit (Quit: -)
15:24:51*def- joined #nim
15:29:06*krux02 quit (Quit: Leaving)
15:36:18*krux02 joined #nim
16:10:08*beholders_eye joined #nim
16:24:36*beholders_eye quit (Ping timeout: 255 seconds)
16:32:13*deadmarshal_ joined #nim
16:41:49FromDiscord<goerge_lsd> any good read on returning generic types ? nim docs is too short
16:42:18*lucasta quit (Quit: Leaving)
17:10:30*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
17:26:26*ntat joined #nim
17:28:45*beholders_eye joined #nim
17:44:32*def- quit (Quit: -)
17:45:15*def- joined #nim
18:00:46*def- quit (Quit: -)
18:01:01*def- joined #nim
18:08:23*beholders_eye quit (Ping timeout: 264 seconds)
18:17:05FromDiscord<juancarlospaco> What about it?, you just return a `T`
18:27:48FromDiscord<Phil> I'll take a look
18:30:11FromDiscord<Phil> In reply to @goerge_lsd "Can someone please take": You can't do "or" for an output, you need to have something concrete that gets explicitly inferred.↡Keep in mind that generics aren't real.↡They don't exist.↡They're just blueprints on how to copy-paste code for the compiler
18:30:52FromDiscord<Phil> Generally, using "or" in generic types also is asking for trouble like you did in createHasher
18:31:21FromDiscord<goerge_lsd> oh is that the only problem. I wanted to get rid of that eventually
18:31:43FromDiscord<Phil> I don't think it's the only problem but it is the problem that leads to "can't generate VM code"
18:33:07FromDiscord<Phil> I'm still walking through it
18:33:58FromDiscord<Phil> I'd also note that extensive use of type unions is prone to screwing you
18:34:24FromDiscord<Phil> They work decently well in simpler usecases, in more complex usecases I've found them blowing up on me sooner or later
18:44:15FromDiscord<Elegantbeef> Wait what?↡(@Phil)
18:44:33FromDiscord<Phil> In reply to @Elegantbeef "Wait what? (<@180601887916163073>)": It has rarely worked out well for me
18:44:49FromDiscord<Elegantbeef> Generic constraints work fine... are you ok?
18:44:58FromDiscord<Phil> I'm as much a fan of generics as the next guy, but `|`, `or` and friends inside of generics have fucked me over often enough in complex edgecases
18:48:01FromDiscord<Elegantbeef> WEll you're holding it wrong
18:48:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=HHiSnGuL
18:49:55FromDiscord<Elegantbeef> I mean well yea they use a generic in a procedure
18:49:58FromDiscord<Elegantbeef> That's not due to the typeclass
18:50:11FromDiscord<Elegantbeef> That's due to not properly instantiating the generic inside `finializeProc`
18:50:32FromDiscord<Elegantbeef> It's a bug yes, but it's incorrect code
18:50:58FromDiscord<Phil> The hell, so what, you can't have a generic proc-signature inside a generic typedef?
18:52:01FromDiscord<Elegantbeef> `DigestGeneric` is a typeclass
18:52:10FromDiscord<Elegantbeef> You did not specify the value inside the object definition
18:52:16FromDiscord<Elegantbeef> So what type does it have?
18:52:58FromDiscord<Phil> Oh FFS, slipped past me.↡@goerge_lsd you can't have different outputs depending on inputs.↡For a generic proc the output type must be inferrable, at compile-time, from the input types
18:53:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=rCNXitgS
18:53:29FromDiscord<Elegantbeef> Anyway the best solution is the tuple based one I linked eons ago
18:53:51FromDiscord<goerge_lsd> somehow this felt more logical : P although I lack the generic logic to write it : P
18:54:21FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=PTRHJVnH for context phil
18:54:55FromDiscord<Elegantbeef> It's not more logical cause you have to manually pass both types to a hash procedure cause you have dissociated flow
18:55:35FromDiscord<Elegantbeef> Like I said if you really wanted you could also emit a `tuple[name: Digest]` and that'd be infered from `state.finish()`
18:55:41FromDiscord<Elegantbeef> well `hashFinish`
18:59:26FromDiscord<goerge_lsd> I was planning to get rid of char / uint8, by writing wrapper functions to the checksums module
19:00:14FromDiscord<goerge_lsd> @ringabout any good reason for using both char and uint8 for data in `checksums` ? : )
19:02:35FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=ZQFzLrzL there we go solved most of it
19:04:11FromDiscord<goerge_lsd> so what does that macro do again, in layman's terms ? : )
19:04:35FromDiscord<goerge_lsd> oh from tuple to digest type
19:04:38FromDiscord<Elegantbeef> Takes `tuple[name: T]` and turns it into `tuple[name: typeof(T.hashFinish())]`
19:07:23*def- quit (Quit: -)
19:10:49FromDiscord<goerge_lsd> how would you dynamically create this kind of tuple though ? If what we want to hash is not known at compile time
19:10:56FromDiscord<goerge_lsd> (edit) "what" => "how"
19:13:30*def- joined #nim
19:24:29FromDiscord<Elegantbeef> That's the fun part, you don't
19:25:45FromDiscord<goerge_lsd> that's a no go then
19:27:54FromDiscord<Elegantbeef> Yep you have to go the lame way of non extensibility if you want to do this runtime switching
19:28:54FromDiscord<goerge_lsd> runtime thing is not negotiable.. I want to use this in another project that hashes potentially all files on a filesystem, with user chosen checksums
19:29:09FromDiscord<goerge_lsd> not sure what extensibility you think of
19:29:31FromDiscord<Elegantbeef> The ability for any user to add any hash without forking a project πŸ˜„
19:37:22*ntat quit (Quit: Leaving)
19:42:13FromDiscord<goerge_lsd> so aliasing types in generic parameter is done with Type1: Type2 ? I thought it's `=`
19:42:28FromDiscord<Elegantbeef> That's not aliasing that's constraining
19:44:25FromDiscord<goerge_lsd> and what's with the {.nimcall.} annotation
19:55:29*PMunch joined #nim
20:07:44FromDiscord<goerge_lsd> In reply to @isofruit "Oh FFS, slipped past": I kind of get this.. so I can't use values but types instead, to pass to that proc ? and use when instead of case ?
20:09:20*def- quit (Quit: -)
20:09:38*def- joined #nim
20:17:52FromDiscord<goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=PifdNhQW
20:17:53FromDiscord<goerge_lsd> this works
20:17:54FromDiscord<griffith1deadly> In reply to @goerge_lsd "and what's with the": ensure that its nim proc, not closure ... etc
20:18:45FromDiscord<goerge_lsd> I think I should use typedescs here?
20:20:16FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=HUreMDWQ
20:20:27FromDiscord<griffith1deadly> its compile time switching
20:21:18FromDiscord<goerge_lsd> So I should look into methods then ?
20:21:36FromDiscord<griffith1deadly> ref object & methods
20:21:39FromDiscord<griffith1deadly> so yes
20:22:36FromDiscord<griffith1deadly> note: with ref objects `is` not worked
20:22:51FromDiscord<griffith1deadly> and u should use `of`
20:24:39*def- quit (Quit: -)
20:24:55*def- joined #nim
20:35:04*PMunch quit (Quit: Leaving)
20:39:30*def- quit (Quit: -)
20:40:12FromDiscord<Robyn [She/Her]> What are the rules for the name of a Nim package? First letter is alphabetical, rest is alphanumerical?
20:40:46FromDiscord<Robyn [She/Her]> Are non-ascii characters allowed in the name?
20:41:06FromDiscord<Robyn [She/Her]> Any length requirement?
20:41:24FromDiscord<sOkam! 🫐> how does one add a `--path:/THE/PATH/DIR` option to a `nim.cfg` file?
20:41:41FromDiscord<sOkam! 🫐> I thought that was the syntax, but apparently nim doesn't like that
20:42:41*def- joined #nim
20:42:57FromDiscord<Robyn [She/Her]> In reply to @heysokam "how does one add": Have you tried `path=`?
20:43:23FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=shcXdkiL
20:43:29FromDiscord<Robyn [She/Her]> @sOkam! 🫐
20:44:30FromDiscord<Elegantbeef> @Robyn [She/Her] a nim module has to be a valid Nim identifier
20:44:49FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "<@524288464422830095> a nim module": And what's the rules for that? I can't remember :P
20:45:05FromDiscord<Elegantbeef> RTFM
20:46:37FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Have you tried `path=`?": oh that wasn't the issue, actually
20:46:50*def- quit (Client Quit)
20:46:53FromDiscord<sOkam! 🫐> `--path:thing` is incorrect, but `--path:"thing"` is valid πŸ€·β€β™‚οΈ
20:47:09FromDiscord<sOkam! 🫐> your snipped made me realize i wasn't using quotes, tyty πŸ‘Œ
20:47:13FromDiscord<sOkam! 🫐> (edit) "snipped" => "snippet"
20:47:29*def- joined #nim
20:52:38FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "RTFM": :pain:
20:52:47FromDiscord<Robyn [She/Her]> In reply to @heysokam "oh that wasn't the": Aaah
21:06:58*def- quit (Quit: -)
21:07:15*def- joined #nim
21:20:55FromDiscord<sOkam! 🫐> is there a non-manual way to make a copy of a `ref` type?
21:22:22FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=gpAseGay
21:22:56FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=MTVULUyk
21:23:06FromDiscord<sOkam! 🫐> dind't know that existed
21:23:21FromDiscord<Robyn [She/Her]> It's behind a compiler flag but you should look into it
21:24:16FromDiscord<sOkam! 🫐> i don't like experimental features. they over-complicate the buildsystem
21:24:24FromDiscord<sOkam! 🫐> is there any alternative?
21:25:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=OjkqthSL
21:25:12FromDiscord<Elegantbeef> If you only want a shallow copy
21:25:14FromDiscord<Robyn [She/Her]> In reply to @heysokam "i don't like experimental": It's not experimental, just disabled by default for orc and arc
21:25:24FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "If you only want": Yeah this means any nested references aren't copied
21:25:33FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "It's not experimental, just": same deal, really. it adds a flag that you need to know exists to use
21:25:47FromDiscord<Robyn [She/Her]> You could always copy the implementation yourself?
21:25:58FromDiscord<sOkam! 🫐> for `PNode`? you kiddin
21:26:23FromDiscord<Elegantbeef> I think there is a deep copy impl for PNode
21:26:25FromDiscord<sOkam! 🫐> very unmaintainable, but that would work for simpler cases
21:26:42FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "I think there is": oh is there. any clue how its named, roughly?
21:26:48FromDiscord<sOkam! 🫐> that would be really handy
21:27:55FromDiscord<Robyn [She/Her]> https://github.com/nim-lang/Nim/issues/23460 not sure how good it is
21:28:11FromDiscord<Robyn [She/Her]> In reply to @heysokam "for `PNode`? you kiddin": Oh damn, there's no `copyNimTree` or something?
21:29:00FromDiscord<Elegantbeef> `copyTree` iirc
21:29:13FromDiscord<Robyn [She/Her]> So then shouldn't be an issue for sOkam
21:31:27FromDiscord<sOkam! 🫐> that was it. ty beef!! πŸ™
21:32:09FromDiscord<sOkam! 🫐> the ast file has SO much stuff in it, that it is really hard to even know that functionality exists already
21:40:47FromDiscord<Robyn [She/Her]> Hey Beef, any suggestions for a name on a package manager for Nim packages? I can't use Cargo because it's already taken 😭
21:43:14FromDiscord<sOkam! 🫐> if PMunch made it, `PMan` would fit like a damn glove πŸ™‚
21:43:36FromDiscord<MDuardo> Nargo πŸ‘‘β†΅(Sounds dumb)
21:44:09FromDiscord<threefour> In reply to @MDuardo "Nargo πŸ‘‘ (Sounds dumb)": Sounds like a drug dealer themed package manager
21:44:11FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Hey Beef, any suggestions": I had to solve this same question myself, btw, and I chose `spry` which is a synonym (ish) of nimble
21:44:18FromDiscord<threefour> (edit) "dealer" => "trafficker"
21:44:38FromDiscord<sOkam! 🫐> In reply to @threefour "Sounds like a drug": lol yeah, so close to `narko` πŸ™ˆ
21:45:16FromDiscord<sOkam! 🫐> @Robyn [She/Her] chatgpt is next level incredible for this type of stuff. big time recommend
21:45:46FromDiscord<sOkam! 🫐> it throws out a bunch of garbo, but it also outputs some absolute gems
21:46:36*jmdaemon joined #nim
21:47:23FromDiscord<Robyn [She/Her]> In reply to @heysokam "<@524288464422830095> chatgpt is next": Hmmm yeah I'll probably use that
21:47:52FromDiscord<sOkam! 🫐> What features do you have in mind, btw? curious on your approach
21:59:45FromDiscord<Robyn [She/Her]> In reply to @heysokam "What features do you": Feature flags are pretty much the most compelling feature I can think of
22:00:06FromDiscord<Robyn [She/Her]> Also I'll be using toml
22:00:15FromDiscord<Robyn [She/Her]> I am using Cargo as inspiration tho
22:01:48FromDiscord<MDuardo> Question, is TOML really that complex?↡↡Read something about having a lot of features and stuff along those lines
22:01:48FromDiscord<Elegantbeef> parcel is a good name for a package delivery program πŸ˜„
22:01:48FromDiscord<Elegantbeef> Anything postal related
22:01:52FromDiscord<sOkam! 🫐> intrigued to see what you come up with
22:02:09FromDiscord<sOkam! 🫐> parcel is great
22:02:10FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "parcel is a good": As a package manager though?
22:02:20FromDiscord<Elegantbeef> Yes
22:02:24FromDiscord<Robyn [She/Her]> In reply to @heysokam "intrigued to see what": I'm mostly just fed up with Nimble and unwilling to use Nimscript
22:02:37FromDiscord<sOkam! 🫐> yeah, same reason why i'm intrigued
22:02:42FromDiscord<sOkam! 🫐> nimble can get on your nerves real fast
22:04:15FromDiscord<sOkam! 🫐> the part that triggers me the most is libraries being installed repeatedly with a hash at the end↡I guess it wouldn't be so much of an issue if local dev actually worked πŸ€·β€β™‚οΈ
22:04:29FromDiscord<MDuardo> The only problem I have with Nimble is that the Nim LSP marks everything inside a .nimble file as error
22:04:30FromDiscord<MDuardo> 😐
22:04:54FromDiscord<sOkam! 🫐> In reply to @MDuardo "The only problem I": i posted a potential fix recently, but it never got implemented
22:05:51FromDiscord<MDuardo> Really hope this gets implemented, it would be so nice to have↡(@sOkam! 🫐)
22:06:53FromDiscord<sOkam! 🫐> @MDuardo https://discord.com/channels/371759389889003530/371759389889003532/1165216271281946635
22:07:15FromDiscord<sOkam! 🫐> well you are not on discord, let me repost I guess, since its fixable locally
22:07:32FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=uERAWWSM
22:08:01FromDiscord<sOkam! 🫐> That will make the nimls not freak out on any nims file (not just nimble files)
22:08:47FromDiscord<MDuardo> Where's the link for joining Nim's Discord?↡I'd like to enter
22:08:50FromDiscord<sOkam! 🫐> Its basically missing that import, because it reads all files as if they were `.nim`
22:09:17FromDiscord<sOkam! 🫐> idk where it is, but here is a link https://discord.gg/G5xDvFsx
22:09:19FromDiscord<MDuardo> Is not the best solution but would be a good workaround↡(@sOkam! 🫐)
22:09:49*pmp-p quit (Ping timeout: 272 seconds)
22:10:36FromDiscord<sOkam! 🫐> the lsp should do that import, given how it works atm
22:12:07FromDiscord<sOkam! 🫐> seems like `copyTree` has issues too, @ElegantBeef 😦
22:12:54FromDiscord<sOkam! 🫐> It is removing nodes from the original type when I remove them from the copy
22:15:07*om3ga quit (Ping timeout: 246 seconds)
22:23:17FromDiscord<Robyn [She/Her]> In reply to @heysokam "the part that triggers": I'm not sure how to go about this to be honest, I'm thinking of (if it's a git repo) grabbing all the tags and then creating an index of tags -> git hash, then storing packages in `{pkg name}/{git hash}`
22:26:14FromDiscord<sOkam! 🫐> that's what nimble does, but using the package name instead of a subfolder
22:26:16FromDiscord<sOkam! 🫐> same issue
22:26:45FromDiscord<sOkam! 🫐> if I'm working on local, I don't have a damn commit hash at all. and that breaks the setup
22:27:26FromDiscord<sOkam! 🫐> If local dev actually worked in some way, then you wouldn't need access to override the folder... but it doesn't πŸ€·β€β™‚οΈ
22:28:00FromDiscord<Robyn [She/Her]> In reply to @heysokam "if I'm working on": For local, it'd simply use `{pkg name}/local/{version}`
22:28:27FromDiscord<sOkam! 🫐> same problem, but now you are locked behind tagging locally to start working
22:28:52FromDiscord<sOkam! 🫐> if I have a local folder, I don't need it versioned. that's why im on local to begin with, to skip versioning
22:28:55FromDiscord<Robyn [She/Her]> In reply to @heysokam "same problem, but now": I'd imagine you'd just do `parcel use {local}`
22:29:23FromDiscord<Robyn [She/Her]> In reply to @heysokam "if I have a": Tbf,, I'm planning on having a `.parcel` folder in the current dir too, that'll use symlinks to the package index and stuff, wouldn't be hard to use something like that
22:29:42FromDiscord<Robyn [She/Her]> Honestly this is just a collection of ideas that'll absolutely change anyway
22:29:51FromDiscord<sOkam! 🫐> if you want my opinion, follow what npm does. its a local-first package manager
22:30:03FromDiscord<sOkam! 🫐> you have to opt-in into global install
22:30:06FromDiscord<Robyn [She/Her]> In reply to @heysokam "if you want my": I don't know what npm does tbh
22:30:14FromDiscord<Robyn [She/Her]> In reply to @heysokam "you have to opt-in": I was gonna do something more like `pnpm`
22:30:42FromDiscord<sOkam! 🫐> `nimpm` should work too, now that you mention
22:30:42FromDiscord<Robyn [She/Her]> Installs to a global folder but also uses a local folder with symlinks
22:31:18FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Installs to a global": that's why i'm specifying what npm does
22:31:41FromDiscord<sOkam! 🫐> global install by default is a fucking mess, imo↡and local install can be used for global if you specify a global folder
22:49:36*def- quit (Quit: -)
22:50:19*def- joined #nim
23:07:47*jmdaemon quit (Ping timeout: 264 seconds)
23:08:07*beholders_eye joined #nim
23:09:39*jmdaemon joined #nim
23:11:08FromDiscord<goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=ogZLmqNp
23:11:54FromDiscord<Elegantbeef> No cause you wanted runtime descrimination
23:12:02FromDiscord<Elegantbeef> Use object variants or inheritance
23:12:06FromDiscord<goerge_lsd> Right now I just want to learn : )
23:12:49FromDiscord<goerge_lsd> I started with object variants actually, and the code was very ugly.. too much repetition. That's why I wanted to try with generics/typeclass
23:14:28FromDiscord<Elegantbeef> Right then why would you even use a generic `newHasher`
23:15:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=UNyLuYPB
23:22:53FromDiscord<goerge_lsd> hmmm
23:23:47FromDiscord<goerge_lsd> yeah only, MD5Digest and MD5Context end up being created by the init procedure, doesn't make sense to declare them beforehand just so i can call the proc with those params
23:24:33FromDiscord<Elegantbeef> Could use `typedesc`s then and use `init` after
23:25:16FromDiscord<goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=xvAJGjLB
23:26:30FromDiscord<goerge_lsd> I can't use a static value enum instead of typedesc?
23:26:42*jmdaemon quit (Ping timeout: 268 seconds)
23:27:16FromDiscord<Elegantbeef> Yea
23:27:33FromDiscord<Elegantbeef> You can
23:27:57FromDiscord<goerge_lsd> but.. how do you discriminate between them ?
23:28:06FromDiscord<goerge_lsd> I need to write a newHasher proc for each kind
23:28:08FromDiscord<Elegantbeef> `when x == y`
23:28:10FromDiscord<goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=ckkYKeZA
23:28:15FromDiscord<goerge_lsd> oh
23:29:30FromDiscord<goerge_lsd> wait, this doesn't work like expected
23:30:05FromDiscord<goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=YjAkGibq
23:30:15FromDiscord<goerge_lsd> overloaded 'newHasher' leads to ambiguous calls
23:30:16FromDiscord<Elegantbeef> Well yea you have the same proc twice
23:30:45*jmdaemon joined #nim
23:31:00FromDiscord<Elegantbeef> `proc newHasher(hash: static HashType): auto` is your type definition
23:33:53FromDiscord<goerge_lsd> woop, that actually works
23:34:12FromDiscord<goerge_lsd> you're hired. When can you start ?
23:34:35FromDiscord<Elegantbeef> Technically this can all be done using a hacky around converters
23:41:25FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=EtWBjKFV if one wanted to really be funny
23:54:01FromDiscord<goerge_lsd> what's that `0` in `.[val](0)` on the last line
23:54:50FromDiscord<Elegantbeef> The type is a distinct int