On Monday, 13 December 2021 at 16:59:47 UTC, Adam D Ruppe wrote:
>On Monday, 13 December 2021 at 16:40:31 UTC, Ola Fosheim Grøstad wrote:
>I would prefer something like sql"…"
, css"…"
etc.
How would you implement those?
That really depends on what your philosophy is. I've given some hints above. What do you want to achieve?
-
better IDE support?
-
total control in metaprogramming for each application?
-
types that are shared between libraries (E.g. multiple frameworks using the same sql-literal)
-
solid error messages from the compiler without libraries having to go out of their way to provide it?
If you want 1, 3, 4 then you probably should consider using a validating grammar in the compiler. If you want 2, then you can make it a type like I suggested above.