jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 260 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 240 seconds]
apotheon has quit [Ping timeout: 240 seconds]
apotheon has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 244 seconds]
Oliphaunte has joined #crystal-lang
matp has quit [Ping timeout: 264 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
matp has joined #crystal-lang
soveran has joined #crystal-lang
matp has quit [Remote host closed the connection]
pduncan has quit [Ping timeout: 250 seconds]
pduncan has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Read error: Connection reset by peer]
Oliphaunte has joined #crystal-lang
pduncan has quit [Ping timeout: 250 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
bjz has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
datanoise has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
datanoise has quit [Quit: Textual IRC Client: www.textualapp.com]
the_drow has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Client Quit]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
bjz has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 265 seconds]
onethirtyfive has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/v63K1
<crystal-gh> crystal/master a3df4d8 Ary Borenszweig: Compiler: invoke `map_type` earlier
<crystal-gh> crystal/master 671ecb3 Ary Borenszweig: Compiler: make sure to hold the invariant to never shrink types. Fixes #3104
bjz has joined #crystal-lang
onethirtyfive has quit []
zodiak has quit []
the_drow has quit [Quit: This computer has gone to sleep]
<travis-ci> crystal-lang/crystal#671ecb3 (master - Compiler: make sure to hold the invariant to never shrink types. Fixes #3104): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/150371673
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
the_drow has joined #crystal-lang
chrisrbnelson has joined #crystal-lang
<FromGitter> <mosop> anyone knows a “Crystal vs Ruby cheetsheets” site? for example, attr_reader in Ruby is similar to getter macro in Crystal.
<the_drow> Has anyone attempted doing this before? https://github.com/crystal-lang/crystal/issues/3107
chrisrbnelson has quit [Ping timeout: 250 seconds]
Oliphaunte has joined #crystal-lang
<the_drow> I know crystal_ruby and it looks nice (although not done yet and it needs help)
<the_drow> I'm talking about porting the module itself to crystal
Oliphaunte has quit [Ping timeout: 240 seconds]
onethirtyfive has quit [Remote host closed the connection]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
<jhass> the_drow: As I noted we already have HTML.escape
<jhass> and URI.escape and URI.unescape
<jhass> so I guess you'd be missing HTML.unescape?
<FromGitter> <mosop> @jhass thanks!!
<BlaXpirit> any way to find out if `initialize` is being called from code or from a side effect like `new` or `super` ?
<jhass> doesn't the compiler just inject method definitions for new?
<BlaXpirit> well i'm more concerned about `super`
<BlaXpirit> nope, this makes absolutely no sense and i shouldn't be doing this
<the_drow> jhass, Oh really? Cool. Yes I am I guess
<jhass> should be easy enough to add, give it a shot?
<jhass> the hardest part will be parsing the &#; entity stuff
<BlaXpirit> ugh, need to hardcode a list of entities?
Oliphaunte has joined #crystal-lang
<jhass> well, for the "pretty" names, I don't see a way around it
Oliphaunte has quit [Ping timeout: 260 seconds]
<the_drow> jhass, I might later on. I'll update the issue anyway
sardaukar has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
pawnbox_ has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
Redfoxmoon has quit [Read error: Connection reset by peer]
Redfoxmoon has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
Raimondi^1 has joined #crystal-lang
Raimondii has quit [Ping timeout: 240 seconds]
Raimondi^1 is now known as Raimondi
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
RinkanaZ has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
<FromGitter> <Rinkana> How can i run a function on a var if the var is not nil. I've tried ```@example.call(data) unless @example.nil?``` but it still throws errors
<FromGitter> <Rinkana> Nvm, found it: ```@example.try &.call(data)```
<BlaXpirit> well this is sad. can't have two `crystal run` or `crystal eval` running at the same time
<BlaXpirit> files get overwritten
soveran has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> @BlaXpirit what are you trying to achieve?
<BlaXpirit> run two crystal programs and see the diff of their outputs
<BlaXpirit> tried running them in parallel to save time
<FromGitter> <sdogruyol> tough one
<FromGitter> <sdogruyol> :)
RinkanaZ has quit [Ping timeout: 250 seconds]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
the_drow has quit [Quit: This computer has gone to sleep]
Oliphaunte has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] jeromegn opened pull request #3108: Can't parse enum from upcase word (master...patch-1) https://git.io/v63QK
<jhass> BlaXpirit: well, that should be fixable
<jhass> just gotta randomize the temp dir
<BlaXpirit> well it's a cache dir, not a temp dir, part of the point is that the dir has a reproducible name
<BlaXpirit> to speed up next compilation
<jhass> guess we could just hash the fullpath and append
<BlaXpirit> for crystal run it definitely should be randomized and then removed
<BlaXpirit> for crystal eval it definitely should be randomized and then removed
<BlaXpirit> for run not sure
<jhass> well, eval just writes to a tempfile and then fallsthrough to run iirc
<BlaXpirit> yes but it always creates a folder named 'eval' in the cache folder, whereas all the other names are absolute paths
<BlaXpirit> kinda solved this for myself by specifying a custom cache folder
<BlaXpirit> (a different one for each of the runs)
the_drow has joined #crystal-lang
the_drow has quit [Quit: This computer has gone to sleep]
<jhass> perhaps it's enough to use the basename of the output_filename at https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/command/eval.cr#L20 ?
<jhass> for the eval case anyway
the_drow has joined #crystal-lang
Oliphaunte has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 252 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 258 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
sardaukar has quit [Remote host closed the connection]
PCLine__ has joined #crystal-lang
<FromGitter> <GuneshRaj> Hi, has anyone experience any issues with Crystal and MySQL on OSX El-Capitan?
<FromGitter> <GuneshRaj> I cant seem to compile a simple app with mysql bindings
<FromGitter> <Rinkana> I've never even used an DB connection in crystal.
<FromGitter> <Rinkana> But what errors do you get?
<FromGitter> <GuneshRaj> Apparently in ElCapitan, soft linking a path to /usr/lib is non permitted
<FromGitter> <GuneshRaj> So, I had a include the link in the clang compile command -L
<FromGitter> <GuneshRaj> dl -L/usr/lib -L/usr/local/lib -L/usr/local/mysql/lib/ ⏎ Undefined symbols for architecture x86_64: ⏎ "_main", referenced from: ⏎ implicit entry/start for main executable ⏎ ld: symbol(s) not found for architecture x86_64 [https://gitter.im/crystal-lang/crystal?at=57a74f87483751d50f310902]
<FromGitter> <GuneshRaj> gives me this error after adding the path:
A124 has joined #crystal-lang
<FromGitter> <Rinkana> That's quite odd
<FromGitter> <GuneshRaj> Its running the latest MySQL Community and has the 64bit dylib as well.
<FromGitter> <Rinkana> It is indeed the El Capitan security "feature"
<FromGitter> <Rinkana> You can disable that feature if you want but it is better if you submit an issue and request that not /usr/lib is used but /usr/local
sardaukar has joined #crystal-lang
<FromGitter> <GuneshRaj> I don't mind these features but crystal does not seem to allow -L type flags in the build command, kinda makes it hard to maintain 2 different variables for Lib Path
<FromGitter> <GuneshRaj> Im curious, what do you use Crystal for @Rinkana ?
<FromGitter> <Rinkana> General testing applications. For me there is no need for DB connections
<FromGitter> <Rinkana> And most DB connectors are third party atm
<FromGitter> <GuneshRaj> cool, Im just building a case to migrate from Go to Crystal
Oliphaunte has quit [Remote host closed the connection]
<FromGitter> <Rinkana> Ah great
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<FromGitter> <Rinkana> What kind of case are you building if i may ask?
<FromGitter> <GuneshRaj> We are planing to rebuild some of our systems / platforms. we started to migrate from Java to Go-Lang about a year ago.
<FromGitter> <GuneshRaj> I feel Crystal may be a better fit, well until it hits 1.0
<jhass> GuneshRaj: Crystal should respect the LIBRARY_PATH environment variable and you can pass the -L flag via the --link-flags option to crystal build
<jhass> we're really just calling your system linker
pawnbox has quit [Remote host closed the connection]
the_drow has quit [Quit: This computer has gone to sleep]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
william__ has joined #crystal-lang
<william__> does crystal emit code at some level before llvm that is deterministic? like: if you compile the same program twice, you get the same object code file exactly?
Oliphaunte has quit [Ping timeout: 264 seconds]
crystal-lang164 has joined #crystal-lang
<crystal-gh> [crystal] Rinkana opened pull request #3111: [WIP] HTTP::Client middleware (master...http_client_middleware) https://git.io/v6seP
pawnbox has quit [Remote host closed the connection]
william__ has quit [Ping timeout: 250 seconds]
PCLine__ has quit [Ping timeout: 250 seconds]
trapped has joined #crystal-lang
juki_9087 has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
juki_9087 has quit [Quit: Page closed]
trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
<BlaXpirit> hm why wouldnt it be deterministic after llvm
ponga has quit [Quit: Connection closed for inactivity]
<jhass> not sure if it still holds, but afaik type ids are randomized
the_drow has joined #crystal-lang
pawnbox has joined #crystal-lang
Crizkov has joined #crystal-lang
<Crizkov> Hello, Crystal community!
<FromGitter> <Rinkana> hi
<Crizkov> Would be great if Crystal and Kemal can be in the top of these benchmarks ---> https://www.techempower.com/benchmarks/
<Crizkov> I think that techempower will do another test soon, because the repo of benchmarks was updated. @sdogruyol I'm curious for kemal results
<Crizkov> In the top are tool and languages as Go(Iron), Urweb, Postgres, Java (Spark), Colossus (Scala) :-)
<Crizkov> *Rust(Iron)
<Crizkov> Ruby(rails), Django(Python), PHP(Laravel || Symphony) are at the end. ---> https://www.techempower.com/benchmarks/
<Crizkov> ;-)
Crizkov has quit [Quit: Page closed]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 276 seconds]
<FromGitter> <sdogruyol> Crizkov: well it'll be above Node for now
<FromGitter> <sdogruyol> will be at top lines once we get parallelism
xmgx has joined #crystal-lang
soveran has joined #crystal-lang
<jhass> they left already
<FromGitter> <sdogruyol> hehe
soveran has quit [Remote host closed the connection]
<FromGitter> <williamsharkey> Not sure if this feature would be good, but have people considered example based typing for empty arrays? Like, instead of ⏎ ``` ⏎ [] of Int32 ⏎ [] eg 5 [https://gitter.im/crystal-lang/crystal?at=57a77e8b857442dc0f5b3733]
<FromGitter> <Rinkana> But why would you want to do that?
<FromGitter> <Rinkana> If you have an default value you can do ```[5]``` and it works
<FromGitter> <williamsharkey> How would you declare an empty array that can have types of int, string and nil?
<FromGitter> <sdogruyol> by using a Union Type
<FromGitter> <sdogruyol> [] of Int32 | String | Nil
<FromGitter> <williamsharkey> I don't know, but I think it would be easier to say `arr = [] eg ["hello", 5, nil]`
<FromGitter> <sdogruyol> ```[] of Int32 | String | Nil``` is definitely simpler
<FromGitter> <Rinkana> But ```[] of Int32 | String | Nil``` is way more logical as it precicly tells you what you store
<FromGitter> <williamsharkey> Ok, I didn't realize it was that simple.
<BlaXpirit> >> Array(typeof("hello", 5, nil)).new
<DeBot> BlaXpirit: # => [] - https://carc.in/#/r/16fl
<BlaXpirit> >> [] of Int32 | String | Nil
<DeBot> BlaXpirit: # => [] - https://carc.in/#/r/16fm
<FromGitter> <williamsharkey> I think the main reason to not add something like example based typing for empty arrays is that it adds complexity without adding much value. I think that it is equally as precise and logical as anything else that uses type inference, though. I wouldn't be surprised if there are instances where typing the out the type signature of an empty array is tedious, and it would be easier to use examples that are in scope, but it
<FromGitter> ... would be up to me to find an example. Thanks for the feedback.
<BlaXpirit> williamsharkey, well i showed you how to do it "example based"
<BlaXpirit> >> [7] of typeof("hello", 5, nil)
<DeBot> BlaXpirit: # => [7] - https://carc.in/#/r/16fo
<BlaXpirit> >> [true] of typeof("hello", 5, nil)
<DeBot> BlaXpirit: no overload matches 'Pointer(Int32 | String | Nil)#[]=' with types Int32, Bool - https://carc.in/#/r/16fp
<FromGitter> <williamsharkey> Thanks, Blaxprit, I did not understand originally. It is exactly what I had in mind. Thanks
<FromGitter> <williamsharkey> It speaks to the power of this language that my random request is fulfilled so naturally. brillant
<FromGitter> <williamsharkey> Is there a common workflow that is used when someone wants inspect emitted code? Like if I want to test two alternate syntaxes and confirm that they compile to the same thing? Do people inspect llvm or is there a more human readable way to do it?
<BlaXpirit> inspect llvm
<FromGitter> <Rinkana> You can also do ```crystal play```
<BlaXpirit> i don't think it's relevant
<FromGitter> <Rinkana> You can enter the code in your browser and it will tell you the compile time info
<RX14> jhass, re #3075, what do you mean by false positive?
<jhass> 123::0:3000 parsed as {"123::0", 3000}
<RX14> whats so wrong about that?
Oliphaunte has joined #crystal-lang
<FromGitter> <sdogruyol> isn't that a wrong address by itself?
tim has joined #crystal-lang
<jhass> nope
<RX14> well you could create a valid example
<jhass> it's actually valid
<BlaXpirit> jhass, it is not valid
<jhass> not just assigned
<jhass> just not*
<jhass> 2001::0:3000 if you feel any better then
<RX14> regardless, i don't think it's an issue
<jhass> it's easy enough to prevent
<RX14> eh i dunno
the_drow has quit [Quit: This computer has gone to sleep]
<RX14> maybe check the host fragment contains : and doesn't start with [, if so return the raw host string?
jhass has quit [Excess Flood]
<RX14> is that enough?
jhass has joined #crystal-lang
<jhass> sounds like you need to run twice through it, or once anyway, like I currently do in the worst case
<jhass> what's the problem with checking it really?
<RX14> just seems excessive
<RX14> more complex code to maintain
<RX14> if you delegate to URI, speed issues
<RX14> if you use regex, holy speed issues
<jhass> in my code it's unless index; ...; else return; end; instead of ...;
<jhass> that's all
<RX14> which code?
<jhass> the one I benchmarked
<RX14> how do i know what you benchmarked?
<jhass> yes
<RX14> you didn't link your code next to the benchmark
<jhass> well, why would I write a new version for the benchmark
<RX14> do we really need to allocate a string for to_i
<BlaXpirit> if I have an output stream, in crystal i use stream << "stuff"
<BlaXpirit> if I have an input stream that can produce different types, how do I implement and name that operation?
<BlaXpirit> i've been thinking like x = stream.read(String)
<BlaXpirit> or x = (stream >> String)
pawnbox has quit [Remote host closed the connection]
<BlaXpirit> but it's not really satisfactory
<BlaXpirit> in c++ they write String s; stream >> s
pawnbox has joined #crystal-lang
tim has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 276 seconds]
<jhass> there's Int32.from_io
<BlaXpirit> hm nice. though adding to standard types is not applicable in my case
<BlaXpirit> that allowed me to find this though https://github.com/crystal-lang/crystal/blob/f104e7a8/src/io.cr#L724
<FromGitter> <benjaChomin_twitter> as knowing all the information that returns the context of HTTP :: Server :: Context?
sardaukar has quit [Quit: Leaving]
sardaukar has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
sardaukar has quit [Quit: Leaving]
Oliphaunte has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
<crystal-gh> [crystal] CodeSteak opened pull request #3113: Fix #1663 for HTTP::WebSocket::Protocol.read_size (master...websock-length-fix) https://git.io/v6sGj
triangles has quit [Quit: Leaving]
Oliphaunte has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <CodeSteak> Hey, is there a way to call private functions in specs besides monkeypatching? (It try to write a spec for https://github.com/crystal-lang/crystal/pull/3113)
matp has joined #crystal-lang
<BlaXpirit> :(
Philpax has joined #crystal-lang
<FromGitter> <steakknife> Is there some way to do #if __SIZEOF_INT__ == 4 ... #elseif __SIZEOF_INT == 8 ... #else #error #endif in cr lib decls?
<jhass> steakknife: what for? Note we have a platform specific alias at LibC::Int
<FromGitter> <steakknife> That's the answer then. Thanks.
<jhass> CodeSteak: well, ideally you would observe the changed behavior from the public interface?
<jhass> private methods should be implementation details and behavior asserted from the public interface
<FromGitter> <CodeSteak> @jhass then I would have to pass more than 64kb to test the payload length :/
<jhass> read it from a fixture file or generate it?
<FromGitter> <CodeSteak> than i will generate some. Thanks :D
trapped has quit [Ping timeout: 276 seconds]
Dreamer3 has joined #crystal-lang