https://github.com/stanford-oval/thingtalk
The Programming Language of Virtual Assistants
https://github.com/stanford-oval/thingtalk
dsl hacktoberfest programming-language voice-assistant
Last synced: 10 months ago
JSON representation
The Programming Language of Virtual Assistants
- Host: GitHub
- URL: https://github.com/stanford-oval/thingtalk
- Owner: stanford-oval
- License: apache-2.0
- Created: 2016-01-31T01:58:58.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-06-06T22:55:10.000Z (over 2 years ago)
- Last Synced: 2025-03-29T16:08:52.210Z (11 months ago)
- Topics: dsl, hacktoberfest, programming-language, voice-assistant
- Language: TypeScript
- Homepage:
- Size: 14.8 MB
- Stars: 86
- Watchers: 14
- Forks: 21
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ThingTalk
[](https://travis-ci.com/stanford-oval/thingtalk) [](https://coveralls.io/github/stanford-oval/thingtalk?branch=master) [](https://david-dm.org/stanford-oval/thingtalk) [](https://lgtm.com/projects/g/stanford-oval/thingtalk/context:javascript)
## The Programming Language of Virtual Assistants
ThingTalk is the declarative (rule-based) distributed programming
language for virtual assistants. It connects to multiple web services
and IoT devices in a single _when-get-do_ statement.
For example, in ThingTalk you can say:
```
monitor(@com.washingtonpost.get_article(section=enum world))
=> @com.yandex.translate.translate(target_language="zh"^^tt:iso_lang_code, text=title)
=> @com.facebook.post(status=$result);
```
This program automatically monitors Washington Post headlines, translates them to Chinese, and then posts them on Facebook.
It does so by referring to primitives defined in [Thingpedia](https://thingpedia.stanford.edu), an open-source crowdsourced repository of APIs and metadata.
Documentation for the ThingTalk language is available on the [Almond wiki](https://wiki.almond.stanford.edu/thingtalk).
This package contains the grammar, the compiler of the language,
the interface to analyze programs using SMT, the code to translate
from ThingTalk to natural language, part of the ThingTalk runtime,
and various libraries to manipulate ThingTalk abstract syntax trees.
While this library is useful on its own for specific purposes, to
run ThingTalk programs you will need a full virtual assistant runtime, such
as one provided by the [Genie Toolkit](https://github.com/stanford-oval/genie-toolkit).
ThingTalk is developed by the Stanford Open Virtual Assistant Lab, a research
initiative led by prof. Monica Lam, from Stanford University.
You can find more information at
## License
This package is covered by the Apache 2.0 license. See [LICENSE](LICENSE) for details.
## Versioning
This package **does not** follow semantic versioning. Instead, the version should
be interpreted as:
- Major version will be bumped for incompatible changes in the language, such that
existing valid programs are no longer valid.
- Minor version will be bumped for any change in the library, such as AST definitions,
interfaces to compilation/optimization passes, adding and removing additional
processing modules.
- Patch version will be bumped for compatible bug fixes.
**Minor version bumps can introduce incompatibility to library users**; it is
recommended that library users use tilde version ranges on their ThingTalk dependency.
### Source compatibility
The syntax of ThingTalk is designed to be forward and backward compatible to a limited extent.
Within major versions, we guarantee the following
- Syntax generated with an older version of ThingTalk (or written by a human targeting
an older version of ThingTalk) will continue to parse correctly with a newer version
of the language.
- Syntax generated by a newer version of ThingTalk may not parse correctly with an
older client. As a best effort, client code can provide a ThingTalk library
version to generate syntax compatible with that version (reducing functionality).
- Generally speaking, the same program will continue using the same normalized syntax
representation (which is unique for a given program semantic) with different
versions of the library. Hence, ThingTalk syntax is suitable for long-term storage of programs
that are compared syntactically (e.g. datasets). Deviations from this rule will
be clearly marked in the release notes.