[Haskell-beginners] First Project: Imperative Algorithm Visualization tool

Adit Biswas aditbiswas1 at gmail.com
Sun Nov 9 17:49:48 UTC 2014


I'm kindoff a beginner in haskell, I've mostly just been exploring the
language, some of the introductory books on the subject and writing
some small programs.
This is one of my first projects I wanted to try out, but I'm feeling
a bit lost on how to go about doing it. I want to build a tool which
takes in inputs describing algorithms, probably in their imperative
form and generate animations using SVG and HTML5 preferably or OpenGL.
I find that being able to visualize the execution of an algorithm
helped me understand the material a few years ago when i started
college but I mostly had to do these on pen and paper.

So my higher level idea on approaching this problem is:
    1. Create a dsl for describing data structures, e.g Link lists,
trees, graphs
    2. Create a dsl for describing each step of the algorithms
manipulating the data structures
    3. The algorithms would be a monadic composition of the step ADTs
    4. Lift the algorithm to some monad which carries out the side
effects of making changes to a visualization.

I'm sorry if I didn't use all the correct terminology for describing
the problem, I'm not completely sure if it's an appropriate approach.
My logic was that Since each state of the visualization is a
sideeffect of executing an algorithm, it would be a seperate monad
like IO, the entire algorithm can be represented as some form of a
graph, I should have data types representing each component of the
graph.

I have no idea how to go about designing a DSL or for designing a
monad which will handle the animations. Could someone help me approach
the solution and what topics I want to look at to understand how to
build the solution. Feel free to let me know if you'd like to help
work on the tool, or if you think I should simplify my project in some
way. This is mostly just an idea for a project and since I'm feeling
pretty beginnerish with the language, i wouldnt love suggestions on a
simpler project which can sorta lead me in a direction in which i can
make this tool in the future. Thank You!

-- 
Adit Biswas


More information about the Beginners mailing list