Hacker News new | ask | show | jobs
by tobmlt 2956 days ago
I'm just a numerics person but I'd love to hear your input about relational/declarative/Prolog-like programming in Python in the following situation: if the working language doesn't have to be anything resembling Prolog, but can instead be a Python internal DSL(DSL-lite?), and further if, say, one wants to do unification only over (what amounts to) some numeric data, then Python's operator overloading can supply all the heavy lifting one needs - allowing one to build up a representation of the (computational) expression tree via overloading and then "compile" that guy into lists of relational function closures which await environments (design spaces). This is of course a really specific case, but as a "mechanical-type" engineer doing a thesis on automated geometry generation, and needing a pre-processor to quickly pair down my design space to something nice given a design specification on the fly, I've found python + unification + numerics (especially interval arithmetic - where the design space is basically closed...) to be a really useful (and work saving) combination! The end result feels like magic to me anyway. But lots of computing feels like magic to a numerical programmer - that's what makes it so fun to branch out - and Python makes that as easy as possible. (Thanks for all of your writings which help the novice do this kind of thing!)

I should summarize that long winded statement in case anyone tries to read it: eh hem... This one time, for this one specific case, off in a totally unrelated field of engineering, Python made for a pretty fair Prolog substitute for one kid's dissertation.