5 ms·
There are quite a few languages that can do that... perl, ruby, bash
by cortesoft 6y ago
There are quite a few languages that can do that... perl, ruby, bash
- svachalek 6y agoThis is an... interesting idea of "straightforward" in the case of bash and to a lesser degree, perl (although I hear perl 6 is nicer).
- tyingq 6y agoRaku is even more expressive, so if you're unhappy with Perl 5 for readability reasons, there no improvement there.
- rpastuszak 6y agoHow about node/es?
- lizmat 6y agoPlease note that Perl 6 has been renamed to Raku (https://raku.org https://raku.org using the #rakulang tag on social media). And yes, it is nicer :-)
- dragonwriter 6y agoPerl and Ruby have even more common use of “magic” than python.
- sitkack 6y agoAs a long time (97) user of Python who completed a couple katas in Ruby, Ruby has _regular_ magic, as in it is predictable. Python magic is adhoc.
- dragonwriter 6y agoAs a long time user of both Python and Ruby, Ruby has plenty of ad hoc magic, at least as much of Python, though it's likely you won't see that as much in whatever language you are less familiar with.
- Hamuko 6y agoCan you do straightforward JSON download and processing in bash?
- dylan604 6y agoIs that the sole criteria for a scripting language to be useful?
- heavyset_go 6y agoYou can go a long way with jq, pup and similar tools. As an exercise, I used Bash to build scraping and download scripts for about a dozen websites. I found that I only needed to dip into Python when doing complicated operations on strings, or I needed access to data structures. I actually liked the approach of using Bash first for scraping, because it gave me direct access to Bash's superior IPC and concurrency constructs. I could plug in a Python script into the pipeline and it wouldn't be any different than interacting with another Bash process.
- buddhiajuke 6y agoWith an util like jq, yes.
- samatman 6y agoI do most of my straightforward JSON download and processing in bash. Well, in fish. As everyone else replying to you indicated, I use jq for it. But when I type `curl http://example.com http://example.com | jq .`, I'm programming in fish. Granted, when I want to do something more complex and durable, I'm likely to reach for, yes, python. But nearly as often, I build up a moderately complex jq command, and set an alias to it.
- Sebb767 6y agoAnd php, which is also a really beginner-friendly language. In fact, not needing the big toolchain at the beginning helps experimenting a lot and is probably one big factor of what made both of them take off so much in that niche.