<< 01-05-2014 >>

00:03:53*gsingh93_ quit (Ping timeout: 265 seconds)
00:04:12*Matthias247 quit (Read error: Connection reset by peer)
00:05:51*gsingh93 quit ()
00:11:25*gsingh93- is now known as gsingh93
00:14:23*gsingh93_ joined #nimrod
00:38:13SkrylarEXetoC: is the opengl module you were working on usable?
00:42:57Jehan_Eep.
00:43:15Jehan_The number of workers useable by spawn is hardcoded as 4?
00:43:34VarriountJehan_: spawn is still in the alpha stage at the moment.
00:44:00Jehan_Yeah, I was wondering why the hell I was capped at 400% CPU usage on a 64-core machine. :)
00:44:10Jehan_Okay, createThread() it is. :)
00:44:13VarriountYou have a 64 core machine?
00:44:38VarriountI take it you're not using the average home desktop then?
00:45:14EXetoCSkrylar: yes. it triggered an ICE for Demos though
00:45:48VarriountWhatever OpenGl wrapper I used for the OpenGl tutorials I followed works.
00:46:01*DAddYE_ quit (Remote host closed the connection)
00:46:42EXetoCwell I rewrote it 2-3 weeks ago
00:47:04VarriountWhy?
00:48:08Jehan_Technically, I could use a Cray XE, but someone would be very unhappy if I spent research money there for experimenting with Nimrod.
00:48:26VarriountJehan_: Yeah, but what are you currently using?
00:48:30Jehan_And the reason is that I have access it for work.
00:48:44Jehan_At home, an iMac or Macbook Pro.
00:49:09Jehan_The 64 core machines are just standard AMD Opteron machines.
00:50:02Skrylaroh joy. i get to fiddle with more stuff: http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf
00:50:05EXetoCVarriount: I replaced the old one that is, which wasn't implemented by me. I added some missing symbols and optionally automatic error handling
00:55:21Skrylarapparently valve made up some weird thing where you blur a font texture and it makes it so you can scale it up/down... Qt uses it in one place
00:55:53VarriountSkrylar: I skimmed through that paper. Looks really neat.
01:00:18*njoejoe quit (Ping timeout: 240 seconds)
01:03:25SkrylarVarriount: yeah, i might have to rethink some of my text rendering code
01:03:50Skrylarapparently QML uses that technique so they don't have to make a glyph cache for every font size, you just made a single one and zoom
01:04:25*njoejoe joined #nimrod
01:04:38*gsingh93_ quit (Ping timeout: 255 seconds)
01:05:44*Jesin joined #nimrod
01:05:51VarriountI don't suppose any of you guys has used ReadDirectoryChanges in combination with IO completion ports before?
01:16:59njoejoeVarriount: I haven't. not sure these are the magical search keys, but sometimes i search github for key functions to get started: https://github.com/search?q=CreateIoCompletionPort+ReadDirectoryChanges&ref=searchresults&type=Code
01:19:26Varriountnjoejoe: Thanks for the tip about github.
01:21:24*gsingh93_ joined #nimrod
01:21:28*gsingh93_ quit (Client Quit)
01:31:23Jehan_If anyone wants to look at a parallel version of the codegolf example:
01:31:26Jehan_https://gist.github.com/rbehrends/cf84a2cd8b407f4fc612
01:32:06Jehan_I still have to find an eight core machine to compare it to the C++ version, but I expect it should compare reasonably well.
01:32:14Jehan_Despite not pulling any dirty tricks.
01:32:35Jehan_Anybody who needs context: http://codegolf.stackexchange.com/questions/26371/how-slow-is-python-really-part-ii
01:32:48Demosa day well spent :D
01:33:12Jehan_Not really a day, more like a couple of hours total. :)
01:33:52njoejoeneed a version of nimrod > 0.9.4? (12, 18) Error: undeclared identifier: 'TThread'
01:34:28Varriountnjoejoe: Import threading.
01:34:32Jehan_need to compile with --threads:on
01:34:50VarriountNimrod needs a joke module, like python and braces.
01:34:59Jehan_nimrod cc --threads:on -d:release --passc:-flto
01:35:16njoejoeworked. and FAST!
01:35:17Jehan_--passc:-flto only for clang.
01:35:43VarriountI dunno if flto will work for me, being on windows and such.
01:35:53Jehan_Yeah. The credit largely goes to clang (Nimrod insofar as it produces C code that the C compiler can optimize well).
01:36:07Jehan_Just skip -flto, that's just another 10% or so.
01:36:25Jehan_It's mostly so that the RNG call can be inlined.
01:36:47Jehan_What is interesting is that tail recursion leads to faster code here than using a loop with break.
01:36:49Demosyou can use /LTGC on windows I think
01:37:00Demosalso -flto works with gcc
01:37:17Demosin fact I thought the "proper" way to do it with clang was to use some kind of "emit llvm" command
01:37:35VarriountDemos: Yeah, I know. However I've heard that -flto on gcc is unstable.
01:37:57Jehan_But really, the interesting part is that this is a fairly faithful implementation without speed hacks and is still competitive.
01:38:25njoejoe0.2 seconds on my machine vs 70 seconds for pypy
01:39:10Jehan_How many cores/hyperthreading?
01:39:40Jehan_On my fairly old quadcore it's about 0.34 seconds vs 89 for PyPy.
01:40:13Jehan_On 64 cores with as many threads about 0.07 seconds, a good part of which is startup time. :)
01:40:18njoejoeIntel(R) Core(TM) i7-3610QM CPU @ 2.30GHz (4 cores)
01:41:14Jehan_I'll probably give it a review tomorrow (to make sure I don't have any inadvertent bugs) and post it then.
01:42:20*gsingh93_ joined #nimrod
01:43:42njoejoejust think how fast it could be with hardware RNG! http://wiki.openssl.org/index.php/Random_Numbers#Hardware :-)
01:44:43VarriountOh wonderful. Even without -flto, the codegolf thing doesn't work for me. It just crashes.
01:45:05VarriountT_T
01:45:33Jehan_Bug in the code or in the compiler?
01:46:11VarriountIt compiles correctly, but when I run the resulting binary, I get a straight crash. Even without -d:release, there's no stack trace.
01:46:36VarriountObserving the process with Process Monitor doesn't reveal anything.
01:47:27Jehan_Sounds like something goes wrong in one of the threads.
01:48:09VarriountDemos: Have been able to compile it with VCC? If so, what command did you use?
01:48:35Demosthe codegolf thing?
01:48:40VarriountYeah.
01:49:07*DAddYE joined #nimrod
01:52:37Demosyeah it segfaults
01:52:42Demoslocks.nim line 137
01:53:06VarriountYou got stack trace information?
01:53:41*DAddYE quit (Ping timeout: 255 seconds)
01:54:36Demosworking on it
01:56:28Jehan_Ugh, lock may need to be initialized.
01:57:20Jehan_Yeah, that'd be it.
01:58:56Jehan_Okay, updated it, and got a bit more speed out of it, too.
02:00:41VarriountUm. It finished instantly.
02:00:43Jehan_This is where the lack of constructors really bites you.
02:00:44njoejoe0.185s for me
02:01:04Varriount(Now how do I get timing information)
02:01:11Jehan_Heh.
02:01:27Jehan_A really good stopwatch and fast reactions? :)
02:01:47Jehan_On Unixes, it's just the time command.
02:01:53DemosI got 344 ticks
02:02:02DemosMeasure-Command
02:02:08njoejoevery impressive. i notice no use of "spawn". is spawn not the way to use multicore with nimrod?
02:02:09Demosso from a visual studio command prompt you type:
02:02:23Jehan_Spawn is currently capped at four worker threads.
02:02:23Demos@powershell Measure-Command {./golf.exe}
02:02:33Varriountnjoejoe: Spawn is still in the very early stages of development.
02:02:36Jehan_I used spawn initially, but then was told it was alpha still.
02:02:53njoejoegotcha
02:03:40Demos3.56 million clock ticks
02:03:41renesachow much smaller would the code be using spawn?
02:03:50Jehan_Not much.
02:04:01Jehan_The createThread() calls would be replaced by spawns.
02:04:12Jehan_And the joinThread() loop by a single sync().
02:04:15renesacthe performance should be the same, right?
02:04:38Jehan_Pretty much, except that right now you can spawn at most four threads at once.
02:04:47renesacyeah, I know
02:05:09Jehan_As a matter of fact, performance is roughly the same for me with spawn on a quadcore machine.
02:05:28renesacusing more threads than cores helps?
02:05:28VarriountJehan_: Are you going to submit that to the codegolf page?
02:05:35renesacor hurts?
02:05:41Jehan_Yeah, tomorrow, after I've had time to sleep on it.
02:06:19Jehan_Depends on what you're doing.
02:06:26renesacin this benchmark
02:06:36Jehan_In this benchmark, it shouldn't matter much.
02:06:43Jehan_Except if you've got hyperthreading.
02:07:42Jehan_The effect of hyperthreading is a bit unpredictable. Should help, but doesn't always.
02:08:29VarriountI noticed noone used PHP on that codegolf page. :3
02:08:44Jehan_Wonder why. :)
02:09:26VarriountIt would be interesting to see what a Forth implementation would look like.
02:09:30renesacwe need a nimrod->brainfuck compiler
02:09:48Jehan_Speak for yourself. :)
02:09:53Demosah randomly flipping signs in my shaders fixed my problem
02:10:13VarriountDemos: The programmer equivalent of mashing buttons to get things working.
02:11:39Demosall too common with graphics code
02:11:56DemosI bet we could automate this a bit
02:11:59*superfunc joined #nimrod
02:14:37VarriountHi superfunc
02:14:51superfuncwassup
02:18:21Demosgot it to 309s with LTCG
02:19:11VarriountWait, so it's actually /slower/?
02:19:18*superfunc quit (Ping timeout: 240 seconds)
02:19:20Demossorry 309ms
02:19:26Demosit was 344 before
02:20:22VarriountDemos: Is there a way to tell the measure command to choose the best time out of a predetermined count?
02:20:44DemosI dun know
02:25:26VarriountHm. Enabling flto with gcc doesn't really lower the min speed I get (300ms)
02:27:26Jehan_Yup, I was using -flto with clang, where it did help.
02:27:39Jehan_Code optimization is a black art, anyway.
02:28:18Jehan_As I said, it surprised me that tail recursion was actually faster than using break.
02:28:30VarriountOddly enough, with -flto enabled the timings are more erratic/varied.
02:28:56Jehan_There is some unavoidable randomness either way.
02:29:20*Jesin quit (Ping timeout: 246 seconds)
02:31:47Jehan_Anyhow, time to get some sleep, even though it's a holiday tomorrow (today?). Night!
02:32:09VarriountGoodnight!
02:32:22*Jehan_ quit (Quit: Leaving)
02:33:09VarriountDemos: When I compile with vcc, I get timings in the 470ms range.
02:33:49*DAddYE joined #nimrod
02:35:39Demoswell PGO did nothing, which is not suprising for such a small app
02:37:23VarriountGoodnight Demos, et al
02:37:57njoejoegnite Varriount
02:40:12*gsingh93_ quit ()
02:40:44*Jesin joined #nimrod
03:06:51*superfunc joined #nimrod
03:07:15superfuncVarriount: my bad, forgot I had to go talk with a teacher
03:19:29*superfunc quit (Quit: Page closed)
04:01:01*xenagi quit (Quit: Leaving)
04:42:14*bjz joined #nimrod
04:51:06*menscrem joined #nimrod
05:28:48*[1]Endy joined #nimrod
05:33:06*darithorn quit (Ping timeout: 240 seconds)
05:36:09*DAddYE quit (Remote host closed the connection)
05:36:35*DAddYE joined #nimrod
05:40:47*DAddYE quit (Ping timeout: 245 seconds)
05:52:38*DAddYE joined #nimrod
06:05:47*superfunc joined #nimrod
06:07:25*nande quit (Read error: Connection reset by peer)
06:09:48*superfunc quit (Ping timeout: 240 seconds)
06:42:48*menscrem quit (Ping timeout: 240 seconds)
07:18:35*Demos quit (Read error: Connection reset by peer)
07:22:02*olahol quit (Quit: Lost terminal)
07:49:42*skyfex joined #nimrod
07:54:26*DAddYE quit (Remote host closed the connection)
07:55:00*DAddYE joined #nimrod
08:00:11*DAddYE quit (Ping timeout: 276 seconds)
08:13:30*springbok quit (Ping timeout: 240 seconds)
08:32:57*Matthias247 joined #nimrod
08:56:58Araqhi skyfex wb
09:03:41Skrylarwow libjpeg's headers are old
09:03:51Skrylardoes nimrod even have a 'far pointer'?
09:06:10skyfexAraq: hi, been a while :)
09:08:00skyfexfyi, I have a little program that's used every day at work now
09:08:07skyfexwritten in Nimrod
09:08:29skyfexGonna upload the code to github soon.. but it's hideous at the moment though
09:11:53*io2 joined #nimrod
09:16:07*io2 quit (Client Quit)
09:23:12*menscrem joined #nimrod
09:23:45menscremhi all
09:24:41*io2 joined #nimrod
09:26:27*[2]Endy joined #nimrod
09:27:53Skrylarhi menscrem
09:30:21*[1]Endy quit (Ping timeout: 265 seconds)
09:31:02SkrylarAraq: well i found a new way to stress test c2nim
09:31:10Skrylarthrow an archaic libjpeg header at it
09:31:21Skrylarthey're full of absolutely horrible things like #defines for constants in the MIDDLE of a structure
09:32:17*io2 quit (Remote host closed the connection)
09:32:19*[1]Endy joined #nimrod
09:32:59*io2 joined #nimrod
09:33:19*io2 quit (Remote host closed the connection)
09:33:25skyfexThere, it's up on Github: https://github.com/skyfex/kiosk
09:35:39*io2 joined #nimrod
09:36:23*[2]Endy quit (Ping timeout: 276 seconds)
09:38:17Skrylarskyfex: your screenshots contain errors, so says firefox :(
09:42:35skyfexSkrylar: Works for me :P
09:42:55skyfexeven in FF
09:43:02skyfexbut it's old though
09:44:04Araqcool
09:44:05*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
09:44:14Araqthe screenshots work for me
09:44:55*io2 joined #nimrod
09:45:31Skrylari'll try on a different computer
09:48:33Skrylarworks over there
09:48:37Skrylari wonder whats wrong with my ff
09:49:45*io2 quit (Client Quit)
09:51:01*io2 joined #nimrod
09:53:45*io2 quit (Client Quit)
09:55:36*io2 joined #nimrod
09:55:57*io2 quit (Remote host closed the connection)
10:02:11*uvelichitel joined #nimrod
10:15:20Skrylarhuh.
10:15:40Skrylari went and checked how godot does fonts.. it also does fixed-size premade bitmaps and has hell with asian fonts
10:16:21Skrylari think the auto-packing font thing i had planned for nimrod coupled with the distance field technique for scalable fonts might actually be state of the art xD
10:17:50*njoejoe quit (Quit: Page closed)
10:18:20*njoejoe joined #nimrod
10:19:59*[2]Endy joined #nimrod
10:23:33*[1]Endy quit (Ping timeout: 252 seconds)
10:31:24*[1]Endy joined #nimrod
10:34:05*[2]Endy quit (Ping timeout: 246 seconds)
10:37:02dom96skyfex: Awesome, you should make a video showing it in action :D
10:41:19Araqwe got our first spam bot
10:41:35Araqthat means we need a new captcha
10:42:21Araqthe idea behind the current one was that nobody would bother to solve it since it's not used anywhere else
10:44:50dom96aww, did you remove it already?
10:44:52dom96What did it say?
10:49:39dom96and how do you know it was a spam bot?
10:49:55Skrylarthe account was named spammusbutt333
10:50:08Araqit was about losing weight made easy
10:50:19dom96So? Maybe a human solved the captcha.
10:51:01*[2]Endy joined #nimrod
10:52:01Araqtrue
10:55:02*[1]Endy quit (Ping timeout: 276 seconds)
11:25:13*springbok joined #nimrod
11:25:47*springbok quit (Changing host)
11:25:47*springbok joined #nimrod
11:38:59skyfexdom96: I will, but right now it's text based.. I want a flash graphical UI first :P
11:40:54EXetoCoh no
11:45:53*BitPuffin quit (Ping timeout: 255 seconds)
11:46:24*BitPuffin joined #nimrod
12:35:20*wan joined #nimrod
12:41:23wanAraq: I've converted a nicer-looking captcha (still using cairo) if you want: https://gist.github.com/idlewan/d1e8d0af59e93a78274d
12:45:11*uvelichitel quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:02:50Araqwan: a screenshot would be nice ... ;-)
13:04:46dom96Araq: look at the comment in the gist
13:08:40Araqok. That's pretty hard to read for a human being though.
13:10:57wanYes, well, it's a captcha
13:11:30wanIt wouldn't be one if it was easy to read for a human (thus for a machine as well)
13:12:27wanbut it's possible to tune the opacity of the circles
13:12:36Araqwell the point of the current captcha is that it is simple to read and yet requires math :P
13:13:03Araqso that you have to adapt the captcha solver
13:13:16Araqand since that's work people wouldn't do it
13:19:10wanYou can still display "3+999" as text, but have it more readable by changing the 0.4 opacity in the set_source_rgba to something less opaque
13:19:26*darkf quit (Quit: Leaving)
13:25:10wanby the way, in the current nimforum code, are captcha files ever deleted? Or does someone purges the folder manually?
13:27:13Araqiirc they are re-used
13:30:10*Jehan_ joined #nimrod
13:31:46wanah, mod 10000 on the id, missed that
13:41:14*uvelichitel joined #nimrod
13:42:53*lesshaste joined #nimrod
13:42:56lesshastehi
13:43:06lesshasteis there a nimrod compiler for ubuntu?
13:44:49uvelichitelHi. Can I somehow express proc(arg: doable): in meaning my proc would be happy with arg of any type if it has method arg.dosomething implemented?
13:45:04*wan quit (Quit: leaving)
13:52:12Jehan_uvelichitel: I think what you're looking for is parametric polymorphism (a.k.a. generic types).
13:55:19Jehan_proc f[T](arg: T) =
13:55:19Jehan_ mixin dosomething
13:55:19Jehan_ dosomething(arg)
13:55:19Jehan_proc dosomething(x: int) =
13:55:19Jehan_ echo x
13:55:19Jehan_f(99)
13:56:09uvelichitelJehan_: I see. Thanks
13:56:14Jehan_Templates (i.e., macros) can also accomplish the same thing.
13:57:20Jehan_template g(arg: expr): stmt =
13:57:20Jehan_ dosomething(arg)
13:57:20Jehan_g(100)
13:57:29Jehan_But be careful with those.
14:00:14Jehan_User-defined type classes allow you to specify more specific constraints than "mixin" does, but I believe they're still somewhat beta-ish.
14:03:34*lesshaste quit (Quit: Leaving)
14:19:29Araqyeah they are beta-ish and what's worse they don't yet affect symbol binding rules, so 'mixin' is still necessary. sometimes.
14:20:03OrionPKlesshaste nimrod should work on ubuntu just fine
14:20:34Araqsymbol binding rules are the hardest part in nimrod's design, I wonder if we'll ever get them "right"
14:21:13Jehan_Binding in conjunction with metaprogramming is always hard. I'm not sure it's even possible to properly define "right". :)
14:22:19Jehan_Incidentally, I got some more performance out of the codegolf example and posted it: http://codegolf.stackexchange.com/questions/26371/how-slow-is-python-really-part-ii/26479#26479
14:23:56dom96Argh, I can't upvote it.
14:24:33Jehan_You probably don't have enough rep. In any event, I'm just as happy with people not stuffing the ballot box. :)
14:25:01dom96Yeah, I need 15. In any case, great job!
14:25:42Jehan_The really interesting part is how pointless some of the micro optimizations you can try are.
14:25:53Jehan_Some of the stuff I experimented with made things even worse.
14:26:01Jehan_Even though it was impossible to tell why.
14:26:30Jehan_Even when they didn't obviously did to pipeline stalls, branch mispredictions, or confused the optimizer.
14:26:50Jehan_s/did to/lead to/
14:27:54Araqyeah. modern cpus are just too strange
14:28:06AraqI recently timed:
14:28:17Araq for i in 0..10_000: inc globalVar
14:28:19Araqvs.
14:28:28Araq for i in 0..10_000: inc localVar
14:28:34Jehan_I also note that since Nimrod compiles to C, you can obviously get the exact same performance in C/C++. :)
14:28:49Araq atomicInc(globalVar, localVar)
14:29:06Jehan_Oh! Do you know that nimrod cpp --threads:on doesn't seem to work?
14:29:06Araqand got no difference beyond the measurement noise
14:29:38Araqwas multi-threaded ofc, so the accesses to the shared global should kill it
14:29:46Araqbut didn't
14:29:51Jehan_Hmm, what exactly did you compare? the increment of the global and local variables or vs. atomic increments?
14:30:25Araqwell the benchmark was more complex
14:30:43Araqbut this was one difference that I tried
14:31:10Jehan_There's generally no way around atomic operations being expensive.
14:31:32Araqwell it was done in a branch
14:31:33Jehan_But local vs. global -- wouldn't be surprised there.
14:31:45Araqmaybe I got the basic frequencies wrong
14:31:55Araqand so what's in the branch didn't matter
14:32:24Jehan_The thing about atomic operations is that they essentially ignore caches and write/read directly to/from main memory.
14:32:42Jehan_To put it somewhat simplistically, it's actually a bit more complicated on modern processors.
14:33:21Jehan_So, there's an unavoidable 50 clock cycle lag, give or take, for any code that depends on an atomic instruction.
14:34:01Jehan_Of course, for code that doesn't depend on it, and if it happens infrequently, it might not be that bad.
14:34:17dom96Araq: Is the profiler still broken?
14:34:34Araqdom96: I didn't fix it
14:34:35Jehan_On the other hand, it was much worse on older CPUs (where atomic instructions essentially locked down the memory bus entirely).
14:34:38OrionPKJehan_ whats the speed diff?
14:34:50Jehan_OrionPK: Between what and what?
14:35:17OrionPKevery other post has a 50x speedup"
14:35:18OrionPK"
14:35:29OrionPKexcept yours
14:35:59Jehan_No, the C++ implementation has a 500+ speedup or so on eight cores.
14:36:34Jehan_On my quadcore machine, I go from 89 seconds to .15 seconds (gcc-4.9, -flto).
14:36:41Jehan_Which is also a little over x500.
14:37:06OrionPKcomparing apples and oranges?
14:37:13OrionPKdifferent algorithms to produce the same result?
14:37:34Jehan_No, my algorithm is actually pretty faithful to the original.
14:37:42OrionPKoh ok
14:37:47OrionPKnice
14:38:20dom96Jehan_: Maybe you should include the '500x' beside "Nimrod" (in the title)
14:38:49Jehan_dom96: I could, but I'm not big on advocacy. :)
14:39:12*Jesin quit (Quit: Leaving)
14:39:22*darithorn joined #nimrod
14:39:26Jehan_It's down in the text for anybody who really cares, with proper context of how the speedup is measured.
14:39:46OrionPKI'm big on consistency :P
14:39:51OrionPKur post is not consistent w/ the other posts
14:40:02Jehan_In what way?
14:44:15OrionPKin not having a speed difference from the op
14:45:10Jehan_The OP is in Python, there should be a difference?
14:46:24dom96The only inconsistency as far as I can see is that the "500x" is not in the title.
14:46:31dom96It is mentioned in the text.
14:46:57AraqJehan_: I read http://www.1024cores.net/home/scalable-architecture/parallel-disk-io/the-solution and I think our thead pool should get some magic to activate as many threads as is reasonable and adapt the number to the workload
14:46:57Jehan_Yup. And it's speedup on an architecture that's different from what the other people (or the OP) use.
14:48:27Jehan_I'm not sure I understand what you mean by that?
14:48:53Araqwell I only have some vague ideas
14:49:25Jehan_Do you mean not starting more threads than is necessary initially and create new workers on demand?
14:49:35Araqbut --threads:on could profile IO operations and try to see if it's IO bound or CPU bound at runtime
14:50:29AraqJehan_: yes, creating new workers on demand, or perhaps start with a high number but disable most of these initially
14:50:44Jehan_Probably don't want to start a high number.
14:51:07Jehan_Threads require resources (such as stack memory).
14:51:37Araqyeah but fixed size arrays are nice :P
14:51:39Jehan_Also, some architectures may have only a limited number of threads available to support.
14:51:54Jehan_Yeah, but no need to prepopulate them. :)
14:51:58Araqwell "many" is still <= 256 here
14:52:11Araqbut anyway, that's just a detail
14:52:15Jehan_I'm thinking of having hundreds of processes with hundreds of threads each. :)
14:55:34Jehan_And interesting, I didn't know that rawProc and rawEnv existed.
14:56:37Jehan_I have to say, much as the rough corners of Nimrod frustrate me at times, the sheer amount of work that has gone into it is pretty darn impressive.
14:57:31Jehan_Eh, s/corners/edges/
14:57:57renesacJehan_, you can use the new syntax for array declaration
14:58:01renesacjust the lenght
14:58:05renesacnot a range
14:58:06Araqthanks
14:58:13AraqI need to go, bbl
14:58:20Jehan_Yes, I know. That's not even that new.
14:58:29Jehan_I prefer to be explicit about ranges, though.
14:59:23renesacand have you tried {.inline.} and {.noinit.} as micro-optimizations?
14:59:52Jehan_-O3 -flto already does inlining automatically.
15:00:08Jehan_{.inline.}, as I recall, just puts an inline on the corresponding C function.
15:00:26renesacan additional hint to the compiler
15:00:40Jehan_Yeah, and the compiler usually knows better what it does.
15:00:43renesacbut probably don't changes
15:01:12Jehan_From my brief glimpse at the disassembly, pretty much all of it ends up in one big assembly routine either way.
15:01:17renesaclast I heard, gcc decided to inline or not based on line count
15:01:24renesacright
15:01:45Jehan_And {.noinit.} is not useful anywhere, even if I wanted to use it.
15:01:53renesacand how about {.noinit} for the vectors?
15:01:54Jehan_It's actually not based on line count, but IR size.
15:02:58Jehan_That would avoid only a couple of initializations once per thread.
15:03:04OrionPKyou mean noinit is not useful in your code?
15:03:19OrionPKI've had big performance improvements from using noinit
15:03:25Jehan_OrionPK: exactly.
15:04:12renesacoh, you re-use the same vector many times
15:04:22Jehan_The only place where I could avoid the initialization is mainThread().
15:04:37Jehan_Which does not even amount to a rounding error.
15:04:53renesacyeah, I didn't saw that you reuse the same vectors
15:05:20renesacand have you tried a xorshift PRNG?
15:05:40Jehan_The big advantage over C is: I can turn on bound checks, suffer virtually no performance loss, and get automatic memory safety.
15:05:48Jehan_The code uses the xorshift RNG now.
15:05:52OrionPKhow often do you call random
15:05:54renesacoh, now I see that you replaced for your own
15:05:56OrionPKyou could do noinit on that
15:06:09Jehan_Partly because the Mersenne generator in the lib has some inefficiencies.
15:06:23Jehan_There's no use for noinit in random().
15:06:49Jehan_The only local variable in random has to be initialized and is (from the RNG state).
15:07:09OrionPKthe result variable is initialized
15:07:17OrionPKand then overwritten
15:07:23Jehan_Yes, and the compiler optimizes that away.
15:07:27OrionPKdoes it?
15:07:29OrionPKit didnt used to
15:07:36renesacOrionPK, : only once per thread, right?
15:07:42Jehan_Using {.noinit.} on ints is a waste of time. :)
15:07:51OrionPKtrue renesac
15:07:53renesac^
15:08:07Jehan_And introduces potential bugs.
15:08:08renesac{.noinit.} is for vectors and other objects
15:08:19Jehan_If I wanted to risk that, I'd write C in the first place.
15:08:27renesacints the compiler really optimizes the initialization away
15:08:34Jehan_{.noinit.} is to be used only after careful consideration on performance-critical code.
15:09:31renesacand you really should put the speedup on the title, like everybody else
15:09:42Jehan_Not without context. :)
15:09:48renesacpeople won't care to look at a text wall for a speed up of 5
15:10:02Jehan_I'm an academic, posting under my real name.
15:10:11Jehan_If it works, the OP will put it in the main post.
15:10:36renesaccontext like the number of cores?
15:10:46renesacor the full context of every optimization you tried and failed?
15:10:48renesac:P
15:10:51Jehan_Architecture, number of cores, yeah.
15:10:58renesacC++: x200 (4-core i7, should scale to x400 on 8-core)
15:11:03renesac<-- like that guy?
15:11:14renesacit is not difficult
15:11:34Jehan_Like that, but I'd also like someone else to review it first.
15:11:51Jehan_As I said, advocacy is not my thing. I leave that to dom96. :)
15:12:03renesacit is like any claim in a title, if you are catch by it, you will read the rest of the article to see exactly how they got it
15:12:37Jehan_Incidentally, the C++ header may overstate its claim.
15:12:47Jehan_You do not necessarily see a linear speedup.
15:13:09Jehan_I peaked out at a 35ish speedup or so on a 64-core machine, and only after increasing iters.
15:13:31Jehan_Even going from 4 to 8 threads didn't quite double the speed.
15:13:48renesacright
15:13:59Jehan_Performance numbers just don't make good soundbites.
15:17:57renesacand the ubuntu user asking for nimrod for it's os probably didn't find it with apt-get
15:18:11Jehan_The Ubuntu user is the OP, alas. :)
15:18:53Jehan_For what it's worth, I tried and installed it on a RedHat system the other day from Git, just following the instructions there, so it shouldn't be too hard.
15:19:07renesacdid we ever had an debian/ubuntu package?
15:19:17Jehan_No idea.
15:19:19renesacyeah, but apt-get is easier
15:19:39Jehan_Oh, I agree. Push-button solutions are always easier. Problem is, someone has to prepare them. :)
15:19:59renesaconly heard of arch-linux having a nimrod package
15:20:08Jehan_I should probably look into submitting a PR for Homebrew.
15:20:15renesacyeah, nothing in computers is easy until someone makes it so...
15:20:18*wan joined #nimrod
15:20:19Jehan_Which is still on 0.9.2
15:22:03dom96niminst can generated deb packages
15:22:31dom96if someone wants to create a 0.9.4 .deb I can include it on the download page
15:22:32Jehan_I think the work is more navigating the Debian bureaucracy.
15:22:41Jehan_To have it included there.
15:22:58dom96oh yeah, including it in the debian repos is a lot more work.
15:25:01wanRound 9 results of the web framework benchmarks: https://news.ycombinator.com/item?id=7680261
15:25:33wanNimrod is not bad on the updates test: http://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=update
15:25:56dom96it's been a while since round 8
15:26:08dom96glad they are still doing them
15:26:15dom96New async should be ready for round 10!
15:26:47Jehan_Hmm, under what name is Nimrod participating there?
15:26:47wanAnd there is room to grow for nawak (augment workers from 42 to 256 will surely get more for 'updates' test)
15:26:49renesachave you done any optimization between rounds 8 and 9?
15:26:54renesacJehan_, jester
15:26:55wanNawak
15:27:02wanand jester too for json test
15:27:11renesacops
15:27:13renesacyea
15:27:14renesach
15:27:20Jehan_Ah, I didn't see Jester, which is why I asked.
15:27:52dom96I wonder why nawak is missing from EC2 on the data updates test
15:27:55renesacjester is in another tab
15:28:08wanIt's missing too from peak
15:28:16dom96yeah
15:29:07renesaclua is on top of the single query benchmark
15:29:15Jehan_While I hate optimizing code for benchmarks, JSON is useful enough in general that performance may be worth looking at for other use cases, too.
15:29:17dom96interesting that nawak performs worse than jester on the json test
15:30:21wanI don't know why nawak isn't on ec2 and peak. Maybe they had trouble installing Mongrel2 or something, but they did it manually on i7.
15:30:48dom96jester isn't on ec2 either
15:32:59dom96maybe they didn't want to spend any more money on ec2
15:33:48wannawak in its current form has probably a lot of overhead (Mongrel2 handling http, passing on through zeromq to nawak) and it will never take the lead for the not-so-important brute tests (json, plaintext). However it is trivial to add workers, and this fact only boosts the concurrency level when slow operations (db) is involved.
15:34:03wanFortunes test is winnable (http://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=fortune)
15:34:33dom96wan: indeed. Good job :)
15:34:51dom96Hopefully new async will also help nawak.
15:35:24wanWe'll have to update nimrod's version too, I pinned to an end-of-december commit previously.
15:35:42dom96indeed
15:35:57wanI'm realy
15:36:06wan*really interested in new async
15:36:20wanhowever we have to make db wrappers async too
15:36:21Jehan_Random aside: One of the killer features of Nimrod for me is that I can package the compiler with any software I'm writing.
15:36:33Jehan_In source form, no less.
15:36:54Jehan_That isn't really practical with, say, Mono.
15:36:59dom96wan: That's good to hear, may still take some time before new async is fully functional and well tested though.
15:40:44wanWith new async, jester should be able to surpass Mongrel2+nawak on everything, if it works correctly and you use a db connection pool
15:41:12*bjz quit (Ping timeout: 245 seconds)
15:46:26dom96wan: heh, looks like we both commented about Nimrod at the same time
15:46:55dom96I'll delete my comment and reply to yours
15:49:05wankay thanks
15:49:28dom96there
15:50:17dom96oh dear, looks like someone beat you to it: https://news.ycombinator.com/item?id=7680242
15:51:03dom96your link isn't even on the front page anymore :(
15:51:15dom96wan: can you make the some comment in that thread?
15:51:32Jehan_HN is a bit like roulette in that way. :)
15:51:38wanyes, I think it got removed from the standard listing
15:51:49wandom96: I'll do that
15:51:53EXetoCstill not number one :/ good job still!
15:53:11dom96EXetoC: we'll get there
15:53:21wanYes but room to grow! I purposefully only used ~40 workers instead of 256 to keep hopes up for further rounds
15:53:50Jehan_Just remember that people still use Rails and Django, despite their performance. :0
15:53:56renesacJehan_, here I get a 432x speedup with 3 threads
15:54:06Jehan_Language ecosystem matters a LOT.
15:54:40dom96Jehan_: True. But currently we have neither best speed nor best ecosystem.
15:54:42Jehan_renesac: Nice, I'm just curious why you picked 3? :)
15:54:59EXetoCdom96: rly, ok :>
15:55:00renesacruning on a VM with 3 visible cores
15:55:01wanJehan_: Yes, that's why micro-frameworks that are sinatra-like and still very fast will be quite attractive
15:55:07Jehan_Gotcha.
15:56:06wancpoll_cppsp implementations for example are really fast but horrible to look at
15:56:10Jehan_In all fairness, most of the credit for Nimrod's performance should go to the authors of the C optimizer. :)
15:56:37Jehan_Though it helps a lot that Nimrod generates pretty idiomatic C (not a trivial task, either).
15:57:04renesachey, we get credit too, for allowing you to use those nice optimizers
15:57:09renesacalso that
15:57:33Jehan_But really, languages like Nimrod outshine C for larger programs.
15:57:42Jehan_Where it's really hard to make C code both fast and safe.
15:57:49dom96Perhaps most of the credit should go to the CPU engineers? :P
15:58:21dom96wan: let me know when you comment
15:59:13wanalready did, I just copied over my comment
15:59:36Jehan_It got autokilled.
15:59:40Jehan_Because it's a duplicate.
15:59:57Jehan_Shows up as [dead] for me.
16:00:16dom96ahh, explains why I can't see it.
16:00:22*untitaker quit (Ping timeout: 245 seconds)
16:00:31dom96HN has so many invisible rules
16:01:00Jehan_Well, they're designed to maximize the signal/noise ratio, not make it easy to advertise your stuff. :)
16:01:29dom96hehe true
16:02:27wanI changed it a little. Can you see it, or should I repost?
16:02:37dom96I think you need to repost
16:02:56Jehan_Still dead. I don't think you can edit it once dead.
16:03:29Jehan_I'd recommend just letting it sit until you have a context to post it in, though.
16:03:51Jehan_Right now it looks too much like an ad and may get hit by a downvote storm anyway.
16:05:18Jehan_I'd add something like: "Disclaimer: I'm the author of Nawak, so I'm pretty excited about this."
16:05:30wanGood point
16:05:33Jehan_Assuming you are the author of Nawak (guessing here).
16:05:45wanyep
16:06:14*untitaker joined #nimrod
16:08:59Jehan_But in general, hackers being happy about their work doing well in a contest get a much different reception on HN than fanboys appearing to hawk something.
16:09:55wanAlright, I've tried again. Let me know if it gets invisible
16:10:42Jehan_Can see it, yeah.
16:12:15wanJehan_: (I used your introduction sentence, it was so clear that I didn't change it. Thanks!)
16:14:50*Johz joined #nimrod
16:15:52JohzHello, is there an obvious way of making sublists that I'm missing?
16:16:17*superfunc joined #nimrod
16:16:23JohzI'm trying to iterate over the arguments list, having already dealt with the first argument.
16:17:11dom96hi Johz. list[0..3] should work. Is that what you mean?
16:17:37JohzYep, that's exactly it. Knew I was missing something! :P
16:21:00*easygreasy joined #nimrod
16:25:01EXetoCthat's a copy operation btw
16:26:19VarriountHi easygreasy
16:27:07easygreasyVarriount: hi there
16:27:48*superfunc quit (Ping timeout: 240 seconds)
16:29:27easygreasyso, a new version of Nimrod (9.4)popped up on the Arch repos which reminded me that I wanted to try it out, I remember skimming through the tutorials many moons ago, but I find I learn/grok best by looking at actual project code, anyone with some suggestions?
16:31:02EXetoCthe compiler? :)
16:31:20Jehan_Wouldn't recommend the compiler. That might be a bit daunting as a first look.
16:31:41easygreasyEXetoC: heh
16:31:42Jehan_Just consider the size, 40k lines of not exactly trivial code.
16:32:00dom96Here is a good list https://github.com/trending?l=nimrod :)
16:32:01Jehan_Someone should probably do http://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/prolog/problemas/ for Nimrod. :)
16:33:23easygreasybtw are there bindings for opengl, glfw, perhaps sdl2 ?
16:33:59EXetoCall of those
16:34:04dom96^
16:34:21easygreasyEXetoC: sweet :)
16:35:05easygreasyanyone been experimenting with some 'higher-level' game 2d frameworks in nimrod?
16:36:31*Demos joined #nimrod
16:37:32EXetoCthere's a graphics module and then plenty of wrappers, but not that much high level stuff
16:37:54EXetoCthere are at least 1-2 engines in the works that haven't been released yet
16:38:18easygreasyEXetoC: ok, just figured I'd ask as it's something I'd probably like to try as a nimrod project (simple 2d game engine)
16:38:19dom96there is nimgame
16:39:30easygreasydom96: sounds interesting, is it an actual game or a framework?
16:39:40dom96a framework
16:39:53EXetoCI wonder if it compile
16:39:56dom96https://github.com/Vladar4/nimgame
16:40:06dom96Yeah, it's a bit old now
16:40:09Demoseasygreasy: cairo!
16:40:13Demoscairo is pretty good
16:40:32EXetoCcairo seems like a great lib indeed
16:41:35easygreasycairo as in the vector gfx library?
16:41:52Demosyeah
16:42:19easygreasyhaven't considered that for 2dgame development
16:42:21EXetoCbut I can't remember if hardware acceleration worked well on windows
16:42:37easygreasybut I may have missed something
16:42:58Demosit will be slower than custom GL calls, but likely not slower than something like love or pygame
16:43:03Demosor god forbid game maker
16:43:27Demosyou can load up bitmaps and use them as a source I think
16:43:35EXetoCshouldn't matter much, depending on how well it batches things
16:44:27easygreasyok, looking through the babel package manager source code right now, looks very neat and concise, which reflects well on the nimrod language I suppose
16:45:40easygreasythe T for type and P for pointer (?) prefix is that a hardline convention amongst nimrod developers, can't say I personally find it pleasing but I guess it's more a 'get used to' deal
16:45:46Demoseasygreasy: well it was written by one person :D but yeah the package manager is nice
16:45:56Demoseasygreasy: some people do not do it
16:46:05Jehan_easygreasy: I ignore Hungarian notation myself.
16:46:10Demospersonally I use T but not P (I just use ref TFoo and whatnot)
16:46:32DemosJehan_: it is not really Hungarian notation though since these are type names and not variable names
16:46:42Jehan_I use FooRef and FooObj in the rare cases where I need to distinguish between objects and references to them.
16:48:33easygreasyJehan_ lol, yes now that was a horrid time in my development life, WINAPI...
16:49:40Jehan_Luckily, type inference allows you to ignore the type names 99% of the time.
16:52:24*DAddYE joined #nimrod
16:54:16easygreasyJehan_: ok, good, so I won't be crucified if I write code which doesn't use the T/P convention
16:54:49*gsingh93 quit (Quit: ZNC - http://znc.in)
16:55:05Jehan_I think you'll find that Nimrod as a language isn't very opinionated.
16:55:21Jehan_It even allows for OOP, even though the primary author isn't a fan of it.
16:56:00Jehan_Another example: it's specifically case-insensitive (even underscores are optional) so that people aren't forced to use the conventions of third-party libraries.
16:56:39Demosfunny, I found nimrod to be quite opinionated, just not on stupid things :D
16:56:40Jehan_There's still a style guide for the core, but the general attitude seems to be more "live and let live".
16:57:15Jehan_Demos: Then you haven't written code in Ada or Eiffel or Haskell or … :)
16:57:35easygreasyisn't that T/P prefixa Delphi thing btw? I seem to recall that but my memory is what it is...
16:57:39Jehan_Yup.
16:57:53Jehan_Nimrod has its roots in the Pascal family of languages.
16:58:16easygreasyoh, case-insensitive, that's an interesting choice
16:58:20Jehan_Even the syntax in general is Pascal-likes (except Pythonesque white space blocks instead of begin end).
16:58:30Jehan_Pascal-like*
16:59:14*gsingh93 joined #nimrod
16:59:17Jehan_I have always preferred Pascal's syntax over C's, so that's actually a selling point for me.
16:59:39Jehan_But it's interesting to see how many people have never encountered a Pascal-like language in their life.
16:59:42EXetoC"syntax doesn't matter too much" is a lie :p
16:59:55Jehan_"Type names AFTER variables? How odd."
17:00:14VarriountBack. (I was commuting to class)
17:00:23Jehan_EXetoC: Google "Sapir-Whorf hypothesis".
17:00:28DemosJehan_: I have written a tad bit of haskell (not enough to really internalize all the crazy shit those people do) but nirmod came across as being opinionated in terms of having "flat" code and good code-locality
17:00:52Varriounteasygreasy: If you want a look at conventional nimrod code, look at the standard library, or dom96's Jester framework.
17:01:07Jehan_Code locality, yet it has include?
17:01:11easygreasyI do like that it compiles to c which allows you to make use of the excellent optimizating compilers with years of effort put into generating efficient code, it's a big selling point for me, that and the python style indentation
17:01:22easygreasyVarriount: thanks, will do
17:01:38VarriountThough, for the sake of sanity, do not try to understand the compiler unless you have several bottles worth of aspirin.
17:01:59Varriount(Not that the compiler code is badly written, it's just very complex)
17:02:18Jehan_Compiling to C is a bit of a double-edged sword.
17:02:21Demosand somewhat crufty, it was apperently translated from Pascal
17:02:44Jehan_I think it's overall a benefit, but it also makes a few things hard.
17:03:05Jehan_Like anything that involves inspecting stack frames.
17:03:17EXetoCthat's just one of the outputs
17:03:45easygreasyVarriount: heh, no I don't have any such aspirations, I own two books on compiler development, they are still in pristine mint condition after all these years, hohum...
17:03:46Jehan_I still think it's the best choice for the primary backend of a new compiler.
17:05:35EXetoCinspecting stack frames? you normally just need to view the nimrod stack, and that works as expected
17:05:51VarriountJehan_: For what it's worth, I don't think the include directive is used anywhere in the *pure* standard library.
17:05:54Jehan_EXetoC: Try to implement a precise garbage collector.
17:06:17Jehan_The standard library uses include internally quite a bit? Or what do you mean?
17:06:42VarriountThe modules in the pure directory?
17:06:43Jehan_I don't have a problem with include, actually. I think it's a good thing that it exists.
17:08:16menscremPrompt, why does not work?: a = 10'u - 2'u
17:08:21Jehan_They do have a fair amount of includes, yeah?
17:08:29VarriountOk, I was wrong, the modules in the pure directory do use include, but only for the runtime library
17:09:00Jehan_menscrem: import unsigned
17:09:44EXetoCVarriount: runtime library, in pure?
17:10:04Jehan_Varriount: Realistically, it's often helpful to break down a large module into smaller ones without needing implementation hiding between the smaller modules.
17:10:38menscremJehan_: oh, exactly, thanks
17:10:54*q66 joined #nimrod
17:10:55*q66 quit (Changing host)
17:10:55*q66 joined #nimrod
17:11:10Demosactually yeah, why are libs in pure importing symbols from dlls?
17:11:23fowlDemos, which
17:11:30Jehan_Araq considers unsigned arithmethic dangerous by default, because it can wrap around, so you need to enable it.
17:11:31Demoswell os does
17:11:55Demospeople love to use unsigned numbers for no good reason, so we make it harder for them to do that
17:12:05Jehan_E.g.: for i in 0..x-1 breaks if x == 0 and x is unsigned.
17:12:18fowlos is a special case, its also full of when defined(platform) stuff that implies non-pure-nimrod code
17:13:00Demosyeah
17:13:19renesacJehan_, it also currently breaks if x == x.high
17:13:20renesac:P
17:13:35Jehan_renesac: Yeah, but that's a far less likely situation.
17:14:15renesacI'm not sure...
17:14:49renesacas those 'x-1' are usually used to iterate in vectors and things like that
17:14:54Jehan_If you work with numbers that can be that large, then both int and uint are generally the wrong choice.
17:15:33renesacwhere in nimrod you can just 'for i in vec'
17:15:49renesac128 or 256 aren't that big
17:15:50renesac:P
17:16:15renesacand I first encountered this problem making a unittest with uint32
17:16:29Jehan_Oh, I'm not saying that it can't happen.
17:16:32renesacand yes, uint32 is the right choice
17:16:42renesacfor that thing
17:17:00*q66 quit (Quit: Leaving)
17:17:54renesacwell, in the things I program, I aways end up using uints and their wrap around semantics...
17:18:20renesacI really hope someday they can be a 1st class citizen in nimrod...
17:18:32Jehan_Yeah, I often use that, too, but for those situations, "import unsigned" isn't a big burden.
17:18:56renesacwell, my problem isn't just that
17:19:06fowlmy parser combinator builds trees now: {"left": {"I": "1"}, "op": "+", "right": {"left": {"I": "3"}, "op": "-", "right": {"I": "2"}}}
17:19:06Jehan_My personal problem is more that mod is broken for signed ints.
17:19:11fowl:>~
17:19:18renesacJehan_, it is not broken
17:19:31Jehan_From a mathematician's perspective, it is.
17:19:48Jehan_That's not Nimrod's fault, though, that's the fault of CPU designers primarily.
17:20:00renesacJehan_, see this table:
17:20:00renesachttp://en.wikipedia.org/wiki/Modulo_operation
17:20:23renesacthere is no standard...
17:20:53renesacbut yeah... what nimrod calls 'mod' is usually called 'rem' in languages that use letters for those operators
17:22:13Jehan_Yup. And in mathematics, x mod n \in {0,…,n-1} pretty much always.
17:23:09Jehan_mod creates equivalence classes (congruence modulo n), and it makes no sense to have two representations for the same equivalence class.
17:23:46renesacthings that are annoying with uints: in c: "if(x)", in nimrod: "if (x == 0'u32)"
17:24:28renesacand having to convert to int for array indexing, etc
17:24:47renesacthose are open bugs...
17:25:41Jehan_Array indexing I buy.
17:25:45Jehan_The "if" not.
17:26:22renesacbuy?
17:26:48Jehan_I mean, I agree that this is a misfeature.
17:26:50EXetoCrenesac: x == 0 is enough in this case
17:26:53EXetoCit's really minor
17:27:00renesacEXetoC, no, it is not
17:27:07renesacthat is a open bug
17:27:24renesacand yeah, nimrod don't need the parenthesis
17:27:27renesacthat is a plus
17:27:52*q66 joined #nimrod
17:27:52*q66 quit (Changing host)
17:27:53*q66 joined #nimrod
17:27:58EXetoCwell ok I only care about intended behavior
17:28:42renesacI care for what I'm forced to use
17:28:43renesac^"
17:28:52Jehan_import unsigned
17:28:52Jehan_var x: uint32 = 0
17:28:52Jehan_if x == 0: echo "0"
17:28:55Jehan_That works for me?
17:30:27renesacvar u:uint32 = 2147483648'u32 # Error: type mismatch: got (int64) but expected 'uint32'
17:30:27renesac assert u > 0 # Error: type mismatch: got (int literal(0), uint32)
17:30:54renesachttps://github.com/Araq/Nimrod/issues/936
17:31:16renesacoh, the first line I pasted is already corrected with the 'u32
17:31:33VarriountPart of the problem is that the compiler doesn't have an int128 type to work with, to deal with unsigned types range.
17:32:02renesacthat is only a problem for 'uint' and 'uint64' I think
17:32:14renesacnot for ordinals
17:32:35VarriountBut uint's aren't ordinals (in nimrod)
17:32:57renesacuint8, uint16, etc are ordinals
17:33:08Jehan_I note that comparing ints and uints for things other than equality is dangerous.
17:33:28Jehan_There are a ton of problems in C because that's allowed there.
17:33:43renesacI want to compare a literal, that should be converted to uint
17:33:54renesac*against a literal
17:34:10EXetoCyeah that's different. it's just a shortcut evaluated at compile-time
17:34:11Jehan_I grant you that literals should ideally be special-cased if they're in the intersection of int and uint.
17:34:12renesacI appreciate that nimrod is more strict, but those things listed are just bugs
17:35:17renesacthe manual says that widening type conversions are aways allowed
17:35:20renesacimplicitly
17:35:39renesacbbl
17:35:51Jehan_Yup. Small integer literals should ideally be in a special subtype of int and uint.
17:35:57Araqfyi renesac is correct
17:37:54*brson joined #nimrod
17:37:54*springbok quit (Ping timeout: 240 seconds)
17:39:15EXetoCthat these are bugs?
17:42:48Araqyes
17:43:10Araqthey are not even hard to fix ...
17:43:17AraqI should tell renesac how to do it
17:43:30Jehan_Heh. :)
17:46:13Araqfor the 'if x' one can define a converter to get that feature
17:46:29Araqbut I don't like it. it's sloppy thinking
17:47:09Jehan_If it's all the same to you, I'd rather not have non-boolean types implicitly treated as booleans.
17:47:23Jehan_Except where that's part of their feature set.
17:49:10reactormonkJehan_, converters are kinda explicit
17:49:35Demosthat road leads to C insanity, lets not do it
17:49:35Jehan_That's not what I mean.
17:49:48Jehan_If there were an int -> bool converter in system, for example.
17:49:57EXetoCdeclaring one is explicit, while using one is not
17:50:16EXetoCwell, optionally it is
17:50:17Demosheck I think if (x==0) is more explicit than if(x), esp since they do different things
17:50:37Demosrather I think it is more clean
17:50:39Demos*clear
17:50:41Demosargh
17:52:01Jehan_It's also that it can lead to bugs. One reason for having a type system is to avoid clerical errors.
17:57:34fowldom96, did you try to use `=>` with map()?
17:57:44dom96fowl: yes, why?
17:58:03fowlcant do it without the type
17:58:20EXetoCthat's known
17:58:25fowlmap(s, (it: int) => $it)
17:58:37fowloh :(
17:58:44dom96the compiler still needs help sometimes.
18:03:40dom96Is there anything in the stdlib for indenting a string?
18:06:26Araqthere is strutils.wordWrap iirc
18:07:00dom96huh? Why would that indent?
18:07:52Araqyou can pass newLine= "\n " to it
18:09:13Araqbut yes. it does more than that
18:09:19dom96wouldn't that only add indentation where it word wraps?
18:09:45Araqtrue
18:10:51renesacI've already tried a converter actually
18:11:11renesacbut nimrod has a single "and" operator, instead of a separate one for bitwise and logical
18:11:34renesacand the last time I tried to fix those implicit conversion bugs, I got overload resolution errors
18:12:33Araqthe quick way out is to patch sigmatch.complexDisambiguation() then
18:12:37renesacthere were procs for 'int64' and 'uint64', and 'uint8' was unsure of which to pick
18:15:14fowldom96, im pretty sure theres an indentation function in the json module
18:15:58dom96fowl: if there is it doesn't seem to be publi
18:16:00dom96*public
18:16:05fowlyea
18:16:56dom96'cannot evaluate at compile time: stdout'
18:17:02Demoswhy would complex disambiguation help here? It looks to me like it just does ordering for like Foo[Bar[T]] vs Foo[T] vs T
18:17:16dom96stdout.write should work at compile-time shouldn't it?
18:17:35Araqdom96: not anymore, no
18:17:52Araqthe compile-time FFI was removed
18:17:53dom96why?
18:18:24fowldom96, because the api changed and nobody wants to update it
18:18:34dom96echo works, stdout should too
18:19:01Araqno, "echo" is special
18:19:01dom96hrm, I guess I see the problem.
18:19:03dom96oh well.
18:20:07AraqDemos: indeed that's what it currently does. but one could make it perform "prefer int over uint8 if both match"
18:20:38Araqthat it ultimately needs to be rewritten still stands
18:22:17Demosyeah, again I am up for that but it is jumping into the deep end. Now I can not figure out how "prefer int over uint8" would fix our literal problems
18:25:29Demosoh for the widening conversions
18:25:30fowlhow to fix the literal problems: when someone mentions a problem with literals we just insist that there is literally no problem
18:26:30DemosI care more about the literal problems, although they are way more annoying in a stuff like var s: seq[uint32] = @[1,2,3,4,5]
18:26:33Demoswhich does not work
18:26:55fowl1u32, 2,3,4,..
18:27:11DemosOoOooOOOOoo really!
18:27:28Demossweet
18:27:46fowlDemos, [] is a literal array here and @ is a prefix op, all members of array are the same type, so you can just do the first one
18:28:01renesacthis should be on tutorial
18:28:08Demosyeah, makes sense now, but I did not realize it before
18:28:35renesacbut yeah, ideally you should't need this
18:28:55renesacbecause you are declaring the type on the same line
18:28:57Demosyeah, but fixing it may be too complex for little benifit
18:29:05EXetoCindeed
18:29:20renesacyeah, not the highest priority
18:29:20Demoswould perhaps need something like c++'s initalizer lists, which add complexity to type deduction rules
18:30:39renesacAraq, what do you think about the idea I and filwitt were discussing about deprecating the 'u32', 'f64', etc literal suffixes
18:30:53renesacand add '.u32', '.f64' instead?
18:31:13renesacso everything is more consistent, and less special cases?
18:31:39Demosthat is not more consistent unless we allow stuff like var x: u32 = 4
18:31:40renesac'u would turn into '.uint' of course, same for 'f
18:31:49dom96IIRC there were times where I had to explicitly use the suffixes for each literal in an array constructor
18:32:03fowlDemos, c++s requirements are getting astounding
18:32:12dom96I'd say it's not for 'little benefit'
18:32:21renesacDemos, true...
18:32:30EXetoCdom96: isn't it a bug?
18:32:39Demosfowl: c++ is not actually all that complex, it is just that it has some features that interact badly
18:33:08fowlDemos, "const" alone requires code analysis
18:33:14Demosand from a programmer's perspective it is verbose and doing some simple things requires a lot of insane work
18:33:35fowlDemos, more than what nimrod does, given its weirdness with things like vector<const T>
18:33:35dom96https://github.com/Araq/Nimrod/blob/devel/lib/windows/winlean.nim#L692
18:34:15Araqdom96: that's caused by the ambiguous hex literals
18:34:19Demosconst is just a regular old type qualifier, I do not think the analysis required for it is that big
18:34:43Demosconst may be a bad idea, but still
18:34:45Araqhi Johz welcome
18:35:01dom96Araq: i'm not sure why they are ambiguous
18:35:04renesacdom96, fill a bug
18:35:19renesacyeah, it is an array, it should not be ambiguous
18:35:27Araqdom96: 0xFF is 255, does that look like an int8 to you?
18:35:44Araqthat's the problem here
18:35:50renesac-127?
18:36:04renesac*-128
18:36:20dom96*shrug* that's what it's defined as, the compiler shouldn't get in my way
18:36:30Araqwell TGUID's definition is old, it should use unsigned instead
18:36:54dom96unless allowing such code is dangerous, perhaps it is.
18:37:10renesacI don't think so
18:37:35renesac0xFF is a valid int8 value
18:37:55fowli say we include rope and directions for tying good knots with the compiler
18:38:21fowlor if we can find them cheap enough, a pistol and a bullet
18:38:59renesacI agree that usually uint8 is better in those cases (and probably the protocol is defined using them)
18:39:12renesacbut that should work
18:39:12EXetoCbut 255 isn't valid int8, so why should 0xff be?
18:39:19Araqrenesac: I don't care about 'u8 vs .u8 but this "omg this is inconsistent" is getting tiresome very fast
18:39:46renesacI know
18:40:51renesacstill, that might simplify the language and mean less typing (well, a '.' if you use the suffixes w/o the ')
18:41:05renesacbut yeah, not sure if it is worth now
18:43:23Araqfilwit is a smart guy but he never answered the question: "if your coworker can't remember .u8 vs 'u8 would you really want to work with him?" in a satisfying manner
18:43:33EXetoCless typing? you mean either exactly as many characters or one more?
18:43:59renesacwhen you don't have a literal, you need 'uint8'
18:44:15Demosthe bigger problem is that even if we allow .u8 it is not more consistent, since we normally only allow .type and u8 is not a type
18:44:50renesacand if demos crictic would be solved, we would have 'array[u8]'
18:45:20renesacit would become the type
18:45:34Demoswhich is not a great idea
18:45:39fowlrenesac, what stops you from defining those types?
18:46:06EXetoCso are strings for byte buffers a good idea? in the socket interface for example
18:46:08renesacfowl, I would have to create a babel package and import them everywhere?
18:46:13EXetoCI suppose more types could be supported
18:46:30fowlrenesac, when you compile you can do --import:module , or add that to your nimrod.cfgs
18:46:45renesacnot great for sharing code
18:47:00fowlrenesac, neither is not declaring your dependencies
18:47:11renesac?
18:47:20renesacthe alternative is not defining those types
18:47:21fowli'd rather see import librenesac
18:47:37EXetoCit should indeed be used sparingly, and I've only ever implicitly imported a single 'common' module
18:47:38renesacand not have to import anything more
18:48:03Demosis foo(4) supposed to match proc foo(a: openarray[int])?
18:48:16renesacI need to touch up my bithacks module
18:48:17AraqDemos: no, but varargs[int]
18:48:19fowlrenesac, your real complaint then, not the lack of types called i* and u*, its that they arent in system, ready for you to use without importing anything
18:48:34Demosit does not, but the comment on baseTypeMatch in sigmatch seems to suggest it might
18:48:46renesacfowl, that was an improvement suggestion for nimrod
18:49:08renesacalso, people making syntax highlighting could ignore the ' case
18:49:15renesacin the future
18:49:37Araqthere is also the improvement request of making every type Uppercase
18:49:49Araqand then we end up with I32 which is hard to read ...
18:50:03renesacand harder to type
18:50:04renesac:P
18:50:26fowlrenesac, filwit has all these suggestions for truly minor syntax changes, why does he not just fork the syntax file and make the changes he wants?
18:50:29EXetoCeveryone knows that these are types
18:51:05dom96and that is why 'i32 should stay
18:51:19Araqalso the semantics are slightly different
18:51:22dom96it's a type suffix not a type and can therefore stay as it is case-wise
18:51:49Araqit's not a type *conversion* it's part of the literal
18:52:06Araq0xfff'f64 is valid too
18:52:19Araqfloating point hexadecimal literal
18:52:36Araq0xffff.float64 does something entirely different
18:53:12Araqso yes. it's "inconsistent" if you don't understand it. :P
18:53:43renesacAraq, it does something different because it transforms 0xffff to int before, right?
18:54:18Araqright
18:54:28EXetoCthen there's constant folding, but maybe you shouldn't rely on it
18:54:37fowldoes anybody have a pun on "parser/parsing" i can use
18:54:55Demosfowl: you writing a parsec clone?
18:55:59fowlDemos, parsec looks a lot more advanced. this is just a combinator
18:57:09renesacwell, it is a typecast then
18:58:11EXetoCconversion you mean?
18:58:12Johz<Araq> hi Johz welcome <-- Hi, sorry!
18:58:23EXetoCcast is unchecked
18:58:28renesacEXetoC, 0xfff'f64
18:58:57renesacok, 1'f64 is a conversion
18:59:04renesacyeah, different semantics
18:59:54EXetoCmaybe construction is the right term here, but anyway
19:00:12renesacwas that 5000'u for echo bug fixed?
19:00:31renesacit was discussed some days ago
19:00:56renesac5000'u8
19:01:16renesacthe compiler should probably give an error in this case
19:01:34JohzIs there a way of getting a line from a file without stripping the line ending?
19:01:41EXetoCI haven't seen such a commit. I tried to fix it, but gave up because I wasn't able to step through the compiler
19:03:01renesacok, so it was you
19:04:23*brson quit (Ping timeout: 246 seconds)
19:05:01EXetoCI thought maybe I could've fixed some of the bugs in a reasonable time frame anyway had I had another monitor :-)
19:05:34renesacyeah, a second monitor is really handy for coding and writing
19:05:55renesacand many other things
19:06:06VarriountJohz: No. If you want, add an option to the current procedures that read lines from files to prevent stripping the lines.
19:06:51DemosAraq: why is the printing of errors from typeclass matching disabled?
19:06:58DemosI just turned it on and it seemed to work
19:07:02*brson joined #nimrod
19:07:38EXetoCand maybe visual bookmark management in vim
19:09:57EXetoCit probably exists. I need to look for that
19:11:30fowleasygreasy, can you put together a list of components you would like for a 2d game engine
19:20:09AraqJohz: what do you need it for?
19:20:40AraqDemos: "seemed to work" well ... :P
19:20:59DemosOK fine I will actually run the tests :D
19:21:04Demosgawd
19:21:04Araqbut I didn't write it, maybe indeed it's not necessary anymore
19:21:07JohzEssentially so that I can tell if there's a newline at the end of the file or not.
19:22:26Araqlol why would you care about that
19:22:28EXetoCwhat follows is essentially an empty line then
19:22:43EXetoCbut it might or might not be included
19:23:19easygreasyfowl: sorry was afk, some component/entity based framework with support for collisions (circle,rect), sprite/animation functionality, probably some tile display/collision functionality
19:26:21Demoshttps://github.com/barcharcraz/Systemic/tree/master/ecs <-- that is my component framework core. A little messy ATM
19:26:30Johz<Araq> lol why would you care about that <-- Because I *want* to! :P
19:26:34fowleasygreasy, check this out, it has all that except for tiles https://github.com/fowlmouth/roids
19:27:25JohzIt's not so much an issue, as more that I'm used to having to deal with line endings, and apparently making my life easier for me is just too confusing to cope with... :P
19:27:53easygreasyfowl: I will, thanks!
19:28:22EXetoCJohz: well, have you checked if the last line is an empty line in that case?
19:29:42EXetoC""
19:30:30JohzThat's what I probably will do. Or just force newlines all over the place. I mean, no-one's ever complained about an excess of newlines, have they?
19:31:32EXetoCit's the most logical thing to do imo, but like I said, it depends on whether or not said proc includes that, which I consider to be the correct behavior
19:31:35Araqwhat I will complain about though is petty tools which tell me my files don't end in a newline
19:33:38VarriountThe 'and' keyword does bitwise AND'ing on ints, correct?
19:33:47EXetoCyes
19:34:01fowlJohz, you can always rewind and check the byte of the file if you want
19:38:46VarriountAraq: Did you read Gradha's post on the forum about 'emit'?
19:38:47*renesac quit (Ping timeout: 240 seconds)
19:39:22EXetoCAraq: what's the deal with newlines and C? the problem is that some old compilers suck in this regard
19:40:19AraqVarriount: no. link?
19:40:44AraqEXetoC: visual C++ only eat windows' newlines, maybe newer versions are better
19:40:52VarriountAraq: http://forum.nimrod-lang.org/t/429#2327
19:41:20EXetoCI forgot to end with ", I guess"
19:41:25EXetoCok
19:42:18*menscrem quit (Ping timeout: 240 seconds)
19:42:34easygreasyfowl: looking a bit at the source/hierarchy, I'm a bit confused about the 'room' part, is that an abstraction like a 'scene' type solution seen in other frameworks or is it game specific as an actual 'room' ?
19:43:03AraqVarriount: well he is obviously kidding
19:43:18fowleasygreasy, no, it just holds a collection of entities
19:44:09fowleasygreasy, i didnt spend a lot of a time thinking about the best topology, entities are also stored in a spatial tree for rendering
19:44:17easygreasyfowl: oh, so it's like a 'group' functionality? like 'aliens' or 'bullets' ?
19:44:41easygreasyfowl: so you can omit unecessary collisions et al ?
19:44:44fowleasygreasy, no, more like a world or space
19:44:55fowlthere is also a physics system attached to it
19:45:23VarriountGah. I can *open* a directory handle fine, but as soon as I call ReadDirectoryInfo on it, I get a permission denied error.
19:45:24easygreasyfowl: ok, so likely more like a 'scene' abstraction that I've seen in some frameworks
19:46:20*xtagon joined #nimrod
19:46:52fowleasygreasy, yes
19:47:40EXetoCscene is pretty much the universal term for that
19:50:22EXetoChm, doomsys
19:51:35*renesac joined #nimrod
19:51:46easygreasyfowl: ok, I gotta hit the sack, bookmarked your project and will study it, thanks for the link!
19:52:32*easygreasy quit (Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140430131441])
19:52:41Jehan_Johz: Does https://gist.github.com/rbehrends/c7fbe8aa8660e3d4379a what you need?
19:55:26DemosAraq: allright, looks like turning on typeclass errors did not cause any mass breakage
19:55:59Jehan_And here I was wondering why it suddenly started to rain fire outside ...
19:56:36DemosAlso are you sure you want to allow multiple hops through converters? It is not currently allowed?
19:57:29fowlJehan_, it should be an iterator
19:57:29AraqI'm sure I don't want it, Demos
19:58:19EXetoC'lines' already includes an empty line if \n is the last char
19:58:32Jehan_fowl: Yes, feel free to adapt it. :)
20:00:29VarriountHow do I ensure that an array is alligned to a 32 bit integer (dword) boundary?
20:00:36Varriount*aligned
20:00:59EXetoCby wrapping it I assume
20:01:06fowlsizeof(t) mod 4 == 0 ?
20:01:20Jehan_How do you allocate that array?
20:01:40Varriountvar buffer: array[100, int32]
20:02:14fowlput a char after it any - the addresses?
20:02:25VarriountWhat?
20:03:01fowlchr.addr.int - buffer.addr.int = size of buffer
20:04:51Jehan_Normally, the C compiler should automatically align it properly for performance. Is there some other crucial reason why you absolutely have to assure it's on a boundary? E.g. using assembly instructions that require it?
20:05:38Jehan_Doing it portably is generally tricky because the C standard does not constrain memory alignment all that much.
20:05:43VarriountJehan_: The api that uses the buffer wants it "Aligned on a DWORD boundary"
20:05:55EXetoCI don't know if there's such a requirement. anyway, since the size of an array is static, just enforce this with a template
20:05:58Varriounthttp://msdn.microsoft.com/en-us/library/windows/desktop/aa365465(v=vs.85).aspx
20:06:09EXetoC*guarantee
20:06:18Jehan_Ah, that's what I wanted to know.
20:06:35Araqjust use: tuple [alignIt: int32, buffer: array [X, byte]], Varriount
20:06:53Araqand pass addr buffer to it
20:07:03VarriountJehan_: I'm trying to get the call to ReadDirectoryChanges to work, however I end up with a 'Permission Denied' error.
20:07:04Jehan_If it's platform-specific, you can … yeah, pretty much that, except use a double instead of int32.
20:07:27EXetoCint64?
20:10:05EXetoCas always, don't pay attention to what I'm saying
20:10:22VarriountAnd.. I still get an Access Denied error. Oh well.
20:11:41fowlc needs int4 and int6
20:12:51VarriountWell, I have to go.
20:13:04VarriountIf anone wants to try getting this working - https://gist.github.com/Varriount/941fcda927679af9ae89
20:13:38EXetoCbye
20:14:01EXetoCare you sure you have enough fun things to do?
20:14:22Jehan_Sorry, Varriount, not a Windows person.
20:15:11Jehan_EXetoC: I don't think int64s necessarily have to be aligned that way, especially when it's x86 code.
20:17:24*Jesin joined #nimrod
20:18:01*Johz quit (Ping timeout: 265 seconds)
20:18:55Jehan_Varriount: If you want to do it absolutely portably, use a slightly longer buffer, then find the lowest address within it that is aligned, then use copyMem() afterwards to extract the data.
20:19:28Araqfloat64 IS aligned on a 8 byte boundary though
20:19:46Jehan_Yeah, but in theory, the C compiler could decide to leave a gap.
20:19:50EXetoCI don't why, but wait, why are discussing 8 byte types?
20:20:04EXetoC+we
20:20:21Jehan_I had a discussion with a professor once who knew a guy who actually did that to facilitate some optimizations.
20:20:34AraqJehan_: no C compiler does that
20:20:35Jehan_Where he could prove that the struct wasn't used elsewhere.
20:20:48Jehan_No existing C compiler that I know of, yes.
20:21:13Jehan_But you never know what things will be like in a few years.
20:21:42Jehan_Just recently, a lot of compiler writers have started taking the "undefined" parts of the C standard pretty literally to facilitate more optimizations.
20:24:27Araqalignment changes for *bytes* after 8 byte that have to be aligned
20:24:37Araqare really unlikely
20:24:44Araqeven in 10 years from now
20:24:50EXetoCwill things like sizeof or len ever return Natural?
20:25:39Araqand the C standard is a living document with a few contradictions
20:25:59AraqEXetoC: unlikely.
20:26:22Araqvar L = len(x); while L > 0: dec L # argh, don't make L a natural
20:26:43Araq*while L >= 0
20:30:10EXetoCyou're right it's silly. everyone knows that a natural number will be returned anyway, and it's unlikely that <0 will be returned because of some bug
20:31:08Jehan_Araq: I've had my share of issues getting stuff to work on the Cray CC so I tend to be careful about assuming that compiler always writers think the same way I do. :)
20:34:44*faassen left #nimrod (#nimrod)
21:00:29*brson quit (Quit: leaving)
21:00:43*brson joined #nimrod
21:27:59njoejoetrying to get memchr() working with nimrod: https://gist.github.com/jots/11461543 the file "split.txt" in the middle there explains what i'm trying to do.
21:33:17Jehan_You're calling memchr() incorrectly.
21:33:50Jehan_The last argument is the size of the buffer you're searching, the first the start of the buffer.
21:36:29dom96Wasn't there a VM bug which caused code to be evaluated incorrectly when comments were present or something like that?
21:36:41dom96I think I may be hitting the same bug
21:37:40dom96nope, i'm wrong
21:42:13njoejoeJehan_: I see. so I need something like p = c_memchr(addr(s), 10, (addr(s) + p) - p) ? but it says s has no address
21:42:34EXetoCmake it a var if it isn't
21:42:38Jehan_Honestly, I don't think you even need memchr().
21:42:56Jehan_I just threw together a quick implementation in pure nimrod that actually seems to be faster than the C one.
21:43:14Jehan_Mostly because of using fread() vs. read() underneath, I suspect, but still.
21:43:52njoejoewow. if you gist it, i'll test it :-)
21:45:02Jehan_https://gist.github.com/rbehrends/738010461a04b44cd2a5
21:45:18Jehan_No guarantees, but it produces the same numbers as lc2.c for me.
21:46:56njoejoeit produces same number as lc.c for me. 3 seconds. i'm after that 1 second white whale...
21:48:02Jehan_Hmm. I suspect that has less to do with the code and more with using read() vs. fread().
21:48:06njoejoebtw, i found the memchr() trick looking at gnu's wc.c
21:48:27Jehan_What OS are you running on?
21:48:35njoejoelinux
21:48:42Jehan_Yeah, I was testing it on OS X.
21:49:02Jehan_So it's probably different system calls, especially for something that should be I/O bound.
21:49:22Jehan_Yeah. lc.c uses fread(), lc2.c read().
21:49:39Jehan_readBuffer() in nimrod calls fread() also.
21:49:47Jehan_That's probably where the difference comes from.
21:50:38Jehan_Yeah, lc.c is also faster for me than lc2.c.
21:51:11njoejoelc2 did fread as well with same result. for some reason on linux, memchr faster than buf[i] == '\L
21:52:10njoejoei just have to figure out how to call it in nimrod
21:52:50Jehan_That's straightforward.
21:53:16Jehan_address of byte in buffer as first argument, '\L' as second argument, remaining bytes as third.
21:53:27Jehan_The trick is converting the result to an offset.
21:54:23*silven quit (Ping timeout: 250 seconds)
21:56:47Jehan_Also, you can use isNil to check if a C pointer is null.
22:00:16njoejoeisNil. much nicer. thanks.
22:03:54*brson quit (Ping timeout: 240 seconds)
22:03:56Araqnjoejoe: system.lines uses a bigger buffer on devel so it might be useful again to you
22:04:07*[2]Endy quit (Ping timeout: 245 seconds)
22:11:34dom96I just implemented the jist of downforeveryoneorjustme.com in 24 lines: https://gist.github.com/dom96/49427cd0a9c8da47fff3
22:11:38dom96:D
22:12:09dom96Less than that even
22:12:22dom96if you remove the empty lines and echo
22:12:25Varriountdom96: Implement async file reading/writing for asyncstuff
22:12:37dom96Varriount: I have bigger fish to fry
22:12:44dom96Varriount: How's fsmonitor going?
22:12:55njoejoethanks Araq. I'm wondering about use of fgetc and ungetc in sysio.nim:readline because on linux (at least my machine) they don't perform so well. (i *think*). so i'm trying see if a better way for readLine()
22:13:17Varriountnjoejoe: Assembly. >:D
22:13:18Araqoh yeah, good idea!
22:13:42Araqforgot about this crappy implementation
22:14:54Jehan_njoejoe: Have a look at this: https://gist.github.com/rbehrends/c63debe2ee689ccd5ff3
22:15:13Jehan_It uses memchr(). I have serious doubts that memchr() is the bottleneck, though.
22:16:01Jehan_It frankly shouldn't be on something that by rights should be I/O bound.
22:17:23Jehan_Btw, Araq: Is it intended that "using" does not work with fields, only procs?
22:17:59VarriountLast I heard, It's still debatable whether 'using' will stay in the language.
22:18:07Jehan_Heh.
22:18:12Jehan_Yeah, I can see why.
22:18:48AraqI think it pushes the language beyond its breaking point
22:18:51Jehan_It's just that I remembered it the other day and tried to give it a whirl to save some typing on an RNG implementation and found that it didn't do anything for that.
22:19:18*Demos quit (Read error: Connection reset by peer)
22:19:19Jehan_I can see it introducing unwanted ambiguities, too.
22:19:19*Jesin quit (Remote host closed the connection)
22:19:47njoejoeJehan_: you are a genius! it worked! I will have to read it and understand it now :-)
22:19:52EXetoC"template x: stmt = fooBarBazOhaicjriweocr"
22:20:19njoejoeJehan_: it got down to 1 second. same as lc2.c
22:20:43Jehan_njoejoe: Huh. Now I _am_ surprised.
22:21:04Jehan_But I'm no genius, it's just all about making Nimrod pretend to do pointer arithmetic.
22:21:58Jehan_I take it you're doing -d:release?
22:22:05njoejoeyes
22:22:35Jehan_Also, how long is your file? Must be over a GB.
22:22:36njoejoeso nimrod version just as fast as highly optimized gnu wc.c
22:22:47njoejoe2.9GB
22:23:24Jehan_I can see it giving an improvement with very long lines. Still, a 3x speedup is odd.
22:24:55njoejoe100mm lines, so 29 bytes per line.
22:25:34Jehan_Hmm. That is strange.
22:25:36NimBotAraq/Nimrod devel 6c4870d Dominik Picheta [+0 ±3 -0]: Get rid unsafe pointer type in GetQueuedCompletionStatus.
22:25:36NimBotAraq/Nimrod devel 543687f Dominik Picheta [+0 ±1 -0]: Fixes buffered recv in asyncnet.
22:25:36NimBotAraq/Nimrod devel a21289f Dominik Picheta [+0 ±1 -0]: Await is now supported in try statements.
22:25:51Jehan_Oh well, I need my beauty sleep.
22:25:53Jehan_Good night.
22:26:11EXetoCJehan_: pretend, how? the most basic way to do pointer arithmetic is this: "cast[ptr array[nElems, T]](yourPointer)"
22:26:29njoejoegoodnight Jehan_ and thanks!
22:26:43Jehan_Yeah, that's what I mean: Use casts, since it can't do it natively.
22:26:45EXetoCdunno if that's relevant, but it's good to know that
22:26:46Jehan_Anyhow, take care.
22:27:16*Jehan_ quit (Quit: Leaving)
22:28:38EXetoCthat's natively, in a way
22:33:51*uvelichitel quit (Quit: Textual IRC Client: www.textualapp.com)
22:36:46*xenagi joined #nimrod
22:42:36Varriountdom96: I'm stuck at the moment figuring out why ReadDirectoryChanges complains about me giving it an invalid handle.
22:43:17dom96Varriount: Can I see your code?
22:43:59Varriountdom96: If you insist.. but it's hackish, and requires marking some field in asyncdispatch structures as public.
22:44:55Varriountdom96: https://gist.github.com/Varriount/cece02012ff743e39c3e
22:47:24dom96You shouldn't be allocating PCustomOverlapped anymore
22:47:39dom96It's a ref now
22:47:43Varriountdom96: I said it was hackish.
22:48:25Varriountdom96: Also, I haven't had a chance to update the code from your commit 15 minutes ago. I'm still in class.
22:48:56dom96My code shouldn't make much of a difference
22:49:07dom96If you've got Araq's fixes then you can't allocate
22:49:16dom96you should alloc the buffer though I think
22:49:27fowldom96, you could probably still allocate and cast it
22:49:51dom96fowl: To a ref? Doesn't sound like a good idea.
22:50:11Varriountdom96: It should be an array of the structure that windows fills the array with. I'll fix it when I get home.
22:50:30fowldom96, not a good idea, but it may not crash initially
22:51:12dom96Varriount: well perhaps that will work if it's captured by the callback
22:51:35Varriountdom96: It hasn't even gotton to the wait for iocp stuff stage.
22:51:42VarriountSo stop berating me about things.
22:52:11VarriountAlso, just updated gist.
22:52:19dom96I'm not, i'm trying to help you.
23:04:11EXetoCI wonder if int32 matched float better than cint at some point
23:09:08EXetoCno I don't think so. MongoDB does have an int32 type, but it gets coerced into a float or something when sent to the server
23:30:10Skrylari have developed a newfound hatred for the jpeg format
23:30:40Skrylarthe amount of Irrelevant Crap exposed in the header is amazing
23:32:13EXetoCmetadata?
23:32:36SkrylarEXetoC: you could call it that
23:32:45Skrylarwhy would i need to have access to the huffman tables?
23:32:59Skrylarall i want is to 1) encode an image, and 2) decode an image and 3) maybe get exif data
23:33:15Skrylarthat should be maybe 6-9 functions and a tuning parameter struct
23:41:08VarriountHow do I define a structure whose array is of variable size? I'm importing something from Windows.h
23:42:35*darkf joined #nimrod
23:43:23EXetoCVarriount: I was able to select the size at runtime, but was told that it was a bug
23:43:55VarriountI guess a pointer will do then.
23:44:57EXetoCbut if it is to be allowed then it must be the last field, at which point sizeof won't be evaluated at compile time
23:49:13EXetoCbut then you have an additional field all of a sudden, so yeah probably not a good idea
23:52:48Varriountdom96: Won't the GC dislike passing a ref of the custom overlapped structure to an outside procedure? I distinctly remember Araq mentioning that passing ref's to outside sources did something...
23:53:53dom96You need to GC_ref it
23:55:11VarriountAlso, I thought we were abondoning the pascal prefixes?
23:55:28dom96not yet