[CLI] Support type lowering in the generated symbol containers

Open
#145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
cli

Research direction

Start by reviewing the generated symbol-container code and generator-option precedent in issue #130; this issue does not name specific files or tests. Determine whether optionally lowering ExtendA and ExtendB into Base, while retaining their own slices, improves linking performance without undermining the allocation benefits. Done means the option's behavior is implemented and validated against the inheritance and reference grammar described here.

Written by the indexing model from the issue text.

Description

With https://github.com/TypeFox/fastbelt/pull/144, the slices from the generated symbol containers can be reused directly in the linking phase. However, in a grammar such as:

interface Base { Name string }

interface ExtendA extends Base {...}
interface ExtendB extends Base {...}

RefA: Ref=[ExtendA:ID]
RefB: Ref=[ExtendB:ID]
RefBase: Ref=[Base:ID]

The generated container allocates a slice for ExtendA and ExtendB, but will generate a merged container for Base. This makes sense, as it generally reduces heap allocations, but reduces linking performance, due to the amount of allocations required to generate and iterate trough the merged container. We should consider whether it makes sense to optionally lower the types of ExtendA and ExtendB into Base (in addition to keeping their own slices). This could be a generator option, as seen in #130.

Dominant language
Go
Stars
33
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TypeFox/fastbelt

All issues in TypeFox/fastbelt

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.