Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Future Programming Language


Published on

Published in: Technology
  • Be the first to comment

Future Programming Language

  1. 1. Future Programming Languages Ben Logsdon, Dustin Beadle, Jaim Ahmed, Nivedita Kaluskar, Hongchao Li CS Department, University of Georgia April. 13 th 2005
  2. 2. Outline <ul><li>Python 3000 </li></ul><ul><li>Ruby 2 </li></ul><ul><li>Groovy </li></ul><ul><li>Scala </li></ul>
  3. 3. Python 3000 Mystery Science meets Windows
  4. 4. From the creator <ul><li>“one day you may find that you are _already_ using Python 3000 -- only it won't be called that, but rather something like Python 2.8.7. “ </li></ul>
  5. 5. About Python Development <ul><li>Open Source </li></ul><ul><li>P ython E nhancement P roposals </li></ul><ul><li> </li></ul><ul><li>BDFL – Guido van Rossum guides development </li></ul><ul><li>PEPs are used in further versions of Python such as multi-line imports (328) and reverse iteration(322) </li></ul>
  6. 6. Sample PEPs <ul><li> </li></ul><ul><li>Fix import statements </li></ul><ul><li>Current: </li></ul><ul><li>from Tkinter import Tk, Frame, Button Entry, Canvas, Text, LEFT, DISABLED NORMAL, RIDGE, END </li></ul><ul><li>To: from Tkinter import (Tk,Frame,Button,Entry, Canvas, Text, LEFT,DISABLED,NORMAL,RIDGE,END) </li></ul><ul><li>Change to absolute imports indicating relative paths through dots </li></ul><ul><li>ex) from foo import bar => from .foo import bar </li></ul>
  7. 7. Python 2.5 <ul><li>Add support for shadow passwords </li></ul><ul><li>Deprecate and/or remove old modules such as gopher and posixfile </li></ul><ul><li>Remove support for old platforms </li></ul><ul><li>AST-based compiler (Abstract Syntax Tree) </li></ul><ul><li>Decimal data type with specified precision (327) </li></ul>
  8. 8. Ruby 2
  9. 9. Intro To Ruby <ul><li>Designed to be a successor to Perl. </li></ul><ul><li>Dynamically Typed, OO, Scripting Language </li></ul><ul><li>Contains a garbage collector, contains threads, fully integrated closures and iterators, plus proper meta-classes. </li></ul><ul><li>Open source, multi-platform can be download at... </li></ul><ul><li> </li></ul>
  10. 10. Ruby vs Python <ul><li>Both are High Level languages </li></ul><ul><li>In Ruby, everything is an Object. Python allows programming with out objects if needed. </li></ul><ul><li>Python has a much larger range of libraries for use. However, Ruby can make use of these through Ruby/Python , although performance can suffer. </li></ul><ul><li>According to The Great Computer Language Shootout Python has better performance time. </li></ul><ul><li>More info at Python Vs Ruby </li></ul>
  11. 11. Ruby on Rails <ul><li>Flagship Ruby Program </li></ul><ul><li>Framework for developing web applications at a quick but sustainable pace </li></ul><ul><li>Automatic Object-Relational-Mapping class </li></ul><ul><li>Templated and non-templated page generation </li></ul><ul><li>Automatic generation of unit tests </li></ul><ul><li>Powerful and intelligent multi-level caching </li></ul><ul><li>Pre-database entry validation </li></ul><ul><li>Go to to check out an example of what Ruby can do. </li></ul>
  12. 12. Future of Ruby.. Ruby 2 <ul><li>Ruby 2, or Ruby Rite, is still aways away from being released. </li></ul><ul><li>It is promised to be a bytecode based, thread-safe virtual machine. </li></ul><ul><li>Changes include, </li></ul><ul><li>variable scopes </li></ul><ul><li>the difference between statement and expressions </li></ul><ul><li>semantics of multiple values </li></ul><ul><li>private method visibility </li></ul><ul><li>range in condition </li></ul><ul><li>keyword arguments </li></ul><ul><li>new hash literals </li></ul>
  13. 13. Future of Ruby.. Ruby 2 <ul><li>Ruby 2 is still quite a ways away, the current version of ruby is still 1.8 </li></ul><ul><li>Most syntax changes will be complete by version 1.9 however. </li></ul><ul><li>More details about Ruby Rite can be found here . </li></ul>
  14. 14. <ul><li>Groovy </li></ul>
  15. 15. Groovy <ul><li>An object oriented programming language designed for the Java platform. </li></ul><ul><li>Makes available the features in Ruby, Smalltalk, Python using a Java-like syntax. </li></ul><ul><li>Can be used as a replacement for Java for small and medium sized applications. </li></ul><ul><li>Makes writing test cases for unit tests very easy. </li></ul>
  16. 16. Features <ul><li>Uses Java syntax, but with far fewer rules. </li></ul><ul><li>Does not require semi colons; access modifiers and variable types are optional. </li></ul><ul><li>Makes use of standard Java libraries including Collection and File I/O. </li></ul><ul><li>Can utilize any Java library from within Groovy, including JUnit. </li></ul><ul><li>Includes support for Closures, SQL, Servlets, Beans, Unit testing etc. </li></ul>
  17. 17. Closures in Groovy <ul><li>A closure is one or more program statements enclosed in curly brackets. </li></ul><ul><li>{ [closureArguments->] statements } </li></ul><ul><li>The main difference between a closure and method is that closures do not require a class or a method name. </li></ul><ul><li>Closures can be assigned to a variable when created which can be passed around the program like any other variable. </li></ul>
  18. 18. Closures (Contd…) <ul><li>Example: Method definition </li></ul><ul><li>package example.math; </li></ul><ul><li>public class MyMath { </li></ul><ul><li>public static long square(int numberToSquare) { </li></ul><ul><li>return numberToSquare * numberToSquare; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul><ul><li>Corresponding Closure definition </li></ul><ul><li>def c = {numberToSquare -> numberToSquare * numberToSquare }; </li></ul>
  19. 19. Closures Vs Code Blocks <ul><li>Code within a code block is executed by the virtual machine as soon as it is encountered. </li></ul><ul><li>Statements within closures are not executed until the call() is made on the closure. </li></ul><ul><li>Eg: y = instead of </li></ul><ul><li>y = example.math.MyMath.square(x) for the method block. </li></ul>
  20. 20. Unit testing with Groovy <ul><li>Groovy's relaxed Java-like syntax, its reuse of standard Java libraries, and its rapid build-and-run cycle make it an ideal candidate for rapidly developing unit tests. </li></ul><ul><li>Groovy extends JUnit and this allows running of tests via the groovy command. </li></ul><ul><li>GroovyTestCase gives some particularly handy assert methods. </li></ul><ul><li>Eg: assertArrayEquals, asserts that two arrays are equal by checking their individual values and respective lengths. </li></ul>
  21. 21. Contd… <ul><li>To write unit tests in groovy, a class extending </li></ul><ul><li>groovy.util.GroovyTestCase has to be created. </li></ul><ul><li>Example: </li></ul><ul><li>import groovy.util.GroovyTestCase </li></ul><ul><li>class MyTest extends GroovyTestCase { </li></ul><ul><li>void testSomething() { </li></ul><ul><li>assert 1 == 1 </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  22. 22. <ul><li>Scala </li></ul>
  23. 23. <ul><li>Scala is object-oriented </li></ul><ul><ul><li>Scala is a pure object-oriented language in the sense that every value is an object. </li></ul></ul><ul><ul><li>Types and behavior of objects are described by classes and traits . </li></ul></ul><ul><ul><li>Class abstractions are extended by subclassing and a flexible mixin-based composition mechanism as a clean replacement for multiple inheritance. </li></ul></ul><ul><ul><li>example </li></ul></ul>
  24. 24. <ul><li>Scala is functional </li></ul><ul><ul><li>Scala is also a functional language in the sense that every function is a value. </li></ul></ul><ul><ul><li>Example </li></ul></ul><ul><ul><li>class MyBool(x: Boolean) { def and(that: MyBool): MyBool = if (x) that else this ; </li></ul></ul><ul><ul><li>def or(that: MyBool): MyBool = if (x) this else that; def negate: MyBool = new MyBool(!x); } </li></ul></ul>
  25. 25. <ul><li>Scala is statically typed </li></ul><ul><ul><li>Scala is equipped with an expressive type system that enforces statically that abstractions are used in a safe and coherent manner. </li></ul></ul><ul><ul><li>In particular, the type system supports: </li></ul></ul><ul><ul><ul><li>generic classes, </li></ul></ul></ul><ul><ul><ul><li>variance annotations, </li></ul></ul></ul><ul><ul><ul><li>upper and lower type bounds, </li></ul></ul></ul><ul><ul><ul><li>classes and abstract types as object members, </li></ul></ul></ul><ul><ul><ul><li>compound types, </li></ul></ul></ul><ul><ul><ul><li>explicitly typed self references, </li></ul></ul></ul><ul><ul><ul><li>views, and </li></ul></ul></ul><ul><ul><ul><li>polymorphic methods. </li></ul></ul></ul>
  26. 26. <ul><li>Polymorphic Method Example </li></ul><ul><li>object PolyTest with Application { </li></ul><ul><li>def dup[T](x: T, n: Int): List[T] = if (n == 0) Nil else x :: dup(x, n - 1); </li></ul><ul><li>Console.println(dup[Int](3, 4)); Console.println(dup(&quot;three&quot;, 3)) } </li></ul>
  27. 27. <ul><li>Scala is extensible </li></ul><ul><ul><li>Scala provides a unique combination of language mechanisms that make it easy to smoothly add new language constructs in form of libraries. </li></ul></ul>
  28. 28. <ul><li>Scala interoperates with Java and .NET </li></ul><ul><ul><li>Scala is designed to interoperate well with popular programming environments like the Java 2 Runtime Environment (JRE) and the .NET CLR. </li></ul></ul><ul><ul><li>In particular, the interaction with mainstream object-oriented languages like Java and C++ is as smooth as possible. </li></ul></ul>
  29. 29. Reference <ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul>