Io as an interface isn’t released yet, I say wait and let’s try it out. Maybe it’s crap and something else will be implemented like the other previous async solutions in zig. Since zig isn’t a 1.0 lang yet it’s expected to have some pitfalls and breakage.
Reader and writers were interfaces before 0.15.1. What’s new is that they are buffered. I don’t think that zig discourages interfaces, just that the language doesn’t hide anything. An interface in all system languages is a struct with a vtable just like in zig but that they have an easy way of creating one. If you need one in zig you can go that approach or use a tagged union just that zig is open about what an interface is.
> f you need one in zig you can go that approach or use a tagged union just that zig is open about what an interface is.
Perl objects worked like this and the ecosystem is a mess as a result. There's a built in `bless` to add a vtable. There's some cool stuff you can do with that like blessing arrays to do array of structs vs struct of arrays and making it look like a regular object in user code. The problem is there are like 4 popular object libraries that provide base stuff like inheritance, meta objects, getters/setters etc and they're not all compatible and they have subtle tradeoffs that get magnified when you have to pull multiple in to get serious work done.
Yes I know. I see the same statement every single time this conversation comes.
Let me ask this: hypothetically if they wanted to, would it be possible for Zig to add a language feature called Interface which provided to the user "...an easy way of creating one".
Creating an interface is fairly easy once you know how. I would say that it is as easy as in rust for a beginner. You get used to it and I don’t believe it needs a special keyword.
I would like to see an example of someone showing the workflow for using jj and doing feature branch. I don’t really get that yet. Most examples only show that they commit once and then push. But what if it requires multiple commits.
`jj log` if needed to see what revision ID you need to use
`jj new <starting revision> -m <message>` to create a new change with a given message with <starting revision> as the parent. (you can also use the `--insert-before <revset>` and/or `--insert-after <revset>` to set the parent & child revison(s) for the new revision).
`jj bookmark set <feature 1 name> --revision <revset>` to make a bookmark (a branch name) on the revison you just made.
Make changes on this branch as desired. `jj new` for each new change you want to have its own revision.
If you added more revisions to the branch, `jj bookmark move <feature 1 name> --to '@'` (you can also use the change ID instead of '@', '@' just means "the current change you're editing").
`jj edit <starting revset>` to go back to your starting revset.
`jj new -m <message>` to make a new revset on top of the starting revset (the starting revset now has two children: it has branched)
`jj bookmark set <feature 2 name> --revision <revset>` to name the second branch you just created.
Make changes as desired. `jj new` for each new change you want to have its own revision.
If you added more revisions to the branch, `jj bookmark move <feature 2 name> --to '@'`.
`jj new <feature 1 name> <feature 2 name> -m "merge feature 1 & feature 2"` to make a new revision with the feature 1 & feature 2 bookmark revisions as its parents (this is a merge).
Alternatively, you could use `jj rebase` to move any number of commits to anywhere in the commit graph you want.
Makes me curious of what kind of beast hardware the developer has in order not to notice the lag. Kind of interesting that a simple landing page takes more resources than many modern games.
Only tested the mobile app, the design is heavily inspired by things3 and I see no option for a graph which is one of the things obsidian is most famous for.