<< 19-09-2018 >>

00:05:40*ven473 quit (Ping timeout: 246 seconds)
00:15:58*stefanos82 quit (Quit: Quitting for now...)
00:17:56zachcarterquit
00:18:11zachcarterwhoops
00:18:42zachcarterhttps://gist.github.com/zacharycarter/947aa1c002d930cba00ebe5a8cb7536a - is working now :D thanks for all the help alehander42
00:30:49zachcarterwe can start writing components at work! - https://viperhtml.js.org/hyperhtml/examples/#!fw=React&example=Custom%20Component & https://viperhtml.js.org/hyperhtml/examples/#!fw=React&example=Stateful%20Component
00:39:15*Cube22 joined #nim
00:44:02*Cube22 quit (Remote host closed the connection)
00:57:05FromGitter<gogolxdong> Is nes another library?
01:08:40*sblop joined #nim
01:11:51*sblop quit (Client Quit)
01:12:23*sblop joined #nim
01:12:40*pankracy20 joined #nim
01:13:37*demotomohiro joined #nim
01:14:56zachcartergogolxdong: nes = Nim ECMAScript
01:14:56*demotomohiro quit (Read error: Connection reset by peer)
01:14:56zachcarterit's the macro that provides the DSL for generating ES6 classes
01:15:02*demotomohiro joined #nim
01:15:34*SenasOzys quit (Ping timeout: 240 seconds)
01:17:18*SenasOzys joined #nim
01:17:23*pankracy20 quit (Remote host closed the connection)
01:25:36*abm quit (Ping timeout: 252 seconds)
01:59:54FromDiscord<🐍 Aareon 🐳> Howdy everyone
02:08:46*dddddd quit (Remote host closed the connection)
02:31:33*leorize quit (Quit: WeeChat 2.2)
03:05:22*NimBot joined #nim
03:07:04*smt quit (Ping timeout: 240 seconds)
03:09:20*arecaceae quit (Remote host closed the connection)
03:09:39*arecaceae joined #nim
03:13:19*vegax87 quit (Ping timeout: 252 seconds)
03:25:12*vegax87 joined #nim
03:37:28*flaviu joined #nim
03:43:39*zachcarter quit (Ping timeout: 244 seconds)
03:44:56flaviuWhen I create 2 enums with the same member name, I get "test.nim(5, 5) Error: redefinition of 'kill'"
03:45:30flaviuhttps://gist.github.com/flaviut/7bd738654647b690c92fbdfeb71bc3db from what I've read, shouldn't this work and allow me to disambiguate at the use site?
04:08:14*Sembei quit (Max SendQ exceeded)
04:09:23*Sembei joined #nim
04:12:51*sblop quit (Quit: WeeChat 1.9.1)
04:20:08*miran joined #nim
04:30:18FromGitter<codenoid> good noon
04:30:24*flaviu quit (Remote host closed the connection)
04:58:55*cncr04s25 joined #nim
05:00:59*flaviu joined #nim
05:01:47*cncr04s25 quit (Remote host closed the connection)
05:16:55*darithorn quit (Quit: WeeChat 2.2)
05:20:42*requested joined #nim
05:23:33*requested quit (Remote host closed the connection)
05:24:10*SenasOzys quit (Ping timeout: 246 seconds)
05:34:09*miran quit (Quit: Konversation terminated!)
05:37:43*nsf joined #nim
05:51:47*demotomohiro quit (Ping timeout: 240 seconds)
05:53:31*leorize joined #nim
06:17:12*SenasOzys joined #nim
06:37:33*xet7 joined #nim
06:37:38monofuel[m]I automated building docker images from nim devel, making images for amd64 and arm https://hub.docker.com/r/monofuel/nim/
06:38:17monofuel[m]wanted to make it easier to toy with the latest version of nim on raspberry pi without waiting for it to compile
06:47:28flaviumonofuel[m]: Nice job; that looks useful! A point of possible improvement: each time you make a layer in docker (i.e. use a command), that adds a layer to the image. So to reduce the image size, you can use line continuations and "&&" to chain commands. If you do this, as well as delete unnecessary files (nimcache, csources, .git), you could probably get the image under 50MB.
06:47:48flaviuYou can also merge all those apk lines into one "apk --update --no-cache git build-base"
06:48:30flaviuActually, looks like you don't need the "--update" when using "--no-cache"
06:57:19*dpn`24 joined #nim
06:57:31FromGitter<alehander42> no problem @zacharycarter can't wait to see the lib
06:58:01*dpn`24 quit (Remote host closed the connection)
06:58:37FromGitter<alehander42> what version of nim do you typically use here? last stable / some recent devel / current devel?
06:58:46FromGitter<alehander42> (people here)
07:03:13*TheLemonMan joined #nim
07:10:54*Vladar joined #nim
07:39:06FromGitter<Bennyelg> hey what does this syntax means ?[(position + i) and 15]
07:39:43FromGitter<Bennyelg> what doe the `and` means
07:39:49FromGitter<narimiran> @Bennyelg this is from my AoC solution, right? :)
07:40:01FromGitter<Bennyelg> yea good bless you here
07:40:06FromGitter<narimiran> `and 15` is the same as `mod 16`
07:40:07FromGitter<Bennyelg> I am eating my self
07:40:22FromGitter<Bennyelg> first time seeing this
07:40:25FromGitter<Bennyelg> in my live
07:40:27FromGitter<Bennyelg> life*
07:40:46FromGitter<narimiran> haha, look it up under bit-masking
07:40:55FromGitter<Bennyelg> thanks
07:41:46FromGitter<narimiran> theoretically should/could be faster than doing `mod`, but probably compiler optimizes it so in practice might be the same
07:42:29Araqflaviu, that still requires the .pure annotation to work
07:42:33FromGitter<Bennyelg> go it :D, I ate myself around 2 hours just trying to understand what the hack
07:43:27FromGitter<alehander42> i guess it's bit and ? usually it's `&`, i find it confusing when called `and`
07:43:35FromGitter<Bennyelg> yea
07:43:50FromGitter<alehander42> ok
07:43:51FromGitter<Bennyelg> if it was `&` I would understand it right away
07:44:35FromGitter<narimiran> i would rather that it was `&`, but our BDFL doesn't like (well-known) symbols and he prefers words :(
07:44:59FromGitter<alehander42> ahh i finally get it
07:45:14FromGitter<alehander42> `{.base.}` warning is when you accidentally DONT override a method in a subclass
07:45:27Araq'&' is already concat
07:45:33FromGitter<alehander42> a hint would do wonders for that error message
07:46:10FromGitter<alehander42> `(are you trying to override a parent method? this signature doesn't match any)`
07:46:27Araqand fyi I would prefer 'bitand' these days
07:46:36FromGitter<alehander42> yeah bitand would be cool
07:47:35FromGitter<Bennyelg> agree
07:47:45FromGitter<Bennyelg> bitand will be much more applicable here
07:47:56FromGitter<narimiran> you cannot concat two numbers with `&` ;)
07:48:04FromGitter<Bennyelg> yea
07:48:07FromGitter<Bennyelg> I tried it now
07:48:10FromGitter<alehander42> because honestly before that I thought I have to fix my base method somehow (after all the error message shows `base` several times which actually doesn't have a lot to do with the error usually)
07:48:11FromGitter<Bennyelg> and you can't
07:48:37Araqalehander42: RFC is wip
08:01:11FromGitter<alehander42> `0` is invalid module name
08:01:51FromGitter<alehander42> that's what happens when you start autogenerating nim files with other nim files
08:03:25*gmpreussner quit (Ping timeout: 246 seconds)
08:03:32*gmpreussner_ joined #nim
08:10:56TheLemonMana test case with 11 `when defined` subcases, @timotheecour you deserve a prize or something like that
08:19:06*abm joined #nim
08:34:22*PMunch joined #nim
08:36:42FromGitter<mratsim> @thelemonman something to keep an eye on: https://github.com/BurntSushi/critcmp "A command line tool for comparing benchmarks run by Criterion."
08:44:22TheLemonManthat's something I wanted to write, but as a simple web-based app with some nice graphs
08:54:53pigmeja haskell Criterion?
08:56:47TheLemonManthere's a Nim one too :)
08:56:53pigmejoh
08:57:31pigmejit seems that you're the author :D
08:57:40*leorize quit (Ping timeout: 272 seconds)
09:03:59TheLemonManthanks to some macro magic we have the best DSL out of the other criterions (IMO ofc :)
09:10:08pigmejyou'r opinion may be bit biased :P
09:10:11pigmejyour*
09:32:00PMunchNim macros are great for making DSLs though, so I wouldn't be surprised if he was right :)
09:42:22*a_b_m joined #nim
09:43:18*a__b__m joined #nim
09:43:55*xet7 quit (Quit: Leaving)
09:45:28*abm quit (Ping timeout: 245 seconds)
09:45:56*abm joined #nim
09:46:34*a_b_m quit (Ping timeout: 240 seconds)
09:48:34*a__b__m quit (Ping timeout: 240 seconds)
09:52:07*ven473 joined #nim
09:56:58*noonien joined #nim
10:10:56*dddddd joined #nim
10:12:17FromGitter<mratsim> Haskell as Monads :P
10:12:23FromGitter<mratsim> has*
10:16:00*Vladar quit (Remote host closed the connection)
10:18:30*navin joined #nim
10:21:25*Sembei quit (Max SendQ exceeded)
10:22:33*Sembei joined #nim
10:34:44*Vladar joined #nim
10:38:26*couven92 quit (Quit: Client disconnecting)
10:46:52FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/GsTP/Screen-Shot-2018-09-19-at-6.46.15-PM.png)
10:47:20FromGitter<bung87> I wrote a test lib using macro , get a lot of fun
10:50:53*Vladar quit (Ping timeout: 245 seconds)
10:53:42FromGitter<bung87> https://github.com/bung87/luna/blob/master/src/luna.nim#L110 take a look
10:58:08*Vladar joined #nim
11:05:03*jsn- quit (Ping timeout: 245 seconds)
11:05:14*jsn- joined #nim
11:06:49TheLemonManAraq, why did you re-add osx to the allow_failures section?
11:08:56FromGitter<kaushalmodi> @bung87 Very cool. Can you add a README that also includes how this compares to the unittest stdlib?
11:09:37FromGitter<kaushalmodi> https://nim-lang.org/docs/unittest.html
11:10:40FromGitter<vivekimsit> Hi Guys, I have just recently started learning Nim and recently published a small utility module in github
11:10:59FromGitter<vivekimsit> it would be great if someone can have a quick overview and give me some feedback
11:11:09FromGitter<vivekimsit> https://github.com/vivekimsit/pretty-bytes
11:13:44FromGitter<bung87> well , there’s more feature considering in commented code, `parallel `,output to file , the mose favour part is the terminal prints styles.
11:15:19FromGitter<xmonader> Is it just me or the parsetoml isn't really friendly to use?
11:15:20*navin quit (Remote host closed the connection)
11:15:44FromGitter<bung87> also considering add consumed time
11:15:51FromGitter<kaushalmodi> @vivekimsit Comments unrelated to code, you shouldn't commit the binaries to the git repo.
11:16:28*navin joined #nim
11:17:17FromGitter<kaushalmodi> The binaries would be specific to your OS. So anyone building this themselves on a different OS will anyways have to build it again. Read on how to distribute binaries as GitHub Releases assets instead.
11:18:55FromGitter<kaushalmodi> About the code, good job adding tests. I'd also add tests for arbitrary values. Right now, you are using just rounded "clean" byte values which are not very realistic.
11:20:32FromGitter<vivekimsit> @kaushalmodi thanks for the comments, I am still in very early stage of learning vim so any comment will definitely help me out
11:20:47*navin quit (Ping timeout: 240 seconds)
11:20:51FromGitter<vivekimsit> I need to add more tests for sure
11:21:17FromGitter<vivekimsit> and find some edge cases so any pull requests are welcome
11:21:40*stefanos82 joined #nim
11:22:19FromGitter<vivekimsit> also, right now the output is always in this format: `x.y` it would be better if I could trim the `0` after the decimal if the result is an integer
11:28:55FromGitter<kaushalmodi> About trimming the trailing .0, look at the `g`/`G` format for printing floats using `fmt`. Here are my notes on that: https://scripter.co/notes/nim-fmt/#type--only-for-numbers
11:31:14*leorize joined #nim
11:32:20*SenasOzys quit (Ping timeout: 250 seconds)
11:33:29FromGitter<kaushalmodi> I think you will get an error if you do just `var number = 123` in your test, because then number would be an int and not a float.
11:33:40FromGitter<alehander42> @bung87 looks good
11:34:03FromGitter<kaushalmodi> @vivekimsit You would need to add support for int types too.
11:34:41FromGitter<kaushalmodi> Better, make that proc a generic, and slightly tweak the behavior of int vs float inside that generic proc definition.
11:34:49FromGitter<alehander42> But the killing feature for me in unittest is that it can show you the subvalues in the expected nodes
11:35:03FromGitter<alehander42> E.g. a + b , can show a and b
11:35:16FromGitter<alehander42> But the problem is it's very inconsistent in it
11:35:30FromGitter<alehander42> If your lib can do this well too, I'll use it
11:35:47FromGitter<kaushalmodi> @xmonader admittedly, I haven't used parsetoml much. But using it was fine.
11:36:51FromGitter<kaushalmodi> You can find an example in here: https://github.com/kaushalmodi/nbuild/blob/master/src/nbuild.nim
11:37:44FromGitter<kaushalmodi> See the cfg variable in there
11:37:55FromGitter<bung87> havn’t look that further ,just using literal value for testing ,since it suitable for mine another lib, will keep it in mind .
11:44:02FromGitter<xmonader> @kaushalmodi well, basic usage doesn't even work ⏎ https://github.com/NimParsers/parsetoml/issues/23
11:46:45FromGitter<kaushalmodi> I see, that error is due to the removal of string nil recently
11:46:57FromGitter<kaushalmodi> I haven't tried parsetoml after that.
11:47:15FromGitter<kaushalmodi> It should be an easy fix I believe.
11:48:00FromGitter<kaushalmodi> For now, you should be able to continue using an experimental switch; don't remember it right now.
11:48:26FromGitter<kaushalmodi> If someone can help, that switch temporarily allows nil string on devel.
11:49:51FromGitter<xmonader> compiling with nilseqs:on works but still raises errors
11:53:06FromGitter<kaushalmodi> The error is evident :)
11:53:16FromGitter<kaushalmodi> You have four quotes at the beginning
11:53:28FromGitter<kaushalmodi> `""""`
11:54:32*krux02 joined #nim
11:54:57*SenasOzys joined #nim
12:00:17FromGitter<dandevelo> Trying to build the latest nim and getting this error: lib/system/sysstr.nim(87, 25) Error: type mismatch: got (ptr UncheckedArray[system.char]) but expected 'cstring = CString'
12:04:02FromGitter<dandevelo> Does it work on your side?
12:06:50*navin joined #nim
12:11:13*navin quit (Ping timeout: 246 seconds)
12:15:13Araqdandevelop: remove old Nim installations and do what travis/appveyor does
12:18:12FromGitter<kaushalmodi> @Araq: Thanks for merging the nightly docs PR. They are alive! https://nim-lang.github.io/Nim/
12:18:56FromGitter<kaushalmodi> Are you going to add the commit hash to the footer?
12:20:40FromGitter<kaushalmodi> (Well, not "nightly" any more, they get updated with each devel commit. :))
12:34:46FromGitter<bung87> ` ✘ plus(1, 2) == 4 [3 == 4]` how to nicely log the results? reverse operator?
12:34:51Araqyeah, but "nightly" builds have priority and are coming too
12:35:40FromGitter<bung87> @alehander42 get something for you
12:37:28*navin joined #nim
12:41:07FromGitter<bung87> well ,make it `[3 and 4]`
12:50:26*navin quit (Remote host closed the connection)
12:58:25*Vladar quit (Remote host closed the connection)
12:59:03FromGitter<narimiran> `got 3, expected 4`?
13:00:02FromGitter<bung87> seems not suitable for `a() == b()`
13:07:22FromGitter<narimiran> yup, it isn't
13:08:34FromGitter<bung87> ah, got a option for humans :)
13:10:03*SenasOzys__ joined #nim
13:11:34*SenasOzys quit (Read error: Connection reset by peer)
13:12:50*kapil___ joined #nim
13:13:04*Febo1 joined #nim
13:13:44*Febo1 quit (Remote host closed the connection)
13:20:33*ryanhowe joined #nim
13:22:18*ryanhowe quit (Client Quit)
13:29:50krux02dandevelo: that looks like a cast[cstring](...)
13:29:54krux02is missing
13:32:07*Vladar joined #nim
13:35:25*SenasOzys joined #nim
13:36:08*SenasOzys__ quit (Remote host closed the connection)
13:53:55FromGitter<Bennyelg> @mratsim how was the performance agingest julia? ⏎ https://github.com/mratsim/nim-julia-challenge
13:58:07FromGitter<bketelsen> morning nimmers
13:59:10FromGitter<bketelsen> I'm stuck on a version problem trying to build the nim forum. I have the latest nim built as of this morning : `choosenim show ⏎ Channel: devel ⏎ Version: #devel ⏎ ⏎ ``` Path: /Users/bketelsen/.choosenim/toolchains/nim-#devel```` [https://gitter.im/nim-lang/Nim?at=5ba2562e7dca30650323e743]
13:59:25FromGitter<bketelsen> `nimble v0.8.11 compiled at 2018-09-19 13:43:33 ⏎ git hash: 1f79f17de90702abad31a6f70d3f9c74195cb105`
13:59:40FromGitter<bketelsen> nim forum is at #master
14:01:42FromGitter<bketelsen> nimble install fails with errors about headers: `but expression 'headers' is of type: RawHeaders` so I changed jester to #head in nimforum.nimble, but that gives me a different error about isNil being a user defined error.
14:02:15FromGitter<bketelsen> `forum.nim(79, 46) Error: usage of 'isNil' is a user-defined error`
14:02:27FromGitter<bketelsen> Can anyone suggest what I'm doing wrong?
14:03:11Araqmaybe nothing and we need to update nimforum :-)
14:05:01PMunchbketelsen, in the newest version of Nim sequences and strings can't be nil
14:05:35PMunchYou can go back to the old behaviour with --nilseqs:on, or you can use a stable version of Nim
14:08:25FromGitter<bketelsen> brilliant! That fixed the build error. Thank you @PMunch and @Araq
14:11:06FromGitter<kaushalmodi> *s/fixed/bypassed :)
14:11:20*ven473 quit (Remote host closed the connection)
14:11:37*ven473 joined #nim
14:11:48PMunchToo bad these "user-defined errors" can't have custom messages
14:12:05PMunchWould be nice to leave a little notice of this change in the error message
14:13:04AraqPMunch: yeah good idea, consider it done
14:13:13FromGitter<kaushalmodi> How come they cannot have detailed messages?
14:13:31FromGitter<kaushalmodi> I put in detailed messages in the exceptions I throw.
14:13:36Araqbut I need to hack it into the compiler because user-defined error messages could be supported but would break boostrapping otherwise
14:14:43FromGitter<kaushalmodi> OK, may be because these are compile time errors.
14:14:51FromGitter<bketelsen> https://github.com/nim-lang/nimforum/issues/204 <-- filed issue on nimforum repo
14:16:39*seni joined #nim
14:23:08*rockcavera quit (Remote host closed the connection)
14:26:22*navin joined #nim
14:27:59FromGitter<razuit> how does one cleanly close an AsyncHTTPServer that is running on a separate thread? I have this Nim program that spawns another thread for running an HttpServer, then waits for a key and then wants to cleanly stop the HTTP server ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ba25cefd655361f7622241f]
14:33:23TheLemonManoh fuck, appvoyeur timed out once again
14:33:33FromGitter<mratsim> voyeur lol
14:39:34*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
14:51:10*rockcavera joined #nim
14:57:19FromGitter<Vindaar> @razuit why does the server run in a separate thread, if it's an async HTTP server already? Is this just a simplified case?
15:00:00*couven92 joined #nim
15:07:36*navin quit (Remote host closed the connection)
15:08:37*navin joined #nim
15:10:01*navin quit (Remote host closed the connection)
15:14:54*SenasOzys quit (Ping timeout: 252 seconds)
15:16:42*Vladar quit (Ping timeout: 264 seconds)
15:21:49*SenasOzys joined #nim
15:25:52*Trustable joined #nim
15:26:29*Trustable quit (Remote host closed the connection)
15:27:24*Trustable joined #nim
15:30:34*demotomohiro joined #nim
15:35:49*skrylar joined #nim
15:38:40*Vladar joined #nim
15:42:25*PMunch quit (Quit: Leaving)
15:47:25*xet7 joined #nim
16:01:15*Aareon joined #nim
16:11:04*abm quit (Ping timeout: 240 seconds)
16:11:26*TheLemonMan joined #nim
16:12:14*wildlander joined #nim
16:17:07*navin joined #nim
16:35:36*darithorn joined #nim
16:38:54*navin quit (Remote host closed the connection)
16:40:04FromGitter<iffy> Is there a way to statically link (a specific version of) sqlite into my binary and still use the `db_sqlite` module?
16:44:48*Aareon quit (Remote host closed the connection)
16:48:34*navin joined #nim
16:50:40FromGitter<mratsim> probably with dynlibOverride
16:51:15FromGitter<iffy> ooo, let me try that
16:51:17FromGitter<mratsim> I saw some questions on the forum recently about static linking
16:55:03FromGitter<iffy> I guess dynlibOverride is assuming I've already built the static sqlite lib, right? There's not a way to use sqlite source (and have nim compile everything in one step)?
16:59:56FromGitter<iffy> yep
17:00:00FromGitter<iffy> wow... that was too easy
17:11:56*Aareon joined #nim
17:11:59FromGitter<bung87> is there a Deep learn framework in nim ?
17:12:34AareonThere are wrappers for Tensor iirc
17:12:35TheLemonManno, only shallow learning ones
17:12:43AareonMaybe... lol
17:12:57FromGitter<bung87> wrappers ..
17:13:13TheLemonManthere's nimtorch & arraymancer
17:14:02AareonArrayMancer is a good one
17:15:22FromGitter<bung87> ah seems fit my needs, I β€˜ll give a try
17:15:43FromGitter<bung87> thanks guys!
17:16:11*Aareon_ joined #nim
17:16:31*Aareon_ left #nim (#nim)
17:16:47*Aareon left #nim (#nim)
17:16:53*Aareon_ joined #nim
17:17:08*Aareon_ is now known as Aareon
17:17:55TheLemonManAraq, what about deprecating {int,str}define pragmas and instead have a compiler plugin generate a CT-tuple (a-la locals()) with all the user defines?
17:19:02Aareon`locals()` as in Python `locals()`?
17:20:07monofuel[m]flaviu: thanks for the feedback, i'll look into updating it later today. I'm not familiar with optimizing dockerfiles for size, normally I try to optimize for making it easy change with fast rebuild but size would be better in this case.
17:20:12FromGitter<kaushalmodi> TheLemonMan: How will the value type be derived?
17:20:30FromGitter<kaushalmodi> Interestingly, I *just* learned about the *define pragma.. noted that here: https://scripter.co/notes/nim/#define-switch-value
17:21:24TheLemonMankaushalmodi, the compiler already knows about them
17:22:13FromGitter<kaushalmodi> I thought it assigned it as string or int based on strdefine or intdefine..
17:22:32*Aareon quit (Quit: Igloo IRC: https://iglooirc.com)
17:24:15TheLemonManof course all of them are strings, because all the -d: switches are indeed strings, and the user is responsible for parsing it (& error handling)
17:26:07FromGitter<kaushalmodi> hmm, makes sense
17:26:14*SenasOzys quit (Ping timeout: 272 seconds)
17:26:32FromGitter<kaushalmodi> I also find it *magical* that a define switch of strdefine type gets a `"true"` value by default
17:27:20FromGitter<kaushalmodi> if the switch value is stored as string, we need to distinguish between a `-d:foo` switch vs `-d:foo=bar` switch vs no switch
17:27:38FromGitter<kaushalmodi> so I think option[string] will need to enter that scene
17:27:42*SenasOzys joined #nim
17:28:52TheLemonManconflating `-d:foo` and `-d:foo=` may help without bringing into the table the big (optional) guns :)
17:33:25*navin quit (Remote host closed the connection)
17:33:27FromGitter<kaushalmodi> yes, actually I wasn't talking of that case.. I was talking about the case of a define switch not being used.
17:33:40FromGitter<kaushalmodi> But thinking more, we wouldn't need to worry of such cases
17:33:57FromGitter<kaushalmodi> as there won't be a tuple element for missing switches :)
17:33:58TheLemonManoh, if the -d: is missing then you'd have a missing-field error
17:34:21FromGitter<kaushalmodi> If I understood you correctly, passing `-d:foo -d:bar=val` will be analogous to `const locals = [("foo", ""), ("bar", "val")]`
17:34:23FromGitter<kaushalmodi> right?
17:35:20TheLemonManmore like `(foo: "", bar: "val")`, a tuple is nicer than a table here
17:35:25FromGitter<iffy> Is there a way to access the correctly-typed values of returned db_sqlite result rows? e.g. `select 1 as first, "foo" as second` and then `row.first == 1` and `row.second == "foo"`?
17:35:44FromGitter<kaushalmodi> TheLemonMan: yes, thanks
17:36:18FromGitter<kaushalmodi> so yeah, that `locals` suggestion would be nice
17:36:48FromGitter<kaushalmodi> how would Nim ensure that there's no name collision with a `locals` in user code?
17:37:43TheLemonManerr, `defines` is a better name here :) it'd be implemented as a compiler plugin like `locals()` is
17:38:47FromGitter<kaushalmodi> OK, I'll trust you guys because I don't know what `locals()` is :)
17:38:54FromGitter<kaushalmodi> But yes, `defines` is nicer
17:39:07FromGitter<kaushalmodi> You want to make an RFC?
17:40:12*Trustable quit (Remote host closed the connection)
17:41:39TheLemonManit's more a brain-fart than a full-blown RFC right now heh
17:42:33FromGitter<kaushalmodi> Another tangent to that
17:42:42FromGitter<kaushalmodi> we already have `defined` proc (macro?)
17:42:53FromGitter<kaushalmodi> but it's a user-facing proc like thing
17:43:03FromGitter<kaushalmodi> right now defined returns either true or false
17:43:19FromGitter<kaushalmodi> would be nice if it returned true/false/stringval
17:43:22FromGitter<kaushalmodi> wdyt?
17:43:49FromGitter<kaushalmodi> or.. if it returned (again) option[string] :)
17:44:09*navin joined #nim
17:44:20FromGitter<kaushalmodi> so instead of a user having to check `defined` and the new `defines`, then now need the same old `defined`
17:44:27TheLemonManmy opinion is that since `defined` is a question (is it defined or not?) it should just return a bool
17:44:53FromGitter<kaushalmodi> hmm
17:49:40TheLemonManit's like elisp predicates :)
17:49:53FromGitter<kaushalmodi> hey!
17:49:55FromGitter<kaushalmodi> You use emacs?
17:50:05FromGitter<kaushalmodi> it's like alist in elisp :)
17:50:17FromGitter<kaushalmodi> ok, you meant `defined`
17:50:26*demotomohiro quit (Quit: Leaving)
17:50:53FromGitter<kaushalmodi> when you pasted `(foo: "", bar: "val")`, I was thinking alists.. `'((foo . "") (bar . "val"))`
17:51:05TheLemonManI've sunk way too much time/effort in vim, but I wr{i,o}te quite a lot of scheme heh
17:51:13FromGitter<kaushalmodi> hmm
17:53:02*stefanos82 quit (Quit: Quitting for now...)
17:54:49*xet7 quit (Quit: Leaving)
18:05:50*druonysus joined #nim
18:36:47*navin quit (Remote host closed the connection)
18:58:15FromDiscord<treeform> I found this module "coro" https://github.com/nim-lang/Nim/blob/master/lib/pure/coro.nim
18:58:20FromDiscord<treeform> Does not seem to be used much
18:58:29FromDiscord<treeform> there are some tests in the folder but it looks very limiting...
18:58:47FromDiscord<treeform> is the new async stuff super seeds this? What is the history behind it?
19:00:38*Piraty joined #nim
19:00:58Piratyhi, is there any known distro that packages nim-forum?
19:01:59*aerth quit (Quit: later versions)
19:07:58*SenasOzys quit (Ping timeout: 245 seconds)
19:11:05federico3the forum itself? no
19:23:37*Jesin quit (Quit: Leaving)
19:26:02*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
19:31:59*Jesin joined #nim
19:32:43*SenasOzys joined #nim
19:38:34*PrimHelios joined #nim
19:55:51*navin joined #nim
19:58:04ng0hey, is there a due date for applications for the core dev position(s) that are open?
19:59:00*gmpreussner_ quit (Ping timeout: 252 seconds)
20:00:09*navin quit (Ping timeout: 244 seconds)
20:17:11FromDiscord<treeform> I have not seen a due date? Usually job applications don't have one.
20:23:55*voice_ftp_ quit (Ping timeout: 244 seconds)
20:29:39*ritchie_ quit (Remote host closed the connection)
20:30:09FromDiscord<Shield> I feel that I've seen a staticfor template in nim files, anybody knows where is it? if not, what's a simple way to do it
20:32:38*voiceftp joined #nim
20:34:55Araqng0, October or November
20:37:35ng0Araq: thanks
20:40:55*zachcarter joined #nim
20:49:37*Bercik5 joined #nim
20:52:10*Bercik5 quit (Remote host closed the connection)
20:54:16*PrimHelios quit (Quit: Leaving)
21:04:38*zachcarter quit (Ping timeout: 245 seconds)
21:10:31*krux02 quit (Remote host closed the connection)
21:11:56*ritchie_ joined #nim
21:19:12*Vladar quit (Remote host closed the connection)
21:33:41*nsf quit (Quit: WeeChat 2.2)
21:40:32*solidsnack23 joined #nim
21:41:12*solidsnack23 quit (Remote host closed the connection)
21:41:56*zachcarter joined #nim
21:51:56*kapil___ quit (Quit: Connection closed for inactivity)
22:01:37FromGitter<iffy> Can I make a proc that returns a proc and has access to the outer proc's arguments? I'm getting an illegal capture error
22:03:34FromGitter<iffy> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ba2c7b6e6046343f388cdff]
22:04:16FromGitter<iffy> the compiler doesn't like me using `statements` from within the inner proc
22:25:04FromGitter<iffy> Can I copy those statements to some other variable for later use?
22:25:42FromGitter<drewp> picking up from @dm1try idea at https://gitter.im/nim-lang/Nim?at=5b9ef81db4990c30eec684d5 , my code is now like https://gist.github.com/drewp/d299548fd28c9db22dc1c8f0b1cf8f8a and it looks pretty except for the casts on 33-34
22:41:46*zachcarter quit (Ping timeout: 260 seconds)
22:44:16FromGitter<rayman22201> @iffy it's the openArray. You can't capture an openArray because it may not have an address. If you make that a concrete type like a seq it will work.
22:45:28FromGitter<iffy> k, I tried a seq after that and I though it compiled, I was still getting errors. I need to get a smaller example of my whole code. Thanks for the tip!
22:45:51*enthus1ast joined #nim
22:46:31FromGitter<rayman22201> You could make it a template instead
22:46:40FromGitter<iffy> That's where I started :)
22:46:52FromGitter<iffy> let me paste my full file (shortened)
22:46:54enthus1astany idea how i could convert (in js context) a stdlib.json to a js json object?
22:49:11enthus1astanything better than: JSON.parse(($j))
22:49:11*abm joined #nim
22:49:41FromGitter<rayman22201> @enthus1ast I don't understand the question. what is a stdlib.json?
22:50:08enthus1astim useing `json` from the stdlib to parse a json msg in the browser
22:50:55FromGitter<iffy> @rayman22201 can I paste 30 lines here or is there a better pastebin?
22:51:18enthus1astbut when i call a callback, which is defined by javascript code, i see the implementation of json, not the json data
22:51:48FromGitter<rayman22201> @iffy, pastebin
22:52:53FromGitter<iffy> @rayman22201 https://gist.github.com/iffy/ac3fc7a8710149ada8b44ab20d137bd6
22:53:39*wildlander quit (Quit: Konversation terminated!)
22:56:21FromGitter<rayman22201> @enthus1ast I understand your question now. I think the answer is that there really isn't a good way. Nim is not Javascript. You have to convert across the boundary somehow.
23:02:22FromGitter<iffy> when I try a template like this: ``` ⏎ template sqlList(sql_arr: untyped) = ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5ba2d57de6046343f389178d]
23:02:38enthus1astmaybe it would be a good idea to port my code to the native JSON api...
23:02:52FromGitter<iffy> I get "expression 'proc anon(db227039: DbConn) = ... has no type (or is ambiguous)"
23:03:08enthus1astBUT it would be cool if stdlib json would have such a function out of the box :)
23:04:43FromGitter<rayman22201> @enthus1ast maybe try the jsFromAST macro in the jsffi module? https://nim-lang.org/docs/jsffi.html#jsFromAst
23:04:55FromGitter<rayman22201> I'm not sure though
23:05:42FromGitter<rayman22201> @iffy, your proc doesn't have a return type, and the code below wants it to have a return type. I'm looking closer at why
23:06:29FromGitter<iffy> in the template version or the pastebin version? (oh... or both?)
23:08:08enthus1asti think the error is in the context of sqlList
23:08:45enthus1astcould you nopaste where you use sqlList?
23:09:00FromGitter<iffy> what is nopaste?
23:09:36FromGitter<iffy> fwiw, this compiles: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ba2d730be4f300626bc14cb]
23:09:38enthus1astcould you send the code
23:10:01FromGitter<iffy> @enthus1ast https://gist.github.com/iffy/ac3fc7a8710149ada8b44ab20d137bd6
23:13:29FromGitter<kaushalmodi> Is there a simple example somewhere that shows how to create a Nim application wrapper around a JS library?
23:13:51FromGitter<kaushalmodi> I am interested in creating a CLI utility that uses https://github.com/microlinkhq/metascraper
23:15:56FromGitter<iffy> I'm off now, but I'll read later if you have any ideas; thanks!
23:16:21FromGitter<rayman22201> ttyl @iffy
23:19:15enthus1asttry
23:19:23enthus1asttemplate sqlList(sql_arr: untyped): proc (db:DbConn) =
23:20:05enthus1ast^ iffy
23:20:37*enclyp joined #nim
23:20:58*enclyp quit (Remote host closed the connection)
23:21:00*a5m012 joined #nim
23:21:55*a5m012 quit (Remote host closed the connection)
23:26:41enthus1astfunny this could also help me with my issue
23:27:06enthus1astbut https://github.com/pragmagic/karax/blob/master/karax/jjson.nim could help you aswell @kaushalmodi
23:27:48FromGitter<rayman22201> Karax to the rescue lol
23:28:40enthus1ast @kaushalmodi https://github.com/pragmagic/karax/blob/master/karax/jwebsockets.nim
23:32:17FromGitter<kaushalmodi> I'm not sure what kind of example will help me. I have 0 JS knowledge. I believe I'll need to translate the JS require to Nim somehow? See https://github.com/microlinkhq/metascraper/blob/master/README.md#usage
23:33:03enthus1astdo you must use metacrawler or "just want to crawl some data from a site"?
23:33:46enthus1astmetascraper i mean
23:35:28*Tiiffi16 joined #nim
23:36:21*Tiiffi16 quit (Remote host closed the connection)
23:37:11FromGitter<kaushalmodi> I want to just scrape meta data: author, title and abstract.
23:38:25FromGitter<kaushalmodi> The challenge is that the data could be in JSON-LD, mf2, DC, og and variety of meta data formats.
23:38:53enthus1astok
23:43:59enthus1astthen it must run inside nodejs i guess?
23:44:45*PrimHelios joined #nim
23:49:19FromGitter<kaushalmodi> .. I believe so .. I assumed, which I shouldn't have, that Nim will compile to JS code, which should act as wrapper for that library.. and then "somehow" (I believe using `npm`) that can be converted to a binary.
23:50:00FromGitter<kaushalmodi> Is that plan technically possible?
23:51:33enthus1astyou could compile yourscript.nim to yourscript.js which could be executed by nodejs then
23:52:27enthus1astbut it would not be a standalone executable
23:52:38FromGitter<kaushalmodi> Hmm, OK
23:52:53FromGitter<adam-r-kowalski> How come this code doesn’t compile? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ba2e1541043315947b8231d]
23:53:37FromGitter<kaushalmodi> enthus1ast: Thanks for your time. There are quite a many "I don't know how" in that plan :)
23:54:04FromGitter<kaushalmodi> I'll look for some other way to parse URL metadata from CLI.
23:54:29FromGitter<kayabaNerve> Nim needs better UI options
23:54:33FromGitter<kayabaNerve> Nimx is flat out broken
23:55:09FromGitter<zetashift> Easier said than done :P
23:56:32FromGitter<kayabaNerve> ... yep
23:56:35FromGitter<adam-r-kowalski> Is there a resouce on composing Concepts? Like I want to say that in order to be this concept you must also fullfill the interface of another concept
23:56:37FromGitter<kayabaNerve> Just pushed 4 new commits to mine
23:58:01enthus1astadam-r-kowalski `s.len is int` compiles for me
23:58:38FromGitter<kayabaNerve> I complain about a lot of stuff without doing anything because I'm a very critical person. That said, I need an UI lib, and the options out there are so bad I'm actually writing one.
23:58:52enthus1asti know its terrible
23:59:01FromGitter<adam-r-kowalski> Oh thanks! For some reason vscode was giving me an error message on the s is Iterator line
23:59:13enthus1asti have the same isse :)
23:59:17enthus1astissue
23:59:47enthus1astthe best thing i found for nim really was webview