ABSTRACT Combining Static and Dynamic Typing in Ruby Michael

Total Page:16

File Type:pdf, Size:1020Kb

ABSTRACT Combining Static and Dynamic Typing in Ruby Michael ABSTRACT Title of dissertation: Combining Static and Dynamic Typing in Ruby Michael Furr Doctor of Philosophy, 2009 Dissertation directed by: Professor Jeffrey S. Foster Department of Computer Science Many popular scripting languages such as Ruby, Python, and Perl are dynam- ically typed. Dynamic typing provides many advantages such as terse, flexible code and the ability to use highly dynamic language constructs, such as an eval method that evaluates a string as program text. However these dynamic features have tra- ditionally obstructed static analyses leaving the programmer without the benefits of static typing, including early error detection and the documentation provided by type annotations. In this dissertation, we present Diamondback Ruby (DRuby), a tool that blends static and dynamic typing for Ruby. DRuby provides a type language that is rich enough to precisely type Ruby code, without unneeded complexity. DRuby uses static type inference to automatically discover type errors in Ruby programs and provides a type annotation language that serves as verified documentation of a method's behavior. When necessary, these annotations can be checked dynamically using runtime contracts. This allows statically and dynamically checked code to safely coexist, and any runtime errors are properly blamed on dynamic code. To handle dynamic features such as eval, DRuby includes a novel dynamic analysis and transformation that gathers per-application profiles of dynamic feature usage via a program's test suite. Based on these profiles, DRuby transforms the program before applying its type inference algorithm, enforcing type safety for dynamic constructs. By leveraging a program's test suite, our technique gives the programmer an easy to understand trade-off: the more dynamic features covered by their tests, the more static checking is achieved. We evaluated DRuby on a benchmark suite of sample Ruby programs. We found that our profile-guided analysis and type inference algorithms worked well, discovering several previously unknown type errors. Furthermore, our results give us insight into what kind of Ruby code programmers \want" to write but is not easily amenable to traditional static typing. This dissertation shows that it is possible to effectively integrate static typing into Ruby without losing the feel of a dynamic language. Combining Static and Dynamic Typing in Ruby by Michael Furr Dissertation submitted to the Faculty of the Graduate School of the University of Maryland, College Park in partial fulfillment of the requirements for the degree of Doctor of Philosophy 2009 Advisory Committee: Professor Jeffrey S. Foster, Chair/Advisor Professor Michael Hicks Professor Neil Spring Professor Vibha Sazawal Professor Bruce Jacob, Dean's Representative c Copyright by Michael Furr 2009 Dedication To my wife, Laura. ii Table of Contents List of Figures vi 1 Introduction 1 1.1 Thesis . .3 1.2 Contributions . .4 1.2.1 RIL, a Ruby Analysis Framework . .4 1.2.2 Static Types for Ruby . .5 1.2.3 Profiled-Guided Analysis of Dynamic Features . .6 2 A Framework for Ruby Analysis 7 2.1 An Introduction to Ruby . .9 2.2 Parsing Ruby . 12 2.2.1 Language Ambiguities . 13 2.2.2 A GLR Ruby Parser . 15 2.3 The Ruby Intermediate Language . 20 2.3.1 Eliminating Redundant Constructs . 20 2.3.2 Linearization . 22 2.3.3 Materializing Implicit Constructs . 25 2.4 Additional Libraries . 27 2.4.1 Dataflow . 27 2.4.2 Pretty Printer . 28 2.4.3 Scope Resolution . 30 2.4.4 Visitor . 30 2.4.5 File Loading . 31 2.4.6 Runtime Instrumentation . 32 2.5 Using RIL . 33 2.5.1 Eliminating Nil Errors . 33 2.5.2 Dataflow Analysis . 36 2.5.3 Dynamic Analysis . 39 2.6 Related Work . 43 3 A Static Type System for Ruby 46 3.1 Overview . 46 3.2 Static Types for Ruby . 48 3.2.1 Basic Types and Type Annotations . 48 3.2.2 Intersection Types . 50 3.2.3 Optional Arguments and Varargs . 51 3.2.4 Union Types . 52 3.2.5 Object Types . 53 3.2.6 F-Bounded Polymorphism . 54 3.2.7 The self type . 55 3.2.8 Abstract Classes and Mixins . 56 3.2.9 Tuple Types . 57 iii 3.2.10 First Class Methods . 58 3.2.11 Types for Variables and Nil . 60 3.2.12 Unsupported features . 61 3.2.13 Cast Insertion . 62 3.3 MiniRuby ................................ 64 3.3.1 Source Language . 65 3.3.2 Type Checking . 67 3.3.3 Type Inference . 76 3.4 Implementation . 78 3.5 Experimental Evaluation . 79 3.5.1 Experimental Results . 82 3.6 Related Work . 86 4 Analyzing Dynamic Features 90 4.1 Motivation . 91 4.2 Overview . 96 4.3 Dynamic Features in DynRuby ..................... 98 4.3.1 An Instrumented Semantics . 100 4.3.2 Translating Away Dynamic Features . 102 4.3.3 Safe Evaluation . 107 4.3.4 Formal Properties . 109 4.4 Implementation . 111 4.4.1 Additional Dynamic Constructs . 112 4.4.2 Implementing safe eval ...................... 114 4.5 Profiling Effectiveness . 117 4.5.1 Dynamic Feature Usage . 117 4.5.2 Categorizing Dynamic Features . 118 4.6 Type Inference . 122 4.6.1 Performance and Type Errors . 125 4.6.2 Changes for Static Typing . 127 4.7 Threats to Validity . 134 4.8 Related Work . 135 5 Future Work 139 5.1 Type System Improvements . 139 5.2 Profiling Improvements . 143 6 Conclusions 145 A RIL Example Source Code 148 B Proofs for MiniRuby 153 B.1 Static Semantics . 153 B.2 Dynamic Semantics . 154 B.3 Soundness . 158 iv C Proofs for DynRuby 174 C.1 Type Checking Rules . 174 C.2 Complete Formalism and Proofs . 177 C.2.1 Translation Faithfulness . 177 C.2.2 Type Soundness . 190 Bibliography 197 v List of Figures 2.1 Sample Ruby code . 10 2.2 Example GLR Code . 16 2.3 Disambiguation example . 18 2.4 Nested Assignment . 22 2.5 RIL Linearization Example . 24 2.6 Dynamic Instrumentation Architecture . 31 3.1 MiniRuby ................................ 66 3.2 Type Checking Rules for Expressions . 68 3.3 Type Checking Rules for Definitions . 72 3.4 Subtyping Judgments . 75 3.5 Type Inference Rules (Updates Only) . 76 3.6 Type Inference Results . 80 4.1 Using require with dynamically computed strings . 91 4.2 Example of require from Rubygems package manager . 92 4.3 Use of send to initialize fields . 93 4.4 Defining methods with eval ........................ 94 4.5 Intercepting calls with method missing .................. 95 4.6 DynRuby source language . 97 4.7 Instrumented operational semantics (partial) . 100 4.8 Transformation to static constructs (partial) . 103 4.9 Safe evaluation rules (partial) . 107 4.10 Dynamic feature profiling data from benchmarks . 116 vi 4.11 Categorization of profiled dynamic features . 121 4.12 Type inference results . 123 4.13 Changes needed for static typing . 124 B.1 Type Checking Rules for Values . 154 B.2 Big-step Operational Semantics for Expressions (1/2) . 155 B.3 Big-step Operational Semantics for Expressions(2/2) . 156 B.4 Big-step Operational Semantics for Definitions . 158 C.1 Type checking rules for DynRuby (selected rules) . 175 C.2 Instrumented big-step operational semantics for DynRuby (exclud- ing blame and error rules) . 178 C.3 Transformation to static constructs (complete) . 179 C.4 Safe evaluation rules (complete) . 180 C.5 Additional operational semantics rule wrapped expressions (1/2) . 181 C.6 Additional operational semantics rule wrapped expressions (2/2) . 182 C.7 Type checking rules for DynRuby (complete) . 183 C.8 Type checking rules for DynRuby (complete) . 184 vii Chapter 1 Introduction Over the last decade a new wave of programming languages such as Perl [81], Python [79], and Ruby [74] have gained popularity. These languages are distin- guished by their strong support for regular expressions and string manipulation, terse syntax, comprehensive libraries, and expressive language constructs. Com- bined, these features aim to make solving common programming tasks as easy as possible. In particular, these features ease the development of prototypes, where producing a implementation quickly is often more important than producing a pro- gram that is correct for every possible input. These languages are also dynamically typed, meaning that no program is ever prevented from being executed. If a type error occurs at runtime, such as evaluating true + 3, the program will be aborted with an error message. However, if this expression is not evaluated, no error will be emitted. This can.
Recommended publications
  • Developer's Guide Sergey A
    Complex Event Processing with Triceps CEP v1.0 Developer's Guide Sergey A. Babkin Complex Event Processing with Triceps CEP v1.0 : Developer's Guide Sergey A. Babkin Copyright © 2011, 2012 Sergey A. Babkin All rights reserved. This manual is a part of the Triceps project. It is covered by the same Triceps version of the LGPL v3 license as Triceps itself. The author can be contacted by e-mail at <[email protected]> or <[email protected]>. Many of the designations used by the manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this manual, and the author was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this manual, the author assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. Table of Contents 1. The field of CEP .................................................................................................................................. 1 1.1. What is the CEP? ....................................................................................................................... 1 1.2. The uses of CEP ........................................................................................................................ 2 1.3. Surveying the CEP langscape ....................................................................................................... 2 1.4. We're not in 1950s any more,
    [Show full text]
  • An Implementation of Python for Racket
    An Implementation of Python for Racket Pedro Palma Ramos António Menezes Leitão INESC-ID, Instituto Superior Técnico, INESC-ID, Instituto Superior Técnico, Universidade de Lisboa Universidade de Lisboa Rua Alves Redol 9 Rua Alves Redol 9 Lisboa, Portugal Lisboa, Portugal [email protected] [email protected] ABSTRACT Keywords Racket is a descendent of Scheme that is widely used as a Python; Racket; Language implementations; Compilers first language for teaching computer science. To this end, Racket provides DrRacket, a simple but pedagogic IDE. On the other hand, Python is becoming increasingly popular 1. INTRODUCTION in a variety of areas, most notably among novice program- The Racket programming language is a descendent of Scheme, mers. This paper presents an implementation of Python a language that is well-known for its use in introductory for Racket which allows programmers to use DrRacket with programming courses. Racket comes with DrRacket, a ped- Python code, as well as adding Python support for other Dr- agogic IDE [2], used in many schools around the world, as Racket based tools. Our implementation also allows Racket it provides a simple and straightforward interface aimed at programs to take advantage of Python libraries, thus signif- inexperienced programmers. Racket provides different lan- icantly enlarging the number of usable libraries in Racket. guage levels, each one supporting more advanced features, that are used in different phases of the courses, allowing Our proposed solution involves compiling Python code into students to benefit from a smoother learning curve. Fur- semantically equivalent Racket source code. For the run- thermore, Racket and DrRacket support the development of time implementation, we present two different strategies: additional programming languages [13].
    [Show full text]
  • Bringing GNU Emacs to Native Code
    Bringing GNU Emacs to Native Code Andrea Corallo Luca Nassi Nicola Manca [email protected] [email protected] [email protected] CNR-SPIN Genoa, Italy ABSTRACT such a long-standing project. Although this makes it didactic, some Emacs Lisp (Elisp) is the Lisp dialect used by the Emacs text editor limitations prevent the current implementation of Emacs Lisp to family. GNU Emacs can currently execute Elisp code either inter- be appealing for broader use. In this context, performance issues preted or byte-interpreted after it has been compiled to byte-code. represent the main bottleneck, which can be broken down in three In this work we discuss the implementation of an optimizing com- main sub-problems: piler approach for Elisp targeting native code. The native compiler • lack of true multi-threading support, employs the byte-compiler’s internal representation as input and • garbage collection speed, exploits libgccjit to achieve code generation using the GNU Com- • code execution speed. piler Collection (GCC) infrastructure. Generated executables are From now on we will focus on the last of these issues, which con- stored as binary files and can be loaded and unloaded dynamically. stitutes the topic of this work. Most of the functionality of the compiler is written in Elisp itself, The current implementation traditionally approaches the prob- including several optimization passes, paired with a C back-end lem of code execution speed in two ways: to interface with the GNU Emacs core and libgccjit. Though still a work in progress, our implementation is able to bootstrap a func- • Implementing a large number of performance-sensitive prim- tional Emacs and compile all lexically scoped Elisp files, including itive functions (also known as subr) in C.
    [Show full text]
  • Konzeption Und Implementierung Eines Gamification Services Mit Ruby
    Konzeption und Implementierung eines Gamification Services mit Ruby Reinhard Buchinger MASTERARBEIT eingereicht am Fachhochschul-Masterstudiengang Interaktive Medien in Hagenberg im Dezember 2012 © Copyright 2012 Reinhard Buchinger Diese Arbeit wird unter den Bedingungen der Creative Commons Lizenz Namensnennung–NichtKommerziell–KeineBearbeitung Österreich (CC BY- NC-ND) veröffentlicht – siehe http://creativecommons.org/licenses/by-nc-nd/ 3.0/at/. ii Erklärung Ich erkläre eidesstattlich, dass ich die vorliegende Arbeit selbstständig und ohne fremde Hilfe verfasst, andere als die angegebenen Quellen nicht benutzt und die den benutzten Quellen entnommenen Stellen als solche gekennzeich- net habe. Die Arbeit wurde bisher in gleicher oder ähnlicher Form keiner anderen Prüfungsbehörde vorgelegt. Hagenberg, am 3. Dezember 2012 Reinhard Buchinger iii Inhaltsverzeichnis Erklärung iii Kurzfassung vii Abstract viii 1 Einleitung 1 1.1 Motivation und Zielsetzung . .1 1.2 Inhaltlicher Aufbau . .2 2 Grundlagen 3 2.1 Gamification . .3 2.1.1 Verfolgte Ziele . .3 2.1.2 Geläufige Spielemechanismen . .4 2.1.3 Frühere Formen . .4 2.2 Apache Cassandra . .6 2.2.1 Datenmodell im Vergleich zu RDBMS . .6 2.2.2 Vorteile im Clusterbetrieb . .7 2.3 Apache ZooKeeper . .7 2.4 RabbitMQ . .9 2.5 Memcached . 10 2.6 Ruby . 11 2.6.1 JRuby . 11 2.6.2 Gems . 12 2.7 Domänenspezifische Sprachen . 14 2.7.1 Vorteile . 14 2.7.2 Nachteile . 15 2.7.3 DSL in Ruby . 15 2.8 runtastic . 15 2.8.1 Produktpalette . 16 2.8.2 Infrastruktur . 16 3 Verwandte Systeme und Anforderungen 19 3.1 Verwandte Systeme . 19 iv Inhaltsverzeichnis v 3.1.1 Gamification Systeme .
    [Show full text]
  • Safe, Fast and Easy: Towards Scalable Scripting Languages
    Safe, Fast and Easy: Towards Scalable Scripting Languages by Pottayil Harisanker Menon A dissertation submitted to The Johns Hopkins University in conformity with the requirements for the degree of Doctor of Philosophy. Baltimore, Maryland Feb, 2017 ⃝c Pottayil Harisanker Menon 2017 All rights reserved Abstract Scripting languages are immensely popular in many domains. They are char- acterized by a number of features that make it easy to develop small applications quickly - flexible data structures, simple syntax and intuitive semantics. However they are less attractive at scale: scripting languages are harder to debug, difficult to refactor and suffers performance penalties. Many research projects have tackled the issue of safety and performance for existing scripting languages with mixed results: the considerable flexibility offered by their semantics also makes them significantly harder to analyze and optimize. Previous research from our lab has led to the design of a typed scripting language built specifically to be flexible without losing static analyzability. Inthis dissertation, we present a framework to exploit this analyzability, with the aim of producing a more efficient implementation Our approach centers around the concept of adaptive tags: specialized tags attached to values that represent how it is used in the current program. Our frame- work abstractly tracks the flow of deep structural types in the program, and thuscan ii ABSTRACT efficiently tag them at runtime. Adaptive tags allow us to tackle key issuesatthe heart of performance problems of scripting languages: the framework is capable of performing efficient dispatch in the presence of flexible structures. iii Acknowledgments At the very outset, I would like to express my gratitude and appreciation to my advisor Prof.
    [Show full text]
  • Snow Blocks Rescuers in West Coast Flood
    . ^ * A r t n g m Daflj Net PrcM Rim The Weather War tka Week Dniled r o n e u l of U. S. WeMher Were— Deeeilibee U , 1»M ' Fair, cidder tonight, low ih>-SS; 14,151 fair, HMIe temperature ehaiige to­ Memhnr at the Audit morrow, high in Ma. Poi ee u of ClreoUtion Manehe»ter^-^A CUy o f ViUage Charm VOL. LXXXIV, NO. 74 (TWENTY-FOUR PAGES—TWO SECTIONS) MANCHESTER, CONN., MONDAY, DECEMBER 28, 1964 (Claaslfied Advertialng on Page tZ) PRICE SEVEN CENTS Events In State Snow Blocks Rescuers State Denies Bus Request In West Coast Flood For Enfield --------- \ HARTFORD (A P )— The SAN FRANCISCO (AP)-*'n"t take off from Stead Alr^ Oregon reported 18 deaths<^day halted helicopter flights fa Stale has denied a bus Force Base in Nevada because from '1“flood '' action." " " — the area. The prediction was for — A heavy snowfall block of the storm. line’s request to serve En- ed flood relief flights in The Red Cross listed 16.300 contin\ied snow today. The turn to cold dropped the families as suffering major loss­ "W e’ll have to airlift supplies n iield commuters who work Northern California today snow level to 1,000 feet eleva­ es to homes, businesses or or evacuate soon.” Sowle said. in East Hartford but ap­ and prolonged the isolation tion. farms in Oregon, California, He called those isolated In the proved a similar request ordeal of sTOnded refugees The Columbia dropped enough Idaho and Washington, mountainous, heavily wooded from a competitor. into an eighth day.
    [Show full text]
  • Comparative Studies of Programming Languages; Course Lecture Notes
    Comparative Studies of Programming Languages, COMP6411 Lecture Notes, Revision 1.9 Joey Paquet Serguei A. Mokhov (Eds.) August 5, 2010 arXiv:1007.2123v6 [cs.PL] 4 Aug 2010 2 Preface Lecture notes for the Comparative Studies of Programming Languages course, COMP6411, taught at the Department of Computer Science and Software Engineering, Faculty of Engineering and Computer Science, Concordia University, Montreal, QC, Canada. These notes include a compiled book of primarily related articles from the Wikipedia, the Free Encyclopedia [24], as well as Comparative Programming Languages book [7] and other resources, including our own. The original notes were compiled by Dr. Paquet [14] 3 4 Contents 1 Brief History and Genealogy of Programming Languages 7 1.1 Introduction . 7 1.1.1 Subreferences . 7 1.2 History . 7 1.2.1 Pre-computer era . 7 1.2.2 Subreferences . 8 1.2.3 Early computer era . 8 1.2.4 Subreferences . 8 1.2.5 Modern/Structured programming languages . 9 1.3 References . 19 2 Programming Paradigms 21 2.1 Introduction . 21 2.2 History . 21 2.2.1 Low-level: binary, assembly . 21 2.2.2 Procedural programming . 22 2.2.3 Object-oriented programming . 23 2.2.4 Declarative programming . 27 3 Program Evaluation 33 3.1 Program analysis and translation phases . 33 3.1.1 Front end . 33 3.1.2 Back end . 34 3.2 Compilation vs. interpretation . 34 3.2.1 Compilation . 34 3.2.2 Interpretation . 36 3.2.3 Subreferences . 37 3.3 Type System . 38 3.3.1 Type checking . 38 3.4 Memory management .
    [Show full text]
  • (Pdf) of from Push/Enter to Eval/Apply by Program Transformation
    From Push/Enter to Eval/Apply by Program Transformation MaciejPir´og JeremyGibbons Department of Computer Science University of Oxford [email protected] [email protected] Push/enter and eval/apply are two calling conventions used in implementations of functional lan- guages. In this paper, we explore the following observation: when considering functions with mul- tiple arguments, the stack under the push/enter and eval/apply conventions behaves similarly to two particular implementations of the list datatype: the regular cons-list and a form of lists with lazy concatenation respectively. Along the lines of Danvy et al.’s functional correspondence between def- initional interpreters and abstract machines, we use this observation to transform an abstract machine that implements push/enter into an abstract machine that implements eval/apply. We show that our method is flexible enough to transform the push/enter Spineless Tagless G-machine (which is the semantic core of the GHC Haskell compiler) into its eval/apply variant. 1 Introduction There are two standard calling conventions used to efficiently compile curried multi-argument functions in higher-order languages: push/enter (PE) and eval/apply (EA). With the PE convention, the caller pushes the arguments on the stack, and jumps to the function body. It is the responsibility of the function to find its arguments, when they are needed, on the stack. With the EA convention, the caller first evaluates the function to a normal form, from which it can read the number and kinds of arguments the function expects, and then it calls the function body with the right arguments.
    [Show full text]
  • Static Analyses for Stratego Programs
    Static analyses for Stratego programs BSc project report June 30, 2011 Author name Vlad A. Vergu Author student number 1195549 Faculty Technical Informatics - ST track Company Delft Technical University Department Software Engineering Commission Ir. Bernard Sodoyer Dr. Eelco Visser 2 I Preface For the successful completion of their Bachelor of Science, students at the faculty of Computer Science of the Technical University of Delft are required to carry out a software engineering project. The present report is the conclusion of this Bachelor of Science project for the student Vlad A. Vergu. The project has been carried out within the Software Language Design and Engineering Group of the Computer Science faculty, under the direct supervision of Dr. Eelco Visser of the aforementioned department and Ir. Bernard Sodoyer. I would like to thank Dr. Eelco Visser for his past and ongoing involvment and support in my educational process and in particular for the many opportunities for interesting and challenging projects. I further want to thank Ir. Bernard Sodoyer for his support with this project and his patience with my sometimes unconvential way of working. Vlad Vergu Delft; June 30, 2011 II Summary Model driven software development is gaining momentum in the software engi- neering world. One approach to model driven software development is the design and development of domain-specific languages allowing programmers and users to spend more time on their core business and less on addressing non problem- specific issues. Language workbenches and support languages and compilers are necessary for supporting development of these domain-specific languages. One such workbench is the Spoofax Language Workbench.
    [Show full text]
  • Stepping Ocaml
    Stepping OCaml TsukinoFurukawa YouyouCong KenichiAsai Ochanomizu University Tokyo, Japan {furukawa.tsukino, so.yuyu, asai}@is.ocha.ac.jp Steppers, which display all the reduction steps of a given program, are a novice-friendly tool for un- derstanding program behavior. Unfortunately, steppers are not as popular as they ought to be; indeed, the tool is only available in the pedagogical languages of the DrRacket programming environment. We present a stepper for a practical fragment of OCaml. Similarly to the DrRacket stepper, we keep track of evaluation contexts in order to reconstruct the whole program at each reduction step. The difference is that we support effectful constructs, such as exception handling and printing primitives, allowing the stepper to assist a wider range of users. In this paper, we describe the implementationof the stepper, share the feedback from our students, and show an attempt at assessing the educational impact of our stepper. 1 Introduction Programmers spend a considerable amount of time and effort on debugging. In particular, novice pro- grammers may find this process extremely painful, since existing debuggers are usually not friendly enough to beginners. To use a debugger, we have to first learn what kinds of commands are available, and figure out which would be useful for the current purpose. It would be even harder to use the com- mand in a meaningful manner: for instance, to spot the source of an unexpected behavior, we must be able to find the right places to insert breakpoints, which requires some programming experience. Then, is there any debugging tool that is accessible to first-day programmers? In our view, the algebraic stepper [1] of DrRacket, a pedagogical programming environment for the Racket language, serves as such a tool.
    [Show full text]
  • More Efficient Serialization and RMI for Java
    To appear in: Concurrency: Practice & Experience, Vol. 11, 1999. More Ecient Serialization and RMI for Java Michael Philippsen, Bernhard Haumacher, and Christian Nester Computer Science Department, University of Karlsruhe Am Fasanengarten 5, 76128 Karlsruhe, Germany [phlippjhaumajnester]@ira.u ka.de http://wwwipd.ira.uka.de/JavaPa rty/ Abstract. In current Java implementations, Remote Metho d Invo ca- tion RMI is to o slow, esp ecially for high p erformance computing. RMI is designed for wide-area and high-latency networks, it is based on a slow ob ject serialization, and it do es not supp ort high-p erformance commu- nication networks. The pap er demonstrates that a much faster drop-in RMI and an ecient drop-in serialization can b e designed and implemented completely in Java without any native co de. Moreover, the re-designed RMI supp orts non- TCP/IP communication networks, even with heterogeneous transp ort proto cols. We demonstrate that for high p erformance computing some of the ocial serialization's generality can and should b e traded for sp eed. Asaby-pro duct, a b enchmark collection for RMI is presented. On PCs connected through Ethernet, the b etter serialization and the improved RMI save a median of 45 maximum of 71 of the runtime for some set of arguments. On our Myrinet-based ParaStation network a cluster of DEC Alphas wesave a median of 85 maximum of 96, compared to standard RMI, standard serialization, and Fast Ethernet; a remote metho d invo cation runs as fast as 80 s round trip time, compared to ab out 1.5 ms.
    [Show full text]
  • A Practical Introduction to Python Programming
    A Practical Introduction to Python Programming Brian Heinold Department of Mathematics and Computer Science Mount St. Mary’s University ii ©2012 Brian Heinold Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported Li- cense Contents I Basics1 1 Getting Started 3 1.1 Installing Python..............................................3 1.2 IDLE......................................................3 1.3 A first program...............................................4 1.4 Typing things in...............................................5 1.5 Getting input.................................................6 1.6 Printing....................................................6 1.7 Variables...................................................7 1.8 Exercises...................................................9 2 For loops 11 2.1 Examples................................................... 11 2.2 The loop variable.............................................. 13 2.3 The range function............................................ 13 2.4 A Trickier Example............................................. 14 2.5 Exercises................................................... 15 3 Numbers 19 3.1 Integers and Decimal Numbers.................................... 19 3.2 Math Operators............................................... 19 3.3 Order of operations............................................ 21 3.4 Random numbers............................................. 21 3.5 Math functions............................................... 21 3.6 Getting
    [Show full text]