Bc (programming language): Difference between revisions

Content deleted Content added
m Calculating π to 10000 places: digits == more clear and immediately understandable than "places"
History: RPN is a weird combination of both more and less convenient; bc was supplementary rather than an outright replacement
Line 22:
 
==History==
bc first appeared in [[Version 6 Unix]] in 1975 and was written by [[Robert Morris (cryptographer)|Robert Morris]] and [[Lorinda Cherry]] of [[Bell Labs]]. bc was preceded by [[dc (computer program)|dc]], an earlier arbitrary-precision calculator written by the same authors. dc could do arbitrary-precision calculations, but its [[reverse Polish notation]] (RPN) syntaxsyntax—much wasloved inconvenientby many for evaluating algebraic formulas<!-- who? just about ''everyone'' who possessed an expensive [[HP calculators]] of the era -->—proved inconvenient to its users when expressing flow control, and therefore bc was written as a front-end to dc. bc was a very simple [[compiler]] (a single [[yacc]] source file with a few hundred lines), which converted the new, C-like, bc syntax into dc's [[postfix notation]] and piped the results through dc.
 
In 1991, [[POSIX]] rigorously defined and standardized bc. Two implementations of this standard survive today: The first is the traditional Unix implementation, a front-end to dc, which survives in Unix and [[Plan 9 from Bell Labs|Plan 9]] systems. The second is the [[free software]] [[GNU]] bc, first released in 1991 by Philip A. Nelson. The GNU implementation has numerous extensions beyond the POSIX standard and is no longer a front-end to dc (it is a [[bytecode interpreter]]).