HOME

TheInfoList



OR:

Andrei Alexandrescu (born 1969) is a
Romanian-American Romanian Americans are Americans who have Romanian ancestry. According to the 2017 American Community Survey, 478,278 Americans indicated Romanian as their first or second ancestry, however other sources provide higher estimates, which are most ...
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
and D language
programmer A computer programmer, sometimes referred to as a software developer, a software engineer, a programmer or a coder, is a person who creates computer programs — often for larger computer software. A programmer is someone who writes/creates ...
and author. He is particularly known for his pioneering work on
policy-based design ''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. The book makes u ...
implemented via
template metaprogramming Template metaprogramming (TMP) is a metaprogramming technique in which templates are used by a compiler to generate temporary source code, which is merged by the compiler with the rest of the source code and then compiled. The output of these te ...
. These ideas are articulated in his book ''
Modern C++ Design ''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. The book makes u ...
'' and were first implemented in his programming library,
Loki Loki is a god in Norse mythology. According to some sources, Loki is the son of Fárbauti (a jötunn) and Laufey (mentioned as a goddess), and the brother of Helblindi and Býleistr. Loki is married to Sigyn and they have two sons, Narfi or Na ...
. He also implemented the " move constructors" concept in his MOJO library. He contributed to the ''
C/C++ Users Journal ''C/C++ Users Journal'' was a computer magazine dedicated to the C and C++ programming languages published in the United States from 1985 to 2006. It was one of the last printed magazines to cover specifically this topic (apart from ACCU's journ ...
'' under the
byline The byline (or by-line in British English) on a newspaper or magazine article gives the name of the writer of the article. Bylines are commonly placed between the headline and the text of the article, although some magazines (notably ''Reader's D ...
"Generic". Alexandrescu worked as a research scientist at
Facebook Facebook is an online social media and social networking service owned by American company Meta Platforms. Founded in 2004 by Mark Zuckerberg with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin M ...
, before departing the company in August 2015 in order to focus on developing the D programming language. He became an American citizen in August 2014.


Education and career

Alexandrescu received a
B.S. A Bachelor of Science (BS, BSc, SB, or ScB; from the Latin ') is a bachelor's degree awarded for programs that generally last three to five years. The first university to admit a student to the degree of Bachelor of Science was the University ...
degree in Electrical Engineering from
Polytechnic University of Bucharest Politehnica University of Bucharest ( ro, Universitatea Politehnica din București) is a technical university in Bucharest, Romania. 200 years of activity have been celebrated lately, as the university was founded in 1818. His first article was published in the ''
C/C++ Users Journal ''C/C++ Users Journal'' was a computer magazine dedicated to the C and C++ programming languages published in the United States from 1985 to 2006. It was one of the last printed magazines to cover specifically this topic (apart from ACCU's journ ...
'' 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. Alexandrescu earned an
M.S. A Master of Science ( la, Magisterii Scientiae; abbreviated MS, M.S., MSc, M.Sc., SM, S.M., ScM or Sc.M.) is a master's degree in the field of science awarded by universities in many countries or a person holding such a degree. In contrast to ...
(2003) and a PhD (2009) in
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
from the
University of Washington The University of Washington (UW, simply Washington, or informally U-Dub) is a public research university in Seattle, Washington. Founded in 1861, Washington is one of the oldest universities on the West Coast; it was established in Seattle a ...
. More recently, he has been assisting
Walter Bright Walter G. Bright is an American computer programmer who created the D programming language, the Zortech C++ compiler, and the ''Empire'' computer game. Early life and education Bright is the son of the United States Air Force pilot Charles D. B ...
in the development of the
D 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-engineeri ...
. Alexandrescu released a book titled ''The D Programming Language'' in May 2010. From 2010 to 2014, Alexandrescu,
Herb Sutter Herb Sutter is a prominent C++ expert. He is also a book author and was a columnist for Dr. Dobb's Journal. He joined Microsoft in 2002 as a platform evangelist for Visual C++ .NET, rising to lead software architect for C++/CLI. Sutter has ser ...
, and
Scott Meyers Scott Douglas Meyers (born April 9, 1959) is an American author and software consultant, specializing in the C++ computer programming language. He is known for his ''Effective C++'' book series. During his career, he was a frequent speaker at con ...
ran a small annual technical conference called ''C++ and Beyond''.


Contributions


Expected

Expected is a
template Template may refer to: Tools * Die (manufacturing), used to cut or shape material * Mold, in a molding process * Stencil, a pattern or overlay used in graphic arts (drawing, painting, etc.) and sewing to replicate letters, shapes or designs ...
class for
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
which is on the C++ Standards track. Alexandrescu proposes Expected 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 Hope is an optimistic state of mind that is based on an expectation of positive outcomes with respect to events and circumstances in one's life or the world at large. As a verb, its definitions include: "expect with confidence" and "to cherish ...
, or the more recent
Haskell Haskell () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lan ...
and
Gallina The Gallina or Largo-Gallina culture was an occupation sequence during the pre-Spanish colonization of the Americas, Hispanic period in the American Southwest from approximately 1050 to 1300. The culture was located in north-central New Mexico roug ...
; or of the error handling mechanism of Google's Go, or th
Result
type in
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH ...
. He explains the benefits of Expected as: * Associates errors with computational goals * Naturally allows multiple exceptions in flight * Switch between "error handling" and "exception throwing" styles * Teleportation possible across thread boundaries, across nothrow subsystem boundaries and across time (save now, throw later) * Collect, group, combine exceptions


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 parseInt(const string&); // Returns an expected int: either an int or an exception


Scope guard

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


Bibliography

* * *


References


External links


Alexandrescu's homepage
– Contains links to downloadable Loki libraries for various
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
s. *
Interviu MONEY.ro: Facebook face angajări în România
', 1 March 2010 {{DEFAULTSORT:Alexandrescu, Andrei Romanian computer scientists C++ people Politehnica University of Bucharest alumni University of Washington alumni Living people Scientists from Bucharest Facebook employees 1969 births Romanian emigrants to the United States Programming language designers