This repository has been archived by the owner on Feb 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge GeoffreyBooth proposal into README (#26)
* Merge GeoffreyBooth proposal into README * Split out some of the overlong README into separate files * Restore alternatives section * Better filenames * Force detect case change #1 * Force detect case change #2
- Loading branch information
1 parent
f77b3d3
commit 7cb3365
Showing
4 changed files
with
90 additions
and
39 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# A New CoffeeScript Compiler | ||
|
||
The current CoffeeScript 1.x compiler is extremely well commented, but it really needs those comments. An entire project, [CoffeeScript Redux](https://github.com/michaelficarra/CoffeeScriptRedux), was created just to rewrite CoffeeScript’s codebase, not to add new features. | ||
|
||
Don’t underestimate how hard it is to write your own language compiler. If it were easy, CoffeeScript Redux would have been finished; as it stands, that project was essentially abandoned a year ago. | ||
|
||
Also don’t underestimate how hard it is to add new features to the CoffeeScript 1.x compiler. If that were easy, someone else would’ve added modules and classes to it by now. | ||
|
||
The CoffeeScript community suffers from too many people with a lot of passion but little time to invest in development. For that reason, we consider a new-from-scratch compiler to be off the table. We’ll just end up with another Redux. | ||
|
||
So we have only two options for starting points for our new compiler: | ||
|
||
* The current CoffeeScript 1.x compiler. | ||
* Pros: already supports all existing CoffeeScript code. | ||
* Cons: complicated, difficult-to-understand codebase. | ||
* The CoffeeScript Redux compiler, probably from [this PR](https://github.com/michaelficarra/CoffeeScriptRedux/pull/344). | ||
* Pros: better codebase, and the PR already supports many ES2015 features. | ||
* Cons: we inherit Redux’s issues and unfinished work, including any incompatibilities with existing CoffeeScript code. | ||
|
||
We have until modules and classes are supported in the current compiler before we need to [choose which compiler to use as a starting point for the next phase](https://github.com/coffeescript6/discuss/issues/25). | ||
|
||
As to where we should put our new compiler and develop it, here are two ideas: | ||
|
||
* Inside the current main [coffee-script repo](https://github.com/jashkenas/coffeescript), especially if we’re updating the old compiler. Currently the repo is structured such that the code in `src` is compiled and output into `lib/coffee-script`. If we want to avoid merge conflicts with any pending PRs against the repo, we should leave those folders as they are. But we could add new folders, for example `source` and `lib/coffeescript`, that contain the new compiler source code and compiled output. A flag like `output: 'modern'` would cause the new compiler (i.e. the code in `lib/coffeescript`) to be used instead of the old one. Both compilers, modern and legacy, would live on in the same repo. Bugfixes and improvements could be submitted against either. | ||
* In a new “coffeescript” repo, inside the [coffeescript organization](https://github.com/coffeescript). We should claim the `coffeescript` name on NPM, and point it to a new repo at [https://github.com/coffeescript/coffeescript](https://github.com/coffeescript/coffeescript). This new repo would either be a fork of the original CoffeeScript repo or a migration of the CoffeeScript Redux repo (in order to preserve the old repo’s history of issues and pull requests). No opt-in flag would be necessary; by doing `npm install coffeescript` instead of `npm install coffee-script`, developers would be choosing this compiler (though we would need some way to warn them in case they intended to choose `coffee-script`). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Reference | ||
|
||
## Relevant Discussions | ||
- https://github.com/jashkenas/coffeescript/issues/4078 | ||
- https://github.com/jashkenas/coffeescript/issues/3162 | ||
- https://github.com/jashkenas/coffeescript/issues/4228 | ||
- https://github.com/jashkenas/coffeescript/issues/3832 | ||
- (might as well scroll through https://github.com/jashkenas/coffeescript/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20es6 ) | ||
- https://github.com/michaelficarra/CoffeeScriptRedux/issues/336 | ||
- https://github.com/michaelficarra/CoffeeScriptRedux/issues/338 | ||
|
||
## Possible Alternatives | ||
There are a number of interesting new languages that have sprung up, some of them listed below. None seem to capture the essence of "unfancy JavaScript" accomplished in CoffeeScript, but may be sources of inspiration nonetheless: | ||
|
||
- [LiveScript](http://livescript.net/) – Extremely feature-rich, closest to CoffeeScript I've seen, functional-oriented | ||
- [Earl Grey](http://www.earl-grey.io/) – Python-ish with macros | ||
- [PureScript](http://www.purescript.org/) – Haskell-based, recommended by @michaelficarra (author of CoffeeScriptRedux) | ||
- [Elm](http://elm-lang.org/) – Haskell-based, only works in the browser. | ||
- [Frappe](https://github.com/lydell/frappe) (just an idea) | ||
- [TacoScript](https://github.com/forivall/tacoscript) (in the early stages) |