kbenzie / vim-spirv

A vim plugin for the Khronos Group's SPIR-V standard.
MIT License
30 stars 2 forks source link

Official SPIR-V syntax #12

Closed ShabbyX closed 3 years ago

ShabbyX commented 3 years ago

I just found out about both this project, and the official SPIR-V vim syntax generated by SPIR-V Tools: https://github.com/KhronosGroup/SPIRV-Tools#extras

Are you aware of the other project? If so, how do these compare? If not, may I suggest collaborating with SPIR-V Tools and bringing the features in the project there for the greater benefit of the community?

kbenzie commented 3 years ago

Official SPIR-V syntax

Syntax highlighintg of the textual SPIR-V form is not defined in the standard. What makes syntax highlighting "official"?

Are you aware of the other project?

Do you mean the entire SPIRV-Tools project? In which case, yes. I started the project for my employer before contributing it to the Khronos Group to maintain.

the official SPIR-V vim syntax generated by SPIR-V Tools: https://github.com/KhronosGroup/SPIRV-Tools#extras

The script in SPIRV-Tools which generates a vim syntax file was created separately and in parallel with this plugin.

While the script exists to generate a syntax file for vim, it's generation is not enabled in the build by default and does not ship in packaged releases, to access it requires building from source. That's not particuarly useful to end users of SPIRV-Tools, is it?

If so, how do these compare?

I've not compared how the SPIRV-Tools syntax highlighting looks side by side.

This plugin also provides a number of usability enhancements beyond syntax highlighting, as described in the README and help.

As a plugin, it can be easily installed using any of the number of package managers for vim, or indeed simply cloned in a suitable location and loaded as a vim 8 package. This is not the case for the SPIRV-Tools syntax highlighting.

If not, may I suggest collaborating with SPIR-V Tools

There is already a link to this plugin in the SPIRV-Tools README, this was added in early 2017. The decision to add this link and leave this repository stand alone was made during a Khronos Group F2F meeting.

bringing the features in the project there for the greater benefit of the community?

Would this really benefit the community when you can't even access the generated syntax file without building from source?

For me, to be of greatest benefit to the community, SPIR-V syntax highlighting would ship with vim itself by default.

As for the other features in this plugin, specifically automatically (dis)assembling binary SPIR-V files on :edit/:write, it's unlikely those would be accepted into the vim runtime itself as the default vim behaviour is to open binary files as is, not preprocess into a human readable form. These features would need to remain in a plugin.

Even in the event SPIR-V syntax highlighting is added to the vim runtime, there would still be use of a plugin which provides syntax highlighting for any version prior to the one which adds that support.

ShabbyX commented 3 years ago

Official SPIR-V syntax

Syntax highlighintg of the textual SPIR-V form is not defined in the standard. What makes syntax highlighting "official"?

Meant so say "Official SPIR-V vim syntax file". Official in the sense that it's SPIR-V Tools itself that is providing it (i.e. "blessed" by Khronos(!))

Do you mean the entire SPIRV-Tools project? In which case, yes. I started the project

That's awesome, but no I was referring to the script inside the project.

Would this really benefit the community when you can't even access the generated syntax file without building from source?

Perhaps there was a misunderstanding. It seems to me there's wasted effort when both this project and the script in SPIR-V Tools attempt to supply a vim syntax file for SPIR-V. I'm not familiar with either mind you, and I'm sure the plugin here is fantastic. I was merely bringing this to your attention, ICYMI, so perhaps the two projects could be merged. I'm sure technicalities such as not being built by default, or having the files available as a package are trivially worked through.

It's great to know this project is advertised by SPIR-V Tools, and honestly a surprise they felt the need to write their own script if they were aware of this.

kbenzie commented 3 years ago

perhaps the two projects could be merged

I'm going to be honest, this is not something I'm interested in. I use this plugin regularly without any issue and I'm sure a number of other people do too. It's a niche plugin but it is used by people in the community. I feel any changes to how or where this plugin is provided would needlessly impact their productivity.

If/when I or others do have an issue it's very easy for me to fix as I have commit access to this repository. I'm not interested in introducing additional steps to this workflow such as seeking approval from the SPIRV-Tools maintainers.

There are numerous examples on the internet of vim plugins with extend or replace features provided by default in vim, let alone another third party syntax file such as this.

I'm sure technicalities such as not being built by default, or having the files available as a package are trivially worked through.

The trivial thing for me, is to do nothing. This discussion has already taken more of my precious spare time than I have needed to maintain the plugin in the last year or more.

It's great to know this project is advertised by SPIR-V Tools, and honestly a surprise they felt the need to write their own script if they were aware of this.

As I mentioned before, the syntax files were developed in parallel without knowledge of each other. Any duplicated effort was entirely in the year 2016.

Conclusion

I'm going to close this ticket. I will happily fix bugs or implement features requests but I shall continue to be the sole independant maintainer of this plugin.

I appriciate you're trying to benefit the community, but I am not the one who will be doing that work. I have a suggestion which I beleive would have of greater benefit to the community, you can ignore it if you like: Take the time to upstream the SPIRV-Tools syntax file to vim.

ShabbyX commented 3 years ago

Thank you for taking the time to respond here