text:
Optimizing compiler

An optimizing compiler is a compiler designed to generate code that is optimized in aspects such as minimizing program execution time, memory use, storage size, and power consumption.

Optimization is generally implemented as a sequence of optimizing transformations, algorithms that transform code to produce semantically equivalent code optimized for some aspect.

Optimization is generally CPU and memory intensive. In practice, factors such as available memory and a programmer's willingness to wait for compilation limit the optimizations that a compiler might provide.

Research indicates that some optimization problems are NP-complete, or even undecidable.

In general, optimization cannot produce optimal output, and in fact, is impossible in a general sense since optimizing for one aspect may degrade performance for another. Rather, optimizations are heuristic methods for improving resource usage in typical programs.

Categorization
Optimizations are categorized in various, overlapping ways.

Local vs. global scope
Scope describes how much of the input code is considered to apply an optimization.

Local scope optimizations use information local to a basic block. Since basic blocks have no control flow, these optimizations need very little analysis, saving time and reducing storage requirements, but this also means that no information is preserved across jumps.

Global scope optimizations, a.k.a. intraprocedural methods, act on whole functions. This gives them more information to work with, but often makes expensive computations necessary. Worst case assumptions have to be made when function calls occur or global variables are accessed because little information about them is available.

Peephole optimization
Peephole optimizations are usually performed late in the compilation process after machine code has been generated. This optimization examines a few adjacent instructions (like "looking through a peephole" at the code) to see whether they can be replaced by a single instruction or a shorter sequence of instructions. For instance, a multiplication of a value by 2 might be more efficiently executed by left-shifting the value or by adding the value to itself (this example is also an instance of strength reduction).

Interprocedural optimization
Interprocedural optimizations analyze all of a program's source code. The greater the quantity of information consumed; the more effective the optimizations can be. The information can be used for various optimizations including function inlining, where a call to a function is replaced by a copy of the function body.

Link-time optimization
Link-time optimization (LTO), a.k.a. whole-program optimization, is a more general class of interprocedural optimization. During LTO, the compiler has visibility across translation units which allows it to perform more aggressive optimizations like cross-module inlining and devirtualization.

Machine and object code optimization
Machine code optimization uses an object code optimizer to analyze the executable task image of the program after all of an executable machine code has been linked. Some of the techniques that can be applied in a more limited scope, such as macro compression which saves space by collapsing common sequences of instructions, are more effective when the entire executable task image is available for analysis.

Language-independent vs. language-dependent
Most high-level programming languages share common programming constructs and abstractions: branching (if, switch), looping (for, while), and encapsulation (structures, objects). Thus, similar optimization techniques can be used across languages. However, certain language features make some optimizations difficult. For instance, pointers in C and C++ make array optimization difficult (see alias analysis). However, languages such as PL/I that also support pointers do have optimizations for arrays. Conversely, some language features make certain optimizations easier. For example, in some languages, functions are not permitted to have side effects. Therefore, if a program makes several calls to the same function with the same arguments, the compiler can infer that the function's result need be computed only once. In languages where functions are allowed to have side effects, the compiler can restrict such optimization to functions that it can determine have no side-effects.

Machine-independent vs. machine-dependent
Many optimizations that operate on abstract programming concepts (loops, objects, structures) are independent of the machine targeted by the compiler, but many of the most effective optimizations are those that best exploit special features of the target platform. Examples are instructions which do several things at once, such as decrement register and branch if not zero.

The following is an instance of a local machine dependent optimization. To set a register to 0, the obvious way is to use the constant '0' in an instruction that sets a register value to a constant. A less obvious way is to XOR a register with itself. It is up to the compiler to know which instruction variant to use. On many RISC machines, both instructions would be equally appropriate, since they would both be the same length and take the same time. On many other microprocessors such as the Intel x86 family, it turns out that the XOR variant is shorter and probably faster, as there will be no need to decode an immediate operand, nor use the internal "immediate operand register". A potential problem with this is that XOR may introduce a data dependency on the previous value of the register, causing a pipeline stall. However, processors often have XOR of a register with itself as a special case that does not cause stalls.

Factors affecting optimization

 * Target machine: Choices about which optimizations can and should be applied depend on characteristics of the target machine. Some compilers such as GCC and Clang parameterize machine dependent factors so that they can be used to optimize for different machines.

 * Target CPU architecture:

 * Number of registers: Registers can be used to optimize for performance. Local variables can be stored in registers instead of the stack. Temporary/intermediate results can be accessed in registers instead of slower memory.

 * RISC vs. CISC: CISC instruction sets often have variable instruction lengths, often have a larger number of possible instructions that can be used, and each instruction could take differing amounts of time. RISC instruction sets attempt to limit the variability in each of these: instruction sets are usually constant length, with few exceptions, there are usually fewer combinations of registers and memory operations, and the instruction issue rate (the number of instructions completed per time period, usually an integer multiple of the clock cycle) is usually constant in cases where memory latency is not a factor. There may be several ways of carrying out a certain task, with CISC usually offering more alternatives than RISC. Compilers have to know the relative costs among the various instructions and choose the best instruction sequence (see instruction selection).

 * Pipelines: A pipeline is essentially a CPU broken up into an assembly line. It allows use of parts of the CPU for different instructions by breaking up the execution of instructions into various stages: instruction decode, address decode, memory fetch, register fetch, compute, register store, etc. One instruction could be in the register store stage, while another could be in the register fetch stage. Pipeline conflicts occur when an instruction in one stage of the pipeline depends on the result of another instruction ahead of it in the pipeline but not yet completed. Pipeline conflicts can lead to pipeline stalls: where the CPU wastes cycles waiting for a conflict to resolve. Compilers can schedule, or reorder, instructions so that pipeline stalls occur less frequently.

 * Number of functional units: Some CPUs have several ALUs and FPUs that allow them to execute multiple instructions simultaneously. There may be restrictions on which instructions can pair with which other instructions ("pairing" is the simultaneous execution of two or more instructions), and which functional unit can execute which instruction. They also have issues similar to pipeline conflicts. Instructions can be scheduled so that the functional units are fully loaded.

 * Machine architecture

 * CPU cache size and type (direct mapped, 2-/4-/8-/16-way associative, fully associative): Techniques such as inline expansion and loop unrolling may increase the size of the generated code and reduce code locality. The program may slow down drastically if a highly utilized section of code (like inner loops in various algorithms) suddenly cannot fit in the cache. Also, caches which are not fully associative have higher chances of cache collisions even in an unfilled cache.

 * Cache/memory transfer rates: These give the compiler an indication of the penalty for cache misses. This is used mainly in specialized applications.

 * Intended use

 * Debugging: During development, optimizations are often disabled to speed compilation and since optimized code can be challenging to debug. Optimizing transformations, particularly those that reorder code, can make it difficult to relate the executable code to the source code.

 * General-purpose use: Prepackaged software is often expected to run on a variety of machines that may share the same instruction set, but have different performance characteristics. The code may not be optimized to any particular machine, or may be tuned to work best on the most popular machine while working less optimally on others.

 * Special-purpose use: If the software is compiled for machines with uniform characteristics, then the compiler can heavily optimize the generated code to those machines.

 * Notable cases include code designed for parallel and vector processors, for which special parallelizing compilers are used.

 * Firmware for an embedded system can be optimized for the target CPU and memory. System cost or reliability may be more important than the code speed. For example, compilers for embedded software usually offer options that reduce code size at the expense of speed. The code's timing may need to be predictable, rather than as fast as possible, so code caching might be disabled, along with compiler optimizations that require it.

Common themes
Optimization includes the following, sometimes conflicting themes.

 * Optimize the common case: The common case may have unique properties that allow a fast path at the expense of a slow path. If the fast path is taken most often, the result is better overall performance.
 * Avoid redundancy: Reuse results that are already computed and store them for later use, instead of recomputing them.
 * Less code: Remove unnecessary computations and intermediate values. Less work for the CPU, cache, and memory usually results in faster execution. Alternatively, in embedded systems, less code brings a lower product cost.
 * Fewer jumps by using straight line code, also called branch-free code: Less complicated code. Jumps (conditional or unconditional branches) interfere with the prefetching of instructions, thus slowing down code. Using inlining or loop unrolling can reduce branching, at the cost of increasing binary file size by the length of the repeated code. This tends to merge several basic blocks into one.
 * Locality: Code and data that are accessed closely together in time should be placed close together in memory to increase spatial locality of reference.
 * Exploit the memory hierarchy: Accesses to memory are increasingly more expensive for each level of the memory hierarchy, so place the most commonly used items in registers first, then caches, then main memory, before going to disk.
 * Parallelize: Reorder operations to allow multiple computations to happen in parallel, either at the instruction, memory, or thread level.
 * More precise information is better: The more precise the information the compiler has, the better it can employ any or all of these optimization techniques.
 * Runtime metrics can help: Information gathered during a test run can be used in profile-guided optimization. Information gathered at runtime, ideally with minimal overhead, can be used by a JIT compiler to dynamically improve optimization.
 * Strength reduction: Replace complex or difficult or expensive operations with simpler ones. For example, replacing division by a constant with multiplication by its reciprocal, or using induction variable analysis to replace multiplication by a loop index with addition.

Loop optimizations
Loop optimization acts on the statements which make up a loop, such as a for loop, for example loop-invariant code motion. Loop optimizations can have a significant impact because many programs spend a large percentage of their time inside loops.

Some optimization techniques primarily designed to operate on loops include:

 * Induction variable analysis: Roughly, if a variable in a loop is a simple linear function of the index variable, such as, it can be updated appropriately each time the loop variable is changed. This is a strength reduction, and also may allow the index variable's definitions to become dead code. This information is also useful for bounds-checking elimination and dependence analysis, among other things.

 * Loop fission or loop distribution: Loop fission attempts to break a loop into multiple loops over the same index range but each taking only a part of the loop's body. This can improve locality of reference, both of the data being accessed in the loop and the code in the loop's body.

 * Loop fusion or loop combining or loop ramming or loop jamming : Another technique which attempts to reduce loop overhead. When two adjacent loops would iterate the same number of times regardless of whether that number is known at compile time, their bodies can be combined as long as they make no reference to each other's data.

 * Loop inversion: This technique changes a standard while loop into a do/while (also known as repeat/until) loop wrapped in an if conditional, reducing the number of jumps by two, for cases when the loop is executed. Doing so duplicates the condition check (increasing the size of the code), but is more efficient because jumps usually cause a pipeline stall. Additionally, if the initial condition is known at compile-time and is known to be side-effect-free, the if guard can be skipped.

 * Loop interchange: These optimizations exchange inner loops with outer loops. When the loop variables index into an array, such a transformation can improve locality of reference, depending on the array's layout.

 * Loop-invariant code motion: If a quantity is computed inside a loop during every iteration, and its value is the same for each iteration, it can vastly improve efficiency to hoist it outside the loop and compute its value just once before the loop begins. This is particularly important with the address-calculation expressions generated by loops over arrays. For correct implementation, this technique must be used with loop inversion, because not all code is safe to be hoisted outside the loop.

 * Loop nest optimization: Some pervasive algorithms such as matrix multiplication have very poor cache behavior and excessive memory accesses. Loop nest optimization increases the number of cache hits by performing the operation over small blocks and by using a loop interchange.

 * Loop reversal: Loop reversal reverses the order in which values are assigned to the index variable. This is a subtle optimization which can help eliminate dependencies and thus enable other optimizations. Furthermore, on some architectures, loop reversal contributes to smaller code, as when the loop index is being decremented, the condition that needs to be met in order for the running program to exit the loop is a comparison with zero. This is often a special, parameter-less instruction, unlike a comparison with a number, which needs the number to compare to. Therefore, the amount of bytes needed to store the parameter is saved by using the loop reversal. Additionally, if the comparison number exceeds the size of word of the platform, in standard loop order, multiple instructions would need to be executed in order to evaluate the comparison, which is not the case with loop reversal.

 * Loop unrolling: Unrolling duplicates the body of the loop multiple times, in order to decrease the number of times the loop condition is tested and the number of jumps, which hurt performance by impairing the instruction pipeline. A "fewer jumps" optimization. Completely unrolling a loop eliminates all overhead, but requires that the number of iterations be known at compile time.

 * Loop splitting: Loop splitting attempts to simplify a loop or eliminate dependencies by breaking it into multiple loops which have the same bodies but iterate over different contiguous portions of the index range. A useful special case is loop peeling, which can simplify a loop with a problematic first iteration by performing that iteration separately before entering the loop.

 * Loop unswitching: Unswitching moves a conditional from inside a loop to outside the loop by duplicating the loop's body inside each of the if and else clauses of the conditional.

 * Software pipelining: The loop is restructured in such a way that work done in an iteration is split into several parts and done over several iterations. In a tight loop, this technique hides the latency between loading and using values.

 * Automatic parallelization: A loop is converted into multi-threaded or vectorized (or even both) code in order to utilize multiple processors simultaneously in a shared-memory multiprocessor (SMP) machine, including multi-core machines.

Prescient store optimizations
Prescient store optimizations allow store operations to occur earlier than would otherwise be permitted in the context of threads and locks. The process needs some way of knowing ahead of time what value will be stored by the assignment that it should have followed. The purpose of this relaxation is to allow compiler optimization to perform certain kinds of code rearrangement that preserve the semantics of properly synchronized programs.

Data-flow optimizations
Data-flow optimizations, based on data-flow analysis, primarily depend on how certain properties of data are propagated by control edges in the control-flow graph. Some of these include:

 * Common subexpression elimination: In the expression, "common subexpression" refers to the duplicated  . Compilers implementing this technique realize that   will not change, and so only calculate its value once.

 * Constant folding and propagation: replacing expressions consisting of constants (e.g., ) with their final value  at compile time, rather than doing the calculation in run-time. Used in most modern languages.

 * Induction variable recognition and elimination: see discussion above about induction variable analysis.

 * Alias classification and pointer analysis: in the presence of pointers, it is difficult to make any optimizations at all, since potentially any variable can have been changed when a memory location is assigned to. By specifying which pointers can alias which variables, unrelated pointers can be ignored.

 * Dead-store elimination: removal of assignments to variables that are not subsequently read, either because the lifetime of the variable ends or because of a subsequent assignment that will overwrite the first value.

SSA-based optimizations
These optimizations are intended to be done after transforming the program into a special form called Static Single Assignment, in which every variable is assigned in only one place. Although some function without SSA, they are most effective with SSA. Many optimizations listed in other sections also benefit with no special changes, such as register allocation.

 * Global value numbering: GVN eliminates redundancy by constructing a value graph of the program, and then determining which values are computed by equivalent expressions. GVN is able to identify some redundancy that common subexpression elimination cannot, and vice versa.

 * Sparse conditional constant propagation: Combines constant propagation, constant folding, and dead-code elimination, and improves upon what is possible by running them separately. This optimization symbolically executes the program, simultaneously propagating constant values and eliminating portions of the control-flow graph that this makes unreachable.

Code generator optimizations

 * Register allocation: The most frequently used variables should be kept in processor registers for fastest access. To find which variables to put in registers, an interference-graph is created. Each variable is a vertex and when two variables are used at the same time (have an intersecting liverange) they have an edge between them. This graph is colored using for example Chaitin's algorithm using the same number of colors as there are registers. If the coloring fails one variable is "spilled" to memory and the coloring is retried.

 * Instruction selection: Most architectures, particularly CISC architectures and those with many addressing modes, offer several different ways of performing a particular operation, using entirely different sequences of instructions. The job of the instruction selector is to do a good job overall of choosing which instructions to implement which operators in the low-level intermediate representation with. For example, on many processors in the 68000 family and on the x86 architecture, complex addressing modes can be used in statements like "lea 25(a1,d5*4), a0", allowing a single instruction to perform a significant amount of arithmetic with less storage.

 * Instruction scheduling: Instruction scheduling is an important optimization for modern pipelined processors, which avoids stalls or bubbles in the pipeline by clustering instructions with no dependencies together, while being careful to preserve the original semantics.

 * Rematerialization: Rematerialization recalculates a value instead of loading it from memory, preventing a memory access. This is performed in tandem with register allocation to avoid spills.

 * Code factoring: If several sequences of code are identical, or can be parameterized or reordered to be identical, they can be replaced with calls to a shared subroutine. This can often share code for subroutine set-up and sometimes tail-recursion.

 * Trampolines: Many CPUs have smaller subroutine call instructions to access low memory. A compiler can save space by using these small calls in the main body of code. Jump instructions in low memory can access the routines at any address. This multiplies space savings from code factoring.

 * Reordering computations: Based on integer linear programming, restructuring compilers enhance data locality and expose more parallelism by reordering computations. Space-optimizing compilers may reorder code to lengthen sequences that can be factored into subroutines.

Functional language optimizations
Although many of these also apply to non-functional languages, they either originate in or are particularly critical in functional languages such as Lisp and ML.

 * Tail-call optimization: A function call consumes stack space and involves some overhead related to parameter passing and flushing the instruction cache. Tail-recursive algorithms can be converted to iteration through a process called tail-recursion elimination or tail-call optimization.

 * Deforestation (data structure fusion): In languages where it is common for a sequence of transformations to be applied to a list, deforestation attempts to remove the construction of intermediate data structures.

 * Partial evaluation

Other optimizations

 * Bounds-checking elimination: Many languages, such as Java, enforce bounds checking of all array accesses. This is a severe performance bottleneck on certain applications such as scientific code. Bounds-checking elimination allows the compiler to safely remove bounds checking in many situations where it can determine that the index must fall within valid bounds; for example, if it is a simple loop variable.

 * Branch-offset optimization (machine dependent): Choose the shortest branch displacement that reaches the target.

 * Code-block reordering: Code-block reordering alters the order of the basic blocks in a program in order to reduce conditional branches and improve locality of reference.

 * Dead-code elimination: Removes instructions that will not affect the behaviour of the program, for example definitions which have no uses, called dead code. This reduces code size and eliminates unnecessary computation.

 * Factoring out of invariants (loop invariants): If an expression is carried out both when a condition is met and is not met, it can be written just once outside of the conditional statement. Similarly, if certain types of expressions (e.g., the assignment of a constant into a variable) appear inside a loop, they can be moved out of it because their effect will be the same no matter if they're executed many times or just once. This is also known as total redundancy elimination. A similar but more powerful optimization is partial-redundancy elimination (PRE).

 * Inline expansion or macro expansion: When some code invokes a procedure, it is possible to directly insert the body of the procedure inside the calling code rather than transferring control to it. This saves the overhead related to procedure calls, as well as providing an opportunity for many different parameter-specific optimizations, but comes at the cost of space; the procedure body is duplicated each time the procedure is called inline. Generally, inlining is useful in performance-critical code that makes a large number of calls to small procedures. A "fewer jumps" optimization. The statements of imperative programming languages are also an example of such an optimization. Although statements could be implemented with function calls they are almost always implemented with code inlining.

 * Jump threading: In this optimization, consecutive conditional jumps predicated entirely or partially on the same condition are merged.
 * E.g., to ,
 * and to.

 * Macro compression: A space optimization that recognizes common sequences of code, creates subprograms ("code macros") that contain the common code, and replaces the occurrences of the common code sequences with calls to the corresponding subprograms. This is most effectively done as a machine code optimization, when all the code is present. The technique was first used to conserve space in an interpretive byte stream used in an implementation of Macro Spitbol on microcomputers. The problem of determining an optimal set of macros that minimizes the space required by a given code segment is known to be NP-complete, but efficient heuristics attain near-optimal results.

 * Reduction of cache collisions: (e.g., by disrupting alignment within a page)

 * Stack-height reduction: Rearrange expression tree to minimize resources needed for expression evaluation.

 * Test reordering: If we have two tests that are the condition for something, we can first deal with the simpler tests (e.g., comparing a variable to something) and only then with the complex tests (e.g., those that require a function call). This technique complements lazy evaluation, but can be used only when the tests are not dependent on one another. Short-circuiting semantics can make this difficult.

Interprocedural optimizations
Interprocedural optimization works on the entire program, across procedure and file boundaries. It works tightly with intraprocedural counterparts, carried out with the cooperation of a local part and global part. Typical interprocedural optimizations are: procedure inlining, interprocedural dead-code elimination, interprocedural constant propagation, and procedure reordering. As usual, the compiler needs to perform interprocedural analysis before its actual optimizations. Interprocedural analyses include alias analysis, array access analysis, and the construction of a call graph.

Interprocedural optimization is common in modern commercial compilers from SGI, Intel, Microsoft, and Sun Microsystems. For a long time, the open source GCC was criticized for a lack of powerful interprocedural analysis and optimizations, though this is now improving. Another open source compiler with full analysis and optimization infrastructure is Open64.

Due to the extra time and space required by interprocedural analysis, most compilers do not perform it by default. Users must use compiler options explicitly to tell the compiler to enable interprocedural analysis and other expensive optimizations.

Practical considerations
There can be a wide range of optimizations that a compiler can perform, ranging from the simple and straightforward that take little compilation time to the elaborate and complex that involve considerable amounts of compilation time. Accordingly, compilers often provide options to their control command or procedure to allow the compiler user to choose how much optimization to request; for instance, the IBM FORTRAN H compiler allowed the user to specify no optimization, optimization at the registers level only, or full optimization. By the 2000s, it was common for compilers, such as Clang, to have a number of compiler command options that could affect a variety of optimization choices, starting with the familiar  switch.

An approach to isolating optimization is the use of so-called post-pass optimizers (some commercial versions of which date back to mainframe software of the late 1970s). These tools take the executable output by an optimizing compiler and optimize it even further. Post-pass optimizers usually work on the assembly language or machine code level (in contrast with compilers that optimize intermediate representations of programs). One such example is the Portable C Compiler (pcc) of the 1980s, which had an optional pass that would perform post-optimizations on the generated assembly code.

Another consideration is that optimization algorithms are complicated and, especially when being used to compile large, complex programming languages, can contain bugs that introduce errors in the generated code or cause internal errors during compilation. Compiler errors of any kind can be disconcerting to the user, but especially so in this case, since it may not be clear that the optimization logic is at fault. In the case of internal errors, the problem can be partially ameliorated by a "fail-safe" programming technique in which the optimization logic in the compiler is coded such that a failure is trapped, a warning message issued, and the rest of the compilation proceeds to successful completion.

History
Early compilers of the 1960s were often primarily concerned with simply compiling code correctly or efficiently, such that compile times were a major concern. One notable early optimizing compiler was the IBM FORTRAN H compiler of the late 1960s. Another of the earliest and important optimizing compilers, that pioneered several advanced techniques, was that for BLISS (1970), which was described in The Design of an Optimizing Compiler (1975). By the late 1980s, optimizing compilers were sufficiently effective that programming in assembly language declined. This co-evolved with the development of RISC chips and advanced processor features such as instruction scheduling and speculative execution, which were designed to be targeted by optimizing compilers rather than by human-written assembly code.

List of static code analyses

 * Alias analysis
 * Pointer analysis
 * Shape analysis
 * Escape analysis
 * Array-access analysis
 * Dependence analysis
 * Control-flow analysis
 * Data-flow analysis
 * Use-define chain analysis
 * Live-variable analysis
 * Available expression analysis

title: Optimizing compiler


text:
Talk:The Cathedral and the Bazaar

Wiki Education Foundation-supported course assignment
This article was the subject of a Wiki Education Foundation-supported course assignment, between 14 August 2019 and 7 December 2019. Further details are available on the course page. Peer reviewers: KyannaYeager.

Above undated message substituted from Template:Dashboard.wikiedu.org assignment by PrimeBOT (talk) 11:00, 17 January 2022 (UTC)

Title
I'm curious - I haven't read this book - but who is the Accidental Revolutionary in the title? One would assume it is Torvalds, but the title reads like it is Raymond. kibibu 07:40, 18 October 2005 (UTC)
 * It's definitely ESR (who has a habit of sometimes slightly over-estimating his worth). I think he is referring to the revolution that his essay caused (including the release of the Netscape source code) and his involvement in the birth of the open-source movement (as distinct from the existing free software movement).  The expression could, of course, equally apply to Torvalds or Stallman.  In fact, I cannot think of a revolutionary in any field who wasn't to some extent accidental. --Joe Llywelyn Griffith Blakesley talk contrib 17:54, 26 February 2006 (UTC)
 * I agree, modesty doesn't appear to be his strong point. Given there was already a Free software movement, perhaps he's more of an accidental evolutionary . kibibu 06:03, 8 May 2006 (UTC)
 * Or maybe it's just hyperbole from the publisher, put on the front of a book to help sell it... --Dilaudid 11:41, 8 February 2007 (UTC)

Bolox
Is it just a load of bolox though? — Preceding unsigned comment added by 31.111.60.43 (talk) 08:33, 4 April 2022 (UTC)

Microsoft
is the comment about microsoft relevent?

This text was removed:
 * Many people see Microsoft Corporation as the epitome of the closed source model, with all it's attendant reduction in software quality.

I am not at all a fan of MS software or their business practices (especially their business practices) either. But this seems like an unnecessary jab at Microsoft. Did Raymond really make such a statement in his essay? If he did, then the above statement needs to be changed to reflect this (and made NPOV). If he didn't, then this statement is off-topic and not appropriate (remember, this is an article about the essay, not about microsoft -- see What Wikipedia is not #6). maveric149

 * I thought I might get picked up on this one. I'm not going to put the sentence back, however, FWIW, I don't agree. Raymond did not make such a statement, but the statement is clearly editorial. What's more it is quite clearly defensible - many people do agree with the statement - read a little of Bruce Schneier and the Gartner Group. Even Bill Gates has admitted there are way too many security flaws and bugs in Microsoft's products, so it doesn't take too much to connect Raymond's essay with this effect. So the statement is NOT "off-topic" (whatever that is in an encyclopedia!). I disagree that it is inappropriate.

 * There is also the argument that to preserve a NPOV it is necessary to illustrate both sides of the case. I see that What Wikipedia is not #6 includes the text: But an article can of course report objectively on what advocates say. This is what I was doing. Please read the What Wikipedia is not before quoting it.

 * I do agree that the sentence is a bit inflammatory (well, it inflamed you, didn't it :-)) and this serves to divert attention from the subject of the article.

 * BTW, I didn't comment on Microsoft's business practices, I commented on their software development methods, which is what the article is all about. Graham Chapman

 * no, the article is not about microsoft's business practices or software development models, it is about a paper that someone wrote (which is incidentally about software development models). i again assert that microsoft is not relevent to an encyclopedic description of the paper in question. yes, a wikipedia article can report objectively on what advocates say. that doesn't mean that in an article about glucose, i can insert an objective description of what people think about chedder cheese. further, illustrating "both sides of the case" is also irrelevent. there are not multiple viewpoints as to what "the cathedral and the bazaar" is. microsoft's practices are certainly not a viewpoint on the topic. i've less love for microsoft than the next guy, but that isn't any reason to compromise the quality of the wikipedia's articles. --jkominek

 * Jeez, angry people :-) 1. The paper is also about open vs closed source - chapter 6 even has the term Open-Source in the chapter title. 2. You can assert MS is not relevant and I can again disagree. Microsoft's practices are a darn good example of the closed source model. 3. There are multiple viewpoints here: there are exactly two, open source and closed source. 4. In preserving this alleged quality you remove illustrations which help the reader to understand the context of the article. Might as well remove all references to open source, Netscape and the text of the essay as well.

 * sorry, wasn't angry, just trying hard to get my point across. since it seems as though my point was made more clearly by others, below here, i'll not bother with my previously composed even longer response. (which will put in an appearance if this ever comes up again. :) --jkominek

I really hate defending microsoft (I avoid their software like the Plague and only use it when I am coerced into doing so -- such as work and school). But the article needs to describe what Raymond said without stirring up unnecessary hornets nests (which the removed statement obvisously has). If he didn't say it, then it is not relevent. The statement could be placed in another article, such as "Open vs. Closed Source" or whatever. maveric149

 * Not once does Microsoft get a mention in CatB. Bugger-all time is spent discussing proprietary software.  Maveric is right.  It's just not relevant in this case. --Robert Merkel

 * But the article needs to describe what Raymond said without stirring up unnecessary hornets nests (which the removed statement obvisously has).  Yes, it's a good point. Sigh. I'll return to my primeval slime. Graham Chapman

Speculation on Raymond's motivations
I took out " Raymonds' choice of examples, however, may have been influenced by a desire to present Richard Stallman as out-dated." as it read like pure speculation. I thought the motivation in the choices was that two large projects had been so closed as to generate prominent and energy-sapping forks. Is there documentation otherwise? - David Gerard 10:46, May 11, 2004 (UTC)

 * I've just re-added a modified version noting that it is speculation, but at the time I hadn't read your comment here. (If you give me a few minutes, I'll post a proper response here.)Markvs 14:19, 11 May 2004 (UTC)

 * Proper response: there were many better examples of Cathederal development, the BSD's being probably the most extreme - and they fostered two forks. ESR picked Stallmans two greatest pieces of software (although RMS no longer worked on GCC, it was still his crowning achievement).  Why ignore BSD? using BSD and one of GCC or Emacs would have provided richer material for comparison, but ESR chose Stallmans two projects.  For some reason.

 * ESR popularised the term "Open Source" as a replacement for "Free Software", he founded OSI which refers to FSF's advocacy as "ideological tub-thumping", and claims that OSI will be like FSF except without "the losing attitude and symbolism". In ESR's writings, he gives Stallman a compliment, and then claims that no one pays attention to Stallman anymore.  ESR constantly tries to write Free Software and RMS out of the history books.  I wasn't going to add a comment when I first saw the catb page, but when I noticed that you've added notes to all GCC and Emacs related pages about how they once epitomised the Cathederal style, I thought it's only right to mention that some people think ESR's choices were far from objective. Markvs 14:37, 11 May 2004 (UTC)

 * Fair enough. Though it'd add nicely to the statement if the "It is speculated" had a substantiating link or something.

 * I thought GCC/ECGS was actually a good example because it's such an important piece of the FOSS puzzle. When writing the EGCS article, I was reading old EGCS web pages and mailing lists ... they singed my eyebrows. NPOVing that lot was fun.

 * I do agree that using EMACS as an example is more likely to be taken as pique on Raymond's part (where he wrote lots of supporting extensions but couldn't get contributions into the main program). Although again, look at the XEmacs crew's web pages and opinions on why they couldn't work with the FSF - David Gerard 15:02, May 11, 2004 (UTC)

 * If no-one has a reference link for the "It is speculated" sentence, I'm inclined to delete it, or it'll just look like editorialising - David Gerard 15:00, May 12, 2004 (UTC)

 * I'll have a quick look (later), but if I don't turn up anything, it could be replaced rather than just memory holed. If you want the page to be a collection of facts, then it should be mentioned that ESR was having code rejected by the Emacs maintainers, ESR's two chosen projects were the software high points of the man he set out to replace (even when BSD offered a more closed and more forked example), and I had a third fact worth mentioning but I've forgotten it now - must dash, will be back. Markvs 16:49, 12 May 2004 (UTC)

 * It doesn't go down the "memory hole" - it's in the page history and here on the talk page.

 * You've admitted your starting point is a personal bias against ESR. This is an article about the essay, not why ESR sucks. When "It is speculated" really means "I speculate", one needs to apply severe NPOV to oneself and back up every word so well that even ESR couldn't reasonably object - David Gerard 16:58, May 12, 2004 (UTC)

 * I've said that I don't like ESR but that doesn't mean that I'm editting these pages as an outlet for my dislike. I'm editting these pages because they lack info, and that's how wikipedia grows.  Also, they appear to be written by people that only/mostly know of ESR through ESR's writings, ESR-related press releases, or via one google search.  This is sub-par for wikipedia - but I don't have time for an edit war with you.

 * His choice of RMS's two pet projects for his examples of badly managed projects is more than a coincidence, it doesn't take a genius to spot that one. Here's an article with 6 interesting forks, emacs and gcc are among them, but BSD and libc are two other good ones: http://linuxmafia.com/faq/Licensing_and_Law/forking.html

 * Anyway, there's a trend here. You've spent three posts justifying the removal of stuff and pointing out character flaws in me, while I've used three posts to present info so that something can be added to the page.  Try to improve on stuff rather than criticise - the latter is simple, but the former is what makes the encyclopedia better.

 * Anyway, here's my latest suggestion: move the "It's speculated..." sentence to a paragraph of it's own. (It can be the very last paragraph if you like.)  And reword it to the facts-only version I mentioned above.  Actually, if you leave it as is, I'll give this a go tomorrow, and you can see if you like it. Markvs 21:02, 12 May 2004 (UTC)

 * Yeah, but the "It's speculated ..." is still just YOU doing it. You're editorialising in the third person. Who speculates it? Ciaran O'Riordan user:markvs speculates it. Who else? You haven't listed them.

 * Can you back up your words to the point that even ESR couldn't reasonably object? That's the NPOV test. So far you haven't.

 * May I also suggest that your @fsf.org email address and focus on ESR vs the FSF may give you the appearance of editing from a somewhat partisan viewpoint.

 * ps: I personally think Open Source vs. Free Software arguments are essentially missing the point . I myself prefer "free software" as the freedom is the essential point to me. I had the inestimable joy of writing this page so as to write something acceptable to both the People's Front of Judea and the Judean People's Front. (And in the process discovered that the Netscape Public License is Free Software [with problems] but not Open Source!)

 * You are adding "information" to Wikipedia, but doing it from such a strong POV that you're including information as if it's remarkable when it isn't, e.g. a book on Unix philosophy being released under an invariant license. That's a problem. Can you see any of what I'm talking about here? - David Gerard 21:20, May 12, 2004 (UTC)

 * (Actually Ciaran is a friend, but I am a "free software" person.)
 * For the third time: I think the sentence that starts with "It's speculated..." needs fixing, and should be replaced with facts. We're not getting anywhere here, so I'll edit the page to show you what I'm talking about.  Revert it or improve it if you want. Markvs 22:23, 12 May 2004 (UTC)
 * OK :-) - David Gerard 22:24, May 12, 2004 (UTC)

 * Yes, that strikes me as much better supported - David Gerard 20:55, May 13, 2004 (UTC)

Stallman vs Raymond before CatB??
"Richard Stallman, a man with whom Raymond had many heated arguments ("Free Software" Vs. "Open Source" etc.)."

These arguments happened after the essay. But the para seems to imply they were part of why Raymond picked GCC and Emacs as examples, so that example doesn't work at all. Anyone got one that does? Evidence of personal animosity between ESR and RMS before CatB? Else the sentence should be cut - David Gerard 10:26, May 17, 2004 (UTC)

Further on this point, from :

''"In fairness, from watching a great number of ESR v. RMS arguments, it's a good idea to be skeptical of the claim that ESR said something about RMS, or that RMS said something about ESR. The _actual things_ that they say about one another and about one another's positions are a lot milder than the versions that get repeated by some flamewar participants.  RMS has partisans who hold a lot of animosity for ESR, and ESR has partisans who hold a lot of animosity for RMS. What they actually say about one another is generally that they have an important tactical (and philosophical) disagreement; and they will not deny having respect and gratitude for one another's contributions.  And I certainly don't think that they take their disagreements personally, although fans of either one will sometimes try to make it look more like a bitter personal rivalry. As far as I know, ESR's actual statements on this point (as contrasted with what he might be thought to have said) are more limited and politer, and extend to saying that he (ESR) is a better salesman (to business?) than RMS, which is true, and which RMS is not interested in disputing. They will then disagree over whether or not this is important or desirable."''

That is: their partisans often use them as proxies. I suggest that without some firm evidence, this article should not risk doing this - David Gerard 15:26, May 17, 2004 (UTC)

 * (re: Evidence of personal animosity between ESR and RMS before CatB? Else the sentence should be cut)

 * no no no no no no. Stop cutting info from other contributors.  If a sentence is not completely accurate, make it accurate.  In this case, (if your theory is true,) maybe that sentence should be changed to "ESR went on to disagree with many of RMS's opinions" or "this was the first of many public disagreements between R + E".  Or something to that effect, it could be worded better but I'm just giving an example, I have no time - so I mightn't see any responses to this post for a while, but PLEASE, add to wikipedia, don't take away from it. (I'm Markvs but I've forgotten my password, so I made this account). Georg Bush 01:16, 23 May 2004 (UTC)

 * "If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it." It's been near three weeks now and it's still unjustified. You're trying to make an assertion your sentence simply doesn't justify. If the sentence that doesn't in fact support the assertion is taken out, then you're editorialising. Has no-one else in the world except you raised this possibility? Do you really have no references? In that case this is original research and not a candidate for mercy.

 * I've commented out the paragraph in question until it can actually be substantiated. - David Gerard 12:28, 3 Jun 2004 (UTC)

Criticisms of CatB
We need these documented. I don't mean personal editorialising (as above) - I mean documenting famous criticisms of CatB and its ideas, and criticisms of those criticisms. The First Monday paper (even if it was crap) and reactions to it should be covered, for example. Any others? Famous criticisms by others are needed. (I have an urge to get this article through WP:FAC.) - David Gerard 11:00, 25 Aug 2004 (UTC)

License
The work seems to be licensed under an Open Publication license, not a creative commons license.

 * "Permission is granted to copy, distribute and/or modify this document under the terms of the Open Publication License, version 2.0." It is. ABoerma 21:59, 7 February 2006 (UTC)

The pic's gone..?
Or is it just my browser's problem? AilaG 01:20, 20 April 2006 (UTC)
 * It has to be your browser's problem. I think you have to fix it as I can view the image. -- S iva1979 Talk to me  01:49, 20 April 2006 (UTC)

Don't merge
I don't see the rationale for merging. That the two pieces were sold in a compilation doesn't necessarily mean they're the same thing. Chris Cunningham 18:52, 10 May 2007 (UTC)

 * I think this article could be expanded to cover the whole book, not just the first essay. The book is already mentioned in the article and the accompanying image. The HtN article is only a stub, and the Revenge of the Hackers article (referenced here) doesn't yet exist. I don't see any reason all the essays can't be described in a single article. Aardvark92 00:33, 11 May 2007 (UTC)

 * Again, what's the rationale? Length isn't the only grounds for whether an article stands along. CatB is by far the best-known and least contentious of the essays; that the others have short or non-existent articles is more a function of their relative lack of impact on the community than anything else. Chris Cunningham 07:59, 11 May 2007 (UTC)

References?
"The essay helped convince most existing open source and free software projects to adopt Bazaar-style open development models, fully or partially — including GNU Emacs and GCC, the original Cathedral examples. Most famously, it also provided the final push for Netscape Communications Corporation to release the source code for Netscape Communicator and start the Mozilla project."

The above quote is referenced to Eric S. Raymond himself. In my eyes, what he says is probably biased to infinity and as such not proper material for an encyclopedia. I'd even want to remove the reference altogether and insert a. 80.217.188.76 22:50, 23 October 2007 (UTC)

 * While I agree that ESR isn't a reliable source in general, the fledgling Open Source Initiative (when it was basically Raymond and Perens) were pretty closely associated with Mozilla's source release at the time iirc. We may just need a better reference. Chris Cunningham 09:42, 24 October 2007 (UTC)

The 13th element...
...is an Antoine de Saint-Exupery quote, and should be addressed like that.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Talk:The Cathedral and the Bazaar


text:
Due process

Due process of law is application by the state of all legal rules and principles pertaining to a case so all legal rights that are owed to a person are respected. Due process balances the power of law of the land and protects the individual person from it. When a government harms a person without following the exact course of the law, this constitutes a due process violation, which offends the rule of law.

Due process has also been frequently interpreted as limiting laws and legal proceedings (see substantive due process) so that judges, instead of legislators, may define and guarantee fundamental fairness, justice, and liberty. That interpretation has proven controversial. Analogous to the concepts of natural justice and procedural justice used in various other jurisdictions, the interpretation of due process is sometimes expressed as a command that the government must not be unfair to the people or abuse them physically or mentally. The term is not used in contemporary English law, but two similar concepts are natural justice, which generally applies only to decisions of administrative agencies and some types of private bodies like trade unions, and the British constitutional concept of the rule of law as articulated by A. V. Dicey and others. However, neither concept lines up perfectly with the American theory of due process, which, as explained below, presently contains many implied rights not found in either ancient or modern concepts of due process in England.

Due process developed from clause 39 of Magna Carta in England. Reference to due process first appeared in a statutory rendition of clause 39 in 1354 thus: "No man of what state or condition he be, shall be put out of his lands or tenements nor taken, nor disinherited, nor put to death, without he be brought to answer by due process of law." When English and American law gradually diverged, due process was not upheld in England but became incorporated in the US Constitution.

Magna Carta
In clause 39 of Magna Carta, issued in 1215, John of England promised: "No free man shall be seized or imprisoned, or stripped of his rights or possessions, or outlawed or exiled, or deprived of his standing in any other way, nor will we proceed with force against him, or send others to do so, except by the lawful judgment of his equals or by the law of the land." Magna Carta itself immediately became part of the "law of the land", and Clause 61 of that charter authorized an elected body of 25 barons to determine by majority vote what redress the King must provide when the King offends "in any respect against any man". Thus, Magna Carta established the rule of law in England by not only requiring the monarchy to obey the law of the land but also limiting how the monarchy could change the law of the land. However, in the 13th century, the provisions may have been referring only to the rights of landowners, and not to ordinary peasantry or villagers.

Shorter versions of Magna Carta were subsequently issued by British monarchs, and Clause 39 of Magna Carta was renumbered "29". The phrase due process of law first appeared in a statutory rendition of Magna Carta in 1354 during the reign of Edward III of England, as follows: "No man of what state or condition he be, shall be put out of his lands or tenements nor taken, nor disinherited, nor put to death, without he be brought to answer by due process of law."

In 1608, the English jurist Edward Coke wrote a treatise in which he discussed the meaning of Magna Carta. Coke explained that no man shall be deprived but by legem terrae, the law of the land, "that is, by the common law, statute law, or custom of England.... (that is, to speak it once and for all) by the due course, and process of law.."

Both the clause in Magna Carta and the later statute of 1354 were again explained in 1704 (during the reign of Queen Anne) by the Queen's Bench, in the case of Regina v. Paty. In that case, the British House of Commons had deprived John Paty and certain other citizens of the right to vote in an election and committed them to Newgate Prison merely for the offense of pursuing a legal action in the courts. The Queen's Bench, in an opinion by Justice Littleton Powys, explained the meaning of "due process of law" as follows: "[I]t is objected, that by Mag. Chart. c. 29, no man ought to be taken or imprisoned, but by the law of the land. But to this I answer, that lex terrae is not confined to the common law, but takes in all the other laws, which are in force in this realm; as the civil and canon law.... By the 28 Ed. 3, c. 3, there the words lex terrae, which are used in Mag. Char. are explained by the words, due process of law; and the meaning of the statute is, that all commitments must be by a legal authority; and the law of Parliament is as much a law as any, nay, if there be any superiority this is a superior law."

Chief Justice Holt dissented in this case because he believed that the commitment had not in fact been by a legal authority. The House of Commons had purported to legislate unilaterally, without approval of the British House of Lords, ostensibly to regulate the election of its members. Although the Queen's Bench held that the House of Commons had not infringed or overturned due process, John Paty was ultimately freed by Queen Anne when she prorogued Parliament.

English law and American law diverge
Throughout centuries of British history, many laws and treatises asserted various requirements as being part of "due process" or included in the "law of the land". That view usually held in regards to what was required by existing law, rather than what was intrinsically required by due process itself. As the United States Supreme Court has explained, a due process requirement in Britain was not "essential to the idea of due process of law in the prosecution and punishment of crimes, but was only mentioned as an example and illustration of due process of law as it actually existed in cases in which it was customarily used".

Ultimately, the scattered references to "due process of law" in English law did not limit the power of the government; in the words of American law professor John V. Orth, "the great phrases failed to retain their vitality." Orth points out that this is generally attributed to the rise of the doctrine of parliamentary supremacy in the United Kingdom, which was accompanied by hostility towards judicial review as an undemocratic foreign invention.

Scholars have occasionally interpreted Lord Coke's ruling in Dr. Bonham's Case as implying the possibility of judicial review, but by the 1870s, Lord Campbell was dismissing judicial review as "a foolish doctrine alleged to have been laid down extra-judicially in Dr. Bonham's Case..., a conundrum [that] ought to have been laughed at". Lacking the power of judicial review, English courts possessed no means by which to declare government statutes or actions invalid as a violation of due process. In contrast, American legislators and executive branch officers possessed virtually no means by which to overrule judicial invalidation of statutes or actions as due process violations, with the sole exception of proposing a constitutional amendment, which are rarely successful. As a consequence, English law and American law diverged. Unlike their English counterparts, American judges became increasingly assertive about enforcing due process of law. In turn, the legislative and executive branches learned how to avoid such confrontations in the first place, by tailoring statutes and executive actions to the constitutional requirements of due process as elaborated upon by the judiciary.

In 1977, an English political science professor explained the present situation in England for the benefit of American lawyers: "An American constitutional lawyer might well be surprised by the elusiveness of references to the term 'due process of law' in the general body of English legal writing.... Today one finds no space devoted to due process in Halsbury's Laws of England, in Stephen's Commentaries, or Anson's Law and Custom of the Constitution. The phrase rates no entry in such works as Stroud's Judicial Dictionary or Wharton's Law Lexicon."

Two similar concepts in contemporary English law are natural justice, which generally applies only to decisions of administrative agencies and some types of private bodies like trade unions, and the British constitutional concept of the rule of law as articulated by A. V. Dicey and others. However, neither concept lines up perfectly with the American conception of due process, which presently contains many implied rights not found in the ancient or modern concepts of due process in England.

United States
The Fifth and Fourteenth Amendments to the United States Constitution each contain a Due Process Clause. Due process deals with the administration of justice and thus the Due Process Clause acts as a safeguard from arbitrary denial of life, liberty, or property by the government outside the sanction of law. The Supreme Court of the United States interprets the clauses as providing four protections: procedural due process (in civil and criminal proceedings), substantive due process, a prohibition against vague laws, and as the vehicle for the incorporation of the Bill of Rights.

Others
Various countries recognize some form of due process under customary international law. Although the specifics are often unclear, most nations agree that they should guarantee foreign visitors a basic minimum level of justice and fairness. Some nations have argued that they are bound to grant no more rights to aliens than they do to their own citizens, the doctrine of national treatment, which also means that both would be vulnerable to the same deprivations by the government. With the growth of international human rights law and the frequent use of treaties to govern treatment of foreign nationals abroad, the distinction, in practice, between these two perspectives may be disappearing.

title: Due process


text:
Dosimeter

A radiation dosimeter is a device that measures dose uptake of external ionizing radiation. It is worn by the person being monitored when used as a personal dosimeter, and is a record of the radiation dose received. Modern electronic personal dosimeters can give a continuous readout of cumulative dose and current dose rate, and can warn the wearer with an audible alarm when a specified dose rate or a cumulative dose is exceeded. Other dosimeters, such as thermoluminescent or film types, require processing after use to reveal the cumulative dose received, and cannot give a current indication of dose while being worn.

Personal dosimeters
The personal ionising radiation dosimeter is of fundamental importance in the disciplines of radiation dosimetry and radiation health physics and is primarily used to estimate the radiation dose deposited in an individual wearing the device.

Ionising radiation damage to the human body is cumulative, and is related to the total dose received, for which the SI unit is the sievert. Radiographers, nuclear power plant workers, doctors using radiotherapy, HAZMAT workers, and other people in situations that involve handling radionuclides are often required to wear dosimeters so a record of occupational exposure can be made. Such devices are known as "legal dosimeters" if they have been approved for use in recording personnel dose for regulatory purposes.

Dosimeters are typically worn on the outside of clothing, a "whole body" dosimeter is worn on the chest or torso to represent dose to the whole body. This location monitors exposure of most vital organs and represents the bulk of body mass. Additional dosimeters can be worn to assess dose to extremities or in radiation fields that vary considerably depending on orientation of the body to the source.

Modern types
The electronic personal dosimeter, the most commonly used type, is an electronic device that has a number of sophisticated functions, such as continual monitoring which allows alarm warnings at preset levels and live readout of dose accumulated. These are especially useful in high dose areas where residence time of the wearer is limited due to dose constraints. The dosimeter can be reset, usually after taking a reading for record purposes, and thereby re-used multiple times.

MOSFET dosimeter
Metal–oxide–semiconductor field-effect transistor dosimeters are now used as clinical dosimeters for radiotherapy radiation beams. The main advantages of MOSFET devices are:

1. The MOSFET dosimeter is direct reading with a very thin active area (less than 2μm ).

2. The physical size of the MOSFET when packaged is less than 4 mm.

3. The post radiation signal is permanently stored and is dose rate independent.

Gate oxide of MOSFET which is conventionally silicon dioxide is an active sensing material in MOSFET dosimeters. Radiation creates defects (acts like electron-hole pairs) in oxide, which in turn affects the threshold voltage of the MOSFET. This change in threshold voltage is proportional to radiation dose. Alternate high-k gate dielectrics like hafnium dioxide and aluminum oxides are also proposed as a radiation dosimeters.

Thermoluminescent dosimeter
A thermoluminescent dosimeter measures ionizing radiation exposure by measuring the intensity of light emitted from a Dy or B doped crystal in the detector when heated. The intensity of light emitted is dependent upon the radiation exposure. These were once sold surplus and one format once used by submariners and nuclear workers resembled a dark green wristwatch containing the active components and a highly sensitive IR wire ended diode mounted to the doped LiF2 glass chip that when the assembly is precisely heated (hence thermoluminescent) emits the stored radiation as narrow band infrared light until it is depleted The main advantage is that the chip records dosage passively until exposed to light or heat so even a used sample kept in darkness can provide valuable scientific data.

Film badge dosimeter
Film badge dosimeters are for one-time use only. The level of radiation absorption is indicated by a change to the film emulsion, which is shown when the film is developed. They are now mostly superseded by electronic personal dosimeters and thermoluminescent dosimeters.

Quartz fiber dosimeter
These use the property of a quartz fiber to measure the static electricity held on the fiber. Before use by the wearer a dosimeter is charged to a high voltage, causing the fiber to deflect due to electrostatic repulsion. As the gas in the dosimeter chamber becomes ionized by radiation the charge leaks away, causing the fiber to straighten and thereby indicate the amount of dose received against a graduated scale, which is viewed by a small in-built microscope. They are only used for short durations, such as a day or a shift, as they can suffer from charge leakage, which gives a false high reading. However they are immune to EMP so were used during the Cold War as a failsafe method of determining radiation exposure.

They are now largely superseded by electronic personal dosimeters for short term monitoring.

Geiger tube dosimeter
These use a conventional Geiger-Muller tube, typically a ZP1301 or similar energy-compensated tube, requiring between 600 and 700V and pulse detection components. The display on most is a bubble or miniature LCD type with 4 digits and a discrete counter integrated chip such as 74C925/6. LED units usually have a button to turn the display on and off for longer battery life, and an infrared emitter for count verification and calibration. The voltage is derived from a separate pinned or wire-ended module that often uses a unijunction transistor driving a small step-up coil and multiplier stage. While expensive, it is reliable over time and especially in high-radiation environments, sharing this trait with tunnel diodes, though the encapsulants, inductors and capacitors have been known to break down internally over time. These have the disadvantage that the stored dose in becquerels or microsieverts is volatile and vanishes if the power supply is disconnected, though there can be a low-leakage capacitor to preserve the memory for short periods without a battery. Because of this, most units use long-life batteries and high-quality contacts. Recently-designed units log dose over time to non-volatile memory, such as a 24C256 chip so it may be read out via a serial port.

Dosimetry dose quantities
The operational quantity for personal dosimetry is the personal dose equivalent, which is defined by the International Commission on Radiological Protection as the dose equivalent in soft tissue at an appropriate depth, below a specified point on the human body. The specified point is usually given by the position where the individual’s dosimeter is worn.

Instrument and dosimeter response
This is an actual reading obtained from such as an ambient dose gamma monitor, or a personal dosimeter. The dosimeter is calibrated in a known radiation field to ensure display of accurate operational quantities and allow a relationship to known health effect. The personal dose equivalent is used to assess dose uptake, and allow regulatory limits to be met. It is the figure usually entered into the records of external dose for occupational radiation workers.

The dosimeter plays an important role within the international radiation protection system developed by the International Commission on Radiological Protection and the International Commission on Radiation Units and Measurements. This is shown in the accompanying diagram.

Dosimeter calibration
The "slab" phantom is used to represent the human torso for calibration of whole body dosimeters. This replicates the radiation scattering and absorption effects of the human torso. The International Atomic Energy Agency states "The slab phantom is 300 mm × 300 mm × 150 mm depth to represent the human torso".

Process irradiation verification
Manufacturing processes that treat products with ionizing radiation, such as food irradiation, use dosimeters to calibrate doses deposited in the matter being irradiated. These usually must have a greater dose range than personal dosimeters, and doses are normally measured in the unit of absorbed dose: the gray (Gy). The dosimeter is located on or adjacent to the items being irradiated during the process as a validation of dose levels received.

title: Dosimeter


text:
Electrometer

An electrometer is an electrical instrument for measuring electric charge or electrical potential difference. There are many different types, ranging from historical handmade mechanical instruments to high-precision electronic devices. Modern electrometers based on vacuum tube or solid-state technology can be used to make voltage and charge measurements with very low leakage currents, down to 1 femtoampere. A simpler but related instrument, the electroscope, works on similar principles but only indicates the relative magnitudes of voltages or charges.

Gold-leaf electroscope

The gold-leaf electroscope was one of the instruments used to indicate electric charge. It is still used for science demonstrations but has been superseded in most applications by electronic measuring instruments. The instrument consists of two thin leaves of gold foil suspended from an electrode. When the electrode is charged by induction or by contact, the leaves acquire similar electric charges and repel each other due to the Coulomb force. Their separation is a direct indication of the net charge stored on them. On the glass opposite the leaves, pieces of tin foil may be pasted, so that when the leaves diverge fully they may discharge into the ground. The leaves may be enclosed in a glass envelope to protect them from drafts, and the envelope may be evacuated to minimize charge leakage. This principle has been used to detect ionizing radiation, as seen in the quartz fibre electrometer and Kearny fallout meter.

This type of electroscope usually acts as an indicator and not a measuring device, although it can be calibrated. A calibrated electrometer with a more robust aluminium indicator was invented by Ferdinand Braun and first described in 1887. According to Braun, the standard gold-leaf electrometer is good up to about 800 V with a resolution of 0.1 V using an ocular micrometer. For larger voltages up to 4–6 kV Braun's instrument can achieve a resolution of 10 V.

The instrument was developed in the 18th century by several researchers, among them Abraham Bennet (1787) and Alessandro Volta.

Early quadrant electrometer

While the term "quadrant electrometer" eventually referred to Kelvin's version, this term was first used to describe a simpler device. It consists of an upright stem of wood, to which is affixed to a semicircle of ivory. From the center there hangs a light cork ball upon a pivot. When the instrument is placed upon a charged body, the stem participates and repels the cork ball. The amount of repulsion may be read off the graduated semicircle, though the measured angle is not in direct proportion to the charge. Early inventors included William Henley (1770) and Horace-Bénédict de Saussure.

Coulomb's electrometer

Torsion is used to give a measurement more sensitive than repulsion of gold leaves or cork-balls. It consists of a glass cylinder with a glass tube on top. In the axes of the tube is a glass thread, the lower end of this holds a bar of gum lac, with a gilt pith ball at each extremity. Through another aperture on the cylinder, another gum lac rod with gilt balls may be introduced. This is called the carrier rod.

If the lower ball of the carrier rod is charged when it is entered into the aperture, this will repel one of the movable balls inside. An index and scale (not pictured) is attached to the top of the twistable glass rod. The number of degrees twisted to bring the balls back together is in exact proportion of the amount of charge of the ball of the carrier rod.

Francis Ronalds, the inaugural Director of the Kew Observatory, made important improvements to the Coulomb torsion balance around 1844 and the modified instrument was sold by London instrument-makers. Ronalds used a thin suspended needle rather than the gum lac bar and replaced the carrier rod with a fixed piece in the plane of the needle. Both were metal, as was the suspending line and its surrounding tube, so that the needle and the fixed piece could be charged directly through wire connections. Ronalds also employed a Faraday cage and trialled photography to record the readings continuously. It was the forerunner of Kelvin's quadrant electrometer (described below).

Peltier electrometer
Developed by Peltier, this uses a form of magnetic compass to measure deflection by balancing the electrostatic force with a magnetic needle.

Bohnenberger electrometer
The Bohnenberger electrometer, developed by J. G. F. von Bohnenberger from an invention by T. G. B. Behrens, consists of a single gold leaf suspended vertically between the anode and cathode of a dry pile. Any charge imparted to the gold leaf causes it to move toward one or the other pole; thus, the sign of the charge as well as its approximate magnitude may be gauged.

Attraction electrometer
Also known as "attracted disk electrometers", attraction electrometers are sensitive balances measuring the attraction between charged disks. William Snow Harris is credited with the invention of this instrument, which was further improved by Lord Kelvin.

Kelvin's quadrant electrometer

Developed by Lord Kelvin, this is the most sensitive and accurate of all the mechanical electrometers. The original design uses a light aluminum sector suspended inside a drum cut into four segments. The segments are insulated and connected diagonally in pairs. The charged aluminum sector is attracted to one pair of segments and repelled from the other. The deflection is observed by a beam of light reflected from a small mirror attached to the sector, just as in a galvanometer. The engraving on the right shows a slightly different form of this electrometer, using four flat plates rather than closed segments. The plates can be connected externally in the conventional diagonal way (as shown), or in a different order for specific applications.

A more sensitive form of quadrant electrometer was developed by Frederick Lindemann. It employs a metal-coated quartz fiber instead of an aluminum sector. The deflection is measured by observing the movement of the fiber under a microscope. Initially used for measuring star light, it was employed for the infrared detection of airplanes in the early stages of World War II.

Some mechanical electrometers were housed inside a cage often referred to as a “bird cage”. This is a form of Faraday Cage that protected the instrument from external electrostatic charges.

Electrograph
Electricity readings may be recorded continuously with a device known as an electrograph. Francis Ronalds created an early electrograph around 1814 in which the changing electricity made a pattern in a rotating resin-coated plate. It was employed at Kew Observatory and the Royal Observatory, Greenwich in the 1840s to create records of variations in atmospheric electricity. In 1845, Ronalds invented photographic means of registering the atmospheric electricity. The photosensitive surface was pulled slowly past of the aperture diaphragm of the camera box, which also housed an electrometer, and captured ongoing movements of the electrometer indices as a trace. Kelvin used similar photographic means for his quadrant electrometer (see above) in the 1860s.

Modern electrometers
A modern electrometer is a highly sensitive electronic voltmeter whose input impedance is so high that the current flowing into it can be considered, for most practical purposes, to be zero. The actual value of input resistance for modern electronic electrometers is around 1014Ω, compared to around 1010Ω for nanovoltmeters. Owing to the extremely high input impedance, special design considerations (such as driven shields and special insulation materials) must be applied to avoid leakage current.

Among other applications, electrometers are used in nuclear physics experiments as they are able to measure the tiny charges left in matter by the passage of ionizing radiation. The most common use for modern electrometers is the measurement of radiation with ionization chambers, in instruments such as geiger counters.

Vibrating reed electrometers
Vibrating reed electrometers use a variable capacitor formed between a moving electrode (in the form of a vibrating reed) and a fixed input electrode. As the distance between the two electrodes varies, the capacitance also varies and electric charge is forced in and out of the capacitor. The alternating current signal produced by the flow of this charge is amplified and used as an analogue for the DC voltage applied to the capacitor. The DC input resistance of the electrometer is determined solely by the leakage resistance of the capacitor, and is typically extremely high, (although its AC input impedance is lower).

For convenience of use, the vibrating reed assembly is often attached by a cable to the rest of the electrometer. This allows for a relatively small unit to be located near the charge to be measured while the much larger reed-driver and amplifier unit can be located wherever it is convenient for the operator.

Valve electrometers
Valve electrometers use a specialized vacuum tube (thermionic valve) with a very high gain (transconductance) and input resistance. The input current is allowed to flow into the high impedance grid, and the voltage so generated is vastly amplified in the anode (plate) circuit. Valves designed for electrometer use have leakage currents as low as a few femtoamperes (10−15 amperes). Such valves must be handled with gloved hands as the salts left on the glass envelope can provide leakage paths for these tiny currents.

In a specialized circuit called inverted triode, the roles of anode and grid are reversed. This places the control electrode at a maximum distance from the space-charge region surrounding the filament, minimizing the number of electrons collected by the control electrode, and thus minimizing the input current.

Solid-state electrometers
The most modern electrometers consist of a solid state amplifier using one or more field-effect transistors, connections for external measurement devices, and usually a display and/or data-logging connections. The amplifier amplifies small currents so that they are more easily measured. The external connections are usually of a co-axial or tri-axial design, and allow attachment of diodes or ionization chambers for ionising radiation measurement. The display or data-logging connections allow the user to see the data or record it for later analysis. Electrometers designed for use with ionization chambers may include a high-voltage power supply, which is used to bias the ionization chamber.

Solid-state electrometers are often multipurpose devices that can measure voltage, charge, resistance and current. They measure voltage by means of "voltage balancing", in which the input voltage is compared with an internal reference voltage source using an electronic circuit with a very high input impedance (of the order of 1014 Ω). A similar circuit modified to act as a current-to-voltage converter enables the instrument to measure currents as small as a few femtoamperes. Combined with an internal voltage source, the current measuring mode can be adapted to measure very high resistances, of the order of 1017 Ω. Finally, by calculation from the known capacitance of the electrometer's input terminal, the instrument can measure very small electric charges, down to a small fraction of a picocoulomb.

title: Electrometer