<< 31-10-2017 >>

00:18:22*Trustable quit (Remote host closed the connection)
00:40:43*Nikky quit (Ping timeout: 255 seconds)
00:50:46*Nikky joined #nim
00:51:08*yglukhov joined #nim
00:55:27*yglukhov quit (Ping timeout: 248 seconds)
01:02:38FromGitter<Gooseus> <treeform> added list_objects and list_buckets method to the S3Client
01:20:12*gokr quit (Ping timeout: 260 seconds)
01:41:17*yglukhov joined #nim
01:45:35*yglukhov quit (Ping timeout: 248 seconds)
01:59:08*UxerUospr joined #nim
02:00:40GitDisc<treeform> wow nice thank you!
02:01:17FromGitter<superfunc> @Yardanico sorry about my useless PR the other day, my stuff had gotten quite out of sync :D
02:16:01*def-pri-pub joined #nim
02:20:32*chemist69_ quit (Ping timeout: 255 seconds)
02:34:08*chemist69 joined #nim
02:59:12*libman quit (Quit: Connection closed for inactivity)
03:04:08*couven92 quit (Ping timeout: 240 seconds)
03:08:46*derlafff quit (Ping timeout: 255 seconds)
03:27:57*UxerUospr quit (Remote host closed the connection)
03:28:51*yglukhov joined #nim
03:29:32*Snircle quit (Ping timeout: 246 seconds)
03:29:39*Snircle_ joined #nim
03:33:31*yglukhov quit (Ping timeout: 255 seconds)
03:38:49*couven92 joined #nim
03:39:13*derlafff joined #nim
03:44:07*Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com)
04:20:57*cspar__ joined #nim
04:23:27*cspar_ quit (Ping timeout: 240 seconds)
04:29:22*def-pri-pub quit (Quit: Leaving.)
04:35:00*couven92 quit (Read error: Connection reset by peer)
04:41:01*yglukhov joined #nim
04:45:08*yglukhov quit (Ping timeout: 240 seconds)
04:58:05*def-pri-pub joined #nim
04:59:41*vlad1777d joined #nim
05:07:32*def-pri-pub quit (Quit: Leaving.)
06:19:08FromGitter<Yardanico> @superfunc what PR you're talking about ? :)
06:19:26FromGitter<Yardanico> ah, about l warning, nothing bad
06:19:33FromGitter<Yardanico> it's not easy to spot changes in nim devel sometimes
06:19:35FromGitter<superfunc> 6613, yeah
06:20:29FromGitter<Yardanico> so Araq used `l` in dfa.nim and then removed the warning because it's annoying :P
06:20:40FromGitter<superfunc> lol
06:21:14FromGitter<superfunc> I'm looking at 6420 right now, but its a bit weird, I'm trying to understand the errno behavior
06:22:13FromGitter<superfunc> In the open function in system.nim, errno doesn't seem to be set after a failed open call, but it does get set after the IOException is rasied.
06:24:36FromGitter<Yardanico> all platform-dependent functions from system.nim are implemented in sysio.nim
06:24:43FromGitter<Yardanico> lib/system/sysio.nim
06:25:57*yglukhov joined #nim
06:26:38FromGitter<gogolxdong> @PMunch var client = jsnew net.createConnection(JsObject{ path:"qemu+tcp://192.168.4.151/system".cstring }, proc () = ⏎ console.log("Connected to server!") ⏎ )
06:26:56FromGitter<gogolxdong> @PMunch
06:27:05FromGitter<gogolxdong> var client = jsnew net.createConnection(JsObject{ path:"qemu+tcp://192.168.4.151/system".cstring }, proc () = ⏎ console.log("Connected to server!") ⏎ )
06:27:16FromGitter<Yardanico> why are you deleting your messages?
06:27:34FromGitter<gogolxdong> var client = jsnew net.createConnection(JsObject{ path:"qemu+tcp://192.168.4.151/system".cstring }, proc () = ⏎ console.log("Connected to server!") ⏎ )
06:27:53FromGitter<gogolxdong> can't ctrl+enter
06:28:41FromGitter<gogolxdong> ``````
06:28:51FromGitter<Yardanico> ```like thid```
06:28:54FromGitter<Yardanico> *this :)
06:28:57FromGitter<superfunc> I think you want shift+enter
06:29:10*nsf joined #nim
06:29:29FromGitter<gogolxdong> ```code paste, see link``` ⏎ ⏎ yeah, exactly :) [https://gitter.im/nim-lang/Nim?at=59f8184932e080696e472cfb]
06:29:40FromGitter<Yardanico> @gogolxdong I'm just saying that because your message has been sent to IRC three times :)
06:29:44*XZentus joined #nim
06:30:20FromGitter<gogolxdong> ok , I am aware of that.
06:31:47FromGitter<gogolxdong> @PMunch nim-electron can't connect socket in this form
06:35:13FromGitter<gogolxdong> I tried this path with libvirt-python client, it works well.
06:36:35FromGitter<Yardanico> why are you using JS here?
06:36:41FromGitter<Yardanico> you can connect using Nim without JS FFI
06:37:16*earenndil quit (Quit: ZNC 1.6.3+deb1 - http://znc.in)
06:37:24FromGitter<superfunc> @Yardanico Is errno platform dependent since its in c99?
06:37:47FromGitter<Yardanico> @superfunc it seems so http://www.ioplex.com/~miallen/errcmp.html
06:37:57FromGitter<Yardanico> but mostly they're equal
06:38:01FromGitter<gogolxdong> We are presenting a crossing platform dashboard, web is a reasonable choice.
06:38:14FromGitter<superfunc> @Yardanico Whats that link supposed to be to?
06:38:20FromGitter<superfunc> It looks like a dead link
06:38:25FromGitter<Yardanico> @superfunc it's not a dead linjk
06:38:34FromGitter<Yardanico> An identifier is defined for platforms that have a numeric value listed (even though there may not be an associated message shown). Column 2 is a score that indicates the fraction of platforms on which the identifier is found (1 meaning all).
06:38:49FromGitter<superfunc> Huh, I get a 404 on that page
06:40:07FromGitter<Yardanico> maybe your browser incorrectly parses it?
06:40:12FromGitter<Yardanico> it's fine with google chrome
06:40:22FromGitter<superfunc> I'm on chrome too
06:40:43FromGitter<Yardanico> try this http://www.ioplex.com/~miallen/errcmp.html
06:40:47FromGitter<Yardanico> https://goo.gl/PebG8P
06:41:05FromGitter<superfunc> Still 404, on ffox as well
06:41:33FromGitter<gogolxdong> and I want to use tcp to work around wsgi for better lantency.
06:42:51FromGitter<Yardanico> @superfunc I don't really know
06:43:17FromGitter<superfunc> ¯\_(ツ)_/¯
06:48:53FromGitter<superfunc> It can be done in sysio.nim anyways.
06:59:29*yglukhov quit (Remote host closed the connection)
07:00:04*yglukhov joined #nim
07:04:01*yglukhov quit (Ping timeout: 240 seconds)
07:12:06*couven92 joined #nim
07:21:40*claudiuinberlin joined #nim
07:33:18*tdc joined #nim
07:38:54*PMunch joined #nim
07:39:44FromGitter<sptorin_twitter> try exclude some chars from string, can't do it via `strip`... what right way?
07:41:26FromGitter<superfunc> strutils.multireplace
07:42:08couven92ah! `strutils.multireplace`, my own little baby! :P
07:42:50couven92(I can't really take any credit for that one though, Araq made me do it :D )
07:43:52FromGitter<Yardanico> @superfunc but it's only for strings :)
07:44:03FromGitter<Yardanico> I mean you can use single-char strings too
07:44:24FromGitter<Yardanico> but this is a (little bit) less efficient :D
07:45:58FromGitter<sptorin_twitter> multiReplace change one char, and if I want cut from string 5 chars?
07:46:44couven92`align` or `leftAlign` maybe?
07:47:27Araqs.setLen s.len - 5
07:48:32FromGitter<sptorin_twitter> I mean other (baaaad english). Have str1 = "a! b? c.." and need cut all punctuation marks for result "a b c"
07:49:07couven92sptorin_twitter, then `multiReplace` is the way to go
07:49:12FromGitter<superfunc> multiReplace can replace as many strings as you want.
07:50:13FromGitter<superfunc> ```code paste, see link``` ⏎ ⏎ results in `ccc` [https://gitter.im/nim-lang/Nim?at=59f82b34b20c6424296ba9c6]
07:50:20FromGitter<Yardanico> @superfunc you can use {} syntax
07:50:37FromGitter<Yardanico> echo strutils.multiReplace(str, {"a": ""), ("b": ""})
07:50:51FromGitter<couven92> @Yardanico you can???? :O
07:50:55FromGitter<Yardanico> ah sorry
07:51:01FromGitter<Yardanico> echo strutils.multiReplace(str, {"a": ""}, {"b": ""})
07:51:17FromGitter<superfunc> So in your case, something like `strutils.multiReplace(str, @["!", "?", "."])`
07:51:19FromGitter<Yardanico> ah no
07:51:22FromGitter<Yardanico> it doesn't work :(
07:51:50FromGitter<Yardanico> but I remember that it worked last time ...
07:52:04FromGitter<Yardanico> yes
07:52:04FromGitter<Yardanico> https://github.com/Yardanico/twitchrelay/blob/master/twitchrelay.nim#L70
07:52:25FromGitter<Yardanico> strutils.multiReplace(str1, {"a": "", "b": ""}) works
07:53:16FromGitter<couven92> @superfunc @sptorin_twitter no, the proper way to do it is as follows: ⏎ ⏎ ```echo strutils.multiReplace("a! b? c..", ("!", ""), ("?", ""), (".", ""))``` [https://gitter.im/nim-lang/Nim?at=59f82bece44c43700a9b7cd2]
07:53:26FromGitter<couven92> make use of varargs! ;)
07:53:51FromGitter<Yardanico> {} is nicer :P
07:53:53FromGitter<superfunc> yes yes, wasn't concerned about that bit :p
07:54:16FromGitter<sptorin_twitter> Tnx! I try use only one param like: `("!", "")` in multiReplace
07:54:21FromGitter<couven92> @superfunc you also realized your mistake as I typed out the correction I see
07:55:11FromGitter<superfunc> It was missing the groupings yeah
07:55:22FromGitter<superfunc> Though I still wrote it out as a seq
07:55:47couven92:) IRC is persistent! Your mistake has been logged :P
07:56:02FromGitter<superfunc> :)
07:56:27couven92yeah, doing it as a seq only creates (very tiny) overhead, varargs or array is cleaner here
07:56:54FromGitter<superfunc> No argument here
07:57:32FromGitter<Yardanico> couven92: why not {} ?
07:57:34FromGitter<Yardanico> syntax
07:58:02couven92I have no idead! I guess, because that syntax is completely foreign to me! :P
07:58:06FromGitter<Yardanico> it has no overhead too
07:58:19FromGitter<Yardanico> well it's very convenient to anyone who has used dictionaries or tables
07:58:23FromGitter<Yardanico> in other languages too
07:58:30couven92I only know the curlies for sets
07:58:53*couven92 triggers the **noob** alert sign!
07:59:32FromGitter<Yardanico> https://nim-lang.org/docs/manual.html#statements-and-expressions-table-constructor
08:00:01*Arrrr joined #nim
08:00:01*Arrrr quit (Changing host)
08:00:01*Arrrr joined #nim
08:00:11couven92huh! sometimes I really wonder how Araq dares to let me anywhere near the stdlib! :D
08:01:09*yglukhov joined #nim
08:01:39Araqcouven92: fix the html generation
08:02:11couven92oh! yeah, will do asap
08:02:20PMunchDid you break something couven92?
08:02:26couven92PMunch, not yet
08:02:52couven92not since my major hickup with the Android build.sh bug
08:03:13Araqno need to wonder, we have code reviews and tests to squeeze out quality
08:04:45couven92yeah! I have learned a LOT from you by getting review feedback! Makes me write slightly better Nim code next time :)
08:15:23yglukhovdom96: you around?
08:30:21*Vladar joined #nim
08:31:32FromGitter<mratsim> @krux02 @Araq, I’d love to have this PR soon: https://github.com/nim-lang/Nim/pull/5664 ⏎ ⏎ I tracked down my OpenMP perf issue. ⏎ It was due to multiple thread writing/reading to the same cache line during parallel reductions. I need to evaluate the sizeof(each_thread_result) at compile-time to make them at-least a cache line apart [https://gitter.im/nim-lang/Nim?at=59f834e44ff065ac1898dccc]
08:32:27Araqcan't merge it
08:33:13Araqtried, it breaks too much stuff and krux02 was removing things that really need to remain
08:34:16FromGitter<mratsim> ok. too bad :/
08:38:37*jjido joined #nim
08:39:28*obadz quit (Ping timeout: 252 seconds)
08:39:53*obadz joined #nim
08:57:09*XZentus quit ()
09:03:38*gokr joined #nim
09:16:38*Senketsu joined #nim
09:23:16*Senketsu quit (Quit: leaving)
09:28:38*Senketsu joined #nim
09:29:34FromGitter<mratsim> Yeah another programming language: https://github.com/LiXizhi/NPLRuntime/wiki/WhatIsNPL, NPL (neural parallel language) is based on luajit, target networking, graphics, audio and comes with a 3d physics engine
09:29:59ArrrrSo ... why is type forwarding done with pragma instead of by leaving its body empty? Like proc forward declaration.
09:33:54*slim_jim_jiss joined #nim
09:41:37*gokr quit (Ping timeout: 255 seconds)
09:44:21*Senketsu quit (Quit: leaving)
09:46:51*Senketsu joined #nim
09:51:21*Senketsu quit (Client Quit)
09:53:27*Tanger quit (Ping timeout: 240 seconds)
09:53:54*floppydh joined #nim
09:56:08*Senketsu joined #nim
09:58:39*cspar_ joined #nim
09:59:07*Tanger joined #nim
10:01:02*thomasross__ quit (Remote host closed the connection)
10:01:40*cspar__ quit (Ping timeout: 248 seconds)
10:01:40*d10n quit (Ping timeout: 248 seconds)
10:01:40*redlegion quit (Ping timeout: 248 seconds)
10:01:40*arnetheduck joined #nim
10:01:40*jackv quit (Ping timeout: 248 seconds)
10:01:52*thomasross_ joined #nim
10:02:18*jackv joined #nim
10:02:22*d10n joined #nim
10:02:22*d10n quit (Changing host)
10:02:22*d10n joined #nim
10:02:51*redlegion joined #nim
10:02:51*redlegion quit (Changing host)
10:02:51*redlegion joined #nim
10:04:02*gmpreussner quit (Ping timeout: 260 seconds)
10:04:10*gmpreussner joined #nim
10:04:27*demi- quit (Ping timeout: 240 seconds)
10:04:37*avsej quit (Ping timeout: 260 seconds)
10:04:41*slim_jim_jiss quit (Ping timeout: 246 seconds)
10:04:47*demi- joined #nim
10:06:17*avsej joined #nim
10:06:17*avsej quit (Changing host)
10:06:17*avsej joined #nim
10:07:14*JappleAck joined #nim
10:13:54*Senketsu quit (Quit: leaving)
10:14:29*Senketsu joined #nim
10:19:47*Tanger quit (Ping timeout: 260 seconds)
10:24:40*Tanger joined #nim
10:30:16*slim_jim_jiss joined #nim
10:32:19*floppydh quit (Quit: WeeChat 1.9.1)
10:33:53*ibutra joined #nim
10:34:48*floppydh joined #nim
10:38:20*qwertfisch is now known as zombiefisch
10:40:27*gokr joined #nim
10:41:05*slim_jim_jiss quit (Ping timeout: 246 seconds)
10:50:48*slim_jim_jiss joined #nim
10:52:29couven92I have a macro with a generic type parameter `T`, how do I get the type of T as a NimNode? when I use `getType(T)` I only get `Error: undeclared field: 'T'`
10:53:33*Trustable joined #nim
10:56:00Araqcouven92: it seems currently impossible, I stumpled upon this too
10:56:24couven92So take the type as typedesc parameter instead of generic?
10:56:46*Arrrr quit (Ping timeout: 264 seconds)
10:57:08Araqcouven92: sounds good
11:02:05couven92what is happening here? https://play.nim-lang.org/?gist=3611e4c134adb4d2aaecb201d25d9177
11:03:35*Snircle joined #nim
11:03:57couven92why does nim say that the array has to be discarded?
11:05:22couven92and why does it work when the macro returns untyped instead?
11:05:50FromGitter<Yardanico> use untyped unless you really need to use typed
11:05:59couven92really? :O
11:06:09couven92elaborate please
11:06:12FromGitter<Yardanico> yes, in macros you almost alwayse untyped
11:06:19FromGitter<Yardanico> ask @krux02 :D
11:10:02FromGitter<Yardanico> but I didn't encounter a situation where I need typed macro, I don't really know what are the differences
11:10:04FromGitter<Yardanico> ask Araq :)
11:10:27FromGitter<Yardanico> I mean sometimes I need "typed" argument for a macro, but not typed result
11:10:51PMunchTyped means that your AST is type checked before it's handed back. Your AST is illegal by itself since it doesn't discard the array, it's only when it's placed in the context of the assignment that it is legal. If you use untyped the AST is not type checked and you can return anything you like, even completely illegal Nim code. It will then be type-checked at a later point, in this case after it's been placed in the assignment context.
11:11:16couven92ah, thx PMunch
11:12:07FromGitter<alehander42> btw I remember I saw somewhere semityped discussion was it here or github ? I had some situations where I had to generated a macro(typed) invocation in a macro(untyped) and I wondered if this kind of mode would help me
11:13:11PMunchalehander42, we talked about it here yesterday
11:14:11PMunchAnd yes, it would probably help
11:14:32PMunchsemityped will basically allow you to get type information, but you have to manage errors yourself
11:14:48FromGitter<Yardanico> Araq wants to make "typed" work like "semityped"
11:14:58FromGitter<Yardanico> but it would be hard to do as you might expect :)
11:15:29FromGitter<alehander42> thanks, I'll look up for it
11:16:05FromGitter<mratsim> You can still do type checking in an untyped macro by delegating to a compile-time proc
11:16:55FromGitter<Yardanico> how?
11:17:09FromGitter<Yardanico> you accept NimNode arguments in compile-time proc
11:17:30FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/private/ast_utils.nim
11:18:41FromGitter<Yardanico> hmm, what is this pragma syntax ? :) never seen this one before :) just curious
11:19:05FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/93dcc00d7924d0eae0735078a1cfcbffa1e80bd8/src/tensor/private/p_accessors_macros_read.nim#L161
11:19:25FromGitter<mratsim> And the `hasType`is called there
11:19:33PMunchAnother benefit of semityped is that templates and macros within will be expanded before you get the result
11:19:47*dddddd joined #nim
11:20:09FromGitter<mratsim> Oh the weird pragma is probably due to mass find/replace
11:20:32FromGitter<mratsim> Like the one who did {.noInit, noInit.}
11:21:57FromGitter<mratsim> But I agree needing both typed and untyped args in a macro is non-trivial
11:23:00FromGitter<alehander42> hm I kinda need typed info for a sub-element of an untyped expression :D
11:23:12FromGitter<Yardanico> @mratsim well it is easy to understand
11:23:15FromGitter<alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f85d225a1758ed0f6f4c42]
11:23:19FromGitter<Yardanico> that untyped arguments aren't type checked
11:23:25FromGitter<Yardanico> but typed arguments are checked for errors
11:24:10FromGitter<alehander42> I can't just use typed here, because it wouldn't typecheck, but then I can't just getType of a child of an untyped node, so I need to generate `expand(string)` from s and then expand to get `typed`
11:24:32FromGitter<Yardanico> @alehander42 yes
11:24:44FromGitter<Yardanico> that's why semityped is needed, or typed needs to be chancked
11:24:50FromGitter<Yardanico> *changed
11:25:13FromGitter<mratsim> @alehander42 do it like me, call a typed macro on the subargs from the untyped macro
11:25:34*jjido quit (Ping timeout: 252 seconds)
11:25:53PMunchHmm, mratsim does that actually work?
11:25:59FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/93dcc00d7924d0eae0735078a1cfcbffa1e80bd8/src/tensor/accessors_macros_read.nim#L56
11:26:04FromGitter<mratsim> You bet it does
11:28:00PMunchDoes that expand templates as well?
11:28:31FromGitter<mratsim> With getAST maybe
11:28:45PMunchHmm, interesting
11:31:09FromGitter<alehander42> well that's what I am doing, I am doing
11:31:13FromGitter<alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f85f01976e63937e0bcdf9]
11:31:41FromGitter<alehander42> or at least it seems similar to ⏎ ⏎ ```result = quote do: ⏎ inner_typed_dispatch(`t`, `new_args`)``` [https://gitter.im/nim-lang/Nim?at=59f85f1c976e63937e0bce9b]
11:32:00FromGitter<mratsim> You need the do
11:33:16FromGitter<alehander42> why ? it works fine for me without `do`
11:33:22FromGitter<mratsim> getAST documentation is awfully short compared to how useful it is https://nim-lang.org/docs/macros.html#getAst,untyped
11:33:49FromGitter<mratsim> Oh? Interesting, have to check more what does the do do
11:34:22FromGitter<alehander42> :D I didn't know I can pass a block myself, I thought quote: was the only form
11:34:34FromGitter<Yardanico> it just allows you to construct ast nodes in a more convenient way
11:34:43FromGitter<Yardanico> e.g. like (almost) usual nim code
11:34:56FromGitter<Yardanico> quote do returns a nim ast too
11:36:03FromGitter<Yardanico> template + getAst is practically the same
11:37:01FromGitter<alehander42> I use quote all the time, I wondered if quote:block and quote do: block differ in behavior somehow
11:37:21FromGitter<Yardanico> ah, you was talking about quote vs quote do
11:37:22FromGitter<Yardanico> IDK really
11:38:39*ibutra quit (Quit: My iMac has gone to sleep. ZZZzzz…)
11:49:57FromGitter<Yardanico> Araq: is using ..< and .. without spaces before and after it fine? ⏎ E.g. "for x in 1..<6" or "for x in 1..5"
11:50:10FromGitter<Yardanico> just asking for my " projects" :)
11:50:26couven92I like spaces between
11:51:00FromGitter<Yardanico> well I want to know what's the true nim-way
11:51:01couven92if only for consistency (I think it better, too, but that's subject to opinion)
11:51:48couven92I see .. and ..< as operators, and my general rule is: spaces between operands and operators
11:53:16FromGitter<Yardanico> yay, I get programmer ads on reddit: ⏎ "Are you fluent in C++? If so, we would like to meet you. Our offer in a nutshell: a successful product + development without deadlines + challenging problems + 120k a year"
11:53:49*jjido joined #nim
11:54:18FromGitter<Yardanico> sadly it's not about Nim :P
11:58:23GitDisc<awr> how do you get the capacity of a sequence?
11:58:43federico3Yardanico: with a good enough compiler nobody will know you are actually writing in Nim
11:59:11GitDisc<awr> you can specify the capacity of a new sequence with newSeqOfCap but i can't find a way to retreive the capacity of an existing sequence
11:59:18FromGitter<Yardanico> awr: why do you need it?
11:59:49FromGitter<Yardanico> federico3: well you can search for string containing Nim in binaries :P
12:00:58FromGitter<mratsim> Development without deadlines ? Smells fishy :p
12:01:36federico3Yardanico: erhm, I was joking that you can generate C++ and claim it's written by you
12:01:37GitDisc<awr> i guess i don't really need to actually get the capacity
12:02:23FromGitter<Yardanico> federico3: well yeah, you can do that xD
12:02:38FromGitter<Yardanico> "my code is a bit weird but it works"
12:03:04FromGitter<mratsim> "why is it copyrighted Andreas Rumpf"
12:03:04GitDisc<awr> how does newSeq() choose the capacity of its result seq
12:03:16FromGitter<Yardanico> you can see it in the source :)
12:03:36FromGitter<mratsim> It's Len + 50 iirc?
12:04:17FromGitter<mratsim> Or a power of two
12:04:55GitDisc<awr> https://github.com/nim-lang/Nim/blob/badba83d38371726bafba5870d5fb927eb453e41/lib/system.nim#L3191
12:05:18FromGitter<Yardanico> it's not the thing that you're looking for I think
12:06:27GitDisc<awr> tbat seems to be it tho
12:06:28GitDisc<awr> https://github.com/nim-lang/Nim/blob/e5cb1a2dd547827ee750abbb21039d1cf0a30988/lib/system/mmdisp.nim#L161
12:07:41FromGitter<Yardanico> but really you shouldn't need capacity
12:08:46FromGitter<Yardanico> lol, I'll probably port https://github.com/matheuss/google-translate-token/blob/master/index.js and https://github.com/matheuss/google-translate-api/blob/master/index.js to nim :)
12:09:40FromGitter<Yardanico> the token generation stuff is insane
12:09:44FromGitter<Yardanico> it seems to be simpler here: https://github.com/Stichoza/google-translate-php/blob/master/src/Stichoza/GoogleTranslate/Tokens/GoogleTokenGenerator.php
12:10:05GitDisc<awr> why are addInt and mulInt used there anyway instead of operators + and *?
12:10:45GitDisc<awr> (forgive me for my ignorance, i don't know a whole lot about compilers)
12:10:52FromGitter<Yardanico> it seems to be a ASM instruction
12:11:20FromGitter<Yardanico> well I mean magic proc which has backend-specific implementation
12:11:34FromGitter<Yardanico> you can find it here
12:11:35FromGitter<Yardanico> https://github.com/nim-lang/Nim/blob/5f685bb0e6b2d68b9796e6a7d29469ce3f3b38ec/lib/system/arithm.nim
12:23:01*elrood joined #nim
12:23:54*bjz joined #nim
12:24:14*bjz quit (Client Quit)
12:24:25floppydhthis is legit no?: emit a c-function Foo then import it via: proc foo() = {.importc: "Foo".} no?
12:24:52FromGitter<Yardanico> you don't need = here
12:25:09FromGitter<Yardanico> proc foo() {.importc: "Foo".} maybe
12:25:59floppydhright, then my issue is elsewhere, thanks
12:27:38floppydhI'm getting "conflicting types for Foo" somehow
12:27:56floppydhFoo returns a "const char*" and importcs it to a proc that returns a cstring so should work no :/
12:28:50floppydhoh googling tells me it has something to do with me statically linking stuff apparently
12:30:12floppydhdoing it like this atm: {.passl: gorge("pkg-config xcb --static --libs").}
12:30:16floppydhapparently that's not supported anymore?
12:34:12*Amun_Ra quit (Ping timeout: 252 seconds)
12:35:59*Amun_Ra joined #nim
12:36:27floppydhapparently the issue with static-linking is that I can't importc the things I have just emitted anymore or so? - if I don't emit and then importc a function from the emitted block but instead write a proc and then as a proc-body emit the c-code and capture the arguments/result-var in the emitted block, it works
12:46:29*guelosk joined #nim
12:56:40*UxerUospr joined #nim
12:59:21FromGitter<couven92> @Araq in the recent (parallel) testament runs I can see tests failing, but the test run in itself succeeded. Why is that?
13:01:46*yglukhov quit (Remote host closed the connection)
13:02:40FromGitter<couven92> For example, I can see my NaN test fail, because apparently different OSes and compilers have different ways of stringifying NaN (which I didn't know before)
13:03:12*yglukhov joined #nim
13:04:26*yglukhov quit (Remote host closed the connection)
13:04:39*yglukhov joined #nim
13:12:13FromGitter<dandevelo> I have this gist: https://gist.github.com/anonymous/2ffddd1c82e9e72d84b9e093ecdbf843
13:13:26FromGitter<dandevelo> Can I create a some sort of template that would expand the handler1 and handler2 fields with Obj1 as parameter in order to avoid writing those fields twice?
13:14:01FromGitter<dandevelo> the only difference between those fields definitions is Obj1 and Obj2. Can I generate those field definitions using a template/
13:15:50FromGitter<Yardanico> can you post an example how you want to use this template?
13:16:03FromGitter<dandevelo> sure, just a moment
13:17:09FromGitter<dandevelo> https://gist.github.com/anonymous/2750b2180fa74f0d339c94e872658bd9
13:18:41FromGitter<Yardanico> ah, like this
13:21:53FromGitter<dandevelo> Is that something that can be accomplished with Nim?
13:25:26FromGitter<Yardanico> well, as usual: why do you want this ? :)
13:26:27FromGitter<dandevelo> I want to be able to define Obj1.handler1() and Obj2.handler1() for two different object types without having to duplicate code
13:27:17FromGitter<Yardanico> why not Obj.handler() and Obj2.handler() ?
13:27:25FromGitter<Yardanico> or use object inheritance after all?
13:30:07FromGitter<dandevelo> I first tried doing it using inheritance and that didn't go well. Guess I will try it again
13:31:11FromGitter<Yardanico> well I mean - why would you need things like that ? :)
13:34:15FromGitter<dandevelo> These are event handlers for some custom controls. The handler functions look the same except for the first parameter (which is different based on the object type
13:35:28FromGitter<dandevelo> The event handlers are stored as fields and not procedures so that I can easily swap implementation for a particular event if I need to
13:35:52FromGitter<dandevelo> Does this make sense?
13:43:39FromGitter<dandevelo> I also thought of something like generic types: https://gist.github.com/anonymous/abec9e5ea2855a60fcb95687424ef92f
13:43:52FromGitter<dandevelo> But this doesn't seem to compile
13:43:58*couven92 quit (Read error: Connection reset by peer)
13:44:10FromGitter<mratsim> @floppydh did you try {.compile: your c file.} ? If you have a source code this is easy
13:44:38floppydhmratsim I didn't, will shortly
13:46:16FromGitter<mratsim> @dandevelo I'm like Yardanico, I'm sure you are trying something strange.
13:46:39FromGitter<mratsim> But you should probably use a template
13:46:54FromGitter<mratsim> let me fetch you an example
13:47:03FromGitter<dandevelo> @mratsim I would appreciate that :)
13:47:57FromGitter<mratsim> Here: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/fallback/blas_l3_gemm_micro_kernel.nim
13:48:15FromGitter<mratsim> At the bottom I have almost the exact same proc except for the types
13:48:43FromGitter<mratsim> I define a template that accepts "C: typed"
13:49:00FromGitter<mratsim> And the procs at the bottom just call that template
13:49:31FromGitter<mratsim> Template are inlined so there is no indirection/overhead at runtime
13:51:24elrooddandevelo: if you want to avoid duplicating code, why stop at generating the handlers? would something along these lines work? https://gist.github.com/anonymous/7c23fe24e816de7733748de952841506
13:52:15FromGitter<mratsim> ^
13:52:32FromGitter<dandevelo> @martsim I will take a look now. Do you believe templates would also work inside type definitions?
13:52:58FromGitter<mratsim> Elrood solution is probably the best actually
13:53:14FromGitter<mratsim> Check identifier construction on the manual as well
13:53:39FromGitter<dandevelo> @elrood that looks like a good idea except fields(such as field:string in your example) would be different for different objects
13:54:07FromGitter<dandevelo> @elrood how would I add additional fields (like field2:string to Obj2 in that example?
13:54:44FromGitter<mratsim> But why do you need the handler be part of the object type?
13:55:19FromGitter<mratsim> Just keep data and metadata in the object and proc apart, this way you can generate the proc with a template
13:56:19FromGitter<dandevelo> I need this in order to be able to easily swap handlers when needed
13:56:39FromGitter<dandevelo> like this obj1.handler1 = otherImplementation()
13:56:46FromGitter<mratsim> I see
13:58:59FromGitter<mratsim> Check this as well, this is how I store proc in an object https://github.com/mratsim/nim-rmad/blob/master/src/autograd.nim
14:01:17FromGitter<dandevelo> Taking a look now. I noticed you use .noSideEffect a few times. Never really undestood how that works
14:03:40GitDisc<awr> is func getting added in 0.18
14:04:25GitDisc<awr> as an alias to proc ... {.nosideeffect.}
14:06:33FromGitter<mratsim> @dandevelo noSideEffect tells the compiler to check that I only read/modify variable passed as arguments to the function. i.e. function is pure: if it calls with the exact same arguments it will always give the same result
14:07:44FromGitter<mratsim> Using global variables, accessing string/stdout or using threading in a function will throw a compile error when noSideEffect is enabled
14:07:58elrooddandevolo: https://gist.github.com/anonymous/9943f7dcf88089fc8e63e6127b15c834 <- you could do this, but for more fields and types that'd become awkward quite quickly, in that case a better separation between data and handlers would probably make more sense
14:10:26*gggs quit (Ping timeout: 248 seconds)
14:10:55FromGitter<mratsim> @dandevelo some more info/propaganda (serious) https://alvinalexander.com/scala/fp-book/benefits-of-pure-functions (silly version) http://www.deadcoderising.com/2017-06-13-why-pure-functions-4-benefits-to-embrace-2/
14:11:27*gggs joined #nim
14:14:06FromGitter<dandevelo> Thank you @mratsim going to read it now.
14:14:35FromGitter<dandevelo> @elrood agree that looks awkward
14:15:45FromGitter<mratsim> I think it's ok
14:17:02FromGitter<mratsim> It's much better than the classFactory in Java
14:17:46FromGitter<dandevelo> Yes, that is ok for few fields
14:21:03FromGitter<Yardanico> awr: no
14:21:16FromGitter<Yardanico> func doesn't have noSideEffect ATM IIRC
14:25:41FromGitter<data-man> Hi! ⏎ is anyone using the Midnight Commander?
14:27:45*miran__ joined #nim
14:30:24federico3data-man me
14:31:44FromGitter<alehander42> @data-man my father :D
14:32:20FromGitter<data-man> I want to implement a Nim syntax highlighting for mcedit, but doing it manually is too lazy for me. :)
14:32:20FromGitter<alehander42> i've been literaly told tales of it for sleeping when I was little
14:34:25FromGitter<data-man> is there any ready-made utility for generating all a proc names of the stdlib?
14:35:59subsetparkyour father told you about file managers as a bedtime story?
14:36:35FromGitter<data-man> nim genTags ... would be perfect :)
14:38:17PMunchsubsetpark, probably an easy way to make him sleep :P
14:38:28*nsf quit (Quit: WeeChat 1.9.1)
14:38:56*sleepyqt joined #nim
14:38:59subsetparkI've gotta hear these stories
14:40:19FromGitter<alehander42> well obviously he wouldn't tell me stories about dependent typing
14:40:22FromGitter<alehander42> I was just a child
14:40:42subsetparkhaha
14:44:07FromGitter<stisa> @data-man I don't think there is, you could try using the json generated by running `nim jsondoc2 <lib.nim>`
14:46:00FromGitter<stisa> or maybe check how https://nim-lang.org/docs/theindex.html is generated
14:48:53FromGitter<data-man> @stisa: Thanks! I think I'll do a PR to the ctags. :)
14:52:08subsetparkuniversal ctags support would be awesome
14:57:30*Sentreen quit (Quit: WeeChat 1.6)
14:57:38FromGitter<dandevelo> Ok, I managed to create a sample to illustrate better what I am trying to achieve: https://play.nim-lang.org/?gist=a452b1fe4026d92b6cad9fc94a75d8ef
14:57:40*Sentreen joined #nim
14:58:09FromGitter<dandevelo> The thing is, this crashes the compiler. Any idea what am I doing wrong?
15:00:18FromGitter<dandevelo> This is the code: https://gist.github.com/anonymous/a452b1fe4026d92b6cad9fc94a75d8ef
15:02:23FromGitter<dandevelo> @mratsim @Yardanico @elrood do you see anything wrong with this code?
15:04:15*dandevelo joined #nim
15:07:28FromGitter<Yardanico> probably FirstControl* = ref object of EventHandler[FirstControl] ⏎ ⏎ ``` someField: int``` [https://gitter.im/nim-lang/Nim?at=59f891b0614889d475226f46]
15:07:34FromGitter<Yardanico> maybe it does the infinity recursion
15:08:59FromGitter<dandevelo> Do you think that could be written another way?
15:11:01FromGitter<dandevelo> I wonder what @Araq thinks about this segmentation fault
15:11:16FromGitter<Yardanico> ah no wait
15:11:31FromGitter<Yardanico> yeah, it's recursion:
15:11:33FromGitter<alehander42> that's just infinite recursion because you construct your type that way, not a segfault
15:11:47FromGitter<alehander42> what are you trying to achieve>?
15:12:03FromGitter<dandevelo> @alehander42 that is what the compiler reports: Segmentation fault: 11
15:12:17FromGitter<Yardanico> @dandevelo it reports that with release mode
15:12:27FromGitter<Yardanico> try it in debug mode, it'll show full traceback as any nim program :)
15:12:38FromGitter<Yardanico> full compiler log: https://gist.github.com/Yardanico/108c893809bc98535d86dc625e115d83
15:13:37FromGitter<alehander42> exactly
15:13:48FromGitter<dandevelo> Do you have any idea on how to fix that?
15:16:53FromGitter<lguzzon> Just put new after equal ... ⏎ var ctrl1 = FirstControl() ⏎ var ctrl2 = SecondControl()
15:17:12FromGitter<lguzzon> var ctrl1 = new FirstControl() ⏎ var ctrl2 = new SecondControl()
15:17:22FromGitter<lguzzon> may be ...
15:17:36FromGitter<Yardanico> @lguzzon no
15:17:41FromGitter<Yardanico> well yeah, his code is incorrect here
15:17:47FromGitter<Yardanico> but compiler crash is because of recursion at line 10
15:18:03FromGitter<Varriount> @dandevelo Use a ref as that generic parameter
15:18:23FromGitter<Yardanico> so it will be ref of ref ? :D
15:18:40FromGitter<Yardanico> because FirstControl itself is a ref
15:19:57FromGitter<dandevelo> So the question is how do we get rid of that recursion at line 10
15:21:43FromGitter<alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8950732e080696e49e9c9]
15:21:46FromGitter<alehander42> use concepts
15:21:52FromGitter<Yardanico> ohhh
15:22:13FromGitter<Yardanico> @alehander42 fancy stuff ! :)
15:22:32FromGitter<Yardanico> ah no
15:22:32FromGitter<Yardanico> wait
15:22:36FromGitter<Yardanico> he can't use that
15:22:53FromGitter<Yardanico> @dandevelo said that he need to be able to change handlers
15:23:00FromGitter<dandevelo> Yes, that's the thing
15:23:12FromGitter<Yardanico> you couldn't do that at runtime with concepts
15:23:23FromGitter<alehander42> so you want to be able to do `ctrl1.onKeyPress = handler` ?
15:23:29FromGitter<dandevelo> Right
15:24:12FromGitter<mratsim> You can store a concept proc as a closure no?
15:24:38FromGitter<Yardanico> well you can
15:24:48FromGitter<Yardanico> but you can't change a handler of a type at runtime
15:24:54FromGitter<mratsim> The current limitation in concept is to do a collection of heterogenous types
15:24:56FromGitter<Yardanico> because concepts are resolved at compile-time
15:25:20FromGitter<Yardanico> @mratsim e.g change the keypress handler of ctrl1 object at runtime
15:25:26FromGitter<mratsim> But the proc type signature is the same so if only implementation changes it's ok?
15:26:29FromGitter<Yardanico> well I can't explain why it isn't possible, but it's not possible AFAIK :)
15:26:37FromGitter<Yardanico> because all this stuff is compiletime anyway
15:27:26FromGitter<mratsim> Na it is, if type signature for all handlers of a type is the same they can all be stored in a field
15:27:54FromGitter<mratsim> The only question is about recursion
15:27:57FromGitter<Yardanico> can you show an example how that would work? :)
15:28:24FromGitter<mratsim> Going home first, wait for a bit
15:28:48FromGitter<stisa> maybe look at how stream does it? https://nim-lang.org/docs/streams.html
15:29:19FromGitter<Yardanico> yeah, streams way is the most efficient one
15:29:34FromGitter<Yardanico> nim-way of writing *interfaces* :)
15:29:43FromGitter<Yardanico> and it's the most efficient way to do that
15:29:45*gokr quit (Ping timeout: 246 seconds)
15:29:57*jjido quit (Ping timeout: 240 seconds)
15:32:47FromGitter<lguzzon> here my dime on the table: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8979f210ac2692053287c]
15:33:35*UxerUospr quit (Quit: leaving)
15:35:57*PMunch quit (Quit: Leaving)
15:37:14*UxerUospr joined #nim
15:37:29FromGitter<alehander42> you can do ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ but I admit that's not too great [https://gitter.im/nim-lang/Nim?at=59f898b9f7299e8f5355722c]
15:38:35FromGitter<data-man> https://github.com/xomachine/metaevents ?
15:39:34FromGitter<Yardanico> lol
15:39:45FromGitter<Yardanico> If you can't acces some website on Chrome because of invalid HSTS
15:39:50FromGitter<Yardanico> you can type "badidea" in that chrome window
15:39:53FromGitter<Yardanico> and it will load this page :P
15:40:34*abc joined #nim
15:40:58*abc is now known as Guest6875
15:41:07FromGitter<Yardanico> https://chromium.googlesource.com/chromium/src/+/90b6605758feea9d4f2a56ad3f6992e1e868b445/components/security_interstitials/core/browser/resources/interstitial_v2.js
15:42:14Guest6875Hi, I am new to Nim. Just downloaded it and tried to send get request. I get this error on running the code `Error: unhandled exception: No such host is known`. The website is correct and I can send GET through other programming languages. That link just redirects to another link.
15:42:57FromGitter<andreaferretti> @Yardanico cool! Not that I have a page to test this :-)
15:43:45FromGitter<dandevelo> @lguzzon I am not sure how to call onKeyPress with your example
15:44:34FromGitter<dandevelo> This is because the self parameter is a FirstControl_Fields
15:46:41FromGitter<Yardanico> Guest6875: what's the url?
15:47:28Guest6875https://amizone.net/
15:48:57FromGitter<dandevelo> @alehander42 this might work, reading now to understand the concepts part
15:50:22Guest6875I just ran this code - var client = newHttpClient() var response = client.get("https://amizone.net/")
15:51:57Guest6875and compiling with `-d:ssl`
15:52:25FromGitter<dandevelo> @Yardanico @stisa going to take a look at the streams approach
15:53:10FromGitter<Yardanico> Guest6875: hmm, happens to me too, it can be either one on these: misconfiguration of this server, or bug in httpclient :) report it to github issues
15:53:31FromGitter<Yardanico> or bug in net/nativesockets
15:54:46Guest6875No github account, sorry. Can someone else open the issue please.
15:55:28FromGitter<Yardanico> ok
15:55:52federico3I'll do it
15:56:10FromGitter<Yardanico> ok, do it :)
15:56:23Guest6875thanks!
15:57:58FromGitter<stisa> strange, doing the request on `https://amizone.net/amizone/` seem to work
15:58:26Guest6875Yeah.
15:58:50Guest6875Using dart as well as Red, the GET request works on "https://amizone.net/" also
15:58:53FromGitter<Gooseus> is quite strange... fails if use just http as well
15:59:10FromGitter<gogolxdong> what is the right way to translate ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=59f89dce210ac26920534f94]
15:59:17federico3getaddrinfo is failing before the connect
15:59:37FromGitter<Yardanico> yep
15:59:42FromGitter<Yardanico> and a strange thing
15:59:49FromGitter<Yardanico> for some reason nim tries to resolve amizone.netamizone
15:59:54federico3getaddrinfo returns -2
15:59:58FromGitter<Yardanico> after tring amizone.net
16:00:00FromGitter<Yardanico> *trying
16:00:47FromGitter<Yardanico> yeah it successes 0_0
16:00:50FromGitter<Yardanico> or wait
16:01:44FromGitter<Yardanico> try to echo address at line 1537 in net.nim
16:01:54FromGitter<Yardanico> it would echo it - so it succedes
16:02:02FromGitter<lguzzon> @dandevelo ⏎ https://play.nim-lang.org/?gist=05423cd1a2a1f6afb5f42a9cc2953318
16:02:04FromGitter<Gooseus> @Varriount let me know your feedback on the nimaws from yesterday, was hoping to clean it up some more today
16:03:40FromGitter<Yardanico> federico: will you make an issue? or you already fixed it? :D
16:03:57FromGitter<dandevelo> Thanks @lguzzon looks like a little bit of code to write in case of more than 2 handlers
16:04:10federico3Yardanico: almost
16:07:15FromGitter<Yardanico> 47 issues to close
16:07:20FromGitter<Yardanico> to have 3k closed issues :)
16:09:57GitDisc<GooRoo> @Yardanico JFYI: whenever you see C++, 120k and Berlin in one sentence, you can most certainly say it's a job in think-cell
16:10:58GitDisc<GooRoo> their ad is everywhere
16:16:58FromGitter<data-man> @subsetpark: my progress on the Nim support in the ctags is here: https://github.com/data-man/ctags/tree/nim_support ⏎ While the Nim parser is simply copied from Python. :)
16:22:12*Arrrr joined #nim
16:22:12*Arrrr quit (Changing host)
16:22:12*Arrrr joined #nim
16:29:59*gokr joined #nim
16:37:32FromGitter<dandevelo> @Yardanico @stisa I guess this is how it looks with the "streams" approach: https://gist.github.com/0a23d4cabb1edc42689f2657182991a0
16:37:48miran__Yardanico: we celebrate 3K closed issues with v1.0? :P
16:46:00FromGitter<dandevelo> Shorter version here: https://gist.github.com/7eec565e7157db7eddda3fc3c94970cd
16:59:21*floppydh quit (Quit: WeeChat 1.9.1)
17:01:57*Guest6875 quit (Quit: Page closed)
17:04:00*arnetheduck quit (Ping timeout: 248 seconds)
17:08:08*vivus joined #nim
17:09:52*JappleAck quit (Ping timeout: 252 seconds)
17:12:03*slim_jim_jiss quit (Remote host closed the connection)
17:12:26*slim_jim_jiss joined #nim
17:12:34*guelosk quit (Ping timeout: 260 seconds)
17:20:56*Ven joined #nim
17:21:21*Ven is now known as Guest12701
17:24:25*PMunch joined #nim
17:27:11*JappleAck joined #nim
17:36:27*elrood quit (Quit: Leaving)
17:50:25*Vladar quit (Remote host closed the connection)
17:51:20FromGitter<mratsim> @dandevelo @yardanico Alternative with closure. You can metaprogramm the hell out of that too: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8b8184ff065ac189bd5fd]
17:52:05FromGitter<mratsim> @dandevelo I think it would be great if you put your problems and all the solutions on the forum, so that people can compare and we can show to new people how things can be done.
17:52:21*Jesin quit (Quit: Leaving)
17:55:52*Jesin joined #nim
17:57:40*yglukhov quit (Remote host closed the connection)
17:58:16*yglukhov joined #nim
18:00:38FromGitter<dandevelo> @mratsim that is a good idea
18:00:50*Trustable quit (Remote host closed the connection)
18:00:59FromGitter<mratsim> @dandevelo Metaprogrammed alternative, 23 lines ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8ba5ab20c6424296eff40]
18:01:40FromGitter<cabhishek> @mratsim My talk went well, got some good feedback which I'll incorporate in my next talk. Also, people were curious after the talk as no one had heard of Nim. There were few talks about making python fast/performant/type safe etc which acted as a segway for my talk on Nim 
18:01:53FromGitter<mratsim> cool =)
18:01:55FromGitter<Yardanico> @cabhishek video ? :)
18:02:07*yglukhov quit (Read error: Connection reset by peer)
18:02:14FromGitter<mratsim> I saw Netflix Vectorflow by the way, i’m gonna eat that cake as well ;)
18:02:25*yglukhov joined #nim
18:06:05*dandevelo quit (Remote host closed the connection)
18:06:57*yglukhov quit (Ping timeout: 248 seconds)
18:13:57*gokr quit (Ping timeout: 240 seconds)
18:17:03*nsf joined #nim
18:23:47*slim_jim_jiss quit (Ping timeout: 246 seconds)
18:29:09shashlickdom96: does choosenim support proxies? I have http_proxy defined in env but choosenim is unable to connect
18:31:44shashlickthe error I get is "Error: unhandled exception: No such host is known."
18:34:53*Vladar joined #nim
18:35:47FromGitter<Yardanico> say goodbye to our travis and appveyor :P
18:36:05FromGitter<Yardanico> 10 PRs in ONE HOUR
18:36:06FromGitter<Yardanico> :D
18:38:56*zolk3ri joined #nim
18:47:45FromGitter<mratsim> Travis has “Linux capacity issue” yesterday :/
18:48:19FromGitter<data-man> 13 MuaHaHa :)
18:49:16*Guest12701 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:51:15federico3Yardanico when is the hour starting precisely?
18:53:59FromGitter<Yardanico> all these PRs
18:54:00FromGitter<Yardanico> (https://files.gitter.im/nim-lang/Nim/o01l/image.png)
18:54:11FromGitter<Yardanico> 11 already
18:54:47federico3Yardanico PRs.inc ;)
18:55:01FromGitter<Yardanico> lol
18:55:01FromGitter<Yardanico> 12
18:55:06FromGitter<Yardanico> well 11 already
18:55:12FromGitter<Yardanico> bitops was created at 20:52 (my time)
18:55:18FromGitter<Yardanico> now it's 21:55
18:55:47federico3hah!
18:56:09*yglukhov joined #nim
18:56:28FromGitter<cabhishek> @mratsim sounds good! I know the lead developer of vector flow incase you want his contact :)
18:56:58*yglukhov quit (Remote host closed the connection)
18:57:12*yglukhov joined #nim
18:59:09*yglukhov quit (Read error: Connection reset by peer)
18:59:45*yglukhov joined #nim
19:14:35*rauss quit (Read error: Connection reset by peer)
19:16:25*rauss joined #nim
19:20:03FromGitter<dom96> @shashlick I don't think so, please report an issue
19:21:14FromGitter<mratsim> @cabi
19:21:56FromGitter<mratsim> @cabhishek hehe, probably I’ll ask him to brag first when i covered all his use cases ;).
19:23:58FromGitter<Yardanico> Araq: just if you didn't knew, tester is broken - even if tests are failing it returns 0 :)
19:25:41*Ven joined #nim
19:26:05*Ven is now known as Guest53736
19:32:33*Vladar quit (Remote host closed the connection)
19:36:05*Arrrr quit (Ping timeout: 240 seconds)
19:43:41*gokr joined #nim
19:51:20*Arrrr joined #nim
19:51:20*Arrrr quit (Changing host)
19:51:20*Arrrr joined #nim
20:00:51Araqyardanico: ouch, I thought I tested against that
20:12:23*Arrrr quit (Read error: Connection reset by peer)
20:12:32GitDisc<awr> oh cool when did circular module dependencies become an error?
20:13:17GitDisc<awr> i had accidentally done a circular dependency a while ago and, well, it breaks things
20:13:57GitDisc<awr> took me a while to track down what i was doing wrong
20:19:12GitDisc<awr> oh wait
20:19:15GitDisc<awr> what the hell
20:19:38GitDisc<awr> https://glot.io/snippets/ev2e2q930s
20:26:23GitDisc<awr> it only seems to error if `import b` precedes `let x* = 3`
20:28:25*Guest53736 is now known as Ven``
20:32:08FromGitter<Gooseus> hey neat, node 8.9 is now LTS, so looks like I can start using async/await there as well
20:33:05Araqawr: Nothing really changed recently wrt recursive module deps
20:33:13Araqwe added some detection
20:33:19Araqthey never worked reliably
20:33:34Araqno regressions were reported, you're late
20:34:17Araqactually, devel now supports breaking up cycles via "Package scoped types"
20:46:56FromGitter<Gooseus> so question, this node 8.9 release has a new piece called N-API which provides a simple api for writing c/c++ v8 plugins... think this has any relevance here? https://medium.com/the-node-js-collection/n-api-next-generation-node-js-apis-for-native-modules-169af5235b06
20:54:39Araqmaybe, but I see Nim's value in standing on its own feet, not as means to expand the frightening node.js even further
20:54:47*PMunch quit (Quit: leaving)
21:00:48FromGitter<Gooseus> yeah, true, I was thinking that using Nim as a bridge to C for the node community would bring in a lot of interest and maybe you could get some converts and more library/core devs
21:03:07*Argon joined #nim
21:03:57*UxerUospr quit (Quit: leaving)
21:04:54*Argon left #nim (#nim)
21:09:57FromGitter<Yardanico> Araq: how to compiler C sources for a specific os? build.sh doesn't auto detect termux (android). I remember it's something like "sh build.sh --os:android"
21:11:04*couven92 joined #nim
21:11:57*miran__ quit (Ping timeout: 260 seconds)
21:12:25FromGitter<Yardanico> Ah nvm
21:12:31FromGitter<Yardanico> It's --os android
21:16:13couven92yeah @Yardanico sorry doing --os space osname was just simpler to code into the `build.sh`
21:16:55couven92I don't do shell! :P Only plain old Windows Command Prompt! cmd FTW!!!! :D
21:17:18*couven92 ducks pending incoming hits
21:18:40*smt` quit (Ping timeout: 258 seconds)
21:19:28*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
21:19:56*nsf quit (Quit: WeeChat 1.9.1)
21:20:02FromGitter<Yardanico> Couven92 what option I need to pass to Nim compiler to compile koch?
21:20:09FromGitter<Yardanico> After I compiled csources
21:20:18couven92on android?
21:20:33FromGitter<Yardanico> Yes
21:20:37couven92`nim compile --os:osname koch`
21:20:58couven92(or rather `bin/nim compile --os:osname koch`
21:23:08*Snircle joined #nim
21:23:51FromGitter<Yardanico> https://gist.github.com/Yardanico/34c7cc4be173786359386eb2a465ce8d hmm, I thought that this one has been fixed
21:24:27FromGitter<Yardanico> So I should use some option like --shBinPatg
21:24:38*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:24:45FromGitter<Yardanico> shBinPath, I don't remember the exact name ;)
21:24:45couven92uhm that's strange, that really is fixed!
21:24:59couven92yeah, that won't work anymore, I removed that
21:25:09couven92hang on, let me see
21:27:00FromGitter<Yardanico> Maybe it was fixed after 0.17.2 ? Hmm
21:28:23FromGitter<data-man> @Yardanico: Android on real device or emulated?
21:28:23Araqno
21:29:45couven92@Yardanico, https://github.com/nim-lang/Nim/blob/devel/lib/pure/osproc.nim#L770 apparently you can still do `useShPath:/system/bin/sh`
21:30:25couven92so then it'll be `nim c -d:useShPath:/system/bin/sh --os:android koch`
21:31:27couven92and I'll do a PR to fix this better than it is now :) This is remnant from the time we didn't have the android define symbol
21:32:19couven92AH! We added `@if termux` in https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L95
21:32:43couven92that's not good :/
21:33:30FromGitter<Yardanico> @data-man real of course, Nim has been ported to android (termux)
21:34:03FromGitter<Yardanico> In this year
21:37:31couven92@Yardanico, so --define:termux is probably the best option to go for...
21:37:53FromGitter<brentp> I'm trying to do this: ```{.emit:""" ⏎ ⏎ ===define bam_get_qual(b) ((b)->data + ((b)->core.n_cigar<<2) + (b)->core.l_qname + (((b)->core.l_qseq + 1)>>1))=== ⏎ ⏎ """.} ... [https://gitter.im/nim-lang/Nim?at=59f8ed31f7299e8f535777cc]
21:37:57couven92However, the /system/bin/sh should always be used on android anyways, so I'll fix that
21:39:30FromGitter<brentp> @brentp blah this: https://pastebin.ca/raw/3902060
21:39:57FromGitter<brentp> but I get `:(.text+0x745): undefined reference to `bam_get_qual'`
21:43:48*Ven joined #nim
21:43:49FromGitter<brentp> can I emit a macro like this?
21:44:11*Ven is now known as Guest77569
21:46:05FromGitter<Yardanico> You should use emit in your proc too
21:46:11FromGitter<Yardanico> To use your C macro
21:46:11couven92@Yardanico here you go: https://github.com/nim-lang/Nim/pull/6661
21:46:27FromGitter<Yardanico> C macros can't be importc'ed AFAIK
21:46:45couven92@Yardanico, yes they can!
21:46:58couven92you just must not use dynlib
21:47:14FromGitter<Yardanico> C macros?
21:47:16FromGitter<Yardanico> What?
21:47:42couven92but you must do: `proc fancypants(): void {.importc: "FANCYPANTS", header: "fancypants.h".}`
21:47:48couven92header is important here!
21:48:39FromGitter<brentp> hmm. ok.
21:49:15FromGitter<brentp> so I emit and import from the header?
21:49:42FromGitter<Yardanico> Couven92: but @brentp emits this C macro and importc it the same Nim file
21:49:50FromGitter<Yardanico> *it in
21:49:55couven92oh
21:50:06couven92then don't use header, should still work
21:50:34couven92importc basically only tells the nim compiler not to mess the name up, if I understand correctly
21:51:31FromGitter<brentp> so, I'm not following. How would I change the code that I have: https://pastebin.ca/raw/3902060
21:52:11couven92@brentp I apparently cannot open your pastebin link :(
21:52:19couven92I get invalid post ID
21:52:49FromGitter<brentp> https://gist.github.com/brentp/bb97f755387cc250f78015322baad22d
21:55:47couven92@brentp this works fine for me
21:55:49couven92https://gist.github.com/ae554cdd08b34b6bc3bb8d1e443ffcdb
21:56:14couven92(emits a macro for printf and then calls that macro)
21:59:06FromGitter<data-man> And why didn't anyone remember Halloween today? ⏎ Congratulations! :)
21:59:44FromGitter<Yardanico> Well as you may know we don't really celebrate it in Russia 
22:00:25FromGitter<brentp> hmm @couven92 I can't get the corresponding thing to work for my problem. will keep looking.
22:01:01FromGitter<data-man> I know, I'm in Russia :)
22:02:40couven92@brentp that's strange
22:03:00FromGitter<Yardanico> @brentp did you try to write it in Nim?
22:03:03couven92Araq, I started with testament HTML, I was blocked immdediately: https://github.com/nim-lang/Nim/issues/6663
22:03:08FromGitter<Yardanico> E.g without emit
22:03:27couven92@Yardanico can you tag that issue with `crash` label please
22:04:25couven92thanks! :)
22:06:17FromGitter<Yardanico> Well I labeled it before I saw your message :)
22:06:43couven92you're the label master! :)
22:06:57FromGitter<Yardanico> I use FastHub as a Github client for android btw
22:11:48FromGitter<Yardanico> Couven92: I labeled it as a regression if it worked with 0.17.2
22:12:06couven92+1
22:13:24FromGitter<brentp> got a little farther. I was calling it from an inlined function. that doesn't work. but now it's giving errors inside the macro
22:13:29FromGitter<brentp> ``````
22:13:40FromGitter<brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f8f594d6c36fca31be643c]
22:14:16FromGitter<brentp> I guess I'll write it in nim. wanted to avoid hopping around the pointer arithmetic
22:27:39*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:28:47*Guest77569 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:30:20*Ven joined #nim
22:30:44*Ven is now known as Guest44505
22:35:17FromGitter<brentp> by the way. I started learning nim a few months ago. I wrote a simple command-line tool for genomics.
22:35:23FromGitter<brentp> then people started using it a lot.
22:35:43FromGitter<brentp> I wrote it up and it's now published here: https://academic.oup.com/bioinformatics/article/4583630
22:37:16FromGitter<brentp> https://github.com/brentp/mosdepth
22:37:24*def-pri-pub joined #nim
22:39:48couven92Araq, what is the problem with testament HTML gen? It seems to be working fine for me... (except for nim crashing on compile)
22:40:15couven92I should maybe remove CPU and OS though, since they aren't used anymore?
22:41:28*Trustable joined #nim
22:48:15*Guest44505 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:52:27FromGitter<zetashift> @brentp How was your experience with Nim in this area? Isn't most user work done with R?
22:53:56*libman joined #nim
22:57:45FromGitter<data-man> @brentp: then you need to write like this: "... and hacking in python, go, C, bash, Nim (the best!)" :)
22:59:24Araqcouven92, it takes too much time and seems to be an O(n^2) algorithm
22:59:42couven92ah, okay, that I can fix
22:59:45Araqyou iterate over the results in a weird way and I don't understand why, simplify it
22:59:52couven92will do
23:00:06Araqbtw your NaN tests fail
23:00:09couven92any idea why nim stack overflows while compiling testament
23:00:11Araqfor mingw
23:00:12couven92yeah I know
23:00:34couven92But TravisCI and AppVeyor didn't catch that in the CI run
23:00:43couven92why is that?
23:01:27AraqI broke the tester, that's why
23:01:35couven92I'll just remove the NaN tests and replace with a call to isNan or sth... stringify isn't really that important, detecting Nan is
23:01:43Araqer nope
23:01:54Araqstringify needs to produce consistent results
23:02:00couven92oh
23:02:02Araqand we have lots of hacks for that already anyway
23:02:13Araqonly needs a little tweaking
23:02:15couven92okay, I'll see into it
23:02:56couven92what do you prefer? `NaN` like JavaScript
23:03:36couven92maybe a nice infinity unicode rune for INFINITY? :P
23:04:15couven92should I care about differentiating between signaling NaN and non-signaling NaN?
23:06:48Araqno
23:07:13Araqalso it's "nan" and "inf" apparently
23:07:25couven92okay fine :)
23:09:35FromGitter<brentp> Actually the experience was very good I was wrapping a C library and then writing custom stuff on top of that.
23:11:57FromGitter<brentp> I'm already doing other projects in Nim as well
23:17:19*zolk3ri quit (Remote host closed the connection)
23:21:27*tdc quit (Ping timeout: 240 seconds)
23:23:44*yglukhov quit (Remote host closed the connection)
23:26:24GitDisc<treeform> Isn't there are like 8 Nans?
23:27:48GitDisc<treeform> I stand corrected there are 16,777,214 32 bit NaNs.
23:30:09*vlad1777d quit (Ping timeout: 248 seconds)
23:36:51*couven92 quit (Quit: Client Disconnecting)
23:38:28*Trustable quit (Remote host closed the connection)
23:38:37*couven92 joined #nim
23:39:41FromGitter<Gooseus> jeez, what a rabbit hole... I just caught the end of this conversation and did some googling after drinking some beers - https://stackoverflow.com/questions/19800415/why-does-ieee-754-reserve-so-many-nan-values
23:40:57*Sentreen quit (Ping timeout: 240 seconds)
23:43:33federico3does anyone has a theaded / async implementation of map/mapIt?
23:47:39*sleepyqt quit (Remote host closed the connection)
23:53:45*Sentreen joined #nim
23:54:14Araqcouven92, in fact, the HTML output is slow that Chrome refuses to show the page after a while
23:59:12FromGitter<mratsim> @federico3, I have an OpenMP implementation but it’s only suitable to non-GCed types