aboutsummaryrefslogtreecommitdiffstats
path: root/src/lift.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-12-25Simplify let to fn, rather than deal with it through to compilation.David Robillard1-32/+2
The previous implementation of let was a premature optimization intended to make let cheap/free, but screws up closure creation and variable indexing because a new scope is created by something other than fn. Only compile top level expressions to globals (with associated store/retrieve overhead) in a REPL when it is necessary. Add `do' form (ala scheme `begin') to backend (used by `match' simplify). git-svn-id: http://svn.drobilla.net/resp/resp@348 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-10Fix type of lifted calls.David Robillard1-5/+3
git-svn-id: http://svn.drobilla.net/resp/resp@345 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-10Move simplification from lift stage to a new (post-typing) simplify stage.David Robillard1-44/+2
git-svn-id: http://svn.drobilla.net/resp/resp@344 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-10Convert match form to if at lift stage (remove knowledge of match from ↵David Robillard1-17/+71
compile stage and backends). git-svn-id: http://svn.drobilla.net/resp/resp@342 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09More readable names for lifted fn implementations.David Robillard1-2/+4
git-svn-id: http://svn.drobilla.net/resp/resp@338 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Document the free variable implementation (mostly in lift_symbol) better.David Robillard1-11/+19
git-svn-id: http://svn.drobilla.net/resp/resp@335 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Fix cpplint warnings.David Robillard1-0/+3
git-svn-id: http://svn.drobilla.net/resp/resp@329 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Add let form.David Robillard1-1/+33
git-svn-id: http://svn.drobilla.net/resp/resp@328 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Fix indentation.David Robillard1-4/+2
git-svn-id: http://svn.drobilla.net/resp/resp@327 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Sort code.David Robillard1-39/+41
git-svn-id: http://svn.drobilla.net/resp/resp@326 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Make environment always referenced by symbols.David Robillard1-4/+3
Intern symbol strings, but not ASymbol objects themselves, so each symbol can have a different Cursor. Fixes missing locations in error reporting. git-svn-id: http://svn.drobilla.net/resp/resp@324 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-07Saner recursive descent lexer/parser.David Robillard1-3/+1
git-svn-id: http://svn.drobilla.net/resp/resp@306 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-05Simplify parser.David Robillard1-3/+1
git-svn-id: http://svn.drobilla.net/resp/resp@300 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-04More const-correctness (remove all use of const_cast from lift.cpp).David Robillard1-38/+34
git-svn-id: http://svn.drobilla.net/resp/resp@296 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-04More const-correctness.David Robillard1-12/+15
git-svn-id: http://svn.drobilla.net/resp/resp@295 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-04Make resp_lift const-correct.David Robillard1-9/+9
git-svn-id: http://svn.drobilla.net/resp/resp@294 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-04Eliminate tuple/list mutation.David Robillard1-40/+43
Fix AST::str(). git-svn-id: http://svn.drobilla.net/resp/resp@293 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Remove use of RTTI for AST.David Robillard1-20/+22
git-svn-id: http://svn.drobilla.net/resp/resp@290 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Remove AST::constrain.David Robillard1-4/+4
git-svn-id: http://svn.drobilla.net/resp/resp@287 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Merge ACall and ATuple.David Robillard1-14/+14
git-svn-id: http://svn.drobilla.net/resp/resp@285 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Remove AFn.David Robillard1-22/+21
git-svn-id: http://svn.drobilla.net/resp/resp@284 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Move AFn and AType prot() methods to ATuple.David Robillard1-3/+3
git-svn-id: http://svn.drobilla.net/resp/resp@283 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Remove ACall subclasses.David Robillard1-19/+16
git-svn-id: http://svn.drobilla.net/resp/resp@282 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Remove use of ACall type hierarchy from lift phase.David Robillard1-32/+20
git-svn-id: http://svn.drobilla.net/resp/resp@280 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Remove use of ACall subclasses for contrain phase.David Robillard1-3/+4
git-svn-id: http://svn.drobilla.net/resp/resp@279 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Work towards removing different classes for each type of expression.David Robillard1-66/+103
git-svn-id: http://svn.drobilla.net/resp/resp@278 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Represent code as list structure (i.e. traditional LISP lists built from ↵David Robillard1-42/+48
pairs), rather than tuple structure. Remove unused/crufty depoly stage. Remove cps from AST interface (but keep cps.cpp code around for later). Improved command line interface for compilation stages (options -T -L -S). git-svn-id: http://svn.drobilla.net/resp/resp@277 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-11-17Use single uint32_t for GC object header (mark and tag).David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/resp/resp@272 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-10-14Prefix internal "me" parameter with underscore.David Robillard1-4/+4
git-svn-id: http://svn.drobilla.net/resp/resp@271 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-19Generalise `cons': a call to any symbol beginning with an uppercase characterDavid Robillard1-5/+6
(i.e. a type symbol), e.g. (Thing 2), is a call to a type constructor which creates a Tup containing the arguments, with the symbol as the first element in the type expression, e.g. (Thing 2) has type (Thing Int) and compiles to a tuple containing a single Int. The type constructor `Tup' can be used as a `cons' replacement to construct generic tuples. git-svn-id: http://svn.drobilla.net/resp/resp@264 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-19Add quote to syntax (currently only a lexeme is quotable, no lists...)David Robillard1-0/+6
git-svn-id: http://svn.drobilla.net/resp/resp@262 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-13Better (but still not correct...) computation of lifted function ↵David Robillard1-5/+18
implementation type. git-svn-id: http://svn.drobilla.net/resp/resp@258 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-13Better error reporting when unification fails (report both locations, and ↵David Robillard1-1/+0
preserve locations during substitution). git-svn-id: http://svn.drobilla.net/resp/resp@256 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-13Restructure as a source translation based compiler.David Robillard1-29/+159
Implement support for closures (via lambda lifting phase). git-svn-id: http://svn.drobilla.net/resp/resp@254 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-08Exception specifiers.David Robillard1-13/+9
More efficient constraints construction (c') in unify(). git-svn-id: http://svn.drobilla.net/resp/resp@253 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-04-08Tuplr -> Resp (RESource Processing).David Robillard1-5/+5
git-svn-id: http://svn.drobilla.net/resp/resp@252 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-16. operator for destructuring Tuples (cons).David Robillard1-0/+6
git-svn-id: http://svn.drobilla.net/resp/tuplr@236 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Remove all use of ATuple::at().David Robillard1-9/+9
git-svn-id: http://svn.drobilla.net/resp/tuplr@229 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Replace more use of at(0) with head().David Robillard1-3/+3
git-svn-id: http://svn.drobilla.net/resp/tuplr@228 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-15Make TEnv purely a type environment.David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/resp/tuplr@222 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-13liftCall -> compileFunction.David Robillard1-2/+2
git-svn-id: http://svn.drobilla.net/resp/tuplr@208 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2009-10-08Move lifting pass to separate file.David Robillard1-0/+78
git-svn-id: http://svn.drobilla.net/resp/tuplr@205 ad02d1e2-f140-0410-9f75-f8b11f17cedd