Summary
Small example programs and tech demos that I have written in the Ur/Web programming language.Details
Examples
jsMove/:
A simple interactive tech demo which draws a circle to the screen. It may be moved via keyboard/mouse or touchscreen, depending on the selected URL (main or main_touch). It uses the Ur/Web JavaScript FFI extensively for graphics (Raphaël) and for several additional event handlers.
Note that currently the buttons only work via the keyboard, so modes (click vs drag, etc) typically may not be toggled on the touchscreen version until this issue is fixed.
Other Examples:
To be announced.
Compatibility
Ideally, these demos should…
- Run on all major browsers: Firefox, Opera, Chrome, Safari and Internet Explorer.
- Compile and run on Ur/Web version 20120807, or newer. Old versions of Ur/Web must use older revisions from this repository, where appropriate.
If either of these statements are untrue, then please contact me.
Troubleshooting
Note regarding Javascript paths:
The "script" paths noted in the .urp project files must be visible to your host, or should be adjusted to appropriate paths. Since in many cases I refer to locally hosted Javascript files that only exist on my intranet, these values should be changed to public hosted URLs.
Unable to compile or run examples:
If you are unable to get the examples to work for any reason, please contact me, and I will try my best to help you. (Although if I'm busy, I might not respond for a while).
Disclaimer
Although I have written a lot of code (or at least, am very comfortable) in Scheme, Emacs Lisp, Erlang and Prolog of a strongly functional/declarative flavor, I'm not (yet) on the cutting edge of purely functional statically typed programming.
My examples are intended to show how to do specific non-trivial "practical" tasks in Ur/Web, which I use in my larger Ur/Web applications, rather than serve as an example of how to write good Ur/Web code. Although I'm getting better, I'm sure that this code looks horrible to experienced Ur/Web or Haskell Programmers. Comments/critiques are always welcome, especially from experienced Ur/Web or Haskell programmers!