1 / 17

Moscow ML Code Generation for Microsoft .Net

Moscow ML Code Generation for Microsoft .Net. Niels Jørgen Kokholm Copenhagen Programming Language Seminar December 12th 2002. Moscow ML. Standard ML batch compiler (mosmlc) Standard ML Basis Library Interactive evaluation system (mosml) … Runs on CaML light runtime

Download Presentation

Moscow ML Code Generation for Microsoft .Net

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Moscow ML Code Generation for Microsoft .Net Niels Jørgen Kokholm Copenhagen Programming Language Seminar December 12th 2002

  2. 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) COPLAS

  3. 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 COPLAS

  4. 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 COPLAS

  5. 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 COPLAS

  6. 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 COPLAS

  7. Status • 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  COPLAS

  8. 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 COPLAS

  9. CaML light vs. CLR COPLAS

  10. Moscow ML Code Generation • Parsing, typecheck, translation • Compilation: • Closure splitting • Expression compilation • Byte code emission COPLAS

  11. Changing the backend 1 • Textual assembler vs RTCG? • Verifiable or unverifiable code? • Efficiency COPLAS

  12. Changing the backend 2 • Representation of run time values • Correct tail recursion • Exception handling • Boxing of primitive types COPLAS

  13. Runtime value representation COPLAS

  14. Closures COPLAS

  15. Exception handling COPLAS

  16. Boxing of primitive types COPLAS

  17. Performance comparisons COPLAS

More Related