Git Product home page Git Product logo

hs-logo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hs-logo's Issues

Improve diagrams PNG output

  • Add a little bit of padding
  • Use an appropriate stroke width
  • Use a white background and a black foreground

Robust messaging and error handling

  • Enumerate all common errors
  • Find a way to robustly handle each of those error cases
  • Keep track of all line numbers, and make error messages indicate the most accurate line number

Avoid using ParsecT based Evaluator

Currently use an evaluator which sits on top of ParsecT to do the heavy liftting of reading input. This task is to change the evaluator to avoid that.

Figure out how to call SVG backend directly

Currently, the Logo interpreter calls the SVG backend via the helper method defaultMain, passing the arguments using withArgs.

This can be made better if we directly call the SVG backend, using something like the renderDia method.

Bad output

repeat 5100 [fd 10 rt arctan (remainder repcount 100) / 100]

Produces some bizarre output, which does not match the one at the Logo 15-word challenge page at all.

Make an OS X Package

Looks at the make_os_package.sh script in the pandoc project.

A great reason to do this is to allow people to install hs-logo without needing to install Haskell. Hopefully, when we have a cleaner and more robust implementation and user guide, people would want to use it without compiling it from source.

Clean up code

Clean up some bad choice of var names in code, that were chosen in the interest of expediency.

Evaluation logic is awkward

Currently the evaluation logic in Evaluator.hs is pretty awkward. This makes implementing control primitives like for a bit cumbersome. Here are some of the problems:

  • eval method works only on binary expressions with NumLiteral tokens on both sides
  • evaluating a list involves calling a different method called evaluateList

Here are some initial ideas to fix this:

  • Rename eval to evalBinOp or something
  • Have methods for each type of operation, like evalWord, evalExpr, evalList
  • Have a new method called eval which does pattern matching to determine what kind of evaluation to perform on a token, and then return a logotoken as a return type.
  • Change the control structures to use eval so that they dont have to be concerned about what is passed in

Write logic to evaluate expressions

Need to take a list of raw LogoToken types and evaluate them to return a LogoToken which is one of the Logo data types: word, number or list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.