ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.29.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
Groogy has quit [Ping timeout: 248 seconds]
<FromGitter> <girng> :D
duane has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d2a7f704d750532413f01af]
<FromGitter> <Blacksmoke16> thats a new one
<FromGitter> <watzon> That is a new one
<FromGitter> <Blacksmoke16> interesting
<FromGitter> <Blacksmoke16> and of course these are never easy to reduce
<FromGitter> <watzon> Nope they're the worst
<FromGitter> <Blacksmoke16> alright well its a bug with my serializer shard
<FromGitter> <Blacksmoke16> rofl
<FromGitter> <Blacksmoke16> which seems to be caused by me removing some code i left for testing last release
<FromGitter> <Blacksmoke16> oo i got it
<FromGitter> <Blacksmoke16> now to reduce
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/7858
<FromGitter> <Blacksmoke16> moving the newing up the of validator into a macro included seems to fix it
<FromGitter> <Blacksmoke16> ill make an issue
<FromGitter> <watzon> I just realized, I actually got that same error recently
<FromGitter> <watzon> I think while working on Apatite
<FromGitter> <Blacksmoke16> Able to reproduce?
<FromGitter> <watzon> Haven't tried. The playground seems sufficient.
<FromGitter> <Blacksmoke16> πŸ‘
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> oh boy that's a nasty one haha
<FromGitter> <Blacksmoke16> similar to https://github.com/crystal-lang/crystal/issues/6996 in a way
<FromGitter> <Blacksmoke16> nearly the same code
<FromGitter> <Blacksmoke16> well issue there is prob inheritance, so prob not really related
<FromGitter> <Blacksmoke16> easy work around at least
<FromGitter> <Blacksmoke16> @girng i found your music thread :P
<FromGitter> <Blacksmoke16> added some of my fav bands
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
<FromGitter> <girng> @Blacksmoke16 4 months too late bro, what's wrong with you
<FromGitter> <girng> πŸ˜†
<FromGitter> <Blacksmoke16> must have been when i wasnt on it too much
rohitpaulk has joined #crystal-lang
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <watzon> What do y'all think of this? https://github.com/watzon/crego
<FromGitter> <watzon> Work in progress, but I don't think it will take me too long to finish
<FromGitter> <Blacksmoke16> https://github.com/maxfierke/fincher is also this one :P
<FromGitter> <Blacksmoke16> happened to see that on github haha
<FromGitter> <Blacksmoke16> dunno if it still works tho
<FromGitter> <watzon> Lol I didn't even think to look for an existing implementation
<FromGitter> <watzon> Oh well, I've been wanting to play with steganography for a while
laaron has quit [Client Quit]
<FromGitter> <Blacksmoke16> well there you go
laaron has joined #crystal-lang
laaron has quit [Client Quit]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <girng> wtf
<FromGitter> <girng> why would you want to think you are finding hidden messages through typos
<FromGitter> <watzon> Yeah I don't quite get that version of stego
<FromGitter> <Blacksmoke16> :P
<FromGitter> <girng> sounds like a feature that should be in TempleOS
<FromGitter> <watzon> πŸ˜‚
laaron has quit [Client Quit]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> @watzon cool :)
rohitpaulk has quit [Ping timeout: 245 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <girng> ROFL at that Rust comment
absolutejam3 has joined #crystal-lang
gangstacat has quit [Quit: Ĝis!]
sorcus has joined #crystal-lang
absolutejam3 has quit [Ping timeout: 246 seconds]
absolutejam3 has joined #crystal-lang
_whitelogger has joined #crystal-lang
gangstacat has joined #crystal-lang
absolutejam3 has quit [Ping timeout: 258 seconds]
DTZUZU has quit [Read error: Connection reset by peer]
alex`` has joined #crystal-lang
_whitelogger has joined #crystal-lang
ht_ has joined #crystal-lang
alex`` has quit [Ping timeout: 244 seconds]
alex`` has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <girng> heyyy @r00ster91
<FromGitter> <girng> i see you, how r u, where u been
<FromGitter> <bajro17> @watzon where are you from ?
<FromGitter> <watzon> The US
<FromGitter> <bajro17> I see you are so good in crystal until now
<FromGitter> <bajro17> Can you maybe record udemy course or yt
<FromGitter> <bajro17> on udemy until now 0 courses about crystal I cant find anyway any good course
<FromGitter> <watzon> You know that might not be a bad idea
<FromGitter> <bajro17> I try record courses on yt but my voice is bad and I need time to say something on english :D
<FromGitter> <bajro17> at same time you can help a lot of people to learn and also earn some money
dwdv has joined #crystal-lang
<FromGitter> <watzon> I'll definitely look into it :)
<FromGitter> <watzon> Well I did it y'all! You'd never know it, but this image contains embedded text
<FromGitter> <bararchy> @watzon Stenography ?
<FromGitter> <bajro17> @watzon if you do it please ping me I will buy it instantly :)
<FromGitter> <girng> should i just do if test.size > 0 ?
<dingenskirchen> try adding a `remove_empty: true` to `split`'s param list
<FromGitter> <girng> @dingenskirchen thanks!
<FromGitter> <girng> works
<dingenskirchen> ^^
sagax has quit [Ping timeout: 258 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 246 seconds]
<dingenskirchen> how bad on the sin scale would you rate adding (limited) UFCS to a language that doesn't have it?
_whitelogger has joined #crystal-lang
absolutejam3 has joined #crystal-lang
alex`` has quit [Ping timeout: 272 seconds]
alex`` has joined #crystal-lang
absolutejam3 has quit [Ping timeout: 245 seconds]
lucasb has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 248 seconds]
alex`` has joined #crystal-lang
dingenskirchen has quit [Remote host closed the connection]
<FromGitter> <girng> rofl
<FromGitter> <girng> wtf
_whitelogger has joined #crystal-lang
alex`` has quit [Ping timeout: 272 seconds]
alex`` has joined #crystal-lang
gangstacat has quit [Ping timeout: 252 seconds]
gangstacat has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<jokke> hey is it possible to have my shard pull git submodules?
<jokke> i need to pull an extension repostitory (not crystal)
<FromGitter> <Blacksmoke16> when its installed?
<jokke> yeah
<FromGitter> <Blacksmoke16> could you add a postinstall hook?
<jokke> yeah i did that
<FromGitter> <Blacksmoke16> that would prob do it
<jokke> but since it's not a git repo at the time it's being called the git submodule commands wont do anything
<jokke> but i just did it with a clone now
<jokke> i call make ext in the postinstall hook
<FromGitter> <Blacksmoke16> that'll work
<FromGitter> <girng> @Blacksmoke16 can you take a look at dingens code above and ELI5 plz
<FromGitter> <Blacksmoke16> not actually sure
<FromGitter> <Blacksmoke16> ah i see
<FromGitter> <Blacksmoke16> looks like he just added a macro that adds a method missing macro hook
<FromGitter> <Blacksmoke16> which adds a `#puts` method to `String`
<FromGitter> <girng> wat lol
<FromGitter> <girng> aww macro shenanigans
<FromGitter> <girng> yeah f that
<FromGitter> <girng> thx for explanation though
<FromGitter> <girng> i don't like macros
<FromGitter> <Blacksmoke16> anymore? :P
<FromGitter> <girng> yeah lol, used to but i just don't use em anymore
<FromGitter> <girng> hard to explain, but yeah
<FromGitter> <girng> i feel like they are "yet another programming language" you need to learn
<FromGitter> <girng> when i already got my bread and butter with crystal
<FromGitter> <Blacksmoke16> do you use `property/getter`?
<FromGitter> <girng> I mean, macroland syntax {%, etc
<FromGitter> <Blacksmoke16> it has its uses
<FromGitter> <girng> true
<FromGitter> <j8r> @girng that's the good approach, not to use macros when not strongly needed
<FromGitter> <girng> thx
<FromGitter> <j8r> else it can quickly become a mess to debug
<FromGitter> <j8r> and understand
sagax has joined #crystal-lang
<FromGitter> <andrius> Hi, I am not sure is this is a right place to ask. Learning crystal-lang, currently I do some API thing; I have class with `DB.mapping` and `JSON.mapping`, and things works great except I do need special conditional converter: some of `Bool` fields from JSON should be converted to the nil (if they was null) or to a string with values 'yes' and 'no' in the database (and in opposite way). Unfortunately all the
<FromGitter> ... experiments I did was failed, can't really get it working right and getting something like this: `Expected string but was bool at 1:32 (JSON::ParseException)`. Any references to start with?
<FromGitter> <Blacksmoke16> sec
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d2b5c5801621760bcb35bf8]
<FromGitter> <Blacksmoke16> then use it like `bool_field: {type: Bool, converter: BoolConverter},`
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/cr can give a better example if you can give some example code in the playground
<FromGitter> <andrius> Great it works! :) https://play.crystal-lang.org/#/r/7888
<FromGitter> <girng> blacksmoke is a beast
<FromGitter> <Blacksmoke16> Probably would error if it's null tho
<FromGitter> <Blacksmoke16> Would need to handle that if it's a possible value
<FromGitter> <andrius> And another question, I shall populate through HTTP::Client an big object (reduced swagger-like specification), in ruby that's trivial – I just making hash with all the embedded sub-hashes, convert to json and post. What would be the best way with Crystal? Do I need a builder for given object?
<FromGitter> <Blacksmoke16> Should just be able to do to_json on the hash
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
DTZUZO has joined #crystal-lang
ht_ has quit [Quit: ht_]
ht_ has joined #crystal-lang
dingenskirchen has joined #crystal-lang
alex`` has quit [Ping timeout: 245 seconds]
dingenskirchen has quit [Remote host closed the connection]
alex`` has joined #crystal-lang
dingenskirchen has joined #crystal-lang
absolutejam3 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 245 seconds]
dingenskirchen1 has joined #crystal-lang
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen1 is now known as dingenskirchen
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #crystal-lang
dingenskirchen has quit [Client Quit]
dingenskirchen has joined #crystal-lang
laaron- has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
absolutejam4 has joined #crystal-lang
absolutejam3 has quit [Ping timeout: 268 seconds]
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #crystal-lang
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #crystal-lang
dingenskirchen has quit [Client Quit]
dingenskirchen has joined #crystal-lang
lucasb has quit [Quit: Connection closed for inactivity]
ht_ has quit [Quit: ht_]
lucasb has joined #crystal-lang
<FromGitter> <tenebrousedge> dingenskirchen : why UFCS?
<dingenskirchen> wdym why?
<FromGitter> <tenebrousedge> what's the use-case?
<dingenskirchen> oh right
<dingenskirchen> is a short text by walter bright on the idea
<FromGitter> <tenebrousedge> Using it for `puts` makes sense, but `puts` is somewhat unusual
<dingenskirchen> tl/dr more encapsulation by moving functions operating on objects out of the objects
<FromGitter> <tenebrousedge> isn't that what a mixin/module does?
<dingenskirchen> yeeah it kinda solves a similar problem
<dingenskirchen> it was more of a fun proof of concept than anything serious anyway :V
<FromGitter> <tenebrousedge> well, I appreciate the code and the explanation, thank you
<dingenskirchen> ^^
<dingenskirchen> oh god what happened to my nice ascii emote
<FromGitter> <tenebrousedge> looks normal here (Firefox / Linux)
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #crystal-lang
<dingenskirchen> probably thunderbird doing weird things
sorcus has quit [Ping timeout: 276 seconds]
<FromGitter> <asterite> @Blacksmoke16 Maybe you can play with this: https://gist.github.com/asterite/178ec225dde3063c6a3d545c1cfea25f
<FromGitter> <asterite> I needed to add a method to JSON::Builder, I'll later send it as a PR but for now you can use that monkey-patch
<FromGitter> <Blacksmoke16> whoa interesting
<FromGitter> <Blacksmoke16> ill check it out, thanks!
DTZUZO has joined #crystal-lang
absolutejam4 has quit [Ping timeout: 244 seconds]
<FromGitter> <asterite> I don't have more time today, but maybe tomorrow I'll try integrating it with oq (at least the parts that I can, not the XML right now)
<FromGitter> <asterite> I also kind of dislike that the json and yaml pull parser interfaces are so different... one uses enums, the other symbols... I'll probably change the symbols one to enums, I prefer type-safety
DTZUZO has quit [Ping timeout: 245 seconds]
<FromGitter> <Blacksmoke16> aye, working on XML input is next on my list
<FromGitter> <Blacksmoke16> i appreciate the help
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
<FromGitter> <Blacksmoke16> i think i see the benefit of this
<FromGitter> <Blacksmoke16> `OQ::Stream.json_to_yaml(ARGF, STDOUT)`
<FromGitter> <Blacksmoke16> `Maximum resident set size (kbytes): 8716`
<FromGitter> <Blacksmoke16> vs `JSON.parse(ARGF).to_yaml(STDOUT)` which has to load it into memory
<FromGitter> <Blacksmoke16> `Maximum resident set size (kbytes): 3038008`
<FromGitter> <Blacksmoke16> πŸ’―
<FromGitter> <Blacksmoke16> processing time got a bit better but uses sooo much less memory
<FromGitter> <Blacksmoke16> ill take a stab at the xml version, shouldnt be too bad now that i got something to go on
<FromGitter> <asterite> Yeah, the downside of streaming is that I think it's a bit slower to parse, but shouldn't be that terrible
<FromGitter> <Blacksmoke16> benchmark i did, it finished like 5 sec faster
<FromGitter> <Blacksmoke16> :shrug: ill take it
<FromGitter> <asterite> cool!
<FromGitter> <asterite> maybe faster because no memory needs to be allocated, or at least not that much
<FromGitter> <Blacksmoke16> Could be
lucasb has quit [Quit: Connection closed for inactivity]