* New to ada, a few questions @ 2002-08-05 18:07 Stephane Jolicoeur 2002-08-05 20:38 ` Jim Rogers 2002-08-05 23:56 ` Keith Thompson 0 siblings, 2 replies; 8+ messages in thread From: Stephane Jolicoeur @ 2002-08-05 18:07 UTC (permalink / raw) Cc: s.jol *** post for FREE via your newsreader at post.newsfeed.com *** Hello, I am a strong python programmer that is looking for a compiled language to complement my tool chest. I tried C but those pointers are an annoyance, I tried C++ but there to the pointers and it's OO weirdness kicked in. Then I stumbled on an Ada tutorial, I dislike the Pascal-like coding style but there seems to be no pointer and it can be compiled to native byte code ! I would like to know, what good books are there for learning ada ( some sort of tutorial/reference book). How "fast" is compiled Ada code by this I mean is it like C/C++ or more like Java? I read that it is possible to interface Ada with C? How is this done? Can I use say stdio.h in an Ada program? How about interfacing with C++ or objective C? Are there any GUI librairies (windows, BSD, Mac OS X)? Has any Ada compiler been made to compile code for microcontrollers ( PIC, 68hc11, etc )? How does the threading work? I think this should suffice for a first post. Best Regards Stephane -----= Posted via Newsfeed.Com, Uncensored Usenet News =----- http://www.newsfeed.com - The #1 Newsgroup Service in the World! -----== 100,000 Groups! - 19 Servers! - Unlimited Download! =----- ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: New to ada, a few questions 2002-08-05 18:07 New to ada, a few questions Stephane Jolicoeur @ 2002-08-05 20:38 ` Jim Rogers 2002-08-05 22:27 ` akhar 2002-08-05 23:56 ` Keith Thompson 1 sibling, 1 reply; 8+ messages in thread From: Jim Rogers @ 2002-08-05 20:38 UTC (permalink / raw) Stephane Jolicoeur wrote: > *** post for FREE via your newsreader at post.newsfeed.com *** > > Hello, > I am a strong python programmer that is looking for a compiled language to > complement my tool chest. I tried C but those pointers are an annoyance, I > tried C++ but there to the pointers and it's OO weirdness kicked in. Then I > stumbled on an Ada tutorial, I dislike the Pascal-like coding style but > there seems to be no pointer and it can be compiled to native byte code ! > I would like to know, what good books are there for learning ada ( some > sort of tutorial/reference book). How "fast" is compiled Ada code by this I > mean is it like C/C++ or more like Java? I read that it is possible to > interface Ada with C? How is this done? Can I use say stdio.h in an Ada > program? How about interfacing with C++ or objective C? Are there any GUI > librairies (windows, BSD, Mac OS X)? Has any Ada compiler been made to > compile code for microcontrollers ( PIC, 68hc11, etc )? How does the > threading work? I think this should suffice for a first post. > First the short answer: visit www.adapower.com for Ada online books and tutorials. More detailed answers follow: * Ada code is as fast as C or C++ code. * Ada provides calling conventions and several useful conversions for calling functions compiled in C. You cannot use stdio.h in Ada. Ada does not understand C source syntax, and Ada has no standard preprocessor. * Interfacing with C++ or objective C is possible. The simplest way is to treat them both as C programs. More complex approaches are somewhat compiler specific. * There are several GUI bindings for Ada. The GtkAda binding is very useful and portable. * Ada is available for embedded systems, but not for 8 bit microcontrollers. * Ada "threading" works very well. It is actually defined in the more general terms of concurrent programming, and is often implemented using threads. Compared to Java, Ada's concurrency model is extremely robust and sophisticated. I hope you have pleasant experiences learning Ada. Jim Rogers ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: New to ada, a few questions 2002-08-05 20:38 ` Jim Rogers @ 2002-08-05 22:27 ` akhar 2002-08-05 22:33 ` chris.danx ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: akhar @ 2002-08-05 22:27 UTC (permalink / raw) > * Ada provides calling conventions and several useful conversions > for calling functions compiled in C. You cannot use stdio.h in Ada. > Ada does not understand C source syntax, and Ada has no standard > preprocessor. this means I have to link to a DLL ? > * Interfacing with C++ or objective C is possible. The simplest way > is to treat them both as C programs. More complex approaches are > somewhat compiler specific. same thing here? > * Ada is available for embedded systems, but not for 8 bit microcontrollers. where ca I get more info on this? > * Ada "threading" works very well. It is actually defined in the more > general terms of concurrent programming, and is often implemented > using threads. Compared to Java, Ada's concurrency model is extremely > robust and sophisticated. Tell me more about concurrent programming, how does it interface to the OS threading model. I read this is the main reason it is used for realtime applications , but cannot find any tutorials. > I hope you have pleasant experiences learning Ada. Me too > Jim Rogers > Sephane ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: New to ada, a few questions 2002-08-05 22:27 ` akhar @ 2002-08-05 22:33 ` chris.danx 2002-08-05 23:25 ` Larry Kilgallen 2002-08-06 3:37 ` Adrian Hoe 2 siblings, 0 replies; 8+ messages in thread From: chris.danx @ 2002-08-05 22:33 UTC (permalink / raw) akhar wrote: >>* Ada provides calling conventions and several useful conversions >> for calling functions compiled in C. You cannot use stdio.h in Ada. >> Ada does not understand C source syntax, and Ada has no standard >> preprocessor. > > this means I have to link to a DLL ? no, you can write a binding to stdio functions, import them then link the object file in. How to do the link depends on the compilers involved, so you'd need to read the docs. You don't have to use stdio though, Ada has it's own io functions which are usually just as good. Try the lovelace tutorial, it's a nice introduction for someone who's already programmed before! You can find it via http://www.adapower.com Chris ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: New to ada, a few questions 2002-08-05 22:27 ` akhar 2002-08-05 22:33 ` chris.danx @ 2002-08-05 23:25 ` Larry Kilgallen 2002-08-06 3:37 ` Adrian Hoe 2 siblings, 0 replies; 8+ messages in thread From: Larry Kilgallen @ 2002-08-05 23:25 UTC (permalink / raw) In article <n9C39.216$PE6.18962@wagner.videotron.net>, "akhar" <akhar@videotron.ca> writes: >> * Ada provides calling conventions and several useful conversions >> for calling functions compiled in C. You cannot use stdio.h in Ada. >> Ada does not understand C source syntax, and Ada has no standard >> preprocessor. > this means I have to link to a DLL ? No, but you have to compile each module with its own compiler (C or Ada) and then link them together. If you have reason to prefer to use some mechanism like a DLL/Shared Object/Shareable image you can do that too. Ada compilers are just like any other compiler in most cases for the top-down view -- they take in text files and put out object files. >> * Interfacing with C++ or objective C is possible. The simplest way >> is to treat them both as C programs. More complex approaches are >> somewhat compiler specific. > same thing here? Same thing as what ? >> * Ada is available for embedded systems, but not for 8 bit > microcontrollers. > where ca I get more info on this? Try http://www.adapower.com >> * Ada "threading" works very well. It is actually defined in the more >> general terms of concurrent programming, and is often implemented >> using threads. Compared to Java, Ada's concurrency model is extremely >> robust and sophisticated. > Tell me more about concurrent programming, how does it interface to the OS > threading model. I read this is the main reason it is used for realtime > applications , but cannot find any tutorials. If your OS has a threading model, it interfaces to it in any fashion that can achieve the specified behavior from the Ada Reference Manual, but typically it is better to learn this from a textbook. There are Ada compilers that depend entirely on OS services for their tasking, and there are Ada compilers that are entirely independent of OS tasking services. The emphasis in Ada is that your source code is portable between various operating systems and various compilers on those operating systems because your tasking/threading/multiprogramming support is a guarantee from the Ada implementation without you having to be concerned with how to deal with the operating system. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: New to ada, a few questions 2002-08-05 22:27 ` akhar 2002-08-05 22:33 ` chris.danx 2002-08-05 23:25 ` Larry Kilgallen @ 2002-08-06 3:37 ` Adrian Hoe 2 siblings, 0 replies; 8+ messages in thread From: Adrian Hoe @ 2002-08-06 3:37 UTC (permalink / raw) akhar wrote: >>* Ada provides calling conventions and several useful conversions >> for calling functions compiled in C. You cannot use stdio.h in Ada. >> Ada does not understand C source syntax, and Ada has no standard >> preprocessor. >> > this means I have to link to a DLL ? > > >>* Interfacing with C++ or objective C is possible. The simplest way >> is to treat them both as C programs. More complex approaches are >> somewhat compiler specific. >> > same thing here? > > >>* Ada is available for embedded systems, but not for 8 bit >> > microcontrollers. > where ca I get more info on this? > > >>* Ada "threading" works very well. It is actually defined in the more >> general terms of concurrent programming, and is often implemented >> using threads. Compared to Java, Ada's concurrency model is extremely >> robust and sophisticated. >> > Tell me more about concurrent programming, how does it interface to the OS > threading model. I read this is the main reason it is used for realtime > applications , but cannot find any tutorials. > > >>I hope you have pleasant experiences learning Ada. >> > Me too > > >>Jim Rogers >> >> > > Sephane > > > For a list of books, visit http://adrianhoe.com. -- type Dmitry is new Adrian; -- Adrian Hoe -- http://adrianhoe.com -- Remove *nospam* to email ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: New to ada, a few questions 2002-08-05 18:07 New to ada, a few questions Stephane Jolicoeur 2002-08-05 20:38 ` Jim Rogers @ 2002-08-05 23:56 ` Keith Thompson 2002-08-06 2:31 ` David C. Hoos, Sr. 1 sibling, 1 reply; 8+ messages in thread From: Keith Thompson @ 2002-08-05 23:56 UTC (permalink / raw) Stephane Jolicoeur <s.jol@jol-tech.net> writes: > *** post for FREE via your newsreader at post.newsfeed.com *** > > Hello, > I am a strong python programmer that is looking for a compiled language to > complement my tool chest. I tried C but those pointers are an annoyance, I > tried C++ but there to the pointers and it's OO weirdness kicked in. Then I > stumbled on an Ada tutorial, I dislike the Pascal-like coding style but > there seems to be no pointer and it can be compiled to native byte code ! > I would like to know, what good books are there for learning ada ( some > sort of tutorial/reference book). How "fast" is compiled Ada code by this I > mean is it like C/C++ or more like Java? I read that it is possible to > interface Ada with C? How is this done? Can I use say stdio.h in an Ada > program? How about interfacing with C++ or objective C? Are there any GUI > librairies (windows, BSD, Mac OS X)? Has any Ada compiler been made to > compile code for microcontrollers ( PIC, 68hc11, etc )? How does the > threading work? I think this should suffice for a first post. Ada does have pointers; it calls them access types. They're not needed nearly as often as they are in C. For example, if you want to pass a parameter by reference, you just pass it; there's no need to use a pointer type. Array types are array types. The bounds of an array are fixed when the object is created, but they can be determined at run time; again, there's no need to use pointers. Even when you do use pointers, it's much easier to do so safely. Pointer arithmetic, a major source of undefined behavior in C, is not built into the language, and is almost never necessary. <metaphor>Of course you can shoot yourself in the foot, but it's harder to do so; the safety is on by default and you have to say "I want to turn off the safety now, and I know it's dangerous." before you disable it.</metaphor> No, you can't use <stdio.h> directly (Ada doesn't grok C syntax), but Ada does have good facilities for interfacing to other languages, with predefined support for C, Fortran, and Cobol, and compiler-specific support for C++. Of course, Ada has its own I/O packages, so there's seldom any need to interface to the facilities defined in <stdio.h>. -- Keith Thompson (The_Other_Keith) kst@cts.com <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst> Schroedinger does Shakespeare: "To be *and* not to be" ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: New to ada, a few questions 2002-08-05 23:56 ` Keith Thompson @ 2002-08-06 2:31 ` David C. Hoos, Sr. 0 siblings, 0 replies; 8+ messages in thread From: David C. Hoos, Sr. @ 2002-08-06 2:31 UTC (permalink / raw) ----- Original Message ----- From: "Keith Thompson" <kst@cts.com> Newsgroups: comp.lang.ada To: <comp.lang.ada@ada.eu.org> Sent: August 05, 2002 6:56 PM Subject: Re: New to ada, a few questions > Stephane Jolicoeur <s.jol@jol-tech.net> writes: > > *** post for FREE via your newsreader at post.newsfeed.com *** > > > > Hello, > > I am a strong python programmer that is looking for a compiled language to > > complement my tool chest. I tried C but those pointers are an annoyance, I > > tried C++ but there to the pointers and it's OO weirdness kicked in. Then I > > stumbled on an Ada tutorial, I dislike the Pascal-like coding style but > > there seems to be no pointer and it can be compiled to native byte code ! > > I would like to know, what good books are there for learning ada ( some > > sort of tutorial/reference book). How "fast" is compiled Ada code by this I > > mean is it like C/C++ or more like Java? I read that it is possible to > > interface Ada with C? How is this done? Can I use say stdio.h in an Ada > > program? How about interfacing with C++ or objective C? Are there any GUI > > librairies (windows, BSD, Mac OS X)? Has any Ada compiler been made to > > compile code for microcontrollers ( PIC, 68hc11, etc )? How does the > > threading work? I think this should suffice for a first post. > > Ada does have pointers; it calls them access types. They're not > needed nearly as often as they are in C. For example, if you want to > pass a parameter by reference, you just pass it; there's no need to > use a pointer type. Array types are array types. The bounds of an > array are fixed when the object is created, but they can be determined > at run time; again, there's no need to use pointers. Even when you do > use pointers, it's much easier to do so safely. Pointer arithmetic, a > major source of undefined behavior in C, is not built into the > language, If pointer arithic is not built into the language, how do you explain paragraph B.3.2 (1) which says: 1 The generic package Interfaces.C.Pointers allows the Ada programmer to perform C-style operations on pointers. It includes an access type Pointer, Value functions that dereference a Pointer and deliver the designated array, several pointer arithmetic operations, and �copy� procedures that copy the contents of a source pointer into the array designated by a destination pointer. As in C, it treats an object Ptr of type Pointer as a pointer to the first element of an array, so that for example, adding 1 to Ptr yields a pointer to the second element of the array. > and is almost never necessary. <metaphor>Of course you can > shoot yourself in the foot, but it's harder to do so; the safety is on > by default and you have to say "I want to turn off the safety now, and > I know it's dangerous." before you disable it.</metaphor> > > No, you can't use <stdio.h> directly (Ada doesn't grok C syntax), but > Ada does have good facilities for interfacing to other languages, with > predefined support for C, Fortran, and Cobol, and compiler-specific > support for C++. Of course, Ada has its own I/O packages, so there's > seldom any need to interface to the facilities defined in <stdio.h>. > > -- > Keith Thompson (The_Other_Keith) kst@cts.com <http://www.ghoti.net/~kst> > San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst> > Schroedinger does Shakespeare: "To be *and* not to be" > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada > > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-08-06 3:37 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-08-05 18:07 New to ada, a few questions Stephane Jolicoeur 2002-08-05 20:38 ` Jim Rogers 2002-08-05 22:27 ` akhar 2002-08-05 22:33 ` chris.danx 2002-08-05 23:25 ` Larry Kilgallen 2002-08-06 3:37 ` Adrian Hoe 2002-08-05 23:56 ` Keith Thompson 2002-08-06 2:31 ` David C. Hoos, Sr.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox