249 karma · joined August 16, 2015
Last time I tried it, they were working on integrating wasm support for user-accessible custom scriptable scenarios (a la Roblox).
[1]: https://en.wikipedia.org/wiki/Transair_Flight_810 [2]: https://admiralcloudberg.medium.com/dark-waters-of-self-delu...
For some crashes that have interesting causes (at least from an engineering perspective) beyond "maintenance failed to identify a problem before takeoff" or "pilots fail to identify problem or take wrong actions", I strongly recommend the articles on TWA 800 (1996) [1] and the near-crash of SmartLynx Estonia 9001 (2018) [2]. The first goes into great detail exactly _how_ the FAA discovered the root cause, whereas the second one involves a logic oversight in the flight computers of a modern Airbus plane.
[1]: https://admiralcloudberg.medium.com/memories-of-flame-the-cr... [2]: https://admiralcloudberg.medium.com/the-dark-side-of-logic-t...
[0]: https://github.com/MythicManiac/copilot-import [1]: https://github.com/drathier/stack-overflow-import
Some other examples:
>>> from copilot import rock_paper_scissors
>>> rock_paper_scissors('Rock', 'Scissors')
'Player 1 wins'
>>> from copilot import get_current_git_commit
>>> get_current_git_commit()
b'29c7e9b138a9247c598b613ca378d103de878e2a\n'
>>> from copilot import answer_to_everything
>>> answer_to_everything(1)
42
Practically, it works through two separate copilot calls. The first one asks copilot to predict the arguments a function would take, then the second one asks it to predict the body of the function. The returned code is then parsed, both to ensure that it is actual valid Python (it almost always is, although it sometimes spits out Python 2 or cuts off due to length limits), and to remove any extra statements that are not part of the function (sometimes it likes to include an `if __name__ == "__main__"` for example).The function is then wrapped in an error handler that will attempt to include a module if the snippet references an undefined variable. Copilot tends to use the correct libraries, but forgets to import them so this step is necessary to get most things working. We experimented with prompting an `import ` inside the function body, which worked decent but delivered some wonky results when the code needed more than one import or when it needed none at all.