SlideShare une entreprise Scribd logo
1  sur  36
3
Dynamic
Languages

Static
Languages

Simple and succinct

Robust

Implicitly typed

Performant

Meta-programming

Intelligent tools

No compilation

Better scaling

Late bound

Type safety

Loosely type

Compile-time checking

Highly expressive

RunTime Performance

4
Linguagem

Tipagem

Compilação

Objetos

Tipos

C#

Forte

Estática

Estáticos

Estáticos

VB.NET

Forte ou
Fraca

Estática

Estáticos

Dinânicos

Boo

Forte

Dinâmica

Dinâmicos

Dinâmicos

Python

Fraca

Dinâmica

Dinâmicos

Dinâmicos

Ruby

Fraca

Dinâmica

Dinâmicos

Dinâmicos

5
6
7
print “Alo mundo”

8
9
10
11
http://www.codeplex.com/IronPython

12
13
http://blogs.msdn.com/hugunin/

http://blogs.msdn.com/hugunin/archive/2006/09/05/741605.aspx

14
15
− I

R

O

N
16
17
18
Python
Source File
or
Code
Snippet

Python
Scanner

Tokens

Python
Parser

AST

IL
Generator

IL

CLR

refs
IronPython.
Objects

19
def factorial(n):
if n == 1: return 1
return n * factorial(n-1)
0 LOAD_FAST 0 (n)

IL_0000: ldarg.0

3 LOAD_CONST 1 (1)

IL_0001: ldsfld object __main__::c$0$PST04000002

6 COMPARE_OP 2 (==)

IL_0006: call object IronPython…Ops::Equal(object,object)

9 JUMP_IF_FALSE 8 (to 20)

IL_000b: call bool IronPython...Ops::IsTrue(object)
IL_0010: brfalse IL_0020

12 POP_TOP
13 LOAD_CONST 1 (1)

IL_0015: ldsfld object __main__::c$0$PST04000002

16 RETURN_VALUE

IL_001a: ret

20
def factorial(n):
if n == 1: return 1
return n * factorial(n-1)

public static object factorial_f1(object n) {
if (Ops.EqualIsTrue(n, 1)) return Main.c_1;
return Ops.Multiply(n, Ops.Call(Main.factorial,
Ops.Subtract(n, Main.c_1)));
}

21
0 LOAD_FAST 0 (n)
3 LOAD_CONST 1 (1)

0000001b mov
0000001d mov

ecx,esi
edx,1

6 COMPARE_OP 2 (==)

00000023 call

dword ptr ds:[036E3184h]

9 JUMP_IF_FALSE 8 (to 20)

00000028 mov
0000002a test
0000002c je

edi,eax
edi,edi
00000038

12 POP_TOP
13 LOAD_CONST 1 (1)

00000039 mov

eax,dword ptr ds:[01B054E4h]

16 RETURN_VALUE

<pop 4 registers and ret>

22
Milhões de testes por segundo

def t2():
for i in L:
if i == 1000000: break
<snip 18 identical lines>
if i == 1000000: break
80
70
60
50
40
69

30
20
10
7

11

16

Python-2.1

Python-2.3

Python-2.4

15

21

0
IronPython on IronPython on IronPython on
1.1
2.0
2.0 w/opt
23
2
4
26
28
Adding Dynamic to .NET
IronPython

IronRuby

C#

VB.NET

Others…

Dynamic Language Runtime
Expression Trees
Object
Binder

JavaScript
Binder

Dynamic Dispatch
Python
Binder

Call Site Caching
Ruby
Binder

COM
Binder

29
IronPython Consumindo C#
public class Calculator {
…
public int Add(int x, int y) {
return x + y;
}
}

class Calculator:
…
def Add(self, x, y):
return x + y

calc = GetCalculator()
sum = calc.Add(10, 20)

30
C# 3.0 Consumindo IronPython
public class Calculator {
…
public int Add(int x, int y) {
return x + y;
}
}

class Calculator:
…
def Add(self, x, y):
return x + y

PyObject calc = GetCalculator();
Calculator calc = GetCalculator(); object res = calc.Invoke("Add", 10, 20);
int sum = calc.Add(10, 20);
int sum = Convert.ToInt32(res);
object calc = GetCalculator();
Type calcType = calc.GetType();
object res = calcType.InvokeMember("Add",
BindingFlags.InvokeMethod, null,
new object[] { 10, 20 });
int sum = Convert.ToInt32(res);
31
32
33
34
binhara@monobrasil.org

3
5
Semana Interop: Trabalhando com IronPython e com Ironruby

Contenu connexe

Tendances

Can PL/SQL be Clean? (2013)
Can PL/SQL be Clean? (2013)Can PL/SQL be Clean? (2013)
Can PL/SQL be Clean? (2013)
Peter Kofler
 
PHP to Python with No Regrets
PHP to Python with No RegretsPHP to Python with No Regrets
PHP to Python with No Regrets
Alex Ezell
 
Enjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProfEnjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProf
mametter
 

Tendances (20)

Can PL/SQL be Clean? (2013)
Can PL/SQL be Clean? (2013)Can PL/SQL be Clean? (2013)
Can PL/SQL be Clean? (2013)
 
Updates of socket.io@1.0
Updates of socket.io@1.0Updates of socket.io@1.0
Updates of socket.io@1.0
 
What's new In Perl?
What's new In Perl?What's new In Perl?
What's new In Perl?
 
FOSDEM 2020 Presentation : Precise, cross-project code navigation at GitHub s...
FOSDEM 2020 Presentation : Precise, cross-project code navigation at GitHub s...FOSDEM 2020 Presentation : Precise, cross-project code navigation at GitHub s...
FOSDEM 2020 Presentation : Precise, cross-project code navigation at GitHub s...
 
Jaoo irony
Jaoo ironyJaoo irony
Jaoo irony
 
IronRuby for the .NET Developer
IronRuby for the .NET DeveloperIronRuby for the .NET Developer
IronRuby for the .NET Developer
 
Iron* - An Introduction to Getting Dynamic on .NET
Iron* - An Introduction to Getting Dynamic on .NETIron* - An Introduction to Getting Dynamic on .NET
Iron* - An Introduction to Getting Dynamic on .NET
 
IronRuby And The DLR
IronRuby And The DLRIronRuby And The DLR
IronRuby And The DLR
 
Php Vs Phyton
Php Vs PhytonPhp Vs Phyton
Php Vs Phyton
 
Globalization autdi for Fedora Atomic
Globalization autdi for Fedora AtomicGlobalization autdi for Fedora Atomic
Globalization autdi for Fedora Atomic
 
Software architecture...Yes, on tests!
Software architecture...Yes, on tests!Software architecture...Yes, on tests!
Software architecture...Yes, on tests!
 
IronRuby for the Rubyist
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the Rubyist
 
PHP to Python with No Regrets
PHP to Python with No RegretsPHP to Python with No Regrets
PHP to Python with No Regrets
 
Talk
TalkTalk
Talk
 
OOPS Advanced
OOPS AdvancedOOPS Advanced
OOPS Advanced
 
Alternate languages for the CLR
Alternate languages for the CLRAlternate languages for the CLR
Alternate languages for the CLR
 
Kotlin from-scratch
Kotlin from-scratchKotlin from-scratch
Kotlin from-scratch
 
Wojciech Ogrodowczyk | 3Scale | I am a Developer
Wojciech Ogrodowczyk | 3Scale | I am a DeveloperWojciech Ogrodowczyk | 3Scale | I am a Developer
Wojciech Ogrodowczyk | 3Scale | I am a Developer
 
Enjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProfEnjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProf
 
JetBrains MPS
JetBrains MPSJetBrains MPS
JetBrains MPS
 

Similaire à Semana Interop: Trabalhando com IronPython e com Ironruby

Polyglot Architecture: A Rational Approach to Software Design
Polyglot Architecture: A Rational Approach to Software DesignPolyglot Architecture: A Rational Approach to Software Design
Polyglot Architecture: A Rational Approach to Software Design
kompalg
 
Dynamic languages for .NET CLR
Dynamic languages for .NET CLRDynamic languages for .NET CLR
Dynamic languages for .NET CLR
py_sunil
 
Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...
Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...
Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...
ScyllaDB
 

Similaire à Semana Interop: Trabalhando com IronPython e com Ironruby (20)

Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
 
Languages formanandmachine
Languages formanandmachineLanguages formanandmachine
Languages formanandmachine
 
Turbo charging v8 engine
Turbo charging v8 engineTurbo charging v8 engine
Turbo charging v8 engine
 
Polyglot Architecture: A Rational Approach to Software Design
Polyglot Architecture: A Rational Approach to Software DesignPolyglot Architecture: A Rational Approach to Software Design
Polyglot Architecture: A Rational Approach to Software Design
 
Plone - A History of Python Web
Plone - A History of Python WebPlone - A History of Python Web
Plone - A History of Python Web
 
Dynamic languages for .NET CLR
Dynamic languages for .NET CLRDynamic languages for .NET CLR
Dynamic languages for .NET CLR
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
Python for Science and Engineering: a presentation to A*STAR and the Singapor...
Python for Science and Engineering: a presentation to A*STAR and the Singapor...Python for Science and Engineering: a presentation to A*STAR and the Singapor...
Python for Science and Engineering: a presentation to A*STAR and the Singapor...
 
Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...
Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...
Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...
 
Pyconke2018
Pyconke2018Pyconke2018
Pyconke2018
 
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...
Cfgmgmtcamp 2024 — eBPF-based Security Observability & Runtime Enforcement wi...
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech Pune
 
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the future
 
E sampark with c#.net
E sampark with c#.netE sampark with c#.net
E sampark with c#.net
 
What is Python?
What is Python?What is Python?
What is Python?
 
Continuous SQL with Apache Streaming (FLaNK and FLiP)
Continuous SQL with Apache Streaming (FLaNK and FLiP)Continuous SQL with Apache Streaming (FLaNK and FLiP)
Continuous SQL with Apache Streaming (FLaNK and FLiP)
 
Py Con 2009 Pumping Iron Into Python
Py Con 2009   Pumping Iron Into PythonPy Con 2009   Pumping Iron Into Python
Py Con 2009 Pumping Iron Into Python
 

Plus de Alessandro Binhara

Uma breve introdução ao Big Data e Inteligência Artificial.pptx
Uma breve introdução ao Big Data e Inteligência Artificial.pptxUma breve introdução ao Big Data e Inteligência Artificial.pptx
Uma breve introdução ao Big Data e Inteligência Artificial.pptx
Alessandro Binhara
 
BigData e internte das coisas aplicada a engenharia
BigData e internte das coisas aplicada a engenhariaBigData e internte das coisas aplicada a engenharia
BigData e internte das coisas aplicada a engenharia
Alessandro Binhara
 
A IMPORTÂNCIA DA PARTICIPAÇÃO NA GESTÃO DE PROJETOS TECNOLÓGICOS INOVADORES:...
A IMPORTÂNCIA DA PARTICIPAÇÃO NA  GESTÃO DE PROJETOS TECNOLÓGICOS INOVADORES:...A IMPORTÂNCIA DA PARTICIPAÇÃO NA  GESTÃO DE PROJETOS TECNOLÓGICOS INOVADORES:...
A IMPORTÂNCIA DA PARTICIPAÇÃO NA GESTÃO DE PROJETOS TECNOLÓGICOS INOVADORES:...
Alessandro Binhara
 

Plus de Alessandro Binhara (20)

Uma breve introdução ao Big Data e Inteligência Artificial.pptx
Uma breve introdução ao Big Data e Inteligência Artificial.pptxUma breve introdução ao Big Data e Inteligência Artificial.pptx
Uma breve introdução ao Big Data e Inteligência Artificial.pptx
 
BigData e internte das coisas aplicada a engenharia
BigData e internte das coisas aplicada a engenhariaBigData e internte das coisas aplicada a engenharia
BigData e internte das coisas aplicada a engenharia
 
Case RDStation: Construindo DataLakes com Apache Hadoop em cloud agnóstica
Case RDStation: Construindo DataLakes com Apache Hadoop em cloud agnósticaCase RDStation: Construindo DataLakes com Apache Hadoop em cloud agnóstica
Case RDStation: Construindo DataLakes com Apache Hadoop em cloud agnóstica
 
Latinoware 2019 - DEsenvolvimento mobile em Nivel jedi
Latinoware 2019 - DEsenvolvimento mobile em Nivel jediLatinoware 2019 - DEsenvolvimento mobile em Nivel jedi
Latinoware 2019 - DEsenvolvimento mobile em Nivel jedi
 
2019 latinoware - O mundo novo da realidade virtual
2019 latinoware - O mundo novo da realidade virtual2019 latinoware - O mundo novo da realidade virtual
2019 latinoware - O mundo novo da realidade virtual
 
Realidade Virtual e a Ciência de Dados -latinoware
Realidade Virtual e a Ciência de Dados -latinowareRealidade Virtual e a Ciência de Dados -latinoware
Realidade Virtual e a Ciência de Dados -latinoware
 
Realidade Virtual e a Ciência de Dados
Realidade Virtual e a Ciência de DadosRealidade Virtual e a Ciência de Dados
Realidade Virtual e a Ciência de Dados
 
A IMPORTÂNCIA DA PARTICIPAÇÃO NA GESTÃO DE PROJETOS TECNOLÓGICOS INOVADORES:...
A IMPORTÂNCIA DA PARTICIPAÇÃO NA  GESTÃO DE PROJETOS TECNOLÓGICOS INOVADORES:...A IMPORTÂNCIA DA PARTICIPAÇÃO NA  GESTÃO DE PROJETOS TECNOLÓGICOS INOVADORES:...
A IMPORTÂNCIA DA PARTICIPAÇÃO NA GESTÃO DE PROJETOS TECNOLÓGICOS INOVADORES:...
 
Curso de Férias - Robótica
Curso de Férias -  Robótica Curso de Férias -  Robótica
Curso de Férias - Robótica
 
BIG DATA & IoT: Tecnologias e  Aplicações
BIG DATA & IoT: Tecnologias e  AplicaçõesBIG DATA & IoT: Tecnologias e  Aplicações
BIG DATA & IoT: Tecnologias e  Aplicações
 
Introduçãoo aws, escalando uma aplicação Web
Introduçãoo aws, escalando uma aplicação WebIntroduçãoo aws, escalando uma aplicação Web
Introduçãoo aws, escalando uma aplicação Web
 
Bigadata casese opotunidades
Bigadata casese opotunidadesBigadata casese opotunidades
Bigadata casese opotunidades
 
Xamarin plataform
Xamarin plataformXamarin plataform
Xamarin plataform
 
Desenvolvimento de Games para Mobile.
Desenvolvimento de Games para Mobile.Desenvolvimento de Games para Mobile.
Desenvolvimento de Games para Mobile.
 
Games imersivos
Games imersivosGames imersivos
Games imersivos
 
Abertura - interopmix2014
Abertura - interopmix2014Abertura - interopmix2014
Abertura - interopmix2014
 
Curso C# em Mono - Orientação a Objeto Basico
Curso C# em Mono - Orientação a Objeto BasicoCurso C# em Mono - Orientação a Objeto Basico
Curso C# em Mono - Orientação a Objeto Basico
 
Treinamento csharp mono
Treinamento csharp monoTreinamento csharp mono
Treinamento csharp mono
 
Int305 projeto mono-final
Int305 projeto mono-finalInt305 projeto mono-final
Int305 projeto mono-final
 
Apresentação Final a FINEP Projeto MonoBasic
Apresentação Final a FINEP Projeto MonoBasicApresentação Final a FINEP Projeto MonoBasic
Apresentação Final a FINEP Projeto MonoBasic
 

Dernier

Dernier (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Semana Interop: Trabalhando com IronPython e com Ironruby