proj-plbook-plChOtherFeatures

Table of Contents for Programming Languages: a survey

Chapter : runtime features

separate stacks

erlang

chapter: compilation/interpretation

compilation

interpretation

static and dynamic linking

bytecode

some platforms have bytecode by default but also support native code generation (e.g. .Net: http://msdn.microsoft.com/en-us/library/6t9t5wcf%28v=VS.80%29.aspx )

just-in-time compilation

debugging

crashing

stack trace

core dump

DWIM

DWIM stands for Do What I Mean. It was a feature of an old Lisp dialect called Interlisp. In this dialect, the compiler/interpreter would, upon encountering an error, attempt to 'patch up' the program to do something sensible. For example, DWIM might correct DEFINEQ((FACTORIAL (LAMBDA (N) (IFFN=0 THENN 1 ESLE N*8FACTTORIALNN-1)))) to DEFINEQ((FACTORIAL (LAMBDA (N) (IF N=0 THEN 1 ELSE N*(FACTORIAL N-1))))) (example from http://extravagaria.com/Files/HOPL2-Uncut.pdf ).

According to Thomas Bushnell in a discussion in March 2002 on comp.lang.lisp ( https://groups.google.com/d/msg/comp.lang.lisp/OoGwrUcibTY/oHlRSOARXDQJ ), "DWIM was a great experiment, I think; in the sense that it was worth trying, and produced a fairly clear conclusion: "bzzt, not the right way.". According to Kent Pitman in http://www.nhplace.com/kent/Papers/cl-untold-story.html , a desire to have an ARPA-funded Lisp which did not have DWIM was one of the motivations for Common Lisp (http://www.nhplace.com/kent/Papers/cl-untold-story.html , as well as the March 2002 comp.lang.lisp discussion ( https://groups.google.com/d/msg/comp.lang.lisp/OoGwrUcibTY/AHhj1Jk0DdIJ )).

One complaint about DWIM from Thomas Bushnell was that "DWIM has a near-disastrous non-locality effect. A given piece of code will be patched up to look "sane" given the current feature set of the system. But when the feature set changes, the "nearest sane patchup" may well be very different." ( https://groups.google.com/d/msg/comp.lang.lisp/OoGwrUcibTY/oHlRSOARXDQJ )

According to Kent Pitman in ( https://groups.google.com/d/msg/comp.lang.lisp/OoGwrUcibTY/AHhj1Jk0DdIJ ), there were various horror stories involving DWIM, and "One of them I heard went like this (and again, I can't even say if this is an actual story of what DWIM would do but it gives you the idea of what it had license to do and why people both liked and feared it): A user didn't know how to use the DECL facility so figured they would just say (DECL) and that DWIM would help them. [This shows the trust aspect of a user who likes DWIM.] DWIM realized that DECL was not actually a function name so searched for a name to substitute that was better. It found DEL. [I think that was the name. It's been many years now and I'm doing this from memory. The function it found deletes files, anyway.] DEL isn't a function of no args so DWIM "helpfully" assumed (DEL NIL) to pad out a good number of args. But NIL was a wrong type of argument, so DWIM concluded a wildcard would be most appropriate ... Well, you get the idea. A lot of people just wanted DWIM turned off, and you can sort of see why. If you think Common Lisp has fuzzy semantics, or you think some of my stories about Maclisp make it sound like the unruly wild, wild west of Lisp, you should think of Interlisp as all the more --- well, not unruly but weirdly ruly.

BUT, you couldn't just turn DWIM off because it had been around a long time and lots of code needed it to survive."

Seeing lower-level implementation

In Python you can see Python bytecode with 'dis'. In Ruby you can see bytecode with http://www.ruby-doc.org/core-2.1.0/RubyVM/InstructionSequence.html . You can see assembly in Julia with code_llvm and code_native, and in Common Lisp with 'disassemble'.

In Common Lisp you can add extra optimization to certain functions by e.g. '(optimize speed (safety 0) (debug 0))' (see e.g. https://news.ycombinator.com/item?id=7120683 ).

Chapter : other contributors to language success

library breadth quality selection of canonical libraries

packaging

community

momentum, momentum at the top (absent dictator?)

license

openness

best practices

not scary

IDEs

  typing helps

Some features of some IDEs: