THT is in early Beta. We welcome contributors & feedback.
A new web language with the convenience of PHP.
  • Runs on PHP.THT auto-compiles to PHP, which means it's quick and available on nearly every platform & web host.
  • Easier to Use.THT has a familiar JavaScript-like syntax, clear error messages, and an organized standard library.
  • Easy to Run.Just edit your files and refresh. There are no extra build steps. The final code is cached for speed.
  • Web Framework.THT includes essential features like routing, templating, and Markdown.
  • More Secure.By default, THT protects against the most common web vulnerabilities, like XSS and SQL injection.

A Quick Look 

// THT has a familiar JavaScript-like syntax.
let colors = ['red', 'blue'];
colors.add('yellow');

// The Web module has methods for common tasks,
// like returning a complete HTML5 document.
Web.sendPage({
    title: 'Primary Colors',
    body:  bodyHtml(colors),
});

// Template functions let you include HTML in your
// scripts. Logic is just THT, escaped & sandboxed.
// Note the optional HTML shortcuts.
template bodyHtml(colors) {

    <h1>Primary Colors</>
    <ul>
    :: for (color in colors) {
        <li>{{ color.toUpperCaseFirst() }}</>
    :: }
    </>

}

Built on PHP (The Good Parts) 

You don’t need to know PHP to use THT.

When you update your THT code, it’s automatically transpiled to PHP. No extra steps are necessary — just edit and refresh.

Because it’s cached, your site is always running the final PHP code.

Each page request follows the same “share nothing” approach that makes PHP apps easy to reason about.

For a full comparison, see How THT compares to PHP.

Web Framework 

THT includes almost everything you need for a modern website:

Security 

By default, THT defends against the most common security risks.

Some of the improvements over standard PHP:

Performance 

Out of the box, PHP is more than fast enough for most apps. But you can benefit even more by the speed gains in PHP 7, or an opcode cache like APC.

THT provides a built-in Perf module to identify any performance bottlenecks in your app (usually database calls).

Q: Why should I use THT? 

You might like THT if you appreciate the convenience & simplicity of PHP, but don’t want to deal with the idiosyncrasies and pitfalls that come with it.

You might also want a JavaScript-like language for server-side development, but without the complexity of Node.js.

At this early stage, THT is probably best for single-server web apps. This includes anything you would run on a shared web host. (e.g. content-driven sites, blogs, forums, home pages, etc.)

It aims to be useful for programmers of all levels: From novices with a little programming experience, to experienced programmers looking for a quick web development tool.

Give It a Try 

THT is still in Beta, but if you’d like to try it out, it’s already capable of making basic web apps.

Check out the Get Started page.