<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>
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 …