views:

141

answers:

1

Has anyone used GolfScript for a serious project aside from CodeGolf? Perhaps you could give an example. I am curious to learn it and I am wondering if its worth my time or if its just a hobby language?

When I search stackoverflow.com I can only find CodeGolf examples of the language. In some sense it reminds me when I first learned Perl. It appeared to be some mysterious and cryptic language. However, Perl has much practical and historical appeal. I especially enjoy the Regex capability built into the language. As far as I can tell by the API there is no built in Regex capability to GolfScript. Although, someone created a simple Regex parser in 256 chars.

So is GolfScript really worth learning?

GolfScript used on stackoverflow.com [11-Oct-2010]:

Conversion:

The source code looks fairly small. I think it would be an interesting conversion to another language. It is copyrighted by Darren Smith so with his permission of course. The token parsing seems fairly compact.

GolfScript Syntax:

/[a-zA-Z_][a-zA-Z0-9_]*|'(?:\\.|[^'])*'?|"(?:\\.|[^"])*"?|-?[0-9]+|#[^\n\r]*|./m

{} denote inner block creation

: is a special assignment operator

Every other token is treated as a variable. Numbers and strings are variables too, just that they have a logical initial value (which you could change if you really wanted to).

' Strings and " strings are parsed using ruby's string parse, via eval. Therefore it is possible to run ruby code in GolfScript by doing something like this: "#{Time.now}"

+1  A: 

It's worth learning if you can save time (if you value time), create a better solution (if you care), or increase value in some way (whatever that may be) by using it :-)

For many people the 'monetary payout' is a factor to consider. (i.e. one might learn/use COBOL if they can find a well-paying job that uses it.)

Edit: @Shiftbit It might save time if all you do is codegolf ;-) Most computer programs are significantly more complex -- and the complexity often requires readability and maintainability not to mention a useful collection of libraries. (Granted some languages have arguably taken a '3rd grade reading level' approach too far.)

pst
It definitely seems like a language that could save time. As for COBOL it seems to be diametrically opposed to GolfScript as far as syntax is concerned. But I am not sure if there is any demand for GolfScript. I know COBOL is ingrained in many banking systems. I have not seen any practical demand for GolfScript except for Code Golf challenges.
Shiftbit
+1 It reminds me of the Yoda tale about Perl vs Python: http://www.netfunny.com/rhf/jokes/99/Nov/perl.html
Shiftbit