首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 15 毫秒
1.
The flexibility offered by dynamically typed programming languages has been appropriately used to develop specific scenarios where dynamic adaptability is an important issue. This has made some existing statically typed languages gradually incorporate more dynamic features to their implementations. As a result, there are some programming languages considered hybrid dynamically and statically typed. However, these languages do not perform static type inference on a dynamically typed code, lacking those common features provided when a statically typed code is used. This lack is also present in the corresponding IDEs that, when a dynamically typed code is used, do not provide the services offered for static typing. We have customized an IDE for a hybrid language that statically infers type information of dynamically typed code. By using this type information, we show how the IDE can provide a set of appealing services that the existing approaches do not support, such as compile-time type error detection, code completion, transition from dynamically to statically typed code (and vice versa), and significant runtime performance optimizations. We have evaluated the programmer׳s performance improvement obtained with our IDE, and compared it with similar approaches.  相似文献   

2.
Lua是一种小巧的脚本语言,它的易扩展性与整合性,使得它可以与别的语言很好的融合在一起,实现各种各样的需求,因此它的应用非常的广泛.本文利用Lua脚本语言与标准C语言相结合,在Linux操作系统上设计并实现了一个轻量级的Web服务器程序.Lua脚本语言的引入,使Web服务器不仅易于配置和安装,而且可以在那些无法负担IIS的主机上顺畅地运行;还进一步提高了服务器的运行速度,并增强了服务器的灵活性和扩展性.  相似文献   

3.
Goals of flexibility and re-usability in typed object-oriented languages suggest the requirement of double dispatch, i.e., the mechanism of dynamically selecting a method not only according to the run-time type of the receiver (single dispatch), but also to the run-time type of the argument. However, many mainstream languages, such as, e.g., C++ and Java, do not provide it, resorting to only single dispatch. In this paper we present a general technique for adding double dispatch as a type-safe language feature, so yielding dynamic overloading and covariant specialization of methods, without extending basic semantics. To this aim we introduce a toy core language, extended to a full form of (non encapsulated) multi methods. Then we define a translation algorithm from multi methods to the core language, that implements double dispatch by using only standard mechanisms of static overloading and single dispatch. As a main feature, our translation preserves type safety, it uses neither RTTI nor type downcasts and does not introduce crucial overhead during method selection.  相似文献   

4.
针对变电站中采用UART串口通信规约进行信息传递的各种外围设备,在需要与其进行通信的IED智能装置的开发中,设计了一种基于Lua脚本语言的嵌入式通信方案。通过该方案,可将具体串口报文规约的组建和解析交给Lua脚本进行处理,使设计者在具体装置的软件开发中,仅关注其与外围设备以及Lua脚本间交互接口的设计,而不用关心具体的串口通信规约,从而提供了一种装置串口通信的现场可配置化方案,提高了装置应用的灵活性。  相似文献   

5.
动态脚本语言Lua与C++交互方法的研究与实现   总被引:1,自引:0,他引:1  
针对当前利用C++开发大型复杂程序代价高、周期长的问题,为了充分发挥Lua动态脚本语言的特点。重点探讨了如何在Lua脚本中模拟消息事件机制和Lua访问C++接口的具体实现方法以及Lua调试器的设计方案。  相似文献   

6.
7.
脚本语言Lua小巧高效,能与C/C++语言自然的结合与交互,其设计目的是为了嵌入应用程序中,从而为应用程序提供灵活的扩展和定制功能,让客户在游戏中设计自己的客户端脚本,制作特殊的游戏逻辑插件。  相似文献   

8.
Lua在TD-SCDMA网络测试仪中的应用   总被引:1,自引:1,他引:0       下载免费PDF全文
代贝  雒江涛 《计算机工程》2010,36(1):265-266
传统网络测试仪采用xml或ini配置文件实现消息过滤功能,针对时分同步码分多址接入(TD-SCDMA)网络测试仪需要支持复杂组合逻辑条件的消息过滤功能,采用Lua脚本语言,通过在宿主程序中调用Lua函数和向Lua脚本注册C函数来实现该功能。测试结果表明,方案较好地满足了仪表的功能需求,达到了预期目标。  相似文献   

9.
10.
11.
Although static typing provides undeniable benefits for the development of applications, dynamically typed languages have become increasingly popular for specific scenarios. Since each approach offers different benefits, the StaDyn programming language has been designed to support both dynamic and static typing. This paper describes the minimal core of the StaDyn programming language. Its type system performs type reconstruction over both dynamic and static implicitly typed references. A new interpretation of union and intersection types allows statically gathering the type information of dynamic references, which improves runtime performance and robustness. The evaluation of the generated code has shown how our approach offers an important runtime performance benefit.  相似文献   

12.
Agent-oriented programming techniques seem appropriate for developing systems that operate in complex, dynamic, and unpredictable environments. We aim to address this requirement by developing model-checking techniques for the (automatic or semiautomatic) verification of rational-agent systems written in a logic-based agent-oriented programming language. Typically, developers apply model-checking techniques to abstract models of a system rather than the system implementation. Although this is important for detecting design errors at an early stage, developers might still introduce errors during coding. In contrast, developers can directly apply our model-checking techniques to systems implemented in an agent-oriented programming language, automatically verifying agent systems without the usual gap between design and implementation. We developed our techniques for AgentSpeak, a rational-agent programming language based on the AgentSpeak (L) abstract agent-oriented programming language. AgentSpeak shares many features of the agent-oriented programming paradigm. Similarly, we've developed techniques for automatically translating AgentSpeak programs into the model specification language of existing model-checking systems. In this way, we reduce the problem of verifying that an AgentSpeak system has certain BDI logic properties to a conventional LTL model-checking problem.  相似文献   

13.
This paperlintroduces the reader to many of the salient features of the Cedar programming environment, a state-of-the-art progrmming system that combines in a single integrated environment: high quality graphics, a sophisticated editor and document preparation facility, and a variety of tools for the programmer to use in the construction and debugging of his programs. The Cedar programming language [8] is a strongly typed, compiler-oriented language of the Pascal family. What is especially interesting about the Cedar project is that it is one of the few examples where an interactive, experimental programming environment has been built for this kind of language. In the past, such environments have been confined to dynamically typed languages like Lisp and Smalltalk.  相似文献   

14.
Java领域混合语言编程时代已经到来。本文首先回顾静态类型语言和动态类型语言、命令式语言和声明式语言的基本概念和各自的优缺点,然后介绍Java语言的发展趋势和基于Java Virture Machine的代表性语言Jython、JRuby、Groovy、Scala和Clojure,最后指出软件项目的未来在于混合语言编程,Java仍将是JVM生态系统中的重要组成部分。  相似文献   

15.
16.
基于目标文件的微型系统动态构建技术   总被引:1,自引:0,他引:1  
描述了一种基于目标文件的微型系统动态构建技术,其基本思想是以封装后目标文件为原料,动态地构建出一个微型系统。其优点是灵活性较强,如可以动态地修改或者升级等等,这在一些嵌入式环境中是非常需要的。文中就C语言目标模块的动态加载进行了阐述,并提出了一套实验性的原型方案。  相似文献   

17.
In object programming languages, the Visitor design pattern allows separation of algorithms and data structures. When applying this pattern to tree‐like structures, programmers are always confronted with the difficulty of making their code evolve. One reason is that the code implementing the algorithm is interwound with the code implementing the traversal inside the visitor. When implementing algorithms such as data analyses or transformations, encoding the traversal directly into the algorithm turns out to be cumbersome as this type of algorithm only focuses on a small part of the data‐structure model (e.g., program optimization). Unfortunately, typed programming languages like Java do not offer simple solutions for expressing generic traversals. Rewrite‐based languages like ELAN or Stratego have introduced the notion of strategies to express both generic traversal and rule application control in a declarative way. Starting from this approach, our goal was to make the notion of strategic programming available in a widely used language such as Java and thus to offer generic traversals in typed Java structures. In this paper, we present the strategy language SL that provides programming support for strategies in Java. Copyright © 2012 John Wiley & Sons, Ltd.  相似文献   

18.
Lua在自动测试中的应用   总被引:1,自引:0,他引:1  
Lua是一种小巧的脚本语言,它的易扩展性与整合性,使得它可以与别的语言很好的融合在一起,实现各种各样的需求,因此它的应用非常的广泛。本文通过Lua在一个自动测试系统(Tester)中的应用来展现Lua语言的优点。  相似文献   

19.
To increase software performance, it is now common to use hardware accelerators. Currently, GPUs are the most widespread accelerators that can handle general computations. This requires to use GPGPU frameworks such as Cuda or OpenCL. Both are very low-level and make the benefit of GPGPU programming difficult to achieve. In particular, they require to write programs as a combination of two subprograms, and, to manually manage devices and memory transfers. This increases the complexity of the overall software design. The idea we develop in this paper is to guarantee expressiveness and safety for CPU and GPU computations and memory managements with high-level data-structures and static type-checking. In this paper, we present how statically typed languages, compilers and libraries help harness high level GPGPU programming. In particular, we show how we added high-level user-defined data structures to a GPGPU programming framework based on a statically typed programming language: OCaml. Thus, we describe the introduction of records and tagged unions shared between the host program and GPGPU kernels described via a domain specific language as well as a simple pattern matching control structure to manage them. Examples, practical tests and comparisons with state of the art tools, show that our solutions improve code design, productivity, and safety while providing a high level of performance.  相似文献   

20.
The use of typed intermediate languages can significantly increase the reliability of a compiler. By type-checking the code produced at each transformation stage, one can identify bugs in the compiler that would otherwise be much harder to find. We propose to take the use of types in compilation a step further by verifying that the transformation itself is type correct, in the sense that it is impossible that it produces an ill typed term given a well typed term as input.We base our approach on higher-order abstract syntax (HOAS), a representation of programs where variables in the object language are represented by meta-variables. We use a representation that accounts for the object language's type system using generalized algebraic data types (GADTs). In this way, the full binding and type structure of the object language is exposed to the host language's type system. In this setting we encode a type preservation property of a CPS conversion in Haskell's type system, using witnesses of a type correctness proof encoded in a GADT.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号