<< 19-10-2018 >>

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:21FromGitter<yyyc514> do templates work with overloading differently?
01:15:44FromGitter<yyyc514> https://gist.github.com/yyyc514/6478367a491c8d7923faad0151683c94
01:15:57FromGitter<yyyc514> surely some way to escape templates to prevent substitution
01:21:19FromGitter<rayman22201> {.dirty.} I think? https://nim-lang.org/docs/manual.html#templates-hygiene-in-templates
01:25:06*darithorn joined #nim
01:26:05FromGitter<yyyc514> how would that help?
01:26:25FromGitter<yyyc514> i don’t think named argument work like i want them to anyways
01:27:05FromGitter<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:52FromGitter<yyyc514> dirty has no effect
01:28:00FromGitter<yyyc514> body SHOULD be replaced, but only the right hand side
01:28:13FromGitter<yyyc514> the left hand side is an object with a field named “body"
01:28:14FromGitter<rayman22201> well specifically, `resp` is the thing that's actually not being affected.
01:28:18FromGitter<yyyc514> i want some way to escape it
01:29:57FromGitter<yyyc514> like resp.`body` = body
01:30:01FromGitter<yyyc514> but that’s not supported
01:30:34FromGitter<rayman22201> does it work if you change the name of body to something else?
01:30:50FromGitter<yyyc514> it would but i want to use named arguments
01:30:55FromGitter<yyyc514> and the name of the argument is “body"
01:31:32FromGitter<rayman22201> that's what I'm saying. Does it work if you change the argument name from "body" to "foo"
01:32:02FromGitter<yyyc514> yes
01:32:07FromGitter<yyyc514> but then i’d break the API i want
01:32:13FromGitter<yyyc514> render(body=…) is the API
01:32:29FromGitter<yyyc514> but named arguments don’t figure into overloading so that might all go out the window anyways
01:34:24FromGitter<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:40FromGitter<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:45FromGitter<yyyc514> i do’nt think it’s a bug, but it’s annoying
01:36:33FromGitter<yyyc514> any good articles on designing an API in nim?
01:37:21FromGitter<rayman22201> I'm not sure. That smells like it might be a bug. but idk
01:38:00FromGitter<yyyc514> https://github.com/nim-lang/Nim/issues/8899 i commented here
01:38:41FromGitter<rayman22201> Not really, unfortunately. Most people point to karax as the best example of idiomatic Nim api.
01:38:52FromGitter<rayman22201> #smallcommunityproblems
01:40:06FromGitter<yyyc514> i’m coming from Ruby where so many things are hash based opts
01:40:10FromGitter<rayman22201> good 'ol Araq. The champion of KISS lol
01:40:41FromGitter<yyyc514> `render body: ...`, `render raw: …`, `render html: …`, etc.
01:40:48FromGitter<rayman22201> well... Ruby also has a lot of perf issues because of that kind of dynamic features
01:41:00FromGitter<yyyc514> issues is a strong word ;-)
01:41:24FromGitter<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:34FromGitter<yyyc514> renderHTML renderRaw renderJSON etc
01:42:40FromGitter<rayman22201> You are on the right track with using templates and macros. That is idiomatic Nim. Nim is very pro DSL
01:50:50FromGitter<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:46FromGitter<alehander42> wow @yyyc514 I almost remembed your nick, thought it's @yyyc514
10:25:12FromGitter<alehander42> well something which I do is just to use a macro instead
10:29:08FromGitter<alehander42> ```macro render*(body: untyped): untyped = ⏎ result = quote: ⏎ resp.body = `body```` [https://gitter.im/nim-lang/Nim?at=5bc9b1f41c100a4f29adc5f9]
10:29:20FromGitter<alehander42> it's one line more, but it fixes those issues
10:30:23*kapil____ quit (Quit: Connection closed for inactivity)
10:32:09FromGitter<alehander42> ah @rayman22201 already did the same, sorry
10:32:52FromGitter<alehander42> if you want Nim API-s, just take a look at the existing libs
10:33:04FromGitter<alehander42> e.g. of the top of my head, jester's routes
10:33:30FromGitter<alehander42> Araq's ormin ORM https://github.com/Araq/ormin/blob/master/examples/forum/forum.nim
10:34:24FromGitter<alehander42> zah's chronicles logger https://github.com/status-im/nim-chronicles (a good example of key-value handling)
10:35:34FromGitter<alehander42> @mratsim 's https://github.com/numforge/loop-fusion
10:36:25FromGitter<alehander42> @andreaferretti 's https://github.com/andreaferretti/rosencrantz
10:37:36FromGitter<alehander42> @zacharycarter 's https://github.com/zacharycarter/litz/blob/master/tests/test_hello_world.nim hyperhtml inspired one
10:38:48FromGitter<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:10FromGitter<alehander42> but you'll find out that most of them define their custom DSL closely tied to the problem domain
10:39:32FromGitter<alehander42> and they are pretty different from each other
10:41:15*elrood joined #nim
10:41:59FromGitter<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:04Summertimethe standard library is pretty good, and the commandeer package is too, some parts were a bit hard to find though
11:01:11Summertimebut 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:43FromGitter<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:24anamokhi
11:11:23anamok"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:47FromGitter<xmonader> @anamok you can define another task in ur nimble file to do the cleaning
11:14:03anamokok, but "nimble test" shouldn't leave a mess :)
11:16:10FromGitter<xmonader> @anamok I understand not sure how other ppl solve it
11:21:20*sagax quit (Remote host closed the connection)
11:32:55anamokI solved it this way: collect every file in tests/ and take away from it *.nim* . What remains can be deleted.
11:33:53anamokA better way would be to check if a file is binary or not.
11:37:49AraqI just use an OS with an .exe extension instead :P
11:38:03Araq(obligatory trolling...)
11:38:27FromGitter<xmonader> @Araq i just read spawn isn't meant to work with channels in a comment of yours
11:38:54FromGitter<xmonader> and that was 3 years ago, what is the status of that?
11:39:49FromGitter<alehander42> the one thing I don't understand is how people like Araq managed to stay calm for the windows forced autoupdates
11:39:59FromGitter<alehander42> I almost threw my laptop from the 8th floor
11:40:11FromGitter<alehander42> once
11:40:22Araq"forced autoupdates"? dunno, never noticed it
11:40:34FromGitter<alehander42> a lucky man
11:40:45AraqI noticed and hate them for my PS4...
11:41:32federico3anamok: executables are flagged as such. Just do: find tests -type f -executable -delete
11:41:59Araqxmonader: it's still crap but soon destructors will come to rescue us
11:42:23Araqfederico3, cool, does that also remove my handwritten scripts with the exec bit?
11:42:48federico3anamok: still, various tools like koch and nim doc have the bad habit of not tracking which files they are creating
11:43:41federico3so you cannot tell if they are overwriting files you created manually of if you are deleting files not created by them
11:43:46Araqbad habit? which compiler does track its files? what does that even mean..
11:43:49FromGitter<xmonader> @Araq i shouldn't use it in production then :(
11:44:17Araqxmonader: stay away from 'spawn' in production, channels are fine with threads
11:45:14federico3Araq: 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:44Araqnim doc supports an output directory
11:46:09federico3but it's not the default behavior
11:46:27PMunchfind . -type f -exec file {} \; | grep ELF
11:47:12federico3PMunch: you are still deleting binaries that have not been created as part of the test run
11:47:44Araqfederico3, most compilers I've used dumped .o/.obj files next the source code...
11:48:19federico3Araq: it's not a compiler problem, the compiler is fine. It's the tooling around it.
11:49:30AraqIMO 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:13Araqif p/foo.nimble exists we are allowed to create p/html and p/bin, that would help
11:50:49PMunchfederico3, well yes, there's no good way to know what files were created by a specific action
11:50:51federico3e.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:57PMunchCould take a snapshot before and after but eh.
11:51:38PMunchBut my solution at least won't remove bash scripts
11:51:52federico3PMunch: a filesystem snapshot? a bit heavy handed :)
11:52:30PMunchNah, just a find before and after :P
11:52:45PMunchCould of course also try to figure it out based on time-stamps
11:53:06*Ven`` joined #nim
11:53:20federico3PMunch: is this for test runs or nim doc or other tools?
11:53:25*hoijui joined #nim
11:54:30PMunchI don't know. It's anamok who asked for how to do this .P
11:54:38PMunchBut I think it was just for a test run
11:57:24anamokfederico3: 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:20anamoktest run only (at the moment)
11:58:38federico3anamok: same problem: what if the .exe is not part of the test run?
11:59:14anamokMust be gone. What is it doing in the tests/ folder? ;)
11:59:55federico3I have various examples of ancilliary tools that sit there
12:00:25federico3for the record, find . -type f ! -name "*.*" -executable filters out only executables without extension
12:01:06Araqgood to know
12:01:27anamokThen 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:45Araqanamok, sounds reasonable
12:02:00PMunchWhy not just add -o when compiling and putting them in a bin folder?
12:02:06PMunchOr am I missing something obvious here?
12:02:29anamokI didn't know about the "-o" ...
12:03:25krux02general question, what do you think about an issue template
12:04:10krux02other github repositories already have it and use it, in Nim issues can be arbitrarily shaped.
12:04:32FromGitter<alehander42> i think people discussed it when the rfcs discussion happened
12:04:53anamokPMunch, "nimble test" ignores "-o bin"
12:05:40FromGitter<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:43PMunchkrux02, problem is if it just becomes silly strict
12:06:51PMunchAdding too much stuff that's seldom used
12:07:16PMunchanamok, fix it and PR nimble :)
12:07:37FromGitter<alehander42> well one can always erase the prepopulated issue markdown and write a simple one-line issue
12:07:38FromGitter<alehander42> right?
12:09:33federico3PMunch: 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:47Araqnimcache is Nim's scratch directory
12:12:05Araqproblem is though that binaries and HTML docs are not just for deletion
12:12:26Araqsome people like to distribute or at least use these
12:13:17federico3yes, and it should be local to the project
12:16:54FromGitter<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:41FromGitter<kaushalmodi> anamok: just create your own "tests" task in config.cfg
12:32:10FromGitter<kaushalmodi> I am seeing that I can easily get away with "nimble foo" tasks except for "nimble install"
12:32:39FromGitter<kaushalmodi> s/config.cfg/config.nims
12:34:04FromGitter<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:06krux02PMunch: I agree
12:53:20krux02this is my first draft: http://ix.io/1pxM
12:53:39krux02The idea is just to get a general ordering of information
12:53:47krux02and 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:51krux02@all: that is the issue template above, please comment on it, and say if you don't like it.
12:55:29krux02if you can phrase what you don't like about it, that would be welcome as well.
12:56:05Araqkrux02, I like it
12:56:32krux02cool
12:59:05krux02alehander42: 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:41FromGitter<alehander42> the title is usually above the issue
13:07:04FromGitter<alehander42> maybe it should be
13:07:22FromGitter<alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc9d70a435c2a518ed0312f]
13:08:16krux02alehander42: the idea is to rething about the title after the summary has been written.
13:09:17FromGitter<alehander42> I think the examples can be called Example/Steps to reproduce
13:09:44FromGitter<alehander42> because people might forget to add context (e.g. additional setup needed sometimes)
13:10:42krux02well it is not about what might happen, it is more about what currently happens.
13:11:54krux02I don't want a template that covers every possible case, I would rather have an incomplete template that triggers creativity.
13:13:18krux02the issue template is implemented now
13:13:36krux02I am excited for the next issue :P
13:14:31FromGitter<narimiran> @krux02 i wanted to implement it, but didn't have much time these days
13:14:40FromGitter<narimiran> (issue template)
13:14:56krux02well you can create an issue now and see if you like it.
13:15:23*anamok joined #nim
13:15:34FromGitter<narimiran> did you use github's templates as a starting point?
13:16:08krux02I used one from somewhere, yes
13:16:11FromGitter<narimiran> is it possible to to show an example of nim code block in the template?
13:16:27krux02yes it is
13:16:43krux02the template has the same syntax as the issue markdown
13:16:49krux02it is just markdown
13:17:04krux02or better said github favored markdown
13:17:06FromGitter<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:10krux02flavored
13:17:50krux02narimiran[m], that is a good point, but not all isseues are source code related
13:18:01krux02they can be documentaten related
13:18:45FromGitter<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:15krux02well it is an issue tracker for a programming language
13:20:21krux02I 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:47FromGitter<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:16FromGitter<narimiran> there should be: "current output", and "expected output" as two separate fields
13:22:45FromGitter<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:56FromGitter<narimiran> let's make our future lives easier!
13:23:22krux02well 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:49FromGitter<kaushalmodi> "there should be: "current output", and "expected output" as two separate fields" +1
13:25:19krux02haushalmodi: when you nest quotes, you should use single quotes as inner quotes ;)
13:25:23krux02but yes it's noted
13:25:27krux02good point
13:25:47FromGitter<alehander42> I also agree
13:26:45krux02ok, 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:45FromGitter<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:24krux02I can also fill the template with some nonsese issue
13:34:52krux02here is an example: http://ix.io/1pxV
13:35:35FromGitter<narimiran> nitpicking, but i would switch the order of current and expected output.
13:36:05FromGitter<narimiran> and use single backticks for inline code in markdown ;)
13:36:37krux02well I am used to double backticks, because I think rst requires them
13:37:27krux02this basically sums up all relevant markdown
13:37:29krux02code listing
13:37:38krux02identifiers in full text
13:37:46krux02output
13:38:27FromGitter<narimiran> here is my version: http://ix.io/1pxX
13:39:01FromGitter<narimiran> giving it a bit of breathing room to easier see where is what
13:39:40FromGitter<narimiran> and changed "could" to "should"
13:41:25krux02I am ok with the spacing
13:41:48*vlad1777d quit (Ping timeout: 252 seconds)
13:41:48FromGitter<narimiran> oh, and make that `## Possible Solution`, without the rest
13:42:12FromGitter<narimiran> i am not ;)
13:43:36krux02Well I don't want to restrict the issues template too much to just bugs
13:44:32FromGitter<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:07FromGitter<kaushalmodi> krux02: mention in the HTML comment to fill sections as applicable
13:45:09FromGitter<narimiran> @kaushalmodi or just use single ticks for your (outside) quotes, so you can just copy-paste ;)
13:45:27krux02this is how you officially nest quotes: "krux02: 'when you nest quotes'"
13:45:37krux02this has nothing to do with computers at all
13:45:54*elrood quit (Quit: Leaving)
13:45:56FromGitter<narimiran> officially you use “ and ”, and ‘ and ’ ;)
13:46:04krux02yes
13:46:10FromGitter<kaushalmodi> krux02: but what if those have verbatim single quotes
13:46:10krux02just wanted to say that
13:46:42FromGitter<narimiran> and that's not universally true, some languages (e.g. croatian) officially have starting quotes on the bottom side
13:46:46FromGitter<kaushalmodi> *I know we are just trolling*
13:46:59krux02well, normally when you quote people, they don't speak in verbatim single quotes
13:47:08FromGitter<narimiran> and some languages have « and », and some have in the reverse order: » and «
13:47:22krux02or german has „“
13:47:32krux02„double“‚single‘
13:48:01FromGitter<narimiran> ok, it's time for me to go home, too much grammar nazis here :D :P
13:48:12krux02quoting is difficult
13:49:17krux02I decided to keep the template as simple as it was before, without the output fields
13:49:27krux02I like them, but only for bug reports
13:49:49krux02there should be a template selection mechanism
13:50:18anamokI 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:45krux02hmm 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:34krux02anamok: nim doesn't know anything about your git structure, so it shouldn't matter if the subdirectories are submodules or not
13:56:49krux02doesn't nim build the doc for the subdirectories?
13:57:53anamokI tried `nim doc src/*.nim`, thus it didn't go in the subdurectories. `nim doc src/` gives an error.
14:00:09krux02``nim doc src/**.nim`` does go into subdirectories if your shell is ``fish``
14:01:11krux02``nim doc $(find src -iname '*.nim')`` should work recursively
14:01:55anamokI have bash. And I would also do it under Windows sometime.
14:02:34krux02try if that command line above works with find
14:02:38leorize`find src -name '*.nim' -exec nim doc '{}' +`
14:02:55leorize^ that one is the more "standard" way of using find
14:02:57krux02or that
14:03:59*hoijui joined #nim
14:04:31anamokOK, it worked, thanks
14:04:38krux02leorize, my "standard" way of using find is ``find . | grep '\.nim'
14:04:47FromDiscord<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:04leorizekrux02: that's the unix way :)
14:05:07anamokleorize: the `+` should be `\;`, no?
14:05:30leorize`+` concat the entire file list
14:05:37leorize`\;` pass them one by one
14:05:45leorizeI don't know if nim doc support multiple so...
14:05:57anamokno, + gave an error
14:06:23krux02hotdog: why don't you read that file at runtime?
14:06:55krux02normally if you put that thing in a const it should work at runtime, too
14:07:04anamokCan we tell `nim doc` to produce the output to a destination folder?
14:07:26anamokI tried `-o dest/`
14:08:49anamokAnd 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:31anamokOr what is the preferred way to create the docs for a library that is split up to several modules?
14:09:38FromDiscord<hotdog> @krux02 I am preprocessing/bundling files to be used in JS
14:09:45FromDiscord<hotdog> So can't read from disk at runtime
14:09:54krux02ok
14:10:37krux02as I said, put it into a const, that should work.
14:11:02FromDiscord<hotdog> Yeah that's true. I probably need to use a compileTime proc instead of a static block
14:11:33krux02const value = (block: ...
14:12:49FromDiscord<hotdog> It worked 👍 Thanks @krux02
14:13:14krux02you are welcome
14:13:40FromDiscord<hotdog> Out of curiosity, how could I modify this at runtime? Without copying to a var seq
14:13:52krux02no
14:14:09krux02well there is always a way
14:14:09FromDiscord<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:15FromDiscord<hotdog> If that makes sense
14:14:36krux02yea I understand
14:14:47krux02but no not an intended use of const
14:14:54FromDiscord<hotdog> Yeah
14:15:45FromDiscord<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:09FromDiscord<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:01narimirankrux02: re "there should be a template selection mechanism", i thought there is
14:29:42narimiranwhen 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:43krux02narimiran: I guess I have to take a look at it.
14:31:10krux02narimiran, the question is, how do you select a template when you create an issue?
14:31:11narimirani'm looking at it right now, i'll start with your template and see where that takes us
14:34:27krux02narimiran: can you make a PR? hopefully in a way that I can test the templates on your fork of Nim.
14:35:31narimiranthere's a "feature request" template. krux02, let's make that one too
14:36:14krux02great idea
14:36:30narimiranthis is its default: http://ix.io/1py5
14:38:00FromGitter<kaushalmodi> narimiran: make the descriptions/instructions HTML comments
14:38:10narimiran@kaushalmodi: will do
14:38:13FromGitter<kaushalmodi> that way people can choose to leave them as is, and they won't show up
14:38:20FromGitter<kaushalmodi> in the submitted issue
14:38:23narimirananything in particular we should add/modify?
14:39:10federico3narimiran: it should be more clear and concise
14:39:11FromGitter<kaushalmodi> request -> requested
14:39:23FromGitter<kaushalmodi> narimiran: ^ in that template
14:39:44narimiranfederico3: can you be more specific, please?
14:39:44FromGitter<kaushalmodi> well. the second instance of "request" :)
14:39:59FromGitter<mratsim> @anamok, use a `build/` folder and tell nimble test to put files in there
14:40:09FromGitter<kaushalmodi> narimiran: I think he is referring to the repetition
14:40:25FromGitter<pr-yemibedu> good morning everyone.
14:40:41FromGitter<mratsim> for example @anamok: https://github.com/status-im/nim-stint/blob/master/stint.nimble#L12-L17
14:40:43FromGitter<pr-yemibedu> I was working on code and setting up tooling in vscode.
14:41:08FromGitter<pr-yemibedu> i have things for debugging with gdb and profiling with nimprof.
14:41:33federico3narimiran: I was joking a bit but honestly the template is very repetitive
14:41:55narimiranfederico3: i'll delete non-bold text
14:42:08narimiran...and make the bold text to be a comment
14:42:30FromGitter<mratsim> to many describe :/
14:42:33FromGitter<mratsim> too*
14:42:41FromGitter<mratsim> and clear and concise
14:42:43FromGitter<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:21FromGitter<mratsim> you just need —debugger:native
14:43:32FromGitter<pr-yemibedu> i wanted something like if the ``` when compiledOption("stackTrace"):
14:43:49FromGitter<mratsim> you can use that
14:45:15narimiranmy quick version: http://ix.io/1py7
14:45:48FromGitter<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:45anamokmratsim: thanks. Any way to generate a main html file for grouping the individual .html files?
14:48:05FromGitter<kaushalmodi> anamok: See `nim buildIndex` .. though I haven't yet found a recipe to create one nicely for a multi-module project
14:48:31FromGitter<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:19narimiranif 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:07anamokkaushalmodi: thanks, useful stuff
14:52:47narimirandone, you can now choose the two templates or open a regular issue
14:54:34narimiraninb4 somebody yells that he doesn't like the new folder github created
14:55:10*couven92 quit (Quit: Client disconnecting)
14:55:32FromGitter<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:46anamokmratsim: thanks
15:12:01FromGitter<pr-yemibedu> i figured it out
15:12:16FromGitter<mratsim> I’m still not that happy about the doc generation but it’s passable
15:12:19FromGitter<pr-yemibedu> i used ```when defined(profiler) or defined(memProfiler):```
15:12:37FromGitter<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:14FromGitter<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:57FromGitter<mratsim> I don’t think so be void has some edge cases
15:19:20*Perkol joined #nim
15:19:26FromGitter<mratsim> like this one which is super annoying: https://github.com/nim-lang/Nim/issues/7397
15:19:31FromGitter<tim-st> ok, thanks, because it's the same like `a(); return`
15:20:55Perkolhttps://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:17FromGitter<tim-st> @mratsim I didnt explicitly wrote the return type void; I assume `proc a() = discard` has return type void?
15:23:59FromGitter<tim-st> yes, no difference
15:24:13*seni joined #nim
15:24:48FromGitter<tim-st> maybe @Araq knows if the language def should allow this
15:25:46FromGitter<tim-st> (it's a python style, there for both None is returned)
15:25:53FromGitter<alehander42> @Perkol i am almost sure you meant something else
15:26:07FromGitter<alehander42> because "/C" & "vs.." == "/Cvsadmin.."
15:30:32*darithorn joined #nim
15:36:26*nsf quit (Quit: WeeChat 2.2)
15:39:29PerkolRewrote, still same error
15:39:47FromGitter<mratsim> is there a way to test if something is a var type? `when foo is var` doesn’t work
15:43:07FromGitter<tim-st> maybe you can try to take the `addr` and when not compiles it's not var? but not sure
15:43:13FromGitter<alehander42> Perkol, echo the expression you're passing to make sure its correct
15:43:15FromGitter<alehander42> and also try execShellCmd
15:46:09PerkolTried both, still same stuff
15:47:21anamokI 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:03anamokWhen I run "nim buildIndex" on these htmldocs folders, I get two separate theindex.html files.
15:48:08FromGitter<tim-st> @mratsim `template isVar(x): bool = compiles(addr(x))`
15:48:42anamokI would like just one theindex.html for my whole library.
15:49:21anamokIf I copy the *.idx files in the same dir. and generate theindex.html from them, then the links are broken.
15:49:35FromGitter<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:50FromGitter<alehander42> sorry Perkol, not on windows, cant try it, but it should work in principle
15:49:59FromGitter<mratsim> @tim-st such a hack :/
15:50:48FromGitter<tim-st> maybe with macros there is a better way, but I have to learn macros :\
15:51:38FromGitter<mratsim> yeah in a typed macro you can just check if foo.getTypeInst.kind == nnkVarTy
15:51:43anamokHowever, 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:19FromGitter<mratsim> but I’m trying not to add 50 lines of typed macros, untyped macros are just plain easier
15:52:36FromGitter<mratsim> `is` is supposed to work with `var` https://nim-lang.org/docs/manual.html#generics-type-classes
15:54:34FromGitter<tim-st> yes, that's an issue then
15:54:49FromGitter<tim-st> but my hack seems to work :))
15:56:34FromGitter<mratsim> the bug report template is too verbose :/
15:57:58FromGitter<tim-st> and it misses the most important thing: "nim --version"
15:58:21narimiran@mratsim what should be removed?
15:58:32narimiran@tim-st good catch!
15:59:53*tdc quit (Ping timeout: 252 seconds)
16:03:17*enthus1ast joined #nim
16:04:01enthus1astis there already a windows service in nim?
16:05:36enthus1astif not then i start hacking one
16:05:43FromGitter<mratsim> @narimiran dunno yet. Note that `nim —version` doesn’t work with choosenim devel
16:10:01FromGitter<tim-st> https://nim-lang.org/docs/manual.html has no syntax highlighting (or colors?) in print mode
16:10:44FromGitter<tim-st> Creating a pdf in a5 format via chrome looks very good otherwise
16:11:06FromGitter<mratsim> @tim-st your template’s is SIGSEGV-ing :/
16:11:37FromGitter<tim-st> well I said it's just a guess
16:11:50FromGitter<mratsim> it as a good one though
16:11:55FromGitter<tim-st> for which code it fails?
16:12:04FromGitter<tim-st> mayabe that's also a `addr` bug in nim?
16:12:23FromGitter<mratsim> ah no, it’s because I was returning a static bool
16:12:30FromGitter<mratsim> if I change that to a simple bool it works
16:12:50FromGitter<tim-st> maybe you can change the template to a static block
16:12:58FromGitter<tim-st> dunno if it helps
16:13:09FromGitter<mratsim> it’s ok, I can use a bool anyway
16:15:13*tdc joined #nim
16:15:27FromGitter<tim-st> my idea was that the nim compiler likely does the same check for `addr` so it should work for all
16:15:36FromGitter<mratsim> it works
16:15:46FromGitter<mratsim> it’s the static bool return value that doesn’t work with templates
16:15:59FromGitter<tim-st> ok, a bug? :D
16:16:19FromGitter<mratsim> static bool return values aren’t supposed to be supported :P
16:16:41krux02what is a static bool return value supposed to mean anyway
16:16:58anamokI figured out how to create doc pages for a multi-module library.
16:17:06anamokwith theindex
16:17:24krux02anamok: cool
16:17:29FromGitter<mratsim> @krux02 it means that it’s returned at compile-time
16:18:05anamokI should write a blog post about it, I guess.
16:18:09krux02mratsim: compile time proc?
16:18:13FromGitter<tim-st> you can emulate it in a template by using a static block I think
16:18:29FromGitter<mratsim> compile-time proc only work for NimNode input and output
16:18:37krux02anamok, not sure if blog post is the best way to do it
16:18:54krux02I think it is very valuable to create documentation recursively in a project.
16:19:02FromGitter<mratsim> @krux02: see https://github.com/nim-lang/Nim/issues/8051
16:19:52krux02anamok: yes you should document it, but that is a valuable issue.
16:20:06krux02creating documentation for nested projects is too complicated
16:20:11krux02you have a solution for it
16:20:18krux02we need issues with solutions
16:21:34krux02so 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:52krux02then there is a chance that this process will be integrated into nim
16:22:01krux02e.g. nim doc --recursive
16:23:27*sagax joined #nim
16:26:43*narimiran quit (Ping timeout: 245 seconds)
16:27:26anamokkrux02, OK, will do that
16:28:43anamokI can also create a sample project on github
16:30:09FromGitter<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:57k0mpjut0rHello 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:08leorizeyou could build it at compile time since you've already do staticRead...
16:37:14FromGitter<mratsim> storing it in the binary would make for a super large code. Just ship it separately and mmap it at runtime
16:37:48FromGitter<mratsim> iirc it’s an issue with time zone data (tzdata) that @GULPF is having for the standard lib
16:39:50FromGitter<mratsim> or parse it at run time with `let foo = parseCSV(…)`, i.e. use `let` instead of const/staticRead
16:41:23k0mpjut0rI want a single portable binary, and basically what I have right now is 'const data = staticRead(...); let foo = parseCsv(...)'
16:41:39leorizeyou could parse it at compile time...
16:46:51*endragor joined #nim
16:49:00krux02k0mpjut0r, reading big data at runtime is actually a good idea
16:49:18krux02you probably want to be able to parse it quickly. Code execution at compile time is slow
16:49:28krux02at runtime it's fast
16:50:07krux02today I discussed with Araq to implement a resource compiler
16:50:20krux02this would allow to link binary data into the executable
16:50:26krux02that would be fast
16:51:11*endragor quit (Ping timeout: 250 seconds)
16:54:26FromDiscord<hotdog> Given a proc signature and a proc body in a template (both as untyped), how can I generate a proc?
16:57:35FromGitter<mratsim> you can use `dumpASTGen`: on a normal proc to see how everything cobines
16:57:38FromGitter<mratsim> combines*
16:58:45FromDiscord<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:25FromGitter<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:37FromGitter<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:13FromDiscord<hotdog> Ok thanks @mratsim! I'll make a macro
17:00:13FromGitter<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:50FromGitter<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:57FromGitter<zacharycarter> only like a year or so
17:02:10FromGitter<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:19FromGitter<zacharycarter> October 9, 2017
17:02:33*tdc quit (Ping timeout: 252 seconds)
17:02:50*elrood joined #nim
17:03:06FromGitter<mratsim> `newCall(procType = nnkProc, params = YourTypeSig, body = body)
17:03:34FromGitter<mratsim> newProc not newCall*
17:11:02FromDiscord<hotdog> So I think I currently pass the proc sig as untyped, and in the macro it is "nnkProcTy"
17:11:33FromDiscord<hotdog> newProc expects "openArray[NimNode]" as the params
17:12:32FromDiscord<hotdog> But in the macro body it is a "NimNode"
17:14:44FromDiscord<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:57FromDiscord<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:33FromDiscord<hotdog> Maybe I just need to read through existing macros, like in stdlib
17:24:27FromGitter<timotheecour> @mratsim, please file an issue. lol the nsg is weird indeed
17:26:11FromGitter<mratsim> not sure how to do a mini test file :P
17:26:42anamokkrux02, 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:08FromGitter<tim-st> should this work? `proc test(i: untyped) = echo i is string`
17:34:20FromGitter<tim-st> crashes
17:34:36FromGitter<iffy> Whenever I do `nimble build` it takes a while verifying dependencies. Is there a way to skip that step?
17:36:05FromGitter<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:22FromDiscord<hotdog> @iffy I wondered that too. I don't think there is a way
17:41:39FromGitter<iffy> @dom96 ^ is there a way? :)
17:41:53FromGitter<iffy> (to skip the dependency verifying when running `nimble build`)
17:42:46leorizeiffy: `sed 's/requires/#requires/g' proj.nimble` :)
17:42:57krux02anamok: thanks
17:43:17anamokthe issue was just sent
17:43:43leorizeiffy: or, y'know use `nim c` and forget about `nimble` :P
17:44:28FromGitter<iffy> leorize: I'm flailing about with dependencies and `nim c` doesn't work where `nimble build` does.
17:45:17krux02cool
17:46:42FromGitter<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:01shashlickiffy: check if nimble is built in debug mode
17:56:07shashlickIs much slower as a result
17:56:17shashlick0.19.0 had it that way
17:56:30FromGitter<iffy> I'm on 0.19.0 (nimble 0.9.0
17:56:36shashlickYou can recompile it by fixing koch
17:56:51shashlickOr use devel
17:57:29FromGitter<iffy> well, I'm on devel, but I don't think I've reinstalled nimble in a while -- let me test
17:57:54FromGitter<dom96> man, the volume of notifications is deadly
17:58:04shashlickhttps://github.com/nim-lang/Nim/blob/devel/koch.nim#L117
17:58:18FromGitter<iffy> sorry for the notification :(
17:58:36shashlickdom96: thanks for checking the PRs
17:58:44shashlickLooks like the choosenim one worked
17:58:52shashlickNow I can fix the older one
17:58:57FromGitter<dom96> sure, I gotta head out now, but i'll try to continue looking when I get home :)
17:59:26FromGitter<iffy> shashlick: rebuilding with latest devel is still slowish
17:59:52shashlickRun nimble ABC to see if you get a stack trace
18:00:02shashlickIf you do it is still debug
18:00:14shashlickCheck Koch as well to verify it is up to date
18:00:21shashlickAnd recompile it obviously
18:00:52shashlickShould have a -d:release as noted above
18:01:37FromGitter<iffy> shashlick: where do I stick that `-d:release`? I'm following these instructions: https://github.com/nim-lang/Nim#compiling
18:01:56FromGitter<iffy> which is just a git clone, cd, run a script
18:03:34FromGitter<iffy> okay, I just did `./koch tools -d:release` and it's still slowish
18:03:56FromGitter<iffy> I mean, it's not insanely slow, it just adds 4 seconds to each build
18:06:18*kapil____ joined #nim
18:07:15FromGitter<kaushalmodi> anamok: are you there?
18:07:23anamokyes
18:07:41FromGitter<kaushalmodi> you mentioned that you have a flow for generating multi-module docs
18:07:49*craigger joined #nim
18:07:55FromGitter<kaushalmodi> can you share that somewhere?
18:08:18FromGitter<kaushalmodi> If not a detailed blog, just a brief writeup on Nim wiki would do (or Nim forum)
18:08:40anamokyes, it's here: https://github.com/jabbalaci/NimMultiModuleLibrary
18:09:04FromGitter<kaushalmodi> oh, you are jabbalaci :)
18:09:10FromGitter<kaushalmodi> we have interacted on reddit
18:09:35anamokI created this "anamok" name years ago for IRC.
18:11:00FromGitter<kaushalmodi> I'll see if I can integrate that into that docs nimscript task
18:13:40anamokfirst verify if it's correct that I wrote
18:14:19FromGitter<kaushalmodi> anamok: I have just added to that issue for future ref
18:14:30FromGitter<kaushalmodi> when I bake that into docs, I'll ofcourse verify it
18:15:55anamokkaushalmodi: I also opened an issue for this: https://github.com/nim-lang/Nim/issues/9444
18:16:16FromGitter<iffy> Can I source a nimscript file from a nim-compiled binary? For instance, to use it as a config file
18:16:44leorizeyou can
18:17:03leorizesee https://github.com/nim-lang/Nim/blob/027a11d7c85ffc990dc5b41f1c1e2b799e77ba36/compiler/scriptconfig.nim#L28
18:18:06FromGitter<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:52FromGitter<kaushalmodi> @iffy there's TOML too
18:20:22FromGitter<rayman22201> Bah! Why are docs a rabbit hole? lol
18:20:45FromGitter<kaushalmodi> @rayman22201 tell me about it
18:20:47FromGitter<kaushalmodi> :P
18:21:14FromGitter<kaushalmodi> travis configs are in the same category
18:21:34FromGitter<kaushalmodi> I had to make like 35-40 commits last night to get the nim nightly deployment right
18:21:37FromGitter<rayman22201> oh yeah. Automated Testing is a whole other yak shaving adventure
18:23:31FromGitter<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:44Araqrayman22201: I think it wasn't wise to throw away my code :P
18:25:01Araqshould have improved my solution which was specialized for Nim
18:25:16Araqbut to be fair, I don't remember what you changed :P
18:25:27FromGitter<rayman22201> lol
18:26:44FromGitter<kaushalmodi> > Now we are debating on whether to engineer a whole new search infrastructure ⏎ ⏎ what new infra?
18:26:44FromGitter<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:53FromGitter<rayman22201> https://github.com/nim-lang/Nim/issues/9431
18:27:21FromGitter<kaushalmodi> oh
18:27:38FromGitter<kaushalmodi> I thought, I had suggested to just pop up 100% of results on a separate page
18:28:01FromGitter<rayman22201> me too... but it has gone off the rails now
18:28:58FromGitter<kaushalmodi> I think it's just silliness
18:29:28FromGitter<kaushalmodi> There are so many real bugs to solve than rewrite a search engine in Nim + JS
18:30:17FromGitter<rayman22201> I agree
18:30:35AraqI don't think it's so easy, bugs do not always affect every Nim user but a bad doc search kinda does
18:31:02FromGitter<kaushalmodi> Araq: The problem is that 100% search results are not shown
18:31:02FromGitter<rayman22201> I also agree with that
18:31:12FromGitter<kaushalmodi> so just show them on a separate page
18:31:15Araqand often the bugs are of the category "bah and once it compiles you'll complain it's too slow :P"
18:31:31Araqiterator chaining comes to mind...
18:31:50*krux02 quit (Remote host closed the connection)
18:32:04Araqand once it's fast at runtime you'll complain it's bad for compiletimes
18:32:20FromGitter<rayman22201> I don't think "throwing out the baby with the bathwater" is a good solution either with these things
18:32:49Araqand 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:08Araqso ... let's just close bugs as "won't fix"
18:33:11AraqXD
18:33:40shashlickiffy: koch tools doesn't pass flags down so -d:release on command line wont work
18:33:49shashlickcheck koch.nim locally to see if it already has -d:release for nimble
18:33:58Araqkoch tools uses -d:release already
18:33:59shashlickaraq: fixed it in devel recently
18:34:52FromGitter<kaushalmodi> shashlick: related, nimble should pass on the `-` switches to an underlying `nim` exec too
18:35:12FromGitter<kaushalmodi> then people can call `nimble` test, etc. with whatever switch they like `-o`, etc.
18:35:17Araqalways remember the saying, "Why is there something rather than nothing?"
18:35:30Araq- "If there were nothing you'd still be complaining!"
18:35:33FromGitter<iffy> yep, I see that -d:release is being used all over the place in koch.nim (and in making nimble, afaict)
18:35:56FromGitter<kaushalmodi> shashlick: I know you are not responsible for that, but talking about switch passing made me remember that
18:36:25shashlickokay then your latest build should be fine, assuming you recompiled koch that is 🙂
18:36:25*Perkol joined #nim
18:37:22shashlick@kaushalmodi: ya I think there was an issue for that already
18:38:40FromGitter<iffy> @kaushalmodi using https://github.com/NimParsers/parsetoml ? The docs don't seem to agree with the code
18:39:54FromGitter<kaushalmodi> @iffy you should open an issue. I am using that in one of my projects, running Nim devel
18:39:59FromGitter<kaushalmodi> let me check real quick
18:40:27FromGitter<iffy> okay, let me make a sscce
18:40:51FromGitter<kaushalmodi> @iffy ok, it still builds fine
18:41:09FromGitter<kaushalmodi> I am though not doing much fancy stuff in there
18:41:33FromGitter<kaushalmodi> just: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca255d64cfc273f9f26bf1]
18:43:41FromGitter<kaushalmodi> @iffy OK, I take it back.. my build fails after `nimble install parsetoml@#head`
18:44:09FromGitter<iffy> okay, I'll file the issue I'm seeing
18:44:45FromGitter<iffy> https://github.com/NimParsers/parsetoml/issues/24
18:45:36FromGitter<kaushalmodi> @iffy I am NimParsers admin, though not parsetoml dev, so I get all emails
18:45:47FromGitter<iffy> oh, okay
18:46:32FromGitter<iffy> Seems like there was a change to make `parseX` return `TomlValueRef` instead of `TomlTableRef`?
18:48:13FromGitter<kaushalmodi> yeah ..
18:48:23FromGitter<kaushalmodi> the `dump` proc is failing with the same
18:48:26FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca26fa1e23486b93e6c036]
18:49:07FromGitter<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:38FromGitter<kaushalmodi> why did you make the link verbatim?
18:52:17FromGitter<iffy> cause I'm silly -- oops
18:52:28*zachk quit (Changing host)
18:52:28*zachk joined #nim
18:58:03FromGitter<kaushalmodi> @iffy the fix is easy
18:58:12FromGitter<kaushalmodi> *I am so proud of myself to figure this out!*
18:58:22FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca294dc7bf7c366239fc8c]
18:58:53FromGitter<iffy> so, `dump` probably works, but none of the things like `getString` work
18:59:06FromGitter<kaushalmodi> ok, looking there now
18:59:06FromGitter<iffy> `getString` doesn't even exist, actually
18:59:14*anamok quit (Ping timeout: 244 seconds)
18:59:37FromGitter<kaushalmodi> basically need something to translate from valueref to tableref
18:59:38FromGitter<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:04FromGitter<kaushalmodi> @iffy whatever you add should be a plus
19:00:12FromGitter<kaushalmodi> @PMunch actively maintains that project
19:00:16FromGitter<iffy> :)
19:00:31FromGitter<kaushalmodi> s/should/will
19:01:45*PrimHelios_ joined #nim
19:01:56FromGitter<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:38FromGitter<kaushalmodi> my project uses the old `getStringArray` which doesn't exist now
19:02:43FromGitter<iffy> :)
19:02:55FromGitter<kaushalmodi> so if I figure an alternative for that, your solutions should be on the same line
19:03:01FromGitter<iffy> k
19:06:44FromGitter<alehander42> @iffy btw nice work on the argparse lib, looks great
19:07:09FromGitter<iffy> thanks -- it was definitely a learning experience :)
19:08:46FromGitter<kaushalmodi> @iffy figured it out
19:08:46FromGitter<timotheecour> hi @araq quick question if you’re here?
19:08:46FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca2bbe271506518d3b01cc]
19:09:06FromGitter<kaushalmodi> see how that old commented syntax converts to new
19:09:13FromGitter<kaushalmodi> it's more intuitive
19:09:47FromGitter<kaushalmodi> here's the snippet if you want to try: https://ptpb.pw/vu7d/nim
19:09:58FromGitter<kaushalmodi> I have the config.toml content in that commented block
19:11:30FromGitter<iffy> Hmm... I'm not seeing the same thing (though I'm using parseString rather than parseFile)
19:12:06FromGitter<iffy> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca2c86bbdc0b250569cfc7]
19:12:49FromGitter<iffy> but if that's the syntax that *should* work, I'll submit this PR as a start for tests
19:13:18FromGitter<iffy> I should say that the above code fails to run
19:13:29*narimiran joined #nim
19:14:06FromGitter<iffy> `type mismatch: got <TomlValueRef, string>`
19:14:19FromGitter<iffy> when trying to evaluate the `==`
19:14:28FromGitter<kaushalmodi> you shouldn't need getTable
19:14:32FromGitter<kaushalmodi> look at the types
19:14:43FromGitter<kaushalmodi> (that's why I use typetraits in my test code)
19:15:42FromGitter<iffy> it fails even using typetraits and no `getTable()`
19:16:09*NimBot joined #nim
19:16:10FromGitter<kaushalmodi> parsestring returns a string
19:16:26FromGitter<kaushalmodi> getTable needs TomlValueRef in inp (so input of string won't work)
19:17:35FromGitter<kaushalmodi> ~parsestring returns a string~ ignore that, sorry
19:20:59FromGitter<iffy> k I submitted a PR with a single failing test (fails for me). I'll check back after lunch. Thanks @kaushalmodi
19:21:34FromGitter<kaushalmodi> @iffy ok
19:21:40FromGitter<kaushalmodi> btw I found the final piece of the puzzle
19:21:46FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bca2eca6e5a401c2d9ad3ac]
19:21:58FromGitter<kaushalmodi> once you have a value of `TomlValueRef` type
19:22:18FromGitter<kaushalmodi> do `val.stringVal` to get the string val, and so on
19:22:43FromGitter<timotheecour> > btw @timotheecour I’ve started refactoring Arraymancer backend here: https://github.com/numforge/laser
19:23:12FromGitter<timotheecour> great thx @mratsim ! will comment there when i get a chance
19:31:53enthus1astany idea why this failes with `illegalCapture` https://gist.github.com/enthus1ast/0529b06aae315b5312e737ec405ef944 ?
19:32:08*tdc quit (Ping timeout: 245 seconds)
19:33:24enthus1astor does one has a better idea to wrap this proc?
19:34:35*tdc joined #nim
19:46:25FromGitter<rayman22201> @timotheecour are you around?
19:46:35FromGitter<rayman22201> Want to discuss some doc search stuff?
19:46:52FromGitter<timotheecour> here
19:46:55FromGitter<rayman22201> instead of killing everyones github notification dashboards lol
19:47:22FromGitter<timotheecour> what do u think of https://github.com/nim-lang/Nim/issues/9406#issuecomment-431470402
19:47:47FromGitter<rayman22201> I think naive levenshtein edit distance is too simple
19:47:53FromGitter<timotheecour> (more efficient here to discuss, but less searchable for others… tradefoff)
19:48:28FromGitter<timotheecour> its a bit naive sure; whats a simple counter example where it fails?
19:48:34narimiran@timotheecour irclogs are searchable (if you know the date)
19:48:44enthus1astyay got it (updated the gist)
19:49:38FromGitter<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:52FromGitter<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:01FromGitter<timotheecour> github search on the contrary works as I intend it to
19:50:09narimiranhttps://irclogs.nim-lang.org/ + Ctrl-F :)
19:50:46FromGitter<timotheecour> right, it requires being on the right date; ie very not optimal!
19:50:50FromGitter<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:03FromGitter<rayman22201> or you would have to choose which side of the colon you want to search
19:51:11narimirani would say (not that anybody asked me), discuss it here, and then if you come to some conclusions — write it on github
19:51:15FromGitter<rayman22201> the state machine I use takes that into account
19:51:39FromGitter<timotheecour> @rayman22201 quick question first: r results sorted, if so, by what?
19:52:04FromGitter<timotheecour> @ narimiran ok
19:52:05FromGitter<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:26FromGitter<rayman22201> They are sorted by highest score as determined by the fuzzy match state machine function
19:53:34FromGitter<rayman22201> Edit distance weights all changes equally, fuzzy match allows more weight for certain edits to be weighted more or less
19:54:04FromGitter<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:49FromGitter<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:59FromGitter<rayman22201> in the fuzzymatcher.nim file I just put a small sample database and some test queries in an "ismainmodule:" block
19:56:02FromGitter<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:53FromGitter<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:22FromGitter<rayman22201> I put a lot of faith in the algorithm and the fact that many people like the way sublime text works
19:58:21FromGitter<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:01FromGitter<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:25FromGitter<rayman22201> not hard. I actually still like the idea too
19:59:51FromGitter<timotheecour> Cool; I hate UI checkboxes and embrace pure text search ;-)
20:00:21FromGitter<rayman22201> I just want to balance newbie accessiblity vs. pro tweakability. Text UI is still UI
20:00:47FromGitter<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:09FromGitter<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:26FromGitter<rayman22201> Yeah. I agree. that should be reasonable enough
20:01:32PerkolIs there function for determining cpu arch in Nim?
20:02:03FromGitter<timotheecour> u dont’ have any off-of-your-head idea about why “fmt” isn’t shown though, do u?
20:02:13FromGitter<rayman22201> @Perkol https://nim-lang.org/docs/system.html#hostCPU
20:02:33FromGitter<rayman22201> No. I really need to look into the "fmt" thing. It's really weird. It should show up
20:02:50FromGitter<rayman22201> I have to follow it through the js debugger, I just haven't had time
20:03:18FromGitter<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:33FromGitter<timotheecour> i see dochack.nim but where is fuzzymatcher.nim ?
20:04:49FromGitter<timotheecour> > My guess is that "fmt"
20:05:04FromGitter<timotheecour> don’t think so, other 3 word queries work
20:05:20FromGitter<rayman22201> https://github.com/nim-lang/Nim/tree/devel/tools/dochack
20:05:28FromGitter<rayman22201> that's the source for dochack, and fuzzymatcher
20:05:43FromGitter<rayman22201> sorry, I called it "fuzzysearch.nim"
20:05:56FromGitter<timotheecour> ah ok!
20:06:25FromGitter<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:20FromGitter<rayman22201> not all 3 word queries have this problem. I think it's just those particular 3 letters vs. the search space.
20:07:34FromGitter<rayman22201> could be something else though. I have to look closer
20:08:21FromGitter<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:50FromGitter<rayman22201> There was but I deleted it
20:10:07FromGitter<rayman22201> easy enough to add back in though.
20:11:20FromGitter<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:28FromGitter<timotheecour> perfect; any quick easy way to access the index ?
20:13:03FromGitter<timotheecour> (u said it looks like "module name : symbol name”)
20:13:43FromGitter<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:07FromGitter<rayman22201> https://github.com/nim-lang/Nim/blob/devel/tools/dochack/dochack.nim#L246
20:14:23FromGitter<rayman22201> that is the part that makes it difficult to test on the command line
20:15:02FromGitter<rayman22201> Just looking at the theindex.html you can get an idea of the format though
20:15:16FromGitter<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:42FromGitter<rayman22201> Another project I discussed briefly with Araq was generating a better index file more suited for the search specificially
20:15:53FromGitter<rayman22201> a proper search database
20:16:14FromGitter<timotheecour> right, searching inside comments would make sense; also, storing in json would be a start
20:16:32FromGitter<rayman22201> I'm not so sure I'm sold on searching inside comments
20:16:41FromGitter<rayman22201> but json definitely
20:16:53FromGitter<timotheecour> it only makes sense if we add ‘in:comment foobar’ otherwise too much noise
20:17:06FromGitter<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:26FromGitter<rayman22201> which I think is still the right thing to do
20:17:33FromGitter<timotheecour> right, doesn’t look too hard to modify it to also generate json
20:17:38FromGitter<rayman22201> correct
20:19:23FromGitter<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:48FromGitter<rayman22201> though I do like that both parts are taken into account
20:21:21FromGitter<iffy> @kaushalmodi awesome, thank you! And I see that you updated the README
20:21:32FromGitter<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:22FromGitter<rayman22201> there is a reason it's called dochack.js :-P
20:23:49FromGitter<timotheecour> Btw, definitely search by param would be nice too (but again a prerequisite is the 'param:foo’ extensible syntax)
20:25:09FromGitter<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:36FromGitter<rayman22201> It was always a stopgap solution
20:28:01FromGitter<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:33FromGitter<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:29FromGitter<timotheecour> 1) cmd line docsearch in that separate nimble repo (that we can integrate later in javascript code in dochack)
20:31:59FromGitter<timotheecour> (last 1 shd be 5, silly gitter!)
20:34:19FromGitter<rayman22201> I like everything except making it a separate repo.
20:35:04FromGitter<timotheecour> could be a temporary thing for speed of iteration; and could be integrated once something works better than what we have.
20:36:00FromGitter<rayman22201> Or we just keep working on a fork and submit a better PR. Nim accepts PR's fairly liberally
20:36:08FromGitter<rayman22201> for now anyway
20:36:16FromGitter<rayman22201> (Pre 1.0 joys)
20:37:50FromGitter<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:44FromGitter<rayman22201> fuzzysearch.nim is very orthogonal and self contained, so it wouldn't be terrible, but still, meh...
20:39:51FromGitter<timotheecour> Sure, separate fork works too
20:39:54FromGitter<rayman22201> I'm on board with everything else though
20:40:32FromGitter<rayman22201> 👍
20:41:38FromGitter<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:07FromGitter<rayman22201> lol. yes
20:42:51FromGitter<rayman22201> The sad thing is that what I think we all want is a better nimsuggest. We can dream! one day!
20:44:31FromGitter<alehander42> I really can't imagine who will type the whole `matching:exact limit:30 foobar`
20:45:16FromGitter<alehander42> i think people either need shortcuts for this (e.g. ! l:30 foobar) or they'll just scroll manually
20:45:19FromGitter<alehander42> but maybe it's just me
20:45:20FromGitter<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:55FromGitter<alehander42> ok, then i close the page
20:45:59FromGitter<timotheecour> (and allow UI keeps to keep ur old query)
20:45:59FromGitter<alehander42> and after 5 mins i come back
20:46:28FromGitter<alehander42> i think sublime got it right with their search options ui
20:46:32FromGitter<alehander42> very intuitive
20:46:42FromGitter<timotheecour> there are ways to solve this (eg: recall past cmds using arow up); also github issue works well.
20:47:27FromGitter<alehander42> i don't like github issues search, it's actually horrific
20:47:27FromGitter<timotheecour> (as does google’s search, eg: file:pdf bar)
20:47:35FromGitter<kaushalmodi> @iffy http://nimparsers.github.io/parsetoml/
20:47:36FromGitter<alehander42> if i search my name , I see one list of issues
20:47:41FromGitter<alehander42> if I search author:myname
20:47:47FromGitter<alehander42> I see completely different list of issues
20:48:16FromGitter<kaushalmodi> @iffy I didn't plan at all to do anything with parsetoml today
20:48:23FromGitter<alehander42> that's an overreaction, but they could really combine them or at least offer <stuff>:name suggestions
20:48:23FromGitter<kaushalmodi> but you made me go down that rabbithole :P
20:48:38FromGitter<iffy> you're welcome :)
20:48:50FromGitter<iffy> and thank you :)
20:49:30FromGitter<alehander42> anyway good work
20:50:07FromGitter<timotheecour> @alehander42 maybe u mean 'https://github.com/pulls?utf8=%E2%9C%93&q=involves%3Aalehander42+'
20:50:47FromGitter<timotheecour> i like precision; author:foo != involves:foo != foo
20:51:00FromGitter<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:12FromGitter<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:11FromGitter<timotheecour> make sure u have latest devel then search in open issues for this error, otherwise please file a bug :)
20:58:31FromGitter<iffy> will do
21:00:21*flaviu quit (Ping timeout: 252 seconds)
21:00:55*flaviu joined #nim
21:15:43FromGitter<alehander42> @timotheecour I can't imagine why an issue I created shouldn't come up when I search my name
21:17:05FromGitter<alehander42> @rayman22201 they just had several small icons for regexp / case / whole and several others
21:17:19FromGitter<alehander42> but it's different there indeed
21:17:37FromGitter<alehander42> because I usually turn on regex & case sensitive
21:17:44FromGitter<alehander42> and don't touch it for months
21:18:10*xet7 quit (Remote host closed the connection)
21:18:31FromGitter<alehander42> so with text modifiers i'd see `regex:on case:on ...` all the time which would take input space
21:18:55FromGitter<alehander42> but on the other hand it seems to work for github issues, so it's subjectiv
21:22:43FromGitter<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:59anamokThis 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:46anamokI sent a PR to solve this problem and it was merged. This is my very first contribution to Nim :)
22:55:36FromGitter<kaushalmodi> anamok: 👍
22:59:32dom96:D
22:59:52dom96Beautifully done. Hope it gets you that hacktoberfest T-shirt ;)
23:02:06anamokdom96: Thanks :) I'm really happy that I could add something.
23:03:38anamokNim is really fun. I felt the same when I was learning Python a long time ago.
23:13:59FromGitter<yyyc514> hmmmm
23:14:06FromGitter<yyyc514> nim is indeed fun
23:14:30FromGitter<yyyc514> wish i undertstood templates more
23:17:02dom96What do you not understand about them? :)
23:18:11FromGitter<yyyc514> https://gist.github.com/yyyc514/77c451910689d98de123f563a4938f17
23:18:15FromGitter<yyyc514> how do i make this wokr
23:19:01FromGitter<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:16dom96try writing `var request {.inject.} = request` inside your proc
23:27:25dom96(at the top of it)
23:28:00dom96but yeah, the scoping is quite subtle
23:28:02FromGitter<yyyc514> is that making a copy of request though?
23:28:06FromGitter<yyyc514> that helps
23:28:59FromGitter<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:20FromGitter<yyyc514> ok i’m losing a lot of time in the transition
23:38:41FromGitter<yyyc514> (https://files.gitter.im/nim-lang/Nim/tNKe/Screen-Shot-2018-10-19-at-7.38.28-PM.png)
23:38:42FromGitter<yyyc514> fun to see it actually working though :)
23:40:38FromGitter<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:08FromGitter<yyyc514> hmmm so the minimum overhead seems to be 15us just for an empty jester proc
23:50:35FromGitter<yyyc514> ha and now i can’t bench beast cause it won’t close the connection lol
23:51:30FromGitter<yyyc514> trying `wrk`
23:55:48FromGitter<yyyc514> https://gist.github.com/yyyc514/840b30bdc4341df8e67ef86ab02e909f
23:55:56*PMunch quit (Remote host closed the connection)
23:55:57FromGitter<yyyc514> different in output bandwidth is interesting