00:01:29 | FromDiscord | <graveflo> I prefer to write with generics for stuff like this, but the std lib wasn't designed with this pattern in mind so maybe that change wouldn't be accepted unless it is very comprehensive and not part of `system.nim` or `io` or something like that. There is a reason to keep those minimal in their abuse of lang features. Still there are a lot of convenience procs that could be added somewhere |
00:02:07 | FromDiscord | <grumblygibson> @graveflo interesting, I actually tried without the `auto` and it doesn't work without a return type specified. Is there a reason why you think it would work without? |
00:04:08 | FromDiscord | <graveflo> `proc parse[T](v: string): T =` |
00:04:43 | FromDiscord | <graveflo> `proc parseImpl[T](v: string, tds: typedesc[T]): T =` |
00:05:20 | FromDiscord | <grumblygibson> I guess I prefer Status' syntax here. |
00:11:25 | * | jmdaemon joined #nim |
00:15:11 | FromDiscord | <grumblygibson> sent a code paste, see https://play.nim-lang.org/#pasty=OjIlowdELOLi |
00:17:31 | FromDiscord | <Elegantbeef> > Status' syntax? |
00:19:00 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=AtTGJzncpvph |
00:19:24 | FromDiscord | <grumblygibson> In reply to @Elegantbeef "Given you do not": Does the parseInt, for example, do some special stuff to "cover all ints"? I'm not sure what this means. |
00:20:48 | FromDiscord | <Elegantbeef> It does not no cause you cannot do `myUint8 = parseInt` |
00:21:03 | FromDiscord | <Elegantbeef> You'd need to use `std/parseutils` and range check |
00:22:39 | FromDiscord | <grumblygibson> In reply to @graveflo "can also do this,": Sorry I'm dense when it comes to parts of the language I don't use much - what does this enable? |
00:23:34 | FromDiscord | <graveflo> I don't think it does much of anything differently except standardized the `mixin` which is not better or worse. Just depends on how you want it to be used |
00:23:55 | FromDiscord | <graveflo> (edit) "standardized" => "standardizes" |
00:24:30 | FromDiscord | <Elegantbeef> it allows you to define your own `parseImpl` for any type in the future |
00:25:00 | FromDiscord | <grumblygibson> In reply to @Elegantbeef "> Status' syntax?": The Nim style guide that Status publishes I found very helpful. Not everything I agree with. |
00:25:03 | FromDiscord | <Elegantbeef> Though the mixin is not really needed due to how sym binding works |
00:26:52 | FromDiscord | <graveflo> `mixin` and `bind` are weird. Sometimes I need them and sometimes I don't. Sometimes it depends on which version of Nim I'm using. What's the point of `mixin` anyway then |
00:27:06 | FromDiscord | <graveflo> `bind` has never worked for me at all |
00:27:07 | FromDiscord | <Elegantbeef> It forces symbols open |
00:27:16 | FromDiscord | <Elegantbeef> `bind` forces symbols close |
00:27:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=DNYGrLvpCQiN |
00:27:51 | FromDiscord | <graveflo> in what context though. You can't just close a symbol without picking one. It's the closing context that would matter |
00:27:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=nGZJFWwCHuRL |
00:28:14 | FromDiscord | <Elegantbeef> A closed symbol is one that only considers the declaration's scope |
00:28:21 | FromDiscord | <Elegantbeef> An open symbol considers the declaration and instantiation scope |
00:28:43 | FromDiscord | <graveflo> yea that part has never worked for me. Binding a symbol will still pick stuff from the client code's scope |
00:28:52 | FromDiscord | <Elegantbeef> It really doesn't |
00:28:58 | FromDiscord | <Elegantbeef> Atleast in my experience it works fine |
00:29:02 | FromDiscord | <graveflo> its not supposed to |
00:31:21 | FromDiscord | <Elegantbeef> I should say I almost never use bind though |
00:31:33 | FromDiscord | <Elegantbeef> There are very few cases where a closed symbol makes sense ime |
00:32:51 | FromDiscord | <graveflo> yea I just tested it and `mixin` is needed or it will pick symbols closer to the defined scope |
00:34:18 | FromDiscord | <Elegantbeef> I mean that's the point of predefined procedures |
00:34:30 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=gwmnnFSaxoIA |
00:34:31 | FromDiscord | <Elegantbeef> You do not predefine procedures if you want the user to override them |
00:35:41 | FromDiscord | <graveflo> not necessarily true. If you are using the type variable as a parameter anyway you might want to enable overload resolution from the calling context |
00:35:46 | FromDiscord | <Elegantbeef> You're moreso describing a template |
00:36:30 | FromDiscord | <Elegantbeef> Also you export the generic |
00:37:46 | FromDiscord | <Elegantbeef> I'd argue that if you want to enable overloaded procedures you use a `static proc(...):...` |
00:38:16 | FromDiscord | <Elegantbeef> Atleast if you want supposed 0 cost overloading 😄 |
00:39:14 | FromDiscord | <graveflo> well this doesn't look like a template to me at all and I'm not sure what cost you are avoiding and you lost me on the static proc LOL but w/e |
00:39:44 | FromDiscord | <graveflo> this is the way to makes sense to me to make a structured modular dispatch that is based on a typedescr |
00:40:17 | FromDiscord | <Elegantbeef> Instead of using Nim's generic overloading you just do `proc parse[T](s: string, prc: static proc(s: string): T): T` |
00:41:09 | FromDiscord | <graveflo> that is will using the overloading, its just overloading on tyProc instead of tyTyepdesc. Plus that looks like a lot more work |
00:41:25 | FromDiscord | <Elegantbeef> I mean that allows you to actually supply a specific proc where you want |
00:42:09 | FromDiscord | <Elegantbeef> Anyway Nim's dispatch rules generally are what people want, but YMMV 😄 |
00:42:21 | FromDiscord | <graveflo> that's true but you still have to refer to the proc which has the same semantics as the symbols in the other method. That just seems like a more convoluted way of doing it. |
00:42:46 | FromDiscord | <Elegantbeef> It's not really convoluted it's a completely different semantic |
00:43:43 | FromDiscord | <grumblygibson> Nice. The indirection is usually why I avoid passing procs around, but for cases like this `static proc` looks clear, fast, and easy to use. |
00:45:12 | FromDiscord | <graveflo> yea itll be a different semantic but that is just in symbol resolution of the parameters vs the parameters wrapped in a proc definition. Some of the types used in the resolution will be utilized differently and at different times. Not sure why one would be preferred. I wouldn't go using proc types unless it was part of the data model. like in a `void ` kind of way. |
00:45:41 | FromDiscord | <Elegantbeef> Eh depends what you're doing of course |
00:45:48 | FromDiscord | <graveflo> or if I was forced to by other means |
00:45:54 | FromDiscord | <Elegantbeef> In the above parse example I can hardly imagine a case where you actually want to use a different parseimpl for a type |
00:46:00 | FromDiscord | <Elegantbeef> If you did you could wrap it in a distinct for parsing |
00:46:54 | FromDiscord | <Elegantbeef> Especially since generics are instantiated once, so changing the underlying `parseImpl` could break other code |
00:47:19 | FromDiscord | <graveflo> that's true. I'm too lazy to see how it interacts with inheritance and the other hierarchical generic rules. as long as it doesn't greedy bind then that is an acceptable take in my mind. Still I dont think the mixin hurts anything so I would do it anyway |
00:47:41 | FromDiscord | <Elegantbeef> Oh I almost always use mixin in generics that have interfaces |
00:47:44 | FromDiscord | <Elegantbeef> As it's good documentation |
00:47:49 | FromDiscord | <graveflo> I prefer the "you can change it if you want but if it breaks it's own you" philosophy |
00:48:12 | FromDiscord | <Elegantbeef> well it'd silently break so that's not ideal |
00:48:13 | FromDiscord | <graveflo> (edit) "own" => "on" |
00:48:26 | FromDiscord | <Elegantbeef> Though worth noting due to generics changing import order can change a program's behaviour |
00:49:37 | FromDiscord | <graveflo> yea that is not necessarily the goal for things like this. It could be, but that is more niche. The implementations would have to have a well understood contract. |
00:50:10 | FromDiscord | <graveflo> Now I am curious how the non mixed in bindings work with overload resolution, bc if they are greedy that would be an annoying choice to make |
00:51:03 | FromDiscord | <Elegantbeef> https://wandbox.org/permlink/wq6EKN4Om9K6Dcmw an example works |
00:51:31 | FromDiscord | <Elegantbeef> Change that when to change the entire program |
00:52:09 | FromDiscord | <graveflo> actually if `bind` worked that could be a way to stop that from happening. as in, "Im writing code that is sensitive to this particular implementation of X" |
00:52:11 | FromDiscord | <Elegantbeef> Whether this is necessarily "wrong" is an interesting question |
00:52:19 | FromDiscord | <Elegantbeef> I mean it does work ime |
00:52:32 | FromDiscord | <graveflo> yea it's not wrong, but I think typically you would not want that to happen like you said |
00:52:47 | FromDiscord | <Elegantbeef> https://wandbox.org/permlink/KiIQl2B61LTmdfuN works |
00:53:33 | FromDiscord | <graveflo> Ive only ever tried to use `bind` in templates. I think that is what confuses the compiler |
00:53:44 | FromDiscord | <graveflo> and inline iterators I think |
00:53:47 | FromDiscord | <Elegantbeef> Oh `bind` in templates is not the same as `bind` in procs |
00:53:52 | FromDiscord | <graveflo> >.> |
00:54:03 | FromDiscord | <Elegantbeef> I find `bind` in templates works more like `mixin` in procs |
00:54:05 | FromDiscord | <Elegantbeef> I could be wrong |
00:55:13 | FromDiscord | <Elegantbeef> Actually `bind` just might not work inside templates, I do not recall |
00:56:14 | FromDiscord | <Elegantbeef> https://stackoverflow.com/a/74077789/15200657 scroll down for my variation of the unroll but yea this compiles even without `macros` imported, but `bind` didn't work |
00:56:23 | FromDiscord | <graveflo> yea it looks like the bindings are lazy without `mixin` too, so I'm probably going to still use it in these situations |
00:56:39 | FromDiscord | <graveflo> (edit) "lazy" => "greedy (no lazy)" |
00:57:35 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=IVzzWaPgijUF |
00:58:02 | FromDiscord | <graveflo> that prints 1 but commenting the `mixin` line prints 0 |
00:58:17 | FromDiscord | <Elegantbeef> That's not an overloaded symbol without mixin |
00:58:25 | FromDiscord | <Elegantbeef> With mixin it's tightly bound |
00:58:27 | FromDiscord | <Elegantbeef> Without\ |
00:58:40 | FromDiscord | <Elegantbeef> Nim tightly binds to procedures with a single symbol |
00:58:46 | FromDiscord | <Elegantbeef> It open symbols for overloaded |
00:58:48 | FromDiscord | <graveflo> so if I add another definition it's not tightly bound then? |
00:58:53 | FromDiscord | <Elegantbeef> It closes only `bind` |
00:58:54 | FromDiscord | <Elegantbeef> Yes |
00:58:58 | FromDiscord | <graveflo> kk itry |
00:59:16 | FromDiscord | <graveflo> yep ur right |
00:59:51 | FromDiscord | <graveflo> okay nice. This has been educational LOL |
01:00:30 | FromDiscord | <Elegantbeef> I should document this inside my code reuse writeup 😄 |
01:00:37 | FromDiscord | <Elegantbeef> I think I did, I do not recall |
01:02:00 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/writeups/codereuse.html I do not, but this still might interest you |
01:19:40 | FromDiscord | <graveflo> after all this it just makes me want the "weak distinct" more. I use `distinct` a lot and I usually want that behavior instead. |
01:20:37 | FromDiscord | <graveflo> It's annoying constantly making lifting templates and copy/pasting them around |
01:21:32 | FromDiscord | <Elegantbeef> "lifting templates"? |
01:22:04 | FromDiscord | <graveflo> for all distinct ints youd call `borrowIntShit(myType)` and it defines all of the int bindings with `borrow` |
01:22:24 | FromDiscord | <graveflo> but of course it's only some of them |
01:22:29 | FromDiscord | <Elegantbeef> Just define a converter to and from and cry about errors |
01:22:38 | FromDiscord | <graveflo> yea exactly |
01:24:04 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/blob/master/lender.nim#L226-L242 I do have this interesting macro for declarative borrows |
01:38:05 | * | dtomato joined #nim |
01:42:05 | * | def- quit (Quit: -) |
01:44:11 | * | def- joined #nim |
01:47:18 | FromDiscord | <varriount> sent a code paste, see https://play.nim-lang.org/#pasty=OTEfuUTnDDTG |
01:47:41 | FromDiscord | <varriount> (edit) "https://play.nim-lang.org/#pasty=ORXNsyyccUZA" => "https://play.nim-lang.org/#pasty=OQQZrydLLAyN" |
01:49:06 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=aYhzQbdHIwrO |
02:08:16 | * | jmdaemon quit (Ping timeout: 255 seconds) |
02:08:28 | * | jkl quit (Quit: Gone.) |
02:10:22 | * | jkl joined #nim |
02:10:25 | FromDiscord | <varriount> sent a code paste, see https://play.nim-lang.org/#pasty=gAagFDEDALZd |
02:17:55 | * | jmdaemon joined #nim |
02:30:13 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
02:30:33 | * | jmdaemon joined #nim |
02:37:41 | * | jmdaemon quit (Ping timeout: 272 seconds) |
03:19:34 | * | rockcavera quit (Remote host closed the connection) |
04:04:40 | * | derpydoo quit (Ping timeout: 246 seconds) |
04:58:02 | * | krux02 quit (Remote host closed the connection) |
05:03:27 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
06:46:11 | * | advesperacit joined #nim |
07:01:51 | Amun-Ra | Elegantbeef: home in https://www.jasonbeetham.com/writeups/codereuse.html leads to /writeups/ instrad of /writeups.html |
07:04:06 | FromDiscord | <Elegantbeef> Right someone should remove those buttons |
07:05:16 | FromDiscord | <Elegantbeef> Jokes aside I'll get off my ass, thanks |
07:21:56 | FromDiscord | <Robyn [She/Her]> Wouldn't it be really easy to make a trait impl using concepts? |
07:22:16 | FromDiscord | <Elegantbeef> We went over this before robyn |
07:22:22 | FromDiscord | <Elegantbeef> That was traitor 0.1.x |
07:22:30 | FromDiscord | <Elegantbeef> It sucks cause it's so macro ridden |
07:22:37 | FromDiscord | <Robyn [She/Her]> All you'd need to do is `template implement[T: MyConcept](t: T) = discard`? |
07:22:40 | FromDiscord | <Robyn [She/Her]> Ah |
07:22:44 | FromDiscord | <Robyn [She/Her]> Ignore me then |
07:22:51 | FromDiscord | <Robyn [She/Her]> My memory sucks really bad |
07:22:52 | FromDiscord | <Elegantbeef> No it does not work that way |
07:22:55 | FromDiscord | <Elegantbeef> Cause you need to emit a vtable |
07:23:11 | FromDiscord | <Elegantbeef> And cause the types are not existential you cannot have a `Trait[T]` so you need to store indexes of the traits you've implemented |
07:23:21 | FromDiscord | <Robyn [She/Her]> Ah |
07:23:33 | FromDiscord | <Robyn [She/Her]> Fun then |
07:23:34 | FromDiscord | <Elegantbeef> So now you have `Trait[[0, 1, 2]]` and need a macro to convert `[0, 1, 2]` to types to check |
07:24:07 | * | NimEventer quit (Remote host closed the connection) |
07:24:14 | FromDiscord | <Elegantbeef> Well you only need an integer I guess I was doing some silly overlapping trait system |
07:24:21 | * | NimEventer joined #nim |
07:24:29 | FromDiscord | <Elegantbeef> Where you could do `Trait[[A, B]]` and have a union of A and B |
07:26:19 | FromDiscord | <Robyn [She/Her]> Fair |
07:26:27 | FromDiscord | <Elegantbeef> But that made it more complex |
07:26:27 | FromDiscord | <Elegantbeef> Honestly the `type Trait = distinct tuple[_: Atom, ...]` I do with traitor is hands down the best |
07:26:27 | FromDiscord | <Elegantbeef> Whilst yes it is a `distinct tuple` it does not use a macro to declare any type |
07:26:28 | FromDiscord | <Elegantbeef> it requires a single `implTrait MyTrait` and then you can do `myVal.toTrait MyTrait` |
07:26:28 | FromDiscord | <Elegantbeef> hmph seems one cannot change where home points in nimib |
07:26:32 | FromDiscord | <Elegantbeef> If you want a trait system try traitor |
07:26:58 | FromDiscord | <Elegantbeef> It has `AnyTrait[T]` so you can write a procedure that works on value types or boxed trait types |
07:27:18 | FromDiscord | <Robyn [She/Her]> I'll probably look into using it, it might have some usecases in my MC server once I get to entities |
07:27:22 | FromDiscord | <Elegantbeef> `AnyTraitor`\ |
07:27:40 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "It has `AnyTrait[T]` so": Fun |
07:27:52 | FromDiscord | <Elegantbeef> http://www.jasonbeetham.com/traitor/traitor.html#ValidTraitor it has this gnarly concept 😄 |
07:28:31 | FromDiscord | <Elegantbeef> http://www.jasonbeetham.com/traitor/traitor/streams.html but yea if you have not seen, it's quite awesome |
07:28:54 | FromDiscord | <Robyn [She/Her]> Fair |
07:29:55 | FromDiscord | <Elegantbeef> It's slightly slower to dispatch than Nim's OOP sadly, but it gets us away from inheritance trees and does not require more work to get a value type |
07:30:04 | FromDiscord | <Elegantbeef> Which means it's simple as hell to write GC hooks |
07:30:46 | FromDiscord | <Elegantbeef> My file stream self closes for instance |
07:33:48 | FromDiscord | <amaank404> i wonder, was it actually hard to make the matrix, discord and irc co operate in sync? |
07:33:53 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "It's slightly slower to": Fair |
07:34:20 | FromDiscord | <Elegantbeef> IRC is done with a Nim bot, but the other bridge is just t2bot |
07:35:21 | FromDiscord | <Robyn [She/Her]> Tbh, I think Traitor looks nicer than `method` |
07:37:21 | FromDiscord | <Elegantbeef> I try |
07:38:07 | FromDiscord | <Robyn [She/Her]> And you ate (lol) |
07:39:10 | * | PMunch joined #nim |
07:39:16 | FromDiscord | <Elegantbeef> god that was a stretch that took the entire fibre of my being to understand |
07:45:54 | FromDiscord | <Robyn [She/Her]> Get with the times boomer 😛 |
07:46:01 | FromDiscord | <Robyn [She/Her]> I got that skibidi rizz~ |
07:46:23 | FromDiscord | <Elegantbeef> I hope that you perpetually get hang nails |
07:46:25 | FromDiscord | <Robyn [She/Her]> I'm totes tubular |
07:46:27 | FromDiscord | <Robyn [She/Her]> XD |
07:47:00 | FromDiscord | <Elegantbeef> Just for that I'm closing up shop, no more Nim. I'm a Rust user now |
07:47:07 | FromDiscord | <Robyn [She/Her]> Pffff |
07:47:11 | FromDiscord | <Elegantbeef> I'm all about those `pub fn name_do_stuff(){...}` |
07:47:57 | FromDiscord | <Robyn [She/Her]> Jokes on you, I'm in the Rust community too :) |
07:48:19 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I'm all about those": I do dislike this though |
07:48:24 | FromDiscord | <Elegantbeef> Odin? |
07:48:26 | FromDiscord | <zumi.dxy> `present.unwrap()`↵↵...and the prize is a `panic!()` |
07:48:43 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Odin?": Not in Odin but I'll try it just for you :) |
07:48:56 | FromDiscord | <Robyn [She/Her]> In reply to @zumi.dxy "`present.unwrap()` ...and the": Fun! |
07:49:16 | FromDiscord | <Robyn [She/Her]> Tbf you aren't supposed to unwrap unless you're fine with a panic or can guarantee there's something in it |
07:51:29 | FromDiscord | <Elegantbeef> Next you'll tell me I'm not supposed to do `{.cast(raises: []).}: ...` |
07:54:43 | FromDiscord | <zumi.dxy> Rust seems to love method chaining abstract stuff↵Some people don't think it's boilerplate because "data operations are made explicit"↵but it often makes it harder to me to tell what the code does at a high level |
07:55:00 | FromDiscord | <zumi.dxy> that's kind of my surface level gripe with it |
07:57:59 | * | SchweinDeBurg joined #nim |
07:58:22 | NimEventer | New Nimble package! littlefs - API and bindings for littlefs. Includes a fuse implementation., see https://github.com/Graveflo/nim-littlefs |
08:04:16 | FromDiscord | <Robyn [She/Her]> Fair |
08:23:02 | FromDiscord | <odexine> Nice |
08:24:12 | FromDiscord | <Elegantbeef> > might have to enable co-variance to use the API functions↵Now someone is just taking the piss |
08:28:57 | FromDiscord | <graveflo> LOL I haven't even tried that once |
08:35:40 | FromDiscord | <graveflo> wait, is covariance enabled all the time? Can you just annotate something with `var X` and then pass a `ref X` or `ptr X` to it and it just works? |
08:37:56 | FromDiscord | <odexine> i think theyd still have to dereference it but otherwise |
08:39:36 | FromDiscord | <graveflo> yea nvm, this looks like something else entirely |
08:41:33 | FromDiscord | <graveflo> one day I'll figure out what to do about `var X | ref X | ptr X` |
09:20:20 | FromDiscord | <Elegantbeef> @graveflo what do you mean figure out what to do about them? |
09:28:41 | FromDiscord | <graveflo> you know what. I don't even know. It's about time I stop programming for today. I keep getting into situations where I'm writing procs that want to be invariant like that, but it seems like some projects don't need it at all so maybe I'm just being weird |
09:40:18 | FromDiscord | <Elegantbeef> Hmm a typeclass with var does lose the varness |
09:40:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=jkVSOgwZwAmF |
09:40:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=PXtAKzZyCXrf |
10:11:41 | * | xet7 joined #nim |
10:23:37 | NimEventer | New Nimble package! curlies - A macro for object construction using {} (curlies)., see https://github.com/svenrdz/curlies |
10:27:02 | FromDiscord | <whisperecean> Is someone from status here? I can't pull in toml serialization it fails on stew/enums |
10:27:21 | PMunch | whisperecean, maybe try parsetoml instead? |
10:31:14 | PMunch | Hmm, curlies looks cool. But that's a lot of code :S |
10:47:10 | FromDiscord | <nnsee> In reply to @whisperecean "Is someone from status": i had this exact issue |
10:47:11 | FromDiscord | <nnsee> https://discord.com/channels/371759389889003530/371759389889003532/1141692874988199957 |
11:03:42 | NimEventer | New Nimble package! tagforge - A library made for the serialisation and deserialisation of MC NBT!, see https://github.com/Nimberite-Development/TagForge-Nim |
11:29:43 | FromDiscord | <Robyn [She/Her]> Eyyyy |
11:30:16 | FromDiscord | <Robyn [She/Her]> @nnsee did you see my message earlier? :p |
11:40:59 | * | lucasta joined #nim |
11:54:30 | FromDiscord | <arnetheduck> In reply to @whisperecean "Is someone from status": wipe your nimble cache and start over, that usually fixes things |
11:55:08 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "<@961485620075720734> did you see": yup! well done |
11:59:44 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "yup! well done": Thanks! :D |
11:59:57 | FromDiscord | <Robyn [She/Her]> Hope it works for you if you continue any MC dev- |
12:08:25 | * | xet7 quit (Remote host closed the connection) |
12:14:57 | * | rockcavera joined #nim |
12:34:50 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "Hope it works for": haha yup, thanks |
12:36:02 | FromDiscord | <Robyn [She/Her]> Of course :D |
13:56:34 | * | lucasta quit (Quit: Leaving) |
14:07:05 | FromDiscord | <summarity> Is there a reason why `execProcess` only accepts argument arrays, but not seqs? It eventually calls `startProcess`, which also has this restriction, but then weirdly does create a `seq[string]` from that array itself (osproc, line 985) and then dynamically allocates a cstringarray. So I'm not sure why the API exposes strictly only arrays |
14:08:41 | FromDiscord | <odexine> It accepts sequences |
14:10:52 | FromDiscord | <nnsee> https://nim-lang.org/docs/osproc.html#execProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D |
14:11:06 | FromDiscord | <nnsee> openArray[string], which also includes seqs |
14:14:52 | FromDiscord | <summarity> Ah nvm, I was confused by another error. Shouldn't mix positional and keyword args in my code 😖 |
14:22:09 | FromDiscord | <nikita> sent a code paste, see https://play.nim-lang.org/#pasty=aChRuzLMecuQ |
14:38:34 | FromDiscord | <whisperecean> How do I wipe my nimble cache? |
14:50:56 | * | LuxuryMode_ joined #nim |
14:52:34 | Amun-Ra | I don't think nimble has cache |
14:55:01 | FromDiscord | <kots> Are you getting "Error\: string literal as key expected [JsonParsingError]"? If so, the problem is that `{ quality: 2 }` is invalid JSON and it needs to be `{ "quality": 2 }`. |
15:26:18 | FromDiscord | <arnetheduck> In reply to @whisperecean "How do I wipe": `rm -rf ~/.nimble` if you're on linux - other platforms, equivalent but not sure where nimble stores its stuff - you will have to redo any `nimble install` you might have done (I generally don't use it, for this reason) |
15:27:14 | * | PMunch quit (Quit: Leaving) |
15:27:52 | FromDiscord | <whisperecean> That worked! yay |
15:39:22 | FromDiscord | <@@prestosilver> at one point I was working on nimble pkgs directly in the nimble dir, just to get around cloning the repos, that was such a nightmare when I switched to a new pc lol |
15:59:35 | FromDiscord | <nikita> sent a code paste, see https://play.nim-lang.org/#pasty=NrLRCLtJrgcM |
16:07:18 | FromDiscord | <kots> sent a long message, see https://pasty.ee/eHnyhqdYjfLL |
16:10:15 | FromDiscord | <kots> sent a code paste, see https://play.nim-lang.org/#pasty=KpHEjRIwazge |
16:10:23 | * | tiorock joined #nim |
16:10:23 | * | tiorock quit (Changing host) |
16:10:23 | * | tiorock joined #nim |
16:10:23 | * | rockcavera quit (Killed (mercury.libera.chat (Nickname regained by services))) |
16:10:23 | * | tiorock is now known as rockcavera |
16:50:12 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
16:51:09 | * | derpydoo joined #nim |
17:06:02 | * | azimut quit (Ping timeout: 255 seconds) |
17:14:32 | FromDiscord | <griffith1deadly> In reply to @nikita "kots\: json is ok": if it some library/module with able custom hook's, then you can create one for your enum that parse it as int |
17:14:55 | FromDiscord | <griffith1deadly> like cast[Quality](int) or Quality(int) |
17:15:36 | FromDiscord | <griffith1deadly> with jsony (treeform library for json) you can set hook for types |
18:02:40 | * | zgasma joined #nim |
18:56:16 | FromDiscord | <Sven> In reply to @PMunch "Hmm, curlies looks cool.": Hey thanks, that's me messing around with macros. I could probably clean it up so it's less code |
19:06:07 | * | zgasma quit (Quit: leaving) |
19:25:03 | FromDiscord | <avant_> Hey, does someone know any more guides on how to use move/sink/lent, except the NimConf 2020 video? |
20:25:11 | FromDiscord | <Robyn [She/Her]> Is there any reason to use a cache table instead of a comp time variable? |
20:33:41 | FromDiscord | <odexine> When you need a table instead of just a variable? |
20:34:14 | FromDiscord | <odexine> You can’t productively use a CT variable with type table across modules |
20:34:25 | FromDiscord | <odexine> You can with a macro cache table |
20:40:41 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "You can with a": If I don't plan to use it across modules then is it fine? |
20:42:22 | FromDiscord | <Robyn [She/Her]> I can't do a nested table using cachetables after all |
20:42:56 | FromDiscord | <whisperecean> Does anybody have a problem with intellisense and Copilot? |
20:43:05 | FromDiscord | <whisperecean> On VS Code |
20:43:57 | FromDiscord | <odexine> In reply to @chronos.vitaqua "If I don't plan": Sure yes |
20:47:17 | FromDiscord | <nikita> it's `std/marshal`↵(@griffith1deadly) |
20:48:19 | FromDiscord | <nikita> it's `std/marshal`. I think I'll be able to deal with it after reading a book, for now I'll keep it as int |
20:51:07 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "Sure yes": Rad |
20:57:59 | FromDiscord | <whisperecean> ah nimlangserver failed to install |
20:58:02 | FromDiscord | <whisperecean> installed it manually |
21:00:25 | FromDiscord | <MDuardo> nimlangserver needs some improvements |
21:06:27 | FromDiscord | <Elegantbeef> You can but you have to manually implement it through iteration 😄↵(@Robyn [She/Her]) |
21:07:37 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "You can but you": Haha no thanks |
21:08:09 | NimEventer | New thread by nrk: Chame 0.14.0 released, see https://forum.nim-lang.org/t/10963 |
21:23:52 | FromDiscord | <gabrioche_> Hello everyone, I juste learned about Nim recently and I really enjoyed the project and the language itself. I have only made translations of challenged on Codewars but I've never started any projects in this cool language. So, do you reccomend me any tutorials / resources to learn it ? ( I have experience in programming so advanced resources are not a problem) |
21:24:03 | FromDiscord | <gabrioche_> (edit) "challenged" => "challenges" |
21:35:06 | FromDiscord | <gabrioche_> Maybe I am not aksing in the good channel ? |
21:36:54 | Amun-Ra | pick something you'd like to write |
21:42:39 | FromDiscord | <Clonkk> If you already know how to code then try to build something. Start small and make it bigger / better. Tutorials will only take you so far.↵(@gabrioche_) |
21:43:48 | * | xet7 joined #nim |
21:49:36 | FromDiscord | <MDuardo> Start cooking something then↵Also, read the documentation if you can↵(@gabrioche_) |
22:06:37 | FromDiscord | <Srabb Van Griekenland> theres no fucking way https://media.discordapp.net/attachments/371759389889003532/1204911118984806481/image.png?ex=65d673ec&is=65c3feec&hm=f512e45781d7721da629b72d89efb38040a578bd411c3ce7d1433696614da662& |
22:07:17 | FromDiscord | <Elegantbeef> Wrong channel? |
22:08:29 | FromDiscord | <Srabb Van Griekenland> oh wait lmfao |
22:08:37 | FromDiscord | <Srabb Van Griekenland> https://media.discordapp.net/attachments/371759389889003532/1204911623806914633/image.png?ex=65d67465&is=65c3ff65&hm=02f3bb7ff2fddd2f65ec3e94bdf2b6637d4092952168ef6d943d7ea3066b4f94& |
22:08:46 | FromDiscord | <Srabb Van Griekenland> thought i clicked on the one below, apologis |
22:08:47 | FromDiscord | <Srabb Van Griekenland> (edit) "apologis" => "apologies" |
22:08:54 | FromDiscord | <Elegantbeef> Glad you're playing a boomer shooter though 😛 |
22:09:14 | FromDiscord | <Srabb Van Griekenland> In reply to @Elegantbeef "Glad you're playing a": big fan of 'em |
22:09:35 | FromDiscord | <Srabb Van Griekenland> i made 2 of them too |
22:09:40 | FromDiscord | <Srabb Van Griekenland> 1.5 |
22:09:49 | FromDiscord | <Srabb Van Griekenland> 1 of them isnt finished |
22:10:00 | FromDiscord | <Elegantbeef> I do want to eventually make a coop centric doom mod 😄 |
22:12:45 | FromDiscord | <Srabb Van Griekenland> In reply to @Elegantbeef "I do want to": centric? |
22:13:11 | FromDiscord | <Elegantbeef> A good coop focused mod, there arent many of them |
22:13:14 | FromDiscord | <odexine> Co-op centric, as in centred around |
22:13:20 | FromDiscord | <Srabb Van Griekenland> oh |
22:15:15 | FromDiscord | <Elegantbeef> Anyway that Nim huh? |
22:32:00 | FromDiscord | <kdot_227> sent a code paste, see https://play.nim-lang.org/#pasty=mYNOXKQkISbz |
22:32:16 | FromDiscord | <kdot_227> but I'm not sure how to achieve this since most of the viewing of the AST is done during compile time |
22:32:21 | FromDiscord | <kdot_227> and I need this to work during runtime |
22:32:37 | FromDiscord | <kdot_227> I might just be stupid but I don't see a clear solution to this problem, |
22:32:43 | FromDiscord | <kdot_227> (edit) "problem," => "problem." |
22:32:47 | FromDiscord | <Elegantbeef> What you're asking for requires using the VM at runtime |
22:32:54 | FromDiscord | <Elegantbeef> Macros explicitly are compile time expansions |
22:33:28 | FromDiscord | <kdot_227> In reply to @Elegantbeef "Macros explicitly are compile": is there any other way to view the AST of a block of code during runtime? |
22:33:28 | FromDiscord | <Elegantbeef> You can either shell out to the nim compiler passing `e` to evaluate on the VM, use the compiler API directly, or use nimscripter |
22:33:56 | FromDiscord | <Elegantbeef> You need to compile the code so you need the VM or the compiler to compile it |
22:35:41 | FromDiscord | <kdot_227> damn |
22:35:44 | FromDiscord | <kdot_227> that makes it a lot harder |
22:36:05 | FromDiscord | <Elegantbeef> It's not that hard if you use nimscripter 😄 |
22:36:53 | FromDiscord | <kdot_227> ooh I see |
22:36:56 | FromDiscord | <kdot_227> thank you for the help |
22:38:13 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter/blob/master/examples/macrorepl/macrorepl.nim infact this program monitors a nimscript file and emits ast inside of blocks |
22:38:13 | FromDiscord | <kdot_227> this is exactly what I was looking for thank you |
22:38:29 | FromDiscord | <kdot_227> you dont know how much help u are rn |
22:38:41 | FromDiscord | <kdot_227> ive been reading through all the macro docs |
22:38:44 | FromDiscord | <kdot_227> for nothing to work |
22:39:07 | FromDiscord | <Elegantbeef> https://streamable.com/c6farb for a showcase of it in use |
22:39:09 | FromDiscord | <Srabb Van Griekenland> what you guys doing |
22:39:17 | FromDiscord | <Elegantbeef> Probably something nasty |
22:39:31 | FromDiscord | <Elegantbeef> Reaching for nimscripter for AST related things is never good 😄 |
22:41:42 | FromDiscord | <Robyn [She/Her]> I know I shouldn't generate a string of Nim code but I don't wanna use macros rn- |
22:42:04 | FromDiscord | <Robyn [She/Her]> More effort than they're worth even though it'd be nicer to use a macro |
22:45:10 | FromDiscord | <Robyn [She/Her]> My usecase: Generating types and functions for serialising and deserialising |
22:51:52 | * | azimut joined #nim |
23:00:59 | FromDiscord | <Elegantbeef> @Robyn [She/Her] serialising object variants? |
23:02:36 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "<@524288464422830095> serialising object variants?": Nope |
23:02:49 | FromDiscord | <Robyn [She/Her]> Just very simple MC packets into Nim types |
23:03:06 | FromDiscord | <Elegantbeef> So then why do you need to generate code? |
23:03:33 | FromDiscord | <Elegantbeef> Got an example? |
23:07:23 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "So then why do": To autogenerate procedures for reading and writing packets from a buffer, that's the main reason I want it |
23:07:53 | FromDiscord | <Elegantbeef> But why not just use a generic that takes a tuple type and reads it |
23:10:33 | FromDiscord | <Robyn [She/Her]> A tuple type? Why would a tuple type help? |
23:10:56 | FromDiscord | <Elegantbeef> I mean I assume you have a list of packets you want to serialize/deserialize |
23:11:20 | FromDiscord | <Robyn [She/Her]> It's only a packet at a time, and it'll be from a buffer |
23:12:14 | FromDiscord | <Elegantbeef> Right... you still likely have a list of packets that you want to use no? |
23:12:32 | FromDiscord | <Elegantbeef> I do not mean a runtime list, I mean a set, a known collection of data types that are the packets used |
23:16:04 | FromDiscord | <ezquerra> Maybe this is obvious but is there a way to pass an array or sequence to a proc that expects a varargs? |
23:16:13 | FromDiscord | <Elegantbeef> yes you just pass them |
23:16:22 | FromDiscord | <Elegantbeef> `varargs` is also `openArray[T]` |
23:17:07 | FromDiscord | <ezquerra> Umm, I must be doing something else wrong then, since I’m getting a compilation error due to a signature mismatch |
23:17:15 | FromDiscord | <Elegantbeef> Cooooode |
23:18:30 | FromDiscord | <grumblygibson> Was the experimental `{.this: self.}` syntax removed? I was seeing references to it on some old posts. "Cool! Oh, I'm super late to the game and it looks like it's gone." |
23:18:42 | FromDiscord | <Elegantbeef> Probably |
23:19:00 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=WqyRskJmCzAD |
23:20:11 | FromDiscord | <grumblygibson> That does clean up the declarations a bit. Mostly I was hoping to avoid the plethora of `self.member` in the body of the proc. |
23:20:24 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I do not mean": Ah yeah, I have that |
23:20:30 | FromDiscord | <ezquerra> I found the problem. The signature mismatch was not due to the varargs, but due to a missing `var` 🤦 |
23:20:46 | FromDiscord | <ezquerra> sent a long message, see https://pasty.ee/vHoiIUbiWQJz |
23:21:03 | FromDiscord | <kdot_227> @ElegantBeef what version of nim do you use? |
23:21:18 | FromDiscord | <Robyn [She/Her]> Probably 2.0.2, it's the newest version currently |
23:21:24 | FromDiscord | <Elegantbeef> Bleh using `self` is awful in my view so don't do it↵(@grumblygibson) |
23:21:26 | FromDiscord | <ezquerra> I totally missed 1. the `[1]` and 2. the missing `var` 🙂 |
23:21:26 | FromDiscord | <Robyn [She/Her]> Well, besides devel |
23:21:28 | FromDiscord | <Elegantbeef> Devel and 2.0.2 |
23:21:35 | FromDiscord | <kdot_227> In reply to @chronos.vitaqua "Probably 2.0.2, it's the": im using it right now but a lot of things that I see aren't working on it |
23:21:50 | FromDiscord | <Robyn [She/Her]> In reply to @kdot_227 "im using it right": Oh? What do you mean? |
23:22:10 | FromDiscord | <ezquerra> Now that I think of it this is not the first time I had this problem. var / let mismatches are kind of hard to see from the message that nim gives you |
23:22:35 | FromDiscord | <Robyn [She/Her]> Nim's error messages could be greatly improved tbh |
23:22:36 | FromDiscord | <ezquerra> Anyway, thank you @ElegantBeef! |
23:22:39 | FromDiscord | <kdot_227> In reply to @chronos.vitaqua "Oh? What do you": the examples @ElegantBeef showed me with https://github.com/beef331/nimscripter. A lot of them don't work |
23:22:52 | FromDiscord | <kdot_227> last update was 6 months ago and I have no idea what version was primary at that time |
23:22:56 | FromDiscord | <grumblygibson> In reply to @Elegantbeef "Bleh using `self` is": I'm happy to do anything else if you have a good idea or pattern? In python I used `i` for a time, like bad grammar for `me`. |
23:22:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=mubeiWLEEZVQ |
23:23:00 | FromDiscord | <ezquerra> In reply to @chronos.vitaqua "Nim's error messages could": That is true |
23:23:24 | FromDiscord | <Elegantbeef> I mean use a descriptive name of the type or reason the value is there |
23:23:31 | FromDiscord | <Elegantbeef> `self` and `this` applies procedures are attached to instances |
23:23:38 | FromDiscord | <Elegantbeef> They're not unless they're `method`s |
23:24:08 | FromDiscord | <grumblygibson> Gotcha. |
23:24:56 | FromDiscord | <ezquerra> I often get an "indentation" error for all sorts of non indentation related problems (e.g. for an extra comma on the last module name of an import statement) |
23:25:46 | FromDiscord | <Elegantbeef> Kdot what's the issue you're running into? |
23:26:07 | FromDiscord | <Elegantbeef> I should say grumbly that's just my view if you prefer self/this/i/me/other pronoun feel free to |
23:26:20 | FromDiscord | <Elegantbeef> I just think it's daft and makes it harder to read code |
23:27:41 | FromDiscord | <Elegantbeef> You do need to run `macrorepl` with a target file |
23:27:50 | FromDiscord | <Elegantbeef> so like `./macrorepl ./test.nims` |
23:29:10 | FromDiscord | <Robyn [She/Her]> In reply to @kdot_227 "last update was 6": Ah, it was Nim 1.6 |
23:29:38 | FromDiscord | <Elegantbeef> What are we talking about? |
23:29:42 | FromDiscord | <Elegantbeef> I just compiled on 2.0.2 |
23:29:51 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "<@524288464422830095> so just convert": Tbf I could do that |
23:29:51 | FromDiscord | <kdot_227> In reply to @Elegantbeef "I just compiled on": wait hol up give me a sec |
23:30:02 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I just compiled on": 🤷♀️ |
23:32:02 | FromDiscord | <kdot_227> ok here we go |
23:32:23 | FromDiscord | <grumblygibson> In reply to @Elegantbeef "I just think it's": Yeah, thank you. I am generally annoyed with `self` and was still doing it today out of habit. You had me take a step back to realize that -- duh -- this isn't OOP that I'm writing so bad me, stop it. I like that distinction of reserving those for dynamic dispatch scenarios where they are tied to the instance. |
23:32:37 | FromDiscord | <kdot_227> https://media.discordapp.net/attachments/371759389889003532/1204932760704131133/test.txt?ex=65d68814&is=65c41314&hm=785a55cf296a25b1687b3f16232739b7f302d7c5ca594eeb595005fb350b2805& |
23:32:52 | FromDiscord | <kdot_227> @ElegantBeef that's my error |
23:33:18 | FromDiscord | <Robyn [She/Her]> Seems like you're missing a library? |
23:33:24 | FromDiscord | <Robyn [She/Her]> Idk |
23:33:33 | FromDiscord | <Elegantbeef> I don't use windows so yea that's the issue |
23:33:35 | FromDiscord | <Elegantbeef> Install a real OS, thanks 😛 |
23:33:46 | FromDiscord | <kdot_227> In reply to @Elegantbeef "*Install a real OS,": 😭 |
23:34:58 | FromDiscord | <Elegantbeef> I do use linenoise so you need to get a windows package for it |
23:37:13 | FromDiscord | <kdot_227> @ElegantBeef What are you using linenoise for? |
23:37:57 | FromDiscord | <Elegantbeef> it is a TUI program |
23:38:21 | FromDiscord | <kdot_227> In reply to @Elegantbeef "it is a TUI": what OS are you on |
23:38:26 | FromDiscord | <Elegantbeef> Linux |
23:38:30 | FromDiscord | <kdot_227> I'll see if I can get success on a vm |
23:38:33 | FromDiscord | <kdot_227> In reply to @Elegantbeef "Linux": distro |
23:38:39 | FromDiscord | <Elegantbeef> I mean just install linenoise |
23:38:50 | FromDiscord | <kdot_227> In reply to @Elegantbeef "I mean just install": easier said that done on windows |
23:39:02 | FromDiscord | <Elegantbeef> You also can use WSL2 |
23:39:52 | FromDiscord | <Elegantbeef> https://github.com/arangodb/linenoise-ng |
23:39:59 | FromDiscord | <kdot_227> I found that |
23:40:01 | FromDiscord | <kdot_227> compiling rn |
23:40:17 | FromDiscord | <Elegantbeef> Though that's C++ written so `{.compile: linenoise.c.}` will fail |
23:40:37 | FromDiscord | <kdot_227> that's nice |
23:40:41 | FromDiscord | <Elegantbeef> Could also look for a termios port for windows |
23:40:56 | FromDiscord | <kdot_227> I think imma just go put my breadsticks in the oven |
23:41:00 | FromDiscord | <kdot_227> and read your code |
23:41:01 | FromDiscord | <Elegantbeef> Could also remove the `linenoise` import and deal with what is broken |
23:41:07 | FromDiscord | <kdot_227> and try and recreate my own version |
23:41:12 | FromDiscord | <kdot_227> In reply to @Elegantbeef "Could also remove the": I was thinking that too |
23:41:17 | FromDiscord | <kdot_227> thank you for all your help |
23:41:22 | FromDiscord | <Elegantbeef> Think I only use `clearScreen` from there |
23:41:28 | FromDiscord | <kdot_227> I appreciate it |
23:42:31 | FromDiscord | <kdot_227> these are the only problems |
23:42:32 | FromDiscord | <kdot_227> https://media.discordapp.net/attachments/371759389889003532/1204935254909915186/image.png?ex=65d68a67&is=65c41567&hm=c6078a30cd31d192a3d57eaa20eecd949a4b37d62bf023794eb478867a7d4ad4& |
23:43:38 | FromDiscord | <kdot_227> wait |
23:43:43 | FromDiscord | <kdot_227> yay |
23:43:45 | FromDiscord | <kdot_227> got it to compile |
23:44:00 | * | advesperacit quit () |
23:45:15 | NimEventer | New Nimble package! nimplex - NIM simPLEX: A concise scientific Nim library (with CLI and Python binding) providing samplings, uniform grids, and traversal graphs in compositional (simplex) spaces., see https://github.com/amkrajewski/nimplex |
23:45:15 | NimEventer | New Nimble package! serde - Easy-to-use serialization capabilities (currently json only), with a drop-in replacement for std/json., see https://github.com/codex-storage/nim-json |
23:46:43 | FromDiscord | <Robyn [She/Her]> Procrastinating so much on everything ugh |
23:48:17 | FromDiscord | <kdot_227> @ElegantBeef were up to a new part now |
23:48:19 | FromDiscord | <kdot_227> https://media.discordapp.net/attachments/371759389889003532/1204936713018019910/image.png?ex=65d68bc3&is=65c416c3&hm=070abbaa99805fe073d76b0c3666c5e08b684232d722d5c8a272f0a959ffda97& |
23:48:21 | FromDiscord | <kdot_227> I got this far |
23:48:26 | FromDiscord | <kdot_227> and the process hung |
23:48:53 | FromDiscord | <kdot_227> I just want my AST 😭 |
23:49:05 | FromDiscord | <kdot_227> I'm only using it to find strings in nim code |
23:49:08 | FromDiscord | <kdot_227> nothing more nothing less |
23:49:23 | FromDiscord | <Robyn [She/Her]> You could use the compiler as a library |
23:49:35 | FromDiscord | <that_dude.> Why are you trying to finid strings? |
23:49:35 | FromDiscord | <Robyn [She/Her]> Though it can be pretty complex |
23:49:45 | FromDiscord | <kdot_227> In reply to @chronos.vitaqua "You could use the": that sounds like a good idea but I've been working with nim for maybe 2 days and have 0 idea how I would do that |
23:50:23 | FromDiscord | <Elegantbeef> I mean you do not even need to usue the compiler as a library, just implement a nim string parser |
23:50:33 | FromDiscord | <Elegantbeef> But if you're searching for strings in Nim code why do you need this program? |
23:50:42 | FromDiscord | <kdot_227> In reply to @that_dude. "Why are you trying": very stupid project but I want to go to every string in a script and replace it with a rot13(stringval) function |
23:50:59 | FromDiscord | <Robyn [She/Her]> In reply to @kdot_227 "that sounds like a": Why would you wanna do this then? |
23:51:06 | FromDiscord | <kdot_227> In reply to @Elegantbeef "But if you're searching": I'm used to using AST for parsing code so I thought it would be the same unless you have a better idea (please have a better idea) |
23:51:07 | FromDiscord | <Robyn [She/Her]> In reply to @kdot_227 "very stupid project but": Huh... |
23:51:13 | FromDiscord | <Elegantbeef> Sounds like malware 😄 |
23:51:17 | FromDiscord | <kdot_227> In reply to @Elegantbeef "Sounds like malware 😄": NO |
23:51:22 | FromDiscord | <kdot_227> obfuscation != malware |
23:51:31 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Sounds like malware 😄": Just sounds pointless :P |
23:51:37 | FromDiscord | <Elegantbeef> https://github.com/Yardanico/nim-strenc |
23:51:41 | FromDiscord | <that_dude.> https://nim-lang.org/docs/strutils.html#multiReplace%2Cstring%2Cvarargs%5B%5D↵? |
23:51:44 | FromDiscord | <that_dude.> What about this? |
23:51:52 | FromDiscord | <Elegantbeef> Obfuscation is heavily used in malware |
23:51:53 | FromDiscord | <Robyn [She/Her]> In reply to @kdot_227 "obfuscation != malware": Obfuscating the strings seems pointless honestly |
23:52:00 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Obfuscation is heavily used": h |
23:52:00 | FromDiscord | <Elegantbeef> There is very little reason to obfuscate anyway |
23:52:01 | FromDiscord | <Robyn [She/Her]> Ah |
23:52:18 | FromDiscord | <kdot_227> In reply to @Elegantbeef "https://github.com/Yardanico/nim-strenc": 👁️ |
23:52:19 | FromDiscord | <kdot_227> wow |
23:52:20 | FromDiscord | <kdot_227> ok |
23:52:21 | FromDiscord | <kdot_227> i c |
23:52:28 | FromDiscord | <kdot_227> just needed macro to do all the work |
23:52:31 | FromDiscord | <kdot_227> during compile time |
23:52:34 | FromDiscord | <kdot_227> makes sense |
23:52:36 | FromDiscord | <kdot_227> thank you |
23:52:57 | FromDiscord | <Elegantbeef> I mean you could just you know import a module and do `obfuscate"..."` |
23:53:11 | FromDiscord | <Elegantbeef> There is no reason this needs to apply to all string literals used |
23:55:01 | FromDiscord | <odexine> well as long as youre aware that it's not too difficult to undo it |
23:58:11 | FromDiscord | <Robyn [She/Her]> Yeah I feel like that it's very pointless to do rot13 |
23:59:04 | FromDiscord | <Robyn [She/Her]> What if you stored the bytes of a private key somewhere in the binary in various places and then you piece it together throughout the program's runtime to try and avoid detection /j |
23:59:27 | FromDiscord | <Robyn [She/Her]> Tho that wouldn't work because it'd show in the memory if it was observed, right? |
23:59:43 | FromDiscord | <Elegantbeef> What if you just didn't care about obfuscating |