Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The 'scripting' vs 'compiled' language is a false dichotomy. Awk, Perl, Python are compiled programs. What makes a 'scripting' language special? Dynamic typing? Lack of compile step/delay?

I could imagine a lifetime of collecting scripting macros/libs in lisp to be as good or better.



Python is not a compiled language.

However, the reason Bash is so prolific amongst Sys Admins such as myself is the fact that they are portable and reliable to use across Debian, Arch or RHEL based distributions.

You don't have to import extra libraries, ensure that you are running the proper python environment, or be certain that pip is properly installed and configured for whatever extra source code beyond what is included out of the box.

Bash is the most consistent code you can write to perform any task you need when you have to work with Linux.


> Python is not a compiled language.

Python is (at least in the CPython implementation) compiled, to python byte code which runs on the python virtual machine.

Its not compiled to native code. (Unless you use one of the compilers which do compile it to native code, though they tend to support only a subset of python.)


Bash is fine for small scripts.

Once you use it to manage complex data structures and flow, you are simply wasting time because you will have to rewrite it in Python or Go.


Another commenter beat me to it but still: sh / bash / zsh are quite fine up until certain complexity (say 500 lines), after which adding even a single small feature becomes a huge drag. We're talking hours for something that would take me 10 minutes in Golang and 15 in Rust.


I can actually agree with this take. Most of the opinions I've seen in this vein take some absurdly small limit, like 5 lines. 500, though? Yeah. My team rewrote a ProxySQL handler in Python because the bash version had gotten out of hand, and there were only a handful of people who could understand what it was doing. It passed 100% of spellcheck tests, and was as modular as it could possibly be, but modifying it was still an exercise in pain.


> It passed 100% of spellcheck tests

Just like your post does! :)


Ugh… Safari being overly helpful.


> portable and reliable to use across Debian, Arch or RHEL based distributions

Until you try to use a newer feature or try the script in a Mac or BSD or any older bash.

SH code is completely portable, but bash itself can have quite a few novel features. Don’t get me wrong - I’m happy the language is dynamic and still growing. But it can make things awkward when trying to use a script from a newer system on an older server (and the author has been “clever”).


> SH code is completely portable

Not exactly.

https://stackoverflow.com/questions/11376975/is-there-a-mini...


Also the bash runtime is quite small, I think <2mb uncompressed so it is pretty much included in every distro

Installing python or nodejs into your distro will inflate it by at least 30mb, quite crucial when dealing with containers


The phrase "compiled language" doesn't mean anything. Python compilers exist.


> The 'scripting' vs 'compiled' language is a false dichotomy.

Not false, but perhaps in need of better definition. The term script has often denoted a trivial set of commands run by $interpreter.

"Scripting languages" have been seen as being in contrast to C, C++, Pascal, Java, SmallTalk, &c. The scripting languages remove from the user the need:

-a- to think about an extensive type system,

-b- to compile the logic, and

-c- to build for a specific architecture.


>> The 'scripting' vs 'compiled' language is a false dichotomy.

https://news.ycombinator.com/item?id=37206428


Static typing is the key differentiator.

That requires a level of bookkeeping which is helpful for large programs and a nuicense for small programs.


Closer to the truth is that static typing is a nuisance to a sole dev working in a short temporal period. Many successful startups get stuck with overgrown 'scripts' as platforms because it started as a one-man-programming shop.

I do have to add that Python more than any other language I've used results in working the first try that it's not surprising.


> Dynamic typing?

actually amount of reasoning, which program requires to perform in run time is close to interpretion.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: