ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.32.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
hightower3 has quit [Ping timeout: 252 seconds]
sagax has quit [Read error: Connection reset by peer]
sagax has joined #crystal-lang
krthr has joined #crystal-lang
krthr has quit [Ping timeout: 260 seconds]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 252 seconds]
duane has quit [Ping timeout: 240 seconds]
ur5us_ has quit [Ping timeout: 248 seconds]
alexherbo2 has joined #crystal-lang
_whitelogger has joined #crystal-lang
lvmbdv has quit [Quit: OH GOD THE CLINTONS CAME FOR ME]
_whitelogger has joined #crystal-lang
hightower4 has joined #crystal-lang
lvmbdv has joined #crystal-lang
ht_ has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
<FromGitter> <dscottboggs_gitlab> > he biggest one is the nesting limitation: only 2 levels ⏎ ⏎ TOML has unlimited nesting but it's kinda awkward. Personally I think it depends on the use case. There are a lot of cases where you could just use `some_str.split(delim).map &.split(other_delim)` but there are also cases where config files get really complicated and I don't think anything beats YAML for that.
<FromGitter> <dscottboggs_gitlab> JSON and MediaPack are great for transport but not great for config files
ur5us_ has joined #crystal-lang
lvmbdv has quit [Quit: Leaving]
lvmbdv has joined #crystal-lang
lvmbdv has quit [Remote host closed the connection]
lvmbdv has joined #crystal-lang
ur5us_ has quit [Ping timeout: 245 seconds]
<FromGitter> <absolutejam_gitlab> I find TOML really hard to grok
<FromGitter> <absolutejam_gitlab> I'm not a fan of deeply nested yaml, I feel like JSON may have the advantage there
<FromGitter> <absolutejam_gitlab> maybe I need a better indent highlighter for vscode
watzon has quit [Ping timeout: 248 seconds]
watzon has joined #crystal-lang
<FromGitter> <j8r> JSON for config is good, if not changed often
<FromGitter> <j8r> YAML configuration can become very complicated, it's hard to track the nesting
<FromGitter> <j8r> So easy to don't see this little `-` inside this mess
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
lvmbdv has quit [Ping timeout: 268 seconds]
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
lvmbdv has joined #crystal-lang
HumanGeek has joined #crystal-lang
Human_G33k has quit [Ping timeout: 240 seconds]
lvmbdv has quit [Ping timeout: 268 seconds]
lvmbdv has joined #crystal-lang
lvmbdv has quit [Quit: Leaving]
<FromGitter> <randiaz95> Wow, does anyone know a guy named D1ceWard?
<FromGitter> <randiaz95> he is a beast, created this nifty shard I read this morning called xlsx-parser
<Yxhuvud> never heard about him
<Yxhuvud> (or her, whatever)
<FromGitter> <randiaz95> they*
<FromGitter> <randiaz95> lol
<FromGitter> <randiaz95> sorry for the gender
<FromGitter> <randiaz95> Im using it for a microservice that reconciles something at work
<FromGitter> <alehander92> it's a he, dont be sorry for using normal language
<FromGitter> <alehander92> it seems there is info on his github
<FromGitter> <alehander92> if you need to contact him
ht_ has joined #crystal-lang
return0e_ has quit [Ping timeout: 250 seconds]
return0e_ has joined #crystal-lang
<FromGitter> <randiaz95> I might just fork his repo and help him out
duane has joined #crystal-lang
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
<FromGitter> <j8r> How can I type when an API returns `{}`, in JSON
<FromGitter> <Blacksmoke16> an obj where all properties are nilable?
<FromGitter> <tenebrousedge> that looks like an empty struct to me
<FromGitter> <j8r> `Hash(String, Nil)` works, is there any better?
<FromGitter> <Blacksmoke16> is there a case where it should also handle if there are values?
<FromGitter> <j8r> no
<FromGitter> <Blacksmoke16> Nil, Nil then?
<FromGitter> <j8r> Tried, but Nil JSON keys are always strings
<FromGitter> <Blacksmoke16> ah true true
<FromGitter> <j8r> as said by @tenebrousedge , I can use `struct Empty; end`
<FromGitter> <Blacksmoke16> might be the better optoin
<FromGitter> <tenebrousedge> my mostly-uninformed opinion is that JSON is better represented in Crystal as Structs than Hashes
<FromGitter> <j8r> yes, unless the content is dynamic
<FromGitter> <j8r> In this case, having `Hash(String, Nil)` implicitly suppose that the dict may not be empty. ⏎ I choose the struct option, thanks :)
<FromGitter> <tenebrousedge> :plus1:
alexherbo2 has joined #crystal-lang
dostoyevsky has quit [Ping timeout: 252 seconds]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 268 seconds]
alexherbo2 has joined #crystal-lang
<FromGitter> <randiaz95> Guys, is there normally a rule of thumb when it comes to IO over 2 programming languages? ⏎ ⏎ For example: Should I run an executable from my api gateway with some sort of child process crystal executable or should I send a post request over localhost on a server that is listening in crystal?
<FromGitter> <tenebrousedge> probably the former is better for small projects and the latter for large ones
<FromGitter> <randiaz95> Is it because the benefits of large programs are that it can be run over 2 different computers or servers?
<FromGitter> <randiaz95> I was thinking performance could be faster for http server because the overhead of booting up a language is still a little there in terms of an executable.
<FromGitter> <randiaz95> also, I can keep long term variables and datastructs
<FromGitter> <tenebrousedge> as a compiled language Crystal has minimal run-time initialization
<FromGitter> <tenebrousedge> it's not Ruby :)
<FromGitter> <tenebrousedge> even PHP boots in a few dozen milliseconds or so
<FromGitter> <tenebrousedge> but yes, on the large scale, you may end up with different machines for the different processes, and for that you'd want an API
<FromGitter> <tenebrousedge> you could split the difference and use some sort of job queue that would invoke a Crystal binary
<FromGitter> <tenebrousedge> something like beanstalkd
Nazral has quit [*.net *.split]
<FromGitter> <randiaz95> Dang, I am going to look for a beanstalkd equivalent in Python
<FromGitter> <randiaz95> I can make a web server with auth in postgres in 5 minutes, so I think I should use it for a gateway.
<FromGitter> <randiaz95> make my requests and response with requests library.
<FromGitter> <randiaz95> If there was a django in crystal, I would hit it up, but I don't think its too productive to relearn another framework just yet.
duane has quit [Ping timeout: 258 seconds]
<FromGitter> <tenebrousedge> there's a few beanstalkd clients for Python https://github.com/beanstalkd/beanstalkd/wiki/Client-Libraries
<FromGitter> <tenebrousedge> there are also other job and message queues that might be suitable
<FromGitter> <absolutejam_gitlab> never heard of beanstalkd
<FromGitter> <randiaz95> oo django beanstalkd
<FromGitter> <absolutejam_gitlab> I normally use RabbitMQ
<FromGitter> <randiaz95> Wait, isn't beanstalkd the client?
<Yxhuvud> doesn't sidekiq exist for crystal, if you want a job queue?
<FromGitter> <randiaz95> I mean... :'( je suis tres confuse
<FromGitter> <randiaz95> django-beanstalkd is a server side
<FromGitter> <Blacksmoke16> https://github.com/robacarp/mosquito is also pretty good, ive used it in the past
<FromGitter> <absolutejam_gitlab> anyone ever browse Dribbble?
<FromGitter> <absolutejam_gitlab> Get some serious UX envy
<FromGitter> <tenebrousedge> a client here is something that interacts with the job queue service
<FromGitter> <tenebrousedge> you'll usually have one service creating jobs, the job queue managing them, and a pool of workers executing the jobs
<FromGitter> <absolutejam_gitlab> You ever get stuck up on what backend language/framework to use?
<FromGitter> <absolutejam_gitlab> I know I shouldn't but the grass is always greener
<FromGitter> <Blacksmoke16> we adopted a pattern using rabbitmq with dockerized workers consuming from a specific queue
<FromGitter> <Blacksmoke16> uses some go lib under the hood
<FromGitter> <absolutejam_gitlab> we're a Laravel shop and we use RabbitMQ and dedicated workers per queue
<FromGitter> <absolutejam_gitlab> In k8s
<FromGitter> <absolutejam_gitlab> Custom RabbitMQ driver that uses the C extension so it's nice and fast
<FromGitter> <absolutejam_gitlab> with a 3 node RabbitMQ statefulset
<FromGitter> <absolutejam_gitlab> It's nice because it's amqp so there's generally a lib for it in any language
<FromGitter> <wontruefree> @randiaz95 I have not tried this yet but I plan on implementing an SQS queue for my next project https://github.com/sdogruyol/aws
ur5us_ has joined #crystal-lang
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
<FromGitter> <randiaz95> @absolutejam_gitlab interesting, it seems like just outsourcing the front end ux is best..
<FromGitter> <randiaz95> once i have more than 100 lines of html my projects always die... lol
<FromGitter> <randiaz95> I need to modularize my html more.
duane has joined #crystal-lang
watzon has quit [Quit: WeeChat 2.7]
<FromGitter> <absolutejam_gitlab> That's why I love Vue
<FromGitter> <absolutejam_gitlab> encapsulating into components
<FromGitter> <absolutejam_gitlab> Not a dig @ React, etc., I've just only used Vue
<FromGitter> <Blacksmoke16> angular does that as well ^
ht_ has quit [Quit: ht_]
dostoyevsky has joined #crystal-lang
dostoyevsky has quit [Client Quit]
dostoyevsky has joined #crystal-lang
ur5us_ has quit [Remote host closed the connection]
ur5us_ has joined #crystal-lang
<FromGitter> <wontruefree> are the forums down ?
dom96 has quit [Ping timeout: 268 seconds]
dom96 has joined #crystal-lang
tr0yb1t has joined #crystal-lang