renich has quit [Remote host closed the connection]
notzmv has quit [Ping timeout: 252 seconds]
<FromGitter>
<backward-crazy-mage-puppy-36> If anyone has figured out how to require amber application in the new crystal interpreter please let me know. Thanks.
notzmv has joined #crystal-lang
jmdaemon has joined #crystal-lang
jmdaemon has quit [Ping timeout: 240 seconds]
HumanG33k has quit [Quit: WeeChat 3.0]
HumanG33k has joined #crystal-lang
<FromGitter>
<Blacksmoke16> It's still experimental so doubt it would work
<FromGitter>
<domgetter> Woohoo! I've successfully cut the linking step down by a huge factor. Got "hello world" from ~8s to compile down to ~4s by making the linker flag resolution concurrent. My ~6000 LOC project is now ~8s instead of ~12s (non-release).
<FromGitter>
<domgetter> There is probably some more optimization to be done there, but that seemed to be the lowest-hanging fruit.
<FromGitter>
<Blacksmoke16> 🚀
<FromGitter>
<domgetter> The issue and pull request are up if you want to check them out
<FromGitter>
<Blacksmoke16> can you add like `Resolves #11888` to the desc so it links correctly?
<FromGitter>
<domgetter> done
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<domgetter> If I want to sort an array of tuples, would it be something like `array_of_person_tuples.sort_by {|(name, age)| age}` ?
<SamantazFox>
reduced the code as much as possible
ua_ has joined #crystal-lang
<FromGitter>
<domgetter> You defined the `format_features` method with `self.` which makes it defined on the `Filters` struct rather than instances of that struct.
<FromGitter>
<domgetter> So either make it `[Filters.format_features(@features)]` when you call it, or redefine it to `def format_features(features : Features)`
<SamantazFox>
it needs to be static, because it's used outside of an instanciated object
<SamantazFox>
And why one has to use the struct/class name inside said class/struct?
<FromGitter>
<domgetter> I guess I'd say from a language design perspective, it's because those method names are in a different scope. One is in "the scope of an instance of a class" and the other is in "the scope of the class"
<FromGitter>
<Blacksmoke16> ^
<FromGitter>
<domgetter> The reason Test1.foo works and Test2.foo doesn't is because `foo` and `bar` are in the same scope in Test 1. That is, they are both `self.`. Whereas in Test2, `foo` is in one scope, and `bar` is in another.
<FromGitter>
<domgetter> So when `Test2#foo` calls `bar`, it doesn't find it, since there is no instance method called `bar` defined on `Test2`. There is just the class method by the same name
<SamantazFox>
ok, but why does it work with "new", then?
<FromGitter>
<moe:busyloop.net> well, i had to put if `ex.message == "This HTTP::Client cannot be reconnected"` into my connection pool, that feels wrong
<FromGitter>
<moe:busyloop.net> something like This::HTTP::Client::CannotBeReconnected 🤷
<SamantazFox>
Blacksmoke16: Well, the example I gave (calling `self.foo` from instanciated `bar`) would work in C++ or PHP, but not in Crystal
<FromGitter>
<Blacksmoke16> bring it up in that ticket maybe
<FromGitter>
<moe:busyloop.net> yeh will do some reading and maybe writing later 🧐
<FromGitter>
<Blacksmoke16> pretty sure it wouldnt work in php
<FromGitter>
<Blacksmoke16> php always requires a receiver, so its not exactly the same comparison
<FromGitter>
<moe:busyloop.net> it's too logical
<FromGitter>
<moe:busyloop.net> in most other languages `self` semantics are a trainwreck