pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<A124>
johnjansen : To catch up on previous time. (I did reply to the PM but late)
<A124>
Hey, thanks! Well, I'm talking dozens to hundreds of requests/connections parallel. HTTP is a go-to example for crawling. I will read up and try to compare those three languages as precisely as possible. The core will stay at go, for now, but I'm looking into future of processing and extracting data, where we look forward to have widespread web assembly adoption, but for the smaller data [...]
<A124>
[...] processing crowd a balance of language, speed, and concurrency is the key. The talk is about IPFS, and several other things that some people refuse to change and move away from python, as well emerging. Sorry to take your time by this commentary and other stuff, I appreciate your time.
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Philpax has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
hmans has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
mark_66 has joined #crystal-lang
davidbackeus has joined #crystal-lang
HakanD____ has joined #crystal-lang
davidbackeus has quit [Client Quit]
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
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
onethirtyfive 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
ponga has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
HakanD____ is now known as HakanD
soveran has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
HakanD has quit [Quit: Be back later ...]
HakanD has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bjz has joined #crystal-lang
HakanD has quit [Ping timeout: 256 seconds]
HakanD has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
<Papierkorb>
Is this a bug? When the other end of a TCPSocket closes the connection, a #read always returns `0`. It does not raise any error, also there's no IO#eof? :(
<Papierkorb>
So I don't know if the IO has been closed, I have to guess based on the result of #read, and I have to remember that everytime I use it
snsei has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
sfcgeorge has joined #crystal-lang
HakanD_ has joined #crystal-lang
HakanD has quit [Read error: Connection reset by peer]
HakanD__ has joined #crystal-lang
HakanD_ has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
sfcgeorge has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RX14>
Papierkorb, yes thats the point
<RX14>
if read returns zero that IS EOF
<Papierkorb>
That's a subtle way to produce bugs
<RX14>
no it's not
<Papierkorb>
that's not "great"2
<RX14>
it's simple
<RX14>
it's how unix works
<RX14>
read blocks
<RX14>
when it's EOF it returns zero
<Papierkorb>
I want to ask it before if it's EOF
<Papierkorb>
even C can do it.
<Papierkorb>
and there's EOFError, but it's not used in that case? That's weird too
<RX14>
no
<RX14>
EOFError is used for other commands
<Papierkorb>
that's just not consistent
<RX14>
#read is the low level interface
<RX14>
it has to be fast
<RX14>
Papierkorb, there isn't a reliable way to test if a socket is open or closed other than reading or writing from it even in C
<A124>
Actually if the remote does close normally, you know it is closed, no? If not, you cannot know.
<RX14>
yes but what use if eof? if using read after it could return EOF anyway
<Papierkorb>
And I stand by it. A "if size == 0" is too slow .. what? We just did a SYSCALL, a context switch, and now a single branch instruction is too much?
<RX14>
it's a leaky abstraction over TCP at least
<RX14>
Papierkorb, no, raising exceptions are slow
<RX14>
exceptions should be an exception
<RX14>
reaching eof is not exceptional
<RX14>
you have to check the return value of read anyway to determine what of your slice is valid
<RX14>
so handling size == 0 is easy to remember
<RX14>
you might want #read_fully instead
<Papierkorb>
it doesn't work with sockets if it has to wait for the buffer to fill up
<RX14>
yes, I said you *might* want read_fully
<RX14>
depending on wat you're doing
<RX14>
if you need x bytes to do anything with you might as well use read_fully
<RX14>
if you want to handle bytes as they come use #read
pawnbox has joined #crystal-lang
pawnbox_ has quit [Read error: Connection reset by peer]
<Papierkorb>
Great help. "You *might* do something that won't work"
<RX14>
well which call you use depends on your usecase
<RX14>
thats what I said
<Papierkorb>
which is clearly TCPSockets
<RX14>
I don't *know* your usecase so I can't recommend a call
<RX14>
TCP Sockets isn't a usecase
<RX14>
it's a transport
<RX14>
both calls work on TCP sockets
<RX14>
it's just which works for your usecase
<Papierkorb>
Yeah I don't have time to waste on me being talked down to, sorry.
sfcgeorge has joined #crystal-lang
Crizkov has joined #crystal-lang
<Crizkov>
BlaXpirit: Hi! :raising_hand_man: The SDL issue on Linux is already posted #2695
onethirtyfive has quit [Remote host closed the connection]
Majost has joined #crystal-lang
aarongodin has joined #crystal-lang
mroth has joined #crystal-lang
<FromGitter>
<jwoertink> ooo that's awesome
danzilio has joined #crystal-lang
emmanueloga has joined #crystal-lang
soveran has joined #crystal-lang
eizua has quit [Quit: Leaving]
gloscombe has quit [Ping timeout: 260 seconds]
soveran has quit [Ping timeout: 256 seconds]
gloscombe has joined #crystal-lang
<bmcginty>
Is there any way to use a wildcard macro to catch any function call to an object before compilation? I was going to look into writing an ORM in crystal, but being able to do fn.someNameHere would be very nice...
<bmcginty>
And that's probably in an FAQ somewhere. I'll go read that before asking again.
<Papierkorb>
A `sequel` clone would be much appreciated though...
soveran has joined #crystal-lang
<FromGitter>
<johnjansen> @bmcginity this is not totally relevant, but you may also be interested in https://github.com/sdogruyol/tren
<bmcginty>
Papierkorb: raydf: thanks.
<FromGitter>
<raydf> And remember that https://github.com/crystal-lang/crystal-db is a work in progress :). I believe there's a lot of code left to do related to transactions, direct io and pooling management.
kulelu88 has joined #crystal-lang
<FromGitter>
<fkchang> @sdogruyol thanks for the websockets code snippet the other day, finally got around to working with it, ended up going w/a Hash(Http::Websocket, int32) so I could have the proc.id per socket
<FromGitter>
<fkchang> I still need to verify it works as desired, but at least it compiles and in theory does the right thing