= Dynamic Programming Languages = == Level == Grundläggande nivå - First cycle course == Requirements == 60 hp Computer and Systems Sciences with at least 15 hp programming == Short description == This course examines the philosophy behind dynamic languages. We do so in the context of several different dynamic and scripting languages, e.g Python and Ruby, two proven dynamic languages with different strengths and weaknesses. We use dynamic languages as the full-blown programming languages they are, and we will also examine the use of dynamic languages for integration and as tools for metaprogramming, especially for implementation of domain-specific languages. We will also look at other interesting languages like io and Clojure, for interacting with e.g., Java programs and the Java API. == Aim == Having successfully completed the course with grade E or higher, a student should be able to: * use at least one dynamic language (such as Ruby and Python), or scripting language, in program development, both as application languages, as embedded languages and scripting tools. * quickly pick up other dynamic programming languages with imperative core. * use prototype-based programming languages. * reason about the effects of choosing a dynamic programming language over a systems programming language (or vice versa), for a project with respect to design, programming, testing, static checking, maintenance, memory, speed and safety. * reason about the philosophy of the languages used in the course, how this philosophy is affected by language change and additions, enough to interact with communities around dynamic programming languages. * use metapogramming and reason about the effects of using metaprogramming instead of "traditional programming" in aproject. * analyse her own beliefs and preconceptions about dynamic programming languages, their underlying rationaleand criticise them. * discuss current trends in the programming language developing communities and research community such as gradual typing and relate these to more mature concepts such as duck typing and structural typing. == Syllabus == Dynamic languages, sometimes called ’scripting languages’, are high-level, dynamically typed programming languages, often developed in the open-source community and prone to change more rapidly than proprietary-owned languages such as Java and C#. Dynamic languages are flexible and powerful; recent studies suggest that programs written in dynamic languages are about five times shorter than their static equivalents. This means shorter development time and thus cost, and produces programs that are easier to read, change and maintain. Dynamic languages have been called the ’unsung hero of the world-wide web’. Many well-known systems, like the Amazon shopping-site or Google are built on top of dynamic languages. Dynamic languages have also found widespread use as tools for intergrating different systems and components. Dynamic languages are also used to script larger systems or as a high-level interface to a lower-level language. The nature of dynamic languages also facilitate metaprogramming, where the language is used to manipulate the language itself. This is superb for the implementation of domain-specific languages. Domain-specific languages raise the level of abstraction even further than objects and allows the programmer to express the program in terms of the domain. An excellent example of the use of metaprogramming is in the implementation of Ruby on Rails, an MVC framework for building internet applications. Rails allows automatic generation of interfaces straight from the code and provides high-level variable declarations such as "belongs_to" and "has_many", all coded in Ruby, and accessible from within the programming language itself. The popularity of dynamic languages is increasing. The old maxim that static compile-time checks are necessary to build secure software is questioned time and time again by acknowledged people, programmers and academics alike, and the dynamic philosophy maps very well with the popular agile methods like XP and test-first development. In this course, we will examine the philosophy behind dynamic languages. We do so in the context of of several different dynamic and scripting languages, e.g Python and Ruby, two proven dynamic languages with different strengths and weaknesses. As well as using dynamic languages as the full-blown programming languages they are, we will examine the use of dynamic languages for integration and as tools for metaprogramming, especially for implementation of domain-specific languages. We will also look at prototype-based languages like IO and high-level languages like Groovy, for interacting with e.g., Java programs and the Java API.