jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.3 | 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
<vikaton> haha
<vikaton> does he not like Ruby?
<asterite> He doesn't know much Ruby. Unlike me, he doesn't program in his free time... and in his work he mostly does Android, so it's Java
<vikaton> ah
<vikaton> I wonder if IOS or android dev with Crystal is possible
<asterite> He's more into music too
<asterite> I think Android is ARM, so it isn't possible for now...
<vikaton> oh ok
asterite has quit [Ping timeout: 246 seconds]
jtarchie has quit [Quit: Connection closed for inactivity]
waj has quit [Quit: waj]
Cidan is now known as zz_Cidan
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
lokulin has joined #crystal-lang
bogen has joined #crystal-lang
waj has joined #crystal-lang
waterlink1 has joined #crystal-lang
waterlink has quit [Ping timeout: 276 seconds]
waterlink1 has quit [Client Quit]
ponga has quit [Remote host closed the connection]
shama has joined #crystal-lang
shama has quit [Remote host closed the connection]
ponga has joined #crystal-lang
kulelu88 has quit [Quit: Leaving]
ponga has quit [Read error: No route to host]
mdz_ has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
waj has quit [Quit: waj]
Mercurial_ has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
jbomo has quit []
BlaXpirit has joined #crystal-lang
drizz has quit [Remote host closed the connection]
Mercurial_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
mdz_ has joined #crystal-lang
Mercurial_ has joined #crystal-lang
drizz has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
mdz_ has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 246 seconds]
Mercurial_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
sandelius has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
datanoise has joined #crystal-lang
unshadow has joined #crystal-lang
me has joined #crystal-lang
me is now known as Guest42981
Guest42981 has quit [Remote host closed the connection]
Guest93295 is now known as wuehlmaus
Ven has joined #crystal-lang
datanoise has quit [Ping timeout: 264 seconds]
me has joined #crystal-lang
me is now known as Guest71158
Ven has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
unshadow has quit [Ping timeout: 265 seconds]
unshadow has joined #crystal-lang
Ven_ has quit [Ping timeout: 255 seconds]
alsm has joined #crystal-lang
fowlduck has joined #crystal-lang
<unshadow> >> puts "a" + "b" + "c"
<DeBot> unshadow: abc - more at http://carc.in/#/r/2nc
<unshadow> wut ? http://carc.in/#/r/2nf
<jhass> mmh, I've seen longer ones work
<jhass> seems to be a compiler bug?
<unshadow> Sadly becasue of a regression in REGEX at HEAD, I can't even run it locally and check :/
<unshadow> About the file autoclose issue, I think that if you use File.read or File.write thats ok, but, File.open returns the file handler, where even in Ruby its custom do a "f = File.open..." and then f.read\write and in the end f.close
<unshadow> Or if you use it in a block then it's also make sense to autoclose it after the block
<jhass> yes that was my point
<fowlduck> does crystal have a twitter account?
<unshadow> CrystalShards does https://twitter.com/shardscrystal
Guest71158 has quit []
<unshadow> memo unshadow testing
<unshadow> memo! unshadow testing
<unshadow> !memo unshadow testing
<DeBot> unshadow: You can't leave memos for yourself ...
<unshadow> ok...
<unshadow> !memo /(datanoise.+|datanoise)/ Are you planning to add server\listiner to your ssh lib ?
<DeBot> unshadow: Added memo for /(datanoise.+|datanoise)/.
<jhass> eh, that's just .* ;)
<unshadow> !memo /datanoise.*/i Are you planning to add server\listiner to your ssh lib ?
<DeBot> unshadow: Added memo for /datanoise.*/i.
<unshadow> ;)
<jhass> now he'll get it twice...
<unshadow> hahah, I'm sure he will be ok with handeling 2 messages
<fowlduck> oh, ha, forgot I asked. thanks unshadow and jhass
<fowlduck> drinking and IRC don't mix
<jhass> hehe
<unshadow> XD
<fowlduck> but crystal is really interesting
<fowlduck> did I see something on the google group about go-like channels?
<fowlduck> I couldn't find anything in the docs about concurrency
<unshadow> Fibers ?
<fowlduck> oh, there are api docs
<fowlduck> not sure why I didn't see that
<fowlduck> thanks
<fowlduck> wait, where's Thread?
<fowlduck> oh, there's a Fiber.spawn
<unshadow> there's also Thread :)
<unshadow> but the "way" to multitask right now is using "spawn helper_method()"
<fowlduck> ah, ok
<fowlduck> hm, so it doesn't randomly select from ready channels like go does
<fowlduck> that's a really useful property
<jhass> fowlduck: it does, just not on a thread pool, yet
<jhass> oh, randomly
<jhass> does that make a big difference?
<fowlduck> yup
<fowlduck> if only the top-most channel can communicate then there isn't fair access to the fiber/goroutine
<fowlduck> "a single one that can proceed is chosen via a uniform pseudo-random selection"
<jhass> well, that's a single line change, just .select(&.ready?).sample :P
<fowlduck> yup
<fowlduck> sorry, I just got in here and I'm fairly tipsy, I shouldn't be criticizing lang design choices
<fowlduck> I mean, unless it was overlooked?
<fowlduck> or just not known about?
<fowlduck> do you not serialize/deserialize values in channels?
<fowlduck> I've wondered how necessary that really is
<fowlduck> I rewrote https://github.com/igrigorik/agent so I've done a little work in a ruby-like language on the same problem
<fowlduck> I need another beer, brb
<fowlduck> huh
<fowlduck> I'm going to do a pull request
<fowlduck> the installation docs are broken: http://crystal-lang.org/docs/installation/README.html
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<fowlduck> another pull request!
<unshadow> go for it :)
<unshadow> fowlduck: you sound like you want to help out right ?
<fowlduck> sure seems like it
<fowlduck> :)
<unshadow> how about contrubuting a lib ? a much needed lib ?
<fowlduck> hm, well, I could certainly try but I wouldn't want to commit to anything at the moment given my compromised judgement
<unshadow> no no drinking is great for this very very simple task
<fowlduck> but I've added this channel as auto-join, so I'm hoping that brings me back to this. the language really appeals to me
<fowlduck> oh?
<unshadow> Implamenting the Telnet protocl of curse :)
<fowlduck> I have two pull requests to do, what's next? I've never actually written any crystal
<fowlduck> lol
<unshadow> XD
<fowlduck> hahaha noooooo
<fowlduck> please nothing with an RFC
<fowlduck> not just yet anyways ;)
<fowlduck> I work on transfer systems, though, at my job, but I've never worked on a protocol
<unshadow> Thats what I'm working on right now, it's boring as hell, well... I tried... apperently you are not drunk enough
<fowlduck> fun! ;)
<unshadow> http://carc.in/#/r/2nf check out the emerging code
<fowlduck> state machines, lexing, and parsing oh my!
<fowlduck> jesus
<fowlduck> I mean, I'm sure this all makes sense
<fowlduck> translate RFC => code
<fowlduck> have you tried it with multiple telnet servers' output yet?
<unshadow> Right now I'm stuck becuase of an apperent Compiler bug
<fowlduck> I had a colleague who wrote a telnet client in python from scratch who had trouble with the nonsense differences between servers
<fowlduck> oh
<fowlduck> well damn
<fowlduck> it's god's work you're doing, though :)
<fowlduck> hey, has anyone mentioned work on an actor lib?
<unshadow> nha.... it's super selfish , I need it so I do it, I dont think anyone really need a Telnet lib
<fowlduck> hey, I'm sure some hipster hacker with a botnet somewhere might be able to use it ;)
<fowlduck> don't they use that for command & control?
<unshadow> Building a raw tcp protocol is much easier...
<unshadow> just socket.read, parse, execute, send back reply
<fowlduck> I've never done that, either, but that's surprising
<fowlduck> huh
<fowlduck> I guess that makes sense
<fowlduck> that ought to be worked out by now
<fowlduck> or wait, socket.read, you're not reading bytes off the line, so you mean a new protocol
<fowlduck> I misunderstood
Ven has joined #crystal-lang
<unshadow> I mean just creating a parser for cleartext data over the TCP connection ;)
<jhass> I thought C&C is all IRC if you're too lazy to do your own?
<fowlduck> oh, right, IRC, not telnet
<unshadow> data = socket.read, case data while /kill all humanity/ ; exec etc...
<fowlduck> oh, that reminds me, I need to make that github project private
<jhass> heh
<unshadow> C&C on IRC is usually botnet for DDOS and "quick'n'dirty" attacks, while, "off the grid" botnets for APT attacks and special operations are usually ran thourgh TOR with the use of customized protocol
<unshadow> We found a very massive one using one of our customers servers, which apperently was hacked and enlisted to the botnet
<unshadow> it was a fun day
<fowlduck> "fun:
<fowlduck> err, "fun"
<unshadow> XD
<unshadow> >> puts "בדיקה".reverse
<DeBot> unshadow: הקידב - more at http://carc.in/#/r/2nn
<jhass> >> fun with_crystal; puts "yay"; end;
<DeBot> jhass: # => nil - http://carc.in/#/r/2no
<fowlduck> I work in ruby all day and have yearned for a flexible-enough type system for it
<fowlduck> I dived into go because I was sick of all the lolruby shit day in and day out but I... I didn't like it
<fowlduck> dove?
<fowlduck> whatever
<fowlduck> anyways, so, this seems to fit what I want, so I'm interested in contributing
<jhass> great
<unshadow> Cool
<fowlduck> starting with docs, though
<jhass> most needed atm anyway
<jhass> :P
<unshadow> jhass: why dons't the bot announce PR's ? usually it did right ? also stoped telling about build success failure
<jhass> oh, I guess the used notice mode
<jhass> meh
<jhass> we'll see when it becomes a problem I guess
datanoise has joined #crystal-lang
<unshadow> fowlduck: I got interested in crystal becuase of a project in work, we usually use Ruby, but, above 10K concurrent connections the issues with GIL\GVL was drasticlly killing the performace as we couldent use more then 1 CPU Core at a time, Now I add slowly everything I need to the project to Crystal in the hopes of starting a full code migration in a couple of months
havenwood has quit [Ping timeout: 252 seconds]
<fowlduck> using telnet?
<fowlduck> 10k telnet connections? tell me it's true
<fowlduck> that sounds about right for ruby, though
<unshadow> botnet much ? hahahha
datanoise has quit [Ping timeout: 245 seconds]
<fowlduck> hahaha
<fowlduck> we've done a stupid amount of work to setup pipelines between ruby and go to handle massive numbers of connections
<fowlduck> over redis, even
<fowlduck> seeing the benchmarks for crystal, I'm interested to see how it handles this
<unshadow> kidding though, our software is a reverse proxy which scans incoming data for application and network level attacks, it supports multi protocols like HTTP/HTTPS, SSH, SFTP, SMTP, RDP each has it's own attack surface and techniques and we perform deep packet inspection etc.. to find malicious data
<fowlduck> oof, 33 pull requests are open
<fowlduck> whoa, cool
<fowlduck> I don't do anything near that level
<unshadow> fowlduck: what do you guys do ?
<fowlduck> mostly using ruby libraries and binary tools to handle tons of protocols and services
<fowlduck> oh, I work for zencoder
<fowlduck> yup
<unshadow> looks cool :)
<fowlduck> it's pretty incredible what we've done under the hood
<fowlduck> I never dreamed I'd be dealing with these sorts of problems when I started out
<unshadow> I'm sure, video\audio encoding is crazy complicated
<fowlduck> oh, it is, that's probably why I don't do it
<fowlduck> we have a few transcoding engineers that are extremely smart and capable
<fowlduck> and most of the rest of the work revolves around orchestrating VMs in the cloud and allocating resources
<unshadow> I'm working over at Safe-T (www.safe-t.com) , this is the product I talked about --> http://www.safe-t.com/rsaccess/
<fowlduck> and all the minutia around dealing with fan-out shared-resource-hungry processes
<unshadow> fowlduck: Are you guys useing Puppet ?
<fowlduck> I see safe-t and I immediately don't trust it hahaa
<unshadow> XD
<fowlduck> we use chef but we have to decide when to scale up and when to scale down transcoding resources
<fowlduck> and predict resource usage for given transcodes so we can efficiently pack them onto our transcoding VMs
<fowlduck> and pack these processes fairly amongst accounts
<fowlduck> so no one account can starve the others
<fowlduck> there's a tremendous amount of orchestration
<unshadow> fowlduck: thats sounds really cool ! so it's like a live action IT\devops job :)
<fowlduck> ha, yeah, I do plenty of ops-y stuff
<fowlduck> one of our guys wrote a machine learning algorithm to handle our transcoding worker autoscaling
<fowlduck> or copied one that existed, rather
<fowlduck> it seems to have worked out well
<fowlduck> plus we deal with making our resource usage efficient, so making sure we use spot EC2 workers, making sure we kill workers at the right time, etc
alsm has left #crystal-lang ["Leaving"]
<fowlduck> and a lot of the behavior of the system is emergent. there is no central brain for the whole thing, so most of the things we do are complex systems that are gently manipulated to produce different emergent behavior
sandelius has joined #crystal-lang
<fowlduck> it's pretty wild when I really think about it
<unshadow> XD it's great to have a job you like and enjoy
<fowlduck> yeah, most definitely
<unshadow> jhass: your'e a student right ?
<jhass> yeah
<fowlduck> unshadow: you're using crystal to write this project?
<fowlduck> this one? http://www.safe-t.com/rsaccess/
<fowlduck> or is it for testing things?
<unshadow> fowlduck: Nope, it's mostly Ruby, this is where we started having issues with above 10K CC
<fowlduck> wow
<unshadow> we had to use c\c++ for connection handlers
<fowlduck> I can't believe that's written in ruby, to be honest
<fowlduck> the amount of insane shit I've had to deal with in ruby over the years, I just don't trust it anymore
<unshadow> Yeha :) Ruby is awsome
<unshadow> hahah
<unshadow> What do you mean by insane shit ?
<fowlduck> I love the syntax and a lot of the semantics, but some stuff is nuts
<fowlduck> insane shit: (noun) bugs in the MRI implementation of ruby
<fowlduck> I've encountered tons and tons of issues where ruby gets into places that shouldn't be possible
<fowlduck> I'm talking threading bugs, mostly
<fowlduck> like no one holding a Monitor and having three threads waiting on it
<fowlduck> we've had good luck with ruby 2, so far, but that mixed with the lack of safety just makes for fractal headaches
<fowlduck> NoMethodError should be a compile-time problem
<fowlduck> as much as possible
<unshadow> In Crystal it is
<fowlduck> right, that's why it's appealing
<unshadow> you will learn ot hate it, and love it, but mostly hate it XD
<fowlduck> god, our homepage looks like some terribly-designed bullshit
<fowlduck> boring!
<fowlduck> the customer page is pretty cool, though
<fowlduck> makes me proud
<unshadow> stuff like "bla bla".split(" ")[1] => no method [] for Nil
<fowlduck> what?
<fowlduck> that's not right
<fowlduck> is that a bug?
<unshadow> it all depends on threading, Fibering
<jhass> >> "bla bla".split(" ")[1]
<DeBot> jhass: # => "bla" - http://carc.in/#/r/2np
<jhass> ?
datanoise has joined #crystal-lang
<fowlduck> I've never written a lexer/parser/compiler/those-things before, and I kinda want to
<jhass> >> "blabla".split(" ")[1]
<DeBot> jhass: IndexOutOfBounds: Index out of bounds - more at http://carc.in/#/r/2nq
<fowlduck> [1]?
<jhass> yeah
<fowlduck> >> "blabla".split(" ")[1]?
<jhass> I'm not sure why unshadow picked that example
<unshadow> the secound part of the array
<DeBot> fowlduck: # => nil - http://carc.in/#/r/2nr
<fowlduck> omfg, I remembered things
datanoise has quit [Client Quit]
<jhass> so more like
<jhass> >> gets.chomp
<DeBot> jhass: Error in line 4: undefined method 'chomp' for Nil - http://carc.in/#/r/2ns
<unshadow> yeha
<unshadow> thats a better exmple :)
<fowlduck> shit
<fowlduck> nah, I'm cool with that
<fowlduck> for the most part
<jhass> yeah, gets may return nil, in Ruby too ;)
<fowlduck> right
<jhass> send EOF to random ruby program that wants user input
<jhass> have fun
<fowlduck> does crystal do destructuring binds?
<unshadow> but I learned to work with it
<fowlduck> is there a better design?
<unshadow> >> a = gets ; a.chomp if a.is_a?(String)
<DeBot> unshadow: Sorry, that took too long. - http://carc.in/#/r/2nt
<jhass> gets.try &.chomp
<fowlduck> heh, the bot allows I/O?
<jhass> sort of ;)
<unshadow> jhass: it looks really nice &.chomp
<unshadow> what does try do ?
<fowlduck> >> Dir["/"]
<DeBot> fowlduck: # => ["/"] - http://carc.in/#/r/2nu
<fowlduck> >> Dir["/*"]
<DeBot> fowlduck: # => ["/bin", "/boot", "/dev", "/etc", "/home", "/lib", "/mnt", "/opt", "/proc", "/root", "/run", "/sbin", "/srv", "/sys", "/tmp", "/usr", "/var"] - http://carc.in/#/r/2nv
<fowlduck> welp
<jhass> class Object; def try yield self; end; struct Nil; def try; end; end;
<fowlduck> wait, you can re-open classes in crystal?
<fowlduck> can you monkey-patch?
<jhass> sure
<jhass> yes
<fowlduck> dynamic monkey-patches?
<jhass> no ;)
<fowlduck> ah, so compile-time only
<jhass> yeah
<jhass> powerful macro language though
<fowlduck> that's fine with me. it's predictable, at least
<fowlduck> better than ostruct and singleton methods
<jhass> >> class Foo; macro method_missing(m, args, block); puts {{m}}; end; end; Foo.new.hello
<DeBot> jhass: hello - more at http://carc.in/#/r/2nw
<fowlduck> brb, writing a web framework since I have method_missing now
<jhass> heh, that'd only be the.. 6?
<fowlduck> there are 6??
<jhass> feels like
<jhass> let's see
<fowlduck> I saw one on google groups
<fowlduck> some guy asking for help
<unshadow> 4 is really promising :)
<fowlduck> ah, amethyst is what I saw
<jhass> probably shouldn't count https://github.com/ahmetkapikiran/CrystalWeb
<fowlduck> brb installing it
<unshadow> haha
<fowlduck> k, it says install with `curl -k "https://github.com/ahmetkapikiran/CrystalWeb/install_or_something.sh" | sudo sh` what could go wrong
<jhass> kay, 4
<fowlduck> (it doesn't actually say that)
<fowlduck> well then, amethyst is looking pretty rails-y
<jhass> yeah, some people try to achieve something railsish
<fowlduck> I do enough rails that I appreciate the familiarity
<fowlduck> glad they didn't try to take on an ORM, too
<jhass> I think https://github.com/waterlink/active_record.cr is the only stab at it
<fowlduck> amethyst needs templating
<fowlduck> that's a pretty low-hanging fruit
<fowlduck> he says, optimistically, never having written any sort of templating
<fowlduck> how amenable is the project to change at this point?
<fowlduck> I mean, crystal itself
<unshadow> what do you mean by change ?
<jhass> I think I'd like to see a Liquid port
<fowlduck> I'm shit at C, but of course I have opinions
<jhass> crystal is still quite influx
<fowlduck> jhass: I've done enough in liquid to last a lifetime. never again
<jhass> expect breaking changes on every release, regardless of the version number
<jhass> well, or handlebars or whatever, something none-evaling I can run at runtime
<fowlduck> change like when I'm putting together something like activerecord and I think "this feature would make it much easier to implement this"
<jhass> oh definitely a good chance to get it in still
<unshadow> yap
<fowlduck> cool
<unshadow> stuff are changed daily
<jhass> I mean we don't even have encoding support yet or good timezone handling
<unshadow> I want encoding :(
<fowlduck> I was thinking something like tilt https://github.com/rtomayko/tilt
<fowlduck> but I'd need to write some underlying formats to make this necessary
<fowlduck> yak shaving as a hobby
<fowlduck> my life isn't sad at all
<unshadow> Oo
<unshadow> What we really really need, is a XML parser, writer like nokogiri
<jhass> the stdlib one learned xpath at least
<unshadow> thats a start :)
<jhass> reminds me I should add libxml2 to the optdepends
<unshadow> and datanoise is working on Zlib, so this is quite cool
<jhass> oh, already did ^.^
<unshadow> XD
<unshadow> is there a good C ntlm lib ? I want a wrapper built :)
<fowlduck> eh, ok, I'm out for the night. leaving stuff open to https://github.com/manastech/crystal/blob/bf72b077bc91a9a1d19db56fede684ae8a9347c2/src/concurrent/channel.cr#L44 so I submit a fix tomorrw
<fowlduck> g'nite, unshadow and jhass
<fowlduck> or whatever it is there
<jhass> night
<jhass> UGT wins anyways ;)
<BlaXpirit> woah, what happened here
<BlaXpirit> so much talking, i don't think i can read it all
<jhass> happens
BlaXpirit_ has joined #crystal-lang
BlaXpirit has quit [Killed (kornbluth.freenode.net (Nickname regained by services))]
<unshadow> haha yhe a
<asbradbury> some of the stdlib code uses `getter :foo` rather than `getter foo` (which the docs seem to prefer). Is one considered preferable to the other?
<jhass> these days the latter is preferably, though there's really no difference in the generated code, it's style
<unshadow> I like :foo beter as it looks more Ruby
absurdity1 has joined #crystal-lang
<asbradbury> I'm surprised they don't seem to be implemented as a macro, unless I'm missing it
absurdity1 has left #crystal-lang [#crystal-lang]
<jhass> they are
<asbradbury> jhass: doh, thanks, I was being an idiot and grepping in a subdir
bcardiff has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Client Quit]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 276 seconds]
asterite has joined #crystal-lang
havenwood has joined #crystal-lang
<asterite> fowlduck: about channels and them not being fairly selected, we didn't reach 1.0 yet, we are slowly implementing things
<asterite> so probably everything that's broken or looks badly designed, or a bug, is because we didn't have time yet to implement it or fix it
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vI6mE
<crystal-gh> crystal/master a245ed1 Nathan Sutton: Fixed install guide link in Contributing.md
<crystal-gh> crystal/master 71b131e Ary Borenszweig: Merge pull request #782 from nate/fix/installer-link-from-contributing-docs...
waj has joined #crystal-lang
<asterite> jhass: about breaking changes regardless of the version, we are strictly following semver ;-) http://semver.org/
<asterite> "Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable." :-D
<jhass> yeah I know, I didn't mean it that way ;)
<travis-ci> manastech/crystal#2457 (master - 71b131e : Ary Borenszweig): The build passed.
<asterite> I'm just lazy to increase a version number because of a breaking change (like Signal)... seems like "Wow, they incremented the number! ... Oh, because of a small breaking change"
<jhass> at diaspora we (well I) tricked and hacked semver by prepending a version
<jhass> so we got r.x.y.z
<jhass> and do strict semver for the x.y.z part
<jhass> but bump r on our consideration
mdz_ has joined #crystal-lang
<asbradbury> asterite: are you working full time on crystal?
<asterite> Mmm... not sure I like it
<jhass> eh, not saying it would fit for crystal
<asterite> asbradbury: no, not at all, we are doing it in our spare time
<asterite> (well, not all of our spare time, of couse :-))
<asterite> jhass: any idea why Dir["./**/*.cr"] doesn't behave like in Ruby?
<asterite> I'm sure it must be a small fix
<jhass> never looked into its implementation
<jhass> in what way it doesn't?
<asbradbury> asterite: ah right :)
<asterite> jhass: it doesn't recurse directories
<jhass> oh
<jhass> you're just passing to glibc glob?
<asterite> I think you implemented it :-)
<jhass> shit, you're right :D
<jhass> I don't remember :P
<asterite> Hahaha
<asterite> Maybe ruby does its own glob
<jhass> quite possible
<jhass> >> Dir["./**/*.h"]
<DeBot> jhass: # => [] - http://carc.in/#/r/2op
<jhass> hrm
<jhass> yeah looks like everyone does it on their own :/
<asterite> Don't worry, it's not a big deal. Someday we'll fix it
<asterite> asbradbury: why you ask?
<asbradbury> asterite: just curiosity
<jhass> asterite: easiest would probably to "just" recursively walk everything and filter the result with fnmatch(3)
<asterite> seems ruby calls fnmatch too
<asterite> but looking at dir.c it looks like a huge code to port, or to do something similar... at least for now :)
<jhass> hrm, though you'd want to know if your current directory matches part of the pattern
<jhass> so you can decide to walk it or not
<unshadow> asterite: What do you think about the wierd Regex thingy ?
<jhass> so you also want to tokenize the pattern on / I guess
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vI64h
<crystal-gh> crystal/master 5c10d5f Ary Borenszweig: Put back the old Regex constructor, and fix the literal expander for good so next version we can remove it. Fixes #781
<asterite> jhass: I didn't think yet how would one implement it, probably tokenize the pattern, yes
<asterite> unshadow: ;-)
Ven has joined #crystal-lang
waj has quit [Quit: waj]
<travis-ci> manastech/crystal#2458 (master - 5c10d5f : Ary Borenszweig): The build passed.
waj has joined #crystal-lang
asterite has quit [Ping timeout: 246 seconds]
NeverDie has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bcardiff has quit [Quit: Leaving.]
Ven has joined #crystal-lang
willl has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
bcardiff has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
leafybasil has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
vikaton has joined #crystal-lang
leafybas_ has joined #crystal-lang
leafybasil has quit [Ping timeout: 272 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
BlaXpirit has quit [Quit: Quit Konversation]
BlaXpirit has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mdz_ has joined #crystal-lang
<unshadow> asterite: Thanks :)
<jhass> so far most seen error on carc.in: Syntax error in eval:1: unterminated char literal
<jhass> could improve it a bit I guess, a did you mean "foo" would be nice
<unshadow> jhass: guess the 2nd one wasn't fixed in HEAD https://github.com/manastech/crystal/issues/783
<unshadow> :)
waj has quit [Quit: waj]
Excureo has quit [Remote host closed the connection]
Excureo has joined #crystal-lang
bhishma has joined #crystal-lang
<unshadow> >> "testing".gsub(/foo/) do {if $1; 2; end} end
<DeBot> unshadow: Error in line 4: type must be {(Nil | Int32)}, not {NoReturn} - http://carc.in/#/r/2q8
<unshadow> >> "testing".gsub(/foo/) do { |match, string| if match[1]; 2; end} end
<DeBot> unshadow: Syntax error in eval:4: unexpected token: | - http://carc.in/#/r/2qa
<unshadow> >> "testing".gsub(/foo/) do { |match, string| if match[1]; 2; end}; end
<DeBot> unshadow: Syntax error in eval:4: unexpected token: | - http://carc.in/#/r/2qb
bhishma has quit [Ping timeout: 264 seconds]
<unshadow> jhass: wut ?? http://carc.in/#/r/2qk
<vikaton> lol
<vikaton> "NoReturn"
<jhass> unshadow: what confuses you there?
<unshadow> >> puts $0
<DeBot> unshadow: /tmp/crystal-run-eval.hmOYeN - more at http://carc.in/#/r/2ql
<unshadow> is $0 the file name ?
<unshadow> puts $1
<unshadow> >> puts $1
<DeBot> unshadow: Exception: Nil assertion failed - more at http://carc.in/#/r/2qm
BlaXpirit has quit [Quit: Quit Konversation]
BlaXpirit has joined #crystal-lang
shama has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
mdz_ has quit [Remote host closed the connection]
bcardiff1 has joined #crystal-lang
bcardiff has quit [Ping timeout: 265 seconds]
zz_Cidan is now known as Cidan
sandelius has joined #crystal-lang
leafybas_ has quit []
bcardiff has joined #crystal-lang
bcardiff1 has quit [Ping timeout: 264 seconds]
wuehlmaus has quit [Quit: Lost terminal]
bhishma has joined #crystal-lang
wuehlmaus has joined #crystal-lang
bhishma has quit [Quit: Leaving]
mdz_ has joined #crystal-lang
bhishma has joined #crystal-lang
mdz_ has quit [Ping timeout: 276 seconds]
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
waj has joined #crystal-lang
mdz_ has joined #crystal-lang
<crystal-gh> [crystal] waj pushed 1 new commit to master: http://git.io/vIXnr
<crystal-gh> crystal/master 40ab2ac Juan Wajnerman: Added Vagrant configuration for Ubuntu Vivid 64bit
<travis-ci> manastech/crystal#2459 (master - 40ab2ac : Juan Wajnerman): The build passed.
apfohl has quit [Quit: I'm gone!]
bcardiff1 has joined #crystal-lang
NeverDie has joined #crystal-lang
bcardiff has quit [Ping timeout: 252 seconds]
NeverDie has quit [Max SendQ exceeded]
NeverDie has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
Ven has joined #crystal-lang
BlaXpirit has quit [Quit: Quit Konversation]
<fowlduck> allo
<fowlduck> my first commit landed in crystal! https://github.com/manastech/crystal/pull/782
<fowlduck> it's not code, but it's something
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<willl> nice
<waj> fowlduck: docs are becoming equally important as code ;)
<fowlduck> that's what I hear
<fowlduck> from `ready_channel = channels.find &.ready?` to `ready_channel = channels.select(&.ready?).sample`
<fowlduck> so it randomly selects amongst the ready channels, like go does
<fowlduck> I don't understand how this works with concurrency, though. it seems like it shouldn't
<fowlduck> I guess the Scheduler thing handles it?
<fowlduck> only, what's the scheduler?
<waj> is that actually so important? I mean… the `sample` call will add a small but noticeable overhead
<fowlduck> is concurrency cooperative in crystal?
<fowlduck> it really is important
<fowlduck> otherwise the first channel will always be selected if it's always ready and that will starve out other channels that might be ready
<fowlduck> at least that's the design motivation in go
<fowlduck> and I think it's a solid decision
<waj> well… yeah, in Erlang the order of the select clauses defines the priority
<fowlduck> right. with go you would nest selects to enforce priority
<waj> I mean… in the “receive” statement
<fowlduck> right
<waj> I see
<fowlduck> so in go you at least have the *choice* of not starving out other channels
<fowlduck> otherwise you'd have to randomize the order of them on every loop
<waj> however, I’d like to find a way that doesn’t involve array allocations
<fowlduck> I'm all ears
bhishma has quit [Ping timeout: 256 seconds]
<fowlduck> I'm not sure how you could get away with not allocating an array or something else, there
<fowlduck> if we could randomize the order of the array, or at least randomize the order we iterate over it?
<waj> still… if your code is running on a single fiber and there is no physical time to attend all the requests on all the channels, there is always going to be messages accumulating on many channels
<waj> I know that randomizing the selection might be useful in some scenarios, but I’m not sure it isn’t possible to live without it
<fowlduck> the person doing the select could always randomize the order of channels themselves if it's important, I guess
<fowlduck> do you happen to know how Scheduler works?
<waj> this is something I’ve been thinking for a while when I implemented the Channel.select, but I wasn’t sure, so I’m all ears :)
<waj> yup, I wrote that code
<fowlduck> oh, cool, I rewrote https://github.com/igrigorik/agent
<fowlduck> that one doesn't randomize the order of ready channels, though
<waj> Oh! cool!!
<fowlduck> and closing channels doesn't behave right (there's a pull request out)
<fowlduck> but we had to do some nasty stuff because we allow channels to be marshalled
<waj> Looks very nice, why I didn’t know its existence before!?
<fowlduck> no idea
<fowlduck> we use it in production, it's really nice
<fowlduck> but I can't depend on a cooperating scheduler for it
<fowlduck> so I queue operations on channels as well the items in the channel, and resolve the queued operations when each new op comes in
<waj> Crystal’s scheduler is also cooperative
<fowlduck> oh, really? there's no preemption?
<waj> no
<fowlduck> wow, interesting design choice
<waj> and I think Go used to be cooperative for long time also
<waj> I wouldn’t call it a design choice… it’s in early stages ;)
<fowlduck> ah, I didn't know that
<fowlduck> ha, so it's just coincidental atm
<fowlduck> err, incidental
<fowlduck> ?
<fowlduck> trying to find the Thread class
<fowlduck> found it
<fowlduck> ah, nice, condition variables and mutexes already
<waj> it’s just wrapping around pthread
<fowlduck> I suppose crystal will need some sort of reentrant mutex-like thing, like ruby's Monitor
<waj> didn’t need it yet
<fowlduck> # Don't use this class, it is used internally by the event scheduler.
<fowlduck> # Use spawn and channels instead.
<fowlduck> haha
<fowlduck> okie doke
<fowlduck> I almost never write cooperative threaded code. this'll be new to me
<waj> yup, actually the scheduler uses fibers: https://github.com/manastech/crystal/blob/master/src/fiber/fiber.cr
<strcmp1> you can use them as long as you don't do anything IO-bound, because that segfaults
<fowlduck> brb
<waj> strcmp1: that’s a side effect since we moved to evented IO
<strcmp1> yeah
<waj> eventually the scheduler will spawn on many threads
zipR4ND has joined #crystal-lang
<waj> right now it feels like a mix between Go and Node :)
<jhass> https://github.com/jhass/DeBot/blob/master/thread/src/thread/checking_mutex.cr reentrant mutex, in theory (I forgot if I actually use it)
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vI1kS
<crystal-gh> crystal/master 08beee0 Ary Borenszweig: Fixed #783: special vars didn't work when blocks were involved
<crystal-gh> crystal/master a9cb445 Ary Borenszweig: Fixed #784: bug when creating macro with argument with default value and splat
<crystal-gh> crystal/master 14e9cb5 Ary Borenszweig: Small bool initialization in json lexer
<jhass> ah looks like I do
<fowlduck> jesus, controlling the scheduler really makes channels *much* easier to implement
<fowlduck> yay single threading
<waj> more threads will come, eventually
<waj> however, if so many people is happy with nodejs, why not be happy with Crystal that gives you the power of evented IO without all the trouble of having callbacks everywhere :)
<strcmp1> node.js is just a fad.
<waj> haha, you think? it’s pretty good actually
<travis-ci> manastech/crystal#2460 (master - a9cb445 : Ary Borenszweig): The build passed.
<waj> fowlduck: I found the channels implementation to be quite similar (in structure) to Go channels
<waj> anyway… it’s still really simple because it’s missing all the support for multiple threads
<strcmp1> yeah, it is riding on hype, it will be around to stay but i think it has more hype than anything else. in a few years we will see. same as rails 7-8 years ago.
<waj> also, the “select” must change a lot to support multithreading
<waj> even the API interface, although we don’t know how to do it yet
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
<fowlduck> waj: right, select is where all the complications come in
<fowlduck> and making crystal node-like would be a mistake, in my opinion
<fowlduck> I don't want to think about blocking the reactor all the time. sometimes I need to do a lot of computation
<waj> yup, I know
<fowlduck> the amount of work put into working around node's callback hell is absurd
<waj> I should write somewhere the design question I still have for the scheduler
<fowlduck> what's the question?
<fowlduck> ha, neat, I followed you and asterite on twitter last night, it seems
<waj> like, should we have a single IO poller? or one for each worker thread?
<waj> if we had many, how to synchronize access to the same fd from different threads?
<waj> and if we had just one, do we need to wake the poller every time some thread need to subscribe or unsubscribe from events?
<fowlduck> commented on that issue about channels
<fowlduck> and select
<fowlduck> hm, that's an interesting question
<fowlduck> I assume the threading will be M:N?
<fowlduck> like go?
<waj> yes, I think is the best approach nowadays
<fowlduck> I wonder how go handles that
<fowlduck> one I/O poller would introduce contention, I'd think
<fowlduck> but I don't know much about them, or how that might work
<waj> yup, that’s what I found from a GHC paper
<fowlduck> then the question is, how do you divide the work to reduce contention
<fowlduck> without introducing tons of overhead and complexity
<fowlduck> wow, big claims in the abstract
<waj> anyway… little by little. I don’t pretend to put Crystal to run on 40 cores yet :)
<fowlduck> hopefully eventually!
vikaton has quit [Quit: Connection closed for inactivity]
<fowlduck> god, I need to improve my C. most of these problems look really interesting
<fowlduck> and of course I have opinions...
<waj> shoot!
zipR4ND has quit [Ping timeout: 246 seconds]
<fowlduck> I prefer running over not running, even if it's slower
<fowlduck> uptime is paramount
<fowlduck> so option 2 appeals to me
<fowlduck> if I could know about this at compile-time, though, that would be nice
<waj> for me the fact that closing a file in the finalizer is definitely a bug it’s enough to raise some kind of alert and not just the GC do the job
<fowlduck> I just hate it that something the language could easily solve (option 2) could bring down my program in production
<fowlduck> yes, it's a bug, but tell me at compile-time and keep it running if I can't/haven't fixed it
<fowlduck> I guess I don't know if that fits crystal's design goals
<fowlduck> know what would be really cool in crystal? pattern-matching for method overloads
<fowlduck> def foo(bar : Int32 > 4)
<fowlduck> or something
<fowlduck> also it would be cool to be able to put values in there, so it only matches the method that has that specific value
<fowlduck> def foo(:bar, options) ... def foo(:baz, options) ...
<fowlduck> also, thank you to whoever made strings immutable
<waj> the idea of pattern matching was around some time, but we just didn’t want to introduce too many features to the language
<waj> hehe… I think it was one of the very first design decisions
<flaviu> I'd like to point out that that "small but noticeable overhead" could be incredibly small.
<fowlduck> what "small but noticeable overhead"
<flaviu> re. the channel thing a while ago.
<fowlduck> ?
<waj> did you measure it?
<flaviu> There are (very good) PRNGs that execute very quickly[1], [1]: http://xorshift.di.unimi.it/#quality
<fowlduck> checking for every single ready channel first might be the biggest overhead
<fowlduck> instead of stopping at the first
<fowlduck> that would vary by the number of channels, of course
<fowlduck> sample seems like it ought to be cheap as hell
<flaviu> While I assume the speed shown on that page requires that the PRNG be run in a loop, I don't see why it'd cost much more than is shown there.
<flaviu> That's around 4 cycles on the CPU he ran it on.