User loginNavigation |
ImplementationRun time type checkingA couple of items that are loosely related. First, Sun is updating the Java Class File Specification. The main difference is the introduction of a new verification scheme based on type checking rather than type inference. This scheme has inherent advantages in performance (both space (on the order of 90% savings) and time (approximately 2x)) over the previous approach. It is also simpler and more robust, and helps pave the way for future evolution of the platform.I haven't read through the fine print of the changes yet - at some point I need to update my class file disassembler - but then I still haven't gotten around to the changes in Java 5 which were much less involved. One thing that I found interesting was the use of Prolog in the specification (predicates and horn clauses). The type rules that the typechecker enforces are specified by means of Prolog clauses. English language text is used to describe the type rules in an informal way, while the Prolog code provides a formal specification.On a different note, there is a new thesis paper on A Semantics For Lazy Types related to the Alice ML project. The specifications for runtime type checking are in the more formal operational specs of ML and the runtime type checking is more ambitious than that associated with Java. Type analysis needs to compare dynamic types, which have to be computed from (probably higher-order) type expressions that may contain types from other modules. If lazy linking has delayed the loading of these modules so far, then the corresponding types are represented by free type variables. For the type-level computation in our model this means that it may encounter free type variables whose denotation depends on yet unevaluated term-level expressions. To proceed, it inevitably has to eliminate these variables by triggering the necessary evaluations on term-level. In other words: type-level computation has to account for lazy types. We give two strategies for this and show soundness properties for the resulting calculi.In general, it means you still have to with dynamic type checking in static languages - though the meaning is different than the runtime typing that occurs with dynamic PLs. A Very Modal Model of a Modern, Major, General Type SystemA Very Modal Model of a Modern, Major, General Type System, by Andrew W. Appel, Paul-Andre Mellies, Christopher D. Richards, and Jerome Vouillon. Preliminary version of August 10, 2006. We wish to compile languages such as ML and Java into typed intermediate languages and typed assembly languages. These TILs and TALs are particularly difficult to design, because in order to describe the program transformations applied in the course of compilation, they require a very rich and expressive type system... Putting all these type ingredients together in a low-level language is an intricate exercise. A formal proof of soundness —any well-typed program does not go wrong—is thus recommended for any type system for such TILs and TALs. It has been awhile since we discussed work in this area. The current paper is quite intriacte, it seems, and I don't have the time to read it carefully. Maybe someone else would care to elaborate. The paper makes a few technical innovations, and uses several interesting techniques. Soundness is not proved syntactically, but rather semantically. Some LtU member will be happy to see that the authors use Coq to formalize their proofs. By Ehud Lamm at 2006-10-08 13:16 | Implementation | Type Theory | 11 comments | other blogs | 84239 reads
An Incremental Approach to Compiler ConstructionAbdulaziz Ghuloum (Indiana University), An Incremental Approach to Compiler Construction
This paper from the Scheme workshop presents an extended tutorial showing how to implement a compiler from Scheme to x86 assembly language. The compiler is written in Scheme, obviously (something that may confuse students, I might add, so beware). An important aspect of the presentation of the material is that the compiler is built incrementally, and the product of each step is a working compiler for a growing subset of the language. This is similar to the EOPL approach. In contrast many compiler textbooks and courses follow a different route, in which each phase is dedicated to building a different part of the compiler (i.e., lexer, parser etc.), and thus the student only sees how the parts interconnect, and gets the satisfaction of seeing the compiler work, at the very end of the process. Supporting material can be found here. By Ehud Lamm at 2006-10-02 12:02 | Implementation | Teaching & Learning | 12 comments | other blogs | 46731 reads
Samurai - Protecting Critical Heap Data in Unsafe LanguagesSamurai - Protecting Critical Heap Data in Unsafe Languages.
Essentially, you use a custom memory allocator for critical objects, so that they are stored redundantly (i.e, they are replicated). Related reading: Failure-oblivious computing. By Ehud Lamm at 2006-09-16 19:15 | Implementation | Software Engineering | 1 comment | other blogs | 8811 reads
Gradual Typing for Functional LanguagesGradual Typing for Functional Languages
In other news, the Holy Grail has been found. Film at 11. This piece of genius is the combined work of Jeremy Siek, of Boost fame, and Walid Taha, of MetaOCaml fame. The formalization of their work in Isabelle/Isar can be found here. I found this while tracking down the relocated Concoqtion paper. In that process, I also found Jeremy Siek's other new papers, including his "Semantic Analysis of C++ Templates" and "Concepts: Linguistic Support for Generic Programming in C++." Just visit Siek's home page and read all of his new papers, each of which is worth a story here. By Paul Snively at 2006-08-30 17:49 | Functional | Implementation | Lambda Calculus | Semantics | Type Theory | 18 comments | other blogs | 41634 reads
Lisp Machine Manual
A 1984 document by Richard Stallman, Daniel Weinreb and David Moon. The preface contains a "personal note" from Stallman announcing GNU. Some sections of interest are: cdr coding, closure manipulation functions, stack groups, and areas. Concoqtion: Mixing Indexed Types and Hindley-Milner Type InferenceFrom the "Whoa!" files: Concoqtion: Mixing Indexed Types and Hindley-Milner Type Inference
Another tough-to-categorize one: dependent types, the Curry-Howard Correspondence, logic programming, theorem provers as subsystems of compilers, implementation issues... it's all in here. Update: A prototype implementation is available here, but it took a bit of Google-fu to find, and it's brand new, so be gentle. Update II: The prototype implementation isn't buildable out of the box, and includes a complete copy of both the Coq and O'Caml distributions, presumably with patches etc. already applied. So it's clearly extremely early days yet. But this feels very timely to me, perhaps because I've just started using Coq within the past couple of weeks, and got my copy of Coq'Art and am enjoying it immensely. Update III: It occurs to me that this might also relate to Vesa Karvonen's comment about type-indexed functions, which occurs in the thread on statically-typed capabilities, so there might be a connection between this front-page story and the front-page story on lightweight static capabilities. That thought makes me happy; I love it when concepts converge. By Paul Snively at 2006-07-23 18:15 | Functional | Implementation | Logic/Declarative | Semantics | Type Theory | 3 comments | other blogs | 12685 reads
Leaky regions: linking reclamation hints to program structure Tim Harris. Leaky regions: linking reclamation hints to program structure. June 2006 Microsoft Research Technical Report MSR-TR-2006-84.
Not really my area of interest, but since there was much discussion about GC and related topics in the discussion group I thought I'd post a link to this tech report. By Ehud Lamm at 2006-07-19 21:06 | Implementation | login or register to post comments | other blogs | 5512 reads
Abstracting Allocation: The New new ThingAbstracting Allocation: The New new Thing. Nick Benton.
This is, of course, related to TAL, PCC etc. If you find the deatils too much, I suggest reading the discussion (section 7) to get a feel for the possible advantages of this approach. By Ehud Lamm at 2006-07-09 13:44 | Implementation | Semantics | 11 comments | other blogs | 13143 reads
Pluvo : new hybrid scripting language
From Sean B. Palmer. Knowing he's a big fan of Python I expected a fair bit of influence - and there is, in fact the implementation is written in Python. Flexibility over typing was to be expected too, Sean's done a lot of work around RDF. Slightly surprising was Pluvo's syntax, which owes more to Bash. |
Browse archives
Active forum topics |
Recent comments
1 week 2 days ago
1 week 3 days ago
13 weeks 3 days ago
13 weeks 4 days ago
13 weeks 5 days ago
13 weeks 5 days ago
14 weeks 3 days ago
14 weeks 3 days ago
14 weeks 3 days ago
17 weeks 4 days ago