00:01:04 | FromGitter | <zacharycarter> lzma? |
00:07:59 | * | relax quit (Ping timeout: 248 seconds) |
00:09:57 | FromGitter | <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:34 | FromGitter | <Varriount> @mratsim What's this new newSeqofCap? |
00:50:23 | * | ipjk quit (Read error: Connection reset by peer) |
00:59:57 | FromGitter | <zacharycarter> @Varriount I think there's a new seqofcap that doesn't initialize its members |
01:00:13 | FromGitter | <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:30 | FromGitter | <genotrance> @Varriount: did you get to try out autodup? |
01:41:53 | * | Ven`` quit (Ping timeout: 248 seconds) |
01:41:56 | FromGitter | <Varriount> Not yet |
01:42:10 | FromGitter | <Varriount> Ben studying German all day |
01:42:16 | FromGitter | <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:02 | skrylar | boop. |
02:11:21 | * | endragor quit (Ping timeout: 252 seconds) |
02:11:42 | * | Snircle joined #nim |
02:22:33 | subsetpark | Varriount: 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:37 | FromGitter | <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:10 | FromGitter | <citycide> anybody used NiGui and know how to disable window resizing? |
05:04:55 | libman | https://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:04 | FromGitter | <Varriount> subsetpark: Nope. I'm from the US |
06:12:44 | * | PMunch joined #nim |
06:14:19 | FromGitter | <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:21 | FromGitter | <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:58 | Araq | cooldome: .noSideEffect is not implied by func yet |
08:31:18 | Araq | will 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:17 | FromGitter | <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:14 | Araq | system.bool vs your bool? |
08:47:41 | * | claudiuinberlin joined #nim |
08:50:46 | FromGitter | <ephja> oh. ofc |
08:50:55 | * | fastrom quit (Quit: Leaving.) |
08:56:03 | * | coffeepot joined #nim |
08:58:19 | coffeepot | hey guys :) |
08:58:42 | coffeepot | i 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:31 | FromGitter | <Grabli66> I saw there will be a "func". What's the difference between proc and func ? |
09:15:41 | Arrrr | No side effects i think |
09:16:13 | FromGitter | <Grabli66> That's all? |
09:16:18 | * | fastrom joined #nim |
09:17:19 | Arrrr | And new bugs |
09:17:41 | FromGitter | <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:14 | Yardanico | Grabli66: 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:28 | Yardanico | https://irclogs.nim-lang.org/23-09-2017.html#21:41:22 |
10:28:00 | FromGitter | <Grabli66> Good. I understood. |
10:28:29 | Yardanico | endragor, 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:01 | FromGitter | <mratsim> hoooo func is there? :))) |
10:48:01 | * | voiceftp quit (Ping timeout: 240 seconds) |
10:48:22 | Yardanico | yes |
10:48:26 | Yardanico | already 2 days :P |
10:48:57 | FromGitter | <mratsim> so big question, can we use shallowCopy in a func on a let variable? should I raise a bug :P |
10:49:14 | Yardanico | AFAIK write tracking is not the best currently |
10:52:08 | Yardanico | mratsim: and btw write-tracking was there a long time ago |
10:52:22 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/compiler/writetracking.nim |
10:54:28 | FromGitter | <mratsim> I was referring to this on going discussion: https://github.com/nim-lang/Nim/issues/644 |
10:58:05 | FromGitter | <mratsim> write-tracking is interesting though, I probably have a lot of use-case for it |
10:59:36 | * | sleepyqt joined #nim |
11:00:05 | Yardanico | btw, 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:22 | FromGitter | <Grabli66> Nim 0.18 soon? :) |
11:21:57 | crem | Before of after community survey results? |
11:26:23 | FromGitter | <Yardanico> @Grabli66 @Araq is planning to make 0.18 an 1.0 Release Candidate 1 |
11:26:36 | crem | :( |
11:26:53 | FromGitter | <Yardanico> I don't know about community survey |
11:27:26 | FromGitter | <Grabli66> Awesome. |
11:30:53 | FromGitter | <Bennyelg> enumerate for ? |
11:31:01 | FromGitter | <Yardanico> @Bennyelg ? |
11:31:15 | FromGitter | <Bennyelg> for index, line in splitLines(chunk): ⏎ I want to retrive the index |
11:31:56 | FromGitter | <Yardanico> well some iterators add this possibility, but it's not available for any iterators |
11:31:59 | FromGitter | <Yardanico> use this: |
11:32:19 | FromGitter | <Yardanico> ```var i =0 ⏎ for line in splitLines(chunk): ⏎ do stuff.. ⏎ inc i``` [https://gitter.im/nim-lang/Nim?at=59c8e943210ac269206c9a45] |
11:32:34 | FromGitter | <Bennyelg> nah |
11:32:38 | FromGitter | <Bennyelg> i wanted to avoid this hehe |
11:33:31 | FromGitter | <Yardanico> well it's only two additional lines |
11:37:54 | * | claudiuinberlin joined #nim |
11:40:25 | FromGitter | <Bennyelg> Yea I know |
11:40:57 | FromGitter | <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:59 | FromGitter | <Yardanico> well it's easy to make "enumerate" iterator |
11:53:15 | FromGitter | <Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c8ee2bcfeed2eb6549ddcc] |
11:53:27 | FromGitter | <Yardanico> one downside: it wouldn't work for arrays |
11:53:36 | FromGitter | <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:58 | FromGitter | <Bennyelg> thanks. |
11:58:03 | FromGitter | <Yardanico> once concepts will be working without bugs, I think it would be good to add things like this to stdlib |
11:58:53 | FromGitter | <Bennyelg> I have no Idea what concept means, first time I am seeing this |
11:59:22 | FromGitter | <Bennyelg> you check the type x is actually the T we pass? |
11:59:26 | FromGitter | <Bennyelg> for each element? |
11:59:50 | FromGitter | <Yardanico> @Bennyelg only check it at compile time |
11:59:57 | FromGitter | <Yardanico> concepts are a compile-time thing |
12:00:33 | FromGitter | <Yardanico> https://nim-lang.org/docs/manual.html#generics-concepts |
12:00:39 | FromGitter | <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:54 | FromGitter | <Bennyelg> Cool |
12:02:49 | * | sleepyqt quit (Quit: WeeChat 1.9) |
12:02:58 | FromGitter | <Yardanico> but because they're not a runtime thing, you can't for example have a seq of Iterator concept |
12:03:05 | FromGitter | <Yardanico> but this will be possible with "vtref" |
12:03:37 | * | vlad1777d joined #nim |
12:03:47 | FromGitter | <Bennyelg> vtref? |
12:04:33 | FromGitter | <Grabli66> "vtref" will be in 1.0 release? |
12:05:01 | * | claudiuinberlin joined #nim |
12:05:05 | FromGitter | <Yardanico> @Bennyelg https://nim-lang.org/docs/manual.html#generics-vtable-types |
12:05:08 | FromGitter | <Yardanico> @Grabli66 I don't really know |
12:05:37 | FromGitter | <Yardanico> vtrefs are already in manual, but they're not implemented yet |
12:06:16 | FromGitter | <Grabli66> :). Ok. We will wait |
12:07:54 | FromGitter | <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:49 | FromGitter | <Yardanico> @mratsim it doesn't work with splitLines for example, because it's an iterator itself |
12:08:57 | FromGitter | <Yardanico> it would work however with toSeq(splitLines()) |
12:09:01 | FromGitter | <Yardanico> but this is not very efficient |
12:09:16 | FromGitter | <mratsim> Yeah, chaining inline iterators is a sore point <_<: https://github.com/nim-lang/Nim/issues/4516 |
12:09:26 | FromGitter | <mratsim> (and the manual says it is possible) |
12:09:40 | FromGitter | <Yardanico> well it works in this case |
12:09:43 | FromGitter | <Yardanico> even with a concept |
12:09:56 | FromGitter | <mratsim> By the way, varargs is a superset of openarray ? |
12:10:19 | FromGitter | <Yardanico> A varargs parameter is an openarray parameter that additionally allows to pass a variable number of arguments to a procedure. |
12:10:27 | FromGitter | <Yardanico> https://nim-lang.org/docs/manual.html#types-varargs :) |
12:10:34 | FromGitter | <Yardanico> The compiler converts the list of arguments to an array implicitly |
12:10:42 | FromGitter | <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:14 | FromGitter | <Yardanico> well you wouldn't be able to pass a seq or array to varargs argument |
12:16:19 | FromGitter | <Yardanico> oh wait |
12:16:20 | FromGitter | <Yardanico> it works |
12:16:20 | FromGitter | <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:49 | FromGitter | <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:42 | FromGitter | <mratsim> no it would work I think ;) |
12:25:24 | FromGitter | <Yardanico> well it would work |
12:25:33 | FromGitter | <Yardanico> but you wouldn't be able to pass a seq or array anymore |
12:26:19 | * | Snircle joined #nim |
12:27:50 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/WLJY/2017-09-25_14-27-26.png) |
12:28:01 | FromGitter | <mratsim> works with array input too |
12:28:09 | * | claudiuinberlin joined #nim |
12:29:39 | FromGitter | <Yardanico> noo |
12:29:40 | FromGitter | <Yardanico> I mean |
12:30:13 | FromGitter | <Yardanico> ok |
12:30:14 | FromGitter | <Yardanico> nvm :D |
12:30:18 | FromGitter | <Yardanico> but be careful |
12:32:21 | FromGitter | <mratsim> I understand how you feel, it's surprising when something work and you didn't expect it ;) |
12:32:43 | FromGitter | <Yardanico> @Araq what is an "opt" type? |
12:32:50 | * | manjaro-kde5 joined #nim |
12:34:01 | Araq | Option[T] done right |
12:34:15 | FromGitter | <Yardanico> ohhh |
12:36:44 | FromGitter | <Yardanico> it's time to update nim again :P |
12:36:59 | FromGitter | <Yardanico> and you really want to make 0.18 an 1.0 RC 1 it seems |
12:38:55 | FromGitter | <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:25 | FromGitter | <Yardanico> oh, lib/pure/marshal.nim(47, 3) Error: not all cases are covered |
12:42:28 | FromGitter | <Yardanico> https://travis-ci.org/nim-lang/Nim/jobs/279493817 |
12:43:50 | Araq | gah, will fix it |
12:44:24 | Araq | today I learned about emplace_back :-) |
12:44:57 | * | sleepyqt joined #nim |
12:45:01 | Araq | C++ is interesting in its weird hacks for speed |
12:48:14 | Araq | instead 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:35 | Araq | they come up with variadic templates with perfect forwarding |
12:50:03 | Araq | but ok, my shallowCopy variant misses the point somewhat I guess |
12:51:00 | * | jjido joined #nim |
12:53:08 | crem | I 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:22 | Araq | crem: yes but these copies are then under the optimizer's control |
12:55:49 | Araq | and 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:05 | crem | Well, 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:19 | FromGitter | <edubart> @Araq I've tried newSeqOfCap followed by setLen, and worked well, thanks, but now my performance slowdown is because of #6433 |
13:11:39 | Araq | so fix it |
13:13:05 | * | m712 quit (Ping timeout: 240 seconds) |
13:13:12 | FromGitter | <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:42 | Araq | edubart: there you go, still slower than copyMem but I'm too lazy to fix it in the codegen |
13:21:16 | Araq | it's only 2x times slower now |
13:24:06 | FromGitter | <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:19 | FromGitter | <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:18 | FromGitter | <mratsim> Hohoho, thanks @Araq |
14:03:35 | * | jjido joined #nim |
14:05:40 | FromGitter | <Jipok> @edubart What utility did you use to get: "genericAssignAux at 95% cpu usage"? |
14:06:39 | FromGitter | <edubart> the DNN classification demo at https://github.com/edubart/arraymancer-demos |
14:07:19 | FromGitter | <edubart> install arraymancer, run it, and use "perf" linux utility |
14:07:59 | FromGitter | <Yardanico> @edubart update benchmarks? :) |
14:08:05 | FromGitter | <Yardanico> and make them as a table maybe? |
14:08:17 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:08:26 | FromGitter | <edubart> later will do that |
14:10:25 | * | ShalokShalom_ joined #nim |
14:11:27 | FromGitter | <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:12 | FromGitter | <Yardanico> guys, if you forgot to star nim repo - star it now! |
14:12:18 | FromGitter | <Yardanico> 3998 stars |
14:13:06 | dom96 | hah |
14:13:13 | dom96 | let's just make bot accounts and star it :P |
14:13:27 | * | ShalokShalom quit (Ping timeout: 260 seconds) |
14:14:15 | FromGitter | <Jipok> @edubart thx. I didnэt know about зука |
14:14:39 | FromGitter | <Jipok> @edubart thx. I didn't know about this tool |
14:16:35 | FromGitter | <ephja> @Bennyelg I assume you have more than 4 cores considering the speed up |
14:16:47 | FromGitter | <ephja> unless you optimized something else in the meantime :p |
14:17:17 | * | claudiuinberlin joined #nim |
14:22:51 | FromGitter | <Jipok> @edubart I downloaded Hotspot. Maybe you can advise better GUI for perf? Or you use console? |
14:24:23 | FromGitter | <Yardanico> he probably use console |
14:24:28 | FromGitter | <Yardanico> it's not that hard really |
14:26:02 | FromGitter | <edubart> is use console, "perf top -p `pidof myprogram`" |
14:26:18 | FromGitter | <edubart> I* |
14:27:30 | FromGitter | <Bennyelg> @ephja yea I have 4 cores mac (pretty old one) |
14:27:38 | FromGitter | <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:32 | FromGitter | <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:50 | dom96 | oooh, which Python conference? |
14:48:06 | dom96 | also, thank you for preparing a talk :D |
14:48:56 | FromGitter | <Yardanico> @cabhishek can you give us slides ? :) |
14:50:06 | * | miran joined #nim |
14:50:37 | dom96 | I'll take a look in about an hour. Got a call now. |
14:50:43 | FromGitter | <cabhishek> @dom96 http://pyss17.pyss.org/ |
14:52:05 | FromGitter | <cabhishek> @Yardanico @dom96 http://slides.com/akapatkar/nim-for-python-programmers |
14:52:43 | FromGitter | <mratsim> Seems like half the talk are about Data science. Also what is "Grumpy" in one of the talk, sounds funny :D |
14:53:30 | FromGitter | <Yardanico> @cabhishek you can use proc instead of method in Intuitive user defined type system |
14:53:40 | FromGitter | <Jipok> (https://files.gitter.im/nim-lang/Nim/Qjzx/___________.png) |
14:53:46 | FromGitter | <Yardanico> yeah, saw this too |
14:54:16 | FromGitter | <mratsim> Slide 7: change the arg to seq instead of openarray, it would avoid questions that would need diving into details |
14:54:47 | FromGitter | <cabhishek> @mratsim yeah, I was thinking the same :) |
14:55:00 | FromGitter | <mratsim> Unless the type inferred was referring to it? |
14:55:40 | FromGitter | <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:21 | FromGitter | <mratsim> Yeah there are bugs (static) but no breaking change |
14:56:35 | FromGitter | <Yardanico> well stdlib doesn't have any breaking changes |
14:56:42 | FromGitter | <Yardanico> language itself - maybe |
14:57:07 | FromGitter | <mratsim> Will you talk about "someProc a b" or no brace style "a.someProc" ? |
14:57:28 | FromGitter | <cabhishek> @Yardanico ok, I thought there is always the possibility given e.g toLower vs toLowerascii change ? |
14:58:52 | FromGitter | <Yardanico> it was a long time ago |
14:58:58 | FromGitter | <Yardanico> and it still deprecated, and not removed |
14:59:19 | FromGitter | <Yardanico> Deprecated since version 0.15.0: use isLowerAscii instead. |
14:59:30 | FromGitter | <Yardanico> we have 0.17.2 and it's still here |
14:59:41 | FromGitter | <Yardanico> 1) 15.0 was released 1 year ago |
15:00:22 | FromGitter | <cabhishek> @mratsim I wont be talking about that. It might raise doubts ? |
15:00:54 | FromGitter | <mratsim> Yes I think so |
15:00:58 | FromGitter | <cabhishek> @Yardanico Ok. I am totally fine removing it |
15:01:47 | FromGitter | <Yardanico> also identifier equality |
15:01:51 | FromGitter | <Yardanico> someProc = someproc = some_proc |
15:02:20 | FromGitter | <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:54 | FromGitter | <Yardanico> @mratsim you should change comments here from # to ## |
15:03:04 | FromGitter | <Yardanico> in makeUniversall |
15:03:25 | FromGitter | <Jipok> @cabhishek it is probably worth adding about the possibility to use code written in c/c++/js |
15:03:28 | FromGitter | <mratsim> No, if I do that they repeat at each invocation of the template in nim doc2 |
15:03:49 | FromGitter | <mratsim> Second example shamelessly emitting cuda code https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/elementwise_cuda.nim |
15:03:54 | FromGitter | <Yardanico> yeah, and c2nim too @cabhishek |
15:03:57 | FromGitter | <cabhishek> @Yardanico I definitely don't want to talk about that :-| |
15:04:07 | FromGitter | <Yardanico> well it would allow them to use snake_case |
15:04:12 | FromGitter | <cabhishek> I meant about `someProc = someproc = some_proc` |
15:04:14 | FromGitter | <Yardanico> but almost all libraries use camelCase |
15:04:45 | FromGitter | <cabhishek> I'll add `c2nim` section |
15:05:23 | FromGitter | <cabhishek> @Jipok good point. I do mention it on slide #20 |
15:06:16 | FromGitter | <cabhishek> @mratsim Taking a look at your links |
15:07:35 | FromGitter | <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:55 | FromGitter | <edubart> @Araq further improved your change in seq assignment, now I get the same speed as in the test case #6437 |
15:11:17 | FromGitter | <cabhishek> @mratsim I'll mention it |
15:20:19 | * | mahmudov joined #nim |
15:23:35 | * | miran quit (Ping timeout: 240 seconds) |
15:24:49 | Araq | edubart: looks ok |
15:24:58 | Araq | will merge when the tests are green |
15:27:29 | FromGitter | <mratsim> So now Nim seqs are FSTW the fastest seq in the west |
15:27:49 | subsetpark | Araq: any tiebreaking opinions on what to name `>>=` in https://github.com/nim-lang/Nim/pull/6404 ? |
15:29:20 | FromGitter | <mratsim> Rust call monadic bind "and_then" or something like that iirc for Option |
15:29:27 | FromGitter | <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:48 | Araq | subsetpark: 'map'. |
15:30:05 | Araq | overloading resolution can disambiguate and every other name seems worse |
15:31:06 | FromGitter | <andreaferretti> no, please, everything but map! |
15:31:15 | FromGitter | <mratsim> https://doc.rust-lang.org/std/option/enum.Option.html#method.and_then |
15:31:15 | FromGitter | <andreaferretti> overloading cannot disambiguate |
15:31:46 | FromGitter | <mratsim> ^ is a bad name |
15:31:51 | FromGitter | <mratsim> Map |
15:32:01 | FromGitter | <andreaferretti> you may actually want `Option[Option[T]]` |
15:32:13 | FromGitter | <andreaferretti> I recognize it is not very common with options |
15:32:26 | FromGitter | <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:52 | FromGitter | <andreaferretti> bind, flatMap, `>==` are all ok with me |
15:32:55 | subsetpark | yeah, it seems unnecessarily confusing to make `map` automatically flatten, in one very specific case |
15:32:58 | FromGitter | <mratsim> Copy paste from rust: |
15:33:03 | FromGitter | <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:04 | FromGitter | <andreaferretti> but map has a precise meaning |
15:33:26 | FromGitter | <andreaferretti> and you would break a lot of people expectations by conflating it with flatMap |
15:34:17 | subsetpark | what about `mapAndFlatten`? Similar semantics as `flatMap`, but a little more explicit |
15:34:18 | FromGitter | <andreaferretti> my personal vote is for `flatMap`, but I am open to other alternatives |
15:34:46 | Araq | I fail to see why overloading can't disambiguate |
15:34:53 | FromGitter | <mratsim> flatmap has the advantage of convention mapandflatten is a bit verbose |
15:35:31 | subsetpark | It'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:41 | FromGitter | <andreaferretti> because `map` has the type `(Option[A], A => B) => Option[B]` |
15:36:09 | FromGitter | <andreaferretti> while `flatMap` has type `(Option[A], A => Option[B]) => Option[B]` |
15:36:27 | Araq | ok |
15:36:33 | FromGitter | <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:37 | FromGitter | <mratsim> Vegansk used flatmap in his functional programming lib: https://github.com/vegansk/nimfp/blob/master/src/fp/option.nim |
15:39:26 | Araq | meh, what's "flat" about this mapping |
15:39:47 | Araq | both return Option[B] |
15:40:05 | FromGitter | <andreaferretti> it is flat for the following reason |
15:40:22 | FromGitter | <andreaferretti> assume you do *not* have the second function and just apply `map` |
15:40:34 | FromGitter | <andreaferretti> with a function `A => Option[B]` |
15:40:46 | FromGitter | <andreaferretti> what you get has type `Option[Option[B]` |
15:41:09 | FromGitter | <andreaferretti> the second function does this, and then *flattens* the two levels of `Option` in a single one |
15:41:49 | subsetpark | This allows you to chain multiple functions of the type A => `Option[B]` |
15:42:54 | subsetpark | Otherwise you have to do 1. `map`; 2. Look for value and extract; 3. `map` 4. etc... |
15:43:40 | Araq | why not introduce a 'flat' first? |
15:44:02 | * | yglukhov quit (Remote host closed the connection) |
15:44:08 | * | endragor joined #nim |
15:44:09 | Araq | proc flat[T](x: Option[Option[T]]): Option[T] |
15:44:33 | subsetpark | `flat` is going to be type-specific - Option has it, it's `get` |
15:45:10 | subsetpark | `flat` is just going from Option[T] -> T, which is going to be dependent on what specifically is inside the `Option` |
15:45:14 | dom96 | cabhishek: I see you've based it on my slides a little :) |
15:45:17 | FromGitter | <andreaferretti> in fact in scala you do have `flatten[A]: Option[Option[A]] => Option[A]` |
15:45:41 | * | fastrom quit (Quit: Leaving.) |
15:45:43 | FromGitter | <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:18 | FromGitter | <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:08 | FromGitter | <andreaferretti> types having just the `map` operation (which should be associative) are called functors |
15:47:37 | FromGitter | <andreaferretti> functors that also have a `flatten` operation (with some compatibility properties) are called monads |
15:47:54 | FromGitter | <andreaferretti> now, it is not required for nim to express functors and monads in the stdlib |
15:48:13 | FromGitter | <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:39 | dom96 | cabhishek: are you using Nim syntax highlighting in your slides? |
15:53:06 | dom96 | It doesn't seem like it :\ |
15:53:12 | * | yglukhov_ quit (Ping timeout: 260 seconds) |
15:53:25 | dom96 | 'const person' should just be 'let' |
15:53:30 | dom96 | *'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:37 | FromGitter | <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:49 | FromGitter | <BigEpsilon> It can be by default or with an option |
16:04:50 | FromGitter | <cabhishek> @dom96 yeah, I used your slides as an inspiration! Hope you don't mind :) |
16:05:52 | dom96 | nah, it's cool :) |
16:06:03 | FromGitter | <cabhishek> @dom96 is there a nim syntax highlighter for? On slides.com I couldn't find it |
16:06:23 | dom96 | for reveal.js there certainly is |
16:07:11 | subsetpark | andreaferretti does `flatten` have to be implemented for `Option[A] -> A`, or just `Option[Option[A]] -> Option[A]` ? |
16:09:08 | FromGitter | <cabhishek> @dom96 good to know! slides.com is just an editor for reveal.js |
16:10:06 | FromGitter | <mratsim> Oh @abhishek no GIL in Nim |
16:10:45 | FromGitter | <Yardanico> wait, where did he said that? |
16:10:54 | FromGitter | <mratsim> Though multithreading is still WIP it's not irremediably crippled like in Python |
16:11:25 | FromGitter | <mratsim> He didn't say it but I think it's so much a pain in Python that it should be said |
16:11:36 | FromGitter | <Yardanico> @cabhishek but yeah, change method to proc on slide 7 |
16:11:49 | * | Trustable joined #nim |
16:11:50 | FromGitter | <Yardanico> ah sorry |
16:11:51 | FromGitter | <Yardanico> on slide 8 |
16:12:02 | FromGitter | <Yardanico> method speak (self: Person) = can be "proc" |
16:12:23 | FromGitter | <cabhishek> @mratsim exactly, I need to add a slide on multithreading. |
16:12:34 | * | nsf quit (Quit: WeeChat 1.9) |
16:13:41 | FromGitter | <cabhishek> @Yardanico done |
16:13:51 | * | taaperotassu quit (Ping timeout: 248 seconds) |
16:14:21 | FromGitter | <andreaferretti> @subsetpark `flatten` has type `Option[Option[A]] => Option[A]` because there is no operation `Option[A] => A` |
16:14:30 | FromGitter | <andreaferretti> I mean, there is one if the option is not empty |
16:14:39 | FromGitter | <andreaferretti> but the whole point is that it may be empty |
16:14:44 | subsetpark | right, right |
16:14:45 | subsetpark | makes sense |
16:17:34 | FromGitter | <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:29 | subsetpark | andreaferretti / 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:47 | subsetpark | https://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:25 | FromGitter | <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:18 | FromGitter | <krux02> are you trying to implement a full functional programming library to nim? |
16:51:22 | * | ShalokShalom_ is now known as ShalokShalom |
16:51:34 | FromGitter | <krux02> flatMap, map, fold etc? |
16:51:49 | PMunch | Hmm, I should really implement a persistent hash-map to go with my persistent vectors.. |
16:52:24 | FromGitter | <krux02> persistent hashmap, -> serialize to file on program exit an read from it at start |
16:52:53 | PMunch | Not that kind of persistence |
16:53:01 | PMunch | Persistence as in the functional sense |
16:53:09 | FromGitter | <krux02> ? |
16:53:13 | FromGitter | <krux02> you mean immutable? |
16:53:22 | PMunch | http://hypirion.com/musings/understanding-persistent-vector-pt-1 |
16:53:41 | PMunch | Yeah, also called persistent |
16:54:37 | FromGitter | <krux02> yea not sure if I want to call it persistent, because I always called it immutable |
16:54:38 | PMunch | https://github.com/PMunch/nim-persistent-vector |
16:54:53 | FromGitter | <krux02> call it immutable please |
16:55:02 | FromGitter | <krux02> persistency is overloaded |
16:55:34 | PMunch | Well 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:54 | Araq | BigEpsilon: every c2nim extension is welcomed |
17:01:13 | Araq | ok, 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:05 | subsetpark | Araq / 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:31 | FromGitter | <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:42 | FromGitter | <cabhishek> @mratsim good point! I have included unittest in std lib section and will add to it |
17:52:19 | FromGitter | <cabhishek> @mratsim do you have any good examples of dynamic dispatch for methods? |
17:52:57 | FromGitter | <mratsim> I don’t like dynamic dispatch :P but maybe on goer.se web site |
17:53:08 | FromGitter | <mratsim> gokr* |
17:53:33 | FromGitter | <cabhishek> yeah, I read through his blog posts. |
17:53:38 | FromGitter | <mratsim> I remember seeing a very cool example on distinct type with currencies. I’m pretty sure I saw something with methods |
17:53:55 | FromGitter | <mratsim> by the way, for scientists distinct type is awesome ;) |
17:54:33 | FromGitter | <cabhishek> interesting. I was not planning to talk about it but maybe I should |
17:54:36 | FromGitter | <mratsim> Physicists are always “check your units, you don’t add kg with meter, this is plain wrong" |
17:55:07 | FromGitter | <Bennyelg> Fuk :( I did rm -rf to my new file LOL thought I added him to git |
17:55:19 | FromGitter | <Bennyelg> hours of work gone |
17:56:04 | * | Jesin quit (Quit: Leaving) |
17:56:28 | * | Etheco_ quit (Quit: Leaving) |
17:56:54 | FromGitter | <mratsim> You can market that as zero- (runtime) cost proofing |
17:56:58 | Araq | Bennyelg: you can alias 'rm' to put stuff into the wastebin |
17:57:30 | * | Ven joined #nim |
17:57:43 | FromGitter | <Yardanico> @Bennyelg or you can restore it |
17:57:51 | FromGitter | <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:56 | FromGitter | <Yardanico> :( |
17:57:59 | * | Etheco joined #nim |
17:57:59 | FromGitter | <Bennyelg> I can't :( |
17:58:01 | FromGitter | <mratsim> if your file system is ext4 you can restore it |
17:58:14 | FromGitter | <Bennyelg> How do I verify this lol |
17:58:34 | FromGitter | <mratsim> tune2fs -l |
17:58:38 | FromGitter | <mratsim> on your disk |
17:59:08 | FromGitter | <cabhishek> I use https://github.com/sindresorhus/trash and its pretty good |
17:59:12 | FromGitter | <Yardanico> @Bennyelg do you have mac? |
17:59:29 | * | nsf joined #nim |
17:59:33 | * | Jesin joined #nim |
17:59:40 | FromGitter | <Yardanico> @cabhishek ehm, I don't like JS programs |
17:59:49 | FromGitter | <Yardanico> I want it to be written in C or C++, or Nim :) |
17:59:51 | FromGitter | <Bennyelg> Yes |
17:59:59 | FromGitter | <Bennyelg> I am with macBook Air |
18:00:09 | FromGitter | <mratsim> oh, can’t be done I think |
18:00:19 | FromGitter | <Yardanico> why? |
18:00:37 | FromGitter | <cabhishek> well, it offers CLI so you don't have to see the JS code |
18:00:40 | FromGitter | <Yardanico> https://unix.stackexchange.com/questions/48200/recovered-deleted-files-on-mac-by-command-line |
18:00:42 | FromGitter | <Bennyelg> well, so i'll just improve my threadpool knowledge again and write it once again hehe |
18:00:48 | FromGitter | <Yardanico> @cabhishek it's JS, so it's slower |
18:01:05 | FromGitter | <Yardanico> @cabhishek I don't want to start node for every time I want to move my file to trash :( |
18:01:19 | livcd | js is an abomination :-( |
18:02:09 | * | ofelas joined #nim |
18:02:12 | FromGitter | <Yardanico> well it's not, |
18:02:29 | FromGitter | <Yardanico> but I think it would be better to use native command on your system to move your file to trash |
18:02:33 | FromGitter | <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:15 | livcd | Yardanico: It's unnecessary bloat and complexity |
18:03:16 | FromGitter | <Yardanico> @cabhishek and this tool uses a native command on your system :D |
18:03:22 | dom96 | sending things to trash is easy on Mac OS X, there was a package that did it in Nim actually |
18:04:07 | dom96 | you just have to wrap one Obj C function IIRC |
18:04:15 | FromGitter | <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:31 | FromGitter | <Bennyelg> I'll alias the rm -rf to direct me into the trush |
18:04:50 | FromGitter | <mratsim> “The book”? which one? |
18:04:58 | FromGitter | <mratsim> ah Nim in action? |
18:05:03 | FromGitter | <Bennyelg> yup |
18:05:28 | FromGitter | <mratsim> I didn’t buy it, shae on me >_> |
18:05:33 | FromGitter | <Bennyelg> I bought a printed copy few months ago and just received it month ago and find a time to read it |
18:05:42 | livcd | i am tempted to buy the book but only when it's 1/2 the price |
18:05:46 | livcd | sorry dom96 :-( |
18:05:49 | FromGitter | <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:56 | FromGitter | <mratsim> it was, 2 weeks ago, for 1 day |
18:06:58 | FromGitter | <Bennyelg> I paid full, Because I need @dom96 keep is hard work |
18:07:07 | livcd | well i believe on christmas / new y it will be again |
18:07:22 | FromGitter | <mratsim> Cyber Monday !! |
18:07:28 | FromGitter | <Bennyelg> ya |
18:07:39 | livcd | i bought so many books on manning that i do not have time to read or read only 1 chapter |
18:07:42 | livcd | :-S |
18:08:20 | * | Guest37155 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:08:28 | FromGitter | <Yardanico> @Bennyelg sadly he gets like 30% of it |
18:08:30 | FromGitter | <Yardanico> or less |
18:08:48 | FromGitter | <Bennyelg> :/ |
18:09:33 | * | Ven_ joined #nim |
18:09:41 | FromGitter | <dandevelop> How can I pass a Nim string to a function that expects a C string pointer? |
18:09:49 | dom96 | livcd: there are two chapters that free btw |
18:09:53 | livcd | does the contract prevent him from selling e-book directly ? |
18:09:58 | FromGitter | <Yardanico> @dandevelop ptr cstring ? |
18:10:04 | FromGitter | <Yardanico> @dandevelop but use c2nim |
18:10:26 | livcd | dom96: yeah but not the ones that i am interested in :D |
18:10:46 | FromGitter | <Yardanico> @dandevelop just write a simple C file with your function, c2nim will generate proper declaration on nim side |
18:11:13 | livcd | dom96: can you sell the ebooks directly ? |
18:11:16 | FromGitter | <dandevelop> @Yardanico I have the string in Nim and I am trying to pass it to the C function |
18:11:32 | FromGitter | <dandevelop> like var mystring = "Hello" |
18:11:41 | FromGitter | <Yardanico> myfunc(addr mystring) |
18:11:54 | FromGitter | <Yardanico> something like this |
18:12:23 | dom96 | livcd: nope |
18:12:36 | livcd | bummer |
18:14:25 | FromGitter | <dandevelop> @Yardanico I get this: type mismatch: got (ptr string, int) but expected MyFunctionInC( text: pointer, textsize: uint32) |
18:14:41 | FromGitter | <Yardanico> ehm, change "text: pointer" to "text: ptr cstring" |
18:14:58 | FromGitter | <Yardanico> are you sure your C function accepts uint32? |
18:15:00 | FromGitter | <Yardanico> as length |
18:16:59 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
18:17:00 | FromGitter | <dandevelop> @Yardanico what type would be good to express the size of that string? |
18:17:35 | FromGitter | <Yardanico> @dandevelop cint |
18:17:36 | FromGitter | <Yardanico> "cint" |
18:17:40 | FromGitter | <Yardanico> @dandevelop but please |
18:17:49 | FromGitter | <Yardanico> don't create C functions declarations by hand |
18:17:51 | FromGitter | <Yardanico> use c2nim |
18:17:56 | FromGitter | <dandevelop> Ok |
18:18:02 | * | solitudesf quit (Remote host closed the connection) |
18:18:17 | FromGitter | <dandevelop> I believe this was created by c2nim but I will try again |
18:18:21 | FromGitter | <Yardanico> what code you're trying to wrap? |
18:19:22 | FromGitter | <dandevelop> https://github.com/oskca/nsciter/blob/78e3256c96b1c99d1d791a1385f41a5201aadf7e/xapi.nim#L25 |
18:19:38 | FromGitter | <dandevelop> The function on line 25 |
18:19:47 | * | m712 joined #nim |
18:20:35 | FromGitter | <Yardanico> are you sure it was created by c2nim? |
18:20:43 | FromGitter | <Yardanico> well |
18:20:51 | FromGitter | <Yardanico> you can always convert "ptr cstring" to pointer |
18:20:53 | FromGitter | <Yardanico> just cast it |
18:21:50 | FromGitter | <Yardanico> castpointer (addr(mystring)) |
18:21:54 | FromGitter | <Yardanico> shiet |
18:22:02 | FromGitter | <Yardanico> ```cast[pointer](addr(mystring))``` |
18:25:29 | FromGitter | <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:48 | FromGitter | <Yardanico> @dandevelop sizeof probably would work? but I don't really know |
18:26:22 | FromGitter | <Yardanico> ah, no |
18:26:30 | FromGitter | <Yardanico> maybe sizeof(char) * mystring.len ? |
18:27:51 | * | yglukhov joined #nim |
18:28:07 | FromGitter | <Yardanico> ah, no |
18:28:15 | * | zachk joined #nim |
18:28:21 | FromGitter | <Yardanico> I don't really know honestly |
18:29:15 | * | zachk quit (Max SendQ exceeded) |
18:29:39 | FromGitter | <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:01 | FromGitter | <Yardanico> well, no, nim strings are just an array of char |
18:30:08 | FromGitter | <Yardanico> with length |
18:30:20 | FromGitter | <Yardanico> there's no such thing as "utf8 string" in nim |
18:30:27 | * | zachk joined #nim |
18:30:47 | FromGitter | <dandevelop> I mean the C library expects an UTF8 string |
18:31:24 | FromGitter | <Yardanico> well nim strings are utf8 by default |
18:31:36 | FromGitter | <Yardanico> so just pass it ? :) |
18:33:53 | FromGitter | <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:42 | FromGitter | <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:33 | randompoop | Test |
19:24:19 | * | Arrrr quit (Read error: Connection reset by peer) |
19:25:31 | FromGitter | <Yardanico> ? |
19:26:50 | randompoop | Just a regular old test my friend |
19:26:57 | * | TjYoco quit (Quit: Leaving) |
19:27:21 | dom96 | Grabli66: read into a string, then do whatever you want with it |
19:28:51 | FromGitter | <Yardanico> but why do you want to cast pointer to float64? |
19:29:21 | randompoop | Turtles |
19:29:52 | FromGitter | <Grabli66> dom96. Ok. I did that for uint64. It's simple. But for float64 it's little harder :) |
19:30:39 | FromGitter | <Grabli66> @Yardanico , i want to read uint64, float64, etc from AsyncFile. It does not have procedures for that. |
19:30:42 | FromGitter | <Yardanico> but WHY do you want a pointer as a float64? |
19:30:43 | FromGitter | <Yardanico> well |
19:30:50 | FromGitter | <Yardanico> it wouldn't be a "cast" |
19:31:00 | FromGitter | <Yardanico> just implement your own "stream" to "streams" module |
19:32:41 | FromGitter | <Grabli66> I want to cast buffer, that is pointer to float64 |
19:34:07 | FromGitter | <Yardanico> just read it into string |
19:34:18 | FromGitter | <Grabli66> And then? |
19:34:29 | FromGitter | <Jipok> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59c95a45177fb9fe7e000e49] |
19:34:35 | FromGitter | <Jipok> ? |
19:34:50 | FromGitter | <Grabli66> How i can cast string to float64? |
19:35:26 | FromGitter | <Yardanico> why do you want "cast" IT? |
19:35:47 | FromGitter | <Yardanico> maybe just use https://nim-lang.org/docs/streams.html after you read your string? |
19:36:53 | FromGitter | <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:10 | dom96 | cast[float64](myString) ? |
19:37:28 | dom96 | myString just needs to contain the right bytes |
19:37:35 | dom96 | but yeah, you can probably use streams for this |
19:37:40 | dom96 | newStringStream(myString) |
19:38:46 | FromGitter | <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:37 | FromGitter | <Yardanico> escape? |
19:39:45 | FromGitter | <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:47 | dom96 | what do you want to escape it to? |
19:40:10 | FromGitter | <dandevelop> have it in a \uXX\uXX form |
19:40:42 | FromGitter | <Yardanico> are you sure C library wants that? |
19:40:54 | FromGitter | <Yardanico> @Grabli66 maybe you can firstly try it? |
19:40:56 | FromGitter | <Yardanico> and then optimize? |
19:41:12 | dom96 | Grabli66: 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:50 | FromGitter | <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:42 | dom96 | The convention is: sort (for in-place) vs. sorted (for copy) in the stdlib. |
19:54:52 | dom96 | Maybe you could do something similar? |
19:57:16 | FromGitter | <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:50 | FromGitter | <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:22 | dom96 | well no, 'negate' would be in-place |
19:58:32 | dom96 | reciprocated? |
19:59:17 | FromGitter | <mratsim> yeah but “negated” is out of place in all other math package. same thing for reciprocal / reciprocated |
19:59:47 | dom96 | so how do other packages handle this? |
19:59:58 | FromGitter | <mratsim> They use special symbol negate_ in Torch/Lua, negate! in Julia |
20:01:12 | * | vlad1777d joined #nim |
20:01:50 | dom96 | that's the convention in those languages though |
20:02:01 | dom96 | it 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:04 | FromGitter | <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:09 | FromGitter | <mratsim> Is that in NEP-1 ? |
20:05:22 | FromGitter | <Yardanico> nah |
20:08:16 | dom96 | I guess not. |
20:08:22 | FromGitter | <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:22 | dom96 | NEP-1 needs improvements |
20:08:39 | FromGitter | <Varriount> Other than adding 'InPlace' to procedures |
20:09:20 | dom96 | I like the -ed convention |
20:10:08 | subsetpark | Dumb 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:37 | FromGitter | <mratsim> In data science though it’s the veb that’s for out-of-place operations, and I would break domain expectation |
20:11:05 | dom96 | subsetpark: indeed. |
20:11:11 | dom96 | But I could be wrong :) |
20:11:33 | subsetpark | Ugh, I have absolutely no idea where these segfaults are coming from |
20:11:49 | FromGitter | <mratsim> I think I’ll just use negate_var |
20:12:00 | dom96 | mratsim: :( |
20:12:05 | dom96 | That's definitely not Nim convention |
20:12:12 | FromGitter | <mratsim> sooorrryy :/ |
20:12:21 | dom96 | negateMut? |
20:12:22 | FromGitter | <mratsim> well it’s better than negate_mut ;) |
20:12:28 | dom96 | Why? |
20:12:29 | FromGitter | <mratsim> isn’t that Rust? |
20:12:43 | dom96 | if it is then even better, no? |
20:12:45 | FromGitter | <mratsim> I’m fine with mut |
20:13:02 | dom96 | But you should also be using camelCase :P |
20:13:04 | FromGitter | <stisa> nim iterators use `mpairs` and `mitems`, so maybe `mnegate`? |
20:13:07 | FromGitter | <mratsim> but rust does let mut and IndexMut (for array indexing) while Nim uses var |
20:13:15 | FromGitter | <mratsim> ah yes mnegate is good |
20:13:23 | dom96 | oh yeah, that's a better idea stisa |
20:13:24 | FromGitter | <edubart> mnegate I liked |
20:13:36 | FromGitter | <mratsim> actually it is brilliant |
20:13:51 | FromGitter | <mratsim> and I prefer msort and sort to sort sorted ;) |
20:14:14 | dom96 | then perhaps we should change conventions :P |
20:14:17 | Araq | 'msort' ... what's that? FP bending over reality? |
20:15:15 | FromGitter | <mratsim> not sure I follow :/ |
20:16:31 | Araq | anyway, usually you can just use overloading for the "in place" vs "slow" style distinction |
20:17:37 | FromGitter | <Yardanico> Araq: https://github.com/nim-lang/Nim/pull/6437 seems to be OK |
20:18:22 | FromGitter | <Yardanico> and appveyor timeout is not because of this PR |
20:18:31 | FromGitter | <Yardanico> https://ci.appveyor.com/project/dom96/nim/history |
20:19:25 | FromGitter | <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:49 | FromGitter | <mratsim> if mreciprocal is also called reciprocal* |
20:21:52 | Araq | well don't pass an lvalue to the reciprocal but ok I see the problem |
20:22:12 | FromGitter | <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:29 | Araq | so yeah, use mreciprocal like mitems |
20:22:31 | FromGitter | <mratsim> = |
20:22:37 | Araq | bennyelg: use = instead of : |
20:22:38 | FromGitter | <mratsim> not : |
20:22:39 | FromGitter | <Bennyelg> hehe |
20:22:43 | FromGitter | <Bennyelg> yea I am tierd lol |
20:22:58 | * | solitudesf joined #nim |
20:24:08 | dom96 | so should we use msort as well? |
20:27:28 | Araq | no, sort vs sorted is better |
20:29:39 | * | voice_ftp joined #nim |
20:30:08 | dom96 | But it's not CoNSisTent ;P |
20:30:14 | dom96 | j/k |
20:30:45 | * | voiceftp quit (Read error: Connection reset by peer) |
20:32:13 | Araq | A foolish consistency is the hobgoblin of little minds. |
20:32:31 | subsetpark | you sound like matz |
20:33:13 | * | andre1sk joined #nim |
20:34:22 | FromGitter | <Yardanico> he sound like PEP :P |
20:34:39 | * | endragor_ quit (Ping timeout: 252 seconds) |
20:35:01 | FromGitter | <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:09 | FromGitter | <Bennyelg> does nim have green threads? |
20:44:46 | FromGitter | <mratsim> I just updated VScode from 1.14 to 1.16 and the new auto-indent on copy-paste is a pain >_> |
20:45:34 | subsetpark | Bennyelg - the async modules and {.async.} proc accomplish the same style of concurrency |
20:46:15 | FromGitter | <Bennyelg> Thanks. ⏎ Good night folks :D |
20:46:52 | * | andre1sk quit (Quit: Page closed) |
20:47:44 | FromGitter | <Yardanico> subsetpark: not always |
20:47:47 | FromGitter | <Yardanico> not for CPU tasks |
20:48:26 | subsetpark | Generally speaking, green threads are not capable of multiprocessing either |
20:51:57 | xet7 | Is Nim syntax still changing frequently? Or is there stable long support version? |
20:54:30 | Araq | the syntax is stable and so is everything else really (modulo bugs) |
20:55:00 | Araq | there will be changes to 'nil' for strings, seqs and refs but with a long transition period |
20:59:59 | shodan45 | Araq: do you still work for "metatexx"? |
21:00:05 | Araq | no. |
21:00:37 | shodan45 | are they still in business? their github repos don't look very active |
21:02:30 | shodan45 | my company has a large & complicated (not "complex", really) PHP code base, and I'm looking for a migration path |
21:02:42 | shodan45 | to anything else, really :) |
21:02:46 | * | relax quit (Ping timeout: 264 seconds) |
21:02:57 | shodan45 | and I found https://github.com/metatexx/nimzend |
21:03:47 | * | sleepyqt quit (Quit: WeeChat 1.9.1) |
21:08:02 | Araq | shodan45: I know nimzend worked for metatexx fwiw |
21:08:19 | Araq | and Nim has an unsupported PHP backend too |
21:08:30 | shodan45 | oh? didn't know that |
21:08:56 | shodan45 | meaning it can output php? o_O |
21:09:27 | Araq | yeah, Nim treats PHP like a dialect of JS :P |
21:11:07 | shodan45 | what could possibly go wrong? ;) |
21:17:53 | Araq | it works for an incremental migration but it's hardly ideal |
21:19:22 | Araq | to do a full "all or nothing" migration I would try to patch c2nim until it thinks PHP is C++ ... |
21:19:24 | Araq | :D |
21:20:14 | FromGitter | <Varriount> I dunno, they're about the same worth regards to readability. :D |
21:25:27 | FromGitter | <mratsim> well it’s { } vs <? ?> |
21:40:07 | Araq | http://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 |