Those are very good points, and I believe that understanding the difference between “flow script definition typing”, and the more JSON-esque syntax when working with data is key in transferring your flow classic skills to flow connect.
Not sure if this exactly answers your question, but it is a great discussion. And I have been thinking of the best way to put this down in writing. So another example would be to just look at the different ways to return a single value, a record and a table:
And then the “definition typing”, as you correctly state, is also a little bit different as we, among other things now have null support (defined by a question-mark). And an asterix after the trailing curly bracket would give you a “table” (or a sequence actually, almost an array, but not indexed so more correctly called a sequence)
As you have noted, the Empty function in Connect no can no longer be used with a type name. (The reason for this change is that we wanted to avoid ambiguities between types and terms in the language.)
There are a couple of other ways:
type P = {a: text, b: text};
// Alternative 1: use the sequence syntax (square brackets)
let tab1: P* = [];
// Alternative 2: use the default keyword:
let tab2 = default(P*);