The Sophia language is derived from OCaml/ReasonML family. It is strongly typed and has restricted dynamic state.
Sophia is customized for smart contracts, which can be published to a Blockchain (the æternity blockChain). Thus some features of conventional languages, such as floating-point arithmetic, are not present in Sophia, and some blockchain specific primitives like constructions and types have been added.
The Sophia Language
An Æternity BlockChain Language The Sophia is a language in the ML family. It is strongly typed and has restricted…
The main unit of code in Sophia is the contract.
- Contract implementation, or simply a contract, is the code for a smart contract and consists of a list of types, entrypoints, and local functions. Only the entrypoints can be called from outside the contract.
- A contract instance is an entity living on the blockchain (or in a state channel). Each instance has an address that can be used to call its entrypoints, either from another contract or in a call transaction.
- A contract may define a type of state encapsulating its local state. When creating a new contract the init entrypoint is executed and the state is initialized to its return value.
Data types were discussed as well.
Some of these data types include;
Int (A 2-complement integer), Bool(boolean), Bit(A bit field String), An array of bytes List(A homogeneous immutable singly linked list), State(A user-defined type holding the contract state), Event(An append-only list of blockchain log entries), Tuple(An ordered heterogeneous array) and much more.
Dacade was reviewed again and we built a similar Memevote smart contract. According to Fabián Hernández, MemeVote is a decentralized application of the aeternity blockchain (daepp) that allows registering, tag, comment and vote user memes referenced by URL. This daepp is the result of the Aeternity Development 101 course from dacade.org platform, which is a great community that obliges people to learn about this exciting technology
Introduction - æternity Documentation Hub
Jesulonimi Akingbesote went a little deeper with Sophia and they built an authenticated to-do — list æpp which has started functioning with more features to be added as time goes on.