ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 268 seconds]
deavmi has quit [Read error: Connection reset by peer]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 268 seconds]
f1reflyylmao is now known as f1refly
deavmi has joined #crystal-lang
<FromGitter> <elebow> Are there any naming conventions for shards without distinctive names? On crystalshards.xyz, I see `foo.cr`, `foo-cr`, `foo-crystal`. ⏎ ⏎ `foo.cr` seems to be most popular, but I think it could invite confusion when discussing a shard vs an individual file. I think I will go with `foo-cr` for brevity without losing clarity, unless there is a good reason to use one of the others.
<FromGitter> <elebow> I should clarify, I mean project names. Not the name in shard.yml, of course.
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Ping timeout: 240 seconds]
<FromGitter> <naqvis> AFAIK there is no standard project naming convention, but Crystal does have coding conventions (https://crystal-lang.org/reference/conventions/coding_style.html). General practice is shards ending with `.cr` represents library integration (C bindings etc), other than that, it all depends on the developer to name a shard
_ht has joined #crystal-lang
sorcus has joined #crystal-lang
deavmi_ has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
mipmip has quit [Ping timeout: 240 seconds]
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 240 seconds]
mipmip has joined #crystal-lang
<FromGitter> <m_33:matrix.org> Hi guys, I am giving crystal a try, what IDE do you recommend ? atom ? or something more specific to crystallang maybe ?
<mps> I use vim
<mps> and not only for crystal but also other languages
<FromGitter> <m33:nitro.chat> nano addict here ;) But I tend to use more and more GUI based editors, for git integration and avoiding constant switching with documentation in the browser and the terminal (eye fatigue)
<mps> maybe gvim could help
<mps> I don't use gvim so don't know for sure
<mps> m33:nitro.chat: ofc, use what is good for you (just told my prefs)
<FromGitter> <m33:nitro.chat> gvim may worth a try thanks
<FromGitter> <Dan-Do> I use vscode, works ok
<FromGitter> <m33:nitro.chat> Dan-Do (ddd): oh, that would be a great opportunity to test both vscode and crystal at once. I've given up on gvim since it is light but don't feel cozy like atom or in a lesser way geary
<FromGitter> <m33:nitro.chat> Thanks guys, see you later ;)
hendursaga has joined #crystal-lang
hendursa1 has quit [Ping timeout: 240 seconds]
<FromGitter> <naqvis> @Blacksmoke16 πŸ‘
<FromGitter> <naqvis> Thanks
<FromGitter> <RespiteSage> Is there any easier way to get an unqualified class name than ⏎ ⏎ ```module A ⏎ class B ⏎ {{ p! @type.stringify.split("::").last }} ⏎ end ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=60634a383bc21d01dd538097]
<FromGitter> <RespiteSage> ?
<FromGitter> <erdnaxeli:cervoi.se> hmm IΒ don't see another way
<FromGitter> <Blacksmoke16> there isnt
sorcus has quit [Quit: WeeChat 3.1]
sorcus has joined #crystal-lang
sorcus has quit [Client Quit]
<FromGitter> <grkek> FYI Grip is at 1.0.0 now
<FromGitter> <grkek> Check it out :)
DTZUZU has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 240 seconds]
hendursa1 has joined #crystal-lang
deavmi_ has quit [Ping timeout: 246 seconds]
deavmi has joined #crystal-lang
hendursa1 has quit [Remote host closed the connection]
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 240 seconds]
deavmi has quit [Read error: No route to host]
<FromGitter> <oprypin:matrix.org> the heck, it went from 4.0.0 to 1.0.0?
deavmi has joined #crystal-lang
hendursa1 has quit [Ping timeout: 240 seconds]
hendursa1 has joined #crystal-lang
<FromGitter> <zomatree0:matrix.org> doing some json stuff, it seems String.to_json wraps the json in `"` and does `\"` instead of `"`, is this a bug?
<FromGitter> <Blacksmoke16> im pretty sure you're just seeing the escaped versions because you have a string with a json string in it
<FromGitter> <Blacksmoke16> i.e. `pp str.to_json` versus `puts str.to_json`
<FromGitter> <zomatree0:matrix.org> im not because this seems to fix it ⏎ ⏎ ```msg = msg.to_json.gsub "\\\"", "\"" ⏎ msg = msg[1..-2]``` [https://gitter.im/crystal-lang/crystal?at=606369a5f8add214d80607c8]
<FromGitter> <Blacksmoke16> got some example code?
<FromGitter> <zomatree0:matrix.org> wait im dumb, nvm
<FromGitter> <Blacksmoke16> πŸ‘
<FromGitter> <oprypin:matrix.org> can I tell Crystal to try to compile a file but not output any files?
<FromGitter> <grkek> :D @oprypin:matrix.org Sorry I decided it was fucked up to go so far with versions
<FromGitter> <grkek> I didn't really know what I was doing with the versions
<FromGitter> <grkek> so yeah back to 1.0.0
<FromGitter> <grkek> and it is the only release
<FromGitter> <grkek> a stable one with it
<FromGitter> <oprypin:matrix.org> well now it's beyond fucked up
<FromGitter> <grkek> Why is it beyond fucked up tho?
<FromGitter> <Blacksmoke16> @oprypin:matrix.org `--no-codegen` iirc
<FromGitter> <djberg96> does he need to retag the previous releases or something?
<FromGitter> <Blacksmoke16> *doom*
<FromGitter> <grkek> *doom*
<FromGitter> <grkek> *doom eternal*
<FromGitter> <djberg96> maybe make 5.0.0 => 0.0.5, something like that?
<FromGitter> <grkek> god I fucking love that game
<FromGitter> <grkek> I don't have any releases but 1.0.0
<FromGitter> <grkek> I deleted all other releases
<FromGitter> <djberg96> oh
<FromGitter> <grkek> I don't see an issue with using a stable 1.0.0 instead of a buggy version
<FromGitter> <grkek> which doesn't exist anymore
<FromGitter> <oprypin:matrix.org> so for all existing usages you broke the installation *and* the updating to a newer version
<FromGitter> <grkek> No one is using my framework currently or else there would be an issue for that
<FromGitter> <grkek> If someone actually used it I would somehow know
<FromGitter> <grkek> but anyways it is not an issue as long as you have your dependencies not specifying the version of the shard
<oz> πŸ€” how would you?
<FromGitter> <grkek> Someone would write it on the Grip channel
<FromGitter> <oprypin:matrix.org> @Blacksmoke16: oh wow that actually seems to work
<oz> grkek: alright, it's your lib after all. :)
<FromGitter> <grkek> I mean it is better to have a proper versioning after all
<FromGitter> <grkek> I don't want to confuse people with a major release every other week
<FromGitter> <grkek> Not good with versioning so dont blame it on me :D
hendursaga has joined #crystal-lang
hendursa2 has joined #crystal-lang
<FromGitter> <djberg96> @grkek you'll want to be more careful going forward
<FromGitter> <djberg96> recommend reading https://semver.org/
hendursa1 has quit [Ping timeout: 240 seconds]
<FromGitter> <grkek> Yeah, now that I have read that (thank you for the link I discovered that before) I know how to release versions
<FromGitter> <djberg96> πŸ‘
<FromGitter> <grkek> I am still glad I didn't get absolutely obliterated by members of this community for doing something this stupid
<FromGitter> <grkek> but yeah all good
hendursaga has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> @oprypin:matrix.org yea i use that for testing compiler errors
<FromGitter> <oprypin:matrix.org> o.o
<FromGitter> <oprypin:matrix.org> what does `run --no-codegen` even mean
<FromGitter> <oprypin:matrix.org> seems like same as `build --no-codegen` which is slightly less nonsensical
<FromGitter> <Blacksmoke16> it'll run the program, like type checking and stuff without actually generating a binary
<FromGitter> <Blacksmoke16> build would prob make more sense tho but :shrug:
<FromGitter> <oprypin:matrix.org> > it'll run the program ⏎ ⏎ no it won't :o
<FromGitter> <Blacksmoke16> run it without running it :S
<FromGitter> <jrei:matrix.org> Remains a `crystal eval --no-codegen`
<FromGitter> <djberg96> @Blacksmoke16 is that sorta like `ruby -c`?
<FromGitter> <oprypin:matrix.org> j8r (https://matrix.to/#/@jrei:matrix.org): welp `Error: postfix decrement is not supported, use `exp -= 1``
<FromGitter> <Blacksmoke16> @djberg96 im not sure what ruby -c does
<FromGitter> <djberg96> syntax check only
<FromGitter> <Blacksmoke16> ah yea, pretty much
sorcus has joined #crystal-lang
<FromGitter> <asterite> we could probably remove `--no-codegen` and just add a new command, `typecheck` or something like that
<FromGitter> <djberg96> might break tooling do that
<FromGitter> <djberg96> could just make `crystal check` a wrapper for `--no-codegen`
<FromGitter> <djberg96> (or whatever you decide to call it0
<FromGitter> <oprypin:matrix.org> what I'm doing with this checking: https://github.com/crystal-lang/crystal-book/pull/503/files#diff-98d0f806abc9af24e6a7c545d3d77e8f9ad57643e27211d7a7b896113e420ed2 😁 cc @Blacksmoke16
<FromGitter> <asterite> Nice!
<FromGitter> <speg> Aaah!! Trying to set up a HTTP::Client with a UNIXSocket, if I store them as instance variables in a class, the second request fails with "Invalid HTTP Response"... then occasionally works every third try or so. ⏎ ⏎ If I write a plain program with local variables, and write multiple calls to client.get ... it works fine? 🀯 What's going on here?
<FromGitter> <Blacksmoke16> prob not real safe to reuse a client instance
<FromGitter> <Blacksmoke16> @oprypin:matrix.org I feel like i should start to remove `ART.run` from my examples :P
<FromGitter> <oprypin:matrix.org> @Blacksmoke16: i dont get it
<FromGitter> <Blacksmoke16> wouldnt that block and timeout the validator thing?
<oprypin> depends what you want from it. in this config it doesnt execute any code anyway
<FromGitter> <Blacksmoke16> ahh ok, i confused this with some like spec thing for code examples
_ht has quit [Remote host closed the connection]
<FromGitter> <alex-kampa> I remember having read that there was no standard serialisation in Crystal, similar to Marshal, is this still the case?
<FromGitter> <Blacksmoke16> things havent changed since you last asked no :p
<FromGitter> <Blacksmoke16> stdlib has JSON/YAML serialization, there are shards that expand upon this and one that offers a byte format
<FromGitter> <alex-kampa> Thanks @Blacksmoke16, is there a shard you can recommend? I want to serialise an object so it can be read back as quickly as possible.
<FromGitter> <Blacksmoke16> in what format?
<FromGitter> <alex-kampa> I want to save an object so that it can be read in as fast as possible. So byte stream / binary format obviously better than JSON.
<FromGitter> <zomatree0:matrix.org> how would i map over `JSON::Any` presuming it will always be a json object
<FromGitter> <Blacksmoke16> @alex-kampa idk if it still works but https://github.com/jeromegn/protobuf.cr might be an option
<FromGitter> <Blacksmoke16> or tbh, just try using JSON or something simpler and see if you really need the extra perf
<FromGitter> <Blacksmoke16> @zomatree0:matrix.org map over, i.e. the data is an array?
<straight-shoota> @zomatree0 as_h.each
<FromGitter> <zomatree0:matrix.org> thanks
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<FromGitter> <alex-kampa> Agree @Blacksmoke16 that the perf difference might not be that noticeable ... may try with just JSON. Thanks for your advice.
<FromGitter> <Blacksmoke16> πŸ‘
mipmip has quit [Read error: Connection reset by peer]
mipmip has joined #crystal-lang
cloaked1 has joined #crystal-lang
early` has joined #crystal-lang
Flipez7 has joined #crystal-lang
justinmcp_ has joined #crystal-lang
justinmcp has quit [Ping timeout: 265 seconds]
baweaver has quit [Ping timeout: 265 seconds]
early has quit [Ping timeout: 265 seconds]
Flipez has quit [Ping timeout: 265 seconds]
Flipez7 is now known as Flipez
markmarkmark has quit [Ping timeout: 240 seconds]
badeball has joined #crystal-lang
markmarkmark has joined #crystal-lang
mipmip has quit [Ping timeout: 268 seconds]
mipmip has joined #crystal-lang
ua has quit [Ping timeout: 240 seconds]
ua has joined #crystal-lang