Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Differences between C and Tandem C

1,053 views
Skip to first unread message

Varun Vallapu

unread,
Oct 1, 2014, 2:30:17 AM10/1/14
to
Hi All,

First of I am really sorry if you guys think my question silly.

As I am a novice Tandem developer, I would like to the differences between C and Tandem C.

In some manual I read that we would need to user #include<stdioh> instead of #include<stdio.h> and I under that GCC compiler is used in Tandem but TNS compiler used to compile C programs on Tandem.

Please can anyone help me out with this. Any write up or notes is also a great help.


Thanks in advance.

Varun

Keith Dick

unread,
Oct 1, 2014, 7:00:21 AM10/1/14
to
You do not have to write the header file name as stdioh -- the Guardian filesystem does name the file stdioh, but the C compiler on NonStop will transform stdio.h to stdioh when you are compiling in the Guardian environment, so you don't have to change the names in the #include statements. If you want to look at a header file in the editor, you need to use the nonstandard form of the name, but not in #include statements.

You are misinformed that the gcc compiler is used on the NonStop system. There are the old TNS C compiler that produces the CISC code for the original Tandem TNS architecture, the new nmc compiler that produces RISC code for the NonStop systems that use MIPS CPUs, and the newer ccomp compiler that produces native EPIC code for the NonStop systems that use the Itanium CPUs. None of them are gcc. The nmc and ccomp compilers implement the C standard a bit better than the old TNS compiler does, and someone might have compared them to gcc in that regard, but they are not gcc.

You can get the C/C++ Programmer's Guide online by going to http://www.hp.com/go/nonstop-docs, then clicking on the link for J-series systems, then entering the manual title in the SECOND text box at the top of the page. Chapter 1 of that manual contains extensive description of the various compilers available for the NonStop system. Reading that chapter probably will make the situation more clear to you, but if you still have questions after reading it, post your questions here, and someone probably will answer them.

Unless there is a strong reason for using the old TNS compiler, you would find it much better to use the native-mode compiler appropriate for your system. The performance of compute-bound programs will be much better with the native-mode compiler than with the TNS C compiler, but most real programs on NonStop are not compute-bound, so the performance isn't the main point. The main point is that the native-mode compilers support standard C much better.

Shiva

unread,
Oct 1, 2014, 2:57:35 PM10/1/14
to
@Varun: #INCLUDE difference is correctly pointed out by Keith. But other than that there are a few differences here and there. Mainly if you are good at C, you would not find programming C on tandem very difficult. You will definitely encounter lot of errors but there are clear descriptions for them so that you can rectify them. I don't remember the differences distinctly; but there's not much. But I can guarantee you that you can't run a code that has been compiled without errors in your windows PC using a GCC compiler. Your tandem compiler will produce errors of its own.

And like Keith has pointed out, there are three compilers at a higher level. TNS, TNS-R, TNS-E. TNS-E being the latest producing 800 code object. They carry a lot of improvement over TNS compiler, (the following point is only to be considered if you deal with multi version tandem servers as a whole and need to move object code from one to other) but they also make the 'object' unportable to some servers where 800 code is not supported, so in that case TNS compiler would be your go-to. Trust me, when you're moving over multiple versions of tandem servers, you're bound to lose your source code and in that case it is always best to carry portable code - though it brings in the disadvantage of being abled to do less, but enough.

If you need any help or assistance regarding C programming on Tandem, feel free to post here. I've done some hard yards learning this by doing them wrong. So you can find help here always. :)

Varun Vallapu

unread,
Oct 2, 2014, 1:44:19 AM10/2/14
to
Thanks both of you. Keith you gave a real good lead to know about Tandem C. As you said I read the first chapter of C/C++ Manual and understood that HP has added many features to C so that writing C programming is more useful.

Do you have any example program or any notes about writing Falut-Tolerant processing using active backup programming model.

Keith Dick

unread,
Oct 2, 2014, 11:43:55 AM10/2/14
to
The manual Guardian Programmer's Guide has a chapter titled Fault-tolerant Programming in C. I have not looked at it to see how well it covers the topic. There might be other documentation about fault-tolerant programming in C, maybe a white paper or other documentation not in a normal manual, but if such exists, I'm not aware of it. Maybe someone else knows of other documentation.

Varun Vallapu

unread,
Oct 2, 2014, 3:06:17 PM10/2/14
to
Thanks Keith .. I will go through the Guardian Programmer's Guide and get back to this form if I have any queries.

I come to know about few interesting points about Tandem C after reading few pages of C/C++ Manual :)

Keith Dick

unread,
Oct 2, 2014, 6:50:31 PM10/2/14
to
Shiva wrote:
> @Varun: #INCLUDE difference is correctly pointed out by Keith. But other than that there are a few differences here and there. Mainly if you are good at C, you would not find programming C on tandem very difficult. You will definitely encounter lot of errors but there are clear descriptions for them so that you can rectify them. I don't remember the differences distinctly; but there's not much. But I can guarantee you that you can't run a code that has been compiled without errors in your windows PC using a GCC compiler. Your tandem compiler will produce errors of its own.

You probably made a poor choice of wording in the above when you said that you can't run a program that works on a PC on the NonStop system without errors. Certainly there are some things that are accepted by gcc or other C compiler for the PC that are not accepted by the C compilers on the NonStop system, but it is not true that every program that works on a PC will not work on a NonStop system. The NMC and CCOMP compilers are noticeably more picky about data type matching and some other similar things than many other compilers are, but those usually result in warnings that may be ignored or suppressed with the WARN pragma. If you set aside those warnings, I think that a lot of programs that work on a PC will work unchanged on a NonStop system, especially if you compile them in the OSS environment. If you compile in the OSS environment but target the Guardian environment by including -Wsystype=guardian on the compile command line, a smaller number of programs will work
unchanged in the Guardian environment.
>
> And like Keith has pointed out, there are three compilers at a higher level. TNS, TNS-R, TNS-E. TNS-E being the latest producing 800 code object. They carry a lot of improvement over TNS compiler, (the following point is only to be considered if you deal with multi version tandem servers as a whole and need to move object code from one to other) but they also make the 'object' unportable to some servers where 800 code is not supported, so in that case TNS compiler would be your go-to. Trust me, when you're moving over multiple versions of tandem servers, you're bound to lose your source code and in that case it is always best to carry portable code - though it brings in the disadvantage of being abled to do less, but enough.
>
I disagree that the TNS C compiler should be used for any new programs
. It is kept around for modifying and enhancing programs that are already implemented in TNS C and are too hard to convert to native-mode C. While it is true that the TNS object files will run in the emulator on any NonStop system, I don't agree that is a strong enough advantage to outweigh using the NMC and CCOMP compilers for new programs. It is true that if you use a native-mode compiler, and if you must use the program on both TNS/R and TNS/E systems, you must compile your code twice and keep track of the two copies of the executable files, but I think it is much better using the modern compilers, not the old TNS C compiler, so the little extra work is worthwhile.

I don't think much of the argument that TNS C is good because if you lose the source code, you still could use the program on any future NonStop system. If you lose the source code for an important program, you are not running your operation in a responsible way. Most programs require some changes or enhancements from time to time, and you cannot do that if you have only the object file. Should you intentionally use a old, out-of-date compiler so that if someone is sloppy about keeping the source code safe, you still can use the unmaintainable program after the next change of CPU? That doesn't seem like the best choice to me.

> If you need any help or assistance regarding C programming on Tandem, feel free to post here. I've done some hard yards learning this by doing them wrong. So you can find help here always. :)

Yes, we are happy to answer questions and help solve problems you cannot figure out. Try to figure out things yourself first, but if you get stuck, don't spin your wheels for an unreasonably long time before asking a question here.

Shiva

unread,
Oct 5, 2014, 5:12:48 AM10/5/14
to
@Keith: Yes, you're right about the first one. That was a poor choice of words, some programs might work. Some might not. It was just part of my experience which came in as a surprise to me. So just wanted to share that information.

And about your second point, I'm not so sure. It's just that I've worked in various development areas in Tandem (though there's not much to say about my experience) - I've seen places where security and maintenance are not as comparable to the 'perfect IT environment' as we see against the mainframe and other technologies. I can't go into detail about this - but let's just say that there are many big banking sectors that have invested in Tandem for their business purposes and have failed miserably in keeping track of the code just because there was no proper version control put in place, so invariably end up losing some code and most importantly - aren't as secure as you'd expect such an environment to be. And it was not the management's decision or anything as such to compile using TNS C, but rather the programmer's choice keeping in mind the various reasons I sited above. And though I agree that this is not the best approach for any IT system, for when it comes to the developer's choice who don't have a say in keeping a version control available, this was the choice that seemed viable. Many might disagree, but again this is just a perspective. Not a rule, or a law. :)

And yes, try looking around. Don't come here without any homework - not that nobody would respond, just that you wouldn't understand even if they do, so always better to do your part. But then there are so many people here who'd help, and are immensely knowledgable.

comforte...@gmail.com

unread,
Oct 7, 2014, 4:18:27 AM10/7/14
to
On Thursday, October 2, 2014 5:43:55 PM UTC+2, Keith wrote:

>
>
> The manual Guardian Programmer's Guide has a chapter titled Fault-tolerant Programming in C. I have not looked at it to see how well it covers the topic. There might be other documentation about fault-tolerant programming in C, maybe a white paper or other documentation not in a normal manual, but if such exists, I'm not aware of it. Maybe someone else knows of other documentation.
>
>
>


The book HP NonStop for Dummies talks about fault-tolerant programming just a LITTLE bit - but I'd recommend it to get started on HP NonStop anyway [[I am one of the authors, so that makes me biased]]

In Chapter 5, there are a few links to "extensions" of the book, including "nowaited" and "NonStop" programming. While the URLs are reachable without the book, we don't plan to publish them as the idea is really to get them via the book.

What is the book - see http://www.comforte.com/resources/nonstop-for-dummies/what-is-it/

How to get the book - see http://www.comforte.com/resources/nonstop-for-dummies/ns4dummies/


Thomas

Afiz S

unread,
Oct 8, 2014, 2:47:12 PM10/8/14
to
Hi Thomas,

Thanks for sharing wonderful link. However I received a message that book is in still draft mode after I filled in my details.

Message has been deleted

Bill Honaker

unread,
Oct 9, 2014, 8:11:17 PM10/9/14
to
Herman,

CONTROL is also a third party product, from NCI.

Both are 'proper' resource management tools. Many sites don't enforce
processes and procedures to use them, but no tool available can
correct that.

On Wed, 8 Oct 2014 23:01:20 -0700 (PDT), Hemanth
<hemanth...@gmail.com> wrote:

>"let's just say that there are many big banking sectors that have invested in Tandem for their business purposes and have failed miserably in keeping track of the code just because there was no proper version control put in place"
>
>@Shiva, Well I agree that hp NonStop itself dont have any PROPER version control tool, but believe me i have seen several TACL macros can help us in building a tool, we have one tool from Hp called CONTROL which is a version control . Apart from that we have several third party tools one of them is RMS from emperex

wbreidbach

unread,
Oct 10, 2014, 3:15:04 AM10/10/14
to
Our developers have moved everything to NSDEE, which means that all the sourcecode is within the PC world and there are a bunch of tools for version control available.
In addition I created a version control program myself, based on SQL tables, which works different from CONTROL. I created small programs, at the moment for TAL, EPTAL and COBOL (no need for C yet), which invoke the compiler and in case the compilation succeeds the actual sourcecode is written to the archive. During this process the program adds a version procedure to the sourcecode so you can use VPROC to read the version from the object.
Of course it is possible to retrieve the sourcecode from the archive, the file is created with the timestamp of the original file.
I could make this stuff available to others, probably via ITUGLIB, if that makes sense.

Varun Vallapu

unread,
Oct 10, 2014, 7:29:31 AM10/10/14
to
Hi Thomas
Could you please forward the book as the link you mentioned is running out of copies.

Thanks in advance.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

comforte...@gmail.com

unread,
Oct 13, 2014, 1:54:47 AM10/13/14
to
> Hi Thomas,
>
>
>
> Thanks for sharing wonderful link. However I received a message that book is in still draft mode after I filled in my details.

Hi Afiz,

the status page (which is linked to in the reply) was out of date - that has been fixed. Please allow a bit of time for delivery of the e-book.

Thomas

comforte...@gmail.com

unread,
Oct 13, 2014, 1:55:51 AM10/13/14
to
Varun,

I do not understand what exactly is your problem. Please use http://www.comforte.com/resources/nonstop-for-dummies/feedback for any problems with getting the book and http://www.comforte.com/resources/nonstop-for-dummies/ns4dummies/ for asking for copies

Afiz S

unread,
Oct 13, 2014, 2:49:42 AM10/13/14
to
Thanks Thomas,

I have registered myself for the pdf version of the book. I'm eagerly waiting for my copy.

0 new messages