1. Trang chủ
  2. » Công Nghệ Thông Tin

moscow ml code generation for microsoft net

17 120 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Moscow ML Code Generation for Microsoft .Net Niels Jørgen Kokholm Copenhagen Programming Language Seminar December 12th 2002 December 12t h 2002 COPLAS p2 Moscow ML • Standard ML batch compiler (mosmlc) • Standard ML Basis Library • Interactive evaluation system (mosml) • … • Runs on CaML light runtime • Written in Standard ML (and C) December 12t h 2002 COPLAS p3 Microsoft .Net • Microsoft .NET Framework/ECMA CLI – Common Language Runtime (CLR) • Virtual “stack” machine specification similar to JVM – .NET Framework class libraries • Implementations: – MS .NET SDK – MS SSCLI (rotor) – Mono – DotGNU Portable.NET December 12t h 2002 COPLAS p4 What • Work in progress • With Peter Sestoft • Long time goal: port Moscow ML to CLR • Started as four week project at ITU – May ’02 Andrzej Wasowski/PS December 12t h 2002 COPLAS p5 Why • Assess usability of CLR as execution platform for functional languages and the portability of Moscow ML • Expand the range of HW/SW platforms on which Moscow ML run (or avoid porting CaML Light) • Leverage the safety and productivity potential of strongly typed languages in high-end, distributed, XML-aware, E-yada yada yada • Learn about code generation in a non-toy setting and about .NET December 12t h 2002 COPLAS p6 Plan • Overall plan – Feasibility study • Can it be done with reasonable performance – CLR code generation • For pure Standard ML programs – Basis Library part 1 • Parts used by compiler – Bootstrap compiler – Interactive system – Basis Library part 2 December 12t h 2002 COPLAS p7 • CLR code generation + library part .3 – May 2002 • Bootstrap compiler – October 2002 – No floating point types, quote/antiquote, … – No complete regression test • Performance compared to current Moscow ML – Small code benchmarks: 1-4 times as slow – Bootstrapped compiler: 5 times as slow  Status December 12t h 2002 COPLAS p8 Related work • Moscow ML on JVM – Peter Berthelsen, master thesis 1998 • SML.NET – Andrew Kennedy, Claudio Russo, Nick Benton (MS Research), released June 2002 – Standard ML compiler on CLR – Bootstrapped from SML/NJ • F# – Don Syme, MS Research – O’CaML on CLR December 12t h 2002 COPLAS p9 CaML light vs. CLR CaML Light CLR JVM Evaluation stack accessible by index Only top of evaluation stack accessible ? - Local variables - Stack must be empty on entry to try block. Tailor made types OO type system ? Tail recursion of method calls - .uo .exe, .dll. and .netmodule files .class Textual assembler and RTCG library Tailor made garbage collection All-purpose Garbage collection No code verifier Verifiable and unverifiable code ! December 12t h 2002 COPLAS p10 Moscow ML Code Generation 1. Parsing, typecheck, translation 2. Compilation: a) Closure splitting b) Expression compilation 3. Byte code emission B y t e c o d e S y m b o l i c ( m a c r o ) b y t e c o d e ( u n t y p e d ) L a m b d a E x p r e s s i o n s S M L P r o g r a m [...]... unverifiable code? • Efficiency December 12t COPLAS p11 Changing the backend 2 • • • • Representation of run time values Correct tail recursion Exception handling Boxing of primitive types December 12t COPLAS p12 Runtime value representation December 12t COPLAS p13 Closures December 12t COPLAS p14 Exception handling December 12t COPLAS p15 Boxing of primitive types December 12t COPLAS p16 Performance comparisons . Moscow ML Code Generation for Microsoft .Net Niels Jørgen Kokholm Copenhagen Programming Language Seminar December 12th 2002 December 12t h 2002 COPLAS p2 Moscow ML • Standard ML batch. (mosmlc) • Standard ML Basis Library • Interactive evaluation system (mosml) • … • Runs on CaML light runtime • Written in Standard ML (and C) December 12t h 2002 COPLAS p3 Microsoft .Net • Microsoft. of CLR as execution platform for functional languages and the portability of Moscow ML • Expand the range of HW/SW platforms on which Moscow ML run (or avoid porting CaML Light) • Leverage the

Ngày đăng: 24/10/2014, 22:27

Xem thêm: moscow ml code generation for microsoft net

TỪ KHÓA LIÊN QUAN

w