<< 26-04-2015 >>

00:00:25SharchoI'm getting errors with 0.10.3 with strfmt. Is that a known issue?
00:00:49SharchoError: type mismatch: got (string, int, tuple[typ: FmtType, precision: int, width: int, fill: nil, align: FmtAlign, sign: FmtSign, baseprefix: bool, upcase: bool, comma: bool, arysep: nil])
00:01:48SharchoAlso, is strfmt the best library for sprintf-like functionality?
00:02:01AraqSharcho: nope, will look at it tomorrow
00:02:06Araqgood night
00:02:15SharchoAraq: good night
00:13:01*vendethiel quit (Ping timeout: 264 seconds)
00:19:31*brson joined #nim
00:20:02*vendethiel joined #nim
00:38:34*Demon_Fox quit (Ping timeout: 245 seconds)
00:40:01*Demon_Fox joined #nim
00:40:38*vendethiel quit (Ping timeout: 256 seconds)
00:47:37MagusOTBhow do I create a cstringArray from a string?
00:51:28*vendethiel joined #nim
01:04:33*brson quit (Quit: leaving)
01:10:45*JinShil joined #nim
01:17:55*vendethiel quit (Ping timeout: 264 seconds)
01:23:11*mrkishi quit ()
01:28:11*Sharcho quit (Ping timeout: 265 seconds)
01:31:10*vendethiel joined #nim
01:53:21*cmk_zzz_ joined #nim
01:53:21*cmk_zzz_ quit (Client Quit)
01:57:06*n_v joined #nim
01:57:20*mrkishi joined #nim
01:58:07*Amrykid joined #nim
01:58:26*mrkishi quit (Max SendQ exceeded)
01:58:39*dv-_ joined #nim
01:59:05*mrkishi joined #nim
01:59:21*wan_ joined #nim
01:59:23*renesac quit (Ping timeout: 264 seconds)
01:59:23*n0v quit (Ping timeout: 264 seconds)
01:59:23*wan quit (Ping timeout: 264 seconds)
01:59:23*dv- quit (Ping timeout: 264 seconds)
01:59:23*Amrykid2 quit (Ping timeout: 264 seconds)
01:59:23*egrep quit (Ping timeout: 264 seconds)
01:59:24*n_v is now known as n0v
01:59:30*zulmin_ joined #nim
01:59:55*Zulmin quit (Ping timeout: 264 seconds)
02:00:11*mrkishi quit (Max SendQ exceeded)
02:00:31*EXetoC quit (Ping timeout: 264 seconds)
02:00:48*mrkishi joined #nim
02:07:51*egrep joined #nim
02:25:49*egrep quit (Quit: Reboot, 3.18.11-r2 -> 3.18.12-r1)
02:26:36*vendethiel quit (Ping timeout: 240 seconds)
02:27:22*EXetoC joined #nim
02:29:10*egrep joined #nim
02:30:44*vendethiel joined #nim
02:34:43*EXetoC quit (Ping timeout: 264 seconds)
02:40:55*johnsoft quit (Ping timeout: 256 seconds)
02:41:46*johnsoft joined #nim
02:54:47*vendethiel quit (Ping timeout: 250 seconds)
02:56:31*darkf joined #nim
03:09:49*Demon_Fox quit (Ping timeout: 256 seconds)
03:10:18*Demon_Fox joined #nim
03:11:35*vendethiel joined #nim
03:36:27*vendethiel quit (Ping timeout: 256 seconds)
03:47:13*gsingh93 quit (Ping timeout: 264 seconds)
03:51:41*vendethiel joined #nim
03:54:28*xtagon joined #nim
03:54:49*bjz quit (Ping timeout: 245 seconds)
03:56:15*bjz joined #nim
04:13:09*vendethiel quit (Ping timeout: 248 seconds)
04:13:20*vikaton quit (Quit: Connection closed for inactivity)
04:27:39*pregressive joined #nim
04:33:14*johnsoft quit (Ping timeout: 276 seconds)
04:38:57*johnsoft joined #nim
04:50:01*yglukhov________ joined #nim
04:52:47*yglukhov________ quit (Read error: Connection reset by peer)
04:53:03*yglukhov________ joined #nim
04:57:57*yglukhov________ quit (Ping timeout: 265 seconds)
05:02:59*mrkishi quit ()
05:06:49*OnO joined #nim
05:06:58*mrkishi joined #nim
05:08:36*yglukhov________ joined #nim
05:12:44*yglukhov________ quit (Ping timeout: 245 seconds)
05:19:53*pregressive quit (Remote host closed the connection)
05:27:26*johnsoft quit (Ping timeout: 265 seconds)
05:27:36*johnsoft joined #nim
05:34:59*xtagon quit (Read error: Connection reset by peer)
05:38:48*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
06:01:13*yglukhov________ joined #nim
06:05:04*saml_ quit (Remote host closed the connection)
06:08:09*mrkishi quit ()
06:35:03*vendethiel joined #nim
06:48:03*bjz quit (Read error: Connection reset by peer)
06:48:11*bjz_ joined #nim
07:12:32*BlaXpirit joined #nim
07:26:06*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:41:49*vendethiel quit (Ping timeout: 255 seconds)
07:42:02*BlaXpirit quit (Quit: Quit Konversation)
07:43:44*smodo joined #nim
07:50:22*dv-_ is now known as dv-
07:50:39*dv- quit (Changing host)
07:50:39*dv- joined #nim
07:59:12*vendethiel joined #nim
08:01:15*Ven joined #nim
08:10:47*smodo quit (Ping timeout: 265 seconds)
08:16:30*TEttinger quit (Ping timeout: 252 seconds)
08:21:29*JinShil quit (Ping timeout: 245 seconds)
08:21:41*Pisuke joined #nim
08:21:50*pregress_ joined #nim
08:22:02*vendethiel quit (Ping timeout: 276 seconds)
08:22:53*pregres__ joined #nim
08:24:39*vendethiel joined #nim
08:26:35*pregress_ quit (Ping timeout: 256 seconds)
08:27:35*pregres__ quit (Ping timeout: 244 seconds)
08:28:40*JinShil joined #nim
08:36:38*Sharcho joined #nim
08:41:48Araqnimble install nimfmt
08:42:04Araqnimfmt not found in local packages.json, check internet for updated packages? [y/N]
08:42:05Araqy
08:42:14AraqError: unhandled exception: Package not found. [NimbleError]
08:42:22Araqnimble install strfmt
08:42:29AraqError: unhandled exception: 'hg' not in PATH. [NimbleError]
08:42:58AraqExceptions are not supposed to remove the need for any kind of error handling
08:43:10Araqbut I must admit the error messages are good
08:43:34Araqdom96: why not use single try statement around it though?
08:44:01Araqso ... to install strfmt I need to have 'hg'? yay
08:48:05*Demon_Fox quit (Quit: Leaving)
08:53:25*cmk_zzz quit (Ping timeout: 244 seconds)
08:53:36Araqdef-, reactormonk do you remember what's up with strfmt? the author agreed to put it into the stdlib, right?
08:55:03*cmk_zzz joined #nim
08:55:12AraqSharcho: strfmt works fine with devel after I adapted it to use the new 'concept'
09:02:47*BlaXpirit joined #nim
09:08:59*vendethiel quit (Ping timeout: 245 seconds)
09:18:34*milosn quit (Ping timeout: 256 seconds)
09:21:11*elbow_jason joined #nim
09:22:41*elbow__ quit (Ping timeout: 256 seconds)
09:23:16*Matthias247 joined #nim
09:38:13def-Araq: i also have a PR that didn't get pulled yet (I think he oversaw it)
09:38:43def-Araq: there was something about improving the compile time of strfmt before putting it into the stdlib
09:40:23*vendethiel joined #nim
09:41:04*cmk_zzz quit (Ping timeout: 250 seconds)
09:42:30*cmk_zzz joined #nim
09:52:28*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:00:34def-Araq: for simple programs just importing strfmt increases compile time from 0.2 to 0.6 seconds
10:01:19*clarior joined #nim
10:03:37*banister joined #nim
10:11:59*EXetoC joined #nim
10:21:24*milosn joined #nim
10:26:14*Kingsquee quit (Quit: Konversation terminated!)
10:29:53*Ven joined #nim
10:30:12*Ven quit (Max SendQ exceeded)
10:37:11*ingsoc joined #nim
10:43:42Araqso def- on linux 64 only the gctest.nimfails with M&S
10:43:48Araqon my machine
10:43:56Araqyou said for you more fail?
10:44:14def-Araq: no, that one and the new asynchttpserver
10:44:34*Ven joined #nim
10:44:38def-but gctest fails with -d:release and without now, it was only with -d:release before
10:44:38*clynamen quit (Ping timeout: 246 seconds)
10:45:03AraqGC_fullCollect()
10:45:04Araq# the M&S GC fails with this call and it's unclear why. Definitely something
10:45:06Araq# we need to fix!
10:45:07AraqGC_fullCollect()
10:45:10Araqthat's in the test btw
10:45:25Araqso ... it's well known :P
10:45:49Araqnevertheless forcing 2 full collections shouldn't crash anything
10:47:05Araqand now it always works for me *sigh*
10:49:58*clynamen joined #nim
10:57:23*Trustable joined #nim
11:09:03Araqdef-: doesn't fail for me with -d:gcUseBitvectors
11:09:12*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:09:47*Trustable quit (Remote host closed the connection)
11:10:44def-Araq: same here
11:12:45Araqwhat about asynchttpserver?
11:12:50Araqworks with -d:gcUseBitvectors
11:12:54Araq?
11:15:05def-no
11:20:04dom96Araq: did you compile Nimble in release mode?
11:20:24Araqdom96: no, why would I?
11:21:10dom96https://github.com/nim-lang/nimble/blob/master/src/nimble.nim#L912
11:23:18Araqer ... on failure you don't remove the nimble temp dir?
11:26:56Araqdom96: so what are the DLLs I need to ship with Nimble?
11:28:22dom96The temp dir is in /tmp so the OS will delete it anyway.
11:30:08dom96The ones that are in this archive: https://github.com/nim-lang/nimble/releases/download/v0.6/nimble-0.6_win32.zip
11:30:34Araqawesome
11:33:54*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:34:31SharchoAraq: when I do echo "{:d}".fmt(1), I'm still getting: Error: type mismatch: got (string, int, tuple[typ: FmtType, precision: int, width: int, fill: nil, align: FmtAlign, sign: FmtSign, baseprefix: bool, upcase: bool, comma: bool, arysep: nil])
11:34:59*milosn quit (Read error: Connection reset by peer)
11:35:44Araqwhat does {:d} do?
11:35:56Sharcho:d is an integer
11:36:01def-Sharcho: printlnfmt "{:d}", 1 may be a bit nicer, but both work for me
11:36:35def-with strfmt's devel branch (or my PR)
11:37:36SharchoI didn't use the devel branch for strfmt, let me try that
11:39:59SharchoUsing the devel branch of strfmt works
11:40:39Araqstrfmt has a devel branch?
11:41:23SharchoAraq: yep
11:41:27Araqcan we please make the async stuff a nimble package?
11:41:45Araqit's blocking the release of 0.10.4 now. yay.
11:42:10*banister joined #nim
11:43:04*zulmin_ is now known as zulmin
11:47:03*banister quit (Client Quit)
11:47:44dom96Araq: how would that help?
11:47:53dom96that would break everybody's stuff
11:50:49*Ven joined #nim
11:52:40*bjz joined #nim
11:52:48*bjz_ quit (Ping timeout: 250 seconds)
11:57:53*filcuc joined #nim
12:01:54Araqwe could release a faster and more stable 'net' package indepently of the compiler
12:08:30*OnO joined #nim
12:10:01SharchoWow, 0.10.3 is 50% faster for me.
12:11:44AraqSharcho: for what?
12:11:45*BlaXpirit_ joined #nim
12:12:20SharchoAraq: For my program that finds the top-n elements in a file
12:14:16*BlaXpirit quit (Ping timeout: 240 seconds)
12:14:40Araqbbl
12:15:31*filcuc quit (Ping timeout: 256 seconds)
12:26:08*clynamen quit (Ping timeout: 246 seconds)
12:31:05*clynamen joined #nim
12:34:43*banister joined #nim
12:50:27*Ven quit (Read error: No route to host)
13:10:54*filcuc joined #nim
13:16:33*matkuki joined #nim
13:20:41*wan_ quit (Ping timeout: 256 seconds)
13:26:38Araqdef-: can you revert dom96's stuff into something that works please
13:27:03*clynamen quit (Ping timeout: 246 seconds)
13:27:26matkukiIs there a way of cleanly splitting a property to getter/setter while keeping the abillity to use compound assignment operators on the property?
13:27:27matkukiThis works: https://bpaste.net/show/cf5bfbfc297b , but getter and compound assignment both use the 'proc visible_corner*(obj: BackObject): var int' proc.
13:28:27Araqmatkuki: works as expected then
13:28:51Araqwhy would it do 2 roundtrips when the getter returns a 'var' already?
13:29:20Araq+= simply doesn't work well with properties IMHO
13:30:21Araqand when you someOtherOp(backobj.corner) do you expect that it calls *2* times a 'corner' accessor?
13:30:43Araq+= is not any different than someOtherOp
13:32:11*clynamen joined #nim
13:32:12matkukiAraq: It does work as expected, yes.
13:32:13matkukiSo then the recommended way to use properties is to just use a 'proc visible_corner*(obj: BackObject): var int' as a getter and 'proc `visible_corner=`*(obj: BackObject): var int' as a setter, no other fancy stuff?
13:32:30matkukiI should forget about `+=`?
13:32:45Araqyup
13:32:56matkukiGot it.
13:33:01Araqalternatively you can forget about properties ;-)
13:33:11matkukiThanks :)
13:33:28Araqthe overhead vs bug prevention is really poor for these anyway
13:34:03Araqor you can use a template to get a zero-abstraction-penalty for the property
13:34:59*wan_ joined #nim
13:35:00matkukiAraq: Can you point me to a template example?
13:35:28Araqtemplate field(x: Foo): expr = x.field
13:35:47matkukiThanks
13:38:15*milosn joined #nim
13:44:50*Ven joined #nim
13:52:25*clarior quit (Ping timeout: 256 seconds)
13:54:11*clarior joined #nim
13:54:14*vikaton joined #nim
13:59:14*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
14:03:10*OnO joined #nim
14:07:20def-Araq: work around the markandsweep bug or what?
14:07:47def-Araq: my old code before dom96's changes is unsafe, so i don't think that should land in a release
14:12:50*Matthias247 quit (Read error: Connection reset by peer)
14:15:42*gokr joined #nim
14:18:01*HakanD joined #nim
14:23:19HakanDhey
14:26:16HakanDgood news! wikipedia article survived
14:40:24*Jesin quit (Ping timeout: 252 seconds)
14:42:53*miglo joined #nim
14:44:23*clynamen quit (Ping timeout: 246 seconds)
14:45:34migloHi! Is the wx library supported by nim or does a binding exist for building graphical user interfaces?
14:48:28HakanDmiglo: there is a gtk2 wrapper https://github.com/nim-lang/gtk2
14:49:19*clynamen joined #nim
14:49:48*Jesin joined #nim
14:52:21Araqdef-: just add to the docs that the interface is unstable and then it's ready for 0.10.4 imho
14:52:38Araqyour old code doesn't crash the GC
14:53:36Araqmiglo: wxWidgets wrapper is in the works but afaik it's part of a commercial product and so it might take quite some time before it's released as open source
14:53:56migloHm, let's say I want to write a cross-platform application that has an ui. In case of C++ I've used usually wxGtk for Linux and wxMSW for Windows. What do I have to consider if I'm using nim as coding language?
14:57:00def-Araq: i don't think dom96 will be happy with that
14:57:23Araqdef-: I asked him, it's fine, he has his work in a branch already anyway ;-)
14:59:20Araqso ... the M&S bug triggered by the testcase is tough ... essentially the algorithm is wrong. I wonder if we should enable gcUseBitvectors for the release but I don't know what this breaks
14:59:26*clynamen quit (Ping timeout: 246 seconds)
14:59:55Araqand if it worked with 0.10.2 for an app it will likely continue to work
15:02:08*OnO quit (Read error: Connection reset by peer)
15:02:50*OnO joined #nim
15:05:18*clynamen joined #nim
15:05:45Araqonionhammer: websocketmem.nim(12, 67) Error: cannot open 'sha1' ;-)
15:05:55Araqyour instructions are not idiot proof
15:07:09def-Araq: https://github.com/Araq/Nim/pull/2606
15:07:27*HakanD_ joined #nim
15:08:04AraqHakanD_: nice! but why?
15:08:47Araqonionhammer: cannot reproduce your leak with the default GC
15:09:01Araqbut there has been a bugfix that could have caused leaks
15:09:09*HakanD quit (Ping timeout: 248 seconds)
15:09:39HakanD_hmm https://en.wikipedia.org/wiki/Wikipedia:Deletion_review/Log/2015_April_26#Nim_.28programming_language.29
15:10:09HakanD_some sensible admin decided it should stay, and the people nominated the article for deletion is after it again.
15:10:17*clynamen quit (Ping timeout: 246 seconds)
15:10:54*darkf quit (Quit: Leaving)
15:10:56HakanD_meh, none of it makes any sense
15:11:03Araqlol
15:12:06HakanD_than later we should appeal for deletin review review
15:12:21HakanD_i hate politics
15:15:23*clynamen joined #nim
15:16:35Araqonionhammer: still running ... no leak
15:17:00Araq(and yes I do browser refreshes)
15:21:48onionhammerAraq sorry, i tried to get you to put sha1 into the std lib :P
15:22:22onionhammerAraq i'll retest today
15:22:46Araqcan you test on linux too?
15:23:19onionhammersure
15:23:35*clynamen quit (Ping timeout: 246 seconds)
15:27:22onionhammerAraq what were you seeing?
15:27:26onionhammerhow high did it get
15:27:46onionhammerright now os x is getting up to 820kb with 6 clients
15:27:59onionhammerdefault gc
15:28:10Araqnever more than 128KB
15:28:15Araqdefault gc, release
15:28:16onionhammerokay
15:28:23onionhammer900kb now on os x
15:28:27onionhammerI'll try linux now
15:28:50*clynamen joined #nim
15:29:37Araqwell the cycle collector kicks in after 4 MB or something
15:29:50Araqso before you're over that, there is no leak
15:30:21onionhammerok
15:30:26onionhammerit's at 1.109mb
15:30:46Araqwhat do you mean by 6 clients though?
15:30:52onionhammeropen more browsers
15:30:53Araq6 browser tabs?
15:30:55onionhammerit connects more clients
15:30:56onionhammeryeah
15:31:14Araqdoes a tab count too?
15:31:38onionhammeryeah
15:34:40onionhammerok, testing both osx and linux now
15:36:09Araqwell firefox is stupid, redirected it to some file:/// thing
15:36:15Araqso maybe you're right
15:36:30onionhammeranother file you can try is leak.html
15:36:43onionhammerit connects/disconnects much more rapidly
15:36:55onionhammeroh wait no it doesnt ;)
15:36:58onionhammeri changed it lol
15:37:12*JinShil quit (Quit: Konversation terminated!)
15:37:40onionhammeroof,i crashed the server
15:38:37Araqyummy
15:38:48onionhammerlooks like if you call 'send' after a socket has disconnected it crashes
15:38:53onionhammerwith SIGPIPE: pipe closed
15:39:20*miglo left #nim (#nim)
15:40:33Araqbbl
15:40:54onionhammeroh wait, so you're saying your client wasnt hitting it at all?
15:40:59*OnO quit (Quit: Textual IRC Client: www.textualapp.com)
15:42:19*mrkishi joined #nim
15:48:17*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:49:40*Dom96_ joined #nim
15:50:45Dom96_Araq, def-: i am happy with reverting back to the original code, pre def's PR
15:52:04*Ven joined #nim
15:52:19*Dom96_ quit (Client Quit)
15:53:14*jeromegn joined #nim
15:58:56*clynamen quit (Ping timeout: 246 seconds)
15:59:34*HakanD_ quit (Quit: Be back later ...)
15:59:35jeromegnEXetoC: I see you’ve committed aesthetic changes to the mongo package, were you able to replicate the exception?
16:00:15jeromegnrunning (from the package’s dir): `nim c -r mongo.nim` gives me “mongo.nim(49, 15) Error: identifier expected, but found '(result)'” in the end.
16:01:12*superfunc joined #nim
16:01:27superfuncyo everybody
16:04:23*clynamen joined #nim
16:05:48*HakanD_ joined #nim
16:13:56filcuchi, how the cstring type work?
16:14:11filcucdoes it free the memory or not?
16:14:20filcucgiven that it has been allocated in the c function?
16:14:55filcuci'm talking about passing a string from C to Nim
16:15:18filcuci think that the correct use case is: create the string on the stack on the C side
16:15:46filcucthen call a function from the C side to the Nim side passing the pointer to the stack variable
16:16:08filcucon the Nim side copy the cstring to string
16:16:08*mrkishi quit (Read error: Connection reset by peer)
16:16:19*mrkishi joined #nim
16:16:29filcucthen the C function callback return and the memory of the stack allocated string is freed
16:16:35filcucis it correct?
16:22:49*mrkishi_ joined #nim
16:23:49*mrkishi quit (Ping timeout: 250 seconds)
16:26:54matkukiIs there a way to change a node type in a macro from a nnkCommand to nnkProcDef?
16:27:44BlaXpirit_matkuki, u cant just change the type
16:27:49BlaXpirit_arent these completely different things
16:29:52*Gr33n3gg joined #nim
16:29:54matkukiBlaXpirit_: Or perhaps create a new nnkProcDef node and copy everything from the nnkCommand node?
16:30:07onionhammeraraq yeah they both crashed
16:30:12onionhammereventually
16:30:19*jeromegn quit (Quit: jeromegn)
16:34:32matkukiHow can I change the first 'getter' part into the lower 'proc' part inside a macro: https://bpaste.net/show/8d44e0ba0191
16:35:20BlaXpirit_that is not how this works
16:35:31*mrkishi_ quit ()
16:35:47BlaXpirit_hm maybe it works by chance but I can see how it recognizes it
16:36:02BlaXpirit_no, actually i don't
16:36:23*clynamen quit (Ping timeout: 246 seconds)
16:36:32matkukiIt's not an compiler error, if that's what you mean.
16:39:00notfowlthats not valid syntax
16:40:12notfowldefGetter(Obj, accessorName, field)
16:40:32notfowltemplate defGetter (ty,name,field:untyped): typed =
16:40:58notfowl proc `name`* (this:`ty`): auto = this.`field`
16:41:12notfowler you dont need those quotes
16:41:55*clynamen joined #nim
16:42:01matkukinotfowl: Great, what about a setter?
16:42:29notfowlit looks very similar
16:42:47matkukiCan you give me an example please?
16:43:48notfowlproc `value=` (some:ref ty; val:int) = some.val = val
16:44:28*pregressive joined #nim
16:50:18matkukinotfowl: Thanks, that's what I'm using now, but I thought I could pretty it up a bit.
16:50:19matkukiBlaXpirit, notfowl: You were right, it only parses it, but it throws an error in the later passes: 'Error: invalid indentation'. Was just playing around
16:52:28*clarior quit (Ping timeout: 256 seconds)
16:53:14notfowlfilcuc, are you using a c library?
16:53:48filcucyes
16:53:53filcucnotfowl: yes
16:53:58notfowlif you are you need to know if the string needs to be free'd or not
16:54:20filcuci know that i has to be freed
16:55:14filcucnotfowl: ;)
16:55:28*superfunc quit (Ping timeout: 246 seconds)
16:55:42notfowlfilcuc, i dont recommend doing it the way you were describing
16:55:45notfowlon the stack
16:56:00notfowlunless its like a "geterror" function (sdl, gl has these)
16:56:18*ingsoc quit (Quit: Leaving.)
16:56:20filcucno obviusly the example i wrote works if the string is allocated on the stack
16:56:31filcucbut i wanted to know what exactly do the cstring
16:56:41filcucif it calls some free/delete or not
16:56:45filcucbut i believe not
16:57:09filcucsince it could not know if the string is allocate with a C++ new or C malloc
16:57:21notfowlright
16:57:33notfowlto convert it to a string just call $ on it
16:57:48notfowlcopy*
16:58:00notfowlthen you would have to free it
16:59:11filcucnotfowl: ok thank you
17:12:47*clynamen quit (Ping timeout: 246 seconds)
17:15:14*filcuc quit (Ping timeout: 245 seconds)
17:17:58*clynamen joined #nim
17:18:28*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:19:25*HakanD_ quit (Quit: Be back later ...)
17:22:21*HakanD_ joined #nim
17:35:20*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 37.0.2/20150415140819])
17:37:21*matkuki joined #nim
17:39:45matkukinotfowl: Can I change a nnkProcDef node's name inside a statement macro? Example: 'proc someThing()' into 'proc otherThing'
17:40:05*clynamen quit (Ping timeout: 246 seconds)
17:43:46matkukiBlaXpirit_: Maybe you know?
17:44:05BlaXpirit_sure
17:44:56matkukiBlaXpirit_: How is it done?
17:45:13BlaXpirit_i have a different usage here https://github.com/BlaXpirit/nim-random/blob/master/src/random.nim#L62
17:45:18*BitPuffin joined #nim
17:45:30*clynamen joined #nim
17:45:55*Arrrrr joined #nim
17:46:11BlaXpirit_StmtList(ProcDef(Ident(!"someThing"), Empty(), Empty(), FormalParams(Empty()), Empty(), Empty(), Empty()))
17:47:06*brson joined #nim
17:47:19ArrrrrHello, i have a simple question describe in this pastebin related to nim cfg files: http://pastebin.com/dEhdZtPq
17:48:27BlaXpirit_body[0][0] = ident("bbb")
17:48:36BlaXpirit_and by bbb i mean otherThing
17:49:09BlaXpirit_body is StmtList, body[0] is ProcDef, body[0][0] is Ident
17:49:23matkukiBlaXpirit_: Great, let me test it...
17:49:54matkukiBlaXpirit_: Thanks
17:52:05*mrkishi joined #nim
17:53:12EXetoCthere are also getters and setters
17:53:13*Demos joined #nim
17:53:28EXetoCname= and so on
17:55:29*clynamen quit (Ping timeout: 246 seconds)
17:55:42*Matthias247 joined #nim
17:59:29matkukiEXeroC: Thanks, the setter works!
18:00:33*clynamen joined #nim
18:02:49*Gr33n3gg left #nim ("Leaving")
18:04:37*HakanD_ quit (Ping timeout: 264 seconds)
18:09:48matkukiBlaXpirit_: Ah, the visibility marker '*' has to also be added to the name, right?
18:10:06BlaXpirit_matkuki, it's not part of the name
18:10:30BlaXpirit_matkuki, please just compare the output of dumpTree
18:10:35BlaXpirit_with and without star
18:11:06BlaXpirit_Ident(!"name") vs Postfix(Ident(!"*"), Ident(!"name"))
18:11:43BlaXpirit_so you may need to take this into account
18:11:44matkukiSorry, I meant what you just wrote.
18:12:16BlaXpirit_matkuki, so maybe you just want to leave it there instead of readding
18:12:47BlaXpirit_btw .name seems to work same as [0]
18:12:48BlaXpirit_so
18:13:24BlaXpirit_if body[0].name.kind == nnkPostfix: body[0].name[1] = ident("bbb") else: body[0].name = ident("bbb")
18:13:37BlaXpirit_i dunno, just a quick and dirty solution
18:13:49matkukiThanks!
18:17:09*mrkishi quit ()
18:17:19EXetoCoh, those are private
18:17:29EXetoCnvm
18:18:35*clynamen quit (Ping timeout: 246 seconds)
18:24:03*clynamen joined #nim
18:25:16*mrkishi joined #nim
18:29:05*clynamen quit (Ping timeout: 246 seconds)
18:30:41notfowlmatkuki, node.name = ident("myname").postfix("*")
18:31:25matkukinotfowl: Got it, thank you. I've almost finished it.
18:34:04*clynamen joined #nim
18:38:22*Pisuke quit (Ping timeout: 255 seconds)
18:40:08*pregressive quit (Remote host closed the connection)
18:40:59*clynamen quit (Ping timeout: 246 seconds)
18:46:08*clynamen joined #nim
18:48:12MagusOTBIs there an easy way to convert a sequence of strings to a cstringarray?
18:51:23MagusOTBI'm trying to call glShaderSource
18:51:52DemosI think you can just use one cstring
18:52:50MagusOTByou sure? I know the API expects a list of pointers to strings, and the type signature is a cstringArray
18:53:07MagusOTBand using a cstring doesn't compile: Error: type mismatch: got (cstring) but expected 'cstringArray'
18:53:14*clynamen quit (Ping timeout: 246 seconds)
18:54:16Demosright, you need to do glShaderSource(shader, 1, addr sourceCstring, 0)
18:54:26Demosassuming your source is null terminated
18:54:56Demoswell something like that
18:55:08MagusOTBoh, I see, I need to have an intermediate value for the cstring
18:55:24MagusOTBI tried addr(source.cstring), which is broken
18:55:47Demosum, yeah maybe. That probably gives an error about how something has no address
18:55:58MagusOTBit did
18:56:03*pregressive joined #nim
18:56:05notfowlthats not broken
18:56:10MagusOTBoh?
18:56:14MagusOTBit doesn't compile
18:56:18Demosyeah, that's not a bug
18:56:32notfowlwell cstring(str) is a type conversion not an lvalue
18:56:39Demosshould not compile because it is a temp value
18:56:58MagusOTByeah, broken as in attempting to do that is broken.
18:56:59notfowlvar arr: [cstring(s1), cstring(s2), nil]; cfunc(arr[0].addr)
18:57:43MagusOTBcfunc?
18:57:59Demosmuch easier var str = nimstr.cstring
18:58:14Demosthen glShaderSource(shader, 1, addr str, nil)
18:58:25notfowlwell i dont know what your function is called.. cfunc is what you get out of me for free
18:59:06*clynamen joined #nim
19:00:30*brson quit (Ping timeout: 244 seconds)
19:04:12*mrkishi quit ()
19:05:36*mrkishi joined #nim
19:08:59*clynamen quit (Ping timeout: 246 seconds)
19:09:41*TEttinger joined #nim
19:10:24matkukinotfowl: How do I create a nnkAccQuoted node?
19:11:18notfowlnewTree(nnkAccQuoted, sub1,sub2,..)
19:11:35matkukiGot it
19:15:12matkukinotfowl: I get: "undeclared identifier: 'newTree'" ?
19:15:31notfowlyour nim is old
19:16:00matkukiYes it is, about a month, maybe more.
19:18:22notfowlhint: you need to create a *new nim node* then *add* nodes to it
19:19:11*MagusOTB quit (Ping timeout: 276 seconds)
19:19:44matkukiThanks, updating Nim as we speak.
19:25:11*brson joined #nim
19:26:58*HakanD_ joined #nim
19:31:08*clynamen joined #nim
19:31:12*notfowl- joined #nim
19:31:25*notfowl quit (Quit: Leaving)
19:31:31*notfowl- is now known as fowl
19:31:34*fowl quit (Changing host)
19:31:34*fowl joined #nim
19:31:34*fowl quit (Changing host)
19:31:34*fowl joined #nim
19:31:52matkukinotfowl: That did it, it works now, great! Is it just me or has the compiler got faster?
19:34:32matkukiSorry, fowl.
19:39:48ArrrrrWhen i pass this line to the compiler '-p:"lib/glfw"' it works fine. Inside a .cfg files a hint indicates the config is being used, but it is like path is not setted
19:40:39ArrrrrDoes path work different inside a cfg or when can the error resides?
19:43:06EXetoChm ok
19:43:06*onionhammer quit (Read error: Connection reset by peer)
19:43:17*clynamen quit (Ping timeout: 246 seconds)
19:43:34*onionhammer joined #nim
19:43:34EXetoCaren't you including deps with a package file
19:44:48ArrrrrIf by package file you mean nimble, i dont use it
19:45:51*MagusOTB joined #nim
19:48:10*clynamen joined #nim
19:49:23matkukiBlaXpirit_, fowl, EXetoC: Seeing as you really helped me, I owe you an explanation/solution of what I needed: https://bpaste.net/show/56923d591813
19:49:38matkukiThanks again.
19:55:39ArrrrrHave to go, good night.
19:55:43*Arrrrr quit (Quit: Page closed)
19:56:16*Demon_Fox joined #nim
20:00:30Araqonionhammer: what does it mean "you reproduced it on macosx"? it used to leak now it crashes? and what about Linux?
20:01:04onionhammerAraq yes I mean it crashed in osx
20:01:12onionhammeri posted a stacktrace on the issue
20:01:21Araqbut it used to only leak?
20:01:24onionhammerit crashed in linux too
20:01:34onionhammerno it used to crash eventually I think
20:01:43onionhammeri am retesting on linux later when i get a chance
20:01:48Araqso it leaks *and* crashes?
20:02:03onionhammerwell, I assumed it was a 'leak until it crashes' sort of thing
20:02:10onionhammerat least now it leaks and crashes
20:02:23Araqso it leaks gigabytes before crashing?
20:04:03onionhammerno, dont think it got that hight
20:04:05onionhammerhigh
20:10:07*brson quit (Quit: leaving)
20:13:39*wan_ quit (Quit: WeeChat 1.1.1)
20:16:02Araq zeroMem(buffer, buffer.len) # bad idea, that's strlen(buffer)
20:17:00Araqin fact, I dunno why you have this buffer cstring field, it's unsafe and not required afaict
20:17:50Araq GC_unRef(client.asyncSocket.getSocket()) # this is also unsafe and wrong
20:24:06*Kingsquee joined #nim
20:34:35*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 37.0.2/20150415140819])
20:40:17*k1i joined #nim
20:42:20onionhammeraraq i only did that because it seemed to reduce leakage
20:45:38onionhammeraraq the buffer is tracked in gc
20:45:43onionhammerwe already talked about this
20:46:02onionhammerit's only allocated once, and it's just a pointer to strBuffer
20:46:49Araqonionhammer: i know but t makes reviewing harder
20:47:13Araqand cstring is not even bounds checked
20:47:15*filcuc joined #nim
20:48:10Araqwell the GC_unref alone explains the crash you're seeing
20:56:51*yglukhov________ quit (Quit: Be back later ...)
20:57:31*yglukhov________ joined #nim
21:02:13*yglukhov________ quit (Ping timeout: 264 seconds)
21:14:37*Matthias247 quit (Read error: Connection reset by peer)
21:16:56*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:35:38onionhammeraraq doesnt explain the inconsistency between platforms
21:35:42onionhammeraraq try witout
21:36:49Araqinconsistency between platforms? didn't you say linux and mac behave the same?
21:37:17*filcuc quit (Quit: Konversation terminated!)
21:38:07onionhammerdidnt u say you werent able to reproduce it?
21:39:47onionhammeraraq try it without the gcunref, it climbs memory usage a lot more quickly
21:40:09AraqI think I didn't really test it given firefox's strange behaviour :P
21:40:24*mrkishi quit (Remote host closed the connection)
21:41:06onionhammerlike with the gcunref it slowly climbs up, without it goes 1-4mb then back down then back up etc
21:45:05Araqthat's the cycle collector in action then?
21:46:26SharchoI've created an installation script for Nim: https://gist.github.com/shaicoleman/ed76656836d5112e2409
21:46:34*HakanD_ quit (Quit: Be back later ...)
21:46:54onionhammeraraq yeah, but i think the socket library should be cleaning up after itself
21:47:03onionhammerit must be leaving stuff open?
21:47:32onionhammerim running it with 9 clients and the zeromem/gcunref's commented out
21:47:57Araqthat's a different issue then
21:49:10onionhammeragreed, but that was my motivation
21:49:46onionhammerthis code contains a lot of hacky stuff that I was experimenting with to try to resolve memory/performance issues. I never released this :p
22:03:52Araqonionhammer: I think you're supposed to 'close' the sockets on your own ;-)
22:04:03onionhammeraraq I do call close
22:04:17onionhammerthe gcunref was literally right after a close call
22:04:53Araqwell I dunno. dom96 is your man now
22:06:01MagusOTBif I create var a: array[0..3, array[0..3, GLfloat]], is addr(a[0][0]) a pointer to 16 contiguous glfloats?
22:06:32AraqMagusOTB: yes
22:08:08*johnsoft quit (Ping timeout: 250 seconds)
22:08:21*johnsoft joined #nim
22:09:00*bjz joined #nim
22:12:42MagusOTBAraq: cool, thanks
22:20:31onionhammeraraq alright, do you want to assign dom96 to that issue and edit the description or do you want to start a new one
22:20:47dom96which issue is this?
22:21:01Araqonionhammer: close it and open some new issue
22:22:46def-Araq: are you sure about that? i recently noticed that that wasn't true
22:22:57def-Araq: the 2D array pointer thing
22:23:15def-i think there can be some alignment between the arrays
22:23:17onionhammerdom96 sockets arent freeing memory when you close them
22:23:35Araqdef-: I don't think so.
22:23:45dom96onionhammer: Do you have a test case that reproduces this?
22:23:54def-Araq: then i don't know why my code only worked with a 1D array in the end, let me check again
22:24:07onionhammerdom96 follow these instructions https://github.com/Araq/Nim/issues/2242
22:24:34onionhammerdom96 note the code in the ticket has been updated, I dont *think* its crashing but it is definitely using the gc a lot
22:28:36dom96onionhammer: Does this only happen on Mac OS X?
22:28:40dom96http://forum.nim-lang.org/t/1075/4#7177
22:29:13onionhammerdom96 no
22:29:25onionhammerdom96 i havent tested it on windows in a while though
22:29:34onionhammerwhat does the example do for you?
22:30:04def-Araq: ok, that was my fault. wrong alarm
22:32:39dom96onionhammer: I get this: Error: unhandled exception: An attempt was made to access a socket in a way forbidden by its access permissions.
22:32:46dom96on startup
22:32:51*filwit joined #nim
22:34:21*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:44:38onionhammerdom96 i dont know what to tell u, it works on all my machines
22:50:52*gsingh93 joined #nim
23:02:16dom96weird
23:02:19dom96it happens on bindAddr
23:09:32onionhammerodd
23:11:01*BlaXpirit_ quit (Quit: Quit Konversation)
23:11:35*Varriount joined #nim
23:26:30MagusOTBis there a better way to statically declare a GLmatrix than : var mvMatrix: GLMatrixf4 = [[1.GLfloat,0,0,0], [0.GLfloat,1,0,0], [0.GLfloat,0,1,0], [0.GLfloat,0,0,1]]
23:26:55AraqMagusOTB: template or macro
23:30:25*OnwardEuler quit (Ping timeout: 255 seconds)
23:30:43MagusOTBso I can't make statically declared numbers coerce into GLnumbers?
23:30:55filwitdom96: just made yet another commit to my pending Aporia PR. Please review it soon.. it fixes quite a few things since my original PR.
23:33:03MagusOTBcause GLmatrixf4 is array[0..2, array[0..2, GLfloat]], and GLfloat is GLfloat* = float32, and var a: float32 = 4 works.
23:33:22*pregressive quit (Remote host closed the connection)
23:34:29MagusOTBhmmm, an array of float32 doesn't though.
23:35:27filwita GLMatrix4 should be a array[4, ...] not array[3, ...]
23:35:50Araqfilwit: fixed the highlighting too?
23:36:22filwitAraq: eh? if you're asking about my Aporia commit, yet there are many highlighting fixes in it since my first PR
23:36:28filwityes**
23:40:09filwitAraq: btw, did you get anywhere further with the JS backend bugs? I forgot to give you my modified Raytracer code to use a test.
23:40:53*Sharcho left #nim ("Leaving")
23:41:17filwiteither way, I'm interested to know and test anything related to that if and when you have any improvements there.
23:42:08*saml_ joined #nim
23:43:38Araqfilwit: I fixed the JS bugs
23:43:58filwitAraq: awesome :) in devel? (gonna test)
23:44:04Araqyes
23:47:03filwitAraq: well.. output still isn't 100% correct.. but it ran really fast (Nim's JS backend), and output is almost correct... i'm still not entirely convinced the output error isn't in my Canvas fill JS code.. so I'm going to run some tests there to prove it either way
23:48:44Araqdoes that mean devel works for you again?
23:49:55filwitwell yes there's no exceptions being hit
23:50:20filwitno errors, but the resulting image is slightly incorrect
23:53:25def-filwit: maybe the ints/floats aren't exact enough in js?
23:55:17filwitdef-: yeah, I'm going over the code again to see what's going on.. I will go through the JS output as well, but first I'm setting up a test to prove my 'canvasDraw()' hand-written function is operating as expected.
23:55:55filwitI can post the code if anyone wants to take a look at it
23:56:52def-I guess I wouldn't be much use since I don't really know JS. I would just insert lots of debugging, compile to C and JS and check for differences
23:58:02filwityeah.. and JS is weird.. like all numbers are 31-bit floats, etc (and I'm still just using Nim's float, which I assume would be 32bit when used with the JS backend)
23:58:28filwitwell, at least they're 31bit on Chrome's V8.. dunno about Firefox
23:59:43def-so any float operation with the JS backend would be wrong then?