Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #142604

Re: C Translator

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: C Translator
Date 2019-03-29 20:02 +0000
Organization A noiseless patient Spider
Message-ID <87lg0xbg9y.fsf@bsb.me.uk> (permalink)
References (1 earlier) <xfdnE.427090$0_.110498@fx19.am4> <lnk1gia152.fsf@kst-u.example.com> <DufnE.1219230$OGY.973445@fx08.am4> <87y34yc67j.fsf@bsb.me.uk> <MKnnE.266499$kh.234296@fx27.am4>

Show all headers | View raw


Bart <bc@freeuk.com> writes:

> On 29/03/2019 10:42, Ben Bacarisse wrote:
>> Bart <bc@freeuk.com> writes:
>
>>> If it isn't, then because none is static, at least one needs to have
>>> 'extern'.
>>
>> No.  You could find out what's needed by reading the language standard.
>
> You shouldn't need to delve into the standard for such basics. One
> example of usage and you should be set for both writing and reading
> code.

You shouldn't see edge case code like either.  When you do, it often
requires a definitive reference.  But I agree that C has cases that
should be more obvious than they are.  Organic growth and a long history
can do that.

> Here are how those kinds of functions are defined in one language of
> mine (although one kind has to be split, so really four categories not
> three):
>
>   local                       function F:T = ...
>   export               global function G:T = ...
>   import (same lang)                         (done via 'import' stmt)
>   import (FF)          clang  function "I":T

So why are you using C?  What is so great about C that you can't stop
using it no matter how much you hate it?

> This is how I would do it when writing C, this version split between
> header and main module (assume imports will also be shared):
>
> Header:
>   export                        T G(void);
>   import (same lang)   extern   T H(void);
>   import (FF)          X extern T I(void);  (implementation-defined X)
>
> Module:
>   local                static   T F(void);
>   ...
>   local                static   T F(void){}
>   export                        T G(void){}
>
> It's possible to have no header (each module declares what it needs).

You are shoe-horning C into your own categories.  That does not usualy
end well (for any language).  C does not have modules, imports, exports
or local functions.  It's easier to write C if you do things the C way.
I won't explain how C does all this stuff, because you either already
know or don't what to know what that is.

> The trick is have a language that is easy to explain.

You do don't you?  It's a shame it is not popular, but you at least need
not complain about C ever again.

-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

C Translator Bart <bc@freeuk.com> - 2019-03-28 16:16 +0000
  Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 00:01 +0000
    Re: C Translator Robert Wessel <robertwessel2@yahoo.com> - 2019-03-28 20:31 -0500
    Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-03-28 19:02 -0700
      Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 02:34 +0000
        Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-29 10:58 +0100
          Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 12:47 +0000
            Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-29 14:57 +0100
              Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 14:57 +0000
                Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-29 15:08 -0700
                Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-29 15:42 -0700
              Re: C Translator scott@slp53.sl.home (Scott Lurndal) - 2019-03-29 15:16 +0000
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 15:30 +0000
                Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-29 14:47 -0700
        Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-29 10:42 +0000
          Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 11:57 +0000
            Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 13:04 +0000
            Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-29 14:58 +0100
              Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 14:29 +0000
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-29 20:06 +0000
            Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-29 20:02 +0000
              Re: C Translator Bart <bc@freeuk.com> - 2019-03-29 21:10 +0000
                Re: C Translator nobody@example.org (Scott) - 2019-03-30 04:52 +0000
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-30 11:03 +0000
                Re: C Translator nobody@example.org (Scott) - 2019-03-30 16:17 +0000
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-30 18:36 +0000
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-30 20:32 +0000
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-30 22:44 +0000
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 03:23 +0100
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 12:39 +0100
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 15:07 +0100
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 16:21 +0100
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-31 21:19 +0200
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 20:58 +0100
                Re: C Translator Ike Naar <ike@iceland.freeshell.org> - 2019-03-31 20:33 +0000
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 22:06 +0100
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 22:37 +0100
                Re: C Translator Bart <bc@freeuk.com> - 2019-03-31 23:33 +0100
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-01 02:35 +0100
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-01 11:33 +0200
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-03-31 23:54 +0200
                Re: C Translator Bart <bc@freeuk.com> - 2019-04-01 02:16 +0100
                Re: C Translator Ike Naar <ike@iceland.freeshell.org> - 2019-04-01 06:42 +0000
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-01 11:35 +0200
                Re: C Translator Bart <bc@freeuk.com> - 2019-04-01 16:54 +0100
                Re: C Translator Bart <bc@freeuk.com> - 2019-04-01 21:01 +0100
                Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-04-01 13:41 -0700
                Re: C Translator Bart <bc@freeuk.com> - 2019-04-01 22:40 +0100
                Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-04-01 16:25 -0700
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 00:50 +0100
                Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-04-01 17:45 -0700
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 11:28 +0100
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 13:18 +0200
                Re: C Translator Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-04-02 19:15 +0000
                Re: C Translator Bart <bc@freeuk.com> - 2019-04-02 21:14 +0100
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 13:28 +0100
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 10:49 +0200
                Re: C Translator Bart <bc@freeuk.com> - 2019-04-02 01:58 +0100
                Re: C Translator Keith Thompson <kst-u@mib.org> - 2019-04-01 19:13 -0700
                Re: C Translator Bart <bc@freeuk.com> - 2019-04-02 11:13 +0100
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 13:49 +0200
                Re: C Translator Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-04-02 05:15 -0700
                Re: C Translator Bart <bc@freeuk.com> - 2019-04-02 14:50 +0100
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 16:06 +0200
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 16:05 +0200
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 00:11 +0100
                Re: C Translator David Brown <david.brown@hesbynett.no> - 2019-04-02 10:35 +0200
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-04-02 00:06 +0100
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 21:36 +0100
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-31 16:32 +0100
              Re: C Translator Bart <bc@freeuk.com> - 2019-03-30 00:37 +0000
                Re: C Translator Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-30 01:00 +0000
                Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-30 03:37 -0700
                Re: C Translator fir <profesor.fir@gmail.com> - 2019-03-30 06:15 -0700
        Re: C Translator James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-03-29 07:49 -0700

csiph-web