Choosing hmlt as an identifier and file extension is pretty funny and feasibly a troll. Maybe hlet or hamlt would have been more obviously not html.
Hamlet: A type-safe Haml template engine for Go
21–30 of 42 posts
Re: Hamlet: A type-safe Haml template engine for Go
#22That's great; Haml is one thing I like most when doing web development on Ruby/Rails. The only thing I don't like about this implementation is the blocks with inline code: - if user != nil { %strong The user exists - }
1. https://github.com/ruby/syntax_suggest/blob/main/lib/syntax_...
Re: Hamlet: A type-safe Haml template engine for Go
#23The biggest problem with Haml is probably that it's really difficult to write a tree-sitter parser for it. In this case, you would have to parse both haml, go, CSS and JavaScript and be aware of indentation.
Re: Hamlet: A type-safe Haml template engine for Go
#24Earlier quoted context omitted.
Why invent a new language so you don't have to close tags? Do I miss something?
sure, I guess lighting the house with fire also works!
Re: Hamlet: A type-safe Haml template engine for Go
#25Re: Hamlet: A type-safe Haml template engine for Go
#26Earlier quoted context omitted.
sure, I guess lighting the house with fire also works!
In my experience, adding a layer between you and what you are doing adds a potential layer to every bug, and a layer to what new developers need to learn. That needs a lot of justification.
As for adding a layer to what devs needs to learn - that's why I don't generally use this at work. In those situations you often need to pick the most common tools and not the best tools.
Re: Hamlet: A type-safe Haml template engine for Go
#27I appreciate that in JSX, functions can be used as if they were first-class elements. In this case that would be accomplished by supporting the following instead: @hmlt HomePage() { %SiteLayout %p This is the home page for Hamlet. } Which is much cleaner IMO.
Re: Hamlet: A type-safe Haml template engine for Go
#28I appreciate that in JSX, functions can be used as if they were first-class elements. In this case that would be accomplished by supporting the following instead: @hmlt HomePage() { %SiteLayout %p This is the home page for Hamlet. } Which is much cleaner IMO.
Because JSX is just document.createElement() with syntax sugar. If Haml has an equivalent api, there should be a way to implement something similar.
Re: Hamlet: A type-safe Haml template engine for Go
#29Earlier quoted context omitted.
In my experience, adding a layer between you and what you are doing adds a potential layer to every bug, and a layer to what new developers need to learn. That needs a lot of justification.
True, but almost no one is writing HTML anymore. So if I'm anyway post-processing my tsx / jsx / vue / whatever files, I might was well use a language that's great. As for adding a layer to what devs needs to learn - that's why I don't generally use this at work. In those situations you often need to pick the most common tools and not the best tools.
JSX?
Re: Hamlet: A type-safe Haml template engine for Go
#30The example has left me with a strong impression I should avoid this and HAML. That syntax frightens me.
It looks unnecessary. The syntax is ugly and by looking at the examples I can’t say what problem it is supposed to solve.
"Haml accelerates and simplifies template creation" https://haml.info/
If you'd rather write raw HTML, keeping track of closing tags etc, then don't use HAML. No need to bash it because you personally feel it is ugly or unnecessary. FWIW I personally feel the exact opposite.