<< 05-07-2015 >>

00:15:40*vendethiel quit (Ping timeout: 246 seconds)
00:20:48*dalarmmst quit (Ping timeout: 264 seconds)
01:15:42*ozra quit (Ping timeout: 246 seconds)
01:23:03*bjz joined #nim
01:25:30*X67r quit (Quit: leaving)
01:31:55*jaco60 quit (Ping timeout: 246 seconds)
01:41:12*EXetoC quit (Ping timeout: 256 seconds)
01:42:02*Jehan_ quit (Quit: Leaving)
01:42:17*Kingsquee joined #nim
01:53:28*Kingsquee quit (Ping timeout: 244 seconds)
01:54:50*Kingsquee joined #nim
01:56:15*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:00:28*bjz joined #nim
02:01:07*bjz quit (Client Quit)
02:17:05*Demon_Fox quit (Quit: Leaving)
02:53:36*zaquest quit (Quit: Leaving)
03:07:42*vendethiel joined #nim
03:12:53*darkf joined #nim
03:23:54*Guest25669 quit (Quit: Leaving)
03:34:09*JohnS_ joined #nim
03:35:12*BitPuffin|osx quit (Ping timeout: 264 seconds)
03:37:37JohnS_Anyone had any luck calling windows gdi+ functions?
03:37:50JohnS_my proc definition looks like this:
03:37:51JohnS_proc GetImageEncodersSize(numEncoders: ptr uint, size: ptr uint) : DWORD {.cdecl, dynlib: "gdiplus.dll", importc:"GetImageEncodersSize".}
03:38:08JohnS_but i get "could not import: GetImageEncodersSize"
03:54:39reactormonkJohnS_, from where? the nim compiler?
03:58:31JohnS_when running the executable
04:23:07*vendethiel quit (Ping timeout: 256 seconds)
04:25:31reactormonkJohnS_, are you able to import it from C?
04:27:58*xcombelle joined #nim
04:28:06JohnS_yeah, something funny's going on, i can call other functions from GDI+. I just tried the straight GdiplusStartup function and that executed fine
04:28:40JohnS_i'm going to keep digging around, thanks for the help
05:52:04*vendethiel joined #nim
06:13:56*vendethiel quit (Ping timeout: 250 seconds)
06:39:07FedeOmotoJohnS_: this is the correct C function declaration
06:39:09FedeOmotoGpStatus __stdcall GdipGetImageEncodersSize(
06:39:09FedeOmoto [out]unsigned int* numEncoders,
06:39:09FedeOmoto [out]unsigned int* size);
06:40:06FedeOmotoyou've to use the stdcall CC
06:43:20FedeOmotobtw, GpStatus is a sdword, not a dword
06:44:56*FedeOmoto quit (Quit: Leaving)
06:48:53*vikaton joined #nim
06:55:29*vikaton quit ()
07:31:42*rainbowism quit ()
07:34:05*tennix joined #nim
07:45:41*vendethiel joined #nim
07:46:48*dalarmmst joined #nim
07:48:57*tennix quit (Remote host closed the connection)
08:00:00*mnagele joined #nim
08:00:12*mnagele left #nim ("Textual IRC Client: www.textualapp.com")
08:02:00*gmpreussner|work quit (Read error: Connection reset by peer)
08:07:28*vendethiel quit (Ping timeout: 250 seconds)
08:08:41*vendethiel joined #nim
08:31:33*Matthias247 joined #nim
08:41:27*jszymanski joined #nim
08:48:52*jaco60 joined #nim
08:54:23*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:12:17*yglukhov_ joined #nim
09:34:17*bjz joined #nim
09:49:12*darkf_ joined #nim
09:50:27*X67r joined #nim
09:52:14*darkf quit (Ping timeout: 248 seconds)
09:52:21*darkf_ is now known as darkf
10:10:00*jszymanski quit (Ping timeout: 264 seconds)
10:12:39*Matthias247 quit (Read error: Connection reset by peer)
10:13:33*jszymanski joined #nim
10:27:44*vasher_ joined #nim
10:52:49*milosn quit (Read error: Connection reset by peer)
10:53:40*jszymanski quit (Ping timeout: 246 seconds)
10:58:24*milosn joined #nim
11:11:55*bluestreak0 joined #nim
11:12:35*thales joined #nim
11:12:58*thales is now known as Guest15779
11:13:12bluestreak0Hi! Is it possible to use the case statement on an enum? I have tried it, but nim complains, "selector must be of an ordinal type, float or string". Any ideas?
11:15:14def-bluestreak0: works for me: https://gist.github.com/def-/0d9bbeb38890d1733d39
11:16:45*jszymanski joined #nim
11:19:16*wuehlmaus quit (Quit: Lost terminal)
11:22:56Araqbluestreak0: don't use some half assed C compatible enum with holes ;-)
11:24:20bluestreak0Araq: Enums don't have holes unless you specify them to, right?
11:24:30Araqright
11:24:36bluestreak0ok, thanks
11:26:48*Kingsquee quit (Quit: Konversation terminated!)
11:30:18*wuehlmaus joined #nim
11:35:49*EXetoC joined #nim
11:48:54*vendethiel quit (Ping timeout: 250 seconds)
11:49:36*vendethiel joined #nim
11:56:15*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:04:39*bjz joined #nim
12:05:47*bjz quit (Client Quit)
12:08:26*bjz joined #nim
12:38:48*vasher_ quit (Quit: Connection closed for inactivity)
12:44:40*boopsiesisaway is now known as boopsies
12:50:49*X67r_ joined #nim
12:54:09*X67r quit (Read error: Connection reset by peer)
13:18:21*johnsoft joined #nim
13:23:49*BitPuffin|osx joined #nim
13:24:29*Pisuke quit (Max SendQ exceeded)
13:25:39*Pisuke joined #nim
13:32:45*def- quit (Ping timeout: 264 seconds)
13:53:28*xcombelle quit (Remote host closed the connection)
13:55:04*Guest15779 quit (Ping timeout: 252 seconds)
14:11:00*Matthias247 joined #nim
14:12:46federico3when adding a raises: [] pragma to a proc the compilation fails without printing out which line can raise an unlisted exception
14:19:49*def- joined #nim
14:21:56*ozra joined #nim
14:24:34*milosn quit (Read error: Connection reset by peer)
14:28:38*Demon_Fox joined #nim
14:30:01*milosn joined #nim
14:33:53*no_name quit (Remote host closed the connection)
14:33:53*devzerp quit (Remote host closed the connection)
14:39:14*no_name joined #nim
14:39:17*devzerp joined #nim
14:39:19*no_name quit (Remote host closed the connection)
14:39:19*devzerp quit (Remote host closed the connection)
14:39:25*Guest15779 joined #nim
14:57:13*FedeOmoto joined #nim
15:06:59*no_name joined #nim
15:06:59*devzerp joined #nim
15:17:24*silven quit (Remote host closed the connection)
15:18:38*no_name quit (Remote host closed the connection)
15:18:38*devzerp quit (Remote host closed the connection)
15:21:38*silven joined #nim
15:22:31*darkf quit (Quit: Leaving)
15:27:41*no_name joined #nim
15:27:43*devzerp joined #nim
16:07:30r-kuAraq: take a look at my coroutine experiments. based on picoro i implemented them in pure nim. but they are still broken. look at https://github.com/r-ku/Nim/blob/coroutines/lib/system/gc_ms.nim#L482 - when i uncomment this and register main app stack with gc test app crashes when first repr of some object is echoed. maybe you have an idea whats going on there? also another thing:
16:07:31r-kuhttps://github.com/r-ku/Nim/blob/coroutines/coro.nim#L60 if this unused variable is removed app crashes in popFrame() near the end of app execution. In case you see something obvious there please do tell. and ill continue looking into it
16:26:46*bcinman joined #nim
16:44:12*Guest15779 quit (Ping timeout: 244 seconds)
16:50:31*bluestreak0 quit (Quit: Leaving)
16:54:11*zaquest joined #nim
16:56:04*elbow quit (Quit: Leaving)
17:02:04*zaquest quit (Quit: Leaving)
17:14:00*vasher_ joined #nim
17:19:40*arnetheduck quit (Ping timeout: 252 seconds)
18:09:03*CPAuto joined #nim
18:09:15*CPAuto quit (Client Quit)
18:17:18*apense joined #nim
18:25:19*pregressive joined #nim
18:53:43*dalarmmst quit (Ping timeout: 252 seconds)
18:53:58*pregressive quit ()
18:56:18*pregressive joined #nim
19:00:35*flaviu quit (Ping timeout: 265 seconds)
19:02:46*pregressive quit ()
19:03:05*flaviu joined #nim
19:05:23*pregressive joined #nim
19:19:19*pregressive quit ()
19:21:37*BitR quit (Quit: leaving)
19:26:12*pregressive joined #nim
19:28:53*BitR joined #nim
19:44:46*dalarmmst joined #nim
19:49:19*yglukhov_ quit (Quit: Be back later ...)
20:10:13*X67r_ quit (Ping timeout: 246 seconds)
20:15:54*gokr quit (Ping timeout: 250 seconds)
20:16:16*X67r joined #nim
20:17:46*X67r_ joined #nim
20:18:00*X67r_ quit (Client Quit)
20:18:00*X67r quit (Client Quit)
20:18:27*X67r joined #nim
20:19:36*boopsies quit (Ping timeout: 255 seconds)
20:24:42Araqr-ku: well you don't scan the registers at all with this version
20:24:52Araqso no wonder it doesn't work
20:40:23*jszymanski quit (Quit: computer sleeps...)
20:57:06*Guest15779 joined #nim
20:58:23*boopsies joined #nim
21:03:52reactormonkAraq, urgh, the mget patch fails a shitload of tests - let's see if I fucked up the merge
21:04:08reactormonkunhandled exception: key not found: gcc.options.always [KeyError] etc.
21:04:20*Varriount|Mobile joined #nim
21:04:20Araqdid you merge it already? o.O
21:05:17reactormonkwell, locally
21:06:39reactormonkhttps://github.com/reactormonk/nim/tree/mget
21:11:40*Varriount|Phone joined #nim
21:12:24reactormonkyou said you used implicit empty string or something?
21:13:11Araqyeah
21:13:32reactormonkwell ^^ time for some code rewrite.
21:13:44reactormonkor just make get return an option or something :-P
21:14:54*Varriount|Mobile quit (Ping timeout: 248 seconds)
21:14:56reactormonkSo get should return a zero?
21:14:59EXetoCimplicit?
21:15:35reactormonkwith a converter ;-)
21:15:59EXetoCright
21:16:38reactormonkso option[var T] -> exception and option[T] -> zero?
21:17:56reactormonkAraq, can we do this at compiletime?
21:18:44*johnsoft quit (Ping timeout: 250 seconds)
21:19:28*johnsoft joined #nim
21:21:38Araqoption[var t] is not a valid type
21:22:03reactormonkAny way to match for it?
21:24:26Araqmeh, why always so complex?
21:24:53Araqjust comment out the [] accessor, replace it with a new getOrDefault and then re-enable []
21:26:37reactormonkhuh?
21:29:06Araqtables.`[]` and strtabs.`[]` are real things that you can comment out
21:29:25reactormonkthe var or non-var version?
21:33:13*brson joined #nim
21:37:55Araqthe non-var version.
21:38:28Araqthe var-version already raises an exception as it should
21:38:40Araqyou want to patch the non-var version
21:39:20EXetoCwot will happen to []?
21:39:24reactormonkOr I could make get return an option and the raise in the var version... >:)
21:39:48reactormonkLet's see if my idea is slower overall.
21:43:04*Trustable joined #nim
21:45:11AraqEXetoC: we will come up with a transition path
21:45:18Araqalready have a couple of ideas
21:45:54Araqin the end [] will raise an exception for invalid keys and the old [] will be getOrDefault
21:54:25reactormonkSounds reasonable to me
21:55:46*milosn quit (Read error: Connection reset by peer)
21:55:47*Trustable_2 joined #nim
21:58:36*Trustable quit (Ping timeout: 255 seconds)
21:58:48*vasher_ quit (Quit: Connection closed for inactivity)
21:59:05dom96wat
21:59:43dom96Araq: Are we making tables use Option[T]?
22:01:10Araqno.
22:01:39*milosn joined #nim
22:12:13EXetoCdom96: asyncnet won't get getSocket?
22:12:38dom96EXetoC: hrm?
22:12:49dom96you mean an accessor to get the fd?
22:13:14EXetoClike getSocket in asyncio which returns the underlying Socket
22:14:14dom96I don't think so.
22:14:27dom96It doesn't have an underlying Socket
22:14:32dom96You just need to create your own
22:18:42dom96EXetoC: What do you need this for?
22:19:34EXetoCI probably don't
22:21:08EXetoCaren't there any conveniences for receiving all the data available in a socket?
22:21:39*Trustable_2 quit (Remote host closed the connection)
22:22:07dom96That's an ambiguous request.
22:22:16EXetoCperhaps by receiving without awaiting
22:22:18dom96Do you want to keep receiving data until the server closes the socket.
22:22:45dom96or do you want to receive the data that has reached your client only.
22:23:13dom96The former is easy, the latter is not (but I don't know why you would want to do it).
22:25:26dom96so tell me more, what are you trying to do?
22:26:31EXetoCthe latter, but doesn't what I just said achieve that? it is convenient when developing, because you can just send data, then sleep for a fraction of a second and then just examine all the data that has arrived at the client at that point
22:26:40Araqthere is no convenience in sockets programming because sockets are fundamentally fucked up. There is "no length of paket" information to be found and so each and every protocol needs to hack around this shortcoming.
22:26:47EXetoCI'll try that and see if it works
22:27:36dom96Just keep reading data.
22:27:42dom96in an infinite loop then
22:27:57dom96while true: let data = await sock.recv(5000)
22:28:20dom96You don't need to sleep
22:30:31*johnsoft quit (Ping timeout: 246 seconds)
22:32:36*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:36:17*johnsoft joined #nim
22:39:41federico3sockets are meant to be streams - it's up to the upper layers to have a concept of "message"
22:40:12*milosn quit (Read error: Connection reset by peer)
22:41:16dom96indeed
22:41:31EXetoCI was only referring to the local buffer, which holds all the data received at any given time
22:42:07federico3I found it really surprising that there isn't a little message passing protocol as part of TCP/IP
22:45:30*milosn joined #nim
22:45:57dom96EXetoC: There is no way to ask the OS for all the data.
22:46:58EXetoCnot even if you specify a large enough buffer, so that you can be certain that the response will fit?
22:47:48EXetoCin conjunction with MSG_DONTWAIT for example if using bsd sockets
22:47:58*brson quit (Quit: leaving)
22:48:11EXetoCI might be wrong, because I haven't actually used it. I was just looking it up now
22:49:34EXetoCfederico3: that would be an optional component I assume
22:49:52federico3EXetoC: hum?
22:50:19EXetoCnevermind
22:50:57dom96Sure, but it really doesn't buy you anything
22:51:08dom96You get the same results by using the snippet I gave you
22:52:30EXetoCdoesn't it wait for an arbitrarily high duration then?
22:53:33EXetoCI do know how to do this, but I was just thinking of potential shortcuts
22:53:53dom96yes, it does. What do you think recv(10000000000000) does?
22:54:17dom96well ok, it can return less than the size you request.
22:54:40*pregress_ joined #nim
22:54:45EXetoCbut is that only upon disconnect?
22:55:02dom96huh
22:55:12dom96Just try it
22:55:30dom96Use the example in the asyncnet docs
22:55:38*pregressive quit (Ping timeout: 256 seconds)
22:55:46EXetoCI'm on it
22:57:29*pregressive joined #nim
22:58:36*zulmin quit (Ping timeout: 264 seconds)
23:00:19*pregress_ quit (Ping timeout: 265 seconds)
23:01:34*pregressive quit (Ping timeout: 248 seconds)
23:14:43*milosn quit (Read error: Connection reset by peer)
23:16:40*Kingsquee joined #nim
23:20:16*milosn joined #nim
23:20:50Araqso ... c2nim just got yet another feature
23:20:56Araq#@ @# blocks
23:21:35Araqthe idea is that you still have to modify the C code to make it behave. but at least you won't ever have to touch the generated nim code
23:22:40*Matthias247 quit (Read error: Connection reset by peer)
23:23:58*Guest15779 quit (Quit: Leaving)
23:28:37*pregressive joined #nim
23:32:14EXetoCgreat
23:32:44def-Araq: nice
23:34:57*pregressive quit (Ping timeout: 252 seconds)
23:36:19*vendethiel quit (Ping timeout: 246 seconds)
23:37:43*pregressive joined #nim
23:42:19Araqalso don't tell ldlework ... but I'm implementing {.noforward.} for types
23:43:52EXetoCwhat are the benefits?
23:44:06Araqeasier C++ wrapper generation
23:44:20AraqC++ code is full of cyclic type dependencies
23:44:21EXetoCobviously we want that
23:44:26EXetoCcus, world domination and all that
23:44:35EXetoCyeah
23:45:17Araqbut it's still restricted to "all type sections in the same module"
23:45:24*vendethiel joined #nim
23:45:29Araqactually hrm ... uh oh
23:45:53Araqdamn this will be tough, I want it to work across include files
23:46:27Araqbut what about
23:46:44Araqwhen complexDependencyThatRequiresVoodoo: include foo
23:49:35Araqoh well
23:50:58*pregressive quit (Read error: Connection reset by peer)
23:51:01*Varriount|Phone quit (Read error: Connection reset by peer)
23:51:02*pregress_ joined #nim
23:51:34*Varriount|Phone joined #nim
23:55:20*pregress_ quit (Read error: Connection reset by peer)
23:55:52*pregressive joined #nim
23:58:04EXetoC"proc update() {.async.} = result = client.sock.send(data) ... proc main() = waitFor update() ... main()" nothing is being sent. what am I doing wrong?
23:58:25reactormonkdom96, maybe >:)