Various Things in MetaPost (2019)

(habr.com)

40 points | by Tomte 1 day ago

3 comments

  • Gualdrapo 20 hours ago
    Had to dive into MetaPost (and MetaFun) because of ConTeXt, and turns out it's the most closest thing to programming with prose language that I know. You can do pretty cool stuff without needing to dive in into complicated syntax - and do some pretty complicated stuff that at least would require a lot of mouse action with a graphics/vector editor.
  • Nzen 23 hours ago
    [flagged]
    • taeric 22 hours ago
      Strictly, MetaPost is not Knuth's. It is a derivative of Metafont, but is different. I keep meaning to learn to use it, and keep failing. So huge shout out for getting this posted!

      That it is a language somewhat designed to solve linear equations is something I have yet to really wrap my head around. I want to say it is far far more descriptive of what you are drawing than something like SVG. That said, I'm not clear if I could justify that claim.

      • dhosek 22 hours ago
        Metapost was first released in 1989 by John Hobby in who was also effectively a coauthor of Metafont. I will say that the MF language is really kind of a delight. It has a clear influence from TeX in its macro construction, but the presence of first-class variables which TeX lacks makes it a more productive language overall.

        I was a bit inspired by it when I took my one and only CS class as an undergrad. One of the few homework assignments I actually turned in was supposed to be a simple calculator with 26 assignable variables (A–Z). I thought that was boring, so I let variables be of any length and turned the calculator into a linear algebra solver so if you wrote, e.g.,

            2X+3Y=14
            X-Y=1
            X
            Y
        
        it would give you the values for X and Y that met the constraints. I got a C on the assignment because the TA didn’t understand my code (written in CWEB and presented as a 20+ page source listing alongside the functioning executable).
        • taeric 6 hours ago
          I keep meaning to play with both. I don't know how to structure a project around it, though. :(

          For fonts, I think it would be fun to basically make a tiling font where you can basically make something like a dragon tiling by just playing with the letters.

          And kudos on that calculator! Sounds fun. Boo on the TA for giving you a C. Presumably it could be executed. When I was a TA in college, that would go a log way to getting a better grade. My not understanding something was a problem on me, not any student.

      • Nzen 22 hours ago
        I see that you are right. I skimmed the wikipedia article about MetaPost, and Knuth's name caught my eye more than "derived from".
  • verytrivial 1 day ago
    [flagged]