bcardiff has quit [Quit: Leaving.]
leafybas_ has joined #crystal-lang
leafybasil has quit [*.net *.split]
leafybasil has joined #crystal-lang
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
leafybas_ has quit [Ping timeout: 244 seconds]
irclogger______ has joined #crystal-lang
Excurio has joined #crystal-lang
epitron has quit [*.net *.split]
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1815 (master - 3e9d33a : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]
epitron has joined #crystal-lang
tmoore_ has quit [Read error: Connection reset by peer]
endou______ has quit [Read error: Connection reset by peer]
tmoore_ has joined #crystal-lang
endou______ has joined #crystal-lang
bcardiff has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1816 (master - 78f62f1 : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]
bcardiff has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
asterite has joined #crystal-lang
<asterite> hola epitron :)
<asterite> jhass: what was that CeBot? :-)
<jhass> >> 1+1
<CeBot> jhass: 2
<jhass> other question
<jhass> >> [1,2,3,4].inject &.+
<CeBot> jhass: 1
<jhass> that's a bit counter intuitive, isn't it?
<asterite> Wow! That's cool :)
<jhass> btw, it's a first spike, feel free to try to break it ;)
<asterite> But, yeah, a bit counter intuitive... but I don't think we could make it work, unless inject was some kind of macro, or we have send
<asterite> >> require "json"; [1, 2, 3].to_json
<CeBot> asterite: "[1,2,3]"
<jhass> shouldn't it error on that?
<asterite> :-D
<asterite> Well, it's invoking the unary + method
<jhass> oh, mmh
<asterite> It took me some time to understand what it works
<asterite> Maybe that's why in Ruby the method is called @+
<asterite> Is the code for the bot public?
<jhass> not yet
<asterite> It's written in Ruby?
<jhass> it's very spiky
<jhass> no, crystal
<asterite> Yay! :-D :-D
<jhass> it manages to connect, read and send messages, that's about it
<asterite> This is very useful, jhass, you can try things right here in a conversation
<jhass> yeah ;)
<jhass> also you know me, I love indirection, so you can guess how that code looks like atm :P
<jhass> btw I found something
<jhass> that LLVMGetFirstTarget always returned x86-64 was pure luck apparently
<jhass> Target#name is broken, so I actually don't even know what it returns
<jhass> but I guess it must be x86-64
<jhass> yeah, that's what I'm thinking too currently
<asterite> >> require "llvm"; LLVM.init_x86
<CeBot> asterite: ^
<asterite> >> require "llvm"; LLVM.init_x86; LLVM::Target.first.name
<CeBot> asterite: collect2: error: ld returned 1 exit status
<asterite> I guess there's no llvm in the playpen :)
<asterite> It crashes if you don't do LLVM.init_x86, but it works if you run that
<asterite> The big problem with this project is that chances of doing blame and finding my name are very high :(
<jhass> I tried binding LLVMGetTargetFromName
<jhass> and hardcoding "x86" and "x86-64" respectively
<jhass> which works
<jhass> but I don't think adding a param for that would be good/needed
<jhass> the triple should already identify it I think
<jhass> that stuff still confuses me somewhat tbh
<jhass> that init thing threw /usr/lib/crystal/io.cr:242: undefined method 'inspect' for Void btw
<jhass> finding the useful line to return in crystals error output is hard :P
<asterite> Mmm... I think Void has no methods, it doesn't even inherit Object, I think
<asterite> But maybe we should make all types inherit Object... the same goes with a C struct, you can't to_s or inspect it, but it should be possible
<asterite> The only hard thing would be to do a to_s for a C union... for that we might just say "C union" and that' it, I guess
<asterite> For the LLVM issue, I think getting the target from the triple should work
<jhass> yeah, except now I'm getting linker errors
<asterite> Is it against LLVM 3.5?
<jhass> 3.5.1, yep
<jhass> ah, cleanup helped
<asterite> The problem now is that I do: puts LLVM::Target.from_triple "x86_64-apple-darwin14.0.0"; puts LLVM::Target.from_triple "x86_64-unknown-linux-gnu"
<asterite> and it says "x86-64 - 64-bit X86: EM64T and AMD64" the two times
<asterite> Mmm... I should try with 32
<asterite> What's the target triple for a 32 bits linux machine?
<jhass> i686-pc-linux-gnu
<jhass> I hope
<jhass> the -gnu is probably not needed
<asterite> Good, it worked. I get: x86 - 32-bit X86: Pentium-Pro and above
<asterite> If you want, I can try to fix this issue by creating an LLVM target using the triple that you pass when you cross compile
<jhass> yeah, that's what I'm trying locally too atm
<asterite> Ah, good :)
<jhass> bin/crystal build --cross-compile "Linux i686" --mcpu i686 --target i686-pc-linux-gnu -o crystal32 src/compiler/crystal.cr
<jhass> seems to work
<jhass> crystal32.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (GNU/Linux), not stripped
<asterite> Oh, right, Crystal::TargetMachine.create receives the target_triple, so the change should be very small
<asterite> Awesome!
<asterite> Do you want to send a pull request or a replicate the changes?
<asterite> (I almost have it working too)
<asterite> or a -> or I
<jhass> dunno, do you need tests? :P
<asterite> Noe
<asterite> Nope
<asterite> We don't have a single test for LLVM or for all of tihs... except the compiler :-P
<asterite> I'll commit it and then reference it in the issue
<asterite> (but let me know if I did something wrong)
<jhass> sure
<jhass> I think applying the diff I pasted into the issue is worthwhile too
<jhass> and be it for debugging
<asterite> Sure, I'll add it. I missed that when I read that issue, but it's super useful
<asterite> There! Let me know if I missed something
<jhass> okay, let me clean up all my mess first :D
<asterite> >> rand
<CeBot> asterite: 0.302646
<asterite> I love it :-D
<asterite> require "http/client"; HTTP::Client.get("http://crystal-lang.org").body[0 .. 20]
<asterite> >> raise "OH NO"
<CeBot> asterite: #{e.class}: OH NO
<asterite> I guess now I know the original source code for issue 347 :-P
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1818 (master - af86aba : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]
<jhass> :P
<jhass> guess where I use the heredoc ;)
<asterite> I'm thinking...
<jhass> asterite: works like a charm <3. Now I can work on adding 32bit versions to the crystal AUR packages so I can built a 32bit chroot for playpen on my VM so I can move the bot there
<asterite> jhass; awesom!
<asterite> with an e
<jhass> did I mention I like indirection? :D
<jhass> the bot puts your code into a template ;)
<asterite> And I guess we'll start distributing 32 bits binaries in the releases (maybe not in the next one)
<jhass> yeah, I'll just upload a 32bit binary somewhere for the time being
<asterite> What template?
<jhass> an archlinux specific one
<jhass> begin; p begin; %s; end; rescue e; puts "\#{e.class}: #{e.message}"; end;
<jhass> except with newlines ;)
<asterite> So you want interpolation in heredocs, right?
<jhass> no
<jhass> well yes, but not for this one ;)
<asterite> I think %( ... ) works just fine in most cases, so that's why i don't see a big need for heredocs
<jhass> I don't use them often either
<asterite> So the heredoc is another one?
<asterite> >> puts "Hi"
<CeBot> asterite: Hi
<jhass> I don't use multiline strings often in general though
<asterite> >> 10.times { puts "Hi" }
<CeBot> asterite: Hi
<jhass> in this case it just gets the first line of the output ;)
<asterite> Good
<jhass> I try to pick the best line to display
<jhass> first line if everything went well
<jhass> since I rescue all exceptions and print them normally that works for them too
<jhass> >> sleep(10)
<CeBot> jhass: Sorry, that took too long.
<jhass> that searches for the playpen output
<asterite> Hehe :)
<jhass> and replaces it
<jhass> the tricky part is picking the right line from a compiler error
<asterite> Why don't you join all lines with some spaces?
<asterite> In any case, I'm really curious to see your code :)
<asterite> But I can wait
<jhass> IRC messages have ~150 character limit iirc
<asterite> Oh, didn't know that
<jhass> and I want to stay at a single reply
<jhass> so that's not useful, especially if a macro barfs
<asterite> >> (1..100).join "-"
<CeBot> asterite: "1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-42-43-44-45-46-47-48-49-50-51-52-53-54-55-56-57-58-59-60-61-62-63-64-65-66-67-68-69-70-71-72-73-74-75-76-77-78-79-80-81-82-83-84-85-86-87-88-89-90-91-92-93-94-95-96-97-98-99-100"
<asterite> >> (1..1000).join "-"
<CeBot> asterite: "1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-42-43-44-45-46-47-48-49-50-51-52-53-54-55-56-57-58-59-60-61-62-63-64-65-66-67-68-69-70-71-72-73-74-75-76-77-78-79-80-81-82-83-84-85-86-87-88-89-90-91-92-93-94-95-96-97-98-99-100-101-102-103-104-105-106-107-108-109-110-111-112-113-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130-131-132-13
<jhass> yeah, so maybe it was ~250
<asterite> So that's IRC's limit, not the bot's limit, right?
<jhass> right
<asterite> Interesting
<jhass> the bot sent the full thing
<jhass> so a smart IRC client breaks at the limit and sends multiple messages
<asterite> :)
<asterite> Got to sleep now
<asterite> I really like your bot
<jhass> it doesn't actually seems limited in the RFC, but the ircds do it
<jhass> cool, have a good night
<asterite> You too!
asterite has quit [Quit: Page closed]
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1820 (master - 9a0067a : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]
bcardiff has joined #crystal-lang
zamith has quit [Quit: Be back later ...]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 246 seconds]
bcardiff has quit [Quit: Leaving.]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 252 seconds]
CeBot has quit [Quit: Crystal]
CeBot has joined #crystal-lang
CeBot has quit [Client Quit]
CeBot has joined #crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 245 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 264 seconds]
CeBot has quit [Ping timeout: 246 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 265 seconds]
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 252 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 244 seconds]
zamith has joined #crystal-lang
CeBot has joined #crystal-lang
Excureo has joined #crystal-lang
<epitron> >> (1..100).map {|n| ((n+1)*10).to_s.rjust(10,"-") }.join ""
<CeBot> epitron: Error in line 3: undefined method 'rjust' for String
<epitron> Wat
<epitron> :(
Excurio has quit [Ping timeout: 240 seconds]
<jhass> epitron: time for your first PR :P
<epitron> Meh
<epitron> :)
<jhass> that should be fairly easy and fun to do actually
endou______ has quit [Ping timeout: 272 seconds]
tmoore_ has quit [Ping timeout: 272 seconds]
endou______ has joined #crystal-lang
tmoore_ has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
canhtak has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1821 (master - ab4fea6 : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1822 (master - 5941a46 : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]
asterite has joined #crystal-lang
asterite_ has joined #crystal-lang
asterite_ has quit [Client Quit]
<asterite> I didn't know about String#rjust and ljust... yes, they seem fun (and easy) to implement
<asterite> >> Time.now
<CeBot> asterite: 2015-01-25 19:53:25
<asterite> >> {{ `ls`.join(" ") }}
<CeBot> asterite: Error in line 3: expanding macro
<asterite> >> {{ `ls`.split('\n').join(" ") }}
<CeBot> asterite: ""
<asterite> >> {{ `pwd`.stringify }}
<CeBot> asterite: "/home/crystal\n"
CeBot has quit [Quit: Crystal]
CeBot has joined #crystal-lang
<jhass> >> {{ `ls`.join(" ") }}
<CeBot> jhass: in line 3: undefined macro method StringLiteral#join'
<jhass> :)
<asterite> Cool! :)
<asterite> I got a crystal 32 bits on a trusty32 VM
<jhass> yay
<jhass> so the hmac error is still there of course
<asterite> I guess, I didn't try it. I get a segfault at this: puts({1 => 2} == {1 => 2})
<asterite> It's a pretty small program, but it still has Hash, so it could be smaller
<jhass> spec/compiler/codegen/alias_spec.cr fails
<asterite> I tried cross-compiling that program to 32 bits and it works
<jhass> fails = segfaults
<asterite> but that program, compiled with the 32 bits compiler, fails
<jhass> yeah, that's what I'm experiencing too
<jhass> which is why I guess that the target triple is not correctly autodetermined or something like that
<asterite> I'm sure it's just one or two tiny things we have to change/fix, but they'll be hard to find
<jhass> how do we actually generate the target triple when there's none given?
<jhass> same question for cpu
<asterite> It's LLVM::default_target_triple
<asterite> it's a method from LLVM
<jhass> ah
<asterite> I think it returns the same as `llvm-config --host-targets`
<jhass> yeah, if it wasn't that it would've been my suggestions
<jhass> I asked because while building the sandbox I noticed a call to uname -m -s
<asterite> Ugh, it gives me "i386-pc-linux-gnu"
<jhass> mmh
<asterite> while `llvm-config --host-target` gives me "i686-pc-linux-gnu"
<asterite> Is there a difference?
<jhass> yes and no
<jhass> both should yield x86 as cpu
<jhass> same for i486, i586,
<asterite> `uname -m -s` is invoked to get the flags that you use in ifdef, so I don't think that's the problem
<jhass> but I guess the instruction set is slightly different
<asterite> I'll try to cross-compile against i386
<asterite> It still segfaults
<jhass> so what about the cpu/mcpu thingy, where does that come from if not passed?
<asterite> I see we pass "" to it, and I guess LLVM tries to figure it out
<asterite> but I tried also specifying it with the --cpu option and it fails too, so maybe that's not it
<asterite> Hash#== fails, so I'm trying to write a Hash2 class and reduce it to find the problem
zamith has quit [Quit: Be back later ...]
zamith has joined #crystal-lang
<asterite> jhass: Well, I found something. Now more specs pass, but some still fail, so I have to continue investigating... I guess it'll take me a lot of time, but eventually we'll make it :)
<jhass> cool
<jhass> not to sidetrack but
<jhass> >> def foo &block : String ->; end
<CeBot> jhass: Failed to run your code, sorry!
<jhass> eh
<jhass> Syntax error in eval:3: \e[1munexpected token: &\e[0m\n
<jhass> I should open an issue I guess :P
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1823 (master - ad66e73 : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]
<asterite> Should, that should be supported
<jhass> asterite: I got a list failing spec files (hmac, segfaults, one failure in complex) prior your last commit now, should I post it?
<asterite> Should, it can help
<asterite> I'll also post short snippets that fail
<asterite> I think there might be an issue with libunwind bindings or llvm exception-related issues (landing pad, etc.)... so I'll have to check with @waj to continue
asterite has quit [Quit: Page closed]
travis-ci has joined #crystal-lang
<travis-ci> manastech/crystal#1824 (master - f445d12 : Ary Borenszweig): The build passed.
travis-ci has left #crystal-lang [#crystal-lang]