Skip to content

Zig things #1

Open
Open
@bluesillybeard

Description

@bluesillybeard

There are a number of Zig related issues that make development and usage of this library quite difficult.

(Ordered roughly from most important to least important)

Annotating declarations:

In this library, in order to create an instance function that is not dynamically dispatched, the function must be prefixed with 'static_' so the makeInterface function can detect it. A better way to do it without using a prefix does not seem to exist at the moment, although some proposals (such as this one) might make this possible in the future.

Circular Dependencies:

Due to the nature of how interfaces work, there is an extremely annoying tendency to create unavoidable circular dependencies. Some way to break them or at least alleviate them would be appreciated.

Note that I did create a workaround, which can be found in src/tests/circular_reference.zig

A way to detect inferred error sets:

The compiler crashes when trying to use an interface with inferred error sets. The solution is to use a defined error set, but that is not clear to people using this library without knowing that ahead of time. In order to create a better error message than "Oh no the compiler crashed", being able to detect if an error set is inferred would make that a lot better for users.

Creating functions:

Right now, the library still requires the user to create the vtable forward functions (which are used to create the vtable itself, which is part of why there are so many problems with circular dependencies). Some way to generate functions in comptime would be great.

I REALLY don't want to do any preprocessing of the user's code - that would make using this library quite a bit more difficult.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions