00:04:56 | * | thomasross_ joined #nim |
00:04:56 | * | thomasross quit (Killed (orwell.freenode.net (Nickname regained by services))) |
00:04:56 | * | thomasross_ is now known as thomasross |
00:07:40 | donpdonp | for x in things: x is immutable. how to make x 'var'? |
00:09:41 | * | skelett joined #nim |
00:12:27 | donpdonp | for x in things.mitems: |
00:12:49 | * | Hideki_ joined #nim |
00:13:53 | * | livcd quit (Quit: Lost terminal) |
00:17:14 | * | Hideki_ quit (Ping timeout: 240 seconds) |
00:26:44 | * | Hideki_ joined #nim |
00:31:11 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:39:17 | * | vsantana quit (Remote host closed the connection) |
00:43:43 | * | vsantana joined #nim |
00:45:52 | * | Hideki_ quit (Remote host closed the connection) |
00:46:00 | madprops | oh shit, nim has async await |
00:46:26 | * | Hideki_ joined #nim |
00:48:51 | * | Hideki__ joined #nim |
00:48:51 | * | Hideki_ quit (Remote host closed the connection) |
00:50:09 | * | Hideki__ quit (Remote host closed the connection) |
00:52:27 | * | Hideki_ joined #nim |
00:52:45 | * | Hideki_ quit (Remote host closed the connection) |
00:52:59 | * | Hideki_ joined #nim |
00:58:19 | * | krux02_ joined #nim |
01:01:13 | * | krux02 quit (Ping timeout: 250 seconds) |
01:12:29 | * | ehmry quit (Ping timeout: 276 seconds) |
01:21:48 | * | krux02_ quit (Remote host closed the connection) |
01:23:45 | rockcavera | which of these biginteger packages is the best right now? ttmath, bigints or bignum? |
01:26:25 | * | exelotl quit (Ping timeout: 252 seconds) |
01:27:36 | * | ehmry joined #nim |
01:35:51 | * | sealmove quit (Quit: WeeChat 2.6) |
01:41:43 | * | Hideki_ quit (Remote host closed the connection) |
01:48:21 | FromGitter | <s0kil> I have created a wrapper for Coz Profiler, https://github.com/s0kil/nimcoz |
01:49:15 | disruptek | sweet |
01:49:19 | * | ehmry quit (Ping timeout: 250 seconds) |
01:54:28 | * | ehmry joined #nim |
02:02:35 | FromGitter | <s0kil> I find it useful for profiling web servers |
02:05:54 | * | Hideki_ joined #nim |
02:19:13 | * | ehmry quit (Ping timeout: 250 seconds) |
02:24:23 | * | oculuxe quit (Quit: blah) |
02:24:48 | * | uu91 quit (Read error: Connection reset by peer) |
02:24:58 | * | oculux joined #nim |
02:24:59 | * | oculux quit (Client Quit) |
02:25:06 | * | uu91 joined #nim |
02:25:33 | * | oculux joined #nim |
02:25:59 | * | lmariscal quit (Quit: I'm Out!) |
02:28:33 | * | lmariscal joined #nim |
02:38:23 | FromGitter | <s0kil> Is it plausible to partially evaluate a program at compile time using macros? |
02:39:44 | * | Hideki_ quit (Remote host closed the connection) |
02:44:17 | * | lritter quit (Ping timeout: 240 seconds) |
02:45:18 | * | lritter joined #nim |
02:45:46 | * | norm joined #nim |
02:46:09 | * | norm is now known as Guest16693 |
02:47:34 | * | Guest16693 quit (Client Quit) |
03:14:58 | madprops | is there a way to have object property aliases, like value and val without having to fill 2 different properties? |
03:16:08 | disruptek | make one a procedure so it acts like a getter, or use a template. |
03:16:44 | disruptek | s0kil: of course. |
03:17:09 | disruptek | to some extent, that's what macros /are/ ... |
03:21:39 | madprops | disruptek: in the case of a library, the template would have to be done by the user i think, which wouldn't work |
03:22:30 | disruptek | nah, you can do the template. how do you think we can test for !=? that operator is implemented by a template. |
03:34:03 | madprops | is it possible to have a proc execute without using parenthesis? |
03:34:07 | madprops | obj.v |
03:34:22 | disruptek | you just did it. |
03:40:35 | FromGitter | <s0kil> progress is unreal (; |
03:41:32 | disruptek | s0kil: #12554 |
03:41:35 | disbot | https://github.com/nim-lang/Nim/issues/12554 |
03:41:35 | disbot | ^ unsigned conversion regression |
03:41:35 | disbot | ^ snippet at https://play.nim-lang.org/#ix=21TV 😏 |
03:45:10 | FromGitter | <s0kil> @disruptek incredible showstoper |
03:45:42 | disruptek | it's madness. |
03:47:42 | disruptek | s0kil: have you looked at the idea behind golden at all? |
03:51:42 | FromGitter | <s0kil> @disruptek Yes, still exploring, but it seems like the main idea behind it was to it handle a SIGINT more gracefully than your ex-wife. |
03:52:07 | disruptek | that was the main impetus, yes. |
03:53:40 | disruptek | it's gonna record hashes of all inputs and outputs and runtimes; then you'll be able to have it bisect git for you to pinpoint regressions. |
03:59:27 | FromGitter | <s0kil> I probably could figure that out if it would install (: |
04:00:13 | disruptek | right? |
04:00:34 | disruptek | well, it's an idea. it doesn't do much yet. |
04:03:36 | FromGitter | <s0kil> I have tried with your latest commit, Now it's failing at https://github.com/disruptek/golden/blob/master/src/golden/lm.nim#L129 |
04:04:02 | disruptek | doesn't anyone test this stuff? |
04:04:40 | disruptek | lemme just build 1.0.2 ffs |
04:06:24 | disruptek | unbelievable. |
04:07:02 | FromGitter | <s0kil> truly golden |
04:08:36 | disruptek | 3.0.7 builds for me on 1.0.2 🎉 |
04:08:56 | disruptek | tagged and pushed and everything. give it a shot plz. |
04:09:28 | * | uu91 quit (Ping timeout: 245 seconds) |
04:10:08 | FromGitter | <kaushalmodi> disruptek: set Travis crons to test your projects on Nim devel |
04:10:26 | FromGitter | <kaushalmodi> I do that to help catch regressions on my little projects |
04:10:28 | * | uu91 joined #nim |
04:10:36 | FromGitter | <kaushalmodi> I run weekly crons |
04:10:39 | disruptek | that sounds like a lot of work. |
04:10:52 | FromGitter | <s0kil> lot's of work for the server |
04:11:02 | disruptek | you know what fixed this one? |
04:11:26 | disruptek | reversing `result xor 0o777` to `0o777 xor result` or similar. |
04:12:58 | disruptek | s0kil is gonna single-handedly test all my projects tonight. |
04:13:23 | disruptek | all i have to do is add them all to my golden.nimble. |
04:14:04 | madprops | are there plans to do something similar to rusts's unwrap? |
04:14:14 | disruptek | refresh my memory. |
04:14:27 | disruptek | oh, that's destructuring, right? |
04:14:34 | madprops | unwrap exposes a result, containing either something or nothing |
04:14:43 | disruptek | oh, look at the options module. |
04:15:16 | FromGitter | <s0kil> since you mentioned destructuring |
04:15:37 | disruptek | don't even. |
04:15:55 | FromGitter | <s0kil> that's about that only thing I miss from JavaScript |
04:16:08 | disruptek | dodged a bullet right there. |
04:16:55 | FromGitter | <s0kil> https://github.com/technicallyagd/unpack looks promising |
04:18:13 | FromGitter | <s0kil> BTW, golden finally compiled |
04:18:40 | disruptek | you must be on linux. |
04:19:35 | FromGitter | <s0kil> yeah pop_os, It's been good |
04:21:24 | * | jwm224 quit (Quit: WeeChat 2.7-dev) |
04:24:32 | * | jwm224 joined #nim |
04:30:31 | FromGitter | <s0kil> @disruptek How do you read data.mdb output |
04:30:58 | disruptek | there's nothing in it yet, really, so don't worry about it. but there are some lmdb-native tools. |
04:31:20 | disruptek | mdb_dump |
04:33:39 | disruptek | i really like lmdb. i think it's got a good set of qualities for this app. very, very fast and lightweight. the links will be stored in uniform-length records for speed and maybe only variable-length strings will need slower fetches. most stuff could be fixed-len. |
04:37:14 | FromGitter | <s0kil> Is it similar to leveldb? |
04:38:11 | FromGitter | <s0kil> Seems like lmdb is a lot more lightweight |
04:38:14 | disruptek | in that it's lightweight, yes, but it's probably quite a bit lighter. |
04:42:02 | * | chemist69 quit (Ping timeout: 246 seconds) |
04:44:17 | * | chemist69 joined #nim |
04:45:00 | FromGitter | <s0kil> It looks very useful for logging |
04:45:20 | disruptek | yeah, though it's grow-only. |
04:45:55 | disruptek | not really a problem, just, y'know, another thing to design around. |
05:00:34 | madprops | how should i write a `requires` when there are no tagged versions? |
05:01:16 | madprops | ok nvm, just "name" |
05:01:26 | disruptek | requires "irc", requires "https://github.com/some/irc", or "url////some/irc#gitcommithash" |
05:01:46 | madprops | going to try nimx |
05:02:13 | disruptek | please ask others to tag stuff. it's so annoying. i even wrote a tool to make it easier. |
05:03:54 | madprops | yeah versioning is probably important |
05:04:17 | disruptek | nimble doesn't work without it. |
05:04:28 | disruptek | that's part of why i'm working on nimph. |
05:04:44 | madprops | welp, nimx example doesn't run in nim 1.0.2 |
05:04:59 | madprops | Error: undeclared identifier: 'Thread' |
05:05:35 | madprops | if you're making a better nimph, it would be cool to emulate some of cargo functionality |
05:05:40 | madprops | a better nimble* |
05:05:52 | madprops | like "cargo run" "cargo build --release" |
05:06:14 | disruptek | nimble does those things, i think. |
05:06:22 | FromGitter | <s0kil> Yes |
05:06:32 | madprops | it does but it didn't seem straightforward |
05:07:01 | disruptek | nimph is really about close integration with git and github, and basically having complete knowledge of your environment. |
05:07:51 | disruptek | there doesn't need to be a distinction between localdeps and globaldeps and userdeps when the tool can analyze the deps the same way the compiler does. |
05:08:28 | disruptek | there doesn't need to be strict attention paid to versioning when you can just read the repository and roll it to anywhere in the tree that you want to be. |
05:09:12 | disruptek | ...this kinda stuff. i'm not about the build scripts. i'm about source. |
05:10:19 | disruptek | nimph has no configuration and only one command, or one optional argument. |
05:11:36 | madprops | is that limitation by design? |
05:12:16 | disruptek | it just doesn't need anything else. i'm sure new things will grow, but really it only has two modes of operation: |
05:12:25 | disruptek | 1) read the env and tell me what's broken. |
05:12:32 | disruptek | 2) read the env and fix what's broken. |
05:21:09 | madprops | talking about broken envs |
05:21:11 | madprops | i can't uninstall nimx |
05:21:19 | madprops | because it says my fresh project depends on it |
05:21:37 | madprops | and i have no idea why it says that |
05:22:50 | FromGitter | <s0kil> rm -Rf .nimble/p |
05:23:55 | FromGitter | <s0kil> rm -Rf $nimbleDir/pkgs/nimx |
05:26:30 | madprops | yeah nimx is broken on current compiler it seems |
05:28:03 | madprops | i just need a simple ui library |
05:28:42 | madprops | lets check NiGui |
05:29:12 | madprops | is there something like apt autoremove on nimble? |
05:42:49 | * | nsf joined #nim |
05:52:56 | FromDiscord | <WilliamDraco> niGui is pretty good, but simple is the word for it at the moment. |
06:05:31 | * | dddddd quit (Remote host closed the connection) |
06:20:18 | * | theelous3 joined #nim |
06:44:45 | * | narimiran joined #nim |
06:55:14 | * | rockcavera quit (Remote host closed the connection) |
07:03:33 | * | u9898287 joined #nim |
07:21:41 | * | theelous3 quit (Ping timeout: 276 seconds) |
07:33:28 | * | u9898287 quit (Quit: u9898287) |
07:33:43 | * | u9898287 joined #nim |
07:40:40 | * | Jjp137 quit (Quit: Leaving) |
07:40:47 | * | Jjp137 joined #nim |
07:43:14 | FromGitter | <s0kil> How can I achieve this: `from module import procedure as procedureCustomName` ? |
07:55:40 | FromDiscord | <Stuffe> I'm not an expert by I don't think you can |
07:55:59 | FromDiscord | <Stuffe> but you wont have name space collisions, you can still use that proc through module.procedure |
07:57:36 | FromDiscord | <Stuffe> Or I guess you could do: |
07:57:37 | FromDiscord | <Stuffe> import module |
07:57:37 | FromDiscord | <Stuffe> var procedureCustomName = module.procedure |
07:58:08 | uvegbot | > i just need a simple ui library |
07:58:18 | uvegbot | a tk binding would be nice indeed :) |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:01:45 | FromGitter | <s0kil> `from module import nil` |
08:01:58 | FromGitter | <s0kil> This works for me |
08:03:35 | FromDiscord | <Stuffe> Does anyone know how to share mutable global state between different async function instances? using asynchttpserver |
08:03:54 | FromDiscord | <Stuffe> Tried using --gc:boehm but the compiler still complains |
08:04:40 | * | gmpreussner joined #nim |
08:04:50 | FromDiscord | <Stuffe> also saw the "threadvar" pragma, but it looks like it wont allow me to share state |
08:05:51 | * | jjido joined #nim |
08:06:53 | FromGitter | <alehander92> gcsafe ? |
08:08:10 | FromDiscord | <Stuffe> So I just mark it gcsafe and use gc:boehm and that should be safe? |
08:11:30 | FromDiscord | <Stuffe> I mean I see that it compiles, but I feel like I lying to the compiler and it may all crash at any moment |
08:12:37 | * | u9898287 quit (Quit: u9898287) |
08:12:54 | * | u9898287 joined #nim |
08:14:58 | * | u9898287 quit (Client Quit) |
08:15:16 | * | u9898287 joined #nim |
08:15:20 | * | u9898287 quit (Client Quit) |
08:15:36 | * | u9898287 joined #nim |
08:20:53 | * | u9898287 quit (Quit: u9898287) |
08:21:11 | * | u9898287 joined #nim |
08:22:33 | * | u9898287 quit (Client Quit) |
08:22:46 | * | u9898287 joined #nim |
08:29:19 | * | u9898287 quit (Quit: u9898287) |
08:29:33 | * | u9898287 joined #nim |
08:36:48 | * | u9898287 quit (Quit: u9898287) |
08:37:03 | * | u9898287 joined #nim |
08:38:54 | FromDiscord | <WilliamDraco> cross compiling from linux to windows, is it as simple as nimble build -d:release -d:mingw? |
08:39:51 | FromDiscord | <WilliamDraco> I'm actually on windows, trying to get a github action to compile, and it'll compile for linux and then looks like it compiles for windows but then it can't fine file.exe to upload it, so I'm not sure what's happening to it. |
08:40:41 | * | u9898287 quit (Client Quit) |
08:40:58 | * | u9898287 joined #nim |
08:52:01 | FromGitter | <Vindaar> @kaushalmodi finally merged this ggplotnim PR https://github.com/Vindaar/ggplotnim/pull/18 with a big rewrite and lots more recipes. Check it out if you have the time :) |
08:54:19 | * | uu91 quit (Read error: Connection reset by peer) |
08:54:35 | * | uu91 joined #nim |
09:08:17 | * | Guest71347 quit (Ping timeout: 276 seconds) |
09:15:11 | * | u9898287 quit (Quit: u9898287) |
09:15:29 | * | u9898287 joined #nim |
09:24:37 | FromGitter | <mratsim> @Araq the lock in allocShared, deallocShared and friends is a huuuuuuuuuuuugggeeeeeeee bottleneck. Have to resort to raw malloc |
09:30:06 | * | Guest71347 joined #nim |
09:33:11 | * | ng0 joined #nim |
09:48:11 | * | krux02 joined #nim |
09:58:36 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:59:26 | * | Hideki_ joined #nim |
09:59:36 | * | Guest71347 quit (Remote host closed the connection) |
10:02:42 | * | u9898287 quit (Quit: u9898287) |
10:03:00 | * | u9898287 joined #nim |
10:04:26 | * | Hideki_ quit (Remote host closed the connection) |
10:05:23 | * | Hideki_ joined #nim |
10:17:47 | * | Hideki__ joined #nim |
10:21:05 | * | Hideki_ quit (Ping timeout: 276 seconds) |
10:26:46 | * | Hideki__ quit (Remote host closed the connection) |
10:34:21 | dom96 | madprops, what's not straightdforward about nimble's run/build? |
10:35:57 | * | jjido joined #nim |
10:49:49 | * | ehmry joined #nim |
10:50:47 | * | livcd joined #nim |
10:55:26 | * | Hideki_ joined #nim |
10:59:23 | * | uu91 quit (Read error: Connection reset by peer) |
10:59:59 | * | uu91 joined #nim |
11:04:56 | FromDiscord | <Rika> ^ |
11:05:13 | FromDiscord | <Rika> Isn't it also just `nim c --d:release` |
11:05:23 | FromDiscord | <Rika> Or so |
11:26:30 | lqdev[m] | 1. you have to specify the binaries to be built by setting the `bin` variable in your .nimble file |
11:26:39 | lqdev[m] | like `bin = @["myprogram"]` |
11:28:37 | * | clyybber joined #nim |
11:29:22 | * | krux02 quit (Remote host closed the connection) |
11:37:15 | * | sealmove joined #nim |
11:49:10 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:05:13 | * | krux02 joined #nim |
12:53:05 | * | vsantana quit (Ping timeout: 246 seconds) |
12:55:20 | * | jjido joined #nim |
12:58:20 | * | vsantana joined #nim |
13:00:04 | * | Hideki_ quit (Remote host closed the connection) |
13:00:06 | * | jjido quit (Client Quit) |
13:03:14 | * | narimiran quit (Ping timeout: 240 seconds) |
13:07:15 | * | nsf quit (Quit: WeeChat 2.6) |
13:07:52 | * | vesper11 quit (Quit: ZNC 1.7.4 - https://znc.in) |
13:08:42 | * | vesper11 joined #nim |
13:13:28 | * | u9898287 quit (Quit: u9898287) |
13:13:44 | * | u9898287 joined #nim |
13:21:29 | * | jjido joined #nim |
13:22:02 | sealmove | if I want to create a parser out of a yaml file in Nim, should I do it with macros or should I produce a .nim file? |
13:25:41 | * | jjido quit (Client Quit) |
13:26:34 | sealmove | i mean, macros are naturally better than raw string (code) manipulation, but in the end I want to produce a plain .nim file. |
13:27:23 | FromGitter | <topcheese> @madprops, Nimx compiles fine on Mac 10.14, but I can't get anything other than the basic example to run. I haven't looked into troubleshooting why it's not working when I run them. I was also looking at NanoGui and the best way to port that over to Nim. |
13:29:14 | * | u9898287 quit (Quit: u9898287) |
13:29:33 | * | u9898287 joined #nim |
13:32:06 | * | u9898287 quit (Client Quit) |
13:32:21 | * | u9898287 joined #nim |
13:33:01 | FromGitter | <alehander92> sealmove well, you can use both |
13:33:20 | * | u9898287 quit (Client Quit) |
13:33:38 | * | u9898287 joined #nim |
13:33:41 | sealmove | can I play with macros and in the end dump the code representation in a file? |
13:33:48 | FromGitter | <alehander92> i used just raw code for https://github.com/alehander92/helpful_parser/blob/master/src/helpful_parser.nim |
13:33:55 | FromGitter | <alehander92> but it depends on your usecase |
13:34:00 | FromGitter | <alehander92> but yes you can do that as well |
13:34:06 | * | u9898287 quit (Client Quit) |
13:34:14 | * | tane joined #nim |
13:34:18 | FromGitter | <alehander92> its probably easier as you dont depend on compiler lib |
13:34:21 | * | u9898287 joined #nim |
13:34:35 | FromGitter | <alehander92> but on the other hand , if you need stuff which is only on runtime |
13:34:36 | * | jjido joined #nim |
13:34:45 | FromGitter | <alehander92> for generating the parser |
13:34:49 | FromGitter | <alehander92> it would be a problem |
13:34:49 | * | u9898287 quit (Client Quit) |
13:35:08 | * | u9898287 joined #nim |
13:36:26 | sealmove | I don't want to have the VM running every time the project is built. Essential parser should be perfected and then remain as a simple .nim file (without macros) |
13:37:56 | sealmove | i mean, the program should do a simple .yaml -> .nim conversion |
13:39:00 | sealmove | not .yaml -> use-stuff-from-memory |
13:39:25 | Zevv | wel, it should not run the vm every time: when your source file it is not modified, nim will cache, right? |
13:40:22 | * | u9898287 quit (Quit: u9898287) |
13:40:38 | * | u9898287 joined #nim |
13:41:28 | sealmove | ok so the dilemma is to implement it: as program VS as a library |
13:41:41 | sealmove | what's preferable in your opinion? |
13:42:48 | * | u9898287 quit (Client Quit) |
13:43:03 | * | u9898287 joined #nim |
13:45:54 | * | u9898287 quit (Client Quit) |
13:46:13 | * | u9898287 joined #nim |
13:47:28 | Zevv | If you mean mine: I'm fine with macros. Nim caches compile results, and it allows for nicer integration with your code. |
13:47:47 | Zevv | But I guess generating .nim files is fine as well in some cases |
13:51:06 | sealmove | indeed having such a mechanism available as a library is very appealing |
13:51:45 | Zevv | sure |
13:52:37 | * | lritter quit (Ping timeout: 265 seconds) |
13:53:36 | Zevv | and even if you would go the macro way, you migh be able to repr it and write it to a file |
13:59:10 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:59:35 | * | u9898287 quit (Quit: u9898287) |
13:59:52 | * | u9898287 joined #nim |
13:59:57 | * | u9898287 quit (Client Quit) |
14:00:17 | * | u9898287 joined #nim |
14:00:39 | sealmove | yes, I was thinking that, but Zevv you persuaded me that having it as a lib is even better :-) |
14:02:34 | sealmove | https://github.com/kaitai-io/kaitai_struct/issues/619#issuecomment-554640190 |
14:03:13 | * | u9898287 quit (Client Quit) |
14:03:32 | * | u9898287 joined #nim |
14:03:46 | FromGitter | <kaushalmodi> @Vindaar Thanks! I'll update the test out ggplotnim next week. |
14:03:51 | * | jjido joined #nim |
14:04:21 | * | MarquisdeFalbala joined #nim |
14:09:22 | * | u9898287 quit (Quit: u9898287) |
14:11:37 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:19:12 | disruptek | sealmove: take a look at my openapi project; macros to generate .nim from yaml (or json, because you don't have yaml parsing at compile-time). |
14:20:06 | sealmove | no yaml at compile-time? :| why? |
14:21:53 | disruptek | i forget. json parsing at compile-time only works because of a special compiler shim, iirc. |
14:25:24 | disruptek | i think clyybber did some work that may have made yaml at compile-time possible. i haven't tested it recently, so i guess it's worth trying. |
14:26:24 | krux02 | disruptek, I made json parsing at compile time work. And no there isn't anything special involved in there. |
14:26:40 | krux02 | I just removed pointer magic and made it using strings |
14:32:09 | sealmove | is it possible to do some string manipulation to get the code in a form that Nim can parse, and then do the rest with macros? |
14:32:30 | sealmove | because yes, Nim can't parse yaml as it is |
14:34:20 | * | Cadey quit (Quit: WeeChat 1.9.1) |
14:35:22 | * | Xe joined #nim |
14:44:01 | * | dddddd joined #nim |
14:47:20 | * | filcuc joined #nim |
14:48:21 | disruptek | sealmove: you could write an npeg parser that reads yaml and outputs json. |
14:48:32 | disruptek | krux02: cool, that helps. 👍 |
14:49:05 | sealmove | disruptek: why though? |
14:49:29 | disruptek | because it might be easier than modifying nim-yaml to work at compile-time. |
14:50:28 | * | exelotl joined #nim |
14:51:31 | * | Xe quit (Remote host closed the connection) |
14:51:48 | * | Xe joined #nim |
14:52:02 | * | uu91 quit (Ping timeout: 240 seconds) |
14:52:37 | * | uu91 joined #nim |
15:04:33 | * | nsf joined #nim |
15:05:07 | * | filcuc quit (Ping timeout: 265 seconds) |
15:06:21 | disruptek | Araq: are you saying those snippets work for you on 1.0.2? because i'm one of two linux users for which they don't work. |
15:14:26 | * | jjido joined #nim |
15:25:22 | sealmove | disruptek: The whole idea was to utialize Nim's parser. If it doesn't work then there is no reason to re-implement the parsing (it's already done in Scala). |
15:25:31 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:26:10 | sealmove | I guess .yaml -> .nim is fine |
15:26:14 | disruptek | i guess i'm confused about what you're trying to accomplish. |
15:26:50 | sealmove | ideally I would want a statement macro where you write yaml and it's converted into a in-memory parser |
15:27:04 | sealmove | but this seems impossible currently |
15:27:36 | disruptek | it's possible; you just need to rewrite the extant npeg json parser to parse yaml instead, which shouldn't be hard since they are semantically identical. |
15:28:53 | sealmove | hum, I can't see how it works |
15:29:12 | disruptek | can you be more specific? |
15:29:43 | sealmove | ok, w8, I'll send snippet |
15:30:50 | disruptek | nim-yaml doesn't work at compile-time (i don't think). npeg gives you a cheap way to write a parser that works at compile-time. there's an npeg parser for json which you can modify to parse yaml instead, since the only difference between json and yaml is syntax. |
15:32:50 | Zevv | parsing yaml is about as much fun as a stapler to the forehead. Don't go there. |
15:32:53 | * | Trustable joined #nim |
15:33:09 | disruptek | rude. |
15:35:00 | Zevv | yaml is sooo broken |
15:35:19 | disruptek | sshhhh i'm trying to get him to write a parser for it. |
15:35:29 | Zevv | friends don't let friends write yaml parsers |
15:35:39 | disruptek | but zevv, this is sealmove. |
15:37:26 | Zevv | and parsing indented languages is a pita anyway. npeg *can* do it, but it is no fun |
15:37:38 | sealmove | https://play.nim-lang.org/#ix=21Xg |
15:40:09 | disruptek | someone should just bite the bullet and do it. |
15:40:28 | sealmove | how can npeg by-pass the limitations of Nim parser? |
15:40:36 | Zevv | it doesn't |
15:40:42 | disruptek | what makes you think it has to? |
15:41:18 | Zevv | well, if he wants to do the above snippet, it has to |
15:41:24 | Zevv | but it can't. |
15:41:50 | sealmove | ok so the snippet is impossible, then the yaml has to be read from a file |
15:42:05 | sealmove | right? |
15:42:15 | Zevv | right. and then parse it with either a yaml parser that is able to run at compile time |
15:42:17 | disruptek | what makes the snippet impossible? i just see tokens. |
15:42:22 | Zevv | or write something else |
15:42:31 | Zevv | disruptek: nim doesn to parse arbitrary stuff |
15:42:36 | Zevv | it has to be Nim syntax |
15:43:13 | Zevv | nim-lang.org says "Macros cannot change Nim's syntax because there is no need for it — the syntax is flexible enough.", which I think is a bull.+t argument though |
15:43:43 | disruptek | i interpret that statement differently, i guess. |
15:44:09 | disruptek | i think you might be wrong. are you sure you're right? |
15:44:38 | tane | howdy :) |
15:44:42 | disruptek | hello |
15:44:50 | sealmove | hi |
15:44:52 | disruptek | hi sealmove |
15:45:39 | tane | if I generate a proc via template, can I influence its export-visibility at the call-site? I can pass a `name: untyped` to the template and it will accept `foo`, but not `foo*` |
15:45:49 | sealmove | ok so npeg can do what Nim parser can't because it works with raw strings |
15:46:14 | disruptek | tane because a * in the string is meaningless. |
15:46:16 | Zevv | well, the npeg syntax itself is parsed by nim. but the subject is a string |
15:46:33 | Zevv | disruptek: always |
15:46:34 | disruptek | tane: see postfix |
15:46:59 | tane | disruptek, what do you mean by that? |
15:47:07 | disruptek | tane: see postfix() in macros |
15:47:22 | disruptek | ...to apply a postfix operator such as * |
15:48:34 | * | clyybber quit (Quit: WeeChat 2.6) |
15:48:44 | sealmove | Zevv: will something like this work with npeg? https://play.nim-lang.org/#ix=21Xh |
15:49:19 | tane | disruptek, so I'd need to write a macro instead of a templatE? |
15:51:35 | Zevv | that might work, but still we'd need a yaml parser in npeg |
15:51:45 | Zevv | which is a pita to write |
15:51:48 | Zevv | because yaml |
15:53:11 | * | narimiran joined #nim |
16:01:24 | disruptek | tane: yep. |
16:01:42 | tane | disruptek, alright, thank you :) |
16:01:54 | disruptek | what you're doing is modifying the ast, so... |
16:01:59 | sealmove | Zevv: suppose the yaml is successfully parsed. with npeg, what will I have in my hands to work with and produce code? |
16:02:04 | sealmove | is it NimAST? |
16:02:13 | disruptek | it's whatever you want to build during the parse. |
16:02:27 | disruptek | i'd probably use json nodes since they are semantically identical. |
16:04:03 | Zevv | sealmove: take a look at http://ix.io/21Xl/nim |
16:04:32 | Zevv | it's a bit messy, but it's a parser for the "rod" language and builds custom AST |
16:04:50 | Zevv | basically when stuff matches inside your parser you can call a snippet of nim, get the string of the match and do your stuff with it |
16:05:18 | Zevv | I found that in practice it works best to have a working stack of your whatever-AST nodes, and do operations with the matched strings and the stack |
16:08:28 | sealmove | oh right, you can use any AST |
16:08:51 | sealmove | I guess my question is how to create an AST out of matches |
16:09:43 | Zevv | or this one, parsing protobuf into AST: http://ix.io/21Xp/nim |
16:10:06 | sealmove | nice!! |
16:10:26 | * | NimBot joined #nim |
16:10:58 | sealmove | I probably have to do the same with Kaitai Struct AST |
16:12:13 | sealmove | so in the end it's some-AST -> nim-AST and code is emitted in CT? |
16:13:01 | * | Hideki_ joined #nim |
16:13:27 | Zevv | yeah |
16:13:43 | Zevv | it's a long way round, but it works |
16:14:15 | sealmove | I see, looks good! |
16:14:16 | Zevv | pegs can be a pain though. There is not lexer stage so your syntax is a lexer and a parser in one. It has good sides and bad sides |
16:14:27 | sealmove | I know |
16:14:36 | sealmove | It's good opportunity to study PEG |
16:14:51 | sealmove | btw question |
16:15:06 | sealmove | do you think it's possible to create lib like npeg but for BNF? |
16:15:22 | sealmove | I don't think there is such a library in any prog language |
16:16:12 | Zevv | Not sure, this whole parsing stuff was all new to me when I got started with it. I read tons of papers and got smarter about it, but a lot of things are not yet clear to me |
16:16:41 | Zevv | BNF tends to parse ambigious, PEGs dont. But I have a proof somewhere (which i dont understand) telling that pretty much any BNF can be converted to a corresponding PEG |
16:17:02 | Zevv | https://github.com/zevv/npeg/blob/master/doc/papers/From_EBNF_to_PEG.pdf |
16:17:26 | Zevv | if you understand it all, let me know, I could use some help there |
16:18:19 | sealmove | I could present it to my professor in Compilers class :P |
16:19:01 | Zevv | another tricky part is left recursion: no problem in BNFs but PEG's die when you feed them that. I got a nifty workaround allowing kind-of-left-recursion and giving me operator precedence as a free bonus, but it's all on the edge of what PEGs can do |
16:19:04 | sealmove | we were discussing about a BNF lib |
16:19:19 | Zevv | well, cool, bring up npeg and hear what he says :) |
16:19:57 | sealmove | he seemed to lack knowledge about PEG though |
16:19:57 | Zevv | I'd like to hear a prof on that, finally someone who knows how that stuff works, because I don't |
16:20:03 | Zevv | ha, amateur! |
16:21:17 | Zevv | about the nim syntax flexibilty: I had to tweak the original PEG syntax to make it Nim parsable as well, so NPeg PEG is not quite PEG PEG |
16:21:32 | sealmove | yes I read it on README.md |
16:22:12 | sealmove | Nim syntax is flexible but I've run into flexibility issues with it multiple times |
16:22:27 | Zevv | It was a fun ride and I'm not unhappy with the result. The graph drawing was fun. But in the end I met it's limitations and know what it is good for and what not. |
16:22:32 | sealmove | maybe it's not THAT flexible after all |
16:23:16 | sealmove | hmm, well, I think the fact that it can do compile-time is the most appealing feature |
16:24:21 | Zevv | right. it shines for that, and for prototyping and quick hackups for parsers. It's neat for grammars that don't require backtracking and outperforms Nim's json parser for example. But building real-life non trivial parsers like programming languages or YAML is still a lot of work and hard to debug |
16:24:54 | disruptek | i love it. i'm using it all over the place. |
16:25:13 | Zevv | see, I have a user even |
16:25:32 | Zevv | too bad its disruptek, tho |
16:25:36 | disruptek | ikr? |
16:25:46 | disruptek | that guy is such a knucklehead. |
16:26:14 | sealmove | http://savage.net.au/Marpa.html |
16:26:15 | Zevv | that guy is *such* as |
16:26:33 | Zevv | marpa is pretty cool |
16:27:00 | Zevv | also look at ragel: http://www.colm.net/open-source/ragel/ |
16:27:22 | Zevv | ragel goes quite deep and creates kind of the most optimal parse tree and generates a tiny state machine for parsing that |
16:27:43 | * | Trustable quit (Remote host closed the connection) |
16:27:58 | sealmove | cool! |
16:28:23 | Zevv | but none draw graphs as nice as npeg. and everybody loves graphs. |
16:28:27 | sealmove | only takes care of lexing |
16:28:36 | * | Vladar joined #nim |
16:28:39 | sealmove | a lot of ppl use graphviz |
16:28:54 | Zevv | jah but graphviz does not parse, does it :) |
16:29:11 | sealmove | your graphs can parse? lol |
16:29:31 | sealmove | how do you do graphs in npeg? |
16:29:49 | sealmove | ascii art? |
16:29:49 | Zevv | -d:npegGraph |
16:29:53 | Zevv | yeah |
16:29:57 | Zevv | see the top of the readme |
16:30:08 | Zevv | http://zevv.nl/div/.old/java.html |
16:30:40 | sealmove | hmm... |
16:30:51 | Zevv | c'mon. cool, right? |
16:30:53 | Zevv | "hmm..." |
16:30:54 | Zevv | pfff |
16:30:56 | sealmove | graphing is expressed with npeg itself?? |
16:31:09 | Zevv | npeg can draw little pictures of the grammar you give it |
16:31:26 | Zevv | its a bit of a gimmick, but sometimes it helps debugging and understanding what you're trying to write |
16:32:08 | sealmove | so it's graphing the grammar, not a tree of the parsed elements |
16:32:27 | Zevv | https://raw.githubusercontent.com/zevv/npeg/master/doc/example-graph.png |
16:32:31 | Zevv | that also, but I never use that |
16:36:26 | * | Trustable joined #nim |
16:36:44 | sealmove | Zevv, I'll try to implement an npeg yaml parser, since I really need it (the alternative being: generate raw nim code in a .nim file using Scala). |
16:37:48 | disruptek | i need it, too. 😘 |
16:37:56 | Zevv | yeah but parsing yaml is a tremendous pain |
16:38:01 | Zevv | it's indent based, which is no fun with a peg |
16:38:09 | Zevv | and it's ridiculously redundant and complex |
16:38:29 | sealmove | plan is: 1. write yaml parser 2. write Kaitai Struct AST definition 3. write snippets where matches happen to generate Kaitai Struct AST 4. convert Kaitai Struct AST to Nim AST file parsing code |
16:38:45 | Zevv | if you must, here is a little thingy is saved which does basic indent-based parsing, but it's kind of clonky: https://github.com/zevv/npeg/blob/master/misc/indent.nim |
16:40:18 | Zevv | do you need all of yaml, or is it just a subset? |
16:41:09 | Zevv | because, I mean, look at the spec: https://yaml.org/spec/1.2/spec.html |
16:41:13 | sealmove | was just thinking about that. well, in really it's a modified yaml called ksy (Kaitai Struct yaml), but I think it's more of a superset than subset! |
16:41:59 | sealmove | but, I think it's also more restricted in some ways |
16:42:07 | Zevv | I do hope so |
16:43:12 | Zevv | where is the spec? |
16:43:41 | Zevv | is that https://doc.kaitai.io/ksy_reference.html? |
16:44:03 | Zevv | well, there you go: "Every .ksy file MUST be a valid YAML file" |
16:44:28 | sealmove | yes this is the spec |
16:45:54 | sealmove | what about this? https://nimyaml.org/ |
16:46:11 | Zevv | sure, if that works for you, go for it! |
16:46:15 | Zevv | but does it work at CT? |
16:47:32 | sealmove | probably not, but it would save tons of pain, so it seems like a good option, at least temporal |
16:47:39 | Zevv | sure |
16:48:27 | disruptek | aaaaand we've come full circle to the start of the convo. |
16:49:39 | sealmove | hmm but |
16:49:42 | sealmove | it won't work |
16:50:12 | sealmove | in the example you need to create objects yourself, and then call nimYAML to fill them using yaml data from file |
16:52:26 | sealmove | not sure if it can work like the ParseStack in your exampel |
16:56:20 | * | Hideki_ quit (Remote host closed the connection) |
16:57:06 | * | Hideki_ joined #nim |
17:01:11 | * | Perkol joined #nim |
17:01:17 | * | Hideki_ quit (Ping timeout: 240 seconds) |
17:03:50 | * | prometheus quit (Remote host closed the connection) |
17:22:47 | FromDiscord | <exelotl> Hey I made these bindings for a GLTF parser https://gist.github.com/exelotl/3cf6c15e4ac2c93f2274c48352808c1b |
17:23:56 | FromDiscord | <exelotl> not sure how useful they actually are, since after I was done, I realised that much of the hard work lies in parsing the JSON, which is quite a bit easier in Nim. xD |
17:27:39 | * | nsf quit (Quit: WeeChat 2.6) |
17:28:50 | Zevv | well, you had fun making it, right? :) |
17:31:19 | * | Hideki_ joined #nim |
17:36:14 | FromDiscord | <exelotl> yeah! I love manually clicking as many _s as possible without making a mistake |
17:36:47 | FromDiscord | <exelotl> so that I can delete them and convert the next letter to uppercase, all in one go |
17:37:05 | Zevv | you need Vim Power! |
17:38:00 | FromDiscord | <exelotl> lol I tried vim once but it wasn't for me :P |
17:38:44 | Zevv | well, if you spend your time clicking as many _s as possible without making a mistaky, you might want to consider again :) |
17:43:02 | FromDiscord | <exelotl> I mean, there's surely a way to get the power you're talking about without the awkward keybindings and mode-based workflow, right? |
17:50:47 | livcd | even vscode has multiple cursors :) |
18:05:52 | * | dillonb joined #nim |
18:12:19 | madprops | vscode is great |
18:23:39 | * | nsf joined #nim |
18:25:44 | FromDiscord | <exelotl> oh wow I'm dumb, didn't realise you could delete a multi-cursor by clicking on it again |
18:25:56 | FromDiscord | <exelotl> that's basically my problem solved |
18:36:22 | madprops | what am i doing wrong here https://play.nim-lang.org/#ix=21Yc |
18:50:49 | * | solitudesf joined #nim |
18:54:19 | madprops | oh i know what's wrong |
18:58:03 | * | Perkol quit (Quit: Leaving) |
18:59:03 | * | MarquisdeFalbala quit (Remote host closed the connection) |
19:33:39 | * | MarquisdeFalbala joined #nim |
19:49:38 | * | adeohluwa joined #nim |
19:51:39 | * | Xe is now known as Cadey |
19:58:43 | * | adeohluwa quit (Remote host closed the connection) |
20:05:43 | * | adeohluwa joined #nim |
20:25:51 | * | u9898287 joined #nim |
20:28:47 | lqdev[m] | @exelotl also, the esc key does that |
20:28:56 | * | jjido joined #nim |
20:29:13 | * | lqdev joined #nim |
20:29:25 | FromDiscord | <exelotl> well, esc removes all the multicursors |
20:29:43 | FromDiscord | <exelotl> I didn't realise there was a way to remove just one |
20:29:51 | lqdev | ah, that's what you wanted |
20:29:52 | lqdev | right |
20:30:11 | * | lqdev quit (Client Quit) |
20:33:51 | lqdev[m] | I usually just use the column selection functionality, as I don't need anything else really |
20:36:05 | FromDiscord | <exelotl> the difficulty is in changing many instances of `proc do_some_thing*() {.importc:"do_some_thing".}` |
20:36:15 | FromDiscord | <exelotl> into `proc doSomeThing*() {.importc:"do_some_thing".}` |
20:37:08 | FromDiscord | <exelotl> need a way to select some underscores but not all of them |
20:37:52 | FromDiscord | <exelotl> then the tradeof becomes: should I spend 20 minutes finding the perfect regex, or 20 minutes just clicking on all the ones I want |
20:38:10 | FromDiscord | <exelotl> *tradeoff |
20:40:26 | * | Hideki_ quit (Ping timeout: 240 seconds) |
20:40:35 | FromDiscord | <DeltaPHC> Well, luckily, Nim considers `do_some_thing` and `doSomeThing` to be the "same" |
20:40:56 | FromDiscord | <DeltaPHC> That is, if you define it as `do_some_thing` you can actually call it with `doSomeThing()` |
20:42:31 | FromDiscord | <exelotl> oh yeah of course, but I'd rather not define it one way and use it another way (especially because it won't play nicely with autocomplete) |
20:43:04 | FromDiscord | <DeltaPHC> True enough. Still useful to know if you have C bindings that have a different naming convention |
20:44:06 | * | adeohluwa quit (Remote host closed the connection) |
20:48:26 | * | adeohluwa joined #nim |
21:01:03 | * | vsantana quit (Remote host closed the connection) |
21:01:03 | * | jjido quit (Remote host closed the connection) |
21:02:27 | * | adeohluwa quit (Remote host closed the connection) |
21:03:36 | * | vsantana joined #nim |
21:09:17 | * | Jesin quit (Quit: Leaving) |
21:14:12 | * | jjido joined #nim |
21:15:10 | * | Jesin joined #nim |
21:32:26 | * | u9898287 quit (Quit: u9898287) |
21:32:41 | * | u9898287 joined #nim |
21:38:57 | * | u9898287 quit (Quit: u9898287) |
21:39:11 | * | u9898287 joined #nim |
21:47:34 | * | GordonBGood joined #nim |
21:52:41 | * | GordonBGood quit (Ping timeout: 276 seconds) |
22:01:36 | * | Trustable quit (Remote host closed the connection) |
22:06:53 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:12:32 | * | clyybber joined #nim |
22:17:27 | * | u9898287 quit (Quit: u9898287) |
22:17:44 | * | u9898287 joined #nim |
22:19:55 | * | narimiran quit (Quit: Leaving) |
22:39:38 | * | solitudesf quit (Ping timeout: 240 seconds) |
22:42:43 | madprops | NiGui is pretty good |
22:46:51 | * | jjido joined #nim |
23:04:00 | lqdev[m] | which part of `try..except` is the slow part? I suppose `try`ing shouldn't be slow, but `except`ing should? |
23:05:36 | * | tane quit (Quit: Leaving) |
23:06:37 | * | Vladar quit (Quit: Leaving) |
23:11:27 | FromDiscord | <onelivesleft> Anyone got any experience with wNim? I'm trying to use a Scrollbars with a TextCtrl, but it doesn't do anything. |
23:11:33 | FromDiscord | <onelivesleft> Anyone got any experience with wNim? I'm trying to use a Scrollbar with a TextCtrl, but it doesn't do anything. |
23:11:51 | FromGitter | <mratsim> if you edit on discord it resents a message in IRC |
23:11:58 | FromDiscord | <onelivesleft> noted |
23:11:59 | FromDiscord | <onelivesleft> ty |
23:12:38 | FromGitter | <mratsim> you can ask on the forum, AFAIK there are a couple of people using wnim |
23:12:55 | FromGitter | <mratsim> many Nim users are in Europe and it's the night here |
23:22:15 | * | u9898287 quit (Quit: u9898287) |
23:30:01 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:43:12 | madprops | having some trouble matching tabs https://play.nim-lang.org/#ix=220F |
23:44:19 | * | Yardanico_ joined #nim |
23:45:25 | * | Yardanico quit (Remote host closed the connection) |
23:45:49 | * | Yardanico_ quit (Client Quit) |
23:46:09 | * | Yardanico joined #nim |
23:47:32 | * | Yardanico quit (Client Quit) |
23:47:39 | * | Yardanico joined #nim |
23:51:55 | * | nsf quit (Quit: WeeChat 2.6) |
23:53:51 | lqdev[m] | madprops: the regex string literal is a raw string literal, meaning that escape sequences are not interpreted. change \\t to just \t |
23:58:38 | madprops | lqdev[m]: i was initially doing \t |