Andrei Alexandrescu

Last updated

Andrei Alexandrescu
AndreiAlexandrescu.jpg
Alexandrescu at ACCU 2009
Born1969 (age 5455)
Nationality Romanian, American [2]
Education Politehnica University of Bucharest and University of Washington
OccupationDeveloper of the D programming language
Known forExpert on C++ and D programming [3]
SpouseSanda Alexandrescu
Website erdani.org

Tudor Andrei Cristian Alexandrescu [4] (born 1969) is a Romanian-American C++ and D language [3] programmer and author. He is particularly known for his pioneering work on policy-based design implemented via template metaprogramming. These ideas are articulated in his book Modern C++ Design and were first implemented in his programming library, Loki. He also implemented the "move constructors" concept in his MOJO library. [5] He contributed to the C/C++ Users Journal under the byline "Generic<Programming>".

Contents

He became an American citizen in August 2014. [6]

Education and career

Alexandrescu received a B.S. degree in Electrical Engineering from Polytechnic University of Bucharest (Universitatea Politehnica din București) in July 1994. [7] [8]

His first article was published in the C/C++ Users Journal in September 1998. He was a program manager for Netzip, Inc. from April 1999 until February 2000. When the company was acquired by RealNetworks, Inc., he served there as a development manager from February 2000 through September 2001. [7]

Alexandrescu earned a M.S. (2003) and a PhD (2009) in computer science from the University of Washington. [9] [10] [11]

In 2006 Alexandrescu began assisting Walter Bright on the development of the D programming language. [12] He released a book titled The D Programming Language in May 2010.

From 2010 to 2014, Alexandrescu, Herb Sutter, and Scott Meyers ran a small annual technical conference called C++ and Beyond.

Alexandrescu worked as a research scientist at Facebook for over 5 years, before departing the company in August 2015 in order to focus on developing the D programming language. [13]

In January 2022, Alexandrescu began working at Nvidia as a Principal Research Scientist. [14]

Contributions

The D Programming Language

Along with Walter Bright, Andrei has been one of the two main designers of the D Programming Language, and the principal maintainer of the standard library Phobos from 2007 to 2019. He is the founder of the D Language Foundation. His contributions include the ranges module. He is the author of "The D Programmming Language" book.

Expected

Expected is a template class for C++ which is on the C++ Standards track. [15] [16] Alexandrescu proposes [17] Expected<T> as a class for use as a return value which contains either a T or the exception preventing its creation, which is an improvement over use of either return codes or exceptions exclusively. Expected can be thought of as a restriction of sum (union) types or algebraic datatypes in various languages, e.g., Hope, or the more recent Haskell and Gallina; or of the error handling mechanism of Google's Go, or the Result type in Rust.

He explains the benefits of Expected<T> as:

Example

For example, instead of any of the following common function prototypes:

int parseInt(const string&); // Returns 0 on error and sets errno.

or

int parseInt(const string&); // Throws invalid_input or overflow

he proposes the following:

Expected<int> parseInt(const string&); // Returns an expected int: either an int or an exception

Scope guard

From 2000 [18] onwards, Alexandrescu has advocated and popularized the scope guard idiom. He has introduced it as a language construct in D. [19] It has been implemented by others in many other languages. [20] [21]

Bibliography

Related Research Articles

In computer science, a recursive descent parser is a kind of top-down parser built from a set of mutually recursive procedures where each such procedure implements one of the nonterminals of the grammar. Thus the structure of the resulting program closely mirrors that of the grammar it recognizes.

<span class="mw-page-title-main">C++</span> General-purpose programming language

C++ is a high-level, general-purpose programming language created by Danish computer scientist Bjarne Stroustrup. First released in 1985 as an extension of the C programming language, it has since expanded significantly over time; as of 1997, C++ has object-oriented, generic, and functional features, in addition to facilities for low-level memory manipulation for systems like microcomputers or to make operating systems like Linux or Windows. It is usually implemented as a compiled language, and many vendors provide C++ compilers, including the Free Software Foundation, LLVM, Microsoft, Intel, Embarcadero, Oracle, and IBM.

Generic programming is a style of computer programming in which algorithms are written in terms of data types to-be-specified-later that are then instantiated when needed for specific types provided as parameters. This approach, pioneered by the ML programming language in 1973, permits writing common functions or types that differ only in the set of types on which they operate when used, thus reducing duplicate code.

In software engineering, the composite pattern is a partitioning design pattern. The composite pattern describes a group of objects that are treated the same way as a single instance of the same type of object. The intent of a composite is to "compose" objects into tree structures to represent part-whole hierarchies. Implementing the composite pattern lets clients treat individual objects and compositions uniformly.

In object-oriented (OO) and functional programming, an immutable object is an object whose state cannot be modified after it is created. This is in contrast to a mutable object, which can be modified after it is created. In some cases, an object is considered immutable even if some internally used attributes change, but the object's state appears unchanging from an external point of view. For example, an object that uses memoization to cache the results of expensive computations could still be considered an immutable object.

<span class="mw-page-title-main">D (programming language)</span> Multi-paradigm system programming language

D, also known as dlang, is a multi-paradigm system programming language created by Walter Bright at Digital Mars and released in 2001. Andrei Alexandrescu joined the design and development effort in 2007. Though it originated as a re-engineering of C++, D is now a very different language. As it has developed, it has drawn inspiration from other high-level programming languages. Notably, it has been influenced by Java, Python, Ruby, C#, and Eiffel.

<span class="mw-page-title-main">Syntax highlighting</span> Tool of editors for programming, scripting, and markup

Syntax highlighting is a feature of text editors that is used for programming, scripting, or markup languages, such as HTML. The feature displays text, especially source code, in different colours and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. This feature is also employed in many programming related contexts, either in the form of colorful books or online websites to make understanding code snippets easier for readers. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.

Resource acquisition is initialization (RAII) is a programming idiom used in several object-oriented, statically typed programming languages to describe a particular language behavior. In RAII, holding a resource is a class invariant, and is tied to object lifetime. Resource allocation is done during object creation, by the constructor, while resource deallocation (release) is done during object destruction, by the destructor. In other words, resource acquisition must succeed for initialization to succeed. Thus the resource is guaranteed to be held between when initialization finishes and finalization starts, and to be held only when the object is alive. Thus if there are no object leaks, there are no resource leaks.

In some programming languages, const is a type qualifier that indicates that the data is read-only. While this can be used to declare constants, const in the C family of languages differs from similar constructs in other languages in that it is part of the type, and thus has complicated behavior when combined with pointers, references, composite data types, and type-checking. In other languages, the data is not in a single memory location, but copied at compile time for each use. Languages which use it include C, C++, D, JavaScript, Julia, and Rust.

<i>Modern C++ Design</i> Book by Andrei Alexandrescu

Modern C++ Design: Generic Programming and Design Patterns Applied is a book written by Andrei Alexandrescu, published in 2001 by Addison-Wesley. It has been regarded as "one of the most important C++ books" by Scott Meyers.

A class in C++ is a user-defined type or data structure declared with any of the keywords class, struct or union that has data and functions as its members whose access is governed by the three access specifiers private, protected or public. By default access to members of a C++ class declared with the keyword class is private. The private members are not accessible outside the class; they can be accessed only through member functions of the class. The public members form an interface to the class and are accessible outside the class.

The curiously recurring template pattern (CRTP) is an idiom, originally in C++, in which a class X derives from a class template instantiation using X itself as a template argument. More generally it is known as F-bound polymorphism, and it is a form of F-bounded quantification.

C++11 is a version of a joint technical standard, ISO/IEC 14882, by the International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC), for the C++ programming language. C++11 replaced the prior version of the C++ standard, named C++03, and was later replaced by C++14. The name follows the tradition of naming language versions by the publication year of the specification, though it was formerly named C++0x because it was expected to be published before 2010.

The C++ programming language has support for string handling, mostly implemented in its standard library. The language standard specifies several string types, some inherited from C, some designed to make use of the language's features, such as classes and RAII. The most-used of these is std::string.

In the C++ programming language, the assignment operator, =, is the operator used for assignment. Like most other operators in C++, it can be overloaded.

This article compares a large number of programming languages by tabulating their data types, their expression, statement, and declaration syntax, and some common operating-system interfaces.

The erase–remove idiom is a common C++ technique to eliminate elements that fulfill a certain criterion from a C++ Standard Library container.

In C++ computer programming, allocators are a component of the C++ Standard Library. The standard library provides several data structures, such as list and set, commonly referred to as containers. A common trait among these containers is their ability to change size during the execution of the program. To achieve this, some form of dynamic memory allocation is usually required. Allocators handle all the requests for allocation and deallocation of memory for a given container. The C++ Standard Library provides general-purpose allocators that are used by default, however, custom allocators may also be supplied by the programmer.

In C++ computer programming, copy elision refers to a compiler optimization technique that eliminates unnecessary copying of objects.

Although C++ is one of the most widespread programming languages, many prominent software engineers criticize C++ arguing that it is overly complex and fundamentally flawed. Among the critics have been: Robert Pike, Joshua Bloch, Linus Torvalds, Donald Knuth, Richard Stallman, and Ken Thompson. C++ has been widely adopted and implemented as a systems language through most of its existence. It has been used to build many pieces of very important software.

References

  1. "Erdani.com".
  2. andralex (14 August 2014). "No". Reddit. Archived from the original on 16 June 2022.
  3. 1 2 Metz, Cade (7 July 2014). "The Next Big Programming Language You've Never Heard Of". Wired . Retrieved 27 July 2014. Today, Alexandrescu is a research scientist at Facebook, where he and a team of coders are using D to refashion small parts of the company's massive operation.
  4. "The D Language Foundation". dlang.org. Retrieved 5 June 2024.
  5. Alexandrescu, Andrei (1 February 2003). "Move Constructors". Dr. Dobb's Journal . Archived from the original on 7 May 2009. Retrieved 25 March 2009.
  6. "Sixteen years ago, at 28, I landed in New York with $300 to my name. Today I became a US citizen. It's been a wild ride that I hope will go on! : pics". 14 August 2014.
  7. 1 2 "Andrei Alexandrescu: Resumé". Archived from the original on 7 April 2011.
  8. ACCU Spring Conference 2001 Archived 11 August 2011 at the Wayback Machine
  9. "ACCU :: Speakers". members.accu.org.
  10. "ACCU :: Speakers". members.accu.org.
  11. Computer Science & Engineering, Recent Ph.D. Graduates (Summer 2009).mark University of Washington.
  12. "About Andrei Alexandrescu, PhD".
  13. "Moving forward with work on the D language and foundation". 25 August 2015. Retrieved 28 August 2015.
  14. "Andrei Alexandrescu". LinkedIn.com. Retrieved 15 December 2023.
  15. [Botet; Talbot. "A proposal to add a utility class to represent expected monad" (PDF). Archived from the original (PDF) on 19 August 2014.
  16. "STD-make/P0323r2.md at master · viboes/STD-make". GitHub . 21 October 2021.
  17. Alexandrescu. "Systematic Error Handling in C++". Archived from the original on 25 April 2013.
  18. Andrei Alexandrescu; Petru Marginean. "Generic: Change the Way You Write Exception-Safe Code – Forever". Archived from the original on 1 October 2012.
  19. "Exception Safety - D Programming Language".
  20. "Scope::Guard - lexically-scoped resource management - metacpan.org". metacpan.org.
  21. "Scopeguard - Rust".