Not So Foreign Functions

33
Not-So-Foreign Functions Calling Ruby from Smalltalk Martin McClure 2011 ESUG

description

ESUG 2011, Edinburgh

Transcript of Not So Foreign Functions

Page 1: Not So Foreign Functions

Not-So-Foreign Functions

Calling Ruby from Smalltalk

Martin McClure2011 ESUG

Page 2: Not So Foreign Functions

Why Foreign Functions?

Page 3: Not So Foreign Functions

Shared library call

Page 4: Not So Foreign Functions

Shared library call

Distributed object system

Page 5: Not So Foreign Functions

Shared library call

Distributed object system

Is there anin-between way?

Page 6: Not So Foreign Functions

Shared library call

Distributed object system

Multi-language VM

Page 7: Not So Foreign Functions

MagLev: Ruby and Smalltalk in the same VM

Multi-language VM

Page 8: Not So Foreign Functions

How does that work?

Page 9: Not So Foreign Functions

An object...

How does that work?

Page 10: Not So Foreign Functions

An object...

How does that work?

...is an object...

Page 11: Not So Foreign Functions

An object...

How does that work?

...is an object...

...is an object...

Page 12: Not So Foreign Functions

A class...

How does that work?

Page 13: Not So Foreign Functions

A class...

How does that work?

...is a class...

Page 14: Not So Foreign Functions

A class...

How does that work?

...is a class...

...is a class...

Page 15: Not So Foreign Functions

How does that work?

BUT...

Page 16: Not So Foreign Functions

A message...

How does that work?

Page 17: Not So Foreign Functions

A message...

How does that work?

...is Smalltalk...

Page 18: Not So Foreign Functions

A message...

How does that work?

...is Smalltalk...

...or is Ruby.

Page 19: Not So Foreign Functions

A class...

How does that work?

Page 20: Not So Foreign Functions

A class...

How does that work?

...may define different Ruby and Smalltalk

methods...

Page 21: Not So Foreign Functions

A class...

How does that work?

Page 22: Not So Foreign Functions

A class...

How does that work?

...may have different Ruby and Smalltalk

names...

Page 23: Not So Foreign Functions

A class...

How does that work?

Page 24: Not So Foreign Functions

A class...

How does that work?

...may have different Ruby and Smalltalk

superclasses.

Page 25: Not So Foreign Functions

Selector Supplements● Environment ID● Number/type of sent arguments

Page 26: Not So Foreign Functions

Selector Supplements● Default send environment = compile environment

● Must override this default

Page 27: Not So Foreign Functions

Onwardto theDemo

Page 28: Not So Foreign Functions

Thanks to:

Peter McLainTim Felgentreff

Page 29: Not So Foreign Functions

rubygems.org>25000 gems

Page 30: Not So Foreign Functions

maglev-gem install mailfactory

Page 31: Not So Foreign Functions
Page 32: Not So Foreign Functions

What's Next?

● Name “RubyService”?● You tell us...

Page 33: Not So Foreign Functions

?Martin McClure2011 ESUG