560 likes | 739 Views
Integrating Haskell with Visual Studio Assignment Manager. André Santos & VHS/VHS-AM Team alms@cin.ufpe.br. Haskell. Pure functional programming language Strenghts... High level of abstraction Concise code (4x to 10x smaller) Strong Mathematical foundation Modules, Abstract Data Types
E N D
Integrating Haskell with Visual Studio Assignment Manager André Santos & VHS/VHS-AM Team alms@cin.ufpe.br
Haskell • Pure functional programming language • Strenghts... • High level of abstraction • Concise code (4x to 10x smaller) • Strong Mathematical foundation • Modules, Abstract Data Types • Polymorphism, high order functions, Strong typing • higher productivity, easier maintenance, higher code reuse • Lazy Semantics infinite data structures • But weaknesses too... • Limited Integration with other technologies • No powerful IDEs
Project History • Haskell + VS.NET Integration VHS Project • Personal initiative/interest: André and Simon Marlow (MSR) • started by mid-2003 Assignment Manager extensions RFP • RFP for extending Assignment Manager (end of 2003) • MS Shared Source tool for submitting and evaluating student assignments • The VHS-AM Project
VHS-AM Project VHS Project Combined Objectives • Allow the use of Assignment Manager for teaching Haskell by extending Assignment Manager and/or Visual Studio .NET • Have a full IDE for Haskell
This presentation • MS Assignment Manager • VHS (Visual Haskell) and VSIP program • Demo • Conclusions and Future Work
Assignment Manager • Faculty (teaching) Tools • Student Tools • Assignment Manager
Faculty Tools • Set of tools for managing the publishing of courses and course tasks • Two main parts: • Assignment Publishing Tools • Code Extraction
Assignment Publishing Tools • Allows the publishing of courses and tasks • Students access the course site/materials therough: • webserver (http:// ...) • network share (\\Server\folder) • ftp server (ftp:// ...)
Code Extractor • Allows teacher to hide parts of the source code of a project • Tells the students where to write their own code • “Template” projects
Student Tools • Allow the students to see the courses’ sites
After joining a course the student can see what tasks are available...
Assignment Manager • Improved version of the Assignment Publishing Tools • Web application, that requires: • ASP.NET • SQLServer or Microsoft Data Engine • Internet Information Services (IIS) • Microsoft Message Queuing (MSMQ)
Access to available tasks Creation of a course Solution submission Publishes tasks and marks Access to marks Assignment Manager Server Faculty Clients Student Clients A.M. Architecture
A.M. – Communication • Lecturers can contact students through: • E-mail • Internal message system
A.M. – Publishing tasks • Auto-build and auto-check • Extra files (e.g. I/O) • Messages: • Send Reminder, Send Past Due Notice, New Project Notice, Updated Project Notice
A.M. – publishing tasks • After student submissions teacher can assign marks • Marks are available to students
Project History & Objectives • MS Assignment Manager • VHS (Visual Haskell) and VSIP program • Demo • Conclusions and Future Work
Existing Haskell IDEs • Some tools have some Haskell support: • syntax colouring • indentation (hard in Haskell!) • jump to errors • menu of top-level declarations • jump to definition • interactive compilation/evaluation • display type of an identifier • Some tools: emacs, vi(m), WinHugs, Eclipse plugin
Problems • Language support tends to be unreliable, because these environments are not using a real Haskell front-end. eg. Colouring support in Emacs is really bad • Different language flavours: Haskell98+FFI, hierarchical modules, CPP, literate • Jumping to an error often misses (compilers don’t have good source loc info) • No real compilation support • Many, many, many more things an IDE can do…
VHS Project Objectives • Integrate GHC with Visual Studio to make a decent Haskell IDE • Specify a programatic interface to GHC so that it can be re-used in other IDE-like contexts.
Background: Visual Studio • Development shell, with several language plugins: VC++, VC#, VJ#, VB • Very rich feature set • Lots of support for language integration • Projects: multi-file applications/libraries • Solutions: multiple projects • Debugging • Integrated documentation, context-sensitive help etc. • Lots of support for automation/extension/customisation • “free” access to the integration APIs: VSIP • Windows only
VSIP • Visual Studio Industry Partners • set of COM APIs for integrating new functionality into VS: • Language support in the editor • Project • Tools • “freely available” SDK • APIs are highly detailed, flexible & HUGE • Babel (Daan Leijen) provides a simpler abstraction layer for integrating simple language support • http://www.vsipdev.com
Extending VS.NET • VS.NET Extension Mechanisms: • VS.NET IDE Itself • Basic level of automation/extension • customization of the IDE and creation of new components for VS.NET programming. • VS.NET Macros • Widely supported by the IDE: Macros Explorer, VSMacros IDE, supports recording, debugging, etc. • Can’t create GUIs, tool windows, etc. • VS.NET Add-Ins • Higher integration: creation of new applications embeddded in VS.NET, including GUI • Ideal for medium complexity extensions • can’t be used to define new languages • VS.NET Wizards • Takes the programmer step-by-step on the execution of a task • VSIP • More powerful and much more complex • The only way of supporting new programming languages and new project types • Current version supports using managed code • Used to implement most of our use cases
Compiler Using VSIP Lex/Yacc parser or Implementation of Babel Interfaces VSIP COM interfaces Babel COM interfaces Visual Studio Babel Parser, typechecker,etc. Direct to VSIP for project support C/C++
GHC VHS Project VSIP COM interfaces Babel COM interfaces Visual Studio Babel Haskell Service Direct to VSIP for project support C/C++ Haskell
Status of the VHS Project • We have: • Syntax colouring • accurate indication of erroneous subexpressions • Parsing/renaming/type-checking as you type (in a separate thread) • Brace matching • (Partial) Project support including A.M. support • Prototype of quick info support • Prototype of method tips support • Prototype of autocompletion
Demos Method tip Quick info + pop-up list Taskbar errors Brace Matching
Features we want • Extend Brace matching (e.g. let/in) • Drop-down menu of top-level decls • Outlining • Jump to definition (or docs for library fns) • Easy access to documentation • Code model (programatic access to the source code) • Inferred types tooltips • Type of subexpression • Further Project support: • Multi-module support (automatically discover dependencies, etc.) • Library-infrastructure support (import/export library infrastructure metadata gives a nice way to package & ship a project)
More ambitious features • Integrated FFI tools • .NET integration • Debugging • GUI Builder