View 1.md

Thinking about Async/Await

A couple of weeks ago I listened to .Net Rocks! #1433 about Visual Studio 17 with Kathleen Dollard. A very good episode interest but with stuck with me was Kathleen's comment that after all these years she sees very smart people still struggle with async. This is my and others experience as well.

A few years ago I wrote a blog post on why I thought async in C# isn't that great. I took it down a bit later even though it was popular it was also divisive and my understanding of async had grown which made me want to rewrite the whole piece into something better and less divisive.

I used to think that the implicit coupling in async to the SynchronizationContext is a major problem for async but today I think that it's a minor problem for most developers. The reason is that if you are writing ASP.NET you will always have the ASP.NET SynchronizationContext and that gives particular but consistent async behavior. If y

View any_transformer.scala
import ScalaTransformer.AnyTransformer
object ScalaTransformer {
import scala.collection.mutable.ArrayBuffer
sealed abstract class PathElement
object PathElement {
case class Property (name : String) extends PathElement
case class Index (index: Int) extends PathElement
case class Named (name : String) extends PathElement
View 1.md

Transformer combinators

I was considering the excerise and reworked it into that an account holds a bag of properties. The simplest approach is to use a map:

case class Account(props: Map<String, Any>)

However, this can be improved somewhat by introducing typed properties:

View transformer.ts
namespace AnyTransformer {
export interface Cons<T> {
kind: "Cons"
head: T
tail: ImmutableList<T>
}
export interface Empty {
kind: "Empty"
View transformer.fs
module AnyTransformer =
type [<AbstractClass>] BadCause () =
class
abstract Describe : string
override x.ToString () = x.Describe
end
type [<Sealed>] MessageBadCause (msg: string) =
class
inherit BadCause ()
View gen.fs
module FsGen =
module Details =
let inline adapt f = OptimizedClosures.FSharpFunc<_, _, _>.Adapt f
open System
open Details
type [<Struct>] StdGen = StdGen of int*int
module Random =
View CppTransducer.cpp
#include "stdafx.h"
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
View Transducer.fs
module Transducers =
type [<Struct>] Finalizer =
| Action of a : (unit -> unit)
| Disposable of d : System.IDisposable
module Details =
let dispose d =
try
(d : System.IDisposable).Dispose ()
with
View fft.cc
#define _USE_MATH_DEFINES
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <stdexcept>
#include <string>
#include <tuple>
View fft.fs
module Simple =
open System
open System.Numerics
let pi = Math.PI
let tau = 2.*pi
let twiddle a = Complex.FromPolarCoordinates(1., a)
let rec fft = function