In designing parallel programming abstractions, taking away user capabilities is as important as granting them. In this talk, I'll explain the role of this idea in several different parallel programming libraries for Haskell, C++, and other languages--spanning from shared memory to big data.
The Haskell language is an experiment in making purely functional programming practical, and, as such, much of its design stems from limiting where and how the user can employ side effects. Haskell is almost 30 years old, but is used more widely and changing more rapidly than ever before. It's an exciting time for programming languages that use advanced type systems to accomplish formal software verification, and Haskell sits in midst of this revolution: at a juncture where it draws from the latest ideas in theorem proving languages, while at the same time remaining a practical programming language.
By clearing the canvas of unconstrained effects, Haskell and similar languages allow experimenting with specific combinations of effects that work well together: e.g., for transactional memory, deterministic parallelism, or accessing remote data sources. Haskell enforces these restrictions at compile time, via the type system. While C++ cannot limit a method's side effects directly through types, it is well suited to host embedded domain specific languages (EDSLs) that can incorporate the same ideas.
I will argue for a notion of purity that has little to do with whether memory is updated in place or not. Rather, it has to with whether combinations of effects preserve determinism.
I'll show how entire applications can become deterministic functions of their inputs, including I/O. Ultimately we can call entire C++ programs from inside a pure function in Haskell, without violating any rule of the type system or the language's runtime semantics.
Finally, over the course of this talk I'll also describe some specific history where C++ has affected the evolution of Haskell, and where, conversely Haskell may have a few ideas to offer. Haskell and C++ are both old languages that nevertheless keep changing regularly. There are even some surprising contemporary commonalities; for example, C++ and Haskell are two of the best languages available for data baking.
D is a systems programming language with C-like syntax and static typing. It combines efficiency, control, and modeling power with safety and programmer productivity.
Producing correct programs has notoriously been expensive in systems programming. Depending on the language used, programmers face a combination of labor and time intensive issues including struggling with language peculiarities, writing boilerplate code, code generation with difficulty or with external tools, manual resource management, and having to abide by long lists of coding guidelines. Correct programs further require prototyping sometimes with auxiliary languages and unit testing with external frameworks. It is not uncommon that readability and maintainability are sacrificed in the process.
D has minimal historical baggage, outstanding compile-time capabilities, useful exceptions, compiler-guaranteed memory safety, internal unit testing, and optional garbage collector as parts of an extensive feature set. Its features spanning from the lowest to the highest levels of programming paradigms generally obviate auxiliary languages in production.
This talk will give a general introduction of D, focusing mainly on its compile-time features like reflection, templates, code generation, conditional compilation, and user defined attributes; and present D as a time-saving software engineering tool suited for business requirements.
Because C++ is such a powerful language and because C++Now attendees are master users of it, it will be hard to argue for a single feature of D that would make one prefer D over C++. We know that one can achieve almost any programming task in C++, D, or most other languages. The killer feature of D is that the whole package it delivers makes it easier to achieve those tasks. That is the competitive advantage that it brings to D users.