<< 25-12-2017 >>

00:01:00*radagast quit (Quit: radagast)
00:03:26*radagast joined #nim
00:05:32*radagast quit (Client Quit)
00:05:49*radagast joined #nim
00:35:03*yglukhov quit (Remote host closed the connection)
01:10:08*Nikky left #nim ("WeeChat 1.9.1")
01:20:52*yglukhov joined #nim
01:25:05*yglukhov quit (Ping timeout: 240 seconds)
01:27:59*iAmSlow quit (Ping timeout: 248 seconds)
01:38:22*sz0 joined #nim
02:09:49*derlafff quit (Remote host closed the connection)
02:12:48*derlafff joined #nim
02:26:11*chemist69 quit (Ping timeout: 252 seconds)
02:30:35*vivus quit (Quit: Leaving)
02:37:05*endragor joined #nim
02:39:48*chemist69 joined #nim
02:47:33*vlad1777d quit (Remote host closed the connection)
03:00:41FromGitter<gogolxdong> I remembered there is a MaxInt thing ,right?
03:01:12FromGitter<zacharycarter> `int.high` I think?
03:04:05FromGitter<gogolxdong> yeah,exactly.
03:12:49*marenz__ joined #nim
03:16:47*marenz_ quit (Ping timeout: 252 seconds)
03:53:56*MJCaley joined #nim
04:03:48*MJCaley quit (Quit: MJCaley)
04:33:51*dddddd quit (Remote host closed the connection)
05:19:49*sz0 quit (Quit: Connection closed for inactivity)
05:23:13*sz0 joined #nim
05:51:00*radagast quit (Quit: radagast)
05:51:15*radagast joined #nim
05:56:08*radagast_ joined #nim
05:57:55*radagast quit (Ping timeout: 256 seconds)
05:57:55*radagast_ is now known as radagast
06:00:32*radagast quit (Client Quit)
06:00:46*radagast joined #nim
06:05:55*yglukhov joined #nim
06:09:57*yglukhov quit (Ping timeout: 240 seconds)
06:10:00*SenasOzys_ joined #nim
06:27:56*marenz__ quit (Ping timeout: 260 seconds)
06:30:00*drs left #nim (#nim)
07:24:23*Vladar joined #nim
07:54:44*nc-x joined #nim
07:57:05nc-xIf i return a `ref object` (say its name is XYZ) from a `proc`, why do I have to do `result = XYZ()` manually? Else using the `proc` gives `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
08:01:40*nc-x quit (Ping timeout: 260 seconds)
08:02:22FromGitter<nitely> coz otherwise the proc returns the `ref object` default value which is `nil`
08:04:13*nc-x joined #nim
08:04:31nc-xThanks! I had just forgotten about it.
08:09:15*nc-x quit (Ping timeout: 260 seconds)
08:13:17*nsf joined #nim
08:19:50*sz0 quit (Quit: Connection closed for inactivity)
08:42:24*yglukhov joined #nim
08:42:43FromGitter<gogolxdong> Is it necessary to use ref object of RootObj when object type has Table field?
08:44:44FromGitter<gogolxdong> or vscode hints me invalid type: 'Table' in this context: 'QcloudApi'
08:45:44*claudiuinberlin joined #nim
08:52:50FromGitter<gogolxdong> at this line ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a40bc625355812e5715d321]
09:01:57*yglukhov quit (Remote host closed the connection)
09:03:50*gmpreussner quit (Ping timeout: 252 seconds)
09:05:38*gmpreussner joined #nim
09:15:56*yglukhov joined #nim
09:17:23*yglukhov quit (Remote host closed the connection)
09:37:05*vlad1777d joined #nim
09:50:19*nsf quit (Quit: WeeChat 1.9.1)
09:51:59*vlad1777d quit (Ping timeout: 248 seconds)
10:08:28*xkapastel quit (Quit: Connection closed for inactivity)
10:12:17*yglukhov joined #nim
10:26:41FromGitter<mratsim> Merry Christmas :)
10:27:20*iAmSlow joined #nim
10:29:56*yglukhov quit (Remote host closed the connection)
10:31:04*iAmSlow quit (Remote host closed the connection)
10:34:40*endragor quit (Remote host closed the connection)
10:35:15*endragor joined #nim
10:36:30*endragor quit (Remote host closed the connection)
10:36:37*endragor joined #nim
10:45:15*Vladar quit (Remote host closed the connection)
10:48:56*nsf joined #nim
10:52:29*Trustable joined #nim
11:36:27*Yardanico joined #nim
11:49:43FromGitter<Varriount> @mratsim RootObject and RootRef are used to mark an object as inheritable
11:58:47*SenasOzys_ quit (Read error: Connection reset by peer)
11:59:17*SenasOzys joined #nim
12:04:29*dddddd joined #nim
12:07:12*Yardanico quit (Quit: Quitting...)
12:09:23*Yardanico joined #nim
12:21:45*Yardanico quit (Quit: Quitting...)
12:23:33*Yardanico joined #nim
12:27:41*Snircle joined #nim
12:30:26*Yardanico quit (Quit: Quitting...)
12:30:29*yglukhov joined #nim
12:32:43*Yardanico joined #nim
12:32:57*Yardanico quit (Client Quit)
12:35:14*yglukhov quit (Ping timeout: 268 seconds)
12:41:23*natrys joined #nim
12:42:30*xet7 quit (Quit: Leaving)
12:42:46*xet7 joined #nim
13:03:31*yglukhov joined #nim
13:06:16*Trustable quit (Remote host closed the connection)
13:13:14*Vladar joined #nim
13:15:46FromGitter<gogolxdong> What is the equivalent of binascii.b2a_base64(hmac.new().digest()) in nim? Is it hmac_sha1().toBase64() or something?
13:19:33*xkapastel joined #nim
13:26:52FromGitter<Yardanico> There's base64 module; you don't need binascii; you can find Sha modules in nimble
13:37:39FromGitter<gogolxdong> yes, I mean the nim equivalent of binascii.b2a_base64(hmac.new().digest()) in python.
13:38:16*yglukhov quit (Remote host closed the connection)
13:38:54FromGitter<gogolxdong> url generated is different, which is invalid request.
13:39:19*yglukhov joined #nim
13:40:29*yglukhov quit (Remote host closed the connection)
13:43:47FromGitter<gogolxdong> hmac.new().digest() is likely binary while hmac_sha1() gives SHA1Digest* = array[0 .. sha_digest_size-1, uint8] ,Is there a conversion in between?
13:48:04GitDisc<NopeDK> What is the difference between using "ptr[T]" and "UncheckedArray[T]" in Nim? (Especially when interfacing with C)
13:52:24*yglukhov joined #nim
13:52:49AraqUncheckedArray[T] only works as the last object field or with 'ptr'
13:53:16Araquse ptr UncheckedArray[T] when the C code expects an array and ptr T when it doesn't
13:55:00GitDisc<NopeDK> Thanks
14:03:59*marenz__ joined #nim
14:05:19*yglukhov quit (Remote host closed the connection)
14:25:32hiwayHow should I go about binary to hex conversion while loading from a file? Currently using an external tool: https://github.com/hiway/hoistd/blob/master/src/hoistd.nim#L68
14:28:57GitDisc<NopeDK> Loop and use https://nim-lang.org/docs/strutils.html#toHex,BiggestInt,Positive
14:30:52hiwayNopeDK, thank you.
14:32:39GitDisc<NopeDK> hiway, perhaps use the module "ropes" for initial concatenations for speedups, converting to string when done with entire file.
14:33:36hiwayNopeDK, alright, I will look it up :)
14:34:53FromGitter<gogolxdong> I'm not familiar with the detail of cryptography ,is there a prophet can tell me whether binascii.b2a_base64(hmac.new().digest()) in python is the same with hmac_sha1().toBase64() in Nim or not?
14:42:23*scriptum joined #nim
14:42:40*yglukhov joined #nim
14:48:48*Yardanico joined #nim
14:55:31Yardanicoyay, my hacktoberfest t-shirt has finally arrived
14:55:33Araqdon't use "ropes", they are always slower than strings
14:55:37Yardanicowill get it tomorrow
14:57:07hiway@Araq, noted.
15:01:49GitDisc<NopeDK> Thought mass concat would be faster in the end as it does not have to realloc memory to new strings every time.
15:02:41*SitiSchu joined #nim
15:15:09*yglukhov quit (Remote host closed the connection)
15:21:04GitDisc<NopeDK> Araq, so there really is no benefit of ropes over strings, even in large concat heavy applications which should favor them? If that is true, why does Nim include ropes?
15:21:50Yardanicoand also Nim compiler uses ropes
15:23:32*endragor quit (Remote host closed the connection)
15:23:37FromGitter<alehander42> @mratsim happy holidays!
15:24:09*endragor joined #nim
15:27:10*endragor_ joined #nim
15:28:41*endragor quit (Ping timeout: 265 seconds)
15:30:23Yardanicoyou can't use untyped for proc arguments, right?
15:31:35*endragor_ quit (Ping timeout: 252 seconds)
15:33:46GitDisc<NopeDK> From what I can see, correct. Untyped seems to be a metatype only available for templates and macros.
15:37:10Yardanicohttps://github.com/nim-lang/Nim/issues/6970
15:38:23*miran joined #nim
15:39:04FromGitter<mratsim> By the way, is there a way to overloaded template `[]`(f: Foo, varargs[untyped]) but only for varargs > 0 so I don’t overload the dereference operator?
15:40:02FromGitter<mratsim> I guess counting the number of varargs and then redispatch using `system.`[]`(f)`
15:40:30*endragor joined #nim
15:42:31FromGitter<alehander42> Btw is there a way to express with a type that a function can be overloaded in specific ways?(and to reuse this type for many import)
15:43:34FromGitter<mratsim> @alehander42 I use `[T: not (ref | string | seq)]` for example when I want non-garbage collected version.
15:43:40FromGitter<mratsim> there is no specialization per se
15:44:59*endragor quit (Ping timeout: 256 seconds)
15:45:39FromGitter<alehander42> Hmm, the thing is I wanted to type
15:46:41FromGitter<alehander42> Too complicated for a phone,I'll look at it later :D
15:47:00FromGitter<alehander42> Phone keyboard'
15:54:36*Vladar quit (Quit: Leaving)
16:02:26*Yardanico quit (Quit: Quitting...)
16:22:16*Yardanico joined #nim
16:24:29*Yardanico quit (Remote host closed the connection)
16:25:18*xkapastel quit (Quit: Connection closed for inactivity)
16:31:39*Yardanico joined #nim
16:33:35*natrys quit (Quit: natrys)
16:40:00FromGitter<tekjar> Hi. Can some one point me to an example for writing wrappers to a static c lib
16:54:18*Yardanico quit (Remote host closed the connection)
17:12:30*dddddd quit (Remote host closed the connection)
17:15:42*yglukhov joined #nim
17:20:06*yglukhov quit (Ping timeout: 260 seconds)
17:22:32*kobi7 joined #nim
17:27:15*yglukhov joined #nim
17:32:27*yglukhov quit (Remote host closed the connection)
17:39:09FromGitter<mratsim> @tekjar check nimblas which wraps Intel MKL (statically) or OpenBLAS (dynaically)
17:45:19*Yardanico joined #nim
17:46:31*yglukhov joined #nim
17:48:02*yglukhov quit (Remote host closed the connection)
18:02:51GitDisc<awr> happy holidays all
18:04:44*MJCaley joined #nim
18:06:22GitDisc<awr> is there a way i can use `fieldPairs` on an object where i can mutate the values?
18:09:16*nsf quit (Quit: WeeChat 2.0.1)
18:12:17*kobi7 quit (Quit: Leaving)
18:19:12*yglukhov joined #nim
18:34:10*Yardanico quit (Quit: My Hackintosh has gone to sleep. ZZZzzz…)
18:35:35*Yardanico joined #nim
18:41:17*Vladar joined #nim
19:07:59*yglukhov quit (Remote host closed the connection)
19:38:42*Arrrr joined #nim
19:43:02*MJCaley quit (Quit: MJCaley)
19:43:33*Arrrr quit (Ping timeout: 264 seconds)
19:53:48*Yardanico quit (Quit: Quitting...)
19:56:02*Yardanico joined #nim
20:09:23Araqawr fields allows mutation
20:12:38*Arrrr joined #nim
20:12:38*Arrrr quit (Changing host)
20:12:38*Arrrr joined #nim
20:15:03*gokr joined #nim
20:15:08ArrrrWhere is the "Merry Christmas" thread?
20:26:02FromGitter<tekjar> Hi. Is it possible to get address of a const object?
20:26:16YardanicoNo
20:26:19Yardanicobecause they're really constant
20:26:31YardanicoThey're directly embedded in C code and stored in executable
20:28:25YardanicoYou can use `let` instead of a `const` if you want to have your variable stored in RAM so you can access its address
20:29:20FromGitter<tekjar> ```static GPIO_InitTypeDef GPIO_InitStruct; ⏎ ... ⏎ HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);``` [https://gitter.im/nim-lang/Nim?at=5a415fa0c072deaf0b00b218]
20:29:42FromGitter<tekjar> I have a C api which is expecting address of a static var
20:29:59FromGitter<Yardanico> did you try to run c2nim?
20:30:04FromGitter<Yardanico> on this C api header file
20:30:40FromGitter<tekjar> Yeah. c2nim is converting it to a `var`
20:30:42hiwayIs there an equivalent of Python's `os.path.expanduser()` already implemented in Nim? (could not find so far)
20:30:52Yardanicotekjar: so does it work?
20:30:56FromGitter<tekjar> Which is giving following error
20:31:04FromGitter<tekjar> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a416008e43a7a150ca5caf7]
20:31:26FromGitter<tekjar> I'm trying to compile to a microcontroller by the way
20:31:43Yardanicohiway maybe https://nim-lang.org/docs/ospaths.html#expandTilde,string ?
20:32:44Yardanicoyou can also just use getHomeDir() to get user home dir
20:33:15*Arrrr quit (Read error: Connection reset by peer)
20:37:12hiwayYardanico: Thank you, getHomeDir() works; and I wonder how I missed both while searching :S
20:39:35*yglukhov joined #nim
20:40:11*yglukhov quit (Remote host closed the connection)
20:40:28*yglukhov joined #nim
20:47:21*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
20:58:42*yglukhov quit (Remote host closed the connection)
21:02:27*radagast quit (Remote host closed the connection)
21:04:29*dddddd joined #nim
21:05:07*radagast joined #nim
21:07:27*miran quit (Quit: Konversation terminated!)
21:16:10*Yardanico quit (Quit: Quitting...)
21:17:30*Yardanico joined #nim
21:32:44GitDisc<NopeDK> Do we have a benchmark on strings versus ropes with various operations? I am curious due to Araq's previous message stating that ropes would always be slower than strings.
21:40:16*Vladar quit (Quit: Leaving)
21:59:31FromGitter<tekjar> Finally blinking LED on stm32f3discovery is working. Is there anyone using nim extensively for microcontrollers?
22:05:59ddddddtekjar, I'm starting to play with stm32 too, so no extensively at all :) Do you have any links to share?
22:06:21GitDisc<NopeDK> In addendum, and perhaps a comparison to seq[string] as well.
22:07:08GitDisc<NopeDK> Tekjar, no, but would love to when I get back to mcu programming. I prefer the STM due to the balance of features so getting native Nim would be awesome.
22:08:31FromGitter<tekjar> dddddd: Will push to github with instructions in a day
22:10:09*SenasOzys quit (Ping timeout: 248 seconds)
22:10:17ddddddtekjar, I found you there. Will keep an eye. Thanks!
22:10:48FromGitter<tekjar> GitDisc: Maybe there should a bare metal group to collaborate and create framework. Nim and Rust can be new interesting candidates for mcu programming
22:11:40FromGitter<tekjar> There's lot of work going on in Rust.
22:12:32ddddddFor rust there's zinc
22:13:26FromGitter<tekjar> But getting started with Nim is fun. I haven't touched nim for the last 6 months and C for 2 years. Still didn't take much time to bringup a blinking led program
22:13:45FromGitter<tekjar> dddddd: zinc is scrapped.
22:13:59YardanicoI really think that nim can be bettter suited for embedded coding than rust
22:14:20Yardanicobecause after all nim compiles to C and you can also use C headers/files
22:14:29FromGitter<tekjar> Maybe because of C
22:14:31FromGitter<tekjar> Yeah
22:14:33Yardanicobut of course it won't happen without interested people
22:14:40*Yardanico quit (Remote host closed the connection)
22:15:26*radagast_ joined #nim
22:15:31*craigger quit (Ping timeout: 268 seconds)
22:16:55*craigger joined #nim
22:16:56*radagast quit (Ping timeout: 252 seconds)
22:17:15GitDisc<NopeDK> I am interested but don't know how much time I can contribute. (Also, GitDisc is the name of the bridge between Discord and the other services, name is NopeDK, I know, tags get confusing when there are multiple of them, not the first time)
22:17:42ddddddtekjar, good to know (and sorry for the OT, all)
22:19:20AraqNopeDK a good benchmark would be to use the rst2html library to translate manual.rst into html and make the html generator use either ropes, strings or seq[string]
22:19:24*radagast_ quit (Client Quit)
22:19:29FromGitter<tekjar> I wonder why Nim didn't get as much popularity as crystal. Maybe because of not having famous libraries. There are lot of language choices in OS space but not many for bare metal. Creating good frameworks in baremetal space might push the popularity IMO :)
22:19:37*radagast joined #nim
22:21:02GitDisc<NopeDK> Araq, cool. Will do that tomorrow on upload the results somewhere for others who might be interested.
22:21:20Araqer ... that's quite some work
22:21:49GitDisc<NopeDK> Ah damn, well sometime in the future I will upload those benchmarks.
22:24:23*couven92 joined #nim
22:25:21AraqI already know strings win :P
22:25:52GitDisc<NopeDK> Do you mind explaining the reasoning behind that?
22:29:02Araqthis is my mental model of a CPU https://www.google.de/imgres?imgurl=http%3A%2F%2Fwww.diskdoctors.com%2FArticleImages%2FExternal%2520Hard%2520Drive%2520Stops%2520Spinning%2C%2520need%2520expert%2520advice.jpg&imgrefurl=http%3A%2F%2Fdiskdoctors.com%2Fraq%2FExternal-Hard-Drive-Stops-Spinning-need-expert-advice.aspx&docid=yad25n73wr0CCM&tbnid=UYGRZsyN2qDXyM%3A&vet=10ahUKEwjK08HymqbYAhVFyKQKHU0TAfQQMwgnKAEwAQ..i&w=500&h=375&bih=703&biw=1240&q=spinning%
22:29:02Araq20hard%20disk%20image&ved=0ahUKEwjK08HymqbYAhVFyKQKHU0TAfQQMwgnKAEwAQ&iact=mrc&uact=8
22:30:17Araqbah, try this http://bit.ly/2DcVKFv
22:31:12GitDisc<NopeDK> Not getting your metaphor
22:31:24Araqyes, I know that's a hard disk, you know what hard disks are good at? bulk operations.
22:32:57Araqstring concats are memcopys, rope concats are tree allocations
22:33:05GitDisc<NopeDK> So using strings is faster as all of them allocates anyways and allocs are O(1)?
22:33:34Araqmemcopy is a bulk operation
22:33:52Araqtree allocation is jump around in memory
22:33:55GitDisc<NopeDK> Ah, okay, yeah I can see how tree allocation gets detrimental in the end.
22:35:48Araqof course you need to insert mostly into a single 'var string' parameter
22:36:43Araqotherwise you do the memcopys on top of the concat tree
22:37:08GitDisc<NopeDK> Oh damn. I get ya. Strings it is.
22:37:24GitDisc<NopeDK> Thanks
22:38:32*nsf joined #nim
22:50:20*vlad1777d joined #nim
23:04:53*nsf quit (Quit: WeeChat 2.0.1)
23:05:54*fredrik92 joined #nim
23:07:33*freddy92 joined #nim
23:09:31*couven92 quit (Ping timeout: 260 seconds)
23:10:55*fredrik92 quit (Ping timeout: 248 seconds)
23:18:03*freddy92 quit (Quit: Disconnecting)
23:23:21*Sentreen quit (Quit: WeeChat 1.6)
23:26:22*tankfeeder_ joined #nim
23:26:33*tankfeeder_ quit (Client Quit)