Interfacing D To Legacy C++ Code
Channel:NWCPP - Northwest C++ Users Group · Length:1:21:23 · Published:2015-01-23 · Views:5483
Summary
Walter Bright explains to the Northwest C++ Users Group how the D programming language can interface directly with legacy C++ code. He covers why C++ is hard to interface with and how D approaches the problem.
Why HN recommends it
HN uses it as evidence that D has unusually good C++ interop and as Walter Bright's account of the challenges D is tackling.
Programming language design · C, C++, Rust, Go & systems languages
Subtitles (excerpt)
years now [Applause] um um Walter brgh this is interfacing D with C++ and I think this is the biggest crowd I've ever had here and I'm uh I'm reluctant to ask if it's the pizza the C++ or the D I don't think I want to know so okay we'll start off with u most languages offer interrupt with C for the simple reason that you know C is the linqua franka of the programming world all the languages have an interface to C and so you can you know hook things up together by uh going with a c interface and you know the classic most compatible with C language is of course C++ which is built on top of on top of C and C inner operation with d is pretty trivial you just kind of wrap it in an X turn C and then you can have your favorite C functions like malakin free and you can call them directly there's no translation layer there's no marshalling there's no nothing it hooks right up to it and arguments are passed in registers and all that stuff there's just simply no difference from if you were just using C to call it oh I I want to point out I like to do interactive presentations so if you have questions or comments or amplifications or if I'm confusing things just you know speak speak right up so that's pretty simple okay
On Hacker News
Another alternative, I think is D-language bindings to QT (or betterC which is a subset of D allowes to use D with C runtime library, while retaining D-s class system, templates and memory safety). [1] [LINK] D's team is doing an incredible job of matching C++ compiler specific ABIs, name mangling/etc -- just so D users can use C++ libraries (including templates) directly from D without loosing t… — maga_2020, 2019-04
Rust does not have native C++ interop. C ABI is different to what clasp has done (native C++ interop). All widely used Common Lisp implementations have seamless C ABI interop through their FFIs / CFFI [1]. Clasp goes above and beyond that and natively interfaces with C++. LTO works with mixed Common Lisp and C++ code. Exception handling works as expected. You can mix Common Lisp and C++ stack fra… — armitron, 2018-12
Reasons for D: It is a way out of the C++ tar pit, because it does C++ interop better than any other language. D needs to continue to outrun C++ evolving, though. See [LINK] or [VIDEO] It has powerful meta-programming. It is effectively the opposite of Go, which does not even have generics. This certainly provides foot shooting as well, so other languages (e.g. Rust) are more conservative with th… — qznc, 2016-12
Related videos
- How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework · Видео с мероприятий {speach! · 49:55
- CppCon 2015: Andrei Alexandrescu “std::allocator...” · CppCon · 1:12:27
- Lexical Scanning in Go - Rob Pike · GoogleFOSSSydney · 51:17
- Why Isn't Functional Programming the Norm? – Richard Feldman · Metosin · 46:09
- Maybe Not - Rich Hickey · ClojureTV · 1:03:28
- Conway's Game Of Life in APL · Dyalog · 7:47
- Lecture 1A | MIT 6.001 Structure and Interpretation, 1986 · MIT OpenCourseWare · 1:12:55
- Crockford on JavaScript - Volume 1: The Early Years · YUI Library · 1:42:08
- Growing a Language, by Guy Steele · Bill Pugh · 53:31
- CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step” · CppCon · 59:33
- Effective Programs - 10 Years of Clojure - Rich Hickey · ClojureTV · 1:14:51
- Brian Goetz - Stewardship: the Sobering Parts · ClojureTV · 1:03:30
- RustConf 2018 - Closing Keynote - Using Rust For Game Development by Catherine West · Rust Programming Language · 42:29
- JavaScript: The Good Parts · Google TechTalks · 1:03:47
- CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17” · CppCon · 1:19:52
- Ideas about a new programming language for games. · Jonathan Blow · 1:55:24