Some questions about Smart Contract Languages for Masters Thesis

Hi everyone,

I’m currently doing my masters research project in blockchain and smart contract comparisons primarily in smart contract programming languages.

I’m trying to collect some further research for forming a comparison between Hyperledger Fabric Chaincode written in Go, DAML smart contracts and Solidity smart contracts .

I had only had a month to learn the three, I felt like i learnt a lot, but with my little experience in smart contract development I may be missing some important aspects to consider when developing smart contracts.
I found DAML very interesting and loved the readability of the language, I did fine the scripts difficult to learn.

I just have a few questions which come to my mind , would be great to get some insight from developers in the space:

• Has anyone tried both or all three languages, do you have a chaincode/smart contract preference ?
• What have been the good/limiting things found with DAML ?
• I come across someone stating that the Party as a first class citizen makes it excellent where the actors are known to each other - garbage if not , is this true or can someone counter the argument?
• I know for creating financial contracts it excels, are their times where DAML cant handle a certain task can you give a brief example ?
• Is it difficult to connect DAML and use the contract on blockchains like Hyperledger? I didnt have time to test this

Thanks for your time and help!
Please add anything else would be great to get some interesting points about DAML from developers.

1 Like

Hi @dfox97 , welcome to the Daml forums. I think I saw you post the same questions on reddit and you got some nice unbiased answers there.

In particular, I think that’s where this came from:

I come across someone stating that the Party as a first class citizen makes it excellent where the actors are known to each other - garbage if not , is this true or can someone counter the argument?

I would speculate that what the author is trying to get at is that the privacy model of Daml is good for a different sort of use-case than that of Solidity.
By default, all contracts written in Solidity (and chain code) are public. So these languages are really good for public use-cases - a public auction or marketplace, say.
Fabric and Quorum/Besu add channels or groups to that which means “public” can be restricted down to a consortium. That makes those systems suitable for fixed consortium use-cases.
In Daml, every contract is by default visible only to a small set of stakeholders. That makes it very suitable for fixed consortium use-cases, but also use-cases with dynamic stakeholder sets like non-public trading or settlement systems. So in short, from least to most privacy:

Solidity on Ethereum: Suitable for public use-cases
Solidity on Besu or Chain Code on Fabric: Suitable for fixed consortium use-cases.
Daml: Suitable for fixed consortium and dynamic stakeholder use-cases.

Now I’d say that adding privacy is much harder than removing it so while it’s possible to do public use-cases in Daml and I expect we will add features to make that easier in the future, it’s virtually impossible to get real privacy using Solidity. So I think in the long-run Daml will be suitable for a strictly larger set of use-cases than Solidity or Chain Code.

Now I’m also interested to know more about this statement you made:

I did fine the scripts difficult to learn

I assume you mean Daml Script here. What did you find difficult about them, and do you know what we could have done in the feature or our documentation to make that easier?

3 Likes

Hi @Bernhard , thank you for the reply I thought that’s what the comment meant I agree that Solidity is sort of tied to public/consortium you’ve made some really interesting points. Interesting to note that Daml can be good for dynamic stakeholder cases must have overlooked this when reading up on daml. I couldn’t of put it better thank you.

Question

What is the main problem(s) with making Daml for public use cases , is it the difficulty different trade-offs like security / ease of use ect… ?

Personal thoughts

First of all I’d say I’m an entry level student so some of this may be just my inexperience and lack of knowledge in the space.

I thought your documentation was really understandable for a beginner, I loved the online tutorials which jumped you straight into running Daml. Installing and setting up Daml on vs code on windows 10 was so easy and I wasn’t expecting the integration with vs code to work so smoothly.

The cheat sheet was really helpful.

Comparisons on Documentation

Compared to Hyperledger fabrics (Programming in Go for the first time) I personally found Daml much easier to follow and quickly understand.

I would say I’m a bit biased on Solidity documentation as I found it slightly easier to successfully create a contract although I have a familiarity with JavaScript and C++ so it did make it easier to follow. Although at first the Solidity looks very overwhelming compared to how Damls documentation is structured so maybe for someone without this experience Daml would win. It was a very close decision.

For me to follow the documentation of a completely new type/style of language and understand the basics of it in a few hours I was impressed.

I liked how it was broken down with short descriptions such as “This template is very simple: it contains the data for a message and no choices. The interesting part is the signatory clause: both the sender and receiver are signatories on the template. This enforces the fact that creation and archival of Message contracts must be authorized by both parties.”

Daml Scripts personal findings/thoughts

Its hard to determine what I found hard about the Daml Scripts (Test cases) maybe it was just my inexperience and similarity with testing code is this type of way, usually you just have to call functions ect.

I understood the basic test scripts such as the one on the Daml cheat sheet. But when it came to some more “difficult” cases then I was starting to run into problems and I was looking at the documentation and it took me a while to wrap my head around testing, eventually I got it but it just felt like it took a lot longer to grasp compared to designing the contract.

Maybe I missed this but adding some more testing examples with it broken down and explained step by step when I read the documentation Daml Script — Daml SDK 1.16.0 documentation I felt like I needed more guidance, the one example didn’t help me enough.

It may also be helpful to add something like an interactive quiz /test where the user has to type out daml scripts for different scenario examples. I know there is the Daml scripts interactive tutorial but It was tempting to just click copy to clipboard which wasn’t helping me learn although I did like the feature.

2 Likes

Thank you for the detailed feedback and good luck with your research project!