00:00:25 | Sharcho | I'm getting errors with 0.10.3 with strfmt. Is that a known issue? |
00:00:49 | Sharcho | 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]) |
00:01:48 | Sharcho | Also, is strfmt the best library for sprintf-like functionality? |
00:02:01 | Araq | Sharcho: nope, will look at it tomorrow |
00:02:06 | Araq | good night |
00:02:15 | Sharcho | Araq: 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:37 | MagusOTB | how 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:48 | Araq | nimble install nimfmt |
08:42:04 | Araq | nimfmt not found in local packages.json, check internet for updated packages? [y/N] |
08:42:05 | Araq | y |
08:42:14 | Araq | Error: unhandled exception: Package not found. [NimbleError] |
08:42:22 | Araq | nimble install strfmt |
08:42:29 | Araq | Error: unhandled exception: 'hg' not in PATH. [NimbleError] |
08:42:58 | Araq | Exceptions are not supposed to remove the need for any kind of error handling |
08:43:10 | Araq | but I must admit the error messages are good |
08:43:34 | Araq | dom96: why not use single try statement around it though? |
08:44:01 | Araq | so ... 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:36 | Araq | def-, 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:12 | Araq | Sharcho: 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:13 | def- | Araq: i also have a PR that didn't get pulled yet (I think he oversaw it) |
09:38:43 | def- | 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:34 | def- | 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:42 | Araq | so def- on linux 64 only the gctest.nimfails with M&S |
10:43:48 | Araq | on my machine |
10:43:56 | Araq | you said for you more fail? |
10:44:14 | def- | Araq: no, that one and the new asynchttpserver |
10:44:34 | * | Ven joined #nim |
10:44:38 | def- | 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:03 | Araq | GC_fullCollect() |
10:45:04 | Araq | # the M&S GC fails with this call and it's unclear why. Definitely something |
10:45:06 | Araq | # we need to fix! |
10:45:07 | Araq | GC_fullCollect() |
10:45:10 | Araq | that's in the test btw |
10:45:25 | Araq | so ... it's well known :P |
10:45:49 | Araq | nevertheless forcing 2 full collections shouldn't crash anything |
10:47:05 | Araq | and now it always works for me *sigh* |
10:49:58 | * | clynamen joined #nim |
10:57:23 | * | Trustable joined #nim |
11:09:03 | Araq | def-: 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:44 | def- | Araq: same here |
11:12:45 | Araq | what about asynchttpserver? |
11:12:50 | Araq | works with -d:gcUseBitvectors |
11:12:54 | Araq | ? |
11:15:05 | def- | no |
11:20:04 | dom96 | Araq: did you compile Nimble in release mode? |
11:20:24 | Araq | dom96: no, why would I? |
11:21:10 | dom96 | https://github.com/nim-lang/nimble/blob/master/src/nimble.nim#L912 |
11:23:18 | Araq | er ... on failure you don't remove the nimble temp dir? |
11:26:56 | Araq | dom96: so what are the DLLs I need to ship with Nimble? |
11:28:22 | dom96 | The temp dir is in /tmp so the OS will delete it anyway. |
11:30:08 | dom96 | The ones that are in this archive: https://github.com/nim-lang/nimble/releases/download/v0.6/nimble-0.6_win32.zip |
11:30:34 | Araq | awesome |
11:33:54 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:34:31 | Sharcho | Araq: 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:44 | Araq | what does {:d} do? |
11:35:56 | Sharcho | :d is an integer |
11:36:01 | def- | Sharcho: printlnfmt "{:d}", 1 may be a bit nicer, but both work for me |
11:36:35 | def- | with strfmt's devel branch (or my PR) |
11:37:36 | Sharcho | I didn't use the devel branch for strfmt, let me try that |
11:39:59 | Sharcho | Using the devel branch of strfmt works |
11:40:39 | Araq | strfmt has a devel branch? |
11:41:23 | Sharcho | Araq: yep |
11:41:27 | Araq | can we please make the async stuff a nimble package? |
11:41:45 | Araq | it'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:44 | dom96 | Araq: how would that help? |
11:47:53 | dom96 | that 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:54 | Araq | we could release a faster and more stable 'net' package indepently of the compiler |
12:08:30 | * | OnO joined #nim |
12:10:01 | Sharcho | Wow, 0.10.3 is 50% faster for me. |
12:11:44 | Araq | Sharcho: for what? |
12:11:45 | * | BlaXpirit_ joined #nim |
12:12:20 | Sharcho | Araq: For my program that finds the top-n elements in a file |
12:14:16 | * | BlaXpirit quit (Ping timeout: 240 seconds) |
12:14:40 | Araq | bbl |
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:38 | Araq | def-: can you revert dom96's stuff into something that works please |
13:27:03 | * | clynamen quit (Ping timeout: 246 seconds) |
13:27:26 | matkuki | Is 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:27 | matkuki | This works: https://bpaste.net/show/cf5bfbfc297b , but getter and compound assignment both use the 'proc visible_corner*(obj: BackObject): var int' proc. |
13:28:27 | Araq | matkuki: works as expected then |
13:28:51 | Araq | why would it do 2 roundtrips when the getter returns a 'var' already? |
13:29:20 | Araq | += simply doesn't work well with properties IMHO |
13:30:21 | Araq | and when you someOtherOp(backobj.corner) do you expect that it calls *2* times a 'corner' accessor? |
13:30:43 | Araq | += is not any different than someOtherOp |
13:32:11 | * | clynamen joined #nim |
13:32:12 | matkuki | Araq: It does work as expected, yes. |
13:32:13 | matkuki | So 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:30 | matkuki | I should forget about `+=`? |
13:32:45 | Araq | yup |
13:32:56 | matkuki | Got it. |
13:33:01 | Araq | alternatively you can forget about properties ;-) |
13:33:11 | matkuki | Thanks :) |
13:33:28 | Araq | the overhead vs bug prevention is really poor for these anyway |
13:34:03 | Araq | or you can use a template to get a zero-abstraction-penalty for the property |
13:34:59 | * | wan_ joined #nim |
13:35:00 | matkuki | Araq: Can you point me to a template example? |
13:35:28 | Araq | template field(x: Foo): expr = x.field |
13:35:47 | matkuki | Thanks |
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:20 | def- | Araq: work around the markandsweep bug or what? |
14:07:47 | def- | 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:19 | HakanD | hey |
14:26:16 | HakanD | good 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:34 | miglo | Hi! Is the wx library supported by nim or does a binding exist for building graphical user interfaces? |
14:48:28 | HakanD | miglo: 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:21 | Araq | def-: just add to the docs that the interface is unstable and then it's ready for 0.10.4 imho |
14:52:38 | Araq | your old code doesn't crash the GC |
14:53:36 | Araq | miglo: 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:56 | miglo | Hm, 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:00 | def- | Araq: i don't think dom96 will be happy with that |
14:57:23 | Araq | def-: I asked him, it's fine, he has his work in a branch already anyway ;-) |
14:59:20 | Araq | so ... 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:55 | Araq | and 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:45 | Araq | onionhammer: websocketmem.nim(12, 67) Error: cannot open 'sha1' ;-) |
15:05:55 | Araq | your instructions are not idiot proof |
15:07:09 | def- | Araq: https://github.com/Araq/Nim/pull/2606 |
15:07:27 | * | HakanD_ joined #nim |
15:08:04 | Araq | HakanD_: nice! but why? |
15:08:47 | Araq | onionhammer: cannot reproduce your leak with the default GC |
15:09:01 | Araq | but there has been a bugfix that could have caused leaks |
15:09:09 | * | HakanD quit (Ping timeout: 248 seconds) |
15:09:39 | HakanD_ | hmm https://en.wikipedia.org/wiki/Wikipedia:Deletion_review/Log/2015_April_26#Nim_.28programming_language.29 |
15:10:09 | HakanD_ | 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:56 | HakanD_ | meh, none of it makes any sense |
15:11:03 | Araq | lol |
15:12:06 | HakanD_ | than later we should appeal for deletin review review |
15:12:21 | HakanD_ | i hate politics |
15:15:23 | * | clynamen joined #nim |
15:16:35 | Araq | onionhammer: still running ... no leak |
15:17:00 | Araq | (and yes I do browser refreshes) |
15:21:48 | onionhammer | Araq sorry, i tried to get you to put sha1 into the std lib :P |
15:22:22 | onionhammer | Araq i'll retest today |
15:22:46 | Araq | can you test on linux too? |
15:23:19 | onionhammer | sure |
15:23:35 | * | clynamen quit (Ping timeout: 246 seconds) |
15:27:22 | onionhammer | Araq what were you seeing? |
15:27:26 | onionhammer | how high did it get |
15:27:46 | onionhammer | right now os x is getting up to 820kb with 6 clients |
15:27:59 | onionhammer | default gc |
15:28:10 | Araq | never more than 128KB |
15:28:15 | Araq | default gc, release |
15:28:16 | onionhammer | okay |
15:28:23 | onionhammer | 900kb now on os x |
15:28:27 | onionhammer | I'll try linux now |
15:28:50 | * | clynamen joined #nim |
15:29:37 | Araq | well the cycle collector kicks in after 4 MB or something |
15:29:50 | Araq | so before you're over that, there is no leak |
15:30:21 | onionhammer | ok |
15:30:26 | onionhammer | it's at 1.109mb |
15:30:46 | Araq | what do you mean by 6 clients though? |
15:30:52 | onionhammer | open more browsers |
15:30:53 | Araq | 6 browser tabs? |
15:30:55 | onionhammer | it connects more clients |
15:30:56 | onionhammer | yeah |
15:31:14 | Araq | does a tab count too? |
15:31:38 | onionhammer | yeah |
15:34:40 | onionhammer | ok, testing both osx and linux now |
15:36:09 | Araq | well firefox is stupid, redirected it to some file:/// thing |
15:36:15 | Araq | so maybe you're right |
15:36:30 | onionhammer | another file you can try is leak.html |
15:36:43 | onionhammer | it connects/disconnects much more rapidly |
15:36:55 | onionhammer | oh wait no it doesnt ;) |
15:36:58 | onionhammer | i changed it lol |
15:37:12 | * | JinShil quit (Quit: Konversation terminated!) |
15:37:40 | onionhammer | oof,i crashed the server |
15:38:37 | Araq | yummy |
15:38:48 | onionhammer | looks like if you call 'send' after a socket has disconnected it crashes |
15:38:53 | onionhammer | with SIGPIPE: pipe closed |
15:39:20 | * | miglo left #nim (#nim) |
15:40:33 | Araq | bbl |
15:40:54 | onionhammer | oh 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:45 | Dom96_ | 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:35 | jeromegn | EXetoC: I see you’ve committed aesthetic changes to the mongo package, were you able to replicate the exception? |
16:00:15 | jeromegn | running (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:27 | superfunc | yo everybody |
16:04:23 | * | clynamen joined #nim |
16:05:48 | * | HakanD_ joined #nim |
16:13:56 | filcuc | hi, how the cstring type work? |
16:14:11 | filcuc | does it free the memory or not? |
16:14:20 | filcuc | given that it has been allocated in the c function? |
16:14:55 | filcuc | i'm talking about passing a string from C to Nim |
16:15:18 | filcuc | i think that the correct use case is: create the string on the stack on the C side |
16:15:46 | filcuc | then call a function from the C side to the Nim side passing the pointer to the stack variable |
16:16:08 | filcuc | on 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:29 | filcuc | then the C function callback return and the memory of the stack allocated string is freed |
16:16:35 | filcuc | is it correct? |
16:22:49 | * | mrkishi_ joined #nim |
16:23:49 | * | mrkishi quit (Ping timeout: 250 seconds) |
16:26:54 | matkuki | Is there a way to change a node type in a macro from a nnkCommand to nnkProcDef? |
16:27:44 | BlaXpirit_ | matkuki, u cant just change the type |
16:27:49 | BlaXpirit_ | arent these completely different things |
16:29:52 | * | Gr33n3gg joined #nim |
16:29:54 | matkuki | BlaXpirit_: Or perhaps create a new nnkProcDef node and copy everything from the nnkCommand node? |
16:30:07 | onionhammer | araq yeah they both crashed |
16:30:12 | onionhammer | eventually |
16:30:19 | * | jeromegn quit (Quit: jeromegn) |
16:34:32 | matkuki | How can I change the first 'getter' part into the lower 'proc' part inside a macro: https://bpaste.net/show/8d44e0ba0191 |
16:35:20 | BlaXpirit_ | that is not how this works |
16:35:31 | * | mrkishi_ quit () |
16:35:47 | BlaXpirit_ | hm maybe it works by chance but I can see how it recognizes it |
16:36:02 | BlaXpirit_ | no, actually i don't |
16:36:23 | * | clynamen quit (Ping timeout: 246 seconds) |
16:36:32 | matkuki | It's not an compiler error, if that's what you mean. |
16:39:00 | notfowl | thats not valid syntax |
16:40:12 | notfowl | defGetter(Obj, accessorName, field) |
16:40:32 | notfowl | template defGetter (ty,name,field:untyped): typed = |
16:40:58 | notfowl | proc `name`* (this:`ty`): auto = this.`field` |
16:41:12 | notfowl | er you dont need those quotes |
16:41:55 | * | clynamen joined #nim |
16:42:01 | matkuki | notfowl: Great, what about a setter? |
16:42:29 | notfowl | it looks very similar |
16:42:47 | matkuki | Can you give me an example please? |
16:43:48 | notfowl | proc `value=` (some:ref ty; val:int) = some.val = val |
16:44:28 | * | pregressive joined #nim |
16:50:18 | matkuki | notfowl: Thanks, that's what I'm using now, but I thought I could pretty it up a bit. |
16:50:19 | matkuki | BlaXpirit, 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:14 | notfowl | filcuc, are you using a c library? |
16:53:48 | filcuc | yes |
16:53:53 | filcuc | notfowl: yes |
16:53:58 | notfowl | if you are you need to know if the string needs to be free'd or not |
16:54:20 | filcuc | i know that i has to be freed |
16:55:14 | filcuc | notfowl: ;) |
16:55:28 | * | superfunc quit (Ping timeout: 246 seconds) |
16:55:42 | notfowl | filcuc, i dont recommend doing it the way you were describing |
16:55:45 | notfowl | on the stack |
16:56:00 | notfowl | unless its like a "geterror" function (sdl, gl has these) |
16:56:18 | * | ingsoc quit (Quit: Leaving.) |
16:56:20 | filcuc | no obviusly the example i wrote works if the string is allocated on the stack |
16:56:31 | filcuc | but i wanted to know what exactly do the cstring |
16:56:41 | filcuc | if it calls some free/delete or not |
16:56:45 | filcuc | but i believe not |
16:57:09 | filcuc | since it could not know if the string is allocate with a C++ new or C malloc |
16:57:21 | notfowl | right |
16:57:33 | notfowl | to convert it to a string just call $ on it |
16:57:48 | notfowl | copy* |
16:58:00 | notfowl | then you would have to free it |
16:59:11 | filcuc | notfowl: 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:45 | matkuki | notfowl: 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:46 | matkuki | BlaXpirit_: Maybe you know? |
17:44:05 | BlaXpirit_ | sure |
17:44:56 | matkuki | BlaXpirit_: How is it done? |
17:45:13 | BlaXpirit_ | 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:11 | BlaXpirit_ | StmtList(ProcDef(Ident(!"someThing"), Empty(), Empty(), FormalParams(Empty()), Empty(), Empty(), Empty())) |
17:47:06 | * | brson joined #nim |
17:47:19 | Arrrrr | Hello, i have a simple question describe in this pastebin related to nim cfg files: http://pastebin.com/dEhdZtPq |
17:48:27 | BlaXpirit_ | body[0][0] = ident("bbb") |
17:48:36 | BlaXpirit_ | and by bbb i mean otherThing |
17:49:09 | BlaXpirit_ | body is StmtList, body[0] is ProcDef, body[0][0] is Ident |
17:49:23 | matkuki | BlaXpirit_: Great, let me test it... |
17:49:54 | matkuki | BlaXpirit_: Thanks |
17:52:05 | * | mrkishi joined #nim |
17:53:12 | EXetoC | there are also getters and setters |
17:53:13 | * | Demos joined #nim |
17:53:28 | EXetoC | name= and so on |
17:55:29 | * | clynamen quit (Ping timeout: 246 seconds) |
17:55:42 | * | Matthias247 joined #nim |
17:59:29 | matkuki | EXeroC: 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:48 | matkuki | BlaXpirit_: Ah, the visibility marker '*' has to also be added to the name, right? |
18:10:06 | BlaXpirit_ | matkuki, it's not part of the name |
18:10:30 | BlaXpirit_ | matkuki, please just compare the output of dumpTree |
18:10:35 | BlaXpirit_ | with and without star |
18:11:06 | BlaXpirit_ | Ident(!"name") vs Postfix(Ident(!"*"), Ident(!"name")) |
18:11:43 | BlaXpirit_ | so you may need to take this into account |
18:11:44 | matkuki | Sorry, I meant what you just wrote. |
18:12:16 | BlaXpirit_ | matkuki, so maybe you just want to leave it there instead of readding |
18:12:47 | BlaXpirit_ | btw .name seems to work same as [0] |
18:12:48 | BlaXpirit_ | so |
18:13:24 | BlaXpirit_ | if body[0].name.kind == nnkPostfix: body[0].name[1] = ident("bbb") else: body[0].name = ident("bbb") |
18:13:37 | BlaXpirit_ | i dunno, just a quick and dirty solution |
18:13:49 | matkuki | Thanks! |
18:17:09 | * | mrkishi quit () |
18:17:19 | EXetoC | oh, those are private |
18:17:29 | EXetoC | nvm |
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:41 | notfowl | matkuki, node.name = ident("myname").postfix("*") |
18:31:25 | matkuki | notfowl: 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:12 | MagusOTB | Is there an easy way to convert a sequence of strings to a cstringarray? |
18:51:23 | MagusOTB | I'm trying to call glShaderSource |
18:51:52 | Demos | I think you can just use one cstring |
18:52:50 | MagusOTB | you sure? I know the API expects a list of pointers to strings, and the type signature is a cstringArray |
18:53:07 | MagusOTB | and 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:16 | Demos | right, you need to do glShaderSource(shader, 1, addr sourceCstring, 0) |
18:54:26 | Demos | assuming your source is null terminated |
18:54:56 | Demos | well something like that |
18:55:08 | MagusOTB | oh, I see, I need to have an intermediate value for the cstring |
18:55:24 | MagusOTB | I tried addr(source.cstring), which is broken |
18:55:47 | Demos | um, yeah maybe. That probably gives an error about how something has no address |
18:55:58 | MagusOTB | it did |
18:56:03 | * | pregressive joined #nim |
18:56:05 | notfowl | thats not broken |
18:56:10 | MagusOTB | oh? |
18:56:14 | MagusOTB | it doesn't compile |
18:56:18 | Demos | yeah, that's not a bug |
18:56:32 | notfowl | well cstring(str) is a type conversion not an lvalue |
18:56:39 | Demos | should not compile because it is a temp value |
18:56:58 | MagusOTB | yeah, broken as in attempting to do that is broken. |
18:56:59 | notfowl | var arr: [cstring(s1), cstring(s2), nil]; cfunc(arr[0].addr) |
18:57:43 | MagusOTB | cfunc? |
18:57:59 | Demos | much easier var str = nimstr.cstring |
18:58:14 | Demos | then glShaderSource(shader, 1, addr str, nil) |
18:58:25 | notfowl | well 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:24 | matkuki | notfowl: How do I create a nnkAccQuoted node? |
19:11:18 | notfowl | newTree(nnkAccQuoted, sub1,sub2,..) |
19:11:35 | matkuki | Got it |
19:15:12 | matkuki | notfowl: I get: "undeclared identifier: 'newTree'" ? |
19:15:31 | notfowl | your nim is old |
19:16:00 | matkuki | Yes it is, about a month, maybe more. |
19:18:22 | notfowl | hint: you need to create a *new nim node* then *add* nodes to it |
19:19:11 | * | MagusOTB quit (Ping timeout: 276 seconds) |
19:19:44 | matkuki | Thanks, 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:52 | matkuki | notfowl: That did it, it works now, great! Is it just me or has the compiler got faster? |
19:34:32 | matkuki | Sorry, fowl. |
19:39:48 | Arrrrr | When 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:39 | Arrrrr | Does path work different inside a cfg or when can the error resides? |
19:43:06 | EXetoC | hm 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:34 | EXetoC | aren't you including deps with a package file |
19:44:48 | Arrrrr | If by package file you mean nimble, i dont use it |
19:45:51 | * | MagusOTB joined #nim |
19:48:10 | * | clynamen joined #nim |
19:49:23 | matkuki | BlaXpirit_, 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:38 | matkuki | Thanks again. |
19:55:39 | Arrrrr | Have to go, good night. |
19:55:43 | * | Arrrrr quit (Quit: Page closed) |
19:56:16 | * | Demon_Fox joined #nim |
20:00:30 | Araq | onionhammer: what does it mean "you reproduced it on macosx"? it used to leak now it crashes? and what about Linux? |
20:01:04 | onionhammer | Araq yes I mean it crashed in osx |
20:01:12 | onionhammer | i posted a stacktrace on the issue |
20:01:21 | Araq | but it used to only leak? |
20:01:24 | onionhammer | it crashed in linux too |
20:01:34 | onionhammer | no it used to crash eventually I think |
20:01:43 | onionhammer | i am retesting on linux later when i get a chance |
20:01:48 | Araq | so it leaks *and* crashes? |
20:02:03 | onionhammer | well, I assumed it was a 'leak until it crashes' sort of thing |
20:02:10 | onionhammer | at least now it leaks and crashes |
20:02:23 | Araq | so it leaks gigabytes before crashing? |
20:04:03 | onionhammer | no, dont think it got that hight |
20:04:05 | onionhammer | high |
20:10:07 | * | brson quit (Quit: leaving) |
20:13:39 | * | wan_ quit (Quit: WeeChat 1.1.1) |
20:16:02 | Araq | zeroMem(buffer, buffer.len) # bad idea, that's strlen(buffer) |
20:17:00 | Araq | in fact, I dunno why you have this buffer cstring field, it's unsafe and not required afaict |
20:17:50 | Araq | 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:20 | onionhammer | araq i only did that because it seemed to reduce leakage |
20:45:38 | onionhammer | araq the buffer is tracked in gc |
20:45:43 | onionhammer | we already talked about this |
20:46:02 | onionhammer | it's only allocated once, and it's just a pointer to strBuffer |
20:46:49 | Araq | onionhammer: i know but t makes reviewing harder |
20:47:13 | Araq | and cstring is not even bounds checked |
20:47:15 | * | filcuc joined #nim |
20:48:10 | Araq | well 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:38 | onionhammer | araq doesnt explain the inconsistency between platforms |
21:35:42 | onionhammer | araq try witout |
21:36:49 | Araq | inconsistency between platforms? didn't you say linux and mac behave the same? |
21:37:17 | * | filcuc quit (Quit: Konversation terminated!) |
21:38:07 | onionhammer | didnt u say you werent able to reproduce it? |
21:39:47 | onionhammer | araq try it without the gcunref, it climbs memory usage a lot more quickly |
21:40:09 | Araq | I 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:06 | onionhammer | like with the gcunref it slowly climbs up, without it goes 1-4mb then back down then back up etc |
21:45:05 | Araq | that's the cycle collector in action then? |
21:46:26 | Sharcho | I've created an installation script for Nim: https://gist.github.com/shaicoleman/ed76656836d5112e2409 |
21:46:34 | * | HakanD_ quit (Quit: Be back later ...) |
21:46:54 | onionhammer | araq yeah, but i think the socket library should be cleaning up after itself |
21:47:03 | onionhammer | it must be leaving stuff open? |
21:47:32 | onionhammer | im running it with 9 clients and the zeromem/gcunref's commented out |
21:47:57 | Araq | that's a different issue then |
21:49:10 | onionhammer | agreed, but that was my motivation |
21:49:46 | onionhammer | this 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:52 | Araq | onionhammer: I think you're supposed to 'close' the sockets on your own ;-) |
22:04:03 | onionhammer | araq I do call close |
22:04:17 | onionhammer | the gcunref was literally right after a close call |
22:04:53 | Araq | well I dunno. dom96 is your man now |
22:06:01 | MagusOTB | if I create var a: array[0..3, array[0..3, GLfloat]], is addr(a[0][0]) a pointer to 16 contiguous glfloats? |
22:06:32 | Araq | MagusOTB: yes |
22:08:08 | * | johnsoft quit (Ping timeout: 250 seconds) |
22:08:21 | * | johnsoft joined #nim |
22:09:00 | * | bjz joined #nim |
22:12:42 | MagusOTB | Araq: cool, thanks |
22:20:31 | onionhammer | araq 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:47 | dom96 | which issue is this? |
22:21:01 | Araq | onionhammer: close it and open some new issue |
22:22:46 | def- | Araq: are you sure about that? i recently noticed that that wasn't true |
22:22:57 | def- | Araq: the 2D array pointer thing |
22:23:15 | def- | i think there can be some alignment between the arrays |
22:23:17 | onionhammer | dom96 sockets arent freeing memory when you close them |
22:23:35 | Araq | def-: I don't think so. |
22:23:45 | dom96 | onionhammer: Do you have a test case that reproduces this? |
22:23:54 | def- | Araq: then i don't know why my code only worked with a 1D array in the end, let me check again |
22:24:07 | onionhammer | dom96 follow these instructions https://github.com/Araq/Nim/issues/2242 |
22:24:34 | onionhammer | dom96 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:36 | dom96 | onionhammer: Does this only happen on Mac OS X? |
22:28:40 | dom96 | http://forum.nim-lang.org/t/1075/4#7177 |
22:29:13 | onionhammer | dom96 no |
22:29:25 | onionhammer | dom96 i havent tested it on windows in a while though |
22:29:34 | onionhammer | what does the example do for you? |
22:30:04 | def- | Araq: ok, that was my fault. wrong alarm |
22:32:39 | dom96 | onionhammer: I get this: Error: unhandled exception: An attempt was made to access a socket in a way forbidden by its access permissions. |
22:32:46 | dom96 | on startup |
22:32:51 | * | filwit joined #nim |
22:34:21 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:44:38 | onionhammer | dom96 i dont know what to tell u, it works on all my machines |
22:50:52 | * | gsingh93 joined #nim |
23:02:16 | dom96 | weird |
23:02:19 | dom96 | it happens on bindAddr |
23:09:32 | onionhammer | odd |
23:11:01 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
23:11:35 | * | Varriount joined #nim |
23:26:30 | MagusOTB | is 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:55 | Araq | MagusOTB: template or macro |
23:30:25 | * | OnwardEuler quit (Ping timeout: 255 seconds) |
23:30:43 | MagusOTB | so I can't make statically declared numbers coerce into GLnumbers? |
23:30:55 | filwit | dom96: 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:03 | MagusOTB | cause 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:29 | MagusOTB | hmmm, an array of float32 doesn't though. |
23:35:27 | filwit | a GLMatrix4 should be a array[4, ...] not array[3, ...] |
23:35:50 | Araq | filwit: fixed the highlighting too? |
23:36:22 | filwit | Araq: eh? if you're asking about my Aporia commit, yet there are many highlighting fixes in it since my first PR |
23:36:28 | filwit | yes** |
23:40:09 | filwit | Araq: 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:17 | filwit | either 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:38 | Araq | filwit: I fixed the JS bugs |
23:43:58 | filwit | Araq: awesome :) in devel? (gonna test) |
23:44:04 | Araq | yes |
23:47:03 | filwit | Araq: 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:44 | Araq | does that mean devel works for you again? |
23:49:55 | filwit | well yes there's no exceptions being hit |
23:50:20 | filwit | no errors, but the resulting image is slightly incorrect |
23:53:25 | def- | filwit: maybe the ints/floats aren't exact enough in js? |
23:55:17 | filwit | def-: 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:55 | filwit | I can post the code if anyone wants to take a look at it |
23:56:52 | def- | 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:02 | filwit | yeah.. 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:28 | filwit | well, at least they're 31bit on Chrome's V8.. dunno about Firefox |
23:59:43 | def- | so any float operation with the JS backend would be wrong then? |