• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What do Most Java Programmer's Use for Scripting

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I realize this is not the wholly correct forum, but this seemed like the least worst place to post this.

For some of your daily activities, you will have work for which Java is innapropriate and ANT isn't the right tool, e.g., doing something with backup scripts, automation, etc.

What do most Java programmers in these cases use as a scripting language? Something "full-blown" like Python, or just bash shell. Just curious. It would seem odd to learn a large complex language just to do quick scripting tasks. Cross platform would be nice, but even Perl can turn out to be pretty complicated.

Thank's in advance.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gary Furash wrote:What do most Java programmers in these cases use as a scripting language? Something "full-blown" like Python, or just bash shell. Just curious. It would seem odd to learn a large complex language just to do quick scripting tasks


Bash for me; but then I'm an old Sysadmin. In fact it's one of the very few things that I'd say I'm an expert in after nearly 20 years, starting with Bourne; got me own toolkit and doc system to prove it.
And just to prove what a dinosaur I am, I'll p*ss off all the Perlies out there by saying that awk is the best thing I've ever come across for text mangling.

Winston
 
Ranch Hand
Posts: 492
Firefox Browser VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gary Furash wrote:What do most Java programmers in these cases use as a scripting language? Something "full-blown" like Python, or just bash shell. Just curious. It would seem odd to learn a large complex language just to do quick scripting tasks. Cross platform would be nice, but even Perl can turn out to be pretty complicated.



When I was trying to figure out what scripting language to use I tried a bunch of online tutorials to get a feel for the languages, I ended up really enjoying Ruby and use that almost everyday now; but there are plenty of other alternatives, ksh, bash, python, perl, lua. A ton of languages you can choose from.


Hunter
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
bash
 
Gary Furash
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sure that Ruby, Python, Perl, and any of the new desktop JavaScript solutions are great for scripting, but you can also use those for building Java-sized apps, which implies to me that learning them, while not hard, is kind of big and "endless", like Java. Things like the aformentioned Bash seem more like scripting solutions - limited, imperfect, but quick and easy. I would have put in Perl, but that thing has tens of thousands of models including OO. Thanks, I think I'll go with bash for now. With cygwin32, its crossplatform enough form me.

I wanted to use something like Beanshell or Groovy, but Beanshell isn't supported that well (the community just restarted) and Groovy is again its own thing, with non-java syntax.

Please correct me if I'm off here.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
bash or zsh for me, depending on what's available on the particular system I'm on. Although I seem to recall an occasion or two where I found it handy to use groovy.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gary Furash wrote:Groovy is again its own thing, with non-java syntax.



As far as I know, although Groovy does have feature in the language that Java does not, everything that's legal Java syntax is also legal Groovy syntax. You can just plain ol' write Java and execute it via the Groovy interpreter. There are a couple of small caveats though. I think that == in Groovy calls equals(), and that you have to use the is() method for reference equality. Also, array syntax gets you a List (ArrayList, I would imagine) rather than a Java array, though there is a way to get an array as well I think.
 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
keep in mind that even if the language is large like Python, Ruby, or Perl; you don't need to know everything about the language to write small scripts. You only need to focus on the subset of the language your task requires.

Hunter
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gary Furash wrote:Thanks, I think I'll go with bash for now. With cygwin32, its crossplatform enough form me.
Please correct me if I'm off here.


Not at all. It has to be said, though, that comparing bash with something like Python or Ruby is a bit unfair. Many of the "scripts" that have been mentioned have fully-fledged "this is a language, goddammit!" forums (many with some justification), and some of them need a JVM to run on.
When I first used the Bourne shell, it fit in 64K; and the latest version of bash is still less than a meg; the average JVM is about 10, and although I'll bet that it's resident (what we used to call 'sticky') on most machines these days, it still takes a bit of priming.

Why do I like bash? Because it is Unix. There's really nothing that you can do outside it (except maybe some eeprom commands and scsi checks) that you can't do in it. And, especially post-Vista, it is not the same thing as the "command prompt" in Windows.

Winston
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic