views:

421

answers:

2

I'm interested in using Functional MetaPost on Mac OS X:

http://cryp.to/funcmp/

I'm looking for a tutorial like:

http://haskell.org/haskellwiki/Haskell_in_5_steps

but for a trivial FuncMP example, i.e. using GHC, I can compile something simple such as:

import FMP  
myPicture = text "blah"  
main = generate "foo" 1 myPicture

but I can't figure out how to view this foo.1.mp output. (It gives a runtime error about not finding 'virmp'; my MetaPost binary is 'mpost'; I can't figure out how to override this Parameter or what my .FunMP file is or should be doing...) I can run mpost on that but the output (foo.1.1) is what, PostScript? EPS? How do I use this? (I imagine I just need a simple LaTeX file with an EPS figure in it or something...)

Preferably, I'd like to generate output (.ps or .pdf that I can view) so I an actually get somewhere with Functional MetaPost, learning it, playing with it, not banging my head against paths and binaries and shell commands.

+2  A: 

the output of mpost is eps, which you can view in ghostview...

ja
A: 

@ja: This is true (EPS should be mpost's output) but there are a few problems here:

  1. ghostview uses X11 and is ugly (especially on a Mac) to the point of being difficult to use.

  2. I need smooth anti-aliased graphics, specifically PDF so I can import the graphics into Photoshop when I'm done---the on screen results matter!

  3. In the end, I'm not the only one having trouble with Functional Metapost's non-standard Metapost output.

My solution is to try something else:

  • Asymptote ... "a powerful descriptive vector graphics language that provides a mathematical coordinate-based framework for technical drawings. Labels and equations are typeset with LaTeX, for overall document consistency, yielding the same high-quality level of typesetting that LaTeX provides for scientific text. By default it produces PostScript output, but it can also generate any format that the ImageMagick package can produce."
  • It looks really impressive and improves on Metapost in many ways (true floating point, full 3D!) and the programming language looks fairly modern and well thought out (first class functions, Pythonic/Java-ish syntax).

Wow! This is so cool. Asymptote delivers (once you get it installed... the problems are all on the FOSS packages/X11/texlive/macports and especially lazwutil side...)

Jared Updike