Potential use of compiler plugins in Amethyst?

(Khionu Sybiern) #1

I’ve done little research into them, but it seems like compiler plugins might be valuable to us, especially with Linters. I’d like this thread to be for spit-balling ideas for Amethyst creating a compiler plugin.

2 Likes

(Fletcher) #2

Are these available on stable?

0 Likes

(Marco Alka) #3

No, here is the tracking issue

0 Likes

(Fletcher) #4

Using nightly does not spark joy for me. =)

0 Likes

(Jaynus) #5

What features exactly are we looking to gain from a compiler plugin vs. a proc macro? Custom language extensions?

0 Likes

(Khionu Sybiern) #6

This is one thing, sure. We can make more complicated patterns simplified. But one of the primary things I was thinking about was the ability to add custom warnings in the form of lints.

Additionally, we could make failing to register Components a compiler error. We could add to build procedure, such as embedding static asset files, and have it be recognized by RLS/CLion. We could parse input.ron files to generate an Enum of Actions, before build.

2 Likes

(99ViperTooth) #7

A UI plugin in the Editor, or some binary plugins? have to agree with [jaynus] if it can speed
things up… unofficial plugins? but to compile and update those binaries though…

0 Likes

#8

The only issue with plugins is that in the linked thread they said that plugins will be deprecated in favor of macros 2.0, also about this point I will like to stick to the idea proposed by @Xaeroxe here and it’s the usage of macros. I must admit that my experience with macros is pretty limited/nonexistent almost, so I cannot say if is feasible or not to do that way, but seems that having more macros that simplifies the day to day workflow is the way to go.

0 Likes