deepakjois / hs-logo Goto Github PK
View Code? Open in Web Editor NEWLogo turtle graphics interpreter in Haskell
Home Page: http://deepakjois.github.io/hs-logo
License: BSD 3-Clause "New" or "Revised" License
Logo turtle graphics interpreter in Haskell
Home Page: http://deepakjois.github.io/hs-logo
License: BSD 3-Clause "New" or "Revised" License
repeat 4000 [repeat 34 [fd 12 rt 10] rt 90]
causes stack overflow.
Clean up some bad choice of var names in code, that were chosen in the interest of expediency.
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 sidesevaluateList
Here are some initial ideas to fix this:
eval
to evalBinOp
or somethingevalWord
, evalExpr
, evalList
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.Can't install because of this, I will try checking out the github project and installing that. Is there a release planned?
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.
while
if
for
dotimes
hs-logo.cabal
WIth inspiration from diagrams-contrib
pr 3 * (5 + 2) / 4
pr 3 * 7 / 4
pr 3 * 7 + 4
yields
21.0
21.0
25.0
Here are some examples that will be good to be able to draw in hs-logo
Currently there are only types corresponding to Logo tokens. We also need a result type that will represent the outcome of evaluating an expression or result.
for [l 1 10 1]
is invalid, whereas for [ l 1 10 1 ]
is valid.
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.
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.
This should be as simple as adding a map in LogoContext
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.