MagicHaskeller on the Web:
Automated Programming as a Service

Susumu Katayama

Sep. 24, 2013

Learning a language --- a labour for the masses!

Tools supplementing knowledge on libraries:

Hoogle, Hayoo:

on-line dictionaries for Haskell libraries

Hoogle

Hoogle

Tools supplementing knowledge on libraries:

Library browsers of IDEs and editors (Leksah)

Leksah

Leksah

Tools supplementing knowledge on libraries:

Library browsers of IDEs and editors (App Inventor)

App Inventor

App Inventor

Tools supplementing knowledge on libraries:

Auto-completion (GHCi)

GHCi

GHCi

Tools supplementing knowledge on libraries:

Automatic programming from examples

(Flash Fill of Excel 2013)

Flash Fill

Tools supplementing knowledge on libraries:

MagicHaskeller on the Web (this presentation)



Supported browsers: Konqueror

Konqueror

Konqueror

Supported browsers: Firefox

Firefox

Firefox

Supported browsers: W3m (terminal-based)

W3m (terminal-based)

W3m (terminal-based)

Supported browsers: Emacs-W3m (Emacs-based)

Emacs-W3m (emacs-based)

Emacs-W3m (emacs-based)

Supported browsers: Chrome

Chrome

Chrome

Supported browsers: Internet Explorer

Internet Explorer

Internet Explorer

Supported browsers: Safari on iOS

Safari on iOS

Safari on iOS

Supported browsers: Android Web Browser

Android Web Browser

Android Web Browser

Feel free to try it from your PC / smart phone!

Introductory Examples

Implementation

Current Limitations

Evaluation

Number of solved instances.
problems MagicHaskeller Flash Fill
99 Haskell Problems 11/20 (55%) 3/20 (15%)
Flash Fill Examples 3/10 (30%) 9/10 (90%)

Discussion

Flash Fill is quite specialized

What we want to solve

Summary

Future work

... and (missed) Past work

Thanks

for not cracking the server so far!

Appendix

Before Pointing the Alternative Server to you

Please wait while I am checking if the usual server is really stopped, using this:

The Alternative Server

If the Server is Actually Running,

please press the Back button of your browser and try a different query.
For further information, check the 5th item of "Limitations, ToDos, and Future Plans" of the homepage of MagicHaskeller

Evaluation: 99 Haskell Problems

Problem 1: Find the last element of a list.
Problem 2: Find the last but one element of a list.
Problem 3: Find the K'th element of a list. The first element in the list is number 1.
Problem 4: Find the number of elements of a list.
Problem 5: Reverse a list.
Problem 6: Find out whether a list is a palindrome.

Problem 7: Flatten a nested list structure. Could not make a query (no support of creating new data types)

Problem 8: Eliminate consecutive duplicates of list elements.
Problem 9: Pack consecutive duplicates of list elements into sublists.
Problem 10: Run-length encoding of a list.

Problem 11 - 13: Could not make a query (no support of creating new data types)

Problem 14: Duplicate the elements of a list.
Problem 15: Replicate the elements of a list a given number of times.
Problem 16: Drop every N'th element from a list.
Problem 17: Split a list into two parts; the length of the first part is given.
Problem 18: Extract a slice from a list.
Problem 19: Rotate a list N places to the left.
Problem 20: Remove the K'th element from a list.

Evaluation: Problems from the Flash Fill paper (Gulwani, PoPL 2011)

Example 1: Extract the telephone number.
Example 2: Extract the quantity.
Example 3: Extract the directory name
Example 4: Generate abbreviation.
Example 5: Split odds.
Example 6: Remove excess spaces.

Results in Full

99 Haskell Problems
problem MagH result Flash Fill result
Problem 1 O O
Problem 2 O O
Problem 3 O X
Problem 4 Otr X
Problem 5 Otr X
Problem 6 O X
Problem 7 Xdata Xdata
Problem 8 O X
Problem 9 Otr X
Problem 10 X X
Problem 11 Xdata Xdata
Problem 12 Xdata Xdata
Problem 13 Xdata Xdata
Problem 14 O O
Problem 15 O X
Problem 16 X X
Problem 17 X X
Problem 18 O X
Problem 19 X X
Problem 20 X X
Flash Fill Examples
problem MagH result Flash Fill result
Example 1 X O
Example 2 O O
Example 3 X O
Example 4 O O
Example 5 X O
Example 6 O O
Example 7 X O
Example 8 X X
Example 9 X O
Example 10 X O