Keynote: Open Systems - Actors and Cloud
(His new company is Applied Duality - watch for great things!)
To hack, to help other developers, to solve real problems, to fix the world.
Duality - things have opposite aspects, but you should look at them as one whole. They’re not good or bad.
Nothing’s more different from SQL than Rx.
Question the relational database.
Does your data really look like this? It’s tied to the physical format.
Duality between Modelers (DB designers) & Developers. Plants vs. Zombies.
Modelers always talk about Nouns. Customers, Orders, Line Items.
There’s no reuse in SQL. There’s no difference between a table and a type.
There’s no abstraction.
It’s statically typed. It’s baked in to the layout of your files.
In order to make your database run fast, you have to have intimate knowledge of your data storage (to do joins, etc.).
It’s not really declarative, because you have to know what keys to join on. It doesn’t allow nested results, so you have to have the GROUP BY column in the SELECT. WITH RECURSIVE is another example - you have to explicitly write it out.
Declarative is relative - C is declarative to an assembly programmer.
Optimization - query plan - consultants tweak the SQL to get the plan you wanted - but why can’t you tweak the query plan directly? It’s just function pipeline.
ACID is also a lie - you set your transaction isolation level to get performance. Why so many hints?
The closed world assumption is the presumption that what is not currently known to be true is false.
The fallacies of Distributed Computing - well known
The fallacies of Declarative Computing
1. Exceptions do not exist.
2. Statistics are precise.
3. Memory is infinite.
4. There are no side-effects.
5. Schema doesn’t change.
6. There is one developer
7. Compilation time is free.
8. The language is homogeneous.
Once you go outside of SQL, the optimizer doesn’t know anything about this.
It’s really a B-tree. Just give me that and I’ll be happy! Leaky abstractions are a good thing! Then you know the performance characteristics. We don’t need all these layers of crust. Sometimes you need to go under the hood.
Task<T> is a co-monad in C#. See ContinueWith(Func<Task<T>, TResult>).
Avoids the need for multiple futures (one for failure case, etc.)
Comonads are gumball machines.
.Result - remove a gumball
Once out, never in. (It’s not hygenic.)
.Select (s/b map) - turns a gumball machine into a beer machine WITHOUT taking the gumballs out of the machine!
Comonad - .Franchise() - can create a machine of gumball machines
Can compose Franchise with Select using ContinueWith to create a beer machine franchise.
ContinueWith is the duality of SelectMany (aka flatmap).
Developers like Verbs.
We want to perform operations on things, while hiding how they’re accomplished.
We want to swap out implementations of interfaces. You can’t do that in SQL.
ConcurrentDictionary<K,V> implements the same interfaces as Dictionary<K,V>. If single-core code was written against the original interface, it would still work with multiple cores.
A dictionary is nothing more than a database.
Dependency Injection is a work-around for a deficiency in our programming languages.
Moving to the cloud - collections as a service (data structures that live in the cloud) - access with async/await (dream)
Developers don’t want REST. They want to program against objects. The first thing you do is write a wrapper. With an API, you can change the underlying implementation; they’re more abstract.
Similar to database transactions and recovery - intercept all the mutations so you can replay the log (I think this is ActorFx, AKA Ax)
An Actor is something where I send it updates and out come a stream of changes. In Rx we call that a Subject. (The streams are IObservable.)
A UI is also a Subject. As is a web browser, as is a web server.
Dream: Compose communicating stream processors to build applications. Like Erlang, only language-independent. Rx everywhere.
Like Yahoo Pipes but non-visual (developers like code).
Trying to move Rx to an Apache project.
Need to wrap existing services into these Subjects so we can have a consistent interface.
Reactive Message Queue (Qx)
Decouple producer & consumer in space & time.
Either can be offline.
We don’t care about type systems.
Comonads are used when you have an asynchronous communication that gives you one value; Rx is used when you … that gives you multiple values.
Pat Helland’s article on Condos & Clouds
You Are The Subject.
Get rid of all the noise and just give me essence.
One of the great things about the NoSQL movement is that developers are now empowered.
We had more fun with Windows Workflow Foundation (WF) 4 over the last few days - another silent death error.
Again, Maurice helped us out.
If you try to promote a DateTime property containing DateTime.MinValue (or any date before the year 1753), SqlWorkflowInstanceStore will fail silently. SQL Server doesn’t support earlier dates.
Once you know that the trace source name is “System.Activities.DurableInstancing” you can actually see these errors.
Boolean properties cannot be promoted in Windows Workflow Foundation (WF) 4. If you attempt to promote them, your workflow will appear to start but will not be properly persisted nor work properly. In effect, it will die silently. Client applications attempting to create workflows won’t see any errors. Only a few simple types are supported.
This took us about two man-days to debug. Apparently Microsoft couldn’t be bothered to map between Boolean and BIT, or to document this on MSDN, or to return an exception to the client…
Here’s the Microsoft link:
Derik Whittaker’s DimeCasts tutorials were helpful. I did find a few things they didn’t cover, though.
First, if your referenced assemblies need a custom configuration, you can create a LINQPad.config and copy it to the same folder as LINQPad.exe.
Second, select File/Save As to save a query to the My Queries folder. By default this is C:\Documents and Settings\username\My Documents\LINQPad Queries (under Windows XP), but you can change that. The file is saved with a .linq extension, and is simply a text file with an XML-like header. The neat part is that references added with Advanced Query Properties are saved with it! This makes it very easy to create a library of snippets that reference your assemblies and contain any necessary setup code. You could even change the folder location and share it or place it under source control. LINQPad opens saved queries with a single click; these can be reconfigured and re-saved.
The IntelliSense works with referenced assemblies, too.
I set up our persistence framework in LINQPad today and loaded some business objects; it worked beautifully.
Several interesting items:
:: Next Page >>
Development Central is the blog of Bill Sorensen, a professional software developer. Much of this will relate to C#, .NET, and OOP in general.
These postings are provided "AS IS" with no warranties and confer no rights.
| Next >