https://github.com/endel/galapagos
Evolutionary language transformation.
https://github.com/endel/galapagos
Last synced: 10 months ago
JSON representation
Evolutionary language transformation.
- Host: GitHub
- URL: https://github.com/endel/galapagos
- Owner: endel
- License: mit
- Fork: true (camspiers/galapagos)
- Created: 2014-12-26T03:38:43.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-07T22:16:26.000Z (almost 11 years ago)
- Last Synced: 2025-02-21T16:48:02.786Z (about 1 year ago)
- Language: PHP
- Size: 275 KB
- Stars: 10
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php-cn - Galapagos - 语言转换进化 (目录 / 数据结构和存储 Data Structure and Storage)
- awesome-php - Galapagos - 语言转换进化 (结构( Architectural ))
- awesome-php - Galapagos - 语言转换进化 (Architectural Architectural)
README
# Galapagos
Evolutionary language transformation. Fork of [igorw](https://github.com/igorw)'s initial work.
Read the related [blog post](https://igor.io/2013/07/26/evolving-syntax.html).
Backport existing PHP features to previous versions through AST compilation.
Inspired by lisp macros. Using the incredible
[nikic/PHP-Parser](https://github.com/nikic/PHP-Parser).
## Missing features
### 5.4
* Binary number format
* Closure rebinding
Edge cases:
* Calling private methods from within closure
* Ensure `$that` gets passed to nested closures
### State
There needs to be a strategy for managing state. A trait transformer needs to
keep track of the traits it found. That is currently missing.
### Preservation
There should be a way to preserve existing code formatting, especially for
code that wasn't actually modified. Instead of pretty-printing everything,
only changed parts of the AST should be changed in source. Three-way-diff may
help with this.
### Line numbers
Is there any way to do something like source maps to refer to the original
line numbers, so that code remains at all debuggable?