tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Basic patch for passing W9X short DOS paths to TCC.


From: lostgallifreyan
Subject: Re: [Tinycc-devel] Basic patch for passing W9X short DOS paths to TCC.
Date: Wed, 15 Apr 2009 15:07:15 +0100

grischka <address@hidden> wrote:
(15/04/2009 14:50)

>
>lostgallifreyan wrote:
>> Joshua Phillips <address@hidden> wrote:
>> (15/04/2009 13:46)
>> 
>>> stricmp or strcasecmp would be provided by the C library. Tcc is only a 
>>> compiler - it doesn't include a C library. Therefore, the presence of 
>>> stricmp 
>>> or strcasecmp will be determined by the C library you're using (GNU libc or 
>>> MSVCRT or other)
>>>
>> 
>> Ok, that makes sense, but if it were only the library that determines what's 
>> there, TCC might compile C++. As it doesn't I assume it's not just the 
>> library that determines this.
>> (That remark is based in my possibly erroneous assumption that C++ is a kind 
>> of superset of C with a lot more dedicated functions).
>> In short, doesn't the compiler have to 'understand' what it's compiling?
>
>In short, yes and no.  The initial vocabulary (keywords) of a
>C compiler is rather small:
>
>      char short int long float double enum void
>      signed unsigned
>      typedef struct union sizeof
>      const extern static
>      if else while do for
>      continue break goto return switch case default
>
>And some others.  The complete list for TCC is in "tcctok.h".
>
>A C++ compiler knows a few additional keywords, like
>      bool class new delete
>      ...
>
>However the compiler "learns" more words as it reads the include
>files and the program text.  E.g. with TinyCC it learns "pstrcat"
>and "dynarray_add" and "put_ext_sym2" and whatnot.
>
>It learns enough about these words to speak them, but it doesn't
>understand their meaning.  It understands the meaning of its own
>keywords though.
>

Nice description. I'll start exploring those as well as working through that 
tutorial (which itself is interesting because some things in that have to be 
modified to work, which means I look deeply there too). I like Lua because it 
has a small and powerful vocabulary. If I can write C in a similar spirit I 
might take to it better than I thought I would. As in Lua, I'll probably end up 
writing my own general functions in the simplest terms, and building up from 
that. If nothing else, it's nice to be able to choose function and variable 
names with a low risk of collision. >:)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]