Architecture Of LISP Machines

1y ago
4 Views
2 Downloads
636.98 KB
22 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Evelyn Loftin
Transcription

Architecture of LISP MachinesKshitij SudanMarch 6, 2008

A Short History Lesson Alonzo Church and Stephen Kleene (1930) – λ Calculus( to cleanly define "computable functions" )John McCarthy (late 60’s)(used λ Calculus to describe the operation of a computing machine to prove theoremsabout computation)MIT “Knights of the Lambda Calculus”MIT AI Lab ( 1970’s)Symbolics and LMI

“MacLisp” family Machines1975 The CONS prototype (MIT)1977 The CADR aka MIT Lisp Machine (MIT)1980 LM-2 Symbolics Lisp Machine, repackage CADRLMI Lisp Machine same as CADR1982 L-Machine - Symbolics 3600, later 3640, 36701983 LMI LambdaTI Explorer same as LMI Lambda1984 G-Machine - Symbolics 36501986 LMI K-Machine1987 I-Machine, Symbolics XL-400, Macivory I1988 Macivory II1989 I-Machine, Symbolics XL-1200 , Macivory III1990 XL1200, UX-12001991 MacIvory III1992 Virtual Lisp Machine (aka Open Genera)I-machine compatible, running on DEC AlphaTI Explorer-II - u-Explorer

Agenda History of LISP machines.Semantic Models.von Neumann model of computation.Programming language to m/c architecture.Architectural challenges.The SECD abstract machine.A brief case study.

Semantic Models The semantics of a piece of notation is it’s ultimatemeaning.Imp. for programmer Imp. for language designer Imp. for architects Three major methods to describe and define semantics ofprogramming languages:– Interpretive : meaning is expressed in terms of some simpleabstract m/c.– Axiomatic : where rules describe data values given variousobjects before and after execution of various language features.– Denotational : syntactic pieces of program are mapped viaevaluation functions into the abstract values they denote tohumans.

von Neumann Model of Computation

Programming Languages to MachineArchitectures Interplay between h/w (m/c org.) and s/w(compilers, interpreters, and run-timeroutines) needs to be sustainable for efficientcomputational structures. Mathematical framework Computingmodels languages architecture realimplementations. Mathematical framework Abstract m/c real implementations.

A short detour Processing symbols “was” touted (circa early 90’s)as future of computations (obviously hasn’thappened yet!) For processing symbols, declarative languageswere put forth as the solution –– function-based and logic-based languagesSo what is the future?

Architectural challenges - I Today we talk mostly about LISP machines(functional language m/c’s). Describe features “needed” for efficient LISPprogram execution (RISC can obviouslyexecute LISP). Language feature driven architectural hooks –we talk about then briefly. Abstract m/c case studies

Architectural challenges – II(Architectural support for LISP - I) Fast function calls.– call and return instructions with short execution latenciesfor dynamically bound contexts (latest active value boundto a variable name).– funarg problem. Environment maintenance.– shallow- bound (linked-list)– deep-bound (“oblist” global symbol table) with possible caching of name-value bindings (value cache).

Architectural challenges – III(Architectural support for LISP - II) Efficient list representation.– improvements over two-pointer list cells Vector-coded (represent linear lists as vector of symbols) Structure-coded .– each cell has a tag for it’s location in the list.– associative search leads to fast access. Heap maintenance (a.k.a. garbage collection) Marking (accessible lists “marked”, others reclaimed) Reference count (count links to the cell, when 0, reclaim) Generally mix of two schemes used. Dynamic type checking. tagged memories and special type-checking h/w

The SECD Abstract MachineMemory

The SECD Abstract MachineBasic Data Structures Arbitrary s-expressions for computed data.List representing programs to be executed.Stack’s used by programs instructions.Value Lists containing arguments foruncompleted function applications. Closures to represent unprocessed functionapplications.

The SECD Abstract MachineMachine Registers S – Register (Stack register)– Points to a list in memory that’s treated as aconventional stack for built-in functions ( , -, etc)– Objects to be processed are pushed on bycons’ing a new cell on top of the current stack andcar of this points to object’s value.– S- register after such a push points to the new cell.– Unlike conventional stack, this does not overwriteoriginal inputs.– Cells garbage collected later.

The SECD Abstract MachineMachine Registers E – Register (Environment register)– Points to current value list of function arguments The list is referenced by m/c when a value for theargument is needed. List is augmented when a new environment for afunction is created. It’s modified when a previously created closure isunpacked and the pointer from the closure’s cdrreplaces the contents of E-register.– Prior value list designated by E is not overwritten.

The SECD Abstract MachineMachine Registers C – Register (Control register/pointer)– Acts as the program counter and points to the memory cellthat designates through it’s car the next instruction to beexecuted.– The instructions are simple integers specifying desiredoperation.– Instructions do not have any sub-fields for registers etc. Ifadditional information is required, it’s accessed throughfrom the cells chained through the instruction cell’s cdr.– “Increment of PC” takes place by replacement of Cregisters contents by the contents of the last cell used bythe instruction.– For return from completed applications, new function callsand branches, the C register is replaced by a pointerprovided by some other part of the m/c.

The SECD Abstract MachineMachine Registers D – register (Dump register)– Points to a list in memory called “dump”.– This data structure remembers the state of a functionapplication when a new application in that functionbody is started.– That is done by appending onto dump the 3 new cellswhich record in their cars the value of registers S, E,and C.– When the application completes, popping the top ofthe dump restores those registers. This is very similarto call-return sequence in conventional m/c forprocedure return and activation.

The SECD Abstract MachineBasic Instruction Set Instruction can be classified into following 6 groups:1. Push object values onto the S stack.2. Perform built-in function applications on the S stack andreturn the result to that stack.3. Handle the if-then-else special form.4. Build, apply and return from closures representing nonrecursive function applications.5. Extend the above to handle recursive functions.6. Handle I/O and machine control.The CADR machine built at MIT (1984) closelyresembles SECD with some non-trivial differences.

Case StudyConcert machine for MultiLISP (1985) MultiLISP– designed as an extension of SCHEME that permits the programmer to specifyparallelism and then supports the parallelism in h/w “efficiently”. SCHEME new calls:1.(PCALL F E1 E2 En) 2.Permit parallel evaluation of arguments, then evaluate (F E1 E2 En)(DELAY E) 3.Package E in closure.(TOUCH E) 4.Do not return until E evaluated.(FUTURE E) 5.Package E in a closure and permit eager evaluation(REPLACE-xxx E1 E2) [xxx is either CAR or CDR ] 6.Replace xxx component of E1 by E2. (permits controlled modification to storage)(REPLACE-xxx-EQ E1 E2 E3) Replace xxx of E1 by E2 iff xxx E3. (TEST AND SET)

Case StudyConcert machine for MultiLISP (1985) Concert m/c at MIT – 24-way Motorola 68000based shared memory multiprocessor. MultiLISP MCODE (SECD-like ISA) Interpreted by C interpreter ( 3000 loc) Common gc heap distributed among all processormemories to hold all shared data. MCODE programs manage data structure calledtasks that are accessed by 3pointers: programpointer, stack pointer, and environment pointer.

Case StudyConcert machine for MultiLISP (1985) FUTURE call creates a new task and leaves itaccessible for any free processor. It’s environmentis that of it’s parent expression at it’s timecreation. Task queue used to maintain schedulable tasksand unfair scheduling policy used to prevent taskexplosion. GC uses Banker’s algorithm and spread over allprocessors with careful synchronization to avoidmultiple processors trying to evacuate sameobject at the same time.

Questions?Thanks for your patience

Fast function calls. -call and return instructions with short execution latencies for dynamically bound contexts (latest active value bound to a variable name). -funarg problem. Environment maintenance. -shallow- bound (linked-list) -deep-bound ("oblist" global symbol table) with possible caching of name-value bindings .

Related Documents:

Common Lisp extensions, which also add image processing capabilities to Com-mon Lisp: The rst system is the well-known OBVIUS (Object-Based Vision and Un-derstanding System) for Lisp (see [Heeger and Simoncelli 2010]). It is an image-processing system based on Common Lisp and CLOS (Common Lisp Object System). The system provides a

Cookbook, n. a book containing recipes and other information about the preparation and cooking of food. The Common Lisp Cookbook is a collaborative resource to help you learn Common Lisp the language, its ecosystem and to get you started in a wide range of programming areas. It can be used by Lisp newcomers as a tutorial (getting

Table of Contents Table of Contents 1. Introduction 1 1.1. Lisp Machines 2 1.2. Timesharing 3 1.3. Other Computers 3 . Lisp Machines use special consoles with hi-resolution bit-mapped displays and fancy keyboards, . at the laboratory; there are plans to purchase many additional machines which feature an improved hardware design from outside .

This manual is meant to provide LISP references for routine activities that allows you to automate tasks in AutoCAD. 3 LISP References 3.1 ATTRIBCOPY.LSP Description: This program copies text from one entity to another. How to use: Follow Command Line prompts and use common sense. Type AC at the command line, choose text to copy,

AutoCAD as a consultant. A former member of the Board of Directors for AUGI , he is active on AUGI forums and Autodesk discussion groups. rbell@sparling.com Good Habits for Coding in Visual LISP R. Robert Bell – Sparling CP319-1 The power of AutoCAD lies in its customization capabilities. Visual LISP is a powerful tool for

ActiveX Tricks for Visual LISP and VBA R. Robert Bell – MW Consulting Engineers Peter Jamtgaard – Cordeck CP23-3 You can do some amazing things in AutoCAD using ActiveX. This course shows you several examples of the power available to you, both in Visual LISP and VBA. Because you see the same approach taken in both languages, you will

Getting from ODCL to AutoCAD In this section, we will cover the code required to ensure that ObjectDCL.arx is loaded, load the project and then show the form. Open the lisp file that you associated to your ODCL project in your favorite lisp editor. For the purposes of this class, we will use the Visual Lisp IDE that comes with AutoCAD.

Mar 05, 2003 · namespaces. AutoLISP fundamentals are left for other books to cover as that topic has been aptly covered elsewhere already. This book will focus solely on the Visual LISP extensions to AutoLISP and the unique capabilities and features Visual LISP provides. For this book, you will need to have access