Hugs plugin, Haskell Browser
Teachers in Haskell, I often use Haskell demos in teaching algorithms. The problem is that this does not integrate well with the rest of the material, e.g. lecture notes or slides in PDF or HTML. I'd like to integrate explanations and demos and explorative changes to algorithms. This needs better support. Is there something like a Hugs plugin for Netscape? Is there something like a Haskell source browser producing XML or HTML? Thanks for all hints Robert Giegerich
Vim can produce HTML from any source code it has highlighting rules for, which includes Haskell. Dunno about the browser plugin, though. Abe On Wed, 13 Mar 2002, Robert Giegerich wrote:
Teachers in Haskell,
I often use Haskell demos in teaching algorithms. The problem is that this does not integrate well with the rest of the material, e.g. lecture notes or slides in PDF or HTML. I'd like to integrate explanations and demos and explorative changes to algorithms. This needs better support.
Is there something like a Hugs plugin for Netscape?
Is there something like a Haskell source browser producing XML or HTML?
Thanks for all hints
Robert Giegerich
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
"Robert Giegerich" <robert@TechFak.Uni-Bielefeld.DE> wrote,
I often use Haskell demos in teaching algorithms. The problem is that this does not integrate well with the rest of the material, e.g. lecture notes or slides in PDF or HTML. I'd like to integrate explanations and demos and explorative changes to algorithms. This needs better support.
Is there something like a Hugs plugin for Netscape?
What I am doing is to run XEmacs and a PostScript previewer (with the slides) on two different virtual desktops. I can switch between both desktops with a single keystroke. In XEmacs, I am using the Haskell mode from http://haskell.org/haskell-mode/ It does markup Haskell code quite nicely using colour and allows me to run GHCi as a background process - ie, my XEmacs window is split into two halfs with the font-locked source on top and my GHCi session on the bottom. In the first year programming course that I teach, I always develop and debug programs in front of the class (with maybe some definitions pre-defined for larger examples). In fact, I regard it as a big advantage of using Haskell for first-year teaching that this is possible (it's difficult with a more verbose language). I have run student surveys asking students to comment on the lecture and the feedback has been very positive. In fact, the vast majority of students has rated the described approach as by far superior to the traditional chalk&talk approach.
Is there something like a Haskell source browser producing XML or HTML?
Again, XEmacs with the above mentioned Haskell mode can do it. Just execute the function `htmlize-buffer' on a buffer containing the Haskell source. As an example for the generated output, have a look at http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html The detailed choice of colours is, of course, adjustable. At least on a Unix machine, I am quite sure you can use XEmacs also in batch mode to generate the HTML (eg, as part of a Makefile), but I haven't actually used it that way yet. Cheers, Manuel PS: I am doing all this on a laptop running Linux, but I think the virtually same setup should be possible on a Win32 box as XEmacs is available for that platform, too.
"Manuel M. T. Chakravarty" <chak@cse.unsw.edu.au> writes:
The detailed choice of colours is, of course, adjustable. At least on a Unix machine, I am quite sure you can use XEmacs also in batch mode to generate the HTML
Sure. Have a look at -batch, -f and -eval options. Be prepared for a bit of lag at startup though :-) -kzm -- If I haven't seen further, it is by standing in the footprints of giants
tor 2002-03-14 klockan 08.02 skrev Ketil Z. Malde:
"Manuel M. T. Chakravarty" <chak@cse.unsw.edu.au> writes:
The detailed choice of colours is, of course, adjustable. At least on a Unix machine, I am quite sure you can use XEmacs also in batch mode to generate the HTML
Sure. Have a look at -batch, -f and -eval options. Be prepared for a bit of lag at startup though :-)
Enscript has support for coloring Haskell and outputting html: enscript --language=html --pretty-print=haskell --color --output=- --output=- is for stdout You could easily invoke it from a cgi-script. Regards, Martin -- [ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN: 4439498 ] Opinions expressed above are mine, and not those of my future employees. SIGBORE: Signature boring error, core dumped
"Robert Giegerich" <robert@TechFak.Uni-Bielefeld.DE> wrote,
I often use Haskell demos in teaching algorithms. The problem is that this does not integrate well with the rest of the material, e.g. lecture notes or slides in PDF or HTML. I'd like to integrate explanations and demos and explorative changes to algorithms. This needs better support.
Is there something like a Hugs plugin for Netscape?
Is DVI OK? The Active-DVI package http://pauillac.inria.fr/activedvi/ allows embedding programs into DVI files, along with a host of other features for presentations (effects, links, transitions, ...). If you look at the demo included with the distribution you will see a slide with a copy of the Ocaml interpreter running inside a DVI page. Files using ActiveDVI specials are still viewable with, for example, xdvi, but of course most of the features are absent or mangled. -- Frank Atanassow, Information & Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-379
On Thu, Mar 14, 2002 at 03:05:34PM +1100, Manuel M. T. Chakravarty wrote:
Again, XEmacs with the above mentioned Haskell mode can do it. Just execute the function `htmlize-buffer' on a buffer containing the Haskell source. As an example for the generated output, have a look at
http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html
The detailed choice of colours is, of course, adjustable. At least on a Unix machine, I am quite sure you can use XEmacs also in batch mode to generate the HTML (eg, as part of a Makefile), but I haven't actually used it that way yet.
1. Why CSS? Why did I need to enable Java in my Netscape to see the colours? Man, it's just to _indent_ and _paint_! 2. When I hear "translate to HTML" I imagine that underlined words which can be clicked to see, say, definition of function. Sadly, most htmlizers are focused on highlighting rather than navigation. The good news is that could be simply cured with postprocessing of the resulting html file using tags file. There are several tags generators for haskell, both for vim and emacs (ghc distribution contains 2 of them). So the problem can be "reduced to the already seen". Just today I've found the program which does the job for "vim documentation". It uses vim tags file and 2html.vim script which is in vim package. Though the idea is obvious, I've never seen before anybody think of it (maybe I'm the one who need it?). The program is very short perl script. I'll try to adopt it for common files (so, for the haskell too). The address: http://www.erebus.demon.nl/vim/
Cheers, Manuel
Max.
Max Kirillov <max630@mail.ru> wrote,
On Thu, Mar 14, 2002 at 03:05:34PM +1100, Manuel M. T. Chakravarty wrote:
Again, XEmacs with the above mentioned Haskell mode can do it. Just execute the function `htmlize-buffer' on a buffer containing the Haskell source. As an example for the generated output, have a look at
http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html
The detailed choice of colours is, of course, adjustable. At least on a Unix machine, I am quite sure you can use XEmacs also in batch mode to generate the HTML (eg, as part of a Makefile), but I haven't actually used it that way yet.
1. Why CSS?
CSS is fine, ...
Why did I need to enable Java in my Netscape to see the colours? Man, it's just to _indent_ and _paint_!
it is Netscape which is rotten ;-) There is no reason in a Web browser to have to activate extra languages to implement CSS...except bad software design. I'd suggest to get a proper browser like Mozilla http://mozilla.org/ or Galeon http://galeon.sourceforge.net/ (I particularly like the latter.) (Switching on JavaScript is sufficient, btw.)
2. When I hear "translate to HTML" I imagine that underlined words which can be clicked to see, say, definition of function. Sadly, most htmlizers are focused on highlighting rather than navigation. The good news is that could be simply cured with postprocessing of the resulting html file using tags file. There are several tags generators for haskell, both for vim and emacs (ghc distribution contains 2 of them). So the problem can be "reduced to the already seen".
It depends what you want. A tool which cross-references variable occurences, I would call a cross reference tool rather than an HTML pretty-printer. Cheers, Manuel
participants (8)
-
Abraham Egnor -
Alastair David Reid -
Frank Atanassow -
ketil@ii.uib.no -
Manuel M. T. Chakravarty -
Martin Norbäck -
Max Kirillov -
Robert Giegerich