[论文解读] Towards Hybrid Intensional Programming with JLucid, Objective Lucid, and General Imperative Compiler Framework in the GIPSY
本文提出了一种混合内涵式编程框架,将 JLucid、Objective Lucid 和通用命令式编译器框架整合至 GIPSY 系统中,实现了在内涵式程序中无缝使用 Java 代码和对象。该框架引入了用于生成顺序线程和通信过程的编译器,支持数组和面向对象的构造,并为将 C 和 Fortran 等命令式语言编译为 GIPSY 兼容组件提供了可重用的基础设施,显著提升了在分布式、按需驱动计算环境中的表达能力和互操作性。
Pure Lucid programs are concurrent with very fine granularity. Sequential Threads (STs) are functions introduced to enlarge the grain size; they are passed from server to workers by Communication Procedures (CPs) in the General Intensional Programming System (GIPSY). A JLucid program combines Java code for the STs with Lucid code for parallel control. Thus first, in this thesis, we describe the way in which the new JLucid compiler generates STs and CPs. JLucid also introduces array support. Further exploration goes through the additional transformations that the Lucid family of languages has undergone to enable the use of Java objects and their members, in the Generic Intensional Programming Language (GIPL), and Indexical Lucid: first, in the form of JLucid allowing the use of pseudo-objects, and then through the specifically-designed the Objective Lucid language. The syntax and semantic definitions of Objective Lucid and the meaning of Java objects within an intensional program are provided with discussions and examples. Finally, there are many useful scientific and utility routines written in many imperative programming languages other than Java, for example in C, C++, Fortran, Perl, etc. Therefore, it is wise to provide a framework to facilitate inclusion of these languages into the GIPSY and their use by Lucid programs. A General Imperative Compiler Framework and its concrete implementation is proposed to address this issue.
研究动机与目标
- 将 Java 代码和对象的一流支持扩展至 Lucid 家族的内涵式语言中,实现在分布式系统中的混合编程。
- 设计并实现一个通用命令式编译器框架(GICF),支持将命令式代码(如 C、C++、Fortran)编译为 GIPSY 兼容的顺序线程和通信过程。
- 通过 Objective Lucid 和 JLucid 扩展,在内涵式程序中支持数组操作和面向对象编程构造(如点记法、对象实例化)。
- 在 GIPSY 的内涵式编程模型中重用现有用命令式语言编写的科学与工具库。
- 为在分布式、按需驱动执行环境中实现混合内涵式编程,提供可扩展、可伸缩且安全的基础设施。
提出的方法
- 设计并实现 JLucid,一种将 Java 方法直接嵌入 Lucid 程序的语言扩展,使用预处理器和基于抽象语法树(AST)的编译技术,生成顺序线程(STs)和通信过程(CPs)。
- 定义 Objective Lucid 作为 JLucid 的超集,支持一等面向对象构造,包括对象实例化、通过点记法调用方法以及对象数组,其语义映射至内涵式执行模型。
- 设计通用命令式编译器框架(GICF),抽象化命令式语言编译器,通过通用接口和 JNI 集成支持多种语言的插件式编译,特别支持 C/C++。
- 利用 Java 反射和 JNI 技术,在 GIPSY 运行时动态加载并执行编译后的命令式代码作为顺序线程(STs),通过通用执行引擎(GEE)实现按需执行。
- 集成 GIPSY 类型系统和语义分析器,确保内涵式与命令式组件之间类型安全和正确数据流。
- 实现基于 Web 的前端(WebEditor)和命令行接口,以支持混合程序的交互式开发与测试。
实验结果
研究问题
- RQ1如何在保持 Lucid 的声明式、按需驱动执行模型的前提下,无缝集成 Java 代码至内涵式程序?
- RQ2在内涵式编程模型中支持面向对象构造(如方法和字段)的语义与句法要求是什么?
- RQ3如何设计一个通用的编译器框架,以在 GIPSY 生态系统中支持多种命令式语言(如 C、Fortran)?
- RQ4在分布式环境中,组合内涵式逻辑与命令式代码时,如何确保类型安全和正确数据流?
- RQ5如何在不牺牲性能或正确性的情况下,重用现有用命令式语言编写的科学库?
主要发现
- JLucid 编译器成功从嵌入的 Java 代码生成可执行的顺序线程和通信过程,实现了在 GIPSY 系统中的混合执行。
- Objective Lucid 支持完整的面向对象编程构造,包括对象实例化、通过点记法调用方法以及对象数组,其语义已正式定义并集成至内涵式模型。
- 通用命令式编译器框架(GICF)支持将命令式语言编译为 GIPSY 兼容组件,已实现基于 JNI 的 C 语言工作原型,但完整实现仍为未来工作。
- 该框架支持 JLucid 和 Objective Lucid 中的数组操作,数组被视为一等内涵式值,并映射至原生数据结构。
- 通过将 Java 代码嵌入 JLucid 程序,系统实现了对现有库(如 MARF 的 FFT 实现)的重用,如快速傅里叶变换案例研究所示。
- 语义规则和 GIPSY 类型系统的正式验证正在进行中,初步工作基于 PVS 和 Isabelle,表明已具备形式化正确性保证的路径。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。