-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat(svm): initial sbfv1 virtual machine #478
Conversation
I would like to cast my vote as being in favor of files-as-structs. |
Personally I am indifferent. I see pros and cons. I'm happy to use them or to banish them, I don't think it matters very much. But I'll play devil's advocate for a moment to provide some additional perspective. The argument against is that they are hard to understand for people who are not familiar with Zig. The syntax is esoteric and specific to only this programming language. Let's say a developer who has never worked with Zig tries to understand our codebase. They would probably not understand that the file is a struct. They might totally miss the struct fields, or have no idea what they mean. This has a negative impact on the readability and accessibility of our codebase to outsiders. I get that each language has unique features that people would not understand without specific knowledge of that language. I'm not arguing that you should avoid using all of them just for the sake of universal readability. The question is whether the benefit justifies the cost. Having no idea that a file is a struct would have a significant impact on the intelligibility of the entire file. If the only advantage of using the file as a struct is to reduce one level of indentation, that's a pretty small benefit. Would you grant a small benefit to the majority if it causes a big problem for a minority? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor comments / queries but otherwise looks good to me!
642cd61
to
813486b
Compare
3eba407
to
378b514
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks great - just few notes/questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change the actual file names to lower case as well, otherwise looks good to me.
c34977c
to
33443cb
Compare
f2fa77e
to
07eda86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can merge this once it conforms to the self pattern that was decided yesterday. Currently this pr is using a couple different patterns.
I believe I've got the last of the usages here: d334218 |
Merge TODO checklist:
Port over the benchmarks(there's some V2 stuff I want to benchmark as well, excluding from this PR)This does not include SBFv2 support, as it's not ready yet, and we don't need it to start work on the program runtime.
You'll also notice I'm using Zig's file-as-struct feature in some places. The debate for whether it should be used was before my time, however I do want to advocate for it again and take this time to show how great it can be in practice. If we don't like it, I'll change it back to our current style guide.