RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.1 | 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
<FromGitter> <straight-shoota> 👍
<FromGitter> <straight-shoota> awesome
<RX14> lots of edge cases need to be worked out though
<FromGitter> <straight-shoota> sure
cremes has quit [Quit: cremes]
<FromGitter> <bew> great news!
<RX14> but it like
<RX14> runs
<RX14> which is something
rohitpaulk has joined #crystal-lang
kp666[m] has quit [Read error: Connection reset by peer]
logen[m] has quit [Read error: Connection reset by peer]
Renich has quit [Read error: Connection reset by peer]
crse[m] has quit [Remote host closed the connection]
cptaffe1 has quit [Remote host closed the connection]
olbat[m] has quit [Remote host closed the connection]
braidn[m] has quit [Read error: Connection reset by peer]
byteflame has quit [Remote host closed the connection]
galstar[m] has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
alex`` has quit [Remote host closed the connection]
snsei has quit [Ping timeout: 246 seconds]
olbat[m] has joined #crystal-lang
alex`` has joined #crystal-lang
<RX14> dirname is broken on windows...
<crystal-gh> [crystal] RX14 closed pull request #5390: BigDecimal enhancements (master...bigdecimal-tweaks) https://git.io/vbKvk
sz0 has quit [Quit: Connection closed for inactivity]
cremes has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vNIYK
<crystal-gh> crystal/master d023138 Benoit de Chezelles: Allow to init a crystal app/lib in an empty directory (#4691)
<FromGitter> <bew> how?
<RX14> it uses rindex by SEPARATOR
<RX14> without normalizing paths
<RX14> so all unix paths just fail
<RX14> (and unix paths should work just fin on windows as it accepts both seperators)
<travis-ci> crystal-lang/crystal#f7a931c (master - Extend BigDecimal with a few things (#5390)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/326187294
<DeBot> https://github.com/crystal-lang/crystal/pull/5390 (BigDecimal enhancements)
braidn[m] has joined #crystal-lang
logen[m] has joined #crystal-lang
cptaffe has joined #crystal-lang
galstar[m] has joined #crystal-lang
Renich has joined #crystal-lang
crse[m] has joined #crystal-lang
kp666[m] has joined #crystal-lang
byteflame has joined #crystal-lang
<travis-ci> crystal-lang/crystal#d023138 (master - Allow to init a crystal app/lib in an empty directory (#4691)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/326188149
<DeBot> https://github.com/crystal-lang/crystal/pull/4691 (Allow to init a crystal app/lib in an empty directory)
eperez has quit [Ping timeout: 264 seconds]
eperez has joined #crystal-lang
eperez has quit [Ping timeout: 248 seconds]
eperez has joined #crystal-lang
eperez has quit [Ping timeout: 265 seconds]
eperez has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
snsei_ has joined #crystal-lang
eperez has quit [Ping timeout: 276 seconds]
eperez has joined #crystal-lang
eperez has quit [Ping timeout: 248 seconds]
eperez has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
eperez has quit [Ping timeout: 276 seconds]
eperez has joined #crystal-lang
snsei has joined #crystal-lang
eperez has quit [Ping timeout: 265 seconds]
eperez has joined #crystal-lang
eperez has quit [Ping timeout: 265 seconds]
eperez has joined #crystal-lang
hightower has quit [Ping timeout: 265 seconds]
eperez has quit [Ping timeout: 276 seconds]
hightower has joined #crystal-lang
eperez has joined #crystal-lang
eperez has quit [Ping timeout: 264 seconds]
eperez has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
eperez has quit [Ping timeout: 276 seconds]
eperez has joined #crystal-lang
eperez has quit [Ping timeout: 276 seconds]
eperez has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
hightower has quit [Remote host closed the connection]
eperez has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
wontruefree has joined #crystal-lang
<wontruefree> is there anyway to pass a module function in a method?
<wontruefree> I think I figured it out
<wontruefree> something like `->self.foo_func`
<FromGitter> <bararchy> ```-2147483648 out of char range``` ⏎ ⏎ Is there a way to check Char range? like Int32::Max etc.. ? [https://gitter.im/crystal-lang/crystal?at=5a5300ef83152df26d435c20]
ashirase has quit [Ping timeout: 265 seconds]
ashirase has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <marksiemers> Hmm, there is a Char::MAX ⏎ Would something like this help: https://play.crystal-lang.org/#/r/3cp8
rohitpaulk has quit [Ping timeout: 268 seconds]
ashirase has quit [Ping timeout: 246 seconds]
ashirase has joined #crystal-lang
olbat[m] has quit [*.net *.split]
hmans has quit [*.net *.split]
hmans has joined #crystal-lang
olbat[m] has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <bararchy> Oh , awesome , thank @marksiemers
dragonkh has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Groogy_ is now known as Groogy
<Groogy> Morning guys! o/
<Groogy> Almost done with the base UI stuff, just need input fields finished and then multiline text boxes
<FromGitter> <bararchy> cool !
<FromGitter> <bararchy> great work Groogy
rohitpaulk has quit [Ping timeout: 248 seconds]
<Groogy> wanan get it done so I can work on the actual game besides the framework
mark_66 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<livcd> are you making a game framework in Crystal ? :0
claudiuinberlin has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
flaviodesousa has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
<Groogy> livcd yes
<livcd> that's a huge undertaking :)
<livcd> do you have any working demos out there ?
cbass has joined #crystal-lang
<FromGitter> <imonmyown> morning all!
<FromGitter> <imonmyown> so there's no single ended queue in stdlib, just deque?
<Groogy> Eh not really?
<Groogy> THere's my project ego
<FromGitter> <imonmyown> cool, can it work like a single ended queue?
cbass has quit [Ping timeout: 248 seconds]
<FromGitter> <straight-shoota> @imonmyown You can use Deque (https://crystal-lang.org/api/0.24.1/Deque.html) perfectly fine as single-ended queue
<FromGitter> <imonmyown> @straight-shoota yeah, I know, that's what I intended to do :)
cbass has joined #crystal-lang
<FromGitter> <decal> , ,
<FromGitter> <decal> , , V a
jnyw has quit [Quit: WeeChat 2.0.1]
<Groogy> imonmyown I was talking to livcd :P
Majost has quit [Read error: Connection reset by peer]
ilovezfs_ has quit [Read error: Connection reset by peer]
Majost has joined #crystal-lang
ilovezfs_ has joined #crystal-lang
dragonkh has joined #crystal-lang
<dragonkh> hi - how can I use the YAML.mapping() in a nested way? e.g. database:\n name: "development". - how would my class or struct look?
<FromGitter> <bew> @dragonkh something like this? https://carc.in/#/r/3cq4
<dragonkh> great thanks :) - I got confused with the attributes capability - and thought I could define nested mapping in a single class
<dragonkh> but I understand now :)
<FromGitter> <bew> you're welcome ;)
hightower3 has joined #crystal-lang
<FromGitter> <bajro17> Groogy can you please send me your github repo for this project if its on github it look so nice 👏
hightower2 has quit [Ping timeout: 265 seconds]
<FromGitter> <bajro17> also I need help if anyone know is there shard for braintree or paypal I cant find it on google
<dragonkh> if google says no - then it's unlikely they exist
<dragonkh> @bajro17 - seems they don't exist yet
<FromGitter> <bajro17> maybe it will be good idea to convert existing one from other language to crystal :)
<dragonkh> converting a ruby one maybe?
<FromGitter> <bajro17> yes I will try I will publish it if I do it successful
<FromGitter> <bajro17> anyway thank you so much dragonkh for help 👍
<dragonkh> paypal has their own sdk for ruby: https://github.com/paypal/PayPal-Ruby-SDK
<FromGitter> <bajro17> I'm beginner it will help me to understand better crystal
<dragonkh> me too :)
<dragonkh> but I've been doing ruby for a long time so I'm finding Crystal is similar enough that conversions are not too bad
<FromGitter> <bajro17> I dont I use before golang and php (mostly laravel)
<FromGitter> <bajro17> but I see crystal with so bright future and I like so much how clean syntax is
<FromGitter> <sdogruyol> hey welcome @bajro17 👍
<FromGitter> <bajro17> thank you so much Kemal father :D @sdogruyol
<FromGitter> <sdogruyol> thank you 😄
<FromGitter> <bajro17> I have also question for you @sdogruyol I'm hopeless few years I search for job with no success and now I decide to search in Turkey if you know any site in Turkey where I can search for job (I know its not topic for here but I see you are so active on gitter)
<FromGitter> <sdogruyol> where are you from? Why Turkey?
<FromGitter> <bajro17> I'm from Bosnia
<FromGitter> <sdogruyol> oh Bosnia, awesome!
<FromGitter> <sdogruyol> I want to visit there :)
<FromGitter> <bajro17> Bujrum whenever you want bro
<FromGitter> <bajro17> so much buildings stay from time of Turkish empire
<FromGitter> <bajro17> if I learn more about crystal we can even try make some crystal con
<FromGitter> <sdogruyol> that'd be great 💯
<FromGitter> <sdogruyol> about Turkis software market, there's not many Ruby jobs around
<FromGitter> <sdogruyol> Turkish*
<FromGitter> <bajro17> I will be happy even with laravel or golang
<FromGitter> <sdogruyol> Lots of PHP though
<FromGitter> <bajro17> do you still live there?
<FromGitter> <bajro17> also do you have kemal auto generate auth?
<FromGitter> <bajro17> because all time I scare about security in my app :D
Papierkorb has quit [Remote host closed the connection]
<FromGitter> <sdogruyol> yes, I live in Istanbul
<FromGitter> <sdogruyol> auto generate auth?
<FromGitter> <bajro17> yes
<FromGitter> <bajro17> auth scafolding
<FromGitter> <bajro17> like in amber
<FromGitter> <sdogruyol> have you checked http://crystalshards.xyz/?filter=auth yet?
<FromGitter> <bajro17> kemal basic auth
<FromGitter> <bajro17> thank you
<FromGitter> <sdogruyol> ugh, not sure if basic-auth is enough for your needs :)
<FromGitter> <bajro17> I still than need convert paypal sdk and I will publish my website I will send you message when it be published to you can put also that my website use kemal in production
<FromGitter> <bajro17> :)
<FromGitter> <sdogruyol> sure
<FromGitter> <bajro17> thank you so much
dragonkh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
<Groogy> is the framework
martinium_laptop has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <bajro17> Groogy I like it bro so good if any need help I would like to help also if need anything
<Groogy> if you use it and feel theres things to add just go ahead and do PR's
snsei has quit [Ping timeout: 240 seconds]
<Groogy> I only implement stuff when I actually need them
<FromGitter> <bajro17> I will try to make some sample for you to you can put it
jokke has quit [Quit: WeeChat 2.0.1]
<FromGitter> <bajro17> you dont have anything for sound?
<Groogy> nope not yet
<FromGitter> <bajro17> Even I have some doubt about this language before after I see this community I'm sure it will be awesome
<FromGitter> <bajro17> never see more friendly and more helpful community ever
<FromGitter> <straight-shoota> Groogy, you should use `Time.monotonic` for clock
<Groogy> hm why?
<Groogy> oh so that a change in the system time doesn't make the Clock class think that time jumped forward
martinium_laptop has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jokke has joined #crystal-lang
<Groogy> yeah that's true
<FromGitter> <vpereira> I'm wondering if https://crystal-lang.org/api/0.24.1/Deque.html pop is a block operation?
<FromGitter> <yxhuvud> no it returns nil if it is empty
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
<FromGitter> <vpereira> @yxhuvud thank you
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
<FromGitter> <straight-shoota> Groogy, or backward
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
<FromGitter> <asterite> Time.new should store monotonic, cough, cough
<FromGitter> <asterite> My guess is that using Time.new to measure elapsed time will happen over and over again
<FromGitter> <asterite> Too bad Go's designed wasn't liked
<FromGitter> <marksiemers> Groogy, I think you should add that screenshot (or others) to the github readme.
<Groogy> for Boleite?
<FromGitter> <marksiemers> Yeah, or Ego.
<Groogy> I'll put that up when I got some more content in the project
<Groogy> so it doesn't look so empty
Papierkorb has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
<FromGitter> <straight-shoota> @asterite I was under the impression Crystal should be a general purpose application language, not just for webapps... 😕
<RX14> @asterite I liked go's design
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <asterite> we could always change it later
<FromGitter> <asterite> Yeah, theoretiaclly crystal is a general purpose programming language, but practically it's not, I think
<FromGitter> <asterite> Most stuff people do are webapps, and you can see that by the huge amount of "frameworks"
<RX14> @asterite I don't think it's worth worrying about what most people use it for
<RX14> I think of crystal as very general-purpose and I don't really think there's any reason to worry about what it's used for in practice
<FromGitter> <asterite> I know
<RX14> you don't generally have to tradeoff between usecases I think
<FromGitter> <asterite> it's just that I can't imagine a running crystal program and a catastrophic change in local location
<FromGitter> <asterite> It's either a server, which doesn't travel
<FromGitter> <asterite> A game, maybe? You are playing on a plain
<FromGitter> <asterite> If Go caches the local time and nobody is complaining about that (I can't find hits in Google) then it seems safe
<RX14> exactly
<RX14> I think most programs will cache it
<RX14> and most users will be very used to changes in /etc/localtime not reflecting until processes are restarted
<RX14> wither they're in C or in Go or in Crystal
<RX14> so don't worry about it and tradeoff performance like the rest
<RX14> but provide an option for some applications to optionally implement spawn { loop { sleep 5; Location.invalidate_cache } }
<RX14> and then everyone's happy
<FromGitter> <asterite> Right
<RX14> @straight-shoota please just implement it as we've asked...
ashirase has quit [Ping timeout: 265 seconds]
<FromGitter> <asterite> By the way, I was thinking that we could implement JSON like this: https://play.crystal-lang.org/#/r/3cqk
<FromGitter> <asterite> then we just need to be able to attach attributes to instance vars to control the serialization
<FromGitter> <asterite> but by default just doing `include JSON::Serializable` will do it, for example inside a `record` block
<FromGitter> <asterite> Plus it supports inheritance
<RX14> i'm not really a fan of the whole "include a module to run macros" job
<RX14> if you're join that why not just have
<RX14> JSON.serializable
<RX14> instead of include JSON::Serializable
<RX14> and it's not overloading one syntax for 2 things?
<FromGitter> <asterite> what does JSON.serializable do?
<RX14> it's a macro
<FromGitter> <asterite> Ah, let me try
<FromGitter> <asterite> Yeah, it doesn't work
<FromGitter> <asterite> because you want to generate macro code inside `initialize`
<FromGitter> <asterite> so you need to start using \{%
<FromGitter> <asterite> well, `\{%`
<FromGitter> <asterite> and stuff like that
<FromGitter> <asterite> so ugly
<RX14> ugh
<FromGitter> <asterite> That's why I ended up with that
<FromGitter> <asterite> In fact, it almost works by change because macros inside methods are only computed when the method is invoked/instantiated
<FromGitter> <asterite> Macros seem like a very big hack in the language... I wonder how it could be done right
<RX14> probably quote/unquote
<RX14> but I like them
<RX14> they're ugly
<FromGitter> <asterite> :-P
<RX14> quote/unquote makes the syntax clean on something which is still ugly
<RX14> it just hides the ugliness
<RX14> everyone accepts that macros are ugly if they're the way they are right now
<RX14> and I like it
flaviodesousa has quit [Ping timeout: 248 seconds]
<FromGitter> <asterite> Actually, including a module might be fine. When you include a module you get new methods. In this case you get JSON-serialization methods
<RX14> yeah
<FromGitter> <asterite> plus you can ask `if type.is_a?(JSON::Serlializable)`
<RX14> i thought about it some more and it kinda makes sense
<FromGitter> <asterite> (though it won't work for primitive types)
<RX14> another thing is that you no longer have the to_json on Object
<RX14> which trips people up sometimes
<FromGitter> <asterite> Right, I'd like to define it on that module too
<RX14> you just have it on JSON::Serializable
<FromGitter> <asterite> Then, I also like the idea of just doing `@[JSON::Field(key: "foo")]` (or some other name)
<RX14> well
<FromGitter> <asterite> I think for now we could start without having to define `JSON::Field` nor what it can hold
<FromGitter> <asterite> later we could try to make it more strict (though I think it's hard)
<RX14> including JSON::Serializable shouldn't *do* anything by itself
<FromGitter> <asterite> I don't know
<RX14> you should also have to add @[JSON] on the ivars it should work on
<FromGitter> <asterite> I think it's easier to assume that everything is serializable
<RX14> I don't think so
<FromGitter> <asterite> and exclude what you don't want to serialize
<RX14> it's soo easy to accidentally add a fiend
<FromGitter> <asterite> it works like that in C#, for example
<RX14> and get it exposed in your public API
<RX14> field*
<RX14> It should be explicit
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
cbass has quit [Ping timeout: 276 seconds]
<RX14> lol I thought that's what you meant regarding "surprise" re: LLVM 6 @ysbaddaden
DTZUZU has quit [Ping timeout: 240 seconds]
<FromGitter> <asterite> I was expecting something like "And now we can do this awesome thing with the C bindings"
<FromGitter> <asterite> not "And now all our C bindings are broken"
<RX14> well, it is awesome that we can get rid of the C++
<RX14> and the C bindings break all the time
<RX14> (we probably won't be able to get rid of all the C++)
<Yxhuvud> what issue are you talking about regarding JSON?
<RX14> Yxhuvud, just general design
<Yxhuvud> some addition or replacement to JSON.mapping?
cbass has joined #crystal-lang
<Yxhuvud> Those UUID issues/PR make me think of how ruby has to_str for stuff that is representable losslessly as a string which then get autoconverted on demand.
<RX14> too much magick
<FromGitter> <asterite> RX14: imagine having a type with several fields and wanting to add serialization. You have to annotate every field. Now imagine wanting to serialize it to another format too. Again, lots of annotations. With the other approach you just need to add another `include` and at most add an `Ignore` to fields you want to ignore
<FromGitter> <asterite> Or for `record Point, x : Int32, y : Int32` you can't do it
<FromGitter> <asterite> you have to use a block and annotate again the instance vars
cbass has quit [Ping timeout: 255 seconds]
<FromGitter> <asterite> with the "serialize all" by default it's just an include
<RX14> well you have to use block to include anyway
<FromGitter> <asterite> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a53a8210505ad8b45cc8837]
<FromGitter> <asterite> So redundant
<FromGitter> <asterite> Actually, maybe that works without the type annotation, but still...
<RX14> idk
<RX14> what does go do again?
<RX14> with it's fancy `
<FromGitter> <asterite> https://blog.golang.org/json-and-go
<FromGitter> <asterite> By default, it seems to serialize all instance vars
<FromGitter> <asterite> well, all struct fields
<FromGitter> <asterite> and with the `json: ...` annotation you can control how it's done
<FromGitter> <asterite> Of course there's no need to annotate that it is serializable because it's done with reflection at runtime
<FromGitter> <asterite> Oh, actually: The json package only accesses the exported fields of struct types (those that begin with an uppercase letter). Therefore only the the exported fields of a struct will be present in the JSON output.
<RX14> i really dislike that go is so subtle about what''s exported and not
<RX14> well
<RX14> I guess by-default is fine
<RX14> everyone else does it that way
<FromGitter> <asterite> I think it's a good convention
<FromGitter> <bararchy> What do you guys think about applying Crystal to GSOC2018 ?
<Yxhuvud> I think it depends a lot on context. I'd expect json inclusion by default from records, but not structs and objects (the same way the latter two don't generate accessors by default without explicit 'property'.
<Yxhuvud> there is also a question of what to do for types that don't have a json conversion - exclude by default or exception when trying to generate/compile?
<RX14> exception
<RX14> changing the definitions on another type (i.e. making it serializable) shouldn't change the serialization of other types
<FromGitter> <asterite> @bararchy what tasks could we propose for GSOC2018?
<RX14> i think it's a cool idea
rohitpaulk has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
sz0 has joined #crystal-lang
<FromGitter> <bararchy> @asterite well, we can break apart the multi-threading into manageable parts and that would be a nice one. Or, something regarding Compiler work? Etc..
<FromGitter> <bararchy> We just need some people from the community to join as mentor
<FromGitter> <asterite> Maybe, yes
baweaver has joined #crystal-lang
<FromGitter> <bararchy> RX14 I think we need official Manas here, not sure who can nominate a project
<FromGitter> <bararchy> Or at least core dev
<FromGitter> <bararchy> Maybe @sdogruyol , he's good at those things :)
<RX14> gsoc isn't really a way to get things done
<RX14> it's for mentoring a student
<FromGitter> <bararchy> True, but Ruby used it for stuff like JIT and other cool features
<FromGitter> <bararchy> And off SciRuby
<FromGitter> <bararchy> I would even mentor myself if someone wanna work on SHAInet or maybe Kemal ? Or other big community shard
<FromGitter> <marksiemers> Anyone planning on submitting a proposal to the RailsConf in Pittsburg?
<FromGitter> <bajro17> @sdogruyol Hi I will check if its possible to we somehow organize conf here maybe in march if its sound good for you until that time I will work to improve my skills on crystal
<FromGitter> <bew> @asterite I don't like the "serialize all" on module inclusion, to me it doesn't give enough flexibility and does things too magically. IMO the `JSON::Serializable` module could give the user some macros to choose what to do, for example "I want to serialize all", or "I want to serialize this way" (not only based on the fields of the class/struct), or "I don't want to full package => only to_json"
<FromGitter> <bew> Generally, the dev must be in control, including a module should not trigger something, but should make available some macros/methods that the dev can use to the trigger things proposed by the module in question
<FromGitter> <bew> s/to the/to
wontruefree has joined #crystal-lang
<lvmbdv> is this one liner ugly?
<lvmbdv> (sexp.is_atomic?) ? sexp : ff(sexp.left)
<FromGitter> <asterite> Maybes, yes. I don't know how to do it with just `include ...`. We probably need an attribute on top of the class. But I don't know, Go and C# serialize everything by default, so I don't know why we shouldn't do the same. The times I used JSON.mapping, I just defined instance vars for that model and that's it. Everything was serialized.
<FromGitter> <bew> you don't need the `()` lvmbdv for the condition
<lvmbdv> yeah but is_atomic? ? looks ugly
<lvmbdv> the `? ?` does it for me
LastWhisper____ has joined #crystal-lang
<lvmbdv> code A E S T H E T H I C S
<FromGitter> <bew> to me the `is_<something>?` is ugly, there's already a `?`, no need for `is_`
<FromGitter> <bew> if you can't stand the `? ?` don't oneline this :P
<lvmbdv> maybe `atomic?` then?
<lvmbdv> that second advice makes sense too
<lvmbdv> maybe i shouldn't
<FromGitter> <bew> yes `atomic?` is better imo
alibby has joined #crystal-lang
<alibby> /FORMAT timestamp {timestamp %%H:%%M:%%S}
<FromGitter> <bew> ?
DTZUZU has joined #crystal-lang
Ven`` has joined #crystal-lang
Ven`` has quit [Read error: Connection reset by peer]
Ven`` has joined #crystal-lang
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alibby has left #crystal-lang [#crystal-lang]
martinium has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
A124 has quit [Ping timeout: 256 seconds]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
martinium has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
jnyw has joined #crystal-lang
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
alex`` has quit [Ping timeout: 255 seconds]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jxv has joined #crystal-lang
<jxv> How does Crystal deal with the lack of Nils? Does it have a Maybe/Option(al) type?
<ua> jxv, it has nil
<RX14> what do you mean "lack of nils"
<jxv> let me reword it
<RX14> we have a Nil class with a nil value
Renich_ has joined #crystal-lang
<RX14> it's just another class
<jxv> ```NULL REFERENCE CHECKS
<jxv> All types are non-nilable in Crystal, and nilable variables are represented as a union between the type and nil. As a consequence, the compiler will automatically check for null references in compile time, helping prevent the dreadful billion-dollar mistake.```
<RX14> which you can union together
<jxv> on the front page
<RX14> yes...
<jxv> So if I look up something that doesn't exist in an array or map, what do I get?
<RX14> depends
<RX14> either an exception or nil
<RX14> ok, an example
<RX14> if you have Array(Foo), and it's empty
<RX14> array[0] will raise, and typeof(array[0]) is Foo
<RX14> array[0]? will return nil, and typeof(array[0]?) is (Foo | Nil)
<RX14> make sense jxv?
<jxv> yeah, I think
<jxv> is the (Foo | Nil) some kind of ad-hoc type?
<jxv> on-demand
<RX14> it's the union type between Foo and Nil
<jxv> neat
<RX14> which emans that a value of this type can either be Foo or Nil
<jxv> Is it pattern matchable?
<RX14> you typically use if to get rid of them
<RX14> if foo; # here you have Foo; else ; # here you have nil; end
<RX14> if you for some reason have Bool | Nil you have to use
<RX14> if !foo.nil?; # here you have Foo; else ; # here you have nil; end
<jxv> Can I deal what later?
LastWhisper____ has joined #crystal-lang
<jxv> deal with that later***
<RX14> what do you mean "later"?
<RX14> they're just like any type
<jxv> the pattern matching
<RX14> any variable
<jxv> okay, good
<RX14> you pass them around
<RX14> not all unions are with Nil
<jxv> I assume I can do something like (Foo | Bar)
<RX14> you can make unions like String | Int32
<RX14> pass them around
<jxv> That's perfect :D
<jxv> could they be alias to some type name
<RX14> do case foo; when String; # handle string; when Int32; ...
<jxv> such that `Either(A,B) = (A | B)`
<RX14> which is nice
relyks has joined #crystal-lang
<RX14> jxv, but why bother?
<jxv> long story: github.com/jxv/fluid
<RX14> A | B is shorter than Either(A, B)
<RX14> and the former syntax is much more flexible
<RX14> it naturally extends from 1 to many types
<jxv> I want some level consistency, but if it's really common. Then I'd budge
<RX14> Option and Either are no longer special cases
<RX14> they're just emergent from the union system as a whole
<jxv> They're like anonymous sum type
<jxv> s
<RX14> well i guess that's what they are
<RX14> i'm not well versed on the nomenclature of type theory
<RX14> I presume you have a haskell background?
<jxv> yes
<RX14> or some similar FP?
<RX14> jxv, we don't typically give names to unions
<RX14> but you can with alias
<RX14> unfortunately you can't have type parameters to an alias yet
<RX14> so you couldn't do Either or Option
<jxv> Alright
<RX14> and even if you could, I don't think it would be best practice
<RX14> hopefully we'll have generic aliases some day though
<jxv> This is fine. Much better than most languages. Even haskell doesn't have anonymous sum types necessarily
<RX14> yeah it's a unique feature
<RX14> it's really at the heart of crystal's expressability I think