00:00:19 | reactormonk | you could iterate over it? Usecase? |
00:04:49 | miglo | I'm just playing a bit around with recursion and have created a proc that sums up the values of a sequence |
00:05:43 | miglo | don't know whether I've created now the best possible solution |
00:06:12 | miglo | I'm learning nim right now :-) |
00:06:54 | reactormonk | code plz |
00:08:07 | miglo | I was wondering whether some scala examples could be implemented in nim as elegant and concise as in scala |
00:09:18 | reactormonk | Nim and scala require different ways of laying out your code |
00:09:41 | reactormonk | I claim some knowledge in that topic with my scala expertise :-) |
00:09:53 | * | gyeates quit (Ping timeout: 256 seconds) |
00:10:19 | * | boop is now known as boopisaway |
00:11:45 | miglo | here you can find my today's first nim experiment: http://pastebin.com/jruVva6X |
00:12:14 | reactormonk | Probably inefficient as fuck ^^ |
00:12:58 | reactormonk | Hm, might be picked up by tail call optimization, but not sure. tailcall isn't as important in nim so there is no @tailrec |
00:13:05 | miglo | :-) |
00:14:26 | reactormonk | From FP, you might like the concepts, although they aren't used in the stdlib (yet) |
00:14:58 | reactormonk | Araq, anything else for https://github.com/nim-lang/Nim/pull/2930 ? |
00:15:24 | * | jaco60 quit (Ping timeout: 249 seconds) |
00:15:40 | vbtt_ | tail call optimization should require explicit invocation |
00:16:06 | reactormonk | miglo, I assume you know idiomatic nim code would look differently? |
00:17:10 | reactormonk | miglo, e.g. import sequtils; foldl(integers, a + b) |
00:18:09 | * | vikaton quit (Quit: Connection closed for inactivity) |
00:22:14 | * | anthgur quit (Remote host closed the connection) |
00:23:09 | miglo | interesting, thanks for pointing this out. My goal for today was not to write the highest efficient accumulation algo, just to write my first lines of nim code after reading the last days the tutorial. |
00:23:50 | reactormonk | In nim, it's just enough FP if needed, otherwise procedural. Just use a rather hands-on approach. |
00:23:56 | miglo | from the mistakes I made and compiler complains I've already learned a lot |
00:24:35 | miglo | ok, that's it for today. thanks and bye |
00:25:57 | * | johnsoft quit (Ping timeout: 265 seconds) |
00:26:04 | * | miglo left #nim (#nim) |
00:26:13 | * | johnsoft joined #nim |
00:43:43 | * | MyMind joined #nim |
00:47:22 | * | Sembei quit (Ping timeout: 276 seconds) |
00:47:37 | * | gyeates joined #nim |
02:05:13 | * | NimBot joined #nim |
02:05:58 | * | brson joined #nim |
02:09:16 | * | brson quit (Client Quit) |
02:26:37 | * | ozra quit (Ping timeout: 246 seconds) |
02:27:43 | * | tennix quit (Remote host closed the connection) |
02:33:29 | * | tennix joined #nim |
02:33:43 | * | tennix quit (Changing host) |
02:33:43 | * | tennix joined #nim |
02:41:55 | * | darkf joined #nim |
03:00:34 | * | infinity0 quit (Remote host closed the connection) |
03:22:24 | * | vendethiel- quit (Ping timeout: 256 seconds) |
03:27:53 | * | Kingsquee joined #nim |
03:28:23 | * | Demon_Fox quit (Quit: Leaving) |
03:31:29 | * | Pisuke joined #nim |
03:33:33 | * | MyMind quit (Ping timeout: 265 seconds) |
03:43:53 | * | tennix quit (Remote host closed the connection) |
03:45:29 | * | tennix joined #nim |
04:04:18 | * | askatasuna quit (Quit: WeeChat 1.2) |
04:07:04 | * | tennix quit (Remote host closed the connection) |
04:09:03 | * | tennix joined #nim |
04:22:44 | * | ChrisMAN quit (Ping timeout: 245 seconds) |
04:53:53 | * | tennix quit (Remote host closed the connection) |
05:01:02 | * | tennix joined #nim |
05:01:34 | * | vinnie quit (Ping timeout: 256 seconds) |
05:02:42 | * | vinnie joined #nim |
05:13:12 | * | Jesin quit (Quit: Leaving) |
05:30:10 | * | gour joined #nim |
05:35:16 | * | jszymanski joined #nim |
05:38:22 | * | Demon_Fox joined #nim |
06:01:54 | * | tennix quit (Ping timeout: 245 seconds) |
06:05:57 | * | tennix joined #nim |
06:15:29 | * | jszymanski quit (Quit: computer sleeps...) |
06:36:02 | * | tennix quit (Remote host closed the connection) |
06:36:36 | * | tennix joined #nim |
06:40:14 | * | gour left #nim ("Using Circe, the loveliest of all IRC clients") |
07:02:37 | * | Ven joined #nim |
07:12:14 | * | irezvov joined #nim |
07:14:39 | irezvov | hi there |
07:15:00 | irezvov | i have got a trouble with c2nim installation |
07:15:50 | irezvov | i have 0.11.2 version installed, but nimble tries to find devel version |
07:16:02 | irezvov | of nim compiler |
07:16:42 | * | gour joined #nim |
07:16:51 | irezvov | then he tries fetch and install new nim version, and then it says Unsatisfied dependency: nim (>= 0.11.3) |
07:17:04 | irezvov | looks odd :) |
07:18:11 | irezvov | Can somebody show me direction of research? |
07:24:55 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:29:10 | * | Gertm joined #nim |
07:40:56 | * | Ven joined #nim |
07:46:11 | * | gour quit (Quit: Using Circe, the loveliest of all IRC clients) |
07:52:30 | * | tennix quit (Remote host closed the connection) |
07:55:02 | * | tennix joined #nim |
08:00:35 | * | jszymanski joined #nim |
08:13:16 | * | coffeepot joined #nim |
08:14:42 | * | kashyap_ joined #nim |
08:14:56 | kashyap_ | Hi there ... what's a good way to convert a seq[char] to string? |
08:20:24 | kashyap_ | join(collect.mapIt(string, $(it)))? |
08:35:15 | * | gour joined #nim |
08:49:32 | * | milosn quit (Quit: leaving) |
08:49:35 | r-ku | actually my question is similar. i wonder if we can get open_array[T] from seq[T]? i want byte array of seq[int8]. i suppose same method could be applied to converting char seq to string while keeping performance up. |
09:02:48 | * | Demon_Fox quit (Quit: Leaving) |
09:04:53 | Araq | irezvov: hrm that's weird |
09:05:41 | Araq | kashyap_: not sure, I don't use seq[char] to begin with ;-) I use 'string' which is compatible with 'string'. |
09:06:47 | kashyap_ | I am trying to parse a line using for i in str: ... where I get each char at a time and I am putting it into the seq as needed .. at the end of it I need to collapse the seq into a string |
09:07:13 | kashyap_ | actually I am trying to parse CSV and just remembered that there is a module already :) |
09:07:30 | irezvov | Araq: i have already decided to implement required lib(memcache client) in nim natively :) |
09:07:59 | irezvov | so it is not critical for me now |
09:08:13 | Araq | irezvov: woohoo :-) |
09:08:26 | Araq | kashyap_: no no no no, lot's of mistakes right here |
09:08:27 | kashyap_ | but out of curiosity ... how can I approach the problem of going through the characters and collecting them as per some logic |
09:08:31 | Araq | :-) |
09:08:54 | Araq | first of all 'for i in str' doesn't work for anything remotely complex |
09:09:29 | Araq | for example, you split after ';' (ha, for loops works!) but you can escape it like so \; ... ooops |
09:09:45 | kashyap_ | ah .... okay ... I use the csv module for now and look at its implementation later :) |
09:09:59 | Araq | so you need to do i += 2 for handling '\' |
09:10:03 | Araq | secondly |
09:10:32 | Araq | for parsing based on str[i] indexing (and there really is no better way) |
09:10:46 | Araq | we have nice helpers in parseutils.nim |
09:10:52 | Araq | thirdly |
09:11:30 | Araq | you don't collect stuff in a seq only to use join to convert it to a string, Nim is not Python, strings are not "immutable" |
09:11:42 | Araq | you just append to the string via 'add' |
09:12:30 | kashyap_ | won't number of add's result in n^2 for string? |
09:12:41 | Araq | no they won't |
09:12:58 | kashyap_ | cool! |
09:13:00 | Araq | string's 'add' is really like seq's 'add' |
09:13:08 | kashyap_ | I see! |
09:13:10 | kashyap_ | got it |
09:14:22 | Araq | and yes, the CSV parser should be a good example of how to do parsing in Nim |
09:19:08 | * | darkf_ joined #nim |
09:19:17 | * | bjz joined #nim |
09:21:40 | * | darkf quit (Ping timeout: 256 seconds) |
09:34:35 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:41:45 | * | irezvov quit (Quit: Page closed) |
09:51:13 | * | Demon_Fox joined #nim |
10:09:51 | * | pipeep quit (Ping timeout: 248 seconds) |
10:18:59 | * | egrep is now known as meow^ |
10:19:20 | * | meow^ is now known as egrep |
10:21:23 | * | pipeep joined #nim |
10:22:22 | * | dddddd joined #nim |
10:40:09 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
10:41:47 | * | Sentreen joined #nim |
10:48:38 | * | JinShil joined #nim |
10:58:11 | * | tennix quit (Remote host closed the connection) |
10:58:43 | * | tennix joined #nim |
11:08:23 | JinShil | In the mangled name "_D6Object7__ClassZ" does anyone know what the 6 and 7 signify? |
11:14:46 | JinShil | I see. It's the length of the symbol name. |
11:14:55 | * | BitPuffin joined #nim |
11:18:42 | * | BitPuffin quit (Client Quit) |
11:19:44 | * | BitPuffin joined #nim |
11:22:02 | * | darkf_ is now known as darkf |
11:26:09 | * | don_alfredo joined #nim |
11:33:42 | * | Ven joined #nim |
11:33:57 | * | tennix quit (Remote host closed the connection) |
11:44:31 | * | coffeepot joined #nim |
11:53:35 | * | agent_dtscode is now known as Double0dtscode |
11:56:39 | * | Double0dtscode is now known as DoubleOhDTSCode |
11:58:29 | * | tennix joined #nim |
12:02:53 | * | tennix quit (Ping timeout: 246 seconds) |
12:02:59 | * | rgv151 quit (Quit: rcirc on GNU Emacs 24.4.1) |
12:07:39 | * | jaco60 joined #nim |
12:14:05 | * | Demon_Fox quit (Ping timeout: 256 seconds) |
12:14:34 | * | Demon_Fox joined #nim |
12:19:09 | * | vbtt_ quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
12:21:34 | * | vbtt_ joined #nim |
12:35:07 | * | ozra joined #nim |
12:36:20 | * | boopisaway is now known as boop |
12:44:07 | * | gour quit (Remote host closed the connection) |
12:50:21 | * | zahary quit (Read error: Connection reset by peer) |
12:51:19 | * | zahary joined #nim |
12:55:44 | * | Demon_Fox quit (Quit: Leaving) |
12:56:26 | * | zaquest quit (Read error: Connection reset by peer) |
12:57:54 | * | zaquest joined #nim |
12:58:12 | * | milosn joined #nim |
13:11:06 | * | Kingsquee quit (Quit: Konversation terminated!) |
13:26:34 | * | don_alfredo quit (Quit: WeeChat 1.2) |
13:26:48 | ozra | Araq: What are traversalProc generators? Faster GC checkers for generated procs? |
13:36:14 | * | wuehlmaus quit (Quit: Lost terminal) |
13:43:15 | * | Sentreen quit () |
13:46:25 | * | gyeates quit (Ping timeout: 265 seconds) |
13:46:47 | * | Sentreen joined #nim |
14:02:16 | * | gyeates joined #nim |
14:02:47 | Araq | ozra: type specialization for the GC |
14:03:00 | Araq | marker procs are specialized for speed |
14:09:55 | * | renesac quit (Ping timeout: 252 seconds) |
14:12:51 | * | wuehlmaus joined #nim |
14:16:43 | ozra | Araq: Alright. I'm diving deeper and deeper into the chain, wasn't the easiest bug to solve cleanly ;-) Must have the functionality so might as well try to grasp the whole process. |
14:17:02 | * | Sentreen quit () |
14:17:09 | ozra | Well, no it's time for mid summer drinking blackout, barbeque and silly dances. Cheers everyone! |
14:17:19 | Araq | er ... ok ... |
14:17:36 | Araq | can you make the PR before you die? |
14:18:06 | ozra | Depends on what happens tonight! Hopefully ;-) |
14:18:07 | * | irezvov joined #nim |
14:18:58 | irezvov | what is the best way reintepret pure object as string(with manual setted length)? |
14:18:59 | * | Sentreen joined #nim |
14:19:04 | Araq | aren't you too old to get drunk? :P |
14:19:35 | Araq | irezvov: you really can only interpret as 'cstring' |
14:19:50 | Araq | cast[cstring](addr obj) |
14:20:14 | irezvov | but then i want concat it with another string and send by socket |
14:20:16 | ozra | Araq: Fortunately that's an ability you can keep up till your dying day, haha |
14:21:40 | Araq | irezvov: $ the cstring then, but you cannot cast to 'string' directly, the Gc will hate you |
14:23:00 | * | renesac joined #nim |
14:23:49 | irezvov | Araq: so better way to work with such data is cast it to pointer and use low-level socket api? |
14:23:59 | Araq | indeed |
14:24:58 | * | banister joined #nim |
14:25:08 | * | banister quit (Read error: Connection reset by peer) |
14:26:34 | * | ozra quit (Ping timeout: 246 seconds) |
14:31:01 | * | [CBR]Unspoken quit (Ping timeout: 264 seconds) |
14:32:10 | * | Arrrr joined #nim |
14:42:58 | * | jszymanski quit (Ping timeout: 265 seconds) |
14:43:42 | * | jszymanski joined #nim |
14:44:00 | * | JinShil quit (Quit: Konversation terminated!) |
14:48:30 | * | zaquest quit (Read error: Connection reset by peer) |
14:56:42 | * | dddddd quit (Ping timeout: 272 seconds) |
15:00:31 | * | Ven quit (Disconnected by services) |
15:03:06 | * | rgv151 joined #nim |
15:08:08 | * | Matthias247 joined #nim |
15:11:03 | * | NimBot joined #nim |
15:15:50 | * | milosn quit (Ping timeout: 265 seconds) |
15:17:19 | * | Ven_ joined #nim |
15:20:16 | * | Senketsu quit (Quit: Leaving) |
15:22:37 | * | milosn joined #nim |
15:22:52 | * | jszymanski quit (Quit: computer sleeps...) |
15:27:21 | * | zaquest joined #nim |
15:30:30 | * | irezvov quit (Quit: Page closed) |
15:34:21 | * | ChrisMAN joined #nim |
15:40:46 | * | wuehlmaus quit (Remote host closed the connection) |
15:40:57 | * | johnsoft quit (Ping timeout: 244 seconds) |
15:44:50 | * | apense quit (Ping timeout: 265 seconds) |
15:59:42 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:01:53 | * | gmpreussner|work joined #nim |
16:02:28 | * | jszymanski joined #nim |
16:02:34 | * | johnsoft joined #nim |
16:03:07 | * | darkf quit (Quit: Leaving) |
16:08:34 | * | Matthias247 quit (Read error: Connection reset by peer) |
16:08:40 | * | vikaton joined #nim |
16:19:28 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
17:07:34 | * | Sentreen quit (Ping timeout: 276 seconds) |
17:10:44 | * | pregressive joined #nim |
17:12:45 | * | zahary quit (Quit: Leaving.) |
17:15:46 | * | brson joined #nim |
17:31:59 | * | milosn quit (Ping timeout: 256 seconds) |
17:33:12 | * | milosn joined #nim |
17:40:01 | * | BitPuffin quit (Ping timeout: 250 seconds) |
17:46:31 | * | woadwarrior joined #nim |
17:56:25 | * | zaquest quit (Read error: Connection reset by peer) |
17:56:27 | * | yglukhov joined #nim |
18:08:58 | * | Matthias247 joined #nim |
18:19:24 | * | woadwarr_ joined #nim |
18:19:39 | * | Jesin joined #nim |
18:22:49 | * | woadwarrior quit (Ping timeout: 265 seconds) |
18:32:22 | * | woadwarr_ quit (Read error: Connection reset by peer) |
18:34:59 | * | pregressive quit (Remote host closed the connection) |
18:44:08 | * | pregressive joined #nim |
18:53:13 | * | Matthias247 quit (Read error: Connection reset by peer) |
19:03:23 | * | aziz_ joined #nim |
19:04:45 | * | aziz_ is now known as aziz |
19:05:38 | * | zaquest joined #nim |
19:14:29 | * | boop is now known as boopisaway |
19:31:26 | * | flaviu quit (Read error: Connection reset by peer) |
19:33:09 | * | woadwarrior joined #nim |
19:34:01 | * | johnsoft quit (Ping timeout: 264 seconds) |
19:34:18 | * | johnsoft joined #nim |
19:36:35 | * | askatasuna joined #nim |
20:01:55 | * | boopisaway is now known as boop |
20:03:24 | * | boop is now known as boopisaway |
20:04:58 | * | woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
20:10:11 | * | rgv151 quit (Ping timeout: 264 seconds) |
20:11:00 | * | boopisaway is now known as boop |
20:32:29 | * | BitPuffin|osx joined #nim |
20:33:56 | * | Arrrr quit (Quit: WeeChat 1.2) |
20:35:42 | * | Jesin quit (Quit: Leaving) |
20:36:09 | * | DoubleOhDTSCode is now known as dtscode |
20:40:04 | reactormonk | dom96, neat, now we have "guideliens for contributing" in https://github.com/nim-lang/Nim/issues/new |
20:40:47 | dom96 | cool! |
20:44:42 | * | Demon_Fox joined #nim |
21:07:24 | * | Jesin joined #nim |
21:14:55 | * | aziz quit (Remote host closed the connection) |
21:27:43 | * | pregressive quit (Remote host closed the connection) |
21:28:03 | * | gyeates quit (Ping timeout: 276 seconds) |
21:29:33 | * | jszymanski quit (Quit: computer sleeps...) |
21:38:24 | * | saml quit (Quit: Leaving) |
21:39:12 | * | vendethiel joined #nim |
21:39:30 | * | flaviu joined #nim |
21:50:15 | * | gyeates joined #nim |
22:08:26 | * | askatasuna quit (Quit: WeeChat 1.2) |
22:35:43 | * | dalarmmst quit (Ping timeout: 256 seconds) |
22:36:22 | * | brson quit (Quit: leaving) |
22:47:43 | * | dalarmmst joined #nim |
22:56:50 | * | Matthias247 joined #nim |
23:18:35 | * | pregressive joined #nim |
23:18:59 | * | pregressive quit (Remote host closed the connection) |
23:21:10 | * | pipeep quit (Ping timeout: 252 seconds) |
23:22:25 | * | pipeep joined #nim |
23:22:54 | * | dddddd joined #nim |
23:28:17 | * | Xe quit (Ping timeout: 265 seconds) |
23:28:20 | * | vikaton quit (Quit: Connection closed for inactivity) |
23:28:57 | * | Stryzhevskyi joined #nim |
23:30:01 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:33:00 | * | Xe joined #nim |
23:37:10 | * | Stryzhevskyi quit (Quit: Page closed) |
23:44:33 | * | saml_ joined #nim |