Dynamische Sprachen { Helden brauchen weniger } Frank Fischer Manager Evangelism and Marketing http://blogs.msdn.com/frankfi Microsoft Deutschland GmbH
Apr 05, 2015
Dynamische Sprachen{ Helden brauchen weniger }Frank Fischer
Manager Evangelism and Marketinghttp://blogs.msdn.com/frankfiMicrosoft Deutschland GmbH
Zu Anfang: Eine Geschichte
Von einem, der auszog dem Bösen das Fürchten zu lehren…
Jim Hugunin
Standard Pystone Benchmark
0K
20K
40K
60K
80K
100K
IronPython
0.1
Python2.3
IronPython
1.0
IronPython
2.0alpha1
Python2.5
Python2.1
46K
101K90K
80K
50K36K
Hoppala…
…stattdessen .net dynamische Sprachen beibrachte…
Jim Hugunin
Principal ArchitectMicrosoft Corp.
AgendaEine Geschichte zum Beginn… (hatten wir gerade)
Was sind „dynamische Sprachen“ ?? Der Versuch einer Definition
Warum dynamische Sprachen ??Wo würde ich persönlich sie verwenden, wo nicht ;-)
Was hat Microsoft damit zu tun??
AgendaEine Geschichte zum Beginn… (hatten wir gerade)
Was sind „dynamische Sprachen“ ??
Der Versuch einer Definition
Warum dynamische Sprachen ??Wo würde ich persönlich sie verwenden, wo nicht ;-)
Was hat Microsoft damit zu tun??
A Definition…Dynamic programming language is a term used broadly in computer science to describe a class of high level programming languages that execute at runtime many common behaviors that other languages might perform during compilation, if at all. These behaviors could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system, all during program execution. These behaviors can be emulated in nearly any language of sufficient complexity, but dynamic languages provide direct tools to make use of them.Dynamic languages and dynamic typing are not identical concepts, and a dynamic language need not be dynamically typed, though many dynamic languages are dynamically typed.
http://en.wikipedia.org/wiki/Dynamic_programming_language
s = „Hello“ + 8
Was sollten wir also mitnehmen??Paradigma 1: Runtime over Compile-
Time!!!Paradigma 2: Entscheidungen verzögern
Entscheidungen schränken die Möglichkeiten einAgilität == MöglichkeitenWelche Entscheidungen kann man hinauszögern?
Paradigma 3: Details der Implementierung verbergen
Paradigma 4: Duck Typing!!
Set dbOpenRecordset = New ADODB.Recordset With dbOpenRecordset
.CursorLocation = CursorLocation
.Open sSQL, oConn, CursorType, LockType End With
Duck Typeing in C#
Void MyFunc(){
var a = „Hello, world!“;}
Brandneues Konzept… not quite!!!
APL Befunge ChucK Curl dBASE (dBL) ECMAScript ActionScript DMDScript E4X Io JavaScript JScript Eiffel
Erlang Forth Groovy HyperTalk Lisp Dylan Logo Scheme Lua Maude system Oberon Objective Modula-2 Objective-C
Perl PHP Pliant POP-11 Poplog Pike Prolog Python REBOL Revolution Ruby Smalltalk Bistro Self
Slate Squeak Snobol SuperCard SuperCollider Tcl XOTcl TeX macro language VBScript Visual Basic 9.0 Visual FoxPro Windows PowerShell xHarbour
Domain Specific Languages…
inline :csharp do |compiler| compiler.reference '..\PresentationFramework.dll' compiler.compile <<-EOF public class DialogHelpers { public static bool ShowDialog(FileDialog d) { bool? result = d.ShowDialog(); return result == null || result == false ? false : true; } } EOFend
Domain Specific Languages…
class PostController < ApplicationControler
def sendHellorender :text => “Hello, World!”
end
end
Domain Specific Languages…
Require ‘erb’
Document = %[<html xmlns=http://www.w3.org/1999/xhtml xml:lang=“en” lang=“en”><head><title><% @titleLine.each do |titles|%> <%= @titles %> </title>…
AgendaEine Geschichte zum Beginn… (hatten wir gerade)
Was sind „dynamische Sprachen“ ?? Der Versuch einer Definition
Warum dynamische Sprachen ??Wo würde ich persönlich sie verwenden, wo nicht ;-)
Was hat Microsoft damit zu tun??
Mal ehrlich:Dem harten C++ Mann tut das weh…
Speicher- und Laufzeitverhalten sind in dynamischen Sprachen eher eine Randbemerkung
Media Credit: Jessica ScottMarshall sophomore Adam Jenks chews down a piece of chocolate pie during the pie eating
Meine persönliche MeinungWo würde ich dynamische Sprachen einsetzen??
Wo man es kann ;-)Schnelle ErgebnisseVorsicht: Wartbarkeit kostet Arbeit (Test getriebene Entwicklung)Mit dynamische Sprachen kann man auch Bibliotheken bauen… wenn man ordentlich programmiert
Wo bieten sich andere Sprachen an??Wo man muss…Bibliotheken
AgendaEine Geschichte zum Beginn… (hatten wir gerade)
Was sind „dynamische Sprachen“ ?? Der Versuch einer Definition
Warum dynamische Sprachen ??Wo würde ich persönlich sie verwenden, wo nicht ;-)
Was hat Microsoft damit zu tun??
{ Silverlight und PHP }
Demo http://www.php-compiler.net/doku.php?id=php-in-silverlight
Nachdem IronPython so erfolgreich war…
…haben wir gefragt, welche weitere Sprache sollen wir unterstützen…Antwort: „select * from ProgrammingLanguages where IsDynamic = true“Daher:
Dynamic Language Runtime als BasisBringt den notwendigen Support für dynamische SprachenEntwicklung soll extrem vereinfacht werden
Lang.Net Symposium
Legend
V2.0
Legend
V1.0
.NET for Silverlight
XAML
Pre
sen
tati
on
C
ore
Networking
JSON
RESTPOX
RSS
Data
LINQ XLINQ
DLR
Ruby Python
WPF
Extensible Controls
BCL
Generics Collections
Inputs
KeyboardMouseInk
Media
VC1 WMA MP3
Browser Host
MS AJAX Library
DOM Integration
UI Core
Images
Vector Text
Animation
DRM
Media
Controls
LayoutEditing
CLR Execution Engine
Deploy
Friction-Free
Installer
Auto-Updater
ApplicationServices
SOAP
bm_loop_times
30_000_000.times { |e| }
~1.8X faster
bm_loop_whileloop
i = 0while i<30_000_000 i+=1end
~3.3X faster
bm_so_concatenate
STUFF = "hello\n"i=0while i<10 i+=1 hello = '' 400_000.times do |e| hello << STUFF endend
~36% slower
bm_app_raise
i=0while i<300_000 i+=1 begin raise rescue endend
~5.6X slower
{ Späßle mit IronRuby }
Demo
Dynamic Language RuntimeSprachen
IronRubyhttp://rubyforge.org/projects/ironrubyhttp://www.iunknown.com/ IronPythonhttp://msdn.microsoft.com/msdnmag/issues/06/10/clrinsideout/default.aspx?loc=de
http://www.codeplex.com/IronPython http://www.iunknown.com/ JavaScriptVBX
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.