将MVVM模式适应于C++前端和基于Agda的后端
Adapting the MVVM pattern to C++ frontends and Agda-based backends
AI总结:
本文提出了一种通用方法,将MVVM架构应用于函数式语言实现的模型,结合软件开发工具包,解决C++与Agda/Haskell后端交互中的问题,并提供新的Haskell未来设计及基准测试证明。
摘要:
使用agda2hs和特定的Haskell FFI绑定,用C++编写带有Agda或Haskell后端(可能包含正确性证明)的Qt应用程序已成可能。然而,缺乏可重复的方法来实现这一点,以及如何在Agda代码中使用任意的Haskell内置库。我们提出了一种详尽记录的通用方法,应用MVVM架构的理念到函数式语言实现的模型中。这通过提供易于安装和自动编译的软件开发工具包进行增强。针对出现的障碍,我们提供了解决方案和想法,这些本身是新的贡献。我们描述并比较了在Agda代码中使用任意Haskell内置库的解决方案,突出其优缺点。此外,为用户中断,我们提出了一种新的Haskell未来设计,据我们所知,这是首次提供任意中断以及通过直接FFI调用从C和C++进行中断的方案。最后,我们通过基准测试证明,基于我们方法的基础agda2hs编译器在与其他解决方案(如Rocq的OCaml提取功能和Agda的默认MAlonzo后端)比较时是可行的。
英文摘要:
Using agda2hs and ad-hoc Haskell FFI bindings, writing Qt applications in C++ with Agda- or Haskell-based backends (possibly including correctness proofs) is already possible. However, there was no repeatable methodology to do so, nor to use arbitrary Haskell built-in libraries in Agda code. We present a well-documented, general methodology to address this, applying the ideas of the Model-View-ViewModel architecture to models implemented in functional languages. This is augmented by a software development kit providing easy installation and automated compilation. For obstacles arising, we provide solutions and ideas that are novel contributions by themselves. We describe and compare solutions for using arbitrary Haskell built-ins in Agda code, highlighting their advantages and disadvantages. Also, for user interruption, we present a new Haskell future design that, to the best of our knowledge, is the first to provide for arbitrary interruption and the first to provide for interruption via direct FFI calls from C and C++. Finally, we prove with benchmarks that the agda2hs compiler at the base of our methodology is viable when compared to other solutions, specifically to the OCaml extraction feature of Rocq and the default MAlonzo backend of Agda.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。