haskell-mafia / projector

A typed, total templating language
BSD 3-Clause "New" or "Revised" License
7 stars 7 forks source link

Projector

This repository contains a few interrelated projects.

projector-core

projector-core is an implementation of a typed lambda calculus. It is based on the total fragment of the Damas-Hindley-Milner calculus, with the following features:

The projector-core package includes the syntax and type definitions, the type checker, a simplifier (normaliser), and Jack generators for well-typed and ill-typed terms.

projector-html

projector-html is a typed templating language that produces well-formed HTML, featuring:

The objective here is to provide as much actionable feedback as possible to the frontend developer mechanically, while removing a few classes of error from production. This eases code review and reduces deployment risk. If we can produce reusable and efficient code in the process, that is nice too.

Specifically, the following should no longer be possible:

A well-formed template, when rendered, should be a finite (terminating) projection from the platform's version of the data to the target platform's notion of HTML.

Backends for projector-html aim to provide reusable code in the target language, such that we can at any point just check in the generated code and walk away from this tool entirely. For example, a backend targeting Hydrant would render each template accepting a Foo as Foo -> Html.

projector-html-runtime-hs

This is a Haskell Hydrant runtime for projector-html.

This runtime is largely responsible for reexporting the right set of primitive types, and Hydrant. If the runtime is doing serious rendering work, the backend is not finished.

projector-html-runtime-purs

This is a Purescript Pux runtime for projector-html.

This runtime is largely responsible for reexporting the right set of primitive types, and Pux. If the runtime is doing serious rendering work, the backend is not finished.

Conceptual reviewers