# valderman/haste-compiler

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/valderman-haste-compiler).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

1,482 stars · 107 forks · Haskell · BSD-3-Clause

## Links

- GitHub: https://github.com/valderman/haste-compiler
- Homepage: http://haste-lang.org
- awesome-repositories: https://awesome-repositories.com/repository/valderman-haste-compiler.md

## Topics

`compiler` `ghc` `haskell` `javascript` `language` `web`

## Description

Haste-compiler is a source-to-source compiler and web framework that translates Haskell source code into JavaScript programs for execution in web browsers and server environments. It enables the creation of unified web applications from a single type-safe codebase, automatically generating communicating client and server binaries while preserving static type guarantees across tiers.

The system translates high-level code through an existing compiler infrastructure paired with custom code generators, supported by an AST-based optimization and minification pipeline for producing lean deployment assets. It incorporates file-extension-based module resolution to handle platform-specific dependencies automatically during the build phase. 

Integration capabilities include binding native script functions and exporting compiled routines to interact with external environments, alongside browser API bindings for low-level document manipulation, canvas rendering, local storage, and networking. The runtime environment supports concurrent execution and low-level memory handling through unboxed and byte arrays, while bundled command-line utilities manage package dependencies and standard library configuration.

## Tags

### Programming Languages & Runtimes

- [Source Code Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers.md) — Translates high-level functional code into efficient JavaScript programs for browsers and command lines. ([source](https://github.com/valderman/haste-compiler#readme))
- [Haskell Compilation](https://awesome-repositories.com/f/programming-languages-runtimes/haskell-compilation.md) — Converts Haskell source code into efficient JavaScript programs for execution in browsers and servers.
- [AST Optimizations](https://awesome-repositories.com/f/programming-languages-runtimes/ast-optimizations.md) — Applies optimizations to abstract syntax trees to eliminate dead code and simplify logic.
- [JavaScript Interoperability](https://awesome-repositories.com/f/programming-languages-runtimes/javascript-interoperability.md) — Exchanges data and invokes functions between compiled functional programs and the native JavaScript runtime. ([source](https://github.com/valderman/haste-compiler#readme))
- [Foreign Function Interfaces](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/foreign-function-interfaces.md) — Binds native script functions and exports compiled routines to integrate with external environments.

### Software Engineering & Architecture

- [Client-Server Architecture](https://awesome-repositories.com/f/software-engineering-architecture/client-server-architecture.md) — Generates communicating client and server binaries from a single unified codebase. ([source](https://github.com/valderman/haste-compiler#readme))
- [GHC-Based Translators](https://awesome-repositories.com/f/software-engineering-architecture/syntax-tree-analysis/source-to-source-translation/ghc-based-translators.md) — Translates high-level functional source code into optimized JavaScript scripts via custom code generators.
- [Type-Safe Interface Architectures](https://awesome-repositories.com/f/software-engineering-architecture/type-safe-interface-architectures.md) — Preserves static type guarantees across client and server tiers from a single program.

### Web Development

- [Full-Stack Web Development](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/full-stack-frameworks/full-stack-web-development.md) — Enables writing client and server logic within a single type-safe codebase.
- [Type-Safe Web Frameworks](https://awesome-repositories.com/f/web-development/type-safe-web-frameworks.md) — Builds unified web applications with shared type-safe logic across client and server tiers.

### Part of an Awesome List

- [Web API Integration](https://awesome-repositories.com/f/awesome-lists/devtools/web-api-integration.md) — Interacts directly with modern browser features including WebSockets, local storage, canvas rendering, and the DOM. ([source](https://github.com/valderman/haste-compiler/blob/master/README.md))

### DevOps & Infrastructure

- [Production Asset Optimizations](https://awesome-repositories.com/f/devops-infrastructure/cicd-pipeline-automation/core-build-engines/build-optimization/production-asset-optimizations.md) — Generates lean deployment assets by stripping unnecessary code and optimizing compilation outputs. ([source](https://github.com/valderman/haste-compiler/blob/master/README.md))
