On 2015-11-27 08:08, Sönke Ludwig wrote:
Actually, no! Conditionals and loops are the only constructs - switch is a possibility, but basically nothing else. There will also never be variables, just constants. There is a definitive limit, namely when it becomes impossible to reason about the code in a generic way, without "executing" it, so in particular anything that would make it touring complete is a no-go - no recursion, no loop flow control statements, no goto. In fact, there are no "statements" at all, these are all purely declarative "directives".
On one hand that means that now you have to take care of security issues (holes in the scripting engine/compiler or DoS attacks of various sorts) when you want to use this on a server (code.dlang.org). Once there are big numbers of packages, this could also mean that the hardware eventually needs to be upgraded when it would have done fine for a long time with a tiny declarative parser.
Personally I think Dub and code.dlang.org is designed completely wrong. Currently Dub works by the user pushing new code to the repository on GitHub and code.dlang.org watching for changes. If the user instead would use Dub to build a package locally which is then uploaded to code.dlang.org you would have less of these issues. The code would be executed on the client and serialized to a data format (JSON, XML, YAML, whatever) that no person will ever see. code.dlang.org would then read this data format, instead of executing the code, just like it's doing now.
-- /Jacob Carlborg