Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Programming Open Source

Exploring Some Lesser-Known Scripting Languages 60

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.
This discussion has been archived. No new comments can be posted.

Exploring Some Lesser-Known Scripting Languages

Comments Filter:
  • by Anonymous Coward

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

  • by Anonymous Coward on Tuesday January 13, 2015 @07:53PM (#48807517)

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

  • by lefticus ( 5620 ) on Tuesday January 13, 2015 @08:10PM (#48807631) Homepage

    http://chaiscript.com/ [chaiscript.com]

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

    • by Dutch Gun ( 899105 ) on Tuesday January 13, 2015 @09:31PM (#48808149)

      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.

      • by lefticus ( 5620 )

        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... [chaiscript.com] feel free to chime in.

  • Who supports it (Score:5, Interesting)

    by Snotnose ( 212196 ) on Tuesday January 13, 2015 @08:22PM (#48807699)
    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?"
    • by Tablizer ( 95088 )

      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.

    • 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.
      • 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 wri
        • Re:Who supports it (Score:5, Interesting)

          by Marginal Coward ( 3557951 ) on Tuesday January 13, 2015 @11:38PM (#48808713)

          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.

          • Re:Who supports it (Score:4, Interesting)

            by LordLucless ( 582312 ) on Wednesday January 14, 2015 @12:05AM (#48808813)

            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.

          • 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.

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

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

                [applause.gif]

              • Here's some Python: http://codepad.org/UzSmoxF2 [codepad.org]
                • $_ = 'Dagnabb';
                  '$_it! I guess that proves the old adage that "you can write Perl in any language"';

                  • 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 t

      • by msobkow ( 48369 )

        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 "develope

        • 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 s

        • 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).

    • by csirac ( 574795 )
      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 [ycombinator.com] 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,
    • by Above ( 100351 )

      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, py

      • 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.

        • 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 block

    • 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 k

    • by Salgat ( 1098063 )
      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.
  • by Tablizer ( 95088 ) on Tuesday January 13, 2015 @09:03PM (#48807965) Journal

    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... [c2.com]

    • The thing you want is called OMeta.
    • 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.
  • C++ (Score:4, Informative)

    by Roger W Moore ( 538166 ) on Tuesday January 13, 2015 @09:14PM (#48808051) Journal
    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++ [root.cern.ch] or as some of us like to call it C+/-...because it is only C++ to within some (wide) margin of error.
  • .bat
    Maybe that's why I'm depressed.

  • by account_deleted ( 4530225 ) on Wednesday January 14, 2015 @02:49AM (#48809287)
    Comment removed based on user account deletion
  • See the "Related jobs" add at the end of the article with the contents "Could not get related jobs."
  • by Anonymous Coward

    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.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...