jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.7.6 | Fund Crystals development: http://is.gd/X7PRtI | 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
blue_deref has joined #crystal-lang
zamith has quit [Quit: Be back later ...]
zamith has joined #crystal-lang
crjoe has quit [Quit: Page closed]
<travis-ci> manastech/crystal#60e7974 (master - Small change/fix in JSON pull parser): The build passed. https://travis-ci.org/manastech/crystal/builds/76381738
zamith has quit [Ping timeout: 260 seconds]
kyrylo has quit [Quit: Konversation terminated!]
kyrylo has joined #crystal-lang
kulelu88 has left #crystal-lang ["Leaving"]
ylluminate has quit [Quit: Leaving.]
ssvb has quit [Ping timeout: 260 seconds]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
kyrylo has quit [Ping timeout: 255 seconds]
zamith has joined #crystal-lang
ylluminate has joined #crystal-lang
zamith has quit [Ping timeout: 250 seconds]
havenwood has joined #crystal-lang
n0xff has joined #crystal-lang
havenwood has quit [Ping timeout: 260 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 265 seconds]
sailorswift has joined #crystal-lang
NeverDie has joined #crystal-lang
ylluminate has quit [Ping timeout: 240 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 246 seconds]
<crystal-gh> [crystal] bjmllr opened pull request #1241: use 0 as default argument to MatchData#begin, #end, #byte_begin, and #byte_end (master...begin0) http://git.io/vsZLt
havenwood has joined #crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 252 seconds]
blue_deref has quit [Quit: bbn]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 240 seconds]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 240 seconds]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 245 seconds]
<Netfeed> is it possible to call a function methodd on a string? obj.call("some_func") or something?
strcmp1 has quit [Quit: Leaving]
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 264 seconds]
Ven has joined #crystal-lang
BlaXpirit has joined #crystal-lang
Ven has quit [Client Quit]
Ven has joined #crystal-lang
havenwood has quit [Ping timeout: 255 seconds]
sailorswift has quit [Ping timeout: 255 seconds]
zamith has joined #crystal-lang
Rishav has joined #crystal-lang
<Rishav> hi
<Rishav> i have a question about running a project vs running a single cr file
<Rishav> is there any specific command to run an entire project?
<Rishav> can we define an entry point for the project in any config?
<Rishav> my problem is that if i create an app project using crystal init app
<Rishav> and then try to run it
<Rishav> it runs fine
<Rishav> but if i try to build it
<Rishav> it gives me an error
<Rishav> saying that a directory exists by that name
<Rishav> i know i can use -o to specify output
<Rishav> but i thought the compiled file would automatically go into the app directory
zamith has quit [Ping timeout: 244 seconds]
<Rishav> ummm hi? :(
<Netfeed> i created a bin/appname.cr that just requires src/appname.cr and runs a Appname::run! function, and then run it with crystal bin/appname.cr and i can also build it with crystal build bin/appname.cr, i dont know if that's best practice though
<Rishav> thats pretty convoluted
<Rishav> o.0
<Rishav> i was hoping that there was some way to spcify the entry point and the compiled directory for any project
<Netfeed> https://github.com/porras/crul <- that one has a file in the root-dir that does pretty much the same thing too
<Netfeed> i wouldn't mind a better way, but i've not found one yet
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ssvb has joined #crystal-lang
<Rishav> i think i will raise an enhancement request for this
<Rishav> i have been spoiled by nodejs package.json
<Rishav> :D
kyrylo has joined #crystal-lang
BlaXpirit has quit [Quit: Konversation]
BlaXpirit has joined #crystal-lang
zamith has joined #crystal-lang
zamith has quit [Ping timeout: 252 seconds]
trapped has joined #crystal-lang
infrashortfoo has left #crystal-lang [#crystal-lang]
kyrylo has quit [Read error: No route to host]
kyrylo has joined #crystal-lang
blassin has joined #crystal-lang
<blassin> I think I found a bug on Crystal for Mac OS
<blassin> this code http://carc.in/#/r/c1l works on carc.in
<blassin> but I get "Error: File / does not exist" on my Mac
<blassin> or am I doing something wrong?
sleeper_ is now known as sleeper
<crystal-gh> [crystal] ryanworl opened pull request #1244: Added HTML parsing to XML module, references #1240 (master...html_parser_with_libxml2) http://git.io/vsnSi
<BlaXpirit> blassin, simplified it for ya :p http://carc.in/#/r/c1m
<BlaXpirit> works on my Linux too
<blassin> BlaXpirit: sure, I just started work on this tool :D
<blassin> anyone else with a Mac ?
<BlaXpirit> i mean i made a minimal example if u wanna report it
<blassin> I think I will
<blassin> this is very weird
<blassin> thanks for the minification ;)
leafybasil has quit [Read error: No route to host]
leafybas_ has joined #crystal-lang
<Netfeed> \o/ my frist pull request on github to something that's not already mine
<Netfeed> found another bug in the sqlite3 repo :)
blassin has quit [Quit: Page closed]
Rishav has quit [Quit: Page closed]
Ven has joined #crystal-lang
Rishav has joined #crystal-lang
ssvb has quit [Ping timeout: 252 seconds]
<BlaXpirit> I'm looking for feedback on https://github.com/BlaXpirit/crystal-deque , planning to suggest it for addition to Crystal
zamith has joined #crystal-lang
<vegai> what's the correct way to publish comments on github again
<vegai> on a whole file
<vegai> or perhaps I'll just talk here :P
<BlaXpirit> vegai, u can comment a commit, that's for sure
<vegai> BlaXpirit: is there a reason to not use malloc on line 57 as you used it on l64?
<BlaXpirit> here is very good too
<BlaXpirit> vegai, it's related to https://github.com/manastech/crystal/issues/1209
<BlaXpirit> i need to allocate some memory but not fill it all with data
<BlaXpirit> because the amount of data i have is less then the size of minimal allocated chunk
trapped has quit [Read error: Connection reset by peer]
<vegai> ah, now I see
<vegai> ok
trapped has joined #crystal-lang
<jhass> BlaXpirit: my feedback stands, if it should go into stdlib keep the API to the usecases it's good at only, drop API where Array is performing equally or better
<BlaXpirit> so if you need a deque but happen to need a remove an item in the middle just once... too bad?
<jhass> We already have Array, StaticArray & Tuple, I really don't want the java disease of ArrayList, LinkedList, DoubleLinkedList and so on and you wonder all the time what to use now
<vegai> BlaXpirit: conversion on line 78 seems redundant. size:Int => size.to_i
<BlaXpirit> vegai, i think to_i is to_i32
<BlaXpirit> jhass, Deque is an extremely important data structure. Python has it, C++ has it
* vegai shrugs :)
<BlaXpirit> maybe i'm wrong. in any case it would be optimized out if it does nothing
<jhass> BlaXpirit: well, tbh I'd love to keep it as an external library, once we have a decent package manager getting it is a 30sec effort
<jhass> IME not wondering what DS to use by default is a huge comfort, and keeping the redundant usecases in stdlib small is a good way to achieve that
<BlaXpirit> what
<jhass> you can always identify actual bottlenecks and then having a library to swap the default out with is great
<BlaXpirit> jhass, i think this Deque has the same or better asymptotic complexity compared to Array for every method
<jhass> so you want to replace Array with it?
<BlaXpirit> no, that's not applicable
<jhass> see, and now you have to explain a newbie what to use when because both is in stdlib
<BlaXpirit> what's there to explain
<jhass> whereas with an external library you can defer that to the "why's this slow" occasion
<BlaXpirit> it's all here in a couple of liens http://blaxpirit.github.io/crystal-deque/
<jhass> maybe at least add when to not use it if you want it in stdlib
<BlaXpirit> people would only use it if they specifically search for it anyway
<Netfeed> is it possible to call a method on an object by a string?
<BlaXpirit> there is no good reason not to use it, unless you're missing some of Array's functionality
<jhass> anyway, I think I made my point, I'd love to see the specialized stuff in well maintained external libraries and have the default tools only in stdlib
<jhass> Netfeed: no, at best you can write a macro that dispatches to a method by generating a (huge) case when
<BlaXpirit> deque is an extremely powerful tool that very many languages have in standard library
<Netfeed> jhass: too bad
zamith has quit [Quit: Be back later ...]
<jhass> Netfeed: keep in mind that there's no runtime, what call should crystal generate if it doesn't know what method to invoke at compile time?
<Netfeed> would have made stuff easier for me right now though :P
<jhass> use Ruby :P
<Netfeed> that's not an option :)
<Netfeed> i think that the vim extensions lags if you strings that is too long
<Netfeed> haha, yeah, something is wrong, 13% cpu usage moving around in a file that's 84 rows :P
waj has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vscrD
<crystal-gh> crystal/master 410ae60 Ary Borenszweig: Fixed definition of LibC.printf, and use C aliases in some places. Fixes #1243
waj has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vscKd
<crystal-gh> crystal/master 438b760 Ben Miller: MatchData: give default arguments to begin, end......
<crystal-gh> crystal/master 1c5b880 Ary Borenszweig: Merge pull request #1241 from bjmllr/begin0...
havenwood has joined #crystal-lang
Rishav has quit [Ping timeout: 246 seconds]
waj has joined #crystal-lang
NeverDie has joined #crystal-lang
ryanworl has joined #crystal-lang
ssvb has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
ryanworl has quit [Ping timeout: 246 seconds]
russolsen has joined #crystal-lang
russolsen has quit [Client Quit]
blue_deref has joined #crystal-lang
avdi has joined #crystal-lang
<avdi> OK, installing Crystal for the first time
<jhass> \o/
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<avdi> seriously, there's an Ubuntu repo? This is too easy. I insist you make it harder.
<avdi> next you're going to tell me there's already an Emacs mode
<jhass> uhm
<jhass> ?emacs
<DeBot> jhass: Nothing known about emacs.
<jhass> shit
<jhass> ?emacs=https://github.com/jpellerin/emacs-crystal-mode
<DeBot> jhass: Set emacs.
<jhass> avdi: how about ^ :P
<avdi> TOO EASY
<avdi> trying a new language should make me hate my life
<BlaXpirit> consider malbolge
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grios has joined #crystal-lang
elia has joined #crystal-lang
waj has quit [Remote host closed the connection]
Ven has joined #crystal-lang
NeverDie has joined #crystal-lang
<jhass> mmh wonder if we can abuse this to get a 32bit build http://docs.travis-ci.com/user/docker/
<BlaXpirit> if i were to guess, i'd say yes
<BlaXpirit> hmm there is not much info on 32 bit containers
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
NeverDie has joined #crystal-lang
NeverDie has quit [Max SendQ exceeded]
NeverDie has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
strcmp1 has joined #crystal-lang
<BlaXpirit> sure took me a long time to understand that the sort does the magic
<BlaXpirit> i would've gone for some kind of set
waj has joined #crystal-lang
<crystal-gh> [crystal] BlaXpirit opened pull request #1246: Add Deque (double-ended queue) (master...deque) http://git.io/vsW04
<jhass> avdi: <3
shama has joined #crystal-lang
lmarburger has joined #crystal-lang
leafybas_ has quit []
leafybasil has joined #crystal-lang
<asterite> avdi: nice! It seems Ruby is much faster on linux than on darwin, at least on my machine I get slower results with Ruby
<avdi> I forgot to even check which version of Ruby I was using :-/
elia has joined #crystal-lang
<avdi> I'm intrigued by the potential for writing Ruby native extensions in Crystal instead of C
elia has quit [Client Quit]
<asterite> Yes, that could work. But Crystal has its own GC, so I'm still unsure about that idea
<avdi> ah, good point
<asterite> Not that it's not possible, it's just that a program with more than one GC sounds... odd
<asterite> (or slow :-))
<avdi> or explodey
<avdi> still, it seems like a natural fit if you could find a way to make it work
elia has joined #crystal-lang
<asterite> We have a proof of concept: https://github.com/manastech/crystal_ruby
<asterite> It works. But someone should compare the performance against a C implementation
<asterite> On the other hand, if you write your extension with care, for example trying to avoid memory allocations, then it will probably be good enough, and (probably) easier to maintain than a C extension
<asterite> That crystal_ruby is also a proof of concept for macros, because in https://github.com/manastech/crystal_ruby/blob/master/sample/test_ruby.cr a macro (ruby_extension) transforms that class definition to define it via Ruby's C API, etc.
<asterite> but there's no need to go that far to do it :)
<willl> You could make sure to manually hold a reference when passing something up to ruby, so it doesn't get gc'd
<asterite> Yes, I guess we'd need something like GC.pin / unpin
elia has quit [Client Quit]
<willl> it's a little cumbersome, but probably not too bad, especially compared to the C alternative :)
<jhass> and if we do the macro it probably could do it
blue_deref has quit [Quit: bbn]
<avdi> are kwargs coming?
<jhass> kwargs are already there for arguments with a default value
<jhass> >> def foo(a, b=nil, c=nil); p({a, b, c}); end; foo(1, c: 2, b: 3)
<DeBot> jhass: {1, 3, 2} - more at http://carc.in/#/r/c2a
<avdi> interesting
<jhass> there's debate on whether to expand that to required args too or introduce completely distinct syntax for kwargs like Ruby did
<BlaXpirit> it seems to me like just allowing all arguments to be passed through keyword is far superior
<BlaXpirit> and i fail to see how any other option is nearly as good
<BlaXpirit> btw jhass, python 3 has required named arguments as well
<jhass> yes, I'm on that side too
<jhass> (if you read the issues I linked)
<BlaXpirit> jhass, i see that you want "allowing all arguments to be passed through keyword"
<BlaXpirit> but it's not exactly python-style anymore
<BlaXpirit> because python 3 has required named arguments as well def f(x, y=5, *, z): # z is required to be passed by name
<jhass> ah well, not sure we really need that
<jhass> if we allow for all arguments to be passed by keyword
<BlaXpirit> jhass, people brought up the point that sometimes it's important to disallow some things to be passed positionally
<BlaXpirit> in python i often tripped myself up in re.search(regex, string, max=None, flags=0)
<BlaXpirit> i tried to call it as re.search(regex, string, flags) and it worked... wrong
<jhass> idk, just make a habit out of using keyword call semantics then?
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass> let the caller decide and not be forced to the library authors preference
<avdi> in some cases this will be mitigated by type checking
<BlaXpirit> max, flags are both integers in my example though
<avdi> But personally I have less and less use for positional args, except with splats
zamith has joined #crystal-lang
<BlaXpirit> but it's just a crummy old API in python, not a good example
<crystal-gh> [crystal] will opened pull request #1247: Env (master...env) http://git.io/vslJR
<avdi> I'm leaning more and more towards "default to keywords, consider positional for some cases"
<avdi> in my own code, I mean
<avdi> Yay for explicitness
etrepat has joined #crystal-lang
etrepat has quit [Remote host closed the connection]
Codefriar has joined #crystal-lang
<crystal-gh> [crystal] PragTob opened pull request #1248: Sort iterator methods (master...sort-iterator-methods) http://git.io/vslnQ
elia has joined #crystal-lang
elia has quit [Client Quit]
shama_ has joined #crystal-lang
ddfreyne_ has quit [Ping timeout: 244 seconds]
willl has quit [Ping timeout: 244 seconds]
shama has quit [Ping timeout: 244 seconds]
[spoiler] has quit [Ping timeout: 244 seconds]
shama_ is now known as shama
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
willl has joined #crystal-lang
shama has joined #crystal-lang
ddfreyne_ has joined #crystal-lang
[spoiler] has joined #crystal-lang
<avdi> gotta say, I was very impressed how easily that code ported over
<avdi> I half expected to run into trouble with the Hash default proc
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: http://git.io/vsljX
<crystal-gh> crystal/master 4d35089 Ary Borenszweig: Use (and fix) C aliases in all lib definitions. Related to #823
<crystal-gh> crystal/master e32dcec Ary Borenszweig: Remove unused "pid" file (funcionality already present in Process)
<crystal-gh> [crystal] jhass opened pull request #1249: 32bit linux build using docker on Travis (master...docker_travis) http://git.io/vsljd
<travis-ci> manastech/crystal#e32dcec (master - Remove unused "pid" file (funcionality already present in Process)): The build was broken. https://travis-ci.org/manastech/crystal/builds/76523102
<asterite> avdi: luckily that's the only type annotation. I think most of the time they are in array/hashes constructors, captured blocks, and that's it
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vs8q4
<crystal-gh> crystal/master c903aa6 Ary Borenszweig: Fixed curses sample
elia has joined #crystal-lang
grios has quit [Read error: No route to host]
_whitelogger has joined #crystal-lang
havenwood has quit [Ping timeout: 265 seconds]
blue_deref has joined #crystal-lang
waj has quit [Remote host closed the connection]
BlaXpirit has quit [Quit: Konversation]
sleeper is now known as sleeper_
hangyas has joined #crystal-lang
<hangyas> btw I like BlaXpirit's deque
hangyas has quit [Client Quit]
<dzv> how do you set a breakpoint on a crystal method?
<dzv> using lldb
n0xff has quit [Remote host closed the connection]
elia has quit [Quit: Computer has gone to sleep.]
havenwood has joined #crystal-lang
NeverDie has joined #crystal-lang
elbow_jason has joined #crystal-lang
blue_deref is now known as jhats
jhats has quit [Quit: bbn]
zamith has quit [Quit: Be back later ...]