/dev/summer had some good talks as usual

It was /dev/summer at the weekend, where there were a few very interesting talks. Rather than going to the Clojure or Haskell tracks, this time I attended the double session on Go and a couple of sessions by  Gleb Bahmutov .

The Go session took a little while to get going, with the first 45 minutes hardly touching the language after some questions around the directory structure of a Go project on the disc. This meant that we didn’t get to see any large examples, thought the witty presentation and insightful answers to the questions led me to come away with basic Go knowledge that I can now try to put into practice.

The presentations by Gleb were full of good interesting ideas. The first presentation looked at the issues around npm modules and their dependencies (though the ideas applied more generally), and how semantic versioning isn’t typically supported by the modules. The clever idea of the presentation was a tool that tests semantic compatibility by running unit tests against the old and new versions of the module. Failures in the tests imply incompatibility and by having users send their results to a central server it is possible to check how safe a module upgrade is going to be. The second presentation looked at using code snippets inside Chrome to get various metrics on the page such as load time and render time, and also showed us how to combine this with the various profiling tools. Having not used these tools before, this was a great introduction to speeding up a web application.

I also attended the lightning talks which were a useful and informative set on general open source and browser testing.

It was a little strange to come across these talks. I’d just been reading about module dependencies in the .Net Nuget world after the publication of this post which talks about some changes to Nuget to make it support the new CoreClr world where the number of profiles is too great to simply name profiles using an integer value, and package authors will instead need to declare their dependencies. It also links to the bait and switch technique. I was also doing some interesting reading on the new WebAssembly technology and came across this great interview with Brendan Eich that explains things well.

Two other interesting blog posts. A talk on cloud scale event processing using Rx, which mentions some of the changes required to scale from the desktop version to a server based version – features needed included a way to checkpoint a query. This post on Rust’s type system is also interesting.

Posted in Uncategorized | Leave a comment

So what happened at //build

//build happened at the beginning of May, and I’ve been spending a fair amount of time lately working my way through the session videos that have been appearing on Channel 9. I’ll try to summarise the various videos that I have watched.

By far the most important video is the interview with Don Box. After his prominence in the COM and .NET communities he seemed to disappear off the radar some time ago. In this brief interview he tells us what he has been up to in the XBox team.

Roslyn makes it easy for users to write their own compiler extensions, and this talk pushes the idea of getting library writers producing compiler helpers to aid users with integration of their library into a product. There’s general discussion about Roslyn here. There’s a general state of the union talk on the .NET ecosystem, which shows how much innovation is happening in the .NET world at the moment. This talk discusses building cross-platform .NET.

The chat with Anders is also worth a watch

Visual Studio talks include an introduction to writing extensions, integrated Git in VS2015, some debugger tips and improvements in VS2015, and some methods for debugging performance problems. It’s not quite Visual Studio,  but there’s a deep dive into the cross platform code editor here.

There are some good videos on ASP.NET, introducing ASP.NET 5  and another on improving performance.

Moving on to Azure, the new reliable services are introduced here with a deep dive into reliable actors here. There are some new web site facilities on Azure covered here. There’s also a talk on some of the practical issues in developing efficient cloud applications.

I very much enjoyed this talk on the improved compiler technology Microsoft have been developing. They can use the same compiler backend to compile Objective-C as a means to extend a bridge to iPhone applications to bring them into the Windows platform. They have also got a bridge for Android applications.

JavaScript related talks include two on TypeScript, the first is an introduction followed by a discussion of the future direction. There is also a talk on WinJS changes. The  new Microsoft browser is covered here and here, and this talk discusses its new development tools.

With the success of Docker in the Linux world, Microsoft are keen on bringing it to Windows. The advantages of containers are covered in this talk. A walk through of producing a Docker application is interesting. These containers may well run on the new nano-server.

There one of two odds and ends. Continuum, using your phone as a normal computer was really interesting. Using other means of authentication was interesting and support of HTTP/2 were worth watching.

The mass of talks that I watched were on Universal Windows Apps, the progression of Metro style applications from the Windows 8 days. The idea now is that these applications are portable across devices that range from the phone to the large screen computer. The general platform is covered here, the app model is covered here and this covers their deployment. Microsoft is going to provide yet another bridge for covering installer based windows applications into windows universal applications. There is detail about the new lifecycle, the navigation model and app to app communication in this new world.

XAML plays a key role in implementing these applications, so there are many extensions to features like data binding as well as general XAML optimisation techniques. This talk discusses universal app development and this shows how they can be developed in VS2015. Publishing is also an important aspect. The design patterns for such apps  are supposed to make it possible to design an app that works on the small and large scales while remaining responsive. There are many talks on these issues including accessibility. Migrating an existing application was also covered.

All in all it was an interesting build. It was great to see more work on .NET and Roslyn, and the universal windows platform may turn out to be really interesting. Only time will tell.

Posted in Uncategorized | Leave a comment

Some low level locking papers

It’s been a bit quiet around here, as I have been making my way through 50 or so videos of talks from //build/. I’ll do a summary post when I get through them all.

In the meantime, I’ve also been reading a few low level papers. It’s quite interesting that hardware transactional memory is becoming more available, and so this paper on malloc placement is worth a read – the transactional memory uses the cache lines in the L1 and L2 caches to see if a value has been modified by another party while the transaction has been happening. This means that caches can be affected by memory patterns that place many values into locations which map to the same cache line.

On the same blog there were also good posts on the liveness benefits of LIFO lock patterns and implementations of spin-then-park locks.

This gitbook on the Linux kernel is also worth reading if you are interested on how the system gets from a reboot to a running kernel, and this paper describes the many techniques for x86 virtualization.

Posted in Computers and Internet | Leave a comment

Effective Modern C++

Effective Modern C++ by Scott Meyers

C++ has changed a lot over the years and this book covers loads of the subtle points around the newer additions to the language. As usual with the Scott Meyer books, the author takes a number (42 in this case) of items grouped into 8 categories and discusses the issues around the particular topic.

The topics covered include perfect forwarding and so-called universal references, smart pointers which after C++ 14 cover most of the memory management scenarios, lambda expressions and the related issues around variable capture (and whether to capture the variables by reference or by value), and a very interesting section on concurrency in the new C++.

As in his other books, some of the sections are a little overwhelming in technical detail, but you always come away with a better understanding of a topic than when you started reading the issue. A good read and a good introduction to modern effective C++.

Posted in Books | Leave a comment

So how do you patch a deployed Nuget package

Quite some time ago, this blog post went past on the usual Microsoft RSS feed, discussing how Microsoft are going to make it possible to patch NuGet libraries. Using the standard mechanism of putting an assembly in the GAC and redirecting clients to use it via a publisher policy is a way to deploy a patch, but the article hints at an attribute that signals to Microsoft Update that such an updated assembly needs to be installed. I thought that it is was probably time to see what was happening.

Adding a NuGet reference to SignalR and then using Reflector to look at the assembly attributes, there is now a use of
[assembly: AssemblyMetadata(“Serviceable”, “True”)]
to flag the assembly to the runtime.

Looking in the CoreClr source code on github, in the assembly.cpp file there’s a GenerateBreadCrumbForServicing method which writes details about the assembly under c:\programData\Microsoft\NetFramework\BreadcrumbStore\ and sure enough when I look at that folder in explorer I see a mass of NuGet packages that my applications have loaded. These take the form of empty files with names such as

EntityFramework, Version=5.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089

It will be interesting to see how well this mechanism works in practice – if I xcopy deploy something, there is going to be a delay between the first time I load the assembly (leading to the breadcrumb being set) and Microsoft Update running and fixing it up. I’m also interested in what other AssemblyMetadata attribute values there are being used, but investigating that is going to have to wait.

Posted in Uncategorized | Leave a comment

F# Deep Dives

F# Deep Dives by various

I was really looking forward to reading this book, and it was well worth waiting for. The book has many contributing authors, each of whom provides one of the 12 chapters. Of course, with such a diverse set of contributors, some of the chapters are more interesting than others, but many emphasise the benefits of F# as a functional first programming language.

There is an interesting opening chapter on how functional first programming languages can be effectively used in industry, but there were five chapters that I found particularly interesting. Parsing text-based languages looks at the task of writing a parser in F# and uses some interesting techniques such as active patterns to make it easy to read the resulting code. Chapter 6, integrating stock data into the F# language, offers a brief introduction to type providers, and then shows most of the steps to implementing type provider for CSV and YQL.

In the following section on developing complete systems, there are chapters on developing rich user interfaces using the MVC pattern which shows how F# can be used to write an application that uses WPF for its UI, a great chapter on asynchronous and agent-based programming that looks at ETL (extract, transform and load) models, and a chapter on writing games using XNA which emphasises the async workflow which can help keep the state machines of a game understandable.

You’ll learn something from all of the chapters and the book is well worth a read.

Posted in Uncategorized | Leave a comment

Time Reborn

Time Reborn: From the Crisis in Physics to the Future of the Universe by Lee Smolin

This was a very interesting read in the popular science category. It centres on the position on time in the laws of physics, first describing how time lost its place as a central focus of many theories, and then discusses the problems that this causes when physicists try to apply their theories to the universe as a whole. Smolin discusses how the reductionist approach of deriving laws by observing a system from the outside, is inapplicable to the discovery of the laws that govern the universe as a whole. The book is a mash up of interesting ideas from new theories and discussions around existing ideas and theories, all pitched at the popular science level with understandable explanations.

Posted in Uncategorized | Leave a comment