tomchapin has quit [Read error: Connection reset by peer]
matp_ is now known as matp
pawnbox has joined #crystal-lang
tomchapin has joined #crystal-lang
shawn42 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
snsei has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
tomchapin has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
tomchapin has joined #crystal-lang
pawnbox has joined #crystal-lang
tomchapin has quit [Read error: Connection reset by peer]
Philpax_ has quit [Ping timeout: 268 seconds]
tomchapin has joined #crystal-lang
snsei has quit [Remote host closed the connection]
tomchapin has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 246 seconds]
tomchapin has joined #crystal-lang
Philpax has joined #crystal-lang
tomchapin has quit [Read error: Connection reset by peer]
tomchapin has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii has joined #crystal-lang
vivus-ignis has joined #crystal-lang
snsei has joined #crystal-lang
Raimondi^1 has joined #crystal-lang
Raimondi^1 is now known as Raimondi
bjz has joined #crystal-lang
Raimondii has quit [Ping timeout: 260 seconds]
snsei has quit [Ping timeout: 250 seconds]
Philpax has quit [Read error: Connection reset by peer]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
muelleme has joined #crystal-lang
DeBot has joined #crystal-lang
bjz has joined #crystal-lang
tomchapin has quit [Ping timeout: 265 seconds]
akwiatkowski has joined #crystal-lang
tomchapin has joined #crystal-lang
muelleme has quit [Ping timeout: 252 seconds]
pawnbox has quit [Remote host closed the connection]
ponga has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 256 seconds]
gloscombe has joined #crystal-lang
pawnbox has joined #crystal-lang
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
Nik736 has joined #crystal-lang
akwiatkowski has quit [Quit: Konversation terminated!]
krsh has joined #crystal-lang
vivus-ignis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<crystal-gh>
[crystal] MakeNowJust opened pull request #3609: Move filename and some file location methods under to Crystal::Macros::ASTNode (master...fix/doc/macro-filename) https://git.io/v1Otb
gloscombe has quit [Quit: Lost terminal]
gloscombe has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
pawnbox has joined #crystal-lang
Raimondi has quit [Ping timeout: 260 seconds]
Raimondii is now known as Raimondi
ponga has quit [Ping timeout: 258 seconds]
Papierkorb has quit [Ping timeout: 258 seconds]
tomchapin has quit [Read error: Connection reset by peer]
A124 has quit [Ping timeout: 258 seconds]
mroth has quit [Ping timeout: 258 seconds]
pleiosaur has quit [Ping timeout: 258 seconds]
pleiosaur has joined #crystal-lang
A124 has joined #crystal-lang
mroth has joined #crystal-lang
dzv has joined #crystal-lang
krsh has quit [Quit: krsh]
Papierkorb has joined #crystal-lang
tomchapin has joined #crystal-lang
ponga has joined #crystal-lang
dzv_ has quit [Ping timeout: 258 seconds]
<FromGitter>
<bogdanteleaga> @jwoertink I don't think it's similar. I had a preprocess(word) function and I wanted something like words.map(&.preprocess)
<FromGitter>
<bogdanteleaga> but that only works if preprocess is a method on strings
<crystal-gh>
[crystal] asterite opened pull request #3610: Let method_missing also generate a def (master...feature/method_missing_def) https://git.io/v1O2v
pawnbox has quit [Remote host closed the connection]
<FromGitter>
<asterite> You can also do Bytes[1, 2, 3] to create a slice of bytes
<FromGitter>
<asterite> (without needing those pesky _u8)
Philpax has quit [Ping timeout: 260 seconds]
krsh has joined #crystal-lang
gloscombe has quit [Read error: Connection reset by peer]
<FromGitter>
<luislavena> Has anyone took a stab/look at Ruby 3x3 and the optcarrot NES performance challenge?
<FromGitter>
<luislavena> Right now JRuby can do 150fps after JIT while Ruby does ~20fps.
<Papierkorb>
With Graal
<Papierkorb>
After warming up
emancu has joined #crystal-lang
<FromGitter>
<luislavena> Papierkorb: correct, like most of the JIT-based implementations
<Papierkorb>
Graal is the new thing
<FromGitter>
<luislavena> Wonder if any had interest or started to port optcarrot to Crystal
<Papierkorb>
There's already a NES emulator which can play Mario I think
<Papierkorb>
I wrote a non-public SNES emulator, which I'd make public when I get around fixing sprites. still got a long way to go, but Crystal gave me no headaches at all performance wise
<Papierkorb>
luislavena, for comparison, I think the CPU emulation ran at 50x the SNES original clock speed without any JITing of the games code, or rather, the test programs.
<FromGitter>
<luislavena> Thanks, was wondering as a PR stunt (Ruby 3x3, all that jazz) more than the *science* behind it :smile:
gloscombe has quit [Read error: Connection reset by peer]
<FromGitter>
<spalladino> There is a bit old NES emulator in Crystal from a former Manas dev, in case you want to take a look https://github.com/romeroadrian/nes.cr
<FromGitter>
<yxhuvud> If used as a PR stunt, it would probably be a more fair move to translate the optcarrot line for line.
hako has joined #crystal-lang
pawnbox has joined #crystal-lang
<FromGitter>
<spalladino> @luislavena @yxhuvud you're right, if we are looking for comparable benchmark, a direct port is the best way. Anyone interested in working on it? ;-)
gloscombe has joined #crystal-lang
hako has quit [Remote host closed the connection]
hako has joined #crystal-lang
<FromGitter>
<yxhuvud> Hmm, is it possible to specify that an IO should always use a specific ByteFormat? It gets a bit old to specify that it is bigendian on every line
<RX14>
i'm going to add a warning to building compiler/specs if you fail to use bin/crystal
<RX14>
too much recently
vivus-ignis has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
mhib has joined #crystal-lang
mhib has quit [Client Quit]
mounibec has joined #crystal-lang
soveran has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter>
<jwoertink> @bogdanteleaga yeah, that's similar. In ruby it would be `words.map(&method(:preprocess))`. I haven't seen anything like that in crystal though.
<FromGitter>
<spalladino> (please don't do that at home :P)
<FromGitter>
<splattael> I've extracted to body into a method a call it before the `while` ;)
<FromGitter>
<spalladino> :+1:
<FromGitter>
<splattael> I've spotted several `eval`'s. Ouch.
<FromGitter>
<splattael> This gonna be the toughest part.
<FromGitter>
<spalladino> Ouch
<FromGitter>
<spalladino> Yep
matp has joined #crystal-lang
matp_ has quit [Read error: Connection reset by peer]
pawnbox has quit [Remote host closed the connection]
mounibec has joined #crystal-lang
<FromGitter>
<wmoxam> oh cool
<FromGitter>
<wmoxam> I was thinking the other day that optcarrot might be a fun port :D
<FromGitter>
<splattael> @wmoxam help is very much appreciated :D
<FromGitter>
<splattael> (and needed!)
<FromGitter>
<wmoxam> too bad it doesn't have any specs :sweat_smile:
<FromGitter>
<wmoxam> I've been working on a Liquid port and found that having a full test suite makes it so much easier
<FromGitter>
<wmoxam> @splattael I'll try to pitch in when I get a chance!
<FromGitter>
<splattael> @wmoxam well, if it compiles, it should work ;) So, I'm literally transpiling Ruby into Crystal
<Yxhuvud>
yeah, the availability of tests helps so much when porting. Especially if the thing you port exist in 3+ languages :)
rolha has joined #crystal-lang
<rolha>
hi everyone
<rolha>
is there any way to set Int64 as default Int? That is, when I write "x = 1" it's compiled as "x=1_i64"?
<RX14>
no
<rolha>
:) thanks
<RX14>
may I ask why?
<FromGitter>
<luislavena> @splattael that is great to see. I believe the `eval` parts are for the dirty *jit* code that generates to cheat and run faster.
<FromGitter>
<luislavena> when I saw the big config has my eyes were confused...
<FromGitter>
<luislavena> big config *hash
<rolha>
I just find having to type as _i64 when passing to method expecting Int64 a bit tedious (when you have to do it many times)...
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dhk has joined #crystal-lang
<FromGitter>
<cjgajard> i've been using a lot a pattern like `return unless localvar = collection[key]?` I think it is cool (it's concise and prevent double calls), but I a part of me says "that's not too obvious for people comming from other languages :/". How do you feel about it?
<FromGitter>
<johnjansen> the bit i dont like about that is the invisible `nil` return which i *think* happens
<FromGitter>
<drosehn> Yeah, I'm not fond of putting assignment statements in boolean expressions, due to years of finding bugs where someone put `a = b` when what they really wanted was `a == b`. (sometimes that "someone" was me, but many times it was not me. I was just the guy trying to find the bug)
<FromGitter>
<johnjansen> totally, 2 lines is the way to go
<RX14>
using if foo = bar where if is the start of the line is fine though
<FromGitter>
<johnjansen> technically its fine, but thats going to be very hard to spot later … i wouldnt personally allow code into our repos like that
<FromGitter>
<johnjansen> but thats me
<FromGitter>
<cjgajard> I think it is quite idiomatic Crystal since it is needed to filter types... example: `if foo = @foo` or `if bar = foo.bar`
<FromGitter>
<drosehn> eh, I'm not fond if it there either, although I realize that's frequently done in crystal. Wish I could have `a := b` (a throwback to algol68!), which would be used in boolean expressions to indicate "yes, I really meant to use `=` and not `==`".
<FromGitter>
<johnjansen> the `=` just looks way too much like a condition
<FromGitter>
<johnjansen> it is idiomatic, but just because it works doesn’t mean you should do it, ultimately its personal choice though, and someone will always disagree … if you want my opinion though, dont do it
<FromGitter>
<drosehn> It was a popular idea in C, too, at one time. That's why it wasn't a compile-time error, and instead caused run-time bugs.
<FromGitter>
<drosehn> The need to copy `@instance` variables and method-results into a local variable really does encourage the programmer to use `if l_var = @l_var`, though.
<FromGitter>
<johnjansen> it would be clearer (although longer) to do ⏎ ⏎ ```if (a=b) == true ⏎ # blah ⏎ end``` ⏎ ⏎ at least its more obvious whats going on (i realize this will irritate some people immensly though) ;-) [https://gitter.im/crystal-lang/crystal?at=583f6753381827c24da1489a]
<FromGitter>
<drosehn> hmm, yeah, maybe I'll start doing that. That wouldn't cause me to cringe as much when I'm typing it.
<FromGitter>
<johnjansen> haha, sure makes me cringe looking at it though