<< 04-06-2016 >>

00:03:41cheatfatei've got something strange on test toString.nim... everything is fine except `-nan`
00:04:07cheatfateis there any changes have been made recently on this?
00:04:17cheatfateits in my latest local tests run
00:08:38Araqcheatfate: recently is relative
00:10:32*yglukhov joined #nim
00:10:46cheatfateyeah, lets wait for new PR to be compiled :)
00:15:01*yglukhov quit (Ping timeout: 250 seconds)
00:42:56*yglukhov joined #nim
00:47:31*yglukhov quit (Ping timeout: 244 seconds)
01:07:24cheatfateclang code is so slooooow
01:07:49cheatfateits why my freebsd tests is slower then linux tests
01:10:40*chemist69 quit (Ping timeout: 260 seconds)
01:13:23*brson quit (Quit: leaving)
01:13:55*brson joined #nim
01:19:06*yglukhov joined #nim
01:21:54*fastrom quit (Quit: Leaving.)
01:23:32*chemist69 joined #nim
01:23:33*yglukhov quit (Ping timeout: 240 seconds)
01:34:29*PMunch quit (Quit: leaving)
01:35:25*PMunch joined #nim
01:40:42*arnetheduck joined #nim
01:43:30*yglukhov joined #nim
01:47:47*desophos quit (Ping timeout: 244 seconds)
01:48:02*brson_ joined #nim
01:48:28*yglukhov quit (Ping timeout: 264 seconds)
01:51:10*brson quit (Ping timeout: 258 seconds)
01:52:13*brson_ quit (Client Quit)
01:56:32*mcc quit (Quit: Connection closed for inactivity)
02:19:40*yglukhov joined #nim
02:21:21*fastrom joined #nim
02:23:57*yglukhov quit (Ping timeout: 244 seconds)
02:53:22*|meta quit (Quit: Connection closed for inactivity)
02:56:03*yglukhov joined #nim
02:58:23*fastrom quit (Quit: Leaving.)
03:00:56*yglukhov quit (Ping timeout: 272 seconds)
03:09:35*PMunch quit (Quit: leaving)
03:10:05*^aurora^ quit (Ping timeout: 244 seconds)
03:11:44*woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…)
03:16:35*MrFlibble quit (Quit: MrFlibble)
03:20:15*yglukhov joined #nim
03:24:44*yglukhov quit (Ping timeout: 260 seconds)
03:26:15*bjz joined #nim
03:44:28*yglukhov joined #nim
03:49:07*yglukhov quit (Ping timeout: 252 seconds)
04:07:39*Parashurama joined #nim
04:12:10*bjz_ joined #nim
04:12:47*bjz quit (Ping timeout: 260 seconds)
04:13:48*woadwarrior joined #nim
04:18:11*mcc joined #nim
04:20:47*yglukhov joined #nim
04:23:14mccHello, I am having a problem with line 28 here https://bitbucket.org/runhello/nim-practice/src/38f38f40ae99c7c676ca1fa70a2e814f396d97a5/maze.nim?fileviewer=file-view-default it says " type mismatch: got (Array constructor[0..3, nil]) but expected 'array[0..3, Intersection]'" ... why is an array of 4 nils not qualifying as an array of 4 Intersections, given
04:23:14mccthat Intersection is of ref type?
04:25:48*yglukhov quit (Ping timeout: 276 seconds)
04:45:02*yglukhov joined #nim
04:49:21*yglukhov quit (Ping timeout: 240 seconds)
04:49:28Parashuramamcc: I don't know if you solved your problem but 'nil' has no real type. use cast[Intersection](nil)
04:55:42*woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…)
04:56:47mcchm. if i want to zero out an array, is there any better way to do that than [cast[Intersection](nil), cast[Intersection](nil), cast[Intersection](nil), cast[Intersection](nil)] ?
04:57:59mcctypes have default values, right? like if i just say var x : Intersection it will default to nil, won't it? is there a way to intialize a whole array to default values?
04:58:16mccor if i'm filling out arguments of a constructor, is there a way to just say "uh give me the default value for Intersection"?
04:58:24Parashuramamcc: just use var a: array[10, Intersetion]
04:58:55Parashuramamcc: or inside a proc the result is already declared and initialized.
05:00:10mccthanks this is helpful
05:00:39Parashuramamcc: in the line return Intersection(at:at); the exit field is already initialized to [nil, nil, nil, nil] by default.*
05:00:51mccah, ok. i misread an error message then. thanks again
05:01:30Parashuramamcc : and in the rare case where you want the variable uninitialized use pragma {.noinit.}
05:01:43mcc'k
05:21:19*yglukhov joined #nim
05:26:10*yglukhov quit (Ping timeout: 260 seconds)
05:28:49*woadwarrior joined #nim
05:33:01*woadwarrior quit (Client Quit)
05:33:33*woadwarrior joined #nim
05:57:34*yglukhov joined #nim
05:58:40*desophos joined #nim
06:02:39*yglukhov quit (Ping timeout: 276 seconds)
06:04:56*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
06:09:47*Parashurama quit (Quit: ChatZilla 0.9.92 [Firefox 46.0.1/20160511224154])
06:33:38*yglukhov joined #nim
06:37:11*bjz joined #nim
06:38:17*yglukhov quit (Ping timeout: 258 seconds)
06:54:40*makufiru joined #nim
06:58:06*yglukhov joined #nim
07:02:18*yglukhov quit (Ping timeout: 246 seconds)
07:22:16*yglukhov joined #nim
07:26:32*mcc quit (Quit: Connection closed for inactivity)
07:27:09*yglukhov quit (Ping timeout: 276 seconds)
07:31:44*makufiru left #nim (#nim)
07:36:57*zodiak quit (Ping timeout: 246 seconds)
07:47:28*woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…)
07:58:21*yglukhov joined #nim
08:03:33*yglukhov quit (Ping timeout: 276 seconds)
08:04:01*fastrom joined #nim
08:06:23*nsf quit (Quit: WeeChat 1.4)
08:13:55*woadwarrior joined #nim
08:18:20*Arrrr joined #nim
08:22:40*Demon_Fox quit (Quit: Leaving)
08:22:50*yglukhov joined #nim
08:23:14*yglukhov quit (Remote host closed the connection)
08:28:13*yglukhov joined #nim
08:33:54*lubos_cz joined #nim
08:52:47*lubos_cz quit (Ping timeout: 260 seconds)
09:09:58cheatfateAraq, i've got again same thing :) but now on windows :)
09:10:16cheatfateAraq, i think you need to add more information to error `Error: undeclared identifier:`
09:10:59Araqwell you know. symbol injecting templates are not really supposed to be on large scale :P
09:11:08Araqso push your stuff and I shall take a look
09:11:11*yglukhov quit (Remote host closed the connection)
09:11:14Araqbut I need to leave soon
09:13:55cheatfateI think i can try to fight it unil you comeback
09:14:27cheatfateAraq, symbol injecting the only way when you try to avoid pointers everywhere
09:14:44cheatfatein stdlib
09:15:27Araqwell I don't know why yout templates need to be overloaded that much
09:20:41cheatfateAraq, there only 2 templates why overloaded that much?
09:20:58Araqlast time there are so many you oversaw one :P
09:21:07cheatfateor you mean templates [T]
09:21:32cheatfateif this also called [T] templates then it needed to avoid memory allocations while processing sockets
09:21:47cheatfatecurrently asyncdispatch allocates memory many many times
09:22:35cheatfatei have pushed, https://github.com/cheatfate/Nim/tree/helpmeAraq and problematic file is "ioselectors.nim" compiling on windows
09:23:03*yglukhov joined #nim
09:23:12cheatfateand i'm in trouble with only this error `ioselectors.nim(1426, 17) Error: undeclared identifier: 'skey'`
09:24:17cheatfateso if you have some time, you can look and thank you
09:25:24cheatfateyglukhov, are you here?
09:25:41Araqasyncdispatch.nim(491, 18) Error: undeclared identifier: 'WSAPROC_ACCEPTEX'
09:26:54cheatfateAraq, but you dont need to compile asyncdispatch
09:27:07cheatfateonly `lib/pure/ioselectors.nim`
09:28:03*yglukhov quit (Ping timeout: 276 seconds)
09:28:04cheatfateAraq, and i have updated winlean.nim to remove that error on windows
09:28:27cheatfatebut dont watch on asyncdispatch, i need ioselectors.nim :)
09:28:35*lubos_cz joined #nim
09:30:49Araqhmmm, sorry I gotta go.
09:30:56Araqbbl
09:33:18Araqbut this time it looks like a compiler bug
09:33:33Araq:P so work on something else please
09:34:52*ics quit (Quit: Connection closed for inactivity)
09:38:49cheatfateok
09:47:38*yglukhov joined #nim
09:52:03*yglukhov quit (Ping timeout: 246 seconds)
09:55:40*lubos_cz quit (Ping timeout: 260 seconds)
10:01:47*woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…)
10:01:59*GangstaCat quit (Ping timeout: 260 seconds)
10:03:38*woadwarrior joined #nim
10:05:28*woadwarr_ joined #nim
10:06:19*lubos_cz joined #nim
10:08:05*woadwarr_ quit (Client Quit)
10:08:05*woadwarrior quit (Ping timeout: 244 seconds)
10:14:39*Matthias247 joined #nim
10:14:41*GangstaCat joined #nim
10:23:36*yglukhov joined #nim
10:27:45*yglukhov quit (Ping timeout: 246 seconds)
10:48:07*yglukhov joined #nim
10:52:57*yglukhov quit (Ping timeout: 260 seconds)
10:57:46*fredrik92 joined #nim
11:03:14*vendethiel quit (Ping timeout: 260 seconds)
11:06:05*vendethiel joined #nim
11:08:22*yglukhov joined #nim
11:10:25*yglukhov quit (Remote host closed the connection)
11:22:15*yglukhov joined #nim
11:23:03*|meta joined #nim
11:26:33*yglukhov quit (Ping timeout: 246 seconds)
11:27:57*heinrich5991 quit (Ping timeout: 246 seconds)
11:34:47*heinrich5991 joined #nim
11:34:59*desophos quit (Read error: Connection reset by peer)
11:51:18dom96Interesting. D just got a blog http://dlang.org/blog/
11:51:39dom96Maybe we should get rid of our statically generated news pieces and replace it with wordpress?
11:52:01dom96It would be far easier to update.
11:54:43cheatfatedom96, you already made forum, is there a problem to make simple newsline? :)
11:54:58cheatfatewhy to use buggy wordpress
11:57:52dom96that could work too
11:58:05*yglukhov joined #nim
12:02:27*nsf joined #nim
12:02:45*yglukhov quit (Ping timeout: 276 seconds)
12:19:28*Matthias247 quit (Quit: Matthias247)
12:19:45*Matthias247 joined #nim
12:24:19*Matthias247 quit (Ping timeout: 260 seconds)
12:27:44*Matthias247 joined #nim
12:27:50GangstaCatyeah, that way you can show to people everything can be done with Nim, even a forum or a blog system, and that can be really powerful
12:33:44*yglukhov joined #nim
12:37:57*yglukhov quit (Ping timeout: 246 seconds)
12:47:30*lubos_cz quit (Remote host closed the connection)
13:12:21*Matthias247 quit (Quit: Matthias247)
13:12:26cheatfatewe just need a good designer in our team :)
13:12:27*TheLemonMan joined #nim
13:17:10*yglukhov joined #nim
13:24:54*wuehlmau1 is now known as wuehlmaus
13:26:23cheatfateAraq, i think i have found one more bug in compiler, but this time not error but code generator doing some strange things
13:29:13*yglukhov quit (Remote host closed the connection)
13:34:24cheatfateAraq, forget about my last generator bug, my compiler was too old
13:37:50TheLemonManrip compiler
13:40:15*yglukhov joined #nim
13:44:52*yglukhov quit (Ping timeout: 264 seconds)
13:49:08*yglukhov joined #nim
13:50:11*yglukhov quit (Remote host closed the connection)
13:54:57*Matthias247 joined #nim
14:13:10*mcc joined #nim
14:16:32*nsf quit (Quit: WeeChat 1.4)
14:26:44*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
14:36:02*fredrik92 quit (Quit: Shutting down...)
14:46:07*yglukhov joined #nim
14:48:13*Mat4 joined #nim
14:48:17Mat4hi all
14:49:19Mat4Araq: ping
14:50:11cheatfatedom96, is there discussion about `all` in asyncdispatch?
14:51:08dom96what do you mean? On Github?
14:51:56cheatfateyep, just watching code and dont understand something
14:52:18dom96the PRs have some discussion
14:52:32cheatfateif we are passing to `all` futures in varags, i dont think its a good idea to obtain array of results
14:52:54cheatfatejust because varargs mean that i don't pass unknown count of futures to this function
14:53:16*yglukhov quit (Remote host closed the connection)
14:53:22*|meta quit (Quit: Connection closed for inactivity)
14:53:26cheatfateso i dont need seq[resultSet], because i can obtain results by myself without allocating seq[]
14:53:45cheatfatei think seq is only used if futures passed like an array
14:53:49*yglukhov joined #nim
14:54:27cheatfateand even in this situation, i'm already have seq[] of my futures i'm passing to `all` so why i need separate array for their values?
14:55:22cheatfatethis `future arithmetic` functions must be as fast as possible
14:58:54*yglukhov quit (Ping timeout: 276 seconds)
15:04:53AraqMat4: I think the best solution is saturated arithmetic
15:05:25*bjz quit (Max SendQ exceeded)
15:05:27Araqlow(int) and high(int) already are not numbers that are particularly useful
15:07:41*bjz joined #nim
15:09:44Mat4Araq: I agree, however saturated arithmetic lead to some overhead implemented in C without using processor specific libraries
15:13:05Mat4uint16_t sadd16(uint16_t a, uint16_t b)
15:13:05Mat4 { return (a > 0xFFFF - b) ? 0xFFFF : a + b; }
15:15:26Mat4the generated code (GCC) is quite inefficient
15:20:52*yglukhov joined #nim
15:22:33cheatfateMat4, and what code GCC generated?
15:23:46Mat4sadd16:
15:23:46Mat4.LFB0:
15:23:47Mat4 .cfi_startproc
15:23:47Mat4 movswl %di, %ecx
15:23:47Mat4 movswl %si, %eax
15:23:47Mat4 movl $65535, %edx
15:23:49Mat4 subl %eax, %edx
15:23:51Mat4 addl %esi, %edi
15:23:53Mat4 cmpl %edx, %ecx
15:23:55Mat4 movl $-1, %eax
15:23:57Mat4 cmovle %edi, %eax
15:23:59Mat4 ret
15:25:32Mat4problem: cmp + conditional branch + conditional register move
15:27:17Mat4sorry, no conditional branch but instead cmovle
15:28:23cheatfateMat4, you think you could write better?
15:29:19cheatfateMat4, and please could you use intel syntax?
15:35:08Mat4cheatfate: sure, just use movsx and mask out bit 16 of both operand registers before addition
15:35:27Mat4or better mask out the higher register half
15:36:20cheatfateMat4, i think you get such code because you are trying to implement 16bit arithmetic on 32bit registers
15:36:58cheatfateMat4, i think if you compile for 16bit OS you will get better code
15:37:08cheatfateOS = arch
15:39:41Mat4the trick is to avoid overflows using a wider word width for 16 bit arithmetic, then masking out the irrelevant bits. This is also possible with most 16 bit cpu architectures. In these case numbers need to be restricted to 15 bit
15:40:01*desophos joined #nim
15:40:26Mat4(if no option exist for 32 bit arithmetic using two registers)
15:43:01chemist69Hi Araq, you mentioned a few days ago, that you wrote a wrapper for libui and wanted to upload it to nimble. Did you already have the time to do that, because I would love to try it?
15:44:21*nsf joined #nim
15:48:31*woadwarrior joined #nim
15:58:01Mat4cheatfate: because ANSI C does not define the behaviour for overflow and borrow cases and as such the behaviour of all binary logic operators are implementation dependent. That is the reason for above C code (add + and is not a safe combination in C) [to my knowledge]
15:58:54Mat4a C compiler must be very sophisticated to detect saturated arithmetic...
16:03:10tautologicothis is one issue with compiling to C
16:13:40Mat4of course. Nim compiles to C
16:15:10*vendethiel quit (Quit: q+)
16:15:11Mat4sorry for my english
16:15:16*Mat4 is now known as Mat4-bbl
16:23:03*Matthias247 quit (Read error: Connection reset by peer)
16:28:23*xet7 joined #nim
16:30:05Mat4-bbljust to note beside: For signed, staurated arithmetic the sign bit must be restored after the calculation
16:31:44Mat4-bbl(probably a reason for the one complement format which I would prefer)
16:45:14*filwit joined #nim
16:45:30*yglukhov quit (Ping timeout: 276 seconds)
16:53:21filwitdom96: the Nim Forums are a great reference for Jester, but I noticed something odd in forum.nim.. at the end of the file there is `runForever(); db.close()`
16:53:44filwitdom96: isn't that a bug, since the `db.close()` function will never be invoked?
16:54:58filwitor is there something I'm missing about how to shutdown the Jester routs?
17:00:08*yglukhov joined #nim
17:00:13*krolik joined #nim
17:08:20*woadwarrior quit (Quit: Textual IRC Client: www.textualapp.com)
17:09:31dom96filwit: it will be shutdown once the process exits
17:09:33dom96so it doesn't really matter
17:10:04*zodiak joined #nim
17:15:38filwitokay
17:17:41*desophos quit (Ping timeout: 240 seconds)
17:31:54*arnetheduck quit (Remote host closed the connection)
17:33:12*yglukhov quit (Remote host closed the connection)
17:38:25*Mat4-bbl quit (Quit: Leaving)
17:39:15*Trustable joined #nim
17:41:34*yglukhov joined #nim
17:54:07*Demon_Fox joined #nim
18:27:59*yglukhov quit (Remote host closed the connection)
18:30:03*Mat4 joined #nim
18:37:07*yglukhov joined #nim
18:40:07Mat4I get some identifiers wrong, which causes confusion. What I mean with saturated arithemtic is representing an integer in signed magnitude format with larger bit lenght. In these case saturation follows by out masking supernumerary bits and preserving the sign. This can be done within a single mask oparation
18:40:33Mat4^arithmetic
18:40:52Mat4^operation
18:43:12Mat4with assembler that's efficient. However the bit lenght must be fixed and the number range is restricted to to be lesser than the word size
18:49:18Mat4in C there exist the stdint.h library for integer types of specific lenght. The problem is, that the ANSI C standard does not guarantee bit precise operation (to my knowledge). This can result either in inefficient code or even wrong operation.
18:51:00Mat4Most modern CPU's support signed arithmetic though SIMD ISA extensions. Sadly there exist no standard library for using them.
18:51:31*Mat4 quit (Quit: Leaving)
18:51:49*|meta joined #nim
18:57:56*euantor joined #nim
19:10:33*guitmz joined #nim
19:10:42guitmzhello, could anyone help me please?
19:12:08guitmzim getting a binary file size with "getFileSize" and that works but gives me a int64, which I cannot use in my next step which is reading this file bytes into a array using the stream.readData()
19:12:21guitmzbecause stream.readData acceps a int as buffer size
19:12:23guitmznot a int 64
19:12:35guitmztips?
19:12:46Arrrrint(mySize)
19:13:10guitmzyeah, that gives me Error: value of type 'int' has to be discarded
19:13:11*pregressive joined #nim
19:13:35Arrrrlet myNewSize = int(mySize)
19:13:44dom96readData(int(mySize))
19:14:00dom96You need to use the value or explicitly tell the compiler that you want to ignore it.
19:14:19dom96btw welcome to #nim :)
19:14:26guitmzthanks :D
19:14:33guitmzhm basically i need 2 variables to do that?
19:14:48guitmzone with int64 (1st step) then another just for the cast?
19:15:07dom96You shouldn't need two variables, you can just do: readData(getFileSize("asd.txt").int)
19:15:16euantorAre you just trying to read a file into memory? If so, there are easier ways
19:15:38guitmzlet me show you guys better, hang on (pastebin)
19:15:43fowluse memfiles ^^
19:16:29*pregressive quit (Client Quit)
19:16:38guitmzhttp://pastebin.com/AN1feb4E
19:17:07guitmzwill memfile behave like a stream? so i can read its bytes into an array/seq?
19:17:45fowlmemfiles will map the file into memory so you can skip that step of copying it
19:18:16guitmzhm i'll try that now, sounds great, found the docs here.. but still
19:18:27guitmzvery odd, it keeps telling me to discard the int even after the cast
19:18:32guitmzim a bit confused on the motive
19:19:03fowlint(x) doesn't change the type of x, it returns a new value
19:19:46fowlso if you just have that as a statement the compiler says hey you're not doing anything with that int, you have to discard it
19:19:58dom96guitmz: can't you simply use this? http://nim-lang.org/docs/system.html#readFile,string
19:20:01fowlhttp://nim-lang.org/docs/tut1.html#procedures-discard-statement
19:20:38guitmzi could but i need a byte array, not string :/
19:21:24dom96you can get a byte array from a string, but why do you need to?
19:22:24guitmzi need to iterate this byte array looking for a pattern
19:22:26guitmzin a binary file
19:23:26dom96You should be able to iterate a string in the same way
19:23:50guitmzyup, im trying
19:24:09guitmzi was porting a old method from Go to Nim from a old program i wrote
19:24:20guitmzwas trying a 1 to 1 port :)
19:24:22cheatfatedom96, we dont have memory maps wrapper?
19:24:45dom96cheatfate: I think that's what memfiles is, not sure.
19:24:54fowlmemfiles
19:25:13*yglukhov quit (Remote host closed the connection)
19:25:16guitmzyeah apparently so
19:25:42cheatfateyeah, to search file for patter is better to use memfiles
19:26:10guitmzyeah should be more performatic
19:26:24guitmzi see that it behaves like mmap
19:26:28guitmzso yeah
19:29:38*krolik quit (Ping timeout: 250 seconds)
19:30:40*Arrrr quit (Quit: WeeChat 1.4)
19:39:22*desophos joined #nim
19:55:01*guitmz quit (Quit: Page closed)
20:06:41*yglukhov joined #nim
20:11:22*yglukhov quit (Ping timeout: 272 seconds)
20:15:33*yglukhov joined #nim
20:29:44*rok joined #nim
20:59:50*bjz_ joined #nim
21:01:10*bjz quit (Ping timeout: 258 seconds)
21:07:20*Mat4 joined #nim
21:22:17*euantor_ joined #nim
21:25:31*Mat4 quit (Quit: Leaving)
21:25:39*euantor quit (Ping timeout: 276 seconds)
21:43:52*yglukhov quit (Remote host closed the connection)
21:44:27*yglukhov joined #nim
21:47:44*yglukhov_ joined #nim
21:49:03*yglukhov quit (Ping timeout: 276 seconds)
21:50:50*yglukhov_ quit (Remote host closed the connection)
21:56:07*euantor_ quit ()
22:08:16*yglukhov joined #nim
22:12:27*yglukhov quit (Ping timeout: 244 seconds)
22:13:22*|meta quit (Quit: Connection closed for inactivity)
22:14:37*rok quit (Quit: rok)
22:21:00dom96http://nim-lang.org/news/2016_06_04_meet_our_bountysource_sponsors.html
22:30:10cheatfatedom96, i think something wrong with your css/html
22:30:37dom96hrm?
22:31:26dom96which page?
22:31:31dom96and what is wrong?
22:32:09cheatfatewhere i can post an image?
22:32:18dom96imgur.com
22:33:37cheatfatehttps://imagebin.ca/v/2jY4TfkoEcTA
22:35:03cheatfateis it look like expected?
22:35:08*yglukhov joined #nim
22:36:37dom96yeah
22:38:55cheatfatebut looks like misplaced...
22:39:06cheatfatenm, gonna sleep, cya tomorrow
22:39:40*yglukhov quit (Ping timeout: 244 seconds)
22:50:10dom96I guess it does a bit. But it's fine for now.
22:50:34dom96I tried moving it up to align with the title but that created some issues.
23:01:00dom96cheatfate: Of course if you want to play around with it, feel free and create a PR :P
23:03:56*Trustable quit (Remote host closed the connection)
23:11:23*yglukhov joined #nim
23:15:39*yglukhov quit (Ping timeout: 246 seconds)
23:47:36*yglukhov joined #nim
23:52:17*yglukhov quit (Ping timeout: 260 seconds)