glance/README.md

39 lines
1.8 KiB
Markdown
Raw Normal View History

# Glance
2016-12-10 01:20:49 +03:00
Glance is a visual syntax for the programming language Haskell. The goal of this project is to increase programmer happiness and productivity by allowing programmers to understand programs in new and different ways. Currently, the Glance executable produces a visual representation of your code in the form of an SVG image when given a textual Haskell source file. In the future, I hope to incorporate Glance into Haskell code editors, and to eventually create a visual editor for Haskell.
2016-12-12 09:27:35 +03:00
## Try it
2016-12-10 01:06:56 +03:00
First install Graphviz. For instance, in Ubuntu run:
```sudo apt install graphviz```
Then build and execute glance:
```
stack build
stack exec glance-exe -- examples/fact.hs images/fact.svg 500
2016-12-11 03:23:15 +03:00
```
To see the command line options run
```
stack exec glance-exe -- --help
```
Now display the SVG image
2016-12-11 03:23:15 +03:00
```
2016-12-10 22:20:01 +03:00
firefox --new-window images/fact.svg
```
2016-12-12 09:27:35 +03:00
You should now see in your browser window a visual representation of the factorial function. Next, you will probably want to read the Getting Started guide below to help understand the images Glance generates.
2016-12-11 03:23:15 +03:00
2016-12-10 01:06:56 +03:00
## Issues
Glance is still in development, so for the time being, layout, routing, and icon design all have much room for improvement. Here are some specific issues:
* Text boxes may not display correctly with some SVG viewers.
2016-12-10 04:44:41 +03:00
* Images become very spread out when rendering medium to large functions.
2016-12-10 01:06:56 +03:00
* Only a subset of Haskell is rendered
2016-08-14 02:19:49 +03:00
2016-12-10 01:06:56 +03:00
## Getting started
2016-05-29 08:03:09 +03:00
Below is a getting started guide for Glance rendered by Glance itself ([source here](examples/tutorial.hs)). To generate this image run
2016-05-29 07:45:31 +03:00
`stack exec glance-exe -- examples/tutorial.hs examples/tutorial.svg 873 -c`
2016-05-29 07:45:31 +03:00
2016-12-10 01:06:56 +03:00
Also, the [Glance wiki](../../wiki) has a brief introduction to the code architecture.
2017-01-04 12:50:55 +03:00
<img src="https://cdn.rawgit.com/rgleichman/glance/e8290791da1df12f3d77e45851b7a16b704357db/examples/tutorial.svg" alt="Introduction to Glance" />