• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
  • Piet Souris
  • Mikalai Zaikin

The power of scripting languages

Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In another thread, someone praised Python (Jython) for being so well-integrated with Java. Other scripting languages have been specifically designed to be as Java-like as possible, e.g. BeanShell or DynamicJava. I would contend that embedded languages might be most useful when they are as Java-unlike as possible.
When the possible creation of this group was discussed in the moderator's forum, I said:

[...] scripting techniques (in the broadest sense) are undervalued, underused, and genuinely important. One of my frustrations with Java is that it is often used inappropriately. When applied well, Java's object orientation means that the solution can be formulated in terms of concepts from the problem domain, but that doesn't mean that Java is the best tool to do so. How much time would it take you to write Java code to transform an XML document from one vocabulary into another? The obvious answer is, you would never do that. You'd want to use XSLT in all but the most trivial cases.
Scripting can be a superior way to formulate solutions and business logic. It can use a more-or-less traditional programming language to add ease of development and agility (jRuby, when matured, might work wonderfully) or something completely different for problem-specific expressive power (such as XSLT). [...] For example, Ofbiz uses RuleML to express business rules. I understand they plan on adding a Prolog interpreter - another great example of a language that can reduce the effort to solve some problems by an order of magnitude (rule inference in this case).

Template languages are another example, even though despite worthy aims most of them are a poor excuse for a programming language.
At this point, I am particularly interested in the second way to use a non-Java-like embedded language: to solve certain classes of problems more more flexibly and quicker than you could achieve with Java or any of its peers. I have this gut feeling that there are enormous productivity gains and, heck, large quantities of fun to be had that way.
What are your thoughts? Do you have any success or horror stories to share? Am I spouting nonsense?
- Peter
[ February 15, 2002: Message edited by: Peter den Haan ]
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Peter den Haan:
Template languages are another example, even though despite worthy aims most of them are a poor excuse for a programming language.

I am not sure what you call "template languages", maybe something entirely different from what I have in mind. I worked with Clarion, a template-based code-generation engine, before moving to Java. Since then I have a feeling that Java isn't quite an adequate development tool
Here is an old article about it.
Clarion "hides" great amount of code in its templates, and you as a programmer only have to
1) choose an appropriate template ("table", "form" to edit a record, "report"...)
2) substitute parameters (which file you want to edit, which index to use for sorting etc.)
3) "plug in" your own pieces of code to do something that isn't in a template.
Clarion provides a lot of places where you can add your code: before file content is shown, before a record content is shown, after user closed the window, after user pressed given key... You communicate with templates through GUI and all job is pure joy We used templates that output code in Clarion language, but they had templates for C, Pascal, and maybe even Java, I am not sure.
We had a set of templates for a standard desktop application, and everything worked just fine until once we had to support hierarchical data and here standard templates weren't big help. Amount of "added" code probably exceeded amount of generated. We really should have thought about developing our own templates instead of misusing standard ones, but when you are in a "production mode" and all your code has to be written yesterday, you do not think, you code :roll:
An ideal variant would be to have one highly-qualified "template" developer in a team, who would analyze domain and modify/write new templates for the rest of gang. I believe that would speed up the development on an order of magnitude.
In my understanding, both a template-based and object-oriented approaches aim to achieve code reusability. OOA is more powerful, but it is much more difficult to master.
Of course, really thing would be to combine the best from both approaches: to keep all power and dynamics of OOA and to liberate a programmer from mundane coding. I did not think much in this direction, but I also have strong "gut feeling" that it is where enormous productivity gains and all fun is.
[ February 15, 2002: Message edited by: Mapraputa Is ]
no wonder he is so sad, he hasn't seen this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic