Why compiling a script is bad

Or, why greycat yelled at you when you asked for a script compiler

Consider the shell script. What are its properties? What are its strengths and weaknesses?

Strengths:

Weaknesses:

Of course, I'm assuming a properly-written shell script. I therefore don't include things like "prone to newbie syntax and logic errors", because that's characteristic of any kind of programming.

Take a look at that first strength I listed again: Simple, easily understood. What does that imply? For starters, it implies that people can look at it!

If you compile a shell script, you're doing so for one of two reasons:

  1. You want it to run faster, or
  2. You want to hide it from people.

Now, take a look at this page you're reading. What is it? It's a rant. Where is it? It's on some guy's wiki. What's a wiki? It's a way of openly, collaboratively editing information. Where do wikis live? On the World Wide Web. What's the WWW? It's a system for sharing information openly with the entire world. (At least, that's what it was until the corporate realm decided to try to make money from it.) Where does the WWW live? On the Internet. What's the Internet? It's the meta-network of all the world's computer networks that have decided to talk to each other. Why did they do that? Because they like sharing information!

Information wants to be free.

The sharing of information enriches us all. Thomas Jefferson wrote,

If I'm writing a rant, on a wiki, on the World Wide Web, on the Internet, do you really think I'm the type of person who would sympathize with your attempts to hide information? Don't you think we've seen your question frequently enough that we know that's what you're trying to do?

Why do people want to hide their shell scripts?

If you're asking us for help selling a product, then you are a spammer and we want nothing to do with you.

If you're ashamed of your script because you know it's a piece of shit, but you would prefer to hide its crappiness from people (but still have them use it!) instead of fixing it, then you are a blight upon humanity.

If you just wanted your script to run faster, then you're really going about it the wrong way. Shell scripts just aren't built for speed. There are ways of speeding them up within certain limits (algorithmic optimizations, replacing external commands with builtins, etc.), but in the end the final answer to speed is rewrite it in another language.


CategoryRant

GreyCat/CompilingBad (last edited 2013-07-03 16:52:59 by GreyCat)