20,314 research outputs found

    Trust, but Verify: Two-Phase Typing for Dynamic Languages

    Get PDF
    A key challenge when statically typing so-called dynamic languages is the ubiquity of value-based overloading, where a given function can dynamically reflect upon and behave according to the types of its arguments. Thus, to establish basic types, the analysis must reason precisely about values, but in the presence of higher-order functions and polymorphism, this reasoning itself can require basic types. In this paper we address this chicken-and-egg problem by introducing the framework of two-phased typing. The first "trust" phase performs classical, i.e. flow-, path- and value-insensitive type checking to assign basic types to various program expressions. When the check inevitably runs into "errors" due to value-insensitivity, it wraps problematic expressions with DEAD-casts, which explicate the trust obligations that must be discharged by the second phase. The second phase uses refinement typing, a flow- and path-sensitive analysis, that decorates the first phase's types with logical predicates to track value relationships and thereby verify the casts and establish other correctness properties for dynamically typed languages

    The C++0x "Concepts" Effort

    Full text link
    C++0x is the working title for the revision of the ISO standard of the C++ programming language that was originally planned for release in 2009 but that was delayed to 2011. The largest language extension in C++0x was "concepts", that is, a collection of features for constraining template parameters. In September of 2008, the C++ standards committee voted the concepts extension into C++0x, but then in July of 2009, the committee voted the concepts extension back out of C++0x. This article is my account of the technical challenges and debates within the "concepts" effort in the years 2003 to 2009. To provide some background, the article also describes the design space for constrained parametric polymorphism, or what is colloquially know as constrained generics. While this article is meant to be generally accessible, the writing is aimed toward readers with background in functional programming and programming language theory. This article grew out of a lecture at the Spring School on Generic and Indexed Programming at the University of Oxford, March 2010

    The Sketch of a Polymorphic Symphony

    Full text link
    In previous work, we have introduced functional strategies, that is, first-class generic functions that can traverse into terms of any type while mixing uniform and type-specific behaviour. In the present paper, we give a detailed description of one particular Haskell-based model of functional strategies. This model is characterised as follows. Firstly, we employ first-class polymorphism as a form of second-order polymorphism as for the mere types of functional strategies. Secondly, we use an encoding scheme of run-time type case for mixing uniform and type-specific behaviour. Thirdly, we base all traversal on a fundamental combinator for folding over constructor applications. Using this model, we capture common strategic traversal schemes in a highly parameterised style. We study two original forms of parameterisation. Firstly, we design parameters for the specific control-flow, data-flow and traversal characteristics of more concrete traversal schemes. Secondly, we use overloading to postpone commitment to a specific type scheme of traversal. The resulting portfolio of traversal schemes can be regarded as a challenging benchmark for setups for typed generic programming. The way we develop the model and the suite of traversal schemes, it becomes clear that parameterised + typed strategic programming is best viewed as a potent combination of certain bits of parametric, intensional, polytypic, and ad-hoc polymorphism

    Vibrotactile pedals : provision of haptic feedback to support economical driving

    Get PDF
    The use of haptic feedback is currently an underused modality in the driving environment, especially with respect to vehicle manufacturers. This exploratory study evaluates the effects of a vibrotactile (or haptic) accelerator pedal on car driving performance and perceived workload using a driving simulator. A stimulus was triggered when the driver exceeded a 50% throttle threshold, past which is deemed excessive for economical driving. Results showed significant decreases in mean acceleration values, and maximum and excess throttle use when the haptic pedal was active as compared to a baseline condition. As well as the positive changes to driver behaviour, subjective workload decreased when driving with the haptic pedal as compared to when drivers were simply asked to drive economically. The literature suggests that the haptic processing channel offers a largely untapped resource in the driving environment, and could provide information without overloading the other attentional resource pools used in driving

    ‘Turnaround’ of Indian Railways: Increasing the Axle Loading

    Get PDF
    Axle loading had contributed significantly to the ‘turnaround’ of the Indian Railways (IR) in the two years 2004-06. As the Minister of Railways (MR) stated, “A one ton extra loading per wagon implied additional revenue of Rs 500 crore per annum for IR.” The axle loading initiative was a significant step by IR, though sustainability was a concern. This paper focuses on the key driving events, process issues, impact and implications, and sustainability of the initiative of taking the load per wagon from its carrying capacity (CC) to CC+8. Axle loading for a wagon had traditionally been 20.32 tons, except for the mainline versions of steam locomotives. In the early 1980s, the then Chairman of the Railway Board took initiative of increasing axle loading on an experimental basis which after his tenure, could not be sustained on the grounds of safety. In the late 90s, there were initiatives of regularizing the two ton slack normally permitted for excess loading for certain commodities which were usually on a short haul. The railway minister, during inspections in 2004, noticed significant overloading of many wagons in the iron ore and coal routes. This set him thinking on the axle loading initiative. When one of the Zonal Railways (ZR) proposed an increase of up to ten tons per four axled wagon, various directorates in the Railway Board (RB) gave their views, many of which opposed the initiative. The minister, through the RB, directed a variety of processes to bring about inter-departmental alignment, and the initiative was taken forward in a step by step manner over the two years over a large part of IR. The safety and research institutions of IR also had to be taken along. The initiative is still treated as an ‘experiment,’ with many issues that need resolution and strategizing.
    corecore