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
datanoise has quit [Ping timeout: 264 seconds]
waj has joined #crystal-lang
bcardiff has joined #crystal-lang
Guest25_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
datanoise has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
mdz_ has joined #crystal-lang
waj has quit [Quit: waj]
<crystal-gh> [crystal] asterite closed pull request #799: Replace 'Set#<<' with `alias_method` (master...feature/alias_method_add) http://git.io/vLUo6
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
mdz_ has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 244 seconds]
NeverDie has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
datanoise has joined #crystal-lang
waj has joined #crystal-lang
datanoise has quit [Ping timeout: 264 seconds]
<crystal-gh> [crystal] asterite closed pull request #791: Non-matching captures return nil instead of empty string (master...regex-nils) http://git.io/vIQnb
<crystal-gh> [crystal] asterite pushed 6 new commits to master: http://git.io/vLmGQ
<crystal-gh> crystal/master cafe5e2 Will Leinweber: Import URI regex from ruby...
<crystal-gh> crystal/master cafea59 Will Leinweber: Add user, password, userinfo to URI
<crystal-gh> crystal/master cafe1de Will Leinweber: Add URI fragment
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
fowlduck has quit [Remote host closed the connection]
<travis-ci> manastech/crystal#2487 (master - 35d1f23 : Ary Borenszweig): The build passed.
datanoise has joined #crystal-lang
<travis-ci> manastech/crystal#2486 (master - 93ff1fd : Ary Borenszweig): The build passed.
waj has quit [Quit: waj]
datanoise has quit [Ping timeout: 252 seconds]
<crystal-gh> [crystal] yui-knk opened pull request #810: Replace `alias_method` with implementaion (master...fix/alias) http://git.io/vLmVQ
BlaXpirit has joined #crystal-lang
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 245 seconds]
BlaXpirit has quit [Quit: Quit Konversation]
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 244 seconds]
bcardiff has joined #crystal-lang
allen has joined #crystal-lang
allen is now known as Guest63433
Guest63433 has quit [Client Quit]
Ven has joined #crystal-lang
datanoise has joined #crystal-lang
<unshadow> Where can I read about the different between buffered and unbuffered channels ?
datanoise has quit [Ping timeout: 252 seconds]
bcardiff has quit [Quit: Leaving.]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<willl> assuming they're going for the same semantics as go which is a safe bet, https://gobyexample.com/channel-buffering
havenwood has quit [Ping timeout: 240 seconds]
<unshadow> willl: thanks for the link :)
Liothen has quit [Ping timeout: 246 seconds]
Liothen has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
unshadow has quit [Ping timeout: 256 seconds]
unshadow has joined #crystal-lang
BlaXpirit has joined #crystal-lang
<unshadow> We need to open a "Projects the uses Crystal" page
<unshadow> or Projects and Products etc..
<BlaXpirit> >> a = a
<DeBot> BlaXpirit: Error in line 4: undefined local variable or method 'a' - http://carc.in/#/r/3cj
<jhass> probably an improvement over Ruby :P
<unshadow> jhass: that looks more like crystal-shards then what I have in mind, something more like this: http://blog.teamtreehouse.com/coolest-ruby-projects-ever , https://www.ruby-lang.org/en/documentation/success-stories/ , http://railsware.com/work/projects
<unshadow> etc...
<unshadow> >> IO.pending
<DeBot> unshadow: Error in line 4: undefined method 'pending' for IO:Class - http://carc.in/#/r/3cs
Ven has quit [Ping timeout: 264 seconds]
<unshadow> Any one has a good idea on how to follow (tail -f) a file ?
mdz_ has joined #crystal-lang
<unshadow> >> begin ; rescue Interrupt; end
<DeBot> unshadow: Error in line 4: undefined constant Interrupt - http://carc.in/#/r/3e0
<strcmp1> jhass, are you nuts? a = a is my favorite feature of ruby! :P
<jhass> but also one that confuses a lot of newbies ;)
<strcmp1> yup, and i don't really like it :) use to it by now i guess.
Ven has joined #crystal-lang
<unshadow> A little bit offtopic, what do you guys use for Project Managment Systems ?
<unshadow> like tracking development, missions , etc..
havenwood has joined #crystal-lang
sandelius has joined #crystal-lang
bcardiff has joined #crystal-lang
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
datanoise has joined #crystal-lang
waj has joined #crystal-lang
<BlaXpirit> redmine obviously.............
wuehlmaus has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
<jhass> heh
<strcmp1> unshadow, github issues
NeverDie has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 7 new commits to master: http://git.io/vL3yo
<crystal-gh> crystal/master e3d065c Ary Borenszweig: Added `String#chop`
<crystal-gh> crystal/master 1b63cc3 Ary Borenszweig: Added `$1?`, `$2?`, etc. as a nilable alternative to`$1`, `$2`
<crystal-gh> crystal/master 6ecbe45 Ary Borenszweig: Added `String#dump_unquoted` and `String#inspect_unquoted`
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vL3Hj
<crystal-gh> crystal/master 1da4be8 Ary Borenszweig: Merge pull request #810 from yui-knk/fix/alias...
<crystal-gh> crystal/master 563e920 yui-knk: Replace `alias_method` with implementaion
Ven has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #808: Fix some doc examples (gh-pages...doc-fixes) http://git.io/vLqgf
<crystal-gh> [crystal] asterite closed pull request #805: Add splat example (gh-pages...fix/splat) http://git.io/vLIan
<crystal-gh> [crystal] asterite closed pull request #804: Remove useless space (gh-pages...fix/space) http://git.io/vLIcR
<crystal-gh> [crystal] asterite closed pull request #803: Fix typo (gh-pages...fix/typo) http://git.io/vLkbj
datanoise has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vL3A4
<crystal-gh> crystal/master 2c65c7e Ben Noordhuis: Fix bad assumption in TCPSocket.new test...
<crystal-gh> crystal/master 937072a Ary Borenszweig: Merge pull request #806 from bnoordhuis/fix-tcpsocket-test...
<jhass> !memo asterite http://carc.in/#/r/3bh bug or is even non-pointer casting unsafe?
<DeBot> jhass: Added memo for asterite.
<jhass> wait, what? carc.in/#/r/3dd
wuehlmaus has quit [Remote host closed the connection]
<travis-ci> manastech/crystal#2490 (master - 1da4be8 : Ary Borenszweig): The build passed.
<willl> jhass: http://carc.in/#/r/3ef
<jhass> ah, right
<jhass> lol
<jhass> should've seen that
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<travis-ci> manastech/crystal#2489 (master - c91f98f : Ary Borenszweig): The build passed.
jua_ has joined #crystal-lang
waj has quit [Quit: waj]
<travis-ci> manastech/crystal#2491 (master - 937072a : Ary Borenszweig): The build passed.
datanoise has joined #crystal-lang
datanoise has quit [Ping timeout: 272 seconds]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vLsOg
<crystal-gh> crystal/master 3a768ce Ary Borenszweig: Added missing Regex#=~(String)
<crystal-gh> crystal/master 7dc8f8a Ary Borenszweig: Make BufferedIO try to read `count` bytes, don't limit it at the internal's buffer size. Fixes #813.
<crystal-gh> crystal/master 625570d Ary Borenszweig: Use "Crystal" as default user agent for HTTP::Client
Codcore has joined #crystal-lang
<Codcore> how to use 'before_each' in specs? tried before_each do ... code ... end, output is "undefined local variable or method 'before_each'"
<jhass> Spec.before_each, it's global for all specs for now and intended for things like mocking libraries
<Codcore> oh, thanks =)
<Codcore> so, there are no 'more local' variant?
<jhass> yup, not in the standard library spec
<jhass> https://github.com/ysbaddaden/minitest.cr might be usable already though
<Codcore> I tried, but it behave strangely https://github.com/ysbaddaden/minitest.cr/issues/4
waj has joined #crystal-lang
datanoise has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vLs44
<crystal-gh> crystal/master 1d1c67b Ary Borenszweig: Contributing: say that you might be missing some libraries, and point to a wiki page
<crystal-gh> [crystal] asterite closed pull request #800: Small changes in Contributing.md (master...master) http://git.io/vLTQp
shama has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #765: grammar (gh-pages...gh-pages) http://git.io/vI0Dt
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vLsRv
<crystal-gh> crystal/master a8c5f06 Ary Borenszweig: Merge pull request #751 from mrjbq7/sieve...
<crystal-gh> crystal/master 29e1680 John Benediktsson: adding the sieve of eratosthenes example.
<crystal-gh> [crystal] asterite closed pull request #675: Fix crystal deps behavior with path dependencies that have no git commits (master...fix-crystal-deps-with-empty-git) http://git.io/vTgiG
<crystal-gh> [crystal] asterite closed pull request #669: Added more functionality to openssl (master...master) http://git.io/vTcmt
<crystal-gh> [crystal] asterite closed pull request #634: Doc about accessing not allocated array's element (master...master) http://git.io/vJ9hB
<crystal-gh> [crystal] asterite closed pull request #621: Improve building from source instructions (gh-pages...patch-2) http://git.io/vJ6t8
<travis-ci> manastech/crystal#2492 (master - 625570d : Ary Borenszweig): The build passed.
<crystal-gh> [crystal] asterite closed pull request #583: libevent and boehmgc seem to be required now (gh-pages...patch-1) http://git.io/vfSek
<crystal-gh> [crystal] asterite closed pull request #564: Spec : get rid of object patching (master...spec/get_rid_of_object_patching) http://git.io/vfYj0
<crystal-gh> [crystal] asterite closed pull request #531: Update generics.md (gh-pages...patch-1) http://git.io/vvtxY
<travis-ci> manastech/crystal#2494 (master - a8c5f06 : Ary Borenszweig): The build passed.
<crystal-gh> [crystal] asterite closed pull request #517: Added Git dependency. (master...add_git_dependency) http://git.io/ve8K8
<crystal-gh> [crystal] asterite closed pull request #515: Add .DS_Store to .gitignore (master...add_DSStore_ignore) http://git.io/ve8BM
mdz_ has joined #crystal-lang
<travis-ci> manastech/crystal#2495 (master - 82c6f6d : Ary Borenszweig): The build passed.
<crystal-gh> [crystal] asterite closed pull request #296: Added before and after hooks for Spec's (master...spec_before_after) http://git.io/vLsKm
<crystal-gh> [crystal] asterite closed pull request #310: Started Stats module (master...math) http://git.io/vLs6P
<travis-ci> manastech/crystal#2496 (master - 06ae7b6 : Ary Borenszweig): The build passed.
<crystal-gh> [crystal] asterite closed pull request #280: Grammar changes (gh-pages...patch-1) http://git.io/vLsMO
<crystal-gh> [crystal] asterite closed pull request #159: WIP: Date class (master...date) http://git.io/vLsMV
<BlaXpirit> well that's a lot of notifications
<BlaXpirit> so nice
wuehlmaus has joined #crystal-lang
<jhass> unshadow: can't one close issues one has opened on Github?
<waj> asterite is on fire! :)
<jhass> indeed
<jhass> wonder if he gets the number below 100 :D
<jhass> mmh, so you guys think https://github.com/manastech/crystal_ruby won't happen?
vikaton has quit [Quit: Connection closed for inactivity]
asterite has joined #crystal-lang
<asterite> jhass: http://carc.in/#/r/3bh is definitely a bug, should give a compile error when casting to String
<jhass> figured
<asterite> jhass: did you see the comments about the null pointer exception blog post?
<jhass> re. #ruby ?
<jhass> I didn't fully read them I think
<waj> jhass: crystal_ruby should be possible
<asterite> waj: what about the type ids?
<waj> what about them?
<asterite> jhass: oh, because somebody made some comments and use that `nil as Object` to show that the language is not robust, while it turned out to be a bug... so probably he tried that in play.crystal-lang too
<asterite> waj: every time you compile an app, a class Foo might get a different type id
<asterite> is_a? uses that type id to work
<asterite> and also method dispatch
<jhass> ah no, I'm still just skipping through all the runs ;)
<asterite> waj: so two different libraries built by crystal, used by Ruby, won't be compatible
<jhass> mmh, but then how likely is it that you pass unwrapped crystal objects from one to the other?
<waj> ok, but why would you want two libraries to interact with each other directly?
<asterite> hehehe, are you in the same room? :-)
<asterite> I guess we'll have to try. That's just my main "fear" (well, not like fearing a monster)
<waj> anyway… that raises a valid question: which library will initialize the GC?
<jhass> what happens if it's initialized twice?
<waj> however, I think it might be possible to use the Ruby GC instead
<waj> m… maybe nothing happens
<jhass> worst case scenario I can think of is it crashes, second worst case leaks everything allocated between the first and the second init
<waj> regarding binary compatibility between libraries, one wouldn’t expect more compatibility that the one we use when passing structs to other C libraries
<jhass> using Ruby GC sounds interesting, a lot of work went into it recently
<waj> jhass: actually I’m pretty sure nothing happens and everything works just fine, at least if the GC is not statically linked in any of the libraries
<waj> I have no idea otherwise :)
<waj> nice
<waj> bdwgc also supports incremental gc
<jhass> hehe
<waj> we bought it when we started Crystal, and before we decided to use bdwgc
<jhass> though sometimes I do wonder if being able to mark objects as ignored by the GC and provide Object#free would be a good or a bad thing
<waj> bdwgc performance is decent and it was really easy to start
<waj> but huge improvements for Crystal can be done in this area for sure
<jhass> well, I guess I'm thinking about the binding usecase specifically
<jhass> for example I have this https://github.com/jhass/crystal-gobject/blob/master/src/helper.cr#L31 because the GC doesn't seem to see the references to the closure data held by glib and frees them
<waj> well… you can always use plain malloc/free in that case
<waj> but being able to pin some references might be useful sometimes
<jhass> yeah, I guess ideally with manual reference counting
<jhass> which could later also serve as infra for an own GC if desired
<waj> some libraries allow customizing the functions used for malloc/free
<jhass> I mean with ^ I basically did an external reference counter
<waj> we use that in lib_gmp and lib_pcre
<jhass> nah, it's not about library allocated object, but crystal allocated ones
<waj> yes, but if you can control the memory allocated by the library then the GC will see the references to the closures
<jhass> mmh
<waj> not every library allow that anyway
<jhass> yeah, doubt glib/gobject does
<jhass> they implement their own reference counting to some degree iirc
<waj> another option would be giving a more friendly interface to “push_other_roots”
<waj> that’s being used by the fibers to keep references on the fiber stacks
<willl> tangentially related, palloc is really nice http://www.postgresql.org/docs/current/static/spi-memory.html it creates contexts, and then you just drop the whole context when you're done rather than keeping track of every individual thing. more work than a general GC, but not much work in practice
<waj> that’s nice
<jhass> "with 'n' being 'n'" :D
<unshadow> OMFG asterite you are crazy hahaha so many mails XD
<waj> imagine for example if you can asure a fiber is short lived and it doesn’t send references to new object to other fibers, instead of a heap it could use a simple memory region with a pointer that’s incremented each time an allocation is made
<waj> the GC wouldn’t bother to clean up those objects
<waj> and the whole buffer could be released once the fiber ends
<willl> I don't know if it's feasible to have both that and a gc, but creating a context for like a single web request, then dropping it seems like it'd be good
<unshadow> jhass: yeha, I was on my phone, so no close option for issues
<jhass> really? oO
<waj> this is quite interesting also: http://www.ravenbrook.com/project/mps/
<asterite> unshadow: sorry, today is June 16, "international day of cleaning up github issues and pull requests"
<asterite> waj: I still agree with jhass, we should add a GC.pin and GC.unpin to make it easier to deal with those things
<BlaXpirit> wait, what exactly would it do?
<BlaXpirit> i skimmed through prev. messages
<jhass> prevent the GC from releasing the object
<jhass> until unpin
<BlaXpirit> ok
<jhass> or whatever the API will actually be called
<waj> well… we can do that very quickly just adding a reference in a global hash
<BlaXpirit> but uhhh how is this different from saving a reference?
<BlaXpirit> in user code, that is
<jhass> it's not, it saves everybody reimplementing it
<waj> no difference at all
<BlaXpirit> ok
<jhass> though the question of whether to count references or not stays open
<jhass> like does GC.pin a; GC.ping a; GC.unpin a; remove the reference or not
<waj> we can have a Hash(Void*, Int32) with the reference counts
<waj> and have a GC.unpin! also to force removal
<waj> this would be pretty slow anyway
<waj> I’m thinking now something like having a Pineable module that can be included
<waj> Pinnable, Pinable or Pineable? :)
<waj> this module could add the reference count inside the objects
<waj> and build a linked list with the pinned objects
<waj> that way, pin and unpin doesn’t require a lookup in a hash table
<asterite> I think in jhass' case he sends an object to C, doesn't keep a reference to it but doesn't want the GC to delete its memory. I'm not sure it's the same use case
<asterite> I also think it was a closure (a Proc), so I don't think he'll make Proc include that Pinnable module
<jhass> ;)
<waj> mm… good point
<jhass> Ruby has several markers in Object, #freeze & #taint for example
<thor77> is there some way to iterate over lines in a file?
<asterite> thor77: each_line
<thor77> each_line do |line| ?
<asterite> Yes
<thor77> fine, ty
asterite has quit [Quit: Page closed]
<thor77> i'm iterating over a file and want to match a regex on each line. the compiler says "undefined method '[]' for Nil" if i try to access the match-obj
<jhass> thor77: since the regex might not match, check you got a match with if match
<thor77> yeah, thought so, too. but still the same warning
<jhass> got an example?
<thor77> huh, wtf.
<thor77> now it works with "if match"
<thor77> seems like there was another error
<thor77> thank you, anyway
<jhass> yw
genixefr has quit [Ping timeout: 256 seconds]
genixefr has joined #crystal-lang
<unshadow> Would calling unpin just notify the GC that this object is now under it's control, or will it tell it something like Clean this now ! ?
<jhass> I'd say the former
bcardiff has quit [Quit: Leaving.]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: http://git.io/vLZmO
<crystal-gh> crystal/master 8856662 Ary Borenszweig: Small fix in OAuth for empt uri paths
<crystal-gh> crystal/master b96bb81 Ary Borenszweig: Fixed #817: parse error when using __DIR__ in call beginning
<crystal-gh> crystal/master 35e4e92 Ary Borenszweig: Fixed #816: incorrectly parsed call instead of var
<BlaXpirit> latter is inherently unsafe
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vLZGJ
<crystal-gh> crystal/master e202d54 Ary Borenszweig: Disallow casting to Object (for now, because it's a nop). Fixes #815
jua_ has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
unshadow has quit [Ping timeout: 265 seconds]
bcardiff has joined #crystal-lang
mdz_ has quit [Remote host closed the connection]
<crystal-gh> [crystal] kirbyfan64 opened pull request #819: Optimize Array.shift (master...new-shift) http://git.io/vLZ4Q
<travis-ci> manastech/crystal#2498 (master - 35e4e92 : Ary Borenszweig): The build passed.
bcardiff1 has joined #crystal-lang
bcardiff has quit [Read error: Connection reset by peer]
<jhass> !memo asterite http://carc.in/#/r/3g2 another candidate for the better error messages list, could say "no argument named msg" IMO
<DeBot> jhass: Added memo for asterite.
bcardiff1 has quit [Read error: Connection reset by peer]
bcardiff has joined #crystal-lang
bcardiff1 has joined #crystal-lang
bcardiff has quit [Read error: Connection reset by peer]
Codcore has quit [Ping timeout: 246 seconds]
<flaviu> Is it possible to place complex logic in macros?
<jhass> macros do have if/else and for loops
<jhass> and some string and array/hash manipulation methods are mapped out, like gsub, map etc
<jhass> exactly
fowlduck has joined #crystal-lang
waj has quit [Quit: waj]
<jhass> flaviu: keep in mind that macros are evaluated at compile time and a methods code can only run at runtime
<jhass> same for passing values as macro arguments, they need to be known at compile time
<BlaXpirit> jhass, we're trying to cope with the losses from leaving nim
<flaviu> > a methods code can only run at runtime
<flaviu> Implementation constraint, not theoretical :P
<flaviu> BlaXpirit: +1
<jhass> heh, send a PR :P
<flaviu> jhass: I'll get it to you some time in the next decade.
<jhass> sounds good
bcardiff has joined #crystal-lang
bcardiff1 has quit [Read error: Connection reset by peer]
bcardiff has quit [Client Quit]
bcardiff has joined #crystal-lang
mdz_ has joined #crystal-lang
BlaXpirit has quit [Quit: Quit Konversation]
<flaviu> Seriously though, this doesn't seem impossible. The test suite uses CAAS to run the tests, so lots of the functionality is already there.
<flaviu> I'll look into it later.
bcardiff1 has joined #crystal-lang
bcardiff has quit [Read error: Connection reset by peer]
bcardiff1 has quit [Quit: Leaving.]
shama has quit [Ping timeout: 256 seconds]
shama has joined #crystal-lang
jtarchie has quit [Quit: Connection closed for inactivity]
mdz_ has quit [Remote host closed the connection]
shama has quit [Read error: Connection reset by peer]
shama has joined #crystal-lang
bcardiff has joined #crystal-lang
mdz_ has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]