00:08:33 | FromDiscord | <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:23 | FromDiscord | <Elegantbeef> What was your issue? |
00:12:14 | FromDiscord | <danielsokil> My dad left me when I was young |
00:12:38 | FromDiscord | <Elegantbeef> Right I forgot Nim got an emotional compiler phase |
00:12:44 | FromDiscord | <Elegantbeef> Really devastated code |
00:13:33 | FromDiscord | <Robyn [She/Her]> In reply to @danielsokil "My dad left me": Should've walked out first smh |
00:13:49 | FromDiscord | <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:45 | FromDiscord | <amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=NgLZIgRo |
00:16:14 | FromDiscord | <Robyn [She/Her]> In reply to @danielsokil "Crawled": Hobbled |
00:20:34 | FromDiscord | <Elegantbeef> you need to convert it |
00:21:06 | * | beholders_eye joined #nim |
00:21:11 | FromDiscord | <Elegantbeef> `result.add thisItem as yourUnion` |
00:22:45 | FromDiscord | <Robyn [She/Her]> Hey Beef, how did your init proc look like for your sum types impl? |
00:23:20 | FromDiscord | <Elegantbeef> `proc init(_: typedesc[Type], ...): Type` |
00:24:39 | FromDiscord | <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:58 | FromDiscord | <Robyn [She/Her]> How would that work for a generic though? |
00:25:20 | * | disso-peach joined #nim |
00:25:31 | FromDiscord | <Elegantbeef> The same way |
00:25:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=pdjSDjTJ |
00:26:20 | FromDiscord | <Robyn [She/Her]> Ah not too difficult then, should be easy to do, even if repetitive |
00:27:10 | FromDiscord | <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:42 | FromDiscord | <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:08 | FromDiscord | <odexine> Which kind of iterator? |
01:35:50 | FromDiscord | <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:53 | FromDiscord | <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:13 | FromDiscord | <aryzen> Is it unwise to use blocks to subdivide my code? |
01:49:57 | FromDiscord | <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:54 | FromDiscord | <Robyn [She/Her]> In reply to @aryzen "Is it unwise to": Why would it be unwise? |
01:56:54 | FromDiscord | <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:46 | FromDiscord | <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:46 | FromDiscord | <aryzen> In reply to @chronos.vitaqua "Why would it be": It feels slightly like an abuse, is all |
01:58:09 | FromDiscord | <grumblygibson> @aryzen It indents your code for no good reason. Maybe a comment? |
01:58:36 | FromDiscord | <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:57 | FromDiscord | <aryzen> Yeah wasting horizontal space is kinda the big one |
01:59:13 | FromDiscord | <aryzen> (edit) "use" => "using" |
02:00:05 | FromDiscord | <grumblygibson> For the same price you could make an inline func, proc or even a template, to leverage separation and composition instead. |
02:00:30 | FromDiscord | <aryzen> Fair enough |
02:01:18 | * | SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev) |
02:07:45 | FromDiscord | <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:37 | FromDiscord | <grumblygibson> If I had a bunch, maybe π Luckily it's just a single iterator. |
02:09:21 | * | xutaxkamay joined #nim |
02:12:04 | FromDiscord | <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:25 | FromDiscord | <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:35 | FromDiscord | <ambient3332> Is there anything more suitable for the task? |
05:30:28 | FromDiscord | <ambient3332> (there's not need for windowing or designing for overlap) |
05:30:41 | FromDiscord | <ambient3332> Just nice looking unique graphics |
05:32:32 | FromDiscord | <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:54 | FromDiscord | <demotomohiro> Here is a list of GUI libraries: https://github.com/ringabout/awesome-nim?tab=readme-ov-file#gui |
05:40:14 | FromDiscord | <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:31 | FromDiscord | <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:28 | FromDiscord | <ambient3332> (edit) "for:" => "for, so default GUI libraries probably aren't flexible enough for that" |
05:44:16 | FromDiscord | <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:14 | FromDiscord | <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:16 | FromDiscord | <albassort> is there an e--- |
05:56:25 | FromDiscord | <albassort> why did you post a screenshot of an arturia vst |
05:57:02 | FromDiscord | <albassort> In reply to @ambient3332 "Here's an example of": This style has three background tones, defined in blocks |
05:57:19 | FromDiscord | <albassort> this is probably css? or grtk |
05:57:20 | FromDiscord | <albassort> (edit) "grtk" => "gtk4" |
05:57:40 | FromDiscord | <albassort> the gui is probably pretty hard to build but the theming is the easy part here |
05:57:51 | FromDiscord | <odexine> In reply to @albassort "why did you post": Because thatβs the style of UI theyβre going for? |
05:58:03 | FromDiscord | <ambient3332> You're thinking too complex. It's just simple lines and maybe a few pngs |
05:58:15 | FromDiscord | <ambient3332> Plus font rendering and boxes |
05:58:33 | FromDiscord | <odexine> Oftentimes VST GUIs are uhh |
05:58:49 | FromDiscord | <odexine> Boutique is the only word coming to mind but you know what I mean |
05:59:16 | FromDiscord | <ambient3332> It's more work to learn a new GUI library than do it manually π€·ββοΈ |
05:59:32 | FromDiscord | <albassort> uhhhh |
05:59:35 | FromDiscord | <albassort> idk about that one cheif |
05:59:37 | FromDiscord | <albassort> (edit) "cheif" => "chief" |
05:59:52 | FromDiscord | <odexine> I think thatβs especially true with the custom graphs needed for certain types of settings |
05:59:55 | FromDiscord | <ambient3332> like i said, there's no windowing or overlap |
05:59:58 | FromDiscord | <ambient3332> so trivial |
06:00:02 | * | PMunch joined #nim |
06:00:11 | FromDiscord | <ambient3332> shaders are simple to do |
06:00:26 | FromDiscord | <albassort> I have never met anyone say that who didn't immediately regret it |
06:00:37 | FromDiscord | <ambient3332> shaders or windowing? |
06:00:41 | FromDiscord | <albassort> the entire thing |
06:00:49 | FromDiscord | <albassort> windowing is esp pita because of Wayland |
06:01:05 | FromDiscord | <ambient3332> I'm not going to touch anything native like Wayland |
06:01:25 | FromDiscord | <ambient3332> The current plan is all boxy + windy |
06:01:30 | FromDiscord | <albassort> i think i didn't read far up enough |
06:01:38 | FromDiscord | <odexine> I thought they were basically delegating windowing to a library |
06:01:42 | FromDiscord | <odexine> Yeah |
06:02:09 | FromDiscord | <odexine> Basically only concern is the render part no? |
06:02:21 | FromDiscord | <ambient3332> What's the concern? |
06:04:43 | * | def- quit (Quit: -) |
06:05:58 | * | def- joined #nim |
06:07:41 | FromDiscord | <ambient3332> Technically there's https://github.com/steinbergmedia/vstgui but I want to also support standalone and CLAP |
06:08:32 | FromDiscord | <ambient3332> Plus wrapping a C++/CMake project is not something I enjoy greatly |
06:12:15 | FromDiscord | <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:37 | FromDiscord | <ambient3332> (edit) "Ideally, I would design the entire interface ... with" added "separately" |
06:12:42 | FromDiscord | <Elegantbeef> Making a UI library is not a small feat π |
06:12:56 | FromDiscord | <ambient3332> It is if you have a well defined goal |
06:12:59 | * | beholders_eye quit (Read error: Connection reset by peer) |
06:13:01 | FromDiscord | <ambient3332> and you use it only for one app |
06:16:24 | FromDiscord | <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:55 | FromDiscord | <albassort> Beef are you aware of a pgp wrapper in nim? |
08:21:14 | FromDiscord | <albassort> theres one but Its too low level and I don't like it for no particular reason |
08:21:28 | FromDiscord | <albassort> its too old, dont think it'll compile on 2.0 |
08:21:41 | FromDiscord | <albassort> (edit) "its too ... old,without" added "6 years" | "6 yearsold, dont think it'll compile on 2.0 ... " added "without changes" |
08:21:49 | FromDiscord | <albassort> (edit) removed "too" |
08:22:23 | FromDiscord | <albassort> I might wrap this https://github.com/square/gpgmeh |
08:22:35 | FromDiscord | <albassort> oh its rubty |
08:22:39 | FromDiscord | <albassort> (edit) "rubty" => "ruby, i thought it was c" |
08:22:43 | FromDiscord | <albassort> AAAAAAAAAAAAAAAAAA |
08:22:44 | FromDiscord | <Elegantbeef> Pgp more like uhhh yea |
08:22:59 | FromDiscord | <albassort> i don't get it |
08:24:41 | FromDiscord | <Elegantbeef> I used nimble directory and found https://github.com/ba0f3/sequoia.nim |
08:24:43 | FromDiscord | <Elegantbeef> So yea |
08:26:57 | FromDiscord | <albassort> yeah i didn't like that one |
08:27:00 | FromDiscord | <albassort> i must make my own |
08:27:13 | FromDiscord | <Elegantbeef> Why? |
08:27:38 | FromDiscord | <Elegantbeef> Ah nvm I see it has two libraries statically copied in |
08:28:52 | FromDiscord | <albassort> sent a long message, see https://pasty.ee/dRdNNaNi |
08:29:03 | FromDiscord | <albassort> also just bad vibes |
08:29:21 | FromDiscord | <albassort> (edit) "https://pasty.ee/wRwWIryr" => "https://pasty.ee/yQCCooKl" |
08:29:27 | FromDiscord | <Elegantbeef> You commenting on styling issues |
08:29:40 | FromDiscord | <albassort> my code is pretty and elegant |
08:29:46 | FromDiscord | <nnsee> lol |
08:29:50 | FromDiscord | <albassort> >:( |
08:29:55 | FromDiscord | <Elegantbeef> `no : its): void` |
08:30:06 | FromDiscord | <Elegantbeef> Wait do you do `: void` annotations or is that just a sokamism |
08:30:24 | FromDiscord | <Elegantbeef> I know both of you do the objectively incorrect `a : b` |
08:30:46 | * | def- joined #nim |
08:30:54 | FromDiscord | <albassort> what do you do `a : b` |
08:30:56 | FromDiscord | <albassort> (edit) "`a : b`" => "`a:b`" |
08:31:06 | FromDiscord | <Elegantbeef> `a: b` of course |
08:31:24 | FromDiscord | <albassort> silly |
08:31:39 | FromDiscord | <Elegantbeef> You're right you are |
08:32:10 | FromDiscord | <albassort> nim has no easy formatter, so the official styling recommendations are seen as a guideline |
08:32:14 | FromDiscord | <albassort> but your actions here, are silly |
08:32:22 | FromDiscord | <albassort> (edit) "formatter," => "formatter for vscode," |
08:32:54 | FromDiscord | <Elegantbeef> Uh huh |
08:33:11 | FromDiscord | <albassort> anyway, openpgp's written in C++ and its last commit was 5 years ago |
08:33:17 | FromDiscord | <albassort> i think gnupg is the way to go here |
08:33:36 | FromDiscord | <Elegantbeef> I mean who cares when the last commit was unless there are open security issues |
08:34:10 | FromDiscord | <nnsee> In reply to @albassort "nim has no easy": uh hello? nimpretty called |
08:34:26 | FromDiscord | <nnsee> (and yes, nimpretty corrects `a : b` to `a: b` |
08:34:30 | FromDiscord | <nnsee> (edit) "b`" => "b`)" |
08:34:36 | FromDiscord | <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:49 | FromDiscord | <albassort> I think my brain has so much nim formatting in it, I don't even wanna use a formatter |
08:35:42 | FromDiscord | <Elegantbeef> I'm scared at how little Nim formatting your brain has |
08:35:54 | FromDiscord | <nnsee> huh, i now have type annotations displayed in neovim for some reason |
08:35:56 | FromDiscord | <nnsee> https://media.discordapp.net/attachments/371759389889003532/1244569766065078403/image.png?ex=6655976b&is=665445eb&hm=ae0b304fe98c2d27354a4b60529c1a9eccaafb0aaab8668058253ccdd84e1e0d& |
08:36:06 | FromDiscord | <Elegantbeef> updated the nim lang server? |
08:36:18 | FromDiscord | <Elegantbeef> LSPs have type hint support |
08:36:19 | FromDiscord | <nnsee> maybe |
08:36:44 | FromDiscord | <Elegantbeef> It's hilarious inside my gooey stuff |
08:37:00 | FromDiscord | <Elegantbeef> No that didn't come out wrong |
08:37:17 | * | def- quit (Quit: -) |
08:38:21 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1244570376642494545/image.png?ex=665597fc&is=6654467c&hm=eda17985ac6c9896320e13f78f4d44767682cb2a19db8482996990687b106d93& |
08:38:34 | FromDiscord | <nnsee> oh my |
08:39:24 | FromDiscord | <Elegantbeef> Yea maybe a fully statically dispatched GUI system was not the smartest thing |
08:39:35 | * | def- joined #nim |
08:46:29 | FromDiscord | <albassort> beef doing gtk activities |
08:46:35 | FromDiscord | <albassort> why are you remaking bad software |
08:46:49 | FromDiscord | <Elegantbeef> Gtk is not statically dispatched |
08:46:54 | FromDiscord | <Elegantbeef> GTK is a big user of gobject |
08:47:36 | FromDiscord | <Elegantbeef> It's my UI layout and interaction API |
08:48:19 | FromDiscord | <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:47 | FromDiscord | <Elegantbeef> Well it relies on inheritance for boxing but not dispatch |
08:49:14 | FromDiscord | <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:05 | FromDiscord | <albassort> i still dont know how to use macros |
08:51:10 | FromDiscord | <albassort> they are weird magic |
08:51:13 | FromDiscord | <albassort> (edit) "they are weird magic ... " added "to me" |
08:51:38 | FromDiscord | <nnsee> me neither |
08:51:51 | FromDiscord | <nnsee> every time people talk about macros I feel stupid |
08:51:53 | FromDiscord | <Elegantbeef> I don't either |
08:52:16 | FromDiscord | <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:42 | FromDiscord | <Elegantbeef> Except writing a UI using imperative code sucks |
08:53:23 | FromDiscord | <nnsee> just don't write UIs |
08:53:25 | FromDiscord | <albassort> macros make sense there |
08:53:34 | FromDiscord | <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:49 | FromDiscord | <Elegantbeef> I mean I needed a UI for a level edditor |
08:53:53 | FromDiscord | <Elegantbeef> editor\ |
08:53:59 | FromDiscord | <Elegantbeef> It's hard to make a level editor diagetically |
08:55:17 | FromDiscord | <albassort> I don't understand macros so i dont see where they are useful |
08:55:28 | FromDiscord | <Elegantbeef> Lol |
08:55:29 | FromDiscord | <albassort> when you have a tool in your toolbox, you see places where it can be used |
08:55:33 | FromDiscord | <albassort> before that, you don't |
08:55:51 | FromDiscord | <albassort> unless you run into a specific problem with only 1 solution |
08:56:03 | FromDiscord | <Elegantbeef> Of course I was laughing at the view you posted followed by "I don't understand macros" |
08:56:21 | FromDiscord | <albassort> i was saying that my lack of understanding is a bad thing |
08:56:35 | FromDiscord | <albassort> and it prevents me from seeing its utility |
08:57:45 | FromDiscord | <nnsee> i mean i wouldn't say i don't understand macros |
08:57:59 | FromDiscord | <nnsee> i've just never really felt the need to fuck wit da ast |
08:58:28 | FromDiscord | <Elegantbeef> Well you also have pretty good type introspection |
08:58:45 | FromDiscord | <Elegantbeef> Though I'd much prefer things to be proceduralized using macros |
09:00:14 | FromDiscord | <Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/introspection.nim this kind of stuff is rad |
09:03:44 | PMunch | Hmm, given a sequence of inherited objects, is there any way to get the full type? |
09:04:00 | FromDiscord | <Elegantbeef> "Full type"? |
09:04:35 | PMunch | `type Full = object of Parent`, then while iterating over `seq[Parent]` is there a way to get `Full`? |
09:04:42 | PMunch | Sorry, it's early :P |
09:04:53 | FromDiscord | <Elegantbeef> `myVal of Full` |
09:04:58 | PMunch | Of! |
09:05:00 | FromDiscord | <Elegantbeef> `of` is for runtime checking |
09:05:06 | PMunch | I was trying with `is` |
09:07:10 | FromDiscord | <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:26 | FromDiscord | <nnsee> what this does or why i would want to use this |
09:07:36 | FromDiscord | <albassort> you guys might find this funny |
09:07:48 | FromDiscord | <albassort> so gpgme is the high level implementation of gnupg |
09:08:14 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=ZfUSCYGh |
09:08:21 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#pasty=ZIXkGpLA" => "https://play.nim-lang.org/#pasty=HtZkvDNP" |
09:08:24 | FromDiscord | <Elegantbeef> @nnsee inside other code like concepts π |
09:08:32 | FromDiscord | <albassort> it takes XML as input |
09:08:38 | FromDiscord | <Elegantbeef> https://github.com/beef331/traitor/blob/master/traitor.nim#L99-L108 |
09:08:40 | FromDiscord | <Elegantbeef> for instance |
09:09:35 | * | beholders_eye quit (Read error: Connection reset by peer) |
09:13:16 | FromDiscord | <nnsee> fascinating |
09:13:27 | FromDiscord | <nnsee> i wouldn't say i'm a heavy user of concepts either |
09:13:41 | FromDiscord | <nnsee> i just... don't write code like that |
09:13:48 | FromDiscord | <nnsee> i'm a bit too stupid for that |
09:15:15 | * | beholders_eye joined #nim |
09:22:14 | PMunch | Does anyone know of a simple utility to run a program multiple times and get the average runtime? |
09:22:25 | PMunch | Just some very light benchmarking |
09:25:00 | FromDiscord | <Elegantbeef> hyperfine |
09:27:06 | FromDiscord | <nnsee> +1, hyperfine does exactly what you want |
09:27:22 | FromDiscord | <nnsee> i love hyperfine |
09:27:30 | FromDiscord | <Elegantbeef> It's hyper fine |
09:27:33 | PMunch | Ah, exactly what I need! |
09:39:37 | FromDiscord | <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:05 | FromDiscord | <odexine> If the iterator is declared as a closure |
09:40:28 | FromDiscord | <odexine> Otherwise youβre gonna need a for loop in any case |
09:42:10 | FromDiscord | <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:26 | FromDiscord | <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:26 | FromDiscord | <albassort> how can i import a header in futhark and export the generated nim to a file |
11:51:25 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=KoPOluFn |
11:56:22 | FromDiscord | <albassort> @pmunch |
11:58:01 | FromDiscord | <pmunch> Not exactly sure what you mean? |
11:58:27 | FromDiscord | <albassort> I want to export all of the warppings generated by futhark |
11:58:29 | FromDiscord | <albassort> to a file |
11:58:33 | FromDiscord | <albassort> so i can look at it and edit it |
11:58:55 | PMunch | Well, first of that is not recommended |
11:59:04 | PMunch | Just a small warning |
11:59:13 | FromDiscord | <albassort> why is this |
11:59:19 | PMunch | But the code you shared does exactly what you ask |
11:59:26 | PMunch | Which is why I'm confused |
11:59:40 | FromDiscord | <albassort> but it doesn't go to a file? I ran it and there is no "generated".nim anywhere |
12:00:42 | PMunch | Well 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:52 | PMunch | Now you need to remember all the changes you made and do them again |
12:01:01 | PMunch | Which certainly isn't great |
12:01:07 | FromDiscord | <albassort> the main reason why i want this is because I cant actually understand the .h file |
12:01:09 | FromDiscord | <albassort> its too archaic and gnu |
12:01:26 | FromDiscord | <albassort> and there are so many functions |
12:01:33 | * | def- quit (Quit: -) |
12:01:35 | PMunch | Haha, you probably won't have much more luck with the output of Futhark :P |
12:01:35 | FromDiscord | <albassort> it would be easier just to cut down the generated code i think |
12:01:55 | PMunch | I assume that you run the program with `-d:useFuthark`? |
12:02:02 | FromDiscord | <albassort> no... |
12:02:02 | PMunch | Otherwise that block won't get entered at all |
12:02:20 | * | def- joined #nim |
12:02:32 | PMunch | You do see that `when defined(useFuthark)...:` part of the snippet you shared? |
12:02:47 | PMunch | That means that the code won't run if you don't define that flag.. |
12:03:29 | FromDiscord | <albassort> yeah my brain was off |
12:03:42 | FromDiscord | <albassort> when i declare useFuthark, it cannot import itsel |
12:03:45 | FromDiscord | <albassort> (edit) "itsel" => "itself" |
12:04:00 | FromDiscord | <pmunch> In reply to @albassort "yeah my brain was": Happens to the best of us |
12:04:11 | FromDiscord | <pmunch> What do you mean it can't import itself? |
12:05:06 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#pasty=AmCqzUvx |
12:05:29 | FromDiscord | <albassort> Error: module 'futhark' cannot import itself |
12:05:36 | FromDiscord | <albassort> (edit) "Error:" => "`Error:" | "itself" => "itself`" |
12:05:47 | FromDiscord | <albassort> nim c -d:useFuthark |
12:05:55 | PMunch | Have you by any chance called your module `futhark`? |
12:06:17 | FromDiscord | <albassort> ... |
12:06:51 | FromDiscord | <albassort> embarrassing lol |
12:07:07 | FromDiscord | <dissolved.girl> Similar to calling your project `nim` π
|
12:07:14 | FromDiscord | <dissolved.girl> (I've been there) |
12:09:07 | PMunch | Oh, and by the way, don't try to wrap the `.h.in` file. Run `./configure` and wrap the `src/gpgme.h` instead |
12:09:27 | PMunch | And `path` should be the path to where the `.h` file is, not the `.h` file itself |
12:09:49 | PMunch | Code should look something like this: https://play.nim-lang.org/#pasty=EPsijMUE |
12:10:49 | FromDiscord | <albassort> something happens when you're tired and focused where your brain no longer does human language and goes caveman |
12:11:25 | FromDiscord | <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:33 | FromDiscord | <albassort> oh thank goodness, 3000 lines of nonsenese |
12:13:48 | FromDiscord | <albassort> joking, i just wanted the proc declarations |
12:14:47 | PMunch | You could throw in a `-d:nodeclguards` to get some prettier output |
12:14:53 | PMunch | It might fail though :P |
12:16:22 | FromDiscord | <albassort> like yes, it is nonsense, but all i need to do is change around the types and then it makes sense |
12:16:26 | FromDiscord | <albassort> lol |
12:19:35 | PMunch | You 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:08 | FromDiscord | <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:29 | FromDiscord | <danielsokil> (edit) "system.β΅β΅If" => "system during run time.β΅β΅If" |
13:41:33 | FromDiscord | <kots> There's staticRead |
13:42:51 | FromDiscord | <danielsokil> Perfect, danke |
13:58:28 | FromDiscord | <Robyn [She/Her]> It's also called `slurp` :) |
14:03:34 | * | krux02 joined #nim |
14:16:36 | FromDiscord | <arthurmiiengineering> i gotta say |
14:16:41 | FromDiscord | <arthurmiiengineering> coming from python... wow |
14:16:53 | FromDiscord | <arthurmiiengineering> also thanks for all the great resources for learning :p |
14:17:01 | FromDiscord | <arthurmiiengineering> this language is amazing! |
14:17:29 | FromDiscord | <arthurmiiengineering> do we have a guide for how to build packages or organize code in a standardized way? |
14:17:37 | FromDiscord | <arthurmiiengineering> or something like venv? |
14:18:40 | FromDiscord | <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:03 | strogon14 | https://nim-lang.github.io/nimble/create-packages.html |
14:19:03 | strogon14 | https://github.com/nim-lang/packages/?tab=readme-ov-file#adding-your-own-package |
14:19:35 | strogon14 | https://status-im.github.io/nim-style-guide/ |
14:19:42 | FromDiscord | <arthurmiiengineering> sent a code paste, see https://play.nim-lang.org/#pasty=ZLxciCTf |
14:20:08 | FromDiscord | <arthurmiiengineering> In reply to @strogon14 "https://status-im.github.io/nim-style-guide/": :0 whoa! thanks bud |
14:20:35 | FromDiscord | <threefour> Other than following the structure that Nimble requires, if you're building a Nimble package, no. |
14:20:56 | strogon14 | Note that this is from a third-party, though (an important one for the Nim ecosystem, though). |
14:20:56 | FromDiscord | <danielsokil> In reply to @strogon14 "https://status-im.github.io/nim-style-guide/": Thanks for this |
14:21:30 | FromDiscord | <danielsokil> This is the best way to start the document: `With great power comes great responsibility` |
14:21:47 | FromDiscord | <Phil> In reply to @arthurmiiengineering "ah, fair. so noones": Call whatever dir contains the packages source code src |
14:21:55 | FromDiscord | <Phil> Also an examples dir |
14:22:15 | FromDiscord | <arthurmiiengineering> In reply to @isofruit "Call whatever dir contains": perfect, thanks. in python its package, gotta unlearn that i guess :p |
14:22:18 | FromDiscord | <Phil> Implying I want you to write examples π |
14:22:34 | FromDiscord | <arthurmiiengineering> In reply to @isofruit "Implying I want you": yep, got it π
|
14:22:38 | FromDiscord | <danielsokil> Instead of examples, I add a `when IsMainModule` to most my files |
14:23:02 | FromDiscord | <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:14 | FromDiscord | <Phil> In reply to @arthurmiiengineering "perfect, thanks. in python": Actually let me double check |
14:23:18 | FromDiscord | <arthurmiiengineering> In reply to @danielsokil "Instead of examples, I": both? i say both. both is good |
14:23:30 | FromDiscord | <arthurmiiengineering> (edit) "In reply to @danielsokil "Instead of examples, I": both? i say both. both is good ... " added "π" |
14:23:38 | FromDiscord | <Phil> I just did coding in ts , that might fog up my memory |
14:24:42 | FromDiscord | <Phil> I stand corrected: have a <Projectname>.Nim and a <Projectname> dir |
14:24:59 | FromDiscord | <Phil> The Nim file should only define your public API |
14:25:19 | FromDiscord | <Phil> So import and export what is needed |
14:25:35 | FromDiscord | <Phil> (edit) "So import and export what is needed ... " added "from the directory" |
14:26:00 | * | PMunch quit (Quit: Leaving) |
14:26:45 | FromDiscord | <arthurmiiengineering> sent a code paste, see https://play.nim-lang.org/#pasty=Vmwtsbrx |
14:27:12 | FromDiscord | <Phil> Replace Projectname with the name of your lib, but yeah |
14:27:38 | FromDiscord | <Phil> Could also make a contributing.md and license file in the root dir |
14:28:23 | FromDiscord | <arthurmiiengineering> (edit) "https://play.nim-lang.org/#pasty=bRfGGbPP" => "https://play.nim-lang.org/#pasty=BWsqUWFB" |
14:28:40 | FromDiscord | <arthurmiiengineering> In reply to @isofruit "Could also make a": i like to have seperate sections in the docs for users and contributors |
14:29:01 | FromDiscord | <arthurmiiengineering> so i normally just put it there |
14:29:18 | FromDiscord | <Phil> Fair π |
14:29:53 | FromDiscord | <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:06 | strogon14 | arthurmiiengineering: https://nim-lang.github.io/nimble/create-packages.html#project-structure |
14:30:40 | strogon14 | i.e. "mkdir src; mv projectname* src" |
14:30:42 | FromDiscord | <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:55 | FromDiscord | <goerge_lsd> (edit) "checksums" => "" | "procs ... to" added "of a checksum algorithm" |
14:32:25 | FromDiscord | <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:49 | FromDiscord | <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:05 | FromDiscord | <juancarlospaco> What about it?, you just return a `T` |
18:27:48 | FromDiscord | <Phil> I'll take a look |
18:30:11 | FromDiscord | <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:52 | FromDiscord | <Phil> Generally, using "or" in generic types also is asking for trouble like you did in createHasher |
18:31:21 | FromDiscord | <goerge_lsd> oh is that the only problem. I wanted to get rid of that eventually |
18:31:43 | FromDiscord | <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:07 | FromDiscord | <Phil> I'm still walking through it |
18:33:58 | FromDiscord | <Phil> I'd also note that extensive use of type unions is prone to screwing you |
18:34:24 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> Wait what?β΅(@Phil) |
18:44:33 | FromDiscord | <Phil> In reply to @Elegantbeef "Wait what? (<@180601887916163073>)": It has rarely worked out well for me |
18:44:49 | FromDiscord | <Elegantbeef> Generic constraints work fine... are you ok? |
18:44:58 | FromDiscord | <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:01 | FromDiscord | <Elegantbeef> WEll you're holding it wrong |
18:48:59 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=HHiSnGuL |
18:49:55 | FromDiscord | <Elegantbeef> I mean well yea they use a generic in a procedure |
18:49:58 | FromDiscord | <Elegantbeef> That's not due to the typeclass |
18:50:11 | FromDiscord | <Elegantbeef> That's due to not properly instantiating the generic inside `finializeProc` |
18:50:32 | FromDiscord | <Elegantbeef> It's a bug yes, but it's incorrect code |
18:50:58 | FromDiscord | <Phil> The hell, so what, you can't have a generic proc-signature inside a generic typedef? |
18:52:01 | FromDiscord | <Elegantbeef> `DigestGeneric` is a typeclass |
18:52:10 | FromDiscord | <Elegantbeef> You did not specify the value inside the object definition |
18:52:16 | FromDiscord | <Elegantbeef> So what type does it have? |
18:52:58 | FromDiscord | <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:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=rCNXitgS |
18:53:29 | FromDiscord | <Elegantbeef> Anyway the best solution is the tuple based one I linked eons ago |
18:53:51 | FromDiscord | <goerge_lsd> somehow this felt more logical : P although I lack the generic logic to write it : P |
18:54:21 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=PTRHJVnH for context phil |
18:54:55 | FromDiscord | <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:35 | FromDiscord | <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:41 | FromDiscord | <Elegantbeef> well `hashFinish` |
18:59:26 | FromDiscord | <goerge_lsd> I was planning to get rid of char / uint8, by writing wrapper functions to the checksums module |
19:00:14 | FromDiscord | <goerge_lsd> @ringabout any good reason for using both char and uint8 for data in `checksums` ? : ) |
19:02:35 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=ZQFzLrzL there we go solved most of it |
19:04:11 | FromDiscord | <goerge_lsd> so what does that macro do again, in layman's terms ? : ) |
19:04:35 | FromDiscord | <goerge_lsd> oh from tuple to digest type |
19:04:38 | FromDiscord | <Elegantbeef> Takes `tuple[name: T]` and turns it into `tuple[name: typeof(T.hashFinish())]` |
19:07:23 | * | def- quit (Quit: -) |
19:10:49 | FromDiscord | <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:56 | FromDiscord | <goerge_lsd> (edit) "what" => "how" |
19:13:30 | * | def- joined #nim |
19:24:29 | FromDiscord | <Elegantbeef> That's the fun part, you don't |
19:25:45 | FromDiscord | <goerge_lsd> that's a no go then |
19:27:54 | FromDiscord | <Elegantbeef> Yep you have to go the lame way of non extensibility if you want to do this runtime switching |
19:28:54 | FromDiscord | <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:09 | FromDiscord | <goerge_lsd> not sure what extensibility you think of |
19:29:31 | FromDiscord | <Elegantbeef> The ability for any user to add any hash without forking a project π |
19:37:22 | * | ntat quit (Quit: Leaving) |
19:42:13 | FromDiscord | <goerge_lsd> so aliasing types in generic parameter is done with Type1: Type2 ? I thought it's `=` |
19:42:28 | FromDiscord | <Elegantbeef> That's not aliasing that's constraining |
19:44:25 | FromDiscord | <goerge_lsd> and what's with the {.nimcall.} annotation |
19:55:29 | * | PMunch joined #nim |
20:07:44 | FromDiscord | <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:52 | FromDiscord | <goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=PifdNhQW |
20:17:53 | FromDiscord | <goerge_lsd> this works |
20:17:54 | FromDiscord | <griffith1deadly> In reply to @goerge_lsd "and what's with the": ensure that its nim proc, not closure ... etc |
20:18:45 | FromDiscord | <goerge_lsd> I think I should use typedescs here? |
20:20:16 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=HUreMDWQ |
20:20:27 | FromDiscord | <griffith1deadly> its compile time switching |
20:21:18 | FromDiscord | <goerge_lsd> So I should look into methods then ? |
20:21:36 | FromDiscord | <griffith1deadly> ref object & methods |
20:21:39 | FromDiscord | <griffith1deadly> so yes |
20:22:36 | FromDiscord | <griffith1deadly> note: with ref objects `is` not worked |
20:22:51 | FromDiscord | <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:12 | FromDiscord | <Robyn [She/Her]> What are the rules for the name of a Nim package? First letter is alphabetical, rest is alphanumerical? |
20:40:46 | FromDiscord | <Robyn [She/Her]> Are non-ascii characters allowed in the name? |
20:41:06 | FromDiscord | <Robyn [She/Her]> Any length requirement? |
20:41:24 | FromDiscord | <sOkam! π«> how does one add a `--path:/THE/PATH/DIR` option to a `nim.cfg` file? |
20:41:41 | FromDiscord | <sOkam! π«> I thought that was the syntax, but apparently nim doesn't like that |
20:42:41 | * | def- joined #nim |
20:42:57 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "how does one add": Have you tried `path=`? |
20:43:23 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=shcXdkiL |
20:43:29 | FromDiscord | <Robyn [She/Her]> @sOkam! π« |
20:44:30 | FromDiscord | <Elegantbeef> @Robyn [She/Her] a nim module has to be a valid Nim identifier |
20:44:49 | FromDiscord | <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:05 | FromDiscord | <Elegantbeef> RTFM |
20:46:37 | FromDiscord | <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:53 | FromDiscord | <sOkam! π«> `--path:thing` is incorrect, but `--path:"thing"` is valid π€·ββοΈ |
20:47:09 | FromDiscord | <sOkam! π«> your snipped made me realize i wasn't using quotes, tyty π |
20:47:13 | FromDiscord | <sOkam! π«> (edit) "snipped" => "snippet" |
20:47:29 | * | def- joined #nim |
20:52:38 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "RTFM": :pain: |
20:52:47 | FromDiscord | <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:55 | FromDiscord | <sOkam! π«> is there a non-manual way to make a copy of a `ref` type? |
21:22:22 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=gpAseGay |
21:22:56 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=MTVULUyk |
21:23:06 | FromDiscord | <sOkam! π«> dind't know that existed |
21:23:21 | FromDiscord | <Robyn [She/Her]> It's behind a compiler flag but you should look into it |
21:24:16 | FromDiscord | <sOkam! π«> i don't like experimental features. they over-complicate the buildsystem |
21:24:24 | FromDiscord | <sOkam! π«> is there any alternative? |
21:25:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=OjkqthSL |
21:25:12 | FromDiscord | <Elegantbeef> If you only want a shallow copy |
21:25:14 | FromDiscord | <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:24 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "If you only want": Yeah this means any nested references aren't copied |
21:25:33 | FromDiscord | <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:47 | FromDiscord | <Robyn [She/Her]> You could always copy the implementation yourself? |
21:25:58 | FromDiscord | <sOkam! π«> for `PNode`? you kiddin |
21:26:23 | FromDiscord | <Elegantbeef> I think there is a deep copy impl for PNode |
21:26:25 | FromDiscord | <sOkam! π«> very unmaintainable, but that would work for simpler cases |
21:26:42 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "I think there is": oh is there. any clue how its named, roughly? |
21:26:48 | FromDiscord | <sOkam! π«> that would be really handy |
21:27:55 | FromDiscord | <Robyn [She/Her]> https://github.com/nim-lang/Nim/issues/23460 not sure how good it is |
21:28:11 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "for `PNode`? you kiddin": Oh damn, there's no `copyNimTree` or something? |
21:29:00 | FromDiscord | <Elegantbeef> `copyTree` iirc |
21:29:13 | FromDiscord | <Robyn [She/Her]> So then shouldn't be an issue for sOkam |
21:31:27 | FromDiscord | <sOkam! π«> that was it. ty beef!! π |
21:32:09 | FromDiscord | <sOkam! π«> the ast file has SO much stuff in it, that it is really hard to even know that functionality exists already |
21:40:47 | FromDiscord | <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:14 | FromDiscord | <sOkam! π«> if PMunch made it, `PMan` would fit like a damn glove π |
21:43:36 | FromDiscord | <MDuardo> Nargo πβ΅(Sounds dumb) |
21:44:09 | FromDiscord | <threefour> In reply to @MDuardo "Nargo π (Sounds dumb)": Sounds like a drug dealer themed package manager |
21:44:11 | FromDiscord | <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:18 | FromDiscord | <threefour> (edit) "dealer" => "trafficker" |
21:44:38 | FromDiscord | <sOkam! π«> In reply to @threefour "Sounds like a drug": lol yeah, so close to `narko` π |
21:45:16 | FromDiscord | <sOkam! π«> @Robyn [She/Her] chatgpt is next level incredible for this type of stuff. big time recommend |
21:45:46 | FromDiscord | <sOkam! π«> it throws out a bunch of garbo, but it also outputs some absolute gems |
21:46:36 | * | jmdaemon joined #nim |
21:47:23 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "<@524288464422830095> chatgpt is next": Hmmm yeah I'll probably use that |
21:47:52 | FromDiscord | <sOkam! π«> What features do you have in mind, btw? curious on your approach |
21:59:45 | FromDiscord | <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:06 | FromDiscord | <Robyn [She/Her]> Also I'll be using toml |
22:00:15 | FromDiscord | <Robyn [She/Her]> I am using Cargo as inspiration tho |
22:01:48 | FromDiscord | <MDuardo> Question, is TOML really that complex?β΅β΅Read something about having a lot of features and stuff along those lines |
22:01:48 | FromDiscord | <Elegantbeef> parcel is a good name for a package delivery program π |
22:01:48 | FromDiscord | <Elegantbeef> Anything postal related |
22:01:52 | FromDiscord | <sOkam! π«> intrigued to see what you come up with |
22:02:09 | FromDiscord | <sOkam! π«> parcel is great |
22:02:10 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "parcel is a good": As a package manager though? |
22:02:20 | FromDiscord | <Elegantbeef> Yes |
22:02:24 | FromDiscord | <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:37 | FromDiscord | <sOkam! π«> yeah, same reason why i'm intrigued |
22:02:42 | FromDiscord | <sOkam! π«> nimble can get on your nerves real fast |
22:04:15 | FromDiscord | <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:29 | FromDiscord | <MDuardo> The only problem I have with Nimble is that the Nim LSP marks everything inside a .nimble file as error |
22:04:30 | FromDiscord | <MDuardo> π |
22:04:54 | FromDiscord | <sOkam! π«> In reply to @MDuardo "The only problem I": i posted a potential fix recently, but it never got implemented |
22:05:51 | FromDiscord | <MDuardo> Really hope this gets implemented, it would be so nice to haveβ΅(@sOkam! π«) |
22:06:53 | FromDiscord | <sOkam! π«> @MDuardo https://discord.com/channels/371759389889003530/371759389889003532/1165216271281946635 |
22:07:15 | FromDiscord | <sOkam! π«> well you are not on discord, let me repost I guess, since its fixable locally |
22:07:32 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=uERAWWSM |
22:08:01 | FromDiscord | <sOkam! π«> That will make the nimls not freak out on any nims file (not just nimble files) |
22:08:47 | FromDiscord | <MDuardo> Where's the link for joining Nim's Discord?β΅I'd like to enter |
22:08:50 | FromDiscord | <sOkam! π«> Its basically missing that import, because it reads all files as if they were `.nim` |
22:09:17 | FromDiscord | <sOkam! π«> idk where it is, but here is a link https://discord.gg/G5xDvFsx |
22:09:19 | FromDiscord | <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:36 | FromDiscord | <sOkam! π«> the lsp should do that import, given how it works atm |
22:12:07 | FromDiscord | <sOkam! π«> seems like `copyTree` has issues too, @ElegantBeef π¦ |
22:12:54 | FromDiscord | <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:17 | FromDiscord | <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:14 | FromDiscord | <sOkam! π«> that's what nimble does, but using the package name instead of a subfolder |
22:26:16 | FromDiscord | <sOkam! π«> same issue |
22:26:45 | FromDiscord | <sOkam! π«> if I'm working on local, I don't have a damn commit hash at all. and that breaks the setup |
22:27:26 | FromDiscord | <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:00 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "if I'm working on": For local, it'd simply use `{pkg name}/local/{version}` |
22:28:27 | FromDiscord | <sOkam! π«> same problem, but now you are locked behind tagging locally to start working |
22:28:52 | FromDiscord | <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:55 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "same problem, but now": I'd imagine you'd just do `parcel use {local}` |
22:29:23 | FromDiscord | <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:42 | FromDiscord | <Robyn [She/Her]> Honestly this is just a collection of ideas that'll absolutely change anyway |
22:29:51 | FromDiscord | <sOkam! π«> if you want my opinion, follow what npm does. its a local-first package manager |
22:30:03 | FromDiscord | <sOkam! π«> you have to opt-in into global install |
22:30:06 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "if you want my": I don't know what npm does tbh |
22:30:14 | FromDiscord | <Robyn [She/Her]> In reply to @heysokam "you have to opt-in": I was gonna do something more like `pnpm` |
22:30:42 | FromDiscord | <sOkam! π«> `nimpm` should work too, now that you mention |
22:30:42 | FromDiscord | <Robyn [She/Her]> Installs to a global folder but also uses a local folder with symlinks |
22:31:18 | FromDiscord | <sOkam! π«> In reply to @chronos.vitaqua "Installs to a global": that's why i'm specifying what npm does |
22:31:41 | FromDiscord | <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:08 | FromDiscord | <goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=ogZLmqNp |
23:11:54 | FromDiscord | <Elegantbeef> No cause you wanted runtime descrimination |
23:12:02 | FromDiscord | <Elegantbeef> Use object variants or inheritance |
23:12:06 | FromDiscord | <goerge_lsd> Right now I just want to learn : ) |
23:12:49 | FromDiscord | <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:28 | FromDiscord | <Elegantbeef> Right then why would you even use a generic `newHasher` |
23:15:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=UNyLuYPB |
23:22:53 | FromDiscord | <goerge_lsd> hmmm |
23:23:47 | FromDiscord | <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:33 | FromDiscord | <Elegantbeef> Could use `typedesc`s then and use `init` after |
23:25:16 | FromDiscord | <goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=xvAJGjLB |
23:26:30 | FromDiscord | <goerge_lsd> I can't use a static value enum instead of typedesc? |
23:26:42 | * | jmdaemon quit (Ping timeout: 268 seconds) |
23:27:16 | FromDiscord | <Elegantbeef> Yea |
23:27:33 | FromDiscord | <Elegantbeef> You can |
23:27:57 | FromDiscord | <goerge_lsd> but.. how do you discriminate between them ? |
23:28:06 | FromDiscord | <goerge_lsd> I need to write a newHasher proc for each kind |
23:28:08 | FromDiscord | <Elegantbeef> `when x == y` |
23:28:10 | FromDiscord | <goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=ckkYKeZA |
23:28:15 | FromDiscord | <goerge_lsd> oh |
23:29:30 | FromDiscord | <goerge_lsd> wait, this doesn't work like expected |
23:30:05 | FromDiscord | <goerge_lsd> sent a code paste, see https://play.nim-lang.org/#pasty=YjAkGibq |
23:30:15 | FromDiscord | <goerge_lsd> overloaded 'newHasher' leads to ambiguous calls |
23:30:16 | FromDiscord | <Elegantbeef> Well yea you have the same proc twice |
23:30:45 | * | jmdaemon joined #nim |
23:31:00 | FromDiscord | <Elegantbeef> `proc newHasher(hash: static HashType): auto` is your type definition |
23:33:53 | FromDiscord | <goerge_lsd> woop, that actually works |
23:34:12 | FromDiscord | <goerge_lsd> you're hired. When can you start ? |
23:34:35 | FromDiscord | <Elegantbeef> Technically this can all be done using a hacky around converters |
23:41:25 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=EtWBjKFV if one wanted to really be funny |
23:54:01 | FromDiscord | <goerge_lsd> what's that `0` in `.[val](0)` on the last line |
23:54:50 | FromDiscord | <Elegantbeef> The type is a distinct int |