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
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #crystal-lang
postmodern has quit [Quit: Leaving]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 248 seconds]
f1reflyylmao is now known as f1refly
chachasmooth has quit [Ping timeout: 246 seconds]
chachasmooth has joined #crystal-lang
chachasmooth has quit [Ping timeout: 260 seconds]
chachasmooth has joined #crystal-lang
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
ua has quit [Ping timeout: 240 seconds]
ua has joined #crystal-lang
DTZUZU has quit [*.net *.split]
avane has quit [*.net *.split]
raz has quit [*.net *.split]
mipmip has quit [*.net *.split]
sorcus has quit [*.net *.split]
r0bby has quit [*.net *.split]
Flipez has quit [*.net *.split]
deavmi has quit [*.net *.split]
oz has quit [*.net *.split]
ua has quit [*.net *.split]
early has quit [*.net *.split]
badeball has quit [*.net *.split]
johnny101 has quit [*.net *.split]
Xeago has quit [*.net *.split]
SuperFamicom[m] has quit [*.net *.split]
hendursaga has quit [*.net *.split]
xybre has quit [*.net *.split]
dom96 has quit [*.net *.split]
fifr` has quit [*.net *.split]
yxhuvud has quit [*.net *.split]
lanodan has quit [*.net *.split]
olbat has quit [*.net *.split]
Liothen has quit [*.net *.split]
ProjectEpsilon has quit [*.net *.split]
issyl0 has quit [*.net *.split]
commavir has quit [*.net *.split]
twistedpixels has quit [*.net *.split]
woodruffw has quit [*.net *.split]
ebb has quit [*.net *.split]
entel has quit [*.net *.split]
hsh has quit [*.net *.split]
oprypin has quit [*.net *.split]
maxpowa has quit [*.net *.split]
frojnd has quit [*.net *.split]
skrzyp has quit [*.net *.split]
Andriamanitra has quit [*.net *.split]
FromGitter has quit [*.net *.split]
hpyc9 has quit [*.net *.split]
fifr has quit [*.net *.split]
willamin has quit [*.net *.split]
andremedeiros has quit [*.net *.split]
Stephie has quit [*.net *.split]
baweaver has quit [*.net *.split]
snapcase has quit [*.net *.split]
justinmcp_ has quit [*.net *.split]
jrayhawk has quit [*.net *.split]
^ has quit [*.net *.split]
bougyman has quit [*.net *.split]
aquijoule_ has quit [*.net *.split]
coderobe has quit [*.net *.split]
bazaar has quit [*.net *.split]
Nekka has quit [*.net *.split]
markmarkmark has quit [*.net *.split]
jhass has quit [*.net *.split]
repo has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
f1refly has quit [*.net *.split]
Vexatos has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
chachasmooth has quit [*.net *.split]
HumanG33k has quit [*.net *.split]
libneko[m] has quit [Ping timeout: 276 seconds]
fifr has joined #crystal-lang
dom96 has joined #crystal-lang
entel has joined #crystal-lang
Vexatos has joined #crystal-lang
willamin has joined #crystal-lang
bougyman has joined #crystal-lang
^ has joined #crystal-lang
jrayhawk has joined #crystal-lang
snapcase has joined #crystal-lang
justinmcp_ has joined #crystal-lang
Stephie has joined #crystal-lang
baweaver has joined #crystal-lang
andremedeiros has joined #crystal-lang
hpyc9 has joined #crystal-lang
skrzyp has joined #crystal-lang
frojnd has joined #crystal-lang
FromGitter has joined #crystal-lang
Andriamanitra has joined #crystal-lang
maxpowa has joined #crystal-lang
oprypin has joined #crystal-lang
hsh has joined #crystal-lang
bazaar has joined #crystal-lang
markmarkmark has joined #crystal-lang
issyl0 has joined #crystal-lang
commavir has joined #crystal-lang
twistedpixels has joined #crystal-lang
avane has joined #crystal-lang
jhass has joined #crystal-lang
HumanG33k has joined #crystal-lang
f1refly has joined #crystal-lang
Nekka has joined #crystal-lang
mipmip has joined #crystal-lang
lanodan has joined #crystal-lang
raz has joined #crystal-lang
ebb has joined #crystal-lang
coderobe has joined #crystal-lang
woodruffw has joined #crystal-lang
ua has joined #crystal-lang
Flipez has joined #crystal-lang
Xeago has joined #crystal-lang
deavmi has joined #crystal-lang
r0bby has joined #crystal-lang
badeball has joined #crystal-lang
early has joined #crystal-lang
entel has quit [Ping timeout: 250 seconds]
dostoyevsky has joined #crystal-lang
hendursaga has joined #crystal-lang
r0bby has quit [Ping timeout: 246 seconds]
Liothen has joined #crystal-lang
hendursaga has quit [Ping timeout: 240 seconds]
hendursa1 has joined #crystal-lang
r0bby has joined #crystal-lang
entel has joined #crystal-lang
hightower2 has joined #crystal-lang
<hightower2> Hey, I asked some time ago if there was support for shard.yml.local or something that'd override the standard shard.yml. Someone told me that exactly that was supported. But I don't see it working, and stracing the `shards` command doesn't show checks for any file other than shard.yml
<hightower2> Any hints?
libneko[m] has joined #crystal-lang
repo has joined #crystal-lang
daemonwrangler has joined #crystal-lang
flaviodesousa has joined #crystal-lang
flaviodesousa has quit [Remote host closed the connection]
flaviodesousa has joined #crystal-lang
ProjectEpsilon has joined #crystal-lang
SuperFamicom[m] has joined #crystal-lang
postmodern has joined #crystal-lang
<hightower2> For everyone's benefit, indeed the feature exists, just the default filename is shard.override.yml, or can be pointed to by SHARDS_OVERRIDE env var . Thanks
_ht has joined #crystal-lang
<FromGitter> <naqvis> hightower2 that is `shard.override.yml` *not* `shard.yml.local`
<FromGitter> <naqvis> recalled my message, as you already mentioned the correct name :P
<hightower2> si, thanks :)
<FromGitter> <riffraff169> so this leads to a question: why would you need to override the file, when you can just edit the file....maybe to keep a "pristine sources" concept, but not sure
<FromGitter> <riffraff169> but even still, if it is a git repo, you just fork and merge when pulling
<hightower2> To point to a couple shards with path: ../some/local/path, rather than having to modify file which is in git
<FromGitter> <riffraff169> if you need to change it, wouldnt you want to commit to git?
<hightower2> for local development, before it's committed/pushed somewhere else
<straight-shoota> you could also have a override file checked into git and use it to validate different dependencies (for example, track un-released master branches)
alexherbo2 has joined #crystal-lang
<FromGitter> <Blacksmoke16> is there ever a world where this would be true? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60704ecbb6a4714a29b3dc6f]
<FromGitter> <Blacksmoke16> having trouble thinking of a way to handle this scenario
<straight-shoota> what exactly is "this scenario"?
<FromGitter> <Blacksmoke16> say you want to determine some variable `is_a? JSON::Serializable`, but in the case of `Array(User)`, it would need to check against `T` as `Array` isn't `JSON::Serializable`
<straight-shoota> there are ideas to support contravariance in generic arguments, which would allow this to work
<straight-shoota> for now you can do `typeof(arr.first) < JSON::Serializable`
<FromGitter> <Blacksmoke16> sec, let me try that out
<FromGitter> <Blacksmoke16> was able to get it to work via `.class` otherwise `typeof` is a union of other stuff too :/
<straight-shoota> but class only tells you if the first entry is a JSON::Serializable
<straight-shoota> (or whatever actual entry yo u grab)
<FromGitter> <Blacksmoke16> i think thats ok in this case. As it would be weird for an API to return a union of things where some of them couldnt be serialized anyway
<straight-shoota> But if all union members implement `JSON::Serializable`, the typeof should match
<FromGitter> <Blacksmoke16> sadly its a union of a bunch of random stuff
<straight-shoota> So the things that can end up in the array are explicitly *not* all JSON::Serializable?
<straight-shoota> Why do you want to test it then?
<FromGitter> <Blacksmoke16> sec trying something real quick
<FromGitter> <Blacksmoke16> eh, tl;dr athena stores the response of a controller action in a generic type. Then there's some logic to determine what serializer to use based on the data
<FromGitter> <Blacksmoke16> which atm i noticed is actually broken if its like `Array(User)` where `User` is a `JSON::Serializable`
<FromGitter> <Blacksmoke16> might just be easier to drop support for `JSON::Serializable`, although id rather not
<FromGitter> <Blacksmoke16> i think i can move the logic into the generic type to avoid the union
<FromGitter> <Blacksmoke16> yea that seemed to work
<FromGitter> <Blacksmoke16> wont really handle multidimensional arrays but thats prob ok
<FromGitter> <Blacksmoke16> could get it to work if we had macro defs 😭
<FromGitter> <naqvis> kinda look like a hack, but it does work :P ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60705f2d2e5574669b2753d8]
<FromGitter> <Blacksmoke16> well whatever i did compiler wasnt happy, `Invalid memory access (signal 11) at address 0x17e0000000c`
<FromGitter> <Blacksmoke16> :S
<FromGitter> <naqvis> RIP :P
<FromGitter> <Blacksmoke16> i dont see why what i did would have an effect tho
<FromGitter> <naqvis> Generic modules are quite fragile
<FromGitter> <naqvis> i doubt you are dealing with Generic Modules
<FromGitter> <Blacksmoke16> let me see if i can reproduce
<FromGitter> <Blacksmoke16> well its from one of my specs
<FromGitter> <Blacksmoke16> yea idk, its prob just some obscure generics bug that i cant really pin down atm
<FromGitter> <Blacksmoke16> `view = ART::View(String).new("1")` changing this to `view = ART::View(Int32).new(1)` causes it
<repo> hey there o/
<FromGitter> <Blacksmoke16> o/
<repo> i totally missed 1.0.0 :D
<FromGitter> <Blacksmoke16> oo i reproduced it
<FromGitter> <Blacksmoke16> trying to reduce now
<FromGitter> <naqvis> πŸ‘
<FromGitter> <Blacksmoke16> now i cant reproduce it again πŸ€”
<FromGitter> <Blacksmoke16> no we're good
shalokshalom has joined #crystal-lang
<FromGitter> <naqvis> @Blacksmoke16 regarding https://github.com/crystal-lang/crystal/issues/10613 ⏎ moving the comment to definition fixes the issue
<FromGitter> <naqvis> moving the comment to definition works. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60707637a9dd556843ca4650]
<FromGitter> <Blacksmoke16> makes sense but doesnt help in the case where you want to do like: ⏎ ⏎ `````` [https://gitter.im/crystal-lang/crystal?at=60707649b6a4714a29b447e7]
<FromGitter> <Blacksmoke16> ```# :nodoc: ⏎ forward_missing_to @some_ivar``` [https://gitter.im/crystal-lang/crystal?at=6070765746a93d4a19b736e6]
<FromGitter> <naqvis> this shouldn't be displayed in docs
<FromGitter> <naqvis> i mean you don't even need to use `# :nodoc:` here
<FromGitter> <Blacksmoke16> it adds a `method_missing(call)` macro to the docs
<FromGitter> <naqvis> i couldn't reproduce ⏎ ⏎ ```class SomeClass ⏎ getter var : String = "" ⏎ forward_missing_to @var ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=6070775adc24646812af17e6]
<FromGitter> <naqvis> max it shows is `def var : String `
<FromGitter> <naqvis> yeah, see it
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/ato4
<FromGitter> <Blacksmoke16> going to see if i can reduce further
<FromGitter> <Blacksmoke16> prob something related to my semi hacky generic containers :S
<FromGitter> <Blacksmoke16> yea pretty sure its generic inheritance issue again :/
<FromGitter> <Blacksmoke16> replaced abstract class with module and that fixed it
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <Blacksmoke16> prob related to https://github.com/crystal-lang/crystal/issues/8468 maybe
<FromGitter> <naqvis> i'm trying to play with that
<FromGitter> <Daniel-Worrall> So I want to iterate over multiples of n up to a bound, is there a better way than `(x..upper_bound).each.step(x)`?
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/ato7 was able to reduce a bit more
<FromGitter> <naqvis> interesting enough that if both calls are made with String, then it doesn't segfaul
<FromGitter> <Blacksmoke16> @Daniel-Worrall what about ilke `x.step(to: upper_bound, by: x)`?
<FromGitter> <Daniel-Worrall> yeah, that's better
<FromGitter> <Blacksmoke16> @naqvis yea, compiler just bombs on the `action.create_view data` part, even in this case where `data` is always a view
<FromGitter> <Blacksmoke16> works if you comment that `unless` block out too
<FromGitter> <naqvis> yeah, but this sample code isn't even reaching inside unless block
<FromGitter> <Blacksmoke16> exactly
<FromGitter> <Blacksmoke16> everything is a class also, so cant be some stack thing id imagine
<FromGitter> <naqvis> Generics is causing that
<FromGitter> <naqvis> and my guess is its Union
shalokshalom has quit [Quit: https://quassel-irc.org - Komfortabler Chat. Überall.]
<FromGitter> <Blacksmoke16> going to try and reduce some more then file an issue so i can find this in the future when i run into it again ha
<FromGitter> <Blacksmoke16> its also interesting it doesnt happen when you remove any of the immediary steps, like the event, or view listener etc
<FromGitter> <Blacksmoke16> well let me see if thats true
<FromGitter> <naqvis> inside unless block, change var name, then do a `view = view1`, you will see detailed stacktrace ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=6070849746a93d4a19b763e9]
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/atoa was able to get rid of the listener thing
<FromGitter> <Blacksmoke16> getting rid of the event type, doesnt reproduce tho
<FromGitter> <Blacksmoke16> dont see how it would be any diff but :shrug:
<FromGitter> <Blacksmoke16> oo this is interesting
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/atob
<FromGitter> <Blacksmoke16> look at the output, `#<View(Int32):0x7ffefb66f108 @data=32579>`, `32579` πŸ€”
<FromGitter> <naqvis> yeah
<FromGitter> <naqvis> interesting enough, code https://play.crystal-lang.org/#/r/atob is working okay on local box
<FromGitter> <naqvis> But ⏎ ⏎ ```#<View(Int32):0x7ffee0b9c460 @data=1> ⏎ #<View(String):0x7ffee0b9c460 @data="\xFE">``` [https://gitter.im/crystal-lang/crystal?at=607087e81f84d71853a8c5a0]
<FromGitter> <naqvis> `0x7ffee0b9c460` same object
alexherbo23 has joined #crystal-lang
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo23 is now known as alexherbo2
<FromGitter> <Blacksmoke16> oh interesting
<FromGitter> <Blacksmoke16> wonder how that happened
<FromGitter> <naqvis> okay, its due to generic inheritance
<FromGitter> <Blacksmoke16> Boo, my arch nemesis ha
postmodern has quit [Quit: Leaving]
<FromGitter> <Blacksmoke16> Would be great if you could use generic types as ivars
<FromGitter> <naqvis> yeah
<FromGitter> <Blacksmoke16> Without needing to specify the generic type. Like just allow any
<FromGitter> <naqvis> even if that `unless` block isn't being reached, but compiler still parse that and try to infer the type
<FromGitter> <Blacksmoke16> That's my main use case
<FromGitter> <Blacksmoke16> Mhm
<FromGitter> <naqvis> and then it treat things as Union
<FromGitter> <naqvis> as we were invoking `Int32` and `String`
<FromGitter> <naqvis> so it treat the `T` as `Int32 | String`
<FromGitter> <naqvis> and there things get corrupted
<FromGitter> <naqvis> that was the reason we were getting stack overwrites and garbage characters
<FromGitter> <naqvis> https://play.crystal-lang.org/#/r/atoq ⏎ modified `create_view` else clause and here you see the compiler complaining
<FromGitter> <naqvis> so in summary, Generics aren't good to mix with non-generic classes for inheritance :P
<FromGitter> <Blacksmoke16> Shh πŸ˜‰
<FromGitter> <Blacksmoke16> Works with a module tho
<FromGitter> <Blacksmoke16> I'd be in trouble if that is ever disallowed
<FromGitter> <naqvis> might be because of those are treated as mixins
<FromGitter> <Blacksmoke16> Possibly, I'm not going to question it ha
<FromGitter> <naqvis> but this shows that generics require some Love
<FromGitter> <Blacksmoke16> Oh for sure
<FromGitter> <naqvis> let's hope HertzDevil will find some time to care Generics :P
<FromGitter> <Blacksmoke16> πŸ™
<hightower2> :)
<FromGitter> <zomatree0:matrix.org> is there a way do do overloads based on a string literal
<FromGitter> <Blacksmoke16> are the strings known at compile time?
<FromGitter> <tenebrousedge> ^
<FromGitter> <zomatree0:matrix.org> i presume, i dont really know how to answer that
<FromGitter> <tenebrousedge> you can't do a dynamic method call, basically
<FromGitter> <Blacksmoke16> maybe look into a https://crystal-lang.org/reference/syntax_and_semantics/enum.html
<FromGitter> <Blacksmoke16> still cant do overloads based on a specific enum member, but can use a `case`/`in` on them and be more type safe than just strings
<FromGitter> <zomatree0:matrix.org> hmm
<straight-shoota> Maybe just tell what you want to do?
<FromGitter> <zomatree0:matrix.org> im wanting to do `event("message") <proc here>` but all the events take differant args so the types dont match up so i wanted to do it via overloads instead
<FromGitter> <Blacksmoke16> oo an eventing shard, i have one of those :P
<FromGitter> <MrSorcus> > oo an eventing shard, i have one of those :P ⏎ ⏎ πŸ˜†
<FromGitter> <Blacksmoke16> tl;dr make your proc take some `Event` object that contains the data
<FromGitter> <Blacksmoke16> versus passing the data directly to the proc
<FromGitter> <Blacksmoke16> then you can subclass it and stuff for more specific data
<straight-shoota> If you call them with string literals as argument, why not make different methods with the strings as name?
<FromGitter> <zomatree0:matrix.org> looks bad πŸ™ƒ
<FromGitter> <zomatree0:matrix.org> i think i will go the single Event class and subclassing that
<straight-shoota> looks can be deveiving
<straight-shoota> *deceiving
<straight-shoota> doh
<FromGitter> <zomatree0:matrix.org> is overloads via enums a feature that could be added
<FromGitter> <Blacksmoke16> iirc i asked this before and the answer was not likely due to enum members just being constants with Int values
<FromGitter> <Blacksmoke16> not actually types
<FromGitter> <zomatree0:matrix.org> shame
<FromGitter> <Blacksmoke16> you could use some type structure to do it tho. Like each string maps to some specific struct
<straight-shoota> I really don't understand why you want to do sth like `event("message") { ... }` when you could just do `message { ... }` instead
_ht has quit [Remote host closed the connection]
ua has quit [Ping timeout: 240 seconds]
ua has joined #crystal-lang
alexherbo28 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo28 is now known as alexherbo2
flaviodesousa has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo20 has joined #crystal-lang
alexherbo20 has quit [Quit: Ping timeout (120 seconds)]
alexherbo2 has joined #crystal-lang
DTZUZU has joined #crystal-lang
<FromGitter> <ryanstout> sorry, more questions. Is there a way to generate/print llvm IR for crystal code?
<FromGitter> <tenebrousedge> yes
<FromGitter> <tenebrousedge> one of the build options I think
<FromGitter> <ryanstout> @tenebrousedge not sure how I missed that, thanks
<FromGitter> <tenebrousedge> `crystal build --emit llvm-ir`