ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
jokke1 has quit [Ping timeout: 250 seconds]
jokke1 has joined #crystal-lang
<hightower2> I asked above about the sample code to use macros to fill a buffer and dump it into a location later. I found that referenced code at https://play.crystal-lang.org/#/r/3npv
<FromGitter> <paulcsmith> According to the shards doc I can include -rc1 in the version, but it doesn't seem to work. I did set the version and tagged it for this repo: https://github.com/luckyframework/habitat/blob/master/shard.yml
<FromGitter> <paulcsmith> In a lib trying to use it I have: `version: 0.3.0-rc1` but it says "Failed to resolve" when trying to isntall it. Any ideas?
<FromGitter> <bew> Your tag has a `v` before the version
<FromGitter> <bew> So you need to use: `version: v0.3.0-rc1` I guess
<FromGitter> <paulcsmith> I tried that to no avail :( That seems to be the way to tag things. Where the tag has a `v` but in the shard.yml it doesn't
<FromGitter> <paulcsmith> Maybe rc isn't actually supported
<FromGitter> <bew> Then try to put the v everywhere, see if it because it must be the same everywhere
<FromGitter> <bew> RX14: trying another solution for https://stackoverflow.com/questions/50288944/parse-complex-yaml-structure-with-yaml-mapping, and the execution timed out: https://play.crystal-lang.org/#/r/4287 any idea what could have gone wrong?
<FromGitter> <bew> I know the mapping is wrong, I fixed it with a nilable type for `device` in `SingleModelMobile`, but it shouldn't just go to an infinite loop!
<FromGitter> <paulcsmith> Ah, here is an open issue: https://github.com/crystal-lang/shards/issues/184 looks like it is not supported with `version`. Must use `tag` instead
<FromGitter> <bew> oh right nice catch
<FromGitter> <bew> RX14: hmm it seems to time out only in carc.in, works instantly (I get a YAML parsing error)
<FromGitter> <girng> is there something more lightweight than json for client->server communication for gaming? can't use msgpack cause godot doesn't have a module. im doing something like ⏎ https://play.crystal-lang.org/#/r/428i/edit ⏎ ⏎ and in benchmarks, it does 5million iterations per second, compared to a struct using from_json (which is around 370,000 per second) [https://gitter.i
<FromGitter> ... m/crystal-lang/crystal?at=5af63fa75a1d895fae330cd1]
<FromGitter> <girng> but, for example, if i do `cmd:message`. how do i split the message into their own values? for example, sending `x` and `y` values in there
<FromGitter> <bew> what? you can make your own protocol, but cannot use msgpack? what's the logic?
<FromGitter> <girng> cmd, new_message = message.split(':') only accounts for the second split, what if there is x,y in the `message`. i want to do ⏎ `cmd, new_message, x, y = message.split(':')` or something
<FromGitter> <bew> or is this `a:b, c:d` 'protocol' already handled by godot
<FromGitter> <girng> nope, just something i made up t hat's way faster than json
<FromGitter> <girng> using crystal's built in .split method
<FromGitter> <bew> so, will it work with godot?
<FromGitter> <bew> if there is no module for it
<FromGitter> <girng> yeah, for sure godot has split n similar methods in crystal, actuallly
<FromGitter> <girng> i need to get it done in crystal first just not sure how
<FromGitter> <girng> let me make an example with comments, 1 second :)
sz0 has joined #crystal-lang
<FromGitter> <girng> @bew https://play.crystal-lang.org/#/r/428p
<FromGitter> <Blacksmoke16> dynamically mean what? will the format of the cmd/message always be like that?
<FromGitter> <girng> yah, foreach command will have very strict format. if anything invalid or user sending naughty data, i close connection
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/428z ?
<FromGitter> <Blacksmoke16> or am i missing something
<FromGitter> <girng> ohhhh, junst another .split
<FromGitter> <girng> aww i see. i need to check this benchmark again, since using multiple splits. i thought i only had to do .split once
<FromGitter> <Blacksmoke16> or maybe like
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<FromGitter> <bew> @girng you can do `"1:2:3".split(':', limit: 2)`
<FromGitter> <bew> => `["1", "2:3"]`
Yxhuvud has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/429f
<FromGitter> <Blacksmoke16> regex ftw
<FromGitter> <girng> wow, using a second split, in the benchmark, makes split go from 5M/per second, to 3.17m
<FromGitter> <Blacksmoke16> how about the regex match?
<FromGitter> <girng> 1 sec
<FromGitter> <girng> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5af64731d332ee5fad109bcf]
<FromGitter> <girng> code here: https://paste.ee/p/FJaBj
<FromGitter> <Blacksmoke16> id prob just use the regex so its easier to read dont have to do any extra processing
<FromGitter> <Blacksmoke16> at what point does the extra speed become negligible?
<FromGitter> <girng> that im not sure. im contemplating on just doing json.parse...
<FromGitter> <girng> it's so much easier lol
<FromGitter> <Blacksmoke16> yea really
<FromGitter> <Blacksmoke16> sure its 4x slower but does that actually matter?
<FromGitter> <girng> i just get worried, cuz it's going to be be parsed 15times a second, dependent how many players are moving in a map
<FromGitter> <Blacksmoke16> get a prototype then do some benchmarking
<FromGitter> <Blacksmoke16> wont really know till then
<FromGitter> <girng> okok
<FromGitter> <Blacksmoke16> :shrug: is what i would do :p
<FromGitter> <girng> well i do have this vps i bought i could use it for this testing i guess :D
<FromGitter> <girng> although, its running on 500MHz :rofl:
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
gizmore|2 has joined #crystal-lang
gizmore has quit [Ping timeout: 256 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
<FromGitter> <girng> screw all of this
<FromGitter> <Blacksmoke16> yolo
hightower2 has quit [Ping timeout: 264 seconds]
Cyrus has joined #crystal-lang
pn-max has joined #crystal-lang
<pn-max> hey, is there any way to create a subclass instance from a superclass instance ?
<pn-max> automatically, I mean
hey_there__ has joined #crystal-lang
pn-max has quit [Remote host closed the connection]
pn-max has joined #crystal-lang
pn-max has quit [Remote host closed the connection]
hey_there__ has quit [K-Lined]
pn-max has joined #crystal-lang
<FromGitter> <girng> hmm so im doing ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ to read data that is sent from godot's put_utf8_string https://github.com/godotengine/godot/blob/b48cc669e29ba149664b1e1d6003e112f19a9dff/core/io/stream_peer.cpp#L211 ... [https://gitter.im/crystal-lang/crystal?at=5af66a611cfca775e101ab5b]
bmcginty has quit [Ping timeout: 265 seconds]
bmcginty has joined #crystal-lang
pn-max has quit [Ping timeout: 264 seconds]
pn-max has joined #crystal-lang
<pn-max> oh! sorry, only read a bit of the conversation but are you using godot w/ crystal ?
<FromGitter> <girng> yah
<pn-max> nice, using GDNative somehow ? wanted to get into it
<FromGitter> <girng> the stream data from godot is coming in, and working nice. but if sent at an interval, it hiccups. im not sure if i'm reading the stream data correctly
<FromGitter> <girng> nah im just using gdscript lol
<FromGitter> <girng> i am not getting myself involved with c++, im too stupid
<pn-max> Oh, alright! I was saying gdnative because apparently it can be used to create bindings to any language with C FFI
<pn-max> there are already bindings for D, apprently
<pn-max> how are you sending the stream ? curious if you don't mind
<FromGitter> <girng> from godot, i just use: `streampeer.put_utf8_string(JSONDATA)`
<FromGitter> <girng> and in crystal, I read that ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5af67225d245fe2eb7a452b8]
<FromGitter> <girng> I originally was using Int32, but the hiccups were more prevalent, so I switched to a `UInt32` and the hiccups seem less
<FromGitter> <girng> I think this is because the put_utf8_string (https://github.com/godotengine/godot/blob/b48cc669e29ba149664b1e1d6003e112f19a9dff/core/io/stream_peer.cpp#L211), sends an unsigned bit into the stream
<pn-max> thanks, reading
<FromGitter> <girng> not a signed one. however, I am still getting tiny hiccups and not sure where that's coming from
<pn-max> maybe try sending with another crystal program so you can determine whether GDscript is the culprit or not
<FromGitter> <girng> good ida
<pn-max> I would love a sound prod library for crystal, that would be rad
pn-max has quit [Remote host closed the connection]
pn-max has joined #crystal-lang
DTZUZO_ has quit [Ping timeout: 240 seconds]
alex has joined #crystal-lang
<FromGitter> <girng> this is what the hiccup looks like (https://i.gyazo.com/610ceceda3faa073542287603e315182.gif) ⏎ crystal code for tcpsocket: https://paste.ee/p/J3l2c ⏎ so it's not a godot problem actually, it's still happening even if it's using crystal
<FromGitter> <girng> why do those hiccups happen?
<FromGitter> <girng> happens even when sleep is 0.1
pn-max has quit [Ping timeout: 256 seconds]
<Groogy> you mean the messages? Can't that just be the terminal?
<FromGitter> <girng> @groogy what ithought, but its not. something internal is going on i think. if you see my gif on my github issue, the left terminal is what its supposed to look like
<FromGitter> <girng> iuno how to investigate it further >_<
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
hightower2 has joined #crystal-lang
Groogy has quit [Quit: WeeChat 2.1]
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
sz0 has joined #crystal-lang
alex has quit [Ping timeout: 255 seconds]
alex has joined #crystal-lang
<FromGitter> <girng> i created a github issue in WSL https://github.com/Microsoft/WSL/issues/3186 hopefully maybe a microsoft dev can chime in too
pn-max has joined #crystal-lang
<oprypin> ...
rohitpaulk has joined #crystal-lang
<FromGitter> <girng> i think something inside read_bytes, is bugging it out on WSL only
DTZUZO_ has joined #crystal-lang
braidn[m] has quit [*.net *.split]
Renich has quit [Ping timeout: 255 seconds]
kixune[m] has quit [Ping timeout: 246 seconds]
fifr[m] has quit [Ping timeout: 246 seconds]
byteflame has quit [Ping timeout: 255 seconds]
kp666[m] has quit [Ping timeout: 255 seconds]
cptaffe has quit [Ping timeout: 256 seconds]
olbat[m] has quit [Ping timeout: 276 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
olbat[m] has joined #crystal-lang
ssvb has joined #crystal-lang
pn-max_ has joined #crystal-lang
hightower3 has quit [Ping timeout: 240 seconds]
byteflame has joined #crystal-lang
fifr[m] has joined #crystal-lang
braidn[m] has joined #crystal-lang
kp666[m] has joined #crystal-lang
Renich has joined #crystal-lang
cptaffe has joined #crystal-lang
kixune[m] has joined #crystal-lang
<pn-max_> p sure this is just what the windows terminal does
<pn-max_> have you tried with another terminal
<pn-max_> on windows I mean
<pn-max_> To investigate further, I suggest you actually use the values to render something graphical and see if you do see a hiccup there instead
<FromGitter> <KINGSABRI> hello guys, do you have a plan to migrate the official doc (https://crystal-lang.org/docs/) to the new gitbook ?
olbat has quit [Ping timeout: 260 seconds]
alex has quit [Quit: WeeChat 2.1]
<FromGitter> <fridgerator> Someone mentioned in here the other day, I don't remember the outcome
wrq has joined #crystal-lang
<oprypin> KINGSABRI, anyone can do it, including you
pn-max_ has quit [Remote host closed the connection]
pn-max has quit [Remote host closed the connection]
<FromGitter> <wrq> can macros throw compile time errors?
<oprypin> {%raise
<oprypin> "string"
<FromGitter> <wrq> also, can macros look into a declared enum and see the different variants? I want a reason to get my hands dirty with macros, and I was thinking a very simple pattern matching macro for enums only might be a neat little thing to do
<FromGitter> <wrq> but I don't see EnumLiteral in Crystal::Macros
<FromGitter> <wrq> and the TypeDeclaration section doesnt seem to mention it
<oprypin> variants?
<oprypin> enum is not a literal but a language construct
<FromGitter> <wrq> idk the enum values
<FromGitter> <wrq> the rhs of enum cases
<FromGitter> <wrq> so macros and enums wont mix?
<FromGitter> <wrq> I see, thank you
hightower3 has joined #crystal-lang
hightower3 has quit [Ping timeout: 260 seconds]
<FromGitter> <evandrojr> Hi guys ```macro define_method(name, content) ⏎ def {{name.id}} ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=5af729d9e1cf621dba1491f4]
<FromGitter> <evandrojr> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5af72a015666c42eb606fb82]
<FromGitter> <evandrojr> This macro create a method that does not accept parameter
<FromGitter> <evandrojr> How do I create a macro that creates a method with parameters? please
<FromGitter> <evandrojr> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5af72a71862c5e33e92cc993]
<FromGitter> <evandrojr> Like
<FromGitter> <evandrojr> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5af72ad2a2d951363334f5ba]
<FromGitter> <evandrojr> but it does not work
<FromGitter> <evandrojr> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5af72b6a1cfca775e103703c]
<FromGitter> <evandrojr> but it does not work
snsei_ has quit [Remote host closed the connection]
<FromGitter> <bew> @wrq also maybe checkout #5903. Why do you need the values of the enum members?
<DeBot> https://github.com/crystal-lang/crystal/issues/5903 (Restrict Enum values to numerical expression & Allow value access from macro )
commavir has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 260 seconds]
alex`` has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/42ei
<FromGitter> <Blacksmoke16> @evandrojr
rohitpaulk has joined #crystal-lang
<crystal-gh> [crystal] j8r opened pull request #6092: Rename Dir.rm/mkdir to delete/create (master...dir-rename) https://git.io/vpSy1
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
snsei has joined #crystal-lang
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 240 seconds]