<< 16-11-2019 >>

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:40donpdonpfor x in things: x is immutable. how to make x 'var'?
00:09:41*skelett joined #nim
00:12:27donpdonpfor 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:00madpropsoh 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:45rockcaverawhich 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:21FromGitter<s0kil> I have created a wrapper for Coz Profiler, https://github.com/s0kil/nimcoz
01:49:15disrupteksweet
01:49:19*ehmry quit (Ping timeout: 250 seconds)
01:54:28*ehmry joined #nim
02:02:35FromGitter<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:23FromGitter<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:58madpropsis there a way to have object property aliases, like value and val without having to fill 2 different properties?
03:16:08disruptekmake one a procedure so it acts like a getter, or use a template.
03:16:44disrupteks0kil: of course.
03:17:09disruptekto some extent, that's what macros /are/ ...
03:21:39madpropsdisruptek: in the case of a library, the template would have to be done by the user i think, which wouldn't work
03:22:30disrupteknah, you can do the template. how do you think we can test for !=? that operator is implemented by a template.
03:34:03madpropsis it possible to have a proc execute without using parenthesis?
03:34:07madpropsobj.v
03:34:22disruptekyou just did it.
03:40:35FromGitter<s0kil> progress is unreal (;
03:41:32disrupteks0kil: #12554
03:41:35disbothttps://github.com/nim-lang/Nim/issues/12554
03:41:35disbot^ unsigned conversion regression
03:41:35disbot^ snippet at https://play.nim-lang.org/#ix=21TV 😏
03:45:10FromGitter<s0kil> @disruptek incredible showstoper
03:45:42disruptekit's madness.
03:47:42disrupteks0kil: have you looked at the idea behind golden at all?
03:51:42FromGitter<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:07disruptekthat was the main impetus, yes.
03:53:40disruptekit'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:27FromGitter<s0kil> I probably could figure that out if it would install (:
04:00:13disruptekright?
04:00:34disruptekwell, it's an idea. it doesn't do much yet.
04:03:36FromGitter<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:02disruptekdoesn't anyone test this stuff?
04:04:40disrupteklemme just build 1.0.2 ffs
04:06:24disruptekunbelievable.
04:07:02FromGitter<s0kil> truly golden
04:08:36disruptek3.0.7 builds for me on 1.0.2 🎉
04:08:56disruptektagged and pushed and everything. give it a shot plz.
04:09:28*uu91 quit (Ping timeout: 245 seconds)
04:10:08FromGitter<kaushalmodi> disruptek: set Travis crons to test your projects on Nim devel
04:10:26FromGitter<kaushalmodi> I do that to help catch regressions on my little projects
04:10:28*uu91 joined #nim
04:10:36FromGitter<kaushalmodi> I run weekly crons
04:10:39disruptekthat sounds like a lot of work.
04:10:52FromGitter<s0kil> lot's of work for the server
04:11:02disruptekyou know what fixed this one?
04:11:26disruptekreversing `result xor 0o777` to `0o777 xor result` or similar.
04:12:58disrupteks0kil is gonna single-handedly test all my projects tonight.
04:13:23disruptekall i have to do is add them all to my golden.nimble.
04:14:04madpropsare there plans to do something similar to rusts's unwrap?
04:14:14disruptekrefresh my memory.
04:14:27disruptekoh, that's destructuring, right?
04:14:34madpropsunwrap exposes a result, containing either something or nothing
04:14:43disruptekoh, look at the options module.
04:15:16FromGitter<s0kil> since you mentioned destructuring
04:15:37disruptekdon't even.
04:15:55FromGitter<s0kil> that's about that only thing I miss from JavaScript
04:16:08disruptekdodged a bullet right there.
04:16:55FromGitter<s0kil> https://github.com/technicallyagd/unpack looks promising
04:18:13FromGitter<s0kil> BTW, golden finally compiled
04:18:40disruptekyou must be on linux.
04:19:35FromGitter<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:31FromGitter<s0kil> @disruptek How do you read data.mdb output
04:30:58disruptekthere's nothing in it yet, really, so don't worry about it. but there are some lmdb-native tools.
04:31:20disruptekmdb_dump
04:33:39disrupteki 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:14FromGitter<s0kil> Is it similar to leveldb?
04:38:11FromGitter<s0kil> Seems like lmdb is a lot more lightweight
04:38:14disruptekin 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:00FromGitter<s0kil> It looks very useful for logging
04:45:20disruptekyeah, though it's grow-only.
04:45:55disrupteknot really a problem, just, y'know, another thing to design around.
05:00:34madpropshow should i write a `requires` when there are no tagged versions?
05:01:16madpropsok nvm, just "name"
05:01:26disruptekrequires "irc", requires "https://github.com/some/irc", or "url////some/irc#gitcommithash"
05:01:46madpropsgoing to try nimx
05:02:13disruptekplease ask others to tag stuff. it's so annoying. i even wrote a tool to make it easier.
05:03:54madpropsyeah versioning is probably important
05:04:17disrupteknimble doesn't work without it.
05:04:28disruptekthat's part of why i'm working on nimph.
05:04:44madpropswelp, nimx example doesn't run in nim 1.0.2
05:04:59madpropsError: undeclared identifier: 'Thread'
05:05:35madpropsif you're making a better nimph, it would be cool to emulate some of cargo functionality
05:05:40madpropsa better nimble*
05:05:52madpropslike "cargo run" "cargo build --release"
05:06:14disrupteknimble does those things, i think.
05:06:22FromGitter<s0kil> Yes
05:06:32madpropsit does but it didn't seem straightforward
05:07:01disrupteknimph is really about close integration with git and github, and basically having complete knowledge of your environment.
05:07:51disruptekthere 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:28disruptekthere 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:12disruptek...this kinda stuff. i'm not about the build scripts. i'm about source.
05:10:19disrupteknimph has no configuration and only one command, or one optional argument.
05:11:36madpropsis that limitation by design?
05:12:16disruptekit just doesn't need anything else. i'm sure new things will grow, but really it only has two modes of operation:
05:12:25disruptek1) read the env and tell me what's broken.
05:12:32disruptek2) read the env and fix what's broken.
05:21:09madpropstalking about broken envs
05:21:11madpropsi can't uninstall nimx
05:21:19madpropsbecause it says my fresh project depends on it
05:21:37madpropsand i have no idea why it says that
05:22:50FromGitter<s0kil> rm -Rf .nimble/p
05:23:55FromGitter<s0kil> rm -Rf $nimbleDir/pkgs/nimx
05:26:30madpropsyeah nimx is broken on current compiler it seems
05:28:03madpropsi just need a simple ui library
05:28:42madpropslets check NiGui
05:29:12madpropsis there something like apt autoremove on nimble?
05:42:49*nsf joined #nim
05:52:56FromDiscord<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:14FromGitter<s0kil> How can I achieve this: `from module import procedure as procedureCustomName` ?
07:55:40FromDiscord<Stuffe> I'm not an expert by I don't think you can
07:55:59FromDiscord<Stuffe> but you wont have name space collisions, you can still use that proc through module.procedure
07:57:36FromDiscord<Stuffe> Or I guess you could do:
07:57:37FromDiscord<Stuffe> import module
07:57:37FromDiscord<Stuffe> var procedureCustomName = module.procedure
07:58:08uvegbot> i just need a simple ui library
07:58:18uvegbota tk binding would be nice indeed :)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:01:45FromGitter<s0kil> `from module import nil`
08:01:58FromGitter<s0kil> This works for me
08:03:35FromDiscord<Stuffe> Does anyone know how to share mutable global state between different async function instances? using asynchttpserver
08:03:54FromDiscord<Stuffe> Tried using --gc:boehm but the compiler still complains
08:04:40*gmpreussner joined #nim
08:04:50FromDiscord<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:53FromGitter<alehander92> gcsafe ?
08:08:10FromDiscord<Stuffe> So I just mark it gcsafe and use gc:boehm and that should be safe?
08:11:30FromDiscord<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:54FromDiscord<WilliamDraco> cross compiling from linux to windows, is it as simple as nimble build -d:release -d:mingw?
08:39:51FromDiscord<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:01FromGitter<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:37FromGitter<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:21dom96madprops, 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:56FromDiscord<Rika> ^
11:05:13FromDiscord<Rika> Isn't it also just `nim c --d:release`
11:05:23FromDiscord<Rika> Or so
11:26:30lqdev[m]1. you have to specify the binaries to be built by setting the `bin` variable in your .nimble file
11:26:39lqdev[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:02sealmoveif 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:34sealmovei mean, macros are naturally better than raw string (code) manipulation, but in the end I want to produce a plain .nim file.
13:27:23FromGitter<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:01FromGitter<alehander92> sealmove well, you can use both
13:33:20*u9898287 quit (Client Quit)
13:33:38*u9898287 joined #nim
13:33:41sealmovecan I play with macros and in the end dump the code representation in a file?
13:33:48FromGitter<alehander92> i used just raw code for https://github.com/alehander92/helpful_parser/blob/master/src/helpful_parser.nim
13:33:55FromGitter<alehander92> but it depends on your usecase
13:34:00FromGitter<alehander92> but yes you can do that as well
13:34:06*u9898287 quit (Client Quit)
13:34:14*tane joined #nim
13:34:18FromGitter<alehander92> its probably easier as you dont depend on compiler lib
13:34:21*u9898287 joined #nim
13:34:35FromGitter<alehander92> but on the other hand , if you need stuff which is only on runtime
13:34:36*jjido joined #nim
13:34:45FromGitter<alehander92> for generating the parser
13:34:49FromGitter<alehander92> it would be a problem
13:34:49*u9898287 quit (Client Quit)
13:35:08*u9898287 joined #nim
13:36:26sealmoveI 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:56sealmovei mean, the program should do a simple .yaml -> .nim conversion
13:39:00sealmovenot .yaml -> use-stuff-from-memory
13:39:25Zevvwel, 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:28sealmoveok so the dilemma is to implement it: as program VS as a library
13:41:41sealmovewhat'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:28ZevvIf you mean mine: I'm fine with macros. Nim caches compile results, and it allows for nicer integration with your code.
13:47:47ZevvBut I guess generating .nim files is fine as well in some cases
13:51:06sealmoveindeed having such a mechanism available as a library is very appealing
13:51:45Zevvsure
13:52:37*lritter quit (Ping timeout: 265 seconds)
13:53:36Zevvand 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:39sealmoveyes, I was thinking that, but Zevv you persuaded me that having it as a lib is even better :-)
14:02:34sealmovehttps://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:46FromGitter<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:12disrupteksealmove: 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:06sealmoveno yaml at compile-time? :| why?
14:21:53disrupteki forget. json parsing at compile-time only works because of a special compiler shim, iirc.
14:25:24disrupteki 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:24krux02disruptek, I made json parsing at compile time work. And no there isn't anything special involved in there.
14:26:40krux02I just removed pointer magic and made it using strings
14:32:09sealmoveis 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:30sealmovebecause 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:21disrupteksealmove: you could write an npeg parser that reads yaml and outputs json.
14:48:32disruptekkrux02: cool, that helps. 👍
14:49:05sealmovedisruptek: why though?
14:49:29disruptekbecause 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:21disruptekAraq: 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:22sealmovedisruptek: 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:10sealmoveI guess .yaml -> .nim is fine
15:26:14disrupteki guess i'm confused about what you're trying to accomplish.
15:26:50sealmoveideally I would want a statement macro where you write yaml and it's converted into a in-memory parser
15:27:04sealmovebut this seems impossible currently
15:27:36disruptekit'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:53sealmovehum, I can't see how it works
15:29:12disruptekcan you be more specific?
15:29:43sealmoveok, w8, I'll send snippet
15:30:50disrupteknim-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:50Zevvparsing yaml is about as much fun as a stapler to the forehead. Don't go there.
15:32:53*Trustable joined #nim
15:33:09disruptekrude.
15:35:00Zevvyaml is sooo broken
15:35:19disrupteksshhhh i'm trying to get him to write a parser for it.
15:35:29Zevvfriends don't let friends write yaml parsers
15:35:39disruptekbut zevv, this is sealmove.
15:37:26Zevvand parsing indented languages is a pita anyway. npeg *can* do it, but it is no fun
15:37:38sealmovehttps://play.nim-lang.org/#ix=21Xg
15:40:09disrupteksomeone should just bite the bullet and do it.
15:40:28sealmovehow can npeg by-pass the limitations of Nim parser?
15:40:36Zevvit doesn't
15:40:42disruptekwhat makes you think it has to?
15:41:18Zevvwell, if he wants to do the above snippet, it has to
15:41:24Zevvbut it can't.
15:41:50sealmoveok so the snippet is impossible, then the yaml has to be read from a file
15:42:05sealmoveright?
15:42:15Zevvright. and then parse it with either a yaml parser that is able to run at compile time
15:42:17disruptekwhat makes the snippet impossible? i just see tokens.
15:42:22Zevvor write something else
15:42:31Zevvdisruptek: nim doesn to parse arbitrary stuff
15:42:36Zevvit has to be Nim syntax
15:43:13Zevvnim-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:43disrupteki interpret that statement differently, i guess.
15:44:09disrupteki think you might be wrong. are you sure you're right?
15:44:38tanehowdy :)
15:44:42disruptekhello
15:44:50sealmovehi
15:44:52disruptekhi sealmove
15:45:39taneif 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:49sealmoveok so npeg can do what Nim parser can't because it works with raw strings
15:46:14disruptektane because a * in the string is meaningless.
15:46:16Zevvwell, the npeg syntax itself is parsed by nim. but the subject is a string
15:46:33Zevvdisruptek: always
15:46:34disruptektane: see postfix
15:46:59tanedisruptek, what do you mean by that?
15:47:07disruptektane: see postfix() in macros
15:47:22disruptek...to apply a postfix operator such as *
15:48:34*clyybber quit (Quit: WeeChat 2.6)
15:48:44sealmoveZevv: will something like this work with npeg? https://play.nim-lang.org/#ix=21Xh
15:49:19tanedisruptek, so I'd need to write a macro instead of a templatE?
15:51:35Zevvthat might work, but still we'd need a yaml parser in npeg
15:51:45Zevvwhich is a pita to write
15:51:48Zevvbecause yaml
15:53:11*narimiran joined #nim
16:01:24disruptektane: yep.
16:01:42tanedisruptek, alright, thank you :)
16:01:54disruptekwhat you're doing is modifying the ast, so...
16:01:59sealmoveZevv: suppose the yaml is successfully parsed. with npeg, what will I have in my hands to work with and produce code?
16:02:04sealmoveis it NimAST?
16:02:13disruptekit's whatever you want to build during the parse.
16:02:27disrupteki'd probably use json nodes since they are semantically identical.
16:04:03Zevvsealmove: take a look at http://ix.io/21Xl/nim
16:04:32Zevvit's a bit messy, but it's a parser for the "rod" language and builds custom AST
16:04:50Zevvbasically 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:18ZevvI 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:28sealmoveoh right, you can use any AST
16:08:51sealmoveI guess my question is how to create an AST out of matches
16:09:43Zevvor this one, parsing protobuf into AST: http://ix.io/21Xp/nim
16:10:06sealmovenice!!
16:10:26*NimBot joined #nim
16:10:58sealmoveI probably have to do the same with Kaitai Struct AST
16:12:13sealmoveso in the end it's some-AST -> nim-AST and code is emitted in CT?
16:13:01*Hideki_ joined #nim
16:13:27Zevvyeah
16:13:43Zevvit's a long way round, but it works
16:14:15sealmoveI see, looks good!
16:14:16Zevvpegs 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:27sealmoveI know
16:14:36sealmoveIt's good opportunity to study PEG
16:14:51sealmovebtw question
16:15:06sealmovedo you think it's possible to create lib like npeg but for BNF?
16:15:22sealmoveI don't think there is such a library in any prog language
16:16:12ZevvNot 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:41ZevvBNF 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:02Zevvhttps://github.com/zevv/npeg/blob/master/doc/papers/From_EBNF_to_PEG.pdf
16:17:26Zevvif you understand it all, let me know, I could use some help there
16:18:19sealmoveI could present it to my professor in Compilers class :P
16:19:01Zevvanother 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:04sealmovewe were discussing about a BNF lib
16:19:19Zevvwell, cool, bring up npeg and hear what he says :)
16:19:57sealmovehe seemed to lack knowledge about PEG though
16:19:57ZevvI'd like to hear a prof on that, finally someone who knows how that stuff works, because I don't
16:20:03Zevvha, amateur!
16:21:17Zevvabout 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:32sealmoveyes I read it on README.md
16:22:12sealmoveNim syntax is flexible but I've run into flexibility issues with it multiple times
16:22:27ZevvIt 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:32sealmovemaybe it's not THAT flexible after all
16:23:16sealmovehmm, well, I think the fact that it can do compile-time is the most appealing feature
16:24:21Zevvright. 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:54disrupteki love it. i'm using it all over the place.
16:25:13Zevvsee, I have a user even
16:25:32Zevvtoo bad its disruptek, tho
16:25:36disruptekikr?
16:25:46disruptekthat guy is such a knucklehead.
16:26:14sealmovehttp://savage.net.au/Marpa.html
16:26:15Zevvthat guy is *such* as
16:26:33Zevvmarpa is pretty cool
16:27:00Zevvalso look at ragel: http://www.colm.net/open-source/ragel/
16:27:22Zevvragel 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:58sealmovecool!
16:28:23Zevvbut none draw graphs as nice as npeg. and everybody loves graphs.
16:28:27sealmoveonly takes care of lexing
16:28:36*Vladar joined #nim
16:28:39sealmovea lot of ppl use graphviz
16:28:54Zevvjah but graphviz does not parse, does it :)
16:29:11sealmoveyour graphs can parse? lol
16:29:31sealmovehow do you do graphs in npeg?
16:29:49sealmoveascii art?
16:29:49Zevv-d:npegGraph
16:29:53Zevvyeah
16:29:57Zevvsee the top of the readme
16:30:08Zevvhttp://zevv.nl/div/.old/java.html
16:30:40sealmovehmm...
16:30:51Zevvc'mon. cool, right?
16:30:53Zevv"hmm..."
16:30:54Zevvpfff
16:30:56sealmovegraphing is expressed with npeg itself??
16:31:09Zevvnpeg can draw little pictures of the grammar you give it
16:31:26Zevvits a bit of a gimmick, but sometimes it helps debugging and understanding what you're trying to write
16:32:08sealmoveso it's graphing the grammar, not a tree of the parsed elements
16:32:27Zevvhttps://raw.githubusercontent.com/zevv/npeg/master/doc/example-graph.png
16:32:31Zevvthat also, but I never use that
16:36:26*Trustable joined #nim
16:36:44sealmoveZevv, 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:48disrupteki need it, too. 😘
16:37:56Zevvyeah but parsing yaml is a tremendous pain
16:38:01Zevvit's indent based, which is no fun with a peg
16:38:09Zevvand it's ridiculously redundant and complex
16:38:29sealmoveplan 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:45Zevvif 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:18Zevvdo you need all of yaml, or is it just a subset?
16:41:09Zevvbecause, I mean, look at the spec: https://yaml.org/spec/1.2/spec.html
16:41:13sealmovewas 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:59sealmovebut, I think it's also more restricted in some ways
16:42:07ZevvI do hope so
16:43:12Zevvwhere is the spec?
16:43:41Zevvis that https://doc.kaitai.io/ksy_reference.html?
16:44:03Zevvwell, there you go: "Every .ksy file MUST be a valid YAML file"
16:44:28sealmoveyes this is the spec
16:45:54sealmovewhat about this? https://nimyaml.org/
16:46:11Zevvsure, if that works for you, go for it!
16:46:15Zevvbut does it work at CT?
16:47:32sealmoveprobably not, but it would save tons of pain, so it seems like a good option, at least temporal
16:47:39Zevvsure
16:48:27disruptekaaaaand we've come full circle to the start of the convo.
16:49:39sealmovehmm but
16:49:42sealmoveit won't work
16:50:12sealmovein the example you need to create objects yourself, and then call nimYAML to fill them using yaml data from file
16:52:26sealmovenot 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:47FromDiscord<exelotl> Hey I made these bindings for a GLTF parser https://gist.github.com/exelotl/3cf6c15e4ac2c93f2274c48352808c1b
17:23:56FromDiscord<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:50Zevvwell, you had fun making it, right? :)
17:31:19*Hideki_ joined #nim
17:36:14FromDiscord<exelotl> yeah! I love manually clicking as many _s as possible without making a mistake
17:36:47FromDiscord<exelotl> so that I can delete them and convert the next letter to uppercase, all in one go
17:37:05Zevvyou need Vim Power!
17:38:00FromDiscord<exelotl> lol I tried vim once but it wasn't for me :P
17:38:44Zevvwell, if you spend your time clicking as many _s as possible without making a mistaky, you might want to consider again :)
17:43:02FromDiscord<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:47livcdeven vscode has multiple cursors :)
18:05:52*dillonb joined #nim
18:12:19madpropsvscode is great
18:23:39*nsf joined #nim
18:25:44FromDiscord<exelotl> oh wow I'm dumb, didn't realise you could delete a multi-cursor by clicking on it again
18:25:56FromDiscord<exelotl> that's basically my problem solved
18:36:22madpropswhat am i doing wrong here https://play.nim-lang.org/#ix=21Yc
18:50:49*solitudesf joined #nim
18:54:19madpropsoh 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:47lqdev[m]@exelotl also, the esc key does that
20:28:56*jjido joined #nim
20:29:13*lqdev joined #nim
20:29:25FromDiscord<exelotl> well, esc removes all the multicursors
20:29:43FromDiscord<exelotl> I didn't realise there was a way to remove just one
20:29:51lqdevah, that's what you wanted
20:29:52lqdevright
20:30:11*lqdev quit (Client Quit)
20:33:51lqdev[m]I usually just use the column selection functionality, as I don't need anything else really
20:36:05FromDiscord<exelotl> the difficulty is in changing many instances of `proc do_some_thing*() {.importc:"do_some_thing".}`
20:36:15FromDiscord<exelotl> into `proc doSomeThing*() {.importc:"do_some_thing".}`
20:37:08FromDiscord<exelotl> need a way to select some underscores but not all of them
20:37:52FromDiscord<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:10FromDiscord<exelotl> *tradeoff
20:40:26*Hideki_ quit (Ping timeout: 240 seconds)
20:40:35FromDiscord<DeltaPHC> Well, luckily, Nim considers `do_some_thing` and `doSomeThing` to be the "same"
20:40:56FromDiscord<DeltaPHC> That is, if you define it as `do_some_thing` you can actually call it with `doSomeThing()`
20:42:31FromDiscord<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:04FromDiscord<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:43madpropsNiGui is pretty good
22:46:51*jjido joined #nim
23:04:00lqdev[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:27FromDiscord<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:33FromDiscord<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:51FromGitter<mratsim> if you edit on discord it resents a message in IRC
23:11:58FromDiscord<onelivesleft> noted
23:11:59FromDiscord<onelivesleft> ty
23:12:38FromGitter<mratsim> you can ask on the forum, AFAIK there are a couple of people using wnim
23:12:55FromGitter<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:12madpropshaving 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:51lqdev[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:38madpropslqdev[m]: i was initially doing \t