00:05:02 | * | Jesin quit (Quit: Leaving) |
00:08:24 | * | PrimHelios joined #nim |
00:42:31 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:48:38 | * | poopBot quit (Remote host closed the connection) |
01:00:21 | FromGitter | <yyyc514> do templates work with overloading differently? |
01:15:44 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/6478367a491c8d7923faad0151683c94 |
01:15:57 | FromGitter | <yyyc514> surely some way to escape templates to prevent substitution |
01:21:19 | FromGitter | <rayman22201> {.dirty.} I think? https://nim-lang.org/docs/manual.html#templates-hygiene-in-templates |
01:25:06 | * | darithorn joined #nim |
01:26:05 | FromGitter | <yyyc514> how would that help? |
01:26:25 | FromGitter | <yyyc514> i don’t think named argument work like i want them to anyways |
01:27:05 | FromGitter | <rayman22201> maybe I don't understand your question. "body in the template is wrongly taking it's place also" -> that is happening because the template is hygenic |
01:27:52 | FromGitter | <yyyc514> dirty has no effect |
01:28:00 | FromGitter | <yyyc514> body SHOULD be replaced, but only the right hand side |
01:28:13 | FromGitter | <yyyc514> the left hand side is an object with a field named “body" |
01:28:14 | FromGitter | <rayman22201> well specifically, `resp` is the thing that's actually not being affected. |
01:28:18 | FromGitter | <yyyc514> i want some way to escape it |
01:29:57 | FromGitter | <yyyc514> like resp.`body` = body |
01:30:01 | FromGitter | <yyyc514> but that’s not supported |
01:30:34 | FromGitter | <rayman22201> does it work if you change the name of body to something else? |
01:30:50 | FromGitter | <yyyc514> it would but i want to use named arguments |
01:30:55 | FromGitter | <yyyc514> and the name of the argument is “body" |
01:31:32 | FromGitter | <rayman22201> that's what I'm saying. Does it work if you change the argument name from "body" to "foo" |
01:32:02 | FromGitter | <yyyc514> yes |
01:32:07 | FromGitter | <yyyc514> but then i’d break the API i want |
01:32:13 | FromGitter | <yyyc514> render(body=…) is the API |
01:32:29 | FromGitter | <yyyc514> but named arguments don’t figure into overloading so that might all go out the window anyways |
01:34:24 | FromGitter | <rayman22201> I'm not trying to get you to change your api, I'm trying to understand the problem to see if it's a bug |
01:35:40 | FromGitter | <yyyc514> i’m calling `render(body="raw”)` and I get ```resp.”raw" = “raw"``` which is NOT what i’d like, bug or not :) |
01:35:45 | FromGitter | <yyyc514> i do’nt think it’s a bug, but it’s annoying |
01:36:33 | FromGitter | <yyyc514> any good articles on designing an API in nim? |
01:37:21 | FromGitter | <rayman22201> I'm not sure. That smells like it might be a bug. but idk |
01:38:00 | FromGitter | <yyyc514> https://github.com/nim-lang/Nim/issues/8899 i commented here |
01:38:41 | FromGitter | <rayman22201> Not really, unfortunately. Most people point to karax as the best example of idiomatic Nim api. |
01:38:52 | FromGitter | <rayman22201> #smallcommunityproblems |
01:40:06 | FromGitter | <yyyc514> i’m coming from Ruby where so many things are hash based opts |
01:40:10 | FromGitter | <rayman22201> good 'ol Araq. The champion of KISS lol |
01:40:41 | FromGitter | <yyyc514> `render body: ...`, `render raw: …`, `render html: …`, etc. |
01:40:48 | FromGitter | <rayman22201> well... Ruby also has a lot of perf issues because of that kind of dynamic features |
01:41:00 | FromGitter | <yyyc514> issues is a strong word ;-) |
01:41:24 | FromGitter | <yyyc514> i’m just trying to figure out how to translate that kidn of API to nim… i think i end up with just lots of methods |
01:41:34 | FromGitter | <yyyc514> renderHTML renderRaw renderJSON etc |
01:42:40 | FromGitter | <rayman22201> You are on the right track with using templates and macros. That is idiomatic Nim. Nim is very pro DSL |
01:50:50 | FromGitter | <rayman22201> This is probably overkill, but if you really want the control over escaping, you can go into full macros like this: https://gist.github.com/rayman22201/446fd5498c5028b3f3c0f3c21f11bab5 |
01:50:53 | * | vlad1777d quit (Ping timeout: 245 seconds) |
02:04:54 | * | banc quit (Quit: ZNC - http://znc.in) |
02:21:29 | * | banc joined #nim |
03:00:20 | * | dddddd quit (Remote host closed the connection) |
03:07:36 | * | chemist69 joined #nim |
03:10:27 | * | chemist69_ quit (Ping timeout: 250 seconds) |
03:54:59 | * | d10n-work quit (Quit: Connection closed for inactivity) |
04:26:50 | * | kapil____ joined #nim |
04:35:13 | * | darithorn quit () |
04:38:57 | * | endragor joined #nim |
04:59:55 | * | Pisuke joined #nim |
05:01:44 | * | MyMind quit (Ping timeout: 272 seconds) |
05:15:32 | * | stephan_1 joined #nim |
05:20:53 | * | leorize quit (Ping timeout: 276 seconds) |
05:34:50 | * | nsf joined #nim |
05:53:26 | * | gangstacat quit (Ping timeout: 252 seconds) |
05:53:30 | * | leorize joined #nim |
06:06:39 | * | krux02 joined #nim |
06:08:09 | * | stephan_1 quit (Quit: leaving) |
06:15:02 | * | Vladar joined #nim |
06:23:51 | * | vlad1777d joined #nim |
06:45:51 | * | kapil____ quit (Quit: Connection closed for inactivity) |
07:11:18 | * | sagax_ joined #nim |
07:12:38 | * | Tongir quit (Remote host closed the connection) |
07:16:05 | * | Tongir joined #nim |
07:33:52 | * | hoijui joined #nim |
07:44:27 | * | gangstacat joined #nim |
08:15:52 | * | kapil____ joined #nim |
08:27:52 | * | leorize quit (Ping timeout: 244 seconds) |
08:58:55 | * | PMunch joined #nim |
09:02:22 | * | gmpreussner_ quit (Ping timeout: 246 seconds) |
09:03:46 | * | gmpreussner joined #nim |
09:05:08 | * | craigger quit (Read error: Connection reset by peer) |
09:06:25 | * | craigger joined #nim |
09:31:35 | * | platoff joined #nim |
10:12:58 | * | leorize joined #nim |
10:20:30 | * | hoijui quit (Ping timeout: 244 seconds) |
10:22:46 | FromGitter | <alehander42> wow @yyyc514 I almost remembed your nick, thought it's @yyyc514 |
10:25:12 | FromGitter | <alehander42> well something which I do is just to use a macro instead |
10:29:08 | FromGitter | <alehander42> ```macro render*(body: untyped): untyped = ⏎ result = quote: ⏎ resp.body = `body```` [https://gitter.im/nim-lang/Nim?at=5bc9b1f41c100a4f29adc5f9] |
10:29:20 | FromGitter | <alehander42> it's one line more, but it fixes those issues |
10:30:23 | * | kapil____ quit (Quit: Connection closed for inactivity) |
10:32:09 | FromGitter | <alehander42> ah @rayman22201 already did the same, sorry |
10:32:52 | FromGitter | <alehander42> if you want Nim API-s, just take a look at the existing libs |
10:33:04 | FromGitter | <alehander42> e.g. of the top of my head, jester's routes |
10:33:30 | FromGitter | <alehander42> Araq's ormin ORM https://github.com/Araq/ormin/blob/master/examples/forum/forum.nim |
10:34:24 | FromGitter | <alehander42> zah's chronicles logger https://github.com/status-im/nim-chronicles (a good example of key-value handling) |
10:35:34 | FromGitter | <alehander42> @mratsim 's https://github.com/numforge/loop-fusion |
10:36:25 | FromGitter | <alehander42> @andreaferretti 's https://github.com/andreaferretti/rosencrantz |
10:37:36 | FromGitter | <alehander42> @zacharycarter 's https://github.com/zacharycarter/litz/blob/master/tests/test_hello_world.nim hyperhtml inspired one |
10:38:48 | FromGitter | <alehander42> and a lot more, I've also worked on several (https://github.com/zero-functional/zero-functional with @michael72 , or https://github.com/alehander42/nim-quicktest ) |
10:39:10 | FromGitter | <alehander42> but you'll find out that most of them define their custom DSL closely tied to the problem domain |
10:39:32 | FromGitter | <alehander42> and they are pretty different from each other |
10:41:15 | * | elrood joined #nim |
10:41:59 | FromGitter | <alehander42> (those were examples of macro-based DSL-s mostly, in Ruby it's harder to use custom syntax even with metaprogramming, as you can't transform the AST, you still work with values: I've worked on e.g. https://github.com/alehander42/matchete and the syntax there is a bit more limited) |
11:00:04 | Summertime | the standard library is pretty good, and the commandeer package is too, some parts were a bit hard to find though |
11:01:11 | Summertime | but a tool to convert json to bash/sh evalable code took 2 lines of code (need to add another line to prevent RCE) and 3 lines for the commandline interface |
11:04:43 | FromGitter | <xmonader> ```code paste, see link``` ⏎ ⏎ Do you guys have a better idea to implement timeoutable procs? [https://gitter.im/nim-lang/Nim?at=5bc9ba4bae7be9401680866e] |
11:10:23 | * | anamok joined #nim |
11:10:24 | anamok | hi |
11:11:23 | anamok | "nimble test" produces binaries in my tests/ folder for every test file. Is there a simple way to tell "nimble test" to do a cleanup? |
11:12:47 | FromGitter | <xmonader> @anamok you can define another task in ur nimble file to do the cleaning |
11:14:03 | anamok | ok, but "nimble test" shouldn't leave a mess :) |
11:16:10 | FromGitter | <xmonader> @anamok I understand not sure how other ppl solve it |
11:21:20 | * | sagax quit (Remote host closed the connection) |
11:32:55 | anamok | I solved it this way: collect every file in tests/ and take away from it *.nim* . What remains can be deleted. |
11:33:53 | anamok | A better way would be to check if a file is binary or not. |
11:37:49 | Araq | I just use an OS with an .exe extension instead :P |
11:38:03 | Araq | (obligatory trolling...) |
11:38:27 | FromGitter | <xmonader> @Araq i just read spawn isn't meant to work with channels in a comment of yours |
11:38:54 | FromGitter | <xmonader> and that was 3 years ago, what is the status of that? |
11:39:49 | FromGitter | <alehander42> the one thing I don't understand is how people like Araq managed to stay calm for the windows forced autoupdates |
11:39:59 | FromGitter | <alehander42> I almost threw my laptop from the 8th floor |
11:40:11 | FromGitter | <alehander42> once |
11:40:22 | Araq | "forced autoupdates"? dunno, never noticed it |
11:40:34 | FromGitter | <alehander42> a lucky man |
11:40:45 | Araq | I noticed and hate them for my PS4... |
11:41:32 | federico3 | anamok: executables are flagged as such. Just do: find tests -type f -executable -delete |
11:41:59 | Araq | xmonader: it's still crap but soon destructors will come to rescue us |
11:42:23 | Araq | federico3, cool, does that also remove my handwritten scripts with the exec bit? |
11:42:48 | federico3 | anamok: still, various tools like koch and nim doc have the bad habit of not tracking which files they are creating |
11:43:41 | federico3 | so you cannot tell if they are overwriting files you created manually of if you are deleting files not created by them |
11:43:46 | Araq | bad habit? which compiler does track its files? what does that even mean.. |
11:43:49 | FromGitter | <xmonader> @Araq i shouldn't use it in production then :( |
11:44:17 | Araq | xmonader: stay away from 'spawn' in production, channels are fine with threads |
11:45:14 | federico3 | Araq: bad habit to create files outside of dedicated locations, like nim doc does, compared to other similar tools that use an output directory |
11:45:44 | Araq | nim doc supports an output directory |
11:46:09 | federico3 | but it's not the default behavior |
11:46:27 | PMunch | find . -type f -exec file {} \; | grep ELF |
11:47:12 | federico3 | PMunch: you are still deleting binaries that have not been created as part of the test run |
11:47:44 | Araq | federico3, most compilers I've used dumped .o/.obj files next the source code... |
11:48:19 | federico3 | Araq: it's not a compiler problem, the compiler is fine. It's the tooling around it. |
11:49:30 | Araq | IMO the problem is that we are not strict enough, if every Nimble package had a bin/ dir and a html/ dir things start to get easy |
11:50:13 | Araq | if p/foo.nimble exists we are allowed to create p/html and p/bin, that would help |
11:50:49 | PMunch | federico3, well yes, there's no good way to know what files were created by a specific action |
11:50:51 | federico3 | e.g. various test tools would create a unique scratch directory for a test run that will store anything that is specific to that run |
11:50:57 | PMunch | Could take a snapshot before and after but eh. |
11:51:38 | PMunch | But my solution at least won't remove bash scripts |
11:51:52 | federico3 | PMunch: a filesystem snapshot? a bit heavy handed :) |
11:52:30 | PMunch | Nah, just a find before and after :P |
11:52:45 | PMunch | Could of course also try to figure it out based on time-stamps |
11:53:06 | * | Ven`` joined #nim |
11:53:20 | federico3 | PMunch: is this for test runs or nim doc or other tools? |
11:53:25 | * | hoijui joined #nim |
11:54:30 | PMunch | I don't know. It's anamok who asked for how to do this .P |
11:54:38 | PMunch | But I think it was just for a test run |
11:57:24 | anamok | federico3: thanks for the `find` tip but I'm looking for a cross-platform solution. Though under Windows it's enough to check the extension (.exe). |
11:58:20 | anamok | test run only (at the moment) |
11:58:38 | federico3 | anamok: same problem: what if the .exe is not part of the test run? |
11:59:14 | anamok | Must be gone. What is it doing in the tests/ folder? ;) |
11:59:55 | federico3 | I have various examples of ancilliary tools that sit there |
12:00:25 | federico3 | for the record, find . -type f ! -name "*.*" -executable filters out only executables without extension |
12:01:06 | Araq | good to know |
12:01:27 | anamok | Then what about this: binaries are created for the test nim files. Collect *.nim, cut off the ".nim" extension, and you get the binaries. Under Windows add ".exe". These can be deleted. |
12:01:45 | Araq | anamok, sounds reasonable |
12:02:00 | PMunch | Why not just add -o when compiling and putting them in a bin folder? |
12:02:06 | PMunch | Or am I missing something obvious here? |
12:02:29 | anamok | I didn't know about the "-o" ... |
12:03:25 | krux02 | general question, what do you think about an issue template |
12:04:10 | krux02 | other github repositories already have it and use it, in Nim issues can be arbitrarily shaped. |
12:04:32 | FromGitter | <alehander42> i think people discussed it when the rfcs discussion happened |
12:04:53 | anamok | PMunch, "nimble test" ignores "-o bin" |
12:05:40 | FromGitter | <alehander42> I think a default template is a good idea, and if RFC-s are in a different repo we can have different template for them |
12:06:43 | PMunch | krux02, problem is if it just becomes silly strict |
12:06:51 | PMunch | Adding too much stuff that's seldom used |
12:07:16 | PMunch | anamok, fix it and PR nimble :) |
12:07:37 | FromGitter | <alehander42> well one can always erase the prepopulated issue markdown and write a simple one-line issue |
12:07:38 | FromGitter | <alehander42> right? |
12:09:33 | federico3 | PMunch: a dedicated directory can also be used for other scratch files but it needs integration with the tools |
12:11:43 | * | hoijui quit (Ping timeout: 245 seconds) |
12:11:47 | Araq | nimcache is Nim's scratch directory |
12:12:05 | Araq | problem is though that binaries and HTML docs are not just for deletion |
12:12:26 | Araq | some people like to distribute or at least use these |
12:13:17 | federico3 | yes, and it should be local to the project |
12:16:54 | FromGitter | <xmonader> trying to convert prev example from spawn/channels to threads/channels ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5bc9cb35600c5f6423d3f19b] |
12:19:20 | * | anamok quit (Ping timeout: 244 seconds) |
12:20:57 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:24:20 | * | Ven`` joined #nim |
12:31:41 | FromGitter | <kaushalmodi> anamok: just create your own "tests" task in config.cfg |
12:32:10 | FromGitter | <kaushalmodi> I am seeing that I can easily get away with "nimble foo" tasks except for "nimble install" |
12:32:39 | FromGitter | <kaushalmodi> s/config.cfg/config.nims |
12:34:04 | FromGitter | <kaushalmodi> Also, s/get away with/get away without/ :) |
12:44:22 | * | hoijui joined #nim |
12:51:59 | * | hoijui quit (Ping timeout: 276 seconds) |
12:53:06 | krux02 | PMunch: I agree |
12:53:20 | krux02 | this is my first draft: http://ix.io/1pxM |
12:53:39 | krux02 | The idea is just to get a general ordering of information |
12:53:47 | krux02 | and a hint to keep the issues short |
12:54:22 | * | Ven`` quit (Remote host closed the connection) |
12:54:33 | * | Ven`` joined #nim |
12:54:51 | krux02 | @all: that is the issue template above, please comment on it, and say if you don't like it. |
12:55:29 | krux02 | if you can phrase what you don't like about it, that would be welcome as well. |
12:56:05 | Araq | krux02, I like it |
12:56:32 | krux02 | cool |
12:59:05 | krux02 | alehander42: in theory people can delete unused template leftovers, but in practice it is just left in the issue, creating beautilful issues with lots of headlines with no content in them |
13:06:41 | FromGitter | <alehander42> the title is usually above the issue |
13:07:04 | FromGitter | <alehander42> maybe it should be |
13:07:22 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc9d70a435c2a518ed0312f] |
13:08:16 | krux02 | alehander42: the idea is to rething about the title after the summary has been written. |
13:09:17 | FromGitter | <alehander42> I think the examples can be called Example/Steps to reproduce |
13:09:44 | FromGitter | <alehander42> because people might forget to add context (e.g. additional setup needed sometimes) |
13:10:42 | krux02 | well it is not about what might happen, it is more about what currently happens. |
13:11:54 | krux02 | I don't want a template that covers every possible case, I would rather have an incomplete template that triggers creativity. |
13:13:18 | krux02 | the issue template is implemented now |
13:13:36 | krux02 | I am excited for the next issue :P |
13:14:31 | FromGitter | <narimiran> @krux02 i wanted to implement it, but didn't have much time these days |
13:14:40 | FromGitter | <narimiran> (issue template) |
13:14:56 | krux02 | well you can create an issue now and see if you like it. |
13:15:23 | * | anamok joined #nim |
13:15:34 | FromGitter | <narimiran> did you use github's templates as a starting point? |
13:16:08 | krux02 | I used one from somewhere, yes |
13:16:11 | FromGitter | <narimiran> is it possible to to show an example of nim code block in the template? |
13:16:27 | krux02 | yes it is |
13:16:43 | krux02 | the template has the same syntax as the issue markdown |
13:16:49 | krux02 | it is just markdown |
13:17:04 | krux02 | or better said github favored markdown |
13:17:06 | FromGitter | <narimiran> `<!--- This could be a source code block -->` i would add here that it should be self-sufficient/runnable, so it can be reproduced just by copy-pasting it |
13:17:10 | krux02 | flavored |
13:17:50 | krux02 | narimiran[m], that is a good point, but not all isseues are source code related |
13:18:01 | krux02 | they can be documentaten related |
13:18:45 | FromGitter | <narimiran> ok, but this template is for code-related issues. if it is something else, you just delete the template and write as you did until 5 minutes ago :) |
13:19:15 | krux02 | well it is an issue tracker for a programming language |
13:20:21 | krux02 | I already don't like that I have a slash in Possible Solution/Expected Behavior |
13:20:36 | * | Ven`` quit (Remote host closed the connection) |
13:20:47 | FromGitter | <narimiran> i'm going through a lot of old issues, and i just copy paste examples to see if they still produce the reported error. i try to do that as fast as possible, so sometimes i didn't see that something should be run with some special compile option. i would really appreciate if that is somehow (better) noted in the examples |
13:21:03 | * | Ven`` joined #nim |
13:21:16 | FromGitter | <narimiran> there should be: "current output", and "expected output" as two separate fields |
13:22:45 | FromGitter | <narimiran> not only does this help me, but in future, someone might automate checking the old issues, and self-sufficient examples (with the wrong and expected output) would be of great help for that |
13:22:56 | FromGitter | <narimiran> let's make our future lives easier! |
13:23:22 | krux02 | well currently Nim misses a good metric to sort issues by quality. Those points you name would be very important for such a metric. But this template unfortunately doesn't solve that problem at all. |
13:23:49 | FromGitter | <kaushalmodi> "there should be: "current output", and "expected output" as two separate fields" +1 |
13:25:19 | krux02 | haushalmodi: when you nest quotes, you should use single quotes as inner quotes ;) |
13:25:23 | krux02 | but yes it's noted |
13:25:27 | krux02 | good point |
13:25:47 | FromGitter | <alehander42> I also agree |
13:26:45 | krux02 | ok, then I think I will add these two fields, they seem important, and when I think about it, my issues also had those |
13:27:45 | FromGitter | <narimiran> "But this template unfortunately doesn't solve that problem at all." template doesn't force you to use them, but they provide you a nice skeleton to use if you're not experienced and you don't know what a quality issue would look like |
13:33:48 | * | PMunch quit (Ping timeout: 245 seconds) |
13:34:03 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:34:24 | krux02 | I can also fill the template with some nonsese issue |
13:34:52 | krux02 | here is an example: http://ix.io/1pxV |
13:35:35 | FromGitter | <narimiran> nitpicking, but i would switch the order of current and expected output. |
13:36:05 | FromGitter | <narimiran> and use single backticks for inline code in markdown ;) |
13:36:37 | krux02 | well I am used to double backticks, because I think rst requires them |
13:37:27 | krux02 | this basically sums up all relevant markdown |
13:37:29 | krux02 | code listing |
13:37:38 | krux02 | identifiers in full text |
13:37:46 | krux02 | output |
13:38:27 | FromGitter | <narimiran> here is my version: http://ix.io/1pxX |
13:39:01 | FromGitter | <narimiran> giving it a bit of breathing room to easier see where is what |
13:39:40 | FromGitter | <narimiran> and changed "could" to "should" |
13:41:25 | krux02 | I am ok with the spacing |
13:41:48 | * | vlad1777d quit (Ping timeout: 252 seconds) |
13:41:48 | FromGitter | <narimiran> oh, and make that `## Possible Solution`, without the rest |
13:42:12 | FromGitter | <narimiran> i am not ;) |
13:43:36 | krux02 | Well I don't want to restrict the issues template too much to just bugs |
13:44:32 | FromGitter | <kaushalmodi> krux02: "when you nest quotes .." Hah, then I wasn't the only one to think about that. I thought till the extent to backslash escape those nested quotes, and then escape them too so that they show on Gitter :P |
13:45:07 | FromGitter | <kaushalmodi> krux02: mention in the HTML comment to fill sections as applicable |
13:45:09 | FromGitter | <narimiran> @kaushalmodi or just use single ticks for your (outside) quotes, so you can just copy-paste ;) |
13:45:27 | krux02 | this is how you officially nest quotes: "krux02: 'when you nest quotes'" |
13:45:37 | krux02 | this has nothing to do with computers at all |
13:45:54 | * | elrood quit (Quit: Leaving) |
13:45:56 | FromGitter | <narimiran> officially you use “ and ”, and ‘ and ’ ;) |
13:46:04 | krux02 | yes |
13:46:10 | FromGitter | <kaushalmodi> krux02: but what if those have verbatim single quotes |
13:46:10 | krux02 | just wanted to say that |
13:46:42 | FromGitter | <narimiran> and that's not universally true, some languages (e.g. croatian) officially have starting quotes on the bottom side |
13:46:46 | FromGitter | <kaushalmodi> *I know we are just trolling* |
13:46:59 | krux02 | well, normally when you quote people, they don't speak in verbatim single quotes |
13:47:08 | FromGitter | <narimiran> and some languages have « and », and some have in the reverse order: » and « |
13:47:22 | krux02 | or german has „“ |
13:47:32 | krux02 | „double“‚single‘ |
13:48:01 | FromGitter | <narimiran> ok, it's time for me to go home, too much grammar nazis here :D :P |
13:48:12 | krux02 | quoting is difficult |
13:49:17 | krux02 | I decided to keep the template as simple as it was before, without the output fields |
13:49:27 | krux02 | I like them, but only for bug reports |
13:49:49 | krux02 | there should be a template selection mechanism |
13:50:18 | anamok | I have a library and I split one big file in src/ to smaller submodules. How can I generate the doc for everything? I want to get the output in docs/ . |
13:52:45 | krux02 | hmm github supports multiple issue templates, but no gui for selecting them, you have to select the template in the url, which makes it quite pointless |
13:56:34 | krux02 | anamok: nim doesn't know anything about your git structure, so it shouldn't matter if the subdirectories are submodules or not |
13:56:49 | krux02 | doesn't nim build the doc for the subdirectories? |
13:57:53 | anamok | I tried `nim doc src/*.nim`, thus it didn't go in the subdurectories. `nim doc src/` gives an error. |
14:00:09 | krux02 | ``nim doc src/**.nim`` does go into subdirectories if your shell is ``fish`` |
14:01:11 | krux02 | ``nim doc $(find src -iname '*.nim')`` should work recursively |
14:01:55 | anamok | I have bash. And I would also do it under Windows sometime. |
14:02:34 | krux02 | try if that command line above works with find |
14:02:38 | leorize | `find src -name '*.nim' -exec nim doc '{}' +` |
14:02:55 | leorize | ^ that one is the more "standard" way of using find |
14:02:57 | krux02 | or that |
14:03:59 | * | hoijui joined #nim |
14:04:31 | anamok | OK, it worked, thanks |
14:04:38 | krux02 | leorize, my "standard" way of using find is ``find . | grep '\.nim' |
14:04:47 | FromDiscord | <hotdog> If I fill a {.compileTime.} seq on compilation (reading from files using staticRead), how can I access that seq at runtime? Or copy it so it's there at runtime |
14:05:04 | leorize | krux02: that's the unix way :) |
14:05:07 | anamok | leorize: the `+` should be `\;`, no? |
14:05:30 | leorize | `+` concat the entire file list |
14:05:37 | leorize | `\;` pass them one by one |
14:05:45 | leorize | I don't know if nim doc support multiple so... |
14:05:57 | anamok | no, + gave an error |
14:06:23 | krux02 | hotdog: why don't you read that file at runtime? |
14:06:55 | krux02 | normally if you put that thing in a const it should work at runtime, too |
14:07:04 | anamok | Can we tell `nim doc` to produce the output to a destination folder? |
14:07:26 | anamok | I tried `-o dest/` |
14:08:49 | anamok | And now I have individual .html files. Is it possible to generate a main html page from where one can discover all the submodules? |
14:09:31 | anamok | Or what is the preferred way to create the docs for a library that is split up to several modules? |
14:09:38 | FromDiscord | <hotdog> @krux02 I am preprocessing/bundling files to be used in JS |
14:09:45 | FromDiscord | <hotdog> So can't read from disk at runtime |
14:09:54 | krux02 | ok |
14:10:37 | krux02 | as I said, put it into a const, that should work. |
14:11:02 | FromDiscord | <hotdog> Yeah that's true. I probably need to use a compileTime proc instead of a static block |
14:11:33 | krux02 | const value = (block: ... |
14:12:49 | FromDiscord | <hotdog> It worked 👍 Thanks @krux02 |
14:13:14 | krux02 | you are welcome |
14:13:40 | FromDiscord | <hotdog> Out of curiosity, how could I modify this at runtime? Without copying to a var seq |
14:13:52 | krux02 | no |
14:14:09 | krux02 | well there is always a way |
14:14:09 | FromDiscord | <hotdog> I guess what I was originally trying to do was to pre-fill a variable seq that could then have more stuff added to it at runtime |
14:14:15 | FromDiscord | <hotdog> If that makes sense |
14:14:36 | krux02 | yea I understand |
14:14:47 | krux02 | but no not an intended use of const |
14:14:54 | FromDiscord | <hotdog> Yeah |
14:15:45 | FromDiscord | <hotdog> I think that's what I got stuck on. I had the var seq working at runtime, then tried to add stuff to it at compile time |
14:16:09 | FromDiscord | <hotdog> I guess I can macro it so the data is there at runtime, and added to the seq on startup |
14:17:42 | * | PMunch joined #nim |
14:22:40 | * | PMunch quit (Quit: Leaving) |
14:28:18 | * | narimiran joined #nim |
14:29:01 | narimiran | krux02: re "there should be a template selection mechanism", i thought there is |
14:29:42 | narimiran | when you go to the nim's github settings, there is "set up templates" button, and there are three templates and you can use all three of them |
14:30:43 | krux02 | narimiran: I guess I have to take a look at it. |
14:31:10 | krux02 | narimiran, the question is, how do you select a template when you create an issue? |
14:31:11 | narimiran | i'm looking at it right now, i'll start with your template and see where that takes us |
14:34:27 | krux02 | narimiran: can you make a PR? hopefully in a way that I can test the templates on your fork of Nim. |
14:35:31 | narimiran | there's a "feature request" template. krux02, let's make that one too |
14:36:14 | krux02 | great idea |
14:36:30 | narimiran | this is its default: http://ix.io/1py5 |
14:38:00 | FromGitter | <kaushalmodi> narimiran: make the descriptions/instructions HTML comments |
14:38:10 | narimiran | @kaushalmodi: will do |
14:38:13 | FromGitter | <kaushalmodi> that way people can choose to leave them as is, and they won't show up |
14:38:20 | FromGitter | <kaushalmodi> in the submitted issue |
14:38:23 | narimiran | anything in particular we should add/modify? |
14:39:10 | federico3 | narimiran: it should be more clear and concise |
14:39:11 | FromGitter | <kaushalmodi> request -> requested |
14:39:23 | FromGitter | <kaushalmodi> narimiran: ^ in that template |
14:39:44 | narimiran | federico3: can you be more specific, please? |
14:39:44 | FromGitter | <kaushalmodi> well. the second instance of "request" :) |
14:39:59 | FromGitter | <mratsim> @anamok, use a `build/` folder and tell nimble test to put files in there |
14:40:09 | FromGitter | <kaushalmodi> narimiran: I think he is referring to the repetition |
14:40:25 | FromGitter | <pr-yemibedu> good morning everyone. |
14:40:41 | FromGitter | <mratsim> for example @anamok: https://github.com/status-im/nim-stint/blob/master/stint.nimble#L12-L17 |
14:40:43 | FromGitter | <pr-yemibedu> I was working on code and setting up tooling in vscode. |
14:41:08 | FromGitter | <pr-yemibedu> i have things for debugging with gdb and profiling with nimprof. |
14:41:33 | federico3 | narimiran: I was joking a bit but honestly the template is very repetitive |
14:41:55 | narimiran | federico3: i'll delete non-bold text |
14:42:08 | narimiran | ...and make the bold text to be a comment |
14:42:30 | FromGitter | <mratsim> to many describe :/ |
14:42:33 | FromGitter | <mratsim> too* |
14:42:41 | FromGitter | <mratsim> and clear and concise |
14:42:43 | FromGitter | <pr-yemibedu> my issue is that i noticed that i have to modify my source to go between a basic run "-r" and a profile run "-r --stackTrace:on --profiler:{on/off}" |
14:43:16 | * | hoijui quit (Ping timeout: 252 seconds) |
14:43:21 | FromGitter | <mratsim> you just need —debugger:native |
14:43:32 | FromGitter | <pr-yemibedu> i wanted something like if the ``` when compiledOption("stackTrace"): |
14:43:49 | FromGitter | <mratsim> you can use that |
14:45:15 | narimiran | my quick version: http://ix.io/1py7 |
14:45:48 | FromGitter | <pr-yemibedu> i already use the debugger stuff with not a problem it seems. it is surrounding the profiling that i have my issue. |
14:46:45 | anamok | mratsim: thanks. Any way to generate a main html file for grouping the individual .html files? |
14:48:05 | FromGitter | <kaushalmodi> anamok: See `nim buildIndex` .. though I haven't yet found a recipe to create one nicely for a multi-module project |
14:48:31 | FromGitter | <kaushalmodi> I have a well tested NimScript task that generates doc + search index for a single file project: https://github.com/kaushalmodi/nim_config/blob/ae43e690ccfe842d9c1f9b5a929e401bfa8616b3/config.nims#L233-L250 |
14:49:19 | narimiran | if nobody says anything, i'm ready to publish this first version, so we can test it if it works and if we can choose different templates for new issues |
14:50:07 | anamok | kaushalmodi: thanks, useful stuff |
14:52:47 | narimiran | done, you can now choose the two templates or open a regular issue |
14:54:34 | narimiran | inb4 somebody yells that he doesn't like the new folder github created |
14:55:10 | * | couven92 quit (Quit: Client disconnecting) |
14:55:32 | FromGitter | <mratsim> @anamok you can find the codegen for this: https://mratsim.github.io/Arraymancer/ in https://github.com/mratsim/Arraymancer/blob/master/nimdoc.cfg and https://github.com/mratsim/Arraymancer/blob/master/arraymancer.nimble#L185 ⏎ ⏎ Check also the doc codegen for NimYAML: https://nimyaml.org/ |
14:58:03 | * | endragor quit (Remote host closed the connection) |
15:00:38 | * | endragor joined #nim |
15:01:23 | * | endragor quit (Remote host closed the connection) |
15:09:06 | * | Vladar quit (Remote host closed the connection) |
15:11:31 | * | PMunch joined #nim |
15:11:46 | anamok | mratsim: thanks |
15:12:01 | FromGitter | <pr-yemibedu> i figured it out |
15:12:16 | FromGitter | <mratsim> I’m still not that happy about the doc generation but it’s passable |
15:12:19 | FromGitter | <pr-yemibedu> i used ```when defined(profiler) or defined(memProfiler):``` |
15:12:37 | FromGitter | <mratsim> well i’m not a frontend dev, I don’t even know how to fix my css :P |
15:12:45 | * | dddddd joined #nim |
15:13:26 | * | Trustable joined #nim |
15:16:10 | * | sagax_ quit (Remote host closed the connection) |
15:18:14 | FromGitter | <tim-st> not sure if I asked this before: when I have a proc `a: void` and a proc `b: void` should the line `return a()`called in `b` be legal? |
15:18:57 | FromGitter | <mratsim> I don’t think so be void has some edge cases |
15:19:20 | * | Perkol joined #nim |
15:19:26 | FromGitter | <mratsim> like this one which is super annoying: https://github.com/nim-lang/Nim/issues/7397 |
15:19:31 | FromGitter | <tim-st> ok, thanks, because it's the same like `a(); return` |
15:20:55 | Perkol | https://bpaste.net/show/a7e8fbd28061 I get this error when trying to run this. But it works fine in standart(non nim) elevated cmd prompt |
15:23:17 | FromGitter | <tim-st> @mratsim I didnt explicitly wrote the return type void; I assume `proc a() = discard` has return type void? |
15:23:59 | FromGitter | <tim-st> yes, no difference |
15:24:13 | * | seni joined #nim |
15:24:48 | FromGitter | <tim-st> maybe @Araq knows if the language def should allow this |
15:25:46 | FromGitter | <tim-st> (it's a python style, there for both None is returned) |
15:25:53 | FromGitter | <alehander42> @Perkol i am almost sure you meant something else |
15:26:07 | FromGitter | <alehander42> because "/C" & "vs.." == "/Cvsadmin.." |
15:30:32 | * | darithorn joined #nim |
15:36:26 | * | nsf quit (Quit: WeeChat 2.2) |
15:39:29 | Perkol | Rewrote, still same error |
15:39:47 | FromGitter | <mratsim> is there a way to test if something is a var type? `when foo is var` doesn’t work |
15:43:07 | FromGitter | <tim-st> maybe you can try to take the `addr` and when not compiles it's not var? but not sure |
15:43:13 | FromGitter | <alehander42> Perkol, echo the expression you're passing to make sure its correct |
15:43:15 | FromGitter | <alehander42> and also try execShellCmd |
15:46:09 | Perkol | Tried both, still same stuff |
15:47:21 | anamok | I have a library called (example): "stuff". I have "src/stuff.nim" and have "src/stuff/*.nim", where the latter dir. contains the submodules. When I generate the indexes, two separate htmldocs/ folders are created: src/htmldocs/ and src/stuff/htmldocs/ . |
15:48:03 | anamok | When I run "nim buildIndex" on these htmldocs folders, I get two separate theindex.html files. |
15:48:08 | FromGitter | <tim-st> @mratsim `template isVar(x): bool = compiles(addr(x))` |
15:48:42 | anamok | I would like just one theindex.html for my whole library. |
15:49:21 | anamok | If I copy the *.idx files in the same dir. and generate theindex.html from them, then the links are broken. |
15:49:35 | FromGitter | <mratsim> @anamok i.e. there is a way to produce theindex for our own lib, I don’t remember where i saw that though |
15:49:50 | FromGitter | <alehander42> sorry Perkol, not on windows, cant try it, but it should work in principle |
15:49:59 | FromGitter | <mratsim> @tim-st such a hack :/ |
15:50:48 | FromGitter | <tim-st> maybe with macros there is a better way, but I have to learn macros :\ |
15:51:38 | FromGitter | <mratsim> yeah in a typed macro you can just check if foo.getTypeInst.kind == nnkVarTy |
15:51:43 | anamok | However, the theindex.html for the submodules has links to all the submodules. But the main module (stuff.nim) is not included there. |
15:52:06 | * | Perkol quit (Remote host closed the connection) |
15:52:19 | FromGitter | <mratsim> but I’m trying not to add 50 lines of typed macros, untyped macros are just plain easier |
15:52:36 | FromGitter | <mratsim> `is` is supposed to work with `var` https://nim-lang.org/docs/manual.html#generics-type-classes |
15:54:34 | FromGitter | <tim-st> yes, that's an issue then |
15:54:49 | FromGitter | <tim-st> but my hack seems to work :)) |
15:56:34 | FromGitter | <mratsim> the bug report template is too verbose :/ |
15:57:58 | FromGitter | <tim-st> and it misses the most important thing: "nim --version" |
15:58:21 | narimiran | @mratsim what should be removed? |
15:58:32 | narimiran | @tim-st good catch! |
15:59:53 | * | tdc quit (Ping timeout: 252 seconds) |
16:03:17 | * | enthus1ast joined #nim |
16:04:01 | enthus1ast | is there already a windows service in nim? |
16:05:36 | enthus1ast | if not then i start hacking one |
16:05:43 | FromGitter | <mratsim> @narimiran dunno yet. Note that `nim —version` doesn’t work with choosenim devel |
16:10:01 | FromGitter | <tim-st> https://nim-lang.org/docs/manual.html has no syntax highlighting (or colors?) in print mode |
16:10:44 | FromGitter | <tim-st> Creating a pdf in a5 format via chrome looks very good otherwise |
16:11:06 | FromGitter | <mratsim> @tim-st your template’s is SIGSEGV-ing :/ |
16:11:37 | FromGitter | <tim-st> well I said it's just a guess |
16:11:50 | FromGitter | <mratsim> it as a good one though |
16:11:55 | FromGitter | <tim-st> for which code it fails? |
16:12:04 | FromGitter | <tim-st> mayabe that's also a `addr` bug in nim? |
16:12:23 | FromGitter | <mratsim> ah no, it’s because I was returning a static bool |
16:12:30 | FromGitter | <mratsim> if I change that to a simple bool it works |
16:12:50 | FromGitter | <tim-st> maybe you can change the template to a static block |
16:12:58 | FromGitter | <tim-st> dunno if it helps |
16:13:09 | FromGitter | <mratsim> it’s ok, I can use a bool anyway |
16:15:13 | * | tdc joined #nim |
16:15:27 | FromGitter | <tim-st> my idea was that the nim compiler likely does the same check for `addr` so it should work for all |
16:15:36 | FromGitter | <mratsim> it works |
16:15:46 | FromGitter | <mratsim> it’s the static bool return value that doesn’t work with templates |
16:15:59 | FromGitter | <tim-st> ok, a bug? :D |
16:16:19 | FromGitter | <mratsim> static bool return values aren’t supposed to be supported :P |
16:16:41 | krux02 | what is a static bool return value supposed to mean anyway |
16:16:58 | anamok | I figured out how to create doc pages for a multi-module library. |
16:17:06 | anamok | with theindex |
16:17:24 | krux02 | anamok: cool |
16:17:29 | FromGitter | <mratsim> @krux02 it means that it’s returned at compile-time |
16:18:05 | anamok | I should write a blog post about it, I guess. |
16:18:09 | krux02 | mratsim: compile time proc? |
16:18:13 | FromGitter | <tim-st> you can emulate it in a template by using a static block I think |
16:18:29 | FromGitter | <mratsim> compile-time proc only work for NimNode input and output |
16:18:37 | krux02 | anamok, not sure if blog post is the best way to do it |
16:18:54 | krux02 | I think it is very valuable to create documentation recursively in a project. |
16:19:02 | FromGitter | <mratsim> @krux02: see https://github.com/nim-lang/Nim/issues/8051 |
16:19:52 | krux02 | anamok: yes you should document it, but that is a valuable issue. |
16:20:06 | krux02 | creating documentation for nested projects is too complicated |
16:20:11 | krux02 | you have a solution for it |
16:20:18 | krux02 | we need issues with solutions |
16:21:34 | krux02 | so when I think about it, write the blog post about it, and then create an issues regarding that creating documentation for split projects is to complicated with a link on your blog poist that explains how to generate the documentation |
16:21:52 | krux02 | then there is a chance that this process will be integrated into nim |
16:22:01 | krux02 | e.g. nim doc --recursive |
16:23:27 | * | sagax joined #nim |
16:26:43 | * | narimiran quit (Ping timeout: 245 seconds) |
16:27:26 | anamok | krux02, OK, will do that |
16:28:43 | anamok | I can also create a sample project on github |
16:30:09 | FromGitter | <mratsim> @Araq I managed to get this very nice error message: `Error: unhandled exception: /Users/andreasrumpf-mac/projects/build_nim_xz/build/Nim/compiler/suggest.nim(462, 12) `result == nil or result.kind == nkPragma` [AssertionError]` (I was expecting an error, I was doing `when compiles(block: …): {.error: “My nice message”.}`, I was just not expecting this one). |
16:34:57 | k0mpjut0r | Hello all, what is the Nim idiomatic way of storing rather large static structured data? Currently I have staticRead with a 2M CSV and build my map at startup, just wondering if there's a better way. |
16:37:08 | leorize | you could build it at compile time since you've already do staticRead... |
16:37:14 | FromGitter | <mratsim> storing it in the binary would make for a super large code. Just ship it separately and mmap it at runtime |
16:37:48 | FromGitter | <mratsim> iirc it’s an issue with time zone data (tzdata) that @GULPF is having for the standard lib |
16:39:50 | FromGitter | <mratsim> or parse it at run time with `let foo = parseCSV(…)`, i.e. use `let` instead of const/staticRead |
16:41:23 | k0mpjut0r | I want a single portable binary, and basically what I have right now is 'const data = staticRead(...); let foo = parseCsv(...)' |
16:41:39 | leorize | you could parse it at compile time... |
16:46:51 | * | endragor joined #nim |
16:49:00 | krux02 | k0mpjut0r, reading big data at runtime is actually a good idea |
16:49:18 | krux02 | you probably want to be able to parse it quickly. Code execution at compile time is slow |
16:49:28 | krux02 | at runtime it's fast |
16:50:07 | krux02 | today I discussed with Araq to implement a resource compiler |
16:50:20 | krux02 | this would allow to link binary data into the executable |
16:50:26 | krux02 | that would be fast |
16:51:11 | * | endragor quit (Ping timeout: 250 seconds) |
16:54:26 | FromDiscord | <hotdog> Given a proc signature and a proc body in a template (both as untyped), how can I generate a proc? |
16:57:35 | FromGitter | <mratsim> you can use `dumpASTGen`: on a normal proc to see how everything cobines |
16:57:38 | FromGitter | <mratsim> combines* |
16:58:45 | FromDiscord | <hotdog> Ok so need to do it in a macro? Can't just do something like "`procSig` = body" in a template? |
16:59:01 | * | thomasross quit (Read error: Connection reset by peer) |
16:59:25 | FromGitter | <zacharycarter> oh boy lol - I guess due to me - Nim was the #2 most mentioned topic in my company's #developers slack channel |
16:59:37 | FromGitter | <mratsim> the body can easily be used but the proc sig no, for the macro check this example: https://nim-lang.org/docs/macros.html#statements-procedure-declaration |
17:00:13 | FromDiscord | <hotdog> Ok thanks @mratsim! I'll make a macro |
17:00:13 | FromGitter | <mratsim> for the template, you can use things similar to this: https://github.com/numforge/laser/blob/master/laser/openmp/omp_parallel.nim#L43-L47 |
17:01:50 | FromGitter | <zacharycarter> or the number 2 overall term used in slack - either way it's bad because that channel hasn't been around that long lol |
17:01:57 | FromGitter | <zacharycarter> only like a year or so |
17:02:10 | FromGitter | <mratsim> @hotdog maybe check the curry macro, it’s super short and create proc in a couple lines: https://github.com/Araq/metapar/blob/master/livedemo/curry.nim#L31 |
17:02:19 | FromGitter | <zacharycarter> October 9, 2017 |
17:02:33 | * | tdc quit (Ping timeout: 252 seconds) |
17:02:50 | * | elrood joined #nim |
17:03:06 | FromGitter | <mratsim> `newCall(procType = nnkProc, params = YourTypeSig, body = body) |
17:03:34 | FromGitter | <mratsim> newProc not newCall* |
17:11:02 | FromDiscord | <hotdog> So I think I currently pass the proc sig as untyped, and in the macro it is "nnkProcTy" |
17:11:33 | FromDiscord | <hotdog> newProc expects "openArray[NimNode]" as the params |
17:12:32 | FromDiscord | <hotdog> But in the macro body it is a "NimNode" |
17:14:44 | FromDiscord | <hotdog> I'm a bit stuck. Are there any good resources on macros? I've read a few things but still have trouble with the process of creating them |
17:18:57 | FromDiscord | <hotdog> So like with proc params "x, y: int", using dumpTree/dumpAstGen it tells you that they are three "Ident" nodes, but if you wanted to know what is the type of "x" would you have to parse that list to figure it out? Or is there a way of asking the compiler for things like that? |
17:19:33 | FromDiscord | <hotdog> Maybe I just need to read through existing macros, like in stdlib |
17:24:27 | FromGitter | <timotheecour> @mratsim, please file an issue. lol the nsg is weird indeed |
17:26:11 | FromGitter | <mratsim> not sure how to do a mini test file :P |
17:26:42 | anamok | krux02, the multi-moduled library example is here: https://github.com/jabbalaci/NimMultiModuleLibrary . I will send an issue too. |
17:29:20 | * | craigger quit (Read error: Connection reset by peer) |
17:30:54 | * | craigger joined #nim |
17:34:08 | FromGitter | <tim-st> should this work? `proc test(i: untyped) = echo i is string` |
17:34:20 | FromGitter | <tim-st> crashes |
17:34:36 | FromGitter | <iffy> Whenever I do `nimble build` it takes a while verifying dependencies. Is there a way to skip that step? |
17:36:05 | FromGitter | <tim-st> ah, this works: `proc test(i: any) = echo i is string` |
17:36:18 | * | craigger quit (Read error: Connection reset by peer) |
17:41:22 | FromDiscord | <hotdog> @iffy I wondered that too. I don't think there is a way |
17:41:39 | FromGitter | <iffy> @dom96 ^ is there a way? :) |
17:41:53 | FromGitter | <iffy> (to skip the dependency verifying when running `nimble build`) |
17:42:46 | leorize | iffy: `sed 's/requires/#requires/g' proj.nimble` :) |
17:42:57 | krux02 | anamok: thanks |
17:43:17 | anamok | the issue was just sent |
17:43:43 | leorize | iffy: or, y'know use `nim c` and forget about `nimble` :P |
17:44:28 | FromGitter | <iffy> leorize: I'm flailing about with dependencies and `nim c` doesn't work where `nimble build` does. |
17:45:17 | krux02 | cool |
17:46:42 | FromGitter | <mratsim> btw @timotheecour I’ve started refactoring Arraymancer backend here: https://github.com/numforge/laser ⏎ ⏎ Might be interesting for you, I’ve added generic parallel strided iteration on a variadic number of “Tensor” (Tensor being almost a concept the type name isn’t used). |
17:53:47 | * | tdc joined #nim |
17:56:01 | shashlick | iffy: check if nimble is built in debug mode |
17:56:07 | shashlick | Is much slower as a result |
17:56:17 | shashlick | 0.19.0 had it that way |
17:56:30 | FromGitter | <iffy> I'm on 0.19.0 (nimble 0.9.0 |
17:56:36 | shashlick | You can recompile it by fixing koch |
17:56:51 | shashlick | Or use devel |
17:57:29 | FromGitter | <iffy> well, I'm on devel, but I don't think I've reinstalled nimble in a while -- let me test |
17:57:54 | FromGitter | <dom96> man, the volume of notifications is deadly |
17:58:04 | shashlick | https://github.com/nim-lang/Nim/blob/devel/koch.nim#L117 |
17:58:18 | FromGitter | <iffy> sorry for the notification :( |
17:58:36 | shashlick | dom96: thanks for checking the PRs |
17:58:44 | shashlick | Looks like the choosenim one worked |
17:58:52 | shashlick | Now I can fix the older one |
17:58:57 | FromGitter | <dom96> sure, I gotta head out now, but i'll try to continue looking when I get home :) |
17:59:26 | FromGitter | <iffy> shashlick: rebuilding with latest devel is still slowish |
17:59:52 | shashlick | Run nimble ABC to see if you get a stack trace |
18:00:02 | shashlick | If you do it is still debug |
18:00:14 | shashlick | Check Koch as well to verify it is up to date |
18:00:21 | shashlick | And recompile it obviously |
18:00:52 | shashlick | Should have a -d:release as noted above |
18:01:37 | FromGitter | <iffy> shashlick: where do I stick that `-d:release`? I'm following these instructions: https://github.com/nim-lang/Nim#compiling |
18:01:56 | FromGitter | <iffy> which is just a git clone, cd, run a script |
18:03:34 | FromGitter | <iffy> okay, I just did `./koch tools -d:release` and it's still slowish |
18:03:56 | FromGitter | <iffy> I mean, it's not insanely slow, it just adds 4 seconds to each build |
18:06:18 | * | kapil____ joined #nim |
18:07:15 | FromGitter | <kaushalmodi> anamok: are you there? |
18:07:23 | anamok | yes |
18:07:41 | FromGitter | <kaushalmodi> you mentioned that you have a flow for generating multi-module docs |
18:07:49 | * | craigger joined #nim |
18:07:55 | FromGitter | <kaushalmodi> can you share that somewhere? |
18:08:18 | FromGitter | <kaushalmodi> If not a detailed blog, just a brief writeup on Nim wiki would do (or Nim forum) |
18:08:40 | anamok | yes, it's here: https://github.com/jabbalaci/NimMultiModuleLibrary |
18:09:04 | FromGitter | <kaushalmodi> oh, you are jabbalaci :) |
18:09:10 | FromGitter | <kaushalmodi> we have interacted on reddit |
18:09:35 | anamok | I created this "anamok" name years ago for IRC. |
18:11:00 | FromGitter | <kaushalmodi> I'll see if I can integrate that into that docs nimscript task |
18:13:40 | anamok | first verify if it's correct that I wrote |
18:14:19 | FromGitter | <kaushalmodi> anamok: I have just added to that issue for future ref |
18:14:30 | FromGitter | <kaushalmodi> when I bake that into docs, I'll ofcourse verify it |
18:15:55 | anamok | kaushalmodi: I also opened an issue for this: https://github.com/nim-lang/Nim/issues/9444 |
18:16:16 | FromGitter | <iffy> Can I source a nimscript file from a nim-compiled binary? For instance, to use it as a config file |
18:16:44 | leorize | you can |
18:17:03 | leorize | see https://github.com/nim-lang/Nim/blob/027a11d7c85ffc990dc5b41f1c1e2b799e77ba36/compiler/scriptconfig.nim#L28 |
18:18:06 | FromGitter | <iffy> I guess my followup is: is it wise? Or should I be doing something else? (JSON has all the features I need) |
18:19:52 | FromGitter | <kaushalmodi> @iffy there's TOML too |
18:20:22 | FromGitter | <rayman22201> Bah! Why are docs a rabbit hole? lol |
18:20:45 | FromGitter | <kaushalmodi> @rayman22201 tell me about it |
18:20:47 | FromGitter | <kaushalmodi> :P |
18:21:14 | FromGitter | <kaushalmodi> travis configs are in the same category |
18:21:34 | FromGitter | <kaushalmodi> I had to make like 35-40 commits last night to get the nim nightly deployment right |
18:21:37 | FromGitter | <rayman22201> oh yeah. Automated Testing is a whole other yak shaving adventure |
18:23:31 | FromGitter | <rayman22201> I just wanted to make the dochack.js a little bit better. Now we are debating on whether to engineer a whole new search infrastructure... |
18:24:44 | Araq | rayman22201: I think it wasn't wise to throw away my code :P |
18:25:01 | Araq | should have improved my solution which was specialized for Nim |
18:25:16 | Araq | but to be fair, I don't remember what you changed :P |
18:25:27 | FromGitter | <rayman22201> lol |
18:26:44 | FromGitter | <kaushalmodi> > Now we are debating on whether to engineer a whole new search infrastructure ⏎ ⏎ what new infra? |
18:26:44 | FromGitter | <rayman22201> It really wasn't a big change! Essentially all I did was replace the regex search you had with a slightly fancier function |
18:26:53 | FromGitter | <rayman22201> https://github.com/nim-lang/Nim/issues/9431 |
18:27:21 | FromGitter | <kaushalmodi> oh |
18:27:38 | FromGitter | <kaushalmodi> I thought, I had suggested to just pop up 100% of results on a separate page |
18:28:01 | FromGitter | <rayman22201> me too... but it has gone off the rails now |
18:28:58 | FromGitter | <kaushalmodi> I think it's just silliness |
18:29:28 | FromGitter | <kaushalmodi> There are so many real bugs to solve than rewrite a search engine in Nim + JS |
18:30:17 | FromGitter | <rayman22201> I agree |
18:30:35 | Araq | I don't think it's so easy, bugs do not always affect every Nim user but a bad doc search kinda does |
18:31:02 | FromGitter | <kaushalmodi> Araq: The problem is that 100% search results are not shown |
18:31:02 | FromGitter | <rayman22201> I also agree with that |
18:31:12 | FromGitter | <kaushalmodi> so just show them on a separate page |
18:31:15 | Araq | and often the bugs are of the category "bah and once it compiles you'll complain it's too slow :P" |
18:31:31 | Araq | iterator chaining comes to mind... |
18:31:50 | * | krux02 quit (Remote host closed the connection) |
18:32:04 | Araq | and once it's fast at runtime you'll complain it's bad for compiletimes |
18:32:20 | FromGitter | <rayman22201> I don't think "throwing out the baby with the bathwater" is a good solution either with these things |
18:32:49 | Araq | and once it's also fast at compiletime you'll look at the compiler's source and complain the compiler is a clusterfuck and Nim is lacking contributors because of that :-) |
18:33:08 | Araq | so ... let's just close bugs as "won't fix" |
18:33:11 | Araq | XD |
18:33:40 | shashlick | iffy: koch tools doesn't pass flags down so -d:release on command line wont work |
18:33:49 | shashlick | check koch.nim locally to see if it already has -d:release for nimble |
18:33:58 | Araq | koch tools uses -d:release already |
18:33:59 | shashlick | araq: fixed it in devel recently |
18:34:52 | FromGitter | <kaushalmodi> shashlick: related, nimble should pass on the `-` switches to an underlying `nim` exec too |
18:35:12 | FromGitter | <kaushalmodi> then people can call `nimble` test, etc. with whatever switch they like `-o`, etc. |
18:35:17 | Araq | always remember the saying, "Why is there something rather than nothing?" |
18:35:30 | Araq | - "If there were nothing you'd still be complaining!" |
18:35:33 | FromGitter | <iffy> yep, I see that -d:release is being used all over the place in koch.nim (and in making nimble, afaict) |
18:35:56 | FromGitter | <kaushalmodi> shashlick: I know you are not responsible for that, but talking about switch passing made me remember that |
18:36:25 | shashlick | okay then your latest build should be fine, assuming you recompiled koch that is 🙂 |
18:36:25 | * | Perkol joined #nim |
18:37:22 | shashlick | @kaushalmodi: ya I think there was an issue for that already |
18:38:40 | FromGitter | <iffy> @kaushalmodi using https://github.com/NimParsers/parsetoml ? The docs don't seem to agree with the code |
18:39:54 | FromGitter | <kaushalmodi> @iffy you should open an issue. I am using that in one of my projects, running Nim devel |
18:39:59 | FromGitter | <kaushalmodi> let me check real quick |
18:40:27 | FromGitter | <iffy> okay, let me make a sscce |
18:40:51 | FromGitter | <kaushalmodi> @iffy ok, it still builds fine |
18:41:09 | FromGitter | <kaushalmodi> I am though not doing much fancy stuff in there |
18:41:33 | FromGitter | <kaushalmodi> just: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca255d64cfc273f9f26bf1] |
18:43:41 | FromGitter | <kaushalmodi> @iffy OK, I take it back.. my build fails after `nimble install parsetoml@#head` |
18:44:09 | FromGitter | <iffy> okay, I'll file the issue I'm seeing |
18:44:45 | FromGitter | <iffy> https://github.com/NimParsers/parsetoml/issues/24 |
18:45:36 | FromGitter | <kaushalmodi> @iffy I am NimParsers admin, though not parsetoml dev, so I get all emails |
18:45:47 | FromGitter | <iffy> oh, okay |
18:46:32 | FromGitter | <iffy> Seems like there was a change to make `parseX` return `TomlValueRef` instead of `TomlTableRef`? |
18:48:13 | FromGitter | <kaushalmodi> yeah .. |
18:48:23 | FromGitter | <kaushalmodi> the `dump` proc is failing with the same |
18:48:26 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca26fa1e23486b93e6c036] |
18:49:07 | FromGitter | <iffy> Maybe I was `https://github.com/NimParsers/parsetoml/blob/master/src/parsetoml.nim#L1817` first, then `getString()`? |
18:49:37 | * | zachk joined #nim |
18:49:38 | FromGitter | <kaushalmodi> why did you make the link verbatim? |
18:52:17 | FromGitter | <iffy> cause I'm silly -- oops |
18:52:28 | * | zachk quit (Changing host) |
18:52:28 | * | zachk joined #nim |
18:58:03 | FromGitter | <kaushalmodi> @iffy the fix is easy |
18:58:12 | FromGitter | <kaushalmodi> *I am so proud of myself to figure this out!* |
18:58:22 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca294dc7bf7c366239fc8c] |
18:58:53 | FromGitter | <iffy> so, `dump` probably works, but none of the things like `getString` work |
18:59:06 | FromGitter | <kaushalmodi> ok, looking there now |
18:59:06 | FromGitter | <iffy> `getString` doesn't even exist, actually |
18:59:14 | * | anamok quit (Ping timeout: 244 seconds) |
18:59:37 | FromGitter | <kaushalmodi> basically need something to translate from valueref to tableref |
18:59:38 | FromGitter | <iffy> I'm starting a PR that will add test cases, but I'm not sure what syntax *should* be the right one |
19:00:04 | FromGitter | <kaushalmodi> @iffy whatever you add should be a plus |
19:00:12 | FromGitter | <kaushalmodi> @PMunch actively maintains that project |
19:00:16 | FromGitter | <iffy> :) |
19:00:31 | FromGitter | <kaushalmodi> s/should/will |
19:01:45 | * | PrimHelios_ joined #nim |
19:01:56 | FromGitter | <iffy> For instance, on the issue I filed, how should I get the `file_name` string? ⏎ ⏎ 1) `table1.getOrDefault("input.file_name").getStr()` ⏎ 2) `table1["input.file_name"].getStr()` ⏎ 3) `table1.getStr("input.file_name")` [https://gitter.im/nim-lang/Nim?at=5bca2a241e23486b93e6d5ff] |
19:02:38 | FromGitter | <kaushalmodi> my project uses the old `getStringArray` which doesn't exist now |
19:02:43 | FromGitter | <iffy> :) |
19:02:55 | FromGitter | <kaushalmodi> so if I figure an alternative for that, your solutions should be on the same line |
19:03:01 | FromGitter | <iffy> k |
19:06:44 | FromGitter | <alehander42> @iffy btw nice work on the argparse lib, looks great |
19:07:09 | FromGitter | <iffy> thanks -- it was definitely a learning experience :) |
19:08:46 | FromGitter | <kaushalmodi> @iffy figured it out |
19:08:46 | FromGitter | <timotheecour> hi @araq quick question if you’re here? |
19:08:46 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca2bbe271506518d3b01cc] |
19:09:06 | FromGitter | <kaushalmodi> see how that old commented syntax converts to new |
19:09:13 | FromGitter | <kaushalmodi> it's more intuitive |
19:09:47 | FromGitter | <kaushalmodi> here's the snippet if you want to try: https://ptpb.pw/vu7d/nim |
19:09:58 | FromGitter | <kaushalmodi> I have the config.toml content in that commented block |
19:11:30 | FromGitter | <iffy> Hmm... I'm not seeing the same thing (though I'm using parseString rather than parseFile) |
19:12:06 | FromGitter | <iffy> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca2c86bbdc0b250569cfc7] |
19:12:49 | FromGitter | <iffy> but if that's the syntax that *should* work, I'll submit this PR as a start for tests |
19:13:18 | FromGitter | <iffy> I should say that the above code fails to run |
19:13:29 | * | narimiran joined #nim |
19:14:06 | FromGitter | <iffy> `type mismatch: got <TomlValueRef, string>` |
19:14:19 | FromGitter | <iffy> when trying to evaluate the `==` |
19:14:28 | FromGitter | <kaushalmodi> you shouldn't need getTable |
19:14:32 | FromGitter | <kaushalmodi> look at the types |
19:14:43 | FromGitter | <kaushalmodi> (that's why I use typetraits in my test code) |
19:15:42 | FromGitter | <iffy> it fails even using typetraits and no `getTable()` |
19:16:09 | * | NimBot joined #nim |
19:16:10 | FromGitter | <kaushalmodi> parsestring returns a string |
19:16:26 | FromGitter | <kaushalmodi> getTable needs TomlValueRef in inp (so input of string won't work) |
19:17:35 | FromGitter | <kaushalmodi> ~parsestring returns a string~ ignore that, sorry |
19:20:59 | FromGitter | <iffy> k I submitted a PR with a single failing test (fails for me). I'll check back after lunch. Thanks @kaushalmodi |
19:21:34 | FromGitter | <kaushalmodi> @iffy ok |
19:21:40 | FromGitter | <kaushalmodi> btw I found the final piece of the puzzle |
19:21:46 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca2eca6e5a401c2d9ad3ac] |
19:21:58 | FromGitter | <kaushalmodi> once you have a value of `TomlValueRef` type |
19:22:18 | FromGitter | <kaushalmodi> do `val.stringVal` to get the string val, and so on |
19:22:43 | FromGitter | <timotheecour> > btw @timotheecour I’ve started refactoring Arraymancer backend here: https://github.com/numforge/laser |
19:23:12 | FromGitter | <timotheecour> great thx @mratsim ! will comment there when i get a chance |
19:31:53 | enthus1ast | any idea why this failes with `illegalCapture` https://gist.github.com/enthus1ast/0529b06aae315b5312e737ec405ef944 ? |
19:32:08 | * | tdc quit (Ping timeout: 245 seconds) |
19:33:24 | enthus1ast | or does one has a better idea to wrap this proc? |
19:34:35 | * | tdc joined #nim |
19:46:25 | FromGitter | <rayman22201> @timotheecour are you around? |
19:46:35 | FromGitter | <rayman22201> Want to discuss some doc search stuff? |
19:46:52 | FromGitter | <timotheecour> here |
19:46:55 | FromGitter | <rayman22201> instead of killing everyones github notification dashboards lol |
19:47:22 | FromGitter | <timotheecour> what do u think of https://github.com/nim-lang/Nim/issues/9406#issuecomment-431470402 |
19:47:47 | FromGitter | <rayman22201> I think naive levenshtein edit distance is too simple |
19:47:53 | FromGitter | <timotheecour> (more efficient here to discuss, but less searchable for others… tradefoff) |
19:48:28 | FromGitter | <timotheecour> its a bit naive sure; whats a simple counter example where it fails? |
19:48:34 | narimiran | @timotheecour irclogs are searchable (if you know the date) |
19:48:44 | enthus1ast | yay got it (updated the gist) |
19:49:38 | FromGitter | <timotheecour> @narimiran what’s ur best way to search ? i tried via google and Gitter, both kinda suck, especiall gitter’s search is terrible (not even in time order); |
19:49:52 | FromGitter | <rayman22201> The index uses a format of "module name : symbol name". the current algorithm takes that into account and weights things appropriately. Giving more relevant results imo. |
19:50:01 | FromGitter | <timotheecour> github search on the contrary works as I intend it to |
19:50:09 | narimiran | https://irclogs.nim-lang.org/ + Ctrl-F :) |
19:50:46 | FromGitter | <timotheecour> right, it requires being on the right date; ie very not optimal! |
19:50:50 | FromGitter | <rayman22201> edit distance would give crap results because it would always give you a bad edit distance b/c of the module title |
19:51:03 | FromGitter | <rayman22201> or you would have to choose which side of the colon you want to search |
19:51:11 | narimiran | i would say (not that anybody asked me), discuss it here, and then if you come to some conclusions — write it on github |
19:51:15 | FromGitter | <rayman22201> the state machine I use takes that into account |
19:51:39 | FromGitter | <timotheecour> @rayman22201 quick question first: r results sorted, if so, by what? |
19:52:04 | FromGitter | <timotheecour> @ narimiran ok |
19:52:05 | FromGitter | <rayman22201> Also, the state machine allows for more precise (or arbitrary depending on your opinion), weighting of the results specific to the domain. Like I weight matches on word boundries higher. |
19:52:26 | FromGitter | <rayman22201> They are sorted by highest score as determined by the fuzzy match state machine function |
19:53:34 | FromGitter | <rayman22201> Edit distance weights all changes equally, fuzzy match allows more weight for certain edits to be weighted more or less |
19:54:04 | FromGitter | <timotheecour> @rayman22201 2nd quick question: is there an easy way to test what we have on cmd line? Ideally: we give an input file containing a bunch of queries, and it shows outputs on cmd line (bonus point: we can also specify groundtruth and it shows a precision/recall score or other metric for retrieving these) |
19:54:21 | * | anamok joined #nim |
19:54:49 | FromGitter | <rayman22201> Yes. that's how I tested it originally. I didn't include the tests in the PR because I thought they were too arbitrary |
19:55:59 | FromGitter | <rayman22201> in the fuzzymatcher.nim file I just put a small sample database and some test queries in an "ismainmodule:" block |
19:56:02 | FromGitter | <timotheecour> if not too much work, could u maybe at least put these in some repo somewhere with instructions on how to run the test? that way we can have objective measure instead of “it looks like it works better from a few queries in UI” |
19:56:53 | FromGitter | <rayman22201> It's hard to define objective here. The whole thing is subjective, but yes. I will try to set something like that up. |
19:57:22 | FromGitter | <rayman22201> I put a lot of faith in the algorithm and the fact that many people like the way sublime text works |
19:58:21 | FromGitter | <rayman22201> I think it really is going to come down to just tweaking the weights until we find something we are happy with for this particular data set (the Nim doc index) |
19:59:01 | FromGitter | <timotheecour> how complex is it (from ur estimate) to add syntax like ‘matching:exact limit:30 foobar’ ? (doens’ thave to be u to do the work though ;-) ) |
19:59:25 | FromGitter | <rayman22201> not hard. I actually still like the idea too |
19:59:51 | FromGitter | <timotheecour> Cool; I hate UI checkboxes and embrace pure text search ;-) |
20:00:21 | FromGitter | <rayman22201> I just want to balance newbie accessiblity vs. pro tweakability. Text UI is still UI |
20:00:47 | FromGitter | <rayman22201> I'm totally cool with text command options like that, as long as the default mode still works reasonably well for new users. |
20:01:09 | FromGitter | <timotheecour> but a single one; and a simple “click here for supported text syntax” is all that’s needed for pro users; newbie search will just work with sane defaults |
20:01:26 | FromGitter | <rayman22201> Yeah. I agree. that should be reasonable enough |
20:01:32 | Perkol | Is there function for determining cpu arch in Nim? |
20:02:03 | FromGitter | <timotheecour> u dont’ have any off-of-your-head idea about why “fmt” isn’t shown though, do u? |
20:02:13 | FromGitter | <rayman22201> @Perkol https://nim-lang.org/docs/system.html#hostCPU |
20:02:33 | FromGitter | <rayman22201> No. I really need to look into the "fmt" thing. It's really weird. It should show up |
20:02:50 | FromGitter | <rayman22201> I have to follow it through the js debugger, I just haven't had time |
20:03:18 | FromGitter | <rayman22201> My guess is that "fmt" has too few letters, so the score never gets high enough for any one result |
20:04:05 | * | nsf joined #nim |
20:04:33 | FromGitter | <timotheecour> i see dochack.nim but where is fuzzymatcher.nim ? |
20:04:49 | FromGitter | <timotheecour> > My guess is that "fmt" |
20:05:04 | FromGitter | <timotheecour> don’t think so, other 3 word queries work |
20:05:20 | FromGitter | <rayman22201> https://github.com/nim-lang/Nim/tree/devel/tools/dochack |
20:05:28 | FromGitter | <rayman22201> that's the source for dochack, and fuzzymatcher |
20:05:43 | FromGitter | <rayman22201> sorry, I called it "fuzzysearch.nim" |
20:05:56 | FromGitter | <timotheecour> ah ok! |
20:06:25 | FromGitter | <rayman22201> The biggest problem with this search algorithm (and I suspect edit distance would have the same problem) is that search strings that produce similar scores across many strings in the index end up just producing noise. If every score is 100, then nobody wins. |
20:07:20 | FromGitter | <rayman22201> not all 3 word queries have this problem. I think it's just those particular 3 letters vs. the search space. |
20:07:34 | FromGitter | <rayman22201> could be something else though. I have to look closer |
20:08:21 | FromGitter | <timotheecour> yaya. this is really a NLP problem; I’d really like to experiment with it but on cmd line, not in web UI; u said there’s a isMainModule in https://github.com/nim-lang/Nim/blob/devel/tools/dochack/fuzzysearch.nim but where? |
20:09:50 | FromGitter | <rayman22201> There was but I deleted it |
20:10:07 | FromGitter | <rayman22201> easy enough to add back in though. |
20:11:20 | FromGitter | <rayman22201> the api is this: https://github.com/nim-lang/Nim/blob/devel/tools/dochack/fuzzysearch.nim#L35 |
20:12:05 | * | PrimHelios_ quit (Ping timeout: 244 seconds) |
20:12:18 | * | narimiran quit (Ping timeout: 252 seconds) |
20:12:28 | FromGitter | <timotheecour> perfect; any quick easy way to access the index ? |
20:13:03 | FromGitter | <timotheecour> (u said it looks like "module name : symbol name”) |
20:13:43 | FromGitter | <rayman22201> It's a terrible js hack that reads https://nim-lang.org/docs/theindex.html |
20:14:05 | * | Trustable quit (Remote host closed the connection) |
20:14:07 | FromGitter | <rayman22201> https://github.com/nim-lang/Nim/blob/devel/tools/dochack/dochack.nim#L246 |
20:14:23 | FromGitter | <rayman22201> that is the part that makes it difficult to test on the command line |
20:15:02 | FromGitter | <rayman22201> Just looking at the theindex.html you can get an idea of the format though |
20:15:16 | FromGitter | <timotheecour> gotcha; looks like we could move some of that JS logic to a proper api (and make DOM stuff as minimal as possible) |
20:15:42 | FromGitter | <rayman22201> Another project I discussed briefly with Araq was generating a better index file more suited for the search specificially |
20:15:53 | FromGitter | <rayman22201> a proper search database |
20:16:14 | FromGitter | <timotheecour> right, searching inside comments would make sense; also, storing in json would be a start |
20:16:32 | FromGitter | <rayman22201> I'm not so sure I'm sold on searching inside comments |
20:16:41 | FromGitter | <rayman22201> but json definitely |
20:16:53 | FromGitter | <timotheecour> it only makes sense if we add ‘in:comment foobar’ otherwise too much noise |
20:17:06 | FromGitter | <rayman22201> that index file is generated from the idx files from rst generation |
20:17:06 | * | Perkol quit (Remote host closed the connection) |
20:17:26 | FromGitter | <rayman22201> which I think is still the right thing to do |
20:17:33 | FromGitter | <timotheecour> right, doesn’t look too hard to modify it to also generate json |
20:17:38 | FromGitter | <rayman22201> correct |
20:19:23 | FromGitter | <rayman22201> That would make the duplicate results problem go away, and also might make the fuzzy match simpler because the "module : symbol" issue could be stored in a more structured way, instead of trying to work around the current format. |
20:19:48 | FromGitter | <rayman22201> though I do like that both parts are taken into account |
20:21:21 | FromGitter | <iffy> @kaushalmodi awesome, thank you! And I see that you updated the README |
20:21:32 | FromGitter | <timotheecour> ya index.html is a hack :) looking at it now, 1st step shd be convert index.html to import a json file |
20:22:22 | FromGitter | <rayman22201> there is a reason it's called dochack.js :-P |
20:23:49 | FromGitter | <timotheecour> Btw, definitely search by param would be nice too (but again a prerequisite is the 'param:foo’ extensible syntax) |
20:25:09 | FromGitter | <rayman22201> I always knew it was a big refactor to fix it "properly" - that was never my goal. I just thought the original regex was too simple and really frustrated me when I first found Nim. I wanted to make something just slightly more usable for me, until a proper solution (like a much less buggy nimsuggest matured). |
20:25:36 | FromGitter | <rayman22201> It was always a stopgap solution |
20:28:01 | FromGitter | <rayman22201> param search also requires either parsing the index text or getting the AST data, which the rst generator does not currently have access to. |
20:28:33 | FromGitter | <timotheecour> how about following plan: ⏎ ⏎ 1) make code that exports index.html also export indexdata.json (we can integrate the 2 later so that later index.html reads indexdata.json) ⏎ 2) add a test file (or in a separate nimble project which allows faster iteration) a cmd line docsearch utility ⏎ 3) add a file that contains queries and groundtruth ... [https://gitter.im/nim-lang/Nim?at=5bca3e713844923661674718] |
20:29:20 | * | flaviu quit (Read error: Connection reset by peer) |
20:29:55 | * | flaviu joined #nim |
20:31:29 | FromGitter | <timotheecour> 1) cmd line docsearch in that separate nimble repo (that we can integrate later in javascript code in dochack) |
20:31:59 | FromGitter | <timotheecour> (last 1 shd be 5, silly gitter!) |
20:34:19 | FromGitter | <rayman22201> I like everything except making it a separate repo. |
20:35:04 | FromGitter | <timotheecour> could be a temporary thing for speed of iteration; and could be integrated once something works better than what we have. |
20:36:00 | FromGitter | <rayman22201> Or we just keep working on a fork and submit a better PR. Nim accepts PR's fairly liberally |
20:36:08 | FromGitter | <rayman22201> for now anyway |
20:36:16 | FromGitter | <rayman22201> (Pre 1.0 joys) |
20:37:50 | FromGitter | <rayman22201> dochack is fairly embedded in the compiler tools also. I don't know a good way to separate out just that piece without causing integration problems later. (keep in mind Araq doesn't love nimble, and core Nim doesn't really use it.) |
20:38:44 | FromGitter | <rayman22201> fuzzysearch.nim is very orthogonal and self contained, so it wouldn't be terrible, but still, meh... |
20:39:51 | FromGitter | <timotheecour> Sure, separate fork works too |
20:39:54 | FromGitter | <rayman22201> I'm on board with everything else though |
20:40:32 | FromGitter | <rayman22201> 👍 |
20:41:38 | FromGitter | <timotheecour> Cool :) btw: just found this old super relevant issue i had posted in july: https://github.com/nim-lang/Nim/issues/8495 |
20:42:07 | FromGitter | <rayman22201> lol. yes |
20:42:51 | FromGitter | <rayman22201> The sad thing is that what I think we all want is a better nimsuggest. We can dream! one day! |
20:44:31 | FromGitter | <alehander42> I really can't imagine who will type the whole `matching:exact limit:30 foobar` |
20:45:16 | FromGitter | <alehander42> i think people either need shortcuts for this (e.g. ! l:30 foobar) or they'll just scroll manually |
20:45:19 | FromGitter | <alehander42> but maybe it's just me |
20:45:20 | FromGitter | <timotheecour> u type it just once; next time u just edit the last part |
20:45:22 | * | kapil____ quit (Quit: Connection closed for inactivity) |
20:45:55 | FromGitter | <alehander42> ok, then i close the page |
20:45:59 | FromGitter | <timotheecour> (and allow UI keeps to keep ur old query) |
20:45:59 | FromGitter | <alehander42> and after 5 mins i come back |
20:46:28 | FromGitter | <alehander42> i think sublime got it right with their search options ui |
20:46:32 | FromGitter | <alehander42> very intuitive |
20:46:42 | FromGitter | <timotheecour> there are ways to solve this (eg: recall past cmds using arow up); also github issue works well. |
20:47:27 | FromGitter | <alehander42> i don't like github issues search, it's actually horrific |
20:47:27 | FromGitter | <timotheecour> (as does google’s search, eg: file:pdf bar) |
20:47:35 | FromGitter | <kaushalmodi> @iffy http://nimparsers.github.io/parsetoml/ |
20:47:36 | FromGitter | <alehander42> if i search my name , I see one list of issues |
20:47:41 | FromGitter | <alehander42> if I search author:myname |
20:47:47 | FromGitter | <alehander42> I see completely different list of issues |
20:48:16 | FromGitter | <kaushalmodi> @iffy I didn't plan at all to do anything with parsetoml today |
20:48:23 | FromGitter | <alehander42> that's an overreaction, but they could really combine them or at least offer <stuff>:name suggestions |
20:48:23 | FromGitter | <kaushalmodi> but you made me go down that rabbithole :P |
20:48:38 | FromGitter | <iffy> you're welcome :) |
20:48:50 | FromGitter | <iffy> and thank you :) |
20:49:30 | FromGitter | <alehander42> anyway good work |
20:50:07 | FromGitter | <timotheecour> @alehander42 maybe u mean 'https://github.com/pulls?utf8=%E2%9C%93&q=involves%3Aalehander42+' |
20:50:47 | FromGitter | <timotheecour> i like precision; author:foo != involves:foo != foo |
20:51:00 | FromGitter | <rayman22201> @alehander42 it's been a long time since I used sublime, what does their search options ui look like? |
20:52:36 | * | flaviu quit (Ping timeout: 260 seconds) |
20:55:31 | * | flaviu joined #nim |
20:56:12 | FromGitter | <iffy> I'm getting `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` when I run `nim doc` on a file that contains exported modules. Is that expected? |
20:57:11 | FromGitter | <timotheecour> make sure u have latest devel then search in open issues for this error, otherwise please file a bug :) |
20:58:31 | FromGitter | <iffy> will do |
21:00:21 | * | flaviu quit (Ping timeout: 252 seconds) |
21:00:55 | * | flaviu joined #nim |
21:15:43 | FromGitter | <alehander42> @timotheecour I can't imagine why an issue I created shouldn't come up when I search my name |
21:17:05 | FromGitter | <alehander42> @rayman22201 they just had several small icons for regexp / case / whole and several others |
21:17:19 | FromGitter | <alehander42> but it's different there indeed |
21:17:37 | FromGitter | <alehander42> because I usually turn on regex & case sensitive |
21:17:44 | FromGitter | <alehander42> and don't touch it for months |
21:18:10 | * | xet7 quit (Remote host closed the connection) |
21:18:31 | FromGitter | <alehander42> so with text modifiers i'd see `regex:on case:on ...` all the time which would take input space |
21:18:55 | FromGitter | <alehander42> but on the other hand it seems to work for github issues, so it's subjectiv |
21:22:43 | FromGitter | <rayman22201> I see. Yeah. it's very subjective. |
21:23:47 | * | vlad1777d joined #nim |
21:43:05 | * | tdc quit (Ping timeout: 268 seconds) |
22:02:30 | * | endragor joined #nim |
22:06:43 | * | endragor quit (Ping timeout: 245 seconds) |
22:18:33 | * | nsf quit (Quit: WeeChat 2.2) |
22:24:41 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:33:07 | * | elrood quit (Quit: Leaving) |
22:46:07 | * | endragor joined #nim |
22:50:48 | * | endragor quit (Ping timeout: 272 seconds) |
22:51:59 | anamok | This morning we talked about that "nimble test" doesn't do a cleanup after itself and leaves binaries in the tests/ folder. |
22:52:18 | * | adeohluwa joined #nim |
22:53:46 | anamok | I sent a PR to solve this problem and it was merged. This is my very first contribution to Nim :) |
22:55:36 | FromGitter | <kaushalmodi> anamok: 👍 |
22:59:32 | dom96 | :D |
22:59:52 | dom96 | Beautifully done. Hope it gets you that hacktoberfest T-shirt ;) |
23:02:06 | anamok | dom96: Thanks :) I'm really happy that I could add something. |
23:03:38 | anamok | Nim is really fun. I felt the same when I was learning Python a long time ago. |
23:13:59 | FromGitter | <yyyc514> hmmmm |
23:14:06 | FromGitter | <yyyc514> nim is indeed fun |
23:14:30 | FromGitter | <yyyc514> wish i undertstood templates more |
23:17:02 | dom96 | What do you not understand about them? :) |
23:18:11 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/77c451910689d98de123f563a4938f17 |
23:18:15 | FromGitter | <yyyc514> how do i make this wokr |
23:19:01 | FromGitter | <yyyc514> i don’t understand the substitutions, sometimes they seem like raw text but if it was just copying in raw text then i’d think this would work |
23:27:16 | dom96 | try writing `var request {.inject.} = request` inside your proc |
23:27:25 | dom96 | (at the top of it) |
23:28:00 | dom96 | but yeah, the scoping is quite subtle |
23:28:02 | FromGitter | <yyyc514> is that making a copy of request though? |
23:28:06 | FromGitter | <yyyc514> that helps |
23:28:59 | FromGitter | <yyyc514> it’s because of how it mangles the names |
23:30:07 | * | wildlander joined #nim |
23:34:24 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
23:37:20 | FromGitter | <yyyc514> ok i’m losing a lot of time in the transition |
23:38:41 | FromGitter | <yyyc514> (https://files.gitter.im/nim-lang/Nim/tNKe/Screen-Shot-2018-10-19-at-7.38.28-PM.png) |
23:38:42 | FromGitter | <yyyc514> fun to see it actually working though :) |
23:40:38 | FromGitter | <yyyc514> xruntime is from the runtime middleware and the last number is th `us` count from the outermost pieces in jester that i found to bench (initRequest and statusContent) |
23:47:08 | FromGitter | <yyyc514> hmmm so the minimum overhead seems to be 15us just for an empty jester proc |
23:50:35 | FromGitter | <yyyc514> ha and now i can’t bench beast cause it won’t close the connection lol |
23:51:30 | FromGitter | <yyyc514> trying `wrk` |
23:55:48 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/840b30bdc4341df8e67ef86ab02e909f |
23:55:56 | * | PMunch quit (Remote host closed the connection) |
23:55:57 | FromGitter | <yyyc514> different in output bandwidth is interesting |