▲ | hwpythonner 6 days ago | |||||||
I’m not deep into autodiff (just recall some calculus from university), but the syntax in this post reminds me a lot of ML (the programming language, not machine learning) I know autodiff isn’t lambda calculus, but the expression-based structure and evaluation rules feel similar. Couldn’t this be implemented in something like ML or Clojure? Just wondering what the custom DSL adds that existing functional languages wouldn’t already support | ||||||||
▲ | hansvm 5 days ago | parent | next [-] | |||||||
I didn't see a DSL anywhere, just normal JS code. As to what it adds? - It's more accessible to a wider audience (and looks like how you'd implement autodiff in most languages) - It runs in the browser trivially (powering those demos) - The author (potentially) didn't have to learn a new language just to get started - Programs are not fully differentiable, or at the very least there are some crazy edge cases and dragons lurking if you attempt to make them so. A dedicated whitelist of supported operations isn't necessarily a bad design, contrasted with an implicit whitelist in Clojure (depending on the implementation of course, but there wasn't a lot of source-to-source boilerplate even in this example, so I assume the benefit of a functional language would be stripping away some of the characteristics I think are important). | ||||||||
▲ | fire_lake 5 days ago | parent | prev | next [-] | |||||||
There is an F# implementation (Microsoft flavoured ML) called DiffSharp | ||||||||
▲ | constantcrying 5 days ago | parent | prev [-] | |||||||
Automatic differentiation can be implemented in essentially any language. Some just make it look "nicer". | ||||||||
|