<< 31-05-2015 >>

00:16:12*boop is now known as boopisaway
00:25:43vikatonanyone here good with the Windows API ?
00:25:56Varriountvikaton: I have a decent amount of experience.
00:25:58vikatonbecause I need a better alternative than GetAsyncKeyState
00:26:16vikatonVarriount: I need to user a low-level keyboard hook
00:26:22Varriountvikaton: In fact, I'm currently writing up a web scraper to collect the Windows API from MSDN
00:27:02vikatonnice
00:27:21vikatonanyhow, this is the only thing I can find related to my issue in the windows module, http://nim-lang.org/docs/windows.html#WH_KEYBOARD
00:27:29vikatonnot rly that helpful
00:27:36Varriountvikaton: You've tried looking throught the list of functions here: https://msdn.microsoft.com/en-us/library/windows/desktop/ff468859.aspx ?
00:27:45Varriountvikaton: What's wrong with getAsyncKeyState?
00:27:48*rgv151 joined #nim
00:28:17vikatonVarriount: have you ever ran a program "as an adminstrator" ?
00:28:26VarriountYes...
00:29:00vikatonwell GetAsyncKeyState does not GetAsyncKeyState in that state of confirming to run as admin
00:29:02Varriountvikaton: You won't be able to intercept ctrl+alt+delete sequences without writing a device driver.
00:30:39*johnsoft quit (Ping timeout: 245 seconds)
00:30:49vikatonVarriount: It doesnt log keys when this shows up: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQNPYHGi-k3JrgopGpI2FKykFWQ_si0Izx0Su7cE6FwWLbgsMMVw
00:31:27*johnsoft joined #nim
00:31:36Varriountvikaton: Uh, that's a security measure.
00:31:50vikatonexactly
00:32:10Varriountvikaton: This page may be of some explanation: http://stackoverflow.com/questions/15898769/how-to-receive-keyboard-input-from-application-with-admin-privileges-to-a-non-ad?rq=1
00:32:21*rgv151 quit (Ping timeout: 250 seconds)
00:33:47vikatonfor some reason idk if we are on the same page
00:34:07vikatonVarriount: the program executes and works fine without admin privledges
00:34:38Varriountvikaton: Your program is unable to get input from 'elevated' programs, such as the User Account Control prompt, the Ctrl+Alt+Delete prompt, etc.
00:34:56vikatonok yeah we are on the same page
00:35:10vikatonVarriount: would low level hooks work or nah?
00:35:16Varriountvikaton: As I said, that's a security measure, and one that is non-trivial to circumvent.
00:35:50Varriount"As for interacting with elevated programs, I think the only solution, and I believe the one TeamSpeak uses, is to embed an application manifest that sets uiAccess=true. This allows you to bypass UIPI without needing to run the application as administrator."
00:35:53vikatonoh damn
00:37:43Varriountvikaton: See the 'uiAccess Values' section here - https://msdn.microsoft.com/en-us/library/bb756929.aspx
00:38:53Varriountvikaton: Despite what *nix advocates might want to believe, the Windows development team isn't *entirely* stupid
00:39:06vikatonlol
00:40:07Varriountvikaton: As to how to go about authenticode signing and such... It would probably be easier to use visual studio and it's bundled tools to do that.
00:54:35*gsingh93 joined #nim
01:11:41*Xtopherus` is now known as Xtopherus
01:16:34*Xtopherus is now known as banister
01:29:25*rgv151 joined #nim
01:34:01*rgv151 quit (Ping timeout: 264 seconds)
01:37:05IronYI dont think the windows develops are stupid
01:37:13IronYbut with having to cater so much to legacy software
01:37:23IronYand not being able to make cruicial breaking changes
01:37:25IronYwell
01:37:26IronYwindows
01:41:18onionhammerVarriount checking in.. whats up?
01:41:41Varriountonionhammer: I'm trying to get Sublime Text 3 working with the plugin... and failing T_T
01:41:55onionhammer:\\
01:41:59VarriountIt will only load the settings file if the plugins are in a zipped package.
01:42:25VarriountAnd reloading settings on setting file change won't work, for some unknown reason.
01:43:05onionhammerhuh.. i havent run into that using st3
01:43:19Varriountonionhammer: What OS are you using?
01:43:24onionhammeros x
01:43:34VarriountHm. I'm using Windows.
01:43:56Varriountonionhammer: Anyway, it just needs testing and fixing.
01:43:56onionhammeri have st2 on my win box, and st3 on my work laptop(windows)
02:00:09*vendethiel quit (Ping timeout: 265 seconds)
02:01:38ozraYo, Varriount - I pushed a "convert..." of the syntax file, I had missed that on the call syntax.
02:01:54ozrapushed as in PRed ;)
02:04:20Varriountozra: Thanks. I'll look over it in a bit.
02:04:30VarriountI'm hands deep in data exporting code.
02:05:21ozraCool :)
02:05:48Varriountozra: I wonder how large msdn is...
02:06:02*ddl_smurf joined #nim
02:06:06ozraWooooa, don't even dare to think that I don't wanna know, haha
02:06:37ozraLuckily yeeears since I had to reference it :)
02:06:58ozraI saw you were working on a scraper for it?
02:09:33*vendethiel joined #nim
02:18:09Varriountozra: Yeah.
02:18:39Varriountozra: The current windows modules is both incomplete and unreliable. c2nim is a good tool, but it would be a pain to feed the entire windows sdk through it.
02:18:41ozraWhat's the intention? Just collecting it in an orderly fashion for easier reference?
02:18:53ozraAha, auto gen interfaces?
02:18:59VarriountSomething like that.
02:19:07ozraSuper cool!
02:19:14VarriountIf nothing else, it's a good way for me to learn xpath
02:19:25ozra(Not that I use windows - but I hear some people do ;-)
02:19:41Varriountozra: Someone has to develop software for it.
02:19:44ozraxpath - nim-mod?
02:20:15Varriountozra: It's a query language for xml/html documents. I'm using a python libary to scrape things.
02:20:57ozraI was aware of that - just wondering if there was a nim for it. Alright.
02:47:26reactormonkozra, no need to reference other issues, github inserts if you mention them in others - kinda
02:50:34*ozra quit (Ping timeout: 246 seconds)
02:55:58*gsingh93 quit (Ping timeout: 272 seconds)
02:56:51*darkf joined #nim
03:01:08*dtscode is now known as hit1er
03:01:17*hit1er is now known as dtscode
03:05:22*dtscode is now known as charmander
03:08:26*charmander is now known as cheraphy
03:09:03*cheraphy quit (Disconnected by services)
03:09:29*dtscode joined #nim
03:21:45*gsingh93 joined #nim
03:29:41*Jesin quit (Quit: Leaving)
03:31:08*rgv151 joined #nim
03:36:07*rgv151 quit (Ping timeout: 264 seconds)
03:40:32*vendethiel quit (Ping timeout: 258 seconds)
03:49:42*vendethiel joined #nim
03:53:34*kumul quit (Ping timeout: 258 seconds)
04:06:15*gsingh93 quit (Ping timeout: 252 seconds)
04:22:18*endragor joined #nim
04:24:13*pregressive joined #nim
04:28:13*darkf quit (Read error: Connection reset by peer)
04:29:01*darkf joined #nim
04:32:08*rgv151 joined #nim
04:32:45*endragor quit (Remote host closed the connection)
04:35:08*endragor joined #nim
04:35:59*endragor quit (Remote host closed the connection)
04:36:22*endragor joined #nim
04:36:30*rgv151 quit (Ping timeout: 258 seconds)
04:36:46*Kingsqueee joined #nim
04:40:07*endragor quit (Remote host closed the connection)
04:42:32*kumul joined #nim
04:42:59*endragor joined #nim
04:43:51*endragor quit (Remote host closed the connection)
04:51:40*endragor joined #nim
04:52:01*BitPuffin|osx quit (Ping timeout: 272 seconds)
04:52:30*endragor quit (Remote host closed the connection)
04:57:14*ddl_smurf quit (Quit: ddl_smurf)
04:58:34*endragor joined #nim
04:59:26*endragor quit (Remote host closed the connection)
05:03:11*Kingsqueee quit (Quit: Konversation terminated!)
05:03:59*endragor joined #nim
05:04:53*endragor quit (Remote host closed the connection)
05:20:57*vendethiel quit (Ping timeout: 250 seconds)
05:41:25*kumul quit (Ping timeout: 272 seconds)
06:03:50*Demon_Fox joined #nim
06:25:29*solidsnack joined #nim
06:26:53*saml_ quit (Quit: Leaving)
06:41:35*strcmp1 quit (Ping timeout: 272 seconds)
06:43:35*Mat4 joined #nim
06:44:09*Mat4 quit (Client Quit)
06:53:27*Jesin joined #nim
06:59:52*ddl_smurf joined #nim
07:00:01*ddl_smurf quit (Client Quit)
07:04:26*intra joined #nim
07:15:24*vendethiel joined #nim
07:16:32*endragor joined #nim
07:17:27*endragor quit (Remote host closed the connection)
07:19:14*jubalh joined #nim
07:28:04*BlaXpirit joined #nim
07:43:37*Demon_Fox quit (Quit: Leaving)
07:46:51*mischanix left #nim (#nim)
07:48:23*mAch17 joined #nim
07:54:11*strcmp1 joined #nim
07:55:05*mAch17 quit (Quit: Leaving)
07:56:10*solidsnack quit (Ping timeout: 272 seconds)
08:01:45*gmpreussner|work quit (Read error: Connection reset by peer)
08:08:05*jubalh quit (Quit: Leaving)
08:09:15*dtscode quit (Quit: what a weird night)
08:11:27*dashed joined #nim
08:15:27*sepisoad joined #nim
08:21:45*ozra joined #nim
08:26:25*solidsnack joined #nim
08:46:21*vendethiel quit (Ping timeout: 250 seconds)
08:50:40*johnsoft quit (Ping timeout: 255 seconds)
08:52:44*johnsoft joined #nim
08:57:58*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:02:04*milosn quit (Read error: Connection reset by peer)
09:02:16*milosn joined #nim
09:04:10*sepisoad quit (Quit: Leaving)
09:05:51VarriountAraq: The crawler is working. The files it outputs are (nearly) c2nim compatible - I'm leaving in the annotations.
09:07:54VarriountThey're even sorted by what dll's they reside in.
09:24:46*TEttinger quit (Ping timeout: 258 seconds)
09:27:46ozraVarriount: cool to here. :)
09:27:52ozra*hear*
09:29:51*ddl_smurf joined #nim
09:30:01*ddl_smurf quit (Client Quit)
09:33:24Varriountozra: I'm particularly proud of the enum translator
09:34:01ozraMay I ask, where do you live Varriount ?
09:34:13Varriountozra: Virginia.
09:34:19Varriount(In the US)
09:35:02ozraSuspected the US version (don't know any other ;-) Yeah, I was surprised to see you "so soon" so I figured you had other hours :)
09:35:31Varriountozra: My sleep schedule got wrecked yesterday. I spent all night/morning working on this crawler.
09:36:05VarriountSo I woke up at something like 5PM
09:36:43*solidsnack quit (Ping timeout: 264 seconds)
09:37:48ozraAh, ok. I've had horrid sleep cycles (since I was in the womb according to dear mom). Tonight I slept 3h. Sometimes I don't sleep for three days. But now I'm on a good streak - it's been three weeks without missing a nights sleep :-) Slept aroun 4h every night, at least :-)
09:38:32ozraAh, well, except for a few with only three, now that I think about it..
09:38:38VarriountO_o
09:40:24*Arrrr joined #nim
09:40:26ozraNice to hear it progressing so nicely man. Do you happen to know the right practise of "peeking" on a token inthe parser?
09:40:42Varriountozra: You mean, in the Nim parser?
09:40:52ozraVarriount: Ah, yeah
09:41:00VarriountNo idea.
09:41:10VarriountWhat are you trying to do?
09:41:12ozraAlright, I'll keep hopping around the source
09:41:51Varriountozra: The parser is pretty self contained.
09:42:43ozraYeah, its clean, haven't really figured out the 'responisibility distribution', it's a bit ad hoc, so, it's best to just read it all I guess :-)
09:43:17Varriountozra: Well, the parser is clean. The rest of the compiler code... needs work, at least as far as documentation goes.
09:44:16ozraI'm working my way outwards. Began with some fixes in the lexer. Now I'm on to the parser. I guess it's at ast-mangling / rewriting it gets nasty?
09:44:36Varriountozra: Yes. And Lambda Lifting.
09:44:55VarriountLambda lifting... if like staring into the void.
09:44:59Varriount*is like
09:45:09ozraI imagine. Will be interesting...
09:46:42ozraHey, btw, the "goto definition" in NimLime. It worked for a while, but now it's grey. Anything to it? Or maybe it's some problem with me having a symlink to my local repo I cloned from you (before, it was installed via pkg mgr)
09:47:07Varriountozra: No idea. I didn't write that code, nor have I touched it.
09:47:41Varriountozra: I wrote the check, document comment, and language files, mainly.
09:47:59ozraAh, ok. Where did you find it?
09:48:05Varriountozra: If you're using the unstable version from the repository, I've also rewritten the Nimble interface.
09:48:25Varriountozra: onionhammer wrote the documentation and nimsuggest code.
09:49:24VarriountTo be honest, it's a huge work-in-progress right now. I've been making large refactorings, and have done about 1/2 of the existing code base so far.
09:49:27ozraVarriount: Aha, it does use nimsuggest, ok cool. Was just wondering if it was some ad-hoc solution or using that, more 'forward compatible' solution..
09:50:17ozraVarriount: Alright. Great job. Love it. And sublime. I wouldn't have found that editor if I hadn't looked for nim syntax highligthing and found NimLime! :-D
09:50:23Varriount:D
09:53:10*vendethiel joined #nim
09:53:14Varriountozra: My favorite feature is multi-cursor support.
09:54:10*Matthias247 joined #nim
10:05:17ozraVarriount: was out smoking and taking the dog for a piss, had a streak of sun shine in a otherwise cloudy day. Yeah, that multi cursor thing - I thought it was a bug first, haha. I haven't looked at its purpose. What for?
10:06:03Varriountozra: General usefulness. You can select multiple occurences of a word, edit multiple lines of similar structure, etc.
10:06:57ozraThere are lots of great features yet to learn. I like that. It's already enormously useful :-)
10:07:43ozraReminds me. This "magic quotes and brackets insertion" is killing me. Didn't find a setting for it?
10:08:43Varriountozra: You mean, selecting something and typing a quote/brace/bracket, and having it put them on either side of the selection?
10:09:49ozrayeah. but I googled now. "auto_match_enabled": false. great. didn't find yesterday. bad google day I guess ;)
10:10:28fowlMorning all
10:10:36ozraMorning!
10:11:04ozrafowl: do you know the "right way" of peeking a token in the parser?
10:12:36fowlHmm no
10:13:21ozraalright
10:18:45Varriountozra: If you give me a min, I can try looking
10:19:05VarriountI found a bug in my xpath code which made the crawler skip all the structs. :<
10:19:17ozraOk. Ayay.
10:19:20*bluenote_ joined #nim
10:20:38ozraI'm making a call to `exprList()`, and it calls getTok first thing. The thing is, before that I need to see if an _optional_ token is there, which I need to call getTok for. And if it's not there - a token ends up being skipped...
10:21:09ozraadding a 'tokenFetched' bool to params is last resort..
10:22:28ozraMaybe I should refactor it. It breaks the pattern of the parser. Most procs call getTok() after their handling, leaving a fresh tok for the next bugger. exprList() reverses the pattern :-/
10:23:37*ddl_smurf joined #nim
10:24:46ozraNah, it's not that consistant.. I'll have to print it out and study it over coffee. Focus on your crawler Varriount :-)
10:24:55*johnsoft quit (Ping timeout: 256 seconds)
10:25:52*johnsoft joined #nim
10:31:10*banister joined #nim
10:41:46*endragor joined #nim
10:42:32*jubalh joined #nim
10:48:30*endragor quit (Remote host closed the connection)
10:49:49*endragor joined #nim
10:53:06*Trustable joined #nim
10:53:32*Trustable quit (Remote host closed the connection)
10:54:15*Trustable joined #nim
10:56:30*endragor quit (Remote host closed the connection)
11:12:46*jaco60 joined #nim
11:13:46Varriountozra: If nothing else, additional documentation on the compiler internals would be much appreciated.
11:19:11jaco60hi... is there a way to ask for the CPU "native" operand size for int ?
11:19:53Varriountjaco60: Could you rephrase your question? I'm not sure I understand.
11:20:14def-jaco60: sizeof(int)?
11:21:06VarriountNim's ints are always the size of a pointer for the architecture the program is compiled on.
11:22:05jaco60Ok : afaik, the size of a int is the size of a pointer (64 bits on my Core i7). But, on the i7, operand size are 32 bits. If i'm using "int" for my computing tasks, the code will use 64 bits instead of 32 bits
11:22:19jaco60so, i'm using int32...
11:22:25VarriountUh.. where did you hear that?
11:22:55Varriountjaco60: At least in the context of assembly, there is no such thing as a 'native' operand size.
11:23:06Varriount(assembly language)
11:23:37jaco60for the very same code, switching for int to int32 divide the execution time by 2
11:24:14Varriountjaco60: Depends on the code. That doesn't mean that the native operand size (whatever that means) is 32-bit.
11:24:28jaco60http://en.wikipedia.org/wiki/X86-64#Intel_64
11:24:39*dashed quit (Quit: Connection closed for inactivity)
11:26:09Varriountjaco60: I see nothing on there stating that operations on 32-bit data types are inherently 'native' or faster.
11:27:14jaco60if the operand size is 32 bits, a 64 bit operation (say, add 2 int) will be slower, isn't it ?
11:28:51Varriountjaco60: Not necessarily. As I said, there are a great number of factors involved.
11:29:45VarriountIs the operand in a register? Has the operation been done speculatively?
11:31:03jaco60well, that's not rocket science but compare time exec of this trivial code with both int and int32...http://sprunge.us/iTTA
11:32:27jaco60http://sprunge.us/XAia, sorry
11:33:57Varriountjaco60: How are you actually testing speed?
11:34:20VarriountI don't see an import to the times module.
11:34:40jaco60i'm on Unix, so i do "time ./amis"
11:35:38jaco603.09sec for the int32 version, 9s for the int version...
11:36:03Varriountjaco60: Did you run with -d:release?
11:36:06jaco60yes
11:36:30jaco60and the same goes with gcc or clang
11:36:56jaco60with i32 version, i get the same times than in D or Rust
11:38:45Varriountjaco60: Unfortunately, the benchmark doesn't measure *just* integer optimizations. I see float conversion there, as well as loops.
11:39:49*Arrrr quit (Ping timeout: 245 seconds)
11:39:50VarriountIn this case, a guess (and only a guess) as to why the version using 32-bit integers is faster is because they cause less cache misses.
11:40:56jaco60but if register are 32 bits, you're agree that using 64 operands would be slower, no ?
11:41:14VarriountYes, however on a 64-bit system, the registers are 64-bits.
11:41:26jaco60Varriount, i'm not so sure
11:41:48def-jaco60: I'd guess that 64 bit int division is much slower, but haven't checked
11:42:40def-and there can also be cache effects which would help 32bits, but don't see that here
11:42:49ozrajaco60: I raised this issue here in the IRC a couple a days ago but got no response..
11:43:44Varriountozra: What day?
11:44:03ozraVarriount: jaco60: It's a complex scenario to say the least. But often, i32 is faster. i64 _can_ be faster in specific scenarios. But I'm wondering if "using int size of pointer size of platform" is really the smartest decision.
11:44:32ozraVarriount: I can't remember, sorry. Got no replies what soever, so there's not much to read.
11:45:10jaco60ozra, hence my initial question :)
11:45:14Varriountozra: I really wouldn't make any assumptions until a good series of benchmarks is made.
11:45:31ozraAlso in SIMD ops, more ops can be fit in registers, etc.
11:45:58def-if you know you want int32s, then use int32 explicitly
11:46:25ozraVarriount: jaco60: True. Measurements are important! It could be good to have, like in C/C++, a fastint type.. (fastest available int, all things considered)
11:46:54Varriountozra: There's such a type?
11:47:32ozradef-: _If_ there's a measurable great improvement on a bunch of different code I think int should be re-specified... Otherwise. Use int32 in perf. code..
11:47:59ozraVarriount: Yes, in C/C++? In stdlib, or somewhere, don't remember where it's defined.
11:48:18Varriountozra: At this point, changing the size of an integer would probably break most of the C/C++ wrappers
11:49:03ozraI can't imagine those being based on a datatype that has a different specification from any base datatype in C++?? Sounds unlikely!?
11:49:12*ingsoc joined #nim
11:49:20Varriountozra: Huh?
11:50:19ozraI imagine (haven't looked) that any inter mingling with C* must be done with specific width datatypes? Most C++ implementations on 64bit has 32bit int, for instance. The spec is not the same for C* int and Nim int.
11:50:24Varriountozra: The fact that sizeof(int) == sizeof(pointer) is used in some places. I know it's used in the Windows pointer.
11:50:34Varriount*Windows module
11:51:02ozraWooot? Sounds weird to me. Like it's begging to break. What am I missing here?
11:51:13VarriountWhen doing things like declaring types.
11:51:47ozraShit. That doesn't sound good to me. I was hoping there wasn't such a relationship behind the int spec! :-(
11:51:58fowlwhen we use dlls we rely on ABI compatibility
11:52:11fowlwhen use headers we rely on source level compatibility
11:52:26ozrafowl: elaborate?
11:52:29VarriountAnyway, if we're going to go with anecdotal evidence, I'd like to point out that Nim compiles/runs faster when compiled for 64-bit, vs 32-bit, on my machine.
11:53:16fowlozra, i got a pointer to some struct from a dll, to read info from it i better use the right offsets into the struct
11:53:20jaco60Varriount, but on my machine, i'm compiling in 64 bits... The fact is the i32 operands are much more fast
11:53:37jaco60the exec is a 64 bits exec...
11:53:40Varriountjaco60: *In your situation*
11:53:41flaviuHave you run it in a profiler?
11:53:53ozraVarriount: I don't doubt it runs faster using 64-bit instruction set. We're talking size of a specific datatype - that doesn't necessarily translate to being the width of the architecture. The main idea behind 64-bit was to be able to adress more memory.
11:53:56def-ozra: I like the simplicity of an int being pointer size
11:54:11jaco60Varriount, on your machine, my code run faster with int rather than int32 ?
11:54:14fowlozra, on the other hand, if my struct is imported from some header and the real int type is long and i use int32, probably be fine because the c compiler knows that in the header it should be type X
11:54:26Varriountjaco60: I can't time it on my machine at the moment.
11:54:49jaco60it's mesurable just by running it :)
11:54:54jaco60no need for any tool
11:55:06jaco609 sec compared to 3 sec is sensible
11:55:29ozradef-: I don't see the simplicity in it. Other than that _if_ you cast ints and pointers back and forth their compatible. But that's a no no. And _when_ you do evil, there should be an ptrWidthInt type or the like - it should not be seen as intrinsic. Madness!
11:56:15fowleh?
11:56:18ozraYou posted code? I'll try it..
11:56:25fowlsimply put "int" and "float" dont belong in wrappers
11:56:34jaco60ozra, http://sprunge.us/XAia
11:56:49jaco60just swap from int to int32 for MyInt
11:56:55ozraGot it. Looks very micro-benchmarky though ;-)
11:57:14ozrafowl: Agree.
11:57:27*ARCADIVS quit (Quit: ARCADIVS)
11:58:16jaco60ozra, my intention was not to benchmark but to learn Nim by implementing some algos to compare with other languages
11:59:17ozrajaco60: I understand, just saying, in a more complex program, the bench could turn out quite differently..
12:00:08*Varriount goes and installs KCacheGrind for Windows
12:00:20*MyMind joined #nim
12:00:43Varriountozra, jaco60: If I sound irritated, it's because I don't like not having a clear answer.
12:01:42flaviuhm, this is interesting. It's possible to see pipelining in the profiler
12:01:49ozraVarriount: Didn't perceive that. Clear answer to what?
12:01:56*Sembei quit (Ping timeout: 258 seconds)
12:02:39Varriountozra: Why the two types behave so differently.
12:02:46def-jaco60: ok, i checked and it's just the div/mod that's much faster with smaller int types. everything else is the same speed on my machine
12:03:28Varriountdef-: How did you find out? (I haven't used any C/C++ profilers before...)
12:03:43VarriountI'd like to see how Windows compares.
12:03:52*Arrrr joined #nim
12:04:29def-Varriount: i just converted the int64s to int32 before doing mod and div
12:04:39ozraVarriount: 1. How the processor is constructed, if they decide to optimize for int32 because it's most common, then that will be faster, for instance (and "re-writing" hardware is a bit slower iteration ;-). 2. cache-line hits/misses. 3. amount fittable in registers. etc. etc.
12:05:05flaviuThe expensive part is definitely the division.
12:07:35ozraOk. I ran that micro-bench a couple of times on my 64bit Ubuntu. Took the geometric mean (fairest mean for bench times imo), and the results are: int32: 6s, in64: 12.5s - _more_ than twice as slow.
12:07:40Varriountflaviu: A look at this is interesting.. http://www.agner.org/optimize/instruction_tables.pdf
12:07:42flaviuThe sign extension also doesn't seem to be cheap.
12:08:44ozraflaviu: unsigned is often slower in real world code in my experience. C compilers has spec that they should do overflow checks on unsigned. But not on signed.
12:09:07flaviuozra: unsigned is faster here.
12:09:21ozraflaviu: cool. Good to know.
12:10:11ozraI'll see if it's possible to re-compile the compiler with int32 - just for kicks. To get a more "real world" scenario benchmark... Might not be possible though..
12:11:25Varriountozra: Iterestingly enough, that table states that the number of clock cycles the i7 takes for div/idiv instructions using 64-bit registers is variable... and depends on the number.
12:13:05ozraYes, ofc. And when we're down at the clock cycle level, other things are more important: pipe lining and cached vs not cached data
12:14:10ozraVarriount: a bsic optimization in hardware is to have fast machinery for counting leading zero bits in mem cells, this helps it reduce bit fiddling iterations in calculations..
12:14:31flaviuThe unsigned version emits a div instead of idiv. I wonder what the difference is.
12:14:39Varriountozra: Huh. I'm learning all sorts of new things today. :D
12:14:58ozraThe grat thing about being awake ;-)
12:15:04*xcombelle joined #nim
12:15:07flaviuAh, unsigned vs signed.
12:15:13jaco60if i change MyInt to an unsigned int, i get compile error :'
12:15:13ozraflaviu: LOL
12:15:28def-jaco60: import unsigned
12:15:47flaviuSo unsigned division is approx. 50% faster than signed division :O
12:15:52jaco60Ach !
12:16:23ozrajaco60: unsigned is 'not recommended' by Nim.. hence the import. It recommends using "positive" datatype instead. I agree with much of the reasoning.
12:16:57ozraI'll modify the bench and re-run. It is sooo uncommon to do int divs..
12:17:23Varriountozra: Thankfully?
12:17:49Varriountozra: I still don't like the idea of changing the size of the 'int' data type
12:18:18VarriountAlthough, I wonder what Araq's motivation for the decision was.
12:19:11BlaXpiritit's the only thing that makes sense -_-
12:19:11ozraVarriount: yes, thankfully. I mean, ints are basically used for iteration and indexing. Hence, _mostly_, add, sub and mul. That's what should be benched. I can imagine CPU designers don't give a shit about optimizing int-div...
12:19:58ozraAnd for Decimal types (where exact precision of for instance 0.1, 0.2 etc. is needed [those numbers do not exist in float])
12:19:59*boopisaway is now known as boop
12:20:58ozraVarriount: I wonder too. I _hope not_ for casting ints and pointers easily.
12:21:03*gokr joined #nim
12:21:24ozraBlaXpirit: What do you mean?
12:21:36fowlIdk but when you ask him please write it in the FAQ
12:21:47fowlThese discussions come up every few months
12:22:05ozrafowl: Yeah, that's a good idea, inevitably again, yes, haha
12:23:48Varriountozra: Possibly for their range? Given that he's a proponent of signed types.
12:24:20*kumul joined #nim
12:24:43VarriountGiven that 64-bit integer on 32-bit systems would be much slower, but 32-bit integers on 64-bit systems would have a smaller range.
12:25:14ozraBut signed 32 bit is standard in most C compilers for instance. Its range is more than enough for most indexing and looping chores. When more is needed, one explicitly use a guaranteed minimum width datatype (like "atLeast64BitInt")
12:26:00Varriount*shrug*
12:26:29ozraThe 32 vs 64 becomes especially interesting if someone creates an array of int. Then it will have a real impact on cache-fitability and performance, regardless of micro-timings like pipelining, registers and the like. Cache is king.
12:27:16ozraVarriount: and if you run Nim on a 32 bit system, int is still 32 bit, so...
12:27:46Varriountozra: Feel free to put a case up for it. I don't really have too much of an opinion on the matter.
12:27:55ozraYou wouldn't rely on that for range capability. The reasoning must be something else.
12:28:26BlaXpiritdo you really not see it
12:28:36BlaXpiritit's just the processor's int
12:28:41ozraVarriount: The reason I haven't created an issue is that, before I've done real-word benchmarks, there's not a practical argument against it.
12:29:00VarriountBlaXpirit: The thing is, that argument doesn't make sense.
12:29:11BlaXpiritit's not an argument
12:29:13BlaXpiritit's the definition
12:30:06ozraBlaXpirit: There's no such thing as "the processors int". A 64 bit processor can adress with 64bit pointers, THAT is the point of 64 bit. That most ops and registers then are adapted and have 64bit sizes is a 'bonus' sort of. It doesn't make int64 "its datatype"!!!
12:30:23Varriount^
12:30:29*Jehan` joined #nim
12:30:47VarriountOh yay, Jehan` is here. And gokr
12:30:57Jehan`What did I do? :)
12:31:08ozraWoke up! Congratulations! ;)
12:31:27VarriountJehan`: Discussion for changing the size of Nim's 'int' data type to be always 32 bits
12:31:32Jehan`Well, I did that several hours ago … so it can't be that.
12:31:33*gokr quit (Remote host closed the connection)
12:31:37*gokr1 joined #nim
12:31:44Jehan`Varriount: Ugh. That's a complicated story.
12:32:00VarriountJehan`: I know! Isn't it wonderful!
12:32:07BlaXpiritare you sure it was *changed*?
12:32:11ozraVarriount: Jehan` Not "always 32". But speced differently. _iff_ needed. We don't have benchmarks to support it. It's more a question of validity.
12:32:12BlaXpiritand wasn't so all along?
12:32:12Jehan`You can make arguments for and against, but note that first of all, this would break a lot of stuff.
12:32:46Jehan`Quite a bit of the library depends on sizeof(ptr T) == sizeof(int).
12:33:09Jehan`You can also make an argument that the default should be 64-bit.
12:33:19ozraJehan`: I'm waiting for the bomb.. That it has to do with casting ptr <-> int. Please god no.
12:33:25*Varriount waits for ozra to have an apoplectic fit
12:33:40BlaXpiritthat's actually a big part of it
12:33:44Jehan`This is a performance hit for 32-bit architectures, of course, but it would reduce the risk of inadvertent overflows.
12:33:46ozraHahaha. All I want is what's best.
12:34:20Jehan`You can't do 100_000*100_000 in 32-bit, for example.
12:34:34VarriountJehan`: Well, apparently division and module arithmatic for 64-bit integer, on 64-bit architectures, is twice as slow as the same for 32-bit integers.
12:35:06ozraJehan`: The overflow issue is quite miniscule. When working on big data where big indexers and iteration vars are needed, one specifically use 64b< type. (like size_t in the "dreaded language") - remember, this is a systems language, for performance...
12:36:24VarriountJehan`: To play devils advocate, one could argue that the standard library could/should be updated to use the 'SomeInteger' typeclass
12:36:31Jehan`Varriount: Yes, but it has the advantage that on 64-bit, 100_000^2 is correct, while on 32-bit architectures, 100_000^2 == 1410065408.
12:36:41ozraAnd once again, integer division is so uncommon, it should not be used for judging, imo.
12:37:45Jehan`The problem here is really that int means "we like to pretend that precision is infinite but that the actual precision is good enough for our particular application".
12:38:57ozraSince on my machine, int div, as you said also, was _more_ than twice as slow. But the most common uses for ints are indexing and looping. And then add, sub and mul are the important ones. For most arithmetic, like your example Jehan` , one would use a float*. Unless something like your example was for an array, seq, matrix like stuff. And then itn that case it's really real _big data_.
12:38:57jaco60ozra, crypto make intensive use of integer division and modulo, afaik
12:38:57Jehan`In practice, we're subsuming several different concepts under the type "int".
12:39:25Jehan`From array indices to an approximation of natural numbers for simple numbertheoretic calculations.
12:39:33fowlIs there a module or package for benchmarking
12:39:50ozrajaco60: Yes, of course, there are specific cases of algos. I should clarify, I mean in _most_ common applications / solutions.
12:39:54Jehan`ozra: I wouldn't use float. Dear god, float is hell.
12:40:23Jehan`You use float when you (1) need it and (2) know exactly what you are doing.
12:40:34Jehan`Well, sometimes people use it for other stuff, but they deserve what they get.
12:40:40ozraJehan`: with float*, I mean float32|float64|float128. Ofcourse it has its problems, but it's better than dealing with fixed point like in the old days, argg.
12:40:42BlaXpiritmisunderstanding ensues
12:41:18Jehan`ozra: One of the problems is that you cannot check for overflow.
12:41:45Jehan`With fixed-size ints, you can at least get an error if things go wrong.
12:41:50def-fowl: maybe https://github.com/winksaville/nim-benchmark
12:42:05Jehan`But I'm probably the wrong person to ask here, anyway.
12:42:17fowldef-: thx
12:42:44Jehan`Please keep in mind that even though I may do a lot of stuff in Nim, its design goals are actually a mismatch for several of my needs.
12:42:47ozraJehan`: what? do you mean? There's overflow, underflow, etc..
12:43:09ozraBut then oftenly, it's _not used_..
12:43:14Jehan`ozra: FP overflow means your exponent got to big, not that you lost bits somewhere.
12:43:45ozraJehan`: loss of resolution, sort of?
12:44:25Jehan`ozra: With float64, 2^54 == 2^54+1.
12:45:04Jehan`I.e. in floating point land, == means "approximately equal", not "equal".
12:45:27Jehan`There are plenty of application domains where this is just not acceptable.
12:46:44ozraJehan`: Yeah I know (from coding Javascript and simulating int64's ;-) but as said, the alternative is fixed point. And then you'll have to use 128bits or so to be able to handle that number - if you want to handle a reasonable number of decimals. And you still cannot represent all numbers. I mean. It's just no way around it unless CPU's get a vaue-type made out of ratios..
12:47:02ozraBut it would still translate it to bit-operations somewhere along the line, and the res. would be lost..
12:48:12Jehan`ozra: Yeah, but the problem is that 2^31-1 is a pretty small number when you're using it to represent real-world entities. 2^63-1 is not.
12:48:21Jehan`It's not safe, but it is safer.
12:48:22ozraSure in f64 you can't represent 0.1 (or is it 0.2 [or both]) exactly. But you can't represent 1/3 correctly, and wouldn't think much about it. It's like a base10-is-god-habituation-fallacy..
12:48:37Jehan`Again, I need to stress that my personal bias is colored by my personal needs.
12:49:28*johnsoft quit (Ping timeout: 252 seconds)
12:49:44ozraJehan`: I still hold that integers are mostly used for indexing and looping. Arith in floaters... other uses would be exceptional cases. And _then_ you can be specific. I'm just saying the generic int should be for most common generic use.
12:50:01*johnsoft joined #nim
12:50:16Jehan`I am relatively unconcerned about the speed of the default settings, as long as you have the option to choose different ones for performance.
12:50:24ozraAnd, still, we don't know that int = ptr-size is bad. It's more of a question of "is it?". "For general performance"...
12:51:29Jehan`I'm sort of okay with int being the "native" size, because 64-bit ints on 32-bit machines can be a pretty nasty performance hit (especially on mobile).
12:51:49ozraJehan`: Well if one writes for a case where you really have to milk the cycles out of the machinery, than having code in i32 and calling library procs with i64 will cause a hell of a lot of datatype promotions. So, you are basically forced to use the "native" one.
12:51:57Jehan`I'm not so sure that I want to trade down from 64-bit on architectures that can handle it with little performance loss.
12:52:38*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:52:40fowlozra, same thing would happen in c but it would be implicit
12:53:09ozraAlt. is to reimplement dependencies. Ofc. you're completely right in your argument. Extreme performance apps are special cases too, and warrants extra care..
12:53:24ozrafowl: definitely.
12:53:38Jehan`ozra: Not sure what you are arguing for right now, to be honest. :)
12:55:01ozraSimply put: To benchmark i32 vs. i64. _If_ general code benefits largely from i32, I think int spec should be re-considered. That's about it :-) So I guess we can drop this now, haha.
12:55:34Jehan`ozra: So, i32 as the default int on 64-bit architectures, too?
12:55:45*Varriount ponders how terrifying a programmer with experience on a debate-team would be
12:56:06ozraJehan`: Exactly. Considering the big _iff_
12:56:31Jehan`ozra: Ah. I'd be personally opposed to it.
12:56:46*bluenote_ quit (Ping timeout: 246 seconds)
12:57:19ozraJehan`: The reasoning? Considering that you can't rely on int handling 100_000 * 100_100 for instance... (example)
12:57:51Jehan`ozra: Simple example would be that reading a file >= 2GB into a string would break.
12:58:11Jehan`And with -d:release, you'd get an immediate buffer overflow that may be exploitable.
12:58:17ozraJehan`: Then that breaks on 32bit machine. Unless you specify it as int64!
12:58:27Jehan`On a 32-bit machine, you run out of memory.
12:58:48ozraSo you're making dangareous assumptions.
12:59:22ozraJehan`: Out of a practical stand point, probably, but not necessarily. But you mean that you basically assume int is 64 bit, and ignore 32 bit platforms?
12:59:37Jehan`No, I'm dealing in probabilities, not absolutes. Plus, that was an example.
13:00:25*Siecje joined #nim
13:00:30Jehan`I think that as a matter of practical usefulness, the default int size should be able to express the size of in-memory structures.
13:00:47ozraYeah. Well, in any event, since I like the code to be deterministic, and you're good with probabilistic - we could round off now, and pick it up again, iff it actually becomes an issue ;-)
13:01:03ozraJehan`: That is a good notion though.
13:01:04Jehan`That's not what I'm saying, sigh.
13:01:22ozraJehan`: sorry. Your second statement made it clearer :)
13:02:23Jehan`Simply put, I *have* been bitten often enough by ints being 32-bit in C for this particular scenario (i.e. int being too short to handle large sizes) to not consider it a hypothetical.
13:03:43ozraJehan`: Ok. I see some parallels with yesterdays type discussions here, haha. I've never been bitten by range limits, but by type less ness. I think it is very fair to say that different people attract different computing errors B-)
13:04:06Varriountozra: You work with python at all?
13:04:09Jehan`ozra: I'm currently working on a machine with 500 GB of memory (64-core AMD Opteron).
13:04:15Jehan`2 GB is *nothing*.
13:04:49Jehan`And I expect these numbers to go up over the next decade.
13:05:30ozraVarriount: no, have never actually.. Though I coded a transpiler to C/C++ with pythonish syntax around 99/2000, so I obviously like the syntax :)
13:05:32*skyfex_____ joined #nim
13:05:56ozraVarriount: (and has rewritten many times since then.. but..) anyway. Nim is here to save us, haha
13:06:09Varriountozra: Python's integers automatically convert to bigints
13:07:12Jehan`Varriount: Same for Ruby and Smalltalk, by the way.
13:07:39ozraJehan`: I think I do suffer from a problem: My first computer had 16KB RAM, my second had 64KB RAM, such things probably etch a bit of "must save bytes" wiring in to the brain ;-) Though, as said, I like benching. But all in all. I'm starting to sway in my opinion. So thanks for discussing this a bit.
13:08:32Jehan`ozra: Oh, I can relate to that. My first computer was a ZX 81. I did a lot of programming on a ZX Spectrum with 48k of memory.
13:09:13ozraJehan`: It makes more sense taking all the different scenarios together. And: "future proofing" (64bit ops on the CPU is bound to be optimized more in the future) etc.
13:09:30ozraJehan`: A friend had a Spectrum, coded a bit on that too :)
13:09:45Jehan`ozra: In general, I like to point to the 90/10 rule when it comes to performance.
13:09:56VarriountWhat's the 90/10 rule?
13:10:00ozraWhat happened to 80/20?
13:10:01*banister joined #nim
13:10:02Jehan`I.e. 10% of the code accounts for 90% of the runtime.
13:10:19ozra;)
13:10:38Jehan`80/20 is too high for most code.
13:10:41Varriountozra: Huh. I know of 80/20 as a building material
13:11:18Jehan`So, there's the question whether you want to weigh down the majority of the code with design decisions made for optimization.
13:11:29Jehan`Or, pragmatically: Measure, THEN optimize.
13:11:42*johnsoft quit (Ping timeout: 272 seconds)
13:12:20*johnsoft joined #nim
13:12:30ozraVarriount: 80/20 is the paretos principle. Basically what said above, but regarding _anything_ (20% of customers gives 80% of income. (perhaps unrelated) 20% of customers takes 80% of the time.. etc)
13:14:27ozraJehan`: Yeah. I mean, I only optimize in perhaps a few funcs in most apps, because of measurements. So I have to agree my "must use the optimal int-type for general increased perf of all apps compiled" is a bit ludicrous. So can we please drop this while I'm just feeling a little ashamed over my hard to shake off hard-wiring? ;)
13:15:04Jehan`ozra: I don't consider 32-bit ints as the default to be ludicrous.
13:15:22ozraThough, one of the better discussions in a long while. The ones where you form a new opinion :)
13:15:31Jehan`I think the disadvantages outweigh the benefits, but it's not as though it's clearcut.
13:15:50ozraNo, that's for sure.
13:18:15Jehan`Incidentally, one of the things that I find attractive about Smalltalk and Dart is that they give you arbitrary-precision ints by default.
13:18:33Jehan`That's probably not the right choice for a system programming language, but it's nice when you can have it.
13:18:56ozraYeah, I shiver a bit, haha
13:19:15ozra(the performance devil crawling out from behind the ear)
13:19:44Jehan`Actually, tracing compilers tend to deal with that pretty nicely.
13:20:05Jehan`You generally don't pay for the performance hit unless your numbers actually do become so big.
13:20:53ozraAha, they basically just infer datatype dependig on expected "numerical size" of expressions?
13:21:25ozraEh, but how? Or are they JIT with datatype usage caches, or what?
13:22:13Jehan`JIT, tracing.
13:23:40Jehan`Very simply put, the machine speculates that operations don't overflow and branch to the more expensive infinite-precision code when they do.
13:24:16Jehan`You do still pay the overhead for the overflow checks (usually pretty cheap), but even those can be optimized away in a lot of cases.
13:27:13ozraah, ofc. hence the tracing.. Yes, I think JIT compiling has a lot of potential, where it _does_ have types also, it would save speculation, and if not, you still get the benefits mentioned. The bailouts can _usually_ be made pretty cheap too as you say. So I'm keeping eyes on this are of processing tech. So far I still have to use static compiling for my use cases though..
13:27:35ozra...this *area* of...
13:28:16fowlVarriount, is this from fowltek https://github.com/Varriount/DevIL ?
13:28:44fowlVarriount, more importantly is it complete (can i remove the DevIL in fowltek)
13:30:16Jehan`ozra: For example, these two pieces of code take about the same time: https://gist.github.com/rbehrends/2dec89e3ac5a0444490a
13:30:35Jehan`6.3 seconds for Nim on my machine, 6.5 seconds for Dart.
13:30:49Jehan`And the Dart overhead is probably for running the JIT compiler mostly. :)
13:31:56ozraA bit tooo simplitic case ;-) Even just a little bit of arithmetic might test it harder, care to throw in? It'd be interesting to see..
13:32:04Jehan`Actual optimization levels can be less than that (JIT compilers still have limitations in practice), but it's really impressive how close to native performance you can get.
13:32:15fowlYous guys have inspired me to benchmark some of my code
13:32:26fowlTesting float v float32
13:32:39Jehan`ozra: Arithmetic is unlikely to change things much; there are ways to really confuse JIT compilers if you want to.
13:33:47Jehan`I have some code that really hurts LuaJIT because it has so much polymorphic dispatch that is not amenable to tracing.
13:34:04fowlJehan`: by overusing virtual functions?
13:34:13fowlAh
13:34:26ozraJehan`: I mostly have experience with V8 because of work involving iojs. It compiles quickly first, when parts become hot, it uses the "CrankShaft", and when it determines that datatype of certain vars has been stable for a time it inlines it as straight machine ops. And now there's turbofan, but so far it's alpha and not that impressing. The interesting part though is saving time on compilation, and optimizing the actually used parts..
13:35:11fowlSmalltalk does similar with polymorphic inline caches
13:35:12Jehan`ozra: There's a lot of mindshare between the V8 and Dart compilers, as far as I know (since both teams work at Google).
13:35:51ozraYeah, but in discussions I've been, it seems like even V8 devers hardly know what the other one does.. So, I dunno ;)
13:35:59Varriountfowl: I'm fairly sure I generated that directly from c2nim
13:36:53ozraJehan`: I figured even simple arith would require them to make more checks on data size, while the loops are deterministic enough to just set the datatype at start - so it's not really a realistic test..
13:36:56fowlVarriount: ok ^^ I'm trying to remove extra stuff from fowltek
13:37:57ozraOy. Sunshine again - I better run out and take my Nim-parser print outs, coffee and tobacoo with me. bbl.
13:39:42*BlaXpirit_ joined #nim
13:39:43*BlaXpirit quit (Killed (orwell.freenode.net (Nickname regained by services)))
13:39:43*BlaXpirit_ is now known as BlaXpirit
14:04:51AraqVarriount: 'int' is most of the time used for *counting*. counting stuff that's in memory. hence the size reflects the pointer size.
14:05:21Araqthat cast[int](p) is guaranteed to work is just a bonus, not the primary reason.
14:09:12fowlproc `/=`*[T: float|float32](x: var T, y: T) {.inline, noSideEffect.} doesnt seem to work for float32
14:09:59*pregressive quit (Remote host closed the connection)
14:14:53jaco60is there some stuff to do (conversion ?) to apply a sequtil proc to a nim string ?
14:14:58*yymoto2 joined #nim
14:15:39BlaXpiritjaco60, lol you're out of luck
14:15:58BlaXpiritone thing u can do is copy its source :|
14:16:11*Jehan` quit (Quit: Leaving)
14:20:16fowlmost sequtils are templates
14:20:24fowlthey should work with strings
14:22:08jaco60fowl... i tried (intuitively, i admit) mess.filter(proc (c: char): bool = c > 'j')
14:22:29fowljaco60, try filterIt (the template version)
14:22:49fowlmess.filterIt(it > 'j')
14:23:33fowloh
14:23:36fowlhm
14:23:59fowlno that wont work with string either
14:24:07jaco60nope... seems i have to do a toSeq(mess.items).filter...
14:24:17jaco60(as seen on Stackoverflow)
14:24:35fowlbleh
14:25:19*yymoto2 quit (Quit: leaving)
14:26:03*bluenote_ joined #nim
14:27:12*gmpreussner|work joined #nim
14:27:20fowljaco60, https://gist.github.com/fowlmouth/3041f72efa37bea27d1b
14:29:01fowlstring can be casted to seq[char] >_>
14:30:14jaco60if a write toSeq(mess.items).filterIt(it > 'j'), i get a seq of filtered char... so i have to reconvert this seq in string
14:30:59fowljaco60, use the modified one that i just linked
14:31:12fowlthat way is silly
14:31:22jaco60fowl, yes, thanks...
14:31:59fowltoSeq() first makes a new seq, then filter makes a new one, then to convert it to a string thats a new object too
14:32:18jaco60but if i have to wrote all this stuff for each functionnal proc (map, foldr, etc.), it could be tedious
14:33:10fowljaco60, strings arent often used as seqs
14:33:31jaco60in Nim... i see that :)
14:34:50fowllike i said thought you can cast string to seq[char]
14:35:23jaco60i admit i struggle a bit with the nim doc :(
14:39:09fowljaco60, have you seen this? https://nim-by-example.github.io/
14:40:32jaco60fowl: since two days, i've read most of blogs post about nim :)... (the one mentionned on nim-lang, at least)
15:01:26ozrasorry, just jumping in here.. jaco60, are you maniping strings as seq's to approach it functionally?
15:02:28ozraAh, bit late. Need to walk the dog..
15:02:40jaco60ozra... i wanted to to so... but it seems it's not so easy in Nim... at best, i get a final seq[char] but, now, i have to reconvert it in string
15:04:22BlaXpiritwell i have no idea how to do it nicely
15:04:45Araqjaco60: usually people use strutils and call it a day. no need to filter / map stuff when you have 'replace'
15:05:27jaco60with future's lc, i have why i want... but i got a seq[char]...
15:06:33jaco60Araq, i want to apply map to all chars of a string
15:07:14Araqwhy would you? :P
15:07:34jaco60to do a rot13, for example
15:08:16vikatonjaco60: http://rosettacode.org/wiki/Rot-13#Nim
15:08:57jaco60vikaton, except i want to obtain a string, not display each char as it comes
15:09:34fowlyou can't figure it out from there?
15:09:35jaco60basically, i try to wrote a rot13(mess: string): string proc
15:09:37fowlzz
15:10:12jaco60fowl... i just have to recreate a string from the seq i've obtained with lc, yes
15:10:34Araqwhy is string not compatible to openArray[char]? fowl, can you make this work?
15:10:49BlaXpiritwhy is openArray a thing?
15:10:51Araqseems to be just an oversight of sigmatch.nim
15:13:12fowlAraq, in typeRel?
15:13:22Araqyes
15:15:32*darkf quit (Quit: Leaving)
15:18:45vikatoncould windows.h theoretically be written completely in Nim without C FFI ?
15:19:10xcombellecikaton theoricately ?
15:19:29xcombelles/te//
15:19:53vikatonyes
15:20:57Araqis that another way of asking "can Nim *really* do everything that C can do?"
15:21:26Araqand yes, it *really* can do that. C is nothing special.
15:22:20vikatongg
15:25:36*Matthias247 quit (Read error: Connection reset by peer)
15:28:27Arrrrvikaton, how is going on your keylogger?
15:28:55vikatonArrrr: it's finished for the most part https://github.com/Vikaton/nim-keylogger
15:35:02*gokr joined #nim
15:45:29fowlAraq, wow that was easy
15:46:14ozrajaco60: Araq - isn't it possible to overload map etc. to handle strings like 'pseudo' arrays?
15:47:36fowlozra, no thats the lame way
15:47:48fowlozra, string should just be compatible with openarray[char]
15:47:59ozrafowl: haha, so eh, why isn't char seq's working?
15:48:12ozra(sorry haven't followed discussion)
15:48:24ozrasounds reasonable
15:49:19federico3we all want the Nim book.
15:50:56Araqfederico3: it's in the works! :D
15:51:06jaco60ozra: a string.chars() to produce a seq[char] and a conversion from seq[char] to string would be enough, imo
15:51:28ozrashould be piece of cake, no?
15:51:41jaco60in the meanwhile, future's lc and a for loop do the trick
15:51:48fowlAraq, well it was easy to make string match for openarray[char], now i have to make it match for openarray[t]
15:58:27*rgv151 joined #nim
15:59:06ArrrrWill the book teach us how to become masters using macros ?
16:10:11iznogooddVarriount: "The fact that sizeof(int) == sizeof(pointer) is used in some places. I know it's used in the Windows pointer."
16:10:21iznogoodd Im using this in opengl code too. (the standard nim opengl wrapper was wrong last time i checked)
16:11:37*rgv151 quit (Remote host closed the connection)
16:14:00jaco60i have a question about case... Given this code (http://sprunge.us/bXhh), it's clear i would prefer to write 'return c' in the else branch but Nim complains
16:14:37jaco60Error: value of type 'int literal(97)' has to be discarded
16:15:03jaco60i understand why but is there some nim idiomatic to handle this kind of situations ?
16:18:53*rgv151 joined #nim
16:21:09ozraaraq: We had a long discussion earlier about the reasoning around sizeof(int) == sizeof(ptr). Is there a faq, doc, or what's the rationale? We finally arrived at 'indexing as much memory as adressable is good'
16:21:18ozra*as is adr...*
16:22:50vikatonAnyone creating something interesting in Nim ?
16:26:15ozraImplementing new Nim features, does that count? ;-)
16:26:46Arrrrin which features are you working ozra ?
16:27:07jaco60conversion from seq to string :)
16:27:29vikatonyeah that counts haha
16:27:44ozraRight now? I dislike the 'of' syntax of cases, unfortunately, but like '|' from LS etc. So I'm tinkering with the parser making an experimental implementation...
16:28:25ozraIt makes the branches of a case-construct so super clear imo, no noise..
16:28:34fowlyea
16:28:45fowlone character less will save man hours surely
16:29:02ozraIt's about _readability_ - not typing.
16:29:02vikatonwait can I see an example syntax ?
16:29:03fowlbut i have to hold shift to get | so its the same amount of keystrokes
16:29:36fowlreadability?
16:29:39iznogooddwhat we need is pattern matching, not different syntax for cases
16:29:45iznogooddthat will help readability
16:29:47ozraIt's even worse on swedish layout ;-) typing is not a priblem
16:29:53vikatoniznogoodd: agreed
16:30:23*matkuki joined #nim
16:33:09jaco60iznogoodd, plus one
16:33:23ozravikaton: haven't done a gist before, hope I got it right. basically: https://gist.github.com/ozra/74b0c1afaea8c87040b3
16:34:23ozraiznogoodd: example of pattern matching (there are so many variants). This implementation I'm doing doesn't replace 'of', just complements...
16:34:43ozra(question mark after pattern matching)
16:34:54vikatonozra, I kinda like it :)
16:34:59iznogooddT(x,y) = T(1,2)
16:35:11iznogooddthats what pattern matching is
16:35:37ozraAlright. So. No clash. No harm.
16:35:41iznogooddin a case --- T(x,y) => x + y
16:35:41fowlozra, i wish you would fix bugs instead of implementing new features
16:35:54iznogooddor whatever the syntax
16:36:13iznogooddfowl: or needed feature
16:36:14vikatonoh does Nim have lambdas?
16:36:16fowlor syntax even
16:36:19fowla non feature
16:36:46ozravikaton: I also like that for if .. elif .. elif ... It can be muddy if a log if-else suddenly is a 'new' if-else chain. with `case if: | a == 47: bla\n | foo(a) ==bar(a): blorgh` - if you understand the one line code ;)
16:37:16ozravikaton: lamdas are implemented as a macro (!) :)
16:37:40fowler?
16:37:44fowlproc = .. is a lambda
16:37:57jaco60for my own, the absolute missing part of Nim is a book :)
16:37:59ozrafowl: I fixed the number literals yesterday. Now I'm making a 'fun coding'. I much prefer them. So why should I not try it out?
16:38:02*kumul quit (Quit: Leaving)
16:38:30vikatonozra, tell me when u do a pull request
16:38:35*kumul joined #nim
16:38:47ozraiznogoodd: , fowl - for me it _is_ a needed feature. Not 'deadly needed', but strongly wanted.
16:39:16ozrafowl: meant shorthand notation of lamdas
16:39:27*skyfex______ joined #nim
16:39:52iznogooddof vs |, not much diff, same keystroke
16:39:56ozravikaton: sure. It does seem like most syntactical things I want are rather unwanted though :-/
16:40:12ozraiznogoodd: keystroke?
16:40:18iznogooddkey stroke
16:40:27ozraiznogoodd: key stroke? still? haha
16:40:30iznogoodd...
16:40:37iznogooddfinger hitting a key
16:40:55iznogooddshift + # vs o + f
16:41:26jaco60or AltGR + 6 on french keyboard...
16:41:33vikatonozra, always worth a try
16:41:36*skyfex_____ quit (Ping timeout: 256 seconds)
16:41:37ozranot you too? really? typing? One READS code. Types it once, reads it over and over. I find of's to be less readable than `|` by far, even less readable than `case` from C.
16:41:46iznogooddhttp://www.thefreedictionary.com/keystroke
16:41:51vikatonozra, and if its not accepted, use templates :D
16:41:53ozraaltgr + '<' (next to left shift) on swedish...
16:42:20Arrrri prefer of, and i doub | will be accepted. But i should not stop you from experimenting
16:42:21fowlozra, maybe | is a template already
16:42:28fowlcase .. of |1: ...
16:42:30jaco60ozra, while speaking of readability, indentation of "of" or "|" would be better imho
16:42:42ozraNot sure this can be solved in templates?
16:42:43fowlnow its case .. | |1: .. ?
16:43:04fowlno it cant be solved in templates because its not currently valid syntax
16:43:18jaco60but i buy |... that the same as Haskell :)
16:43:54*johnsoft quit (Ping timeout: 244 seconds)
16:44:06ozrajaco60: It's there and LiveScript I've gotten used to it from. Yup. That's why I try it out in the parser. Have to mutate a token also, from the lexer. So probably very non-templatable..
16:44:10*johnsoft joined #nim
16:44:22*pregressive joined #nim
16:44:43*fowl left #nim ("Leaving")
16:45:18*Jehan` joined #nim
16:47:07ozravikaton: Yes, I will try a PR, but as seen, alternative syntaxes aren't to popular of what I've met here so far - even though they don't break anything and create no ambiguouties :-/ "My way or the high way - and it's got to be the old way", is the feeling I get sometimes. I mean, OK if it totally broke a feature, or had no precidense what soever. But that's not the case.
16:47:42ozraAnd the compile cost is zero (not used = no time consumed)
16:50:06ozraArrrr: No, I mean that's the only way to learn the ropes of the compiler also, whether it's accepted or not, the next bug is squashed faster because of what one learns :)
16:51:31vikatoncool
16:51:44vikatonis this outdated? http://rosettacode.org/wiki/Dining_philosophers#Nim
16:56:21vikatonyeah thats pretty outdated
16:56:28vikatonwe goota f1x
16:59:16ozrajaco60: BTW, indenting 'of' is already possible - but perhaps that's what you meant?
16:59:26jaco60yes
16:59:35ozraah.
16:59:51iznogooddjaco60: let base = if c in 'a'..'z': ord('a') else: ord('A')
17:00:00iznogooddafter you are you its a letter
17:00:37iznogooddif not (c in Letters): return c
17:00:43iznogooddsure*
17:00:59iznogoodd(letters is from strutils
17:02:57jaco60iznogoodd, thanks...
17:03:45ozravikaton: well the implementation of '|' cases is "ready" - it works on my test-cases now. Gonna tinker a bit more :)
17:03:59iznogooddor you could simply implement some helper functions to get the final base = ord(applyIf(isLowerCaseLetter(c),toLower, 'A'))
17:04:07ozraMmm, gonna test so that they work indented too. Think so.
17:04:32jaco60iznogoodd, too cryptic, imho
17:04:36vikatonsweet @ ozra
17:04:46iznogooddlol not cryptic if you know functinal programming
17:05:35jaco60iznogoodd, but as i begin with Nim, i prefer to wait to scramble FP paradygms with it ;)
17:05:37ArrrrBut nim uses explicit sintaxis (if aCond and bCond/ case of, etc)
17:06:36ozrajaco60: '|' works with indentation too as expected, if you're interested when it's "done done"..
17:06:57jaco60ozra, cool
17:08:20jaco60so, my caesar code miss only a conversion from seq to string (i've done it via a for loop, which is rather ugly
17:08:53vikatonanyone wanna help?
17:11:25*jubalh quit (Quit: Leaving)
17:12:00ozraNext test after a smoke break: replace entire compiler syntax with '|' (just for testing - promise!)
17:17:32Araqozra: already explained why 'int' is the way it is
17:18:09Araqand '|' for 'case' is rather inconsistent. |foo currently is prefix operator | followed by 'foo'...
17:19:08BlaXpiritlooks like a bunch of bikeshedding
17:19:16Araqthere is no other construct that uses operator symbols why is it essential for 'case'?
17:34:39iznogooddand it steals the | operator
17:35:07ozraAraq: aha, today? I'll search. Regarding '|' it is fully unambioguous in case contructs. It does not steal the operator at all. I just compiled part of the compiler with '|' notation. No problem.
17:35:32iznogoodd||x...
17:35:38iznogooddit would be ugly
17:35:51iznogooddand confusing
17:35:52BlaXpiritbut WHY
17:37:04ozraAraq: I find it to be much clearer - it gets out of the way completely, the of's are small enough to create noise, 'case' actually is less "noisy" imo, but I rather have it like is, but optionaly being able to use the '|' notation, simply because I find it superior for readability.
17:37:13iznogooddthe | syntax could make sense or the ADT but not for cases imo
17:37:22iznogooddfor*
17:37:56iznogooddof x | y
17:38:05*pregressive quit (Remote host closed the connection)
17:38:18ozraIt's common i guard clauses and similar so has a relation imo. Also worked flawlessly in LS for years... But, as said, it's an experiment. But seems stable already..
17:38:47Jehan`I think there should be corollary to Greenspun's Tenth Rule of Programming; namely that every language's syntax diverges towards being a dialect of Perl. :)
17:40:08ozraJehan`: haha. That's a complex bastard syntax wise.. But as long as things don't clash and makes the compiler more complex, I prefer if anyone can choose _their_ preferred style. This mod is rather un-intrusive. It's one block of code in one own branch in the parser...
17:40:45Jehan`Well, the thing is having dozens of dialects baked into the same language.
17:41:10Jehan`It makes reading code a hell of an experience if everybody writes in a different style.
17:42:01iznogooddexactly, alternative syntax is ok if its needed, but with this nothing would be gained
17:42:19ozraJehan`: yes I see your point. When it comes to readability, everyones eyes works differently, the semantics aren't changed in any way. I don't like the style of the nim compiler source at all, but I have no problem coding in it and sticking to it. It's a different thing with the projects one spend day in and out on. That's of no others business than the team working on it imo.
17:42:50*dashed joined #nim
17:44:01ozraJehan`: It is already possible to write code that looks like from mars in Nim, thanks to macros etc. That doesn't mean one _has_ too. And also, if modifying someone elses code, say a module you love, or like this language I fancy a lot, you can live with accepting the style of the authors code. But it's silly to lock down syntax style when the cost is basically zero, and some would love it.
17:44:38Jehan`ozra: Well, in the end, you'll have to convince Araq, not me. :)
17:44:57Araqozra: one doesn't *have* to do it, but you surely *intend* to use it everywhere.
17:45:35iznogooddlol, while your at it, implement a pragma that can change all syntax, aka {.syntax[of]: |.} lol /s
17:45:41Araqyou might as well implement #! ozra's dialect.
17:45:52*gsingh93 joined #nim
17:46:15ozraWell, yes I do, in _my_ code in _my_ projects. And I'd be happy for PRs, but if someone can't even bare to look at my code because of say dashes or the pipes, so be it, it's ultimately I who will work on it formost.
17:46:27ozraAraq: hahaha. I had that one coming!
17:47:08ozraBut seriously, this is the only other thing I'd really enjoy. Most everything else I can live without, postfix if's etc. That's not necessary.
17:47:16Araqozra: the problem is that people will blame Nim for having #! ozra's dialect, not you for using it.
17:48:45ozraI don't think there will be any blame, since it doesn't clash with the existing one? It's perfectly simple to just use 'of', I think that's a great syntax if it's found to be clearer to the user. Rather it is a bonus, as I see it.
17:49:46*anthgur joined #nim
17:50:47Araqpersonally I think #!dialects are all well worth it. Better have an ozra coding Nim modules in #!dialect than an ozra coding in C++ which is much *more* incompatible with the rest of Nim, but that's an unproven assertion. We might as well lose brilliant programmers because "Nim is just a mess".
17:51:37ozraHere's a piece of the compiler source, tell me it's not fucking super clear: https://gist.github.com/ozra/74b0c1afaea8c87040b3
17:51:43iznogooddAraq: yes thats true, but look at haskell now, with all its damn extensions
17:52:10flaviuozra: I'm not against `|`, I'm against different dialects.
17:52:12iznogooddlike the overloaded strings GADTS etc
17:52:37flaviuIf someone says "this code is in Nim", it should look like Nim.
17:52:45Araqozra: it's ugly and believe it or not
17:53:03ozraaraq: I understand your reasoning. I just think, Nim as a potential to attract people like me, from C++ imperativism, with a functional coding interest, and people from python, from golang (when they realize Nim is the same but better ;-), people from lisp. I mean, ultimately, we all want a big module universe, right? :-)
17:53:22iznogooddozra: tbh i wouldnt mind one syntax or the other, but having both in a language divides everyone
17:53:47iznogooddozra implement Tagged union with | syntax instead + pattern matching
17:53:51ozraHaha, fair enough, araq, we do have different tastes to some syntactical elements, though we all here seem to have same tastes to the language and semantics..
17:53:55iznogooddthat would be more productive
17:54:32AraqOberon uses | too and I said WTF when I saw it.
17:54:42Araqcause it simply doesn't fit the language at all.
17:54:46ozraAnd again, I don't think it's really a divide, just a route to more contributions and modules. But of course, this is nothing I could possibly prove.
17:55:20Araqif - elif - else
17:55:28Araqtry - except - finally
17:55:37Araqcase - | - | - else
17:55:38Araqwtf?
17:56:31*milosn quit (Ping timeout: 255 seconds)
17:56:35boopare there any examples of concepts in use?
17:57:32ozrawell, for what it's worth, what I use in my code for long if elif else are ("nimified"): case if: | a == b: doFoo(); | bar(a) == true: doMuckyPup(); | _: doDefault(); (with semicolons 'simulating newlines here')
17:58:00BlaXpiritozra, please just stop :/
17:58:17ozraIn that example gist I posted - I find it looks like a bullet list of possible events. Just fucking super clear :) I don't care if it follows a pattern.
17:58:30iznogooddi prefer && and || vs OR and AND, but the language isnt like that
17:58:32ozraBlaXpirit: Well, well. I'll quit then.
17:59:03flaviuozra: "bar(a) == true" ;)
17:59:33flaviuBut I might be the only other person that likes that syntax
17:59:42ozraflaviu: ? I missed the joke? :-/
17:59:48vikatoniznogoodd: you could always use templates :)
18:00:01*synthmeat quit (Quit: WeeChat 1.3-dev)
18:00:06flaviuozra: "bar(a) == true" is equivalent to "bar(a)"
18:00:08iznogooddvikaton: lol i like being standard
18:00:24vikatonflaviu: as suggestion to nim by example, you should add arrows on the left and right
18:00:30vikatonfor easy navigation
18:00:31*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/20150513174244])
18:00:31ozraflaviu: haha, yeah - just wanted to clarify the context..
18:01:00flaviuvikaton: I've been told, but I can't come up with a good way to implement it.
18:01:19iznogooddflaviu: just copy rust by example
18:01:25Arrrrlol
18:01:27ozrabtw (I will quit in a sec, ok?) araq, it is `case - | - | - | _` (not that it matters in the discussion much)
18:01:38flaviuiznogoodd: They use gitbook, I use nanoc.
18:02:35ozraWell. I'll finish my tests in my feature anyhow. I've learnt alot about the parser today in any event :)
18:02:37*synthmeat joined #nim
18:02:46*synthmeat quit (Client Quit)
18:02:57iznogooddflaviu: it would be pretty ez to add with javascript
18:03:10Araqmuhahaha
18:03:11*kumul quit (Ping timeout: 250 seconds)
18:03:25flaviuiznogoodd: There's an idea! Thanks!
18:03:40iznogooddflaviu: the left menu has all what is needed
18:04:00iznogoodd(to find the next page etc)
18:04:01*BitPuffin|osx joined #nim
18:04:06*synthmeat joined #nim
18:05:32Araqozra: so first {. .} is too ugly. then the world really needs Unicode dashes. now it's 'case of'. tomorrow it might be the * export marker. at which point will you enjoy Nim?
18:06:28BlaXpiritwhen u have these urges, go use LiveScript
18:07:57*Demon_Fox joined #nim
18:08:40flaviuozra: Small imperfections are not a big deal.
18:08:47ozraAraq: Let's put it this way, I much prefer it over C++ already, I mean my thin transpile is an ugly hack admittedly, and yes I might be a little picky, I just see like, when it's _possible_, and _not in the way_ (non breaking, no additional compile cost, etc..), that's how I reason, "why not try and get it in"? I like the semantics and the meta features over C++.
18:09:34flaviuozra: There is a cost, it's just not a cost that is immediately apparent.
18:09:37BlaXpirityou want changes personally for you which would harm everyone else
18:09:55ozraflaviu: Araq: No you're right. It's not the end of the world, but when one has tried basically everything, and think that one has built pretty enlightened choices as to some syntactical looks, (with one obviously being me), it's worth a bit of arguing ;)
18:09:59BlaXpiritreasons: there is more to learn
18:10:15*milosn joined #nim
18:10:22BlaXpiritif you say there is no need to learn it, then why add it in the first place
18:10:23flaviuozra: You are welcome to keep a personal patch set. I do that myself (granted, my patches are pretty minor)
18:10:25ozraBlaXpirit: I don't agree. If I thought it hurt, then I would not argue for it at all. I don't.
18:10:35BlaXpiritif someone doesn't learn it, they can't understand code written using it
18:10:50BlaXpiritif nobody uses this, it's bloat and maintenance cost
18:10:57ozraYes, flaviu, that is an alternate route I consider. But then my code won't work for anyone else.. *shrugs*
18:11:16BlaXpiritif someone new comes across this, they'll say "yuck" and leave nim
18:11:47ozraThat's your opnion BlaXpirit. Based on what?
18:11:54BlaXpiritif you don't think it would hurt... then start thinking
18:12:16jaco60anyway, i prefer addition of functionnalities like transparent str <-> seq (yes, i insist) than syntax addition
18:12:36ozraBlaXpirit: please elaborate.
18:13:00BlaXpiriti stated reasons it is hurtful and don't see a single reason why it's beneficial
18:13:08Arrrr+1 to @[j,a,c,o,6,0].toStr
18:13:23BlaXpiritwell that's a pull request away
18:13:37BlaXpiritthere may even be something like that already, just that we can't find it
18:13:44flaviuI think that the Go people have a good point, they just drew the line in the wrong spot.
18:14:07ozraBlaXpirit: Your reasons for it being hurtful is based on your personal opinion of what would scare you away..?
18:14:21BlaXpiriti didn't say it would scare me away
18:14:42BlaXpiritand you're disregarding the rest
18:14:47BlaXpiritof what i said
18:15:43ozraI'm sorry BlaXpirit, I might have missed something, being to occupied 'defending the feature'. If you'd be so kind and sum it up? I'd be happy (I can search)
18:16:00BlaXpiritI said it 5 minutes ago
18:17:10ozraI'm scanning :)
18:17:15BlaXpiritplease don't let me discourage you, i'm just direct like this :|
18:18:31BlaXpiritthe main and obvious point should be... alternative syntaxes are usually bad.
18:18:46BlaXpiritand no, i don't have anything to confirm this point
18:20:45ozraWow, can't believe it took me so long to find it! I think it's fair to say that there are features in many languages that people never learn until they at some point dives into some 3rd part project and see it, and go, "hmm, what's that?", they then look it up and gets it.
18:21:08BlaXpiritfeatures, sure
18:21:18BlaXpiritbut we aren't really discussing a feature
18:21:29ozrafeatures, constructs, sytax, what have you not..
18:22:22ozraYes, well, I will quit my ramblings about this here now. I really enjoy Nim, don't get me wrong on that! I'll keep this feature local to my machine for now.
18:26:06ozraInt reasoning confirmed. Jolly good :)
18:33:49*bluenote_ quit (Ping timeout: 246 seconds)
18:37:27jh32hi
18:38:23*rgv151 quit (Quit: Leaving...)
18:39:15Araqjh32: hi
18:39:21jh32I'm playing with the parallel example from the docs, is it expected that it doesn't compile as parallel.nim, but works when saved in pi.nim?
18:39:44Araqyes.
18:39:49jh32or is this some problem in my setup?
18:40:02AraqI'm not saying it's good. but it is expected.
18:40:05jh32ah, ok
18:40:23Araqparallel then is the module name, confusing the compiler
18:41:02jh32.. was confusing me too :-)
18:47:36boopis there an easy way to collapse an iterator into a string?
18:47:40boopa la list(iter) in python
18:48:13Jehan`Into a seq, you mean? strutils.toSeq does that.
18:48:41boopthanks!
18:48:59*anthgur quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:50:05boophmm- i'm trying to use this http://nim-lang.org/docs/strtabs.html#keys.i,StringTableRef
18:50:18boopbut it keeps spitting out "undeclared identifier: 'keys'" unless i use it in a for
18:52:00iznogooddflavius: https://gist.github.com/HOLYCOWBATMAN/064621887e58c01ed6aa
18:52:13*Jesin quit (Quit: Leaving)
18:52:31iznogooddflaviu:^
18:52:41iznogooddthat would give you previous and next Href
18:52:47flaviuiznogoodd: thanks, I'll use that.
18:53:11iznogooddi just tested it in my firebug live, but it should work everywhere ithink
18:53:28*Mat4 joined #nim
18:54:01iznogooddflaviu: sorry for no break and the missing ;
18:54:43flaviuiznogoodd: No worries, I'll figure it out.
18:56:36vikatonflaviu: ur implementing it :D
18:56:46flaviuvikaton: iznogoodd did most the work :P
18:57:06vikatonanything works :P, gj iznogoodd
18:57:13iznogoodd=)
18:57:38vikatonguys we need to update this rosseta code for Nim
18:57:54vikatonhttp://rosettacode.org/wiki/Dining_philosophers#Nim
18:58:48*sepisoad joined #nim
18:59:14def-vikaton: I think my version is updated here: https://github.com/def-/nim-unsorted/blob/master/diningphilosophers.nim
19:00:14*Siecje quit (Ping timeout: 245 seconds)
19:00:25vikatondef-, what is acquire and release?
19:01:17Araqverbs.
19:01:26iznogoodd#rekt
19:01:45*Siecje joined #nim
19:02:09*vikaton cries
19:02:45Araq"good day sir. I'd like to acquire and then release the lock."
19:04:06sepisoadi just compiled some nim code on raspberrypi, It works... :)
19:04:36Araqnot self-explanatory?
19:04:43vikatonsepisoad: did u follow a tutorial ?
19:04:49flaviusepisoad: yep, ARM is also in the test matrix: http://buildbot.nim-lang.org/waterfall
19:04:55vikatonAraq,I need to read up on threads, but makes sense
19:04:56iznogooddthe tutorial of life
19:05:17sepisoadactually i used the arch linux arm build
19:05:19Arrrrcomputer science is not included in that tutorial.
19:05:26sepisoadthere is already nim packages there
19:08:45*dtscode joined #nim
19:15:02vikatondef-, I think your code goes on forever
19:15:23vikatondtscode: the keylogger is finished btw
19:15:26def-vikaton: i think that was the intention
19:16:04*gokr quit (Ping timeout: 245 seconds)
19:16:34dtscodevikaton: nice
19:16:38vikatonOh, then the Rust version is wrong :/
19:18:41*onionhammer quit (Read error: Connection reset by peer)
19:19:23*onionhammer joined #nim
19:23:57ArrrrWhy is koch necessary to debug certain crashes?
19:24:40*onionhammer quit (Read error: Connection reset by peer)
19:24:42AraqArrrr: it isn't. but it's convenient.
19:24:42*Matthias247 joined #nim
19:25:10*onionhammer joined #nim
19:25:10onionhammerok
19:25:37Araqonionhammer: are you Arrrr ? o.O
19:25:54ArrrrYes, you discovered me
19:28:21ArrrrCould someone explain me what im doing wrong here? http://pastebin.com/uWsCxZeV
19:30:56*gsingh93 quit (Ping timeout: 272 seconds)
19:31:45flaviuArrrr: but your IP is from Spain and onionhammer's is from Texas.
19:32:13flaviuerr, Minnesota
19:32:30ArrrrThat's because i use proxies
19:33:24flaviuOf course ;)
19:43:16*sepisoad quit (Quit: Leaving)
19:43:19*TEttinger joined #nim
19:45:12*Jehan` quit (Quit: Leaving)
19:46:40*solidsnack joined #nim
19:49:18*gokr1 is now known as gokr
19:49:31dom96Arrrr: why the two identities?
19:50:26BlaXpiritdom96, in case you're not playing up for a joke, that was a... joke
19:51:03dom96oh.
19:51:25BlaXpiritat least i'm almost sure
19:56:25*ozra quit (Ping timeout: 246 seconds)
19:57:13*sepisoad_ joined #nim
20:04:39*sepisoad_ quit (Quit: Lost terminal)
20:07:53*Jesin joined #nim
20:11:03flaviuvikaton, iznogoodd: Pushed, you should see the change in a few minutes.
20:11:25vikatonnice!
20:14:33*pregressive joined #nim
20:14:55*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:15:29iznogooddlolol https://please-enable-js/
20:17:29flaviuiznogoodd: I figure that that's the best way to do it. I mean, I can't do alert("please enable js"), can I?
20:18:03BlaXpiritD:
20:19:02iznogooddbut i got javascript enabled :D
20:19:15Araqwhat? so now I need to enable JS for "nim by example"?!
20:19:31iznogoodd<a id="arrow-prev" class="text-icon disabled" href="↽">https://please-enable-js/">↽</a>
20:19:46flaviuAraq: It works fine without JS, but JS makes it a little bit more convenient.
20:20:24*Trustable quit (Remote host closed the connection)
20:20:24Araqah good. cause I really like to browse the web with lynx on my toaster
20:21:13flaviuAraq: That's not a problem at all. Nim-by-example works fine in lynx.
20:21:47vikatonflaviu: I have a suggestion for the syntax highliting
20:22:12flaviuvikaton: Go ahead and post it
20:23:14Araqcool. now the only problem is that the download is too slow with my 1 baud modem.
20:23:59vikatonflaviu. some thing like http://radiux.io/articles/code-syntax/ or http://siciarz.net/24-days-of-rust-hyper/
20:24:20flaviuAraq: Minimum requirements are 115000 baud, sorry.
20:24:20*Jessin joined #nim
20:24:35dom96Is it just me or is nim-by-example incredibly slow now?
20:24:39iznogooddflaviu: allright its working, it doesnt work at root tho
20:24:51dom96in fact, it's still loading...
20:25:05Mat4Araq: You can still get the download probably per e-mail ;)
20:25:12vikatonloads fine for me
20:25:18*Jesin quit (Disconnected by services)
20:25:20*Jessin is now known as Jesin
20:25:53dom96It seems better now
20:26:15dom96still an annoying delay sometimes
20:26:33dom96I'm guessing it's the time it takes for the JS to load
20:26:38dom96because the ticks take a while to load
20:26:47dom96as well as the previous and next arrows
20:26:53*ingsoc quit (Quit: Leaving.)
20:27:23*Arrrr quit (Quit: lynx2-8-8)
20:27:39flaviudom96: While I attempt to provide a good experience on every device, you might experience some lag on toasters :P
20:28:05dom96toasters?
20:28:18strcmp1a reference to netbsd, i think
20:28:21flaviuLiteral toasters.
20:28:55*banister joined #nim
20:29:07cazovdo you support PIC10? I only have 384 words available to me
20:29:20vikatonflaviu: thoughts?
20:29:33flaviuvikaton: You mean a dark theme for code highlighting?
20:29:43*iznogoodd is now known as HOLYCOWBATMAN
20:30:23dom96flaviu: http://i.imgur.com/Tkz6To8.png
20:30:44flaviucazov: Sure, but the content might be truncated a bit.
20:31:22flaviudom96: That's your network's fault, I can't help you there.
20:31:52dom96Everything else loads fine.
20:32:00flaviuIt's mostly blue, "waiting".
20:32:25dom96yeah. It's strange.
20:32:42dom96oh well
20:34:16flaviuAlthough it does load in 500ms for me, which is a little slow.
20:35:53vikatonflaviu: yeah
20:36:36*ozra joined #nim
20:39:22*Kingsquee joined #nim
20:40:20*xcombelle quit (Quit: Leaving)
20:41:29ozraKadaam. Just had a power outage caused by... beavers!
20:42:25BlaXpiritD:
20:44:41dom96ozra: Beavers? For real?
20:46:01ozradom96: haha. yeah, I've been waiting for it to happen. And finally it did. Still came as a surprise. They've been goin rather hard at the trees down by the stream. And it's been windy like hell today. So. Baaam.
20:46:13Varriountozra: And thus, my plan to take over the world with an army of beavers proceeds...
20:46:16ozra(air borne wires...)
20:46:25ozraVarriount: haha
20:46:37*synthmeat quit (Quit: WeeChat 1.3-dev)
20:47:17ozraLuckily the wire didn't break, so they just cut power to chop up the hanger..
20:47:40ozraVarriount: So, you've got to train your beavers harder!
20:50:12*synthmeat joined #nim
20:51:54vikatonwow ._.
20:52:16vikatonI just now realized that its Consonant not Constant ( ._.)
20:52:28Varriountvikaton: Huh?
20:52:54vikatonin the English language
20:54:19dtscodevikaton: You mean the non vowels?
20:54:25vikatonyes
20:54:43Araqvikaton: that's cool. create a bug report for it. Our docs should have mentioned that.
20:55:05vikatonAraq: in the middle of it right now
20:55:34vikatonit was found in nim-by-example
20:55:55vikatonflaviu: any news and possibly changing it?
20:56:35flaviuvikaton: Sorry, I've been focusing on optimizing load time to absurdity :)
20:56:40flaviuit should be easy enough to change.
20:56:47flaviuerr, to add an option to change it.
20:56:59vikatonYes that would be nice
20:57:38vikatonflaviu: the menu button doesnt work
20:57:56*Mat4 left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.")
20:57:59pigmejhmm, guys what would be way to port lib from non async to async ?
20:58:07HOLYCOWBATMANflaviu: https://github.com/flaviut/nim-by-example/pull/34/
20:58:14HOLYCOWBATMANfixed a bug with the navigation
20:58:38HOLYCOWBATMANif the current url cant be found in the list (as in the root url) it will act as if it were on hello world
20:58:49dom96pigmej: what lib?
20:59:25HOLYCOWBATMANi havent tested it tho, i edited it live on github
20:59:33flaviuHOLYCOWBATMAN: I think I like the current behavior better.
20:59:40flaviuI'll just add the root URL to the toc.
20:59:47HOLYCOWBATMANok sure
20:59:48pigmejdom96: nim-nanomsg
20:59:58pigmejso it's more like porting C
21:00:14HOLYCOWBATMANjust look at your console, currently it break everything since you do not return NAV at all if its not found
21:00:54HOLYCOWBATMANif you would have more javascript, it wouldnt run
21:01:38dtscode<pigmej> so it's more like porting C
21:01:40dtscodeI'm so sorry
21:01:40flaviuHOLYCOWBATMAN: Good point, I'll fix that.
21:01:51dom96pigmej: Do you know how async works in nanomsg?
21:02:07dom96I see a poll proc but that's about it.
21:02:55*HOLYCOWBATMAN is iznogood
21:03:05*filwit joined #nim
21:03:16VarriountHello filwit
21:03:23filwithi Varriount
21:03:54*BitPuffin|osx is now known as BitPuffin
21:03:55pigmejdom96: well not very precise but there is a pool, and that's it
21:04:25pigmejepoll on linux systems, etc, nothing very special I suppose
21:04:53pigmejafair nanomsg doesn't have any weird / hacks as zmq have.
21:04:54HOLYCOWBATMANflaviu: o sorry i thought the getting started page was the same as root
21:05:19HOLYCOWBATMANi just saw that its not
21:05:23dom96pigmej: Why not just use Nim's sockets?
21:06:11pigmejnano have quite cool survey protocol
21:06:21dtscodeNim actually has a very nice socket lib :D
21:06:24pigmejit's bus is also quite fun to use.
21:06:39pigmejdtscode: definitely agree ;-)
21:06:55dom96dtscode: That's nice to hear :)
21:08:10pigmejbtw dom96 how is your experiment with async + threads going ?
21:08:17dtscodeor rather, compared to the other ones I've used. Reminds me a lot of pythons lib, but it isn't a toy :D
21:08:26dom96pigmej: don't really have time for that right now.
21:08:37dom96pigmej: It's kind of in Araq's hands, but he doesn't have time for it either heh
21:08:54pigmejtypical deadlock... ;D
21:09:08filwithey Araq, whenever you're around, can you explain to me why the lineF/linefmt commands wont call my custom system.chcks.raiseNilError via '#raiseNilError' ? The compiler keeps saying it can't find that procedure, and all my greps aren't helping.
21:09:47*BitPuffin is now known as BitPuffin|osx
21:10:24filwitAraq: err.. lineftm in the cgen, if that wasn't clear
21:10:51dom96pigmej: I wonder if nanomsg's fds are just normal OS fds.
21:11:16pigmejdom96: kinda
21:11:33dom96questions is whether you can pass them to epoll
21:11:37dom96*question
21:12:13dom96If you can then you can just call newAsyncSocket(nanoMsgFd)
21:12:14pigmejmaybe the simple ones, but I'm not that familiar with nanomsg internals
21:12:20pigmejhmm
21:12:36dtscodepigmej: link to nanomsg?
21:12:52pigmejdtscode: https://github.com/nanomsg/nanomsg ?
21:12:54pigmejor nanomsg.org
21:12:59dom96well, newAsyncSocket(nanoMsgFd, true) # or false if you want unbuffered
21:13:02*gsingh93 joined #nim
21:13:06dtscodethanks
21:13:24pigmejhmm, i will play then with it in this way... maybe it will work somehow ;)
21:13:46pigmejbut I think the advanced protocols are a bit more complicated but who knows ;-)
21:13:58*Jesin quit (Quit: Leaving)
21:14:12dom96pigmej: If that won't work then you will need to write a dispatcher.
21:14:22dom96pigmej: probably, there are many ways to do this.
21:14:36dtscodeafaict its normal fd's
21:14:47dom96pigmej: Nobody in the history of Nim has done it yet, sooo... you're going to have to experiment :)
21:16:06pigmejdtscode: I'm not sure, https://github.com/nanomsg/nanomsg/blob/master/src/protocols/survey/surveyor.c this doesn't look like fd
21:16:38dom96I wonder if this also works on Windows: http://nanomsg.org/v0.5/nn_poll.3.html
21:16:56dtscodehmmm
21:17:12dom96and if so, how.
21:17:20onionhammerAraq what? no im not Arrrr :P
21:17:41Varriountdom96: What are SP sockets?
21:17:56dom96we should also get Nim on here: http://nanomsg.org/documentation.html
21:18:10pigmejdom96: windows... who cares;p
21:18:29Varriountpigmej: I do!
21:18:49*Varriount is the kind of person who reads 'Windows Internals'
21:18:57dom96Varriount: good question
21:18:59pigmejVarriount: ouch
21:19:09dom96I care about Windows too
21:19:52dom96Nim developers are very Windows friendly :P
21:20:13Varriountdom96: SP = Serial Port
21:21:01dom96Varriount: You sure?
21:21:36Varriountdom96: I can't think of anything else that would make sense.
21:21:41pigmejehs,,, windows ;)
21:21:46dtscodespecial purpose?
21:23:11dom96Well I just went into #nanomsg and asked.
21:23:15dom96Because I am really curious heh
21:24:12dom96oh, I think it's Socket Pair
21:24:13pigmejit's special purpose
21:24:24pigmejdom96: pair is just one of types
21:24:33dom96hrm
21:24:40dom96Special Purpose does make sense.
21:24:44pigmejhah
21:24:45pigmejnop
21:24:46pigmejScalable Protocols
21:24:48pigmej"Scalable Protocols"
21:25:07pigmejone of GO packages have it;D
21:25:53dom96omg lol
21:26:44pigmejbut special purpose sounds better;d
21:26:47*phira quit (Ping timeout: 256 seconds)
21:26:58dtscode:D
21:29:38reactormonkpigmej, muh, I'm stuck somewhere at a social event, wanna take a look at nim-mode?
21:29:50reactormonkI'd suggest TS, but it's a bit too noisy here
21:30:04pigmejreactormonk: 23:30 there ;/
21:30:14reactormonksounds like a good time to code
21:30:22pigmejmy brain is currently in mode 'tomorrow is f*** monday'
21:30:38pigmejreactormonk: but what's wrong? company issues /
21:30:39pigmej?
21:30:53*Matthias247 quit (Read error: Connection reset by peer)
21:31:19reactormonkpigmej, I can't poke it to start anything
21:31:37reactormonksince nimsuggest now works, could you give it a try?
21:32:38pigmejk, but tomorrow, I had to prepare for tomorrow ;/ new week, new month ...
21:32:47pigmejreactormonk: do I still need your fork /
21:32:49pigmej
21:32:50pigmej?
21:32:55reactormonkpigmej, nope
21:32:59reactormonkit's been fixed.
21:33:02pigmejok so all merged :)
21:33:06reactormonkyup
21:33:08pigmejonly nim-mode from epc branch?
21:33:40HOLYCOWBATMANhey, i care about windows!
21:33:52reactormonkpigmej, yup, exactly.
21:33:58dtscode^ Windows lag at its finest
21:34:06HOLYCOWBATMANlol
21:34:22reactormonkouch.
21:34:38pigmejdtscode: rotfl
21:34:41*HOLYCOWBATMAN is now known as Windows
21:34:42reactormonkwow, we're nearing #3k in nim
21:35:14Windowsat least i got better games than pong
21:35:24Windows#rekt
21:36:06*Windows is now known as HOLYCOWBATMAN
21:36:15dtscodeWho needs games better than pong?
21:36:37pigmejdtscode: a gamer who uses windows ... probably ;]
21:36:38HOLYCOWBATMANpong per email
21:36:43*dom96 considers making NimBot kick whoever says #rekt :P
21:37:03reactormonk#shrekt
21:37:04*dtscode kicks dom96
21:37:09dtscode#r_ekt
21:37:17dom96#r-ekt
21:38:18HOLYCOWBATMANr = ek/t
21:38:33pigmej;d
21:38:34dtscode#star-trekt
21:38:58pigmejreactormonk: https://github.com/reactormonk/nim-mode/blob/epc/company-nim.el this makes sense or not at all?
21:39:11dom96#t-rext
21:40:21vikaton#r #e #c #t
21:40:33vikatonoh wow i misspelled
21:40:49dtscodeoh no
21:40:56*dom96 joined #nim
21:40:56*dtscode joined #nim
21:40:58flaviu:P
21:41:01dtscodelisten here fucker
21:41:07dom96oh dear
21:41:15dom96Somebody will get their +o powers taken away.
21:41:24*flaviu1inch joined #nim
21:41:27dtscodeI'll have you know I am a part of 30+ succefull nimperations
21:41:44flaviu1inchT_T
21:41:59flaviuI pasted in 5 kicks at the same time, I guess freenode didn't like that.
21:42:24dom96how many people did you actually kick?
21:42:27dtscode> flaviu1inch
21:42:35dtscodeIf you know what I mean
21:42:38*vikaton joined #nim
21:42:38*flaviu1inch is now known as HOLYCOWBATMAN
21:42:48dom96somebody needs to patch NimBot so that it logs kicks
21:42:55flaviuHOLYCOWBATMAN, dom96, dtscode, vikaton
21:42:57dom96anybody?
21:42:58dtscodeI'm on it
21:43:01dom96anybody at all
21:43:01vikatonwhat
21:43:02dom96yay
21:43:19vikatonare u going to apologize?
21:43:25vikatonbecause i wont accept it :[
21:43:31flaviuNope :B
21:43:35dom96vikaton: aww, i'm sorry for flaviu
21:44:02dtscodewheres the nim bot repo again/
21:44:16pigmejdtscode: github ;p
21:44:29dom96dtscode: the internet
21:44:33pigmejdtscode: dom puts all his stuf on github ;p
21:44:40dom96sorry, I couldn't resist.
21:44:42dtscodeDid you know the internet is on computers now?
21:44:51dom96dtscode: https://github.com/nim-lang/nimbot
21:45:04vikatondtscode: its on them?
21:45:11vikatonthat sounds ugly
21:45:25dtscodevikaton: The internet (stacks) typically are
21:45:40HOLYCOWBATMAN#53454B54
21:45:49*dtscode wonders if he can just edit it straight in github
21:46:00dom96dtscode: yeah... no.
21:46:05dtscodenmd I need to test it
21:46:41dom96yeah, please make it join #nim-offtopic for testing
21:46:50dom96or better yet a channel you own
21:47:06vikatonflaviu: u know when ur gonna start the syntax highlighting thingamejig?
21:47:08pigmejreactormonk: btw what was the issue ?
21:47:32flaviuvikaton: Some time in the next 10 years.
21:48:04vikatonflaviu: i may be able to halp
21:48:11dtscodeI have far too much of an unhealthy interest in IRC bots
21:48:49flaviuvikaton: Just be patient, I'll get around to it.
21:48:51dom96dtscode: I do too. Let's form a club.
21:49:17vikatonOk
21:49:18dtscode:D
21:49:43dom96whoa
21:49:51*strcmp1 quit (Quit: Leaving)
21:49:51dom96This PR implement's Go's GC in Nim? https://github.com/Araq/Nim/pull/2851
21:50:38dtscodeI need some music then I'll get started. What format should the kicks look like? Just "foo has kicked bar from #baz (Because he is not dtscode)" ?
21:50:58Araqholy shit
21:51:07dom96Araq: I know right?
21:51:09Araqso we have Go's GC for Nim?!
21:51:24dtscodeDoes Go have a good GC?
21:52:12Araqthey claim it's getting excellent
21:52:20*BitPuffin|osx quit (Ping timeout: 264 seconds)
21:52:26pigmejAraq: they claim a lot of things...
21:52:32Araqlol
21:52:34ozrapigmej: is nanomsg in a usable state now? I followed it for a while, having used ZMQ alot... You've used it a bunch?
21:52:35VarriountO_o
21:52:48pigmejozra: depends what do you mean by 'usable'
21:53:03pigmejfor me zmq was not usable at all (specific needs)
21:53:05ozrastable...
21:53:10Araqdtscode: I honestly don't know. It used to be a joke.
21:53:23dom96This implementation is quite short.
21:53:28*BitPuffin|osx joined #nim
21:53:29dtscodeAraq: Most of Go is a joke
21:53:31dtscode:D
21:53:38ozrapigmej: ok, if zmq did "pretty good" for my needs..
21:54:08pigmejozra: the thing is nanomsg is really simple (implemenatation / idea)
21:54:12dom96oh this uses a DLL
21:54:19dom96cool!
21:54:34Varriountdtscode: Now now, lets not be mean.
21:54:39dtscode:D
21:54:41pigmejozra: there are some gotchas, but I haven't used it in very big project yet
21:55:01pigmejprobably the current one with python transmist like 10M events /day
21:55:13ozrapigmej: yeah it was gonna support pluginable arch.. did that land?
21:55:22ozrapigmej: I'll get up to date via the web, save you the trouble :) thanks for reminder..
21:55:38pigmejozra: hard to say for me, I'm not that good in C
21:55:49AraqVarriount: I think we are overdoing this PC nonsense. calling something a joke must remain possible.
21:56:06*intra quit (Ping timeout: 258 seconds)
21:56:27pigmejbut protocol is quite simple
21:56:38ozraGo = fucking joke + 1 hehe
21:56:38pigmejthe protocol protocol ;)
21:56:55pigmejwell, go has a lot of tension... a lot of hype
21:57:02pigmeja lot of buzzwords ,a lot of marketing
21:57:04dom96Guys, let's keep the language bashing down low.
21:57:11pigmejand a lot of money ;-)
21:57:13reactormonkpigmej, I can't get company to suggest me anything
21:57:27ozraa lot of money can get you alot of crap
21:57:32dtscodeI should really fork nim-lang/irc one of these days
21:57:37pigmejreactormonk: ok, I once succededd with some of my backends, so I will try then tomorrow ;)
21:57:38flaviuIt's not fair to classify something as a joke. There are several interesting aspects of Go, even if they've made poor decisions in other areas.
21:57:48dom96dtscode: why? It's perfect? :P
21:57:50pigmejozra: sure, but 99% will not notice it
21:58:02dtscodedom96: To have my own copy for reference
21:58:03reactormonkpigmej, ok. The epc code should work as is.
21:58:12dom96precisely what flaviu said.
21:58:16dtscodeIt is perfect :D. Ruined IRC for me in other languages
21:58:24dtscodeI'm trying to write a c++ lib similar to it
21:58:35dom96I've written an IRC lib in many languages now.
21:58:42dtscode<flaviu> It's not fair to classify something as a joke. There are several interesting aspects of Go, even if they've made poor decisions in other areas.
21:58:46dom96and over the years I have become quite efficient at it ;)
21:58:47ozrapigmej: they probably spent 99% of the money of marketing ;)
21:58:50dtscodeSorry :3 I just really dislike go
21:59:12dtscodedom96: I wasn't suggesting I want to change it :D. Although I might write some documenation for it
21:59:14Varriountdtscode: Like me and Java?
21:59:38dtscodeVarriount: probably :D. Java, php, and go I really don't like
21:59:42reactormonkdtscode, I think the idea of the go GC in nim is awesome. I just don't know about more information on seqs
21:59:51dtscodeI bash ruby though just because its not python
21:59:55ozraGwooaa. Java is _the_ worst! I'd snuggle with go anytime before touching that..
22:00:13reactormonkozra, guess why I didn't major in computer science
22:00:24*Varriount throw an AbstractFactoryBeanFactory at ozra
22:00:28Varriount*throws
22:00:34dom96reactormonk: what did you major in?
22:00:46ozrareactormonk: Congrats to not doing so! haha
22:01:07ozraVarriount: hahaha. ozra-mode shields me and re throws
22:01:13reactormonkdom96, computational linguistics
22:01:31VarriountEh! It buuurrrns!
22:01:33dom96reactormonk: My uni doesn't even do that.
22:01:36dom96AFAIK
22:02:08dtscodeDoes a kick register as an EvMsg dom96 ?
22:02:10ozraVarriount: but it burns in a very verbose way!
22:02:14*anthgur joined #nim
22:03:17dom96dtscode: yep
22:03:34dom96dtscode: There is only EvMsg, EvDisconnect IIRC
22:03:40dom96EvMsg has all the messages.
22:03:46dtscodeEvReconnect :p
22:03:55HOLYCOWBATMANhey java is nice
22:03:57HOLYCOWBATMANhttps://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
22:04:04dtscodeI figured it was. I just didn't want to go digging again to see
22:04:22HOLYCOWBATMANa no-nonsense implementation of FizzBuzz
22:04:23*solidsnack quit (Read error: Connection reset by peer)
22:04:55VarriountHOLYCOWBATMAN: The problem with Java is that it tends to damage the brain. People I've met who work with it tend to look at everything as an object, and get confused when they see a language like Nim
22:05:23HOLYCOWBATMANVarriount: lol just look at the code, you might see that it was sarcasm =)
22:05:30VarriountHOLYCOWBATMAN: I know.
22:05:33HOLYCOWBATMANi cant stand java
22:09:27*anthgur quit (Quit: My Mac has gone to sleep. ZZZzzz…)
22:10:17flaviu85ms load time :D
22:12:02Varriountflaviu: What protocol are you using? HTTPS1 or 2?
22:12:43flaviuVarriount: Looks like github pages uses HTTP1
22:13:19Varriountflaviu: Hm. I remember reading somewhere that loading time decrease is non-linear with http1
22:13:20*vendethiel quit (Ping timeout: 264 seconds)
22:16:55dtscodemessage = i.msg.nick & " has kicked " & i.msg.params[1] & " from " & i.msg.params[0] & " (" & i.msg.params[2] & ")"
22:17:02dtscodeis that format fine dom96 ?
22:17:32dtscode<kicker> has kicked <kickee> from <channel> ([reason])
22:17:43dom96sure
22:17:56Varriountdtscode: What are you building?
22:18:12*vendethiel joined #nim
22:18:52dtscodeVarriount: A dooms day device
22:19:15VarriountO_o
22:21:59dtscodeo.O is jester not in nimble anymore?
22:22:05dom96it is
22:22:12*gsingh93 quit (Ping timeout: 252 seconds)
22:22:38dtscodeI can $ nimble install jester succesfully, but then $ nimble build says it can't open jestr
22:23:39dtscodeDoes nim c not look in .nimble?
22:25:21dom96where are you trying to `nimble build` in?
22:25:48dtscodenimbot/
22:25:59dom96did you add jester to your .nimble?
22:26:10dtscodeWhat do you mean?
22:27:12dom96as a dependency
22:27:34dom96although if you're building nimbot then it should already have it
22:27:54dom96but it does not https://github.com/nim-lang/nimbot/blob/master/nimbot.nimble#L13
22:28:04dom96my bad
22:28:09dom96add it in there
22:28:13*BlaXpirit quit (Quit: Quit Konversation)
22:28:14dom96jester#head
22:28:47dtscodeThanls
22:28:54dtscodeNot thanks, but Thanls
22:29:22dom96ne prolamo
22:30:10flaviuGoogle doesn't really like nim-lang.org: https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fnim-lang.org%2F&tab=mobile
22:30:59dtscodeErr can message[8 .. -2] be changed to message[8 .. ^2] and be semantically the same
22:31:39Varriountdtscode: What type is message? A string?
22:31:50pigmejanyway guys, cu!
22:31:54dtscodeVarriount: I believe so
22:31:57filwitcan anyone know if this is a bug with the cgen or a bug with my 'new' macro: https://gist.github.com/PhilipWitte/2d167c888f95e67f0292#file-concept-nim-L109
22:32:04vikatongoogle doesnt like twitter
22:32:17def-vikaton: me neither
22:32:33filwitShip.new(...) is invoking a 'new' macro which returns a block statement
22:33:04flaviuvikaton: choose one: https://richleland.github.io/pygments-css/
22:33:14flaviumake sure to turn on mixed content on that page
22:33:18filwiti'm not sure if 'seq[T].add <nnkBlockStmt>` is valid AST or not
22:33:31dtscodeoh well I'll just tias
22:33:48vikatonflaviu: monokai
22:34:02*boop is now known as boopisaway
22:34:56dtscodeGreat. nimbot doens't compile on 11
22:35:22Varriountfilwit: Can you actually make a seq[T].add <nnkBlockStmt> in non-synthesized code?
22:35:36dom96dtscode: yes
22:35:41dtscodedom96: It does?
22:35:46Varriountdtscode: Nor does Nimble.
22:35:49dom96you can
22:35:57dom96change it to ^2
22:35:59dom96I mean
22:36:21dtscodeAh
22:36:32dtscodeVarriount: Those damn nim devs :/
22:36:38filwitVarriount: i'm not sure.. what I really want is to return an encapsulated expression.. but without the block node, i get 'item redefined' errors
22:37:07dtscodelib/core/macros.nim(300, 39) Error: ambiguous identifier: 'Response' -- use a qualifier
22:37:16dtscodePlease tell I'm not going to have to fix my stdlib?
22:38:25filwitI'm not sure how to generate a hygenic expression without the blockStmt node
22:40:46Varriountfilwit: Delegate to a template?
22:41:39Varriountfilwit: What about moving the block outside the add operation?
22:41:56filwityeah you're probably right about delegating to a template
22:42:07dom96dtscode: httpclient.response vs. jester.response perhaps
22:42:17dom96The compiler really needs a nicer error message here.
22:42:19*vendethiel quit (Ping timeout: 265 seconds)
22:43:13filwitVarrount: not sure what you mean by "move block outside of add".. if you notice, I'm calling Ship.new(..) a bunch above the line I highlighted and it's working just fine. Either way, I think delegating to a template might work...
22:44:47dtscodedom96: Thanks
22:45:33dtscodeerr where would the response be?
22:45:48VarriountWindows has a header called 'Unknwn.h'
22:48:16flaviuvikaton: Uh, adding a button to the code boxes is going to be almost impossible with the way krandowm works.
22:48:39vikatonoh no D:
22:48:54vikatonflaviu: what about inside the boxes?
22:49:49flaviuspecifically, injecting code like https://i.imgur.com/0PUuPe1.png is impossible.
22:50:17vikatono
22:50:38flaviuAdding a button to the footer should be possible, if a little less obvious.
22:50:48jaco60grrrr
22:50:51vikatonbetter than nothing
22:51:06*vikaton hides behind flaviu from jaco60
22:51:21*Jesin joined #nim
22:52:33jaco60why this code doesn't compile ? http://sprunge.us/PVdJ (i've imported sequtils)
22:52:53dtscodebecause a seq isn't an int :p
22:53:13jaco60foldr don't return a seq
22:53:28jaco60but, wait...
22:53:30dtscodeOh sorry missed that
22:53:36dtscodeCan you give us your error?
22:54:37jaco60Error: execution of an external program failed
22:54:47dtscodeodd
22:55:15VarriountSounds like the C compiler is barfing.
22:55:47jaco60the exact message is : Error: execution of an external program failed; rerun with --parallelBuild:1 to see the error message
22:56:00vikatonI need to listen to some frank sinatra right about now ._.
22:56:06HOLYCOWBATMANfoldr(toSeq(2..n),a * b)
22:56:26HOLYCOWBATMANinstead of toSeq(2..n).foldr(a * b)
22:56:28Araqfilwit: sorry i'm too busy to help you
22:56:42HOLYCOWBATMANjaco60:^
22:56:44jaco60HOLYCOWBATMAN, but a simple let fact = toSeq(2..12).foldr(a * b) works perfectly fine
22:57:13HOLYCOWBATMANprobably something to do with the return
22:57:14Varriountjaco60: It's a C codegen error.
22:57:25Varriountjaco60: Please report it.
22:57:30HOLYCOWBATMANreturn foldr(toSeq(2..n),a * b) works
22:58:24jaco60HOLYCOWBATMAN, yes... odd
22:59:42HOLYCOWBATMANredeclaration of 'result_91009' with no linkage
22:59:50filwitAraq: no problem, i'm doing other things anyways.. will put that off for later
22:59:51Varriountjaco60: https://gist.github.com/Varriount/02507a25e72484ebdfb4
22:59:51jaco60yep
23:00:09jaco60Varriount, same here
23:00:23filwitVarriount: I fixed it by using genSym and not returning a BlockStmt: https://gist.github.com/PhilipWitte/2d167c888f95e67f0292#file-concept-nim-L15
23:00:38filwitVarrount: just showing you for completeness
23:00:40Varriountfilwit: Yay!
23:05:04*solidsnack joined #nim
23:08:27dom96http://forum.nim-lang.org/t/1279
23:09:58dtscodeWhat is a screencast?
23:10:22dtscodeAlso, where do I need to swap out HTTPclient.repsonse with Jester.response dom96 ?
23:10:48dom96dtscode: dunno
23:11:09dtscodedamn
23:11:28*dtscode wonders if he can checkout a v0.10 release
23:12:37vikatonwait
23:12:45vikatonwhich of those photos is Araq ?
23:13:46dom96dtscode: Do you get any other messages from the compiler?
23:14:01dtscodedom96: yeah one sec
23:15:12dtscodedom96: https://bpaste.net/show/80587daeb6bf
23:15:55dtscodevikaton: http://www.oreilly.com/pub/au/6501
23:17:45dom96dtscode: Did you change the code?
23:18:01dtscodedom96: of Nimbot? sure
23:18:09dom96how?
23:18:16dom96what did you change I mean
23:18:48dtscodeI added that MKick stuff to irclogrender.nim
23:19:02dom96was it compiling before you added it?
23:19:11*dtscode shrugs
23:19:14dtscodeI didn't try that
23:19:17dom96ok...
23:19:24dom96try removing 'httpclient' from the import line
23:19:30dom96and then write from httpclient import nil
23:19:41dom96then fix errors
23:19:48dtscodeok
23:19:54Araqimport httpclient except foo, bar
23:19:58dom96or that
23:20:04dom96import httpclient except Response
23:20:12dtscodeOk thanks
23:20:53*vendethiel joined #nim
23:21:02dtscodeOh goody it compiled
23:21:09dtscodeDoes nimble have a -y option?
23:23:12flaviuvikaton: Pushed!
23:23:35vikaton:O
23:23:52dom96dtscode: yes
23:24:19vikatonflaviu: Nice job !
23:24:22VarriountAraq: MSDN... is huge.
23:24:23dtscodeOdd now nimbot doesn't want to run
23:24:37*dashed quit (Quit: Connection closed for inactivity)
23:25:32vikatondtscode: does it just not run, or compile error?
23:25:39dtscodevikaton: Not run :p
23:25:57vikatondtscode: Yeah I got that a few times with my Nimbot
23:26:14dtscodeerr the nim-lang nimbot?
23:26:16vikatonI would logout then try again
23:26:28dtscode?
23:26:29vikatonNo just ysing the irc module in general
23:26:36vikatonusing*
23:26:43dtscodeThat works fine. I use that all the time
23:26:47dtscodeI'm talking about dom's bot
23:30:32dtscodedom96: Why does your bot not want to run with src/nimbot --il logs/
23:36:48dom96dtscode: gimme a sec
23:37:05dtscodeone mississippi
23:37:07dtscode:D
23:38:06*kumul joined #nim
23:39:38*gsingh93 joined #nim
23:42:15*vendethiel quit (Ping timeout: 265 seconds)
23:44:09*dtscode quit (Remote host closed the connection)
23:48:51*solidsnack quit (Ping timeout: 272 seconds)
23:49:20*dtscode joined #nim
23:53:45ozraanyone here know off the bat: './koch tests' - does it compile the tests with '--lib:./lib'? Or does it use libs as found by paths?
23:54:14dom96dtscode: ok
23:54:23dtscodeYou figured out the issue?
23:54:31dom96nope
23:54:36dom96but I have time to help you now
23:54:36dtscodedamn
23:55:06ozradom96: Do you now about above? ^
23:55:20dtscodeOk. So the only things i have changed is IRClogrender.nim (to make it render kicks) and the channel that it joins in nimbot.nim
23:55:34dom96ozra: not sure unfortunately
23:55:46dom96dtscode: try adding some echos in open()
23:55:48ozraok.
23:55:53dom96see where it blocks
23:55:54dtscodeI then build it successfully, and try src/nimbot --il logs/ but it just keeps spitting out that syntax call
23:56:06dom96what does it spit out?
23:57:15dtscodedtscode@dtscode-305E4A-305E5A-305E7A:~/Desktop/projects/nimbot$ src/nimbot
23:57:15dtscodeNo IRC logs filename specified.
23:57:54dom96specify the logs filename?
23:58:02dtscodeI did, with --il
23:58:38cazovyou specified a directory, not a filename. you could try --il logs/log.txt ?
23:59:01dtscodeI tried a filename too
23:59:09dtscode(alhtough a directory is a file :p)
23:59:40cazov(fair point :p)
23:59:44dom96you didn't in what you pasted