doc: update progress in README

This commit is contained in:
mappu 2020-04-05 18:24:31 +12:00
parent 5344bbe078
commit 2a00699b2f

View File

@ -7,42 +7,68 @@ The goal is to produce idiomatic, maintainable Go code as part of a one-off conv
## Progress
[X] Convert some small programs
[X] All functions return `(type, error)`
[X] Error handling
- [X] All functions return `(type, error)`
- [X] Convert `throw` to err return
- [ ] Elide error return for functions that cannot throw
- ?? Could be a standalone Go refactoring tool
- [ ] Non-leaf function calls need to check + bubble errors
- [ ] Behaviour of function calls in rvalue cases where err cannot be checked
[ ] Comprehensive coverage of all AST node types
- [ ] Expr
- [ ] Binary
- [X] Binary
- [ ] Scalar
- [ ] ...
- [ ] Convert instanceof for Exception types to Go1.13 `errors.Is`
[ ] Array handling
- [ ] Infer whether to use slice/map for PHP array
[X] Array handling
- [X] Infer whether to use slice/map for PHP array
- [ ] Infer whether map use should be order-preserving
[ ] Multi-file programs
- [ ] Include/Require
[ ] Namespaces
[ ] Generators
[ ] Numbered break/continue
[ ] Goto
[ ] Closures
- [ ] Handle value/reference captures
[ ] Sort callbacks
- [ ] Transparent conversion to sort.Slice
[X] Convert top-level calls to `init()`/`main()`
- *Currently always `init`*
[ ] Class/object transformations
- [X] Convert `new X` constructor calls to `NewX`
- [ ] Convert class inheritance to interfaces with interface assertion
- [X] Static methods
- [X] Inheritance *partial*
- [ ] Interfaces
- [ ] super
- [ ] Need to track current conversion state through into function generator, to select the concrete parent
- [ ] parent::
- [ ] static, self
- [ ] Traits / `use`
- [ ] Abstract methods
[ ] Type inference
- [ ] Convert known PHP typenames to Go equivalents
- [ ] Parse extra types from phpdoc blocks
[ ] Infer whether to declare variable (`var` / `:=`) or reuse (`=`)
- [ ] Track current visibility scope
[ ] Standard library transformations
- [ ] Track golang package imports
- [ ] Handle conflicts between golang stdlib packages / local variable names
[ ] PHP Superglobal transformations
- [ ] `$_SERVER['argv']` to os.Args
- [ ] `$_GET['name']` to r.FormValue('name')
[ ] Closures
- [ ] Handle value/reference captures
[ ] Library/environment transformations
- [ ] Standard library transformations
- [ ] Track golang package imports
- [ ] Handle conflicts between golang stdlib packages / local variable names
- [ ] PHP Superglobal transformations
- [ ] `$_SERVER['argv']` to os.Args
- [ ] `$_GET['name']` to r.FormValue('name')
- [ ] Common 3rd party package transformations to popular equivalents (optional)
- [ ] Guzzle
- [ ] AWS SDK
- [ ] PHPUnit -> Go Test
- [ ] Replace Composer/PSR-4 autoloading with Go imports
[X] Variadic function parameters
[ ] Preserve comments
[ ] Preserve rough line spacing
[ ] Convert wordpress / mediawiki / symfony
- [ ] Option to convert with preset=cli, preset=web, webroot path
- [ ] Option to generate built-in web server
[ ] Generate source maps
[ ] Command-line tool option to `go run`