1 / 10

The Evolution of Modern Computer Languages

The Evolution of Modern Computer Languages. C#, Java, Ruby and the Rise of DSLs by Daniel Leuck. What are Some of the Trends in Computer Languages?. Many things that used to handled with libraries are now being handled at the language level.

clyde
Download Presentation

The Evolution of Modern Computer Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Evolution of Modern Computer Languages C#, Java, Ruby and the Rise of DSLs by Daniel Leuck

  2. What are Some of the Trends in Computer Languages? • Many things that used to handled with libraries are now being handled at the language level. • The line between statically typed systems languages and scripting languages is getting blurred. • Heavier use of declarative programming, both embedded within and used alongside general purpose imperative/OO, is on the rise. • Complex querying capabilities, once the exclusive domain of SQL, are moving into general purpose languages. • Many languages are becoming more malleable by allowing embedded DSLs or supporting dialects. • Testing capabilities are moving into the languages.

  3. Key C# Language Features Introduced in C# 3.0 • LINQThe ability to write terse, perspicuous and statically typed queries directly within C#int[] nums= { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };varlowNums = from n in nums where n < 5 select n; • Type Inference (see above) • Object InitializersEnable declarative construction of object graphs • Extender Methods“Inject” methods from a static class into other classes. • Lots of other syntactic sugar

  4. Declarative UIs with C# This has long been supported by languages with named parameters such as Python and Ruby. varlightBorderColor = Color.FromArgb(102, 102, 200); vardarkBorderColor = Color.FromArgb(60, 60, 255); button.Painter = new Painter { GradientFill = new GradientFill { ColorA = Color.FromArgb(192, 192, 255), ColorB = Color.Navy }, MultiBorder = new MultiBorder { OuterBorderSize = new Padding(1), TopOuterColor = lightBorderColor, LeftOuterColor = lightBorderColor, BottomOuterColor = darkBorderColor, RightOuterColor = darkBorderColor }, ForeColor = Color.FromArgb(255, 255, 230) };

  5. C# 4 • Recent posts on MSDN indicate that the DLR will become part of the standard library, and the generalized DLR AST will be accessible from within the C# language. • This means C# 4 will likely support some really cool meta programming features. Possibilities include dialects, language specific methods, dynamic code blocks. The imagination runs wild 

  6. Java 5, 6 and 7 • Although Java 5 introduced some nice new language features it lags behind C# in terms of language innovation. It does do some things better such as enums, which are actually special classes versus dressed up scalars • Java 6 didn’t introduce any language improvement.  • The current Java 7 proposal includes many language improvements • Closures • Native XML support similar to ActionScript • Superpackages and modules • Runtime generics • Type annotations (e.g. NotNull) • C# like support for properties and events at the language levelex. name = person->name; • Try / catch enhancements • Many others (applicability of operators to many class types, static method extension, etc.)

  7. Ruby • One of today’s most popular scripting languages, especially for Web Development (Ruby on Rails) • 100% OO – Everything is an object, and everything is highly malleable • Borrows from Python and Perl – Simple examples:puts "Hello World"-199.abs # 199"ruby is cool".length # 12"Dan".index("a") # 1"Nice Day Isn't It?".downcase.split(//).sort.uniq.join # " '?acdeinsty” • Supports some meta-programming capabilities • Features coming in Ruby 1.9 include new variable scopes, more advanced argument pattern matching (multiple splats, mixing mixed optional and mandatory arguments, etc.) and improved exception handling • Matz is very tight lipped about Ruby 2. It may support optional typing. It will likely be a clean up release rather than a radical, backwards capability breaking release like Perl 6.

  8. New Language: Cobra • A modern Python / Ruby like language with contracts, language level support for unit testing and optional typing def act(ctx as Context) require # Requirements can speak to… .isActive # the state of the current object ctx.isActive # the state of the arguments ensure # Can refer to 'old’ values in 'ensure’ .actionCount == old .actionCount + 1 body _actionCount += 1

  9. DSLs • Domain Specific Languages are languages specific to a problem domain, a particular problem representation or a particular solution technique. • They are often embedded in strings, but some languages now support their use in embedded blocks which are verified by the interpreter or compiler. • Some tools such as JetBrains MPS are emerging to assist in the design of DSLs

  10. Summary • General purpose programming languages are getting easier to use as terser, more natural representations of common constructs are added • Most recent enhancements to popular programming languages such as C# and Java are syntactic sugar, but are still very helpful • Languages are getting larger as more functionality that used to be the domain of libraries are getting pulled into the language itself. • More and more programming is becoming declarative. • In many areas unit testing and contracts are in, while static typing is out

More Related