[Active] Sophia language and ecosystem development Q1 2024

Followup of [Completed] Sophia language and ecosystem development Q4-2023

Application Status

Status: Active
Last updated: 01.02.2024
Submited by Radosław Rowicki, radrowicki at google’s 5-letter mail domain
Team: Gaith Hallak, Radosław Rowicki
Approved Budget (in h):
Used Budget (in h):
Planned Delivery:

Specify the funding category

Open Source Development, Research and Education

Application Title

Sophia language and ecosystem development Q1-2024

Applicant

Radosław Rowicki (@radrow) and Gaith Hallak (@ghallak)

Value Application

Improvement of smart contract development on the æternity blockchain using Sophia and FATE.

Definition of Terms

  • Sophia — most commonly used smart contract language for the æternity blockchain.
  • FATE — smart contract runtime system on the æternity blockchain.
  • Compiler — translator between a high-level language (here; Sophia) to a low level language executed by a machine (here; FATE).
  • Language ecosystem — a collective term for various tools integrated to work together for software production in a given language.

Status Quo

Sophia is a well designed language and is convenient for smart contract development. Unfortunately, the means utilizing it in professional use cases lack some maturity or external functionalities, especially regarding editor support and testing. Moreover, the language still has some parts which are underdeveloped, and while it does not drastically hinder its usability, it makes it harder to adapt by programmers not familiar with it.

Sophia developers are encouraged to use aestudio for smart contract development. While the editor is a legitimate tool, not everyone is fond of web-based editors. There is practically no alternative to it, unfortunately. While there are some extensions to VS Code, they offer little over syntax highlighting.

The REPL is a working tool and can be used for offline and online testing contracts. It supports basic debugging utilities which are accessible through a websocket layer. However, it lacks some features, especially regarding chain simulation and local variables.

Required Work

In the long term the following should be considered:

  • Maintain the debugger on demand
  • Maintain the REPL on demand
    • Responsiveness polish
    • Testing, fix all crashes
    • Documentation
    • Tutorials
  • Develop the compiler
    • Regular maintenance on demand
    • Rewrite as a modularized device
      • Design and implement parser as a tree-sitter grammar
      • Compatibility layer between tree-sitter and actual AST representation
      • Rewrite typechecker
      • Redesign backend layers
      • Expose code analysis features
  • Editor support
    • Language Server Protocol
    • Integrate with REPL

Our focus in this application has been marked in bold. Things from the previous season considered as done have been crossed out.

Estimate

@ghallak will be working full time on this grant. @radrow will be allocating time during weekends and his free time to provide advice, code reviews, and might do development when required.

Known Limitations

Compiler construction requires a lot of expertise, research and overall engineering effort. The team is small, which hinders the pace.

Outlook

The points that are not marked in bold in the “Required work” section are the longer term goals that should be considered according to their priority in the future.

Publishment

We plan to publish our work in the official AE Github repositories. Project releases will be made by the end of this grant period. Some major changes or critical updates might require publishing new releases for certain projects before the end of the grant period.

Maintenance

Maintenance and bug fixes are part of this grant, and we will be providing bug fixes and updates as necessary to the projects that are developed under this grant.

Update 01.02.2024

  • LSP supports goto definitions
  • tree-sitter grammar is much more stable
  • CST-AST conversion is finished to most extent
  • Baseline for the typechecker has been created.
  • New version REPL with much better interface has been released