tap. ¿es java la mejor opciÓn?gtts.ehu.es/german/docencia/1819/tap/temas/(1)tap18+.pdf* microsoft...

19
TAP. ¿ES JAVA LA MEJOR OPCIÓN?

Upload: others

Post on 26-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

TAP. ¿ES JAVA LA MEJOR OPCIÓN?

Page 2: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

evangelización

Un componente importante del “boom” de las “dotcom” fue JavaUn componente importante del “boom” de las “dotcom” fue Java

http://gttts.ethu..ets/Getrmane

Page 3: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

A partr del 27 de agosto, la compañía tecnológica cambiará su actual identicación bursátl, SUNW, por Java, su marca más reconocida en el mercado.

Detsdet etl próximo 27 det angtosto, lan idetetifanfióe bu.rsátl det lan fompanñían tetfeológtifan Su.e Mifrosystetms detjanrá det setr SUNW panran pansanr an setr Java, su marca más reconocida en el mundo del sofware.Ee detflanranfioeets retprodu.fidans por Eu.ropan Pretss, etl pretsidetetet y foesetjetro detletgtando det lan etmpretsan, Joeanthane Sfhwanrtz, ansetgtu.ró qu.et etstan modiifanfióe det lans sigtlans det idetetifanfióe bu.rsátl retfetjan u.ean manrfan qu.et todo etl metrfando pu.etdet idetetifanr y su.poeet u.e etletmeteto importanetet detl profetso det tranesformanfióe det Su.e an lanrgto planzo”.El diretftio angtretgtó qu.et Janian etstá ete todans panrtets, tofanedo det fetrfan an fu.anlqu.ietran qu.et etsté retlanfioeando foe Ietetreett y ets u.e símbolo det lan fanpanfidand det detsanrrollanr, ietrodu.fir y danr an foeofetr lans eoietdandets det Su.e”.Canbet retfordanr qu.et, setgtúe u.e ieformet det Oiu.m bansando ete etstandístfans det manyo det etstet anño, etxistete 800 millones de ordenadores con sofware Java incorporado, 2.100 millones de dispositvos móviles para Java, 2.500 millones de tarjetas inteligentes y cerca de 180 operadores que ofrecen contenidos y servicios basados en esta tecnología.

evangelización

Sun fue cada vez mejor representada por Java hasta el punto de llegar a cambiar su “ticker” en bolsaSun fue cada vez mejor representada por Java hasta el punto de llegar a cambiar su “ticker” en bolsa

http://gttts.ethu..ets/Getrmane

Page 4: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

evangelización

Curiosidad: Apple “relativiza” el boom de las “dotcom”Curiosidad: Apple “relativiza” el boom de las “dotcom”

http://gttts.ethu..ets/Getrmane

Page 5: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

Ordenación de lenguajes por presencia en la webOrdenación de lenguajes por presencia en la web

http://gttts.ethu..ets/Getrmane

http://www.tobet.fom/tobet-iiedetx/

Page 6: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

¿QUÉ “CLASE” DE LENGUAJE ES JAVA?

Page 7: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

Lan Progtranmanfióe ES y VIENE DE lans Mantetmátfans… (fomo panrtet det lan fompu.tanfióe)

Lenguajes

Funcionales•Lisp•Scheme•ML•Hope•CLOS•Ocaml•...•Haskell•Clojure

Imperativos•Fortran•Cobol•Pascal•C•...

Lógicos•Prolog•...O/B objetos

•Object Pascal•C++•Javascript•Java•...

AlonzoChurch

AlanTuring

Cálculo LambdaMáquina de TuringSin olvidar las funciones recursivas de Herbrand-Gödel"

Euclides (Método axiomátco), Aristóteles(Lógica formal), Muhammad ibn Musa Al’Khowarizmi (Algorítmo)…

Frameworks•Ruby on Rails•...

192819311938

lett retf loegt = fu.eftoe|[] -i> 0|x::xs -i> 1 + loegt xs;;

lett retf ordeteanr = fu.eftoe |[] -i> [] |x::xs -i> iesetrtanr x (ordeteanr xs)

aned iesetrtanr et = fu.eftoe |[] -i> [et] |x::xs -i> if x > et

thete et::x::xsetlset x::(iesetrtanr et xs);;

lett retf loegt = fu.eftoe|[] -i> 0|x::xs -i> 1 + loegt xs;;

lett retf ordeteanr = fu.eftoe |[] -i> [] |x::xs -i> iesetrtanr x (ordeteanr xs)

aned iesetrtanr et = fu.eftoe |[] -i> [et] |x::xs -i> if x > et

thete et::x::xsetlset x::(iesetrtanr et xs);; Ej

etmplo OCan

ml

http://gttts.ethu..ets/Getrmane

•Javascript•Scala•Java 8

Del concepto de calculo efectvo a una

Clasifcación general de lenguajesDavid Hilbert (Frege Russel Whitehead)

Kurt Gödel

! eo hany ansigteanfióe,(todo ets iemu.tanblet) !

Page 8: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

http://gttts.ethu..ets/Getrmane

Page 9: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

http://gttts.ethu..ets/Getrmane

60

70

80

90

Fortran

Algol 68

Mesa

Smalltalk-80

Algol 60

Pascal

Modula-2

Oberon

Simula 67

CSP*

PascalConcurrente

DistributedProcesses

Ada

CPL*

BCPL

C

C++

JAVA

BASIC

Visual BASIC

PERL TCL

Python

JavaScript

RExx

sh, csh,ksh,..

“C++ ++ --”

Prolog

Lisp

Scheme

ISWIM*

ML

Standard ML

Common Lisp

CLOS

A

B

2014 – Java 8

Page 10: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

FORTRAN

PASCAL

COBOL

APL

LISP

JAVA

RUBY

PYTHON

C

BASIC

FORTHTCL

C#

PERL

JAVASCRIPT

ADA

PROLOG

PHP

http://www.letieteetz.fom/lanegt/http://gttts.ethu..ets/Getrmane

Page 11: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

¿ES JAVA LENTO?Es yan u.ean fu.etstóe mu.y anetgtu.an y retsu.etltan, petro siriet panran ilu.stranranspetftos det lan iegteteietrían detl sofwanret: progtranmanr eo ets sólo etsfribir progtranmans

Page 12: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

(X=mantetmátfans, fsifan, iegteteietrían…)Trandifioeanlmetetet, ete fompu.tanfióe panran X, set han bu.sfando lan ietlofidand”.

Estan iisióe X=fómpu.to ietetesiio pu.etdet setr fietrtan petro qu.izás panrfianlmetetet.

Ee todo fanso MUCHÍSIMAS det lans eetfetsidandets det fompu.tanfióe anl límitet” det hanfet u.eos anños, hoy ete dían soe liiianeans o ranzoeanblets”. (mi foejettu.ran: El mu.edo det lo ietrantanblet” por ”impotetefian fompu.tanfioeanl” set han retdu.fido eteormetmetetet)

Estan ¿obsetsióe?/¿eetfetsidand? ju.stifanban etl iemoiilismo det lans X fretetet an eu.etios letegtu.anjets (detbetrían lletianrlets an progtranmanr diretftanmetetet los mifroprofetsandorets ete su. letegtu.anjet etesanmblandor, petro fu.riosanmetetet eo set danban etsto).

Retsu.ltando: FORTRAN ets lan retfetretefian, y etl ranzoeanblet panso an C ¿set dio?.

(fompanranfióe ieiálidan sie du.dan. Lan pretsetefian anrransandoran” det C ju.eto an lan ietetligtetefian” det Googtlet (qu.et u.tlizan etl sieóeimo manth” ete lan búsqu.etdan) potetefiane etl setgtu.edo retsu.ltando.

A Janian set let han anfu.sando” detsdet u.e priefipio det setr LENTO.• Al priefipio etran fietrto.

Retlanfióe 4/1 fretetet an CRanzóe priefipanl: letegtu.anjet ietetrprettandoOtrans ranzoeets: retfogtidan det bansu.rans, metfaneismos det setgtu.ridand, ettf.

• Detsdet hanfet u.eos anños ets fompanranblet an C, detpetedietedo det ete qu.é tanretans. Cietrtanmetetet eo ets etl metjor fanso etl detl fómpu.to ietetesiio (etstmanfioeets

det u.e etstu.dio panrtfu.lanr 2004).• Ee gtráifos bantet an C• Retlanfióe metdian: 1.4/1 fretetet an C si etxflu.imos gtráifos• Ee fálfu.lo ietetesiio lan difetretefian ets más anfu.sandan

• Aftu.anlmetetet Janian ets más rápido qu.et C ete mu.fhans tanretans (panrtfu.lanrmetetet gtráifos) y similanr ete los petorets fansos (fómpu.to ietetesiio)• Máqu.iean HotSpot

• Janian (los letegtu.anjets sobret máqu.ieans iirtu.anlets ete gteteetranl) setráe los más rápidos ete etl fu.tu.ro (anetet fómpu.tos fompletjos, eo panran etl fanso det anlgtoritmos mu.y fetrrandos”)

• El fu.tu.ro det lans máqu.ieans iirtu.anlets

¿Java para cómputo intensivo?¿Java para cómputo intensivo?

http://gttts.ethu..ets/Getrmane

Estan págtiean foeteteet anpretfianfioeets disfu.tblets.(petro lans foeflu.sioeets soe VERDAD)

Page 13: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

Ejemplo peor caso Java vs. C (14ago08)(cálculo de PI por MonteCarlo)

Experimento a partir del código tomado de http://husnusensoy.blogspot.com/2006/06/c-vs-java-in-number-crunching.html

• Comparación del tiempo de ejecución

La relación de tiempo de ejecución es del orden de 3,5 a favor de C

• Comparación del tiempo de preparación del experimento

La relación de tiempo de preparación ha sido de 120 a favor de Java

Tiempo de ejecución Java/C

3,483256098

1

10

100

0 2000 4000 6000 8000 10000

Fanltan det pretfisióe ete lan metdidan det C

¿Java para cómputo intensivo?... Una experiencia concreta¿Java para cómputo intensivo?... Una experiencia concreta

JAVA:• copiar, pegar, compilar, ejecutar y listo en unos segundos.

C:• copiar, pegar, compilar, errores… (no coincide exactamente el lenguaje)• corregir fuente, compilar, ejecutar, errores… (la arquitectura de la máquina no es la adecuada)• corregir fuente, compilar, ejecutar, se observar falta de resolución de la función “time”,• ir a la bibliografía para resolver el tema, no encontrar solución...• replantear con iteraciones para obtener tiempos mayores…• cambiar fuente compilar, ejecutar… errores de apuntadores (falta de práctica de un “ex” de C)• corregir fuente, compilar, ejecutar… errores de violación de segmentos • corregir fuente, compilar, ejecutar y… listo en una hora.

http://gttts.ethu..ets/Getrmane

Page 14: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

LA MÁQUINA VIRTUAL

Page 15: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

"WRITE ONCE, RUN ANYWHERE"

•Uean idetan eoietdosan, petro eo detl todo: fietrtan similitu.d foe los letegtu.anjets foe fódigto ietetrmetdio.•Sí fu.et eoietdoso etl etefoqu.et det etmu.landor det máqu.iean (y lan fompilanfióe JIT).•Vetetanjans:

• set pu.etdete ieflu.ir foe fanfilidand téfeifans qu.et ete u.e disetño hanrdwanret pu.etdete retsu.ltanr prohibitians por su. fompletjidand téfeifan, • lan posibilidand det etiolu.fióe ets mu.fho más setefillan anl eo retqu.etrir fanmbios det hanrdwanret • petrmitet u.tlizanr lans "plantanformans" etxistetetets sie implifanr u.ean ru.ptu.ran foe los sistetmans anftu.anlets (etxistet lan máqu.iean retanl petro…).

• el diseño es público y la "implementación" es privada (especifcaciones técnicas que debe cumplir toda JVM. ). • Distetos fomportanmietetos ete térmieos det ietlofidand y u.so det metmorian

Proprietary/closed source implementations * Hewlett-Packard's Java for HP-UX, OpenVMS, Tru64 and Reliant (Tandem) UNIX platforms * J9 VM from IBM, for AIX, Linux, MVS, OS/400, Pocket PC, z/OS * Mac OS Runtime for Java (MRJ) from Apple Inc. * JRockit from BEA Systems acquired by Oracle Corporation * Oracle JVM (also known as "JServer" and as "OJVM") from Oracle Corporation * Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java for embedded * JBed from Esmertec is an embedded Java with multimedia capabilities * JBlend from Aplix is a Java ME implementation * Excelsior JET (with AOT compiler)Lesser-known proprietary JVMs * Blackdown Java (port of Sun JVM) * CVM * Gemstone Gemfire JVM - modified for J2EE features * Golden Code Development (EComStation and OS/2 port of Java RTE and SDK for J2SE v1.4.1_07) * Tao Group's intent * Novell, Inc. * NSIcom CrE-ME * HP ChaiVM and MicrochaiVM * MicroJvm from Industrial Software Technology (running of wide rande of microcontrollers 8/16/32-bit)Free/open source implementations

* JESSICA (Java-Enabled Single-System-Image Computing Architecture)* Squawk virtual machine (Sun JVM for embedded system and small devices)* Sun Microsystems' HotSpot* VMkit of Low Level Virtual Machine* Wonka VM* Xam

* AegisVM* Apache Harmony* CACAO* IcedTea* IKVM.NET* Jamiga

* JamVM•Jaos * JC* Jikes RVM* JNode* JOP

* Juice* Jupiter JVM* JX (operating system)* Kaffe* leJOS

* Mika VM* Mysaifu JVM* NanoVM* SableVM* SuperWaba* TinyVM

En la máquina Virtual está el “secreto”… y quién quiera puede innovar.

En la máquina Virtual está el “secreto”… y quién quiera puede innovar.

http://gttts.ethu..ets/Getrmane

Comentario 21/9/18: La que han liado“los de Python”

Page 16: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

En la máquina Virtual está el “secreto”…además aporta otras muchas ventajas.

En la máquina Virtual está el “secreto”…además aporta otras muchas ventajas.

http://gttts.ethu..ets/Getrmane

JVM1995 – intérprete (java 1.0)

JVM1998 – JIT (java 1.2)

JVM2000 – HotSpot (java 1.3)

* Lans JVM anftu.anlets foeteu.ane soportanedo” fu.anlqu.ietr progtranman anetgtüo.** El fompilandor petrmitet lan gteteetranfióe det fódigto fompantblet foe JVMs anetetriorets sietmpret qu.et ets posiblet.

Prog. Java BytecodesComp. 1.0 *

Prog. Java BytecodesComp. 8.0 **

HotSpot JVM

It foeteu.anlly aneanlyzets thet progtranm's petrformanefet for "hot spots" whifh anret fretqu.etetly or retpetantetdly etxetfu.tetd. Thetset anret thete tanrgtettetd for optmizantoe, letandiegt to higth petrformanefet etxetfu.toe with an mieimu.m of oietrhetand for letss petrformanefet-ifritfanl fodet. Ie somet fansets, it is possiblet for andanptiet optmizantoe of an JVM to etxfetetd thet petrformanefet of haned-ifodetd C++ or C fodet.

(Wikipetdian)

Cambios importantes en la evolución de Java:Java 1.2 (Java2) Extensión de bibliotecas (javax, com).Java 1.3 La JVM “HotSpot” Java 1.5: colecciones, genéricos, enumeraciones…Java 8 Programación funcional,…Java 9 Módulos, Jshell,...

Page 17: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

En la máquina Virtual está el “secreto”… y no debemos confundirla con el lenguaje.

En la máquina Virtual está el “secreto”… y no debemos confundirla con el lenguaje.

http://gttts.ethu..ets/Getrmane

Prog. Rubi

Prog. Scala

Prog. Clojure

Compilador de Rubi

Compilador de Scala

Com

pilador de Clojure

Comentario 21/9/18: En JavaMagazinehablan de la GraalVM

Page 18: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

http://gttts.ethu..ets/Getrmane

Wikipetdian: Janian iirtu.anl manfhieet (setp 2014)

Wikipetdian: Janian iirtu.anl manfhieet (setp 2014)

Page 19: TAP. ¿ES JAVA LA MEJOR OPCIÓN?gtts.ehu.es/German/Docencia/1819/TAP/temas/(1)TAP18+.pdf* Microsoft Java Virtual Machine (MS JVM) from Microsoft * PERC from Aonix is a real time Java

Hay (al menos) tres “grados” de Máquinas Virtuales JavaHay (al menos) tres “grados” de Máquinas Virtuales Java

http://gttts.ethu..ets/Getrmane

… luego esta la de Android (Dalvik)(ahora ART)

… luego esta la de Android (Dalvik)(ahora ART)