Liste des Groupes | Revenir à cl c |
On 24/04/2025 16:28, bart wrote:Take a look at any ordinary C code of normal functions, statements etc.On 24/04/2025 14:12, David Brown wrote:Sometimes you talk a lot of bollocks.On 23/04/2025 22:49, bart wrote:>>Such libraries as I mentioned for embedded languages or syntax wrapping are clever, but usually impractical, unwieldy and inefficient.>
And as usual, I question your basis for making such wild general claims.
>>>
If you want a new language, do it properly!
Let's compare alternatives here. If I want to make a little bit of embedded language, with C macros I have :
>
+ The implementation is in a language I already know
No. It is in the C preprocessor language. It is quite different from C and requires special skills.
C compilers used to vary quite a bit in how macro expansions were done. Now there is less variance, maybe because they're sharing the one implementation that got it just right.Some will need a particular compiler or version because they rely on some very specific behaviour.There is almost nothing compiler-specific about pre-processor directives. I only know of two very minor extensions that gcc supports, for marginally nicer variadic macro support. Of course the result of the macro expansion might be compiler-specific, just like any other C code you write without macros.
You're trying to avoid agreeing with me, that C files containing constructs that emulate different syntax or different language elements, are going to be confusing.It will also be incredibly confusing for someone looking at a source file with a .c extension.I am not personally a fan of things like these macro packages - I'd rather just use C++. But it's a matter of choice. Even if you could argue that packages like "datatype99" are objectively bad in some sense (and you can't argue that), it would only be an argument against that use of macros, not C macros themselves or other use of them.
If your best argument against C macros is that someone wrote a Brainfuck interpreter with them and it is inefficient, then I think you should retire from the discussion.You seem to advocating using C macros to make an embedded language, given that you say:
Les messages affichés proviennent d'usenet.