370 likes | 551 Views
Achieving Language Interoperability with. Gary Kumfert with Bill Bosl, Tammy Dahlgren, Tom Epperly, Scott Kohn, & Steve Smith. Babel’s Scope & CCA. Babel provides language interoperability, not components. We collaborate with CCA to add parallel distributed support
E N D
Achieving Language Interoperability with Gary Kumfert withBill Bosl, Tammy Dahlgren, Tom Epperly, Scott Kohn, & Steve Smith
Babel’s Scope & CCA • Babel provides language interoperability, not components. • We collaborate with CCA to add parallel distributed support • We also provide tools (Quorum & Alexandria) to facilitate component development and deployment CCA Compliant Frameworks Component Semantics Compilers &Linkers Operating System
Release Announcement • C, C++, F77, Python(client) BETA 0.5
babel-0.5.0.tar.gz • Babel code generator • written in Java • Babel runtime library • written in ANSI C • Docs (minimal) • papers, talks, javadoc html • babel101 tutorial
Hand Coded Language Interoperability JNI Native SWIG Platform Dependent f77 f90 C C++ Python Java
Truly Object Oriented Reference Counting Exception Handling RMI (future) Babel Enabled Language Interoperability f77 f90 C C++ Python Java
Soon!!! Babel Enabled Language Interoperability What’s In This Release: f77 f90 C C++ Python Java
Have a code Want to increase their user base Will learn SIDL Want Babel general and powerful Have a problem Want to solve their problem May never see SIDL Want software that’s easy & trustworthy Developers Users Babel Has Two Types of Customers
Babel’s Design Priorities • Performance • Developer/User dichotomy • What’s natural for each language? • Could expose C array structs in C++ • C++ style would be SIDL::array<T> template <> array<item_t> : public array_mixin < array_t, item_t, item_cxx_wrapper_t> { }
Builds on Industry IDL technology CORBA COM Designed for Scientific Apps complex types dynamic multidimensional arrays SIDL (Scientific Interface Definition Language) version Hello 1.0; package Hello { class World { string getMsg(); } }
version MySolverLib 0.1.0; import ESI; package MySolverLib { interface MatrixGenerator { ... } class OptionDatabase { void getOption( in string name, out string val); } class Vector implements-all ESI.Vector { void setOptions( in OptionDatabase db ); } class Bizarre implements MatrixGenerator { ... void setData( in array<dcomplex,2> a ); } }
SIDL IOR Scientific Interface Definition Language Internal Object Representation XML eXtensible Markup Language Many forms of language interoperable interfaces Compiler Compatible Human Compatible Web Compatible
...automated creation via higher-level tools ...Type Descriptions on Shared Repositories CCAScript ...automated search & discovery by advanced builders ...Browsing for Types XML enables...
Stubs If developer used Babel, they also have a SIDL file. IORs SIDL Skels Language Interoperability: How Babel Makes it Work • Application: user’s LOP(Language Of Preference) • Implementation: developers LOP (Can be wrappers to legacy code) Application Impls
Stubs IORs Skels Language Interoperability: How Babel Makes it Work • Application: user’s LOP(Language Of Preference) • Implementation: developers LOP (Can be wrappers to legacy code) Application • Client Side Stubs: user’s LOP to C • Internal Object Representation (IOR): Always in C • Server Side Skeletons: translates IOR (in C) to developer’s LOP Impls
How Much Language Interoperability Have We Achieved? • Modes • in • out • inout • return value • Basic Types • bool • char • int • long • float • double • fcomplex • dcomplex • string • opaque • Extended Types • Objects • enumerations • arrays of basic types • arrays of objects • (arrays are multidimensional, no arrays of arrays) • OO Method Dispatch • regular • final • static • interfaces • classes • Exception Handling • For All Combinations of Languages • C C • C++ C++ • F77 F77 • Python • 1431 test cases (and counting)
Language Interoperability Developer Concerns: Configuration, Packaging, & Deployment User Concerns: Installation Trust What we foresee, based on experience with our tests...
These aren’t new problems...But they are on a larger scale Developer Concerns: Configuration, Packaging, & Deployment User Concerns: Installation Trust
For Example... • To support Python and Java • All libraries must be shared (*.so) not statically linked (*.a) • C++ shared libraries are problematic • Exception support is platform/compiler dependent • Linking issues when interoperating with other languages • Can create valid shared library with uncatchable exceptions
GNU Make Autoconf configuration Automake build Makefiles Libtool shared libraries CUTE custom testing python’s own build system java’s built-in (broken) make helper scripts fixes to autoconf, automake & libtool lots of hacks Babel’s Configuration/Build
Test History sparc-sun-solaris2.7-gcc babel 0.5.x babel 0.4.x Configure/Build/Repository faults, not software failures!!! IOR Rewrite # Test Cases Date
Problems affect the User too... • How does a user get and install “language interoperable” software? • Binary: if supplied by developer • Source: • Assume “configure; make install”? • How to link into application? • If any C++ code, must use C++ linker • Which C++ to use?C++ has no std binary interface
C++ F77 Python Java Crux of the problem • We’re building 21st century technology... • ... using 30 year old tools. C Autoheader libtool (perl/sh) aclocal Automake (perl) Autoconf (M4) Make Bourne shell
Solution • Integrated config, build, package, test and management system. • no make inside! • can have action create many files • understands directories • uses real database • program all aspects in one language • MUST BE OPEN SOURCE
In the mean time... • Babel works on other platforms, just not automated config/testing • Java code generator (precompiled) • ANSI C runtime library (no problem) • Babel’s tests are (necessarily) pathological worst-case examples • We didn’t create these problems, we just exercise them aggressively
Future Babel: Will Provide More Build Help • “babel.make” • currently lists code generated • may add additional flags, macros, etc. • configure • currently used for regression tests • may generate artifacts useful for developers • helper scripts • warnings
Line Protocol Stubs Unmarshaler IORs IORs Marshaler Skels Line Protocol Farther Future Babel:Will Do Distributed Computing Application Internet Impls
Closing Remarks • Babel Beta 0.5 is released • Babel enables language interoperability • connect C, C++, F77, and Python • provide a uniform object-model, even in non-OO languages. • Deploying & Installing Language Interoperable Code in General • is still very hard • has broken every tool we use
TheEnd babel-announce@llnl.gov babel-users@llnl.gov http://www.llnl.gov/CASC/components components@llnl.gov Bill Bosl, Tammy Dahlgren, Tom Epperly, Scott Kohn, Gary Kumfert, & Steve Smith
A.3. Can HPC and Component Technology REALISTICALLY be integrated? • Yes. • But HPC Components have huge (and unique) hurdles: • Diverse Architectures • Diverse OS’s • Integration of SPMD and Dist. Comp. • Archaic Pkg/Devel/Config/Build tools • Non-CS trained (or interested) users
B.3. Can the HPC community really afford yet another compiler such as Babel? • Is language interoperability important? • How important?
B.3. How is the Java subset of C++ inadequate as an HPC IDL? • What is a “Java subset of C++” ? • How does one • use it to bind to other languages? • get a common inheritance model? • get a common exception model?
B.5. What is the role of traditional (parallel) tools in component technology? • Hopefully, they’re replaced by modern parallel tools.
B.9. What will be the configuration issues for components...to be portable and high-performance? • Lots. • Lack of Configuration, Packaging, & Deployment tools • is the #1 Achilles heel for components • is the #1 day-to-day pain in Babel development • #1 cause for failure in regression tests
C.1. Will anyone actually make the effort to componentize their applications software? • Yes. • But it will be messy. • Efforts to Babelize at LLNL: • hypre - want OOP in ANSI C & automatic F77 bindings • ALPS - want scripting interface for laser plasma physics • SAMRAI - framework used in ALPS
D.4. Should components be viewed as mostly a library/runtime developer technology? • No. • I used components in this PowerPoint Presentation • Users can use components without knowing they’re using them. • This is harder to achieve in UNIX than other platforms
23 Jul 2001 UCRL-PRES-144649 Work performed under the auspices of the U. S. Department of Energy by the University of California, Lawrence Livermore National Laboratory under Contract W-7405-Eng-48