Pact Tutorials – Welcome To Pact – Beginner 01



welcome to the pact smart contract programming language in this tutorial you'll learn all about pact get introduced to its core features and take your first steps towards becoming a pact smart contract developer the goal of this tutorial is to familiarize you with what pact is how it's used and some critical decisions that influence the design of this new language pact is the safest most user-friendly language for smart contracts it's designed for security and performance pact is an open-source programming language for writing smart contracts it's designed from the ground up to support the unique challenges of developing solutions to run on a blockchain pact empowers developers to create robust and high-performance logic for transactions it facilitates execution of mission-critical business operations quickly and effectively pact is designed with safety in mind it's designed is informed by existing approaches to smart contracts as well as stored procedure languages like sequel and Lisp pact resembles a general-purpose touring complete language it includes Lisp like syntax user functions modules and imperative style pack takes a unique approach to smart contract development pack smart contracts contains three core elements the module key sets and tables first a module defines the logic of a smart contract it contains functions pack definitions tables and schemas next packed key sets specify authorization to different parts of the smart contract they determined which accounts have access to which part to the program finally table store data generated by pack modules these tables have a key row structure and support schemas as well as a versioned columnar history each of these elements support a wide range of functionality this ensures that you have the tools you need to create robust solutions for real world problems there are many valuable features that make packs such as safe and high-performance language these features include touring and completeness human readability upgradeable contracts formal verification and many other features these come along with packs unique tooling ecosystem and developer community all this makes writing smart contracts with pact both fun and productive let's take a look at each of these four in more detail first pact is a touring incomplete language with deliberate constraints this is done to help keep your code safe here's why for some applications touring completeness is an extremely important feature for smart contracts it's an incredibly dangerous feature that exposes developers to dangerous and costly attacks for that reason pact is designed to be touring incomplete which places deliberate constraints on its computational ability this supports its design goal of just enough power for transactional blockchain solutions and helps ensure the security of its smart contracts to maintain Turing incompleteness pact does not allow unbounded looping or recursion pack detects recursion and fails immediately looping is also only supported in special circumstances the key benefits of this are to reduce cost and improve performance touring and completeness makes some of the most infamous and costly bugs discovered in other platforms not even possible with pact next pact is human readable all pact code gets stored and written in human readable form on the ledger packed smart contracts installed directly onto the blockchain this allows you to review the running code as it was written and be sure of exactly what it's doing so why is this important well smart contracts soft business problems that require both technical and non-technical expertise building the best smart contract solution requires everyone to understand and contribute to the development of the smart contract for that reason pact was built to be simple to read and write this simplicity helps provide complete transparency for the logic within it smart contracts this approach also encourages shorter programs the code executes directly on the ledger where it can be read easily by anyone as a result pact is easy to understand for example here's a hello world smart contract using pact without having learned anything about the pact language you can already start to see how it works with these few simple lines of code you see a fully functioning pact hello world smart contract pact also supports upgradeable contracts upgradeable contracts allow you to offer new features adapt to new workflow requirements and fix bugs as they're discovered none of this is possible with other smart contract languages and it's a powerful feature when building impactful applications for your business packs tooling ecosystem further amplifies the simplicity of upgrading contracts compiler and runtime errors offer detailed information with stack traces and function documentation to ensure you're making the best version of your smart contract PACs iterative development process is also supported by a feature-rich repple helping you to improve and deploy new smart contracts rapidly it includes features such as incremental transaction execution and environment and database inspection finally pact comes equipped with a powerful validation tool suite in the form of formal verification pact uses XIII an open-source tool developed by Microsoft to mathematically verify and test for bugs present in the code this means that pact allows smart contract authors to express automatically check and formally verify that their code does not contain any bugs formal verification is the same system used to protect mission-critical environment like nuclear power plants or airspace and autopilot systems you now have the same high level of security and every smart contract you write with pact along with these core features there are many other features that pack supports to help make your developer experience as rewarding as possible here's a quick overview of these features first pact includes type inference this feature makes it possible for code to be strongly typed without declaring type information it also has the added benefit of limiting runtime type enforcement developers can use a type check to add just enough types type check eliminates warnings and only enforces types at runtime where needed next similar to relational database management systems pact offers the benefit of total governance this benefit allows changes to commit to the database only if the code runs successfully any errors roll back changes aboard execution and avoid costly mistakes pact is also designed to allow direct integration with an industrial relational database management system this design is helpful in cases that need efficient publication of historical data the PAC programming language name comes from one of its key features known as pacts a pact solves a significant block chain problem in privacy preserving blockchains to maintain privacy on a blockchain participants can only run a subset of smart contracts in these cases the databases of each of the participants become disjointed Peck solves this problem using co-routines covert teams are functions that can start and stop at critical points in a functions execution these covert teams are called pexe they define the steps to be executed by different entities as sequential transactions on the blockchain the features described here are only a few of the crucial features that make PACs such a powerful language for writing smart contracts there are many resources available to help you learn even more about pact before wrapping up here's a look at some of the resources you can use to get started you can join the discord channel for community discussion read the pack smart contract white paper to learn more about the creation of pact go through the pack documentation for a detailed look at everything the language offers follow the github page for the latest updates on pack development you can also ask any questions that come up while you're learning pact on stack overflow using hashtag pact – lang and to get coding right away you can go to pact de cadena io to use our online code editor that allows you to easily build and deploy smart contracts using pact along with all of these resources you can also continue this tutorial series throughout these tutorials you'll learn all about pact by walking through each of its features building real-world applications and exploring new ideas for yourself to take the language in directions no one has even thought of yet that wraps up this tutorial throughout this tutorial you learned about pact got introduced to its core features and took your first steps towards becoming a pact smart contract developer you also know where to find us the community and many valuable resources to help you get started developing with pact feel free to join the community and reach out if you have any questions we're incredibly excited to help you start your journey as a pact smart contract developer so welcome again to the pact programming language we can't wait to see what you build

Leave a Reply

Your email address will not be published. Required fields are marked *