Cover photo

Blockchain Development: Why I'm choosing Solana (SOL) over Solidity

Yesterday, I decided that I should actually teach myself Solidity as an introduction to blockchain development. This is despite the fact that I'm not a fan of Ethereum (ETH) and ERC-20s. However, about ten minutes into the tutorial, it immediately became apparent to me that Solidity is not a language for me. Here's why:

contract ExampleContract {

  function exampleFunction () returns(string memory) {

    return value;
  }

}

It's immediately apparent to me that the language is unnecessarily verbose, when there are two extra keywords (returns and memory in just a function definition, before getting into other aspects). Why would you do that, making a developer do more work than is strictly necessary, particularly in a language based on C/C++? It makes no sense to me and my reaction is "eww, no"! Here's what I think it should look like, based on my experience with other languages based on C/C++ (chiefly Nim, which I love because it allows me to write less code and transpiles to C/C++ and probably Rust, hopefully):

class ExampleContract:

  proc ExampleFunction0: string () -> value;

  // OR 
  proc ExampleFunction1: string ():
    return value;

If you really want to make it clear that ExampleContract is a Contract, make it implement a Contract interface or extend a base class, rather than add unnecessary keywords:

class ExampleContract impl IContract:
class ExampleContract::  Contract:

Already, that's eight (8) lines of code reduced to three (3) or four (4) and definitely far fewer characters to type. As someone who has done software development professionally for over a decade, that (not deviating too much from what already exists or getting wordy) matters to me. I don't like overly-verbose and overly-engineered languages. Java is a case in point. C is elegant in its simplicity, despite its complexity. The further away from that languages go, the more they seem to lose sight of that and add cruft. Nim seems to intentionally keep that to a minimum, as part of its motto/ideology: "Efficient, expressive and elegant". (It also takes inspiration from Python and Rust.)

Why I'm Choosing Solana (and Rust) as a Starting Point

Yes, it does seem a bit ironic that I don’t like Ethereum, yet I’m using Metamask (an ETH wallet) to connect to Mirror …

The Solana Ecosystem (Copyright solana.com/ecosystem)
The Solana Ecosystem (Copyright solana.com/ecosystem)
  • Solana is a cryptocurrency project I like. That's partly because it is intended to be an "Ethereum killer", according to Oscar Wei on medium. It's also partly because it aims to be carbon-neutral. It does this by being more efficient (faster and using less energy per transaction) than ETH.

  • Solana costs less to use than ETH (typically less than $0.01 USD).

  • It's based on Rust (or provides a crate for it), which I want to learn anyway. I can potentially use Rust for projects outside blockchain development.

  • Solana has it's own Stack Exchange (SE) Q&A site.

  • Zcash, another project I like, also uses Rust. That means that the learning curve for transitioning to that will likely not be as steep since I'll have common base knowledge.

  • Rust is (mostly) developed by Mozilla, which is a foundation/organisation I like and respect.

  • Rust is based on C/C++. I like strongly-typed languages that build on with what I'm already familiar. (I know C#, Java and PHP.)

  • I need a good/motivating reason to learn C and C++ (which I've wanted to learn for a long time, despite being put off by how difficult it is for me to understand pointers).

  • Rust can bind to C (and C to it) through the use of a foreign function interface (FFI).

  • There are at least two books on Rust, by members of the development team, available for free from the documentation subdomain of the project's Website.

There does seem to be two disadvantage, however:

  • Rust is not intended for use in Web development, being more a back-end and/or systems language. However, there are libraries (crates, to use Rust's terminology) that apparently help to make this possible (although not necessarily easy). In the worst case scenario, I could probably figure out how to leverage FFI to use Rust with Nim through C.

  • The Solana network does have a worrying tendency to go down like a $5 whore. Perhaps this won't be a big issue if I use it as a stepping stone for learning other projects' development frameworks, languages and toolchains.


This post was originally published on Publish0x. I'm going to be copying my more successful posts there to Mirror, as I prefer Mirror's editor. (Hooray for an actual Markdown editor! Tiny MCE on Pub0x gives me problems.) However, most of my followers are still on Pub0x and it would probably be a waste of my time and energy to get them to switch (even though they might benefit if they regularly write posts). I have to thank Allen Taylor for getting me interested in giving Mirror a try.

if you’ve followed me over from Publish0x, good on you for making a good decision. Please subscribe for more content from me. If you like this post (or any of my other popular posts from Pub0x), please add it to your collection. Thank you for reading.

Subscribe