why scripting (was: Thoughts from an outsider)

Lex Spoon lex at cc.gatech.edu
Wed Aug 30 12:10:53 UTC 2006


"J J" <azreal1977 at hotmail.com> writes:
> Scripting.  Do we need it?  Well Java doesn't have it.  C++ doesn't
> have it. And those are the two most popular languages afaik.  But both
> of those have huge business backing them.  The languages that do *not*
> have this kind of backing, but are sucessfull are all script
> languages, or can run in script mode.
> 
> How hard would it bee to just make an image that looks a little
> different then the default image, it expects arguments set up the way
> they are with typical #! setups?  And any syntax chosen needs to look
> as close as possible to what smalltalk is now.  No new strange
> constructs that are totally different inside the image, no
> meta-programming as a rule.  It needs to look like it does in the
> browser.
> 
> Tim is right, this would be a step back.  Smalltalk has a much better
> environment if you just use the image.


For bigger programs, clearly yes.  For small programs, though, it can
be much more convenient to use a script file.  A file-sized chunk of
code is an excellent unit of code exchange.  Good tools make this unit
of code exchange nice to work with.

There are a lot of things that a script-running program can make
easier.  For example:


1. Compilation/Loading.  You do not have to deal with when to run the
compiler and/or load the code into the running system.  The script
runner does whatever is needed to make your code run.

2. Dependencies.  If your program needs external libraries, at worst
you put a declaration at the top of your file.

3. Integration with other tools.  Any tool that can work with text
files can work with script files.  CVS, SVN, and pretty much any
decent version control system has a convenient way to handle text
files.  You can even embed script files into programs in other
languages.  Try these things with an image -- it's possible but takes
some work.



-Lex


PS -- If your operating system is Squeak, then yes you can just "do
it" to run your code.  But for the sake of argument, let's suppose
that you are using some backwards non-Squeak operating system that
does not use Smalltalk for its system language.




More information about the Squeak-dev mailing list