Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] std.interface #4567

Closed
wants to merge 22 commits into from
Closed

[WIP] std.interface #4567

wants to merge 22 commits into from

Conversation

alexnask
Copy link
Contributor

@alexnask alexnask commented Feb 27, 2020

This module provides tools to create interface types that work at runtime and comptime.

Checklist:

  • std.interface
    • Interface
    • Owned, Comptime, NonOwned, Inline, InlineOrOwned storage types
    • Optional function support
    • Automatic VTable generation
    • VTable generation for any number of arguments (impossible with current language, marking as done)
    • Async function support
    • Tests
    • Proof of concept Allocator reimplementation
    • Async function tests
    • Add documentation

This is currently just a prototype, submitting this PR to make sure the direction of this implementation is something that would fit into zig.

lib/std/interface.zig Outdated Show resolved Hide resolved
Copy link
Contributor

@ikskuh ikskuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good overall, but i think some doc comments on how to use it would be nice ;)

But: Looks like this could replace the current interface pattern quite well

lib/std/interface.zig Outdated Show resolved Hide resolved
lib/std/interface.zig Outdated Show resolved Hide resolved
lib/std/interface.zig Outdated Show resolved Hide resolved
@mikdusan mikdusan added the standard library This issue involves writing Zig code for the standard library. label Mar 6, 2020
@andrewrk
Copy link
Member

This looks like a nice project, that is still WIP and does not require any language or std lib changes. My suggestion would be to work on it in a separate repo until it's ready to be proposed to upstream.

This is currently just a prototype, submitting this PR to make sure the direction of this implementation is something that would fit into zig.

I'm sorry I can't answer this question yet. Let's continue discussing in #130. But the open pull request queue is reserved for code that is proposed to get merged into upstream, and this isn't ready for that yet.

@iacore
Copy link
Contributor

iacore commented Dec 31, 2021

@alexnask can you submit a new pull request? I think now it's time to add it to the standard library (see "Related issues" in #10184).

@Warashi
Copy link

Warashi commented Sep 9, 2022

@andrewrk
alexnask has no activity since July 2021.
alexnask save implementation at https://github.com/alexnask/interface.zig with MIT License, can you take it as standard library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants