`
hqs7636
  • 浏览: 220358 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

三访安德烈Alexandrescu(第一部分)

阅读更多
google翻译哦

Interview with Andrei Alexandrescu (Part 1 of 3)


文章分类: C++编程 文章分类: C + +的编程
In part 1 of this three-part series, Eric Niebler talks with his pal and fellow InformIT contributor Andrei Alexandrescu about the D programming language and Andrei's new book about it: what makes D different from other languages, whether D's class libraries rival those of Java and .NET, and why Andrei claims not to be a guru.在第三部分中三部分系列的第1,埃里克 Niebler会谈,他的朋友和有关的D编程语言和安德烈的关于它的新书:是什么使D的其他语言中的不同同胞Informit.com的贡献安德烈 Alexandrescu,无论是D的竞争对手的Java的类库和。NET,为什么安德烈表示不是一个大师。

See Part 2 of this interview.见第2部分的采访。

My name is Eric Niebler.我的名字是Eric Niebler。 I'm a C++ developer by day.我是一个C + +开发人员的一天。 Andrei Alexandrescu and I have been friends for years, and—in full disclosure—I've long shared Andrei's curiosity about the D programming language.安德烈Alexandrescu和我多年的朋友,在充分披露,从来就长期共同安德烈的有关D编程语言的好奇心。 I even sat in on the D design meetings in Seattle with Andrei, Walter Bright, Bartosz Milewski, and others; in these highly technical meetings about language design, Andrei would gleefully "destroy" Walter about this or that issue, and then he'd "destroy" Bartosz, and me, and the girl behind the counter, and anyone else in range.我什至就坐在三维设计在西雅图会见了安德烈,沃尔特明亮,Bartosz米莱夫斯基,和其他人,在对语言设计这些高度技术性会议,安德烈会兴高采烈地“消灭”沃尔特对这个或那个问题,然后他会“摧毁”Bartosz,和我,柜台后面的女孩,和其他任何人的范围。 So much destruction!这么多的破坏! If Andrei had a reality TV show, his catchphrase would be, "You're destroyed," which would issue out of the side of his smirking mouth in his characteristic sotto voce.如果安德烈已经成为现实的电视节目,他的口头禅是:“你毁”,这是他特有的问题奥西奥悄悄出了他的嘴里一边面带笑容。 Had he been a count in medieval Romania, his moniker might have been Andrei the Destructor.如果他是一个在中世纪罗马尼亚伯爵,他的绰号可能是安德烈的析构函数。 (A little programming language pun there.) (一点点的编程语言有双关语。)

It's my pleasure to interview Andrei for InformIT about his new book, The D Programming Language, and have a chance to destroy him with some devastating questions of my own.这是我高兴地对采访他的新书Informit.com的安德烈,D的编程语言,并有机会摧毁我自己的一些具有破坏性的问题了。 "En garde!" “恩派!” I shout (donning my flame-resistant suit of armor first).我留言(穿上我的盔甲阻燃诉讼第一)。

Eric: Hi, Andrei.埃里克:嗨,安德烈。 First, congrats on becoming a father and a Ph.D., and for releasing a new book as well.首先,在成为一个父亲和一个博士学位,并释放了一本新书,以及祝贺。 You've certainly been busy!你肯定是忙! Second, as a hardcore C++ developer, I must say I am very impressed with D. Nevertheless, I have some nits to pick.第二,作为一个铁杆的C + +开发者,我必须说我感到非常感动不过四,我有一些尼特挑选。

D has been around for quite a while now. D已被相当长的一段约了。 Why is the time right for a book?为什么一本书的时间吗? And why you? ,为什么? Aren't you afraid they'll revoke your "C++ guru" card?难道你不害怕他们会撤销你的“C + +大师”牌?

Andrei: Whoa, what a great question.安德烈:哇,真是一个伟大的问题。 Allow me to hijack it for some catharsis.请允许我劫持一些宣泄它。

It wasn't easy getting used to this "C++ tricks guy" status.这是不容易习惯这种“C + +的过关家伙”的地位。 I was thinking I'd be at most "a design guy who uses C++ as his mechanism."我在想我会在最“设计作为他的家伙谁使用C + +的机制。” It's been very surprising to me that many focused on the C++ tricks of my work more than on the underlying need to express designs in a simple and generic manner.这是非常令人吃惊,我认为许多关于C + +我的工作比对技巧的基本需要来表达一个简单和通用的方式设计更集中。 A few years ago, in a talk at an ACCU conference in Oxford, I said these exact words: "I am not a C++ guru, and I never was."几年前,在一次谈话中,在牛津农民自卫队在会上,我说这些字眼:“我不是一个C + +大师,我从来没有。” The audience burst into laughter—and I was flabbergasted.到笑,而我是观众大吃一惊爆裂。 It was like one of those sitcom moments in which there's a complete misunderstanding.这就像那些情景喜剧的时刻,其中有一个完整的误解之一。 I was being honest, and they thought it was all a ruse!我是诚实,他们认为这只是一个诡计! (I must have seemed quite a pompous jerk to at least some.) (我必须看起来相当自负挺举至少一些。)

So I was unhappy about this typecasting.所以我对这个类型转换不满。 Remember the late Michael Landon from Little House on the Prairie?记得在大草原上小屋已故迈克尔兰登? Nobody ever cast him as a villain!从来没有人投他作为一个坏蛋! I didn't want to be a "Little Template on the C++ Prairie" guy for the rest of my career.我不想成为在C + +里的“小模板”为我的职业生涯的人。 I wanted to be a villain, too—so that's why I did research in machine learning and natural language processing.我想成为一个坏人,太让这就是为什么我在机器学习和研究自然语言处理。 Plenty of mean things to learn.平均事情很多可以学习的。

Around 2006, my doctoral research was going pretty well, and I had decided to start defining my own language as a side project. 2006年左右,我的博士研究是进行得很顺利,我已经决定开始项目定义为一个方自己的语言。 There were just too many things I wanted to express that no language could model reasonably well.有太多的事情,我想,没有语言能够表达模型相当良好。 There were programming languages plastered all over the landscape, yet I was standing in this Sahara with no language oasis anywhere near.有编程语言的景观都贴满了,但我没有任何语言,站在这撒哈拉绿洲附近的任何地方。

That language, called Enki, had some quite ambitious goals.该语言被称为恩基,有一些非常雄心勃勃的目标。 I was toying with Enki when a fateful discussion with Walter Bright at the Flowers Bar in Seattle disabused me of the notion of starting a language from scratch.我被玩弄了恩基当光明与沃尔特在西雅图花酒吧致命的讨论disabused的开始从头开始我的语言的概念。

Eric: Was I there for that?埃里克:是的,我呢? I was, right?我,对不对? At the raised table in the corner on the left.同时在左边的角落里提出的表。 Or was that a different meeting?或者是一个不同的会议?

Andrei: Yes, the odd table with those old seats that must have served Jimi Hendrix's butt.安德烈:是的,与那些必须有送达吉米亨德里克斯的屁股老议席单表。

Eric: I remember when your vapor-language was called Weasel and you kept trying to get people to read your manifesto, like some geeky Unabomber.埃里克:我记得你的汽语言被称为黄鼠狼,你一直试图让别人了解你的宣言,像一些古怪无原子弹论者。

Andrei: Yeah, Weasel was Enki 0.1.安德烈:是啊,黄鼠狼是恩基0.1。 I remember how I did a search-and-replace changing Weasel to Enki in the whitepaper.我记得我做了搜索和替换改变黄鼠狼给恩基的白皮书。 Heck, it's still online.哎呀,它仍然在线。

Any language definition needs to deal with so much stuff, it ain't even funny.任何语言的定义需要处理这么多的东西,它甚至不是滑稽。 And as it's all subjective and difficult to quantify, it's inevitable that some decisions that seem good at one time look really crappy at others.而作为它的所有主观,难以量化,它是不可避免的一些决定,似乎在一时间好好看看别人真的糟糕。 Walter pointed out some aspects of Enki that he knew from experience will age badly, and in fact were already starting to suffer from conceptual rot.瓦尔特指出了恩基某些方面的经验,他知道将年龄严重,实际上已经开始出现腐烂的概念。 Instead of defining Enki from scratch and probably straight into oblivion, Walter suggested, why not use D as a basis, a starting point for a "better D" that I could help define?而不是从头开始,并确定可能被人遗忘直恩基,沃尔特的建议,为什么不以此为基础开发,为一个“更好的D的起点”,我可以帮助确定?

At that time I didn't like D—I found it unprincipled and derivative, in addition to having serious expressiveness problems for certain designs.当时我不喜欢的D -我发现它无原则及衍生除了有严重的表现为某些设计问题,时间。 We agreed to work together on these issues.我们同意就这些问题一起工作。 And that's how D2 was born out of D1's rib: in two worn-out chairs in a smoky bar (they still smoked in that bar back then!) over unbearable noise.这就是D2的是如何诞生的D1的肋骨在两个破旧的椅子在黑烟条:(他们仍然在该酒吧吸烟回来了!)在无法忍受的噪音。 Soon thereafter, we started those legendary day-long meetings that often featured Bartosz Milewski, you, and others.此后不久,我们开始的传奇为期一天的会议,往往精选Bartosz米莱夫斯基,你和他人。

In order to shake off D1's mistakes, Walter decided to make D2 an incompatible branch while putting D1 in maintenance mode.为了摆脱素D1的错误,沃尔特决定把D2的一个分支,而把不符合在维护模式D1的表达。 That gambit caused understandable protests within the community, but has paid off immensely.这个话题引起了社会的理解范围内的抗议,但回报极大。 Today, there are so many aspects of D2 that make me think, "Wow, we really did here what had to be done"—most of which would have been impossible if compatibility with D1 was a requirement.今天,有D2的,使我想到,“这么多问题呀,我们真的在这里做了什么工作要做”,其中将是不可能的,如果与D1的相容性要求最。

The book grew organically together with D2.该书与D2的有机增长。 I wrote what I thought was the right thing; Walter would review draft chapters as I wrote them; and whenever the book and the language were disagreeing over something, we'd negotiate changing one or the other.我说了我认为正确的事情;瓦尔特会章草案的审查,因为我说这些,每当书和语言超过一些不同意,我们会改变谈判一方或另一方。 Oddly enough, we consistently saw eye-to-eye in all aspects that matter.奇怪的是,我们始终认为在各方面的眼睛对眼睛的问题。 In the book, there's a table cell with a skull-and-crossbones; that's the outcome of our largest disagreement.在书中,有一个有骷髅和交叉腿骨表格单元格,这就是我们最大的分歧的结果。

Today, D2 embodies some ideas that I think are really cool and disruptive, and yet it has a level-headedness, a balance that's rare in this design space so prone to extrema.今天,D2中体现了一些想法,我觉得真的很酷和破坏性,但它有一个公平的头脑,保持一个平衡,在这难得的设计空间,以便容易极值。 I am very happy to be a part of all this.我很高兴能参与到其中。

So, why is this the right time for a book?那么,为什么这是一本书的适当时机? Because D2 is now mature enough to be shown to the world.由于D2是已经成熟到足以向世界证明。 Sure, it has some cilantro in its teeth and might emit a burp together with "Hello, world," but it really has something to say.当然,也有一些在其牙齿香菜,并可能发出的“你好,世界”,但它确实有话要说,一打嗝在一起。 Why me?为什么是我? Because I've designed some of D2, I know the rest as well as if I'd designed it myself, and because I believe all of that is worthwhile to share.因为我设计的D2一些,我都知道了以及如果我设计它自己,因为我相信这一切是值得的份额。 About the guru card?关于大师卡吗? Honestly: I'm not a guru, and I never was.老实说:我不是大师,我从来没有。

Eric: As a garbage-collected, natively compiled language, it seems to me that D stakes out a very small patch of real estate on the computing landscape: not as fast as a language with explicit memory management (C or C++), and not as flexible or portable as a JIT-ed or interpreted language (C# or Java).埃里克:作为垃圾收集,原生编译的语言,在我看来,代表D赌注列于计算产业格局的房地产非常小的修补程序:还不如一个明确的内存管理(C或C + +语言快),而不是灵活或便携式作为一个JIT - ED镜头或解释语言(C#或Java)。 In your opinion, is there enough room in the niche D has chosen, especially considering that the niche is shrinking as JIT performance improves and GC can be added to C++ as a library?在您看来,在有足够的空间生态位Ð选择,特别是考虑到利基是JIT的性能提高和GC萎缩可以增加一条,作为一个库为C + +?

Andrei: The question assumes two separate and definite choices: D is garbage-collected, and D is natively compiled.安德烈:假设两个单独的问题,明确的选择:D是垃圾收集和D是本机编译。 In reality, they are both options: D also supports manual memory-management (for example, you can call good old malloc() and free() without any intervening translation layer), and a definite subset of D is JIT-able (although at this time no JIT has been written for it).在现实中,他们都选择:D还支持手动内存管理(例如,你可以调用的旧的malloc()和free没有任何中间转换层()),和一个子集,是对D一定准时,能够(尽管在这个没有准时已为其编写的时间)。 That doesn't make D restrict itself to a small patch between other languages; instead, it invades the territory claimed by each.这并不让Ð局限于一小片之间的语言,而是侵入境内各索赔。 Let me substantiate that claim below.让我证实这一说法如下。

Let's see what a language needs in order to be JIT-able:让我们来看看一个语言需要,以便进行JIT能够:

* It must be memory-safe. *必须存储安全的。 Virtually all JIT infrastructures today want to be able to validate and sandbox code.今天,几乎所有的JIT基础设施要能够验证和沙箱代码。
* The language needs some means of dynamic binding and evaluation. *语言需要一些手段,动态绑定和评价。 This could be done entirely as a library, as Java and C# libraries have shown.为此,可以完全作为一个库,Java和C#库显示。

That leaves us with safety as the one core language feature necessary for JIT-ability.这使得作为一个核心的语言特性准时化,必要的安全我们的能力。 But D isn't safe—it has unrestricted pointers (per my reference to malloc() and free() above).但D是不是安全,它可以不受限制地指针(按我参考的malloc()和free()段)。 D allows you the decadent joys of adult life—you can cast a pointer to an integer and then back, if you really want to do that. D允许您对成年生活颓废的快乐,你可以转换一个指针为整数,然后回来,如果你真的想这样做。 If you want to punch a few electrons down unusual backstreets, D will be your trusty sidekick.如果你想冲下来几个不寻常的后街电子,D将成为您信赖的助手。

So where does that leave us?那么,这是否给我们? The cool trick is that D has a well-defined safe subset known as SafeD, and annotations that guide the compiler to distinguish safe from unsafe code.凉爽的伎俩是,D具有良好定义的子集萨费德已知安全和注释,以指导编译器,以区别于不安全代码的安全。 This isn't a new idea, but D integrated it in style.这不是一个新的想法,但它集成了D的风格。 (We're talking condom, not chastity belt.) (我们正在谈论避孕套,而不是贞操带。)

D offers unrestricted pointers, but the vast majority of D programs never use them. D提供无限制的指针,但绝大多数的D方案从来不使用它们。 (I almost forgot to insert a section in the book dedicated to pointers—true story.) This is because D offers built-in arrays and because all polymorphic objects are garbage-collected and manipulated through restricted references (just as in Java and C#). (我差点忘了插入一个专门的指针,真实的故事书一节。)这是因为D提供了内置的阵列和,因为所有的多态对象是垃圾收集,并通过限制引用(就像在Java和C操纵#) 。 As a powerful consequence, a meaningful, well-defined subset of D is seamlessly JIT-able.作为一个强大的结果,一个有意义的,明确的D子集是无缝进行JIT能。 You can write entire applications in SafeD.你可以写在萨费德整个应用。

At the same time, inevitably some code will need access to unrestricted pointers.同时,不可避免地将一些代码需要访问不受限制的指针。 The JIT engine itself, the garbage collector—they need to mess with untyped memory and at some point claim it became typed, or vice versa. JIT的引擎本身,垃圾收集器,它们需要与非类型化的内存和在某些时候要求它成为打字,或反之亦然的混乱局面。 Also, use of unrestricted pointers can make a good number of programs faster and tighter, and many important programs don't have an upper bound on performance needs—better performance means trying more hypotheses, analyzing more data, wrecking the stock market more effectively, recognizing speech and images better, or—as is the case of my employer, Facebook—offering more cool features to more users with relatively fewer machines.另外,无限制使用指针可以使相当数量的方案更快和更严格的,许多重要的方案没有一个性能上的需求,更好的性能,势必意味着试图更多的假设,分析更多的数据,破坏了股市更有效语音识别和图像更好,或者作为是我的雇主而言,Facebook的很酷的功能,以提供更多更多的用户相对较少的机器。 That's why D also supports unrestricted pointers, in situ allocation, stack-allocated arrays, and other features that are not provably safe.这就是为什么D还支持无限制的指针,就地分配,栈分配的数组,而不是可证明安全的其他功能。

Regarding adding garbage collection to C and C++, that's feasible (and has been done), but it's not very appealing.关于增加垃圾收集到C和C + +,这是可行的(并已完成),但它不是非常有吸引力。 One of the major advantages of GC is provable safety, but C and C++ don't offer a coherent safe subset to use in conjunction with a garbage collector for a solid offering.对胃癌的一个主要优点是可证明的安全,但C和C + +不提供一个连贯的安全的一个子集,可用以提供一个坚实的垃圾收集器一起使用。 You can't write a meaningful C or C++ program without using unrestricted pointers.你可以不写不使用不受限制的指针一个有意义的C或C + +程序。 C++ needs pointers for arrays, polymorphism (an odd breeding, giving birth to monsters such as "array of polymorphic values"), all self-referential data structures (such as lists, trees, and graphs), etc. Even if you use higher-level abstractions on top of pointers, such as std::vector or boost::shared_ptr, and even if you ignore the fact that they use unrestricted pointers in their implementation, their interface isn't sealed—it still must use pointer semantics. C + +中需要对数组的指针,多态现象(一个奇怪的滋生,使诸如“多态值的数组诞生的怪物”),所有自我参照的数据结构,如表,树(和图表),等等,即使你使用更高级别抽象上面的指针,如性病,::向量或升压::shared_ptr的,即使你忽略一个事实,他们在执行无限制使用指针,它们的接口不密封,它仍然必须使用指针语义。 Unrestricted pointers pervade C and C++ to the core.无限制指针弥漫C和C + +的核心。 I'm not saying that's bad!我并不是说这是很糟糕! (Though, heck, I kinda think it. Don't tell.) I'm just saying that erodes the appeal of GC and also works against JIT-ability. (不过,哎呀,我有点想它。不要告诉。)我只是说削弱地方选区的上诉,并反对进行JIT能力工程。

It's interesting that D can serve such broad needs.有趣的是D可以为这种广泛的需求。 I get to run a high-level, safe script; the core library it uses; and the underlying low-level garbage collector—all written in D. That's why D is of potential interest not only for C++ programmers, but also for users of languages such as Java or Python.我开始运行一个高层次的,安全的脚本,核心库中使用,以及相关低级别垃圾收集器,所有书面在D这就是为什么D的潜在利益,不仅为C + +程序员,而且还为用户语言如Java或Python。 The markets will decide whether there will be JIT offerings for the safe subset of D—the language itself is prepared.市场将决定是否将在D -的语言子集的JIT产品本身的安全准备。

Eric: Some would say that the true strength of platforms like Java and .NET is their enormous class libraries.埃里克:有人会说,像Java平台的真正实力和。NET是他们巨大的类库。 Does D have an equivalent? Ð是否有相同呢?

Andrei: D doesn't currently have libraries of the size of Java's and .NET's.安德烈:搭扣目前还没有对Java的大小图书馆和。NET的。 There are some obvious reasons, the simplest being D's youth and relatively low adoption.有一些明显的原因,最简单的是D的青年和相对较低的通过。

However, I'm very hopeful about the future prospects in library space for D. Now the language is stable, which is good—library design is parallelizable, language design is much less so.不过,我很担心图书馆空间为未来的前景充满希望四现在的语言是稳定的,这是好的库设计是并行的,语言的设计是非常少的。 I'm already seeing some strong trends; recently there has been a surge of participation to the standard library.我已经看到了一些强有力的趋势,最近有激增的参与到标准库。 Until a few months ago, Don Clugston, Sean Kelly, and I—and of course sometimes Walter—would maintain and improve Phobos (D's standard library).直到几个月前,唐克拉斯顿,肖恩凯利,和I -,当然有时尔特将维持并提高火卫一(D的标准库)。 Lately, several very strong contributors have shown up from all over the world, and they all "get it."最近,几个非常强大的贡献者显示了从世界各地,他们都“得到它。” It's a weird feeling—I've been working at fundamentals like std.algorithm for years, and developed a specific style and a number of idioms and abstractions, always insecure about whether anyone would care.这是一个关于是否会有人照顾怪异的感觉,从来就一直在想多年std.algorithm基础,并制定了具体的风格和成语和抽象的数字,总是没有安全感。 And now these people come and not only understand that stuff, they also take it to cool places that I hadn't imagined.而现在这些人来,而不是只知道的东西,他们是否还可以降温,我没有想到的地方。

With D, you can get very close to the generic ideal, "This is the last implementation of linear search I'll ever need to write."与D,你可以得到非常接近一般的理想,“这是最后的执行线性搜索我永远需要写。” Or binary search.或二进制搜索。 Or stable matching.或稳定的匹配。 Or Levenshtein distance.或Levenshtein距离。 I searched around, and it looks like D is the only language offering Levenshtein distance on UTF strings without copying the input and without special-casing per encoding.我搜索周围,和它看起来像D是唯一的语言上提供的UTF字符串而不复制的投入,也没有特殊的编码套管每Levenshtein距离。 D just has the abstraction power to deal with variable-width entities efficiently and within a unified definition (that works with many other inputs, such as linked lists of floating point numbers, if you want). Ð只是有抽象的权力来处理可变宽度实体的效率和在一个统一的定义(这与许多其他投入,如浮点数链表,如果你想)。 It's really the last Levenshtein implementation I need to write.这真是我的最后莱文斯坦的实施需要编写。 Now, you may not care about that particular algorithm, but there are benefits of that power for many structures, algorithms, and design artifacts that might be important to you.现在,你可能不关心该特定的算法,但也有对许多结构,算法的权力利益,以及设计工件可能对你很重要。

Stepanov tried exactly that with the STL, and succeeded to enough degree to offer a taste of what true programming is like.斯捷潘诺夫试图准确,与STL和足够的程度,成功地提供了什么是真正的编程一样的味道。 Unfortunately, the STL is currently marred by the fact that getting any of it going in C++ was a tooth-and-nail fight: no lambdas, no static if, no template dispatch, and overall so much syntactic noise that STL today is incomprehensible outside of C++.不幸的是,STL的是目前所破坏的事实,获取任何它在C + +将是牙齿和钉斗争:没有lambda表达式,不产生静电,如果没有模板派遣,以及整体这么多句法噪声的STL今天是不可理解的外部对C + +。 With D, all of that will change.与D,该会改变这一切。

Other languages may seem to offer similar genericity, but they most often don't.其他的语言似乎提供类似的泛型,但它们通常都不起作用。 The typical argument starts like this: "Of course we've taken care of generic search. First, you need to assume that everything is a singly linked list…" (or an object, or a hash table).典型的说法开始是这样的:“当然,我们已经采取了通用的搜索服务。首先,你必须假定一切是一个单链表...”(或对象,或哈希表)。 The only civilized retort to that is, "What do you mean, 'all cows are spherical'?"唯一的文明反驳的,就是,“你是什么意思,'所有的牛都是球形'?” Other languages are so confused that at some point they tried to talk the need for genericity out of existence—don't even get me Going.其他的语言是如此混乱,在某些阶段,他们试图说服了泛型需要存在,育苗,甚至让我走出去。

Why am I saying this?我为什么这样说? Because many libraries are like many fish; a good language is like a good fishnet.由于许多图书馆像很多鱼,良好的语言就像一个很好的渔网。 It will be interesting to see what happens in library space now that D is stable.这将是有趣的,看看现在发生在图书馆空间D是稳定的。

Eric: Has anybody worked out a way to access Java's or .NET's class libraries from D?埃里克:有没有人制定了一个方法来访问Java的或。NET从D级图书馆? That would be interesting, and lessen the need for a vast D class library in the short term.这将是有趣的,并减少了一个巨大的D在短期内类库的需要。

Andrei: Not that I've heard.安德烈:不,我听说了。 There's only one .NET proof-of-concept implementation of a D compiler.只有一个。NET中证明了概念的一个D编译器执行。 There's also talk about translating Java code into D automatically or semi-automatically.另外还有谈谈Java代码转换成D自动或半自动。 Again, such things are not easy but are eminently feasible; market forces will decide what happens.同样,这种事情并不容易,但显然是可行的,市场力量将决定会发生什么。

Eric and Andrei continue this discussion in "Interview with Andrei Alexandrescu (Part 2 of 3)."埃里克和安德烈继续这个“专访安德烈Alexandrescu(3 2部分的讨论)。”


分享到:
评论

相关推荐

    c++编程规范(101条规则)—第一部分

    ++编程规范(101条规则、准则与最佳实践,中文)获图灵奖书籍,Herb Sutter,Andrei Alexandrescu 著,刘基诚译 下载说明:把压缩文件:c++编程规范(101条规则)—第一部分 & c++编程规范(101条规则)—第二...

    [C++编程规范101条规则、准则最佳实践].Herb.Sutter.Andrei.Alexandrescu]

    [C++编程规范101条规则、准则最佳实践].Herb.Sutter.Andrei.Alexandrescu]

    An Implementation of Discriminated Unions in C++ .alexandrescu.pdf

    内置和用户定义类型之间的透明度,一种“完全不相关”模式,要求用户必须以统一方式处理所有可能的鉴别联合体类型,否则将出现编译时错误,以及通过避免动态内存使用和提供常数时间复杂度O(1)的类型转换来实现的高效...

    c++编程规范(101条规则)—第二部分

    ++编程规范(101条规则、准则与最佳实践,中文)获图灵奖书籍,Herb Sutter,Andrei Alexandrescu 著,刘基诚译 下载说明:把压缩文件:c++编程规范(101条规则)—第一部分 & c++编程规范(101条规则)—第二...

    D程序设计语言.(美)Andrei.Alexandrescu著

    D语言是一种通用的系统和应用编程语言,它保持了生成高效代码以及直接访问操作系统API和硬件的能力。《D程序设计语言》是一本介绍D语言的权威书籍,全面、系统、专业地讲解了D语言相关的内容。书中涵盖了D语言的...

    珍藏很多C++的精典图书第三部分(总共六部,实在是太多,珍藏太久,今天拿出来分享给大家)

    1. **C++Templates.chm**:这是一部关于C++模板的深入指南。C++模板是语言中的一个重要特性,允许创建泛型代码,即代码可以在多种数据类型上通用。本书可能会讨论模板的基本概念,如函数模板和类模板,以及模板元...

    C++设计新思维(简体)

    第二部分(第三篇)则是基于第一部分的技术,展示了如何实现一系列设计模式,如: 1. **Small-Object Allocation**:针对小对象的内存分配策略,优化内存管理,降低内存碎片。 2. **Generalization Functors**:...

    modern c++ design

    第一部分(第一页)主要讲解基础技术。其中,template template parameters是一种允许模板接受其他模板作为参数的技术,极大地增强了模板的灵活性和可扩展性。策略设计模式则是通过参数化类的行为,使得代码更具可...

    无涯教程(LearnFk)-D编程教程离线版.pdf

    D语言的第一个稳定版本(1.0)于2007年1月2日发布,紧接着版本2.0于同月17日发布。D语言的特点是简洁易学,它提供了丰富的标准库支持,并且编译效率较高,大多数D语言的实现直接编译为机器代码。D语言的官方编译器是...

    Modern C++ Design

    《现代C++设计》是Andrei Alexandrescu的一部经典之作,它深入探讨了C++模板的高级技术及其在实际编程中的应用,特别是在设计模式和库实现方面的创新。这本书不仅揭示了C++模板的强大潜力,还引入了一种名为Loki的库...

    操作系统(内存管理)

    void *malloc(long numbytes):该函数负责分配 numbytes 大小的内存,并返回指向第一个字节的指针。 void free(void *firstbyte):如果给定一个由先前的 malloc 返回的指针,那么该函数会将分配的空间归还给进程的...

    systematic error handling in c++

    安德烈·亚历山德雷斯库(Andrei Alexandrescu)在CppCon上的演讲主题是“systematic error handling in C++”,其中他提出了Expected和ScopeGuard的设计思想及其在实际应用中的实现。下面我们详细展开这些概念及其...

    C++编程规范.pdf

    Herb Sutter Andrei Alexandrescu著 刘基诚译

    C++编程规范 101条规则、准则与最佳实践 高清扫描版

    作者: [加]赫布 萨特(Herb Sutter)[罗]安德烈亚历克斯安德莱斯库(Andrei Alexandrescu) 译者: 刘基诚 出版社:人民邮电出版社 ISBN:9787115351357 上架时间:2016-3-22 出版日期:2016 年3月 开本:16开 ...

    Modern_C++_Design_中文版

    本书分为两大部分,第一部分专注于基础技术讨论,第二部分则详细介绍了Loki库的设计与实现。 ### 基础技术 #### Template Template Parameters (TTP) Template template parameters允许模板接受其他模板作为参数,...

    C++_Coding_Standards_101_Rule

    4. 《C++ Network Programming》:分为两卷,第一卷讲述了如何使用ACE和设计模式来掌握复杂性,而第二卷则讨论了如何利用ACE和框架实现系统的复用。 5. 《C++ Template Metaprogramming: Concepts, Tools, and ...

    c++ 新思维.pdf

    《C++新思维》是Andrei Alexandrescu所著,侯捷翻译的一本关于C++编程的书籍。这本书详细介绍了现代C++设计的概念,包括泛型编程和设计模式的应用,以及C++模板的高级使用技巧。Andrei Alexandrescu是C++社区著名的...

Global site tag (gtag.js) - Google Analytics