← Back to context

Comment by gommm

3 days ago

I tend to find that for things like this that are really math heavy, it's usually better to create a DSL (or create easily readable function calls, etc) that you can easily write yourself instead of relying on AI to understand math heavy rules. Bonus points, if the rules are in an easily editable format, you can change them easily when they need to. It seems that was the path the author took...

And yes this kind of use-case is exactly where unit tests shine...

> create a DSL (or create easily readable function calls, etc)

These aren't really that different. Consider the history of the earliest (non-assembly) programming languages, particularly https://en.wikipedia.org/wiki/Speedcoding , as well as the ideas expressed by Lisp.

  • Oh yeah, that's why I added the parenthesis. I consider lisp macros to be a dsl and that's exactly what I tend to like using. Similarly with ruby and some meta programming tricks.

I do the opposite, set up everything myself in terms of architecture/design of the software, so the AI can do the boring boilerplate like "math heavy rules". Always interesting to see how differently we all use LLMs.

  • I've usually not been impressed in AI's implementation of math heavy rules so I wouldn't trust it much and I tend to find it easier for me to write them myself and then verify :) Yup, it's always interesting to see the different usages.