Phil Trelford's Array
POKE 36879, 255

24hrs in F#

October 14, 2014 10:55 by phil

The easiest place to see what’s going on in the F# community is to follow the #fsharp hash tag on Twitter. The last 24hrs have been as busy as ever, to the point where it can be hard to keep up these days.

Here’s some of the highlights

Events

Build Stuff conference to feature 8 F# speakers:


and workshops including:

FP Days programme is now live, and features key notes from Don Syme & Christophe Grand, and presentations from:


New Madrid F# meetup group announced:


F# MVP Rodrigo Vidal announces DNA Rio de Janeiro:


Try out the new features in FunScript at MF#K Copenhagen:


Mathias Brandewinder will be presenting some of his work on F# & Azure in the Bay Area


Let’s get hands on session in Portland announced:


Riccardo Terrell will be presenting Why FP? in Washington DC


Sessions featuring FsCheck, Paket & SpecFlow scheduled in Vinnitsa (Ukraine)


Projects

Get Doctor Who stats with F# Data HTML Type Provider:


Major update to FSharp.Data.SqlClient:


ProjectScaffold now uses Paket:


Microsoft Research presentation on new DBpedia Type Provider:


Blogs

More F#, Xamarin.Forms and MVVM by Brad Pillow


Cross-platform MSBuild API by Robin Neatherway


Hacking the Dream Cheeky Thunder Missle Launcher by Jamie Dixon:



Want more?

Check out Sergey Tihon’s F# Weekly!


Tags:
Categories: F# | .Net | Mono
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

C# 6 Cuts

October 2, 2014 00:21 by phil

In a recent thread on CodePlex Mads Torgeson, C# Language PM at Microsoft, announced 2 of the key features planned for C# 6 release have now been cut:

  • Primary constructors
  • Declaration expressions

According to Mads:

They are both characterized by having large amounts of downstream work still remaining.

primary constructors could grow up to become a full-blown record feature

Reading between the lines Mads seems to be saying the features weren’t finished and even if they were they seemed to conflict with a potential record feature currently being prototyped.

The full thread is here: Changes to the language feature set

Language Design

I think there’s two distinct options when adding new features to an existing language with a large user base:

  • upfront design
  • implement incrementally

Upfront design should mean that all cases are met but comes at a time-to-market cost, where as an incremental implementation means quick releases with the potential risk of either sub-optimal syntax or backward compatibility issues when applying more features.

It appeared at the high level that the C# team’s had initially opted for the incremental option. The feature cuts however suggest to me that there may have been a change in direction towards more upfront design.

Primary Constructors

The primary constructors feature was intended to reduce the verbosity of C#’s class declaration syntax. The new feature appeared to be inspired by F# ’s class syntax.

If you like the idea of a lighter syntax for class declarations then you may just want to try F# which already has a well thought out mature implementation, i.e.

type Person(name:string, age:int) =
    member this.Name = name
    member this.Age = age

Or for simple types use the even simpler record type:

type Person = { Name:string, Age:int }

Note: on top of lighter class syntax F# also packs a whole raft of cool features not available in C#, including powerful pattern matching and data access via Type Providers.

Declaration Expressions

Declaration expressions was again designed to reduce verbosity in C# providing a lighter syntax for handling out parameters. Out parameters are used in C# to allow a method to return multiple values:

int result;
bool success = Int32.TryParse("123", out result);

Again handling multiple return values is handled elegantly in F# which employs first-class tuples, i.e.

let success, value = Int32.TryParse("123")

As shown above, C# out parameters can be simply captured in F# as if the method were returning multiple values as a tuple.

Conclusion

The first time I saw Mads publicly announce the now cut primary constructor syntax and declaration expressions was nearly a year ago at NDC London. At the time the features were announced with a number of disclaimers that they may not actually ship. I think in future it may be better for everyone to take those disclaimers with more than just a pinch of salt.


Tags:
Categories: C# | F# | .Net
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

One Week in F#

September 28, 2014 12:30 by phil

With Sergey Tihon on vacation this week, I’ve collated a one off alternative F# Weekly roundup, covering some of the highlights from another busy week in the F# community.

News in brief

FSharp Logo

Events

This week has seen meetups in Nashville, Raleigh, Portland, Washington DC, Stockholm and London:



Recordings

Upcoming meetups

Upcoming Conferences

Projects

Blogs

FsiBot



Have a great week!


Tags:
Categories: F# | .Net | Mono
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed