Inspiration

After the fun I had with the Internet Computer building Ethical Targeting, I wanted to see if I could improve its use in other projects that wanted to incorporate it.

However, finding a project to contribute to was hard. Most of the projects that went for the DFINITY prize in previous sprints ended up not using the Internet Computer or only used it to host static assets served to the browser. Only Code Kindle, DocVerifier, and Ethical Targeting (which wouldn't fit because it was my own project) had any sort of backend computation happening.

Unfortunately, both Code Kindle and DocVerifier rely on complex Python libraries that would be nontrivial to write in Motoko. The only way to get their backends actually running on the Internet Computer would be to implement Candid (the common cross-language interface of the Internet Computer) for Python.

What it does

Building an entire Candid implementation is not something I can do in this time frame, so I decided to start by making something that parses a Candid definition file and converts it to Python...only to discover that is also not the easiest thing to write in a short period of time.

The current status of the project is TBA, and I will keep the repository updated with my progress.

How I built it

  • Pain
  • Python
  • Lark, a library for creating parsers for context-free grammars

Challenges we ran into

  • I started a full-time job this week and only had a couple hours of spare time per day for fellowship work
  • Writing any kind of parser is hard work...writing a JSON serializer for the last project was trivial in comparison

Accomplishments that I'm proud of

Nothing yet, gotta get an MVP first.

What I learned

  • Don't try to write a language parser in a few days

What's next for Candid to Python

  • Candid -> Python interface conversion
  • Python -> Candid interface conversion
  • Conversion of Candid binary format to text representation

Built With

Share this project:

Updates