jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.2 | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal - Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 272 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 276 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 250 seconds]
mdz_ has joined #crystal-lang
havenwood has quit [Remote host closed the connection]
mdz_ has quit [Remote host closed the connection]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 245 seconds]
havenwood has joined #crystal-lang
mdz_ has joined #crystal-lang
mdz_ has quit [Ping timeout: 265 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 272 seconds]
DerisiveLogic has quit [Ping timeout: 265 seconds]
bcardiff has joined #crystal-lang
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
DerisiveLogic has joined #crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 255 seconds]
bcardiff has quit [Quit: Leaving.]
mdz_ has joined #crystal-lang
JBat has joined #crystal-lang
mdz_ has quit [Ping timeout: 240 seconds]
mdz_ has joined #crystal-lang
mdz__ has joined #crystal-lang
mdz__ has quit [Remote host closed the connection]
mdz_ has quit [Ping timeout: 240 seconds]
bcardiff has joined #crystal-lang
ismaelga has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
zamith has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
zamith has quit [Ping timeout: 276 seconds]
mdz_ has joined #crystal-lang
mdz_ has quit [Ping timeout: 244 seconds]
datanoise has quit [Ping timeout: 272 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 265 seconds]
datanoise has joined #crystal-lang
JBat has quit [Ping timeout: 246 seconds]
datanoise has quit [Ping timeout: 256 seconds]
strcmp1 has quit [Ping timeout: 272 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 250 seconds]
DerisiveLogic has quit [Ping timeout: 244 seconds]
BlaXpirit has joined #crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 272 seconds]
zamith has joined #crystal-lang
blAckEn3d has joined #crystal-lang
zamith has quit [Ping timeout: 252 seconds]
<unshadow> >> File.write("/tmp/testing1234.test"); a = File.exist?("/tmp/testing1234.test"); File.delete("/tmp.testing1234.test") if a
<DeBot> unshadow: Error in line 4: wrong number of arguments for 'File::write' (1 for 2) - http://carc.in/#/r/11q
<unshadow> >> File.write("/tmp/testing1234.test", "test"); a = File.exist?("/tmp/testing1234.test"); File.delete("/tmp.testing1234.test") if a
<DeBot> unshadow: Error in line 4: undefined method 'exist?' for File:Class (did you mean 'exists?'?) - http://carc.in/#/r/11r
<unshadow> >> File.write("/tmp/testing1234.test", "test"); a = File.exists?("/tmp/testing1234.test"); File.delete("/tmp.testing1234.test") if a
<DeBot> unshadow: Errno: Error deleting file '/tmp.testing1234.test': Read-only file system - more at http://carc.in/#/r/11s
<unshadow> >> File.write("/tmp/testing1234.test", "test"); a = File.exists?("/tmp/testing1234.test"); File.delete("/tmp/testing1234.test") if a
<DeBot> unshadow: # => nil - http://carc.in/#/r/11t
<unshadow> >> path = "/tmp/testing1234.test"; File.write(path, "test"); a = File.exists?(path); File.delete(path) if a
<DeBot> unshadow: # => nil - http://carc.in/#/r/11u
<unshadow> hm....
strcmp1 has joined #crystal-lang
royaso has joined #crystal-lang
<royaso> test
royaso has left #crystal-lang [#crystal-lang]
<unshadow> Is there a way to patch a lib on-the-fly ? I mean, if I have additions to a certain lib in the stdlibs , can I do something like class Thread < Thread and add what I want ?
<jhass> unshadow: just open it again, class Thread
<unshadow> Cool, thanks
<unshadow> lets say I have something like that: http://carc.in/#/r/122 in my code, where will be good to put it ? as another file ? at the top of main file ?
<unshadow> what priority are the files loaded ? lets say my first call in my code is for the .alive? , do I need to make sure this part of the code is before ? is require always the first ?
datanoise has joined #crystal-lang
<jhass> currently I put it into lib/myproject/core_ext/thread.cr
<jhass> and require that explicitly before I need it
<jhass> (at the top of the file that needs it)
<jhass> pretty sure load order is FS order if you use things like ./*
datanoise has quit [Ping timeout: 256 seconds]
bcardiff has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
bcardiff has quit [Quit: Leaving.]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 252 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 246 seconds]
<blAckEn3d> is there any way to make the compiler dump the ast or any other way to expand macros?
<jhass> crystal hierarchy ?
Dreamer3 has quit [Ping timeout: 258 seconds]
<jhass> a "good" way to see what code a specific macro generated is to just add a syntax error to it
<blAckEn3d> crystal hierarchy doesn't seem to dump the methods in classes
<jhass> yeah
<jhass> it's more intended for the types of the ivars
<blAckEn3d> yeah :)
<jhass> crystal doc should run after macro expansion too
<blAckEn3d> cool, I'll look into it
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 256 seconds]
dhruv_ has quit [Ping timeout: 256 seconds]
ponga has joined #crystal-lang
<blAckEn3d> hm, can anyone help with this: https://gist.github.com/muscar/7588f88e41c132d3cecb
<blAckEn3d> I get: in /usr/local/Cellar/crystal/0.7.2/src/llvm/builder.cr:19: tried to convert LLVM::Value to LibLLVM::ValueRef invoking to_unsafe, but can't deduce its type
Codcore has joined #crystal-lang
<jhass> mmh, you didn't touch LLVM::Value's definition though? or added subclasses or the like?
<blAckEn3d> nope
<Codcore> Is there a safe way to make "self.new" method of a class private without redefining it?
<jhass> http://play.crystal-lang.org/#/r/14a won't get better I'm afraid
<jhass> at least for now, might want to open a suggestion for it
<Codcore> jhass, thanks it fits for me
<jhass> blAckEn3d: I think you're passing the wrong thing: https://github.com/manastech/crystal/blob/master/src/llvm/value.cr#L7
<jhass> it expects a ValueRef though
<blAckEn3d> @jhass I had the same code in a non-visitor method and it worked
<jhass> mh
<jhass> okay, ValueRef is Void* so it should accept anything anyway
<Codcore> it might be a macros for it like's Ruby private_class_method ":mehod_name"
<jhass> blAckEn3d: what if you pass val.unwrap though?
<blAckEn3d> if I change the code to: @ctx.builder.ret(LLVM::Int32, 1) it works
<blAckEn3d> let's see
<blAckEn3d> Error: you've found a bug in the Crystal compiler. Please open an issue: https://github.com/manastech/crystal/issues
<blAckEn3d> fun
<jhass> *shrug*, I'd say hang around until asterite drops by (might be not before tomorrow though)
<blAckEn3d> thanks :)
<blAckEn3d> I'll be around
<unshadow> Why can't Socket.write handle a string ? why should I Slice it to UInt8 ?
<blAckEn3d> just FIY, this works: @ctx.builder.ret (val.unwrap as LibLLVM::ValueRef)
<blAckEn3d> must be a bug in the type inferencer
<jhass> yeah
<jhass> unshadow: just use <<
<unshadow> Socket.write << "String" ?
<unshadow> >> puts << "test"
<DeBot> unshadow: Error in line 4: undefined method '<<' for Nil - http://carc.in/#/r/14g
<unshadow> >> puts << "test".to_s
<DeBot> unshadow: Error in line 4: undefined method '<<' for Nil - http://carc.in/#/r/14h
<unshadow> Oo
<unshadow> >> a = << "test"
<DeBot> unshadow: Syntax error in eval:4: unexpected token: << - http://carc.in/#/r/14i
zamith has joined #crystal-lang
<BlaXpirit> wat
<unshadow> how do I use the << thingy ?
<unshadow> Oh, so Socket << "String"
zamith has quit [Ping timeout: 255 seconds]
<jhass> io << "string", yeah
<unshadow> jhass: working, thanks :)
blAckEn3d has quit []
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 265 seconds]
<Codcore> I've got bug message when trying to call singleton object method - http://play.crystal-lang.org/#/r/14u
<unshadow> Error: you've found a bug in the Crystal compiler. Please open an issue: https://github.com/manastech/crystal/issues
<unshadow> :)
<Codcore> yeah, by nobody answered
<jhass> it's sunday, have some patience ;)
<Codcore> Oh, I forgot it
<unshadow> XD only jhass is here 24/7 not sleeping not eating.
<Codcore> He is crzy =)
<unshadow> Codcore: almost, he is german ;)
<unshadow> How can I tail (follow) a file using Crystal ? for example, I want to see if something new is added and then do with it something
<Codcore> unshadow, You need to watching at 'modified' metainformation of file, i think
<unshadow> I see file has mtime, is that modified time ?
<Codcore> =) I think it is
<unshadow> >> system("touch /tmp/testing1234"); File.mtime("/tmp/testing1234")
<DeBot> unshadow: Error in line 4: undefined method 'mtime' for File:Class - http://carc.in/#/r/14w
<unshadow> >> system("touch /tmp/testing1234"); File::Stat.mtime("/tmp/testing1234")
<DeBot> unshadow: Error in line 4: undefined method 'mtime' for File::Stat:Class - http://carc.in/#/r/14x
<unshadow> >> system("touch /tmp/testing1234"); f = File::Stat.new("/tmp/testing1234"); puts f.mtime
<DeBot> unshadow: 2015-05-31 11:56:55 UTC - more at http://carc.in/#/r/14y
<unshadow> >> system("touch /tmp/testing1234"); f = File::Stat.new("/tmp/testing1234"); puts f.blksize
<DeBot> unshadow: 4096 - more at http://carc.in/#/r/14z
<unshadow> whats the difference between a Fiber and a Thread ?
<unshadow> nm, used google
<unshadow> >> STDOUT << "Testing"
<DeBot> unshadow: Testing - http://carc.in/#/r/15e
<unshadow> jhass: What do you say about the Threads v.s Fibers thingy ? don't you think that using Fibers instead of Threads is like getting stuck under Ruby's GIL all over again ?
<jhass> no
<jhass> once properly implemented you can stack fibers into threads and even cross thread boundaries
<unshadow> Oh, so it's lie using multiple MRI's each with it's own set of Fibers
<unshadow> kind of
<jhass> mh, no, you don't understand the GVL I think :P
<unshadow> Wht's GVL ?
<jhass> well, MRI is a VM since 1.9, not an interpreter, so a nitpick ;P
<unshadow> Oh...
<unshadow> Global VM Lock hahah
<unshadow> ok
leafybasil has quit [Remote host closed the connection]
<unshadow> As far as I know, the GIL (GVL) is an issue where because the VM is using a Single Thread and rubies threads are not real (as in virtual thread) then you cannot do more then 1 concurent execution of ruby code (not incl IO operations which are handeled differently)
<jhass> nope
sandelius has joined #crystal-lang
<jhass> A ruby thread is backed by a real pthread
<jhass> MRI just ensures that only one thread is active when executing Ruby code
<jhass> well, basically
<unshadow> Ok, so this means it's almost like Fibers, the mechanizem is different, but the end result is the same
<jhass> well, for now, the mid term plan is to have the fibers distributed to a thread pool
<unshadow> And who controls the thread pool ?
<unshadow> like, will you have a way to specify maximum Threads ?
<jhass> I think nobody has an idea yet
<unshadow> Oh
<unshadow> so this is a long term goal
<jhass> well, everybody defines their terms different I guess
<unshadow> :)
datanoise has joined #crystal-lang
<unshadow> jhass: Thanks for the link, it was a good read (all 3 parts) I guess I really didn't understand how the GIL works
datanoise has quit [Ping timeout: 265 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BlaXpirit_ has joined #crystal-lang
BlaXpirit has quit [Killed (orwell.freenode.net (Nickname regained by services))]
sandelius has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 256 seconds]
bcardiff has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
datanoise has joined #crystal-lang
ismaelga has joined #crystal-lang
datanoise has quit [Ping timeout: 272 seconds]
<vikaton> is Crystal technically corporately backed?
havenwood has joined #crystal-lang
ismaelga has quit [Ping timeout: 250 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<unshadow> Looks like I'm the only one who ever used regex in gets... I was sure this was a regular thingy to do
sandelius has joined #crystal-lang
ismaelga has joined #crystal-lang
asterite has joined #crystal-lang
asterite has quit [Client Quit]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
datanoise has joined #crystal-lang
sandelius has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
Dreamer3 has joined #crystal-lang
leafybasil has joined #crystal-lang
kulelu88 has joined #crystal-lang
datanoise has quit [Ping timeout: 252 seconds]
havenn has joined #crystal-lang
havenwood has quit [Ping timeout: 256 seconds]
havenn is now known as havenwood
datanoise has joined #crystal-lang
ismaelga has joined #crystal-lang
zamith has joined #crystal-lang
<crystal-gh> [crystal] veelenga opened pull request #719: Corrected build command name in crystal build usage (master...usage_desc_fix) http://git.io/vkodx
ponga has quit [Quit: Leaving...]
ismaelga has quit [Remote host closed the connection]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sandelius has joined #crystal-lang
ismaelga has joined #crystal-lang
datanoise has quit [Ping timeout: 256 seconds]
flaviu has joined #crystal-lang
datanoise has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
datanoise has quit [Ping timeout: 240 seconds]
mdz_ has quit [Ping timeout: 272 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mdz_ has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
miah has joined #crystal-lang
bcardiff has joined #crystal-lang
<BlaXpirit> i made yet another partially working lib generator. yay.
zamith has quit [Quit: Be back later ...]
<BlaXpirit> well it's actually pretty complete, just gotta add constants and variables
<jhass> what approach? clang API?
<BlaXpirit> jhass, Python library that parses C :|
zamith has joined #crystal-lang
<jhass> ah, so the ruby-ffi thingy except in python :P
<jhass> only perl's left I guess!
<BlaXpirit> i dont know ruby-ffi, and the thing based on it is definitely incomplete
<jhass> recently found something nice in glib-2.0, typedef struct GTestCase GTestCase;
<jhass> wonder what you'd generate for that
<BlaXpirit> jhass, type GTestCase = Void*
<jhass> mh, yeah
<jhass> will have to update crystal-gobject to do that eventually
<BlaXpirit> and then i remove 1 pointer when it's used :>
<jhass> well, you can alias to Void too
<BlaXpirit> hm ok
<BlaXpirit> now i realized that the lib just uses preprocessor, so it ignores #define constants
<BlaXpirit> so i'm gonna make some dirty hacks :>
Codcore has quit [Quit: Page closed]
zamith has quit [Quit: Be back later ...]
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 252 seconds]
ismaelga has joined #crystal-lang
<BlaXpirit> i need asterite or waj
<BlaXpirit> well not really
<BlaXpirit> it seems like https://github.com/manastech/crystal_lib only shows all #defines
<BlaXpirit> cpp -dM ftw
strcmp1 has quit [Quit: Leaving]
<BlaXpirit> hmm I would like to make many requests to Crystal asking it "does this compile?"
kulelu88 has quit [Ping timeout: 264 seconds]
BlaXpirit has quit [Quit: Quit Konversation]
kulelu88 has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
datanoise has joined #crystal-lang
willl has quit [Quit: Connection closed for inactivity]
datanoise has quit [Ping timeout: 246 seconds]
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
datanoise has joined #crystal-lang
willl has joined #crystal-lang