3

I was wondering if it is possible for solidity to call functions of other languages. More specifically, I am planning on developing a basic distributed search engine using the ethereum blockchain and I was wondering if I could write the web crawling and indexing in a different language (Python etc) and then have solidity to either gather the local results from this or call the methods directly. I am aware solidity is turing completing but being able to develop in another language would save time with library use and then just use solidity to interact with the blockchain. Hopefully this makes sense, thanks in advance,

1 Answer 1

2

Solidity is compiled into bytecode which is stored on the blockchain and run on the EVM by miners and full nodes.

There are no solidity compilers which support Solidity combined with other languages which can get compiled into a single bytecode that runs on the EVM.

That being said, Solidity is not the only option for programming on Ethereum.

You should look at other EVM compatible languages like:

But what might be of even more interest to you, is the upcoming support for an Ethereum flavored WebAssembly (eWASM)

This will ultimately allow you to program smart contracts in popular languages like C++, Python, Rust, etc... However, this stuff is still in very early development.

2
  • Thanks for your reply however I'm not saying compiling multiple languages into a single bytecode, I was more asking if it is possible for a program written in one language to do the crawling and indexing and create the necessarily local index table and then have a program written in solidity to essentially pick up and transfer this data between the nodes. Commented Aug 21, 2018 at 19:21
  • Seems like you simply want to use Web3 to ether read or write to the blockchain. An external program, with Web3 and access to an Ethereum account who has permission to access a smart contract, can programmatically write data to the blockchain. Additionally, an external program with Web3 can read any data that has been written on the blockchain. But there is no way for a solidity application to read data off the chain directly. All external data needs to be written on chain for it to be picked up by a smart contract. This is where oracles come in. Commented Aug 21, 2018 at 19:28

Your Answer

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

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