Misplaced Pages

Ratfor

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

Ratfor (short for Rational Fortran ) is a programming language implemented as a preprocessor for Fortran 66 . It provides modern control structures , unavailable in Fortran 66, to replace GOTOs and statement numbers.

#476523

66-589: Ratfor provides the following kinds of flow-control statements, described by Kernighan and Plauger as "shamelessly stolen from the language C , developed for the UNIX operating system by D.M. Ritchie " ("Software Tools", p. 318): For example, the following code might be translated as The version of Ratfor in Software Tools is written in Ratfor, as are the sample programs, and inasmuch as its own translation to Fortran

132-404: A preprocessor for Fortran designed to give it C -like capabilities. Fortran was widely used for scientific programming but had very basic control-flow primitives ("do" and " goto ") and no " macro " facility which limited its expressiveness. The name of the language is a pun ( Ratfor (RATional FORtran) -> "Rat Four" -> "Rat Five" -> RatFiv ). Ratfiv was developed by Bill Wood at

198-452: A certain platform or with a particular compiler, due, for example, to the use of non-standard libraries, such as GUI libraries, or to a reliance on compiler- or platform-specific attributes such as the exact size of data types and byte endianness . In cases where code must be compilable by either standard-conforming or K&R C-based compilers, the __STDC__ macro can be used to split the code into Standard and K&R sections to prevent

264-509: A continuation of the basis of the Unix operating system, and as derivatives of Unix: I think the Linux phenomenon is quite delightful, because it draws so strongly on the basis that Unix provided. Linux seems to be among the healthiest of the direct Unix derivatives, though there are also the various BSD systems as well as the more official offerings from the workstation and mainframe manufacturers. In

330-458: A copy of the lost dissertation. During the 1960s, Ritchie and Ken Thompson worked on the Multics operating system at Bell Labs. Thompson then found an old PDP-7 machine and developed his own application programs and operating system from scratch, aided by Ritchie and others. In 1970, Brian Kernighan suggested the name " Unix ", a pun on the name "Multics". To supplement assembly language with

396-482: A role C and Unix had played in the development of later high-profile projects, such as the iPhone . Other testimonials to his influence followed. Reflecting upon his death, a commentator compared the relative importance of Steve Jobs and Ritchie, concluding that "[Ritchie's] work played a key role in spawning the technological revolution of the last forty years—including technology on which Apple went on to build its fortune." Another commentator said, "Ritchie, on

462-590: A semicolon; as a side effect of the evaluation, functions may be called and variables assigned new values. To modify the normal sequential execution of statements, C provides several control-flow statements identified by reserved keywords. Structured programming is supported by if ... [ else ] conditional execution and by do ... while , while , and for iterative execution (looping). The for statement has separate initialization, testing, and reinitialization expressions, any or all of which can be omitted. break and continue can be used within

528-480: A system-level programming language, Thompson created B . Later, B was replaced by C , created by Ritchie, who continued to contribute to the development of Unix and C for many years. During the 1970s, Ritchie collaborated with James Reeds and Robert Morris on a ciphertext-only attack on the M-209 US cipher machine that could solve messages of at least 2000–2500 letters. Ritchie relates that, after discussions with

594-453: A useless intermediate Fortran code (.f) ( gcc foo.r ), this functionality was lost in version 4 during the move in 2005 from f77 to GNU Fortran . The original source was available in . deb and . rpm forms at its original site, mirror.corbina.net/mandriva/, and its archive, www.dgate.org/ratfor/ are gone as of April, 2024. Ratfiv is an enhanced version of the Ratfor programming language ,

660-423: A warning message if a local function was called with the wrong number of arguments, or if different calls to an external function used different numbers or types of arguments. Separate tools such as Unix's lint utility were developed that (among other things) could check for consistency of function use across multiple source files. In the years following the publication of K&R C, several features were added to

726-542: A wide variety of mainframe computers , minicomputers , and microcomputers , including the IBM PC , as its popularity began to increase significantly. In 1983 the American National Standards Institute (ANSI) formed a committee, X3J11, to establish a standard specification of C. X3J11 based the C standard on the Unix implementation; however, the non-portable portion of the Unix C library was handed off to

SECTION 10

#1732899175477

792-494: Is an imperative , procedural language in the ALGOL tradition. It has a static type system . In C, all executable code is contained within subroutines (also called "functions", though not in the sense of functional programming ). Function parameters are passed by value, although arrays are passed as pointers , i.e. the address of the first item in the array. Pass-by-reference is simulated in C by explicitly passing pointers to

858-451: Is an informal name for the current major C language standard revision. It was informally known as "C2X" through most of its development. C23 was published in October 2024 as ISO/IEC 9899:2024. The standard macro __STDC_VERSION__ is defined as 202311L to indicate that C23 support is available. C2Y is an informal name for the next major C language standard revision, after C23 (C2X), that

924-463: Is available, it can be ported to any Fortran system. Ratfor source code file names end in .r or .rat. Ratfor was designed and implemented by Brian Kernighan at Bell Telephone Laboratories in 1974, and described in Software—;Practice & Experience in 1975. It was used in the book "Software Tools" ( Kernighan and Plauger , 1976). In 1977, at Purdue University , an improved version of

990-456: Is commonly used on computer architectures that range from the largest supercomputers to the smallest microcontrollers and embedded systems . A successor to the programming language B , C was originally developed at Bell Labs by Ritchie between 1972 and 1973 to construct utilities running on Unix . It was applied to re-implementing the kernel of the Unix operating system. During the 1980s, C gradually gained popularity. It has become one of

1056-497: Is defined as 201112L to indicate that C11 support is available. C17 is an informal name for ISO/IEC 9899:2018, a standard for the C programming language published in June 2018. It introduces no new language features, only technical corrections, and clarifications to defects in C11. The standard macro __STDC_VERSION__ is defined as 201710L to indicate that C17 support is available. C23

1122-516: Is for the most part backward compatible with C90, but is stricter in some ways; in particular, a declaration that lacks a type specifier no longer has int implicitly assumed. A standard macro __STDC_VERSION__ is defined with value 199901L to indicate that C99 support is available. GCC , Solaris Studio , and other C compilers now support many or all of the new features of C99. The C compiler in Microsoft Visual C++ , however, implements

1188-464: Is hoped to be released later in the 2020s decade, hence the '2' in "C2Y". An early working draft of C2Y was released in February 2024 as N3220 by the working group ISO/IEC JTC1/SC22 /WG14. Historically, embedded C programming requires non-standard extensions to the C language to support exotic features such as fixed-point arithmetic , multiple distinct memory banks , and basic I/O operations. In 2008,

1254-622: Is now also referred to as C78 . The second edition of the book covers the later ANSI C standard, described below. K&R introduced several language features: Even after the publication of the 1989 ANSI standard, for many years K&R C was still considered the " lowest common denominator " to which C programmers restricted themselves when maximum portability was desired, since many older compilers were still in use, and because carefully written K&R C code can be legal Standard C as well. In early versions of C, only functions that return types other than int must be declared if used before

1320-420: Is sometimes called C90. Therefore, the terms "C89" and "C90" refer to the same programming language. ANSI, like other national standards bodies, no longer develops the C standard independently, but defers to the international C standard, maintained by the working group ISO/IEC JTC1/SC22 /WG14. National adoption of an update to the international standard typically occurs within a year of ISO publication. One of

1386-682: The C programming language and was one of the developers of the Unix operating system. With Brian Kernighan , he co-wrote the book The C Programming Language , which is often referred to as K&R after their initials. Ritchie worked together with Ken Thompson , who is credited with writing the original version of Unix; one of Ritchie's contributions to Unix was its porting to different machines and platforms. They were so influential on Research Unix that Doug McIlroy later wrote, "The names of Ritchie and Thompson may safely be assumed to be attached to almost everything not otherwise attributed." Nowadays,

SECTION 20

#1732899175477

1452-578: The IEEE working group 1003 to become the basis for the 1988 POSIX standard. In 1989, the C standard was ratified as ANSI X3.159-1989 "Programming Language C". This version of the language is often referred to as ANSI C , Standard C, or sometimes C89. In 1990 the ANSI C standard (with formatting changes) was adopted by the International Organization for Standardization (ISO) as ISO/IEC 9899:1990, which

1518-653: The IEEE Richard W. Hamming Medal from the Institute of Electrical and Electronics Engineers (IEEE), "for the origination of the UNIX operating system and the C programming language". In 1997, both Ritchie and Thompson were made Fellows of the Computer History Museum , "for co-creation of the UNIX operating system, and for development of the C programming language." On April 21, 1999, Thompson and Ritchie jointly received

1584-414: The Institute for Cancer Research , Philadelphia , PA in the early 1980s and released on several DECUS (Digital Equipment Users Group) SIG (Special Interest Group) tapes. It is based on the original Ratfor by B. Kernighan and P. J. Plauger , with rewrites and enhancements by David Hanson and friends (U. of Arizona), Joe Sventek and Debbie Scherrer ( Lawrence Berkeley National Laboratory ). Ratfiv V2.1

1650-574: The International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC). C is an imperative procedural language, supporting structured programming , lexical variable scope , and recursion , with a static type system . It was designed to be compiled to provide low-level access to memory and language constructs that map efficiently to machine instructions , all with minimal runtime support . Despite its low-level capabilities,

1716-749: The National Medal of Technology from President Bill Clinton in 1999. Ritchie was the head of Lucent Technologies System Software Research Department when he retired in 2007. Dennis Ritchie was born in Bronxville, New York . His father was Alistair E. Ritchie, a longtime Bell Labs scientist and co-author of The Design of Switching Circuits on switching circuit theory . As a child, Dennis moved with his family to Summit, New Jersey , where he graduated from Summit High School . He graduated from Harvard University with degrees in physics and applied mathematics in 1963. In 1967, Ritchie began working at

1782-713: The National Medal of Technology of 1998 from President Bill Clinton for co-inventing the UNIX operating system and the C programming language which, according to the citation for the medal, "led to enormous advances in computer hardware, software, and networking systems and stimulated growth of an entire industry, thereby enhancing American leadership in the Information Age". In 2005, the Industrial Research Institute awarded Ritchie its Achievement Award in recognition of his contribution to science and technology, and to society generally, with his development of

1848-564: The National Security Agency , the authors decided not to publish it, as they were told that the principle applied to machines still in use by foreign governments. Ritchie was also involved with the development of the operating systems Plan 9 and Inferno , and the programming language Limbo . As part of an AT&T restructuring in the mid-1990s, Ritchie was transferred to Lucent Technologies, where he retired in 2007 as head of System Software Research Department. Ritchie created

1914-597: The Bell Labs Computing Science Research Center. In 1968, he defended his PhD thesis on "Computational Complexity and Program Structure" at Harvard under the supervision of Patrick C. Fischer . However, Ritchie never officially received his PhD degree as he did not submit a bound copy of his dissertation to the Harvard library, a requirement for the degree. In 2020, the Computer History Museum worked with Ritchie's family and Fischer's family and found

1980-483: The C Standards Committee published a technical report extending the C language to address these issues by providing a common standard for all implementations to adhere to. It includes a number of features not available in normal C, such as fixed-point arithmetic, named address spaces, and basic I/O hardware addressing. C has a formal grammar specified by the C standard. Line endings are generally not significant in C; however, line boundaries do have significance during

2046-974: The C language is widely used in application, operating system , and embedded system development, and its influence is seen in most modern programming languages. C is a low-level language with constructs closely translating to the hardware's instruction set. However, it is not tied to any given hardware, making it easy to write programs on any machine that supports C. Moreover, C is a high-level programming language with constructs mapping to data structures in application software . C influenced several other languages and derivatives, such as C++ , Objective-C used by Apple, C# used by Microsoft, and Java used in corporate environments extensively and by Android . Ritchie and Thompson used C to write Unix, which has been influential in establishing many computing concepts and principles that are adopted widely. In an interview from 1999, Ritchie clarified that he saw Linux and Berkeley Software Distribution (BSD) operating systems as

Ratfor - Misplaced Pages Continue

2112-591: The C89 standard and those parts of C99 that are required for compatibility with C++11 . In addition, the C99 standard requires support for identifiers using Unicode in the form of escaped characters (e.g. \u0040 or \U0001f431 ) and suggests support for raw Unicode names. Work began in 2007 on another revision of the C standard, informally called "C1X" until its official publication of ISO/IEC 9899:2011 on December 8, 2011. The C standards committee adopted guidelines to limit

2178-414: The Ratfor preprocessor was written. It was called Mouse4, as it was smaller and faster than Ratfor. A published document by Dr. Douglas Comer , professor at Purdue, concluded "contrary to the evidence exhibited by the designer of Ratfor, sequential search is often inadequate for production software. Furthermore, in the case of lexical analysis, well-known techniques do seem to offer efficiency while retaining

2244-648: The Unix operating system. In 2011, Ritchie, along with Thompson, was awarded the Japan Prize for Information and Communications for his work in the development of the Unix operating system. Ritchie was found dead on October 12, 2011, at the age of 70 at his home in Berkeley Heights, New Jersey , where he lived alone. First news of his death came from his former colleague, Rob Pike . He had been in frail health for several years following treatment for prostate cancer and heart disease . News of Ritchie's death

2310-438: The adoption of new features that had not been tested by existing implementations. The C11 standard adds numerous new features to C and the library, including type generic macros, anonymous structures, improved Unicode support, atomic operations, multi-threading, and bounds-checked functions. It also makes some portions of the existing C99 library optional, and improves compatibility with C++. The standard macro __STDC_VERSION__

2376-428: The aims of the C standardization process was to produce a superset of K&R C, incorporating many of the subsequently introduced unofficial features. The standards committee also included several additional features such as function prototypes (borrowed from C++), void pointers, support for international character sets and locales , and preprocessor enhancements. Although the syntax for parameter declarations

2442-467: The availability of Fortran 77 , a successor named Ratfiv (Ratfor=rat4 => rat5=Ratfiv) could, with an option /f77, output a more readable Fortran 77 code: Initial Ratfor source code was ported to C in 1985 and improved to produce Fortran 77 code too. A git tree has been set in 2010 in order to revive ratfor . Although the GNU C compiler had the ability to directly compile a Ratfor file (.r) without keeping

2508-416: The basis for several implementations of C on new platforms. In 1978 Brian Kernighan and Dennis Ritchie published the first edition of The C Programming Language . Known as K&R from the initials of its authors, the book served for many years as an informal specification of the language. The version of C that it describes is commonly referred to as " K&R C ". As this was released in 1978, it

2574-537: The end of each expression statement, and the entry to and return from each function call. Sequence points also occur during evaluation of expressions containing certain operators ( && , || , ?: and the comma operator ). This permits a high degree of object code optimization by the compiler, but requires C programmers to take more care to obtain reliable results than is needed for other programming languages. Dennis Ritchie Dennis MacAlistair Ritchie (September 9, 1941 – c. October 12, 2011)

2640-597: The features of the more-powerful PDP-11. A significant addition was a character data type. He called this New B (NB). Thompson started to use NB to write the Unix kernel, and his requirements shaped the direction of the language development. Through to 1972, richer types were added to the NB language: NB had arrays of int and char . Pointers, the ability to generate pointers to other types, arrays of all types, and types to be returned from functions were all also added. Arrays within expressions became pointers. A new compiler

2706-473: The function definition; functions used without prior declaration were presumed to return type int . For example: The int type specifiers which are commented out could be omitted in K&;R C, but are required in later standards. Since K&R function declarations did not include any information about function arguments, function parameter type checks were not performed, although some compilers would issue

Ratfor - Misplaced Pages Continue

2772-448: The language was designed to encourage cross-platform programming. A standards -compliant C program written with portability in mind can be compiled for a wide variety of computer platforms and operating systems with few changes to its source code. Since 2000, C has consistently ranked among the top four languages in the TIOBE index , a measure of the popularity of programming languages. C

2838-438: The language, supported by compilers from AT&T (in particular PCC ) and some other vendors. These included: The large number of extensions and lack of agreement on a standard library , together with the language popularity and the fact that not even the Unix compilers precisely implemented the K&R specification, led to the necessity of standardization. During the late 1970s and 1980s, versions of C were implemented for

2904-413: The loop. Break is used to leave the innermost enclosing loop statement and continue is used to skip to its reinitialisation. There is also a non-structured goto statement which branches directly to the designated label within the function. switch selects a case to be executed based on the value of an integer expression. Different from many other languages, control-flow will fall through to

2970-425: The most widely used programming languages, with C compilers available for practically all modern computer architectures and operating systems. The book The C Programming Language , co-authored by the original language designer, served for many years as the de facto standard for the language. C has been standardized since 1989 by the American National Standards Institute (ANSI) and, subsequently, jointly by

3036-411: The next case unless terminated by a break . Expressions can use a variety of built-in operators and may contain function calls. The order in which arguments to functions and operands to most operators are evaluated is unspecified. The evaluations may even be interleaved. However, all side effects (including storage to variables) will occur before the next " sequence point "; sequence points include

3102-419: The operating system to a PDP-11 . The original PDP-11 version of Unix was also developed in assembly language. Thompson wanted a programming language for developing utilities for the new platform. He first tried writing a Fortran compiler, but he soon gave up the idea and instead created a cut-down version of the recently developed systems programming language called BCPL . The official description of BCPL

3168-512: The other hand, invented and co-invented two key software technologies which make up the DNA of effectively every single computer software product we use directly or even indirectly in the modern age. It sounds like a wild claim, but it really is true." Another said, "many in computer science and related fields knew of Ritchie's importance to the growth and development of, well, everything to do with computing,..." The Fedora 16 Linux distribution , which

3234-652: The preprocessing phase. Comments may appear either between the delimiters /* and */ , or (since C99) following // until the end of the line. Comments delimited by /* and */ do not nest, and these sequences of characters are not interpreted as comment delimiters if they appear inside string or character literals. C source files contain declarations and function definitions. Function definitions, in turn, contain declarations and statements . Declarations either define new types using keywords such as struct , union , and enum , or assign types to and perhaps reserve storage for new variables, usually by writing

3300-408: The recognizable expression and statement syntax of C with underlying type systems, data models, and semantics that can be radically different. The origin of C is closely tied to the development of the Unix operating system, originally implemented in assembly language on a PDP-7 by Dennis Ritchie and Ken Thompson , incorporating several ideas from colleagues. Eventually, they decided to port

3366-524: The same interview, he stated that he viewed Unix and Linux as "the continuation of ideas that were started by Ken and me and many others, many years ago." In 1983, Ritchie and Thompson received the Turing Award "for their development of generic operating systems theory and specifically for the implementation of the UNIX operating system". Ritchie's Turing Award lecture was titled "Reflections on Software Research". In 1990, both Ritchie and Thompson received

SECTION 50

#1732899175477

3432-409: The simplicity, ease of coding and modularity of ad hoc methods." (CSD-TR236). In comparison to the Ratfor preprocessor on a program of 3000 source lines running on a CDC 6500 system took 185.470 CPU seconds. That was cut by 50% when binary search was used in the Ratfor code. Rewriting the ad hoc lexical scanner using a standard method based on finite automata reduced run time to 12.723 seconds. With

3498-415: The thing being referenced. C program source text is free-form code. Semicolons terminate statements , while curly braces are used to group statements into blocks . The C language also exhibits the following characteristics: While C does not include certain features found in other languages (such as object orientation and garbage collection ), these can be implemented or emulated, often through

3564-468: The type followed by the variable name. Keywords such as char and int specify built-in types. Sections of code are enclosed in braces ( { and } , sometimes called "curly brackets") to limit the scope of declarations and to act as a single statement for control structures. As an imperative language, C uses statements to specify actions. The most common statement is an expression statement , consisting of an expression to be evaluated, followed by

3630-472: The urging of Alan Snyder and also in recognition of the usefulness of the file-inclusion mechanisms available in BCPL and PL/I . Its original version provided only included files and simple string replacements: #include and #define of parameterless macros. Soon after that, it was extended, mostly by Mike Lesk and then by John Reiser, to incorporate macros with arguments and conditional compilation . Unix

3696-703: The use of external libraries (e.g., the GLib Object System or the Boehm garbage collector ). Many later languages have borrowed directly or indirectly from C, including C++ , C# , Unix's C shell , D , Go , Java , JavaScript (including transpilers ), Julia , Limbo , LPC , Objective-C , Perl , PHP , Python , Ruby , Rust , Swift , Verilog and SystemVerilog (hardware description languages). These languages have drawn many of their control structures and other basic features from C. Most of them also express highly similar syntax to C, and they tend to combine

3762-531: The use on a K&R C-based compiler of features available only in Standard C. After the ANSI/ISO standardization process, the C language specification remained relatively static for several years. In 1995, Normative Amendment 1 to the 1990 C standard (ISO/IEC 9899/AMD1:1995, known informally as C95) was published, to correct some details and to add more extensive support for international character sets. The C standard

3828-458: Was an American computer scientist . He created the C programming language and, with long-time colleague Ken Thompson , the Unix operating system and B language . Ritchie and Thompson were awarded the Turing Award from the Association for Computing Machinery (ACM) in 1983, the IEEE Richard W. Hamming Medal from the Institute of Electrical and Electronics Engineers (IEEE) in 1990, and

3894-510: Was augmented to include the style used in C++, the K&R interface continued to be permitted, for compatibility with existing source code. C89 is supported by current C compilers, and most modern C code is based on it. Any program written only in Standard C and without any hardware-dependent assumptions will run correctly on any platform with a conforming C implementation, within its resource limits. Without such precautions, programs may compile only on

3960-653: Was distributed on the DECUS RSX82a SIG tape. C (programming language) This is an accepted version of this page C ( pronounced / ˈ s iː / – like the letter c ) is a general-purpose programming language . It was created in the 1970s by Dennis Ritchie and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of the targeted CPUs. It has found lasting use in operating systems code (especially in kernels ), device drivers , and protocol stacks , but its use in application software has been decreasing. C

4026-706: Was further revised in the late 1990s, leading to the publication of ISO/IEC 9899:1999 in 1999, which is commonly referred to as " C99 ". It has since been amended three times by Technical Corrigenda. C99 introduced several new features, including inline functions , several new data types (including long long int and a complex type to represent complex numbers ), variable-length arrays and flexible array members , improved support for IEEE 754 floating point, support for variadic macros (macros of variable arity ), and support for one-line comments beginning with // , as in BCPL or C++. Many of these had already been implemented as extensions in several C compilers. C99

SECTION 60

#1732899175477

4092-690: Was largely overshadowed by the media coverage of the death of Apple co-founder Steve Jobs , which occurred the week before. Following Ritchie's death, computer historian Paul E. Ceruzzi stated: Ritchie was under the radar. His name was not a household name at all, but... if you had a microscope and could look in a computer, you'd see his work everywhere inside. In an interview shortly after Ritchie's death, long-time colleague Brian Kernighan said Ritchie never expected C to be so significant. Kernighan told The New York Times "The tools that Dennis built—and their direct descendants—run pretty much everything today." Kernighan reminded readers of how important

4158-511: Was not available at the time, and Thompson modified the syntax to be less 'wordy' and similar to a simplified ALGOL known as SMALGOL. He called the result B , describing it as "BCPL semantics with a lot of SMALGOL syntax". Like BCPL, B had a bootstrapping compiler to facilitate porting to new machines. Ultimately, few utilities were written in B because it was too slow and could not take advantage of PDP-11 features such as byte addressability. In 1971 Ritchie started to improve B, to use

4224-563: Was one of the first operating system kernels implemented in a language other than assembly . Earlier instances include the Multics system (which was written in PL/I ) and Master Control Program (MCP) for the Burroughs B5000 (which was written in ALGOL ) in 1961. In around 1977, Ritchie and Stephen C. Johnson made further changes to the language to facilitate portability of the Unix operating system. Johnson's Portable C Compiler served as

4290-494: Was released about a month after he died, was dedicated to his memory. FreeBSD 9.0, released January 12, 2012, was also dedicated in his memory. Asteroid 294727 Dennisritchie , discovered by astronomers Tom Glinos and David H. Levy in 2008, was named in his memory. The official naming citation was published by the Minor Planet Center on 7 February 2012 ( Minor Planet Circulars (M.P.C.) 78272). Ritchie has been

4356-520: Was written, and the language was renamed C. The C compiler and some utilities made with it were included in Version 2 Unix , which is also known as Research Unix . At Version 4 Unix , released in November 1973, the Unix kernel was extensively re-implemented in C. By this time, the C language had acquired some powerful features such as struct types. The preprocessor was introduced around 1973 at

#476523