<crystal-gh>
[crystal] asterite opened pull request #2761: Inherit class vars (only their type, not their value) (master...feature/class_vars) https://git.io/voJKe
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: https://git.io/voJKU
<crystal-gh>
crystal/master ebd4f3e Celso Fernandes: Fix problem of XML parsing empty html string. Fixes #2752...
<bjhaid>
If I wanted to construct a binary protocol that will be shipped over tcp, what should I use, are there pointers that I can learn how to get it done from?
vikaton has quit [Quit: Connection closed for inactivity]
fridgerator 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
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
mark_66 has joined #crystal-lang
snsei has joined #crystal-lang
icezimm has quit [Quit: Leaving.]
sdogruyol has joined #crystal-lang
zodiak has quit [Ping timeout: 260 seconds]
<sdogruyol>
have a nice week everyone!
zodiak has joined #crystal-lang
snsei has quit [Remote host closed the connection]
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
vikaton has joined #crystal-lang
<vikaton>
How's Crystal doing? :P
bjz has joined #crystal-lang
Raimondii has joined #crystal-lang
bjz has quit [Client Quit]
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
bjz has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
<jhass>
bjhaid: by now quite some docs already do have usage examples, feel free to contribute though! Regarding a binary protocol you should look into `IO#read_bytes` and `IO#write_bytes`
<jhass>
vikaton: very well
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 244 seconds]
<sdogruyol>
vikaton: going strong
trapped has joined #crystal-lang
steenuil has quit [Ping timeout: 272 seconds]
vikaton has quit [Quit: Connection closed for inactivity]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Raimondii has joined #crystal-lang
pawnbox_ has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
pawnbox has quit [Ping timeout: 258 seconds]
vikaton has joined #crystal-lang
Raimondii is now known as Raimondi
<bjhaid>
jhass: thanks!
pawnbox_ has quit [Remote host closed the connection]
bjhaid has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
icezimm has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
bjhaid has joined #crystal-lang
bjhaid has quit [Ping timeout: 250 seconds]
trapped_ has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
trapped_ has quit [Read error: Connection reset by peer]
<crystal-gh>
[crystal] asterite pushed 2 new commits to master: https://git.io/voUHx
<crystal-gh>
crystal/master 5bf717e Ary Borenszweig: Make the `T` in a Proc accessible as a tuple
mgarciaisaia has left #crystal-lang [#crystal-lang]
ryanw-se has joined #crystal-lang
maxpowa has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Raimondii has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
paulcsmith_ has joined #crystal-lang
Raimondii is now known as Raimondi
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/voTrH
<crystal-gh>
crystal/master 1749358 Ary Borenszweig: Experimental support for splat in generic type arguments. Fixes #2754
<jhass>
<3
srabuini has quit [Read error: Connection reset by peer]
sebasr has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
kulelu88 has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
<asterite>
jhass: don't you hate it when a language uses tricks that you can't express with syntax? :-P
<jhass>
totally <3
<asterite>
I think that's what makes Ruby so nice. Like, yes, some things are implemented in C, but you could reimplement almost everything in Ruby
<jhass>
indeed
<jhass>
I guess we indeed should have the same stuff for double splat/named tuple, but I can't come up with a valid usecase to motivate it
<asterite>
Yes... in fact, I originally though it wasn't useful for single splat, until you mentioned Enumerable
<asterite>
and then we could also have CurriedProc if we wanted
<jhass>
it only clicked for me that day too actually
<jhass>
that it would solve the Enumerable problem eventually
paulcsmith_ has quit [Client Quit]
<asterite>
It was always a conflict in my mind... because I imagined we would need splat in yield and splat in block args to do it, but I couldn't express the T in Enumerable
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<asterite>
I also didn't know how to express the ugly `include Enumerable(...)` in Tuple in another way, until Brian mentioned splats
<asterite>
well, and it happened that we added Union recently, so then it clicked
<jhass>
:)
<BlaXpirit>
uhm the excitement sounds nice but I can't quite grasp what you're talking about
<asterite>
:-D
<asterite>
We'll be able to make Hash be an Enumerable
<jhass>
BlaXpirit: simply put, a generic can now take a variable number of type arguments
paulcsmith_ has joined #crystal-lang
TheLemonMan has joined #crystal-lang
<BlaXpirit>
thanks
<asterite>
It was already possible, you can do Proc(Int32, Float64), Tuple(A, B, C), etc... but you couldn't use it in your own types
<jhass>
mh, is Foo(*T, U) and Foo(T, *U) okay already?
<jhass>
now that you mention Proc
<jhass>
which is actually Proc(*T, R) now that I look at it
<jhass>
with *T being 0 or more, not one or more
TheLemonMan has quit [Client Quit]
TheLemonMan has joined #crystal-lang
<jhass>
ah I see he answer is no
TheLemonMan has quit [Client Quit]
<jhass>
might be something for the todo list :)
paulcsmith_ has quit [Client Quit]
<asterite>
Yes, I think we can make it work, should be relatively simple... mmm... in fact, instead of having a "variadic" flag it should be a "splat index" and then it will more or less work
<asterite>
I'll try that too, one of these days
<asterite>
representing Proc like that is better
<jhass>
yay this feels like an important step in the language :)
<asterite>
yeah, it de-hardcodes some things... or at least it feels like that
<jhass>
exactly
TheLemonMan has joined #crystal-lang
<jhass>
is variadic generics even something other languages have at all?
<jhass>
I see a rust RFC
<asterite>
I don't know if other statically typed languages have something similar
<asterite>
Rust doesn't have regular variadic arguments, nor overloads, nor named arguments
<asterite>
they are pretty conservative about this stuff
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
paulcsmith_ has joined #crystal-lang
<jhass>
they mostly compare it to C++ template stuff in the RFC discussion
<jhass>
I also see several people trying to find workarounds for C#
<asterite>
I think the difference in Crystal is that the type argument are carried with the type. In D and C++ they are only available in the template.
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
well nobody wrote extensive docs for it yet, but it's fairly obvious if you've seen a socket API before IMO :)
<jhass>
note that most useful functionality comes via the IO include
<jhass>
and again, if you have a specific question, just ask
<ruslux>
Ssory, I am django-monkey, first try network. How i can read N-bytes from socket?
<ruslux>
Must I read slice, and then convert to io?
<jhass>
do the bytes represent anything specific?
<jhass>
like a 64 bit signed integer?
<ruslux>
*prehistory* I am try write mongodb driver over mongo-wire-protocol, and find elegant method to read data of different types successively
<ruslux>
consistent*
<jhass>
ah, rather than binding to libmongoc?
<jhass>
http://crystal-lang.org/api/IO.html#read_bytes%28type%2Cformat%3AIO%3A%3AByteFormat%3D%3Cspanclass%3D%22t%22%3EIO%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3E%3A%3A%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3EByteFormat%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3E%3A%3A%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3ESystemEndian%3C%2Fspan%3E%29-instance-method might come in handy
<jhass>
socket.read_bytes(Int64).class #=> Int64
<ruslux>
Oh, I am confused. I seen mongo.cr, but missed libmongoc
<jhass>
mongo.cr does bind libmongoc :)
<jhass>
ruslux: btw crystal-pg might have some inspiration for API design, especially since it implements postgres wire protocol too by now
<ruslux>
I doubted. Maybe crystaceans not require yet another mongo-lib...
<jhass>
mongo.cr looks a bit dead tbh
<ruslux>
Anyway, the night brings counsel. Goodnight, crystaceans! (\/)o.O(\/)
ruslux has quit [Quit: Page closed]
snsei has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
crystal-lang451 has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
paulcsmith_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]