GT.M interface to Ruby

Post on 23-Feb-2016

72 views 0 download

Tags:

description

GT.M interface to Ruby. The Performance of M combined with the Flexibility of Ruby. September 18 2013. Contents. Who did it What is Ruby Why a new Language Teaching the Next Generation GT.M from Ruby Globals from Ruby. Who did it ?. Who did it ?. Rob Tweed. Luis Ibanez. - PowerPoint PPT Presentation

Transcript of GT.M interface to Ruby

GT.M interface to Ruby

September 18 2013

The Performance of M combined with the Flexibility of Ruby

1. Who did it2. What is Ruby3. Why a new Language4. Teaching the Next Generation5. GT.M from Ruby6. Globals from Ruby

Contents

Who did it ?

Luis Ibanez

Who did it ?

Rob Tweed

M Database

What is it ?

M Language

M Database

What is it ?

Ruby

What is Ruby ?

Ruby

Interpreter Compiler

Ruby

Very LargeCommunity

Large Number of Packages

Ruby

Ruby

There is a Ruby Gem for that…

Why a new language ?

What is Spoken ?

http://www.ohloh.net/languages/compare 41,642 Open Source Ruby Projects

Significant Project: Cypress

Teaching theNext Generation

Teaching M Language

http://www.opensourcesoftwarepractice.org/M-Tutorial/https://github.com/OSEHR/M-Tutorial

Teaching M Language

http://opensource.com/health/12/2/join-m-revolution

Teaching M Language

http://rpi.edu/about/index.html

Teaching M Language

http://www.albany.edu/cci

Teaching M Language

MUMPS Exposure Rate

Fall2011

Spring2012

Fall2012

Spring2013

30 28 97 110 81

Fall2013

Teaching M Language

ClassesInternships

Jobs

MUMPS Retention Rate

Plan B

M Database

Ruby 54,922Developers

NoSQLhttps://www.ohloh.net/languages/ruby

Plan B

https://www.ohloh.net/languages/ruby

Plan B

41 ThousandProjects

327 MillionLines of Code

54,922Developers

Traininghttps://www.ohloh.net/languages/ruby

Plan B

Google:

“Ruby Tutorial”

http://www.ohloh.net/languages/ruby

Plan B

GT.M from Ruby

GT.M from Ruby

GT.MC - API

C++ Wrapper

Ruby Binary PackageSWIG Wrapping

GT.M – C API

http://tinco.pair.com/bhaskar/gtm/doc/books/pg/UNIX_manual/ch11s05.html

Code, Code, Code !

Talk is Cheap,Show me the Code !

Linus Torvalds

Technical Journal Article

http://code.osehra.org/journal/browse/publication/28

gtm-bindings

https://github.com/OSEHRA-Sandbox/gtm-bindings

Tests / Examples

https://github.com/OSEHRA-Sandbox/gtm-bindings/tree/master/Testing

Example 01

How to Install

apt-get install gtm

First install GT.M

Coming

soon !

How to Install

sudo gem install gtm

Install gtm ruby package:

gtm: Ruby Gem

Post-Installation

http://www.osehra.org/blog/gtm-binding-ruby

Post-Install

export GTMCI= /home/ibanez/src/m.js/Source/gtm_access.ci

The full path to gtm_access.ci

Post-Install

cp _gtmaccess.m fileto Routines dir

It might be at

/home/ibanez/src/gtm-bindings/Source

Post-Install

Add libgtmshr.so DIRto LD_LIBRARY_PATH

Otherwise it must be installed in

/usr/lib/fis-gtm/V6.0-000/libgt

mshr.so

Example 02 – Set Global

Example 03 – Get Global

Example 04 – Kill global

Example 05 – Order

Example 06 – Query

Example 07 – Execute

Example 08 – Lock

Bug ?

Example 09 – Execute more

Example 10 – Fibonacci

Example 11 – Fibonacci

Example 11 – Fibonacci

Globals from Ruby

The Future:

Catching up with Node.js

Globals Ruby HashDictionary

Language Integration

Blah, blah, blah;Blah;

Blah, blah;Blah, blah;

Blah;Blah, blah…

What we say to Databases…

Read

Write

Read

Read

Language Integration

SET foo1=“value”

SET ^foo2=“value”

foo1=“value”

foo2 = ewd.GlobalNode(…)

Language Integration: Hash

http://www.ruby-doc.org/core-2.0.0/Hash.html

Language Integration

foo = {“asia” => 1,“africa” => 2}foo = {:asia => 1, :africa => 2}

foo = {asia: 1, africa: 2}

foo[:asia] 1

Language Integration

bar.asia.japan = “sushi”

How it could look like…

Language Integration

A Native JSONDatabasein Ruby !

Language Integration

knights = {'gallahad': 'pure', 'robin': 'brave'}

knightsBar.gallahad = ‘pure’

How it could look like…

http://www.ruby-doc.org/core-2.0.0/Hash.html

Language Integration

knightsBar.each do | key, value |puts keyputs value

end

How it could look like…

http://docs.python.org/2/tutorial/datastructures.html

Questions?

Luis Ibanezibanezl@osehra.org