Scenario vs Script

Hi all,

I somehow came across two different versions documentations with one suggesting using scenario while the other suggests script for testing.

I have tested and it seems that both scenario and script work in DAML 1.8.

So I’m wondering, is there any difference between Scenario and Script? I understand there are some difference in the commands, anything more than that? And which one is more recommended?

Thanks!

/Guisong

1 Like

That is the doc that confuses me.

I somehow open this url: DAML SDK documentation — DAML SDK 0.13.54 documentation

And it indeed shows DAML Version 1.8, while apparently it’s not DAML 1.8.

Is this “0.13.54” also a version of DAML?

1 Like

0.13.54 is an older version of the DAML SDK which is about a year old by now. Unfortunately there is an issue on the docs website where it displays the version incorrectly for versions before 1.0.0 which is why your screenshot incorrectly displays it as 1.8.0.

Now to your original question on scenarios vs DAML Script. You can think of DAML Script as Scenarios 2.0. Scenarios only run in DAML Studio. DAML Script also works in Studio but it does more than that:

  1. You can run it against a real ledger via the daml script command. This is not possible with scenarios.
  2. You can use it in daml repl which is also not supported for scenarios.

You might enjoy @Andreas blogpost on the differences between scenarios and DAML Script which also explains why those two features couldn’t just be added to scenarios and instead required a slight redesign which ended up being DAML Script.

While SDK 1.8.0 supports both scenarios and DAML Script, I would strongly recommend to use DAML Script for all new projects and migrate old projects over time.

3 Likes