LLMpediaThe first transparent, open encyclopedia generated by LLMs

Haml

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Rails (web framework) Hop 4
Expansion Funnel Raw 50 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted50
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
Haml
NameHaml
ParadigmDeclarative, template
DesignerDevon Akmon, Hampton Catlin
DeveloperHampton Catlin, Chris Eppstein
First appeared2006
TypingN/A
Influenced byHTML, Ruby (programming language), Sass (stylesheet language), ERB
LicenseMIT License

Haml Haml is a templating language for producing HTML that emphasizes indentation and minimal syntax. It was created to streamline view generation in Ruby on Rails, influenced by Sass (stylesheet language), Slim (template engine), and ERB, and has been used alongside frameworks and tools such as Sinatra (web framework), Middleman (static site generator), Jekyll, and Nanoc (static site generator). Implementations and ports exist across ecosystems including Node.js, Python (programming language), PHP, and Java.

History

Haml originated in 2006, attributed to developers including Hampton Catlin and Devon Akmon, emerging contemporaneously with template systems like ERB, Liquid (template language), Smarty (template engine), and Jinja (template engine). Early adoption clustered around Ruby on Rails projects and communities such as GitHub, RubyGems, and conferences like RailsConf and RubyConf. Over time Haml influenced and was influenced by languages and tools such as Sass (stylesheet language), Slim (template engine), Mustache (logic-less template), and Handlebars.js, as web development practices shifted toward client-side frameworks like AngularJS, React (JavaScript library), and Vue.js.

Design and Syntax

Haml’s design emphasized readability and DRY principles familiar to users of Ruby (programming language), YAML, Python (programming language), and Sass (stylesheet language). The syntax uses indentation rather than explicit closing tags, resembling syntaxes used in Haml-influenced tools and in languages created by authors associated with projects like Hampton Catlin and contributors active on platforms such as GitHub and Stack Overflow. Typical constructs map to HTML elements, attributes, and content while integrating with Ruby code, helpers from ActionView (Rails), and template conventions found in ERB and Slim (template engine). Haml supports shorthand for classes and IDs inspired by CSS selectors conventions popularized alongside Bootstrap (front-end framework) and Foundation (framework).

Implementation and Usage

Haml implementations exist in multiple languages: the reference Ruby implementation integrates with Ruby on Rails, Rack, and Sinatra (web framework), while ports and adapters target Node.js, Python (programming language), PHP, and Java, often appearing in ecosystems like npm, PyPI, Packagist, and Maven Central Repository. Usage patterns include server-side view rendering in Ruby on Rails applications, static site generation with Middleman (static site generator), and embedding within content management systems comparable to WordPress. Tooling support has been provided by editors and IDEs including Vim, Emacs, Visual Studio Code, and Sublime Text, with community packages and plugins distributed via GitHub and package registries.

Features and Extensions

Haml offers features such as implicit tag nesting, shorthand class and ID notation, attribute interpolation, and integration with Ruby helpers from ActionView (Rails) and libraries like ActiveSupport. Extensions and related projects include engines and compilers that transpile to HTML, integrations with asset pipelines like Sprockets, preprocessors influenced by Sass (stylesheet language), and alternative template engines such as Slim (template engine), Liquid (template language), and Mustache (logic-less template). Community-developed plugins often target interoperability with web frameworks like Sinatra (web framework), static site tools like Jekyll and Middleman (static site generator), and deployment platforms such as Heroku and Netlify.

Adoption and Criticism

Adoption peaked among Ruby on Rails developers, contributors on GitHub, and maintainers of projects using RubyGems and Bundler. Haml is often compared to engines like ERB, Slim (template engine), Liquid (template language), Mustache (logic-less template), and client-side approaches exemplified by React (JavaScript library) and AngularJS. Critics point to whitespace sensitivity issues similar to debates around Python (programming language) and YAML, performance considerations when compared to minimal engines like ERB, and challenges integrating with tooling in polyglot stacks involving Node.js and Java. Proponents highlight readability gains reminiscent of Sass (stylesheet language) and reduced boilerplate used in projects maintained on platforms such as GitHub and showcased at conferences like RailsConf.

Category:Template engines