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


Groups > comp.lang.c > #72037

Re: pure c on smartphones (and other devices)

From Bartc <bc@freeuk.com>
Newsgroups comp.lang.c
Subject Re: pure c on smartphones (and other devices)
Date 2015-10-06 12:29 +0100
Organization A noiseless patient Spider
Message-ID <mv0b73$e8a$1@dont-email.me> (permalink)
References (2 earlier) <c15a2a41-c698-4fb8-8019-2d2a7d13cab2@googlegroups.com> <murd8h$gc7$1@dont-email.me> <ln1tdaxnkx.fsf@kst-u.example.com> <mut78v$dig$1@dont-email.me> <d6a4a12d-f79d-4e89-93b5-971b7f3d1ab3@googlegroups.com>

Show all headers | View raw


On 06/10/2015 11:31, Malcolm McLean wrote:
> On Monday, October 5, 2015 at 8:04:10 AM UTC+1, David Brown wrote:

>> Your trouble here, Bart, is that you
>> have long experience with Windows and are stuck in a rut.  You think the
>> "Windows way" is the /only/ right way, because it is the only way you
>> know.

(I already mentioned about my previous OSes, but the first graphics work 
I did was in 1979. Both colour raster graphics, and vector graphics 
using 4010 terminals. When did Windows appear again?)

> X is harder to code for than Windows GDI. Since I've got Baby X working on both
> systems I think I'm well qualified to comment on that.
> But both systems have points of difficulty, some of it due to legacy systems
> needing to support very constrained systems (so you have a window own the
> clipboard rather than putting stuff on it, to save memory, for example, of
> course that's a total grief to support).
> Once you've got the basic services working, then there's no difference, however.
> Most programs have what I call the algorithmic core, which should be written
> in pure, portable ANSI C, then what I call the glue code, which is the usual
> failure point of the system because it gets hacked about in response to changing
> user requirements, and then the services - code for buttons, colour pickers, and
> the like. The services section (e.g. Baby X) is where the differences lie.
>

Here I would have to disagree; I want to eliminate the C side of it as 
far as I can, and only use it where necessary.

I believe in using interpreted, dynamic code as much as possible 
(especially for anything involved in GUIs where are you waiting for user 
input most of the time).

The interfaces are also far simpler; BabyX is reasonably straightforward 
but scripting code can make it simpler still.

The way I have it is like this: suppose 'G' is the graphics/GUI API used 
by the scripting language, and 'H' is the native graphics API provided 
by the platform (ie. GDI or X Windows). 'H' will generally be vastly 
bigger and more complex than 'G'.

There will then be 3 layers of coding:

* Modules talking only to 'G' (most of the application) or implementing 
parts of 'G' that do not depend on 'H'. All this code is portable.

* Module(s) which implement core parts of 'G' and talk to 'H'

* Interface modules to 'H'.

It is these last two layers, still using interpreted bytecode, that have 
to talk to the platform's graphics API by dynamically accessing the 
shared libraries (.dll or .so). And which need to be different between 
Windows and Linux.

Where does C come into it? Well, hopefully as little as possible! There 
is the interpreter, not written in C, but for a target that my compiler 
doesn't support (anything not 64-bit Windows at the minute), then it 
will need to generate C source code and rely on a C compiler (a messy 
dependency that I can't easily get around).

But all the machine interfaces are also defined in C terms (MS says it's 
C++, but GDI uses C). I still make use of the C runtime library. Example 
code will be in C (if it's C++, then forget it). Such as your BabyX 
which I will probably pinch a few ideas from. And auxiliary programs 
such as Jpeg decoders (although I've now ported your Jpeg decoder to my 
compiled language).

(This is all why I don't always have much patience when trying to make 
use of libraries which exist as C source code, but requiring far more 
messing about with than simply compiling and linking.)

-- 
Bartc

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


Thread

pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-03 08:32 -0700
  pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-03 09:19 -0700
    Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-03 09:58 -0700
      Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-03 10:20 -0700
        Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-03 10:34 -0700
          Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-03 10:40 -0700
            Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-03 11:30 -0700
              Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-03 11:43 -0700
      Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-03 10:24 -0700
        Re: pure c on smartphones (and other devices) Johann Klammer <klammerj@NOSPAM.a1.net> - 2015-10-03 20:18 +0200
          Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-03 11:23 -0700
  Re: pure c on smartphones (and other devices) Aleksandar Kuktin <akuktin@gmail.com> - 2015-10-04 12:31 +0000
    Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-04 05:45 -0700
      Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-04 05:53 -0700
        Re: pure c on smartphones (and other devices) supercat@casperkitty.com - 2015-10-05 10:52 -0700
          Re: pure c on smartphones (and other devices) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-10-05 22:18 +0000
            Re: pure c on smartphones (and other devices) supercat@casperkitty.com - 2015-10-05 16:16 -0700
              Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-06 00:27 +0100
                Re: pure c on smartphones (and other devices) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-06 10:50 +0100
                Re: pure c on smartphones (and other devices) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-10-06 10:47 +0000
                Re: pure c on smartphones (and other devices) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-10-06 12:31 +0100
                Re: pure c on smartphones (and other devices) supercat@casperkitty.com - 2015-10-06 09:18 -0700
                Re: pure c on smartphones (and other devices) Rosario19 <Ros@invalid.invalid> - 2015-10-06 18:30 +0200
                Re: pure c on smartphones (and other devices) supercat@casperkitty.com - 2015-10-06 10:14 -0700
                Re: pure c on smartphones (and other devices) Waldek Hebisch <antispam@math.uni.wroc.pl> - 2015-10-09 18:32 +0000
                Re: pure c on smartphones (and other devices) supercat@casperkitty.com - 2015-10-09 13:02 -0700
              Re: pure c on smartphones (and other devices) glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-10-06 03:25 +0000
      Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-04 06:27 -0700
        Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-04 06:58 -0700
    Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-04 06:01 -0700
      Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-04 15:33 +0100
        Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-04 07:58 -0700
          Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-04 08:13 -0700
        Re: pure c on smartphones (and other devices) Keith Thompson <kst-u@mib.org> - 2015-10-04 15:42 -0700
          Re: pure c on smartphones (and other devices) David Brown <david.brown@hesbynett.no> - 2015-10-05 09:03 +0200
            Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-05 11:24 +0100
              Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-05 11:27 +0100
            Re: pure c on smartphones (and other devices) Keith Thompson <kst-u@mib.org> - 2015-10-05 09:29 -0700
            Re: pure c on smartphones (and other devices) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-06 03:31 -0700
              Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-06 12:29 +0100
                Re: pure c on smartphones (and other devices) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-06 07:18 -0700
                Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-06 18:33 +0100
                Re: pure c on smartphones (and other devices) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-06 11:07 -0700
                Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-07 12:53 +0100
                Re: pure c on smartphones (and other devices) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-07 06:33 -0700
                Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-07 18:21 +0100
                Re: pure c on smartphones (and other devices) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-07 19:10 -0700
  Re: pure c on smartphones (and other devices) Ayan <selfjam@gmail.com> - 2015-10-07 13:41 -0400
    Re: pure c on smartphones (and other devices) fir <profesor.fir@gmail.com> - 2015-10-07 14:01 -0700
      Re: pure c on smartphones (and other devices) Ayan <selfjam@gmail.com> - 2015-10-07 23:09 -0400
        Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-08 02:26 -0700
        Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-08 11:01 +0100
          Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-08 03:29 -0700
            Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-08 12:19 +0100
              Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-08 05:42 -0700
                Re: pure c on smartphones (and other devices) Bartc <bc@freeuk.com> - 2015-10-08 14:41 +0100
                Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-08 06:55 -0700
                Re: pure c on smartphones (and other devices) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-08 08:53 -0700
                Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-08 09:21 -0700
                Re: pure c on smartphones (and other devices) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-10-08 09:46 -0700
                Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-08 10:07 -0700
                Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-11 23:58 -0700
                Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-09 04:41 -0700
              Re: pure c on smartphones (and other devices) "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-10-08 05:59 -0700

csiph-web