F# Compiler tutorial
Embedding F# Compiler and
F# Interactive as services
Don Syme @dsyme
Tomas Petricek @tpetricek
Downloads
http://tinyurl.com/fs-compiler
Why Know The Compiler?
#9 For fun
#8 To help maintain the language on multiple platforms
#7 To implement new F# optimizati...
What is possible
Visual Studio Extensions
F# Depth Colorizer, Fantomas, F# Regions
MonoDevelop & Emacs & vim
Language Serv...
Hands-on overview
Referenced assemblies
FSharp.Compiler.Editor.dll
Modified to expose useful types
Used in F# Refactor & MonoDevelop (soon)
...
TASK #1
Calling the F# tokenizer
TASK #2
Working with Untyped F# AST
TASK #3
Calling F# Editor Services
TASK #4
Embedding F# Interactive
Interesting projects
(aka “where to contribute”)
Where to contribute?
F# Bindings
F# support for MonoDevelop, Emacs, vim, …
F# Refactor & Fantomas
Simple refactorings and ...
Hacking session!
Summary
F# Tooling Extensibility
F# Compiler
Exposes: Tokenizer, untyped AST, editor services
Use for: Editor support, plugins
Wor...
Upcoming SlideShare
Loading in …5
×

Progressive f# tutorials nyc don syme & tomas petricek on calling and extending the f# compiler

1,310 views
1,148 views

Published on

In this tutorial, we’ll look under the cover of the F# compiler. We’ll explore how editors and tools can call the F# compiler API to parse and type check F# code. This might be useful if you want to integrate F# in your favorite editor or if you want to write service F# snippets http://www.fssnip.net/

We’ll also talk about the key components of the F# compiler and how you would go about extending the F# language itself. Don will give you a developer overview of the compiler and Tomas talk about extending the F# computation syntax with experimental extensions like joinads http://http://www.tryjoinads.org/

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,310
On SlideShare
0
From Embeds
0
Number of Embeds
228
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Progressive f# tutorials nyc don syme & tomas petricek on calling and extending the f# compiler

  1. 1. F# Compiler tutorial Embedding F# Compiler and F# Interactive as services Don Syme @dsyme Tomas Petricek @tpetricek
  2. 2. Downloads http://tinyurl.com/fs-compiler
  3. 3. Why Know The Compiler? #9 For fun #8 To help maintain the language on multiple platforms #7 To implement new F# optimizations #6 To bring F# to new target platforms #5 To improve free F# editing tools #4 To write language-aware tools #3 To embed the language in applications #2 To implement new interactive coding experiences #1 To write a compiler API that helps others do the above
  4. 4. What is possible Visual Studio Extensions F# Depth Colorizer, Fantomas, F# Regions MonoDevelop & Emacs & vim Language Service, F# Refactor Documentation Tools FSharp.Formatting & http://fssnip.net And much more at Tsunami.io
  5. 5. Hands-on overview
  6. 6. Referenced assemblies FSharp.Compiler.Editor.dll Modified to expose useful types Used in F# Refactor & MonoDevelop (soon) FSharp.Interactive.Service.dll FSI.exe with EvalExpression : string -> obj More changes in the code. Needs some testing! Get at http://github.com/tpetricek/fsharp/tree/fs-extend and see Dave Thomas’ blog http://7sharpnine.com
  7. 7. TASK #1 Calling the F# tokenizer
  8. 8. TASK #2 Working with Untyped F# AST
  9. 9. TASK #3 Calling F# Editor Services
  10. 10. TASK #4 Embedding F# Interactive
  11. 11. Interesting projects (aka “where to contribute”)
  12. 12. Where to contribute? F# Bindings F# support for MonoDevelop, Emacs, vim, … F# Refactor & Fantomas Simple refactorings and code formatting tools F# on Mono Startup performance, portable libraries, … …another cool project :-)
  13. 13. Hacking session!
  14. 14. Summary
  15. 15. F# Tooling Extensibility F# Compiler Exposes: Tokenizer, untyped AST, editor services Use for: Editor support, plugins Working with typed AST is future work F# Interactive Embed F# in your application! But careful about StackOverflow exceptions…

×