Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.
-
Upload
bethany-underwood -
Category
Documents
-
view
216 -
download
2
Transcript of Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.
![Page 1: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/1.jpg)
Java, .NET, Ruby and PHP integration
Matthias Hryniszak
33rd Degree ConferenceKraków, 7 April, 2011
![Page 2: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/2.jpg)
![Page 3: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/3.jpg)
The following presentation is intended for informational purposes only.
There’s no part of it that you should consider either a guideline, viable option or production-ready set of
instructions that could solve your problem
If you use any concepts of what you see here it is entirely up to you to make sure it works for you.
![Page 4: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/4.jpg)
![Page 5: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/5.jpg)
The storyso far…
![Page 6: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/6.jpg)
X86 asm
![Page 7: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/7.jpg)
section .text global _start ;must be declared for linker (ld)_start: ;tell linker entry point
mov edx,len ;message lengthmov ecx,msg ;message to writemov ebx,1 ;file descriptor (stdout)mov eax,4 ;system call number (sys_write)int 0x80 ;call kernelmov eax,1 ;system call number (sys_exit)int 0x80 ;call kernel
section .datamsg db 'Hello, world!',0xa ;our dear stringlen equ $ - msg ;length of our dear string
![Page 8: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/8.jpg)
C/C++
![Page 9: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/9.jpg)
#include <stdio.h>#include <stdlib.h>
int main() {println("Hello, world!");
}
#include <iostream>
int main() { std::cout << "Hello World!" << std::endl;}
![Page 10: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/10.jpg)
JEE
![Page 11: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/11.jpg)
│ pom.xml│└───src ├───main │ ├───java │ │ └───com │ │ └───aplaline │ │ └───example │ │ │ MyApplicationModule.java │ │ │ ServletConfig.java │ │ │ │ │ ├───components │ │ │ TextLabel.java │ │ │ │ │ └───views │ │ FrontView.java │ │ RootView.java │ │ │ ├───resources │ │ └───com │ │ └───aplaline │ │ └───example │ │ ├───components │ │ │ TextLabel.xsl │ │ │ │ │ └───views │ │ FrontView.xsl │ │ RootView.xsl │ │ │ └───webapp │ │ main.css │ │ │ ├───gfx │ │ pageheader.png │ │ │ ├───scripts │ │ contextfw.js │ │ jquery.js │ │ json.js │ │ │ └───WEB-INF │ web.xml │ └───test └───java └───com └───aplaline └───example WebStart.java
![Page 12: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/12.jpg)
![Page 13: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/13.jpg)
Ruby
![Page 14: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/14.jpg)
puts 'Hello world'
![Page 15: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/15.jpg)
PHP
![Page 16: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/16.jpg)
<?php echo "Hello, World!"; ?>
![Page 17: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/17.jpg)
C#.NET
![Page 18: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/18.jpg)
using System;
class Pogram { public static void Main() { Console.WriteLine("Hello, world!"); }}
![Page 19: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/19.jpg)
![Page 20: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/20.jpg)
AgendaThe no-brainers
PHP – the dynamic language for massesWhy would you even care?How to integrate with PHP code
Ruby – the new waveWhat’s Ruby really good at?How to integrate with Ruby code
整合
![Page 21: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/21.jpg)
AgendaThe evil, but cool side of life
.NET– the evil twin from MicrosoftWhy would you even care?The lame side of integration…How cool kids do it?
整合
![Page 22: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/22.jpg)
![Page 23: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/23.jpg)
TRY THIS BEFORE YOU USE
IT!
![Page 24: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/24.jpg)
How about…
Java integration
整合
![Page 25: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/25.jpg)
Wiki in 2 minutes?
整合
![Page 26: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/26.jpg)
Wiki in 2 minutes!
MediaWiki
整合
![Page 27: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/27.jpg)
Blog in 2 minutes?
整合
![Page 28: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/28.jpg)
Blog in 2 minutes!
Wordpress
整合
![Page 29: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/29.jpg)
Forum in 2 minutes?
整合
![Page 30: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/30.jpg)
Forum in 2 minutes!
PhpBB
整合
![Page 31: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/31.jpg)
![Page 32: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/32.jpg)
![Page 33: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/33.jpg)
TRY THIS BEFORE YOU USE
IT!
![Page 34: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/34.jpg)
ScriptEngineManager sem = new ScriptEngineManager();ScriptEngine se = sem.getEngineByExtension("rb");InputStream is = ClassLoader.getSystemResourceAsStream("hello.rb");InputStreamReader script = new InputStreamReader(is);
try { Object result = se.eval(script); System.out.println("Result: " + result);} catch (Exception e) { System.out.println( "Error while executing script\n" + e.getMessage() );}
Ruby as a scripting languageJSR 223
整合
![Page 35: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/35.jpg)
require 'java'
Calculator = com.aplaline.example.Calculatorcalc = Calculator.newcalc.add(2.0,3.0)
Ruby as a scripting languageJSR 223
整合
![Page 36: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/36.jpg)
require 'java'
Calculator = com.aplaline.example.Calculatorcalc = Calculator.newcalc.add(2.0,3.0)
Ruby as a scripting languageJSR 223
整合
![Page 37: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/37.jpg)
Ruby as a language for testsJtestR - regular
整合
class HashMapTests < Test::Unit::TestCase def setup @map = java.util.HashMap.new end
def test_that_map_is_empty assert @map.isEmpty endend
![Page 38: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/38.jpg)
Ruby as a language for testsJtestR - RSpec
整合
import java.util.HashMap
describe "An empty", HashMap do before :each do @hash_map = HashMap.new end
it "should be able to add an entry to it" do @hash_map.put "foo", "bar" @hash_map.get("foo").should == "bar" endend
![Page 39: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/39.jpg)
![Page 40: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/40.jpg)
![Page 41: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/41.jpg)
Don’t shoot the
messenger
![Page 42: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/42.jpg)
Why even bother?
整合
Learn from other’s mistakesBecome aware that Java is not the only choiceMake sure you understand the risks involvedTo have plenty of fun!
![Page 43: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/43.jpg)
整合
How would you integrate with it?The old-fasion way…
![Page 44: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/44.jpg)
整合
How would you integrate with it?The old-fasion way…
![Page 45: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/45.jpg)
整合
How would you integrate with it?The IKVM-way
IKVM.NET
![Page 46: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/46.jpg)
What’s in the box?
整合
ikvmc.exethe binary compilerjar-to-dll/exe converter
ikvm.exethe JVM implementation on .NET
ikvmstub.exedll-to-jar converter
OpenJDK in assembly form
![Page 47: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/47.jpg)
Java on .NET ???
DemoGroovy + OSGi
整合
![Page 48: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/48.jpg)
What runs on IKVM?
Eclipse
整合
![Page 49: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/49.jpg)
What runs on IKVM?
Apache Tomcat
整合
![Page 50: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/50.jpg)
![Page 51: Matthias Hryniszak 33rd Degree Conference Kraków, 7 April, 2011.](https://reader030.fdocuments.in/reader030/viewer/2022032709/56649ec55503460f94bcf528/html5/thumbnails/51.jpg)
Thanks for watching!
整合
http://padcom13.blogspot.com
http://ikvm.nethttp://resin.orghttp://jruby.org