Slashdot Mirror


Exploring Some Lesser-Known Scripting Languages

Nerval's Lobster writes: Scripting languages are used in everything from games and Web pages to operating-system shells and general applications, as well as standalone scripts. While many of these scripting languages are common and open to modification, there are some interesting, open-source ones that are worth a look, even if they don't have the substantial audience of some of the popular ones. Wren, Candle, Fancy, Pikt, and PPL all show what a single developer can do if they set out with enough motivation to create open-source scripting languages. The results often prove surprisingly powerful.

60 comments

  1. DICE disclaimer by Anonymous Coward · · Score: 1

    Why does the first paragraph have to contain the word JOB??

    1. Re:DICE disclaimer by rmdingler · · Score: 1
      Just being lazy.

      Opportunity, though friendlier to the ear, takes longer to type.

      --
      Happiness in intelligent people is the rarest thing I know.

      Ernest Hemingway

    2. Re:DICE disclaimer by Anonymous Coward · · Score: 0

      I don't know what your post is trying to say, but

      DICE disclaimer

      Submitter does a lot of Dice stuff. You're free to ignore these things and it's as simple as hovering your mouse over the first link in the summary and seeing where it goes.
      However as an amateur "I'll do it when I have the free time" programming language designer myself, I found this article useful in that I've now heard about these languages and may check them out for some inspiration.

    3. Re:DICE disclaimer by Anonymous Coward · · Score: 0

      why does the first post have to contain the word FIRST?

  2. The best part? by Anonymous Coward · · Score: 4, Funny

    The little bit at the bottom of the page that says "Related Jobs: Could not get related jobs".

    1. Re:The best part? by Anonymous Coward · · Score: 0

      Because learning a new programming language has always been about getting a job.

  3. Scripting languages can be great by Anonymous Coward · · Score: 0

    They just need to be able to call an .EXE file.

  4. tcl/tk by Anonymous Coward · · Score: 0

    how about that?

  5. Scripting isn't uncommon by Anonymous Coward · · Score: 0

    There's all sorts of minor scripting languages for specialised purposes. I've recently heard of "laser boxie" that provides a scripting language for creating laser cut boxes.

  6. Oooh is this free "Promote Your Language Day?" by lefticus · · Score: 4, Interesting

    http://chaiscript.com/

    Been working on it for over 5 years now. Stable and easy to use scripting for your C++ application.

    1. Re:Oooh is this free "Promote Your Language Day?" by Dutch+Gun · · Score: 3, Interesting

      Chaiscript looks interesting - something like what I would have probably designed for a language if I was writing one from scratch. I'm currently using Lua for my game engine, but integrating the raw C API with C++ requires a lot of ugly boilerplate code.

      A question while you're here - one of the most useful features of Lua for game development (at least for me) is the support for co-routines. Each lua script (or "chunk") can have it's own stack, and can therefore suspend execution and resume later. This allows a script to sleep for a specified period of time, for example, giving the appearance of being threaded without actually requiring each script to execute on a real thread - which would be far too much overhead.

      This enables me to write simple Lua scripts like:

      DoSomething()
      Sleep(5)
      DoSomethingElse()

      Is there a way to do something similar in Chaiscript? Note: it takes a bunch of external C++ code to be able to pull this off in Lua as well, so doing it via external code is fine.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    2. Re:Oooh is this free "Promote Your Language Day?" by lefticus · · Score: 1

      Hmm... each function call has its own stack, but individual scripts do not. The scripting engine itself is quite self contained (no singletons of any kind), so you could instantiate multiple engines, but that would get heavy handed...

      I'll think about it and see what the possibilities are.

      I've created this discourse topic to discuss the options http://discourse.chaiscript.co... feel free to chime in.

  7. Article not worth your time by Anonymous Coward · · Score: 0

    The article is very shallow, not comprehensive and utterly useless to anyone who is interested in these things to begin with.

    Seriously, if you're thinking of taking up another language, the usual sources of inspiration on the internet are a much better bet.

    1. Re:Article not worth your time by hcs_$reboot · · Score: 1

      Would be great to have a deeper article that makes comparisons between that new stuff and the currently popular languages ; and enhances the + and - of the unknown languages.

      --
      Slashdot, fix the reply notifications... You won't get away with it...
  8. I think that by Anonymous Coward · · Score: 0

    one entirely vapid and bloody stupid article per day about programming languages is more than enough, thank you.

    Not specific to programming languages, but /. standards are low these days. THANK YOU SO MUCH, DICE DOT COM.

  9. Who supports it by Snotnose · · Score: 4, Interesting

    I remember 7-8 years ago I was lead on a new project and we were deciding on a scripting language. I wanted Python over Perl. It was clearly easier to both read and write, and had object orientation.

    What shot it down? My boss telling me "we have a thousand engineers world-wide who know perl, and you 6 will be the Python experts. You really wanna support a thousand engineers learning Python over the next 5 years?"

    1. Re:Who supports it by Anonymous Coward · · Score: 0

      If you need a support group to spoon-feed you, you're not an engineer, you're an infantile cretin.

    2. Re:Who supports it by Tablizer · · Score: 1

      It's rational to make decisions based on what is currently known. It's hard to predict future popularity of tools. Merit alone won't tell you what clicks with the masses.

    3. Re:Who supports it by Anonymous Coward · · Score: 0

      Incapable of thinking for yourself? Don't worry, you can rationalize doing what you're told because you're told. There doesn't even need to be a reason.

    4. Re:Who supports it by John+Bokma · · Score: 2

      Perl has OO for longer than 7-8 years. Perl is not harder to read/write than Python. Hard to read code can be written in any language, including Python. And yes, one can argue that Perl makes it easier to write hard to read code, but why would one do this? Last but not least a lot of hard to read Perl is the result of cargo cult coding; too many people back in the mid-90's thought: "Oh, I know this, it's just another programming language". Heh.

    5. Re:Who supports it by Anonymous Coward · · Score: 0

      Did your neckbeard got stuck in your flesh light again, or what?

    6. Re:Who supports it by tcmatthews_jr · · Score: 2

      Python has to be one of the easiest programming languages to learn. In fact it is one of the easiest programming languages I have ever seen. If you think that Perl is even in the same ballpark in difficulty more power to you. I have looked over Python several times in the past and I am sure I could write anything I wanted with it. I don't work The biggest problem with Perl is the fact that you can if you choose write code nobody can understand 6 months from now. Maybe the problems was to may people writing code that way for job security. Who knows.

    7. Re:Who supports it by csirac · · Score: 1

      As someone who worked (reluctantly, initially) as a (mostly) Perl dev for nearly 4 years, and has now been doing python for nearly 2 years - I miss lexically scoped variables and the Moose OO system. Here's a comment I made on HN which summarizes my lament regarding pythonistas being unable to fathom the very concept of missing anything from the perl world. TL;DR - Perl+Moose gave me a taste for types and a more declarative programming style which is hard and inefficient to reproduce in python (to be fair, it's inefficient in perl too unles you code mostly immutable objects).

    8. Re:Who supports it by Marginal+Coward · · Score: 4, Interesting

      I switched from Perl to Python immediately after I discovered Python. Ironically, I first heard of Python when it was offhandedly mentioned in the book "Advanced Perl Programming." In Perl, I had developed the habit of writing a comment for nearly every line of code - much as most assembly programmers do. Python had similar semantics but much better syntax. It practically documents itself if you do it right. I never did figure out Perl's object syntax (bless, 'em), but objects are easy in Python.

      When I first learned Python, there were lots of Perl books on the shelf in the tech section of any large bookstore, and just a couple of Python books. As a Python fan, I was hoping it would catch on, and couldn't figure out why it wasn't taking the world by storm. Perl was the dominant player in CGI at that time, which made it a big thing. Over the years, I kept taking my little bookshelf polls every now and then, and the ratio changed. Turns out it just took awhile. Now, there are very few Perl books and lots of Python books.

      Thank you, Python. Oh, and thank you, Perl 6.

    9. Re:Who supports it by LordLucless · · Score: 3, Interesting

      As a Python fan, I was hoping it would catch on, and couldn't figure out why it wasn't taking the world by storm. Perl was the dominant player in CGI at that time, which made it a big thing. Over the years, I kept taking my little bookshelf polls every now and then, and the ratio changed. Turns out it just took awhile. Now, there are very few Perl books and lots of Python books.

      I think the problem was that the world didn't migrate from Perl CGI to a better CGI language; it went from CGI to PHP/Coldfusion/ASP, and python wasn't really relevant there. It wasn't until the flaws in those sort of systems became apparent, and OO, MVC frameworks like Django, Web2py, Pylons, etc, came into their own that python started appealing to the masses.

      --
      Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
    10. Re:Who supports it by Anonymous Coward · · Score: 0

      I've heard Lua's even easier to learn...don't know either language...

    11. Re:Who supports it by kleinesRaedchen · · Score: 1

      Python had similar semantics but much better syntax. It practically documents itself if you do it right.

      True for almost any programming language including Perl.

    12. Re:Who supports it by msobkow · · Score: 1

      Sure you can write readable and maintainable Perl.

      But most people don't.

      The same is true of PHP. It can be organized and elegant, but I've yet to have to maintain a single PHP or Perl application that didn't take longer to figure out than it would have to just rewrite the damned thing from scratch.

      Even Erlang is subject to "experts" using obscure syntax and constructs to save a couple of lines, sacrificing readability and maintainability.

      The problem is rarely the language; the problem is "developers" that have never had to maintain someone else's code often enough to understand the value of readability and maintainability.

      --
      I do not fail; I succeed at finding out what does not work.
    13. Re:Who supports it by Anonymous Coward · · Score: 0

      Well, it most certainly has a very nice and comprehensive book that you can use to learn it. That's not to say that there aren't Python books, but I found them generally somewhat more confusing, plus the sheer size of the language in question ("more magic") means that you have to read several times more pages to be ready to read most of the Python code you're going to encounter in practice. There's simply fewer things to learn.

    14. Re:Who supports it by Above · · Score: 1

      As someone who has written in at least a dozen languages, I do not understand arguments that "python is easier to read" at all. The way python wants to use indentation to indicate blocks of code is much more difficult to read for anything of modest complexity. With standard tab widths it wastes too much screen space, and with smaller tab widths it becomes impossible to follow moderately complex code. There's a reason why almost every other language on the planet has some sort of block delimiters.

      Also, python tends to be slow. I'm not sure how much of this is inherent to the language, and how much is how people use it. What I can say is that in real world experience python seems to be "too slow" for the task about twice as often as perl, and I have seen numerous examples of python tasks recoded into both C and perl to make them faster.

      Python's main win seems to be that it is easy to learn. I'm afraid many of the reasons why also make it slow.

    15. Re:Who supports it by mekkab · · Score: 1

      Sounds like I should change my business cards to: "Den Mother of Infantile Cretins."

      --
      In the future, I would want to not be isolated from my friends in the Space Station.
    16. Re:Who supports it by Dragonslicer · · Score: 2

      The way python wants to use indentation to indicate blocks of code is much more difficult to read for anything of modest complexity.

      At the abstract level, I understand why people have trouble with the idea that whitespace is significant in Python (I'm one of them). But after using it for a few years now, I've realized that if you don't indent your code the same way in Python as you would in any other language anyway, you're almost certainly doing something wrong.

    17. Re:Who supports it by gstoddart · · Score: 1

      LOL ... that pretty much sums up my first exposure to Python in the late 90s.

      Our product had libraries written in C, and we had some limited support for Tcl/Tk (hey, it was 97 or something like that).

      One of the guys in professional services proceeded to start writing a whole bunch of stuff in Python and created his own interface to our C stuff. We told him we didn't support Python, and told him the limitations of the library.

      He kept writing stuff in Python, and ignored the limitations of our library. We kept telling him we didn't and wouldn't support Python, he kept doing it.

      The first time someone had a bug and reported it, we said yet again "we don't support Python, we have no intention of supporting Python, and we have no intention of supporting language bindings we didn't create when we told you we wouldn't support them".

      Eventually he got told, in no uncertain terms by one of the development managers that he was on his own to support the crap he'd written, and had to resolve any and all problems with it on its own. Especially since he had done it on his own and ignored the limitations of the library. This eventually got back to the customer, who discovered they'd been sold something which we explicitly wouldn't support then or ever.

      So, is it a thing with Python users that they don't think about things like who supports it?

      This guy seemed to have thought if he kept ignoring us then eventually we'd need to support it because it would be in the customer's hands. He was sorely disappointed.

      You really can't just grab something because it looks cool and shiny and expect the rest of your company to follow suit -- sometimes, you have to listen to what people are telling you is the existing technology and strategy.

      --
      Lost at C:>. Found at C.
    18. Re:Who supports it by Anonymous Coward · · Score: 0

      "I've yet to have to maintain a single PHP or Perl application..."

      Don't worry, your code sucks just like everyone else's code. Why? Because you wrote it in Perl or PHP.

    19. Re:Who supports it by Marginal+Coward · · Score: 1

      I'm not sure I $_ what you mean.

    20. Re:Who supports it by bzipitidoo · · Score: 1

      using obscure syntax and constructs to save a couple of lines, sacrificing readability and maintainability.

      But that's one of the paradoxes. Saving a couple of lines reduces eye clutter. What's obscure to you may be obvious to an expert in that language. Shorter is usually better.

      What makes Perl difficult to read is the same thing that brought Perl to prominence, the regular expressions. People went nuts for regular expressions, and overused them. The Camel book warns readers about that. People are used to skimming through code quickly, because so much of it really is boilerplate. But you can't quickly skim regular expressions except the trivial ones. You have to study each symbol. Miss one backslash, and the entire meaning changes. I think the other big complaint about Perl is that the language overuses sigils. Having a $ in front of every scalar variable name is tiresome for both coder and maintainer. Adds visual clutter. Smacks very much of putting the compiler writer's convenience ahead of the application programmer, a sin committed in many languages. Why couldn't they use plain names? C did that, it's not hard, just need to reserve a few words, for example, don't allow a variable to be named "if".

      --
      Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    21. Re:Who supports it by QilessQi · · Score: 1

      Plus a million points for referring to the "underscore is understood" mnemonic.

      [applause.gif]

    22. Re:Who supports it by Anonymous Coward · · Score: 0
      If Python had only used brace delimiters instead of significant whitespace could it have been The One True Scripting Language?

      If you wanna drive the pythonistas crazy do what I do: delimit your blocks with #{ and #}.

    23. Re:Who supports it by John+Bokma · · Score: 1

      Here's some Python: http://codepad.org/UzSmoxF2

    24. Re:Who supports it by Salgat · · Score: 1

      He had a very good point. There are a million and one amazing languages out there for all sorts of applications but there is a real cost in time and support for using and supporting a niche language.

    25. Re:Who supports it by Marginal+Coward · · Score: 1

      $_ = 'Dagnabb';
      '$_it! I guess that proves the old adage that "you can write Perl in any language"';

    26. Re:Who supports it by John+Bokma · · Score: 1

      Yup. Before Python Pascal was thought of as the language that was extremely readable; it was nearly like programming in pseudo code (hah, it was actually that a cleaner version of Pascal was used in several textbooks on algorithms). However, years ago when I had to port Pascal to Perl (no, I am not making this up) I came upon hundreds of lines of very hard to read code. After some careful study I discovered that someone had coded bubble sort (in a very weird, long winded way) with a separate piece of code to reverse the sort order. Basically sort { $b cmp $a } @items ...

      My point is that how readable code is has also a lot to do if the implementation of an algorithm follows the expectations of the person reading the code. And (also) in Python there are many ways (really) to solve the same problem, including very unreadable ways.

      I do agree that Perl has a lot of "line noise" like $, @, %, etc. but that's not that different from learning a language with a non-Latin alphabet (e.g. Hindi, which uses Devanagari). After a very short while (in my experience) those weird symbols become second nature and actually help with reading (they are there for a reason). It's even more fun when one of the major complains about Python is lack of some line noise; the use of significant white space instead of {} ...

      Finally, while I have been doing some Python programming I am not attracted to the language. I don't know why I am attracted to Perl (and no, it's not because I am brainwashed by Perl). I think it's for the same reason that I consider Devanagari a very nice script. And why I am currently learning Haskell ;-)

    27. Re:Who supports it by nmr_andrew · · Score: 1

      Sure you can write readable and maintainable Perl.

      But most people don't.

      the problem is "developers" that have never had to maintain someone else's code often enough to understand the value of readability and maintainability.

      The same is true of Python (and most other languages for that matter).

    28. Re:Who supports it by Half-pint+HAL · · Score: 1

      At the abstract level, I understand why people have trouble with the idea that whitespace is significant in Python (I'm one of them). But after using it for a few years now, I've realized that if you don't indent your code the same way in Python as you would in any other language anyway, you're almost certainly doing something wrong.

      Yes -- if your code in C etc is not indented for human readability, then it is open to misinterpretation. This is true.

      On a conceptual level, Python's whitespace is a mess, though, because it breaks code encapsulation. Consider this:

      In C, each block knows nothing about its nesting level. It is a block: it knows its namespace, and it knows its contents. It does not need to know anything more than this, so we don't tell it anything more than this.

      With sematic whitespace, however, the level of nesting of blocks is made explicit, and therefore the code knows about the outside environment.

      The problem with this becomes apparent when copying and pasting code, as you probably aren't pasting at the same level.

      But OK, Python doesn't actually explicitly state the nesting level, as a level is at least two spaces or one tab, but can in theory be as long as you like. So the code doesn't actually know its nesting level after all -- it only has knowledge of the maximum depth that it might be nested at. It's not one thing or the other, and it's clearly a hack to sort the cut-and-paste problem, on the assumption that the most sensible use of cut-and-paste in coding is abstracting from in-line code to procedures (and hence should always result in a drop in nesting depth, hence the superfluous spacing being OK).

      But here's the thing... do we really need plaintext editors at all? Who among us doesn't use at the very least an editor with syntax highlighting? So why having leading whitespace characters in code at all? Tracking code nesting is a trivially easy problem, so why not let the computer do it for you? Whenever I say this, people object to being tied to specific editors, but it's such a tiny detail that you could add it into a well-written code editor in no time at all, and it's so lightweight you could even add it to vi to run on embedded systems with negligible impact on the memory footprint.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
  10. Re:Slow news day? by Anonymous Coward · · Score: 0

    Are you envious because the fucking faggots are having more sex than you?

  11. Instant R.Y.O. language? by Tablizer · · Score: 2

    How about a "language" that makes it easy to generate a language how I personally want it so that I'm not stuck with somebody else's goofy preferences:

    http://www.c2.com/cgi/wiki?Ins...

    1. Re:Instant R.Y.O. language? by K.+S.+Kyosuke · · Score: 2

      The thing you want is called OMeta.

      --
      Ezekiel 23:20
    2. Re:Instant R.Y.O. language? by phantomfive · · Score: 2

      I once read about a team that couldn't agree on formatting, so they finally set up a system that pretty-printed code as soon as it was checked out of CVS, adjusting tabs/spaces/braces etc, according to each user's preference.

      If you had a language-generator as you suggest, then you could automatically convert the source code to match the preferred language of each user on checkout. It would be easy.

      --
      "First they came for the slanderers and i said nothing."
  12. C++ by Roger+W+Moore · · Score: 3, Informative

    C++ might be a well known language but it is generally never though of as a script language. However if you are curious you can have a look at ROOT C++ or as some of us like to call it C+/-...because it is only C++ to within some (wide) margin of error.

  13. Or... by Anonymous Coward · · Score: 0

    Just use the newly released Lua 5.3. ;-)

  14. my favorite by 50000BTU_barbecue · · Score: 1

    .bat
    Maybe that's why I'm depressed.

    --
    Mostly random stuff.
    1. Re:my favorite by Anonymous Coward · · Score: 0

      Could be worse. Your favourite could be .ps1
      Then you would be manically depressed.

      Learning point for everyone else here: The difference between mere depression and manic depression in one simple test.

    2. Re: my favorite by Anonymous Coward · · Score: 0

      AppleScript 'cause I'm delusional

  15. Re: Slow news day? by Anonymous Coward · · Score: 0

    Back to 4chan...

  16. GameMonkey by greggman · · Score: 2

    I know Q-Games, makers of PixelJunk Shooter, PixelJunk Eden, The Tomorrow Children, NomNom Galaxy, etc, has used GameMonkey 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.

  17. Could not get related jobs. by aquila78 · · Score: 1

    See the "Related jobs" add at the end of the article with the contents "Could not get related jobs."

  18. Squirrel by Anonymous Coward · · Score: 0

    I like squirrel http://www.squirrel-lang.org

  19. REBOL by Anonymous Coward · · Score: 1

    Is now open source under the Apache 2.0 license. If you haven't tried it, you should.

    There are many examples available here: www.rebol.net/cookbook/

    It took me a couple of minutes to come up with a one line script that would test a group of webservers and if any were down, email an alert message to a list of people.

    Pretty nifty.