ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.34.0 | 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
deavmi_ has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
masterdonx2 has joined #crystal-lang
MasterdonX has quit [Ping timeout: 256 seconds]
<FromGitter> <Blacksmoke16> raz: what about basing it off of the type restriction of the `apply` method
<FromGitter> <Blacksmoke16> `def apply(request : HTTP::Request, configuration : MultiplyConverterMetadata) : Nil` versus `def apply(request : HTTP::Request, configuration : ART::ParamConverterMetadata) : Nil`
<FromGitter> <Blacksmoke16> versus the constant?
DTZUZU has quit [Quit: WeeChat 2.8]
DTZUZU has joined #crystal-lang
rocx has quit [Ping timeout: 260 seconds]
companion_cube has left #crystal-lang ["WeeChat 2.3"]
alexherbo2 has joined #crystal-lang
<FromGitter> <naqvis> thanks oprypin, I also don't like those folders usages, but put that during the last minute :).
<FromGitter> <naqvis> added `postinstall` hook and Makefile. Thank you @Blacksmoke16 and opyrpin
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
ua has quit [Ping timeout: 256 seconds]
tdc has joined #crystal-lang
ua has joined #crystal-lang
<kevinsjoberg> If I want to to loop over indexes starting from 1 in Crystal what would I do? I can do it using a regular loop but usually the each/each_with_index methods are preferred due to performance.
<kevinsjoberg> I basically want to do, "loop from 1 to n-1". Would (1..a.size).times do |i| do?
<kevinsjoberg> s/times/each/
<kevinsjoberg> Yeah, this worrked: "1...sorted_list.size).each".
<FromGitter> <naqvis> πŸ‘
<FromGitter> <naqvis> `1.upto(a.size) do |i| .....`
<FromGitter> <manveru> is anyone monitoring the crystal keybase account? wrote to it about a security issue last week but got no response...
alexherbo2 has joined #crystal-lang
<raz> manveru: security issue in crystal (security bug) or related to keybase?
<FromGitter> <manveru> raz: in crystal
<jhass> I think that key is just used and published there for distribution signing
<jhass> we should have a SECURITY.md
<FromGitter> <manveru> guess that didn't mean keybase chat though :)
<raz> +1 jhass. that was actually my next question (does crystal have a formal process for such reports, and is it keybase)
<jhass> I'll bring this up internally
<raz> perhaps a simple email contact address (that goes to asterite et al) could work, for reports that should not be sent publcally
<FromGitter> <manveru> it's actually an issue with shards, but that has even less contact options
<jhass> how severe do you judge this? Given shards design I kinda doubt it's unexpected RCE or something, so you might just open an issue for now
<raz> well, suppose RCE would be trivial with post-install hooks etc.
<raz> but i don't see how any pkg manager could prevent that
<raz> RCE is part of their job kinda ;)
<FromGitter> <manveru> yeah, it's not super severe, mostly command injection for things like `shards lock`
<jhass> hence I used "unexpected RCE" :)
<raz> :D
<raz> well played, sir
<FromGitter> <manveru> :)
<jhass> because yes, some RCE is part of its features
<FromGitter> <manveru> indeed
<raz> i guess a real bug would be if shards could be tricked into fetching/installing unexpected things (hi npm! o/ )
<yxhuvud> or if stuff is written outside of the relevant directory
<FromGitter> <manveru> i guess that might be possible, haven't done much more than a tiny PoC
<FromGitter> <manveru> i'll make an issue
<raz> yxhuvud: well, post-install scripts run as the current user. also it installs code that you presumably compile shortly after (which can again exec arbitrary commands)
<raz> you kinda have to trust your deps by definition, there's not much shards could do to change that
<FromGitter> <manveru> i compile my shards within nix sandboxes, not directly via `shards install`, so i like some separation of concerns
<raz> ah... hmm
<raz> ok perhaps shards could have a --dont-run-hooks option
<raz> but that would likely break a bunch of shards
<FromGitter> <manveru> there ya go: https://github.com/crystal-lang/shards/issues/396
<jhass> thank you :)
<FromGitter> <manveru> i guess nobody is working on https://github.com/crystal-lang/shards/issues/242 yet either... might have to pick that up
<jhass> yeah, would be appreciated I think :)
<jhass> waj has been doing a lot of work on shards recently, I'm not sure if that's done or what all his plans are
<jhass> I can imagine the latter issue not being completely out of scope there, so might be worth to do a ping on the issue before you invest too much time
<FromGitter> <manveru> hm, i noticed that with shards master the versions now contain the commit
<jhass> ah, see :D
<FromGitter> <manveru> looks like `version: 0.1.0+git.commit.e61b200edb735d5676e11cbe56e8353c8b2ced0b` now
<FromGitter> <manveru> so i guess that's done already :)
<FromGitter> <manveru> would be nicer in a separate field, but well, not that hard to parse
<jhass> mmh, I wonder if that was a side effect of the molinillo port already?
<jhass> but then shards' own lockfile does not do it yet
<jhass> er
<FromGitter> <manveru> it does, if you run `crystal ./src/shards.cr -- lock`
<jhass> yeah, just hadn't been update yet
<FromGitter> <manveru> it probably just didn't need any update yet
<FromGitter> <manveru> :)
<FromGitter> <manveru> would be even nicer if it included the ref the rev is reachable from as well
<jhass> mmh, actually wer we sure it's always included now?
<jhass> taking a second look at the code I'm not so sure
sorcus has quit [Quit: WeeChat 2.8]
lunarkitty has quit [Ping timeout: 260 seconds]
sorcus has joined #crystal-lang
lunarkitty has joined #crystal-lang
<FromGitter> <RomainFranceschini> Hi all, just wondering if someone already tried to compile crystal code as a shared library to embed in an app written in another language
<FromGitter> <RomainFranceschini> I have a PoC with swift calling crystal code. I know Crystal is not meant to be used that way but I'm just curious
<jhass> https://stackoverflow.com/a/32921404/2199687 this old StackOverflow answer should still apply
<jhass> except for calling crystal's main function maybe
<jhass> but yeah, I see no practical uses
<jhass> the runtime is too invasive
<jhass> especially including bdwgc
<yxhuvud> Especially not with Swift. They are at *very* similar levels on the abstraction level chain.
deavmi has quit [Read error: No route to host]
deavmi has joined #crystal-lang
zorp_ has quit [Ping timeout: 272 seconds]
sz0 has quit [Ping timeout: 260 seconds]
sz0 has joined #crystal-lang
<FromGitter> <RomainFranceschini> Thanks, yes it was just fun to do that I don’t intend to go further
<FromGitter> <RomainFranceschini> Although having a shared crystal code base and use it across platforms would be nice
<FromGitter> <RomainFranceschini> To define GUIs I mean
<jhass> with platforms you mean techstacks?
rocx has joined #crystal-lang
<FromGitter> <RomainFranceschini> Yes
<raz> bringing crystal onto iOS would be cool tho. actually the only non-linux platform i'd personally be interested in
<raz> esp. with apple glasses round the corner
<raz> glasses + crystal, it even sounds right! :p
<FromGitter> <naqvis> raz you need to evaluate Swift lol
<raz> well, i've heard good things about it. but i'm not really keen on learning another language at this point
<raz> plus there's so much synergy if you could write crystal both on client+server
<FromGitter> <naqvis> hybrid apps?
<raz> but yea... i'm just dreaming. prob rather unrealistic. ;)
<FromGitter> <naqvis> everything starts with a vision and dream
<raz> yes, but even if you don't go hybrid, just having the full codebase in the same language is great
<raz> (that's the drive behind all those JS server-side frameworks after all. except... they started on the wrongest possible side of the fence)
<FromGitter> <naqvis> true, but they still made their position in the competition and become defacto
<FromGitter> <naqvis> almost everywhere you can find support from each and every mainstream vendor
<FromGitter> <naqvis> i would blame this to JS only lol
allisio has joined #crystal-lang
<allisio> Is it possible to multiple-assign to the result of a macro call without resorting to an Array in the macro?
<jhass> you can return a tuple
<jhass> or anything responding to #[](Int) really
<jhass> multi assign is just syntax sugar rewriting a, b = c to _tmp = c; a = _tmp[0]; b = _tmp[1]
<allisio> Right, sorry; I meant without having to "wrap" the body at all, since that's resulting in an inconvenient union type that doesn't manifest with plain-old multi-assign.
<allisio> But I see that the absolute minimal case of something like `1, 2` isn't a valid macro body, so I suspect I'm barking up the wrong tree.
<jhass> yeah I don't really see the issue with putting a { at the start of your macro and } at the end of it
<jhass> you want it to evaluate to multiple values anyways, but why force the user to always call it in a multiassign
<allisio> It's mostly that I want this particular bit of my DSL to look a certain way, but I'm realizing it's major yak-shaving.
<FromGitter> <Blacksmoke16> Got an example?
<FromGitter> <Daniel-Worrall> `ENV["CRYSTAL_WORKERS"]?.try &.to_i || 4` just used this little snippet to handle how many workers to initialise dynamically at runtime
<FromGitter> <Blacksmoke16> Isn't that what's built in already?
<FromGitter> <Daniel-Worrall> by workers, I mean for my script
<FromGitter> <Daniel-Worrall> An Array of Runtimes and an Array of Mutexes to synchronise to them
<FromGitter> <Blacksmoke16> Ahh gotcha
<FromGitter> <Daniel-Worrall> Yeah, it's concurrent-safe but not parralel safe so I'm wrapping it
<jhass> well our stance is to avoid shared state between fibers
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
hsh has joined #crystal-lang
<FromGitter> <ArtLinkov> Hi, I'm trying to edit the ameba config to higher cyclometric complexity, I changed `shards.yml` to this: ⏎ ⏎ ```ameba: ⏎ github: crystal-ameba/ameba ⏎ version: ~> 0.12.1 ⏎ MaxComplexity: 30``` ⏎ ⏎ But it doesn't seem to work, any suggestions? (other than `ameba --except Metrics/CyclomaticComplexity` everytime I run ameba) [https://gitter.im/c
<FromGitter> ... rystal-lang/crystal?at=5ecbcbc43ffa6106f1d1f5a3]
<FromGitter> <Blacksmoke16> Pretty sure it doesn't go in shard.yml
<FromGitter> <Blacksmoke16> I'd check their docs
<FromGitter> <ArtLinkov> Oh... I'll take a look
<FromGitter> <naqvis> you need to run `ameba --gen-config` to create `.ameba.yml` file and there you can tweak the settings
<FromGitter> <ArtLinkov> Yeah, I see it now :) ⏎ Thanks @Blacksmoke16 @naqvis
zorp_ has joined #crystal-lang
<FromGitter> <j8r> @Blacksmoke16 I succeeded to have a generic deserializer: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ work with YAML too [https://gitter.im/crystal-lang/crystal?at=5ecbd3bb2c49c45f5a9edbbc]
<FromGitter> <j8r> can support custom annotations in the future
allisio has left #crystal-lang ["WeeChat 2.8"]
<raz> O. that looks neat
<FromGitter> <Blacksmoke16> interesting
<FromGitter> <Blacksmoke16> ill be curious to see how it pans out
<FromGitter> <j8r> I'll release more than a POC first, that will have to be refined.
<FromGitter> <j8r> It would be great if advanced stuff like exclusion strategies could be pluged-in
<FromGitter> <Blacksmoke16> the Deserializer is tied to `JSON::PullParser` tho?
<FromGitter> <j8r> no
<FromGitter> <j8r> here is a preview: https://carc.in/#/r/956u
<FromGitter> <j8r> and for now there is no serializer, just a a dumb `each_ivar do ...` method πŸ˜…
<FromGitter> <j8r> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ecbd9d24412600ccd67d54a]
<FromGitter> <j8r> won't be hard to do, still need to work on this
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <Blacksmoke16> does it work?
<FromGitter> <Blacksmoke16> `unless ann && ann[:ignore]` does that mean the annotation is required?
<FromGitter> <Blacksmoke16> i know `String` has quite a few ivars internally that messed up some stuff i tired to do a while ago
<FromGitter> <Blacksmoke16> since it would try to set all of those as well
<FromGitter> <j8r> annotation is not required
<FromGitter> <j8r> `unless ann && ann[:ignore]` means `if !(ann && ann[:ignore])`, so if there is an annotation with a ignore
<FromGitter> <j8r> I have taken this from stdlib :)
<FromGitter> <didactic-drunk> Can I use a `macro` to add types to an array of types? ⏎ I have callbacks from a c function I'm trying to send through a channel without defining the method args 3-4 times. ⏎ Simplified example: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ecbde0dff7a920a720e40c3]
<FromGitter> <Blacksmoke16> ah right
<FromGitter> <Blacksmoke16> @didactic-drunk something like that would prob work yea
<FromGitter> <Blacksmoke16> might need to use standard `{% for x in y %}` syntax tho
<FromGitter> <didactic-drunk> How do I make `MSGS` work taking arbitrary types?
<FromGitter> <didactic-drunk> I don't need `MSGS` at runtime. Is there a compiler storage definition? @@@msgs?
<FromGitter> <Blacksmoke16> how do you mean? its all at compile time so there arent really any types
<FromGitter> <didactic-drunk> ``` 225 | MSGS = [] ⏎ ^ ⏎ Error: for empty arrays use '[] of ElementType'``` [https://gitter.im/crystal-lang/crystal?at=5ecbdfceff7a920a720e469f]
<FromGitter> <Blacksmoke16> just throw a `of Nil` on there
<FromGitter> <didactic-drunk> Thats what I missed.
<FromGitter> <didactic-drunk> and how to extract `args` in to `a, b` instead of `a : Int32, b : String`
<FromGitter> <Blacksmoke16> `a : Int32` is of type https://crystal-lang.org/api/master/Crystal/Macros/TypeDeclaration.html
<FromGitter> <didactic-drunk> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ecbe464225dc25f54a4d130]
<FromGitter> <Blacksmoke16> im not so sure it works like that
<FromGitter> <Blacksmoke16> prob have to do `MSGS.map { |tup| ... }
<FromGitter> <didactic-drunk> ``````
<FromGitter> <didactic-drunk> How do I turn the msg in to function arguments? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ecbeebe3ffa6106f1d256f7]
<FromGitter> <Blacksmoke16> `func_args` should be what? `a, b`?
DTZUZU has quit [Ping timeout: 256 seconds]
<FromGitter> <didactic-drunk> mdata is a tuple. Maybe `a: mdata[0]`? Or anything that works
<FromGitter> <Blacksmoke16> if you setup the ata as a named double could do like `mdata.double_splat`
<FromGitter> <Blacksmoke16> data
DTZUZU has joined #crystal-lang
<FromGitter> <didactic-drunk> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ecbf06f27513a72fbb034a3]
<FromGitter> <didactic-drunk> How did this turn in to a `NumberLiteral`? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ecbf0f23ffa6106f1d25f67]
<FromGitter> <Blacksmoke16> `name` is the tuple, `margs` is the index
<FromGitter> <Blacksmoke16> be easier if you did like `MSGS << { name: name, args: args }` then you could more easily iterate over just the args
<FromGitter> <Blacksmoke16> ```{% for data in MSGS %} ⏎ {% for arg in data[:args %}``` [https://gitter.im/crystal-lang/crystal?at=5ecbf1474412600ccd681966]
FromGitter has quit [Read error: Connection reset by peer]
oprypin has quit [Ping timeout: 260 seconds]
oprypin has joined #crystal-lang
alexherbo2 has joined #crystal-lang
zorp_ has quit [Ping timeout: 246 seconds]
hsh has quit [Quit: Connection closed for inactivity]
FromGitter has joined #crystal-lang
<oprypin> .
DTZUZU has quit [Ping timeout: 265 seconds]
DTZUZU has joined #crystal-lang
<FromGitter> <j8r> should JSON be pretty printed by default?
alexherbo2 has quit [Ping timeout: 256 seconds]
<FromGitter> <j8r> I think yes
<FromGitter> <igor-alexandrov> Hi, folks! I am getting a strange error when getting a size of PNG file without fully reading it: https://play.crystal-lang.org/#/r/9584. When reading file completely everything works well: https://play.crystal-lang.org/#/r/9586
<oprypin> @igor-alexandrov: why are u doing `gets`
<oprypin> isn't that like "up to newline" or something
<oprypin> what's your error
<FromGitter> <igor-alexandrov> Yes, it reads "up to newline", and this is why I have a loop
<FromGitter> <igor-alexandrov> I am not getting an error, I am getting different results (see comments)
<oprypin> but u delete newlines in that way
<oprypin> btw u can just get `body_io`
<FromGitter> <igor-alexandrov> `body_io` does not allow position moving
<oprypin> uhhhh yea
<FromGitter> <j8r> released: https://github.com/j8r/crystalizer#usage
<FromGitter> <Blacksmoke16> That was quick
<FromGitter> <j8r> For [de]serializing anything, to "any" format
<FromGitter> <j8r> Quick, don't know. I have the idea since a long time, I have resumed the works since several weeks
<FromGitter> <j8r> I think it would be great to work together on this one @Blacksmoke16 :)
<FromGitter> <Blacksmoke16> id say its more of a wrapper around stdlib stuff. any new formats would require moneky patching to add the pull parser methods, in addition to actually implementing a pull parser no?
<FromGitter> <j8r> No
tdc has quit [Ping timeout: 264 seconds]
<FromGitter> <Blacksmoke16> is pretty slick tho, nice approach
<FromGitter> <Blacksmoke16> no?
<FromGitter> <j8r> I just called the `to_json` and `new` of the stdlib to avoid reimplementing everything
<FromGitter> <j8r> I can perfectly copy-paste on it, just lazy :)
<FromGitter> <Blacksmoke16> yea thats fair. I just mean like what if you wanted to implement message pack?
<FromGitter> <Blacksmoke16> wouldnt that be a non trivial thing?
<FromGitter> <j8r> In addition of YAML and JSON?
<FromGitter> <Blacksmoke16> yea
<FromGitter> <j8r> That's not hard
<FromGitter> <j8r> look at for example `json.cr` and the `json` directory
<FromGitter> <j8r> a new module lie `MessagePack` will call `Crystalizer.each_var` for serialization, and do whatever it needs to convert an object to messagepack
<FromGitter> <Blacksmoke16> but doesnt that assume the format already has some form of pull parser logic?
<FromGitter> <j8r> not really
<FromGitter> <j8r> You mean
<FromGitter> <j8r> Iterating over ivars is not always possible?
<FromGitter> <j8r> for me it is logical for formating each to a given format
<FromGitter> <Blacksmoke16> https://github.com/j8r/crystalizer/blob/master/src/json/deserialize.cr#L23 like this assumes that the type already has an overload available that accepts the pull parser
<FromGitter> <j8r> that's for json
<FromGitter> <j8r> of course, it uses the stdlib here
<FromGitter> <Blacksmoke16> yea, for message pack there would ofc have to be some additional code to define *how* they get serialized and such yea?
<FromGitter> <j8r> but normally, everything should be in the same module
<FromGitter> <j8r> for message pack, you'll have a custom module, right?
<FromGitter> <j8r> With a custom method, which can call whatever you want
<FromGitter> <igor-alexandrov> @oprypin and I am not deleting new lines, you should pass `true` to `gets` to delete them
<FromGitter> <j8r> or do you want to convert JSON to messagepack?
<FromGitter> <j8r> for example, look at yaml
<FromGitter> <j8r> It doesn't use a pull parser
<oprypin> j8r, could you add the output of what that example produces, for posterity
<FromGitter> <j8r> oprypin right, absolutely
<FromGitter> <j8r> Done, thanks
<oprypin> igor-alexandrov, look even if my explanation wasnt exactly correct, it's still purely due to newlines
<oprypin> i just add `p io.to_s`
<FromGitter> <j8r> @Blacksmoke16 I'm thinking how adding advanced features can be done, like you exclusion strategies
<oprypin> good: `"\x89PNG\u001A\u0000\u0000\u0000\rIHDR\u0000.........`
<oprypin> bad: `"\x89PNG\r\n\u001A\n\u0000\u0000\u0000\rIHDR\u0000..........`
<FromGitter> <igor-alexandrov> Yes, I already found this. Thank you!
<oprypin> wait no, my explanation *was* correct
<oprypin> https://crystal-lang.org/api/0.34.0/IO.html#gets(chomp=true):String?-instance-method
<oprypin> good/bad swapped, too
<FromGitter> <Blacksmoke16> @j8r would be a bit hard w/o some abstraction of the ivars i think
<FromGitter> <Blacksmoke16> er but i think you have that
<FromGitter> <j8r> I think it may be possible for you to use the library. ⏎ The only thing to support is custom annotations
<FromGitter> <j8r> not easy to do :/
<FromGitter> <j8r> maybe, yield a named tuple with all extra annotations...
<FromGitter> <Blacksmoke16> would be required for it
<FromGitter> <Blacksmoke16> as that was my approach as well
<FromGitter> <j8r> Or maybe, it can be done with `annotation : A.class) forall A`
<FromGitter> <Blacksmoke16> :thinking:
<FromGitter> <Blacksmoke16> how would that work?
<FromGitter> <j8r> Inside the method, then you can use `A` in macros
<FromGitter> <j8r> I have not tested, not sure it works
<FromGitter> <Blacksmoke16> right, but how would you know the annotation type to query for, and/or the logic to apply to that annotation?
<FromGitter> <j8r> It works :D
<FromGitter> <j8r> Let me think
<FromGitter> <j8r> (test code: https://carc.in/#/r/9591)
<FromGitter> <j8r> having overloads
<FromGitter> <j8r> or use generics
<FromGitter> <j8r> by using the annotation type class (here `Field`)
<FromGitter> <Blacksmoke16> huh
<FromGitter> <Blacksmoke16> well how does this help tho?
<oprypin> @naqvis, i'd say this is pretty epic https://i.imgur.com/igI8SVq.png
<FromGitter> <Blacksmoke16> given there is only one overload, would also need access to the args within it
<FromGitter> <watzon> What's the existing alias for number types again?
<straight-shoota> hey crystalizer looks great
<FromGitter> <watzon> What is this "crystalizer"?
<FromGitter> <j8r> I was thinking of https://carc.in/#/r/9597
<FromGitter> <Blacksmoke16> ah gotcha
<FromGitter> <j8r> then one can iterate over kwargs. Not ideal, but flexible
<FromGitter> <watzon> Oh nice! (De)serialization without needing to require a module or anything? Sign me up.
<straight-shoota> Hm, but the architecture is based on a pull parser. So that only work for self-describing formats like JSON and YAML.
<FromGitter> <j8r> Thanks. What tell you that?
<oprypin> wait no, the JS doesnt actually work πŸ˜…
<FromGitter> <j8r> JSON use pull parser, but not YAML for deserialization
<straight-shoota> I'm not talking about the specific format implementations
<FromGitter> <j8r> the thing the library provides is: ⏎ ⏎ 1) Serialization: iterates over ivars, and give metadata ⏎ 2) Deserialization: creates ivars from a string key and a block [https://gitter.im/crystal-lang/crystal?at=5ecc3c3a9da05a060a2e17ae]
<FromGitter> <watzon> @j8r what are your thoughts on adding to crystalizer the ability to do what I thought `key` and `root` already did in `JSON::Serializable`?
<FromGitter> <watzon> Basically giving the ability to dig into a json structure and pull a value out
<straight-shoota> The design of Deserializer expects the format implementation to tell which keys it has
<straight-shoota> The format implementation needs to know the format of keys
<FromGitter> <j8r> Ha ok. I could add an other method, which iterates over ivars then?
<FromGitter> <j8r> the format implementation of course get the type of they key, otherwise how to format it?
<straight-shoota> For non-selfdescribing formats, the type must come from the deserializer
<FromGitter> <j8r> It does already?
<FromGitter> <j8r> the type is yielded
<straight-shoota> I mean the key type
<FromGitter> <j8r> ha, ok. I'm gonna add this then, that's easy :)
<straight-shoota> I don't think it is
<straight-shoota> =)
<straight-shoota> But give it a try
<FromGitter> <j8r> `Deserializer#each_ivar(&)`?
<straight-shoota> I've been looking into how serde does this all
<straight-shoota> Didn't get very far though
<FromGitter> <j8r> What are not self-describing format?
<straight-shoota> I'd recommend taking a look at that because it seems to be a really good serialization library
<straight-shoota> Most binary formats are non-self-describing
<straight-shoota> serde uses an internal data model for mapping between serialization format types and language types: https://serde.rs/data-model.html#types
<straight-shoota> For a self-describing format, the deserializer can be used with `deserialize_any`, so the format implementation looks at the data and figures out the data type
<straight-shoota> For non-self-describing formats, the deserializer must be told the data type to expect. And the implementation decides which format type corresponds to the serde type it's been told
<FromGitter> <j8r> thanks to have clarified that
<FromGitter> <j8r> In my case, I think it could be just an overload
<FromGitter> <j8r> (there is already a way to iterate over ivars)
<FromGitter> <j8r> `def set_ivar(key : String, value)`
<FromGitter> <j8r> so: ⏎ ⏎ 1) iterate over ivars, which yields they key + type ⏎ 2) do the logic ⏎ 3) set the ivar value [https://gitter.im/crystal-lang/crystal?at=5ecc40652280c80cbfca085a]
<FromGitter> <j8r> ho, that's already possible - nothing to do lol
<FromGitter> <j8r> Anyway, I did know serde and it looks great. I struggle to fully comprehend Rust code :/
<FromGitter> <j8r> @watzon looking at the issue
<FromGitter> <j8r> I think also `root` is confusing compared to `key`
<FromGitter> <j8r> It would be cleared to have something like `key: "some.path"` - Even if it is not possible
<FromGitter> <j8r> because of key which can have dots, which would need to be escaped etc
<FromGitter> <watzon> Yeah, you could also use some other kind of separator, but it would be nice
<FromGitter> <watzon> `key` could also be a `String | Array(String)`, and if it's an array it would use each item as a key.
<FromGitter> <watzon> That's more or less what @Blacksmoke16 did I believe
<FromGitter> <Blacksmoke16> i just a did a tuple and pass that to `.dig`
<FromGitter> <watzon> That makes sense. Pretty simple.
<FromGitter> <Blacksmoke16> its going to be harder in his case since the data isnt fully parsed yet
<FromGitter> <watzon> Mmmm
lanodan has quit [Ping timeout: 260 seconds]
lanodan has joined #crystal-lang
<FromGitter> <watzon> Ok there has to be an error in `HTTP::Client` or the `OpenSSL` binding itself somewhere. I was noticing issues myself, and now I've received an issue report in Tourmaline about it https://github.com/protoncr/tourmaline/issues/25
<FromGitter> <watzon> Seems to be in OpenSSL itself based on the trace