<< 09-09-2018 >>

00:58:20zachcarteris there any way to run tests for JS in a browser context?
01:00:21zachcarterI think I'll just use puppeteer
01:03:19*SenasOzys quit (Remote host closed the connection)
01:05:38*crem quit (Ping timeout: 250 seconds)
01:07:32*crem joined #nim
01:18:00*crem quit (Ping timeout: 252 seconds)
01:22:54*crem joined #nim
01:35:17*seni quit (Quit: Leaving)
01:42:29*zachcarter quit (Read error: Connection reset by peer)
01:43:33*crem quit (Ping timeout: 252 seconds)
01:45:15*crem joined #nim
01:50:27*crem quit (Ping timeout: 252 seconds)
02:07:57*crem joined #nim
02:20:58*crem quit (Ping timeout: 244 seconds)
02:28:30*crem joined #nim
02:53:24*crem quit (Ping timeout: 272 seconds)
02:54:50*crem joined #nim
03:07:27*crem quit (Ping timeout: 252 seconds)
03:09:53*crem joined #nim
03:14:36*crem quit (Ping timeout: 252 seconds)
03:16:13*crem joined #nim
03:23:29*darithorn joined #nim
03:23:58*darithorn quit (Client Quit)
03:24:15*darithorn joined #nim
03:28:38*zachcarter joined #nim
03:33:34*crem quit (Ping timeout: 252 seconds)
03:35:35*crem joined #nim
03:47:03*crem quit (Ping timeout: 252 seconds)
03:48:26*crem joined #nim
03:49:46*erratic quit (Ping timeout: 272 seconds)
04:21:48FromGitter<bung87> when I using `scanf` I got ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b949fdc7667e11554c6eb81]
04:26:43*erratic joined #nim
04:29:45leorizelooks like a bug to me. please file an issue with example code attached.
04:31:54FromGitter<bung87> ok
04:32:12leorizebung87: can I have the example code? I can't seem to trigger anything like that with examples from strscans module
04:35:02FromGitter<bung87> https://github.com/nim-lang/Nim/issues/8925
04:35:39FromGitter<bung87> Nim Compiler Version 0.18.1 [MacOSX: amd64] ⏎ Compiled at 2018-09-07
04:36:25FromGitter<bung87> updated the issue with git hash
04:36:40leorizeyour example won't compile without definitions of HourRange and MinuteRange
04:37:08*kapil___ joined #nim
04:38:23FromGitter<bung87> it's in times module
04:39:08FromGitter<bung87> updated the issue.
04:41:00leorizeI think you should re-indent the code
04:43:01FromGitter<bung87> ok done it
04:46:27leorizelooks like scanf doesn't support range type with `$i`
04:47:04leorizeit tried to print an error message but bumped into macros module
04:47:53zachcarteris there any way to pass a symbol to the JS backend (a typedesc specifically) without turning it into a string?
04:48:05zachcarteror do I need to use a macro for that?
04:48:35FromGitter<bung87> hmm so that i may using int type for now
04:49:16shashlick@bung87: does it work with stable?
04:50:40FromGitter<bung87> havn't check
05:03:28zachcarterugh - I need to turn a typedesc into a JsObject basically - any ideas how?
05:11:43*erratic quit (Ping timeout: 245 seconds)
05:20:10zachcarterI feel like I'm making this too difficult :/
05:26:50zachcartergot a solution
05:31:11zachcarterSweet! I got custom elements working!
05:45:25*darithorn quit (Quit: WeeChat 2.2)
05:52:04zachcarterhttps://gist.github.com/zacharycarter/6af93331f62dda6f463c69588d3f9c6c
06:01:24zachcarterguess I'm ready to start building something with this + my hyperHTML port now :D
06:41:22*xet7 joined #nim
06:49:09*erratic joined #nim
07:58:03*nsf joined #nim
07:58:18zachcarteris it possible to evaluate a NimNode inside of a macro
07:58:19zachcarter?
07:58:30zachcarterlike if it's a function call for instance?
08:01:31*cspar joined #nim
08:02:29*arebel joined #nim
08:03:21*gmpreussner quit (Ping timeout: 252 seconds)
08:03:44*gmpreussner joined #nim
08:06:47*arebel quit (Ping timeout: 240 seconds)
08:33:33*Vladar joined #nim
08:47:46FromGitter<codenoid> hi all<3
09:14:55FromGitter<tim-st> Does this endian converter always copy also if not needed? https://github.com/nim-lang/Nim/blob/855956bf617f68ac0be3717329e9e1181e5dc0c6/lib/pure/endians.nim#L95
09:15:43FromGitter<zah> Hi Nimmers, ⏎ ⏎ I've put together a proposal for what might be the first accepted grant under the grants program made possible by Nim's partnership with Status to accelerate the development of Nim. ⏎ ⏎ The proposal is to make Nim better suited for interactive programming by implementing support for hot code-reloading and then a REPL and a Jupyter kernel based on it. You can read the full-text here: ...
09:15:43FromGitter... [https://gitter.im/nim-lang/Nim?at=5b94e4be151b090281ecc595]
09:15:43*wildlander joined #nim
09:18:51FromGitter<codenoid> hm :/, what is Jupyter kernel @zah ?
09:20:57FromGitter<jrfondren> https://www.youtube.com/watch?v=HW29067qVWk explains it well
09:21:45FromGitter<jrfondren> @zah I'd recommend adding a bit to that to explain why 'nim secret' isn't suitable
09:22:37FromGitter<codenoid> "kernel" word makes me confuse
09:23:01FromGitter<jrfondren> you can use a bunch of languages, so they need a name for the thing apart from the languages
09:25:26*martinium quit (Ping timeout: 272 seconds)
09:29:40FromGitter<zah> @jrfondren, I've left a comment in Github regarding `nim secret`
09:33:03zachcarterif I have a NimNode in a macro that looks like - `rt.wire(this)` - is it possible to execute the code represented by the NimNode?
09:54:55*stefanos82 joined #nim
10:22:28FromGitter<Bennyelg> Anyone knows how I upload "video" svg to my README?
10:22:34FromGitter<Bennyelg> seems github blocks it
10:30:41*skrylar joined #nim
10:33:19FromGitter<bung87> .gif is enough
10:33:20*arecaceae quit (Remote host closed the connection)
10:33:41*arecaceae joined #nim
10:38:11*Senketsu quit (Quit: WeeChat 2.2)
10:40:51*Senketsu joined #nim
10:40:56FromGitter<Bennyelg> But its svg format
10:43:34FromGitter<codenoid> re-record / covert your svg "video"
10:43:54*SenasOzys joined #nim
10:44:23FromGitter<codenoid> https://github.com/phw/peek
10:51:18*ftsf quit (Ping timeout: 245 seconds)
10:57:01*SenasOzys quit (Remote host closed the connection)
10:58:47FromGitter<Bennyelg> when I cover it to gif the there is no video
10:58:52FromGitter<Bennyelg> just black image.
11:15:31FromGitter<Bennyelg> how you place data to https://raw.githubusercontent.com/phw/peek/master/data/?
11:20:35zachcarterugh - I'm really struggling with trying to invoke a procedure passed as a nim node to a macro. inside of the macro
11:20:49zachcarterand then adding the result to the AST
11:23:09FromGitter<bung87> https://nim-lang.org/docs/manual.html#pragmas-compiletime-pragma like this?
11:23:54zachcartermaybe - I don't think so, but I'll give it a shot
11:24:43FromGitter<bung87> good luck
11:24:49zachcarterthank you
11:27:59*Senketsu quit (Quit: WeeChat 2.2)
11:29:45*skrylar quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
11:30:02FromGitter<Bennyelg> do you see the svg example in the readme now? ⏎ https://github.com/Bennyelg/csvql
11:30:26*Senketsu joined #nim
11:32:28FromGitter<bung87> the console screen? animated once then never event refresh page
11:32:43FromGitter<Bennyelg> :/
11:36:36*halirc joined #nim
11:39:44halircI transferred a binary compiled for windows to another system and there cpcre64.dll and pcre64.dll are missing. Is it possible to include these in the binary when I compile it, so that other users don't have to install anything?
11:46:05FromGitter<alehander42> I can see the whole gif benny
11:49:55FromGitter<Bennyelg> yea I was notice its related to the amount of time you render the page.
11:55:33*smt quit (Read error: Connection reset by peer)
11:55:47FromGitter<Bennyelg> @alehander42 thanks you for the star ;)
12:04:54livcdhalirc: there is shashlick's https://github.com/genotrance/nimpcre but I have not used it myself
12:07:34halirclivcd, thank you, I will have a look. Statically linking to pcre would that be an option or is that difficult? I don't know what compiler options and other things I would have to use for that.
12:08:04halirclivcd, oh looks like that project is about that :)
12:11:33zachcarteranyone around that is good with macros / templates?
12:18:59*dddddd joined #nim
12:25:24FromGitter<alehander42> Yep
12:26:01FromGitter<gogolxdong> what's the benefit of your hyperHTML over karax?
12:27:22FromGitter<alehander42> what's your issue?
12:27:34FromGitter<alehander42> Benny, np it's a cool idea
12:27:56zachcarteralehander42: I think I may have figured out the answer to my question - but if not I will ping you shortly
12:28:14zachcarterthanks for responding
12:56:15*nsf quit (Quit: WeeChat 2.2)
13:05:13*Jesin quit (Quit: Leaving)
13:10:49dom96halirc: It's easier to just ship your binary with the pcre DLLs
13:10:59dom96It might not be visible but most programs do this
13:11:22dom96In the future we'll adopt a Nim regex implementation and get rid of this dependency
13:20:20halircok! thanks
13:25:03FromGitter<arnetheduck> lovely, just spent 6h chasing down the stupidest bug ever in nlvm - a function was being called twice even though clearly in the code there was only one call.. as I was retrofitting nlvm to the new compiler-without-globals, I had turned a `proc` into a `template` as a quick and ugly hack, without noticing that one of the args was evaluated twice.. *sigh*
13:31:48dom96Oh yes, I've been bitten by that gotcha a couple of times too
13:32:10dom96The difference in semantics between template and proc is very subtle
13:36:17FromGitter<arnetheduck> it's `c` macros all over ;) I should have known better by now
13:37:47FromGitter<arnetheduck> was trying to think of a rule that could be turned into a warning, but I guess it's perfectly legitimate to want to have a template arg evaluated multiple times
13:46:02*halirc quit (Quit: Leaving)
13:53:44FromDiscord<treeform> Is there a way to get current app dir during compile?
13:53:58FromDiscord<treeform> I am trying to use relative paths in header: pragma but it just does not work
13:54:31FromDiscord<treeform> I don't know what dir i am compiling in
13:54:35FromGitter<alehander42> Currentsourcepath for the abs path to the current file, not sure about dir
13:54:45FromDiscord<treeform> neat
13:54:49FromGitter<alehander42> You can just take the parent directory i guess
13:59:06FromDiscord<treeform> alehander42, yes! that worked, thank you very much!
14:00:33FromDiscord<treeform> `currentSourcePath.parentDir().parentDir()`
14:05:45dom96You should probably use splitFile().dir instead
14:07:11FromGitter<alehander42> Np
14:12:28*wildlander quit (Quit: Konversation terminated!)
14:26:19FromGitter<mratsim> @arnetheduck I think a warning is fine and a push hints off at that specific place. ⏎ I did fix similar issues in the stdlib and in PRs
14:33:36*Trustable joined #nim
14:38:37FromGitter<tim-st> does `async` work the same on windows and linux (especially `await`)?
14:39:58FromGitter<bung87> if it implements async that should implements await as well
14:40:29FromGitter<tim-st> my code runs fine on windows, but debugging my binary search on linux it seems it jumps like it wants...
14:40:40FromGitter<tim-st> no order
14:41:18*pwntus quit (Ping timeout: 245 seconds)
14:45:10FromGitter<bung87> it may depends on current implements state ... show some codes may someone can help?
14:45:31FromGitter<tim-st> https://github.com/tim-st/nim-zim
14:47:04FromGitter<tim-st> I dont compile with `--threads:on` so it's single threaded I assume
14:48:15dom96jumps like it wants?
14:49:32FromGitter<tim-st> seems but maybe it's only console output buffered in incorrect order
14:51:05dom96I'm not sure how familiar you are with async semantics
14:51:16dom96but any time you have an 'await' your are effectively pausing your proc
14:51:25dom96so execution can come back in other async procedures
14:51:32dom96*you
14:51:55FromGitter<tim-st> ok, so I need locking? but on windows it works
14:52:13FromGitter<tim-st> I assumed this is only needed when using threads
14:52:19dom96You don't need locking
14:52:59FromGitter<tim-st> I have a filestream open the position is always changed by procs but on windows everything works :(
14:55:25FromGitter<tim-st> when all async procs work on the same filestream and come back like they want locking is not needed?
14:56:22FromGitter<bung87> you have a reader on outter scope
14:56:32FromGitter<tim-st> yes
14:57:05FromGitter<tim-st> I assumed `await` make the proc call to a atomar operation
14:57:16FromGitter<bung87> the async await things makes you dont make sure the order but just get result
14:57:54dom96Locking is only needed for parallelism
14:58:00FromGitter<bung87> so you request and get result that's it
14:58:18FromGitter<tim-st> so it should work the same on windows and linux?
14:58:22dom96Unless you're doing something really strange, but I can't even imagine what that could be so that's unlikely
14:58:33dom96In theory, yes
14:58:54FromGitter<tim-st> Is my assumption correct that `await` makes the proc an "atomar operation"
14:58:54dom96The semantics should be the same, so this is perhaps a bug
14:58:59FromGitter<bung87> if there is order ,it 's some thing like `await request1(); await request2()`
14:59:03dom96atomar? You mean "atomic"?
14:59:20FromGitter<tim-st> yeah that was german :\
14:59:57dom96if the proc has 'await' inside it then no, it's not atomic
15:00:53FromGitter<tim-st> hm, then I probably need locking :(
15:02:18FromGitter<bung87> yes , in your case whether using threading you needs lock or let proc handle partial content.
15:02:46dom96What are you doing in a proc that means it needs to be atomic?
15:03:28FromGitter<tim-st> It sets the filestream position, the position must be unchanged for the complete proc body, after the proc is finished it's not relevant where the stream position is
15:03:50FromGitter<bung87> it using async request but using same file reader at outter scope.
15:04:11FromGitter<tim-st> https://github.com/tim-st/nim-zim/blob/febda9158af29e7ebd13eb1b5a7474840b9cfeaf/zim.nim#L386
15:04:52FromGitter<tim-st> when I used the main proc around it worked without threadvar
15:05:02dom96lol, can you link me to where it's reading instead of "when isMainModule"?
15:05:45FromGitter<tim-st> at different positions https://github.com/tim-st/nim-zim/blob/febda9158af29e7ebd13eb1b5a7474840b9cfeaf/zim.nim#L212
15:06:28FromGitter<tim-st> https://github.com/tim-st/nim-zim/blob/febda9158af29e7ebd13eb1b5a7474840b9cfeaf/zim.nim#L452
15:06:31*leorize quit (Ping timeout: 246 seconds)
15:06:43dom96This isn't an async proc though
15:07:06FromGitter<tim-st> the second one is
15:07:12dom96Debug this extensively instead of guessing
15:07:16dom96I doubt you need locks
15:07:24dom96The second one doesn't set the file pos
15:07:42FromGitter<tim-st> I have a vm running extensively debugging is not that easy
15:08:34dom96Okay, that's fair. You might find it easier to ssh into the VM
15:11:00FromGitter<tim-st> ok, will try
15:11:02*leorize joined #nim
15:11:21dom96In any case, all your `setPos`'s are in synchronous procs so it shouldn't be a problem
15:12:42dom96On the other hand, based on how Linux async differs to Windows async it does make sense that this would be the problem
15:13:25dom96On linux a check is made to see if the file is readable, and once it becomes readable the file is read
15:13:44dom96on Windows a request to read is made, and once it's complete you get the data back
15:14:02dom96so there is no opportunity for the file position to change on Windows
15:16:39FromGitter<tim-st> The problem would be if it changes after a complete read and before the next read which is still inside the proc, I debug the stream positions to see if that's the problem
15:30:24FromGitter<tim-st> dom96: thanks for your help I think now it's not related to `async` because it behave the same with the deprectated non async `httpserver`, it's intersting that it behaves different on windows and linux...
15:40:07*edcragg quit (Quit: ZNC - http://znc.in)
15:40:36*edcragg joined #nim
15:53:54*Perkol joined #nim
16:01:20*Perkol quit (Quit: Leaving)
16:02:25FromGitter<Bennyelg> what is the different between proc and func
16:02:31FromGitter<Bennyelg> keyword
16:03:49dom96func is proc + {.noSideEffect.}
16:04:04FromGitter<Bennyelg> thanks
16:04:11dom96i.e. a procedure with no side effects
16:05:18FromGitter<Bennyelg> any procedure which not receive var argument is by nature without side effects
16:05:21FromGitter<Bennyelg> am I correct?
16:06:42dom96there is more to it, you can't access global vars for example
16:07:01dom96also I'm not sure 'var' args count
16:08:00FromGitter<Bennyelg> If I'll try I'll get compiler error?
16:08:06dom96yes
16:08:09FromGitter<Bennyelg> cool
16:17:58*zachcarter quit (Ping timeout: 244 seconds)
16:20:40*zachcarter joined #nim
16:56:23*martinium joined #nim
17:26:22*krux02 joined #nim
17:36:20*stefanos82 quit (Quit: Quitting for now...)
18:00:14FromGitter<tim-st> found the bug... `cmp` doesnt work the same on windows and linux
18:00:43FromGitter<tim-st> on windows result is in [-1,0,1] on linux it return [-int,0,+int]
18:01:02FromGitter<tim-st> where int is some value
18:02:03FromGitter<Araq> doesn't seem likely but 'cmp' returns < 0, == 0, > 0, and the docs say that.
18:02:41FromGitter<Araq> I mean it doesn't seem likely that the values are OS dependent
18:03:34FromGitter<tim-st> @Araq yeah, I just read the docs, I knew the proc from java where it's always in -1,0,1
18:03:43FromGitter<tim-st> I think it's different on different types
18:03:46FromGitter<tim-st> on linux
18:05:35FromGitter<tim-st> for char it's in -1,0,1 for string it returns random values (length diff?)
18:07:32FromGitter<Araq> if it were -1, 0, 1 'cmp' would return an enum
18:07:55FromGitter<Araq> it doesn't because being lax about these values allows for certain optimizations
18:11:08FromGitter<tim-st> but still when the docs say the value is <0 or >0 I would assume the same values are returnt on windows and linux
18:11:35FromGitter<Araq> yeah and they are, afaict
18:11:57FromGitter<tim-st> no, otherwise my program would have worked
18:12:08FromGitter<tim-st> but I will try on windows now
18:13:18FromGitter<tim-st> windows: -1 for `echo cmp("abc", "äbc")`
18:14:00FromGitter<tim-st> linux: -98
18:17:28FromGitter<tim-st> is it a bug?
18:19:34FromGitter<Araq> http://www.cplusplus.com/reference/cstring/memcmp/ well we use memcmp. apparently it produces platform dependent values
18:20:41FromGitter<kayabaNerve> Anyone here know why {.pure.} was removed?
18:20:57FromGitter<kayabaNerve> I'd love to force scoping enums...
18:24:11FromGitter<Araq> yeah, I removed it because it sucked big time
18:24:26FromGitter<Araq> my rationale is in some github issue
18:26:33FromGitter<Araq> if you want to treat the users of your libraries like little children, give your enum fields annoying overly long names instead
18:27:01federico3urgh
18:34:00*avsej quit (Ping timeout: 252 seconds)
18:34:50*avsej joined #nim
18:34:51*avsej quit (Changing host)
18:34:51*avsej joined #nim
18:38:44FromGitter<tim-st> so should I open an issue?
18:38:58FromGitter<tim-st> I assume the same happens for seq[T]
18:40:05shashlickneed some help - can someone help me define a pegs expression for `File "C:\Temp\snip-1536518313.677777\test.py", line 1, in <module>` - I want to pull out the line number
18:41:10*SenasOzys joined #nim
18:41:23shashlickhere's what I have and it doesn't work - `' File "'[\\/\.\:\-a-zA-Z0-9_]+'test.py", line '{\d+}[ .]+`
18:51:50dom96tim-st: wow, that's an interesting cause
18:54:34*captainkraft quit (Ping timeout: 240 seconds)
18:55:07dom96shashlick: Wouldn't it be easier to just use strutils.find("line ")?
18:55:31dom96or better yet "\", line "
18:56:01shashlickya trying to find exact error lines across multiple langages
18:56:04shashlicklet me try
18:57:11FromGitter<tim-st> dom96: yes, I even read into Endianess and developed some code, but then I saw it was the same on windows and linux at compile time and only "PocketPC" has big endian
18:58:16dom96tim-st: I'd say it's something we can fix so yeah, create an issue
18:59:06FromGitter<tim-st> ok, also think it would be better otherwise it's not crossplatform
18:59:34shashlickdom96: pegs =~ has to match from start of string? cannot match partial
19:03:56FromGitter<kayabaNerve> @Araq My reasoning is because I name my enum values after objects.
19:04:07FromGitter<kayabaNerve> So it's not an access issue. It's a scope issue.
19:04:20*skrylar joined #nim
19:04:30FromGitter<kayabaNerve> Anyways. It's still in the pure.
19:04:33FromGitter<tim-st> dom96: it works now on linux too, now I can look for what I wanted to look the memory leaking issues :D
19:10:08FromGitter<tim-st> it's the very same memory increasement on linux :(
19:17:05*seni joined #nim
19:35:46*kapil___ quit (Quit: Connection closed for inactivity)
19:38:57*captainkraft joined #nim
19:44:01FromGitter<codenoid> morning nimmer
19:44:13FromGitter<Bennyelg> 22:44 night here
19:44:16FromGitter<Bennyelg> but good morning
19:44:43FromGitter<codenoid> 02:44
19:52:04*Trustable quit (Remote host closed the connection)
20:00:34FromDiscord<ethanpmorgan> Feel like I should get back into Nim. I didn't buy Nim in Action for nothing
20:04:39*nsf joined #nim
20:13:00FromGitter<tim-st> I now compiled with `gc:none` and it leaks much more more but on a similar increasement curve like with gc
21:03:10*Jesin joined #nim
21:04:44*NimBot joined #nim
21:04:46*Vladar quit (Remote host closed the connection)
21:09:50*nsf quit (Quit: WeeChat 2.2)
21:11:14*Pisuke quit (Excess Flood)
21:12:44*Pisuke joined #nim
21:51:13krux02tim-st: how do you allocate the memory that leaks?
22:01:43dom96He's trying to figure out why 'async' leaks
22:03:40*smt joined #nim
22:13:58*martinium quit (Quit: Leaving)
22:17:48zestyrI'd love to find out as well. Sending a 30MB file with a AsyncHttpClient peaks at 460 MB memory and drops down to 297, while the same code using HttpClient peaks at 200 MB and drops down to less than 1 MB.
22:25:27krux02have you tried valgrind yet?
22:26:43zestyryeah I tried valgrind in many ways, including with koch
22:27:20zestyrcan't get any useful results
23:10:03*SenasOzys quit (Ping timeout: 245 seconds)
23:11:37*cspar quit (Ping timeout: 246 seconds)
23:13:15*druonysus quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
23:13:35*druonysus joined #nim
23:13:35*druonysus quit (Changing host)
23:13:35*druonysus joined #nim
23:23:12*gangstacat quit (Ping timeout: 252 seconds)
23:32:03*xet7 quit (Quit: Leaving)
23:37:59FromGitter<bung87> how to achieve this? `schedule.every 3.seconds do:`
23:41:39*skrylar quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
23:46:24*cspar joined #nim
23:50:56*gangstacat joined #nim