Scripting Languages You May Not Know

shutterstock_wrangler

Scripting languages are used in everything from games and Web pages to operating-system shells and general applications, as well as standalone scripts. They allow the harried developer to do his or her job without engaging in the full compile-test-edit lifecycle; with a script, it’s just edit-and-run.

Many of these scripting languages are common and open to modification. In a gaming environment such as Skyrim, the developers relied on a scripting language called Papyrus; Microsoft Office depends on Visual Basic for Applications, a special version of Visual Basic used to extend Word, Excel, and Outlook. But the most famous scripting language is probably JavaScript, now standardized as ECMAScript, which allows scripting in browsers.

For more programming jobs, click here.

While you may very well know Perl, Python, VBA, JavaScript, and others, here are five other scripting languages with which you may be unfamiliar. Each is the work (at least initially) of just one developer, and all are worth a look for anyone interested in building software.

Wren

Wren is a class-based concurrent open-source scripting language written in about 5,000 lines of C by ex-games programmer Bob Nystrom, author of the Games Programming Pattern book. Wren is intended to improve on the Lua scripting language via its class-based architecture. It’s small and fast and has a simple C API with less than ten function calls (it also requires a C99 compiler). Wren’s scripting language is compiled to bytecode and run by the Wren virtual machine; Bob’s benchmarks suggest it is quite a nippy beast.

class Wren {

flyTo(city) {

IO.print(“Flying to “, city)

}

}

Candle

CandleScript is another single-developer scripting language. Developed by Henry Luo, Candle was built to solve issues with processing any hierarchical data. It treats markup data as a built-in data type and provides processing capabilities.

Candle has its own markup based on XML but with a cleaner data model; it supports not only Candle Markup but XML, XHTML, HTML, MIME messages, JSON and CSV. If you are into XSLT, XQuery, and the like, then this is one to check out.

Another thing to note: Candle goes beyond functional programming and includes procedural programming, so that it can provide flow control statements. Expressions are always functional.

<?csp1.0?>

function main() {

let var = 123;

“Outer var: ” {var} <br/>

<div>

let var = 345;

“Inner var: ” {var} <br/>

</div>

}

Fancy

Fancy is a general purpose, dynamic, object-oriented programming language heavily inspired by Ruby, Smalltalk and Erlang that runs on the Rubinius VM. Developed by Christopher Bertels, it is based on a message-sending system between objects; anyone familiar with Objective-C or Smalltalk should feel at ease with it. In an unusual twist for a Ruby-like language, there is built-in support for tuples. Here’s an example that calculates the 15th Fibonacci number:

class Fixnum {

def fib {

match self {

case 0 -> 0

case 1 -> 1

case _ -> self – 1 fib + (self – 2 fib)

}

}

}

15 times: |x| {

x fib println

}

Fancy is targeted at the Rubinius’s bytecode VM, which can use all of the CPU cores to run Ruby code fast. Rubinus runs on Mac OS X and many flavors of Unix/Linux, with Windows support coming soon.

Pikt

Developed by Robert Osterlund, Pikt (short for Problem Informant/Killer Tool) is software for the monitoring and configuration management of Unix and Linux systems. A PIKT script looks more like a make file rather than a programming language; each script has one or more sections (init, begin, rule, end), and then individual lines are run. Below is a script that reports changes in crontab:

crontab_change(u)

init

status =piktstatus

level =piktlevel

task “Report changes in (u) crontabs”

input proc “if [ -e =hstdir/log/(u).crontab.bak ];

then =diff =hstdir/log/(u).crontab.bak =hstdir/log/(u).crontab

else =cat =hstdir/log/(u).crontab 2>/dev/null; fi”

begin

doexec wait “=crontab -u (u) -l > =hstdir/log/(u).crontab”

rule

output mail $inlin

end

doexec wait “=mv =hstdir/log/(u).crontab =hstdir/log/(u).crontab.bak”

If you’re a system admin, Pikt is handy for reporting and fixing problems, scanning log files on single or networked systems, system configuration and more. There’s a bit of a learning curve, but that’s true of any powerful system. As with all of the scripting languages described here, it’s open source.

PPL

Following a name change from Obix, PPL is a cross-platform language that targets JVM, generating .jar or .class files. Created by developer Christian Neumanns to improve on Java with 100 percent null safety and reliability, the compiler checks for potential null pointer errors and flags them as a compile error. Other reliability features include Design by Contract, integrated unit testing, immutable objects by default, static typing and fail fast, which means detecting as many errors as possible at compile time. It plays nicely with Java, and scripts can include Java source code within them.

The example below shows a simple input/output and includes integrated unit testing:

command double_string

in string type:string end

out result type:string end

script

o_result = i_string & i_string   // simply return twice the input string

end

test                                // start of test script

script

test “a”                      // call co_double_string with i_string = “a”

verify v_result =v “aa”       // verify result is “aa”

test “foo”

verify result =v “foofoo”

end

end

end

end

Although the language is a work in progress, the compiler, development environment and libraries are all PPL, so it has a fair degree of maturity and stability. Overall development status is definitely at alpha, but a beta isn’t likely too far off. You can use PPL to write small executable scripts, command line utilities and simple/complex Web applications using Java JSP/Servlet technology or PPL’s PAIOM (Practical Application Input/Output Manager), which provides application interface layers such as rich user interfaces for the Web, command line utilities and application-to-application communication.

Upload Your ResumeEmployers want candidates like you. Upload your resume. Show them you’re awesome.

Related Articles

Image: wrangler/Shutterstock.com

Comments

11 Responses to “Scripting Languages You May Not Know”

January 13, 2015 at 6:46 pm, Jason Turner said:

As long as you’re mentioning little known scripting languages, you may as well mention ChaiScript.

There have been 2 core developers and a handful of outside contributors. ChaiScript is designed to integrate well with C++, to provide easy scripting for your C++ application.

http://chaiscript.com https://github.com/ChaiScript/ChaiScript

Reply

January 13, 2015 at 6:50 pm, Peter Flynn said:

PPL, it may be noted, is also the name of the scripting language built into the P-Stat statistics and data-management package, dating from the late 1960s and still very much alive.

Reply

January 14, 2015 at 1:50 am, gman said:

I know Q-Games http://www.q-games.com, makers of PixelJunk Shooter, PixelJunk Eden, The Tomorrow Children, NomNom Galaxy, etc, has used GameMonkey http://www.gmscript.com extensively for many of their games and I know several people who’ve left Q-Games, formed new companies and are still using it in their own engines.

Reply

January 14, 2015 at 3:39 am, budi said:

And that’s how i know them all now….

Reply

January 14, 2015 at 3:51 am, Erik Hofman said:

There’s also Nasal which was created by Andy Ross and is used by FlightGear.
It turned out to be increadably snappy and versatile for such a small piece of code:
http://plausible.org/nasal/

Reply

January 14, 2015 at 4:49 am, Simon Brooke said:

Worth also mentioning Scheme Shell (scsh): a unix shell scripting language which is a complete implementation of Scheme. If you come from a lispy background, this is an extremely nice language for quick scripting jobs. It’s not new – I first used it fifteen years ago – but it’s very nice.

http://scsh.net/

Reply

January 14, 2015 at 7:10 am, Faded said:

How about Cold Fusion?

Reply

January 15, 2015 at 11:18 pm, Unca Alby said:

You can call me a “Luddite” if you want, but my opinion is there are already too many different computer languages in the world today, and generally not more than 10% difference between most of them.

Please, language designers: STOP IT. Just stop. If you can’t make an existing language do what you need done, you’re probably not trying hard enough. I’m sure it’s very fulfilling and gives you a great sense of accomplish to invent a new language, but for the most part all you’re doing is giving HR people one more thing to use to filter out job prospects. (“Does he know “Fancy”? No? Into the waste bin.”)

I will allow that time marches on, and there may indeed someday be a huge need for something new. But it had better literally solve every known programming issue in 3 lines of code, e.g.,:

begin
Solve every known programming issue;
end;

Otherwise, for the Love of God, PLEASE stop burdening the world with yet another flavor of C, Perl, Lisp, Smalltalk, etc. We do NOT need any more

Reply

January 18, 2015 at 11:45 am, Roger Dannenberg said:

I wrote Serpent, a small language based on Python for 2 reasons: (1) Python does not allow true concurrency — each Python thread grabs a global lock, and only the thread with the lock can run (due in part to the use of globals for the program counter, stack, etc.), whereas a Serpent virtual machine is a self-contained C++ object and you can instantiate as many as you wish in one address space. (2) Serpent has a real-time garbage collector with sub-millisecond latency, especially designed for controlling audio synthesis processes. I use Serpent for general programming tasks as well as embedded in interactive music applications. See http://www.cs.cmu.edu/~music/aura/serpent-info.htm

Reply

February 21, 2017 at 7:19 am, Paul said:

Chill 🙂

Reply

Post a Comment

Your email address will not be published.