- [ ] Docs - [ ] Tests -------- # Features - [ ] Implement functions - [x] Parsing - [x] Pretty-printing - [x] Name resolution - [x] Typechecking - [x] IR - [ ] LLVM - [x] Need to enforce that functions actually return something!! :( - [x] Implement a string type - [ ] Better error reporting - [x] Source location tracking - [x] `Token` - [x] `AST` - [x] `Name.Error` - [x] `Type.Error` - [ ] `<?>` or whatever in `AST` parser - [ ] Store source `Text` in metadata? - [ ] `instance Render Token.Error` - [ ] `instance Render AST..Error` - [ ] `instance Render Name.Error` - [ ] `instance Render Type.Error` - Anything else....? - [x] Pretty printing of `AST` - [ ] More analyses / transformations in `IR`? ------ # Odds and ends - [x] Re-add validation for `Type` - [x] Validation of `IR` should validate `Function`s - [ ] Make validation failures print the thing that failed to validate - [ ] Bikeshedding and other cleanup of `Pretty` - [x] `instance Render IR.Function` - [ ] nicer pretty-printing of `types` - [x] AST could store full `Expression`s (or other nodes) instead of just `name`s in some places for finer-grained location metadata ------ # Bugs - [x] Less hacky newline handling - [ ] Properly handle exceptions in `Main` - [x] Fix `-` parsing ambiguity (unary vs. binary vs. literal) - [x] Fix `Tardis`-related laziness hacks in `IR` - [x] **Fix dead-code-related bugs in IR generation** - [x] Refactor handling of precedence in `AST` (and fix for `&&`, `||`)? - [ ] Improve handling of operations in `LLVM` to avoid UB on overflow/div-by-zero/etc. - [x] `function isBuzz(number: Int) returns isBuzz` validation error - [ ] IR validation error due to function w/ if { return x } else { return x } and implicitly inserted unit return - [x] `Name` doesn't record metadata/location for function arguments/returns (and maybe others) ----- # Facultative - [x] Implement `break` - [ ] anonymous scopes - [ ] unify `say()` and `write()`? `ask()` for strings? - [ ] make comparison operators polymorphic? - [ ] Either -> Validation? - [x] Bool literals - [x] `Unit` in AST - [x] function types in syntax, C-level HOFs? - [ ] type annotations on lets - [ ] type annotations in expressions - [ ] add more pretty-printing styles (e.g. name-based, scope-based, type-based semantic highlighting); allow selecting w/ command-line flag? - [ ] add `continue` ----- # Refactor - [x] Update to GHC 8.6, LLVM 7 - [x] enable `StrictData`? - ~~check assignments in `Name`, get rid of `NameWith`?~~ would invalidate `Name.validate` - [x] rename repo - [ ] use `unused` instead of `_ <-` - [ ] make use of `modifyM` variants directly returning the modified state, where appropriate - [ ] `text-path-utf8`? - [ ] `safe-exceptions`? - [ ] organize `Token` - [ ] try `DeriveAny` again? - [ ] can we use `DerivingVia`? or `QuantifiedConstraints`? - [x] `BlockArguments`!! - [ ] our own `Loc` type? - [ ] make the error-type in `Main` be a `Doc` rather than `Text`? - [ ] some kind of multiplatey abstraction? - [x] add a method in `Render` to customize how lists of the type are rendered, get rid of the flexible list instances? - [ ] `instance Render a => Render (Maybe a)`? - [ ] style consistency: `where` always trailing - [ ] style: *always* require newline after `->`/`=`...? - [ ] do something about all the warnings - [x] keep a stack of metadata instead of a scalar for better robustness? - [ ] factor out a `MonadMetadata` or something? - [ ] generalize the parser itself over arbitrary `Monoid metadata`? - [ ] collapse `LLVM.FirstState` and `SecondState`, with just the `instance`s differing? - [ ] [`DisambiguateRecordFields`](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#record-field-disambiguation)? - [ ] `StateT` -> `ReaderT` - [ ] explore https://github.com/lamdu/syntax-tree ? ----- # FUTURE - `IRBuilder`? - SSA? - Change IR to graph-based Thorin-style - Expression language - Bidirectional typechecking - Unification - Nonlocal `break`s, `break`s returning values - Struct types - Sum types, simple switches - Stack closures - Stack references (lifetime checking?) - Arrays, stack slices - Heap allocation, reference counting, heap-allocated strings, arrays, closures
Features
TokenASTName.ErrorType.Error<?>or whatever inASTparserTextin metadata?instance Render Token.Errorinstance Render AST..Errorinstance Render Name.Errorinstance Render Type.ErrorASTIR?Odds and ends
TypeIRshould validateFunctionsPrettyinstance Render IR.FunctiontypesExpressions (or other nodes) instead of justnames in some places for finer-grained location metadataBugs
Main-parsing ambiguity (unary vs. binary vs. literal)Tardis-related laziness hacks inIRAST(and fix for&&,||)?LLVMto avoid UB on overflow/div-by-zero/etc.function isBuzz(number: Int) returns isBuzzvalidation errorNamedoesn't record metadata/location for function arguments/returns (and maybe others)Facultative
breaksay()andwrite()?ask()for strings?Unitin ASTcontinueRefactor
StrictData?check assignments inwould invalidateName, get rid ofNameWith?Name.validateunusedinstead of_ <-modifyMvariants directly returning the modified state, where appropriatetext-path-utf8?safe-exceptions?TokenDeriveAnyagain?DerivingVia? orQuantifiedConstraints?BlockArguments!!Loctype?Mainbe aDocrather thanText?Renderto customize how lists of the type are rendered, get rid of the flexible list instances?instance Render a => Render (Maybe a)?wherealways trailing->/=...?MonadMetadataor something?Monoid metadata?LLVM.FirstStateandSecondState, with just theinstances differing?DisambiguateRecordFields?StateT->ReaderTFUTURE
IRBuilder?breaks,breaks returning values