Dolla – The Haskell Blockchain

The journey to our Haskell blockchain has not been short. We started this journey by exploring blockchain tech and its applications, we needed to identify properties that our code had to have or produce. With Blockchains storing and moving large sums of value we needed a language that had enhanced safety. Plus in order for the Dolla blockchain to have fast transaction speeds and handle high throughput the language had to have excellent concurrency and high performance.

The Dolla & Haskell Story

What Made Us Choose Haskell

The journey to our Haskell blockchain has not been short. We started this journey by exploring blockchain tech and its applications, we needed to identify properties that our code had to have or produce. With Blockchains storing and moving large sums of value we needed a language that had enhanced safety. Plus in order for the Dolla blockchain to have fast transaction speeds and handle high throughput the language had to have excellent concurrency and high performance.

Faster Language

Safer Language

Strong Community

Another feature we were looking for was being able to write an application with less lines of code and for the software to be more easily maintained by existing and new programmers. We also wanted a strong community to exist around the language. After an extensive time exploring different programming languages we choose Haskell  and commenced building and testing a Haskell based Blockchain and have never looked back since.

What is Haskell?

Enter your text here…

With Haskell, code is clean and direct, this benefits complex programming where code simplicity helps application programming improving speed and reducing unintended side affects.Haskell is an advanced, purely-functional programming language that has a large number of advantages over a lot of other languages out there. These include:

• Enhanced programmer productivity• More maintainable software• Superior Performance• Excellent Concurrency• Better Safety

These features mean Haskell is a great language for building blockchains. Haskell is an all around well designed language and started out as a research language for academia. Its combination of static and strong typing, user-friendly syntax, declarative style, top notch tooling, wide collection of real world libraries make it a great choice for creating a robust, high-performance blockchain.

Haskell is great for programming applications, as it is a high level language. Haskell is also fast enough for writing 3D games and Blockchains where high speed is important.Haskell is a strongly typed language. Strong typing means that you catch lots of classes of bugs with the type system itself. Also Haskell is statically typed this means that the type checking occurs at compile time instead of runtime. Haskell is statically typed but has type inference. Haskell’s type system is Turing complete and its type inference is nearly total.In contrast other Imperative languages ( Ruby, Python, Java, PHP, C family etc ) are based on low-level commands and highly mutable variables that result in a lot of spaghetti code with large numbers of unintended interacting side effects. This type of code leads to software that is filled with unwanted bugs and as a result breaks easily and isn’t reliable.Another benefit of Haskell is it features garbage collection by default. This means Haskell code automatically avoids common mistakes like buffer overruns and double-free errors, these are both common sources of security vulnerabilities and software crashes.

Haskell has found a number of important uses where mission critical coding is required, this includes for financial companies, compilers, self driving cars and banks. Facebook also uses Haskell in an important project, it is called Fighting spam with Haskell, led by Simon Marlow.

Not to mention Haskell’s popularity in scientific and numerical computing. Where code quality and reliability matters, plus where the combination of speed and nearly automatic parallel code are needed companies turn to Haskell. Another crypto team understands the benefits of Haskell, Cardano a leading cryptocurrency has chosen to build a Haskell blockchain.

Who Uses Haskell?

Haskell has found a number of important uses where mission critical coding is required, this includes for financial companies, compilers, self driving cars and banks. Facebook also uses Haskell in an important project, it is called Fighting spam with Haskell, led by Simon Marlow.

Not to mention Haskell’s popularity in scientific and numerical computing. Where code quality and reliability matters, plus where the combination of speed and nearly automatic parallel code are needed companies turn to Haskell. Another crypto team understands the benefits of Haskell, Cardano a leading cryptocurrency has chosen to build a Haskell blockchain.

quote-left

Cardano a leading cryptocurrency is built using Haskell

quote-right

Cardano 

quote-left

 Facebook uses Haskell in a project called Fighting Spam with Haskell

quote-right

Facbook

quote-left

Bank of America uses Haskell for backend data transformation & loading

quote-right

B America

Haskell Benefits

Enhanced Programmer Productivity

More Maintainable Software

Better Performance

Safer Code – Less Errors

Enhanced Programmer Productivity

When it comes to programmer productivity Haskells benefits are numerous• rapid prototyping• less lines of code than other languages• easier to maintain software as code is more efficient and software coding is easier to understand• less errors leads to decreased work and higher quality codeHaskell is a high level, expressive language that allows you to build applications with less code and in faster time frames which reduces programmer workload. Haskell has a pragmatic type system which reduces errors and facilitates time-consuming and error-prone activities such as refactoring. All this allows the Dolla development team to focus on building the leading Blockchain.

More Maintainable Software

For a world class blockchain having software that is easy to maintain is an advantage over other cryptos. Haskell code is not only easy to read and understand for seasoned Haskell programmers but is easily modifiable and maintainable. This is thanks in part to Haskell’s algebraic type system which catches all sorts of bugs for you. When you’re maintaining your code and needing to update the type of a value or add an extra value to this type, the compiler will tell you what you haven’t fixed yet. This compile-time guarantee reduces workload and improves programmer performance.A lot of languages out there are difficult to understand. When a new programmer comes in and tries to understand the code written by a previous programmer, this means extra time is needed by these programmers to get up to speed or to decipher previous code. This also causes a large number of unintended bugs and crashes.With Haskell you have the ability to produce in quicker time frames code with less bugs, and you can evolve that code easily adding new features and changing requirements.

Performance

High performing blockchains are the future. Another benefit of Haskell is performance, an industry leading blockchain needs to have high through put and fast transaction speeds. Haskell helps us achieve this. With Haskell, code is typically quite fast, on average about half the speed of highly tuned C++ code. Haskell is natively compiled but garbage collected. This and other features means it is much faster than Java, Perl, Ruby or Python. Haskells native code generation and highly optimised libraries like vector and techniques like stream fusion, make this possible. You can zero in on performance hot spots using sophisticated profiling techniques, also you can speed up these hotspots with Haskell’s low-level techniques and an elegant Foreign Function Interface.Haskell has a unique mixture of elegance and speed, Haskell also offers a best in class multi-core experience. On top of this Haskell’s purity makes many parallelism problems trivial. Haskell has good concurrency support and its run time system can handle up to a million lightweight threads working simultaneously. These green threads are extremely light weight, the number of threads is limited only by available memory. This good concurrency support makes it easy to build the right abstractions for parallel execution which reduces program execution times and allows for superior performance in a lot of operations.

Concurrency

Haskell is excellent at concurrency and has a very high performing green (lightweight) threads solution. With Haskell you can scale many times more than a lot of other languages. Haskell allows an infinite number of threads, since each function is pure and has no outside state, you can reorder the process by splitting it out into any number of threads. You can run millions of these lightweight threads on normal hardware. On top of this every request gets a thread, these lightweight green threads help divide workload evenly. This leads to much simpler, easier to maintain logic with performance benefits.When you are able to parallelize an algorithm, speed improvements can be truly incredible on modern multi-core machines. On top of this, the very design of Haskell makes for fewer concurrency bugs. In particular Haskell is pure, this means that there are no mutations to observe and all data can be shared between threads freely.Haskell’s green threads avoid kernel context switches (used by system threads) resulting in faster more efficient threads. Also unlike some other languages which use callback based systems, code remains simple and avoids accidental blocking of the entire system due to long-running computations.

Better Safety for the Haskell Blockchain

Haskell is a very safe language. When it comes to certain industries such as banking, finance and blockchains, safety is of paramount importance. One of the reasons we have chosen Haskell as our langauge of choice is because it cannot have arbitrary side effects. Meaning it is far easier to prevent your code from crashing. Haskell is trusted by large data science firms. This includes AI software engineers ( think Autonomous cars) and financial institutions where safety and data accuracy are paramount. With Crypto currencies code safety concerns are paramount.You have to ask yourself is this software safe and prone to errors? The stakes are very high when people and institutional money is at risk, for this reason we have chosen Haskell. It is easier to secure a system ( like a Blockchain or IoT device ) when you can prevent leaks from arbitrary effects.Haskell Code is predictable and safer, Haskell functions can not have side effects, they can be called and you can be confident that there won’t be some undesired interaction with other parts of the code that creates “action at a distance”, where calling a function causes another to misbehave producing errors. Haskell, with its strong type system, dependent types and compile-time guarantees allows our Dolla Blockchain developers to catch a lot more errors at compile time when compared to languages like Python. Non-syntactic issues only pop up at runtime in a lot of other languages. This safety is a benefit of typed functional programming and of Haskell in particular.Haskell’s type system statically prevents:• XSS ( Cross Site Scripting ) attacks: user input is sanitised and prevents you from accidentally using unsanitised input, this prevents XSS attacks• SQL injection: Input is sanitised preventing escaping SQL queries• other SQL errors: SQL queries are well formed when you query your database using normal Haskell constructs• character encoding issues: you never accidentally mix up text encoded in different ways thanks to the Haskell type system• missing template variables: Haskell’s type system statically checks template variables to make sure they exist and have the right type.

Safer Blockchain

Faster Transactions

Higher Throughput

Peace of Mind

With Haskell’s benefits we are building a faster safer blockchain.

Stay up to date with our Progress