|By Rick Hightower||
|February 1, 2000 12:00 AM EST||
Back before Java became popular, I was a C++ bigot. I programmed in nothing but C++. I lived, ate and breathed C++. If it wasn't C++, it was rubbish. I thought C++ was the alpha and omega of object-oriented programming. I had "operator overloading" for breakfast, "templates" for lunch and "multiple inheritance" for dinner, and I always went back for seconds.
Then a funny thing happened. I got a new job at another company as a C++ programmer. But they pulled the old bait and switch. Once I started working, someone suggested writing a good portion of a large project in a scripting language. I protested - I would not condescend to program in any other language but C++.
Shortly after I started at this new company the following edict was put forth: "Thou shall use a scripting language." Thus I was forced by management to write a good portion of the project in a high-level scripting language. They told us to glue components written in C++ together with this scripting language (in addition to writing components in C++). At first I hated it, as any self-respecting C++ bigot would. Then, gradually, the productivity of my team - and me - skyrocketed.
I became a true believer in scripting languages. The more I saw productivity climb, the less I coded in C++ and the more I coded in the scripting language. Granted, the scripting language had some limitations, but for many tasks it was just what the doctor ordered. Have you had a similar experience with a scripting language? If not, perhaps you should.
Many scripting languages are either object-oriented or object-based. Almost all of them are interpreted and use late-bound polymorphism. This makes scripting languages extremely dynamic and easy to program, which is essential for rapid application development (RAD), gluing components together and prototyping projects.
There's a fine line between a scripting language and a programming language. For example, Smalltalk is an extremely dynamic interpreted language, yet I dare you to call it a scripting language to a Smalltalk evangelist - you'll probably get punched in the nose. When I refer to scripting languages, I'm referring essentially to languages that are mostly interpreted and extremely dynamic, that is, they employ late-bound polymorphism and dynamic typing.
Java for the most part is a glorified scripting language - granted, a scripting language on steroids. Unlike most such languages, however, Java uses statically typed polymorphism; thus it has been called a hybrid language. At first this may seem like a disadvantage, but as it turns out, statically typed polymorphism is great for systems programming, framework definition and component development. Java's design by interface is truly great for large systems and frameworks.
Calling Java a system programming language to a system programmer is likely to evoke a nasty response (similar to calling Smalltalk a scripting language to a Smalltalk evangelist). However, don't view Java as a system programming language in the classic sense. Instead, view it as a virtual system programming language for a virtual system, that is, a virtual machine: the Java Virtual Machine (JVM). And Java, like its scripting language cousins, can be very dynamic - not as dynamic as Python, Smalltalk, and their ilk, but more dynamic than C++.
The funny thing is that the parts of Java that make it a great system language are the same parts that make it a mediocre scripting language. Don't get me wrong. Java is a great language. I jumped on the Java bandwagon as soon as I could hop a ride, and it's been good to me. However, Java is not as easy to use as scripting languages are. You really need a glue language in your toolkit. Build components and frameworks with Java, but glue the frameworks with a scripting language.
Don't fret! There's a history of using high-level scripting languages with system languages. Thus it's no surprise that there are scripting languages for Java. (Note: Don't get hung up on the term scripting; you can replace it with programming.)
Scripting Languages and System Languages: A Marriage Made in Heaven
For example, on UNIX systems many programmers program in C and C++, then glue modules together using higher-level shell programming (KornShell, C Shell, Bourne Shell, etc. Thus C is the system language and the shell scripts are the glue.
Another example: C and C++ programmers on UNIX often use Tcl (a scripting language) to do their GUI programming and glue together classes and libraries written in C++. C++ is the systems language and Tcl is the glue.
At other times C and C++ programmers will use Python as a control language - Python often ships with the UNIX system preinstalled. Python is easy to extend with a C. Again, C is the system programming language, Python is the glue.
The most prevalent example of an object-based scripting language is Visual Basic, which is often used to glue together COM components written in a variety of languages - C++, Delphi, and so on. Thus C++ is the systems language and Visual Basic is the glue.
Scripting Equals Increased Productivity
For more information on scripting languages and increased productivity check out the paper "Scripting: Higher Level Programming for the 21st Century" by John K. Ousterhout ( www.scriptics.com/people/john.ousterhout/scripting.html). The paper basically states what I have experienced: namely, a sharp increase in productivity by using a higher-level language. The paper states that a scripting language is five to 10 times more productive than a strongly typed language like Java.
Scripting languages, however, don't replace a system language; they augment it. And five to 10 times more productive seems a little high to me. My personal experience has been two to three times as fast, depending on the application. Your results may vary.
You may want to use a scripting language for the following reasons:
- To extend an application, that is, an extension language
- To debug an application
- To learn and experiment with the Java API
- To prototype a system rapidly
- To glue together subsystems and components
- To automate testing and regression testing
The best way to learn the Java API is by experimenting. Working with dynamically typed, interactive scripting languages allows you to experiment quickly. Even though the Java API is documented well, it helps to try things out interactively. I do this all the time.
The properties listed above make scripting languages ideal for prototyping. Once you start using an interactive, dynamic scripting language, you won't stop. It's addictive and productive.
Java Was Built to Be Scripted
Java has wonderful features that make creating scripting languages easy. The class reflection and bean introspection APIs are a great basis for integrating these languages. Essentially, the scripting language can get metadata about a Java's class properties, events and methods. The scripting language can then use this metadata to change properties, handle events and invoke methods.
To learn more about introspection and reflection see the API documentation under java.lang.reflect.* and java.beans.Introspector. I've had the pleasure of doing metaprogramming with COM, CORBA and Java. Out of the three, I much prefer Java's reflection and introspection mechanism and APIs. It's a lot easier to use.
Scripting Languages for the Java Virtual Machine
Some may feel that the only language for the JVM is Java. They're wrong. Like many platforms (and Java is very much a platform), the JVM has many languages. And the list of those that work in the JVM seems to keep growing. Mixing Java with a scripting language for RAD is a powerful one-two punch that could make your next project fly.
Introduction to a Regular Column
The Column's First Series
To kick off the column's birth, I'll start with a multipart series on programming and scripting languages that run in the JVM. These languages are Java-friendly, and often run in the JVM in both interpreted mode and as compiled Java classes, that is, they can be compiled to Java bytecode. These languages integrate well with Java classes and beans via the introspection and reflection APIs. They're great for prototyping, gluing together Java components and rapid application development. All of the languages are 100% Pure Java.
A lot of languages work in the JVM. Rather than just pick the ones I think are best, I want to solicit your feedback on which ones are most important to you. You can take part by going to the JDJ forum and voting. However, I've made a short list of languages that I think you should consider.
- JPython (Python)
- Instant Basic (Visual Basic clone)
- JACL (Tcl)
- BeanShell (Java-like)
- Bistro (Smalltalk-like)
- Skij (Lisp/Scheme-like)
Short Drill-Down of Different Languages
- Python (JPython): Java implementation of Python, a high-level, extremely dynamic, object-oriented language. JPython is very close to Python, and has been certified 100% Pure Java. Recently, NetBeans (the Java IDE maker that was bought by Sun) had a poll on their Web site regarding integrating a scripting language with their Java IDE. JPython won by a landslide. If you've used it, you know why.
You can develop JSP in JPython - called PSP for Python Server Pages. Python and JPython are open source. To learn more about JPython visit www.jpython.org and www.python.org. To learn more about Python Server Pages, which run in a Java Servlet server, see www.ciobriefings.com/psp/. (PSP is freely available.)
- Tcl (JACL): Java Command Language (JACL, i.e., Java Tcl) is a Java implementation of Tcl 8.x. With JACL you can write scripts for Java components and APIs. In addition, there is Tcl blend, which allows manipulation of Java objects directly from Tcl. Tcl is open source. To learn more about Jacl see the Scriptics Web site at www.scriptics.com/products/java/. Many Tcl users have claimed significant reduction in development costs. Tcl is the definition of RAD.
- Java (BeanShell): BeanShell is interpreted Java. The syntax is very much like Java, i.e., BeanShell executes Java statements and expressions. Like other scripting languages, BeanShell is dynamically typed; thus much of Java syntax for type declaration and casting is optional. This is a wonderful language for writing prototypes and learning new APIs (new to you) through experimentation. In addition, BeanShell, as the name implies, adds extra support for dealing with beans. I find it very easy to use, and it's freely available and open source under the GPL license. To learn more visit www.beanshell.org. (You may also want to check out Dynamic Java, which seems similar to BeanShell, at www.inria.fr/koala/djava/.)
- Smalltalk (Bistro): Bistro is a Smalltalk variant with extensions for Java features and integration. It offers software developers the ability to code in a syntax that is very readable and expressive. Like BeanShell, Bistro is dynamically typed with the option of being statically typed for closer integration with Java. Thus you can mix and match statically typed systems with those that are dynamically typed. For prototyping, the dynamically typed languages make a lot more sense. Smalltalk is purely dynamically typed. This variant has a good mix of the Java type safeness with the Smalltalk fast development. For more information on Bistro see www.jps.net/nikboyd/bistro/.
- Scheme (Skij): Skij is a small Scheme interpreter implemented in Java. Scheme is a variant of Lisp. Skij enables rapid prototyping in the Java environment. It has many advanced features like macros and first-class continuations. You can download a copy of Skij at www.alphaworks.ibm.com/formula/skij . There are at least 15 ports of Scheme to the JVM. If Skij isn't your favorite Java Scheme variant, let us know what is and why.
The above-mentioned languages are just suggestions. If your favorite isn't listed or none of them tickled your fancy, then go to Robert Tolksdorf's comprehensive list of programming languages for the JVM at http://grunge.cs.tu-berlin.de/vmlanguages.html. Over 100 languages are listed! Find one you like and tell us convincingly why it's the best thing since sliced bread. We don't want to miss the next great thing.
Convergence Dynamic to Static,
and Static to Dynamic Typing
It's interesting to compare BeanShell and Bistro. The former is essentially a Java variant that has added dynamic typing with optional static typing. The latter is a Smalltalk variant that has added static typing with optional dynamic typing. Java and Smalltalk are on both ends of the typing spectrum; these variants have crossed the chasm to provide a mix of dynamic and static typing (see Figure 1).
BeanShell and Bistro are on the right track. The most popular scripting language of all time, Visual Basic, also has support for both static and dynamic typing. Note that JPython has yet another way to fill in this typing gap, as we'll see when we cover JPython in the first article in this series.
Rosetta Stone Examples for Programming Languages
This article series will give specific examples that demonstrate how scripting languages can be more productive. Some are great for certain problem domains; the series will highlight the languages working in those domains. Other languages are general purpose; the series will show all of the languages working in a general-purpose manner.
The first part in the series will cover scripting languages in general, and will introduce JPython. Every article (including the first) will demonstrate several sample applications as follows:
- A simple GUI application
- A simple statistics application
- Embedding the script into an application (if applicable)
- A threaded animation application
- A simple example parsing text
Criteria for Judging the Best Languages
- Ease of use
- Resemblance to parent language
- Unique features
- String parsing
- Working well with Java classes
- Development environment/debugging
- Ease of use: This will cover how easy the language is to learn and use. This could be a combination of market factors. For example, the language is a lot like Visual Basic, and a lot of developers know Visual Basic. Therefore it's easy for many developers to learn. Ease of use could also be based on the syntax of the language. For example, Python is a really easy syntax to learn.
- Embedability: One reason many people use scripting languages is to embed the language into a large application to make it more extensible. Examples of this in the industry are Visual Basic for Applications (VBA) for Microsoft Excel and LotusScript for Lotus Notes. The advantage of using many of these languages is that you can embed them into your own application. In addition, you can use them to control a large system of components and frameworks written in Java. Thus this criterion is how easily you can embed the scripting language in your application and how well the language integrates with Java.
- Unique features: What makes this language cool? What features set this language apart from Java or the other languages? This could be a set of language features that gear the language to a particular problem domain. For example, the language could have a library that's good for generating XML and HTML documents, and the language is easy to integrate with JSP; thus the language is great for Web programming.
- String parsing: Many scripting languages are really keen at doing common tasks like string parsing. Some really excel at it. This covers the string-parsing capabilities of the languages being covered.
- Productivity: If this language is more productive than Java, then this section will highlight that fact. Productivity can be made up of several factors. For example, Smalltalk and Python have an extensive class library that can make it easy to perform common tasks. In addition, Python has built-in language support for collection objects including collection literals that let you define a collection. These language constructs and class libraries make programming strikingly productive.
- Working well with Java classes and APIs: Some languages can compile to Java bytecode, a Java class you can use from other Java classes. Some can extend a Java class into the equivalent of a class for that language. This section will measure how well a developer can integrate this language into existing Java projects.
For example, a language that allows you to define a class that subclasses a Java class may be considered to have very good Java integration.
As another example, Bistro extends Smalltalk syntax so that methods can have type signature. This makes integration with Java easier. Smalltalk ordinarily is only dynamically typed; however, Bistro can be dynamically typed or statically typed. This is a cool feature that will make integrating with Java easier.
- Development environment/debugging: Some languages have facilities to develop and debug code. Some of the development environments are a lot nicer than others. This section will compare the development environments of these scripting languages.
- Other items to be covered: What are the origins of the languages? Why were they developed? What problem domain were they developed for? This often helps in understanding why a language is adept in certain areas.
You've probably seen some reference to the famous (read: infamous) "Hello, World" sample program that a lot of programming language books put as their first example program (thanks to the creators of the C language).
Let's continue the tradition in this column, and give you a taste of some of these scripting languages. Instead of covering one language, however, we'll do two from the language series. Also, instead of a simple "Hello, World," we'll have a "say hello" button. When the user selects this button, another window will pop up and display "Hello, World" in an 18-point bold font. To start this off, we'll show this program in Java as in Listing 1.
Since you likely know Java well, I won't explain the listing in detail. Now use it to compare some of the other languages. The code snippets in Listings 2 and 3 will be as close to Listing 1 as possible (as close as the language permits while still showing the advantages of the featured language).
Now let's show one of my personal favorites - JPython. JPython integrates nicely with the Java bean properties and event model. Also, JPython is very expressive (it weighs in at about two thirds the size of the shorter of the other two listings - size measured in bytes, not lines, since Java can all be on one line).
JPython has a lot of momentum, and its syntax is easy to learn and real tight (not verbose). A version of JSP, PSP (Python Server Pages), works in a servlet engine. Keep an eye out for this one. (Note the double underbar, i.e., __sayHello denotes that sayHello is a private method.) The first article in the language series will be devoted to JPython, which is to JavaBeans what Visual Basic is to ActiveX. We'll cover it in more detail in the next article.
Interest is growing in some of these languages. The JDK 1.3 has added more features for hooking scripting languages to events. IDE developers are starting to include scripting language support in their tools. One or two of these languages are likely to be the next Java or XML, that is, insanely popular Internet Phenomena.
Components (JavaBeans) and distributed components (CORBA, EJB, RMI) have a symbiotic relationship with high-level languages. For example, Visual Basic did well because of VBX, OCX and ActiveX components. And COM/ ActiveX/DCOM did well because of tools like Visual Basic, PowerBuilder, Delphi, and so on. On the Java platform we have the component models; we need the glue, that is, tools for the high-level languages - such as debuggers and IDEs.
Scripting languages are dynamic, interactive environments that help you develop Java code rapidly. The mere assertion that scripting languages improve productivity five to 10 times merits your interest. Go find a scripting language that runs in the JVM and conquer your next Java project in record time. Then let us know how it went.
SYS-CON Events announced today that Juniper Networks (NYSE: JNPR), an industry leader in automated, scalable and secure networks, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Juniper Networks challenges the status quo with products, solutions and services that transform the economics of networking. The company co-innovates with customers and partners to deliver automated, scalable and secure network...
Apr. 29, 2017 08:45 AM EDT Reads: 1,727
Five years ago development was seen as a dead-end career, now it’s anything but – with an explosion in mobile and IoT initiatives increasing the demand for skilled engineers. But apart from having a ready supply of great coders, what constitutes true ‘DevOps Royalty’? It’ll be the ability to craft resilient architectures, supportability, security everywhere across the software lifecycle. In his keynote at @DevOpsSummit at 20th Cloud Expo, Jeffrey Scheaffer, GM and SVP, Continuous Delivery Busine...
Apr. 29, 2017 08:45 AM EDT Reads: 1,233
SYS-CON Events announced today that T-Mobile will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on ...
Apr. 29, 2017 07:15 AM EDT Reads: 1,487
Bert Loomis was a visionary. This general session will highlight how Bert Loomis and people like him inspire us to build great things with small inventions. In their general session at 19th Cloud Expo, Harold Hannon, Architect at IBM Bluemix, and Michael O'Neill, Strategic Business Development at Nvidia, discussed the accelerating pace of AI development and how IBM Cloud and NVIDIA are partnering to bring AI capabilities to "every day," on-demand. They also reviewed two "free infrastructure" pr...
Apr. 29, 2017 07:15 AM EDT Reads: 1,719
SYS-CON Events announced today that Super Micro Computer, Inc., a global leader in compute, storage and networking technologies, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Supermicro (NASDAQ: SMCI), the leading innovator in high-performance, high-efficiency server technology, is a premier provider of advanced server Building Block Solutions® for Data Center, Cloud Computing, Enterprise IT, Hadoop/...
Apr. 29, 2017 05:30 AM EDT Reads: 2,551
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place June 6-8, 2017, at the Javits Center in New York City, New York, is co-located with 20th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry p...
Apr. 29, 2017 05:00 AM EDT Reads: 1,531
Judith Hurwitz is president and CEO of Hurwitz & Associates, a Needham, Mass., research and consulting firm focused on emerging technology, including big data, cognitive computing and governance. She is co-author of the book Cognitive Computing and Big Data Analytics, published in 2015. Her Cloud Expo session, "What Is the Business Imperative for Cognitive Computing?" is scheduled for Wednesday, June 8, at 8:40 a.m. In it, she puts cognitive computing into perspective with its value to the busin...
Apr. 29, 2017 04:00 AM EDT Reads: 3,827
NHK, Japan Broadcasting, will feature the upcoming @ThingsExpo Silicon Valley in a special 'Internet of Things' and smart technology documentary that will be filmed on the expo floor between November 3 to 5, 2015, in Santa Clara. NHK is the sole public TV network in Japan equivalent to the BBC in the UK and the largest in Asia with many award-winning science and technology programs. Japanese TV is producing a documentary about IoT and Smart technology and will be covering @ThingsExpo Silicon Val...
Apr. 29, 2017 02:30 AM EDT Reads: 9,371
The 20th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held June 6-8, 2017, at the Javits Center in New York City, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Containers, Microservices and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit your speaking proposal ...
Apr. 29, 2017 01:45 AM EDT Reads: 1,611
SYS-CON Events announced today that CollabNet, a global leader in enterprise software development, release automation and DevOps solutions, will be a Bronze Sponsor of SYS-CON's 20th International Cloud Expo®, taking place from June 6-8, 2017, at the Javits Center in New York City, NY. CollabNet offers a broad range of solutions with the mission of helping modern organizations deliver quality software at speed. The company’s latest innovation, the DevOps Lifecycle Manager (DLM), supports Value S...
Apr. 29, 2017 01:45 AM EDT Reads: 1,323
The age of Digital Disruption is evolving into the next era – Digital Cohesion, an age in which applications securely self-assemble and deliver predictive services that continuously adapt to user behavior. Information from devices, sensors and applications around us will drive services seamlessly across mobile and fixed devices/infrastructure. This evolution is happening now in software defined services and secure networking. Four key drivers – Performance, Economics, Interoperability and Trust ...
Apr. 29, 2017 12:30 AM EDT Reads: 980
With billions of sensors deployed worldwide, the amount of machine-generated data will soon exceed what our networks can handle. But consumers and businesses will expect seamless experiences and real-time responsiveness. What does this mean for IoT devices and the infrastructure that supports them? More of the data will need to be handled at - or closer to - the devices themselves.
Apr. 29, 2017 12:00 AM EDT Reads: 1,090
Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the USA and Europe, we work with a variety of customers from emerging startups to Fortune 1000 companies.
Apr. 28, 2017 10:30 PM EDT Reads: 2,530
In his keynote at @ThingsExpo, Chris Matthieu, Director of IoT Engineering at Citrix and co-founder and CTO of Octoblu, focused on building an IoT platform and company. He provided a behind-the-scenes look at Octoblu’s platform, business, and pivots along the way (including the Citrix acquisition of Octoblu).
Apr. 28, 2017 10:30 PM EDT Reads: 1,678
Financial Technology has become a topic of intense interest throughout the cloud developer and enterprise IT communities. Accordingly, attendees at the upcoming 20th Cloud Expo at the Javits Center in New York, June 6-8, 2017, will find fresh new content in a new track called FinTech.
Apr. 28, 2017 10:15 PM EDT Reads: 2,560
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
Apr. 28, 2017 09:45 PM EDT Reads: 2,226
Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists will look at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deli...
Apr. 28, 2017 09:15 PM EDT Reads: 2,699
The Internet of Things is clearly many things: data collection and analytics, wearables, Smart Grids and Smart Cities, the Industrial Internet, and more. Cool platforms like Arduino, Raspberry Pi, Intel's Galileo and Edison, and a diverse world of sensors are making the IoT a great toy box for developers in all these areas. In this Power Panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists discussed what things are the most important, which will have the most profound e...
Apr. 28, 2017 08:15 PM EDT Reads: 2,449
@ThingsExpo has been named the Most Influential ‘Smart Cities - IIoT' Account and @BigDataExpo has been named fourteenth by Right Relevance (RR), which provides curated information and intelligence on approximately 50,000 topics. In addition, Right Relevance provides an Insights offering that combines the above Topics and Influencers information with real time conversations to provide actionable intelligence with visualizations to enable decision making. The Insights service is applicable to eve...
Apr. 28, 2017 07:45 PM EDT Reads: 2,995
SYS-CON Events announced today that Grape Up will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct. 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company specializing in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the U.S. and Europe, Grape Up works with a variety of customers from emergi...
Apr. 28, 2017 07:15 PM EDT Reads: 2,381