EcmaScript 4 syntax
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- compilers
Research direction
The issue names no files, tests, or entry points. Start by reviewing the proposed ES4 forms and the stated compatibility questions, then determine what parser, macro, and decorator areas would need evaluation. Done would require a maintainer decision on whether the syntax is accepted and what compatibility tests are needed.
Written by the indexing model from the issue text.
Description
Haxe has some subtle differences from TypeScript and EcmaScript 4 (inexistent) syntax.
- For aliasing types, TypeScript choose to use the context keyword
typerather than a reserved wordtypedef. EcmaScript 4 too was going to usetype(whether in ES4 it was going to be contextual or not I don't remember, though the EcmaScript 4 reference interpreter is available in archive.org). - In TypeScript, you can express
Array<T>asT[]. In EcmaScript 4 you would be able to expressArray.<T>as[T]. To me, it seems like the EcmaScript 4 syntax for specifying array types in brackets is cryptic and readable at the same time.- Both TypeScript and EcmaScript 4 express tuple types with the same syntax, consisting of two or more element types.
- In TypeScript, the dynamic type is written
any. In EcmaScript 4, it's written*.
More specifically, in these languages, type is reserved when it's followed or preceded by another identifier or reserved word, so it doesn't break compatibility.
Here's a Haxe version:
var a:Array<Dynamic> = [];
typedef DoublePrecisionFloatingPoint = Float;
Here's an EcmaScript 4 version:
var a:[*] = [];
type DoublePrecisionFloatingPoint = Number;
I think it'd be interesting if Haxe supported the same ES4 syntax for clarity, considering it'd not break compatibility. It doesn't break macros, does it? After all, Haxe was inspired by ES4.
Another thing I didn't mention is that the decorator syntax of ES4 used brackets, not @:.
- Dominant language
- No language data
- Stars
- 120
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HaxeFoundation/haxe-evolution
-
Difficulty 1/5 Under an hour Newbie friendliness 5/100
HaxeFoundation/haxe-evolution#126 · 2 comments · 1 reaction ·
-
License for RFCsOpen
Difficulty 5/5 Over a week Newbie friendliness 35/100
HaxeFoundation/haxe-evolution#121 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
HaxeFoundation/haxe-evolution#120 · 9 comments · 5 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
HaxeFoundation/haxe-evolution#114 · 8 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
HaxeFoundation/haxe-evolution#107 · 1 comment · 1 reaction ·
All issues in HaxeFoundation/haxe-evolution
Similar issues
-
node:url: url.parse and url.resolve report name parse/resolve instead of Node's urlParse/urlResolveOpenarea:stdlib effort:S impact:low parity type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bad-antics/lateralus-lang#880 · 1 comment ·
Maintainers usually reply within 1 day
-
bug fixed form parser medium priority tokenizer
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
swc-project/swc-next-issues#817 ·