RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.0 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
pawnbox has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 264 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 245 seconds]
pawnbox has quit [Remote host closed the connection]
shawn42 has quit [Quit: Connection closed for inactivity]
pawnbox has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
DeBot has quit [Ping timeout: 260 seconds]
jhass has quit [Ping timeout: 250 seconds]
jhass has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
tomchapin has joined #crystal-lang
<crystal-gh> [crystal] trans opened pull request #3608: YAML support for emitting tags and style (master...emit-tags) https://git.io/v1Y1v
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
<travis-ci> crystal-lang/crystal#c94094c (master - Refactor interpret '==' and '!=' of MacroId): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/179893993
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
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
tomchapin has quit [Read error: Connection reset by peer]
soveran has quit [Remote host closed the connection]
<BlaXpirit> yeah i often want that too. but i dont know any shorthand
tomchapin has joined #crystal-lang
tomchapin has quit [Read error: Connection reset by peer]
olbat has quit [Changing host]
olbat has joined #crystal-lang
olbat has left #crystal-lang [#crystal-lang]
olbat has joined #crystal-lang
tomchapin has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v1OBj
<crystal-gh> crystal/master 760268b TSUYUSATO Kitsune: Move filename and some file location methods under to Crystal::Macros::ASTNode
Nik736 has joined #crystal-lang
Philpax has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 256 seconds]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/v1Og2
<crystal-gh> crystal/master 17c829d Ary Borenszweig: Pretty print: call inspect if redefined...
<crystal-gh> crystal/master c6159b1 Ary Borenszweig: Fixed incorrect MatchData docs. Fixes #3606
<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]
<travis-ci> crystal-lang/crystal#760268b (master - Move filename and some file location methods under to Crystal::Macros::ASTNode): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/180068551
<FromGitter> <zatherz> @asterite will we ever be able to write something like ⏎ ⏎ ```class Test ⏎ property test : UInt8 = 3 ⏎ end``` ⏎ ⏎ and have `Test.new.test` return a `3_u8`? [https://gitter.im/crystal-lang/crystal?at=583ee485381827c24d9dd028]
<Papierkorb> ^
krsh has quit [Quit: krsh]
gloscombe has joined #crystal-lang
vasilakisfil_ has joined #crystal-lang
vasilakisfil has quit [Ping timeout: 250 seconds]
<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.
snsei has quit [Ping timeout: 246 seconds]
<crystal-gh> [crystal] RX14 opened pull request #3611: Ensure wrapper usage (master...feature/ensure-wrapper) https://git.io/v13eT
vivus-ignis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v13eN
<crystal-gh> crystal/master c5cf484 Ary Borenszweig: Add ArrayLiteral#[]= in macros
<crystal-gh> [crystal] asterite opened pull request #3612: Add finished macro hook (master...feature/finished) https://git.io/v13Jj
mounibec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
vivus-ignis has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
vivus-ignis has quit [Quit: Textual IRC Client: www.textualapp.com]
emancu has quit []
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
hako has quit [Ping timeout: 260 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
gloscombe has quit [Read error: Connection reset by peer]
<FromGitter> <splattael> @spalladino @luislavena I've started a port of optcarrot https://github.com/splattael/optcarrot.cr
<FromGitter> <splattael> Currently I'm doing 1:1 translation a la "If it compiles, next file" :D
<FromGitter> <splattael> PR etc. welcome
<FromGitter> <spalladino> Awesome!! Do keep us posted on how it goes, or if you need any help whatsoever :-)
<FromGitter> <splattael> missing trailing `while` a bit ;)
<FromGitter> <spalladino> You can always abuse macros: ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=583f2cbc8d65e3830ebea818]
<FromGitter> <spalladino> macro do_while(condition) ⏎ {{ yield }} ⏎ while {{ condition }} ⏎ {{ yield }} ⏎ end ... [https://gitter.im/crystal-lang/crystal?at=583f2cc589d179bf4de5fb35]
<FromGitter> <splattael> :)
<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)...
<Papierkorb> rolha: 1) the underscore is actually optional. thank god. 2) https://github.com/crystal-lang/crystal/issues/2995
<BlaXpirit> that issue is really heating up huh. 2 people ran into it today
<Yxhuvud> rolha: if it is the same method, define a variant that take something else and cast in that variant
<rolha> Papierkorb: interesting read, thanks.
<Yxhuvud> you can have several methods with the same name if the signatures are different
<RX14> I much prefer it with the underscore
<RX14> 7u64 vs 7_u64 the latter looks way nicer to me
<rolha> Yxhuvud: yes, that's a possibility, thanks.
<BlaXpirit> the nicest is when they are not there
<rolha> But it's just to write specs where the literals are still within Int32, so perhaps I'll just bite the bullet
<rolha> and type a lot of "_i64"s
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rolha has joined #crystal-lang
Philpax has joined #crystal-lang
triangles has joined #crystal-lang
triangles2 has joined #crystal-lang
mounibec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Philpax has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
mounibec has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rolha has quit [Remote host closed the connection]
rolha has joined #crystal-lang
rolha has quit [Client Quit]
soveran has quit [Remote host closed the connection]
rolha has joined #crystal-lang
mounibec has quit [Quit: Textual IRC Client: www.textualapp.com]
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
<RX14> i think it's fine
<RX14> but I usually make it 2 lines
<RX14> localvar = whatever
<RX14> return unless localvar
<RX14> it's a bit cleaner
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
<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