Idea: Creating static html the (obvious ?) way

I think this is a separate question than the original question of whether Elm should be concerned about rendering HTML with no JS in the specific use case where you have main : Html msg. I’ll set aside the question of whether it would make sense for Elm to provide the ability to include head tags in pure Elm so that the conversation doesn’t go off in too many directions.

Both elmstatic and elm-pages have ways to include <head> tags. Both of those frameworks accomplish that through the use of ports, so really the sky is the limit for what you can encapsulate as a framework author there. If you wanted to, you could use one of those frameworks to build your tool. Or you could see how those codebases implemented it for inspiration for a new tool. The basic building blocks are there already, though, it’s more a matter of taking the time to put them together and encapsulating things in a framework.

I’m not sure I’m understanding how WebAssembly would change the situation. It seems like you’re describing some functionality like Server-Side Rendering now, but I’m not quite sure what use case you have in mind. SSR is another separate topic. Whether or not Elm builds in SSR functionality, I think that’s a separate issue from whether it should render different output if you have a main : Html msg.

My perspective on that particular question is that the Elm compiler is a tool for compiling and outputting Elm code. If an app happens to use this specific feature of Elm of having main : Html msg, I still see Elm’s job as building the Elm code that would generate. If you want the specific problem solved to get pure HTML from an Elm module like that, then Elm already gives us the building blocks we need to accomplish that.

The questions of whether it would make sense for The Elm platform providing a way to define <head> tags in Elm, or do Server-Side Rendering, are interesting topics. But I think they’re separate from the original question. There was some discussion about SSR recently.

Anyway, hope that helps. If you decide to do some work exploring building a framework like that, I’d be happy to answer questions from what I’ve learned building similar features for elm-pages.