[RFC] XML DSLs
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- html, xml
- Domain
- compilers
Research direction
Start by reading the referenced RFC #57 and the 28-comment discussion on this issue. Compare the proposed XML DSL forms, including balanced braces and escaped braces, with the current Haxe parser entry points; no implementation files or tests are named in the payload. Done means the syntax design is resolved and its supported cases are covered by the resulting compiler work.
Written by the indexing model from the issue text.
Description
Followup regarding my previous RFC #57
First, thank you for all the comments, after reading the whole discussion and taking time to think about it, I would like to update my proposal.
I agree it is hard to have both the goal of "Universal" block strings and still support XML syntax correctly. Some also mentioned that one of the interesting parts about the feature were some kind of IDE support for syntax highlight and autocomplete, so having the feature too abstract would prevent this.
I still think that some kind of XML DSL syntactic support is - if not absolutely needed - at least interesting enough to have in Haxe. HTML is here to stay for a long time and the XML document model that comes with it can be used for many different other applications as well outside of web client code.
I also think we should not support a single particular DSL such as JSX which spec can evolve and change in unexpected ways, or be entirely deprecated by another alternative syntax - whatever the trending framework happens to be in JS world.
So here's a revised syntax proposal that is trying to ensure that most XML based DSLs will be supported, while still trying to make the strict minimal assumptions about the DSL syntax.
An XML DSL node would be in the form:
<nodename CODE?>
Where CODE (optional) is explained below.
We would then try match with the corresponding closing XML DSL node in the form:
</nodename CODE?>
And we would allow self-closing nodes in the form:
<nodename CODE?/>
CODE section can be anything, expect the > character.
But this creates some invalid syntaxes, for instance the following, because of the comparison inside CODE section:
var x = <node value="${if( a < b ) 0 else 1 }"/>
So I propose that CODE additionally check for opening/closing curly braces {} and ignore their whole content. So for instance the following would be perfectly valid:
var x = <yaml {
some yaml code with balanced {}
} />;
We could additionally treat \{ as escape sequence for the following case:
var x = <node value="\{"/>
I think this version of the syntax gives enough flexibility with minimal assumptions. Using curly braces is done in order to ensure that reentrency is fully supported so any Haxe code within the DSL will be correctly handled.
- 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 ·