<FromGitter>
<fgimian> thanks, I'll go with that approach
<FromGitter>
<fgimian> ๐
<FromGitter>
<fgimian> (sorry for the late reply, work stuff happened ehe)
dom96 has quit [Ping timeout: 240 seconds]
dom96 has joined #crystal-lang
dom96 has joined #crystal-lang
dom96 has quit [Changing host]
TCZ has joined #crystal-lang
greengriminal has joined #crystal-lang
TCZ has quit [Quit: Leaving]
TCZ has joined #crystal-lang
TCZ has quit [Quit: Leaving]
That_Guy_Anon has quit [Ping timeout: 265 seconds]
pabs has quit [Ping timeout: 264 seconds]
akaiiro has quit [Remote host closed the connection]
pabs has joined #crystal-lang
akaiiro has joined #crystal-lang
<FromGitter>
<Blacksmoke16> say i wanted to sort an array of objects by the index of a property in another array
<FromGitter>
<Blacksmoke16> e.x.
<FromGitter>
<Blacksmoke16> each obj has a name property and the other array could be like `["name1", "name2", "name3"]`
<FromGitter>
<Blacksmoke16> but could be like `[{name: "name2", ...}, {name: "name1", ...}, {name: "name3", ...}]`
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<svs> Is it possible to have value objects in Crystal. I want to define classes like AgeFilter, HealthFilter, StatusFilter but I don't want to write an == operator in each class. I would like them to be value objects so that Crystal will return true for equality if all their values are the same, not by object id. Alternatively, is there such a comparison operator?
<FromGitter>
<svs> super! convert the attributes to a hash and compare that
<FromGitter>
<svs> Also....how do I solve this problem? โ โ ``` b.sort_by{|_b| order.index(_b["x"])}``` โ โ Array#index returns `Int32|Nil` but sort_by return `Int32`.....how do I cast the `Int32|Nil` to an `Int32` and is this idomatic? [https://gitter.im/crystal-lang/crystal?at=5b18b00e52e35117cd13f789]
That_Guy_Anon has joined #crystal-lang
That_Guy_Anon has quit [Quit: Leaving]
akaiiro has quit [Remote host closed the connection]
<FromGitter>
<bararchy> @CaDs cool! Did you run the tests to see where Raze stands?
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<CaDs> @bararchy I did run the test in my local environment. Raze used to be faster than Kemal a year ago or so, but since is no longer maintained (as far as I know) is falling behind both Kemal and Amber in speed.
<FromGitter>
<CaDs> I'm thinking about adding both Lucky and Spider Gazelle as well, but the setup is more complex so it might take some time
<FromGitter>
<bararchy> @CaDs if so, what would be the point on adding yet another web framework and especially unmaintained one into a place where people look to choose the next lang/framework ?
<FromGitter>
<bararchy> Isn't it harmful to Crystal as it just shows low performance and unmaintained code
<FromGitter>
<bararchy> (Lucky does make sense to add)
return0e has quit [Ping timeout: 264 seconds]
return0e has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
rohitpaulk has joined #crystal-lang
<crystal-gh>
[crystal] ysbaddaden pushed 1 new commit to master: https://git.io/vhEPW
<crystal-gh>
crystal/master 068edc4 asterite: Compiler: ensure parentheses inside assign value
<FromGitter>
<CaDs> @bararchy in the particular case of Raze I think it is interesting to showcase that framework, I really liked their middleware-based approach. Last commit was 4 month ago so there is still some activity going on there. โ Also I thought it might be good to let people know about the different alternatives when choosing a framework for Crystal and TechEmpower might be a good place to do it. โ โ I don't think
<FromGitter>
<hmans> "4 months ago" doesn't sound too bad. Young ecosystems don't always move fast
<FromGitter>
<bararchy> Yeha
<FromGitter>
<bararchy> I only call something dead after 1y
<FromGitter>
<hmans> It's a difficult metric. I have some *really* small open source projects that haven't received commits for 2 years simply because they're "done". Also because I've been defending them against feature-creep pull request from strangers who wouldn't adhere to the contribution rules in my README which clearly stated to contact me first about changes.
<FromGitter>
<hmans> (So I could say "no" to them. :b)
<FromGitter>
<j8r> @CaDs About Raze I've a hard time to contact @samueleaton to review https://github.com/samueleaton/raze/pull/17 - too bad because the project is nice ๐ . Some specs are also missing
<ben___>
Benchmarks are just benchmarks... Don't let us talk about to much. But, Round 16 is again a unbelievable gap to really good software - to Crystal :) I am thinking again about two different things; the first: is it because mostly of the needed is still poorly written in Crystal or is it morely, because the others are optimised, optimised, optimised? (I know, it's somewhere between;) The second: has someone run the big
<ben___>
performers (please without h2o) "at home" against Crystal? Is there the same gap? I am NOT reducing Crystal here, i am morely: whats needed to be done to become more between :) What's about parallelism on that? Like Golang coroutines? Some opinions? :)
<FromGitter>
<bararchy> As RX14 said, the issue (biggest one) with Crystal benchmarks are the DB driver
<FromGitter>
<bararchy> it needs to be improved
<crystal-gh>
[crystal] bcardiff opened pull request #6165: Update to latest distribution-scripts (master...ci/update-dist-0.25) https://git.io/vhEDP
<FromGitter>
<CaDs> yep, pretty much that
<FromGitter>
<sdogruyol> DB drivers are hard to optimize :)
<FromGitter>
<CaDs> yes, that is also true :D
<FromGitter>
<sdogruyol> 1) ORMs that use them
<FromGitter>
<sdogruyol> plus
<FromGitter>
<bararchy> #6165 yammm were almost at 0.25 :)
<ben___>
@sdogruyol thanks, yes, i am on the road, too :) i need Crystal for future projects, because it's exactly the concept I am waiting for so long - but, Crystal looks easy but is much - much - to learn :) i am hard on this way :)
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter>
<sdogruyol> enjoy the ride :)
rohitpaulk has quit [Ping timeout: 256 seconds]
rohitpaulk has joined #crystal-lang
<ben___>
I do :)
<FromGitter>
<sdogruyol> also please share the Crystal love โค๏ธ
<ben___>
And now i need someone who teaches me/us more about sql and the driver :p :)
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
<ben___>
Ok, better go little steps, but, if there would be some people like me - wish to do but need help of others for that, maybe it's getting easier if we know where we want to work on together ;)
<FromGitter>
<schoening> @bew โ โ > @schoening if you have an IO operation or a sleep or a channel send/receive, it could change. Otherwise, no it won't change. (because Cr is not parallel) โ โ Ah.. Yes I do have IO + sleep. So that is probably why I get some errors. [https://gitter.im/crystal-lang/crystal?at=5b18f578b6eece791de75c70]
<ben___>
@schoening: IO and sleep doesn't produce errors, they made it possible for the scheduler to switch to a waiting fiber, but if a fiber is working and working and working the scheduler wouldn't switch to another in the queue; waiting for IO does this, sleep does this, Fiber.yield does this and the channels are involved :)
<FromGitter>
<schoening> I think what I mean to say is that I got a hash and occasionally a key got deleted and I still tried accessing it ^^
<ben___>
seems complex, how many fibers are working exactly on this?
<FromGitter>
<schoening> Just one. Its the gameloop that runs in a fiber. With a sleep so I dont block the websockets. But I added @game_objects.has_key? all the places where I think it was needed.
<ben___>
What is the exactly error message?
<ben___>
What type is key? And @game_objects?
<FromGitter>
<schoening> missing key. another one I often get is broken pipe from websockets, but I think that one isnt causing errors. But I havent seen the error since yesterday so thats nice
<ben___>
Ok, but if the error stays, it could be hard in the future - we should try to find ;)
<ben___>
Could you detect the error morely when the browser closed the socket or while running?
<FromGitter>
<schoening> I dunno, I have a socket.on_close handler. But I will say when I find the error message again :D
<FromGitter>
<ok2094> what are the :: for in module names and such?
<crystal-gh>
[crystal] bcardiff pushed 1 new commit to master: https://git.io/vhENS
<crystal-gh>
crystal/master 97e7043 Brian J. Cardiff: Update to latest distribution-scripts (#6165)...
<ben___>
@ok2094 namespace in opposite to methods via object.method etc. with . dot :) but the profs can help here much more :)
<ben___>
@schoening: in my simple opinion i am awaiting that error in @game_objects while/after closing a socket; maybe helpful to look at it and start / close several browsers and sockets :) it may be possible that your fiber is not timed correct to the socket.on_close handler - think on Crystal is one-threaded yet :) maybe helpful to p simple messages: opening socket closing socket adding socket closing socket in websocket
<ben___>
implementation and @game_objects to follow them :)
<FromGitter>
<schoening> Good idea :) I will try out the browser closing.
<ben___>
Yes :) It could help to know the type of key, because it's easier to understand where it can be broken ;)
<ben___>
And please use several browsers because of some different implementations - just could be better ;)
<ben___>
And 2 or 3 tabs could be helpful
<ben___>
Sorry, many ideas: please close a browser with 2 or 3 active game tabs too - could be helpful ;)
<ben___>
I am sure we do not exactly understand your message :)
<FromGitter>
<schoening> Yeah, sorry about that. โ I tested out my server. But I think it crashes because my remove connection runs out lol... Not sure how to run a crystal process outside of a terminal. In Node I use PM2
<ben___>
@schoening nice :) could be better to get help from the professionals here :)
<ben___>
HELP ๐
<FromGitter>
<schoening> Haha
<ben___>
What happens that this happens? Can u reproduce?
<ben___>
@j8r is a professional too - can you help, Julien?
<FromGitter>
<schoening> Refreshing a couple of browser windows. โ But I didnt get a "diconnected" message in the terminal. So the client disconnected, but seems still to exist. Gonna try and reproduce locally
<ben___>
Sometimes stupid things are stupid ๐ป
sz0 has quit [Quit: Connection closed for inactivity]
TCZ has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
<ben___>
Guys, maybe, my brain is out of water, but, where could be the point to rescue / ensure to make this did not happen (connection reset by peer)? @schoening have you some kind of exception handling at these points?
<FromGitter>
<schoening> The server actually doesnt exit on the error, it just sort of breaks stuff. I think I have to make a minimal version to test..
<FromGitter>
<j8r> I see in your errorr `unbuffered_read` and other buffer, fd things. We can dig on this
<FromGitter>
<schoening> Thank you, this does look like you are on to something! โ I tried reproducing the error bug havent been able to locally so far.
rohitpaulk has joined #crystal-lang
<FromGitter>
<bararchy> @j8r at last I integrated `hardware` shard into our solution, it works really well :)
TCZ has quit [Quit: Leaving]
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter>
<schoening> @j8r hmm I read through the thread but I can't really see how it helps me since I do #write_bytes and #to_slice
<FromGitter>
<j8r> I don't know how to fix your error. We also haven't all your code
<FromGitter>
<j8r> @bararchy great :-D Tell me if there are features you need, I may continue the work. For disk space, I don't know. I thinks I will need to split out libc from crystal and create a shard because https://github.com/crystal-lang/crystal/pull/6056 was rejected
<FromGitter>
<schoening> Yeah I am trying a minimal version to see if I can reproduce the error and share it ^^
<FromGitter>
<j8r> You have probably missed to specify something with the fibers
<FromGitter>
<j8r> I would be great to have a place where all(or most) LibC functions are implemented, like in Rust or Go https://github.com/rust-lang/libc
duane_ has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
greengriminal has joined #crystal-lang
faustinoaq has quit [Ping timeout: 256 seconds]
<FromGitter>
<schoening> Just gotta post a link here, coz that usually forces my server to crash, so I can see if the bug is fixed. โ http://46.101.168.60:3000/index.html
<ben___>
I found the bycyles are really nice, too :)
<ben___>
@bararchy web socket client in Crystal or other one? :)
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzzโฆ]
<ben___>
Shorten other one oo so nobody knows :)
duane has joined #crystal-lang
GoldenBear has joined #crystal-lang
duane_ has joined #crystal-lang
duane has quit [Ping timeout: 264 seconds]
faustinoaq has quit [Ping timeout: 265 seconds]
<FromGitter>
<schoening> @bararchy lol ok, im down, lets try, just ping me when you have time.
<FromGitter>
<schoening> At that point either gc will cry or the client will crash haha
TCZ has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
pabs has quit [Ping timeout: 260 seconds]
Creatornator has joined #crystal-lang
pabs has joined #crystal-lang
<ben___>
@schoening at 10k Crystal is morely sleeping as working, so if you not have an error you can go sleeping while this, too ;)
<FromGitter>
<schoening> @ben___ connections yes, but not the game loop / the client might get fried since I send an arraybuffer with info about every game object 20 times per second. 10.000 players + maybe 50.000 bullets in a worse case. Might get a bit much for the client or the collision detection ^^ I would like to get 1000 players per server tho.
<ben___>
@schoening ah ok, fine, so you need @bararchy to tune the best results and logic :)
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzzโฆ]
TCZ has quit [Quit: Leaving]
duane_ has quit [Ping timeout: 260 seconds]
bbobb has quit [Quit: bbobb]
Elfryskai has joined #crystal-lang
Elfryskai has quit [Quit: Quit]
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #crystal-lang
That_Guy_Anon has quit [Quit: Leaving]
greengriminal has joined #crystal-lang
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzzโฆ]