jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | 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
<FromGitter> <Sija> weird… why does docs build with crystal v0.35.1 have `<meta name="generator" content="Crystal Docs 0.34.0”>` inside `index.html`?
<FromGitter> <oprypin:matrix.org> @Sija pls use mkdocstrings :o
hightower2 has quit [Ping timeout: 264 seconds]
<FromGitter> <watzon> The thing is, writing super detailed "story" docs like Python has takes a but ton of time. But it would be amazing to see Crystal so meticulously documented.
<FromGitter> <christopherzimmerman> @oprypin:matrix.org I'm moving my docs over to mkdocstrings now, really enjoying the project, looks great!
<FromGitter> <christopherzimmerman> I've also been working for a while now on a way to dynamically insert the output of code into my docs (including plots), I wonder if I can do it as a plugin to mkdocs.
<FromGitter> <watzon> I can see no reason why not. I would actually love to have a code runner plugin for running examples.
Volk has quit [Quit: See you next time!]
<FromGitter> <watzon> Finally finished the Blake2b algo I've been working on
<FromGitter> <watzon> Man that was a pain
<FromGitter> <christopherzimmerman> Benchmarked it yet?
<FromGitter> <watzon> Actually doing that now
<FromGitter> <watzon> 100000 iterations for each one
<FromGitter> <watzon> I don't have anything to compare against though
<FromGitter> <watzon> The ones that start with "hash` are creating a new `Blake2b` instance with each iteration, so they're a tiny bit slower, but .833 seconds to individually hash 100,000 1024 byte records ain't bad imo.
<FromGitter> <watzon> Wait that's 10GB in less than a second isn't it?
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
_whitelogger has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 264 seconds]
<FromGitter> <mattrberry> One easy (albeit minor) optimization could be treating integer division by a power of 2 as a shift ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=600261ebfe007479e4151c64]
<FromGitter> <watzon> Hmm yeah, not bad
avane has quit [Quit: ZNC - https://znc.in]
avane has joined #crystal-lang
deavmi has quit [Ping timeout: 246 seconds]
deavmi has joined #crystal-lang
<FromGitter> <mattrberry> Sometimes benchmark results confuse me, though... I was curious how bitwise and could compare to mod in applicable cases. I added the "xxx" report after the first 3 runs. For the first 2, the "mod" and "and" reports were similar, but once I added the "xxx" report, the "and" one was always faster.... ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=6002ad66d5f4bf2965ed07fe]
<FromGitter> <mattrberry> The "xxx" report was just for a generic modulo test to compare against, where it couldn't simply be converted to a bitwise and
hightower2 has joined #crystal-lang
_ht has joined #crystal-lang
<Andriamanitra> i wouldn't read into miniscule differences (less than 1.5x slower).. there's always some variation
<hightower2> oprypin, could you share in brief how to 'use mkdocstrings' ? :)
<FromGitter> <oprypin:matrix.org> hightower2, https://oprypin.github.io/mkdocstrings-crystal/ ?
<hightower2> ah ok great, I thought something was already built-in, thanks
ua has joined #crystal-lang
<FromGitter> <HertzDevil> i wonder if `unsafe_shr` will be even faster than `>>`
Flipez has quit [Read error: Connection reset by peer]
Flipez8 has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Remote host closed the connection]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 246 seconds]
deavmi has joined #crystal-lang
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 265 seconds]
<FromGitter> <jrei:matrix.org> anyone has ever used UDP multicast with Crystal?
<FromGitter> <Blacksmoke16> @jrei:matrix.org https://github.com/crystal-lang/crystal/issues/3825
<FromGitter> <jrei:matrix.org> Thanks @Blacksmoke16!
<hightower2> Ehm, wanted to do something quick with JSON... How do I convert Array(JSON::Any) to Array(String) ? (I know that the JSON::Anys are strings)
<FromGitter> <Blacksmoke16> `Array(String).from data`
<FromGitter> <Blacksmoke16> or `data.as_a.map &.as_s`
<FromGitter> <Blacksmoke16> `.from_json`*
<hightower2> yes I think I can't use .from_json since it's already JSON::Any, isn't serialized
<hightower2> gonna try with the map thing
<hightower2> worked, thanks!
postmodern has quit [Quit: Leaving]
<FromGitter> <Blacksmoke16> yea would have to be the raw data, but that was assuming you're doing a json.parse first as well
<FromGitter> <Blacksmoke16> like easier to go from data to string array than data json::any string array
<FromGitter> <HertzDevil> what's the suggested practice for submitting a pr that depends on another pr
<FromGitter> <HertzDevil> (of my own)
<oprypin> HertzDevil, lie on the floor and cry
<FromGitter> <Blacksmoke16> prob make the first pr into master then create the 2nd pr to the branch of the first pr
<oprypin> more realistically, just include the exact same commits and more and then add a big text at the start of the description
<FromGitter> <Blacksmoke16> then when the first one is merged github will auto change base to master
<FromGitter> <HertzDevil> hmm
<FromGitter> <Blacksmoke16> where the 2nd pr is a draft
<oprypin> Blacksmoke16, what you're describing would be a pull request to hertzdevil's repo. not possible like that
<FromGitter> <Blacksmoke16> hmm fair point, not sure what gh would do in that case
<oprypin> >a pull request to hertzdevil's repo
<yxhuvud> I'd simply submit it as a pull request with the target pr as the base you pr into.
<oprypin> not possible
<yxhuvud> sure it is. Submit both, then hit edit and choose what branch you want to merge to
<oprypin> what branch of crystal-lang/crystal repo
<yxhuvud> ah, hmm.
<FromGitter> <Blacksmoke16> if pr 1 was made fork branch1 to crystal master, and fork branch2 was made into fork branch1, is gh smart enough to update base to crystal master as well?
<oprypin> first of all, i've never heard of it updating anything, so i dont know
<oprypin> 2nd of all, i dont think it would move a pull request to hertzdevil's repo to become a pull request to crystal-lang's repo
<yxhuvud> it definitely updates if both branches are local to the same repo.
<oprypin> that is good, thanks. now github just needs to let people to target a branch without write access to the main repo
<oprypin> to clarify: you can choose a branch to target, just that you can't push one so that it becomes targetable
<FromGitter> <asterite> I guess we need @HertzDevil in the core team :-P
<FromGitter> <asterite> (note: I'd also like @oprypin to be in the core team, for that matter)
<FromGitter> <asterite> because then, yes, you can stack PRs
<oprypin> 😊
<hightower2> :-)
f1reflyylmao is now known as f1refly
oz has quit [Ping timeout: 256 seconds]
snapcase has quit [Ping timeout: 256 seconds]
snapcase has joined #crystal-lang
justinmcp_ has quit [Ping timeout: 256 seconds]
oz has joined #crystal-lang
justinmcp has joined #crystal-lang
<FromGitter> <jrei:matrix.org> @HertzDevil aka "Crystal Jesus" 😄 He is doing miracles, coming from nowhere
<FromGitter> <jrei:matrix.org> oprypin (https://matrix.to/#/@oprypin:matrix.org) too, but he is there since a long time
<FromGitter> <jrei:matrix.org> "docprypin" 😉
<hightower2> HertzDevil awesome stuff indeed
ua_ has quit [Ping timeout: 256 seconds]
ua_ has joined #crystal-lang
<FromGitter> <HertzDevil> to be more specific i'm waiting for crystal-lang/crystal#10254
_ht has quit [Remote host closed the connection]
deavmi has quit [Quit: Eish! Load shedding.]
deavmi has joined #crystal-lang
<FromGitter> <asterite> You can mention that in the PR. The thing is that I'm not sure more PRs can go into 0.36.0. What's your next PR about?
<straight-shoota> Probably better to pack it into 0.36.0 than 1.0
<FromGitter> <asterite> It's true. But then what about the follow up?
<oprypin> well at least the followup will be possible to open :>
<FromGitter> <HertzDevil> figured out how to fix https://github.com/crystal-lang/crystal/issues/10001#issuecomment-761009379 so writing `Proc.new(&block)` in the compiler itself will finally be possible
<FromGitter> <asterite> Is the change big? Is it a new breaking change?
<FromGitter> <HertzDevil> this one shouldn't be a breaking change
<FromGitter> <asterite> Cool. What happens if someone redefines that method?
<FromGitter> <HertzDevil> well you can redefine `Tuple.new` too, doesn't mean people should, nor that stdlib will be responsible for that
<FromGitter> <asterite> I just wonder whether the compiler will trigger a bug
<FromGitter> <asterite> Maybe having the rule hardcoded isn't that bad
<FromGitter> <asterite> From a user 's perspective it's the same
<FromGitter> <HertzDevil> it breaks exactly one place
<FromGitter> <HertzDevil> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=600365b5e578cf1e95f17a30]
<FromGitter> <HertzDevil> in contrast if you redefine `Tuple.new` it would break things like `NamedTuple#keys` and i believe `Iterator#zip`
<FromGitter> <HertzDevil> the compiler itself uses neither `Tuple.new` nor `Proc.new` directly
<FromGitter> <HertzDevil> at least my ctrl+shift+f suggests so
<FromGitter> <HertzDevil> for this case this might suffice
<FromGitter> <HertzDevil> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60036658252c0a6ded152f32]
<FromGitter> <HertzDevil> due to compatible procs
<FromGitter> <HertzDevil> oh there are all those lib proc aliases that ultimately call `Proc.new`
<FromGitter> <watzon> @asterite there's going to be a 0.36.0? I thought we were going to be moving into the 1.0.0-pre's
<FromGitter> <jrei:matrix.org> I remember my conversation with oprypin (https://matrix.to/#/@oprypin:matrix.org) when the 1.0 release will come :)
<FromGitter> <jrei:matrix.org> I was planning end of 2020 - at the end, we were both wrong
<FromGitter> <asterite> @HertzDevil I left a comment on your commit. I think we can go with your next PR if we check that the method definition matches exactly the one in the std
<FromGitter> <watzon> I understand now, thanks @oprypin:matrix.org
<FromGitter> <watzon> I agree that it would be nice to have another release asap rather than waiting for 1.0.0