RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.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> <vladfaust> @straight-shoota all your arguments break on the fact that we already do have `foo &.bar`. We use it, but could have used `foo { |x| x.bar }`, which is *more explicit and self-explanatory*.
<rkeene> mps, Learning more certainly helps see what's language and what's not
markoong has quit [Remote host closed the connection]
markoong has joined #crystal-lang
ashirase_ has joined #crystal-lang
markoong has quit [Ping timeout: 240 seconds]
jemc has quit [Ping timeout: 246 seconds]
Vexatoast has quit [Quit: ZNC Quit]
Vexatos has joined #crystal-lang
devil_tux has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter> <j8r> @vladfaust the main point of `&.` is to chain blocks in a single line. I don't see a real plus in your proposal
<FromGitter> <j8r> This only free us the `|x|` character, and add more confusions and complexity
<FromGitter> <j8r> Crystal is already too complex :|
<FromGitter> <HarrisonB> I'm confused what @vladfaust is responding to
<FromGitter> <j8r> About a proposal in an issue
<FromGitter> <j8r> I need to create an efficient Crystal file watcher that use Inotify...
<FromGitter> <girng> @mps i only know php, javascript fluently, still learning crystal. however, i've never been a part of such a community like this before with the other languages, so i think i'll end up knowing crystal the strongest
<mps> girng: my intention was not to give advice, just wrote 'aloud' what is my experience with learning languages, and not only languages. And yes, community where one can speak freely and ask even 'stupid' question without being ridiculed by others is good place to 'extend' ones knowledge
ashirase has quit [Ping timeout: 246 seconds]
ashirase_ has quit [Ping timeout: 250 seconds]
ashirase has joined #crystal-lang
ashirase_ has joined #crystal-lang
<FromGitter> <girng> :D
markoong has joined #crystal-lang
<FromGitter> <drum445> What do you guys think of using ECR (server side rendering) vs a separate app layer in something like Vue (client side rendering)?
ashirase has quit [Remote host closed the connection]
<jokke> drum445: totally depends on your usecase
<FromGitter> <drum445> What would you say are good use cases for each? I've never really use ssr but it seems like it could be good for less "interactive" sites
<FromGitter> <drum445> So things that aren't very event driven
<jokke> yeah exactly
<jokke> so if you have more or less static content just use ssr and for stuff with a lot of reactive user interfaces use client side rendering
<jokke> ssr is also much more accessible
<FromGitter> <drum445> because you don't need another language?
<jokke> because it works without javascript
<jokke> for users that have it disabled
<jokke> as a rule of thumb i'd say any public facing website should work without js
<FromGitter> <robacarp> โ˜๐Ÿป
<jokke> which, sadly, isn't the case
<FromGitter> <robacarp> I wish that were true, but the days of unobtrusive js are long over I think
<FromGitter> <robacarp> My preference is: prove to me that you need JavaScript to have a better user interaction, and have a Sane fallback
<jokke> yeah. but it's not a question of feasibility
<jokke> only laziness
<FromGitter> <robacarp> No, devs are just lazy
<FromGitter> <drum445> I think JS is probably required for most things
<FromGitter> <robacarp> Internet got along just fine for a long time without a metric ton of JavaScript that sites are being written with these days. Try it, there are a lot of great paradigms out there
<FromGitter> <drum445> I really don't like what JS has become
<FromGitter> <drum445> Templating engines are solid enough for most things
<FromGitter> <yxhuvud> "No, devs are just lazy" <- It is usually a case of companies not wanting to pay to have two different implementations of the same html pages.
<jokke> Yxhuvud: yeah
<jokke> _but_ usually there's absolutely no reason to implement it in js in the first place
mps has quit [Quit: leaving]
<jokke> you can even write a single page app without any javascript
<FromGitter> <drum445> SPAs aren't always ideal anyway
<FromGitter> <drum445> Most of them are done badly and ruin browser controls
<jokke> yeah
<jokke> if you want your stuff to be snappy you can add something like turbolinks (yes that's javascript)
<FromGitter> <j8r> vue.js or ECR, pre render as much as possible :)
<jokke> slang
<jokke> imho much nicer than ecr
<FromGitter> <Blacksmoke16> ill be the odd man out and like angular
<FromGitter> <j8r> yeah, whatever techno: serving static content is more performant on server, better for SEO, faster for clients
<FromGitter> <j8r> and more robust too - it depends less of a runtime
<FromGitter> <Blacksmoke16> @straight-shoota would i be better off include the additions to `http/spec_helper` in my PR and use that for the oauth stuff, or just duplicate it in the `client_spec`?
<jokke> what i really dislike about the js frameworks is the ssr components that depend on node and all that crap
<jokke> fun fact btw: parceljs has native support for importing rust files :)
<jokke> i'd love to see an embedded crystal version with a simplified stdlib and no gc
<jokke> so we can compile to webasm too :)
<jokke> and ยตC's too
<FromGitter> <vivus-ignis> anyone has experience reading from a pipe? i.e. i do smth like `curl ... | ./crystal_prog`
<FromGitter> <vivus-ignis> i tried this ` STDIN.each_line do |l| ...`, but it never enters this block
<FromGitter> <drum445> Vue is my favourite frontend by far these days
<FromGitter> <drum445> Angular seems too heavy
<FromGitter> <drum445> I might try and use SSR more
jemc has joined #crystal-lang
mps has joined #crystal-lang
<jokke> yeah vue is nice
<jokke> but i also like preact
<jokke> especially in combination with typescript
<jokke> vivus-ignis: yeah. i do it all the time
<jokke> please paste a minimal example
<FromGitter> <vivus-ignis> jokke, could you show me a snippet please?
<jokke> vivus-ignis: https://p.jokke.space/PyyWb/
<jokke> this works just fine
<FromGitter> <vivus-ignis> thanks jokke. i do exactly the same, but it never enters the block
<jokke> then you're not getting any input
<jokke> or it enters the block and you don't realize
<FromGitter> <vivus-ignis> on the writing side of the pipe i have a process that writes from time to time
<FromGitter> <vivus-ignis> initially the pipe has nothing on it
<jokke> yeah
<jokke> so it should be blocking
<jokke> which it is
<FromGitter> <vivus-ignis> i thought this read_lines should block
<FromGitter> <vivus-ignis> yeah
<jokke> if you run my example
<jokke> cat | crystal stdin.cr
<jokke> then start writing lines
<FromGitter> <vivus-ignis> maybe the writing process dies too early... let me debug this shit
blassin has quit [Quit: The Lounge - https://thelounge.chat]
<FromGitter> <vivus-ignis> thank you!
<jokke> sure
blassin has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
jemc has quit [Ping timeout: 258 seconds]
<FromGitter> <vivus-ignis> folks, what is this ampersand here: `password = STDIN.noecho &.gets.try &.chomp` ? cannot find an explanation in the official "book" on crystal-lang
<FromGitter> <HarrisonB> @vivus-ignis it represents the block param
<Yxhuvud> It is a short form for typing ...try {||}
<FromGitter> <HarrisonB> it's equivalent to `STDIN.noecho { |x| x.gets.try(x.chomp) }`
<Yxhuvud> It is a short form for typing ...try {|x| x.chomp}
<Yxhuvud> oops.
<FromGitter> <Sija> to be precise `STDIN.noecho { |x| x.gets.try { |y| y.chomp } }`
<FromGitter> <vivus-ignis> interesting. is this a crystal invention? cannot recall such stuff in ruby
<FromGitter> <Sija> @HarrisonB your example is bit off in terms of 2nd arg
<FromGitter> <Sija> @vivus-ignis in ruby you'd write `.try(:chomp)` instead of `.try(&.chomp)`
<FromGitter> <vivus-ignis> got it. thanks, @HarrisonB Yxhuvud @Sija
<FromGitter> <Sija> @vivus-ignis yw!
<FromGitter> <Sija> for bit of more in-depth explanation of shorthand syntax in Ruby see https://medium.com/whynotio/shorthand-syntax-for-each-map-reduce-more-a790ba12edc9 for example
<FromGitter> <talbergs> Anyone has decent completion for crystal? At least main library api method completion. Damn I'm ready to switch away from vim to a place with completion
<FromGitter> <vivus-ignis> oh cool thank you @Sija
<FromGitter> <girng> grrrr vscode. updated extensions without my permission
<FromGitter> <girng> made a issue in their repo. really sad
lwakefield[m] has joined #crystal-lang
<FromGitter> <HarrisonB> @Sija thank you for the correction!
<FromGitter> <j8r> It should be in the block section of the crystal guide
<FromGitter> <jwoertink> Anyone here using sidekiq.cr ?
<FromGitter> <jwoertink> I'm wondering how you run it along side your web app. Normally you'd have a Procfile that would run the local exec, but I don't have an exec from installing the shard locally
<FromGitter> <Blacksmoke16> i use mosquito and docker, require the things it needs to run and just run the built binary in a docker container
<FromGitter> <jwoertink> When you install that shard, do you add a target for it in your shard.yml to get a separate binary?
<FromGitter> <Blacksmoke16> using the `targets` in shard.yml
<FromGitter> <Blacksmoke16> yea
<FromGitter> <jwoertink> do you point the `main` to your `lib/mosquito/whatever.cr` then?
<FromGitter> <Blacksmoke16> so when i do a `shards build --production --static --release --no-debug` it will generate it as its own binary
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c65d362126af75deba8af4d]
<FromGitter> <jwoertink> oh, I see what you're doing
<FromGitter> <jwoertink> ok sweet
<FromGitter> <jwoertink> thanks!
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c65d39216e4682259a7176f]
<FromGitter> <Blacksmoke16> yea something like that
<FromGitter> <Blacksmoke16> ```targets: โŽ EveToolsApi: โŽ main: src/xxx.cr โŽ Mosquito: โŽ main: src/mosquito.cr``` [https://gitter.im/crystal-lang/crystal?at=5c65d3abdc3f0523ccb75ad2]
<FromGitter> <Blacksmoke16> which would be two separate binaries i can include in separate containers, so that if my worker fails it wont bring down web api
<FromGitter> <jwoertink> cool. I'll give that a shot
<FromGitter> <Blacksmoke16> id imagine sidekiq is similar?
<FromGitter> <Blacksmoke16> i used it in ruby but not crystal
<FromGitter> <Blacksmoke16> https://github.com/robacarp/mosquito is pretty slick as well
<FromGitter> <Blacksmoke16> oo reminds me i need to resolve that throttle pr....
<FromGitter> <vivus-ignis> anyone had a chance to look at this new book: https://pragprog.com/book/crystal/programming-crystal ?
<FromGitter> <vivus-ignis> does it have anything not covered in the official "book"?
<FromGitter> <Blacksmoke16> i have not, maybe if it was free ;)
<FromGitter> <vivus-ignis> ok it has chapter on kemal. and some success stories...
<FromGitter> <Blacksmoke16> ah nice, would be interesting to read the interviews/stories
<FromGitter> <girng> @vivus-ignis @mps can chime in. he bought it afaik
<g-> with ~30 pages left to read, IMO it seemed worth the money
<FromGitter> <vivus-ignis> g- thanks for the feedback
<FromGitter> <drum445> In the markdown lib in stdlib, do new lines not work (double space) ?
<mps> vivus-ignis: book contains most of things you can find on the, but you get all that in one pdf/ebook and you can lay on the sofa and read it
<mps> and not for too much money
<FromGitter> <drum445> I can't seem to get a new line char unless I double enter - which creates a new para
<mps> but, it is nice that the crystal have officially released book which could help to spread information to mainstream
<mps> my only note is that the authors presume that readers know ruby already, and I don't know it. they should remove much too references to ruby.
<mps> but, anyway I don't regret money spend for it
<FromGitter> <drum445> "To create a line break (<br>), end a line with two or more spaces, and then type return." anyone have any ideas please?
<FromGitter> <j8r> @ed use markd instead. Stdlib markown is just here for crystal docs
<FromGitter> <j8r> Very limited
<FromGitter> <anamba> @jwoertink if you're looking for something like sidekiq, try faktory (its replacement). sidekiq.cr is dead
<FromGitter> <jwoertink> I actually checked out https://github.com/robacarp/mosquito and it was really easy to add in!
<FromGitter> <jwoertink> I was having too many issues getting sidekiq running, so swapped it for this in like 2 minutes. It's pretty great
<FromGitter> <Blacksmoke16> ๐Ÿ’ฏ
<FromGitter> <Blacksmoke16> Is pretty slick, also supports customer serialization and deserialization methods for custom objects to and from redis
<FromGitter> <Blacksmoke16> Reminded me to register my PR as well :p
<FromGitter> <Blacksmoke16> Revisit*
<FromGitter> <jwoertink> Yeah, I'm using this thing now. Better get on that PR, because I'll for sure need some throttle later ๐Ÿ˜†