On 2022-04-02 22:28, Steven D'Aprano wrote:
On Sun, Apr 03, 2022 at 01:09:00PM +0900, Stephen J. Turnbull wrote:

>There was a proposal to provide literal syntax for physical units like
>meters, kilograms, and seconds, along the the SI magnitude prefixes.
>I think that got to the "proto-PEP" stage, but it got a lot of weak
>opposition for a number of reasons, mostly "Python isn't intended for
>creating DSLs
Python is excellent for creating DSLs. It is one of the things it is
well known for.

https://www.startpage.com/sp/search?query=writing+dsls+in+python

I'm not the person you're replying to, but a lot of those search results are pretty clearly not what was meant here. Python is fine for creating "real" DSLs, where the L is actually a separate language and Python is just parsing/interpreting it. What Python isn't so good at is creating quasi-DSLs or "DSDs" (domain specific dialects), where Python itself is the language and the domain-specific part is grafted on by use of objects, operator overloading, etc., so that what you run is actually a Python program that just looks and behaves a bit different from what you might expect from "vanilla" Python. This is the "Python isn't for DSLs" argument that I've seen mentioned on this list and elsewhere (although I agree that it's a pretty loose use of "DSL").

--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail."
   --author unknown
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/E7KXNQEOPGTWHPWYWG2SEQORA66ABH77/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to