4 ms·
Online SVG figures with Haskell
- xtacy 15y agoPretty! How does it compare with MetaPost's capabilities? http://en.wikipedia.org/wiki/MetaPost http://en.wikipedia.org/wiki/MetaPost. This page lists a ton of examples of things possible with Metapost: http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.html http://tex.loria.fr/prod-graph/zoonekynd/metapost/metapost.h....
- divip 15y agoThe main purpose of MetaPost is creating figures for books, but this is just an educational tool (in this form).
- andrewflnr 15y agoThis reminds me of experiments I did in using Lua to generate SVG. With a little work, I thought it could make a useful replacement format for vector graphics (if anyone would adopt it; not too likely). It was nice to able to use control structures, especially loops and random numbers, to generate images. I definitely think XML is not the best format. Maybe something based on Haskell or some other functional language could work?
- simcop2387 15y agoIf you found that interesting, check out Pov-Ray. It does the same thing with 3D. Doesn't output any kind of vector format (that I know of), but the scenes are all described in a Turing-Complete language like that.
- andrewflnr 15y agoYes, that's very cool. Thanks.
- aristidb 15y agoVery nice! But am I the only person who thinks that the parameter order on (<|>) is the wrong way? :)
- mr23 15y agoI think they did that because it's like a bind, i.e. circle 5 <|> rect 8 8 puts a <circle> out first then a <rect> so it seems kind of like the IO monad in that it's ordered
- daralthus 15y agoThe site has great interactive tutorials (well in hungarian) if you want to learn some haskell. Check them also! [1] I learn by that in school, so good you posted I almost forget my homework :) [1] http://pnyf.inf.elte.hu/fp/Index.xml http://pnyf.inf.elte.hu/fp/Index.xml
- carterschonwald 15y agoNot sure which library they're using, but it could be http://hackage.haskell.org/package/diagrams http://hackage.haskell.org/package/diagrams
- divip 15y agoAlmost; it is http://hackage.haskell.org/package/dia-functions http://hackage.haskell.org/package/dia-functions