The main building block in TW are widgets.
Widgets came first and then macros have been implemented, later in the process. We are talking about TW versions prior to 5.0.0-alpha.11, which is the first one published.
Macros have always been syntactical sugar for the <$macrocall widget. Which means, for the TW core internally everything is converted into widgets.
Syntactic sugar
In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language “sweeter” for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer. Syntactic sugar is usually a shorthand for a common operation that could also be expressed in an alternate, more verbose, form: The programmer has a choice of whether to use the shorter form or the longer form, but will usually use the shorter form since it is shorter and easier to type and read.
With TW v5.3.0 macros have been superseded by
- procedures
- functions
- custom-widgets
TW docs Custom Widgets
[New in v5.3.0] A custom widget is a special kind of procedure that can be called using the same syntax as widgets.
- It allows users to create their own wikitext widgets which follow the core widget refresh cycle
- It allows users to overwrite core widgets.
TW docs Procedures
[New in v5.3.0] A procedure is a named snippet of text. They are typically defined with the Pragma: \procedure:
- Procedures basically replace macros.
- They are more robust and most of the times more performant.
TW docs Functions
New in v5.3.0 A function is a named snippet of text containing a Filter Expression. Functions can have named parameters which are available within the function as variables.
- Functions are a new mechanism to work with filter expressions.
- Filter expressions can be used like variables
Conclusion
Procedures and Functions are still syntactical sugar. But now for the transclude-widget, which internally is used to “display” things.
Custom-Widgets are also “syntactical sugar” – “not sweet”, because they looks like a widgets.
In the end all of them are converted into transclude-widgets.
Hope that helps
Mario

My point is merely that IF things are fully started over then why not use the more elegant syntax if it works as well.




)
I think of widgets as building blocks providing the underlying functionality, whereas macros/procedures are largely shortcuts — many of which also contain one (or many!) widgets. I try to convert any bit of code I’m likely to reuse into a procedure, so I use the

