michael_campbell has quit [Quit: ZNC 1.6.1 - http://znc.in]
poikon has joined #crystal-lang
<FromGitter>
<redcodefinal> I like that its circularly compiled. Crystal is written in Crystal. Too neat.
pawnbox has joined #crystal-lang
<FromGitter>
<redcodefinal> I've always taken issue with Ruby's internals because I don't know C well enough to make things work at that level. It's nice that I can just look at the language work in the language it's written in.
pawnbox has quit [Remote host closed the connection]
Fichtenstein has quit [Quit: Fichtenstein]
hako has quit [Ping timeout: 260 seconds]
hako has joined #crystal-lang
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 260 seconds]
shawn42 has joined #crystal-lang
ponga has joined #crystal-lang
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 250 seconds]
Raimondi has quit [Ping timeout: 244 seconds]
lacour has quit [Quit: Leaving]
kulelu88 has joined #crystal-lang
mark_66 has joined #crystal-lang
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
bjz has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
<FromGitter>
<mverzilli> I used to think annotating return types when you know what you wanted to return was always a good idea, but in time I realized it's not. For each explicit type annotation you add to your code you loose a bit of polymorphism, which means in the future it'll be more cumbersome to refactor your code. The only situation where I think it's certainly advantageous is when you're writing boundary code: the top level facade for your
<FromGitter>
... lib's API, for example. There's no risk of "someone changing something down the road and then their stuff no longer works" when there's no return annotations. The compiler has your back on that.
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BlaXpirit>
so i'm trying to use macros to write a line like this `@{{name}} : {{type}} | typeof({{default}}) = {{default}}` which ends up as something like `@password : String | typeof(nil) = nil` but Crystal says `can't use 'typeof' here`. is there any alternative?
<BlaXpirit>
RX14, what do you think about this special case `":john!~jsmith@example.com PRIVMSG #test :\u{1}ACTION test\u{1}"`- should it perhaps be made more convenient than just `@params=["#test", "\u{1}ACTION test\u{1}"]` in your fast_irc library?
<crystal-gh>
[crystal] ysbaddaden pushed 1 new commit to master: https://git.io/vXW8b
<FromGitter>
<choallin> Hi guys! After reading "The book" I have a question about concurrency/parallelism. It is mentioned that real parallelism isn't availible yet and in the roadmap it is also not marked. Is there a priority for this? If so, are there any plans when this will be released/done? ⏎ I am talking a look to crystal because I want to implement a messaging server for several hundred users. Maybe more. Is crystal yet an option for such a
<FromGitter>
... use case or should I ditch it for now and use something else?
<crystal-gh>
[crystal] sdogruyol opened pull request #3499: Fix wrong macro generation when LLVM --built-targets returns only one on OS X (master...master) https://git.io/vXWar
<FromGitter>
<sdogruyol> @choallin it's ok for that
<BlaXpirit>
choallin, concurrency works, you don't need parallelism for I/O bound applications
<FromGitter>
<choallin> That's great to hear! :smile: Are there any tutorials that you would recommend for writing a http server?
<FromGitter>
<philnash> Just poking around the HTTP Server and I was wondering something.
<FromGitter>
<benoist> Hey Phil :)
<FromGitter>
<philnash> Why do we have the HTTP::Server::Context rather than simply passing a request and response object to a HTTP::Server::RequestProcessor?
<FromGitter>
<philnash> `HTTP::Server.new(port) do |request, response|`
<FromGitter>
<benoist> If i’m not mistaken this got changed recently to distinguish client request and responses vs server requests and responses
<Papierkorb>
Why even separate the request and response?
<FromGitter>
<benoist> I suppose because there is a lot of overlap between requests and responses for instance headers
<FromGitter>
<philnash> It makes sense to have the two separate to me, I was just considering other environments (Node.js primarily)
<FromGitter>
<benoist> you would have to do request_headers and response_headers instead of request.headers and response.headers
<FromGitter>
<philnash> (I love how readable the standard lib source is btw :) )
<FromGitter>
<benoist> Yeah having a std lib written in the same language is very nice (compared to ruby’s for instance)
<FromGitter>
<philnash> I think Ruby's std lib is written in Ruby, just the core is C
<Papierkorb>
it's so and so. Not big of a deal though if you're using Pry
<FromGitter>
<benoist> it’s mixed a lot
<FromGitter>
<benoist> thats what makes it a bit messy
<FromGitter>
<philnash> Well, I've enjoyed peering through Crystal's so far.
<FromGitter>
<benoist> Well we can finally send sms messages so thats enjoyable too :)
<Papierkorb>
was always just a HTTP request away, so..
<FromGitter>
<philnash> 🎉
<FromGitter>
<philnash> I'm writing up making phone calls too right now. That's why I'm looking at the server for a bit.
<FromGitter>
<philnash> Though will probably move fairly swiftly to Kemal for now.
<Papierkorb>
What do you mean "making phone calls" - Are you implementing SIP+RTP, or WebRTC, or something else?
<FromGitter>
<benoist> oh yeah thats definitly a good idea
<FromGitter>
<philnash> Eww no :D with the Twilio API
<FromGitter>
<benoist> kemal just makes it easier to get started
<FromGitter>
<philnash> I mean, maybe one day, but this is a simple blog post
<FromGitter>
<philnash> I wanted to show the HTTP::Server just because it is quite understandable. Then introduce shards and then Kemal
<FromGitter>
<phoffer> You’re doing another blog post? I just read the sms one in fact :) Any thoughts of writing a client?
<FromGitter>
<philnash> Yeah, trying to follow up on that one quickly
<FromGitter>
<philnash> thanks for reading!
<FromGitter>
<philnash> I'll probably start to put together a simple client
<crystal-gh>
[crystal] jhass closed pull request #3480: Fix wrong result in YAML docs (master...patch-4) https://git.io/vXIqX
<FromGitter>
<philnash> thing is, we have a ridiculous number of APIs these days :D
mark_66 has quit [Remote host closed the connection]
<FromGitter>
<philnash> The internal teams have got around to generating our official clients using a tool they wrote and our own internal dictionary of the API methods
<FromGitter>
<philnash> So building a fully featured one is hard work these days!
<FromGitter>
<philnash> If there's any feedback on my blog post, I'd love to hear it btw
Philpax has quit [Ping timeout: 260 seconds]
<FromGitter>
<phoffer> Cool, excited to see that post. I really liked the first, it includes a lot of little every day type things, posting a request, using basic auth, json mapping, etc. Great for people both familiar and not familiar with Crystal. One note, the `--release` got turned into a `—`. Just in case someone gets lazy as they follow along
<FromGitter>
<philnash> argh! I saw that with `--version` too
<FromGitter>
<philnash> damn WordPress
<FromGitter>
<philnash> Fixed, thanks!
<FromGitter>
<phoffer> Great idea to make a repo out of that too
<Papierkorb>
Could we add scheme question methods for popular ones, like HTTP(s), mailto, tcp, ...?
<Papierkorb>
How do I correctly wait for a UDP datagram to arrive on a #connect'ed UDPSocket with a timeout?
<Papierkorb>
I can do the ol' spawn{ ch.send socket.read } with a timeout fiber, but if the timeout triggers the #read fiber keeps running forever :(
<Papierkorb>
IO.select to the rescue
<FromGitter>
<jwoertink> What would be an example of why you would want to use a `record`?
<FromGitter>
<johnjansen> record?
<BlaXpirit>
jwoertink, it's just to avoid boilerplate. it gives a lot out of the box
<BlaXpirit>
struct with fields and types, all corresponding properties, initialize with optional defaults, equals+hash
optikfluffel has quit [Read error: Connection reset by peer]
<FromGitter>
<jwoertink> So a record has to match up with some defined struct?
<Yxhuvud>
it also was a tuple replacement before we had those
<BlaXpirit>
jwoertink, `record` is literally a macro that writes out `struct` and the `initialize` and a bunch of `property`s
<FromGitter>
<jwoertink> ah
<FromGitter>
<jwoertink> Ok, that makes sense then
<FromGitter>
<jwoertink> thanks
sustained has quit [Ping timeout: 265 seconds]
<FromGitter>
<philnash> Is it better to use `shards install` or `crystal deps`?
<FromGitter>
<philnash> Oh, `crystal deps` delegates to `shards install`
<FromGitter>
<philnash> I'll stick with shards
<FromGitter>
<benoist> well crystal deps is included when you install crystal
<FromGitter>
<philnash> isn't shards included when you install crystal?
<FromGitter>
<benoist> yeah thats what I meant :)
<FromGitter>
<philnash> So we're all correct! Good stuff!
Fichtenstein has joined #crystal-lang
Raimondi has quit [Write error: Broken pipe]
Raimondi^1 has joined #crystal-lang
Raimondi^1 is now known as Raimondi
Raimondi has quit [Write error: Broken pipe]
Raimondi has joined #crystal-lang
gloscombe has quit [Remote host closed the connection]
_whitelogger has quit [K-Lined]
_whitelogger has joined #crystal-lang
<BlaXpirit>
johnjansen, well what do you want to do with the file? is it really text with malformed utf-8 or just random bytes
<FromGitter>
<johnjansen> @BlaXpirit i think its UTF16 actually
<BlaXpirit>
..
<FromGitter>
<johnjansen> those are the first 2 bytes of the file
<BlaXpirit>
johnjansen, yep seems like it
<FromGitter>
<johnjansen> so im trying to find a parsing approach ...
<BlaXpirit>
well everything in the File class has an encoding argument, so use it
<FromGitter>
<johnjansen> bloody hell … always the obvious ;-)
<FromGitter>
<johnjansen> thats the problem with looking but not seeing
emancu has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<FromGitter>
<johnjansen> You know, this is an excellent community, everyone here is so helpful. Crystal is a beautiful language, but the community really makes the experience wonderful, so thanks to everyone !!
<FromGitter>
<redcodefinal> @johnjansen Yeah it's nice, I wrote an alpha transparency paste for stumpy_png and wrote a pull request for it and the dude who wrote the shard wrote a big thing of fixes and refactoring changes I can do for it. Plus the people here are very nice. It is great since we don't have the kind of online resources that other languages have right now, so the community is the best information source.
[spoiler] has quit [Ping timeout: 244 seconds]
jeromegn__ has joined #crystal-lang
jeromegn_ has quit [Read error: Connection reset by peer]
jeromegn__ is now known as jeromegn_
greenbigfrog has quit [Remote host closed the connection]