Changes between Version 4 and Version 5 of Ticket #1580


Ignore:
Timestamp:
Mar 13, 2010 8:57:21 AM (4 years ago)
Author:
tibbe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1580 – Description

    v4 v5  
     1= Motivation = 
     2 
     3Being both fast and safe, Haskell would make a great replacement for e.g. Python and Ruby for server applications. However, good library support for web applications is sorely missing. To write web applications you need at least three components: a web application server, a data storage layer, and an HTML generation library. The goal of this project is to address the last of the three, as the two  are already getting some attention from other Haskell developers. 
     4 
     5= Introduction = 
     6 
    17Almost all web applications need to generate HTML for rendering in the user's browser. The three perhaps most important properties in an HTML generation library are: 
    28 
    3     * High performance: Given that the network introduces a lot of latency the server is left with very little time to create a response to send back to the client. Every millisecond not spent on generating HTML can be used to process the user's request. Furthermore, efficient use of the server's resources is important to keep the number of clients per server high and costs per client low. 
     9 * High performance: Given that the network introduces a lot of latency the server is left with very little time to create a response to send back to the client. Every millisecond not spent on generating HTML can be used to process the user's request. Furthermore, efficient use of the server's resources is important to keep the number of clients per server high and costs per client low. 
    410 
    5     * Correctness: Incorrectly created HTML can result in anything from incorrect rendering (in the best case) to XSS attacks (in the worst case). 
     11 * Correctness: Incorrectly created HTML can result in anything from incorrect rendering (in the best case) to XSS attacks (in the worst case). 
    612 
    7     * Composability: Being able to create small widgets and reuse them on several pages fosters consistency in the generated output and helps both correctness and reuse. (Being able to treat HTML fragments as values rather than as strings is important.) 
     13 * Composability: Being able to create small widgets and reuse them on several pages fosters consistency in the generated output and helps both correctness and reuse. (Being able to treat HTML fragments as values rather than as strings is important.) 
    814 
    915Combinator libraries, like the [http://hackage.haskell.org/package/html html package] on Hackage, address the the last two criteria by making the generated HTML correct by construction and making HTML fragments first class values. Traditional templating systems generally have the first property, offering excellent performance, but lacks the other two. 
     
    1521= Non-Goals = 
    1622 
    17     * Using the very latest type system features to ensure well-formedness. This is not a research project; The goal is to create a production quality library using know techniques. 
     23 * Using the very latest type system features to ensure well-formedness. This is not a research project; The goal is to create a production quality library using know techniques. 
    1824 
    19     * Integrating with [http://hackage.haskell.org/package/formlets formlets]. 
     25 * Integrating with [http://hackage.haskell.org/package/formlets formlets]. 
    2026 
    2127= Tasks = 
    2228 
    23     1. Write an initial implementation based on the API in `Text.Html` (skip `Text.Html.BlockTable`) but with an more predictable naming scheme for combinators. For example, all combinators should have the same name as their HTML counterparts except when they collide with reserved words in which case an "_" is appended. 
     29 1. Write an initial implementation based on the API in `Text.Html` (skip `Text.Html.BlockTable`) but with an more predictable naming scheme for combinators. For example, all combinators should have the same name as their HTML counterparts except when they collide with reserved words in which case an "_" is appended. 
    2430 
    25     Move the attribute combinators into `Text.Html.Attribute` and use namespaces instead of function prefixes to resolve name collisions. 
     31 Move the attribute combinators into `Text.Html.Attribute` and use namespaces instead of function prefixes to resolve name collisions. 
    2632 
    27     2. Write a test suite and a benchmark suite. 
     33 2. Write a test suite and a benchmark suite. 
    2834 
    29     3. With the support of the test and benchmark suite, optimize the performance of the library. Perhaps using tools like [http://hackage.haskell.org/package/ghc-core ghc-core] to study the generated code. 
     35 3. With the support of the test and benchmark suite, optimize the performance of the library. Perhaps using tools like [http://hackage.haskell.org/package/ghc-core ghc-core] to study the generated code. 
    3036 
    31     4. Document the API extensively, using Haddock. Include usage examples at the top of the module. 
     37 4. Document the API extensively, using Haddock. Include usage examples at the top of the module. 
    3238 
    3339= Tools = 
    3440 
    35     * [http://hackage.haskell.org/package/quickcheck QuickCheck] for testing, 
    36     * [http://hackage.haskell.org/package/criterion Criterion] for benchmarking, and 
    37     * [http://hackage.haskell.org/package/haddock Haddock] for documenting. 
     41 * [http://hackage.haskell.org/package/quickcheck QuickCheck] for testing, 
     42 * [http://hackage.haskell.org/package/criterion Criterion] for benchmarking, and 
     43 * [http://hackage.haskell.org/package/haddock Haddock] for documenting. 
    3844 
    3945= Interested Mentors = 
    4046 
    41     * Johan Tibell 
     47 * Johan Tibell 
     48 
     49= FAQ = 
     50 
     51 * Q: Why not use a templating language? 
     52 
     53 * A: While popular, templating languages suffer from a number of problems: 
     54   * Lack of abstraction features to address code and HTML duplication. Templating languages tend to become (poor) general purpose languages over time. 
     55   * Security issues related to leaving proper escaping to the user. 
     56   * Well-formedness issues due to representing HTML as string fragments rather than first class values. 
     57   * Reuse issues due to not treating HTML as first class values (i.e. reuse is achieved by textual inclusion rather than composition).