4

I've been working on creating my first decentralized application, and I'm currently working on this tutorial which attempts to create a decentralized version of Twitter.

I want to integrate an IPFS to store data from users, but another guide that I took a look at used Solidity as the language before compilation.

In fact, this tutorial just distributes the code as a go file.

I'm confused as to how this might be compiled and distributed to the EVMs on the network, and how the process of compiling this application would go. And also - what are the differences between Golang and Solidity in terms of writing decentralized applications?

2 Answers 2

1

It depends on how you're defining defining "decentralised application", and what you consider the differences to be between a Dapp and a smart contract, where they sit in the overall architecture, and how the terms relate to each other.

From what I can remember from looking a while ago at the book you reference, it's not using Go as a smart contracting language (at least I don't think it is... ), which is what Solidity is.

Links that might be useful reading:

I'm confused as to how this might be compiled and distributed to the EVMs on the network

There's currently no way to write smart contracts in Go, and have them compile to EVM bytecode. You'd have to write the compiler to do that. Why this would be a bad idea, specifically for Go, has been covered in the past.

See: What is the merit of creating new smart contract languages like Solidity instead of using other languages?

From the guy who writes most of the Geth code...:

"A while ago I've spent quite a lot of time to create a Go -> EVM cross compiler. I did manage to run a few trivial programs and it definitely was a lot of fun, but quite soon I've started to hit the limitations of the EVM that clashes with the core assumptions behind Go..."

And also - what are the differences between Golang and Solidity in terms of writing decentralized applications?

Solidity is smart contract language, Go, as above, isn't, and probably never will be, at least in Ethereum. Go could be used for other parts of your Dapp, i.e. parts of the front-end, or parts of the back-end that isn't the blockchain.

1

Both Go and Solidity are languages used to develop Smart Contracts in Hyperledger Fabric (aka Chaincode) and Ethereum blockchain platforms, respectively.

Solidity is tuned to interact with the Ethereum Virtual Machine (although we can interact with Ethereum Smart Contracts using Go, but not develop smart contracts).

Go is primarily used in Hyperledger Fabric to develop Smart Contracts also called "Chaincode".

Irrespective of platform, these languages are used to develop smart contracts. Smart contracts are business rules and logic implementations of any decentralized application. So, essentially Go and Solidity are not used to develop DApps themselves, but the rules for the DApps which we call smart contracts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.