On Wed, Jun 12, 2019 at 5:26 PM Yanghao Hua <yanghao...@gmail.com> wrote:
>
> On Tue, Jun 11, 2019 at 11:35 PM Barry Scott <ba...@barrys-emacs.org> wrote:
> > Some times a DSL is usable within the python syntax and that is great.
> > I have use python for a number of DSL's.
> >
> > But when the DSL is beyond what python can help with directly I'm wondering
> > why you do not parse the DSL with python and execute the results.
> >
> > In that way you can have any semantics that you want from any syntax that 
> > you
> > wish to have. However you do not need the python language to be changed at 
> > all.
> >
> > And it must be clear that you are making little to no progress on 
> > convincing people
> > that changing python is a good idea.
> >
> > Barry
>
> Hi Barry, realized that. Please do allow me sometime for formalize
> everything. You are absolutely right in that writing a new parser
> might not be a bad idea, but it is just soooo close for enabling
> Python to be used as the DSL language. We do not even need a DSL for
> HDL in this case, as Python can co-simulate with any HDL simulator
> that supports VPI/DPI/etc., but writing a full featured HDL is really
> just a few hundred of lines of code which enables you to throw away
> the entire HDL simulator (hundreds of thousands of lines, plus another
> hundreds of lines of glue code in between python and HDL simulator.

If Python is really THAT close, then devise two syntaxes: an abstract
syntax for your actual source code, and then a concrete syntax that
can be executed. It's okay for things to be a little bit ugly (like
"signal[:] = 42") in the concrete form, because you won't actually be
editing that. Then your program just has to transform one into the
other, and then run the program.

ChrisA
_______________________________________________
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/FZF7UJLKUOLRVUH6EBHATFQAGKH4V7SS/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to