GT.M interface to Ruby
description
Transcript of GT.M interface to Ruby
![Page 1: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/1.jpg)
GT.M interface to Ruby
September 18 2013
The Performance of M combined with the Flexibility of Ruby
![Page 2: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/2.jpg)
1. Who did it2. What is Ruby3. Why a new Language4. Teaching the Next Generation5. GT.M from Ruby6. Globals from Ruby
Contents
![Page 3: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/3.jpg)
Who did it ?
![Page 4: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/4.jpg)
Luis Ibanez
Who did it ?
Rob Tweed
![Page 5: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/5.jpg)
M Database
What is it ?
M Language
![Page 6: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/6.jpg)
M Database
What is it ?
Ruby
![Page 7: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/7.jpg)
What is Ruby ?
![Page 8: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/8.jpg)
Ruby
Interpreter Compiler
![Page 9: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/9.jpg)
Ruby
Very LargeCommunity
Large Number of Packages
![Page 10: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/10.jpg)
Ruby
![Page 11: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/11.jpg)
Ruby
There is a Ruby Gem for that…
![Page 12: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/12.jpg)
Why a new language ?
![Page 13: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/13.jpg)
What is Spoken ?
http://www.ohloh.net/languages/compare 41,642 Open Source Ruby Projects
![Page 14: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/14.jpg)
Significant Project: Cypress
![Page 15: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/15.jpg)
Teaching theNext Generation
![Page 16: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/16.jpg)
Teaching M Language
http://www.opensourcesoftwarepractice.org/M-Tutorial/https://github.com/OSEHR/M-Tutorial
![Page 17: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/17.jpg)
Teaching M Language
http://opensource.com/health/12/2/join-m-revolution
![Page 20: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/20.jpg)
Teaching M Language
http://www.osehra.org/blog/teaching-m-database-and-m-language-suny-albany-spring-2013-part-i
![Page 21: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/21.jpg)
Teaching M Language
MUMPS Exposure Rate
Fall2011
Spring2012
Fall2012
Spring2013
30 28 97 110 81
Fall2013
![Page 22: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/22.jpg)
Teaching M Language
ClassesInternships
Jobs
MUMPS Retention Rate
![Page 23: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/23.jpg)
Plan B
M Database
Ruby 54,922Developers
NoSQLhttps://www.ohloh.net/languages/ruby
![Page 25: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/25.jpg)
Plan B
41 ThousandProjects
327 MillionLines of Code
54,922Developers
Traininghttps://www.ohloh.net/languages/ruby
![Page 26: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/26.jpg)
Plan B
Google:
“Ruby Tutorial”
http://www.ohloh.net/languages/ruby
![Page 27: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/27.jpg)
Plan B
![Page 28: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/28.jpg)
GT.M from Ruby
![Page 29: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/29.jpg)
GT.M from Ruby
GT.MC - API
C++ Wrapper
Ruby Binary PackageSWIG Wrapping
![Page 30: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/30.jpg)
GT.M – C API
http://tinco.pair.com/bhaskar/gtm/doc/books/pg/UNIX_manual/ch11s05.html
![Page 31: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/31.jpg)
Code, Code, Code !
Talk is Cheap,Show me the Code !
Linus Torvalds
![Page 32: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/32.jpg)
Technical Journal Article
http://code.osehra.org/journal/browse/publication/28
![Page 33: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/33.jpg)
gtm-bindings
https://github.com/OSEHRA-Sandbox/gtm-bindings
![Page 34: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/34.jpg)
Tests / Examples
https://github.com/OSEHRA-Sandbox/gtm-bindings/tree/master/Testing
![Page 35: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/35.jpg)
Example 01
![Page 36: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/36.jpg)
How to Install
apt-get install gtm
First install GT.M
Coming
soon !
![Page 37: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/37.jpg)
How to Install
sudo gem install gtm
Install gtm ruby package:
![Page 38: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/38.jpg)
gtm: Ruby Gem
![Page 39: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/39.jpg)
Post-Installation
http://www.osehra.org/blog/gtm-binding-ruby
![Page 40: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/40.jpg)
Post-Install
export GTMCI= /home/ibanez/src/m.js/Source/gtm_access.ci
The full path to gtm_access.ci
![Page 41: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/41.jpg)
Post-Install
cp _gtmaccess.m fileto Routines dir
It might be at
/home/ibanez/src/gtm-bindings/Source
![Page 42: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/42.jpg)
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
![Page 43: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/43.jpg)
Example 02 – Set Global
![Page 44: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/44.jpg)
Example 03 – Get Global
![Page 45: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/45.jpg)
Example 04 – Kill global
![Page 46: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/46.jpg)
Example 05 – Order
![Page 47: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/47.jpg)
Example 06 – Query
![Page 48: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/48.jpg)
Example 07 – Execute
![Page 49: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/49.jpg)
Example 08 – Lock
Bug ?
![Page 50: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/50.jpg)
Example 09 – Execute more
![Page 51: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/51.jpg)
Example 10 – Fibonacci
![Page 52: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/52.jpg)
Example 11 – Fibonacci
![Page 53: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/53.jpg)
Example 11 – Fibonacci
![Page 54: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/54.jpg)
Globals from Ruby
![Page 55: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/55.jpg)
The Future:
Catching up with Node.js
Globals Ruby HashDictionary
![Page 56: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/56.jpg)
Language Integration
Blah, blah, blah;Blah;
Blah, blah;Blah, blah;
Blah;Blah, blah…
What we say to Databases…
Read
Write
Read
Read
![Page 57: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/57.jpg)
Language Integration
SET foo1=“value”
SET ^foo2=“value”
foo1=“value”
foo2 = ewd.GlobalNode(…)
![Page 58: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/58.jpg)
Language Integration: Hash
http://www.ruby-doc.org/core-2.0.0/Hash.html
![Page 59: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/59.jpg)
Language Integration
foo = {“asia” => 1,“africa” => 2}foo = {:asia => 1, :africa => 2}
foo = {asia: 1, africa: 2}
foo[:asia] 1
![Page 60: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/60.jpg)
Language Integration
bar.asia.japan = “sushi”
How it could look like…
![Page 61: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/61.jpg)
Language Integration
A Native JSONDatabasein Ruby !
![Page 62: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/62.jpg)
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
![Page 63: GT.M interface to Ruby](https://reader035.fdocuments.in/reader035/viewer/2022062218/56816353550346895dd3f3da/html5/thumbnails/63.jpg)
Language Integration
knightsBar.each do | key, value |puts keyputs value
end
How it could look like…
http://docs.python.org/2/tutorial/datastructures.html