Archives for posts with tag: Programming Languages

In part 3 of the Advanced Functional Programming lecture series, Dr. Lämmel focuses on the domain of language interpretation as a method of understanding some important functional programming techniques. As a side effect, some basics of programming language theory are also informally presented.

More specifically, this lecture develops an interpreter for a simple functional programming language that contains Booleans, natural numbers, lambdas, and recursive lets. The interpreter is actually developed in a stepwise manner, which is why the lecture is called “Evolution of an Interpreter.”

In each step, another construct is added and the impact of the extension onto the interpreter is analyzed. In this manner, several interesting programming techniques are exercised. For instance, the Maybe type constructor is pervasively used for dealing with partiality, and Haskell’s fixed point combinator is used to model the semantics (i.e., interpretation) of recursive bindings.

This lecture also prepares us for some more advanced subjects. For instance, the next lecture in this series will cover the intriguing subject of monads while using interpretation as the application scenario. Soon, generalized folds (or bananas, according to Erik Meijer) will also be discussed (the folds will traverse abstract syntax trees as opposed to lists).

Enjoy. Learn.

Thanks to Ralf for providing another excellent lecture!

Earlier lectures here.

Slides: https://developers.svn.sourceforge.net/svnroot/developers/repository/ralfs-channel9-lectures/decks/interpretation.pdf

Related Blog Post and Code:

http://professor-fish.blogspot.com/2010/08/bunch-of-interpreters-using-cpp-and.html

Welcome to another series of C9 Lectures covering functional programming. For this series, Dr. Ralf Lämmel has generously taken the time to produce videos for Channel 9 from his office at the University of Koblenz-Landau (Germany), where he is a professor of computer science. The idea here is to take the next step from Erik Meijer’s fantastic introductory series on functional programming. Accordingly, Ralf’s series will dive into more advanced areas of functional programming, again focusing on the Haskell language (the functional concepts discussed here, however, span beyond any one functional language).

In this second lecture in the series, Ralf digs into Type Classes, which are type system constructs that were originally introduced to provide a form of ad hoc polymorphism (i.e., an advanced form of overloading). Type classes amount to an intriguing element of the Haskell language, which is, for example, evident in their ability to solve the Expression Problem (make sure you watch Ralf’s first lecture on this subject). Furthermore, type classes directly relate to the interface notion of mainstream OO programming, adding important expressiveness to C#/Java-like interfaces.

Type classes also take functional or declarative programming to a whole new level—one may define relations and functions pointwisely on types. That is, in the same way a regular function pattern matches on value structure, a type-level function sort of matches on type-definitional structure. This is quite a mouthful, I know.

There are various extensibility scenarios in the neighborhood of the Expression Problem that are interesting to consider from a design perspective, including several also addressable with type classes, and others that aren’t. Look for the riddles (there are indeed several riddles in this lecture); many of them call for a discussion, rather than a straight solution. But beware—some of them are really difficult.

Thank you, Ralf, for another great lecture!

Get the slides for this lecture.

Enjoy! Learn!

See Lecture 1 – The Expression Problem

Welcome to another installment of C9 Lectures covering the powerful general C++ library, STL. Joining us once again is the great Stephan T. Lavavej, Microsoft’s keeper of the STL cloth (this means he manages the partnership between the owners of STL (dinkumware) and Microsoft, including, of course, bug fixes and enhancements to the STL that ships as part of Visual C++). Simply, Stephan is a C++ library developer.

As is Stephan’s nature, he elaborates on technical details in very substantive way. The Standard Template Library, or STL, is a C++ library of container classes, algorithms, and iterators. STL provides many fundamental algorithms and data structures. Furthermore, the STL is a general-purpose library: its components are heavily parameterized, such that almost every component in the STL is a template.

In part 3, Stephan focuses on shared_ptr and unique_ptr. You will also learn a bit about exception safety and, of course, get another challenging homework assignment. 

Part 1
Part 2

Enjoy! Learn!

Books mentioned by Stephen:

The C++ Standard Library: A Tutorial And Reference by Nicolai M. Josuttis

Effective STL by Scott Meyers

Welcome to another installment of C9 Lectures covering the powerful general C++ library, STL. Joining us once again is the great Stephan T. Lavavej, Microsoft’s keeper of the STL cloth (this means he manages the partnership between the owners of STL (dinkumware) and Microsoft, including, of course, bug fixes and enhancements to the STL that ships as part of Visual C++). Simply, Stephan is a C++ library developer.

As is Stephan’s nature, he elaborates on technical details in very substantive way. The Standard Template Library, or STL, is a C++ library of container classes, algorithms, and iterators. STL provides many fundamental algorithms and data structures. Furthermore, the STL is a general-purpose library: its components are heavily parameterized, such that almost every component in the STL is a template.

In part 3, Stephan focuses on shared_ptr and unique_ptr. You will also learn a bit about exception safety and, of course, get another challenging homework assignment. 

Part 1
Part 2

Enjoy! Learn!

Books mentioned by Stephen:

The C++ Standard Library: A Tutorial And Reference by Nicolai M. Josuttis

Effective STL by Scott Meyers

“The Expression Problem is a new name for an old problem. The goal is to define a datatype by cases, where one can add new cases to the datatype and new functions over the datatype, without recompiling existing code, and while retaining static type safety (e.g., no casts).” – Philip Wadler

Welcome to another series of C9 Lectures covering functional programming. For this series, Dr. Ralf Lämmel has generously taken the time to produce videos for Channel 9 from his office at the University of Koblenz-Landau (Germany), where he is a professor of computer science. The idea here is to take the next step from Erik Meijer’s fantastic introductory series on functional programming. Accordingly, Ralf’s series will dive into more advanced areas of functional programming, again focusing on the Haskell language (the functional concepts here span beyond any one functional language, however).

To begin, Dr. Lämmel teaches us about the Expression Problem. Now put on your thinking caps, make yourself comfortable, and enjoy this installment of functional programming lectures on Channel 9. Huge thanks to Dr. Lämmel, both for doing this series for Channel 9 and for filming and producing it all by himself! Finally, thanks to Erik Meijer for suggesting this series and putting me in touch with Ralf.

See Dr. Lämmel’s blog post about the new lecture series here: http://professor-fish.blogspot.com/2010/08/lecture-series-on-advanced-functional.html

[Homework assignment is on slide 26 - Get the slides]

After a long day of sessions at Emerging Languages Camp 2010, I caught up with two of the day’s presenters, Clojure creator Rich Hickey (you’ve met Rich before in an Expert to Expert episode with Brian Beckman) and F# compiler developer Joe Pamer. Clojure is a dynamic language that compiles to byte code/IL, targeting both the JVM and the CLR. Clojure is a Lisp. F# is a strongly-typed hybrid language that targets the CLR and employs a dual programming model—functional and object-oriented imperative.

Tune in.

“The biggest problem with programming is that we don’t agree on what the problem is”, says Jonathan Edwards, who is first and foremost a practicing programmer. Jonathan also spends a great deal of time thinking about how to evolve the languages and tools programmers use to solve increasingly complex problems in general purpose computing. He is currently a Research fellow at MIT, and I caught up with him at Emerging Languages Camp 2010 shortly after his talk on Declarative Objects (see the PPT or PDF slides). His thoughts on a potential future direction for general-purpose programming are quite compelling. In a nutshell, Jonathan is thinking about an object-oriented model-view declarative programming world. Discussing this idea, he states, “First, restrict pointers with a new object model that uses nesting and binding. Second, prevent cycles with a new form of dataflow based on the Model-View architecture.”

Look through the PPT or PDF linked to above, press play, and open your mind a bit. See what you may see. The programming languages rabbit hole is deep. We seem to be hovering at a comfortable position, yet the problems we face will require us to move further down the tunnel to discover new means of algorithmic expression and code design. Jump in.

Enjoy.

A group of us gathered after a long day of language sessions at ELC 2010 and a conversation just happened. Sure, we talked about doing this before the camera started rolling, but I pressed record only when the time was right—when EROS creator and BitC designer Jonathan Shapiro asked Newspeak’s Gilad Bracha about his stance on type classes. We then move around the standing circle of language designers and meet E/Caja’s Mark S. Miller and one of the AmbientTalk designers, Tom Van Cutsem. It doesn’t get any more impromptu than this and we geek out big time. Tune in.

Recently, I got the chance to spend a few days at the Emerging Languages Camp at OSCON 2010 in Portland, Oregon. It was great to learn about so many new (and not-so-new) approaches to programming language design. The event was set up to ensure the maximum number of sessions in an 8-hour chunk of time, and you will soon be able to watch all the sessions on the Emerging Langs website (perhaps in a few weeks, so keep on checking!).

I caught up with a few folks after each long day of sessions, and over the coming days I’ll be posting those conversations here. First up is one of my favorite language designers and personalities, Gilad Bracha. Gilad has no problem expressing his opinions and this is a great trait. He’s also a great language designer and his Newspeak programming language is steadily maturing. In this conversation, we discuss a whole range of topics, from what’s new in Newspeak to what’s wrong with the web (from a languages and tools point of view). As always, this conversation just happened (C9 Classic, as it were…). We sat down, turned the camera on, and this is the rabbit hole we jumped down. It’s always great to chat with Gilad.

Tune in.

Enjoy.

Welcome to another installment of C9 Lectures covering the powerful general C++ library, STL. The great Stephan T. Lavavej, Microsoft’s keeper of the STL cloth (this means he manages the partnership with the owners of STL (dinkumware) and Microsoft, including, of course, bug fixes and enhancements to the STL that ships as part of Visual C++). Simply, Stephan is a C++ library developer.

As is Stephan’s nature, he elaborates on technical details in very substantive way. The Standard Template Library, or STL, is a C++ library of container classes, algorithms, and iterators. STL provides many fundamental algorithms and data structures. The STL is a general purpose library: its components are heavily parameterized such that almost every component in the STL is a template.

This is not an introductory series on C++. As such, it is expected that viewers already possess a working knowledge of the C++ language. Go ahead and open VC++ IDE and follow along–there are many examples provided on-screen and Stephan will monitor this thread and answer questions.

Enjoy. Learn.

Books mentioned by Stephen:

The C++ Standard Library: A Tutorial And Reference by Nicolai M. Josuttis

Effective STL by Scott Meyers