RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.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
gangstacat has quit [Quit: Ĝis!]
<FromGitter> <vladfaust> I'm so happy now, I've found a way to build great-looking DSLs with annotations avoiding annotations syntax! https://carc.in/#/r/5i5w
<FromGitter> <vladfaust> So I could rewrite my ORM with annotations API (which would drastically simplify internal code), still preserving beautiful DSL
gangstacat has joined #crystal-lang
<FromGitter> <Blacksmoke16> hmm
non-aristotelian has quit [Quit: non-aristotelian]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
teardown has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <proyb6> @t0nyandre I have created a discord but that's just me https://discord.gg/GB8cmSq
<FromGitter> <Blacksmoke16> id rather discord, but is what it is
<FromGitter> <proyb6> Yeah, it's a top notch place to chat in
<FromGitter> <Blacksmoke16> is a pain being split between slack, discord, and gitter for all the stuff im in
<FromGitter> <Blacksmoke16> least no one uses skype anymore :3
<FromGitter> <proyb6> I think no one would test drive discord but Vappr web framework has a big community there now which work well
<oprypin> just say no to discord?
<FromGitter> <proyb6> Any alternative?
<oprypin> gitter?
rohitpaulk has quit [Ping timeout: 245 seconds]
<FromGitter> <j8r> @vladfaust this doesn't works if you have a key with a space or a special character like @
rohitpaulk has joined #crystal-lang
<FromGitter> <j8r> a bit more verbose, but simple and explicit. Furthermore, we can have ivars that aren't serialized
<FromGitter> <Prutheus> Am I missing something? Why do I get a type error at following: ⏎ ` ⏎ results = [] of Hash(String, Array(String | Hash(String, Array(String)))) ⏎ results << { ⏎ "key" => ["value"], ... [https://gitter.im/crystal-lang/crystal?at=5bea96016b9822140d21d6b7]
<FromGitter> <j8r> the first one works
<FromGitter> <j8r> https://carc.in/#/r/5i7f
<FromGitter> <Prutheus> But not on my crystal (v0.26.1). ⏎ In my playground i get the error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bea96bdbb06d73a9968182b]
<FromGitter> <bararchy> on carc seems to work for 27 26.1 26 @Prutheus
<FromGitter> <Prutheus> oh wait now it works when i put it into a file …. strange, just in playground it fails….
<FromGitter> <Prutheus> But not in my project … let me examine that
<FromGitter> <Prutheus> https://carc.in/#/r/5i7i works … and here is how i impleneted it in my code: https://carc.in/#/r/5i7j and there, i get error : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bea97ee4e7ca145209a6df4]
<FromGitter> <Prutheus> Why? am i missing something???
<FromGitter> <j8r> omg the code 😮
<FromGitter> <Prutheus> ?
<FromGitter> <bararchy> @j8r XD\
<FromGitter> <Prutheus> whats wrong with it?
<FromGitter> <bararchy> @Prutheus if you have such a complicated type, better to use a class or struct
<FromGitter> <bararchy> as a container
<FromGitter> <j8r> putting begin/rescue everywhere - nor easy to read nor efficient
<FromGitter> <bararchy> oh I only now saw the code
<FromGitter> <j8r> raising exception is expensive, and should be only used when there is an abnormal error
<FromGitter> <Prutheus> How else should I realize that? @j8r ⏎ @bararchy but why is mine not working in my project, but in a single file???
<FromGitter> <j8r> try to use nilable methods instead of raising ones
<FromGitter> <j8r> if possible
<FromGitter> <Prutheus> @j8r in my context its very easy using raises, but i will have a thought about it …. for now, can we solve the type error please? :D
<FromGitter> <j8r> ad your error is normal, you have to restrain the type with a check before doing an array specific operation
<FromGitter> <Prutheus> what does that mean, I do not understand
<FromGitter> <j8r> like `.is_a? Array`
<FromGitter> <Prutheus> where?
<FromGitter> <j8r> Don't know, I haven't your code :)
<FromGitter> <j8r> (working one)
<FromGitter> <Prutheus> i dont know what you mean now … you posted my code where the error occurs.
<FromGitter> <j8r> but something like `if (array = result["test]).is_a? Array`
<FromGitter> <j8r> @Prutheus you code sample isn't working as is - not easy to fix for us
<FromGitter> <bararchy> Can you try mine @Prutheus ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bea9a15c4457a21ae8c141b]
<FromGitter> <bararchy> the lower one
<FromGitter> <Prutheus> @bararchy works, but why? ^^
<FromGitter> <j8r> You miss an union
<FromGitter> <Prutheus> Huh? I do not understand
<FromGitter> <bararchy> becuase basiclly they are not the same
<FromGitter> <Prutheus> please explain that
<FromGitter> <j8r> That's why it's better to avoid this type of unions
<FromGitter> <Prutheus> you mean [] of … ?
<FromGitter> <ljuti> @Blacksmoke16 Added crude IFTTT assertion here https://gist.github.com/ljuti/67e77797d5127b90d5fea56a2220c2be
<FromGitter> <bararchy> this is what I mean by make your code simpler, the two `results` don't equal
<FromGitter> <Prutheus> But why not?
<FromGitter> <bararchy> use struct or class instead of such a complicated union
<FromGitter> <Prutheus> Can you show me an example for using a struct and for using a class for such stuff please?
rohitpaulk has quit [Ping timeout: 246 seconds]
<FromGitter> <j8r> Do you have a dynamic or static mapping?
<FromGitter> <Prutheus> you mean me?
<FromGitter> <j8r> @Prutheus do you know the structure of the file in advance?
<FromGitter> <Prutheus> what exactly do oyu mean?
<FromGitter> <j8r> do you know the XML keys to parse?
<FromGitter> <Prutheus> yes
<FromGitter> <j8r> so, you can have a struct with instance variables
<FromGitter> <bararchy> @Prutheus https://carc.in/#/r/5i7s
<FromGitter> <bararchy> for example
<FromGitter> <Prutheus> Ahh okay yeah I see. Thanks. Next time I will use classes for such data types.
<FromGitter> <bararchy> @Prutheus 👍 :)
<FromGitter> <j8r> I'm thinking more like this https://carc.in/#/r/5i7x
<FromGitter> <bararchy> @j8r it's really nice, all depends on the incoming data, if it's json then yeha, makes more sense
<FromGitter> <j8r> Even XML
<FromGitter> <Prutheus> nice
<FromGitter> <bararchy> yeha @j8r is pro
<FromGitter> <Prutheus> I know, love him so much
<FromGitter> <Prutheus> but you are also good :D
rohitpaulk has joined #crystal-lang
<FromGitter> <j8r> If you have highly dynamic data to map: https://carc.in/#/r/5i84
<FromGitter> <j8r> that's a mapping approach I'm digging on to replace `JSON::Serializable` and `JSON.mapping`.
<FromGitter> <j8r> haha thanks @bararchy and @Prutheus , you are skilled too (even more than me)
ashirase has quit [Ping timeout: 252 seconds]
ashirase has joined #crystal-lang
<FromGitter> <j8r> that's my screen of GitHub has changed the Crystal color scheme from light violet to dark? https://github.com/crystal-lang/crystal
<FromGitter> <vladfaust> Not just you, @j8r https://github.com/github/linguist/pull/4290
<FromGitter> <vladfaust> Honestly, I feel abit uncomfortable with the new color, but I believe I'm gonna start enjoying it in a day or two
<FromGitter> <j8r> @vladfaust this was you! good job!
<FromGitter> <yxhuvud> Hmm. Ruby 2.6 let `Enumerable#to_h` to take a block. Perhaps we should steal that idea :)
rohitpaulk has quit [Ping timeout: 276 seconds]
<FromGitter> <proyb6> I do think the Crystal github Readme page need to improve?
<FromGitter> <r00ster91> what needs to improve?
<FromGitter> <proyb6> @r00ster91 The point form really doesn't reflect something unique as in
<FromGitter> <proyb6> "The best of both world" is not possible in software world unless RubyGem could be ported easily or stuck in current form
<FromGitter> <proyb6> "We want" and "we love" isn't best fit in the products because we need to advertise that Crystal is make for "You", the programmers, hobbyist, professional, researchers, etc then we have a better picture on the "visions"
fifr has quit [Ping timeout: 244 seconds]
<FromGitter> <proyb6> It is really a good time to rewrite the advertisement parts because everyone think and disbelieve Crystal at first sight because of Ruby have a reputation because of RunyonRails while Crystal have no popular web framework to compare with vast amount of 3rd party libraries in PHP, Nodejs or Go
<FromGitter> <proyb6> How do you make Crystal attractive? FAQ and use cases are needed much
<FromGitter> <r00ster91> There's a FAQ here: https://github.com/crystal-lang/crystal/wiki/FAQ
<FromGitter> <proyb6> Yeah that need improvementas well
<FromGitter> <pitosalas> I can't find a way to declare property with a datatype?
<FromGitter> <proyb6> @r00ster91
<FromGitter> <proyb6> https://golang.org/doc/faq I find this is a lot more info
<FromGitter> <r00ster91> there are already some web frameworks such as Kemal and Amber. They are just that popular yet. But I think that'll happen after time
<FromGitter> <r00ster91> yeah I agree that's of course much more
<FromGitter> <r00ster91> @pitosalas `property variable : String`
<FromGitter> <pitosalas> hm. thanks. I thought I had tried that. sorry for the dum q
<FromGitter> <r00ster91> am I the only one who thinks that the new color for Crystal looks a bit too much like C?
<FromGitter> <proyb6> Yeah, I would think of Laravel took the PHP community by storm when I first learnt and it was easy for beginner to find a better framework when PHP was slow then, but Crystal with a piece of stdlib seem quite usable without a big web framework or may be some would be concern of using Amber that may break their code due to breaking change
<FromGitter> <proyb6> I haven't tried Amber and Lucky until Crystal 1.0 is release
<FromGitter> <r00ster91> I only tried Kemal once so far. I'm not that interested in all these web frameworks
<FromGitter> <j8r> Me too, big web frameworks are hard to optimize
<FromGitter> <j8r> *applications using them
<FromGitter> <proyb6> Yeah, I like everyone to suggest or contribute on the marketing parts and tell a good story, every successful startups has a secret sauce, we should have one too, I guess where we need a marketer and designer
<FromGitter> <vladfaust> So become that marketer and designer
<FromGitter> <vladfaust> Everyone is hoping that someone else will do the hard part. It's an infinite loop :)
<FromGitter> <proyb6> Yeah or engage a consultant, everyone here can be a Rockstar but we need to work hard to "impress" the audiences. A great musicians work with every departmemts and yeah that's the hard part
<FromGitter> <vladfaust> Crystal lacks on finances to sponsor its own development, what consultant you're talking about? :D
<FromGitter> <proyb6> A software consultant who can find Crystal a valuable product and passionate promote in a talk
<FromGitter> <proyb6> I always remember this guy
<FromGitter> <proyb6> https://youtu.be/LH75sJAR0hc
fifr has joined #crystal-lang
<FromGitter> <proyb6> A consultant who finds Crystal as a valuable language and passionate to promote in a talk or something like that... ⏎ I always remember this guy
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 2.2]
DTZUZU has joined #crystal-lang
<FromGitter> <fridgerator> I havent seen RX14 lately, wonder if he's busy with school?
<RX14> yep
<FromGitter> <fridgerator> lol 👍
<FromGitter> <fridgerator> good job
return0e has quit [Ping timeout: 240 seconds]
return0e has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 2.2]
DTZUZU has joined #crystal-lang
<FromGitter> <vladfaust> Okay, seems like it's working https://forum.crystalcommunity.org/
<FromGitter> <vladfaust> Will tweak icons a bit later
<FromGitter> <vladfaust> Why using forum alongside with gitter? Because there is a more focused conversation and it's seen by Google
<FromGitter> <j8r> @vladfaust great initiative, 💯
<FromGitter> <j8r> But where is it hosted?
<FromGitter> <vladfaust> On my server, just as crystaljobs
<FromGitter> <j8r> at least if there are backups of the database, I'm ok 👍
<FromGitter> <vladfaust> And if there are not, then you're not ok?
<FromGitter> <kinxer> @vladfaust That's a worrying response. :P
<FromGitter> <j8r> lol
<FromGitter> <vladfaust> I'll set them up, sooner or later. Not at the same time :)
<FromGitter> <j8r> I won't be ok to take time to post things if they can be lost forever :|
<FromGitter> <vladfaust> Everything is ephemeral in this world
<FromGitter> <vladfaust> So, if you want a wider community, you have to create activity on that forum, because it's way more friendly for newcomers than gitter
<FromGitter> <vladfaust> Otherwise, let's continue whining about "we need a consultant/designer/magician to attract more people"
<FromGitter> <j8r> to sumup, we need people that attract people, that may attract people in their turn
<FromGitter> <vladfaust> Yeap, and I'm giving a kickstarter
<FromGitter> <vladfaust> Hey, @everyone, welcome to the forum: https://forum.crystalcommunity.org 🎉
<FromGitter> <vladfaust> Alright, did my best, now it depends on you
<FromGitter> <Blacksmoke16> oh man, anyone else notice Crystal got a new color on github
<FromGitter> <Blacksmoke16> i miss the purple
<FromGitter> <Blacksmoke16> @ljuti Nice one!
<FromGitter> <vladfaust> Take a look at elixir forum btw, it's nice https://elixirforum.com/
<FromGitter> <Blacksmoke16> currently got HTMl5 and loose email assertions done, having a solid RFC complaint one will take some more work however
<FromGitter> <Blacksmoke16> which i might save for later as current 2 are prob good enough
<FromGitter> <bararchy> So.. Who's adding HTTPQUIC::Client ? ;)
<FromGitter> <j8r> we really need http/2 in stdlib :(
<FromGitter> <j8r> if http/3 is out and we don't even had http/2, this sucks :/
<FromGitter> <fusillicode_twitter> @Blacksmoke16 I miss the purple too :( ⏎ But actually the new color fits better with the overall Crystal appeal :D
<FromGitter> <Blacksmoke16> yea the logo for sure
<FromGitter> <Blacksmoke16> all the docs are purple tho either makes sense really
<FromGitter> <fusillicode_twitter> yeah you're right but unfortunately the first impact aren't the docs ;)
<FromGitter> <fusillicode_twitter> and I write "unfortunately" because they're definitely among the most well written I've ever found till now 👏
<FromGitter> <scottmcclung> noob question: while Crystal implements Ruby methods like String.capitalize or String.downcase, it doesn't implement String.capitalize! and String.downcase!. Is that a language design choice or just hasn't hit the top of the todo list yet?
<Yxhuvud> design choice. Strings are immutable.
<FromGitter> <scottmcclung> good to know, thx!
<FromGitter> <vladfaust> Let's rename Crystal to Onyx
<FromGitter> <r00ster91> theres a web framework called onyx
<FromGitter> <j8r> @vladfaust already taken for a programming language: https://en.wikipedia.org/wiki/Onyx_(programming_language)
<FromGitter> <fridgerator> also : https://www.youtube.com/watch?v=7ADgCeYJMN4
<FromGitter> <vladfaust> @j8r updated 11 years ago
<FromGitter> <vladfaust> There is a singer called Ruby as well
<FromGitter> <vladfaust> Do not take me seriously, nobody would change the name :)
<FromGitter> <j8r> this isn't the same here @vladfaust
<FromGitter> <j8r> this can't work, if we search "onyx programming language" - what are we supposed to get? Ok probably no patent wars, but we have to respect the original onyx creators
<FromGitter> <vladfaust> https://twitter.com/crystallang
<FromGitter> <vladfaust> Twitter has to do something with abandoned accounts. I hate them for their policies
sevensidedmarble has joined #crystal-lang
<FromGitter> <kinxer> But if they did that then the internet would be robbed of this content.
<FromGitter> <kinxer> What a tragedy that would be.
<FromGitter> <kinxer> On a serious note, though, do other programming languages/their communities have Twitter accounts?
<FromGitter> <j8r> we need to re-decentralize the internet. The problem is that Internet is centralized by essence with ISPs
non-aristotelian has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/5iav imagine this has something to do with the `\p`s?
<FromGitter> <Blacksmoke16> also looks like `\pN` arent recognized https://play.crystal-lang.org/#/r/5ib2
<FromGitter> <fusillicode_twitter> Quick question: is there a library (I already know this one https://github.com/akwiatkowski/kemal-auth-token) that gives some facilities regarding doing token authorization on Kemal? 🤔
akaiiro has quit [Remote host closed the connection]
akaiiro has joined #crystal-lang
akaiiro has quit [Ping timeout: 252 seconds]
<FromGitter> <vladfaust> How do you like the new logo? https://forum.crystalcommunity.org
<FromGitter> <bew> Pretty cool!
<FromGitter> <vladfaust> 😏
<FromGitter> <bew> What is this website?
akaiiro has joined #crystal-lang
<FromGitter> <vladfaust> I don't know
<FromGitter> <kinxer> @bew It's the Crystal community forum that @vladfaust created and started hosting earlier today.
<FromGitter> <bew> Yeah i looked at it, looks like a good start, good idea @vladfaust
<FromGitter> <Blacksmoke16> are there any limitations on crystal's regex? having a hard time getting PHP's regex to work
t0nyandre has quit [Quit: WeeChat 2.3]
akaiiro has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> and naturally its super long and hard to debug :p
<FromGitter> <vladfaust> Why don't you create a topic on the forum, @Blacksmoke16? The question will be indexed by Google and it may help to newcomers
<FromGitter> <vladfaust> Also got a nice Twitter account for reason I don't know yet: https://twitter.com/crystallers
<FromGitter> <vladfaust> I'm going to create Questions category
<FromGitter> <vladfaust> It would also reduce duplicate issues in the repo
<FromGitter> <bew> What about questions here in gitter/irc?
<FromGitter> <bew> @Blacksmoke16 crystal's regexes uses pcre
<FromGitter> <Blacksmoke16> thats what PHP should be using as well
<FromGitter> <vladfaust> This would reduce the amount of duplicated questions here in gitter and help newcomers
<FromGitter> <Blacksmoke16> https://www.phpliveregex.com/p/pVB
<FromGitter> <Blacksmoke16> its prob some escaping issue imo
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/5ieq but escaping the `#` and `%` seems to think there is a `)` missing
<FromGitter> <kinxer> You weren't kidding about the length...
<FromGitter> <Blacksmoke16> ikr? :p
<FromGitter> <Blacksmoke16> ha! i got it
<FromGitter> <kinxer> What was it?
<FromGitter> <Blacksmoke16> some unescaped `/`
<FromGitter> <Blacksmoke16> but if any of you need that it'll validate urls
<FromGitter> <Blacksmoke16> hmm but its matching some that it shouldnt
<FromGitter> <kinxer> So, it doesn't reduce much of the whole pattern, but couldn't the beginning just be `https?:\/\/...`?
<FromGitter> <Blacksmoke16> prob
akaiiro has joined #crystal-lang
<FromGitter> <Blacksmoke16> yea either i escaped something i shouldnt have or something, getting diff results between `preg_match` and `=~`
<FromGitter> <Blacksmoke16> ah, missed a `$`
akaiiro has quit [Remote host closed the connection]
akaiiro has joined #crystal-lang
<FromGitter> <vladfaust> Someone could post about different Crystal resources, for example, icr or http://www.crystular.org, or tell about useful shards. This would be helpful for newcomers
<FromGitter> <Blacksmoke16> ```code paste, see link```
<FromGitter> <Blacksmoke16> 👌
<FromGitter> <kinxer> @Blacksmoke16 Nicely done.
<FromGitter> <kinxer> I agree with @vladfaust that the forum could become a very useful resource, but required for that outcome is for people to contribute.
<FromGitter> <vladfaust> As some motivation, I've added a novice challenge 😏
ua has quit [Ping timeout: 240 seconds]
ua has joined #crystal-lang
go|dfish has quit [Ping timeout: 268 seconds]
z64 has quit [Ping timeout: 268 seconds]
<FromGitter> <vladfaust> I like how fast the forum feels.
<FromGitter> <vladfaust> Will definetely spend some time on CSS improvements, but overall I like Discourse
<FromGitter> <vladfaust> Good night!
go|dfish has joined #crystal-lang
ashirase has quit [Ping timeout: 272 seconds]
ashirase has joined #crystal-lang
sevensidedmarble has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
relyks has joined #crystal-lang
non-aristotelian has quit [Quit: non-aristotelian]
non-aristotelian has joined #crystal-lang