asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.1 | 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
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
<travis-ci> manastech/crystal#2269 (master - 86a7fae : Ary Borenszweig): The build has errored.
ismaelga has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vJID9
<crystal-gh> crystal/master c2aedda Ary Borenszweig: Optimized STDIN.gets because it's so common some benchmarks and mini programs will be slow if not using BufferedIO
<crystal-gh> crystal/master 280a505 Ary Borenszweig: Fixed: lib fun weren't propagating raise info
<crystal-gh> crystal/master c142140 Ary Borenszweig: Revert "Assume all C functions are marked with @[Raises], in case they invoke functions defined in Crystal"...
<Dreamer3> is there anything like "browser" but post macros?
<Dreamer3> so i can learn what the macros are doing
ismaelga has joined #crystal-lang
<Dreamer3> can i set a variable in one macro and use it in another?
<Dreamer3> ok any simple ORMs yet? :)
<Dreamer3> ok macros look kind of powerful
<Dreamer3> can i make a macro that encloses things?
<Dreamer3> like to pre/postfix methods
<fowl> wanderer_, hey i am just getting back from dinner, will try it shortly
ponga has joined #crystal-lang
<Dreamer3> can i get an example of a macro that's aware of context again?
<Dreamer3> >> 1+1
<DeBot> Dreamer3: 2
<Dreamer3> >> macro x; puts {{x.id}}; end; x
<DeBot> Dreamer3: in line 3: undefined macro variable 'x'
<Dreamer3> >> macro(x); puts {{x.id}}; end; x
<DeBot> Dreamer3: Syntax error in eval:3: expecting any of these tokens: IDENT, CONST, =, <<, <, <=, ==, ===, !=, =~, >>, >, >=, +, -, *, /, !, ~, %, &, |, ^, **, [], []=, <=>, []? (not '(')
<Dreamer3> >> macro x(); puts {{name}}; end; x
<DeBot> Dreamer3: in line 3: undefined macro variable 'name'
<Dreamer3> >> macro x(); puts {{self.name}}; end; x
<DeBot> Dreamer3: in line 3: undefined macro variable 'self'
<Dreamer3> >> macro x(); puts {{type.name}}; end; x
<DeBot> Dreamer3: in line 3: undefined macro variable 'type'
<Dreamer3> grrrr
<Dreamer3> >> class A; macro x(); puts {{type.name}}; end; x; end
<DeBot> Dreamer3: in line 3: undefined macro variable 'type'
<Dreamer3> >> def a; macro x(); puts {{type.name}}; end; x; end; a
<DeBot> Dreamer3: Syntax error in eval:3: can't define macro inside def
<Dreamer3> >> macro x(); puts {{type.name}}; end; def a; x; end; a
<DeBot> Dreamer3: in line 3: undefined macro variable 'type'
<Dreamer3> >> macro x(); puts {{name}}; end; def a; x; end; a
<DeBot> Dreamer3: in line 3: undefined macro variable 'name'
<Dreamer3> >> macro x(); puts {{self.name}}; end; def a; x; end; a
<DeBot> Dreamer3: in line 3: undefined macro variable 'self'
<Dreamer3> >> macro x(); puts {{type.name}}; end; def a; x; end; a
<DeBot> Dreamer3: in line 3: undefined macro variable 'type'
<Dreamer3> >> macro x(); puts {{x.name}}; end; def a; x; end; a
<DeBot> Dreamer3: in line 3: undefined macro variable 'x'
<Dreamer3> >> macro x(); puts {{@name}}; end; def a; x; end; a
<DeBot> Dreamer3: in line 3: unknown macro instance var: '@name'
<Dreamer3> maybe a method isn't enough context?
CraigBuchek has joined #crystal-lang
willlll has quit [Quit: willlll]
ismaelga has quit [Remote host closed the connection]
shama has quit [Remote host closed the connection]
<fowl> wanderer_, the link says file not found http://speedy.sh/AFtY7/crystal.7z
shama has joined #crystal-lang
drizz has quit [Read error: Connection reset by peer]
drizz has joined #crystal-lang
shama has quit [Remote host closed the connection]
shama has joined #crystal-lang
<Dreamer3> maybe a method isn't enough context?
<Dreamer3> are named args supporteD?
<Dreamer3> the errors are confusing me
<Dreamer3> only if i give them default values?
<Dreamer3> i want named, required, no default
<Dreamer3> i want named, required, no default
JBat has joined #crystal-lang
CraigBuchek has quit [Quit: Leaving.]
shama has quit [Remote host closed the connection]
harisamin has joined #crystal-lang
BlaXpirit has joined #crystal-lang
wanderer_ has quit [Ping timeout: 246 seconds]
HakanD has joined #crystal-lang
HakanD has quit [Quit: Be back later ...]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
HakanD has joined #crystal-lang
harisamin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
harisamin has joined #crystal-lang
harisamin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Ping timeout: 252 seconds]
JBat has quit [Quit: Computer has gone to sleep.]
DerisiveLogic has quit [Ping timeout: 255 seconds]
havenwood has quit []
HakanD_ has joined #crystal-lang
HakanD has quit [Read error: Connection reset by peer]
BlaXpirit has quit [Quit: Quit Konversation]
willlll has joined #crystal-lang
willlll has quit [Quit: willlll]
Ven has joined #crystal-lang
Ven has quit [Client Quit]
Ven has joined #crystal-lang
JBat has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orliesaurus has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
HakanD__ has joined #crystal-lang
leafybasil has joined #crystal-lang
HakanD_ has quit [Ping timeout: 265 seconds]
ismaelga has joined #crystal-lang
Ven has joined #crystal-lang
vikaton has joined #crystal-lang
vikaton has left #crystal-lang [#crystal-lang]
vikaton has joined #crystal-lang
<vikaton> >> x = null; x
<DeBot> vikaton: Error in line 3: undefined local variable or method 'null'
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ismaelga has quit [Remote host closed the connection]
HakanD__ has quit [Quit: Be back later ...]
ismaelga has joined #crystal-lang
HakanD__ has joined #crystal-lang
HakanD___ has joined #crystal-lang
HakanD__ has quit [Ping timeout: 256 seconds]
ismaelga has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
ismaelga has joined #crystal-lang
BlaXpirit-UA has joined #crystal-lang
leafybasil has quit [Ping timeout: 264 seconds]
DerisiveLogic has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
strcmp1 has joined #crystal-lang
HakanD___ has quit [Read error: Connection reset by peer]
HakanD___ has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DeBot has quit [Quit: Crystal]
CraigBuchek has joined #crystal-lang
DeBot has joined #crystal-lang
willlll has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vJq5l
<crystal-gh> crystal/master 785241a Ary Borenszweig: Added Enum#to_i
<crystal-gh> crystal/master b95cc7a Ary Borenszweig: Updated Changelog
<crystal-gh> crystal/master 4c49a52 Ary Borenszweig: Fixed meteor sample
ismaelga has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Read error: No route to host]
Ven has joined #crystal-lang
<travis-ci> manastech/crystal#2271 (master - 4c49a52 : Ary Borenszweig): The build is still failing.
havenwood has joined #crystal-lang
<Dreamer3> vikaton: nil
<Dreamer3> >> x = nil
<DeBot> Dreamer3: nil
<vikaton> yeah i was just testing
CraigBuchek has quit [Quit: Leaving.]
leafybas_ has joined #crystal-lang
leafybasil has quit [Ping timeout: 264 seconds]
leafybas_ has quit [Ping timeout: 265 seconds]
leafybasil has joined #crystal-lang
<Dreamer3> macro get(url : String, str : String)
<Dreamer3> shuld that not enforce those types?
<Dreamer3> it's trying to pass a Call to the 2nd arg
<Dreamer3> i was thinking it should just fail to match the macro since the call profile isn't the same
<Dreamer3> at the very least i'd like to match a real function if it's argument types all match up, rather than the macro
harisamin has joined #crystal-lang
leafybasil has quit [Ping timeout: 256 seconds]
dom96 has quit [Changing host]
dom96 has joined #crystal-lang
barosl has quit [Quit: Leaving]
leafybasil has joined #crystal-lang
zipR4ND has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CraigBuchek has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 276 seconds]
<vikaton> :[
knoopx has joined #crystal-lang
CraigBuchek has quit [Quit: Leaving.]
zipR4ND has quit [Ping timeout: 245 seconds]
<vikaton> are there docs on how to use ecr
BlaXpirit-UA has quit [Quit: Quit Konversation]
BlaXpirit has joined #crystal-lang
<vikaton> how do I go about serving .ecr files with Frank ?
<vikaton> or any other framework in crystal
leafybas_ has joined #crystal-lang
leafybas_ has quit [Read error: Connection reset by peer]
zipR4ND has joined #crystal-lang
<jhass> look at crystalshard again, it does that
leafybas_ has joined #crystal-lang
leafybas_ has quit [Remote host closed the connection]
<vikaton> o
leafybasil has quit [Ping timeout: 245 seconds]
<vikaton> OKay
<vikaton> idk why this isnt working :/
<vikaton> the ecr is working, but my site as a whole isnt
<jhass> to solve "isn't working" you apply "just fix it"
<vikaton> I see the cause
<vikaton> jhass, if you mind, try inputting something in the text box: http://stackin.money:3000/
<jhass> just reloads
<vikaton> exactly
<vikaton> not supoed to happen
<vikaton> but when I remove the ecr syntax, it works
<vikaton> any fix to that ?
<jhass> yeah, just apply "fix it"
<vikaton> I can't
<vikaton> I dont have that tool
<jhass> it's not a tool, it's a description of solution reflecting the amount of detail in your problem description
<vikaton> okay
<vikaton> jhass, in my html file, when a word is inputted in the text box, like "help" this happen in the JS
<vikaton> document.getElementById('yes').innerHTML = "Hi"
<vikaton> if its like that it works and the text is "Hi"
<vikaton> if I have document.getElementById('yes').innerHTML = "<%= "hi" %>;
<vikaton> It reloads the page, no matter what word it is
<vikaton> and I can't figure out why :[
<jhass> check the JS error console
<jhass> in your browser
Excureo has quit [Read error: Connection reset by peer]
<vikaton> I got unexoected token illgegal
<vikaton> illegal
<vikaton> ah found it
<vikaton> Thanks jhass :)
<vikaton> aaaand another error :[
Excureo has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
<vikaton> >> "hello".gsub "h", "k"
<vikaton> uhhh
<vikaton> >> "hi"
<DeBot> vikaton: "hi"
<vikaton> >> "hello".gsub "h", "k"
<vikaton> it doesnt wnna work :9
<jhass> the trigger is ">>" not " >>"
<vikaton> it doesnt wnna work :9
<vikaton> oops
<vikaton> >> "hello".gsub "h", "k"
<vikaton> its literally >>
<vikaton> not " >>"
knoopx has quit [Remote host closed the connection]
<vikaton> >> "hi"
<DeBot> vikaton: "hi"
<vikaton> >> "hello".gsub "h","k"
<DeBot> vikaton: Error in line 3: no overload matches 'String#gsub' with types String, String
<vikaton> uhh, what?
<vikaton> jhass, isnt that how you use it in Ruby ?
endou has joined #crystal-lang
<vikaton> >> "hello".gsub /h/,"k"
<DeBot> vikaton: "kello"
<vikaton> oh
jhass|off has joined #crystal-lang
<epitron> vikaton: omg, your domain is awesome
zipR4ND has quit [*.net *.split]
harisamin has quit [*.net *.split]
jhass has quit [*.net *.split]
endou_ has quit [*.net *.split]
strcmp1 has quit [*.net *.split]
havenwood has quit [*.net *.split]
jhass|off is now known as jhass
havenwood has joined #crystal-lang
HakanD___ has quit [Quit: Be back later ...]
<vikaton> heh thanks epitron
strcmp1 has joined #crystal-lang
zipR4ND has joined #crystal-lang
jua_ has joined #crystal-lang
<vikaton> How do we gsub spaces?
<jhass> >> "foo bar".gsub " ", "\t"
<DeBot> jhass: Error in line 3: no overload matches 'String#gsub' with types String, String
<jhass> :o
<jhass> >> "foo bar".gsub / /, "\t"
<DeBot> jhass: Syntax error in eval:7: unterminated regular expression
<jhass> ah, too old crystal :/
<vikaton> yeah :/
<jhass> >> "foo bar".gsub %r( ), "\t"
<DeBot> jhass: "foo\tbar"
<vikaton> o
<jhass> >> "foo bar".tr " ", "\t"
<DeBot> jhass: "foo\tbar"
<BlaXpirit> wondering if I should use significant whitespace in strings
<BlaXpirit> like, i have a multiline string that has lines witth trailing whitespace
wanderer_ has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 4 new commits to master: http://git.io/vJOO0
<crystal-gh> crystal/master 1cbb9e5 Ary Borenszweig: Removed partial and unused db-related code
<crystal-gh> crystal/master cc0266e Ary Borenszweig: Improved error message for "already initialized constant"
<crystal-gh> crystal/master 3957dd5 Ary Borenszweig: Fixed #595: disallow classes inside captured blocks
asterite has joined #crystal-lang
willlll has quit [Quit: willlll]
Dreamer3 has quit [Remote host closed the connection]
Dreamer3 has joined #crystal-lang
willlll has joined #crystal-lang
<travis-ci> manastech/crystal#2272 (master - 7f20fdc : Ary Borenszweig): The build is still failing.
ismaelga has quit [Remote host closed the connection]
<zipR4ND> hey crystal people, is there any explanation on how to use threads ?
<jhass> not much to it, thread = Thread.new { concurrent_code }; thread.join
<BlaXpirit> how to make empty array of arrays of type?
<jhass> Array(Array(X))
<BlaXpirit> oh
<jhass> >> [] of Array(String]
<DeBot> jhass: Syntax error in eval:3: expecting token ')', not ']'
<jhass> >> x = [] of Array(String]; x << ["foo"]
<DeBot> jhass: Syntax error in eval:3: expecting token ')', not ']'
<jhass> bah, you get it
waterlink has joined #crystal-lang
<BlaXpirit> dang, but i still need a block because i'm actually creating array of empty arrays of arrays of type
<BlaXpirit> thanks
<BlaXpirit> what i mean is Array.new(count, [] of Array(SF::Color?)) is an array of the same []
<asterite> you can use a block
<zipR4ND> sorry, im new to threading (no c experience ..) what does thread join do? basically i want to dispatch an action to another part of of my code, which eventually returns a result, but continue to execute code after the result has returned to the first thread ...
<asterite> >> Array.new(3) { [] of String }.map &.object_id
<DeBot> asterite: [140283816, 140283792, 140283768]
<BlaXpirit> [:24:37] <BlaXpirit> but i still need a block
<BlaXpirit> thanks
<zipR4ND> particulary: what does thread.join do ?
<asterite> it waits for the thread to finish
<asterite> that is, it blocks until the thread finishes executing
<zipR4ND> ok
ponga has quit [Quit: Leaving...]
<zipR4ND> what i want is an application wide event hub that executes independently of other parts of the application, which listen to it and may block until certain events occur ...
willlll has quit [Quit: willlll]
ponga has joined #crystal-lang
ponga has quit [Client Quit]
<travis-ci> manastech/crystal#2272 (master - 7f20fdc : Ary Borenszweig): The build is still failing.
<asterite> zipR4ND: in the next release I think that will be easier to accomplish
willlll has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vJOD4
<crystal-gh> crystal/master 5128361 Ary Borenszweig: libevent: link to rt on linux
BlaXpirit_ has joined #crystal-lang
BlaXpirit has quit [Ping timeout: 276 seconds]
BlaXpirit-UA has joined #crystal-lang
BlaXpirit_ has quit [Ping timeout: 276 seconds]
BlaXpirit has joined #crystal-lang
BlaXpirit-UA has quit [Ping timeout: 272 seconds]
<zipR4ND> asterite: im build from git, can i already benefit? :)
<asterite> Sure. You can use spawn and a channel to communicate between the processes
<asterite> if you know how Go works, it's similar here
<ssvb> asterite: does it really use multiple threads?
<asterite> Not yet, just one thread for now
<zipR4ND> i'll look into that ..
<asterite> Note that this is all very experimental
BlaXpirit has quit [Ping timeout: 256 seconds]
<ssvb> ok, I had a look at the fiber/spawn/channel implementation examples and it was more like a cooperative multithreading
<ssvb> zipR4ND: you can always start multiple threads, exchange data between them via some data structure (array or whatever) and protect access to this shared data structure using a mutex
<jhass> I guess I should upstream https://github.com/jhass/DeBot/blob/master/thread/src/thread/queue.cr some time...
<ssvb> implementing support for http://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html might make it easier
BlaXpirit has joined #crystal-lang
<ssvb> jhass: :-)
<ssvb> jhass: it does not look like a very sophisticated implementation though
<jhass> it's pretty much just what I needed, what do you miss though?
waterlink has quit [Ping timeout: 240 seconds]
<ssvb> mostly just the Array#shift performance is not great for using it as a queue
<jhass> yeah I guess a linked list would be better
<ssvb> or it could be probably implemented as a circular buffer under the hood
<jhass> a sized queue could
BlaXpirit has quit [Ping timeout: 264 seconds]
waterlink has joined #crystal-lang
BlaXpirit_ has joined #crystal-lang
<zipR4ND> what does the Scheduler.yield ? do i need an application global scheduler?
BlaXpirit-UA has joined #crystal-lang
<ssvb> jhass: still having any working Queue implementation would be a surely great start, it can be always improved later
<ssvb> so your code looks very much interesting
<travis-ci> manastech/crystal#2273 (master - 5128361 : Ary Borenszweig): The build is still failing.
BlaXpirit_ has quit [Ping timeout: 256 seconds]
willlll has quit [Quit: willlll]
ponga has joined #crystal-lang
ponga has quit [Remote host closed the connection]
<zipR4ND> i would love to have somthing like promises in JS or futures in nim ...
DerisiveLogic has quit [Ping timeout: 264 seconds]
<jhass> shouldn't be too hard to implement
<jhass> you take a condition variable, block on .get and signal on fulfill
<zipR4ND> jhass: can you explain the condition variable? atm i roughly understand mutex and channel ..
<zipR4ND> channel works great btw ..
<zipR4ND> getting "[PCL] Stale coroutine called: .." though ..
<jhass> well, the variant with the condition variable would only work with threading, not with coroutines
<zipR4ND> ok, but how does it work?
<jhass> ConditionVariable#wait should be called in a mutex, it sleeps and blocks the thread and releases the lock
<jhass> ConditionVariable#signal makes a single #wait call return
<jhass> ConditionVariable#broadcast makes all #wait calls return
<jhass> so if you come out of the #wait you recheck the condition you wait for
<travis-ci> manastech/crystal#2273 (master - 5128361 : Ary Borenszweig): The build is still failing.
<jhass> have a look at the Queue I posted earlier, wait and signal delegate to a condition variable
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vJ3f1
<crystal-gh> crystal/master 0df531e Ary Borenszweig: Crystal 0.7.0
<jhass> asterite: you fixed IO.select?
<vikaton> What !
<vikaton> asterite isnt here :P
<vikaton> o wait
<vikaton> he is..
<asterite> jhass: Nope
<jhass> :(
<asterite> but I don't want to delay the next release forever
<asterite> there are many bug fixes and improvements since 0.6.1, I feel that version is kind of useless now
<vikaton> ^
<vikaton> I concur
<vikaton> are you posting a blog post ?
<asterite> DeBot and prax.cr will probably break
<jhass> yeah, and I don't really have time to do crystal-posix-io atm
<asterite> Don't worry, we are all volunteers here
<asterite> in time we'll fix everything
<jhass> well, it means I can't update which is bad because I use my package which I do need to update...
<asterite> In any case the use of Thread and IO.select will probably disappear or change, so...
<asterite> Or we'll fix it
<jhass> it won't, I will bring it back as library the moment I find the time to
<asterite> Ok, as you wish :-)
<jhass> having every crystal program that does a simple puts have to depend on libevent and libpcl is a bit insane
<asterite> What was the problem with IO.select? I think waj told me that now it might block forever
<jhass> yeah, it never returns
<asterite> waj eventually wants to rewrite those things himself, maybe using inline assembler… or at least part of those
<asterite> Why is it a bit insane? Go programs always statically link everything and are huge, and not many people complain
<vikaton> asterite, will the 0.7.0 package have libevent and such ?
<jhass> but if we're honest that'll take a year or so
<asterite> Yes, it will have libevent and libpcl
<asterite> But I don't think having Thread, Mutex and those synchronizations mechanisms as the default in the language make sense nowadays...
<asterite> Other concurrency models are by far superior and safer
<asterite> and threads don't scale
<jhass> you know I have no issue with a slim and focused stdlib
<vikaton> is the installation process updated to 0.70 ?
<jhass> it's just that I currently don't have the time to do it as a library proper
<asterite> Well, you won't have to use libevent nor libpcl directly, so that makes the std slim. Those are just implementation details, probably temporary until we find a better solution. The same as the GC
JBat has quit [Quit: Computer has gone to sleep.]
<jhass> and as much as I agree with you that you should be opinionated about stdlib, as much do I still see value in the well understood classic concurrency primitives
<jhass> I do have to learn a concurrency paradigm that's new to me and that's new for many people coming from the classic languages
<jhass> that's not a bad thing, but it makes the entry barrier higher
<jhass> and currently I don't want to rewrite DeBot for example
<asterite> Our experience is, we had a bunch of critical Ruby on Rails app that eventually became very slow and couldn't scale. We had to rewrite portions of those in Erlang or Go
<jhass> with the classic threading primitives I could just write it down, I didn't need to think much about the design because I understand those primitives well
<asterite> Ruby couldn't scale because it didn't have a good concurrency model
DerisiveLogic has joined #crystal-lang
<jhass> you misunderstand me, I'm not saying you shouldn't do it
<asterite> So it's just an opinion?
<jhass> and a major inconvenience for me atm, yeah
<asterite> OK. Don't worry, I really like DeBot and once we stabilize things, you can be sure I'll send a pull request to make it work with the new concurrency model
<vikaton> asterite, is the installation process updated to 0.7.0 ?
<asterite> I'm currenly preparing the release
<asterite> the tag has to come before that :)
<jhass> so I have a couple short term options atm: 1) do not update the AUR package, that's a nogo, 2) stop developing DeBot since I can't recompile it with the updated compiler 3) have an old compiler unpackaged somewhere and take care to use it to recompile DeBot 4) Completely rewrite the bottom layer of DeBot 5) Do crystal-posix-io now
<jhass> maybe you can see that neither is really attractive to me
<asterite> That's because in arch you can't use an old package?
<jhass> well, 3b) is create a package for the old compiler
<jhass> which means I can't use new compiler features and fixes in it
<jhass> but I'll probably go for 3
<asterite> What if we try to make DeBot work, together, so we can fix and improve the spawn and channels support?
<asterite> DeBot would be a good use case
<jhass> after all it's a toy project for me still and I just can't justify the time atm, sorry
<jhass> and I'm now convinced that I'll do crystal-posix-io anyway when I find the the time and nobody else comes first
<jhass> I just want to have that available as an option, not as an recommended one but I don't want the language to loose it
<asterite> Sounds good
<travis-ci> manastech/crystal#2274 (master - 0df531e : Ary Borenszweig): The build is still failing.
<vikaton> asterite, will the release be releases today?
HakanD___ has joined #crystal-lang
<asterite> vikaton: on what OS are you?
<vikaton> Debian 7 @ asterite
BlaXpirit has joined #crystal-lang
BlaXpirit-UA has quit [Ping timeout: 256 seconds]
n1ftyn8 has joined #crystal-lang
zipR4ND has quit [Ping timeout: 276 seconds]
<asterite> you can already do sudo apt-get update; sudo apt-get install crystal
<fowl> did File::PATH_SEPARATOR and other changes from windows branch get in to 0.7.0
BlaXpirit_ has joined #crystal-lang
BlaXpirit has quit [Read error: Connection reset by peer]
<vikaton> w0w rly?
<asterite> fowl: no, sorry
BlaXpirit-UA has joined #crystal-lang
BlaXpirit_ has quit [Ping timeout: 246 seconds]
<jhass> asterite: btw /topic ;)
<vikaton> asterite, so how does this new concurrency model work? like non-blocking IO and such
BlaXpirit has joined #crystal-lang
BlaXpirit-UA has quit [Ping timeout: 256 seconds]
BlaXpirit has quit [Ping timeout: 256 seconds]
BlaXpirit has joined #crystal-lang
<asterite> I should probably say this now, I'll be taking a break from the computer for about two months. I'll try to reply emails and github issues, but I won't probably be coding at that time. But waj will be around answering and maybe programming
ponga has joined #crystal-lang
<vikaton> Oh okay
<vikaton> how can I test non-blocking IO ?
<vikaton> and is it something thats just in the language or something that you implement?
<asterite> non-blocking IO works out of the box, you don't have to do anything
<vikaton> ooo
ponga has quit [Read error: No route to host]
BlaXpirit has quit [Ping timeout: 256 seconds]
ponga has joined #crystal-lang
BlaXpirit has joined #crystal-lang
<BlaXpirit> asterite pls :(
ponga has quit [Read error: No route to host]
leafybasil has joined #crystal-lang
<BlaXpirit> that's not the answer
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<vikaton> asterite, remember that benchmark I did earlier with Node.js and Crystal? lol
ponga has joined #crystal-lang
ismaelga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<vikaton> Crystal kills now
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<vikaton> >> "hello".t("h","k")
<DeBot> vikaton: Error in line 3: undefined method 't' for String (did you mean 'tr'?)
<vikaton> >> "hello".tr("h","k")
<DeBot> vikaton: "kello"
<vikaton> >> "hello".tr("h","k").tr("e","a")
<DeBot> vikaton: "kallo"
<vikaton> swag
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<asterite> vikaton: cool :)
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
HakanD___ has quit [Quit: Be back later ...]
ponga has quit [Read error: Connection reset by peer]
<BlaXpirit> accidentally nillable types are a pain though :s
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<asterite> BlaXpirit: awesome!!
ponga has joined #crystal-lang
<BlaXpirit> looks a bit nicer than the C-ported SDL-based one :p
<BlaXpirit> i mean code
<vikaton> I wish I can try it
<asterite> I did `crystal deps; crystal tetrominos.cr` and it worked :)
<vikaton> but sadly, windows and a debian vps wont help ;-;
<BlaXpirit> good, asterite
<asterite> The code is really short
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
<asterite> what are accidentally nillable types?
<BlaXpirit> when I know a variable can never be nil, but the compiler doesn't
ponga has quit [Read error: No route to host]
<BlaXpirit> in any case, I wish there was a shorter way to deal with that than .not_nil!
<asterite> Oh, I see for example `if @part`
<asterite> In those cases you should assign to a local variable
<asterite> for example: `if part = @part; …; else; … end`
<asterite> Look
ponga has joined #crystal-lang
<asterite> Well, nevermind
<asterite> The usual approach is to assign an instance variable to a local variable. It can be inside the if or outside. Then the compiler knows the "nilable" status of local variables
<vikaton> @shardscrystal behind the scenes lol :P
<BlaXpirit> I don't think there is an example of what i'm talking about here
<asterite> I'll send you a pull request now if I can :)
<BlaXpirit> haha ok :)
<vikaton> yup, it was BlaXpirit's repo
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
<asterite> There are some patterns regarding nil, I think in the PR I'll show you them all
<asterite> :)
<vikaton> BlaXpirit: do you have a twitter?
<BlaXpirit> vikaton, same as this name
<vikaton> BlaXpirit: you should follow @shardscrystal , your repo was just tweeted by my bot lol
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<BlaXpirit> woops, line 238 has some leftovers
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
asterite has quit [Quit: Leaving.]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
willlll has joined #crystal-lang
<willlll> Does HTTP::Server#listen_fork work?
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<Dreamer3> good question
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
BlaXpirit_ has joined #crystal-lang
jua_ has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
BlaXpirit has quit [Ping timeout: 256 seconds]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 256 seconds]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
BlaXpirit-UA has joined #crystal-lang
BlaXpirit_ has quit [Ping timeout: 250 seconds]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vJ3d4
<crystal-gh> crystal/master 3864d6f Ary Borenszweig: Removed unused require from docs
<crystal-gh> crystal/master d773030 Ary Borenszweig: Swapped order of @[Link] for libevent. Fixes #597
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
BlaXpirit-UA has quit [Ping timeout: 255 seconds]
DerisiveLogic has joined #crystal-lang
DerisiveLogic has quit [Remote host closed the connection]
<vikaton> >> 1;2;
<DeBot> vikaton: 2
panga has quit [Read error: No route to host]
DerisiveLogic has joined #crystal-lang
<vikaton> puts "1", sleep 1.2; puts "2"; puts "3"
<vikaton> >> puts "1", sleep 1.2; puts "2"; puts "3"
<DeBot> vikaton: in /usr/lib/crystal/event/event.cr:66: field 'tv_sec' of struct LibC::TimeVal has type Int32, not Int64
ponga has joined #crystal-lang
<vikaton> >> puts "1", sleep 2; puts "2"; puts "3"
<DeBot> vikaton: in /usr/lib/crystal/event/event.cr:55: field 'tv_sec' of struct LibC::TimeVal has type Int32, not Int64
BlaXpirit-UA has joined #crystal-lang
<vikaton> >> puts "1", sleep 2 as In32; puts "2"; puts "3"
<DeBot> vikaton: Error in line 3: undefined constant In32 (did you mean 'Int32'?)
<vikaton> >> puts "1", sleep 2 as Int32; puts "2"; puts "3"
<DeBot> vikaton: in /usr/lib/crystal/event/event.cr:55: field 'tv_sec' of struct LibC::TimeVal has type Int32, not Int64
<vikaton> :/
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<jhass> yup, it's broken on 32 bit
<vikaton> oh
BlaXpirit has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
BlaXpirit-UA has quit [Ping timeout: 256 seconds]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
BlaXpirit has quit [Ping timeout: 256 seconds]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<crystal-gh> [crystal] jhass opened pull request #599: LibC::TimeVal#tv_sec is TimeT (master...fix_32bit_sleep) http://git.io/vJ3he
<Dreamer3> hmmmm
ponga has joined #crystal-lang
<Dreamer3> a way to get hash to return nil for non finds?
<jhass> >> {a: 1}[:b]?
<DeBot> jhass: nil
<Dreamer3> hmmm
<Dreamer3> >> session = {} of String => JSON::Type; session[:b]
<DeBot> Dreamer3: Error in line 3: undefined constant JSON::Type
<Dreamer3> >> require 'json'; session = {} of String => JSON::Type; session[:b]
<DeBot> Dreamer3: Syntax error in eval:3: unterminated char literal
<Dreamer3> >> require "json"; session = {} of String => JSON::Type; session[:b]
ponga has quit [Read error: Connection reset by peer]
<DeBot> Dreamer3: MissingKey: Missing hash value: :b
<jhass> and now append a ?
ponga has joined #crystal-lang
<Dreamer3> >> require "json"; session = {"a" => 1} of String => JSON::Type; session[:b]
<DeBot> Dreamer3: Error in line 3: no overload matches 'Hash(String, JSON::Type)#[]=' with types String, Int32
ponga has quit [Read error: No route to host]
<Dreamer3> >> require "json"; session = {} of String => JSON::Type; session["a"]=1; session["b"]
<DeBot> Dreamer3: Error in line 3: no overload matches 'Hash(String, JSON::Type)#[]=' with types String, Int32
<Dreamer3> >> require "json"; session = {} of String => JSON::Type; session["a"]=1 as JSON::Type; session["b"]
<DeBot> Dreamer3: Error in line 3: can't cast Int32 to JSON::Type
ponga has joined #crystal-lang
<Dreamer3> oh it's int64
<Dreamer3> how annoying
<Dreamer3> >> require "json"; session = {} of String => JSON::Type; session["a"]="1" as JSON::Type; session["b"]
<DeBot> Dreamer3: MissingKey: Missing hash value: "b"
<jhass> >> require "json"; session = {} of String => JSON::Type; session["a"]="1" as JSON::Type; session["b"]?
<DeBot> jhass: nil
<jhass> and yeah, working with JSON::Type is a bad idea, it's only useful as transport
ponga has quit [Read error: No route to host]
<Dreamer3> must be my version is newer?
<jhass> no
<Dreamer3> what id you change?
<Dreamer3> oh the ?
<Dreamer3> yeah i just saw that
<jhass> I added a ?
<Dreamer3> in the source
ponga has joined #crystal-lang
<Dreamer3> and i missed it in your first example
<Dreamer3> because i wasn't looking for it
<Dreamer3> i'm using it to transport the session
<Dreamer3> i'm not sure what else to store it in post load, since i still need the same "supports any value" behavior
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
<jhass> how about the concept of "json serializable"
<Dreamer3> ?
ponga has quit [Read error: Connection reset by peer]
<jhass> module JSON::Serializable; abstract def self.from_json(String); abstract def to_json : String; end; {} of String => JSON::Serializable;
ponga has joined #crystal-lang
<jhass> mh, no, not useful
<travis-ci> manastech/crystal#2275 (master - d773030 : Ary Borenszweig): The build is still failing.
ponga has quit [Read error: No route to host]
<jhass> session = {} of String => String; session["user"] = user.to_json; user = User.from_json session["user"]
ponga has joined #crystal-lang
<jhass> yeah, I think making session a plain String => String is the sanest choice
<Dreamer3> can't cast Int32 to Int64
<Dreamer3> grrr
<jhass> to_i64
DerisiveLogic has quit [Remote host closed the connection]
ponga has quit [Read error: No route to host]
DerisiveLogic has joined #crystal-lang
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
<Dreamer3> ha
<Dreamer3> so first i have to build cookie support into the request
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
c355E3B has quit [Quit: Connection closed for inactivity]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
<crystal-gh> [crystal] niftyn8 opened pull request #601: String#camelcase handles -es (master...camelcase-dashes) http://git.io/vJsOm
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
DerisiveLogic has quit [Ping timeout: 255 seconds]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
DerisiveLogic has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ismaelga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
panga has joined #crystal-lang
panga has quit [Read error: Connection reset by peer]
DerisiveLogic has quit [Remote host closed the connection]
ponga has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang
panga has joined #crystal-lang
panga has quit [Read error: No route to host]
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
ponga has quit [Read error: No route to host]
ponga has joined #crystal-lang
DerisiveLogic has joined #crystal-lang
ponga has quit [Read error: Connection reset by peer]
ponga has joined #crystal-lang