00:01:07 | FromDiscord | <dain> sent a code paste, see https://paste.rs/6yw |
00:03:56 | * | vicfred joined #nim |
00:15:05 | FromDiscord | <haxscramper> I think I should add your example to docs |
00:16:32 | FromDiscord | <dain> thx |
00:17:29 | FromDiscord | <dain> I had to fumble around to figure out how it worked because the existing json examples were trivial. wasn't quite sure how it worked on jq-style transformations of deeply nested data |
00:17:49 | FromDiscord | <dain> might be worth going through the jq tutorials and seeing how much can be translated into the nim pattern matching way |
00:19:50 | FromDiscord | <dain> take a big json object and pull interesting data out of it from different parts |
00:21:43 | FromDiscord | <haxscramper> Good idea. I'm not entirely familiar with jq (google-query-every-time basically), so if you have some real-world examples, or just things that your were confused I would rally appreciate it |
00:22:38 | FromDiscord | <haxscramper> Because key-value pattern handling wasn't given that much thought when fusion matching was designed, so documentation is naturally lacking in use cases and examples |
00:23:30 | FromDiscord | <dain> yeah. I think it would be something loads of people would try to use it on. since json processing is so common (more common than writing AST macros) |
00:24:35 | FromDiscord | <dain> my motivation was actually to refute this blowhard: http://www.smashcompany.com/technology/why-i-prefer-dynamic-typing-over-static-typing-the-speed-of-adapting-to-change |
00:26:30 | * | Pyautogui joined #nim |
00:27:51 | FromDiscord | <enthus1ast> i took some babysteps in dynamic nimja template evaluation, at least it works with nimscript \:) |
00:28:11 | * | Pyautogui quit (Client Quit) |
00:28:20 | FromDiscord | <haxscramper> Before reading the article itself I think I should point out that nim stdlib json is slow, and handling massive amounts of it with pattern matching would be even slower. Instead I would recommend using treefrom/jsony, which has support for dynamic nodes↵(@dain) |
00:28:40 | FromDiscord | <haxscramper> And dynamic nodes could be checked with pattern matching |
00:29:19 | FromDiscord | <dain> ooo |
00:29:20 | FromDiscord | <dain> thanks |
00:29:53 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/875898479526944819): i took some babysteps in dynamic nimja template evaluation, at least it \~works\~ somehow got me a nimja template withouth recompile the binary with nimscript \:) |
00:31:15 | FromDiscord | <haxscramper> In reply to @haxscramper "Before reading the article": > #1 – the external API is bloated, so writing a schema for the whole thing would be difficult to justify in terms of business. We only need a tiny slice of the data. More so, when the API ambushes you with an unexpected change, you have a lot of work to do to adapt to the change↵↵Okay, that is literally what I just said |
00:32:06 | FromDiscord | <haxscramper> Efficient compiled schema for whatever you need, and some randomized garbage that cannot be mapped onto anything sane, like value that can be int/string/bool/array at the same time |
00:33:29 | FromDiscord | <haxscramper> So yes, if you want to completely dismantle these arguments I suggest you check out jsony as well |
00:34:05 | FromDiscord | <haxscramper> The only thing is lacking is support for data validation, and I'm not sure what treefrom's plans on that one |
00:35:09 | FromDiscord | <dain> ya my intuition was: the code bloat goes away when you have pattern matching and object variants and discriminated unions |
00:35:19 | FromDiscord | <dain> (edit) "and" => "/" |
00:35:26 | FromDiscord | <haxscramper> "Great" article btw, comparing java vs anything would make your argument look convincing, yeah, that |
00:35:55 | FromDiscord | <haxscramper> In reply to @dain "ya my intuition was:": Yes. Pattern matching reduces boilerplate for dealing with loosely structured information |
00:36:29 | FromDiscord | <haxscramper> So it is a fixup for statically typed languages that makes it possible to easily deal with this |
00:37:30 | FromDiscord | <haxscramper> And would bet there is an introspection framework for java that makes it a one-liner |
00:37:53 | FromDiscord | <dain> oh and while we're on the subject of the docs, the part in "ref object matching" where it talks about the need for "of" isnt quite clear to me. is it talking about the double `of of` thing? |
00:38:13 | FromDiscord | <dain> that looks weird and scary |
00:38:34 | FromDiscord | <haxscramper> Yes. 'of' itself is a nim operator they you can use, like 'instanceof' in java |
00:39:05 | FromDiscord | <haxscramper> And it can be used in prefix, and case also uses of ... So you get this weird 'of of' |
00:41:16 | FromDiscord | <haxscramper> In reply to @haxscramper "And would bet there": Nim has static codegen and introspection and it is arguably easier to use, but java also has its powerful sides. This article is as bad as "beating C with Haskell" where they have hyper-optimized Haskell code vs some cave-tier C one. Same story here, except nim making it more obvious how to have code hyper-optimized for readability |
00:42:45 | FromDiscord | <haxscramper> Although admittedly patter matching looks like regex |
00:52:12 | FromDiscord | <dain> > Instead I would recommend using treefrom/jsony, which has support for dynamic nodes↵i'm a little confused by what you say here. aren't the stdlib JSON nodes dynamic before you cast them? |
00:53:09 | FromDiscord | <dain> the jsonny `fromJSON` proc returns a `JsonNode` which is the stdlib one right? |
00:53:13 | FromDiscord | <dain> https://nimdocs.com/treeform/jsony/jsony.html#fromJson%2Cstring |
00:53:24 | FromDiscord | <enthus1ast> yes |
01:02:37 | * | dsrw joined #nim |
01:02:58 | FromDiscord | <haxscramper> In reply to @dain "the jsonny `fromJSON` proc": I was talking about this https://nimdocs.com/treeform/jsony/jsony.html#fromJson%2Cstring%2Ctypedesc%5BT%5D |
01:03:24 | FromDiscord | <haxscramper> Json string to any type |
01:03:47 | * | jfrent joined #nim |
01:04:22 | FromDiscord | <dain> ah I see, thanks |
01:04:25 | FromDiscord | <haxscramper> https://github.com/treeform/jsony/blob/master/tests/test_objects.nim |
01:05:12 | FromDiscord | <dain> so if I'm to understand it: you can mix and match between putting the json into types you define upfront, and doing ad-hoc parsing? |
01:07:01 | FromDiscord | <haxscramper> More or less h https://github.com/treeform/jsony#full-support-for-json-in-json |
01:07:03 | nrds | <prestigebot99> itHub: 7"A loose, direct to object json parser with hooks." |
01:10:26 | FromDiscord | <Ayy Lmao> Is there a way to escape backticks within a `quote do` block in a macro? |
01:11:08 | FromDiscord | <Elegantbeef> You can always change the insert character |
01:11:40 | FromDiscord | <Ayy Lmao> I've been trying to do that but I'm not exactly sure how it works. It isn't behaving how I would expect. |
01:11:42 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/macros.html#quote%2Ctyped%2Cstring notice it has a second parameter |
01:14:03 | FromDiscord | <Ayy Lmao> I'll try to write an example |
01:14:59 | FromDiscord | <Elegantbeef> I've personally never used any other symbol but i recall some library was using `@` instead, though dont recall how 😀 |
01:17:57 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3vWS |
01:18:41 | FromDiscord | <Elegantbeef> why are you even using a macro here? |
01:19:00 | FromDiscord | <Ayy Lmao> It's just my simple example of the problem I am having. What I'm doing is more complicated and requires a macro |
01:19:01 | FromDiscord | <Elegantbeef> Assuming this is representative of the proc logic |
01:19:13 | FromDiscord | <Elegantbeef> Just making sure |
01:20:18 | FromDiscord | <xflywind> In reply to @Elegantbeef "https://nim-lang.org/docs/macros.html#quote%2Ctyped": Dev docs have some examples |
01:20:45 | FromDiscord | <Elegantbeef> https://nim-lang.github.io/Nim/macros.html#quote%2Ctyped%2Cstring |
01:21:58 | FromDiscord | <Rika> In reply to @Elegantbeef "https://nim-lang.org/docs/macros.html#quote%2Ctyped": The last time I used it changing that parameter did nothing |
01:23:59 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3vWT |
01:24:35 | FromDiscord | <Elegantbeef> Yea you dont need the accquote it's just `@tyName` |
01:24:46 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3vWU like so |
01:26:32 | FromDiscord | <Ayy Lmao> That seems to work for my simple example but it is failing for my more complicated one. I'll try to boil down the issue |
01:28:28 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3vWW |
01:28:33 | FromDiscord | <Ayy Lmao> It doesn't work for `@tyName = distinct int` |
01:31:24 | * | KurtGodel quit (Read error: Connection reset by peer) |
01:31:44 | * | KurtGodel joined #nim |
01:32:32 | FromDiscord | <Elegantbeef> Yea the prefix operator there isnt parsable |
01:33:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3vWX |
01:36:29 | * | dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
01:41:09 | NimEventer | New thread by Kalbhairab: Notification show, see https://forum.nim-lang.org/t/8323 |
01:41:58 | * | dsrw joined #nim |
01:42:31 | FromDiscord | <Ayy Lmao> Strange. Well I guess the template is the way to go for now. I wonder why there is no way to simply escape the backticks. I feel like that would be conceptually much simpler and not have errors like this. Maybe I am just not understanding it properly. |
01:44:57 | * | stkrdknmibalz joined #nim |
01:51:44 | * | dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
02:31:13 | NimEventer | New thread by Alexeypetrushin: Print why assert failed?, see https://forum.nim-lang.org/t/8324 |
02:42:13 | * | arkurious quit (Quit: Leaving) |
03:43:11 | FromDiscord | <undersquire> Nim is named after this right https://en.m.wikipedia.org/wiki/Nimrod_(computer) |
03:43:52 | FromDiscord | <Elegantbeef> No it's named after nimrod the king from the bible |
03:44:07 | FromDiscord | <undersquire> Ah ok lol |
03:44:19 | FromDiscord | <undersquire> Oh that makes sense with the crown 😂 |
03:49:15 | FromDiscord | <Elegantbeef> Yea the language was also named nimrod, and nimble was named babel iirc |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:30 | * | supakeen joined #nim |
04:15:31 | NimEventer | New question by Alex Craft: Nim enum converter macro?, see https://stackoverflow.com/questions/68780268/nim-enum-converter-macro |
04:37:53 | FromDiscord | <Jonah> how can i get nimble to always have `-d:ssl` enabled when building my app |
04:38:34 | FromDiscord | <Jonah> nvm, i had the wrong filename for `nim.cfg` |
04:38:46 | FromDiscord | <Elegantbeef> you can make a `config.nims` and put `switch("define", "ssl")` |
04:38:52 | FromDiscord | <Elegantbeef> Or a `nim.cfg` ofc |
05:29:56 | * | Jjp137 quit (Read error: Connection reset by peer) |
05:31:08 | * | Jjp137 joined #nim |
05:38:41 | FromDiscord | <Bung> @ElegantBeef scripter ready for use ? |
05:39:09 | FromDiscord | <Elegantbeef> Nope i've been a tremendously bad developer |
05:40:04 | FromDiscord | <Bung> that's bad news to me |
05:41:29 | FromDiscord | <Elegantbeef> I apologize, but the way to support Nim -\> nimscript object variants is quite complex and i havent being wanting the self pain to write it |
06:01:27 | * | rockcavera quit (Remote host closed the connection) |
06:04:44 | * | xet7 quit (Ping timeout: 272 seconds) |
06:09:19 | * | flynn quit (Read error: Connection reset by peer) |
06:09:54 | FromDiscord | <Bung> Dont be , I think I just need find another solution. |
06:10:27 | * | flynn joined #nim |
06:11:36 | FromDiscord | <treeform> In reply to @dain "so if I'm to": Its much faster to parse json string > objects direclty, then go json string > json nodes > objects. That's the main reason why Jsony is fast. |
06:12:15 | FromDiscord | <treeform> it just does less work |
06:29:14 | FromDiscord | <Chiggy> Hello. I installed nim on windows, and also have cygwin installed. However, I get compile errors. and I was able to find an issue for it↵<https://github.com/nim-lang/Nim/issues/10645> It mentions a config.nims. But it doesnt exist for me. What do I do? |
06:30:54 | FromDiscord | <Elegantbeef> Create the file in the location and plop in the fields it gave |
06:31:14 | FromDiscord | <Chiggy> oh ok |
06:32:17 | FromDiscord | <Elegantbeef> Though it doesn support cygwin, so consider using mingw |
06:34:50 | * | max22- joined #nim |
06:35:56 | FromDiscord | <Chiggy> In reply to @Elegantbeef "Though it doesn support": um, from this page <http://mingw-w64.org/doku.php/download>? |
06:37:31 | FromDiscord | <Elegantbeef> If you just use choosenim it should work ok |
06:42:58 | * | xet7 joined #nim |
06:45:28 | FromDiscord | <Chiggy> In reply to @Elegantbeef "If you just use": I installed using choosenim and still same error |
06:47:35 | FromDiscord | <Chiggy> I downloaded https://github.com/dom96/choosenim/releases/download/v0.7.4/choosenim-0.7.4_windows_amd64.zip and extracted it. Ran the runme.bat file |
06:49:02 | FromDiscord | <Chiggy> output https://media.discordapp.net/attachments/371759389889003532/875994404698095636/unknown.png |
06:50:21 | FromDiscord | <Elegantbeef> you did add that directory to your path? |
06:50:37 | FromDiscord | <Chiggy> yeah |
06:50:56 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/875994880441217034/unknown.png |
06:51:13 | FromDiscord | <Chiggy> and it works too https://media.discordapp.net/attachments/371759389889003532/875994951740182558/unknown.png |
06:54:32 | FromDiscord | <Elegantbeef> You did create that config file? |
06:56:41 | FromDiscord | <Chiggy> new error this time |
06:56:52 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/875996378080370718/unknown.png |
06:58:42 | FromDiscord | <Chiggy> config https://media.discordapp.net/attachments/371759389889003532/875996833850224690/unknown.png |
06:59:01 | FromDiscord | <Elegantbeef> IT cannot find mingw, so it's not in your path |
06:59:21 | FromDiscord | <Chiggy> In reply to @Chiggy "um, from this page": But I havent installed mingw yet |
06:59:33 | FromDiscord | <Elegantbeef> Choosenim should install it |
06:59:34 | FromDiscord | <Chiggy> I thought choosenim would install it and stuff |
06:59:48 | FromDiscord | <Chiggy> In reply to @Chiggy "output": well thats the whole output of choosenim |
07:00:06 | FromDiscord | <Chiggy> now what |
07:00:36 | FromDiscord | <Chiggy> (edit) |
07:02:24 | FromDiscord | <Elegantbeef> Have you restarted/logged out and back in? I know windows can be finicky with the path |
07:02:38 | FromDiscord | <Chiggy> let me restart explorer |
07:02:55 | FromDiscord | <Rika> I believe you have to relog |
07:03:26 | FromDiscord | <Chiggy> hmm ight I will restart my laptop |
07:06:19 | FromDiscord | <Chiggy> ok I have restarted my laptop |
07:06:31 | FromDiscord | <Chiggy> now how do I check if mingw got installed by choosenim |
07:06:56 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/875998910177501194/unknown.png |
07:07:02 | FromDiscord | <Elegantbeef> run `x86_64-w64-mingw32-gcc.exe` |
07:07:32 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/875999058584539136/unknown.png |
07:07:35 | FromDiscord | <Chiggy> nope |
07:07:49 | FromDiscord | <Chiggy> where does choosenim install it |
07:11:26 | FromDiscord | <Elegantbeef> I dont know but i think it's either in program files or in a `.nim` directory in documents |
07:11:43 | FromDiscord | <Chiggy> documents has no .nim |
07:12:05 | FromDiscord | <Chiggy> I do have a .nimble in my Home directory |
07:12:29 | FromDiscord | <Chiggy> and theres also a .choosenim there |
07:12:36 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/876000334244376617/unknown.png |
07:13:02 | FromDiscord | <Chiggy> and nothing in program files either |
07:13:31 | FromDiscord | <Chiggy> can I just manually install those 2 exes |
07:13:41 | FromDiscord | <Chiggy> if so, how or from where |
07:15:45 | FromDiscord | <Elegantbeef> I do not know |
07:52:41 | * | xet7 quit (Remote host closed the connection) |
07:56:54 | FromDiscord | <Chiggy> Ok now I installed mingw. Install gcc and stuff. And am using it. And I get a different error now |
07:57:06 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/876011533958791198/unknown.png |
07:57:26 | FromDiscord | <Chiggy> why has getting nim to compile become such a challenge for me |
07:57:28 | FromDiscord | <Chiggy> (edit) "why has getting nim to compile become such a challenge for me ... " added "lol" |
07:58:54 | FromDiscord | <Chiggy> Ok adding the config file helped |
07:58:57 | FromDiscord | <Chiggy> it compiled now |
08:00:40 | FromDiscord | <hamidb80> hey |
08:01:31 | FromDiscord | <hamidb80> how can i get stats of a file in nim [eg. modified date, creation date ,...]? i couldn't find any examples |
08:02:36 | FromDiscord | <Elegantbeef> `std/os` has a few of those `getCreationDate`, `getLastModificationTime` |
08:03:31 | FromDiscord | <Elegantbeef> `getFileInfo` for the whole lot |
09:13:53 | * | tdc joined #nim |
10:52:17 | * | tdc quit (Ping timeout: 258 seconds) |
10:57:51 | FromDiscord | <dom96> In reply to @Chiggy "where does choosenim install": Choosenim doesn’t install it if it’s already in your path |
10:58:34 | FromDiscord | <Chiggy> I am pretty sure ming wasnt in my path tho |
10:58:53 | FromDiscord | <dom96> In reply to @Chiggy "": Then what’s this? |
10:59:27 | FromDiscord | <Chiggy> I probably lack knowledge but, arent those different? |
10:59:52 | FromDiscord | <Chiggy> I thought cygwin and mingw were different things |
11:00:28 | FromDiscord | <dom96> Yes, but choosenim just looks for any gcc |
11:00:39 | FromDiscord | <Chiggy> ah I see |
11:00:45 | FromDiscord | <Chiggy> I did have gcc in the path yeah |
11:00:59 | FromDiscord | <dom96> The real problem is your custom config I guess |
11:01:03 | FromDiscord | <Gabryx86_64> In reply to @Chiggy "I thought cygwin and": doest cygwin need a dll on path? |
11:02:17 | FromDiscord | <Chiggy> In reply to @dom96 "The real problem is": Yeah I didnt understand much why its like needed. I can see in the mingw bin folder both `gcc.exe` and the other file are present. Why does using the other file solve the issue 🤔 |
11:02:56 | FromDiscord | <Chiggy> (edit) "other file" => "`x86_64-w64-mingw32-gcc.exe`" | "other file" => "`x86_64-w64-mingw32-gcc.exe`" |
11:48:19 | FromDiscord | <enthus1ast> i'm playing with nimscript, to make my template engine dynamic, currently i evaluate a whole nim script set a global variable and get the content of the variable with selectUniqueSymbol() and getGlobalValue().↵↵I was wondering if/how it is possible to just let the vm epand a macro, and get the expanded nim into the compiled program |
11:49:09 | FromDiscord | <Rika> call the macro? |
11:50:02 | FromDiscord | <enthus1ast> let the vm call the macro? |
11:50:31 | FromDiscord | <Rika> ah, from the vm |
11:50:32 | FromDiscord | <enthus1ast> the problem is that the macro is only partial valid, and gets valid when inside a proc body |
11:51:51 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3vYV |
11:52:01 | FromDiscord | <enthus1ast> as far as i see i can only get symbols from the vm |
11:53:57 | FromDiscord | <haxscramper> You can convert data betweem VM and compiled part by registering callbacks |
11:53:57 | FromDiscord | <haxscramper> https://github.com/haxscramper/hnimast/blob/master/tests/tNimscriptInterop.nim |
11:54:33 | FromDiscord | <haxscramper> `selectUniqueSymbol` might work as well, but I would try to use callback implementation |
11:54:35 | * | ploki joined #nim |
11:54:59 | FromDiscord | <haxscramper> Nim my earlier example I also used it https://github.com/haxscramper/hack/blob/22088c696fa45cc01d059084d73d1b6a4e449063/testing/nim/compilerapi/nims_template.nim#L63 |
11:57:26 | FromDiscord | <haxscramper> I'm not sure what you mean by "let the vm expand a macro, and get the expanded nim into the compiled program". You could theoretically use `semMacroExpr` or `semSym` from `compiler/sem.nim` |
11:57:42 | FromDiscord | <haxscramper> Take in call to a macro, get it's expanded form |
11:58:22 | * | max22- quit (Ping timeout: 256 seconds) |
11:58:26 | FromDiscord | <haxscramper> it is not exported though |
11:59:52 | FromDiscord | <haxscramper> Also if you drop `evalPass` then you woudl basically expand a macro |
12:00:29 | FromDiscord | <enthus1ast> i was thinking about two options how to use a dynamic template\:↵1. have the whole stuff (with the outer proc definition ) in a dynamic evaluated nim script.↵2. have the outer proc definition in compiled code, then register all parameters of the compiled proc to the vm, evaluate the template, get the return code out of the vm, return it in compiled code |
12:01:20 | FromDiscord | <haxscramper> By "get the return code out of the vm, return it in compiled code" you mean return value of the compiled part? |
12:01:21 | FromDiscord | <enthus1ast> (3. much better option, but lack of knowledge) |
12:02:24 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3vYY |
12:04:15 | FromDiscord | <haxscramper> So you want to define a compiled proc that calls into VM? |
12:04:18 | FromDiscord | <enthus1ast> yep |
12:05:31 | FromDiscord | <Rika> nimscripter time i guess |
12:05:36 | FromDiscord | <Rika> unless im misunderstanding |
12:05:47 | FromDiscord | <haxscramper> no, nimscripter does this other way |
12:05:55 | FromDiscord | <haxscramper> VM into compiled |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:31 | * | supakeen joined #nim |
12:07:02 | FromDiscord | <Rika> well im not seeing the use for the other way |
12:07:09 | FromDiscord | <enthus1ast> then there could be a define that tells if the template is dynamically evaluated (eg. when developing a web site) but in production it is compiled |
12:07:16 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vZ0 |
12:07:37 | FromDiscord | <haxscramper> so basically the idea is - you `processModule` inside of compiled proc body |
12:07:54 | FromDiscord | <haxscramper> `processModule` for the proc implementation |
12:08:00 | FromDiscord | <haxscramper> And some glue code for it to set `result` in the end |
12:08:01 | FromDiscord | <enthus1ast> but then i must convert between PNode and NimNode or? |
12:08:29 | FromDiscord | <haxscramper> Where nimnode comes from? |
12:08:40 | FromDiscord | <haxscramper> I mean, there is nim node, we are not doing macro code right now? |
12:09:42 | FromDiscord | <enthus1ast> so the macro is expanded inside the vm (where i generate NimNodes) the vm does its magic and outputs PNodes? |
12:11:12 | FromDiscord | <haxscramper> Here, the `# <- vm` part is written manually, or it is a `compileTemplate("file.nwt")`? |
12:11:31 | FromDiscord | <enthus1ast> yes this should be a compileTemplate("file.nwt") |
12:11:44 | FromDiscord | <enthus1ast> at least this is what i had in mind |
12:11:53 | FromDiscord | <haxscramper> okay, then it doesn't matter because macro be expanded in `processModule3` |
12:12:38 | FromDiscord | <haxscramper> So your proc implementation would be a `processModule(graph, m, newCall(graph.getIdent("compileTemplate"), newLit("file.nwt"))` |
12:12:39 | FromDiscord | <haxscramper> Roughly speaking |
12:12:40 | FromDiscord | <haxscramper> But! |
12:13:06 | FromDiscord | <haxscramper> you can do better than this, and instead of calling into vm that calls into vm to expand macro to generate code to compile it in vm |
12:13:18 | FromDiscord | <haxscramper> you can just implement `compileTemplate(file: string): PNode` |
12:13:48 | FromDiscord | <haxscramper> And then processModule(graph, m, compileTempate("file.ntw"))\` |
12:15:00 | FromDiscord | <haxscramper> But this would require adapting macro implementation so it works at both runtime and compile time .. which is not impossible, I have tons of code that interacts with both runtime and compiletime AST |
12:15:40 | * | Vladar joined #nim |
12:15:54 | FromDiscord | <haxscramper> And if template parser works at compile-time there is nothing stopping it from working at runtime as well |
12:27:43 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vZ8 |
12:28:33 | FromDiscord | <haxscramper> https://haxscramper.github.io/hnimast/src/hnimast/hast_common.html#newWhen%2CN%2CN%2CN for generic codegen procs |
12:30:36 | FromDiscord | <haxscramper> Also, I would suggest simplifying AST definition, because it is super overloaded with fields - better introduce `NStmtList` kind and pack all subnodes in there |
12:42:56 | ploki | hey, is it possible for c codegen to not produce exceptions related code when using custom =destroy ? |
12:43:05 | ploki | consider this: https://play.nim-lang.org/#ix=3vZb |
12:44:07 | ploki | in the produced c, the destroy is handled with setjmp,exceptions,safepoint ... |
12:45:10 | FromDiscord | <haxscramper> Does `{.emit: "//".}` solve the issue? |
12:45:46 | FromDiscord | <enthus1ast> [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)\: i'm trying, and playing with this, thank you really much! |
12:58:41 | * | arkurious joined #nim |
13:25:46 | * | vrilles joined #nim |
13:53:18 | * | yoctocell joined #nim |
13:54:11 | * | yoctocell quit (Remote host closed the connection) |
13:59:44 | * | max22- joined #nim |
14:02:58 | * | vsantana joined #nim |
15:15:38 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
15:19:36 | * | Mister_Magister quit (Ping timeout: 272 seconds) |
15:23:54 | * | rockcavera joined #nim |
15:23:54 | * | rockcavera quit (Changing host) |
15:23:54 | * | rockcavera joined #nim |
15:44:52 | * | ploki quit (Quit: Client closed) |
16:19:10 | FromDiscord | <dom96> hm, anybody using --header in Nim to generate headers? Once I add a {.byref.} to one of my types Nim seems to fail to generate that type's {.header.} #include |
16:19:18 | * | Vladar quit (Remote host closed the connection) |
16:22:34 | FromDiscord | <enthus1ast> [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)\: when i'm calling processModule and i set up `graph` and `m` like in your hacks, then it does evaluate in its own module right? so it does behave differently than the macro or? |
16:22:58 | FromDiscord | <enthus1ast> the macro expands in place |
16:23:29 | FromDiscord | <enthus1ast> but for the processModule i must get the return code and the params in and out right? |
16:24:18 | FromDiscord | <enthus1ast> what kinda works in my playground code is, when i let a vm callback sets a closure variable, that i then return |
16:24:56 | FromDiscord | <haxscramper> `processModule` acts as if you were supplying new chunks of code in repl |
16:25:17 | FromDiscord | <haxscramper> So yes, it does process everything in one module |
16:25:17 | FromDiscord | <haxscramper> Except for imported stuff that are processed as regular nim code |
16:25:33 | FromDiscord | <enthus1ast> oh pardon i call processModule3 |
16:25:35 | FromDiscord | <haxscramper> Yes, macro expands in place when you call it, like any regular nim code |
16:26:19 | FromDiscord | <haxscramper> yes, I know, in the end I just got confused with 1/2/3 as well. But they all act identically |
16:26:33 | FromDiscord | <haxscramper> processModule2 from my very first example does the same |
16:27:11 | FromDiscord | <Ayy Lmao> In reply to @dom96 "hm, anybody using --header": `--header` in the compiler? I'm not seeing that in the docs, what does it do? |
16:27:22 | FromDiscord | <haxscramper> It is deprecated↵(@Ayy Lmao) |
16:27:25 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/commit/279df834bae8b6972af6cbcbdd57c1d53e1df9c7 |
16:27:46 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3w0x |
16:28:04 | FromDiscord | <haxscramper> yes, because you need to do `nkReturnStmt` obviously |
16:28:12 | FromDiscord | <dom96> In reply to @haxscramper "https://github.com/nim-lang/Nim/commit/279df834bae8": ugh |
16:28:16 | FromDiscord | <enthus1ast> `obviously` ;) |
16:28:33 | FromDiscord | <haxscramper> well, I mean it is identical to nim code |
16:28:34 | FromDiscord | <haxscramper> macro code |
16:28:58 | FromDiscord | <haxscramper> so you can use `dumpAstGenRepr` or what it is called |
16:29:01 | FromDiscord | <dom96> Well I submitted https://github.com/nim-lang/Nim/issues/18694 anyway |
16:29:21 | FromDiscord | <haxscramper> and replace literal/ident construction with their more verbose conterpats |
16:29:37 | FromDiscord | <haxscramper> yeah, good idea |
16:29:38 | FromDiscord | <haxscramper> I think hnimast needs pnodeAstGenRepr |
16:30:13 | FromDiscord | <haxscramper> And I should also use `newIf` and other shortcut calls instead of this `nnkIf.newTree()` abomination wherewher possible |
16:31:21 | FromDiscord | <dom96> Guess I'll be hacking around this ugh |
16:31:28 | FromDiscord | <Ayy Lmao> I've been confused about things with FFI for a while. Am I supposed to be relying on having a header to interface with libraries? In c it seems to be possible to get away with not using a header, but c++ appears to be a different story. |
16:31:57 | FromDiscord | <enthus1ast> sent a long message, see https://paste.rs/5c1 |
16:32:07 | FromDiscord | <haxscramper> I'm pretty sure you need header to interface with C++ in almost every scenario |
16:32:15 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/lij |
16:33:51 | FromDiscord | <Ayy Lmao> In reply to @haxscramper "I'm pretty sure you": Yeah I'm finding that seems to be the case as I get deeper into it. |
16:34:35 | FromDiscord | <Rika> In reply to @haxscramper "https://github.com/nim-lang/Nim/commit/279df834bae8": why is araq so aggressive? |
16:34:42 | FromDiscord | <Rika> ive always thought about that |
16:37:08 | FromDiscord | <Ayy Lmao> Has anyone gotten pixie to compile for visual studio? I keep getting tons of errors like ` error C2664: 'm128i _mm_loadu_si128(const m128i )': cannot convert argument 1 from 'void ' to 'const m128i '` |
16:38:58 | * | ploki joined #nim |
16:39:52 | FromDiscord | <dom96> sent a code paste, see https://play.nim-lang.org/#ix=3w0B |
16:44:49 | * | ploki quit (Quit: Ping timeout (120 seconds)) |
16:45:16 | * | ploki joined #nim |
16:48:15 | * | Mister_Magister joined #nim |
16:52:10 | FromDiscord | <haxscramper> https://github.com/haxscramper/hack/commit/fe67a0082adda327310d817ac774d6ecc8998789 [enthus1ast](https://matrix.to/#/@sn0re:matrix.code0.xyz) |
16:53:40 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3w0D |
16:53:59 | FromDiscord | <gerwy> Is devel much faster than stable 1.4.8? |
16:54:25 | FromDiscord | <haxscramper> most likely no |
16:54:31 | FromDiscord | <haxscramper> and "much faster" itself does not really mean anything |
16:55:00 | FromDiscord | <haxscramper> if you are asking about IC - I don't know, but IIRC it is still in experimental/break-everything state |
16:56:16 | FromDiscord | <gerwy> I just have a project and id like to optimize the shit out of it |
16:56:22 | FromDiscord | <gerwy> Im already going with simd |
16:56:43 | FromDiscord | <gerwy> Next step is also using gpu, but i have some issues with that |
16:57:16 | FromDiscord | <haxscramper> then nim devel is unlikely to add anything |
16:58:05 | FromDiscord | <haxscramper> you might also consider closely examining how you handle data, cache etc, before going to GPU, but I'm not really qualified to give any meaningful optimization suggestions |
16:58:45 | FromDiscord | <enthus1ast> yeah also when i do this -\> Error\: 'return' not allowed here |
16:59:05 | FromDiscord | <haxscramper> ah |
16:59:12 | FromDiscord | <haxscramper> yes, 300iq moment |
16:59:20 | FromDiscord | <haxscramper> return needs to be in fucntion |
16:59:21 | FromDiscord | <haxscramper> function |
16:59:48 | * | vrilles quit (Quit: vrilles) |
16:59:51 | FromDiscord | <haxscramper> try writing `return 12` in toplevel statement in a repl |
17:00:07 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3w0G |
17:01:24 | FromDiscord | <haxscramper> also this would just be a horrible implementation performance-wise, I think there must be a way to cache sem of the executed call |
17:01:58 | FromDiscord | <enthus1ast> currently performance is my last concern hahaha |
17:02:47 | FromDiscord | <enthus1ast> mh ok so this means i cannot return from there |
17:05:34 | FromDiscord | <enthus1ast> mh i also cannot access the outer scope |
17:05:43 | FromDiscord | <enthus1ast> i think i have a fundamental flaw in my code |
17:12:02 | FromDiscord | <enthus1ast> In case you want to have a look at the hot mess\:↵↵https://github.com/enthus1ast/nimja/blob/1ad62023817e87a77ca7d1075a639f0e9b469c57/src/nimja/parser.nim#L400↵https://github.com/enthus1ast/nimja/blob/dynamic/tests/basic/test_dynamic.nim |
17:21:05 | * | vicfred quit (Ping timeout: 248 seconds) |
17:29:08 | * | KurtGodel quit (Read error: Connection reset by peer) |
17:29:26 | * | KurtGodel joined #nim |
17:43:58 | FromDiscord | <haxscramper> https://github.com/haxscramper/hack/commit/a1e6341dc5a7f34744682f4b48818c5a68facd0b |
17:43:59 | FromDiscord | <haxscramper> okay, I think it does what you need to do |
17:44:45 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3w0Q |
17:45:04 | FromDiscord | <haxscramper> I returned `processModule2()` that takes stream because it is easier to write test examples this way |
17:46:22 | * | max22- quit (Ping timeout: 245 seconds) |
17:47:18 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3w0R |
17:47:54 | FromDiscord | <haxscramper> I used your exampel |
17:47:55 | FromDiscord | <haxscramper> ` parseNode(graph, m, llStreamOpen("templateExecutedInVm()"))` is your implementation code, it calls into macro/template that is expanded in VM |
17:47:57 | FromDiscord | <Chiggy> sent a code paste, see https://play.nim-lang.org/#ix=3w0S |
17:48:11 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3w0T |
17:48:37 | FromDiscord | <gerwy> In reply to @haxscramper "you might also consider": Well yeah im already doing few things↵I could try to work with one buffer instead of two buffers in game of life, two speed things up im swapping their pointers instead of swapping data |
17:49:00 | FromDiscord | <haxscramper> Right now, there is still a bug where repeated calls to `runtimeImplBody()` does not return correct resutls |
17:49:00 | FromDiscord | <haxscramper> But internal logic functions fine |
17:49:31 | FromDiscord | <gerwy> And i will involve simd to it too, with 8 cells 1-bit data i should be able to compute like 32 of cells at the same time |
17:50:07 | FromDiscord | <haxscramper> [enthus1ast](https://matrix.to/#/@sn0re:matrix.code0.xyz)\: |
17:50:10 | FromDiscord | <enthus1ast> yes |
17:54:36 | FromDiscord | <Ayy Lmao> What's the best way to go from an utf16 encoded int to a string? Casting to a Rune seems to work ok but I'm not sure if it's right. |
17:55:34 | FromDiscord | <enthus1ast> thank you [haxscramper](https://matrix.to/#/@haxscramper:matrix.org) |
18:02:27 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3w0Y |
18:05:56 | FromDiscord | <Chiggy> In reply to @haxscramper "You can directly access": Oh thats cool. And one more thing, how can I find out the index, if I have an object? (I got this object via sugar collect) |
18:06:02 | FromDiscord | <Chiggy> (edit) "an object?" => "a node?" |
18:06:11 | FromDiscord | <Chiggy> (edit) "node?" => "json?" |
18:07:08 | * | vicfred joined #nim |
18:07:13 | FromDiscord | <haxscramper> Not sure what do you mean by "find index". You can search in json array with `std/sequtils.findIt`, or something like that |
18:09:18 | FromDiscord | <Chiggy> In reply to @haxscramper "Not sure what do": Like, if my array is like `[ {'a':1} , {'b':2}]` and I already have the `{'b':2}` element, how can I get its index, so I can delete it? |
18:09:26 | FromDiscord | <Chiggy> thats what I meant |
18:09:47 | FromDiscord | <enthus1ast> you cant, you ,ust search for it or loop through the array with pairs() |
18:10:03 | FromDiscord | <enthus1ast> you cant, you must search for it or loop through the array with pairs() |
18:10:13 | FromDiscord | <Chiggy> oh |
18:10:31 | FromDiscord | <enthus1ast> how do you got the element in the first place? |
18:10:51 | FromDiscord | <Chiggy> using the collect macro |
18:12:32 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3w0Z |
18:12:34 | FromDiscord | <haxscramper> I forgot there is no `findIt` in stdlib |
18:13:04 | FromDiscord | <enthus1ast> then i would use .pairs() , identify the element, store the index somewhere, then after the loop delete it |
18:14:15 | FromDiscord | <enthus1ast> yes \: ) |
18:17:46 | FromDiscord | <Chiggy> ok this is weird, but I was just typing find, and vscode intellisense got me this, and it seems to work? https://media.discordapp.net/attachments/371759389889003532/876167729822969856/unknown.png |
18:19:37 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/876168195365535804/unknown.png |
18:20:42 | FromDiscord | <enthus1ast> yes when you want to loop a second time, this works |
18:20:53 | FromDiscord | <Chiggy> huh? |
18:21:03 | * | max22- joined #nim |
18:21:32 | FromDiscord | <enthus1ast> when you have the index during a collect, you can store it, and delete it. Then find does not have to loop over the seq again |
18:22:03 | FromDiscord | <Chiggy> hmm thats true |
18:22:45 | FromDiscord | <enthus1ast> but you cant delete during iterating, so this must be done afterwards |
18:23:55 | FromDiscord | <enthus1ast> but find also does only find the first |
18:24:14 | FromDiscord | <enthus1ast> it might not be the element you want to delete (if you have multiple of them) |
18:24:55 | FromDiscord | <Chiggy> am gonna be honest and just say, I am actually very new to nim, but I have been trying to read the docs and the tutorials. I am an intermediate python guy, who wanted to optimize some code. |
18:25:12 | FromDiscord | <Chiggy> In reply to @enthus1ast "it might not be": btw yes I only have 1 occurence |
18:25:22 | * | ploki quit (Quit: Client closed) |
18:29:06 | FromDiscord | <Chiggy> Ok I am confused. Whats wrong here? ↵`gt_raw_data` is an array of json and so is `old_players_gts`. I got both by using `parseJson(string)` proc. https://media.discordapp.net/attachments/371759389889003532/876170580443934730/unknown.png |
18:32:30 | FromDiscord | <Chiggy> Um, anyone? |
18:33:34 | FromDiscord | <enthus1ast> mh |
18:33:50 | FromDiscord | <enthus1ast> sure that old\_player\_gts is not a string? |
18:34:33 | FromDiscord | <Chiggy> Yeah |
18:34:44 | FromDiscord | <Chiggy> can I somehow echo the type during runtime |
18:34:47 | FromDiscord | <Chiggy> that would confirm |
18:35:11 | FromDiscord | <dom96> https://nim-lang.org/docs/json.html#pairs.i%2CJsonNode |
18:35:16 | FromDiscord | <dom96> idx is the key |
18:35:40 | FromDiscord | <enthus1ast> ah did not know this |
18:36:22 | FromDiscord | <Chiggy> wait but its an array of jsonNodes, so uh, what will the value of key |
18:38:10 | FromDiscord | <dom96> you'll get a runtime error |
18:38:19 | FromDiscord | <Chiggy> I did |
18:38:20 | FromDiscord | <Chiggy> lol |
18:38:28 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/876172942600450128/unknown.png |
18:38:45 | FromDiscord | <Chiggy> In reply to @Chiggy "can I somehow echo": . |
18:40:36 | FromDiscord | <Chiggy> so `typeof(old_players_gts)` gives `JsonNode` |
18:40:55 | FromDiscord | <Chiggy> I am confused right now |
18:41:20 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3w13 |
18:44:20 | FromDiscord | <Chiggy> sent a code paste, see https://play.nim-lang.org/#ix=3w14 |
18:45:24 | FromDiscord | <enthus1ast> but it looks a little complicated, maybe keep it simple, if you do not have so many elements in the list, then the find options could be good/fast |
18:46:49 | FromDiscord | <Chiggy> In reply to @enthus1ast "but it looks a": just shy of 43k elements |
18:47:22 | FromDiscord | <enthus1ast> ok maybe little optimization could not hurt here \:) |
18:47:34 | FromDiscord | <Chiggy> Yeah |
18:47:46 | FromDiscord | <Chiggy> the part of code I am writing took 2 seconds in python |
18:48:19 | FromDiscord | <Chiggy> lets see how long it will take in nim |
18:50:32 | FromDiscord | <enthus1ast> if you just want to delete them from the list then you could also use filterIt |
18:51:44 | FromDiscord | <Chiggy> rn the del works pretty well, but I think I will be needing the filter function later on since I use `filter()` function in my python code |
18:52:56 | FromDiscord | <enthus1ast> or, even build a table or a hashset first, delete the ones you wanto to delete, depending on the size of gt\_raw\_data and old\_players\_gts |
18:53:04 | FromDiscord | <enthus1ast> if both are relly big, this explodes |
18:53:19 | FromDiscord | <enthus1ast> and transform the hashset into seq (if you need to) |
18:53:20 | FromDiscord | <Chiggy> gt_raw_data size is not fixed |
18:53:30 | FromDiscord | <Chiggy> but old players will just keep on increasing each time the code runs |
18:53:50 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/876176616030634055): if both are really big, this explodes |
18:54:13 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/876176679997964358): then transform the hashset into seq (if you need to) |
18:54:16 | FromDiscord | <Chiggy> what does explode mean here? |
18:54:27 | FromDiscord | <Chiggy> like really good for performance and speed? |
18:54:56 | * | notchris quit (Ping timeout: 272 seconds) |
18:55:03 | FromDiscord | <Chiggy> and also, why do people talk with webhooks? |
18:55:06 | FromDiscord | <Chiggy> (edit) "webhooks?" => "webhooks in hee?" |
18:55:08 | FromDiscord | <Chiggy> (edit) "hee?" => "here?" |
18:55:13 | FromDiscord | <enthus1ast> i mean when your outer loop contains 40k elems and every loop iteration it has to also loop through 40k elements of the inner loop |
18:56:01 | FromDiscord | <Chiggy> In reply to @Chiggy "like really good for": . |
18:56:26 | * | ormiret quit (Ping timeout: 258 seconds) |
18:56:33 | FromDiscord | <enthus1ast> then it might be better to build a hashset, then exlude the items, then build a seq out of the hashset again |
18:57:03 | * | euantorano quit (Ping timeout: 276 seconds) |
18:58:27 | * | LyndsySimon quit (Ping timeout: 252 seconds) |
18:58:39 | * | ormiret joined #nim |
18:58:42 | FromDiscord | <Chiggy> that sounds complex ngl |
18:59:45 | * | euantorano joined #nim |
19:00:21 | * | LyndsySimon joined #nim |
19:01:35 | * | notchris joined #nim |
19:04:51 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/ahp |
19:04:54 | * | Pyautogui joined #nim |
19:05:01 | FromDiscord | <enthus1ast> the hash solution is very fast |
19:05:43 | FromDiscord | <Chiggy> outer is just a sequence that contains 1,2,3, ... 39,999, 40k ? |
19:05:51 | FromDiscord | <enthus1ast> yeah |
19:05:56 | FromDiscord | <enthus1ast> in this example |
19:06:04 | FromDiscord | <Chiggy> yeah |
19:06:35 | FromDiscord | <enthus1ast> so after the excl call, outerHash does not contains elements from the innerHash set |
19:06:59 | FromDiscord | <Chiggy> basically like set difference? |
19:07:04 | FromDiscord | <enthus1ast> yes |
19:07:15 | FromDiscord | <enthus1ast> ehm |
19:07:17 | FromDiscord | <enthus1ast> kindof |
19:07:47 | FromDiscord | <enthus1ast> so depending on your data and what you wanna do i would consider this |
19:08:16 | FromDiscord | <Chiggy> Do you know python |
19:08:17 | FromDiscord | <enthus1ast> or with a table where the key is eg. playername |
19:08:56 | FromDiscord | <enthus1ast> yes |
19:11:12 | * | Pyautogui quit (Quit: Connection closed) |
19:11:26 | FromDiscord | <Chiggy> ok give me 5 minutes then |
19:11:59 | FromDiscord | <enthus1ast> i have to go drinking, you know germans like to drink \:) |
19:15:23 | FromDiscord | <Chiggy> you there or did you go |
19:15:46 | FromDiscord | <enthus1ast> here |
19:16:06 | FromDiscord | <Chiggy> <https://gist.github.com/Chiggy-Playz/09daa4563f5b7dd0275d92ffbefef60e> check this. I tried to tell what variable is supposed to contain what data |
19:17:50 | FromDiscord | <Chiggy> the issue in my python code begins at line 60. Its just, too unoptimized / slow. And I told you the number of rows in old_gt_data keeps on increasing. So the time taken to run my py code also increases. My target is around 30 seconds. When I ran the code for the first time, it ran in 8 seconds. Pretty good I would say. Then it has increased to 90 seconds. |
19:19:46 | FromDiscord | <Chiggy> after seeing my coding and figuring out how it works, would hash table be a good way? I just want it to be fast af. Since the code is supposed to run every minute |
19:26:01 | FromDiscord | <Chiggy> Lol you going through it right now or? |
19:26:16 | FromDiscord | <Chiggy> coz I am sorta waiting on you to know your opinion so I could advance |
19:30:06 | FromDiscord | <Chiggy> mention me when you are back please |
19:44:53 | * | rockcavera quit (Remote host closed the connection) |
20:03:45 | * | vsantana quit (Ping timeout: 248 seconds) |
20:24:44 | FromDiscord | <enthus1ast> Yeah↵(@Chiggy) |
20:24:52 | FromDiscord | <enthus1ast> Tomorrow↵(@Chiggy) |
20:25:01 | FromDiscord | <Chiggy> Hey |
20:25:22 | FromDiscord | <Chiggy> So were you able to go through it |
20:29:29 | * | xet7 joined #nim |
20:36:26 | * | supakeen quit (Remote host closed the connection) |
20:36:50 | * | supakeen joined #nim |
20:46:33 | FromDiscord | <enthus1ast> Yes, but i do not got every detail. The first Impression was, "this should be done inside the databases", the second was, that you loop the big sequence instead of the smaller one and do key lookups in the bigger one. But I'll help tomorrow porting it to nim if you like |
20:51:44 | * | krux02 joined #nim |
22:26:49 | FromDiscord | <ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3w2c |
22:30:24 | FromDiscord | <Elegantbeef> What's the input code? |
22:31:33 | FromDiscord | <ynfle (ynfle)> Should I post the whole code here? |
22:31:48 | FromDiscord | <Elegantbeef> playground probably smarter |
22:32:35 | FromDiscord | <ynfle (ynfle)> https://play.nim-lang.org/#ix=3w2d |
22:35:27 | FromDiscord | <Elegantbeef> So what i tend to do(not a proficient compiler dev) is that now we know where it errors, we can see the ast by putting an echo before it errors, or you can use a debugger if you wish of course |
22:35:45 | FromDiscord | <Elegantbeef> So i put `echo resNode` before that attempt of getting sym |
22:36:21 | FromDiscord | <Elegantbeef> rather `echo resNode.kind` |
22:37:16 | FromDiscord | <Elegantbeef> Ok so we see in the case it errors it has an `nkEmpty` in that AST position, so now we need to see why it's empty, when it expects a node |
22:39:27 | FromDiscord | <ynfle (ynfle)> Where did you put it? Nimdata 355? |
22:39:47 | FromDiscord | <Elegantbeef> No in the compiler |
22:39:56 | FromDiscord | <Elegantbeef> before line 1023 in cgen |
22:42:39 | FromDiscord | <ynfle (ynfle)> Do I then have to recompile nim? |
22:42:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3w2g |
22:42:50 | FromDiscord | <Elegantbeef> Well yea |
22:42:53 | FromDiscord | <Elegantbeef> `./koch temp` a lot |
22:43:03 | FromDiscord | <ynfle (ynfle)> Take a while on my computer |
22:43:11 | FromDiscord | <Elegantbeef> Only takes a while if doing a release |
22:43:19 | FromDiscord | <Elegantbeef> Takes vastly less time if doing `./koch temp` |
22:43:24 | FromDiscord | <ynfle (ynfle)> Oh ok |
22:45:10 | FromDiscord | <ynfle (ynfle)> Are you sure it's that method? |
22:45:40 | FromDiscord | <Elegantbeef> That's the method AST that it echos as it compiles |
22:45:52 | FromDiscord | <Elegantbeef> doing `echo prc.ast` before i attempt to get the sym |
22:46:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3w2i |
22:48:47 | FromDiscord | <ynfle (ynfle)> So how does the compiler error relate to this? |
22:49:17 | FromDiscord | <Elegantbeef> for some reason using that code results in the `result` being `nkEmpty` instead of a `nkSym` |
22:50:04 | FromDiscord | <Elegantbeef> So the thing to do is now figure out why and i reason it's the iterator result with an import or the using statement |
22:50:44 | FromDiscord | <ynfle (ynfle)> Why do you think that? |
22:51:03 | FromDiscord | <Elegantbeef> Cause those are the only two things that make sense to why the AST would be odd |
22:51:50 | FromDiscord | <Elegantbeef> I mean this is all just guessing i havent confirmed it |
22:54:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3w2j |
22:56:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3w2k |
22:56:36 | FromDiscord | <Elegantbeef> So it seems the issue is a `[T]` plus `DataFrame[NonT]` |
22:57:22 | FromDiscord | <Elegantbeef> Now i wish you luck on reasoning why this happens |
22:57:41 | FromDiscord | <ynfle (ynfle)> I think I know why |
22:57:54 | FromDiscord | <ynfle (ynfle)> Look right above the base method |
23:04:06 | * | max22- quit (Remote host closed the connection) |
23:10:06 | FromDiscord | <ynfle (ynfle)> NVM |
23:26:08 | FromDiscord | <ynfle (ynfle)> How do I use a debugger with the compiler? Do I have to use other flags when compiling with `./koch temp`? |
23:30:12 | FromDiscord | <Elegantbeef> probably need `--debugger:native` |
23:51:30 | * | krux02 quit (Remote host closed the connection) |
23:53:04 | FromDiscord | <System64 ~ Flandre Scarlet> How was sin() proc implemented? By Lookup table? |
23:53:59 | NimEventer | New post on r/nim by h234sd: OOP in Nim, if you missed it :), see https://reddit.com/r/nim/comments/p4iwvl/oop_in_nim_if_you_missed_it/ |
23:54:45 | FromDiscord | <Elegantbeef> it uses the sin from `math.h` so how ever that is done |
23:56:34 | FromDiscord | <System64 ~ Flandre Scarlet> and how was it implemented in C? |