YAIL/Companion Documentation

The YAIL format looks really interesting, is there any documentation? I am interested in writing YAIL by hand and potentially making my own YAIL compiler. Also, are there docs for the Companion protocol?

PS: What does YAIL mean? Is it Young Android Intermediate Language?

1 Like


YAIL is simply Scheme but with App Inventor specific macros. The macros are defined in runtime.scm file which you find under buildserver directory.

When you start a local instance of App Inventor and login with Admin access, you get the ability to generate and read YAIL code for any block as a block comment.


Depending on who you ask, YAIL actually has two meanings. The original one was Young Android Intermediate Language, but on occasion we've also called it "Yet Another Intermediate Language".

If you're interested in learning Scheme/YAIL, you may want to follow the Structure and Interpretation of Computer Programs (MIT 6.001), which was co-designed by Prof. Hal Abelson who is the director of the MIT App Inventor project. There are also video lectures available here.


Thank you for the link to the course. I know YAIL is an extended version of Scheme, I'm just trying to figure out what the extensions are. I got rendezvous2 and a WebRTC connection working on the companion I'm writing, and AI2 sends YAIL over the datachannel so I need to start writing the YAIL interpreter. If the iOS companion was open source (It still isn't, right?) it would probably be a very helpful reference. For a more specific question, where is the code for com.google.youngandroid.runtime as required in pretty much every YAIL file? I can't find it in the repo, all the files that come up when I search are tests or part of the codegen.

The package com.google.youngandroid.runtime is defined as part of runtime.scm. At least on the branch I'm currently on, it starts at line 965 with the call (module-name com.google.youngandroid.runtime).

1 Like