HaxeFoundation / HaxeFoundation/haxe

Haxe-in-Haxe notes

Open
#6,843 76 comments 75 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

The first goal is to have the compiler written in Haxe and generating the corresponding OCaml code, allowing for a more familiar syntax for potential contributors and compiler team. At longer term, this will allow the compiler to run on other platforms although this is not something that will be possible or that we should focus at first.

The following needs to be resolved to have a working Haxe-in-Haxe implementation.

Note to Haxe users : this is an exploration of the possibility, we are not sure yet we will have something working in the end.

OCaml Haxe target (Haxe-to-OCaml) (@ncannasse) :
- [ ] OCaml generator for Haxe compiler: we shouldn't try to support the whole Haxe specification at first, in particular everything involving reflection / dynamic is not used by the compiler and thus not required.
- [x] Class/structures representation: we should go with something like C, with a data structure representing the classes fields and methods taking the class as first argument.
- [x] Ability to access externs, such as ExtLib PMap module, etc. This should work pretty will with abstracts or extern classes given the class representation choice
- [x] List support: not an easy one, we need to have some way to easily construct and pattern match ml immutable lists
- [ ] More list support: `::` as proper operator with type inference, correctly infer `::` in pattern matching

Automated Haxe compiler OCaml-to-Haxe ML2HX (@nadako) :
- [x] Extracting the OCaml typed AST
- [ ] Generating the corresponding Haxe code
- [ ] Lexing and parsing: I think they should be left as "externs" for now, and we can keep the original OCaml source
- [ ] Making sure the corresponding Haxe code compiles (gets typed) with the ML target

Merge of both ML target and ML2HX :
- [ ] Making sure the Haxe compiler code successful generates to ML
- [ ] Making sure the ML generated code compiles and run
- [ ] Performance/Styling : replace consecutive var assignment with lets in ML target, replace consecutive lets with same type by single var decl in ML2HX
- [ ] Deal with Lexer and Parser at this point?
- [ ] Refactoring: after porting, several steps of refactoring will be possible by reorganizing the modules and packages

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.