<< 19-03-2015 >>

00:01:03kjo1good to know!
00:01:52*xificurC quit (Ping timeout: 240 seconds)
00:03:11*reem_ joined #nim
00:03:27*BlaXpirit quit (Quit: Quit Konversation)
00:04:48*clynamen quit (Ping timeout: 246 seconds)
00:05:55k1iare nim arrays compatible with C-arrays? docs weren't clear
00:06:55*clynamen joined #nim
00:08:14*mpthrapp joined #nim
00:08:15fowlcompatible in what sense
00:09:12fowlarray[1,int] should be int[1]
00:09:22k1i+1
00:09:23k1ithanks
00:09:31kjo1omg
00:10:06kjo1(sorry wrong window)
00:11:23*brson quit (Quit: leaving)
00:11:57*brson joined #nim
00:18:35reactormonkkjo1, nice ^^
00:20:12*bcinman joined #nim
00:20:59*Matthias247 quit (Read error: Connection reset by peer)
00:21:06*bcinman_ quit (Read error: Connection reset by peer)
00:21:36*reem_ quit (Remote host closed the connection)
00:21:42*TEttinger joined #nim
00:22:38*TEttinger quit (Client Quit)
00:23:30*TEttinger joined #nim
00:29:03kjo1Has anyone thought about making an ipython/jupyter kernel for nim? In some sense that would happen after the REPL, but thought I'd ask ...
00:30:22EXetoC"for x in coll.find: ..." -> no segfault, "for x in toSeq(coll.find): ... " -> segfault somewhere in the loop *shrug*
00:30:26flaviukjo1: That seems like a good idea.
00:31:02EXetoCone day I'll be able to write code without stumbling into issues every other line
00:31:03flaviuthe current repl doesn't do FFI and still has occasional bugs, btw.
00:31:22EXetoCone can dream
00:34:39EXetoCat some point I'll have to blame stupidity rather than bad luck :p
00:35:46flaviuI've been looking at Sphinx, and it seems like it shouldn't be too hard to make it do nim.
00:37:01reactormonkflaviu, not the search engine I assume?
00:37:10EXetoCit has sections and such I assume
00:37:30EXetoChaven't used it yet
00:37:31flaviureactormonk: Nope, http://sphinx-doc.org/
00:38:32reactormonkflaviu, could we replace nim doc with that?
00:39:07flaviureactormonk: Doubt araq would go along with that, but it could be an unofficial alternative. Looking to see if it's possible to leverage nimc to avoid having to parse nim.
00:39:34reactormonkflaviu, non-nim doc builder? heresy!
00:39:50EXetoCmight as well use something with more features in the meantime, if necessary
00:39:58reactormonkEXetoC, like?
00:40:18girvoSphinx is used by a lot of projects these days. Pretty sure "readthedocs" is based on it too
00:40:41girvohttps://readthedocs.org/
00:40:54flaviuYep, like the beautiful Python Requests docs.
00:40:56EXetoCreactormonk: I mean than what we have
00:41:03flaviuand it has search too!
00:41:25reactormonkyup, the search is what makes it awesome.
00:42:16EXetoCmuch less work than improving doc2?
00:42:26*bcinman_ joined #nim
00:42:29flaviu*much less*
00:42:33*bcinman quit (Read error: Connection reset by peer)
00:42:49flaviuAll I've got to do is replace https://bitbucket.org/birkenfeld/sphinx/src/40bd03003ac6fe274ccf3c80d7727509e00a69ea/sphinx/ext/autodoc.py?at=default with something that takes nim.
00:44:14*MagusOTB joined #nim
00:45:41EXetoCgo nuts
00:54:16reactormonkflaviu, go for it? I can help you next two days
00:54:46flaviuWell, looks like nim has jsondoc. That looks useful. Unfortunately it segfaults, but I think I've got a patch
00:55:01EXetoCand then port sphinx to nim \o/
00:55:15flaviuEXetoC: Are you working on py2nim?
00:55:25flaviu;)
00:57:35EXetoCnot yet
00:58:47*brson quit (Quit: leaving)
01:04:17reactormonkflaviu, going for the sphinx stuff?
01:04:49*bcinman_ quit (Ping timeout: 245 seconds)
01:05:02flaviureactormonk: yep
01:05:10flaviuI'm digging around in docgen right now
01:05:20reactormonksweet
01:06:31*bcinman joined #nim
01:08:58EXetoCwill it be able to categorise based on the first argument?
01:13:26flaviuhmm, yeah, that is a problem
01:14:42EXetoCit ought to be flexible if it is to be language-agnostic
01:17:45*bcinman_ joined #nim
01:18:35*bcinman quit (Ping timeout: 256 seconds)
01:20:42*tmku quit (Ping timeout: 256 seconds)
01:21:59flaviureactormonk: I'll work out all the bugs in jsondoc, but EXetoC does have a point.
01:22:13flaviuDocgen is of limited usefulness if it doesn't somehow sort by first parameter type.
01:22:51reactormonkflaviu, jsondoc produces a json?
01:23:31flaviuyep, but atm it crashes. see https://github.com/flaviut/Nim/commit/ca38246d21b32a294c97e99657d97f5ef493aefb for a fix
01:23:36EXetoCindirectly at least, by giving more control to the plugin
01:24:36*reem joined #nim
01:26:38*bcinman_ quit (Ping timeout: 265 seconds)
01:27:03*tmku joined #nim
01:27:50reactormonkflaviu, put a PR up
01:28:05reactormonk... if it works as expected
01:28:14flaviureactormonk: I will, I've got some other stuff I'd like to change first though.
01:30:16*bcinman joined #nim
01:34:54*filwit quit (Quit: Leaving)
01:45:13*bcinman quit (Ping timeout: 256 seconds)
01:52:22*bcinman joined #nim
01:53:32*banister joined #nim
02:00:28*darkf joined #nim
02:09:10*bcinman quit (Ping timeout: 265 seconds)
02:09:47*saml_ joined #nim
02:19:23*bcinman joined #nim
02:21:09*dhasenan quit (Remote host closed the connection)
02:23:49*fizzbooze quit (Ping timeout: 264 seconds)
02:27:14*jholland quit (Quit: Connection closed for inactivity)
02:32:08*chemist69_ joined #nim
02:32:13*bcinman quit (Ping timeout: 264 seconds)
02:32:28*mwbrown quit (Ping timeout: 244 seconds)
02:34:39*bcinman joined #nim
02:35:15*chemist69 quit (Ping timeout: 250 seconds)
02:46:38*bcinman quit (Ping timeout: 252 seconds)
02:49:03*bcinman joined #nim
02:58:37*bcinman quit (Ping timeout: 264 seconds)
02:59:18*kjo1 quit (Quit: Leaving.)
03:00:30*bcinman joined #nim
03:03:14*elbow_jason joined #nim
03:04:26*elbow_jason quit (Client Quit)
03:06:38*brson joined #nim
03:14:09*bcinman quit (Read error: Connection reset by peer)
03:14:24*bcinman joined #nim
03:33:06*dtscode joined #nim
03:38:28*brson quit (Quit: leaving)
03:42:57*bcinman_ joined #nim
03:44:01*bcinman quit (Read error: Connection reset by peer)
04:09:24*reem quit (Remote host closed the connection)
04:10:54*elbow_jason joined #nim
04:13:45*reem joined #nim
04:16:13*saml_ quit (Quit: Leaving)
04:19:10*fizzbooze joined #nim
04:34:12cazovhi, while reading about the website on the forums I noticed that the link bar on the top right has different entries when in the forums versus when in other parts of the site. the entries while viewing the forums are: "home, docs, learn, download, forum, faq" and the logo is clickable and goes to forums.nim-lang.org. on all other sections the entries are "learn, docs, download, support, forum, faq" and the logo goes to nim-lang.org/index.html
04:35:17*fizzbooze quit (Quit: WeeChat 1.1.1)
04:35:30*fizzbooze joined #nim
04:56:55*elbow_json joined #nim
04:57:30*elbow_jason quit (Read error: Connection reset by peer)
04:59:02*a5i quit (Quit: Connection closed for inactivity)
04:59:13*elbow_json quit (Client Quit)
04:59:18*elbow_jason joined #nim
04:59:35reactormonkcazov, yeah, gotta bug dom96 about that
04:59:56cazovok, next time I am lurking and I see him talking I will ping him again :]
05:05:00*reem quit (Remote host closed the connection)
05:05:43*elbow_jason quit (Quit: Leaving)
05:07:40*reem joined #nim
05:15:18*gsingh93 quit (Ping timeout: 264 seconds)
05:18:20*CryptoToad joined #nim
05:18:41CryptoToadHey, anyone have experience setting callback methods for setWindowsHookEx?
05:19:14CryptoToadI've done it in C++ but I can't figure out how to do it in nim
05:20:35CryptoToadShould I just do them inline with embedded C?
05:28:54fowlCryptoToad, whats the problem
05:29:40CryptoToadI just can't figure out how to declare the callback functions, I see that setWindowHookEx takes a HOOKPROC as a parameter but no matter what I can't cast my proc or a pointer to it into that variable.
05:29:51*gsingh93 joined #nim
05:30:09CryptoToadready to do the whole thing with .emit lol
05:31:15fowldo you use windows or winlean
05:31:33CryptoToadwindows
05:32:16fowlHOOKPROC* = proc (para1: int32; para2: WPARAM; para3: LPARAM): LRESULT {.stdcall.}
05:32:26fowlyou need stdcall pragma
05:33:41VarriountCryptoToad: Using Windows API's?
05:34:32VarriountCryptoToad: Just an FYI, the windows module isn't entirely tested, so the wrappings should be double-checked before use.
05:34:50VarriountIt was translated from a Pascal module originally.
05:34:59CryptoToadAhh, so here be dragons?
05:35:19CryptoToadI'm going to try just adding the pragma
05:35:48VarriountCryptoToad: Usually things work fine (for 32 bit programs)
05:36:14VarriountOccasionally there is a mistake in the size of a type, or the number of parameters, etc.
05:36:28CryptoToadahh gotcha
05:43:23CryptoToadGot that fixed, or at least it compiles
05:43:24CryptoToadthanks guys
05:59:25*phira quit (Quit: ZNC - http://znc.sourceforge.net)
06:03:09*fizzbooze quit (Ping timeout: 245 seconds)
06:25:19CryptoToadI don't think the types on the message loop function arguments are right
06:30:00CryptoToadnvm
06:46:30*xificurC joined #nim
06:53:42*ehaliewicz quit (Ping timeout: 264 seconds)
07:01:50*CryptoToad quit (Quit: Leaving)
07:04:49*gsingh93 quit (Ping timeout: 245 seconds)
07:09:21*Demon_Fox quit (Quit: Leaving)
07:18:53*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:27:25*shodan45 quit (Ping timeout: 255 seconds)
07:31:24*shodan45 joined #nim
07:43:32*BlaXpirit joined #nim
07:55:15*banister joined #nim
08:39:30*irrequietus joined #nim
08:44:54ekarlsoshalabh: nah, nvm would be too similar to the Node JS thing
08:45:53*irrequietus quit ()
08:49:26*Trustable joined #nim
08:50:26*irrequietus joined #nim
08:52:58*epichero quit (Remote host closed the connection)
08:55:48*Trustable quit (Remote host closed the connection)
08:56:33*Trustable joined #nim
09:03:03*zahary quit (Read error: Connection reset by peer)
09:03:15*zahary joined #nim
09:08:57*tumult joined #nim
09:09:07*bcinman_ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
09:18:43*reem quit (Remote host closed the connection)
09:31:12*BlaXpirit quit (Read error: Connection reset by peer)
09:32:08*BlaXpirit joined #nim
09:53:46*epichero joined #nim
09:58:37*epichero quit (Ping timeout: 255 seconds)
10:37:17*TEttinger quit (Ping timeout: 252 seconds)
10:39:11*a5i joined #nim
10:53:34*girvo quit (Ping timeout: 245 seconds)
11:09:31*epichero joined #nim
11:14:13*epichero quit (Ping timeout: 255 seconds)
11:30:49*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:34:22*banister joined #nim
11:44:39*sepisoad joined #nim
11:50:06*girvo joined #nim
11:54:41*girvo quit (Ping timeout: 250 seconds)
12:19:20*reem joined #nim
12:20:17*girvo joined #nim
12:23:51*reem quit (Ping timeout: 256 seconds)
12:25:01*girvo quit (Ping timeout: 264 seconds)
12:44:31*chemist69_ quit (Quit: WeeChat 1.1.1)
13:00:05*mwbrown joined #nim
13:00:19*nimnoob123 joined #nim
13:00:36nimnoob123Can anyone help me w/ this aporia issue? https://github.com/nim-lang/Aporia/issues/77
13:07:33*jfchevrette joined #nim
13:09:49*jfchevrette quit (Client Quit)
13:09:51*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:12:49*kjo1 joined #nim
13:25:00*mpthrapp_ joined #nim
13:25:16*epichero joined #nim
13:26:34*Ven joined #nim
13:29:44*epichero quit (Ping timeout: 246 seconds)
13:30:14*clone1018_ quit (Read error: Connection reset by peer)
13:32:30Araqnimnoob123: you need to compile aporia with nim devel
13:32:40nimnoob123I did
13:33:27nimnoob123Nim Compiler Version 0.10.3 (2015-03-19) [Windows: i386]
13:34:03nimnoob123unless nim devel means something totally different
13:34:20*mwbrown quit (Ping timeout: 272 seconds)
13:34:25EXetoCno, it hasn't been released
13:36:05EXetoCso it's definitely the devel version that you have
13:36:33nimnoob123i did a git pull from the repo about an hour ago
13:39:43nimnoob123EXetoC: http://i.imgur.com/sR81V4v.png 110% sure
13:40:14*clone1018_ joined #nim
13:40:15*clone1018_ quit (Remote host closed the connection)
13:40:34Araqnimnoob123: you also need @head from the gtk2 nimble package
13:41:01nimnoob123that i might not have, sec
13:41:18EXetoCthat's what I'm saying, and the date is right there :-)
13:42:14nimnoob123EXetoC: ?
13:42:38EXetoChow about defaulting to HEAD at this point?
13:43:00nimnoob123the only thing i didn't have was the gtk2 nimble package
13:43:45nimnoob123which actually isn't listed anywhere here https://github.com/nim-lang/Aporia on the readme, going to recompile now
13:44:08nimnoob123i didn't install aporia through nimble btw
13:44:11EXetoCbut, "Requires: "nimrod >= 0.9.2, gtk2#head""
13:44:58EXetoCthat syntax is not used anymore though, I think, and a .nimble file hasn't even been added yet
13:45:21nimnoob123again nothing on that aporia readme says anything regarding gtk2 nimble package
13:45:24EXetoCperhaps it works because it is a .babel. things are changing quickly
13:45:49EXetoCnimnoob123: no, but it is a dependency as you can see, and so it should be installed automatically if things work correctly
13:45:51nimnoob123works now Araq, thanks
13:47:05EXetoCdid aporia@#head alone not work?
13:47:17nimnoob123EXetoC: that's not really my point, point is it's 8am, barely had a sip of coffee and the Readme.md doesn't mention it and it should. Sure when I'm fully awake maybe my brain would go "hey how about checking that nimble/babel file to see if im missing a package
13:47:34nimnoob123simple solution would just to add that little detail to the read me file lol
13:48:45nimnoob123and like I said before I didn't install aporia through nimble
13:50:14*clone1018_ joined #nim
13:50:15*clone1018_ quit (Remote host closed the connection)
13:51:59*gokr quit (Quit: Leaving.)
13:54:29*pregressive joined #nim
13:54:59nimnoob123so now I'm going to do a PR to include that small detail in the readme if you're installing by cloning the repo instead of installing through nimble :D
13:55:41*BlaXpirit quit (Quit: Quit Konversation)
13:57:41EXetoCyou want it to be mentioned in every package? it just seems a little redundant
13:58:17*BlaXpirit joined #nim
13:59:07EXetoCor just for "core" packages?
14:00:13*clone1018_ joined #nim
14:00:14*clone1018_ quit (Remote host closed the connection)
14:04:32EXetoCredundant as in it's not a package-specific piece of information
14:05:12nimnoob123it's aporia specific
14:05:43*pregressive quit ()
14:05:53EXetoCI was referring to this "hey how about checking that nimble/babel file to see if im missing a package"
14:06:49nimnoob123that's not even what I was talking about PRing
14:07:22nimnoob123All I did was add gtk2 to the aporia dependencies readme file, that's it. leaving it there
14:08:44nimnoob123Going to go work now and it's cool that I've finally got aporia working and will play with that later.
14:08:54*nimnoob123 quit (Quit: Page closed)
14:09:03*girvo joined #nim
14:10:13*clone1018_ joined #nim
14:10:14*clone1018_ quit (Remote host closed the connection)
14:13:37*girvo quit (Ping timeout: 264 seconds)
14:20:13*clone1018_ joined #nim
14:20:14*clone1018_ quit (Remote host closed the connection)
14:21:23*banister joined #nim
14:21:28*banister quit (Max SendQ exceeded)
14:26:06*epichero joined #nim
14:27:06*banister joined #nim
14:29:54*zahary quit (Ping timeout: 252 seconds)
14:30:14*clone1018_ joined #nim
14:30:14*clone1018_ quit (Remote host closed the connection)
14:30:39*epichero quit (Ping timeout: 245 seconds)
14:39:04*sepisoad quit (Quit: Leaving)
14:40:13*clone1018_ joined #nim
14:40:14*clone1018_ quit (Remote host closed the connection)
14:48:32*jholland joined #nim
14:50:14*clone1018_ joined #nim
14:50:14*clone1018_ quit (Read error: Connection reset by peer)
14:50:45*zahary joined #nim
14:53:34*darkf quit (Quit: Leaving)
14:55:24kjo1Any one have any experience manipulating Image's using the Javascript DOM? I'm having trouble going from a TNode to a TImage (let imageObj:TImage = document.getElementById("source"))
15:06:13Araqkjo1: 'cast' it?
15:06:53*reem joined #nim
15:09:50*girvo joined #nim
15:10:08*ehaliewicz joined #nim
15:10:10kjo1Araq, that's not a bad idea …
15:10:14*clone1018_ joined #nim
15:10:14*clone1018_ quit (Read error: Connection reset by peer)
15:10:27kjo1just wondering if they should be related in the object hierarchy
15:14:16*girvo quit (Ping timeout: 256 seconds)
15:18:25kjo1I was able to successfully add an image to the DOM using: let imageObj = cast[ref TImage](document.createElement("IMG"))
15:19:06*brson joined #nim
15:20:26kjo1creating an imageObj like this: let imageObj = new TImage gives me an error in the javascript though
15:22:40*tumult quit (Ping timeout: 246 seconds)
15:23:41kjo1maybe creating Image elements with TImage is not correct
15:24:56*sepisoad joined #nim
15:25:35*epichero joined #nim
15:29:02sepisoadi'm tryin to port fltk to nim using c2nim, unfortunately c2nim fails at converting most header files
15:29:10sepisoadfor example this one: https://github.com/rageworx/fltk-1.3.3-ts/blob/master/FL/Fl.H
15:29:59sepisoadi have trouble using c2nim, maybe you can help me
15:30:14*clone1018_ joined #nim
15:30:14*clone1018_ quit (Remote host closed the connection)
15:32:02def-sepisoad: you will have to change the parts that fail
15:32:35sepisoadI ended up commenting most of the failed parts :(
15:32:49sepisoadant that's not going to work for me
15:33:20sepisoadfor example Fl.H(50, 0) Error: ';' expected
15:33:30sepisoadI don't get it
15:35:07def-Maybe a #def instead of #define: http://nim-lang.org/c2nim.html#def-directive
15:36:10tstmdef-: For fun, I tried out something else on the nbody thing. It's not faster, in fact it seems to be a touch slower, but less repetition. http://tstm.info/files/nbody_5.nim
15:37:50*arnetheduck quit (Ping timeout: 272 seconds)
15:37:53def-tstm: cool
15:38:28EXetoCsepisoad: it usually requires some manual work
15:39:01EXetoCbut less than if you had done everything manually
15:39:03*Stefan_S joined #nim
15:39:07*gokr joined #nim
15:39:09reactormonkAraq, what's the official way to map javascript functions that are defined on an object, but only used in direct reference e.g. window.foobar()? I've assume it's proc foobar() {.importc: "window.foobar".}
15:40:08Stefan_Ssepisoad, are you using Nim comment markers # for C code? Will not work!
15:40:13*clone1018_ joined #nim
15:40:14*clone1018_ quit (Remote host closed the connection)
15:40:54sepisoadStefan_S, you mean I use nim comment in c Code???
15:41:22Araqreactormonk: yes
15:41:38Stefan_SYes, a very short look at you given file link give me that impression.
15:42:15sepisoadno, no, I'm not that dump ;)
15:42:19reactormonkAraq, hm. it's different in dom.nim where they are attached to an object an then exposed via var window: ref TWindow
15:43:00reactormonkon another note, what is {.nimcall.} in JS?
15:43:29sepisoadStefan_S, for example a line like this would fail:
15:43:30sepisoad#define FL_SOCKET unsigned __int64
15:43:33Araqreactormonk: .nimcall means it's not .closure
15:43:59tstmWhat's the recommended way for debugging nim?
15:44:02Araqsepisoad: for example use #def FL_SOCKET unsigned __int64
15:44:09reactormonkAraq, can I ask what's .closure or should I RTFM?
15:44:18sepisoadand if i remove __int64, c2nim would proceed without error, but i'm wondering what is wrong with that
15:44:25Stefan_Ssepisoad: Sorry, seems I am wrong. It is just C define.
15:45:21sepisoadid #def specific to c2nim or is it a part of C standard?
15:45:26Araqreactormonk: .closure means it's a tuple[procPtr, environment] or the js equivalent
15:45:50Araqsepisoad: last time I checked c2nim's manual was 5 pages.
15:46:16Araq5 pages that happen to explain the difference between #def and #define ;-)
15:46:23Araqand why it's necessary
15:47:25sepisoadAraq, oop, sorry ;)
15:49:37Stefan_Ssepisoad, you should try to use latest c2nim called 0.97, it has many advantages over the last stable one.
15:51:02Stefan_SAnd, __int64 will not be a valid Nim symbol either, so you have to rename it later. Currently I am not sure why c2nim does not like it.
15:53:08Araqcause I got tired of C's never ending clusterfuck of a type zoo
15:53:25Araqthere is only so much you can support in a lifetime
15:53:49reactormonkAraq, should I go rewrite dom.nim?
15:54:00Araqmaybe I missed __int64 :P
15:54:17reactormonkor go with https://github.com/Araq/Nim/issues/2371
15:54:38Araqreactormonk: rewrite dom.nim? and break the code that uses it?
15:54:47reactormonkAraq, exactly. >:)
15:55:18Araqjust create dom2 and tell everybody dom1 is deprecated
15:55:30Araqthat worked for parseopt ...
15:57:42kjo1I'm currently messing around with HTML5 & canvas with nim
15:57:47kjo1kind of fun
15:58:45tstmkjo1: Interesting. Do you feel it's easier or faster to do than with just, you know, javascript?-)
15:59:02kjo1:)
15:59:27sepisoadWOW, my system goes out of memory while parsing Fl.H file and c2nim crashes
15:59:28kjo1it's a fun way to learn nim
15:59:39kjo1and relearn javascript/html5
16:00:32Araqsepisoad: well maybe you shouldn't make it expand an infinitely recursive #def macro
16:00:37tstmWhat I would like to toy around is something like an ORM + lightning fast nim json server + html5
16:01:05tstmTo get something that serves static pages and data in json and scales well
16:02:20Stefan_SOh, my c2nim devel installed yesterday is strange, line int i; gives Error: unhandled exception: invalid format string [ValueError] while old c2nim096 works still.
16:02:40Stefan_SSorry, can not help, have to investgate that first.
16:03:23AraqStefan_S: use latest Nim devel and c2nim master
16:04:40Stefan_SThanks Araq, will do that.
16:05:00*Stefan_S quit ()
16:09:05EXetoCnow I just need to put the nimcache dirs elsewhere when building the compiler, so as to avoid having to do "rm -r" in the package script
16:09:58EXetoC /tmp probably
16:11:11*filwit joined #nim
16:17:34*sepisoad quit (Quit: Leaving)
16:17:59*CryptoToad joined #nim
16:18:35EXetoCcan it not be omitted? it might not be possible to use gcc in such a way
16:19:29AraqEXetoC: cannot follow. --nimcache exists fwiw
16:21:24CryptoToadAraq i figured out my app:gui error from yesterday, I was using the mingw that's bundled with the windows version and it was the wrong mingw version. I installed 4.9.2 and i've been smooth sailing ever since.
16:21:26EXetoCyeah I had no reason to announce it really. I'll use that and mktemp
16:21:34*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:24:49*ehaliewicz quit (Ping timeout: 244 seconds)
16:26:13CryptoToadcan anyone take a look at my keyboard hook code? it compiles and runs fine but it's just not hitting the callback.
16:26:23CryptoToadIt may be a 64 bit issue.
16:26:40CryptoToados: windbloat
16:27:06*gokr quit (Quit: Leaving.)
16:27:37*bcinman joined #nim
16:28:46CryptoToadhttp://hastebin.com/mekeponapi.coffee
16:34:39*Ven joined #nim
16:38:59*Jesin quit (Quit: Leaving)
16:40:29CryptoToadnevermind, it just doesn't work in the IDE
16:40:32CryptoToadworks fine standalone
16:45:37*Jesin joined #nim
16:46:32*gsingh93 joined #nim
16:48:06*kjo1 quit (Quit: Leaving.)
16:50:44*davidhq joined #nim
16:53:26*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:54:42*adn_ joined #nim
16:54:44*adn_ quit (Client Quit)
16:58:37*girvo joined #nim
17:00:19*pregressive joined #nim
17:03:04*girvo quit (Ping timeout: 256 seconds)
17:18:00*shodan45 quit (Quit: Konversation terminated!)
17:22:00*reem quit (Remote host closed the connection)
17:22:38*reem joined #nim
17:24:01*pregressive quit (Remote host closed the connection)
17:24:34*kjo1 joined #nim
17:25:30*fizzbooze joined #nim
17:27:02*reem quit (Ping timeout: 246 seconds)
17:31:43*smodo joined #nim
17:33:03*S_Salewski joined #nim
17:35:24S_Salewskisepisoad: My c2nim097 works again after reinstall. For your __int64 -- seems to be not a gnu, but a windows extension as google told me.
17:37:20S_SalewskiFor similar gnu gcc extensions I used something like "#def --int64" to let c2nim ignore it. But for your case maybe replace "unsigned __int64" by Nim's uint64?
17:38:44*zipR4ND joined #nim
17:38:55*ehaliewicz joined #nim
17:40:03*pregressive joined #nim
17:40:56EXetoCignoring it seems like a bad idea, so the latter might be a better approach
17:42:20S_SalewskiSure -- I have checked all my gnu extensions of GTK carefully if it could be ignored.
17:46:47*UberLambda joined #nim
17:46:56EXetoCthe GTK 3 lib?
17:49:06S_SalewskiYes, sure GTK3.
17:56:03EXetoCare you going to add a high-level interface?
17:57:07S_SalewskiWhat is high level for you? Full Garbage collector support?
17:57:08*kjo1 quit (Quit: Leaving.)
17:59:02S_SalewskiI think I will not try to make full GC support for GTK3, it would be very much work and overhead and we do not need it really.
17:59:58S_SalewskiWhat is not high level for GTK3 is, that we can not extend GTK types.
18:00:51S_SalewskiBut that is not a big problem, composition instead of inheritance. As someone in the forim wrote.
18:03:39EXetoCif only the allocation could be delegated to the user, but I suspect that it isn't possible. there are many other things that can be made more high level though, as is the case for most bindings
18:05:57*reem joined #nim
18:05:58S_SalewskiGC support is really difficult Golang recently did it, and a few other bindings too. But all these bindings becomme very large 100k lines of code!
18:07:03EXetoCit already allocates memory for you, so reference counting should be more appropriate, but destructors might still be limited
18:07:05S_SalewskiMy GTK3 is already high level, most usage is very similar as used from Python or Ruby.
18:08:22EXetoCI'll go look at some GTK 3 tutorials and see if I can think of anything. I've only used the GTK 2 bindings and that was some time ago so I can't remember any specifics
18:08:29S_SalewskiRef counting really works not bad for GTK. Most C code hash not to really struggle with allocating and deallocating memory.
18:09:25S_SalewskiI like the Ruby GTK tutorial, but it is partly GTK2 still.
18:09:31EXetoCok. it'll have to wait though
18:09:40EXetoCI think lack of documentation was the biggest issue I had
18:10:28S_SalewskiPython has a GTK3 tutorial, but is uses classes for each example.
18:10:53EXetoCwhat about signals? is the C interface good enough?
18:12:02S_SalewskiTutorials are generally a weak point for GTK3: No users, so no one enjoys writing tutorials, which means even fever users.
18:12:13EXetoCanyway, great work. some things are more convenient in GTK3 IIRC
18:13:49S_SalewskiYes, signals and callbacks need some work. Aporia, which I used for testing GTK3, uses some low level dirty code.
18:14:32S_SalewskiMuch is already improved, addr statement is mostly not necessary for my bindings.
18:15:56S_SalewskiCallbacks is one point I can improve, maybe a special signal-connect function for each important type and signal.
18:16:16EXetoCok
18:17:14S_SalewskiAnd I have to rework some flags: Currently all are enums as generated by c2nim, but some should be sets, so or operation is easily possible.
18:18:04S_SalewskiBut all that depends on interest, I will not spent muchmore time on it when really no one will ever use it.
18:19:09S_SalewskiI do understand well that some people prefer Qt and wxWidgets with more native look on windows and mac.
18:19:48*fizzbooze quit (Ping timeout: 252 seconds)
18:19:52S_SalewskiBye, have to do some work...
18:19:56EXetoCAutomatic generation of sets is something I've considered. I might look into it
18:19:56*S_Salewski quit ()
18:20:02EXetoC.. bye
18:21:11EXetoCquitting when there's work to do - very wise
18:31:04*zipR4ND quit (Ping timeout: 245 seconds)
18:43:18*dewdrop quit (Read error: Connection reset by peer)
18:47:25*girvo joined #nim
18:47:29*fizzbooze joined #nim
18:52:05*girvo quit (Ping timeout: 265 seconds)
19:00:49*zipR4ND joined #nim
19:05:50*pipeep quit (Quit: Bye!)
19:06:45*pipeep joined #nim
19:09:01*a5i quit (Quit: Connection closed for inactivity)
19:09:51*reem quit (Remote host closed the connection)
19:15:40*dtscode quit (Ping timeout: 256 seconds)
19:16:03*epichero quit ()
19:16:21*reem joined #nim
19:16:53*smodo quit (Quit: Leaving)
19:17:01*OderWat joined #nim
19:17:05*pregressive quit (Remote host closed the connection)
19:17:27Araqhi OderWat
19:17:50OderWatHi there..
19:17:51EXetoCshould I omit the compiler source from the package since it's a package now?
19:17:54AraqI was wondering: did you consider Lazarus for the UI stuff?
19:18:03*pregressive joined #nim
19:18:16AraqEXetoC: what's the context of that question?
19:18:44OderWatwow never heared of it araq
19:18:52EXetoCAraq: generation of linux package
19:19:14EXetoCI noticed how confusing that sentence was
19:19:54AraqOderWat: sarcasm is hard to detect
19:20:07EXetoCperhaps I should keep it anyway, at least for a little while. until 1.0 perhaps, at which point all this should be stable I assume
19:20:22OderWatSorry no sarcasm I would have marked that with ;-)
19:20:34Araqok
19:20:35OderWatI really never heard of it ... afair
19:21:12Araqwell now that they managed to release version 1.0 after one or two decades of work put into it
19:21:18Araqit works rather nicely
19:21:36Araqbut I haven't done much with it, since I don't do native UIs
19:22:46OderWatI guess I always ignored that quickly because there is pascal and delphi all around. Which I always avoided :)
19:22:59Araqpfff :P
19:23:55OderWatHehe.. Last Turbo Pascal I wrote was "guess the animal" in "informatik" showing the teacher how cool that is :)
19:24:16AraqEXetoC: the linux package should include the compiler's sources
19:24:34Araqthe compiler's sources should become part of the stdlib anyway
19:24:56Araqso that this "I cannot install c2nim" dance goes away
19:25:20EXetoC /compiler -> package -> /lib/compiler? got it :p
19:27:16*brson quit (Quit: leaving)
19:28:50*epichero joined #nim
19:31:36AraqEXetoC: btw when you don't report your 'find works, toSeq(find)' bug properly, we cannot fix it.
19:36:57EXetoCI will
19:54:55*fizzbooze quit (Ping timeout: 265 seconds)
20:13:20*zipR4ND quit (Ping timeout: 272 seconds)
20:13:35k1iAraq: really liking nim thus far
20:13:43k1iawesome job, you and team
20:14:27CryptoToad^ nim is a really great language
20:14:48Araqwow thanks. Always nice to hear. :-)
20:15:11EXetoCI like nim too btw
20:15:20k1ithe C interop is beautifully seamless
20:15:31k1ire: type conversion, references, etc.
20:15:57k1iis there a way to go from seq[T] -> array[T]?
20:16:48k1i(no idea what the in-memory representation of seq is)
20:17:12Araqno, array's size has to be known at compile-time
20:17:31k1ii need to alloc a null-terminated c-style array from a seq
20:17:46Araqthat said, for C interop you can simply do addr(s[0])
20:17:53Araqto get a C compatible pointer
20:17:54k1iis it null terminated?
20:17:55k1iok
20:18:06def-k1i: only if your actual seq is null terminated as well
20:18:09CryptoToadhttp://hastebin.com/apomahexur.coffee can anyone tell me just by looking at this why this throws an illegal storeage access error?
20:18:19*fizzbooze joined #nim
20:18:24*UberLambda quit (Quit: Leaving the Matrix)
20:19:09CryptoToadsorry for all of my fail guys, docs are a bit sparse in this area and googling symbols is a good way to get nowhere fast
20:19:29k1ione thing i'd be happy to help with when i get some free time, would be the "piecing together of the docs"
20:19:51k1ii think that's the only thing that's missing - a unified, general way to get from doc-to-doc, look up various builtins, etc
20:19:55CryptoToadyeah, while nim is great to code in i do find myself reading lots of compiler source xD
20:20:40k1ithe fact that the compiler source is approachable at all is great
20:20:47CryptoToadyeah absolutely
20:20:52CryptoToadi love that it's an option
20:21:20def-CryptoToad: maybe because of the dereferncing of the casted int pointer?
20:21:49k1ithe friendliness of real, low-level interop is a killer feature for me
20:22:16k1ionly thing I am really missing is the ability to do FFI w/o a wrapper (e.g. just including headers) , but it's understandable that it's necessary
20:22:49def-k1i: i guess the way to go would be to improve c2nim so it can handle more automatically
20:22:52EXetoCthere's a header pragma
20:23:05EXetoCand C code can be emitted
20:23:05k1iyeah, def- that's probably the right pathway
20:23:29CryptoToadoh i see what i'm doing
20:23:30CryptoToadderp
20:23:31CryptoToadwow
20:23:36k1ii just wrote the wrappers around CoreFoundation I needed
20:23:38k1iby hand
20:24:13CryptoToadso now that i know what the wrong way is, what's the right way to obtain a value from a pointer in nim?
20:25:26EXetoCfoo[]
20:25:46*nande joined #nim
20:26:03EXetoCor do you mean the pointer type?
20:26:18CryptoToadbasically
20:26:28CryptoToadi recieve an LPARAM as an arg from a callback
20:26:36CryptoToadand i cast that to an int pointer
20:26:43CryptoToadbut i can't grab the int value it points to
20:27:04CryptoToadusing foo[] throws illegal storage access
20:29:57EXetoCis it nil? is stdcall correct?
20:30:30EXetoCyeah seems correct
20:31:36CryptoToadit's probably something to do with the cast
20:31:46CryptoToadbut i can't seem to get it to work how it should
20:34:47EXetoCdoes -d:useSysAssert add anything?
20:35:00k1ilen(seq[T]): int vs. a uint
20:35:20EXetoCuint is very rarely needed
20:36:12*girvo joined #nim
20:36:23k1iC interop :shrug:
20:36:34k1iis there any way to import C constants?
20:37:04fowlCryptoToad, gist it ill look at it
20:37:05EXetoCbut you already have a seq so where does the C interop come in?
20:37:28EXetoCconvert to uint if necessary
20:37:35k1iEXetoC: the C function requires a uint length of the array you are passing
20:37:47k1iyea
20:37:47k1ii did
20:38:38EXetoCand then seq[0].addr I assume
20:38:45EXetoCwhy is null termination necessary though?
20:39:08EXetoCis that a difference issue?
20:39:12*dtscode joined #nim
20:39:22k1idifferent issue and the docs were unclear
20:39:32k1ii guess CF is open-source ,i probably should have looked at the actual C impl vs. just the headers
20:39:40k1ibut everything is nicely wrapped/abstracted now :)
20:40:16def-k1i: try importcing them as a var
20:40:41EXetoCit's not specifically a null terminated string that's needed then? that's more common, and consider using a string instead then
20:40:50*girvo quit (Ping timeout: 265 seconds)
20:41:00def-hm, no. c2nim converts them into a regular nim constant without an importc
20:41:14k1idef-: that's what i was seeing
20:41:25k1iso i wasnt sure
20:41:39EXetoCif c2nim wasn't used then maybe you don't have any cstring parameters, but char* can be substituted with cstring, and then you get implicit conversion from string to cstring
20:42:04EXetoCor was it the other way around? but str.cstring can also be used
20:42:27fowlCryptoToad, this says the keycode is passed in wParam not lParam (and lParam is int not a pointer) https://msdn.microsoft.com/en-us/library/windows/desktop/ms646281%28v=vs.85%29.aspx
20:42:41EXetoCuh oh
20:42:46*kjo joined #nim
20:49:26*dewdrop joined #nim
20:54:06k1iTIL: cstringarray is a thing
20:54:51*fizzbooze quit (Ping timeout: 265 seconds)
20:56:08k1idoesn't look like there are any built-in functions to convert that to a safe nim array type though?
20:56:25k1ii am blind - cstringArrayToSeq :D
20:57:12fowli didnt know that existed
20:58:35*Woflox joined #nim
20:59:22*filwit quit (Quit: Leaving)
20:59:29k1ihttps://github.com/Araq/Nim/blob/master/lib/system.nim#L2447 - fowl
21:02:02*brson joined #nim
21:11:22*epichero quit (Remote host closed the connection)
21:14:45*epichero joined #nim
21:15:23*mpthrapp_ quit (Remote host closed the connection)
21:16:52k1ihow do I cast a pointer to a proc back to an executable proc?
21:16:57k1i(i have the proc type defined)
21:18:49EXetoCcast[proc(x: Foo, ...): Bar] ...?
21:19:05EXetoCinclude a calling convention if necessary
21:20:17*chewbranca quit (Quit: Adios)
21:20:42k1iand to go from proc -> pointer? addr(theProc) yields "Error: expression has no address"
21:21:36EXetoCis it a var?
21:21:38Araqk1i: theProc is already the address
21:21:50EXetoCok
21:22:25k1ii am trying to pass said proc to a function accepting type 'pointer'
21:23:02Araqk1i: cast[pointer](theProc)
21:23:19k1iproc foo(cb: proc) = bar(cb) - using cb as a pointer works fine
21:23:33k1iusing a proc type though, foo(cb: myProcType) = bar(cb) fails
21:23:34*ChrisMAN quit (Read error: Connection reset by peer)
21:23:59Araqdon't use 'cb: proc'
21:24:24k1i(i'm not, that was just what was working)
21:24:30Araquse 'cb: proc(){.stdcall.}' instead
21:24:53k1iis this just a lack of specified calling convention?
21:24:54EXetoCon mac?
21:25:23k1ii really like the pragma system
21:26:14Araqand yeah, you better get the calling convention right
21:27:42EXetoCAraq: stdcall is used in mac?
21:28:07AraqEXetoC: no.
21:28:19AraqI thought he's using the winapi
21:28:32Araqbut anyway, he has to ensure it doesn't end up as .closure
21:28:47k1iCoreFoundation- osx
21:29:06EXetoCcdecl then?
21:32:48Araqbest idea is nimcall then
21:32:51k1i^
21:33:01Araqas it's compatible and most nim procs use it
21:33:17k1iis there an easy way to re-use proc type definitions
21:33:30k1i(in definition, etc.)
21:35:00k1ibtw, thanks on the {.nimcall.} call- works perfectly
21:35:22def-k1i: type x = proc(a: foo): bar
21:35:35k1iand then to define a function of type x?
21:35:53k1ican I re-use said type in definition?
21:35:53EXetoCaren't you interfacing with C? if so then I don't get how it's compatible, and cdecl seems to be used in other cases
21:36:40k1iEXetoC: this API is a kqueue/epoll-like context object - arbitrary data structure - i need to pass a proc pointer -> the ctx object for it to be used later in the fired events
21:36:47k1iC doesn't execute this
21:37:49k1irather, the system C I am wrapping doesn't actually call this particular proc
21:38:05EXetoCit's "user data"?
21:38:27k1iyeah
21:38:39EXetoCmakes sense then
21:40:03EXetoCwhat was the motivation for requiring procvar in some cases?
21:40:16k1ihttps://developer.apple.com/library/mac/documentation/Darwin/Reference/FSEvents_Ref/index.html#//apple_ref/c/tag/FSEventStreamContext - is the userdata object
21:40:24k1iit's mostly userdata, they intrude a bit on the struct w/ "version"
21:41:09*Mat4 joined #nim
21:41:12Mat4hello
21:41:17k1ii'd like to put my work into the builtin fsmonitor package for OSX
21:41:21EXetoCnice enum names
21:41:23EXetoCMat4: wb
21:41:31k1iEXetoC: wrapping this has not been fun
21:41:41Mat4hi EXetoC
21:42:30EXetoCkFSEventStreamEventFlagItemFinderInfoMod
21:43:33k1ii am really liking how easy C integration is for the most part, how seamless it is
21:43:35k1iEXetoC: they're all like that
21:43:43k1iEXetoC: the objective C ecosystem is 100% like that
21:43:47k1ieverything has absurd prefixing
21:44:11k1iwith references to the 90s (NS = nextstep)
21:44:34EXetoCC/Java
21:46:51CryptoToadfowl, WM_KEYUP is a different thing entirely and works as it should.
21:47:09CryptoToadif para2 == WM_KEYUP: detects if a key is up or down
21:47:22CryptoToadand that is passwd by the WPARAM
21:47:32CryptoToadthe LPARAM passes the keycode.
21:48:41Mat4k1i: Can I summarize your statement in the sense that you dislike notations which uses prefixes (like the Ungarian one) ?
21:48:55fowloh so i was looking at the wrong thing?
21:49:06CryptoToadyes. I did that earlier too though, so don't feel bad.
21:55:21CryptoToaddid some re organization, same error on var intPtr: string = cast[ptr string](para3)[]
21:56:03*epichero quit (Read error: Connection reset by peer)
21:56:16*epichero joined #nim
21:58:07AraqCryptoToad: passing string around to some callback looks dangerous
21:58:14Araqit that called from another thread?
21:58:15CryptoToadyes it is
21:58:27CryptoToadno it's from within the same thread
21:58:42CryptoToadand Araq
21:58:45CryptoToadwhat i'm after is an int
21:58:45Araqhrm but still
21:58:50CryptoToadbut i can't get it
21:59:02Araqcast[int](myptr) works
21:59:10Araqcast[pointer](someint) works
21:59:53*ChrisMAN joined #nim
22:02:52CryptoToadokay
22:03:54CryptoToadgot it working, thanks a bunch
22:03:59CryptoToadcan't believe it was that easyt
22:04:41*fizzbooze joined #nim
22:06:58*girvo joined #nim
22:08:43*johnsoft quit (Ping timeout: 250 seconds)
22:09:47*johnsoft joined #nim
22:11:23*girvo quit (Ping timeout: 252 seconds)
22:12:21k1iis there a built-in os-aware path manipulation library in the stdlib?
22:12:28k1ictrl+f on the lib.html doc isn't turning anything up
22:16:11EXetoCk1i: http://nim-lang.org/lib.html look for "os"
22:16:17*epichero quit ()
22:17:04*shalabh quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
22:17:05EXetoChttp://nim-lang.org/theindex.html + ctrl-f
22:18:42CryptoToadone issue Araq
22:18:45CryptoToadvar intPtr: int = cast[int](para3) returns the address
22:18:47CryptoToadI need the value
22:20:07k1ithanks EXetoC
22:21:07AraqCryptoToad: it doesn't return the address
22:21:32Araqbut maybe you pass wrong stuff to it
22:21:36CryptoToadyeah maybe
22:21:43Araqtry to pass this: cast[pointer](33)
22:21:50Araqand see if the value is 33
22:22:24CryptoToadahh
22:22:27CryptoToadyeah i'm doing something wrong
22:22:27CryptoToadthanks
22:22:43CryptoToadit happened to output something that looked like an addr
22:24:01*phira joined #nim
22:25:35*bcinman quit (Ping timeout: 246 seconds)
22:27:52*bcinman joined #nim
22:28:21*BlaXpirit quit (Quit: Quit Konversation)
22:31:05tstmdef-: Still around?
22:31:37def-tstm: yes
22:32:02tstmdef-: I made the nbody even faster! Do you have something else than mac to test it on?
22:32:14def-I'm on Linux
22:32:20tstmI shaved almost 20% off using avx intrinsics
22:32:45Araqtstm: nice! :-)
22:32:51*girvo joined #nim
22:33:19def-Nice, but my CPU is too old for AVX anyway
22:33:26def-I'm interested in seeing the code still
22:33:31tstmOh. Then it won't work.
22:33:33tstmhttp://tstm.info/files/nbody_vec.nim
22:33:54tstmAnd it depends on these https://github.com/bsegovia/x86_simd.nim
22:34:31fowlk1i, path functions in os module
22:35:01tstmThe squaresum is still a bit odd, I was having some trouble in the m256d conversions
22:35:41tstmIf someone has linux with avx, could you test that one how it fares against the other versions?
22:35:50*brson quit (Ping timeout: 272 seconds)
22:35:54tstm(and against optimized c!)
22:36:22def-tstm: ah, let me test on another system
22:37:26tstmAt least on my mac it beats everything
22:37:49tstmThe non-avx version ran in about 5s and this one does it in 4.1s
22:39:54tstmAnd you guys are smarter with memory conversions than I am, how would I implement the squaresum properly, when the store_pd() just wants to write the stuff to an array starting from pointer.
22:40:39fowltstm, arr[0].addr
22:41:12*fluoride joined #nim
22:42:38*a5i joined #nim
22:44:52tstmfowl: Cool. =)
22:46:30*mwbrown joined #nim
22:46:59def-tstm: on a Xeon E5-2680: nbody_c: 5.17, nbody_nim: 7.95, nbody_nim_vec: 6.54
22:47:23tstmdef-: Well, getting closer in any case. :D
22:48:01*Mat4 left #nim (#nim)
22:48:57tstmI was kind of surprised how easy it was to get SIMD intrinsics going
22:49:37*BlaXpirit joined #nim
22:55:23*pregressive quit (Remote host closed the connection)
22:57:33*epichero joined #nim
22:57:42*TEttinger joined #nim
23:02:42flaviudef-: What compiler are you using?
23:07:10*fluoride quit (Quit: Leaving)
23:09:08*fluoride joined #nim
23:09:48def-flaviu: gcc
23:11:00flaviudef-: What happens with clang? Also try ICC if you have that.
23:12:03def-don't have clang on that machine
23:13:42tstmdef-: I installed nim on a decent Ubuntu server box as well, and even there it's faster (on regular gcc, not clang) than the C version. I thought that was only a mac compiler thing that enabled nim to be so fast.
23:14:19tstmOn a Xeon E5-1650 with gcc 4.8.2
23:16:34tstmOf course sse is bound to be somewhat slower than avx I guess. The optimized c version is not quite as good as the single vector operations you can do with avx I guess.
23:16:44def-with icc: C: 6.76, nim: 7.28, nim-vec: 6.63
23:30:10*irrequietus quit ()
23:33:16*xificurC quit (Ping timeout: 258 seconds)
23:38:48*bcinman quit (Ping timeout: 252 seconds)
23:46:02*ehaliewicz quit (Remote host closed the connection)
23:48:49*bcinman joined #nim
23:57:27*BlaXpirit quit (Quit: Quit Konversation)
23:58:45*Trustable quit (Remote host closed the connection)