| David Tarditi, Peter Lee, and Anurag Acharya. No assembly required: Compiling standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992. A Type System for the C Fragment The type system for the target language is defined for a particular # that assigns types to constants and operators. # (x) = t |
....the part of f after the application and a call of c. Now we can jump to c with continuation s without having to return afterwards. Of course, it is quite inefficient to create so many functions. Appel describes lots of optimizations that make CPS rather fast as the (native) SML NJ compiler shows. [TAL90] describes a compiler for ML programs into C code that also uses CPS. The restrictions of the JVM don t allow us the use of CPS in its original form because programs can neither directly modify the call stack nor call another method without creating a new stackframe on top of its own one. On the ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, USA, November 90.
....the framework of Java. Kawa [3] and MLj [2] partially implement proper tail recursion by depending on the fact that many tail calls are actually self calls and replacing such calls with simple goto s. This works as far as only self tail calls are concerned. Another approach is to use trampolines [15]. In this approach, procedures are divided into two kinds, tail call procedures and the others. A tail call procedure returns the closure of its continuation, which is then invoked by the outer procedure. This approach prevents stack growth but incurs a constant overhead in each tail call. Schinz ....
D. Tarditi, P. Lee, and A. Acharya. No assembly required: Compiling standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992.
....collection makes it unsuitable for very highreliability applications, but it also requires a small degree of cooperation from the back end, because certain compiler optimizations are not safe in the presence of conservative collection. Another solution which has been used when compiling to C [20] is to entirely avoid storing data on the C stack. This can be done by implementing a virtual machine, with its own stack and registers (which can be implemented as e.g. C global variables) The source language is then compiled to code which manipulates the virtual machine state; procedure calls ....
....a language with manual memory management. As far as we know there has been no published work comparing the performance of these hand coded shadow stack approaches with conservative collection. And as far as we are aware, none of the published work on these addresses multithreading. Tarditi et al. [20] describe an ML to C compiler that supports accurate garbage collection. However, this compiler works by emulating a virtual machine, rather than using the normal C calling convention; this has the drawbacks mentioned in the introduction. The Glasgow Haskell compiler [15] has accurate garbage ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213, November 1990.
....certainly not realistic on the JVM which does not allow method bodies of more than 64 kilobytes. This technique can however be used to remove tail calls among a small set of mutually recursive functions, while other tail calls are handled differently. A popular technique is to use a trampoline [9]. A trampoline is an outer function which repeatedly calls an inner function. Each time the inner function wishes to tail call another function, it does not call it directly but simply returns its identity (e.g. as a closure) to the trampoline, which then does the call itself. Unlimited stack ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, November 1990.
....stack frames. You have the same problem if you want to translate to portable C, without assembly language kludges. Hence, you cannot use the C or Java stack for the call stack, but instead have to explicitly manage the call graph and return addresses. Such re writing has been done before for ML [MLtoC] and Scheme [RScheme] In Java we have the extra complication that we do not have function addresess, and no efficient way to work with labels. Instead, we can simulate code labels by using switch labels. This is more overhead than regular method calls, so the regular Procedure interface ....
David Tarditi, Peter Lee, and Anurag Acharya, No Assembly Required: Compiling Standard ML to C, 1992, 161-177.
....is not concerned with tree interpretation so that within the following, virtual machine instructions are thought of as bytecodes. Another popular route to language implementation is via source code translation into the C programming language and subsequent compilation with a standard C compiler [Bar89, TLA92, DPS94, Att94, SW95]. Despite some differences, C code translation is here regarded as compilation into native machine instructions which simply happens in two steps (see also Section 6.4) Also unaddressed in Figure 3 1 is the fact that virtual machine instructions can be further compiled into native machine ....
....generating C code and is therefore different from C embedded code vectors as the C language is here only used as a vehicle for data representation. The representation shares however the performance drawbacks of virtual machines. The latter approach to C translation is applied in many systems [Bar89, TLA92, DPS94, Att94, SW95, Que96]. The approach supplies system portability and performance with standard C compiler technology. However, some high level language features (e.g. call cc, tailcall optimization) are difficult to implement. A major drawback for C translation is that the executable program representation is native ....
D. Tarditi, P. Lee, and A. Acharya. No assembly required: compiling standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992.
....programs are meant to be edited and maintained, not target programs, which is the case in source to source translation. However, the borderline is not sharp: there are converters that are used as compilers, but they have, for example, C as their target language instead of an assembly language [104]. In addition, there are other di#erences between compilation and source tosource translation. Compilers are required to be time e#cient, because usually the same program has to be compiled several times to eliminate all the syntactic and semantic errors. Source to source translation is usually ....
....a source language is not needed if source programs are translated into another language with a compiler which is available. For example, ML programs can be translated into C such that the translation process is like compiling except for the target language being C instead of an assembly language [104]. If the basic goal of translation is maintainability and readability of target programs, the defects of target programs and hand editing requirement can be accepted. To summarize, we have shown that source to source translators su#er from some defects. In order to resolve these shortcomings, it ....
Tarditi, D., Lee, P., Acharya, A., No assembly required: compiling standard ML to C, ACM Letters on Programming Languages and Systems 1 (2) 1992, 161--177.
....and Bruno Monsuez and Alan Mycroft respectively for their remarks about the first and second draft of this paper. Previous work on the compilation of Lisp to C include the Kyoto Common Lisp [YH88] and Bartlett s SCHEME C compiler [Bar89] A previous attempt to compile ML to C is reported in [TAL90], but SML2C yields lower level C programs, for example it does use an apply like procedure for function calls instead of the standard C calling mechanism. ....
D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling Standard ML to C. Technical Report 187, CMU-CS, November 1990.
....gives us a mostly portable Scheme compiler for free. There are many variations on the sort of C code which can be produced but two main directions have emerged: 1. the generation of C code that mimics a virtual machine; in this case, the C compiler is considered as a virtual assembly language (Tarditi et al. 1992). 2. the generation of C code that resembles handwritten C code. Each method has its own advantages and its own drawbacks but we claim that an optimizing compiler must generate natural C code (direction 2) 3.1.1 C as a virtual assembly language If we use C as an assembly language, we ....
....cannot be ful lled with the natural mapping because C does not provide any mechanism to implement tail recursion. One might consider that limitation too high a price to pay. Solutions to implement tail recursion in C without stack consumption exist but they cannot be used with the natural mapping (Tarditi et al. 1992; Baker, 1994; Feeley et al. 1997) We 20 Manuel Serrano consider the gains of the natural mapping more important. In addition, since local functions are compiled into C loops, which do not allocate stack activation frames, many of tail recursive functions are correctly handled by our compiler. ....
Tarditi, D., Acharya, A., & Lee, P. (1992). No assembly required: Compiling Standard ML to C. Acm letters on programming languages and systems, 2(1), 161-177.
....make use of Caml functions to traverse complex data structures rather than writing C code to access Caml data structures. The Caml system was recommended by other researchers [10] due to its lightweight implementation and respectable performance. Other compilers like New Jersey ML [3] and sml2c [159] were discarded as being too resource hungry. Caml Light grammar is close to Ektran and therefore it is easy to translate Ektran to Caml code. 3.3 Engineering the Parallelising Compiler The underlying philosophy of the Ektran compiler is to shift as much as possible of the burden of dealing ....
D. Tarditi, A. Acharya, and P. Lee. No Assembly Required: Compiling Standard ML to C. Technical Report 187, CMU-CS, November 1990.
....functional languages that generate C code: The Alfa language [GH87, Gol88] is compiled into C code for hypercube systems but the absolute performance of programs is rather low. Bar89] introduces SCHEME C, a portable Scheme compiler; the generated code performs well compared to VAX Common Lisp. TAL90] describes a compiler for Standard ML that uses C as a compilation target. The Glasgow Haskell compiler [PJHH 93] is based on the Spineless Tagless G Machine [Pey91] that uses C as a sort of portable macro assembler. The compiler for the strict functional language Opal [Pep92] generates very ....
David Tarditi, Anurag Acharya, and Peter Lee. No Assembly Required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, November 1990.
....involved in writing a good code generator. One approach is to use C as a portable assembler, relying on a collection of tricks and non standard extensions to persuade C to generate the sort of code they want. This approach has become quite common among compilers for functional and logic languages [8, 19, 11, 21, 3], including our own compiler for Haskell, the Glasgow Haskell Compiler. In the light of our experience we have become more and more dissatisfied with using C as a compiler target language. That is not a criticism of C it was not designed for that purpose. For example, a particular ....
....is not a portable assembler; it is a compact representation for Java. 3 Why C is not suitable as a portable assembler An obvious question is this: why not (continue to) use C as a portable assembler Quite a few papers have appeared in the last few years describing ways of achieving this effect [8, 19, 11, 21, 3], but all are unsatisfactory in one way or another. More precisely, we can identify the following difficulties: Some source languages require the so called tail call optimisation. This means that a procedure call whose result is returned to the caller of the current procedure is executed in ....
[Article contains additional citation context not shown here]
D Tarditi, A Acharya, and P Lee. No assembly required: compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, 1992.
....to find that the performance of Pict code, which uses just channel based communication, is in the same ball park as that of functional code. It is especially worth bearing in mind that Pict loses some performance just because we compile to C rather than to native code. Tarditi, Acharya and Lee [TAL90] found that compiling to C rather than to native code costs almost a factor of two for New Jersey ML code. If we are paying a similar price by compiling Pict to C, we might reasonably expect a native code generator to improve the performance of Pict to within a factor of two or three from New ....
....recursive process definitions) We are not aware of any compiler which implements a language whose sole computational mechanism is channel based communication. However, the compilation of calculus to C presented in this dissertation is quite closely related to the SML to C compiler described in [TAL90] The stackless representation used here for calculus processes is very reminiscent of the continuation passing style of code generation used in the New Jersey ML compiler [AM87] upon which the SML to C compiler is built) Chapter 11 Conclusions and further work Throughout this dissertation ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling standard ML to C. Technical Report CMU-- CS--90--187, Department of Computer Science, Carnegie Mellon University, November 1990.
....stack stack is empty. The routine xtop repeatedly executes the topmost node, until the stack is empty. The routine xtop assumes that the first word of a node points to the routine to be called. The routine xtop is one of several variations on a mechanism known as the UUO handler [ghc] RABBIT][sml2c]. Figure 3 shows the intermediate C code resulting from compiling the above application routines tpow and mult. In order to demonstrate an execution, Figure 4 contains a C application which calls the routine tpow. The code of Figures 2, 3, and 4 may be compiled and executed as a usual C ....
David Tarditi, Peter Lee and Anurag Acharya. "No Assembly Required : Compiling Standard ML to C", ACM Letters on Programming Languages and Systems, Vol. 1, No. 2, June 1992, pp. 161-177. foxnet.cs.cmu.edu/papers.html
....extensions, but does not support the newer Sather 1.0 language features. 1 It also implements an alias construct which is not in Sather 0.1. 98 The compiler uses C as the intermediate language. This is similar to the strategy adopted by compilers by several other languages such as Standard ML [213], Scheme [26] and POOL2 [9] The advantages of using C are obvious. Because of C s widespread availability, it is relatively easy to port the compiler. We can also take advantage of low level optimizations (e.g. register allocation) performed by the C compiler. One disadvantage is that many ....
David Tarditi, Peter Lee, and Anurag Acharya. No Assembly Required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992.
....to FOL (a rst order simplytyped language) via the algorithm described in Section 4. After a series of optimizations (e.g. inlining, tuple attening, redundant argument elimination, and loop invariant code motion) the FOL program is translated to a C program, which is then compiled by gcc. Like [22], a trampoline is used to satisfy tailrecursion. To reduce trampoline costs, multiple FOL procedures may reside in the same C procedure; a dispatch on C procedure entry jumps to the appropriate code [7] To demonstrate the practicality of our approach, we have measured its impact on compile time ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, June 1992. Appears as CMU-CS-90-187.
....is empty. The routine xtop repeatedly executes the topmost task frame, until the stack is empty. The routine xtop assumes that the first word of a task frame points to the routine to be called. The routine xtop is one of several variations on a mechanism known as the UUO handler [ghc] RABBIT][sml2c]. Figure 4 shows the intermediate C code resulting from compiling the TSIA code in Figure 2a) Figure 5 shows an application which calls the routine d of Figure 4. The code of Figures 3, 4, and 5 may be compiled and executed as a usual C application. As expected, the output is 14. In order to ....
David Tarditi, Peter Lee and Anurag Acharya. "No Assembly Required : Compiling Standard ML to C", ACM Letters on Programming Languages and Systems, Vol. 1, No. 2, June 1992, pp. 161-177. foxnet.cs.cmu.edu/papers.html
....keep type information until a late stage in the compilation process when code has reached a low level form more primitive than 3GL code, but its type system is substantially more complex than the C or Ada style typing we use. While there are many existing systems that compile ML or Haskell to C [40, 14, 12, 31], they treat C as a loosely typed portable assembly language, and often make use of casts and non standard extensions (e.g. as provided by gcc) This paper describes the overall architecture of our system, and reports in detail on the more novel transformations. We assume the reader to be ....
D. Tarditi, P. Lee, and A. Acharya. No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992.
....keep type information until a late stage in the compilation process when code has reached a low level form more primitive than 3GL code, but its type system is substantially more complex than the C or Ada style typing we use. While there are many existing systems that compile ML or Haskell to C #Tarditi et al. 1992; Cridlig, 1992; Chailloux, 1992; Peyton Jones, 1992; Tofte et al. 1997#, they often make heavy use of casts or non standard extensions #e.g. as provided by gcc#, especially to handle closures and exceptions and to avoid using the C procedure activation model. Our system generates ANSI standard, ....
Tarditi, D., Lee, P., and Acharya, A. #1992#. No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 1#2#:161#177.
....[App92] the process de nition towards the top level, reducing the number of dynamic process creation. For example, z [ w] def x[ y] Q in P end can be transformed to def x[ y] Q in z [ w] P end when 2 The HACL compiler translates a HACL program to a C program in a manner similar to sml2c [TAL90]. The compiler is available both for a single processor workstation and for network of workstations. We just show performance on a single processor workstation. 26 Table 1: Running time for the benchmark programs naive (sec) opt. sec) func. sec) sfib25 1.45 0.57 0.41 pfib25 1.76 0.93 ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, November 90.
....FOL (a first order simply typed language) via the algorithm described in Section 5. After a series of optimizations (e.g. inlining, tuple flattening, redundant argument elimination, and loop invariant code motion) the FOL program is translated to a C program, which is then compiled by gcc. Like [TAL92] a trampoline is used to satisfy proper tail recursion. To reduce trampoline costs, multiple FOL procedures may reside in the same C procedure; a dispatch on C procedure entry jumps to the appropriate code [FMRW97] To demonstrate the practicality of our approach, we have measured its impact on ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, June 1992. Appears as CMU-CS-90-187.
....exists. This approach sacrifices some performance for reduced development time and enhanced portability, especially if a widely used language (like C or C ) is used as the target. Several major projects have adopted this approach, including compilers for FORTRAN [15] Pascal [17] Standard ML [45], Scheme [10] and Haskell [23] all of which use C as the target language. Compilation to the JVM does not fall neatly into either category, however, since the JVM, although nominally a machine code, is relatively high level. In particular, it includes some constructs not normally found in ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, Carnegie Mellon University, November 1990.
....much better to have one portable assembly language that could be generated by a front end and implemented by any of the available code generators. So pressing is this need that it has become common to use C as a portable assembly language (Atkinson et al. 1989; Bartlett 1989b; Peyton Jones 1992; Tarditi, Acharya, and Lee 1992; Henderson, Conway, and Somogyi 1995; Pettersson 1995; Serrano and Weis 1995) Unfortunately, C was never intended for this purpose it is a programming language, not an assembly language. C locks the implementation into a particular calling convention, makes it impossible to compute targets ....
....give a front end the freedom to design its own control flow. It is very difficult to implement the tail call optimisation in C, and no C compiler known to us does so across separately compiled modules. Those using C have been very ingenious in finding ways around this deficiency (Steele 1978; Tarditi, Acharya, and Lee 1992; Peyton Jones 1992; Henderson, Conway, and Somogyi 1995) but the results are complex, fragile, and heavily tuned for one particular implementation of C (usually gcc) A C compiler may lay out its stack frames as it pleases. This makes it difficult for a garbage collector to find the live ....
Tarditi, David, Anurag Acharya, and Peter Lee. 1992. No assembly required: compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177.
....pointer to C function first class C label code block = Table 3.1: Alternatives for Compiling to C It is not novel to use C as an lower level intermediate language and use an existing C compiler as a final backend. Many techniques are proposed so far to compile a higher level language to C [12, 18, 43]. Some of them fully respect ANSI C. Others make use of GCC extension and are not compatible with ANSI C. Since both approaches have advantages and disadvantages, it cannot be said that one is superior to the other. The former approach brings us more portability, while the latter brings us more ....
....in the function. The optimization also demands the modification for the scheduler function. This scheme is fully compatible to ANSI C and realizes a high portability, whether the optimization is used or not. Consequently, it is so popular as to be adopted in many languages. KL1 [10, 11] and MLtoC [43] are the examples. The third approach (GCC Scheme) The generated C program in this scheme uses the GCC original extensions aggressively and is not ANSI C compatible. It transfers control by goto ignoring function boundaries. GCC allows us to deal with a label as first class (named Labels as ....
David Tarditi, Peter Lee, and Anurag Acharya. No Assembly Required: Compiling Standard ML to C. In Letters on Programming Languages and Systems, June 1992.
....for creating linear channel explicitly in Venezia. 7.2 Problem of Compiling to C In our framework, Schematic source codes are translated into those of C. This method enables us to ffl get high portability. ffl use high performance C compilers On the other hand, we must tackle with some problems[17][4] One of them is the jump instruction. It is very problematic because labels are not first class values in C. In particular, we cannot store a label in memory or jump to it from an arbitary point in the C program. Of course, we cannot handle program counter in C level. But, execution point ....
Tarditi, D., A. Acharya, P. Lee, No Assembly Required: Compiling Standard ML to C, Technical Report pp.90--187, Carnegie Mellon University, Pittsburgh, 1990.
....[5] Besides allowing us to more rapidly bring new implementation techniques into use in the project, this will also benefit a sizable community of Standard ML users. We have already had several good experiences with making such improvements to this system, for example in the Portable SML project [35]. In this section we describe our proposed research activities in the area of language implementation. Optimizing Standard ML Programs Dataflow analysis has become the standard basis for many optimization techniques for conventional programming languages. Such optimizations include global register ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187,School of Computer Science, Carnegie Mellon University, November 1990.
....independently with different design goals, yet have ultimately resorted to the same mechanisms. In both cases we find that the performance of our C code is between a factor of two and three slower than the native code generators for our compilers. In addition, recent work on compiling SML[12, 20] has yielded similar performance results, despite the fact that the SML compiler uses static typing information to overcome the overhead of encoding data type information at runtime. We find this coincidence to be compelling evidence that the observations are intrinsic to the problems of ....
.... capable of converting a source language with higher order procedures and requiring a tail recursive implementation into another language lacking both of these features since at least 1976[15, 16] Because of its ubiquity, the language C has become a popular target language for these compilers[13, 20, 1, 14, 19]. But there are difficulties that arise from the choice of C as a target language: 1. Fully tail recursive languages (e.g. Scheme, ML, and Dylan[3] consider procedure call to be goto statements that happen to pass arguments, 16] while C implementations are free to treat procedure call and goto ....
[Article contains additional citation context not shown here]
David Tarditi, Anunrag Acharya, and Peter Lee. No assembly required: Compiling standard ML to C. Technical report, School of Computer Science, Carnegie Mellon University, November 1990. CMU-CS-90-187.
....types of the process number and group number operations are as follows: val process number : unit int val group number : unit int 3. 4 Program Execution The current mechanism for compiling programs is based on a separate compilation system using a modified version of the SML2C compiler[13]. Signatures, functors, and structures are compiled to produce a single executable and the structures are executed for side effects. In this sense, all cells execute the same code, until the paraML runtime system is invoked. The runtime system is called by applying the paraml function to a thunk ....
David Tarditi, Anurag Acharya, and Peter Lee "No Assembly Required: Compiling Standard ML to C." Technical Report 187, CMU--CS, (November 1990).
....hand C is case sensitive and Scheme is not. The compiler uses upper case letters for the characters that are legal in identifiers in Scheme but not in C; for example val becomes SvalS. The compiler also introduces local variables to shadow global variables to improve register usage (similar to [11]) These introduced variables begin with R; thus RSvalS is a local variable shadowing the global variable SvalS. This code is not what we would have written if we had used C in the first place, but it is at least as efficient. The use of Pre Scheme makes the program relatively more ....
Tarditi, D., Acharya, A., and Lee., P. No Assembly Required: Compiling Standard ML to C. Technical Report, School of Computer Science, Carnegie Mellon University (1991).
....copy propagation, and inlining of those continuations and procedures that have single unique invocation points. No static analysis is performed, except a simple per module reference count analysis. We refer the reader to the literature for further details concerning the practical issues involved [3, 19,22,27, 28]. 6 Tailcalls in C Implementations of high level languages must often deal with tailcalls. A tailcall is a function call that occurs as the last action (the tail ) in a function body. An implementation is properly tail recursive if tailcalls do not cause net growth in stack usage. In effect, ....
....the label, receives as the return value the next label to call, and loops ad infinitum. While this preserves tail recursion, parameter passing cannot be done in a natural way. Instead, global variables are used to communicate arguments from caller to callee. This technique has been used many times [24, 27, 28]. To eliminate the high overhead for parameter passing and control flow in the previous scheme, some compilers collect all code into a single C function [13] This allows parameters to be located in local C function variables, perhaps even registers, and known control transfers become simple ....
David R. Tarditi, Peter Lee, and Anurag Acharya. No assembly required: Compiling Standard ML to C. ACM LOPLAS, 1(2):161--177, June 1992.
....statically allocated C data structures. The only technical problems are how to represent labels, and how to implement tailcalls. Because of tail recursiveness, the C stack cannot be used for calls or parameter passing. A standard solution is to represent each label as a parameterless function [20, 21]. A function must end by returning the address of the next function to call. On top of this sits a dispatch loop that calls a function pointer, gets back a new pointer, and then loops to call the new function, ad infinitum. Parameters and results are passed in global variables and or a simulated ....
David R. Tarditi, Peter Lee, and Anurag Acharya. No assembly required: CompilingStandard ML to C. ACM LOPLAS, 1(2):161--177, June 1992.
....benchmark figures obtained by our compiler, compared with other ML and Lisp compilers. Time figures present the minimum of three consecutive runs; times are expressed in seconds and represent user system times. For compilers which produce C code (Bigloo, Camlot [6] scheme to c [3] sml2c [17]) C files are compiled with gcc using the O2 option. Bigloo is available on many Unix platform (Sparc, HP PA, Mips, Alpha, Intel, Next, RS6000, MC68k, We measure the execution times on a Sun 4 (Sparc 2 architecture, running SunOs 4.1.2, 64 Mo of memory) we report the best user system ....
D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, Carnegie Mellon University, Pittsburg, Pennsylvania, School of Computer Science, March 1991.
....than either collector time or allocation time. 1 Overview For almost any language, there are a handful of compilers that generate C [1] as a target language. For instance, Javato C compilers include Toba [20] Vortex [11] and Harissa [18] and ML to C compilers include Bigloo [22] SML2C [27], and TIL C [28] 1 . The developers of these compilers chose C as a target language to leverage the optimizations of existing C compilers and to obtain a relatively portable, easy to build back end. However, Java, ML, and many other languages require garbage collection which C does not directly ....
D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, Nov. 90.
....keep type information until a late stage in the compilation process when code has reached a low level form more primitive than 3GL code, but its type system is substantially more complex than the C or Ada style typing we use. While there are many existing systems that compile ML or Haskell to C (Tarditi et al. 1992; Cridlig, 1992; Chailloux, 1992; Peyton Jones, 1992; Tofte et al. 1997) they often make heavy use of casts or non standard extensions (e.g. as provided by gcc) especially to handle closures and exceptions and to avoid using the C procedure activation model. Our system generates ....
Tarditi, D., Lee, P., and Acharya, A. (1992). No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177.
....but the available information is sketchy. Compiling higher level languages to C is not new. Many language systems leverage existing compilers and use C as an intermediate language in the compilation process. Systems for Smalltalk [Git94] SR [And82] Scheme [Bar89] Icon [Wal91] Forth [EM96] SML [TAL90], Pascal [Gil90] Cedar [ADH 89] and Fortran [FGMS90] are well known. For traditionally compiled languages like Pascal and Fortran, translation to C improved portability. For Scheme, Forth, and Icon, translation removed interpretation overhead. Similarly, Toba removes interpretation overhead ....
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, Nov 90.
....keep type information until a late stage in the compilation process when code has reached a low level form more primitive than 3GL code, but its type system is substantially more complex than the C or Ada style typing we use. While there are many existing systems that compile ML or Haskell to C [47, 15, 13, 37, 49], they often make heavy use of casts or non standard extensions (e.g. as provided by gcc) especially to handle closures and exceptions and to avoid using the C procedure activation model. Our system generates ANSI standard, nearly cast free code. Also, many of these systems generate C from very ....
D. Tarditi, P. Lee, and A. Acharya. No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992.
No context found.
David Tarditi, Peter Lee, and Anurag Acharya. No assembly required: Compiling standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992. A Type System for the C Fragment The type system for the target language is defined for a particular # that assigns types to constants and operators. # (x) = t
No context found.
David Tarditi, Peter Lee, and Anurag Acharya. No assembly required: Compiling standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992. A Type System for the C Fragment The type system for the target language is defined for a particular # that assigns types to constants and operators. Expressions (#
No context found.
D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 2(1):161--177, 1992.
No context found.
D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, Carnegie Mellon University, Pittsburg, Pennsylvania, School of Computer Science, March 1991.
No context found.
D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling Standard ML to C. ACM Letters on Programming Languages and Systems, 2(1):161--177, 1992.
No context found.
D. Tarditi, P. Lee, and A. Acharya. No assembly required: Compiling standard ML to C. ACM Letters on Programming Languages and Systems, 1(2):161--177, June 1992.
No context found.
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, Carnegie Mellon University, November 1990.
No context found.
D. Tarditi, P. Lee, and A. Acharya, "No assembly required : Compiling standard ML to C," ACM Letters on Programming Languages and Systems, vol. 1, pp. 161--177, June 1992. 151
No context found.
D. Tarditi, A. Acharya, and P.Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University,November 1990.
No context found.
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, November 90.
No context found.
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, USA, November 90.
No context found.
David Tarditi, Anurag Acharya, and Peter Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, School of computer Science, Carnegie Mellon University, November 1990.
No context found.
D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling Standard ML to C. Technical Report CMU-CS-90-187, School of Computer Science, Carnegie Mellon University, Nov. 1990.
No context found.
Tarditi, D., & Lee, P. "No assembly required: Compiling standard ML to C". ACM LOPLAS 1,2 (1992), 161-177.
First 50 documents Next 50
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC