01:17:04 | * | Gustavo6046 quit (Remote host closed the connection) |
01:17:07 | * | Gustavo6046_ joined #nim |
01:20:22 | * | Gustavo6046_ is now known as Gustavo6046 |
01:25:17 | * | Gustavo6046_ joined #nim |
01:25:25 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
01:28:07 | * | Gustavo6046_ is now known as Gustavo6046 |
02:38:31 | * | Freneticks quit (Ping timeout: 252 seconds) |
02:40:58 | * | Freneticks joined #nim |
02:51:39 | * | arkurious quit (Quit: Leaving) |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
04:38:36 | NimEventer | New Nimble package! chacha20 - ChaCha20 stream cipher, see https://git.sr.ht/~ehmry/chacha20 |
04:41:01 | FromDiscord | <Rika> Oh are they a cryptographer |
04:43:32 | FromDiscord | <that_dude> Is it possible to remove a variable name from a scope so It doesn't actually get used later? I have a temp var at the start which is used to set up a global/exported let once its done with it's calculations |
04:44:03 | FromDiscord | <that_dude> (edit) "it's" => "its" |
04:44:05 | FromDiscord | <Elegantbeef> throw it in a `block` is the easiest |
04:44:22 | FromDiscord | <Elegantbeef> Alternatively use expressions |
04:44:31 | FromDiscord | <Elegantbeef> What's the code? |
04:44:45 | FromDiscord | <that_dude> And that wont cause issues with the exporting/global part? |
04:45:07 | FromDiscord | <that_dude> sent a code paste, see https://paste.rs/0Ps |
04:45:18 | FromDiscord | <Elegantbeef> Ah yea block will work or `std/collect` |
04:45:28 | FromDiscord | <that_dude> Cool |
04:45:44 | FromDiscord | <Elegantbeef> `std/sugar`'s collect sorry |
04:46:01 | FromDiscord | <that_dude> I just thought that if I define all_actions in the block it will get removed once the block ends |
04:46:11 | FromDiscord | <Elegantbeef> It will |
04:46:37 | FromDiscord | <that_dude> The issue is that I need all_actions to stick around after the block |
04:46:40 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3BMC |
04:47:17 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3BME |
04:47:22 | FromDiscord | <Elegantbeef> There are the two solutions |
04:47:25 | FromDiscord | <that_dude> Thanks will look into that. I haven't really ever used sugar |
04:50:15 | FromDiscord | <that_dude> Where could I find more info about how let can be used that way? (In the way it's shaped like a proc) |
04:50:41 | FromDiscord | <Elegantbeef> It's just an expression |
04:50:52 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-if-expression |
04:50:58 | FromDiscord | <Elegantbeef> all of them are listed there |
04:51:18 | FromDiscord | <that_dude> Ah thanks |
05:23:12 | * | rockcavera quit (Remote host closed the connection) |
06:51:18 | * | PMunch joined #nim |
08:20:44 | * | max22- joined #nim |
08:40:12 | FromDiscord | <zidsal> big thanks to whoever fixed the choosenim 1.6 windows issue now I can be on bleeding edge! |
08:45:25 | PMunch | Hmm, does jsony work during compile-time? |
08:45:38 | PMunch | The slowest part of Futhark is parsing the Opir output.. |
08:46:16 | FromDiscord | <Elegantbeef> there is `toStaticJson` |
08:46:40 | PMunch | Well I need to parse JSON during compile-time |
08:46:44 | PMunch | Not create it |
08:47:03 | FromDiscord | <Elegantbeef> Ah then i think it'll just work since it's not using any low level ops |
08:57:49 | FromDiscord | <haxscramper> It just scans string and mutates `i: var int` when scanning json |
09:02:41 | * | Vladar joined #nim |
09:07:35 | PMunch | Damn it.. |
09:07:46 | PMunch | I converted my code to use packedjson |
09:08:04 | PMunch | And I just get this error: /home/peter/.nimble/pkgs/packedjson-0.2.2/packedjson.nim(104, 41) Error: cannot generate code for: mSlice |
09:13:11 | PMunch | For jsony I need to define everything as types.. |
10:26:12 | PMunch | I wonder if jsony will be any faster.. |
10:26:31 | FromDiscord | <Kiloneie> can you not use echo at compile time ? i mean it works, but there is no output anywhere... |
10:26:46 | PMunch | Echo on compile-time works just fine |
10:27:08 | PMunch | And it echos while you're compiling, so it might get bunched up with the hints and such |
10:27:19 | PMunch | After all I'm not really serialising the data, I'm just working directly with the JSON data structures.. |
10:27:41 | FromDiscord | <Kiloneie> ah yeh, there it is hidden like hell |
10:30:46 | FromDiscord | <Kiloneie> it dissapears after recompilation of the same program |
10:33:11 | * | max22- quit (Remote host closed the connection) |
10:33:51 | * | max22- joined #nim |
10:33:51 | PMunch | Yup, because Nim sees that you don't have to recompile and just skips it |
10:37:25 | PMunch | Okay Yardanico, Futhark now compiles Sciter |
10:37:41 | PMunch | Takes about half a minute on my machine to do the wrapping though |
10:37:49 | PMunch | Although most of that is in the JSON parsing stage |
10:43:12 | FromDiscord | <Yardanico> oh, interesting, will check later today! I assume I can save the output somewhere? |
10:43:17 | FromDiscord | <Yardanico> of the resulting Nim file |
10:43:56 | PMunch | It does that automatically ;) |
10:44:04 | PMunch | Both the JSON output and the Nim output |
10:44:18 | PMunch | In the cache folder, and re-uses them if you don't change the options |
10:58:52 | * | stkrdknmibalz joined #nim |
11:07:08 | PMunch | Oh man, the JSON output Opir spits out is so messy :P |
11:19:59 | PMunch | Is packedjson supposed to work at compile-time? |
11:24:28 | FromDiscord | <MrOkram> Hello, i'm trying to run NimScan on a really low powered device (Router with only 100MB of RAM and 2 core ARM CPU), and i keep running out of threads mid scan, any way to remedy this or should i just accept defeat ? https://media.discordapp.net/attachments/371759389889003532/898531768565641316/unknown.png |
11:26:46 | PMunch | Try to set the --threads option to NimScan? |
11:30:20 | FromDiscord | <MrOkram> Yup, tried it both off and on |
11:30:33 | PMunch | Off and on? |
11:30:40 | PMunch | It is an option to control how many threads to use.. |
11:32:44 | FromDiscord | <MrOkram> sent a code paste, see https://play.nim-lang.org/#ix=3BOc |
11:32:52 | FromDiscord | <MrOkram> (edit) "https://play.nim-lang.org/#ix=3BOc" => "https://play.nim-lang.org/#ix=3BOd" |
11:33:46 | PMunch | Yeah that's not what I was talking about |
11:33:53 | PMunch | Does it even build with --threads:off? |
11:34:30 | FromDiscord | <MrOkram> Surprisingly yes, it does, and it works, then runs out of "threads" again... |
11:35:25 | PMunch | Again, try setting the --threads option to NimScan to something low, maybe even just set it to 1 to try |
11:35:27 | FromDiscord | <MrOkram> Correction, my mistake, it doesn't build with threads off |
11:39:01 | PMunch | As I would have expected |
11:39:21 | PMunch | But yeah, try to pass --threads to the program instead, specifying a low amount of threads |
11:39:23 | FromDiscord | <MrOkram> In reply to @PMunch "Again, try setting the": Damn, i missed that option totally, tried it now, with 1 thread set it still somehow runs out of threads to create.. |
11:41:09 | PMunch | Hmm, maybe you can't have more than one thread on your hardware? Sounds a bit weird |
11:42:45 | FromDiscord | <MrOkram> In reply to @PMunch "Hmm, maybe you can't": Well, it's a low end ADSL router, was happy it even worked to begin with \:) |
11:42:52 | FromDiscord | <Rika> Set it to zero and see if your computer implodes into a black hole |
11:43:33 | PMunch | Yeah it's cool that you can even use Nim on it :) |
11:43:58 | PMunch | I mean you can use Nim on pretty much everything, but the fact that you could grab a random program and have it at least run is pretty cool |
11:46:45 | FromDiscord | <MrOkram> In reply to @Rika "Set it to zero": Happy to report that with 0 threads set it just does nothing, lmao |
11:46:59 | FromDiscord | <Rika> That’s hilarious |
11:48:24 | PMunch | Yes it has a `for i in 1..maxThreads: threads.add ...` and then it runs `threads.join` |
11:48:31 | PMunch | So with 0 threads it wouldn't do anything |
11:48:54 | FromDiscord | <MrOkram> Haha, amazing |
11:49:06 | FromDiscord | <enthus1ast> MrOkram is it really necessary to use threads for port scanning? |
11:49:12 | FromDiscord | <enthus1ast> why not use async for this? |
11:49:51 | FromDiscord | <MrOkram> Well, i just wanted a done solution tbh, something that i could just grab and run, didn't expect to run into these kinds of problems |
11:50:53 | FromDiscord | <MrOkram> Tbh, it still works, and it can do it's job, i'll just have to limit the port range to the one i need, not let it do a full port scan |
11:52:15 | PMunch | It's a bit weird that it fails with that error though |
11:52:27 | PMunch | You would think it starts all the threads first |
11:52:53 | FromDiscord | <Rika> Needs a “run on the main thread” option mapped to threads = 0 |
11:53:57 | * | max22- quit (Ping timeout: 265 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:55 | * | supakeen joined #nim |
12:14:55 | FromDiscord | <enthus1ast> @MrOkram\: i hacked a async portscanner just for you |
12:15:25 | FromDiscord | <enthus1ast> https://play.nim-lang.org/#ix=3BOo |
12:16:05 | FromDiscord | <enthus1ast> it is a hack, though. Expect dragons |
12:17:32 | FromDiscord | <MrOkram> Thanks man! Really appreciate it ! |
12:21:03 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
12:21:47 | * | sagax quit (Quit: Konversation terminated!) |
12:28:18 | FromDiscord | <Yardanico> In reply to @MrOkram "Well, i just wanted": Do you need NimScan specifically? |
12:28:32 | FromDiscord | <Yardanico> I mean, if you want to do port scanning fast, almost nothing beats masscan |
12:28:55 | FromDiscord | <Yardanico> And it's async and doesn't use threads so it's pretty light on resources |
12:29:03 | FromDiscord | <Yardanico> That said it's written in C :) |
12:29:34 | FromDiscord | <MrOkram> Hmm, i might give it a shot, but doubt it'll work that well on 100MB of RAM \:) |
12:30:07 | FromDiscord | <Yardanico> It will |
12:30:10 | FromDiscord | <MrOkram> In reply to @Yardanico "Do you need NimScan": And nope, just something that'll scan a specific IP for open ports, and is lightweight so it can be used on embedded devices like routers and ONT's |
12:30:47 | FromDiscord | <Yardanico> yeah I think masscan should be good enough for you, I just hope you're not creating a botnet XD |
12:30:47 | FromDiscord | <enthus1ast> but you will not build a botnet right? |
12:31:08 | FromDiscord | <MrOkram> In reply to @enthus1ast "but you will not": I can't guarantee that |
12:31:12 | FromDiscord | <MrOkram> (edit) "In reply to @enthus1ast "but you will not": I can't guarantee that ... " added "\:)" |
12:31:28 | FromDiscord | <enthus1ast> botnets are fun and stuff, but think of the poor admins (like me) that have to clean the mess |
12:31:48 | FromDiscord | <enthus1ast> (and are too lazy and have no time, to patch everything ;) ) |
12:33:20 | PMunch | At this rate Nim will just be the #1 malware language :P |
12:34:06 | FromDiscord | <MrOkram> In reply to @PMunch "At this rate Nim": Well, Windows defender already doesn't like it... So i wouldn't be surprised honestly |
12:35:19 | PMunch | I mean I can see why people want to use it, it is a pretty nice language to write malware in I guess |
12:35:43 | PMunch | But it's a shame if Windows will just block it for everyone else just trying to use it for less nefarious purposes.. |
12:36:22 | FromDiscord | <enthus1ast> we need a "shikata ga nai" like encoder for the nim compiler |
12:36:33 | FromDiscord | <enthus1ast> so that there is nothing to pick up |
12:37:52 | PMunch | shikata ga nai? |
12:40:59 | FromDiscord | <enthus1ast> this is a shellcode encoder (build into metasploit framework) that did a good job to avoid antivirus detection |
12:42:46 | PMunch | Aah, so it basically obfuscates the binary so that it no longer fingerprints as malware? |
12:42:58 | FromDiscord | <enthus1ast> yes |
12:43:06 | PMunch | That's one way to ensure that Nim will be the #1 malware :P |
12:43:42 | PMunch | Ah sweet, I think I have gotten the Discord Bot Bridge thing modified enough to work now :) |
12:44:19 | FromDiscord | <enthus1ast> well we already have term rewriting macros; and https://github.com/Yardanico/nim-strenc |
12:45:00 | * | rockcavera joined #nim |
12:45:01 | * | rockcavera quit (Changing host) |
12:45:01 | * | rockcavera joined #nim |
12:45:31 | PMunch | Oh shit, that's true |
12:46:29 | FromDiscord | <enthus1ast> i can understand, malware writing is fun, (and half of my project folder is full of self written "malware") but i would never use them, it's just a hobby for me |
12:46:51 | PMunch | Damn, that Hint mention reminds me that I really want to have custom hints.. |
12:54:26 | * | PMunch quit (Quit: Leaving) |
12:55:09 | FromDiscord | <enthus1ast> currently i clone the good old bifrost\: |
12:55:16 | FromDiscord | <enthus1ast> bifrostClone.png https://media.discordapp.net/attachments/371759389889003532/898554619658137640/bifrostClone.png |
13:03:08 | * | arkurious joined #nim |
13:05:19 | * | max22- joined #nim |
13:37:49 | FromDiscord | <qb> Do we got a cool cross platform hotkey library which doesn't requires the window focus? |
13:40:27 | FromDiscord | <enthus1ast> i've started to wrap libuihook, but its not finished |
13:40:36 | FromDiscord | <enthus1ast> only tested it on windows though |
13:41:30 | FromDiscord | <enthus1ast> maybe i can release it, could be already enough for your usecase |
13:43:40 | FromDiscord | <qb> just looking for some `if keypressed(foo):` which doesn't cares about the window focus 😛 |
13:44:04 | FromDiscord | <qb> theres nothing done how it seems in x11 |
13:44:24 | FromDiscord | <enthus1ast> libuihook can do this |
13:44:28 | FromDiscord | <enthus1ast> but its a c library |
13:45:14 | nrds | <Prestige99> I believe there are programs for x11 that can do it, unless you mean doing it for things _other_ than x11? |
13:45:54 | FromDiscord | <enthus1ast> @qb\: but as i said, its not done, i had troubles with the varargs |
13:45:55 | FromDiscord | <enthus1ast> https://gist.github.com/enthus1ast/2f9c16de5814636e2fdd983902e1f262 |
13:46:53 | FromDiscord | <enthus1ast> https://github.com/kwhat/libuiohook |
13:49:29 | FromDiscord | <hugogranstrom> In reply to @qb "just looking for some": Keylogger? 🥴 |
13:49:43 | FromDiscord | <Rika> thonkl |
13:50:17 | FromDiscord | <qb> 😄 are keyloggers still a thing in 2021 |
13:50:23 | FromDiscord | <Rika> yes |
13:51:22 | FromDiscord | <qb> Well if I would write one I wouldn't focus on the smart linux guys |
13:52:37 | FromDiscord | <qb> https://tronche.com/gui/x/xlib/input/XQueryKeymap.html looks promising but seems like it isn't wrapped in the nim x11 wrappers |
13:53:15 | FromDiscord | <qb> nvm got it https://github.com/nim-lang/x11/blob/master/x11/xlib.nim#L1723 |
13:53:53 | nrds | <Prestige99> https://github.com/baskerville/sxhkd might be useful to look into |
14:02:38 | FromDiscord | <jmgomez> sent a long message, see http://ix.io/3BPa |
14:02:44 | * | kayabaNerve quit (Ping timeout: 268 seconds) |
14:04:37 | FromDiscord | <juan_carlos> I think all yes (?), but some answers are kinda advanced. |
14:07:12 | * | kayabaNerve joined #nim |
14:08:10 | FromDiscord | <Rika> c++ classes in nim are still kinda funkyy |
14:08:47 | FromDiscord | <Rika> nim doesnt handle stuff that arent refs wrt. memory afaik |
14:09:56 | FromDiscord | <jmgomez> What do you mean with funky, can you be more specific? So, I guuess you could easily create the object in C++ and use it in Nim |
14:09:58 | FromDiscord | <./Network> Use sxhkd. |
14:10:05 | FromDiscord | <./Network> I use it with bspwm. |
14:10:50 | * | tinytoes is now known as tinystoat |
14:14:16 | FromDiscord | <Rika> In reply to @./Network "Use sxhkd.": who are you talking to |
14:14:23 | FromDiscord | <Rika> oh i missed the link |
14:14:25 | FromDiscord | <Rika> nevermind |
14:16:28 | * | kayabaNerve quit (Ping timeout: 252 seconds) |
14:19:04 | FromDiscord | <qb> In reply to @hugogranstrom.nim "Keylogger? 🥴": For the logs: https://play.nim-lang.org/#ix=3BPh |
14:19:20 | FromDiscord | <qb> In reply to @qb "just looking for some": For the logs: https://play.nim-lang.org/#ix=3BPh |
14:23:13 | * | kayabaNerve joined #nim |
14:29:38 | * | rockcavera quit (Remote host closed the connection) |
15:04:09 | FromDiscord | <treeform> Is there a way to get the path used for staticRead, both getProjectPath and currentSourcePath are not it? |
15:06:13 | FromDiscord | <enthus1ast> i think the path that getProjectPath returns changes when you wrap it in a template |
15:06:47 | FromDiscord | <treeform> I see that might be my issues. |
15:06:58 | FromDiscord | <treeform> I think I got it to work with currentSourcePath().parentDir ? |
15:07:01 | FromDiscord | <enthus1ast> i use this construct in nimja to get a path to the current executable dir |
15:07:06 | FromDiscord | <enthus1ast> https://github.com/enthus1ast/nimja/blob/master/src/nimja/sharedhelper.nim |
15:07:30 | FromDiscord | <treeform> thanks! |
15:07:42 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/898587772275789906): i use this construct in nimja to get a path to the current ~~executable~~ script dir |
15:19:11 | * | Gustavo6046 joined #nim |
15:22:32 | FromDiscord | <Fancy> Hello |
15:24:54 | FromDiscord | <Fancy> I saw that nim had support for javascript, does it also have full support for the html canvas api? |
15:24:58 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3BPR |
15:29:22 | FromDiscord | <Rika> tandy: split that into other objects |
15:29:44 | FromDiscord | <Rika> artist object, music metadata object, group metadata, release metadata, services |
15:29:45 | FromDiscord | <Rika> etc |
15:29:48 | FromDiscord | <tandy> i cant↵(@Rika) |
15:29:49 | FromDiscord | <tandy> https://github.com/metabrainz/listenbrainz-server/blob/63826071c819aba376018e68985298a8af8bcb29/data/model/listen.py |
15:29:55 | FromDiscord | <tandy> im building a representation of this |
15:30:22 | FromDiscord | <Rika> what do you mean "cant" |
15:30:29 | FromDiscord | <Rika> are you interfacing with python |
15:30:49 | FromDiscord | <tandy> like i need to build json from the type↵(@Rika) |
15:30:52 | FromDiscord | <tandy> using jsony |
15:31:10 | FromDiscord | <tandy> so id rather not deviate from their representations for ease of development / maintainability |
15:31:22 | FromDiscord | <Rika> then break at 80 columns |
15:31:25 | FromDiscord | <Rika> (or less) |
15:31:38 | FromDiscord | <Rika> or 120, you choose |
15:31:43 | FromDiscord | <Rika> but no more than 120 i would say |
16:09:16 | * | Gustavo6046 quit (Ping timeout: 245 seconds) |
16:11:56 | * | Gustavo6046 joined #nim |
16:16:24 | * | max22- quit (Quit: Leaving) |
16:16:45 | FromDiscord | <tandy> hm ok il do that |
16:21:18 | FromDiscord | <tandy> `UserTimelineEventMetadata = Union[RecordingRecommendationMetadata, NotificationMetadata]` |
16:21:23 | FromDiscord | <tandy> is this possibel in nim ? |
16:22:13 | FromDiscord | <tandy> i know you can achieve something likethis by doing `object: RecordingRecommendationMetadata | NotificationMetadata` |
16:25:58 | * | SebastianM joined #nim |
16:26:05 | FromDiscord | <tandy> `UserTimelineEventMetadata = RecordingRecommendationMetadata | NotificationMetadata` this seems to work? |
16:28:06 | FromDiscord | <leorize> that's called a typeclass, it's a generic type at compile-time and cannot be used as a concrete type |
16:28:29 | FromDiscord | <leorize> in Nim you have to whip out case objects if you want a sum type |
16:28:48 | FromDiscord | <leorize> or if you feel experimental enough, you can use this\: https://github.com/alaviss/union |
16:30:43 | SebastianM | Hey guys just downloaded nim 1.6 nightly from github and tried to compile fibonacci function with tcc. I get tcc: error: undefined symbol "fabs". With old nim version 1.3.7 it compiles and works with the same tcc. Is there a way to fix it somehow? |
16:32:11 | FromDiscord | <tandy> oh damn |
16:36:31 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3BQh |
16:36:35 | FromDiscord | <tandy> i get a nimsuggest warning if i do |
16:40:26 | FromDiscord | <leorize> they're exported if the type is exported |
16:40:42 | FromDiscord | <tandy> oh ofc |
16:43:03 | FromDiscord | <tandy> but even then i cant overwrite a field hmm |
16:43:12 | FromDiscord | <tandy> like so |
16:43:15 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3BQk |
16:43:42 | FromDiscord | <leorize> yea you gotta give them different names |
16:45:10 | FromDiscord | <tandy> `metadata: APIListen | APIFollowEvent | APINotificationEvent` this is a lot easier |
16:45:55 | FromDiscord | <leorize> you can use my union library if you're brave enough |
16:45:58 | FromDiscord | <leorize> it does exactly that |
16:46:54 | FromDiscord | <leorize> but yea, this should have been a language feature |
16:49:11 | FromDiscord | <tandy> i would if it wasnt for the fact that these are api bindings |
16:49:14 | FromDiscord | <tandy> might be a little overkill |
16:49:30 | FromDiscord | <tandy> agree, would make pythoninterop a lil easier |
16:49:46 | FromDiscord | <tandy> have you tried making an RFC? |
16:51:30 | FromDiscord | <leorize> I haven't, mainly due to a lack of time |
16:51:59 | FromDiscord | <tandy> fair, hope you can get round to it \:) |
17:00:33 | * | rockcavera joined #nim |
17:00:33 | * | rockcavera quit (Changing host) |
17:00:33 | * | rockcavera joined #nim |
17:32:52 | NimEventer | New thread by DMisener: Nim access to OSX cut and paste buffer:, see https://forum.nim-lang.org/t/8504 |
17:40:41 | * | SebastianM quit (Remote host closed the connection) |
17:41:08 | * | neurocyte0132889 joined #nim |
17:41:08 | * | neurocyte0132889 quit (Changing host) |
17:41:08 | * | neurocyte0132889 joined #nim |
17:52:55 | NimEventer | New thread by Orlean: Question about procedure parameters, see https://forum.nim-lang.org/t/8505 |
18:05:11 | * | neurocyte0132889 quit (Ping timeout: 264 seconds) |
18:15:15 | * | Zevv left #nim (#nim) |
18:16:57 | NimEventer | New thread by Orlean: How to overload procedure correctly?, see https://forum.nim-lang.org/t/8506 |
18:50:52 | * | Vladar quit (Quit: Leaving) |
18:51:05 | NimEventer | New thread by Orlean: How to get n-th symbol of utf-8 string, see https://forum.nim-lang.org/t/8507 |
18:51:21 | FromDiscord | <reilly> Say I have two enum types defined in the same file, and they both contain an enum with the same name. How can I, in another file, specify which enum type I want to refer to? |
18:54:21 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3BQT |
19:00:00 | FromDiscord | <haxscramper> I think you can do `module.EnumName.EnumField` |
19:00:14 | FromDiscord | <juan_carlos> Use the full name. |
19:01:22 | * | mahlon quit (Quit: PotatoTech) |
19:02:14 | FromDiscord | <treeform> In reply to @reilly "Say I have two": New version of nim will fix this. It will infer the enum you want. But that is not out yet. Use the full name. EnumOne.OptionB should work but you need to export EnumOne as well. |
19:17:28 | FromDiscord | <reilly> Neither `EnumName.EnumField` nor `module.EnumName.EnumField` work. Both fail to compile because, if I'm interpreting the message correctly, it's trying to treat `EnumName` like an object, and it doesn't have any field named `EnumField`. |
19:20:36 | FromDiscord | <reilly> Okay, looks like my problem was actually something a little weirder. Not sure exactly what, but I know how to make it go away. |
19:28:13 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3BR5 |
19:28:25 | FromDiscord | <reilly> (edit) "https://play.nim-lang.org/#ix=3BR5" => "https://play.nim-lang.org/#ix=3BR6" |
19:28:29 | FromDiscord | <reilly> Accidentally pressed enter, oops. Edited. |
19:28:54 | FromDiscord | <reilly> (edit) "https://play.nim-lang.org/#ix=3BR6" => "https://play.nim-lang.org/#ix=3BR7" |
19:30:21 | FromDiscord | <reilly> It's not obvious to me what the issue is. The error isn't super helpful either. |
19:43:53 | FromDiscord | <tandy> oh nevermind, this doesnt compile |
19:48:04 | FromDiscord | <treeform> In reply to @reilly "Actually, what *is* going": you probably want ` igBegin("Hello, world!", flags = NoResize)` |
19:48:12 | FromDiscord | <tandy> [leorize](https://matrix.to/#/@leorize:envs.net)\: does union work with jsony? |
19:58:50 | * | rockcavera quit (Remote host closed the connection) |
20:04:11 | FromDiscord | <reilly> In reply to @treeform "you probably want `": Well, I'm trying to use that `gWindowF()` template as some syntax sugar, so I need to be able to pass in flags that way. |
20:15:42 | FromDiscord | <reilly> Apparently I just can't name the template argument `flags`. |
20:19:04 | FromDiscord | <Elegantbeef> Yea i assume you're doing `flags = flags` which the template will replace with it's `flags` parameters |
20:19:24 | FromDiscord | <Elegantbeef> Templates are dumb when it comes to symbol replacing |
20:32:45 | FromDiscord | <leorize> you might have to write a custom serializer |
20:35:35 | FromDiscord | <Elegantbeef> leorize do you have an `unpackIt` equivlent? |
20:36:41 | FromDiscord | <Elegantbeef> Just curious as it'd help the Nim -\> json side |
20:36:55 | FromDiscord | <Elegantbeef> also assume you remember what my unpackit did |
20:36:55 | FromDiscord | <leorize> not atm |
20:37:07 | FromDiscord | <leorize> please pr one \:) |
20:37:33 | FromDiscord | <leorize> I'm crunching nim-sys so it will take a bit before I can get back to union |
20:37:47 | FromDiscord | <leorize> there's still a lot of ergonomics that has to be solved \:( |
20:38:11 | FromDiscord | <Elegantbeef> Yea i may make the PR, but idk still trying to get the nimVM to work in wasm |
21:21:01 | FromDiscord | <tandy> Dam |
21:43:53 | * | stkrdknmibalz quit (Ping timeout: 264 seconds) |
21:59:55 | * | rockcavera joined #nim |
21:59:56 | * | rockcavera quit (Changing host) |
21:59:56 | * | rockcavera joined #nim |
22:09:54 | nrds | <Prestige99> Hey impbox, you around? Running into a weird issue with chipmunk's body userData property. I may have bound it incorrectly, or something. If you look here: https://git.einheit.tech/EinheitTechnologies/shade/src/branch/example/platformer/src/shadepkg/game/physicsbody.nim#L73 |
22:10:34 | nrds | <Prestige99> I'm assigning it to the object's address, and want to use it later, but it seems that's actually unsafe (I believe the address must change) |
22:10:56 | FromDiscord | <impbox [ftsf]> Are they ref objects? |
22:11:02 | nrds | <Prestige99> Yes |
22:11:08 | FromDiscord | <impbox [ftsf]> refObj[].addr i think |
22:11:24 | nrds | <Prestige99> the parent here https://git.einheit.tech/EinheitTechnologies/shade/src/branch/example/platformer/src/shadepkg/game/physicsbody.nim#L107 is not nil, but when I try to access it, I get an illegal store access error |
22:11:27 | FromDiscord | <impbox [ftsf]> But I'm not 100% sure |
22:11:27 | nrds | <Prestige99> ok I'll try that |
22:11:57 | nrds | <Prestige99> ah same issue, yeah |
22:15:05 | nrds | <Prestige99> Wonder if this is a bug |
22:23:31 | FromDiscord | <Elegantbeef> Impbox i've found exactly where the NimVm feels like stop working! |
22:23:34 | FromDiscord | <Elegantbeef> Though it's fucking unclear how |
22:28:56 | FromDiscord | <impbox [ftsf]> \o/ |
22:29:02 | FromDiscord | <impbox [ftsf]> Progress |
22:32:17 | nrds | <Prestige99> Not sure why the addr of the result would be different than the final object. It shouldn't change, right? |
22:37:47 | nrds | <Prestige99> Weird, even if I just take an instance of my ref object and echo repr myObj[].addr I get an illegal storage access error |
22:57:23 | nrds | <Prestige99> Narrowed it down. https://git.einheit.tech/EinheitTechnologies/shade/src/branch/example/platformer/examples/platformer/king.nim#L82 Adding either of these children to the result, triggers the illegal storage access error when trying to echo the addr of the result |
22:57:31 | nrds | <Prestige99> just not entirely sure why, yet |
23:17:28 | * | mahlon joined #nim |
23:19:43 | FromDiscord | <Elegantbeef> So interestingly it seems it's just `gcSafe` causing an issue |
23:25:09 | FromDiscord | <Elegantbeef> @impbox [ftsf]\: ehhh https://streamable.com/bqsa3w |
23:26:35 | nrds | <Prestige99> nice |
23:26:58 | nrds | <Prestige99> that's so cool |
23:27:36 | FromDiscord | <Elegantbeef> Indeed, some nice magic 🙂 |
23:29:01 | FromDiscord | <impbox [ftsf]> Whee! |
23:29:20 | FromDiscord | <impbox [ftsf]> Afk atm but i take it it's working? |
23:29:26 | FromDiscord | <Elegantbeef> it oddly caused by annotating a proc with `closure` |
23:29:28 | FromDiscord | <Elegantbeef> Yep |
23:29:39 | FromDiscord | <impbox [ftsf]> In the nico code? |
23:29:48 | FromDiscord | <Elegantbeef> Nah in nimscripter |
23:29:55 | FromDiscord | <impbox [ftsf]> Interesting |
23:30:17 | FromDiscord | <impbox [ftsf]> So cool it works! Awesome work beef! |
23:30:21 | FromDiscord | <Elegantbeef> To be fair there isnt any reason to annotate it with closure but iirc it was annotated with closure in the VM |
23:30:35 | FromDiscord | <Elegantbeef> Thanks |
23:33:22 | FromDiscord | <Elegantbeef> Eventually i'll feel comfortable moving this to the master branch, but need to write tests and have the API solidified, personally I dont like having to do `isFile = false` so think i'm going to use a distinct for `NimScriptFile` and `NimScriptPath` |