<< 25-09-2017 >>

00:01:04FromGitter<zacharycarter> lzma?
00:07:59*relax quit (Ping timeout: 248 seconds)
00:09:57FromGitter<zacharycarter> oh the compression algo
00:18:11*yglukhov joined #nim
00:22:35*yglukhov quit (Ping timeout: 240 seconds)
00:37:43*couven92 quit (Quit: Client Disconnecting)
00:38:24*Snircle quit (Ping timeout: 246 seconds)
00:39:34FromGitter<Varriount> @mratsim What's this new newSeqofCap?
00:50:23*ipjk quit (Read error: Connection reset by peer)
00:59:57FromGitter<zacharycarter> @Varriount I think there's a new seqofcap that doesn't initialize its members
01:00:13FromGitter<zacharycarter> someone was clamoring for it and I think araq implemented it
01:03:10*Snircle joined #nim
01:17:02*vlad1777d quit (Ping timeout: 260 seconds)
01:22:24*chemist69 quit (Ping timeout: 252 seconds)
01:36:19*chemist69 joined #nim
01:37:20*Ven`` joined #nim
01:41:30FromGitter<genotrance> @Varriount: did you get to try out autodup?
01:41:53*Ven`` quit (Ping timeout: 248 seconds)
01:41:56FromGitter<Varriount> Not yet
01:42:10FromGitter<Varriount> Ben studying German all day
01:42:16FromGitter<Varriount> *been
01:52:38*Snircle quit (Ping timeout: 255 seconds)
01:54:02*endragor joined #nim
01:58:52*adeohluwa quit (Quit: Connection closed for inactivity)
02:07:19*Snircle joined #nim
02:07:54*Snircle quit (Client Quit)
02:07:54*skrylar joined #nim
02:07:55*endragor_ joined #nim
02:08:02skrylarboop.
02:11:21*endragor quit (Ping timeout: 252 seconds)
02:11:42*Snircle joined #nim
02:22:33subsetparkVarriount: are you italian originally?
02:26:18*Snircle_ joined #nim
02:28:23*Snircle quit (Ping timeout: 246 seconds)
02:31:30*def-pri-pub joined #nim
02:35:56*relax joined #nim
02:44:21*endragor_ quit (Remote host closed the connection)
02:55:21*dddddd quit (Remote host closed the connection)
02:55:37FromGitter<genotrance> Cool
03:16:29*endragor joined #nim
03:21:16*m712 joined #nim
03:49:40*Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com)
04:16:21*def-pri-pub quit (Quit: Leaving.)
04:25:22*BigEpsilon joined #nim
04:48:05*relax quit (Ping timeout: 240 seconds)
04:58:04*Nobabs27 quit (Quit: Leaving)
05:01:10FromGitter<citycide> anybody used NiGui and know how to disable window resizing?
05:04:55libmanhttps://github.com/nim-lang/Nim is three stars away from 4000. ;P
05:10:26*miran joined #nim
05:31:04*Vladar joined #nim
05:37:03*BigEpsilon quit (Ping timeout: 252 seconds)
05:54:46*BigEpsilon joined #nim
06:04:10*skrylar quit (Quit: Leaving)
06:07:20*solitudesf joined #nim
06:10:04FromGitter<Varriount> subsetpark: Nope. I'm from the US
06:12:44*PMunch joined #nim
06:14:19FromGitter<ephja> same shit
06:21:51*miran quit (Ping timeout: 248 seconds)
06:37:10*nsf joined #nim
06:49:30*solitudesf quit (Remote host closed the connection)
06:56:15*solitudesf joined #nim
07:09:05*mahmudov quit (Ping timeout: 240 seconds)
07:18:54*yglukhov joined #nim
07:22:06*couven92 joined #nim
07:23:01*yglukhov quit (Ping timeout: 240 seconds)
07:28:51*claudiuinberlin joined #nim
07:30:39*claudiuinberlin quit (Client Quit)
07:37:29*claudiuinberlin joined #nim
07:40:38*Arrrr joined #nim
07:40:38*Arrrr quit (Changing host)
07:40:38*Arrrr joined #nim
07:58:12*gokr joined #nim
08:08:31*Sentreen quit (Ping timeout: 248 seconds)
08:21:15*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:22:29*Sentreen joined #nim
08:26:14*yglukhov joined #nim
08:28:21FromGitter<cooldome> @Araq: Hi Araq, I have noticed you have added func which looks like a good idea. Wanted to check if it supposed to be equivalent of proc () {.noSideEffect.} or you have some other idea in mind?
08:30:58Araqcooldome: .noSideEffect is not implied by func yet
08:31:18Araqwill add it later though
08:35:22*vlad1777d joined #nim
08:35:46*EastByte quit (Quit: WeeChat 1.9)
08:36:08*EastByte joined #nim
08:41:17FromGitter<ephja> `got (bool) but expected 'bool = Char'` the what now? :p
08:41:38*fastrom joined #nim
08:42:44*claudiuinberlin joined #nim
08:43:30*claudiuinberlin quit (Client Quit)
08:45:14Araqsystem.bool vs your bool?
08:47:41*claudiuinberlin joined #nim
08:50:46FromGitter<ephja> oh. ofc
08:50:55*fastrom quit (Quit: Leaving.)
08:56:03*coffeepot joined #nim
08:58:19coffeepothey guys :)
08:58:42coffeepoti noticed we don't seem to have a frac proc in math? Only split decimal. Have i missed it?
09:01:10*thomasross quit (Remote host closed the connection)
09:01:35*thomasross joined #nim
09:02:34*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:10:08*mahmudov joined #nim
09:14:08*arnetheduck_ joined #nim
09:14:09*arnetheduck quit (Ping timeout: 248 seconds)
09:14:31FromGitter<Grabli66> I saw there will be a "func". What's the difference between proc and func ?
09:15:41ArrrrNo side effects i think
09:16:13FromGitter<Grabli66> That's all?
09:16:18*fastrom joined #nim
09:17:19ArrrrAnd new bugs
09:17:41FromGitter<Grabli66> Good. :)
09:31:11*fastrom quit (Ping timeout: 255 seconds)
09:31:32*fastrom joined #nim
09:33:59*fastrom1 joined #nim
09:35:39*fastrom quit (Ping timeout: 246 seconds)
09:44:44*fastrom joined #nim
09:46:14*fastrom1 quit (Ping timeout: 246 seconds)
09:46:53*libman quit (Quit: Connection closed for inactivity)
09:56:47*kier quit (Ping timeout: 260 seconds)
10:01:04*claudiuinberlin joined #nim
10:01:26*fastrom1 joined #nim
10:01:36*chemist69 quit (Ping timeout: 252 seconds)
10:02:59*claudiuinberlin quit (Client Quit)
10:03:12*fastrom quit (Ping timeout: 260 seconds)
10:06:13*claudiuinberlin joined #nim
10:06:14*claudiuinberlin quit (Client Quit)
10:10:17*claudiuinberlin joined #nim
10:21:08*Yardanico joined #nim
10:23:25*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:26:14YardanicoGrabli66: Araq from IRC: func in my head means 2 things: - no side effects (aka no access to globals), - writes only to parameters marked as 'var', and potentially: - no aliasing in the function call
10:26:28Yardanicohttps://irclogs.nim-lang.org/23-09-2017.html#21:41:22
10:28:00FromGitter<Grabli66> Good. I understood.
10:28:29Yardanicoendragor, can you ask your co-workers to look into this? :) https://github.com/pragmagic/vscode-nim/pull/60
10:28:37*chemist69 joined #nim
10:37:01*BitPuffin|osx joined #nim
10:43:15*Ven`` joined #nim
10:47:57*kier joined #nim
10:48:01FromGitter<mratsim> hoooo func is there? :)))
10:48:01*voiceftp quit (Ping timeout: 240 seconds)
10:48:22Yardanicoyes
10:48:26Yardanicoalready 2 days :P
10:48:57FromGitter<mratsim> so big question, can we use shallowCopy in a func on a let variable? should I raise a bug :P
10:49:14YardanicoAFAIK write tracking is not the best currently
10:52:08Yardanicomratsim: and btw write-tracking was there a long time ago
10:52:22Yardanicohttps://github.com/nim-lang/Nim/blob/devel/compiler/writetracking.nim
10:54:28FromGitter<mratsim> I was referring to this on going discussion: https://github.com/nim-lang/Nim/issues/644
10:58:05FromGitter<mratsim> write-tracking is interesting though, I probably have a lot of use-case for it
10:59:36*sleepyqt joined #nim
11:00:05Yardanicobtw, you don't need "experimental" for func
11:05:43*Yardanico quit (Remote host closed the connection)
11:13:12*dddddd joined #nim
11:20:22FromGitter<Grabli66> Nim 0.18 soon? :)
11:21:57cremBefore of after community survey results?
11:26:23FromGitter<Yardanico> @Grabli66 @Araq is planning to make 0.18 an 1.0 Release Candidate 1
11:26:36crem:(
11:26:53FromGitter<Yardanico> I don't know about community survey
11:27:26FromGitter<Grabli66> Awesome.
11:30:53FromGitter<Bennyelg> enumerate for ?
11:31:01FromGitter<Yardanico> @Bennyelg ?
11:31:15FromGitter<Bennyelg> for index, line in splitLines(chunk): ⏎ I want to retrive the index
11:31:56FromGitter<Yardanico> well some iterators add this possibility, but it's not available for any iterators
11:31:59FromGitter<Yardanico> use this:
11:32:19FromGitter<Yardanico> ```var i =0 ⏎ for line in splitLines(chunk): ⏎ do stuff.. ⏎ inc i``` [https://gitter.im/nim-lang/Nim?at=59c8e943210ac269206c9a45]
11:32:34FromGitter<Bennyelg> nah
11:32:38FromGitter<Bennyelg> i wanted to avoid this hehe
11:33:31FromGitter<Yardanico> well it's only two additional lines
11:37:54*claudiuinberlin joined #nim
11:40:25FromGitter<Bennyelg> Yea I know
11:40:57FromGitter<Bennyelg> I managed to csvql 16m rows csv in 90 seconds using threadpool, instead 500 seconds
11:43:29*fastrom joined #nim
11:44:14*fastrom1 quit (Ping timeout: 240 seconds)
11:50:47*Vladar quit (Quit: Leaving)
11:51:14*vlad1777d quit (Ping timeout: 240 seconds)
11:51:59FromGitter<Yardanico> well it's easy to make "enumerate" iterator
11:53:15FromGitter<Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c8ee2bcfeed2eb6549ddcc]
11:53:27FromGitter<Yardanico> one downside: it wouldn't work for arrays
11:53:36FromGitter<Yardanico> but arrays have iterator like this anyway
11:54:55*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:55:19*ShalokShalom_ is now known as ShalokShalom
11:55:20*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
11:56:58FromGitter<Bennyelg> thanks.
11:58:03FromGitter<Yardanico> once concepts will be working without bugs, I think it would be good to add things like this to stdlib
11:58:53FromGitter<Bennyelg> I have no Idea what concept means, first time I am seeing this
11:59:22FromGitter<Bennyelg> you check the type x is actually the T we pass?
11:59:26FromGitter<Bennyelg> for each element?
11:59:50FromGitter<Yardanico> @Bennyelg only check it at compile time
11:59:57FromGitter<Yardanico> concepts are a compile-time thing
12:00:33FromGitter<Yardanico> https://nim-lang.org/docs/manual.html#generics-concepts
12:00:39FromGitter<Yardanico> Concepts, also known as "user-defined type classes", are used to specify an arbitrary set of requirements that the matched type must satisfy.
12:00:54FromGitter<Bennyelg> Cool
12:02:49*sleepyqt quit (Quit: WeeChat 1.9)
12:02:58FromGitter<Yardanico> but because they're not a runtime thing, you can't for example have a seq of Iterator concept
12:03:05FromGitter<Yardanico> but this will be possible with "vtref"
12:03:37*vlad1777d joined #nim
12:03:47FromGitter<Bennyelg> vtref?
12:04:33FromGitter<Grabli66> "vtref" will be in 1.0 release?
12:05:01*claudiuinberlin joined #nim
12:05:05FromGitter<Yardanico> @Bennyelg https://nim-lang.org/docs/manual.html#generics-vtable-types
12:05:08FromGitter<Yardanico> @Grabli66 I don't really know
12:05:37FromGitter<Yardanico> vtrefs are already in manual, but they're not implemented yet
12:06:16FromGitter<Grabli66> :). Ok. We will wait
12:07:54FromGitter<mratsim> @Bennyelg you can already do ⏎ ⏎ ```for i, val in arr: ⏎ ## do stuff``` ⏎ ⏎ It will call the pairs iterator implicitly which for arrays and seq corresponds to the index [https://gitter.im/nim-lang/Nim?at=59c8f19a7b7d98d30d33e921]
12:08:49FromGitter<Yardanico> @mratsim it doesn't work with splitLines for example, because it's an iterator itself
12:08:57FromGitter<Yardanico> it would work however with toSeq(splitLines())
12:09:01FromGitter<Yardanico> but this is not very efficient
12:09:16FromGitter<mratsim> Yeah, chaining inline iterators is a sore point <_<: https://github.com/nim-lang/Nim/issues/4516
12:09:26FromGitter<mratsim> (and the manual says it is possible)
12:09:40FromGitter<Yardanico> well it works in this case
12:09:43FromGitter<Yardanico> even with a concept
12:09:56FromGitter<mratsim> By the way, varargs is a superset of openarray ?
12:10:19FromGitter<Yardanico> A varargs parameter is an openarray parameter that additionally allows to pass a variable number of arguments to a procedure.
12:10:27FromGitter<Yardanico> https://nim-lang.org/docs/manual.html#types-varargs :)
12:10:34FromGitter<Yardanico> The compiler converts the list of arguments to an array implicitly
12:10:42FromGitter<mratsim> i’m randomly changing my openarray to varargs and I’m surprised it works lol
12:12:05*Pisuke quit (Ping timeout: 240 seconds)
12:12:07*Sembei joined #nim
12:14:55*vlad1777d quit (Ping timeout: 248 seconds)
12:15:14FromGitter<Yardanico> well you wouldn't be able to pass a seq or array to varargs argument
12:16:19FromGitter<Yardanico> oh wait
12:16:20FromGitter<Yardanico> it works
12:16:20FromGitter<Yardanico> wtf
12:16:32*BitPuffin|osx quit (Ping timeout: 248 seconds)
12:17:09*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:20:49FromGitter<Yardanico> well you wouldn't be able to change openarray to varargs if you have some arguments with the same type as varargs argument after varargs argument :)
12:23:02*d10n-work joined #nim
12:24:42FromGitter<mratsim> no it would work I think ;)
12:25:24FromGitter<Yardanico> well it would work
12:25:33FromGitter<Yardanico> but you wouldn't be able to pass a seq or array anymore
12:26:19*Snircle joined #nim
12:27:50FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/WLJY/2017-09-25_14-27-26.png)
12:28:01FromGitter<mratsim> works with array input too
12:28:09*claudiuinberlin joined #nim
12:29:39FromGitter<Yardanico> noo
12:29:40FromGitter<Yardanico> I mean
12:30:13FromGitter<Yardanico> ok
12:30:14FromGitter<Yardanico> nvm :D
12:30:18FromGitter<Yardanico> but be careful
12:32:21FromGitter<mratsim> I understand how you feel, it's surprising when something work and you didn't expect it ;)
12:32:43FromGitter<Yardanico> @Araq what is an "opt" type?
12:32:50*manjaro-kde5 joined #nim
12:34:01AraqOption[T] done right
12:34:15FromGitter<Yardanico> ohhh
12:36:44FromGitter<Yardanico> it's time to update nim again :P
12:36:59FromGitter<Yardanico> and you really want to make 0.18 an 1.0 RC 1 it seems
12:38:55FromGitter<mratsim> In that case vtable and chaining inline iterators should be put in a "Coming soon" section!
12:40:49*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
12:42:25FromGitter<Yardanico> oh, lib/pure/marshal.nim(47, 3) Error: not all cases are covered
12:42:28FromGitter<Yardanico> https://travis-ci.org/nim-lang/Nim/jobs/279493817
12:43:50Araqgah, will fix it
12:44:24Araqtoday I learned about emplace_back :-)
12:44:57*sleepyqt joined #nim
12:45:01AraqC++ is interesting in its weird hacks for speed
12:48:14Araqinstead of proc reserveSlot[T](x: Container[T]): ptr T; proc add[T](s: seq[T]; x: T) = reserveSlot(s)[] = x; proc addMove[T](s: seq[T]; x: var T) = shallowCopy(reserveSlot(s)[], x); reset(x)
12:48:35Araqthey come up with variadic templates with perfect forwarding
12:50:03Araqbut ok, my shallowCopy variant misses the point somewhat I guess
12:51:00*jjido joined #nim
12:53:08cremI don't read nim, but I think that shallowCopy copies. While emplace_back doesn't copy anything, it constructs the object right in the container.
12:54:22Araqcrem: yes but these copies are then under the optimizer's control
12:55:49Araqand when you think about it, "constructing" a struct Point { int x, y; } means two "copies"
12:56:28*Vladar joined #nim
12:57:03*PMunch quit (Quit: Leaving)
12:57:05cremWell, construction is not only copying of constructor parameter, it can do other things too.
12:58:23*Arrrr quit (Quit: Leaving.)
13:02:24*jjido quit (Read error: Connection reset by peer)
13:10:19FromGitter<edubart> @Araq I've tried newSeqOfCap followed by setLen, and worked well, thanks, but now my performance slowdown is because of #6433
13:11:39Araqso fix it
13:13:05*m712 quit (Ping timeout: 240 seconds)
13:13:12FromGitter<edubart> I'm trying but I dunno how to fix properly >.>
13:16:30*mahmudov quit (Remote host closed the connection)
13:18:37*m712 joined #nim
13:20:42Araqedubart: there you go, still slower than copyMem but I'm too lazy to fix it in the codegen
13:21:16Araqit's only 2x times slower now
13:24:06FromGitter<edubart> :D thanks will do some tests
13:27:50*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:32:10*claudiuinberlin joined #nim
13:37:19FromGitter<edubart> what a difference, my deep network learning model training went from 29 seconds to 7 second with just this simple change
13:42:54*PMunch joined #nim
13:44:50*Snircle joined #nim
13:46:04*libman joined #nim
13:48:07*relax joined #nim
13:50:02*Arrrr joined #nim
13:50:02*Arrrr quit (Changing host)
13:50:02*Arrrr joined #nim
13:50:08*sz0 joined #nim
13:56:18FromGitter<mratsim> Hohoho, thanks @Araq
14:03:35*jjido joined #nim
14:05:40FromGitter<Jipok> @edubart What utility did you use to get: "genericAssignAux at 95% cpu usage"?
14:06:39FromGitter<edubart> the DNN classification demo at https://github.com/edubart/arraymancer-demos
14:07:19FromGitter<edubart> install arraymancer, run it, and use "perf" linux utility
14:07:59FromGitter<Yardanico> @edubart update benchmarks? :)
14:08:05FromGitter<Yardanico> and make them as a table maybe?
14:08:17*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:08:26FromGitter<edubart> later will do that
14:10:25*ShalokShalom_ joined #nim
14:11:27FromGitter<edubart> @Jipok I think you want `perf`, it's a linux profiling tool integrated with the linux kernel, I daily use it to profile almost everything, it shows most used C func symbols in realtime of all the system (or program)
14:12:12FromGitter<Yardanico> guys, if you forgot to star nim repo - star it now!
14:12:18FromGitter<Yardanico> 3998 stars
14:13:06dom96hah
14:13:13dom96let's just make bot accounts and star it :P
14:13:27*ShalokShalom quit (Ping timeout: 260 seconds)
14:14:15FromGitter<Jipok> @edubart thx. I didnэt know about зука
14:14:39FromGitter<Jipok> @edubart thx. I didn't know about this tool
14:16:35FromGitter<ephja> @Bennyelg I assume you have more than 4 cores considering the speed up
14:16:47FromGitter<ephja> unless you optimized something else in the meantime :p
14:17:17*claudiuinberlin joined #nim
14:22:51FromGitter<Jipok> @edubart I downloaded Hotspot. Maybe you can advise better GUI for perf? Or you use console?
14:24:23FromGitter<Yardanico> he probably use console
14:24:28FromGitter<Yardanico> it's not that hard really
14:26:02FromGitter<edubart> is use console, "perf top -p `pidof myprogram`"
14:26:18FromGitter<edubart> I*
14:27:30FromGitter<Bennyelg> @ephja yea I have 4 cores mac (pretty old one)
14:27:38FromGitter<edubart> and if you want to see the call stack (I usually do), compile the app with cflags "-g" and add "--call-graph dwarf" in perf
14:40:49*couven92 quit (Quit: Client disconnecting)
14:44:15*jsgrant quit (Remote host closed the connection)
14:44:24*jsgrant joined #nim
14:47:32FromGitter<cabhishek> Hi everyone! I am planning to talk about Nim at a Python conference. Would like to get some feedback on my slides and some tips to make it better  /cc @dom96
14:47:50dom96oooh, which Python conference?
14:48:06dom96also, thank you for preparing a talk :D
14:48:56FromGitter<Yardanico> @cabhishek can you give us slides ? :)
14:50:06*miran joined #nim
14:50:37dom96I'll take a look in about an hour. Got a call now.
14:50:43FromGitter<cabhishek> @dom96 http://pyss17.pyss.org/
14:52:05FromGitter<cabhishek> @Yardanico @dom96 http://slides.com/akapatkar/nim-for-python-programmers
14:52:43FromGitter<mratsim> Seems like half the talk are about Data science. Also what is "Grumpy" in one of the talk, sounds funny :D
14:53:30FromGitter<Yardanico> @cabhishek you can use proc instead of method in Intuitive user defined type system
14:53:40FromGitter<Jipok> (https://files.gitter.im/nim-lang/Nim/Qjzx/___________.png)
14:53:46FromGitter<Yardanico> yeah, saw this too
14:54:16FromGitter<mratsim> Slide 7: change the arg to seq instead of openarray, it would avoid questions that would need diving into details
14:54:47FromGitter<cabhishek> @mratsim yeah, I was thinking the same :)
14:55:00FromGitter<mratsim> Unless the type inferred was referring to it?
14:55:40FromGitter<Yardanico> honestly I disagree with "Occasional breaking changes to the standard library"
14:56:10*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:56:21FromGitter<mratsim> Yeah there are bugs (static) but no breaking change
14:56:35FromGitter<Yardanico> well stdlib doesn't have any breaking changes
14:56:42FromGitter<Yardanico> language itself - maybe
14:57:07FromGitter<mratsim> Will you talk about "someProc a b" or no brace style "a.someProc" ?
14:57:28FromGitter<cabhishek> @Yardanico ok, I thought there is always the possibility given e.g toLower vs toLowerascii change ?
14:58:52FromGitter<Yardanico> it was a long time ago
14:58:58FromGitter<Yardanico> and it still deprecated, and not removed
14:59:19FromGitter<Yardanico> Deprecated since version 0.15.0: use isLowerAscii instead.
14:59:30FromGitter<Yardanico> we have 0.17.2 and it's still here
14:59:41FromGitter<Yardanico> 1) 15.0 was released 1 year ago
15:00:22FromGitter<cabhishek> @mratsim I wont be talking about that. It might raise doubts ?
15:00:54FromGitter<mratsim> Yes I think so
15:00:58FromGitter<cabhishek> @Yardanico Ok. I am totally fine removing it
15:01:47FromGitter<Yardanico> also identifier equality
15:01:51FromGitter<Yardanico> someProc = someproc = some_proc
15:02:20FromGitter<mratsim> For template I think your example can be done with proc and is not enough. Here are 2 things that might be better: lifting standard math function in "universal function" https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/ufunc.nim
15:02:32*claudiuinberlin joined #nim
15:02:47*d10n-work quit (Quit: Connection closed for inactivity)
15:02:54FromGitter<Yardanico> @mratsim you should change comments here from # to ##
15:03:04FromGitter<Yardanico> in makeUniversall
15:03:25FromGitter<Jipok> @cabhishek it is probably worth adding about the possibility to use code written in c/c++/js
15:03:28FromGitter<mratsim> No, if I do that they repeat at each invocation of the template in nim doc2
15:03:49FromGitter<mratsim> Second example shamelessly emitting cuda code https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/elementwise_cuda.nim
15:03:54FromGitter<Yardanico> yeah, and c2nim too @cabhishek
15:03:57FromGitter<cabhishek> @Yardanico I definitely don't want to talk about that :-|
15:04:07FromGitter<Yardanico> well it would allow them to use snake_case
15:04:12FromGitter<cabhishek> I meant about `someProc = someproc = some_proc`
15:04:14FromGitter<Yardanico> but almost all libraries use camelCase
15:04:45FromGitter<cabhishek> I'll add `c2nim` section
15:05:23FromGitter<cabhishek> @Jipok good point. I do mention it on slide #20
15:06:16FromGitter<cabhishek> @mratsim Taking a look at your links
15:07:35FromGitter<mratsim> For GC you can say as a joke that it seems like half of the Nim community are game devs and they didn't like GC until they met Nim ;) 
15:07:55FromGitter<edubart> @Araq further improved your change in seq assignment, now I get the same speed as in the test case #6437
15:11:17FromGitter<cabhishek> @mratsim I'll mention it 
15:20:19*mahmudov joined #nim
15:23:35*miran quit (Ping timeout: 240 seconds)
15:24:49Araqedubart: looks ok
15:24:58Araqwill merge when the tests are green
15:27:29FromGitter<mratsim> So now Nim seqs are FSTW the fastest seq in the west
15:27:49subsetparkAraq: any tiebreaking opinions on what to name `>>=` in https://github.com/nim-lang/Nim/pull/6404 ?
15:29:20FromGitter<mratsim> Rust call monadic bind "and_then" or something like that iirc for Option
15:29:27FromGitter<ephja> @mratsim in how many ways can random access sequences be optimized anyway? :p
15:29:33*endragor quit (Remote host closed the connection)
15:29:48Araqsubsetpark: 'map'.
15:30:05Araqoverloading resolution can disambiguate and every other name seems worse
15:31:06FromGitter<andreaferretti> no, please, everything but map!
15:31:15FromGitter<mratsim> https://doc.rust-lang.org/std/option/enum.Option.html#method.and_then
15:31:15FromGitter<andreaferretti> overloading cannot disambiguate
15:31:46FromGitter<mratsim> ^ is a bad name
15:31:51FromGitter<mratsim> Map
15:32:01FromGitter<andreaferretti> you may actually want `Option[Option[T]]`
15:32:13FromGitter<andreaferretti> I recognize it is not very common with options
15:32:26FromGitter<andreaferretti> but it may very well happen with generic programming
15:32:30*endragor joined #nim
15:32:47*BigEpsilon quit (Ping timeout: 260 seconds)
15:32:52FromGitter<andreaferretti> bind, flatMap, `>==` are all ok with me
15:32:55subsetparkyeah, it seems unnecessarily confusing to make `map` automatically flatten, in one very specific case
15:32:58FromGitter<mratsim> Copy paste from rust:
15:33:03FromGitter<mratsim> fn and_then<U, F>(self, f: F) -> Option<U> where ⏎ ⏎ ```F: FnOnce(T) -> Option<U>, ``` ⏎ ⏎ [−] ... [https://gitter.im/nim-lang/Nim?at=59c921ae614889d475395aab]
15:33:04FromGitter<andreaferretti> but map has a precise meaning
15:33:26FromGitter<andreaferretti> and you would break a lot of people expectations by conflating it with flatMap
15:34:17subsetparkwhat about `mapAndFlatten`? Similar semantics as `flatMap`, but a little more explicit
15:34:18FromGitter<andreaferretti> my personal vote is for `flatMap`, but I am open to other alternatives
15:34:46AraqI fail to see why overloading can't disambiguate
15:34:53FromGitter<mratsim> flatmap has the advantage of convention mapandflatten is a bit verbose
15:35:31subsetparkIt's not that overloading can't disambiguate - but it introduces ambiguity into the *semantics* of map, by making it much less clear what map does on a type level
15:35:41FromGitter<andreaferretti> because `map` has the type `(Option[A], A => B) => Option[B]`
15:36:09FromGitter<andreaferretti> while `flatMap` has type `(Option[A], A => Option[B]) => Option[B]`
15:36:27Araqok
15:36:33FromGitter<andreaferretti> so anything that matches the second signature will *also* match the first one
15:36:56*endragor quit (Ping timeout: 246 seconds)
15:37:37FromGitter<mratsim> Vegansk used flatmap in his functional programming lib: https://github.com/vegansk/nimfp/blob/master/src/fp/option.nim
15:39:26Araqmeh, what's "flat" about this mapping
15:39:47Araqboth return Option[B]
15:40:05FromGitter<andreaferretti> it is flat for the following reason
15:40:22FromGitter<andreaferretti> assume you do *not* have the second function and just apply `map`
15:40:34FromGitter<andreaferretti> with a function `A => Option[B]`
15:40:46FromGitter<andreaferretti> what you get has type `Option[Option[B]`
15:41:09FromGitter<andreaferretti> the second function does this, and then *flattens* the two levels of `Option` in a single one
15:41:49subsetparkThis allows you to chain multiple functions of the type A => `Option[B]`
15:42:54subsetparkOtherwise you have to do 1. `map`; 2. Look for value and extract; 3. `map` 4. etc...
15:43:40Araqwhy not introduce a 'flat' first?
15:44:02*yglukhov quit (Remote host closed the connection)
15:44:08*endragor joined #nim
15:44:09Araqproc flat[T](x: Option[Option[T]]): Option[T]
15:44:33subsetpark`flat` is going to be type-specific - Option has it, it's `get`
15:45:10subsetpark`flat` is just going from Option[T] -> T, which is going to be dependent on what specifically is inside the `Option`
15:45:14dom96cabhishek: I see you've based it on my slides a little :)
15:45:17FromGitter<andreaferretti> in fact in scala you do have `flatten[A]: Option[Option[A]] => Option[A]`
15:45:41*fastrom quit (Quit: Leaving.)
15:45:43FromGitter<andreaferretti> and it turns out that `flatMap` is the composition of `map` and `flatten`
15:45:58*fastrom joined #nim
15:45:58*MyMind joined #nim
15:46:18FromGitter<andreaferretti> the same pattern works with many other types, such as lists or futures
15:46:34*Sembei quit (Ping timeout: 264 seconds)
15:47:02*endragor quit (Remote host closed the connection)
15:47:08FromGitter<andreaferretti> types having just the `map` operation (which should be associative) are called functors
15:47:37FromGitter<andreaferretti> functors that also have a `flatten` operation (with some compatibility properties) are called monads
15:47:54FromGitter<andreaferretti> now, it is not required for nim to express functors and monads in the stdlib
15:48:13FromGitter<andreaferretti> but at least it would be welcome not to explicitly break the pattern for common types such as options
15:48:22*yglukhov_ joined #nim
15:50:06*BigEpsilon joined #nim
15:50:25*fastrom quit (Ping timeout: 248 seconds)
15:52:39dom96cabhishek: are you using Nim syntax highlighting in your slides?
15:53:06dom96It doesn't seem like it :\
15:53:12*yglukhov_ quit (Ping timeout: 260 seconds)
15:53:25dom96'const person' should just be 'let'
15:53:30dom96*'let person'
15:54:27*endragor joined #nim
15:54:36*sz0 quit (Quit: Connection closed for inactivity)
15:55:11*voiceftp joined #nim
15:56:37FromGitter<BigEpsilon> @Araq , Are you ok for introducing nested types in c2nim ? ⏎ Foo::Bar is maped to FooBar, Foo<T>::Bar is maped to FooBar[T] (with importcpp "Foo<'0>::Bar") ⏎ I already implemented it for "tydef typename" and I want to generelize it to nested Struct/Classes and nested typedef
15:56:49FromGitter<BigEpsilon> It can be by default or with an option
16:04:50FromGitter<cabhishek> @dom96 yeah, I used your slides as an inspiration! Hope you don't mind :)
16:05:52dom96nah, it's cool :)
16:06:03FromGitter<cabhishek> @dom96 is there a nim syntax highlighter for? On slides.com I couldn't find it
16:06:23dom96for reveal.js there certainly is
16:07:11subsetparkandreaferretti does `flatten` have to be implemented for `Option[A] -> A`, or just `Option[Option[A]] -> Option[A]` ?
16:09:08FromGitter<cabhishek> @dom96 good to know! slides.com is just an editor for reveal.js
16:10:06FromGitter<mratsim> Oh @abhishek no GIL in Nim
16:10:45FromGitter<Yardanico> wait, where did he said that?
16:10:54FromGitter<mratsim> Though multithreading is still WIP it's not irremediably crippled like in Python
16:11:25FromGitter<mratsim> He didn't say it but I think it's so much a pain in Python that it should be said
16:11:36FromGitter<Yardanico> @cabhishek but yeah, change method to proc on slide 7
16:11:49*Trustable joined #nim
16:11:50FromGitter<Yardanico> ah sorry
16:11:51FromGitter<Yardanico> on slide 8
16:12:02FromGitter<Yardanico> method speak (self: Person) = can be "proc"
16:12:23FromGitter<cabhishek> @mratsim exactly, I need to add a slide on multithreading.
16:12:34*nsf quit (Quit: WeeChat 1.9)
16:13:41FromGitter<cabhishek> @Yardanico done
16:13:51*taaperotassu quit (Ping timeout: 248 seconds)
16:14:21FromGitter<andreaferretti> @subsetpark `flatten` has type `Option[Option[A]] => Option[A]` because there is no operation `Option[A] => A`
16:14:30FromGitter<andreaferretti> I mean, there is one if the option is not empty
16:14:39FromGitter<andreaferretti> but the whole point is that it may be empty
16:14:44subsetparkright, right
16:14:45subsetparkmakes sense
16:17:34FromGitter<Yardanico> and yeah, change const to let on this slide too as @dom96 said :) @cabhishek
16:18:06*taaperotassu joined #nim
16:18:53*relax quit (Ping timeout: 255 seconds)
16:24:29subsetparkandreaferretti / Araq - added `flatten` and implemented `flatMap` in terms of it. Araq hopefully you have been convinced of the usefulness of maintaining two different type signatures for these operations!
16:24:47subsetparkhttps://github.com/nim-lang/Nim/pull/6404
16:30:21*endragor_ joined #nim
16:31:29*arnetheduck_ quit (Ping timeout: 255 seconds)
16:33:37*endragor quit (Ping timeout: 248 seconds)
16:37:06*yglukhov joined #nim
16:37:47*sz0 joined #nim
16:41:37*yglukhov quit (Ping timeout: 260 seconds)
16:43:25FromGitter<jilee210> mydiff
16:44:03*couven92 joined #nim
16:48:01*miran joined #nim
16:49:09*jjido quit (Ping timeout: 252 seconds)
16:51:18FromGitter<krux02> are you trying to implement a full functional programming library to nim?
16:51:22*ShalokShalom_ is now known as ShalokShalom
16:51:34FromGitter<krux02> flatMap, map, fold etc?
16:51:49PMunchHmm, I should really implement a persistent hash-map to go with my persistent vectors..
16:52:24FromGitter<krux02> persistent hashmap, -> serialize to file on program exit an read from it at start
16:52:53PMunchNot that kind of persistence
16:53:01PMunchPersistence as in the functional sense
16:53:09FromGitter<krux02> ?
16:53:13FromGitter<krux02> you mean immutable?
16:53:22PMunchhttp://hypirion.com/musings/understanding-persistent-vector-pt-1
16:53:41PMunchYeah, also called persistent
16:54:37FromGitter<krux02> yea not sure if I want to call it persistent, because I always called it immutable
16:54:38PMunchhttps://github.com/PMunch/nim-persistent-vector
16:54:53FromGitter<krux02> call it immutable please
16:55:02FromGitter<krux02> persistency is overloaded
16:55:34PMunchWell they aren't technically the same: https://stackoverflow.com/questions/10034537/persistent-vs-immutable-data-structure
16:58:41*yglukhov joined #nim
16:59:54*Jesin quit (Quit: Leaving)
17:00:54AraqBigEpsilon: every c2nim extension is welcomed
17:01:13Araqok, you convinced me, 'flatMap' is the name to use
17:02:49*Ven joined #nim
17:03:00*subsetpark wipes brow
17:03:05*Jesin joined #nim
17:03:13*Ven is now known as Guest72709
17:09:44*BigEpsilon quit (Ping timeout: 240 seconds)
17:21:05subsetparkAraq / dom96 : I am running a Nim library as a Python extension, compiled to C and then called in FFI. I've never experienced any segfaults before, but now in a new application environment I am. I'm running uwsgi, and spawning multiple app processes in addition to a master process. Can you think of where I would now be encountering memory issues?
17:31:41*rauss quit (Quit: WeeChat 1.9)
17:31:50*rauss joined #nim
17:33:31FromGitter<mratsim> oh @abhishek if it’s not too long already maybe talk about testing in Nim? Having static types means much less tests (no need to test malformed string if your proc only accepts int), and the unittest lib in the standard library is pretty straightforward
17:36:44*Guest72709 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:37:45*mahmudov quit (Remote host closed the connection)
17:42:59*vivus joined #nim
17:44:24*rusua joined #nim
17:47:56*yglukhov quit (Remote host closed the connection)
17:48:33*yglukhov joined #nim
17:48:33*yglukhov quit (Remote host closed the connection)
17:48:49*yglukhov joined #nim
17:50:02*yglukhov quit (Remote host closed the connection)
17:51:42FromGitter<cabhishek> @mratsim good point! I have included unittest in std lib section and will add to it
17:52:19FromGitter<cabhishek> @mratsim do you have any good examples of dynamic dispatch for methods?
17:52:57FromGitter<mratsim> I don’t like dynamic dispatch :P but maybe on goer.se web site
17:53:08FromGitter<mratsim> gokr*
17:53:33FromGitter<cabhishek> yeah, I read through his blog posts.
17:53:38FromGitter<mratsim> I remember seeing a very cool example on distinct type with currencies. I’m pretty sure I saw something with methods
17:53:55FromGitter<mratsim> by the way, for scientists distinct type is awesome ;)
17:54:33FromGitter<cabhishek> interesting. I was not planning to talk about it but maybe I should
17:54:36FromGitter<mratsim> Physicists are always “check your units, you don’t add kg with meter, this is plain wrong"
17:55:07FromGitter<Bennyelg> Fuk :( I did rm -rf to my new file LOL thought I added him to git
17:55:19FromGitter<Bennyelg> hours of work gone
17:56:04*Jesin quit (Quit: Leaving)
17:56:28*Etheco_ quit (Quit: Leaving)
17:56:54FromGitter<mratsim> You can market that as zero- (runtime) cost proofing
17:56:58AraqBennyelg: you can alias 'rm' to put stuff into the wastebin
17:57:30*Ven joined #nim
17:57:43FromGitter<Yardanico> @Bennyelg or you can restore it
17:57:51FromGitter<Bennyelg> yea maybe next time. ⏎ It was a improve of the csvql to be 3 x faster
17:57:53*Ven is now known as Guest37155
17:57:56FromGitter<Yardanico> :(
17:57:59*Etheco joined #nim
17:57:59FromGitter<Bennyelg> I can't :(
17:58:01FromGitter<mratsim> if your file system is ext4 you can restore it
17:58:14FromGitter<Bennyelg> How do I verify this lol
17:58:34FromGitter<mratsim> tune2fs -l
17:58:38FromGitter<mratsim> on your disk
17:59:08FromGitter<cabhishek> I use https://github.com/sindresorhus/trash and its pretty good
17:59:12FromGitter<Yardanico> @Bennyelg do you have mac?
17:59:29*nsf joined #nim
17:59:33*Jesin joined #nim
17:59:40FromGitter<Yardanico> @cabhishek ehm, I don't like JS programs
17:59:49FromGitter<Yardanico> I want it to be written in C or C++, or Nim :)
17:59:51FromGitter<Bennyelg> Yes
17:59:59FromGitter<Bennyelg> I am with macBook Air
18:00:09FromGitter<mratsim> oh, can’t be done I think
18:00:19FromGitter<Yardanico> why?
18:00:37FromGitter<cabhishek> well, it offers CLI so you don't have to see the JS code
18:00:40FromGitter<Yardanico> https://unix.stackexchange.com/questions/48200/recovered-deleted-files-on-mac-by-command-line
18:00:42FromGitter<Bennyelg> well, so i'll just improve my threadpool knowledge again and write it once again hehe
18:00:48FromGitter<Yardanico> @cabhishek it's JS, so it's slower
18:01:05FromGitter<Yardanico> @cabhishek I don't want to start node for every time I want to move my file to trash :(
18:01:19livcdjs is an abomination :-(
18:02:09*ofelas joined #nim
18:02:12FromGitter<Yardanico> well it's not,
18:02:29FromGitter<Yardanico> but I think it would be better to use native command on your system to move your file to trash
18:02:33FromGitter<mratsim> @Bennyelg thread pool interesting, I’m lost between all the parallelism/future possibility (forkjoin, thread pool, work stealing, actor, OpenMP …) I can’t find a resource that explains all the tradeoffs and the application domains.
18:02:40*Vladar quit (Quit: Leaving)
18:03:15livcdYardanico: It's unnecessary bloat and complexity
18:03:16FromGitter<Yardanico> @cabhishek and this tool uses a native command on your system :D
18:03:22dom96sending things to trash is easy on Mac OS X, there was a package that did it in Nim actually
18:04:07dom96you just have to wrap one Obj C function IIRC
18:04:15FromGitter<Bennyelg> @mratsim The book explain it pretty well, also, You can read about concurrency and parallelism, I read about it on "Medium" 2 days ago
18:04:31FromGitter<Bennyelg> I'll alias the rm -rf to direct me into the trush
18:04:50FromGitter<mratsim> “The book”? which one?
18:04:58FromGitter<mratsim> ah Nim in action?
18:05:03FromGitter<Bennyelg> yup
18:05:28FromGitter<mratsim> I didn’t buy it, shae on me >_>
18:05:33FromGitter<Bennyelg> I bought a printed copy few months ago and just received it month ago and find a time to read it
18:05:42livcdi am tempted to buy the book but only when it's 1/2 the price
18:05:46livcdsorry dom96 :-(
18:05:49FromGitter<Bennyelg> Now Im going to finish chapter 6
18:05:52*m712 quit (Ping timeout: 248 seconds)
18:05:52*Jesin quit (Quit: brb rebooting)
18:05:56FromGitter<mratsim> it was, 2 weeks ago, for 1 day
18:06:58FromGitter<Bennyelg> I paid full, Because I need @dom96 keep is hard work
18:07:07livcdwell i believe on christmas / new y it will be again
18:07:22FromGitter<mratsim> Cyber Monday !!
18:07:28FromGitter<Bennyelg> ya
18:07:39livcdi bought so many books on manning that i do not have time to read or read only 1 chapter
18:07:42livcd:-S
18:08:20*Guest37155 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:08:28FromGitter<Yardanico> @Bennyelg sadly he gets like 30% of it
18:08:30FromGitter<Yardanico> or less
18:08:48FromGitter<Bennyelg> :/
18:09:33*Ven_ joined #nim
18:09:41FromGitter<dandevelop> How can I pass a Nim string to a function that expects a C string pointer?
18:09:49dom96livcd: there are two chapters that free btw
18:09:53livcddoes the contract prevent him from selling e-book directly ?
18:09:58FromGitter<Yardanico> @dandevelop ptr cstring ?
18:10:04FromGitter<Yardanico> @dandevelop but use c2nim
18:10:26livcddom96: yeah but not the ones that i am interested in :D
18:10:46FromGitter<Yardanico> @dandevelop just write a simple C file with your function, c2nim will generate proper declaration on nim side
18:11:13livcddom96: can you sell the ebooks directly ?
18:11:16FromGitter<dandevelop> @Yardanico I have the string in Nim and I am trying to pass it to the C function
18:11:32FromGitter<dandevelop> like var mystring = "Hello"
18:11:41FromGitter<Yardanico> myfunc(addr mystring)
18:11:54FromGitter<Yardanico> something like this
18:12:23dom96livcd: nope
18:12:36livcdbummer
18:14:25FromGitter<dandevelop> @Yardanico I get this: type mismatch: got (ptr string, int) but expected MyFunctionInC( text: pointer, textsize: uint32)
18:14:41FromGitter<Yardanico> ehm, change "text: pointer" to "text: ptr cstring"
18:14:58FromGitter<Yardanico> are you sure your C function accepts uint32?
18:15:00FromGitter<Yardanico> as length
18:16:59*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
18:17:00FromGitter<dandevelop> @Yardanico what type would be good to express the size of that string?
18:17:35FromGitter<Yardanico> @dandevelop cint
18:17:36FromGitter<Yardanico> "cint"
18:17:40FromGitter<Yardanico> @dandevelop but please
18:17:49FromGitter<Yardanico> don't create C functions declarations by hand
18:17:51FromGitter<Yardanico> use c2nim
18:17:56FromGitter<dandevelop> Ok
18:18:02*solitudesf quit (Remote host closed the connection)
18:18:17FromGitter<dandevelop> I believe this was created by c2nim but I will try again
18:18:21FromGitter<Yardanico> what code you're trying to wrap?
18:19:22FromGitter<dandevelop> https://github.com/oskca/nsciter/blob/78e3256c96b1c99d1d791a1385f41a5201aadf7e/xapi.nim#L25
18:19:38FromGitter<dandevelop> The function on line 25
18:19:47*m712 joined #nim
18:20:35FromGitter<Yardanico> are you sure it was created by c2nim?
18:20:43FromGitter<Yardanico> well
18:20:51FromGitter<Yardanico> you can always convert "ptr cstring" to pointer
18:20:53FromGitter<Yardanico> just cast it
18:21:50FromGitter<Yardanico> castpointer (addr(mystring))
18:21:54FromGitter<Yardanico> shiet
18:22:02FromGitter<Yardanico> ```cast[pointer](addr(mystring))```
18:25:29FromGitter<dandevelop> @Yardanico do you know how can I get number of bytes occupied by the Nim string?
18:25:34*Jesin joined #nim
18:25:48FromGitter<Yardanico> @dandevelop sizeof probably would work? but I don't really know
18:26:22FromGitter<Yardanico> ah, no
18:26:30FromGitter<Yardanico> maybe sizeof(char) * mystring.len ?
18:27:51*yglukhov joined #nim
18:28:07FromGitter<Yardanico> ah, no
18:28:15*zachk joined #nim
18:28:21FromGitter<Yardanico> I don't really know honestly
18:29:15*zachk quit (Max SendQ exceeded)
18:29:39FromGitter<dandevelop> @Yardanico thank you for your help, I guess it depends on the library I use. Seems like that is an UTF8 string
18:30:01FromGitter<Yardanico> well, no, nim strings are just an array of char
18:30:08FromGitter<Yardanico> with length
18:30:20FromGitter<Yardanico> there's no such thing as "utf8 string" in nim
18:30:27*zachk joined #nim
18:30:47FromGitter<dandevelop> I mean the C library expects an UTF8 string
18:31:24FromGitter<Yardanico> well nim strings are utf8 by default
18:31:36FromGitter<Yardanico> so just pass it ? :)
18:33:53FromGitter<Yardanico> @Araq tests in https://github.com/nim-lang/Nim/pull/6437 are fine, but appveyor timed out
18:43:39*john joined #nim
18:44:02*john is now known as Guest47753
18:44:06*Guest47753 is now known as relax
18:47:49*TjYoco joined #nim
18:49:36*mahmudov joined #nim
18:50:28*vivus quit (Ping timeout: 240 seconds)
19:01:46*claudiuinberlin joined #nim
19:02:42FromGitter<Grabli66> Can i read from AsyncFile to pointer(buffer), and then cast this pointer to float64?
19:10:35*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:22:22*randompoop joined #nim
19:22:33randompoopTest
19:24:19*Arrrr quit (Read error: Connection reset by peer)
19:25:31FromGitter<Yardanico> ?
19:26:50randompoopJust a regular old test my friend
19:26:57*TjYoco quit (Quit: Leaving)
19:27:21dom96Grabli66: read into a string, then do whatever you want with it
19:28:51FromGitter<Yardanico> but why do you want to cast pointer to float64?
19:29:21randompoopTurtles
19:29:52FromGitter<Grabli66> dom96. Ok. I did that for uint64. It's simple. But for float64 it's little harder :)
19:30:39FromGitter<Grabli66> @Yardanico , i want to read uint64, float64, etc from AsyncFile. It does not have procedures for that.
19:30:42FromGitter<Yardanico> but WHY do you want a pointer as a float64?
19:30:43FromGitter<Yardanico> well
19:30:50FromGitter<Yardanico> it wouldn't be a "cast"
19:31:00FromGitter<Yardanico> just implement your own "stream" to "streams" module
19:32:41FromGitter<Grabli66> I want to cast buffer, that is pointer to float64
19:34:07FromGitter<Yardanico> just read it into string
19:34:18FromGitter<Grabli66> And then?
19:34:29FromGitter<Jipok> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c95a45177fb9fe7e000e49]
19:34:35FromGitter<Jipok> ?
19:34:50FromGitter<Grabli66> How i can cast string to float64?
19:35:26FromGitter<Yardanico> why do you want "cast" IT?
19:35:47FromGitter<Yardanico> maybe just use https://nim-lang.org/docs/streams.html after you read your string?
19:36:53FromGitter<Grabli66> That string does not have ascii symbols, i cant parse it. It's just a memory of some bytes, and i want get that bytes as float64 :)
19:37:04*yglukhov quit (Remote host closed the connection)
19:37:10dom96cast[float64](myString) ?
19:37:28dom96myString just needs to contain the right bytes
19:37:35dom96but yeah, you can probably use streams for this
19:37:40dom96newStringStream(myString)
19:38:46FromGitter<dandevelop> How does one escape a utf-8 string? I have a string defined as var myString = "hello世界" and I want to pass this to a C library
19:39:37FromGitter<Yardanico> escape?
19:39:45FromGitter<Grabli66> Will be too much allocations for reading one value. 1. Read string from AsyncFile, 2. Create new stream from that string. 3. Read float from stream.
19:39:47dom96what do you want to escape it to?
19:40:10FromGitter<dandevelop> have it in a \uXX\uXX form
19:40:42FromGitter<Yardanico> are you sure C library wants that?
19:40:54FromGitter<Yardanico> @Grabli66 maybe you can firstly try it?
19:40:56FromGitter<Yardanico> and then optimize?
19:41:12dom96Grabli66: so cast it yourself. If you know about allocations you should be able to figure out how to do that :)
19:46:11*Trustable quit (Remote host closed the connection)
19:48:23*miran quit (Quit: Leaving)
19:48:36*ofelas quit (Quit: shutdown -h now)
19:49:50FromGitter<mratsim> small survey, I have to provides several operations with an in-place and an out-of place version. ⏎ Say the out of place version is “negate” (negate all elements of an array/tensor/matrix). What do you prefer for the in-place version? ⏎ ⏎ 1) negate_i (for in-place) ⏎ 2) negate_x (just because) ... [https://gitter.im/nim-lang/Nim?at=59c95dde7b7d98d30d3624e0]
19:54:42dom96The convention is: sort (for in-place) vs. sorted (for copy) in the stdlib.
19:54:52dom96Maybe you could do something similar?
19:57:16FromGitter<mratsim> mmm interesting, I could do negate (out-of-place by usage) / negated (in-place)
19:57:46*voiceftp quit (Read error: Connection reset by peer)
19:57:50FromGitter<mratsim> But there is at least one function (reciprocal: 1/x for all element) which would be reciprocaled :P
19:58:17*voiceftp joined #nim
19:58:22dom96well no, 'negate' would be in-place
19:58:32dom96reciprocated?
19:59:17FromGitter<mratsim> yeah but “negated” is out of place in all other math package. same thing for reciprocal / reciprocated
19:59:47dom96so how do other packages handle this?
19:59:58FromGitter<mratsim> They use special symbol negate_ in Torch/Lua, negate! in Julia
20:01:12*vlad1777d joined #nim
20:01:50dom96that's the convention in those languages though
20:02:01dom96it seems to me like you should follow Nim's conventions in this case
20:03:26*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
20:04:37*relax quit (Ping timeout: 260 seconds)
20:05:04FromGitter<mratsim> yes probably, I tried to follow Nim style in a lot of place, but I didn’t know about this one and always got caught by doing reverse instead of reversed
20:05:09FromGitter<mratsim> Is that in NEP-1 ?
20:05:22FromGitter<Yardanico> nah
20:08:16dom96I guess not.
20:08:22FromGitter<Varriount> I've been trying to find a good naming dichotomy for in-place vs copying operations, and haven't found any foolproof system
20:08:22dom96NEP-1 needs improvements
20:08:39FromGitter<Varriount> Other than adding 'InPlace' to procedures
20:09:20dom96I like the -ed convention
20:10:08subsetparkDumb question: if I have two Python interpreters, and they both load the same nim .so file into memory - there is absolutely no shared memory between the two nim runtimes, right?
20:10:37FromGitter<mratsim> In data science though it’s the veb that’s for out-of-place operations, and I would break domain expectation
20:11:05dom96subsetpark: indeed.
20:11:11dom96But I could be wrong :)
20:11:33subsetparkUgh, I have absolutely no idea where these segfaults are coming from
20:11:49FromGitter<mratsim> I think I’ll just use negate_var
20:12:00dom96mratsim: :(
20:12:05dom96That's definitely not Nim convention
20:12:12FromGitter<mratsim> sooorrryy :/
20:12:21dom96negateMut?
20:12:22FromGitter<mratsim> well it’s better than negate_mut ;)
20:12:28dom96Why?
20:12:29FromGitter<mratsim> isn’t that Rust?
20:12:43dom96if it is then even better, no?
20:12:45FromGitter<mratsim> I’m fine with mut
20:13:02dom96But you should also be using camelCase :P
20:13:04FromGitter<stisa> nim iterators use `mpairs` and `mitems`, so maybe `mnegate`?
20:13:07FromGitter<mratsim> but rust does let mut and IndexMut (for array indexing) while Nim uses var
20:13:15FromGitter<mratsim> ah yes mnegate is good
20:13:23dom96oh yeah, that's a better idea stisa
20:13:24FromGitter<edubart> mnegate I liked
20:13:36FromGitter<mratsim> actually it is brilliant
20:13:51FromGitter<mratsim> and I prefer msort and sort to sort sorted ;)
20:14:14dom96then perhaps we should change conventions :P
20:14:17Araq'msort' ... what's that? FP bending over reality?
20:15:15FromGitter<mratsim> not sure I follow :/
20:16:31Araqanyway, usually you can just use overloading for the "in place" vs "slow" style distinction
20:17:37FromGitter<Yardanico> Araq: https://github.com/nim-lang/Nim/pull/6437 seems to be OK
20:18:22FromGitter<Yardanico> and appveyor timeout is not because of this PR
20:18:31FromGitter<Yardanico> https://ci.appveyor.com/project/dom96/nim/history
20:19:25FromGitter<mratsim> I tried to use overloading but it didn’t work @Araq: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ With == comparison the compiler tells me that it doesn’t expect (void, Tensor) [https://gitter.im/nim-lang/Nim?at=59c964cd7b7d98d30d36469c]
20:19:49FromGitter<mratsim> if mreciprocal is also called reciprocal*
20:21:52Araqwell don't pass an lvalue to the reciprocal but ok I see the problem
20:22:12FromGitter<Bennyelg> what is the problem with the call ⏎ ⏎ ```var header: newSeq[string](row.len)``` [https://gitter.im/nim-lang/Nim?at=59c96574614889d4753ab7c0]
20:22:13*relax joined #nim
20:22:29Araqso yeah, use mreciprocal like mitems
20:22:31FromGitter<mratsim> =
20:22:37Araqbennyelg: use = instead of :
20:22:38FromGitter<mratsim> not :
20:22:39FromGitter<Bennyelg> hehe
20:22:43FromGitter<Bennyelg> yea I am tierd lol
20:22:58*solitudesf joined #nim
20:24:08dom96so should we use msort as well?
20:27:28Araqno, sort vs sorted is better
20:29:39*voice_ftp joined #nim
20:30:08dom96But it's not CoNSisTent ;P
20:30:14dom96j/k
20:30:45*voiceftp quit (Read error: Connection reset by peer)
20:32:13AraqA foolish consistency is the hobgoblin of little minds.
20:32:31subsetparkyou sound like matz
20:33:13*andre1sk joined #nim
20:34:22FromGitter<Yardanico> he sound like PEP :P
20:34:39*endragor_ quit (Ping timeout: 252 seconds)
20:35:01FromGitter<Yardanico> https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds
20:38:14*rusua quit (Quit: Connection closed for inactivity)
20:40:01*gokr quit (Ping timeout: 240 seconds)
20:40:49*endragor joined #nim
20:44:09FromGitter<Bennyelg> does nim have green threads?
20:44:46FromGitter<mratsim> I just updated VScode from 1.14 to 1.16 and the new auto-indent on copy-paste is a pain >_>
20:45:34subsetparkBennyelg - the async modules and {.async.} proc accomplish the same style of concurrency
20:46:15FromGitter<Bennyelg> Thanks. ⏎ Good night folks :D
20:46:52*andre1sk quit (Quit: Page closed)
20:47:44FromGitter<Yardanico> subsetpark: not always
20:47:47FromGitter<Yardanico> not for CPU tasks
20:48:26subsetparkGenerally speaking, green threads are not capable of multiprocessing either
20:51:57xet7Is Nim syntax still changing frequently? Or is there stable long support version?
20:54:30Araqthe syntax is stable and so is everything else really (modulo bugs)
20:55:00Araqthere will be changes to 'nil' for strings, seqs and refs but with a long transition period
20:59:59shodan45Araq: do you still work for "metatexx"?
21:00:05Araqno.
21:00:37shodan45are they still in business? their github repos don't look very active
21:02:30shodan45my company has a large & complicated (not "complex", really) PHP code base, and I'm looking for a migration path
21:02:42shodan45to anything else, really :)
21:02:46*relax quit (Ping timeout: 264 seconds)
21:02:57shodan45and I found https://github.com/metatexx/nimzend
21:03:47*sleepyqt quit (Quit: WeeChat 1.9.1)
21:08:02Araqshodan45: I know nimzend worked for metatexx fwiw
21:08:19Araqand Nim has an unsupported PHP backend too
21:08:30shodan45oh? didn't know that
21:08:56shodan45meaning it can output php? o_O
21:09:27Araqyeah, Nim treats PHP like a dialect of JS :P
21:11:07shodan45what could possibly go wrong? ;)
21:17:53Araqit works for an incremental migration but it's hardly ideal
21:19:22Araqto do a full "all or nothing" migration I would try to patch c2nim until it thinks PHP is C++ ...
21:19:24Araq:D
21:20:14FromGitter<Varriount> I dunno, they're about the same worth regards to readability. :D
21:25:27FromGitter<mratsim> well it’s { } vs <? ?>
21:40:07Araqhttp://klmr.me/slides/modern-cpp/#1
22:00:23*nsf quit (Quit: WeeChat 1.9)
22:04:36*sz0 quit (Quit: Connection closed for inactivity)
22:06:35*solitudesf quit (Ping timeout: 240 seconds)
22:26:01*PMunch quit (Quit: leaving)
23:01:45*vlad1777d quit (Remote host closed the connection)
23:03:12*vlad1777d joined #nim
23:15:10*thomasross quit (Remote host closed the connection)
23:15:35*thomasross joined #nim
23:35:52*zachk quit (Read error: Connection reset by peer)
23:36:42*zachk joined #nim
23:49:15*randompoop quit (Quit: Death is the end of everything)
23:58:02*vlad1777d quit (Remote host closed the connection)
23:58:43*def-pri-pub joined #nim
23:59:39*vlad1777d joined #nim