pith. sign in

arxiv: 1907.07764 · v1 · pith:7FAYRZIYnew · submitted 2019-07-10 · 💻 cs.PL

HTCC: Haskell to Handel-C Compiler

Pith reviewed 2026-05-24 23:02 UTC · model grok-4.3

classification 💻 cs.PL
keywords haskellhandel-cfpgacompilerhardware designtransformational derivationxtea ciphervhdl
0
0 comments X

The pith

HTCC compiles a subset of Haskell to Handel-C to generate hardware for FPGAs.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The paper describes HTCC, a compiler that translates a supported subset of Haskell into Handel-C along with VHDL, Verilog, EDIF, and SystemC outputs. It automates a transformational derivation process so that functional programs can be turned into hardware that targets FPGAs from Altera and Xilinx. The implementation uses ANTLR for the lexical, syntax, and semantic analysis stages and includes an integrated development environment. Sample translations of first-class and higher-order functions are shown, together with a full case study that compiles the XTEA cipher and measures its performance on Cyclone II, Stratix IV, and Virtex-6 devices.

Core claim

HTCC automates the transformational derivation methodology by compiling a subset of Haskell directly into Handel-C, thereby rapidly producing hardware designs that map onto FPGAs while also generating VHDL, Verilog, EDIF, and SystemC from the same source.

What carries the argument

The HTCC compiler, built with ANTLR, that performs lexical, syntax, and semantic analysis to translate Haskell into Handel-C and other hardware languages.

If this is right

  • Hardware designs can be produced directly from Haskell programs without manual rewriting into a hardware description language.
  • First-class and higher-order functions become available as building blocks inside the generated FPGA circuits.
  • The same Haskell source can be turned into multiple hardware formats and evaluated across Cyclone II, Stratix IV, and Virtex-6 FPGAs.
  • An automated derivation chain replaces hand-crafted transformational steps for the supported subset.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • Developers already comfortable with functional programming could target FPGAs without learning a separate hardware language.
  • The approach might lower the cost of exploring alternative hardware architectures by keeping the source in a high-level functional form.
  • If the subset proves too restrictive for larger designs, the compiler would need explicit extension rather than relying on the current automation.

Load-bearing premise

The supported subset of Haskell is sufficient to express complete, practical hardware designs such as the XTEA cipher without requiring features outside the subset or incurring unacceptable performance loss.

What would settle it

A complete, practical hardware design expressed in Haskell that either cannot be written inside the supported subset or that exhibits unacceptable performance loss after compilation through HTCC.

Figures

Figures reproduced from arXiv: 1907.07764 by Ahmed Ablak, Issam Damaj (American University of Kuwait).

Figure 1
Figure 1. Figure 1: The transformational derivation and refinement methodology. [PITH_FULL_IMAGE:figures/full_fig_p002_1.png] view at source ↗
Figure 2
Figure 2. Figure 2: HTCC compiler state machine. The syntax analyzer is also generated using ANTLR, where a new parse tree is constructed every compilation. ANTLR provides the required Java library to construct parse trees and to walk through them starting on the leftmost side. During the walk-through, the program being compiled is checked for any errors based-on the provided grammar to ANTLR. The third stage of HTCC compiler… view at source ↗
Figure 5
Figure 5. Figure 5: demonstrates the use-case diagram of HTCC IDE. The proposed IDE supports the following: • Editing and storing project files • Highlighting and automatic code completion • File navigation, and allows to open multiple files simul￾taneously • Running Haskell code under GHC • Compiling Haskell code to Handel-C code. Accordingly simulating Handel-C code and generating VHDL, EDIF, Verilog, and SystemC implementa… view at source ↗
Figure 6
Figure 6. Figure 6: HTCC IDE IV. COMPILER IMPLEMENTATION The following subset of Haskell grammar is part of HTCC compiler code. Here, functions are divided into decelerations (dcFun) and definitions (dFun) [PITH_FULL_IMAGE:figures/full_fig_p004_6.png] view at source ↗
Figure 7
Figure 7. Figure 7: The parse tree of function f. A subset of the lexer grammar is as following: ID : [a − zA − Z] + [0 − 9]∗ ; NL : 0\r 0 ? 0\n 0 ; ARROW : 0− >0 | 0 →0 ; WS : [\t] + → SKIP; DIGIT : [0 − 9]+; COMMENT : 0 − −0 .∗? 0\r 0 ? 0\n 0 → SKIP; V. FIRST-CLASS AND HIGHER-ORDER HASKELL FUNCTIONS HTCC can generate both first-class and higher-order func￾tions. First-class functions represent simple binary operations, whil… view at source ↗
Figure 8
Figure 8. Figure 8: A single XTEA round with its internal computational constructs. The [PITH_FULL_IMAGE:figures/full_fig_p006_8.png] view at source ↗
read the original abstract

Functional programming languages, such as Haskell, enable simple, concise, and correct-by-construction hardware development. HTCC compiles a subset of Haskell to Handel-C language with hardware output. Moreover, HTCC generates VHDL, Verilog, EDIF, and SystemC programs. The design of HTCC compiler includes lexical, syntax and semantic analyzers. HTCC automates a transformational derivation methodology to rapidly produce hardware that maps onto Field Programmable Gate Arrays (FPGAs) . HTCC is generated using ANTLR compiler-compiler tool and supports an effective integrated development environment. This paper presents the design rationale and the implementation of HTCC. Several sample generations of first-class and higher-order functions are presented. In-addition, a compilation case-study is presented for the XTEA cipher. The investigation comprises a thorough evaluation and performance analysis. The targeted FPGAs include Cyclone II, Stratix IV, and Virtex-6 from Altera and Xilinx.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

2 major / 1 minor

Summary. The paper presents HTCC, a compiler from a subset of Haskell to Handel-C (with output also in VHDL, Verilog, EDIF, and SystemC) that automates transformational derivation of hardware designs for FPGAs. It describes the compiler's lexical, syntax, and semantic analyzers (built with ANTLR), an IDE, sample translations of first-class and higher-order functions, a case study compiling the XTEA cipher, and a performance evaluation targeting Cyclone II, Stratix IV, and Virtex-6 devices.

Significance. If the compiler correctly handles a practical subset and the XTEA case study demonstrates competitive FPGA performance without manual intervention, the work would offer a concrete bridge between functional programming and hardware synthesis, potentially reducing design effort for FPGA targets. The automation of transformational derivation is a notable strength if supported by reproducible artifacts.

major comments (2)
  1. [Abstract] Abstract: The central claim that HTCC 'automates a transformational derivation methodology to rapidly produce hardware' and includes 'a thorough evaluation and performance analysis' cannot be assessed, as the text supplies no metrics, timing/area results, error rates, or verification steps for the XTEA case study or any samples.
  2. [Abstract] Abstract: No definition or grammar fragment is given for the supported Haskell subset, so it is impossible to evaluate the weakest assumption that this subset suffices for complete practical designs such as XTEA without unacceptable performance loss or missing features.
minor comments (1)
  1. [Abstract] Abstract: Typo 'In-addition' should be 'In addition'.

Simulated Author's Rebuttal

2 responses · 0 unresolved

We thank the referee for their careful reading and comments on our manuscript describing HTCC. We address the two major comments point by point below. The full paper contains a case-study section with synthesis results on the named FPGA platforms; we are prepared to strengthen the abstract and add explicit subset details if that improves clarity.

read point-by-point responses
  1. Referee: [Abstract] Abstract: The central claim that HTCC 'automates a transformational derivation methodology to rapidly produce hardware' and includes 'a thorough evaluation and performance analysis' cannot be assessed, as the text supplies no metrics, timing/area results, error rates, or verification steps for the XTEA case study or any samples.

    Authors: The manuscript body contains a dedicated XTEA case-study section that reports the generated Handel-C/VHDL/Verilog output together with synthesis results (timing and area) obtained on Cyclone II, Stratix IV and Virtex-6 devices. The abstract summarises these results; we can expand the abstract to list the concrete metrics if the referee prefers the numbers to appear there as well. revision: partial

  2. Referee: [Abstract] Abstract: No definition or grammar fragment is given for the supported Haskell subset, so it is impossible to evaluate the weakest assumption that this subset suffices for complete practical designs such as XTEA without unacceptable performance loss or missing features.

    Authors: The supported subset is defined by the lexical, syntax and semantic rules implemented in the ANTLR-generated analyzers and is exercised by the first-class/higher-order function examples plus the complete XTEA cipher. We agree that an explicit grammar fragment or enumerated language subset would make this boundary clearer and will add one in the revised version. revision: yes

Circularity Check

0 steps flagged

No significant circularity

full rationale

The paper describes the design, implementation, and evaluation of a compiler tool (HTCC) that translates a Haskell subset to Handel-C and other hardware languages, including a case study on the XTEA cipher. No derivation chain, predictions, fitted parameters, uniqueness theorems, or ansatzes are claimed or present in the abstract or described content. The work is a standard software engineering and compiler construction paper with no load-bearing steps that reduce to self-definition or self-citation by construction.

Axiom & Free-Parameter Ledger

0 free parameters · 0 axioms · 0 invented entities

Only the abstract is available; no free parameters, axioms, or invented entities can be extracted from the provided text.

pith-pipeline@v0.9.0 · 5690 in / 1170 out tokens · 30058 ms · 2026-05-24T23:02:32.025990+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Reference graph

Works this paper leans on

37 extracted references · 37 canonical work pages

  1. [1]

    Altera, “Web,” Information available from: https://www.altera.com/

  2. [2]

    Xilinx, “Web,” Information available from: http://www.xilinx.com/

  3. [3]

    mentor.com/

    MentorGraphics, “Web,” Information available from: https://www. mentor.com/

  4. [4]

    SystemC - A modeling platform supporting multiple design abstractions,

    P. R. Panda, “SystemC - A modeling platform supporting multiple design abstractions,” in Proceedings of ISSS01 , October 2001

  5. [5]

    Closing the gap between hardware and software: hardware- software cosythesis at oxford,

    I. page, “Closing the gap between hardware and software: hardware- software cosythesis at oxford,” in IEE Colloquium on Hardware- Software Cosynthesis for Reconfigurable Systems , February 1996, pp. 200–211

  6. [6]

    Higher-Level Hardware Synthesis of the KASUMI Algorithm,

    I. W. Damaj, “Higher-Level Hardware Synthesis of the KASUMI Algorithm,” Journal of Computer Science and Technology , vol. 22, no. 1, pp. 60–70, 2007. [Online]. Available: http://dx.doi.org/10.1007/ s11390-007-9007-9

  7. [7]

    Hardware synthesis of a parallel jpeg decoder from its functional specification,

    J. Hawkins and A. E. Abdallah, “Hardware synthesis of a parallel jpeg decoder from its functional specification,” in Design Methods and Applications for Distributed Embedded Systems . Springer, 2004, pp. 197–206

  8. [8]

    Formal behavioural synthesis of Handel-C parallel hardware implementation for functional specifica- tions,

    A. E. Abdallah and J. Hawkins, “Formal behavioural synthesis of Handel-C parallel hardware implementation for functional specifica- tions,” in Proceedings of the 36th annual Hawaii international con- ference on system sciences . IEEE Computer Society Press, 2003, pp. 278–288

  9. [9]

    Parallel Algorithms Development for Programmable Devices with application from cryptography,

    I. Damaj, “Parallel Algorithms Development for Programmable Devices with application from cryptography,” International Journal of Parallel Programming, vol. 35, no. issue: 6, pp. 529–572, 1st Dec. 2007, journal (Purpose), Published (Status), Elsevier Science (Publisher), New York, U.S.A. (Address), DOI: 10.1007/s10766-007-0046-1

  10. [10]

    Thompson, Haskell: The Craft of Functional Programming

    S. Thompson, Haskell: The Craft of Functional Programming. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc., 1997

  11. [11]

    Lava: Hardware Design in Haskell,

    P. Bjesse, K. Claessen, M. Sheeran, and S. Singh, “Lava: Hardware Design in Haskell,” in Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming , ser. ICFP ’98. New York, NY , USA: ACM, 1998, pp. 174–184. [Online]. Available: http://doi.acm.org/10.1145/289423.289440

  12. [12]

    C λash : from Haskell to hardware,

    C. Baaij, “C λash : from Haskell to hardware,” December 2009. [Online]. Available: http://essay.utwente.nl/59482/

  13. [13]

    Hardware synthesis in ForSyDe,

    A. ACOSTA, “Hardware synthesis in ForSyDe,” June 2007. [Online]. Available: http://people.kth.se/ ∼ingo/Papers/ThesisAlfonsoAcosta2007. pdf

  14. [14]

    Hardware design and functional programming: a perfect match

    M. Sheeran, “Hardware design and functional programming: a perfect match.” J. UCS, vol. 11, no. 7, pp. 1135–1158, 2005

  15. [15]

    On embedding a microarchitec- tural design language within haskell,

    J. Launchbury, J. Lewis, and B. Cook, “On embedding a microarchitec- tural design language within haskell,” in Proceedings of the fourth ACM SIGPLAN international conference on Functional programming . ACM Press, 1999, pp. 60–69

  16. [16]

    Specifying microprocessors in hawk,

    J. Matthews, J. Launchbury, and B. Cook, “Specifying microprocessors in hawk,” in Proceedings of the International Conference on Computer Languages. IEEE, May 1998, pp. 90–101

  17. [17]

    Hydra: hardware description in a functional language us- ing recursion equations and high order combining forms,

    J. O’Donnell, “Hydra: hardware description in a functional language us- ing recursion equations and high order combining forms,” in The Fusion of Hardware Design and Verification , G. J. Milne, Ed. Amsterdam: North-Holland, 1988, pp. 309–328

  18. [18]

    HML: An innovative hardware design language and its translation to VHDL,

    Y . Li and M. Leeser, “HML: An innovative hardware design language and its translation to VHDL,” in Conference on Hardware Design Languages, June 1995

  19. [19]

    Advanced modeling features of MHDL,

    D. Barton, “Advanced modeling features of MHDL,” in In International Conference on Electronic Hardware Description Languages , January 1995

  20. [20]

    DDD: A system for mechanized digital design derivation,

    S. Johnson and B. Bose, “DDD: A system for mechanized digital design derivation,” Indiana University, Indiana, Tech. Rep. 323, 1990

  21. [21]

    Higher-level hardware synthesis,

    R. Sharp, “Higher-level hardware synthesis,” Ph.D. dissertation, Robin- son College University of Cambridge, Cambridge, November 2002

  22. [22]

    muFP: a language for VLSI design,

    M. Sheeran, “muFP: a language for VLSI design,” in Proc. ACM Symposium on LISP and Functional Programming . ACM Press, 1984, pp. 104–112

  23. [23]

    Circuit design in ruby,

    G. Jones and M. Sheeran, “Circuit design in ruby,” In Formal Methods for VLSI design , pp. 13–70, 1990

  24. [24]

    Multi-level equivalence in design trans- formation,

    T. Cheung and G. Hellestrand, “Multi-level equivalence in design trans- formation,” in Proceedings of International Conference on Computer Hardware Description Languages , Chiba Japan, September 1996, pp. 559–566

  25. [25]

    Functional process modelling,

    A. E. Abdallah, “Functional process modelling,” Research Directions in Parallel Functional Programming, (Springer Verlag, October 1999), pp. 339–360, October 1999

  26. [26]

    Parr, The Definitive ANTLR 4 Reference , 2nd ed

    T. Parr, The Definitive ANTLR 4 Reference , 2nd ed. Pragmatic Bookshelf, 2013

  27. [27]

    Co-designs of Parallel Rijndael,

    I. Damaj, “Co-designs of Parallel Rijndael,” in The International Sym- posium on System-on-Chip . Tampere, Finland: IEEE, 1-2 November 2011, pp. 72–77

  28. [28]

    Parallel AES Development for Programmable Devices,

    ——, “Parallel AES Development for Programmable Devices,” in The Fourth IASTED International Conference on Parallel and Distributed Computing and Networks , IASTED. Innsbruck - Austria: Acta Press, February 2009

  29. [29]

    Parr, Language Implementation Patterns: Create Your Own Domain- Specific and General Programming Languages , 1st ed

    T. Parr, Language Implementation Patterns: Create Your Own Domain- Specific and General Programming Languages , 1st ed. Pragmatic Bookshelf, 2009

  30. [30]

    Adaptive LL(*) Parsing: The Power of Dynamic Analysis,

    T. Parr, S. Harwell, and K. Fisher, “Adaptive LL(*) Parsing: The Power of Dynamic Analysis,” SIGPLAN Not., vol. 49, no. 10, pp. 579–598, Oct

  31. [31]

    Available: http://doi.acm.org/10.1145/2714064.2660202

    [Online]. Available: http://doi.acm.org/10.1145/2714064.2660202

  32. [32]

    Jacobson, G

    I. Jacobson, G. Booch, J. Rumbaugh, J. Rumbaugh, and G. Booch, The unified software development process. Addison-Wesley Reading, 1999, vol. 1

  33. [33]

    D. R. Heffelfinger, Java EE 7 Development with NetBeans 8 . Packt Publishing Ltd, 2015

  34. [34]

    Efficient Tiny Hardware Cipher un- der Verilog,

    I. Damaj, S. Hamade, and H. Diab, “Efficient Tiny Hardware Cipher un- der Verilog,” in Proceedings of the 2008 High Performance Computing and Simulation Conference , 2008

  35. [35]

    Comparison of hardware and software based encryption for secure communication in wireless sensor networks,

    M. Botta, M. Simek, and N. Mitton, “Comparison of hardware and software based encryption for secure communication in wireless sensor networks,” in Telecommunications and Signal Processing (TSP), 2013 36th International Conference on , July 2013, pp. 6–10

  36. [36]

    Lightweight Cryptography for FPGAs,

    P. Yalla and J. Kaps, “Lightweight Cryptography for FPGAs,” in International Conference on Reconfigurable Computing and FPGAs, 2009, Dec 2009, pp. 225–230

  37. [37]

    Design of Efficient XTEA using Verilog,

    I. A. Shweta Gaba and D. Sujata, “Design of Efficient XTEA using Verilog,” International Journal of Scientific and Research Publications , vol. 2, June 2012. TABLE II COMPASSION AMONG SIMILAR XTEA HARDWARE IMPLEMENTATION Reference [34] [35] [36] [33] Logic elements NA 424 LUTs 1182 LUTs 539 Slices Fmax (MHz) NA NA 71.11 142.4 Total Exe. Time 2,48 ms NA 14.0...