Page 2 of 2

Re:Programming language features

Posted: Wed Nov 06, 2002 6:49 pm
by grey wolf
Christoph, i'm quite at a loss as to why you would need anything that any particular language doesn't provide. C++ seems to have all it needs for coding major applications, rebol has all it needs for network-oriented scripting applications, ruby has all it needs to be functionally equivalent to nearly all other scripting languages....

if you need to use one obscure and (extremely) rarely-used feature of some extremely obscure language, why do you need to create (or modify) a language that includes those features? after all, such features are so uncommon as it is.

Re:Programming language features

Posted: Wed Nov 06, 2002 7:11 pm
by creichen
Hi,
grey wolf wrote: Christoph, i'm quite at a loss as to why you would need anything that any particular language doesn't provide. C++ seems to have all it needs for coding major applications, rebol has all it needs for network-oriented scripting applications, ruby has all it needs to be functionally equivalent to nearly all other scripting languages....
Well, C++ doesn't really have a decent type system, so its usefulness for large-scale applications is somewhat debatable (the fact that large programs have been created in C++ should be contrasted with the general quality of today's software, which, compared to the products of any other discipline considered to be an engineering one, is still, at the very least, embarassing).

As far as Rebol and other special-purpose programming languages are concerned, my general perception has been that these languages in general just provide convenient syntactic sugar for things that other languages would put into libraries (possibly hiding them behind some unwieldly generic syntax).
grey wolf wrote: if you need to use one obscure and (extremely) rarely-used feature of some extremely obscure language, why do you need to create (or modify) a language that includes those features? after all, such features are so uncommon as it is.
That doesn't mean it's not useful now or in the future. Imagine suggesting networked objects to someone twenty years ago-- you would've been laughed at.

Don't get me wrong-- I don't want to change or come up with new languages at this point, I just want to examine a couple of language features from a mathematical point of view in my thesis, and try to see how they can (semantically) interact. That's why I'm looking for fresh ideas here-- networked objects, serialization, exceptions, continuations, side effects and slicing all give a lot of motivation for this kind of work, but there may be lots of useful things I'm missing.


-- Christoph

Re:Programming language features

Posted: Thu Nov 07, 2002 8:41 pm
by grey wolf
well, C/C++ wasn't exactly designed with RTTI in mind. it was just meant to give you hardware. :)

good luck on your thesis. i wish i could give helpful input.

Re:Programming language features

Posted: Sun Nov 10, 2002 8:30 pm
by Tom
hmmm this is not about the thread exactly but I found somthing funny about C/C++

when you define:

#define PRN printf("Hello\n"); // see that ';'?

you can type in:

PRN // No Semi-Colen!!! with no errors!

but I think that'd be the source of bugs and mis-types and bad habits. I think that C/C++ should have a protection about that so errors are less.

Is that off-thread or i'm never going to understand what you mean and I shouldn't even post in this thread? ::) ??? :-[ :o

Re:Programming language features

Posted: Mon Nov 11, 2002 5:03 am
by Schol-R-LEA
Tom wrote: hmmm this is not about the thread exactly but I found somthing funny about C/C++

when you define:

#define PRN printf("Hello\n"); // see that ';'?

you can type in:

PRN // No Semi-Colen!!! with no errors!

but I think that'd be the source of bugs and mis-types and bad habits. I think that C/C++ should have a protection about that so errors are less.

Is that off-thread or i'm never going to understand what you mean and I shouldn't even post in this thread? ::) ??? :-[ :o
Well, one thing you have to keep in mind is that, while it is defined alogn with C in the ANSI standard, the preprocessor is {i}not{/i] a part of the language proper. The preprocessor is just what the name implies: a tool which processes parts of the source code, making changes to it, before the text is sent to the compiler. Except for the #pragma statements (which change the option switches sent to the C compiler) , every preprocessor directive has the effect of adding, replacing or removing text in the C source code.

In the case of [tt]#define[/tt] statements, what they do is replace the defined label with the exact text that follows (except comments, which the preprocessor removes first) until the end of the line - since they are not C statements themselves, [tt]#define[/tt]s are not closed by semi-colons. (In the case of macros, the parameter labels which appear in the defined string are first replaced with their actual arguments before te label is changed). So, when after the preprocessor is done, what the C compiler sees is

Code: Select all

printf("Hello, World!"); 
without any indication of the #define or any other preprocessor tools.

Re:Programming language features

Posted: Fri Nov 15, 2002 8:22 am
by elias
has anyone ever heard of c--? ive only seen one mention of it somewhere, and i forget the source. its supposd to be lower level than c, but higher than asm. but id like a compiler that lets you write in c or c++, but you can inculde a block
asm{
//code here
}
and it would compile that asm code. i think gcc can do this, but i HATE AT&T assembly syntax. i think its so ugly. nasm syntax is nice and clean, and id like a compiler that lets you do wat i said above using nasm sytanx

Re:Programming language features

Posted: Fri Nov 15, 2002 12:58 pm
by creichen
Hi,
elias wrote: has anyone ever heard of c--? ive only seen one mention of it somewhere, and i forget the source. its supposd to be lower level than c, but higher than asm.
Found the link on Simon Peyton-Jones HP: http://www.cminusminus.org/.

-- Christoph