ailrk / blgol60 Goto Github PK
View Code? Open in Web Editor NEWAlgol 60 60 years later
License: MIT License
Algol 60 60 years later
License: MIT License
The symbol lookup and temporary name generators are memoized: they will only compute the key once, then the result will be stored in a memoization table. The problem is to use what for storing these states. To avoid unsafePerformIO
, I need to wrap all operations in a state monad, and the entire computation also needs to be in the state monad to remember the change. This introduces two problems: 1. there will be an extra layer of monad, and that clutter the code. 2. Memoization table only serves the purpose of speeding up lookup, the side effect isn't really observable at all. Extra work is really not necessary.
I think a global memoization table is a legit use for the global mutable state. The goal is to have something like unsafePerformIO (newIORef HM.mepty)
for recording the state and insertions will be in IO monad.
Write a small graph module just for this project.
AST is stable now, so there should be a pretty printer.
from Test.hs
, with runAll exprTest
=== 5 ================
"if true and false then 1 + 3 * 2 else 4 < 10"
Left "-"
( line 1
, column 3
) :
unexpected reserved word "if" expecting simple expression
=== 8 ================
"if not b > 3 then c >= 2 else c < 4"
Left "-"
( line 1
, column 3
) :
unexpected reserved word "if" expecting simple expression
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.