New Multilingual Programming Made Easyrosaec.snu.ac.kr/meet/file/20120726s.pdf · 2018. 4. 12. ·...
Transcript of New Multilingual Programming Made Easyrosaec.snu.ac.kr/meet/file/20120726s.pdf · 2018. 4. 12. ·...
Multilingual Programming Made Easy
이병철
광주과학기술원
1
Evolving machines, programming languages, and systems
Innovative high level programming languages
Faster and smaller machines used widely
Legacy libraries and systems
Apache Tomcat
Evolving machines, programming languages, and systems
Innovative high level programming languages
Faster and smaller machines used widely
Portability
Legacy libraries and systems
Apache Tomcat
Evolving machines, programming languages, and systems
Innovative high level programming languages
Faster and smaller machines used widely
Portability
Complexity
Legacy libraries and systems
Apache Tomcat
Evolving machines, programming languages, and systems
Innovative high level programming languages
Faster and smaller machines used widely
Portability
Complexity
Legacy libraries and systems
Heterogeneity
Heterogeneity
Apache Tomcat
6
Multilingual programs
Standard libraries
Java C/C++
Python
C/C++
Python
7
Multilingual programs
Standard libraries Multilingual bindings
Java
C/C++
Python Ruby Java C/C++
Python
C/C++
Python WebKit
8
Multilingual programs
Multilingual components
Standard libraries Multilingual bindings
Java
C/C++
Python Ruby Java C/C++
Java C/C++
Python
C/C++
Python
SQL
WebKit
Apache Tomcat
Javascript
Active research groups in multilingual programming
9
2005 2006 2007 2008 2009 2010 2011 2012
PLDI ESOP OOPSLA
OOPSLA
CCS CCS OOPSLA
PLDI
OOPSLA
OOPSLA
PLDI ECOOP
Static analysis for Ocaml/C and JNI
Static and dynamic analysis for JNI
Composable analysis for language interfaces
PhD dissertation [Lee 2011]
Collaborators
10
Kathryn S McKinley
Ben Wiedermann Robert Grimm
Martin Hirzel Byeongcheol Lee
Multilingual program
Crossing language boundaries
Mozilla application framework
Eclipse
SQLite
Crossing language boundaries
Mozilla application framework
Eclipse
SQLite
void Java_Eclipse_show(JNIEnv* e, jobject jpage) { char *cpage = Mozilla::show(cpage); } void Mozilla::show(string cpage) { sqlite3_run( ); …}
(*e)->GetStringUTFChars(e, jpage);
class Eclipse { native void show(String page); }
“select title from bookmark” + “where” + predicate(cpage)
Programming pitfalls
• Is it OK to call a JNI function here?
• Does “jpage” point to a Java string?
• Is “cpage” going to be released eventually?
void Java_Eclipse_show(JNIEnv* e, jobject jpage) { char *cpage = Mozilla::show(cpage); }
(*e)->GetStringUTFChars(e, jpage);
class Eclipse { native void show(String page); }
Synthesizing dynamic FFI bug checker [PLDI’10]
Programming pitfalls
Is the SQL command syntactically correct?
void Mozilla::show(string cpage) { sqlite3_run( ); …}
“select title from bookmark” + “where” + predicate(cpage)
Marco: safe, expressive macros for any language [ECOOP’12]
Programming pitfalls
How to debug this program across Java and C/C++?
void Java_Eclipse_show(JNIEnv* e, jobject jpage) { char *cpage = Mozilla::show(cpage); } void Mozilla::show(string cpage) { sqlite3_run( ); …}
(*e)->GetStringUTFChars(e, jpage);
class Eclipse { native void show(String page); }
“select title from bookmark” + “where” + predicate(cpage)
Portable mixed-environment debuggers [PLDI’10]
Classification and composition
Marco [ECOOP’12], Jinn [PLDI’10], and Blink [OOPSLA’09]
PhD Dissertation [Lee 2011]
Improve safety
PhD Dissertation [Lee 2011]
Single-language tools Language interfaces
Multilingual tools Multilingual programs
Improve safety
Classification and composition
Future work
• Correctness Program analysis for resource management
Empirical studies on real-world bugs
Automatically explaining and fixing bugs
• Performance Optimizing away cross-boundary overhead
Cooperative memory management for multiple runtime systems
Mapping multilingual program fragments to heterogeneous multi-core processors
19
Thank you
20