<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]
<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>
<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>
<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 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>
<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> 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?
<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>
<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>
<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>
<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]
<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>
<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