TP

Concepts behind the C# 3.0 language

One of the lectures that I attended last year was Programming Methodology and Philosophy of Programming Languages. The lecture was mostly about history of programming languages and how several features evolved, disappeared and than after many years appeared again in another programming language.

As I final work I decided to write an article that describes ideas that influenced the design of the C# 3.0 language. Some of these features are known from functional languages (for example from LISP or Haskell), some other were developed at Microsoft Research and appeared in the F# language or Cω. I also wanted to show in what ways are these features limited in the C# 3.0. I think that thanks to these limitation, the C# 3.0 is still a simple (or at least not difficult) to understand which is very important for mainstream language, but I find it interesting to know what is possible in other (less limited) languages.

Published: Sunday, 15 October 2006, 3:19 PM
Tags: c#, academic, functional, meta-programming
Read the complete article

F# metaprogramming and classes

F# quotations allows you to easily write programs that manipulate with data representation of program source code. If you're not familiar with quotations I recommend reading my previous article [1] that contains short introduction to this topic first. Quotations can be used for example for translating subset of the F# language to another code representation or another language.

To get the quotation data of the expression you can either use <@@ .. @@> operator or resolveTopDef function. In the first case the code written between the "<@@" and "@@>" is converted to data during the compilation. The resolveTopDef function allows you to get quotation data of top-level definition (function) from compiled library at runtime (you have to use --quotation-data command line switch while compiling the library). I mentioned that quotations can be used to represent only subset of the F# language. Currently, one of the quotation limitations is that it's not possible to enclose the whole class in the quotation operators. It is also not possible to get the representation of the whole class at runtime nor the representation of class members (for example methods).

In this article I'll present a simple method that makes it possible to use F# quotations for working with classes as well, however this is rather a prototype that can be used for experimenting and discovering areas where working with classes might be useful, not a fully working solution.

Published: Saturday, 14 October 2006, 1:36 AM
Tags: meta-programming, f#
Read the complete article

F# quotations visualizer - reloaded!

Quotation Visualizer

Some time ago, I wrote an article about useful utility called F# quotations visualizer. This utility can be used to show visual representation of F# quotations, that can represent (subset of) source code written in F#. There are two ways that you can use to get F# quotations - first is using operators <@@@@ ... @@@@> (this returns quotation of the code written inside the operator), second method is to get quotation of top level definition from compiled F# assembly (you have to explicitly enable this using command line switch --enable-quotation-data while compiling assembly).

Because I added several new features to the original Quotations visualizer, I decided to publish the latest version - here is the list of main improvements:

Published: Sunday, 1 October 2006, 9:39 PM
Tags: meta-programming, f#
Read the complete article

All blog posts by tag

f# (112), functional (66), research (49), c# (37), academic (27), asynchronous (27), parallel (23), programming languages (22), functional programming (20), universe (20), meta-programming (18), philosophy (16), links (15), presentations (14), data science (12), writing (12), joinads (12), web (11), thegamma (11), talks (9), data journalism (9), math and numerics (9), random thoughts (9), phalanger (8), haskell (7), mono (7), webcast (7), design (6), architecture (5), fslab (5), open source (5), visualization (4), fun (4), accelerator (4), type providers (3), linq (3), f# data (3), .net (3), training (2), coeffects (2), deedle (2), monads (2), art (2), fractals (2), funscript (2), new york (2), manning (2), books (2)