1. 18

  2. 3

    This seems interesting. At first glance, I thought it was a more ergonomic syntax for Go (something like CoffeeScript for JavaScript back in the day); however, it seems like it’s a configuration language for Go. Which is neat, but there are already quite a few configuration languages with Go support (e.g., Starlark). The big thing that most of these fail at, however, is static types–it seems like it’s particularly easy to make type errors in configuration languages, and the usual dynamic typing guidance “just catch type errors with tests!” seems particularly unhelpful here (I really don’t want to have to write tests for my configuration if I can help it). Since I’ve dabbled with TypeScript recently for some web frontend stuff, I’ve come to the conclusion that it’s probably the best bet for an embedded scripting language in the general case (type system is solid, syntax is familiar, lots of existing high quality tooling, etc), provided of course that we can get a decent embeddable runtime for host languages.

    That said, does anyone know how we can make tsc aware of host functions? E.g., if I bind a foo() func to the TS/JS runtime and invoke it in my program, how do I make tsc not complain that foo() isn’t defined/imported in my TS source code?

    1. 7

      expr is not really a configuration language. It is used to write expressions. It is useful if you want to integrate a rule system in an app (filtering a a subset of data, giving permissions for a resource). It is easy to learn because its scope is limited and it is fast because it compiles to bytecode and has an optimizing compiler. The author is also quite responsive. Thanks Anton!

      1. 1