{"id":"wbTdyKexdgI","title":"Lesson 3: Daml Development Environment","description":"00:25 Daml New\n01:03 Daml file requirements\n01:42 First function\n02:08 Test function\n02:17 Linting errors\n\nFor a better learning experience, sign up and enroll in this free course at: https://daml.talentlms.com/plus/catalog/courses/141","channel_name":"Digital Asset Training","published_at":"2025-02-19T00:00:00.000Z","thumbnail_url":"https://i.ytimg.com/vi/wbTdyKexdgI/hqdefault.jpg","transcript_text":"Let's start by setting up the development environment for Daml and get familiar with the tools we'll use. We'll show you the basic process, but you should refer to http://docs.daml.com for full process and details. For this setup, we'll need Microsoft Visual Studio Code, Java 11 or Greater, and the Open Source Daml SDK. You'll also want the path and environmental variables configured according to the setup guides. We'll start out in a directory where I wanna store my project. With the Daml SDK installed and set up correctly, I can enter \"daml new learnDaml\". The Daml command line interface is known as the Daml Assistant and can help with creating, building, testing, and deploying Daml projects. The \"daml new\" command creates a project folder with the name Learn Daml, and a basic Daml project. With the project created, we can start the Daml Dev environment with \"daml studio\". This opens up Visual Studio Code to the project we just created. In the Explorer panel, you can see the files and folders the Daml assistant created. There are a couple important things here we need to point out. First, we'll create our Daml code in this Daml folder using the file extension .daml. And second, the daml.yaml is the file where all our dependencies are written. So let's create our first Hello World program in Daml. We'll call it helloWordl.daml And, a couple points here, again... the file name must start with a capital letter and it must have the extension .daml. At this point, we need to define something; like a function that we can run. Since we haven't shown you how to write functions in Daml yet. It's okay if you just follow along or copy the code that I type here. Our goal is to understand the process we'll use to create Daml applications. The first statement is \"module HelloWorld where\". Hello World is the module name and must be the same as the file name. And then let's create a simple function. What we've just done is define a function named Hello that takes some text as input and then returns hello, followed by the input text. To test this function, we need to write a script. Testing is an integral part of Daml development. So we'll write a test function like this... The first two statements declare that we're writing a script, and the last statement invokes the hello function and passes it to the argument or parameter, Chris. Now notice a little squiggly line here. As part of the Daml SDK there's a linter and debugging extension added to Visual Studio Code. This line indicates there's a compilation error. It's common to see errors and warnings like this when writing Daml code. The linter is there to ensure your code can compile and provides hints on potential errors. In this situation, it's reminding us that to run scripts in Daml, we need to import the Daml.Script library. So let's do that by writing \"import Daml.Script\" up at the top. Once the script compiles, you'll see a clickable link up here just above the script definition. If we click this, it'll run the test script and you'll be able to see the output in another tab. That's it. This tells us that our basic development environment is all set and ready to go. Now that we're all ready, let's start writing in Daml.","transcript_synced_at":"2026-10-26T04:03:38.926Z","segments":[{"start_seconds":0,"text":"Let's start by setting up the development environment for Daml and get familiar with the tools we'll use.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=0s"},{"start_seconds":5,"text":"We'll show you the basic process, but you should refer to http://docs.daml.com for full process and details.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=5s"},{"start_seconds":11,"text":"For this setup, we'll need Microsoft Visual Studio Code, Java 11 or Greater, and the Open Source Daml SDK.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=11s"},{"start_seconds":19,"text":"You'll also want the path and environmental variables configured according to the setup guides. We'll start out in a directory where I wanna store my project.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=19s"},{"start_seconds":28,"text":"With the Daml SDK installed and set up correctly, I can enter \"daml new learnDaml\".","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=28s"},{"start_seconds":35,"text":"The Daml command line interface is known as the Daml Assistant and can help with creating, building, testing, and deploying Daml projects.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=35s"},{"start_seconds":43,"text":"The \"daml new\" command creates a project folder with the name Learn Daml, and a basic Daml project. With the project created, we can start the Daml Dev environment with \"daml studio\".","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=43s"},{"start_seconds":55,"text":"This opens up Visual Studio Code to the project we just created.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=55s"},{"start_seconds":59,"text":"In the Explorer panel, you can see the files and folders the Daml assistant created. There are a couple important things here we need to point out.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=59s"},{"start_seconds":66,"text":"First, we'll create our Daml code in this Daml folder using the file extension .daml. And second, the daml.yaml is the file where all our dependencies are written.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=66s"},{"start_seconds":77,"text":"So let's create our first Hello World program in Daml.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=77s"},{"start_seconds":82,"text":"We'll call it helloWordl.daml And, a couple points here, again...","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=82s"},{"start_seconds":86,"text":"the file name must start with a capital letter and it must have the extension .daml.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=86s"},{"start_seconds":92,"text":"At this point, we need to define something; like a function that we can run. Since we haven't shown you how to write functions in Daml yet.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=92s"},{"start_seconds":99,"text":"It's okay if you just follow along or copy the code that I type here. Our goal is to understand the process we'll use to create Daml applications.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=99s"},{"start_seconds":107,"text":"The first statement is \"module HelloWorld where\". Hello World is the module name and must be the same as the file name.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=107s"},{"start_seconds":116,"text":"And then let's create a simple function.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=116s"},{"start_seconds":120,"text":"What we've just done is define a function named Hello that takes some text as input and then returns hello, followed by the input text.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=120s"},{"start_seconds":128,"text":"To test this function, we need to write a script. Testing is an integral part of Daml development. So we'll write a test function like this...","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=128s"},{"start_seconds":137,"text":"The first two statements declare that we're writing a script, and the last statement invokes the hello function and passes it to the argument or parameter, Chris.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=137s"},{"start_seconds":148,"text":"Now notice a little squiggly line here.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=148s"},{"start_seconds":150,"text":"As part of the Daml SDK there's a linter and debugging extension added to Visual Studio Code. This line indicates there's a compilation error.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=150s"},{"start_seconds":158,"text":"It's common to see errors and warnings like this when writing Daml code.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=158s"},{"start_seconds":163,"text":"The linter is there to ensure your code can compile and provides hints on potential errors.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=163s"},{"start_seconds":168,"text":"In this situation, it's reminding us that to run scripts in Daml, we need to import the Daml.Script library. So let's do that by writing \"import Daml.Script\" up at the top.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=168s"},{"start_seconds":179,"text":"Once the script compiles, you'll see a clickable link up here just above the script definition.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=179s"},{"start_seconds":184,"text":"If we click this, it'll run the test script and you'll be able to see the output in another tab. That's it.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=184s"},{"start_seconds":191,"text":"This tells us that our basic development environment is all set and ready to go. Now that we're all ready, let's start writing in Daml.","url":"https://www.youtube.com/watch?v=wbTdyKexdgI&t=191s"}],"youtube_url":"https://youtube.com/watch?v=wbTdyKexdgI","url":"https://ccpedia.xyz/videos/wbTdyKexdgI"}