1 / 15

Introducing HaskellLight

Introducing HaskellLight. Rijk-Jan, Arjan, Daan, Martijn L. Goal. Teaching “Compiler framework”. Haskell. Demo. Language Haskell Error reporting No classes. Compiler Simplicity Error reporting eXtreme testing. Design. Highlights. Precise positions of errors Warnings

dionne
Download Presentation

Introducing HaskellLight

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. Introducing HaskellLight Rijk-Jan, Arjan, Daan, Martijn L.

  2. Goal • Teaching • “Compiler framework” Haskell

  3. Demo

  4. Language Haskell Error reporting No classes Compiler Simplicity Error reporting eXtreme testing Design

  5. Highlights • Precise positions of errors • Warnings • Hints (type errors, undefined var.) • Still fast, small and portable

  6. Position f = 3 x = 3 f = 4 • Hugs: • ERROR Main.hs:1 - "f" multiply defined • Where is the other definition? • Helium: • (1, 1), (3, 1): duplicated function "f"

  7. Warnings f id = id 3 id x = x • Which “id” was meant? • Hugs • Silent • Helium • (1, 3): variable "id" shadows the one at (3, 1)

  8. Warnings • Unused parameters/functions... • No type definition • Unreachable code (in case)

  9. Hints map f xs = case xs of []->[] y:ys->map ys • ERROR Main.hs:1 – Type error in function binding*** Term : map*** Type : c -> [a] -> [b]*** Does not match : [a] -> [b] • (4, 11): type error in rhs of case: map ystype: b -> cprevious rhs’s: [a]Probably too few arguments to 'map' in this right-hand side

  10. Fast, small, portable

  11. Code speed GHC  5 x Helium  60 x Hugs

  12. Implementation Lexer Lazy Virtual Machine (Daan Leijen) Parser ToCore Static Analysis Type Checker

  13. Not yet modules where, lambda Float, tuples pattern-matching nested patterns comprehensions FFI (Java), GUI, IDE, interpreter “Never” classes Double, Integer records Future of Helium

  14. Conclusion • Helium is Haskell-- with nice error messages • Helium will be “textbook Haskell” • Helium will hopefully some day be used in education

More Related