Mlbibtex: Reporting the Experience∗

Total Page:16

File Type:pdf, Size:1020Kb

Mlbibtex: Reporting the Experience∗ MlBibTEX: Reporting the experience∗ Jean-Michel Hufflen LIFC (EA CNRS 4157) University of Franche-Comté 16, route de Gray 25030 BESANÇON CEDEX France hufflen (at) lifc dot univ-fcomte dot fr http://lifc.univ-fcomte.fr/~hufflen Abstract This article reports how the different steps of the MlBibTEX project were con- ducted until the first public release. We particularly focus on the problems raised by reimplementing a program (BibTEX) that came out in the 1980’s. Since that time, implementation techniques have evolved and new requirements have ap- peared, as well as new programs within TEX’s galaxy. Our choices are explained and discussed. Keywords TEX, LATEX, BibTEX, reimplementation, reverse engineering, im- plementation language, program update. Streszczenie Artykuł omawia realizację poszczególnych kroków przedsięwzięcia MlBibTEX, w czasie do przedstawienia pierwszej publicznej wersji. W szczególności skupiamy się na problemach powstałych przy reimplementacji programu (BibTEX), powsta- łego w latach 80 zeszłego wieku. Od tego czasu rozwinęły się techniki implemen- tacyjne, powstały nowe wymagania oraz nowe programy w świecie TEX-owym. Przedstawiamy i dyskutujemy dokonane wybory. Słowa kluczowe TEX, LATEX, BibTEX, reimplementacja, reverse engineering, język implementacji, aktualizacja programu. 0 Introduction aim to provide new programs, based on TEX & Co.’s ideas.2 A first representative example is the LAT X 3 In 2003, TEX’s 25th anniversary was celebrated at E 1 project [32], a second is N S [27]. the TUG conference, held in Hawaii [1]. LATEX T MlBibT X — for ‘MultiLingual BibT X’ — be- [28] and BibTEX [35] — the bibliography processor E E longs to the class of such projects. Let us recall usually associated with the LATEX word processor — are more recent, since they came out in the 1980’s, that this program aims to be a ‘better BibTEX’, especially regarding multilingual features. For an shortly after TEX. All are still widely used, such longevity being exceptional for software. However, end-user, MlBibTEX behaves exactly like ‘classical’ these programs are aging. Of course, recent ver- BibTEX: it searches bibliography data base (.bib) sions have incorporated many features absent from files for citation keys used in a document and then the first versions, which proves the robustness of arranges the references found, writing them to a .bbl A these systems. Nevertheless, they present some lim- file suitable for LTEX, w.r.t. a bibliography style. 3 4 itations due to the original conception, and a major MlBibTEX is written in Scheme, it uses XML as a reimplementation may be needed to integrate some modern requirements. In addition, interactive word 2 Concerning TEX, an additional point is that TEX’s de- processors have made important progress and are se- velopment has been frozen by its author, Donald E. Knuth [26]. If incorporating new ideas to a ‘new TEX’ leads to a ma- rious rivals, even if they do not yield typesetting of jor reimplementation, the resulting program must be named such professional quality. That is why some projects differently. 3 The version used is described in [24]. ∗ Title in Polish: MlBIBTEX: raport z doświadczeń. 4 EXtensible Markup Language. Readers interested in 1 TEX Users Group. an introductory book to this formalism can consult [37]. TUGboat, Volume 29, No. 1 — XVII European TEX Conference, 2007 157 Jean-Michel Hufflen central format: when entries of .bib files are parsed, ming language, higher than C. So we consider they result in an XML tree. Bibliography styles tak- again the prototype in Scheme that we sketched ing advantage as far as possible of MlBibTEX’s new in 2002. SXML7 [25] is chosen as the represen- features are written using nbst,5 a variant of XSLT6 tation of XML texts in Scheme. Some parts of described in [15]. The stack-based bst language [34] MlBibTEX are directly reprogrammed from C used for writing bibliography styles of BibTEX can to Scheme. As for the other parts, this proto- be used in a compatibility mode [20]. type is a good basis for much experiment [16]. We think that the experience we have gained Nov. 2004 The version written in C is definitely in developing MlBibTEX may be useful for other, dropped, whereas the version in Scheme is mod- analogous, projects. To begin, we briefly review the ified to improve efficiency; it becomes the ‘offi- chronology of this development. As will be seen, cial’ MlBibTEX [18]. this development has not been linear, and the two following sections focus on the problems we had to Sep. 2005 We decided to freeze MlBibTEX’s design face. We explain how we have determined which and concentrate only on finishing programming. Many Scheme functions are rewritten in confor- criteria are accurate when a programming language 8 is to be chosen for such an application. Then we mity to SRFIs [39]. show how the compatibility with ‘old’ data and the May 2006 A working version is almost finished, integration of modern features should be managed. except for the interface with the kpathsea li- brary. 1 MlBibTEX’s chronology May 2007 Public availability of MlBibTEX’s Ver- Oct. 2000 MlBibTEX’s design begins: the syntax sion 1.3. of .bib files is enriched with multilingual anno- Let us also explain that MlBibT X is not our tations. Version 1.1’s prototype is written using E only task. As an Assistant Professor in our univer- the C programming language and tries to reuse sity, we teach computer science, and participate in parts of ‘old’ BibT X’s program as far as pos- E other projects. As a consequence, MlBibT X’s de- sible. E velopment has been somewhat anarchic: we hardly May 2001 The first article about Ml T X is [9]. Bib E worked on it for two or three months, put it aside Later, the experience of developing Ml T X’s Bib E for one or two months, and so on. Last, we have su- Version 1.1 is described in [10]. pervised some student projects regarding graphical May 2002 After discussions with participants at tools around MlBibTEX [2, 8], programmed using the EuroBachoTEX conference, we realise that Ruby [31], but concerning the development of the the conventions for bibliography styles are too MlBibTEX program itself, we have done it alone. diverse, even if we consider only those of Eu- ropean countries. We realise that this first ap- 2 Choice of an implementation language proach is quite unsuitable, without defining a There are several programming paradigms: impera- new version of the bst language. So we decide tive, functional, and logic programming. There are to explore two directions. First, we develop a also several ways to implement a programming lan- questionnaire about problems and conventions guage: interpretation and compilation. Some par- concerning bibliography styles used within Eu- adigms are more appropriate, according to the do- ropean countries. Second, we begin a prototype main of interest. Likewise, some interpreted lan- in Scheme implementing the bst language [11]. guages are more appropriate if you want to pro- Initially, this prototype is devoted to experi- gram a prototype quickly and are just interested in ments about improving bst in a second version, performing some experiment.9 But compiled lan- 1.2. guages are often preferable if a program’s efficiency Jan. 2003 Version 1.2 is stalled. The new version is crucial. In addition, the level of a programming (1.3) is based on XML formats. The nbst lan- language has some influence on development: in a guage is designed and presented at [12, 13]. We high-level language, low-level details of structures’ explain in [14] how the results of our question- implementation do not have to be made explicit, so naire have influenced this new direction. Feb. 2004 It appears to us that MlBibTEX should 7 Scheme implementation of XML. be developed using a very high-level program- 8 Scheme Requests for Implementation, an effort to coor- dinate libraries and other additions to the Scheme language 5 New Bibliography STyles. between implementations. 6 eXtensible Stylesheet Language Transformations, the 9 Such is the case for the two graphical tools around language of transformations used for XML documents [44]. MlBibTEX programmed in Ruby by our students [2, 8]. 158 TUGboat, Volume 29, No. 1 — XVII European TEX Conference, 2007 MlBibTEX: Reporting the experience development is quicker, and the resulting programs implementation of low-level functionalities. are more concise, nearer to a mathematical model. Finally, our choice was Scheme, the modern di- In addition to these general considerations, let alect of Lisp. We confess that we are personally us recall that we aim to replace an existing program attracted by functional programming languages, be- by a new one. This new program is supposed to cause they can abstract procedures as well as data: do better than the ‘old’ one. ‘To do better’ may in this sense, they are very high-level programming mean ‘to have more functionalities, more expressive languages. Concerning Scheme, it seems to us to be power’, but for sake of credibility, it is desirable for undebatable that it has very good expressive power, the new program to be as efficient as the ‘old’ one. and takes as much advantage as possible of lexical Let us not forget that TEX and BibTEX are written scoping. In addition, it allows some operations to be using an old style of programming — more precisely, programmed ‘impurely’, by side effects, as in imper- a monolithic style used in the 1970’s–1980’s — based ative programming, in order to increase efficiency. mainly on global variables, without abstract data However, we use this feature parsimoniously, on lo- types. Choosing a language implemented efficiently cal variables, since it breaks the principles of func- is crucial: as a counter-example, NT S, written us- tional programming.
Recommended publications
  • Bringing GNU Emacs to Native Code
    Bringing GNU Emacs to Native Code Andrea Corallo Luca Nassi Nicola Manca [email protected] [email protected] [email protected] CNR-SPIN Genoa, Italy ABSTRACT such a long-standing project. Although this makes it didactic, some Emacs Lisp (Elisp) is the Lisp dialect used by the Emacs text editor limitations prevent the current implementation of Emacs Lisp to family. GNU Emacs can currently execute Elisp code either inter- be appealing for broader use. In this context, performance issues preted or byte-interpreted after it has been compiled to byte-code. represent the main bottleneck, which can be broken down in three In this work we discuss the implementation of an optimizing com- main sub-problems: piler approach for Elisp targeting native code. The native compiler • lack of true multi-threading support, employs the byte-compiler’s internal representation as input and • garbage collection speed, exploits libgccjit to achieve code generation using the GNU Com- • code execution speed. piler Collection (GCC) infrastructure. Generated executables are From now on we will focus on the last of these issues, which con- stored as binary files and can be loaded and unloaded dynamically. stitutes the topic of this work. Most of the functionality of the compiler is written in Elisp itself, The current implementation traditionally approaches the prob- including several optimization passes, paired with a C back-end lem of code execution speed in two ways: to interface with the GNU Emacs core and libgccjit. Though still a work in progress, our implementation is able to bootstrap a func- • Implementing a large number of performance-sensitive prim- tional Emacs and compile all lexically scoped Elisp files, including itive functions (also known as subr) in C.
    [Show full text]
  • An Evaluation of Go and Clojure
    An evaluation of Go and Clojure A thesis submitted in partial satisfaction of the requirements for the degree Bachelors of Science in Computer Science Fall 2010 Robert Stimpfling Department of Computer Science University of Colorado, Boulder Advisor: Kenneth M. Anderson, PhD Department of Computer Science University of Colorado, Boulder 1. Introduction Concurrent programming languages are not new, but they have been getting a lot of attention more recently due to their potential with multiple processors. Processors have gone from growing exponentially in terms of speed, to growing in terms of quantity. This means processes that are completely serial in execution will soon be seeing a plateau in performance gains since they can only rely on one processor. A popular approach to using these extra processors is to make programs multi-threaded. The threads can execute in parallel and use shared memory to speed up execution times. These multithreaded processes can significantly speed up performance, as long as the number of dependencies remains low. Amdahl‘s law states that these performance gains can only be relative to the amount of processing that can be parallelized [1]. However, the performance gains are significant enough to be looked into. These gains not only come from the processing being divvied up into sections that run in parallel, but from the inherent gains from sharing memory and data structures. Passing new threads a copy of a data structure can be demanding on the processor because it requires the processor to delve into memory and make an exact copy in a new location in memory. Indeed some studies have shown that the problem with optimizing concurrent threads is not in utilizing the processors optimally, but in the need for technical improvements in memory performance [2].
    [Show full text]
  • Programming with GNU Emacs Lisp
    Programming with GNU Emacs Lisp William H. Mitchell (whm) Mitchell Software Engineering (.com) GNU Emacs Lisp Programming Slide 1 Copyright © 2001-2008 by William H. Mitchell GNU Emacs Lisp Programming Slide 2 Copyright © 2001-2008 by William H. Mitchell Emacs Lisp Introduction A little history GNU Emacs Lisp Programming Slide 3 Copyright © 2001-2008 by William H. Mitchell Introduction GNU Emacs is a full-featured text editor that contains a complete Lisp system. Emacs Lisp is used for a variety of things: • Complete applications such as mail and news readers, IM clients, calendars, games, and browsers of various sorts. • Improved interfaces for applications such as make, diff, FTP, shells, and debuggers. • Language-specific editing support. • Management of interaction with version control systems such as CVS, Perforce, SourceSafe, and StarTeam. • Implementation of Emacs itself—a substantial amount of Emacs is written in Emacs Lisp. And more... GNU Emacs Lisp Programming Slide 4 Copyright © 2001-2008 by William H. Mitchell A little history1 Lisp: John McCarthy is the father of Lisp. The name Lisp comes from LISt Processing Language. Initial ideas for Lisp were formulated in 1956-1958; some were implemented in FLPL (FORTRAN-based List Processing Language). The first Lisp implementation, for application to AI problems, took place 1958-1962 at MIT. There are many dialects of Lisp. Perhaps the most commonly used dialect is Common Lisp, which includes CLOS, the Common Lisp Object System. See http://www-formal.stanford.edu/jmc/history/lisp/lisp.html for some interesting details on the early history of Lisp. 1 Don't quote me! GNU Emacs Lisp Programming Slide 5 Copyright © 2001-2008 by William H.
    [Show full text]
  • Allegro CL User Guide
    Allegro CL User Guide Volume 1 (of 2) version 4.3 March, 1996 Copyright and other notices: This is revision 6 of this manual. This manual has Franz Inc. document number D-U-00-000-01-60320-1-6. Copyright 1985-1996 by Franz Inc. All rights reserved. No part of this pub- lication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means electronic, mechanical, by photocopying or recording, or otherwise, without the prior and explicit written permission of Franz incorpo- rated. Restricted rights legend: Use, duplication, and disclosure by the United States Government are subject to Restricted Rights for Commercial Software devel- oped at private expense as specified in DOD FAR 52.227-7013 (c) (1) (ii). Allegro CL and Allegro Composer are registered trademarks of Franz Inc. Allegro Common Windows, Allegro Presto, Allegro Runtime, and Allegro Matrix are trademarks of Franz inc. Unix is a trademark of AT&T. The Allegro CL software as provided may contain material copyright Xerox Corp. and the Open Systems Foundation. All such material is used and distrib- uted with permission. Other, uncopyrighted material originally developed at MIT and at CMU is also included. Appendix B is a reproduction of chapters 5 and 6 of The Art of the Metaobject Protocol by G. Kiczales, J. des Rivieres, and D. Bobrow. All this material is used with permission and we thank the authors and their publishers for letting us reproduce their material. Contents Volume 1 Preface 1 Introduction 1.1 The language 1-1 1.2 History 1-1 1.3 Format
    [Show full text]
  • Lexical Scope and Function Closures +Closures.Rkt
    CS 251 SpringFall 2019 2020 Principles of of Programming Programming Languages Languages λ Ben Wood Lexical Scope and Function Closures +closures.rkt https://cs.wellesley.edu/~cs251/s20/ Lexical Scope and Function Closures 1 Topics • Lexical vs dynamic scope • Closures implement lexical scope. • Design considerations: why lexical scope? • Relevant design dimensions Lexical Scope and Function Closures 2 A question of scope (warmup) (define x 1) (define f (lambda (y) (+ x y))) (define z (let ([x 2] [y 3]) (f (+ x y)))) What is the argument value passed to this function application? Lexical Scope and Function Closures 3 A question of scope (define x 1) (define f (lambda (y) (+ x y))) (define z (let ([x 2] [y 3]) (f (+ x y)))) What is the value of x when this function body is evaluated for this function application? Lexical Scope and Function Closures 4 A question of free variables A variable, x, is free in an expression, e, if x is referenced in e outside the scope of any binding of x within e. x is a free variable (define x 1) of the lambda expression. (define f (lambda (y) (+ x y))) (define z (let ([x 2] [y 3]) (f (+ x y)))) To what bindings do free variables of a function refer when the function is applied? Lexical Scope and Function Closures 5 Answer 1: lexical (static) scope A variable, x, is free in an expression, e, if x is referenced in e outside the scope of any binding of x within e. x is a free variable (define x 1) of the lambda expression.
    [Show full text]
  • A Python Implementation for Racket
    PyonR: A Python Implementation for Racket Pedro Alexandre Henriques Palma Ramos Thesis to obtain the Master of Science Degree in Information Systems and Computer Engineering Supervisor: António Paulo Teles de Menezes Correia Leitão Examination Committee Chairperson: Prof. Dr. José Manuel da Costa Alves Marques Supervisor: Prof. Dr. António Paulo Teles de Menezes Correia Leitão Member of the Committee: Prof. Dr. João Coelho Garcia October 2014 ii Agradecimentos Agradec¸o... Em primeiro lugar ao Prof. Antonio´ Leitao,˜ por me ter dado a oportunidade de participar no projecto Rosetta com esta tese de mestrado, por todos os sabios´ conselhos e pelos momentos de discussao˜ e elucidac¸ao˜ que se proporcionaram ao longo deste trabalho. Aos meus pais excepcionais e a` minha mana preferida, por me terem aturado e suportado ao longo destes quase 23 anos e sobretudo pelo incondicional apoio durante estes 5 anos de formac¸ao˜ superior. Ao pessoal do Grupo de Arquitectura e Computac¸ao˜ (Hugo Correia, Sara Proenc¸a, Francisco Freire, Pedro Alfaiate, Bruno Ferreira, Guilherme Ferreira, Inesˆ Caetano e Carmo Cardoso), por todas as sug- estoes˜ e pelo inestimavel´ feedback em artigos e apresentac¸oes.˜ Aos amigos em Tomar (Rodrigo Carrao,˜ Hugo Matos, Andre´ Marques e Rui Santos) e em Lisboa (Diogo da Silva, Nuno Silva, Pedro Engana, Kaguedes, Clara Paiva e Odemira), por terem estado pre- sentes, duma forma ou doutra, nos essenciais momentos de lazer. A` Fundac¸ao˜ para a Cienciaˆ e Tecnologia (FCT) e ao INESC-ID pelo financiamento e acolhimento atraves´ da atribuic¸ao˜ de uma bolsa de investigac¸ao˜ no ambitoˆ dos contratos Pest-OE/EEI/LA0021/2013 e PTDC/ATP-AQI/5224/2012.
    [Show full text]
  • An Extensible Constraint-Enabled Window Manager
    Scwm: An Extensible Constraint-Enabled Window Manager Greg J. Badros Jeffrey Nichols Alan Borning gjb,jwnichls,borning @cs.washington.edu f Dept. of Computer Scienceg and Engineering University of Washington, Box 352350 Seattle, WA 98195-2350, USA Abstract powerful, and satisfying. We desired a platform for researching advanced Using C to implement a highly-interactive applica- window layout paradigms including the use of con- tion also complicates extensibility and customiz- straints. Typical window management systems ability. To add a new feature, the user likely must are written entirely in C or C++, complicating write C code, recompile, relink, and restart the extensibility and programmability. Because no ex- application before changes are finally available for isting window manager was well-suited to our goal, testing and use. This development cycle is es- we developed the Scwm window manager. In pecially problematic for software such as a win- Scwm, only the core window-management primi- dow manager that generally is expected to run for tives are written in C while the rest of the pack- weeks at a time. Additionally, maintaining all the age is implemented in its Guile/Scheme exten- features that any user desires would result in ter- sion language. This architecture, first seen in rible code bloat. Emacs, enables programming substantial new fea- tures in Scheme and provides a solid infrastructure An increasingly popular solution to these prob- for constraint-based window layout research and lems is the use of a scripting language on top of other advanced capabilities such as voice recogni- a core system that defines new domain-specific tion.
    [Show full text]
  • Basic Lisp Techniques
    Basic Lisp Techniques David J. Cooper, Jr. February 14, 2011 ii 0Copyright c 2011, Franz Inc. and David J. Cooper, Jr. Foreword1 Computers, and the software applications that power them, permeate every facet of our daily lives. From groceries to airline reservations to dental appointments, our reliance on technology is all-encompassing. And, it’s not enough. Every day, our expectations of technology and software increase: • smart appliances that can be controlled via the internet • better search engines that generate information we actually want • voice-activated laptops • cars that know exactly where to go The list is endless. Unfortunately, there is not an endless supply of programmers and developers to satisfy our insatiable appetites for new features and gadgets. Every day, hundreds of magazine and on-line articles focus on the time and people resources needed to support future technological expectations. Further, the days of unlimited funding are over. Investors want to see results, fast. Common Lisp (CL) is one of the few languages and development options that can meet these challenges. Powerful, flexible, changeable on the fly — increasingly, CL is playing a leading role in areas with complex problem-solving demands. Engineers in the fields of bioinformatics, scheduling, data mining, document management, B2B, and E-commerce have all turned to CL to complete their applications on time and within budget. CL, however, no longer just appropriate for the most complex problems. Applications of modest complexity, but with demanding needs for fast development cycles and customization, are also ideal candidates for CL. Other languages have tried to mimic CL, with limited success.
    [Show full text]
  • Download Introduction to LISP and Symbol Manipulation, Sharam
    Introduction to LISP and symbol manipulation, Sharam Hekmatpour, Prentice Hall, 1988, 0134861922, 9780134861920, 303 pages. DOWNLOAD HERE Lisp , Paul M. Chirlian, 1986, Computers, 303 pages. The new UCI LISP manual , James Richard Meehan, Jun 1, 1979, Computers, 366 pages. Lisp machine manual , Richard Stallman, Daniel Weinreb, David Moon, 1984, Computers, 859 pages. LISP, the language of artificial intelligence , A. A. Berk, 1985, Computers, 160 pages. Common LISP A Gentle Introduction to Symbolic Computation, David S. Touretzky, 2013, Computers, 600 pages. Highly accessible treatment covers cons cell structures, evaluation rules, programs as data, recursive and applicable programming styles. Nearly 400 illustrations, answers to .... The T programming language a dialect of LISP, Stephen Slade, 1987, Computers, 425 pages. An Introduction to Programming in Emacs Lisp , Robert J. Chassell, Jan 1, 2004, , 289 pages. Introduction to ADA , Paul M. Chirlian, 1984, Computers, 291 pages. Has Been Written Easy Enough for the Beginner to Understand, Yet Comprehensive Enough for the Experienced Programmer. Includes Programs & Exercises. Syntactic extensions in the programming language LISP , Eugene Edmund Kohlbecker, 1986, Computers, 216 pages. The programmer's introduction to LISP , Ward Douglas Maurer, 1972, Computers, 112 pages. It's simply a WONDERFUL title on LISP. I got the opportunity to work on Lisp firstly during my Graduate, then during Doctoral Studies, both at Jawaharlal Nehru University, New Delhi, and finally while teaching graduate students of Computer Science at Punjabi University Patiala, Punjab, India, where I used this book as the main text book in the classroom. The book is very lucid, precise, and includes meaningful exercises and projects at the end of each chapter.
    [Show full text]
  • Reporting the Experience Jean-Michel Hufflen
    mlBibTeX: Reporting the Experience Jean-Michel Hufflen To cite this version: Jean-Michel Hufflen. mlBibTeX: Reporting the Experience. TUGB, 2007, pp.157–162. hal-00644467 HAL Id: hal-00644467 https://hal.archives-ouvertes.fr/hal-00644467 Submitted on 24 Nov 2011 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. ∗ MlBibTEX: Reporting the Experience Jean-Michel HUFFLEN LIFC (EA CNRS 4157) University of Franche-Comté 16, route de Gray 25030 BESANÇON CEDEX FRANCE [email protected] http://lifc.univ-fcomte.fr/~hufflen Abstract This article reports how the different steps of the MlBibTEX project were con- ducted until the first public release. We particularly focus on the problems raised by reimplementing a program (BibTEX) that came out in the 1980’s. Since this time, implementation techniques have evolved, new requirements have appeared, as well as new programs within TEX’s galaxy. Our choices are explained and discussed. Keywords TEX, LATEX, BibTEX, reimplementation, reverse engineering, im- plementation language, program update. Streszczenie Artykuł omawia realizację poszczególnych kroków przedsięwzięcia MlBibTEX, w czasie do przedstawienia pierwszej publicznej wersji. W szczególności skupiamy się na problemach powstałych przy reimplementacji programu (BibTEX), powsta- łego w latach 80 zeszłego wieku.
    [Show full text]
  • LISP a Programmable Programming Language
    LISP A Programmable Programming Language Christoph Müller 25.01.2017 Offenes Kolloquium für Informatik Agenda 1. Why Lisp? 2. The Basics of Lisp 3. Macros in Action 4. Tools and Platforms 5. Literature and more obscure Lisp dialects 6. Why it never (really) caught on 7. Bonus - A bit of History 1 Why Lisp? Timeless • When we talk about Lisp we talk about a language family • One of the oldest (∼ 1958) language families still in use today (only Fortran is older) • The Syntax is by its very nature timeless 2 Innovator • Garbage Collection • Homoiconicity (Code is Data) • Higher Order Functions • Dynamic Typing • Read Evaluate Print Loop (REPL) • Multiple Dispatch • And many more ... 3 Scheme - A Language for Teaching • Scheme was used as an introductory Language in famous Universities like MIT (6.001) • Extremely small language core • Great for learning to build your own abstractions 4 Picking a Language for this Talk Lets look at the most popular Lisp dialects on GitHub (provided by GitHut): GitHub Popuplarity Rank Language 20 Emacs Lisp 23 Clojure 40 Scheme 42 Common Lisp 48 Racket Clojure with its JVM heritage and Scheme with its focus on a small core will be used throughout this talk. 5 The Basics of Lisp The name giving lists • The basis of lisp is the s(ymbolic)-expression • Either a atom or a list • Atoms are either symbols or literals • Every element of a list is either an atom or another list • Elements are separated by whitespace and surrounded with parentheses • The first element of a (to be evaluated) list has to be what we will call a verb in this talk ;atoms x 12 ;lists (+ 1 2 3) (+ (* 2 3) 3) 6 What is a verb? • A verb is either a • A function • A macro • A special form • Special forms include if, fn, loop, recur etc.
    [Show full text]
  • Einführung in LISP
    Einführung in LISP Simon Lutz, Frank Preiswerk “Real Programmers don't write in LISP. Only idiots' programs contain more parenthesis than actual code.” “Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.” 04/19/06 Seminar 10 Programmiersprachen - Lisp/Scheme - Simon Lutz, Frank Preiswerk 1 Zeitlicher Überblick 1958: Lisp wurde von John McCarthy am MIT speziell für nicht-numerische Probleme designed und von Steve Russell auf einer IBM 704 Maschine implementiert. Der Name bedeutet “List Processing Language”. 1968: Erster Lisp Compiler geschrieben in Lisp von Tim Hart und Mike Levin. 1968-70: Implementation von SHRDLU mittels Lisp, berühmtes AI-System. 1970er Jahre: Performanz von bestehenden Lisp-Systemen wird zum Thema, es entstehen optimierte Lisp-Maschinen. Heute wieder verschwunden. 1980er – 1990er Jahre: Bemühungen für eine Vereinheitlichung der vielen bestehenden Lisp-Dialekte: Common Lisp entsteht. 1994: ANSI veröffentlicht Common Lisp Standard. Dies zu einem Zeitpunkt, als der Weltmarkt für Lisp viel kleiner war als in den früheren Zeiten. 04/19/06 Seminar 10 Programmiersprachen - Lisp/Scheme - Simon Lutz, Frank Preiswerk 2 Lisp heute Nach einem Rückgang in den 90er Jahren ist das Interesse seit 2000 wieder gestiegen, massgeblich im Rahmen von Open Source Implementationen von Common Lisp. 2004: Peter Seibel’s “Practical Common Lisp” ist für kurze Zeit an zweiter Stelle von Amazon’s populärsten Programmierbüchern. April 2006: Tiobe Software rankt Lisp auf Platz 14 der populärsten Programmiersprachen. Neue “Lisper” beschreiben die Sprache gerne als “eye-opening experience” und behaupten, in Lisp deutlich produktiver zu sein als in anderen Sprachen.
    [Show full text]