HaxeFoundation / HaxeFoundation/haxe

[hxb] Add -main information

Open
#11,502 0 comments 0 reactions 0 assignees View on GitHub
feature-hxb
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Hxb currently does not store `com.main_class` and `com.main` anywhere. It would be nice to (optionally?) support this so that we can have runnable archives without the need to specify `-main` again.

I'm not sure where this should go though because it's not part of any particular module's structure. We likely need some sort of manifest/bootstrap file in the generated .zip which we check by convention. Notably, this should still be in binary format because `com.main` is a `texpr option`.

Somewhat related, it would also be nice if we could store the module order, i.e. the output of `Finalization.sort_types`. That way we don't have to do this on every compilation.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how hxb generates the .zip archive and how Finalization.sort_types produces module order. Investigate where com.main_class and com.main could be represented in a binary manifest or bootstrap file by convention. Done means the archive can preserve the optional main information and module order without requiring -main or repeating compilation sorting.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.