rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<Zenohate> Hello here
<FromGitter>
<Zenohate> I wanted to know what would be thought of changing the way UDP sockets are implemented in Crystal because for now the implementation is extremely slow and low throughput
<FromGitter>
<Zenohate> I was thinking of proposing a variant of receive that may fetch multiple messages, using rcvmmsg on Linux and rcvmsg elsewhere
<FromGitter>
<Zenohate> It has nothing to do with multicasting, it is about minimizing the number of system calls
<FromGitter>
<vladfaust> Ah, sorry, I don't know much about UDP 😅
<FromGitter>
<Zenohate> Basically, for now, with all the tests I did, because Crystal does a system call for every call to receive, and receives packets individually, you are pretty much bottlenecked at around 30k UDP packet received, which is not a lot
<FromGitter>
<Zenohate> The measured latency between receiving and sending back was low enough that we should expect more than thrice that amount
<FromGitter>
<Zenohate> Namely, the time between sending the request and receiving the response was about 3 microseconds
<FromGitter>
<Zenohate> It means the server wastes lots of time between requests
<FromGitter>
<Zenohate> And the place where it happens may only be in system calls that wait to receive new packets
<Yxhuvud>
zenohate: I'd open an issue. Likely, not many people have actually done a lot with UDP so people would likely be open to improvements.
<hoffentlichja>
I was just asking myself the last few days if Crystal already has everything necessary net stack wise, to implement something like a game server in it
_whitelogger has joined #crystal-lang
<FromGitter>
<Zenohate> hoffentlichja: it technically does if your game server doesn't require to handle too much clients
<FromGitter>
<TheOnlyArtz> Isn't it bad to use not_nil?
<z64>
your backend helper as written doesn't quite make sense because you're using instance variables in class methods, so i dont know what the intention is there. refactoring backend helper is also possible
<z64>
maybe you didn't mean to write `def self.foo`, but you could keep that, and simply accept `server` as an argument
<FromGitter>
<TheOnlyArtz> So those `self.` are ruining them?
<FromGitter>
<TheOnlyArtz> makes sense
<z64>
`def self.handle_handshake_client_type(server, message, client)`, and just call `Backend::Helper.handle_handshake_client_type(@server, msg, client)`
<FromGitter>
<TheOnlyArtz> What do you mean not using the getter? I'm literally doing what you've done in your example
<z64>
when you use `getter`, `getter!`, etc, it wraps your access to the ivar in a method that basically does `@foo.not_nil!`, removing `Nil` from the type union. you need to call this method; this doesn't change how using the ivar directly works
<z64>
you need to change `@backend_helper.foo` to `backend_helper.foo`
<FromGitter>
<TheOnlyArtz> Oh yea
<FromGitter>
<TheOnlyArtz> Thank you!
<z64>
yw
<FromGitter>
<TheOnlyArtz> Can I compile crystal to run on Windows?
<z64>
you could. but there is only a very limited set of capabilities; so its probably not useful to you unless you are interested in helping to port the compiler/stdlib
<FromGitter>
<TheOnlyArtz> Looks like the most recent update on that thread was 4 months ago
<FromGitter>
<Maroo-b> Hey, ⏎ I'm getting this error when I try to build Crystal on Ubuntu 18.04 ⏎ `undefined reference to `LLVMInitializeInstCombine'`Any ideas?
<FromGitter>
<Maroo-b> I'm using llvm version 6 for reference
<FromGitter>
<r00ster91> @Maroo-b ah I had that too once. The solution is to use LLVM 6.0.1
<FromGitter>
<r00ster91> there was a regression in 6.0.0
<FromGitter>
<r00ster91> or you simply use an older llvm version
<FromGitter>
<Maroo-b> @r00ster91 thanks! I'll update then to 6.0.1.
<FromGitter>
<Maroo-b> it seems there in no 6.0.1 release for Ubuntu oO
<FromGitter>
<tenebrousedge> @Maroo-b what does crystal --version say about LLVM?
<FromGitter>
<Maroo-b> thank you very much @tenebrousedge it worked :)
<FromGitter>
<tenebrousedge> you're very welcome :)
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
<FromGitter>
<HCLarsen> Hey folks. Does anyone know how to run command line commands in Crystal? Seems to be a lack of documentation around this, but I'm sure it's been done.
<FromGitter>
<HCLarsen> Thanks Rooster. I didn't think to look in the top level namespace.
rohitpaulk has joined #crystal-lang
<FromGitter>
<HCLarsen> That only returns a bool though. What if I want to get the output back as a string?
<FromGitter>
<HCLarsen> Nevermind, found it
RX14 has quit [Quit: Fuck this shit, I'm out!]
RX14 has joined #crystal-lang
_whitelogger has joined #crystal-lang
DmitryBochkarev has quit [Ping timeout: 250 seconds]
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<drum445> What templating engine is most recommended, Jinja is excellent in Python, but that kind of engine doesn't work well in a strongly typed language