Is there a CoffeeScript fork with no changes other than fixed scoping, so that it's largely compatible with CoffeeScript (completely compatible if the code has no outer-variable assignments)? I'd consider acceptable ways to assign an outer variable to include :=
a la LiveScript, or nonlocal
a la Python, or something else.
Asked
Active
Viewed 505 times
3
-
Why do you want this? Probably you will tell me some (edge) cases where you have fallen on your nose etc - I dont want to be snorty here. However regarding from a purely non technical/maintenance POV with Coffeescript you get a very decent language (more decent than JavaScript anyways) that is maintained and has a large following so any bugs and questions will be answered within a short time. On the other hand languages like Livescript or IcedCoffeeScript while having some cool features (oh man I'd love to have Jeremy include some of those) are simply dwarfed by the CS community – robkuz Sep 20 '12 at 07:10
-
@robertj Yes, I'm just asking - just because I learn about a fork matching these conditions, doesn't mean I'll use it and not apply further judgement (taking into account the magnitude of differences, upstream staleness, community/support, etc.). This is also why I'm looking for a CS fork with a minimal patch set, so that it can closely track upstream. I suspect the answer to my question is "No," but still decided to ask - the answer may well change one day. – Yang Sep 20 '12 at 09:59
-
2I totally agree with the poster. Unpredictable scoping is a bug. – donquixote Dec 13 '12 at 03:14
-
hmm, i should mention, the problem is mitigated by the fact that scoping is per file. so if you have small files you can avoid the problem. i still would prefer strict local scoping, though. – donquixote Dec 13 '12 at 04:15
2 Answers
0
There's not. I think LiveScript is compatible with CoffeeScript, but that isn't anything near "a small patch".

Ven
- 19,015
- 2
- 41
- 61
-
They're not compatible, but they are quite similar and a lot of code would need only minimal modification to work. It probably wouldn't be overly difficult to write a CoffeeScript -> LiveScript conversion program and I'd bet there is one already. – Kef Schecter Mar 26 '14 at 05:42
0
Could be that Coco is your friend.
https://github.com/satyr/coco
I am going to try it myself now..
On its way to hide JavaScript's bad parts, CoffeeScript has accumulated own quirks: horrible variable scope, awkward ranges, confusing and/or pointless keywords, verbose file extension, and so on. Coco tries to amend them, entwining good parts of both.
found in a list of coffee alternatives:
https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS
EDIT:
There is still a caveat with the Coco solution, afaik.
The := syntax only helps you with assignments, not with read access.

donquixote
- 4,877
- 3
- 31
- 54