<FromGitter>
<Willamin> Is there a general opinion or vision for shard size? More specifically
<FromGitter>
<vlazar> just don't do it a node way? :)
<FromGitter>
<Willamin> Right. In the JS world, single function packages aren't frowned upon. I was wondering how this community felt about it
<FromGitter>
<Willamin> Personally, I don't mind them, but wanted to get some other opinions :D
<FromGitter>
<vlazar> the situation in node is most likely coming from the fact stdlib in JS is too small and buggy
<FromGitter>
<vlazar> with great stdlib in Crystal we wouldn't end up with too many small shards anyways I think
greengriminal has quit [Quit: Leaving]
jeet has quit [Ping timeout: 240 seconds]
<FromGitter>
<rishavs> Is there a way to attach a variable/data hash to the Http::Server Response? I want to create a data passing mechanism which dies with the context.
<FromGitter>
<rishavs> Something akin to passing a store object through the coontext in the node/react world
<FromGitter>
<Willamin> It might not be the *best* way, but you can always reopen the HTTP::Server::Response class and add your data hash as needed. Probably only do that as a last resort
<FromGitter>
<rishavs> I am kinda scared of trying that. I was hoping we had something like a an ibuilt `add` method 😄
<FromGitter>
<bendietze_twitter> @bararchy you need a "server" who manage the connections and "client/s" who is/are bounded, or? But i never tested send and receive in one socket :) And why sleep 10? :)
<FromGitter>
<bararchy> well, at least they have "foods"
lvmbdv has joined #crystal-lang
<FromGitter>
<bararchy> XD
<Groogy>
^^
DTZUZO has joined #crystal-lang
<Groogy>
though right now working on making tiles smaller in smaller-tiles branch and let entities occupy several tiles at once. It will help some game design decisions and make some things simpler but it sure as hell is making rendering way harder xD
rohitpaulk has joined #crystal-lang
<FromGitter>
<sdogruyol> how's the performance in general?
<FromGitter>
<bararchy> Groogy do you render on a 2nd Thread?
<Groogy>
nope, tthere's no threads yet in crysttal is there?
<Groogy>
also performance is generally good so far
<RX14>
whats the point of something if you have to go out of your way and code on a tightriope to not make it segfault?
<RX14>
cast fails? segfault
<RX14>
not_nil! fails? segfault
<FromGitter>
<bararchy> Well, I didn't say its good, just said it can be used in *certain* situations hahaha
<FromGitter>
<bararchy> I do prefer proper working multi-threading using spawn Fiber/Channel but I use what I can
rohitpaulk has quit [Ping timeout: 265 seconds]
<FromGitter>
<bararchy> RX14 nice job on windows file dir spec
<RX14>
yeah nice job failing CI
<RX14>
fixed now though :)
jeet has quit [Ping timeout: 260 seconds]
<RX14>
I need to fix the stdlib specs running slowly
<RX14>
used to be a quick 10 second smoketest
<RX14>
now it takes ages like 30 seconds
<FromGitter>
<valamorgon> how can I parse nested json string to hash?
<RX14>
what d you mean by "nested"
<RX14>
the resulting hash needs a type
rohitpaulk has joined #crystal-lang
<FromGitter>
<valamorgon> I meant I have a json string which array of object, which also has properties that are object or arrays etc.
<RX14>
if it has a schema (thing usually do), then use JSON.mapping
jeet has joined #crystal-lang
<FromGitter>
<bararchy> @valamorgon could it be you're just talking about JSON.parse ?
<FromGitter>
<valamorgon> @bararchy the propblem with json.parse is it returns json::any
<FromGitter>
<bararchy> @valamorgon and you want a predefined class/object to work with? If so use what RX14 suggested
<FromGitter>
<valamorgon> can I loop it after crystal 25.0 ? or can I add new key value to it?
<FromGitter>
<valamorgon> I actually want to use lazy hashes like in javascript
<FromGitter>
<valamorgon> but maybe not possible
<FromGitter>
<bararchy> You can go over it recursively, using .is_h? Or is_a? Etc..
<FromGitter>
<bararchy> Make sure you use 0.25.1 so .clone and .dup will work :)
<FromGitter>
<valamorgon> I actually used to_h but it didnt work for me when I tried to add a new k,v as string string
<RX14>
at the end of the day, crystal is typed and you're going to have to change how you code in it
<FromGitter>
<valamorgon> then I saw .hash(hasher) so I thought maybe there is a simple way to achive it
<RX14>
it's rare that JSON.mapping is impossible to use
<RX14>
after all, there must be a schema or your code couldn't understand it
<FromGitter>
<valamorgon> yeah but it could understand hash right? but there is no way to convert it to hash currently?
<RX14>
not in exactly the same way as 0.24.2, no
<RX14>
you get a Hash(String, JSON::Any)
<RX14>
but JSON::Any isn't a good thing anyway
<RX14>
JSON.parse should go, you should have to use JSON::Any.from_json, and the docs should be updated to show JSON::Serializable front and center with JSON::Any as a footnote
<RX14>
JSON::Any is still needed but it's not a good place to start for most people
akaiiro has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter>
<j8r> Since we are talking about, can we have a partial mapping of a json file?
<FromGitter>
<j8r> I've for example a list, but the elements inside can change. Or even at the top level, there are always-here keys but other can be also present
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
<crystal-gh>
[crystal] asterite opened pull request #6307: Fix: missing codegen cast from metaclass union to virtual metaclass (master...bug/6298-cast-metaclass-union-to-virtual-metaclass) https://git.io/fwKnT
wontruefree has joined #crystal-lang
nobbi has joined #crystal-lang
nobbi has quit [Client Quit]
akaiiro has quit [Remote host closed the connection]
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
<FromGitter>
<trans> The problem is when the keys are customizable by the user. There is no way to know what the value type might be.
<FromGitter>
<rishavs> What does this operator means? `||= `Just noticed them in Lucky's context extender
rohitpaulk has joined #crystal-lang
<FromGitter>
<fridgerator> memoize
<FromGitter>
<fridgerator> sets the variable, unless it is already set
<FromGitter>
<rishavs> thanks
<Yxhuvud>
rishavs: x ||= y is basically expanded to x || x = y
<FromGitter>
<rishavs> Thanks! got it now
jeet1 has joined #crystal-lang
jeet has quit [Ping timeout: 248 seconds]
<RX14>
no, it's x = x || y
<RX14>
as in if x is already set (not falsey), it's x, otherwise initialize it with y
jeet2 has joined #crystal-lang
jeet1 has quit [Ping timeout: 260 seconds]
<FromGitter>
<asterite> It's actually what they said before
<FromGitter>
<asterite> The assignment is done only if x is falsey
<crystal-gh>
[crystal] kostya opened pull request #6308: replace mapping with serializable in compiler (master...remove_using_mapping_in_compiler) https://git.io/fr9kA
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
snsei has quit [Ping timeout: 256 seconds]
alex`` has quit [Quit: WeeChat 2.1]
<FromGitter>
<velddev> hey hey! dows anyone here know how to downgrade crystal?
<FromGitter>
<j8r> Depends of your system @velddev
<FromGitter>
<j8r> You can also download whatever release of crystal and use it (or add in the `PATH`)