mverzilli has joined #crystal-lang
waj has joined #crystal-lang
bcardiff has joined #crystal-lang
jhass|off has joined #crystal-lang
irclogger_______ has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff has joined #crystal-lang
e_dub has joined #crystal-lang
canhtak has joined #crystal-lang
mlilenium_ has joined #crystal-lang
mlilenium_ has left #crystal-lang [#crystal-lang]
mverzilli has joined #crystal-lang
waj has joined #crystal-lang
canhtak has joined #crystal-lang
canhtak has joined #crystal-lang
mverzilli has joined #crystal-lang
kostya has joined #crystal-lang
CraigBuchek has joined #crystal-lang
mverzilli_ has joined #crystal-lang
asterite has joined #crystal-lang
mverzilli has joined #crystal-lang
<asterite> kostya: I just see you added a base64 benchmark. Cool! :-)
<asterite> I think the decoding part is slower in crystal but I still don’t know why
<kostya> :)
<asterite> About the brainfuck one, I don’t know if waj told you but we believe it’s because of the hash implementation, in c++ it uses a red-black-tree and we use buckets with linked lists, and that’s where most of the time is spent, hash lookup
<asterite> In any case, it’s good to see us close the top :)
<asterite> I’m curious about Java’s performance too
<kostya> i think in other languages it implemented without optiomizations
<kostya> like pure pointers in crystal
<asterite> base64 or benchmark?
<kostya> base64
<asterite> Ah, right. Well, that’s one of the things I like about crystal: you can go to low-level mode if you want to, for more performance
<asterite> In Ruby you have to go to C, but there’s still the wrapping and the interepreter slowdowns
<jhass> asterite: hey, I fear I have another silly bug, no minimal enough case to report yet though
<asterite> Or other languages have built-in stirngs and arrays where you can’t see their source code so you wonder what are the algorithms they use or why it’s working slow, but here you can see the source code of everything: string, array, hash
<jhass> basically I end up in a if branch without the code before that in the method even being run
<jhass> or the condition of the branch being true for that matter
<asterite> jhass: keep reporting bugs, it’s one of the things that keeps the language moving forward and making it rock solid :)
<jhass> I'm kinda lost on how to reduce this one though
<asterite> What error you get? Segfault?
<asterite> Compiler error?
<jhass> no, just misbehavior
<jhass> basically I end up at this code http://paste.mrzyx.de/p5d17799f/
<asterite> Oh, the worst ones
<jhass> the first pp is never executed
<jhass> the second pp reports false
<asterite> Can you try with “puts”? “pp” had bugs which I think I fixed, but there might be some other bugs
<asterite> (but pp is one of my favourite macros :-P)
<jhass> well, I have other code before that which isn't run too and it was doing that without the pp's, but let me try
<asterite> If you have a repo for the code I can download it and try to debug it
<asterite> (but probably later in the day, I have some work to do in a few minutes)
<jhass> It's still kinda messy and I'm not sure about a few things, but yeah, let me push it
<asterite> Don’t worry, the compiler code is also messy in many places :-P
<jhass> (the pp->puts didn't change anything)
<jhass> it goes through a fairly long code path, which is why I'm unable to really reduce it
<asterite> Great, I’ll try it later
<kostya> i can make decode 17% faster
<asterite> Cool! How?
<kostya> by 4 lines change
<asterite> :)
<kostya> in PointerAppender not increment count
<kostya> and save start pointer
<kostya> then sub them
<asterite> Smart! Can we do that in other places too? Maybe PointerAppender can remember the original pointer and then in count it can sub
<asterite> Thanks :)
<asterite> I’ll commit it in a few seconds
<asterite> In my machine the encode part gets faster, not that much the decode part
<asterite> maybe there’s a difference in mac/linux, don’t know
<kostya> for me encode not changed, decode faster by 17%
<asterite> Pushed!
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<travis-ci> manastech/crystal#1554 (master - c4e60aa : Ary Borenszweig): The build passed.
e_dub has joined #crystal-lang
<asterite> jhass I was able to reproduce your problem, it’s very strange…if I comment the update_output line it works ok, I’ll investigate it later :)
<asterite> The spec2 output looks really nice :)
<jhass> :)
<jhass> asterite: btw. any thoughts on a with yield variant that changes not (only) the self but the definee?
<asterite> How’s that?
<jhass> like that you can do something like; module MyMod; def self.expand; with self yield; end; end; MyMod.expand do def foo; end; end;
<jhass> basically ruby's #class_eval
<asterite> Mmm… but that would execute at runtime, and we can’t define methods at runtime
<asterite> You can try to do things with macros, but I’m not exaclty sure what you want to do with that
<jhass> yeah not sure it's actually feasible, just wanted to have your thoughts
<jhass> well, for spec2 currently I change all your def it_ methods to macros basically
<jhass> or bass the context into them
<jhass> which I like neither
<jhass> ideally I could just define them inside the describe block
<asterite> I also thought describe and it should be macros
<jhass> and they would become new methods on Context or some module that's included into it or has it available via other means
<jhass> well, the whole point was to defer execution from definition
<jhass> so that execution order can be randomized for example
<jhass> or it may allow running just a single example and stuff like that in the long term
bcardiff has joined #crystal-lang
<jhass> the approach to achieve that with macros would making describe a class and it a def basically, but I had some other issues with that I forgot atm
<asterite> You could transform the “it’ to a proc and add that to the list of examples
<asterite> but I know it’s hard, it’s like you have to remember stuff in macros which later next macro invocations need to know, right?
<jhass> yeah, my main issue was tracking the context nesting I think
<jhass> which with my current solution happens without any global state
<jhass> in theory it could parse multiple files in parallel i think
<jhass> not that the parse time is actually anywhere being slow
<asterite> what parse what?
<jhass> crystal reading in the files
<jhass> or actually what I mean with parse/load time is the time it takes for the definitions to happen prior executing them
<asterite> Sorry, I got some work to do now. I think it’s best if one day we have a call or something and solve these issues, because we also want a better spec framework but we didn’t figure out how to do it, and you seem to be on a good path, so we can talk together and see what’s missing in the language to accomplish that
<asterite> What do you think? :)
<jhass> I'm not so much a skype/hangouts person (skype suspended my account actually...), but we can surely have a chat later ;)
<jhass> gotta go too anyway :)
<asterite> Ok, chat works too :)
<jhass> have fun working ;P
<asterite> Sure, optimizing slow ruby code is always fun …
asterite_ has joined #crystal-lang
asterite has joined #crystal-lang
mverzilli has joined #crystal-lang
asterite has joined #crystal-lang
dom96 has joined #crystal-lang
bcardiff1 has joined #crystal-lang
dom96 has joined #crystal-lang
e_dub has joined #crystal-lang
bcardiff has joined #crystal-lang
endou has joined #crystal-lang
bcardiff1 has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff1 has joined #crystal-lang
bcardiff has joined #crystal-lang
asterite has joined #crystal-lang
travis-ci has joined #crystal-lang
travis-ci has left #crystal-lang [#crystal-lang]
<travis-ci> manastech/crystal#1555 (master - 34ea95a : Ary Borenszweig): The build passed.
e_dub has joined #crystal-lang
canhtak has joined #crystal-lang
asterite has joined #crystal-lang
asterite has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1556 (master - ff306bd : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]
e_dub has joined #crystal-lang
e_dub has joined #crystal-lang
e_dub has joined #crystal-lang
asterite has joined #crystal-lang
asterite has joined #crystal-lang
Excureo has joined #crystal-lang