Sujet : Re: Python recompile
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 19. Mar 2025, 17:21:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vreqv1$16clp$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
User-Agent : Mozilla Thunderbird
On 19/03/2025 07:14, Tim Rentsch wrote:
bart <bc@freeuk.com> writes:
On 13/03/2025 21:52, Tim Rentsch wrote:
>
bart <bc@freeuk.com> writes:
>
Here however is a summary of these fictional tools:
>
https://github.com/sal55/langs/blob/master/CompilerSuite.md
>
I'm not interested in the tools. What I am asking to see is
the language.
>
I'm working on a document that summaries the features.
I expect some people will find it interesting reading. It is
almost certainly worth writing, assuming there is an interested
audience.
I don't know if you've seen the thread I made, where I posted a link to it. So any suggestions now are a little late.
The evidence is that no one is interested in this kind of language now.
I will use the write-up for my quick reference (to remind me of what's in there, which is quite a lot). But I will probably add appendices with some proper reference material.
My interest is seeing a definition of the language, including
at least a complete syntax, and some sort of description of
the semantics for each construct, especially those that look
or behave differently than familiar constructs in mainstream
languages.
Most languages I've tinkered with, I haven't bothered with any references. I just need to know the basics (hello world; defining a function; printing a number).
I think most people don't until they have to use a language properly.
Being concise or terse is okay; I don't need to
read a belabored explanation of, for example, how function
calls work, if they work the same way that function calls in
C work. But it is important, in this example, to say that
function arguments are always evaluated left-to-right (if
indeed that is the case),
A lot of this stuff is up to the implementation. Here, function arguments I believe are always evaluated right-to-left, which in my own implementation, is an assumption made in the front-end.
But it's really up to the backend. It could decide to reverse the order; there is enough info in the IL to do that, but it's messy. So it should really be a characeteristic that the front-end interrogates.
There's another issue with the stack, which normal grows downwards, but when the backend is told to interpret the IL, it grows upwards. So function arguments are physically ordered the other way around, but the right-most in the source code is still evaluated first.
(This had a bearing when the backend was used to interpret C, where my implementation of variadic function bodies assumed the stack went a certain way.)
Anyway, the ordering is not specified by the language, and should be be relied upon. It won't hurt to mention that though.