comp.lang.ada
 help / color / mirror / Atom feed
* Suitability of Ada as a general-purpose language
@ 2012-07-30 11:43 Dufr
  2012-07-30 12:12 ` Patrick
                   ` (7 more replies)
  0 siblings, 8 replies; 32+ messages in thread
From: Dufr @ 2012-07-30 11:43 UTC (permalink / raw)


Hi 

I have a dilemma: whether to learn Ada or Delphi/Object Pascal (I have a only Pascal background, and I wish to stick with Pascal-like languages). My target would be to write day-to-day (business, educational, etc), relatively simple desktop applications.

Since I don't need to write scientific or engineering programs, and I don't need to work in embedded systems, my fear is that using Ada may be a bit of an overkill in my case. But still, I am very much attracted to it, because Ada has a reputation for being rock solid, with good libraries, well documented, well supported, etc. I also like very much its readability.
On the other hand, Delphi/Object Pascal is probably easier (and less complicated) for my needs, and may have more development tools (though I am not sure of this).

Could you please share with me your insights regarding the pros and cons of choosing Ada in my case?

I thank you all in advance.

Dufr





^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
@ 2012-07-30 12:12 ` Patrick
  2012-07-30 12:37 ` Georg Bauhaus
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 32+ messages in thread
From: Patrick @ 2012-07-30 12:12 UTC (permalink / raw)


Hi Dufr

I like all sorts of things about Ada but one of the best features for me is the "police state" compiler. I don't have so decades of experience with C++ bug bites and Ada will help save me from some of my own errors, strong typing is great.

There are not a lot of libraries but check out GCC -fdump-ada-spec and it's sidekick -fdump-ada-spec-slim. They will help bind to C code. Ada can interface with other languages too. 

I write a skeleton of what I want in C and then bind to that instead of creating full bindings.

Please don't be discouraged with all the dead links around the net, an Ada compiler ought to be available 20 years from now. Long term, recent projects like the Boeing 787 use Ada.

There are lots of cheap used Ada books at abebooks and lots of pdf Ada books on the net

If you have any question I would love to help, although I only have 7 months with Ada myself




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
  2012-07-30 12:12 ` Patrick
@ 2012-07-30 12:37 ` Georg Bauhaus
  2012-07-30 13:27   ` Patrick
  2012-07-30 13:04 ` francois_fabien
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 32+ messages in thread
From: Georg Bauhaus @ 2012-07-30 12:37 UTC (permalink / raw)


On 30.07.12 13:43, Dufr wrote:
> On the other hand, Delphi/Object Pascal is probably easier (and less complicated) for my needs, and may have more development tools (though I am not sure of this).

I understand that there are companies owning some Delphi
skeletons in the closet, and they are looking for people
who would do the (sometimes) frustrating work of maintaining
this kind of software, or rewriting it in some language that
current management finds more appropriate. Or so that its
"architecture", if any, is discovered.

Since Delphi was cheap and more popular on Windows PCs,
I'd assume the number of Delphi jobs is higher. The implication
"He can write GUI software using language X!" and
"Therefore, he can write GUI software using language Y" is seen
as false. Please, someone correct me if I'm wrong!

Being "market-oriented", and not a brilliant engineer,
never pick Ada.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
  2012-07-30 12:12 ` Patrick
  2012-07-30 12:37 ` Georg Bauhaus
@ 2012-07-30 13:04 ` francois_fabien
  2012-07-30 13:45 ` Vasiliy Molostov
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 32+ messages in thread
From: francois_fabien @ 2012-07-30 13:04 UTC (permalink / raw)


 
> Could you please share with me your insights regarding the pros and cons of choosing Ada in my case?
> 
Pros : Modular/Strong typing/ Easy to make concurrent programming on multicore/True Portability on win-MacOS-Linux/Easy maintability because the langage is readable/Execution performance in line with the C langage.

Cons : interface with databases is somewhat messy and requires personal investment.
For a day-to-day business, I recommand GTK interface as User Interface.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 12:37 ` Georg Bauhaus
@ 2012-07-30 13:27   ` Patrick
  2012-07-30 13:45     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 32+ messages in thread
From: Patrick @ 2012-07-30 13:27 UTC (permalink / raw)







> Being "market-oriented", and not a brilliant engineer,
> 
> never pick Ada.

I am self employed so I can choose whatever language I like and I think it makes good business sense. If you have to submit to stupid employers better learn javascript and PHP



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
                   ` (2 preceding siblings ...)
  2012-07-30 13:04 ` francois_fabien
@ 2012-07-30 13:45 ` Vasiliy Molostov
  2012-07-30 13:55   ` Vasiliy Molostov
  2012-07-31 14:28   ` Marc C
  2012-07-30 14:19 ` Ludovic Brenta
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 32+ messages in thread
From: Vasiliy Molostov @ 2012-07-30 13:45 UTC (permalink / raw)


Dufr <dufriz@gmail.com> писал(а) в своём письме Mon, 30 Jul 2012 15:43:46  
+0400:

> On the other hand, Delphi/Object Pascal is probably easier (and less  
> complicated) for my needs, and may have more development tools (though I  
> am not sure of this).

You always can use not all these complicated things at once.
There is no such requirement to get all-in-one-and-immediately, I suppose.

I dont know special pros, but consider that everything in this field will  
become a pros with some time spent on it. eclipse ide (aka gnatbench)  
should be a plus also. since you referred that source code reading is  
important, I can consider that Ada has this as pros too.

cons is that you will stuck with c.l.a. also there is no nice and complete  
gui setup program to install compiler, dev-tools and additional libs.

-- 
Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 13:27   ` Patrick
@ 2012-07-30 13:45     ` Dmitry A. Kazakov
  2012-07-30 13:50       ` Patrick
  0 siblings, 1 reply; 32+ messages in thread
From: Dmitry A. Kazakov @ 2012-07-30 13:45 UTC (permalink / raw)


On Mon, 30 Jul 2012 06:27:23 -0700 (PDT), Patrick wrote:

>> Being "market-oriented", and not a brilliant engineer,
>> 
>> never pick Ada.
> 
> I am self employed so I can choose whatever language I like and I think it
> makes good business sense. If you have to submit to stupid employers
> better learn javascript and PHP

Some of our customers indeed demand Delphi, which is a legacy language for
them. As a consequence they demand monstrous Borland C++ as well.

This or that way one have to learn many languages.

But of course, if you are free to choose there is no reason not to take
Ada.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 13:45     ` Dmitry A. Kazakov
@ 2012-07-30 13:50       ` Patrick
  2012-07-30 13:55         ` Patrick
  2012-07-30 14:14         ` Dmitry A. Kazakov
  0 siblings, 2 replies; 32+ messages in thread
From: Patrick @ 2012-07-30 13:50 UTC (permalink / raw)
  Cc: mailbox

like any language you can also jut use a subset. It don't know anything about Ada Java like interfaces yet.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 13:50       ` Patrick
@ 2012-07-30 13:55         ` Patrick
  2012-07-30 14:14         ` Dmitry A. Kazakov
  1 sibling, 0 replies; 32+ messages in thread
From: Patrick @ 2012-07-30 13:55 UTC (permalink / raw)
  Cc: mailbox


> like any language you can also jut use a subset. It don't know anything about Ada Java like interfaces yet.

Forgot to mention that there are compiler directives(pragmas) to help you stick to a predefined subset. 

If you stuck to one of these you'd have Pascal but with a stronger type system.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 13:45 ` Vasiliy Molostov
@ 2012-07-30 13:55   ` Vasiliy Molostov
  2012-07-31 14:28   ` Marc C
  1 sibling, 0 replies; 32+ messages in thread
From: Vasiliy Molostov @ 2012-07-30 13:55 UTC (permalink / raw)


Vasiliy Molostov <molostoff@gmail.com> писал(а) в своём письме Mon, 30 Jul  
2012 17:45:45 +0400:

> cons is that you will stuck with c.l.a.

but in case of delphy I am afarid even imagine with which thing you will  
stuck instead,
so stuck to c.l.a. can be considered a pros too.


-- 
Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 13:50       ` Patrick
  2012-07-30 13:55         ` Patrick
@ 2012-07-30 14:14         ` Dmitry A. Kazakov
  1 sibling, 0 replies; 32+ messages in thread
From: Dmitry A. Kazakov @ 2012-07-30 14:14 UTC (permalink / raw)


On Mon, 30 Jul 2012 06:50:49 -0700 (PDT), Patrick wrote:

> like any language you can also jut use a subset. It don't know anything
> about Ada Java like interfaces yet.

One of great weaknesses of Delphi is that it is not fully OO. It were quite
possible to extend Ada in a way that all types had classes and inheritable
interfaces too with no time/memory overhead.

OO is natural progression of ADT. There is no alternative to OO for a
strongly typed language. Which does not imply that Java interfaces are any
good.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
                   ` (3 preceding siblings ...)
  2012-07-30 13:45 ` Vasiliy Molostov
@ 2012-07-30 14:19 ` Ludovic Brenta
  2012-07-30 14:34   ` Yannick Duchêne (Hibou57)
  2012-07-30 16:07 ` Ludovic Brenta
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 32+ messages in thread
From: Ludovic Brenta @ 2012-07-30 14:19 UTC (permalink / raw)


See
http://hammerprinciple.com/therighttool/items/ada/pascal

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 14:19 ` Ludovic Brenta
@ 2012-07-30 14:34   ` Yannick Duchêne (Hibou57)
  2012-07-30 15:26     ` Dufr
  0 siblings, 1 reply; 32+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2012-07-30 14:34 UTC (permalink / raw)


Le Mon, 30 Jul 2012 16:19:39 +0200, Ludovic Brenta  
<ludovic@ludovic-brenta.org> a écrit:

> See
> http://hammerprinciple.com/therighttool/items/ada/pascal
>
> --
> Ludovic Brenta.

The funniest is at the very bottom (the one which most applies to Pascal,  
with 5/5 for Pascal over Ada):

    “I often write things in this language with the
     intent of rewriting them in something else later”.

A bit too much severe with Pascal by the way; many are worst.

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 14:34   ` Yannick Duchêne (Hibou57)
@ 2012-07-30 15:26     ` Dufr
  2012-07-30 16:05       ` Patrick
                         ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Dufr @ 2012-07-30 15:26 UTC (permalink / raw)


Being stuck with c.l.a. does not seem so bad after all, given the
prompt and ovewhelming response from you guys. Thanks indeed to all of
you for your replies.

Using only a subset of the language was something that I had already
considered. After all, everyone only uses a subset of any given
language -- I doubt that anyone could fully exploit a language
functionality, practically.
However, I have not been able to make up my mind on one point: would I
have to pay a penalty in terms of performance and efficiency if I
decided to use a large language like Ada, even if only a subset of it?
My worry, which I hope you can dispel, is that the compiled code of my
(subset-)Ada program may still be less efficient in term of executable
file size and of execution speed. As I said, I hope some of you can
disprove my doubts.
Just for a reality check, how big is the executable file of the Hello
World program? (in simple text mode to standard output).

Also, would there be really so much syntax overhead (verbosity, for
one), even if I decide to use only a subset of the language (leaving
out advanced features like concurrency etc)?

Thanks again

Dufr



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 15:26     ` Dufr
@ 2012-07-30 16:05       ` Patrick
  2012-07-30 16:11       ` Georg Bauhaus
  2012-07-30 22:06       ` Brian Drummond
  2 siblings, 0 replies; 32+ messages in thread
From: Patrick @ 2012-07-30 16:05 UTC (permalink / raw)


Ada is in the same league in terms of executable size and speed to C.

the wikipedia book has a section on why hello world is so big, there are some things required to bring the size down and the computer language shootout has Ada clocked




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
                   ` (4 preceding siblings ...)
  2012-07-30 14:19 ` Ludovic Brenta
@ 2012-07-30 16:07 ` Ludovic Brenta
  2012-07-30 16:45   ` Dmitry A. Kazakov
  2012-08-01 23:57 ` Lucretia
  2012-08-06 20:52 ` gautier_niouzes
  7 siblings, 1 reply; 32+ messages in thread
From: Ludovic Brenta @ 2012-07-30 16:07 UTC (permalink / raw)


Dufr wrote on comp.lang.ada:
> Could you please share with me your insights regarding the pros
> and cons of choosing Ada in my case?

Pros of Ada relative to Pascal:
- Ada is "Pascal done right".  No dangling else problem.  Support
  for modules built into the language.  Strong typing taken to the
  extreme (type Number_Of_Apples can be declared to be incompatible
  with type Number_Of_Oranges).

- There is only one language standard and several compilers
  implementing it.  No dialects.  (TBH, not all compilers implement
  Ada 2012 yet, some are Ada 2005- or Ada 95-only).  But all versions
  of the language are 99.9% backward compatible.

- The language standard ("Ada Reference Manual") is one of very, very
  few ISO standards that are available to the public at no cost.

- Some compilers cost zero, at least one other compiler is very
  cheap.  Most others are quite expensive but they are only intended
  for embedded targets.  One compiler is Free Software: you can see
  and change the sources.  No vendor lock-in.

- comp.lang.ada.

- the culture of Ada programmers.  They chose Ada for its safety,
  against the prevailing lemming mentality.  They usually know
  several other languages.  They usually write good software. You
  can say that Ada selects the best programmers.

- the bragging factor.  When programming in Ada you can boast that you
  use the same language as TGV, nuclear power plants, satellites,
  rockets, airline carriers and air traffic control systems.  Serious
  language for serious programmers.

Cons of Ada relative to Pascal:
- object-oriented features are implemented in a way quite unique
  among programming languages.  You may have to re-learn OOP if you
  know it from another language and you may find the Ada way counter-
  intuitive.  But it works well in practice.

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 15:26     ` Dufr
  2012-07-30 16:05       ` Patrick
@ 2012-07-30 16:11       ` Georg Bauhaus
  2012-07-30 22:06       ` Brian Drummond
  2 siblings, 0 replies; 32+ messages in thread
From: Georg Bauhaus @ 2012-07-30 16:11 UTC (permalink / raw)


On 30.07.12 17:26, Dufr wrote:

> My worry, which I hope you can dispel, is that the compiled code of my
> (subset-)Ada program may still be less efficient in term of executable
> file size and of execution speed.

Why would that be? Ada was designed so that it would be good
for hard real-time systems. Responsiveness and compact code
are a must. Overhead is an enemy. Checks can be controlled.

Fewer features (of a profile/subset) may even mean a smaller
run-time system.

> Just for a reality check, how big is the executable file of the Hello
> World program? (in simple text mode to standard output).

The size of an executable will depend on whether the run-time system
is a dynamically linked library as usual, or whether you link all
of the Ada run-time system (and other libraries). A few ten KiB
in the first case.


> Also, would there be really so much syntax overhead (verbosity, for
> one), even if I decide to use only a subset of the language (leaving
> out advanced features like concurrency etc)?

An Ada subset means fewer features, but the amount of syntax adding
to its readability is not changed much. Usually, having to clearly
state their wishes as program text helps the programmers to (later)
actually understand what they have written.





^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 16:07 ` Ludovic Brenta
@ 2012-07-30 16:45   ` Dmitry A. Kazakov
  2012-07-30 18:03     ` Patrick
  0 siblings, 1 reply; 32+ messages in thread
From: Dmitry A. Kazakov @ 2012-07-30 16:45 UTC (permalink / raw)


On Mon, 30 Jul 2012 09:07:29 -0700 (PDT), Ludovic Brenta wrote:

> Cons of Ada relative to Pascal:
> - object-oriented features are implemented in a way quite unique
>   among programming languages.

If under uniqueness you understand consistency, then yes, Ada is unique in
that regard, at least among OOPLs I know.

>  You may have to re-learn OOP if you
>   know it from another language and you may find the Ada way counter-
>   intuitive.

They should learn that some things they took for granted were wrong. OO is
not the only thing Ada does right where other languages messed up. You
already mentioned Pascal syntax issues (else- and semicolon-problems etc).
It is difficult to find something that Borland Pascal does better than Ada.
Certainly, not OO. Maybe the finally-clause? Though I do not like it
either. Even the IDE is now worse comparing to the GPS.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 16:45   ` Dmitry A. Kazakov
@ 2012-07-30 18:03     ` Patrick
  2012-07-30 19:33       ` Dufr
  0 siblings, 1 reply; 32+ messages in thread
From: Patrick @ 2012-07-30 18:03 UTC (permalink / raw)
  Cc: mailbox

BTW Dufr

If it's not a secret, maybe you could tell people what sort of libraries you normally use, you might get some good pointers about using them from Ada



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 18:03     ` Patrick
@ 2012-07-30 19:33       ` Dufr
  2012-07-30 20:04         ` Patrick
                           ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Dufr @ 2012-07-30 19:33 UTC (permalink / raw)


On Jul 30, 8:03 pm, Patrick <patr...@spellingbeewinnars.org> wrote:
> BTW Dufr
>
> If it's not a secret, maybe you could tell people what sort of libraries you normally use, you might get some good pointers about using them from Ada

Actually, I have not been programming much as yet. I expect to find
the libraries that I need within the Ada userland. What I expect to
need, at this early stage, are libraries for text processing, which I
guess are available as native Ada libraries. Then I may need some
basic (client-side) email functionality, and some library that allows
me to retrieve webpages and ftp resources. Any suggestion on these?



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 19:33       ` Dufr
@ 2012-07-30 20:04         ` Patrick
  2012-08-06  9:01         ` Jacob Sparre Andersen
  2012-08-06  9:15         ` Pascal Obry
  2 siblings, 0 replies; 32+ messages in thread
From: Patrick @ 2012-07-30 20:04 UTC (permalink / raw)


hmmm. The other list members will be able to provide better answers but some quick thoughts...

I think the Ada curl binding might be out of date.  It would however be very easy to write a few functions in C and then call them from Ada and utilize CURL this way.

Perl like text processing will not be good. You could do the same for the PCRE C library as mentioned for CURl or if you want to write a real parser, Ada's rich data structures and good proformance would make this ideal.

Don't know anything about email code..

HTH 



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 15:26     ` Dufr
  2012-07-30 16:05       ` Patrick
  2012-07-30 16:11       ` Georg Bauhaus
@ 2012-07-30 22:06       ` Brian Drummond
  2012-07-31  4:19         ` Randy Brukardt
  2 siblings, 1 reply; 32+ messages in thread
From: Brian Drummond @ 2012-07-30 22:06 UTC (permalink / raw)


On Mon, 30 Jul 2012 08:26:23 -0700, Dufr wrote:

Of these two languages, I see Ada as stable or increasing in usage, and 
with better long term prospects.

> However, I have not been able to make up my mind on one point: would I
> have to pay a penalty in terms of performance and efficiency if I
> decided to use a large language like Ada, even if only a subset of it?

In performance terms you will lose nothing with Ada, and probably come 
out ahead vs Pascal. (There are probably fewer people caring about Pascal 
tools and tuning them.)

Executable size is a poor measure of efficiency; the Ada runtime system 
(RTS) provides a LOT of facilities that "Hello World" doesn't need. Any 
decent sized application will need them, whatever language it is written 
in. 

It is probably not worth crafting a specially small RTS just to make Ada 
look good on "Hello World" benchmarks! However it could be done... the 
AVR-Ada compiler for tiny embedded processors has effectively no RTS, and 
I am seeing executables of 1K or so to control two stepper motors (Arduino 
+ Motorshield).

> Also, would there be really so much syntax overhead (verbosity, for
> one), even if I decide to use only a subset of the language (leaving out
> advanced features like concurrency etc)?

Versus Pascal : not much. Versus C or Perl? A lot but it's worth it :-)

- Brian



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 22:06       ` Brian Drummond
@ 2012-07-31  4:19         ` Randy Brukardt
  2012-08-03 19:21           ` Yannick Duchêne (Hibou57)
  0 siblings, 1 reply; 32+ messages in thread
From: Randy Brukardt @ 2012-07-31  4:19 UTC (permalink / raw)


"Brian Drummond" <brian@shapes.demon.co.uk> wrote in message 
news:jv70gq$v6u$1@dont-email.me...
...
> Executable size is a poor measure of efficiency; the Ada runtime system
> (RTS) provides a LOT of facilities that "Hello World" doesn't need. Any
> decent sized application will need them, whatever language it is written
> in.

Right. We used to tell people that back in the early days of Ada, but few 
people bought that argument.

> It is probably not worth crafting a specially small RTS just to make Ada
> look good on "Hello World" benchmarks! However it could be done...

It's not really the runtime so much as to how smart the binder is at not 
including unneeded stuff. Janus/Ada has subprogram-level trimming of all Ada 
code and the entire runtime; we got executables in the 5-7K range on MS-DOS. 
For Windows, we can't do as well, because we get all kinds of cruft from the 
OS interface. But it's still reasonably small. After all, hardly any program 
uses all of the routines in Text_IO (in programs we checked, the average was 
less than 40%). Janus/Ada also trims subprograms that are primitive for 
tagged types but never called (this requires tracking dispatching calls) --  
we did that to make Claw programs have sane sizes.

The real problem is having to use system linkers, which never have the 
needed facilities (at least, not facilities that actually work). Janus/Ada 
always pre-links the Ada code in order to do proper trimming, but that adds 
a step so I understand why other compilers don't use it.

Of course, this effort is worthwhile on any program where the size is 
relevant; it's just not silly benchmarks (although its more obvious with the 
benchmarks).

                                                 Randy. 





^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 13:45 ` Vasiliy Molostov
  2012-07-30 13:55   ` Vasiliy Molostov
@ 2012-07-31 14:28   ` Marc C
  2012-08-04 14:07     ` Vasiliy Molostov
  1 sibling, 1 reply; 32+ messages in thread
From: Marc C @ 2012-07-31 14:28 UTC (permalink / raw)


On Monday, July 30, 2012 8:45:45 AM UTC-5, Vasiliy Molostov wrote:

> cons is that you will stuck with c.l.a.

Given the signal-to-noise ratio here due to the wide breadth of experienced developers that frequent this newsgroup, I'm hard-pressed to see how relying on c.l.a. for Ada assistance could be considered a "con"!

Even so, it's not the only choice. Tagging a question on StackOverflow with the "Ada" tag (http://stackoverflow.com/questions/tagged/ada) will bring it to the attention of a small cadre of experienced Ada developers. And the Ada subreddit (http://www.reddit.com/r/ada)is an ongoing source of links to Ada news, projects, and announcements.

Ada has a presence on SourceForge, GitHub, and RosettaCode, providing a rich source of Ada examples for use and learning.

There may not be as many "Ada Articles" as there are for other programming languages, but there's a lot fewer garbage articles and information.

Marc A. Criley
Ada Sub-reddit moderator



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
                   ` (5 preceding siblings ...)
  2012-07-30 16:07 ` Ludovic Brenta
@ 2012-08-01 23:57 ` Lucretia
  2012-08-06 20:52 ` gautier_niouzes
  7 siblings, 0 replies; 32+ messages in thread
From: Lucretia @ 2012-08-01 23:57 UTC (permalink / raw)


On Monday, July 30, 2012 12:43:46 PM UTC+1, Dufr wrote:

> I have a dilemma: whether to learn Ada or Delphi/Object Pascal (I have a only Pascal background, and I wish to stick with Pascal-like languages). My target would be to write day-to-day (business, educational, etc), relatively simple desktop applications.

I have and always will maintain that with Pascal you are limited as to how far you can go, standard Pascal doesn't have a lot, so you have to rely on different dialects. Whereas with Ada the language will grow as you do.

Also, even though you cannot really judge a language on the size of it's hello world program and how that size compares to other languages, I thought I'd do a test on 32-bit debian:

with ada.text_io; use ada.text_io;

procedure hello is
begin
   put_line ("hello world");
end hello;

$ /usr/bin/gnatmake -O2 hello.adb
$ ls -l hello
-rwxr-xr-x 1 laguest laguest 16563 Aug  2 00:39 hello
$ strip hello
$ ls -l hello
-rwxr-xr-x 1 laguest laguest 9128 Aug  2 00:39 hello

and then:

$ /usr/bin/gnatmake -O2 hello.adb -cargs -fdata-sections -ffunction-sections -largs -Wl,--gc-sections
$ ls -l hello
-rwxr-xr-x 1 laguest laguest 12842 Aug  2 00:43 hello
$ strip hello
$ ls -l hello
-rwxr-xr-x 1 laguest laguest 8584 Aug  2 00:43 hello

Should give you an idea.

Luke.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-31  4:19         ` Randy Brukardt
@ 2012-08-03 19:21           ` Yannick Duchêne (Hibou57)
  2012-08-03 20:21             ` Brian Drummond
  2012-08-04  2:48             ` Vasiliy Molostov
  0 siblings, 2 replies; 32+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2012-08-03 19:21 UTC (permalink / raw)


Le Tue, 31 Jul 2012 06:19:58 +0200, Randy Brukardt <randy@rrsoftware.com>  
a écrit:

> "Brian Drummond" <brian@shapes.demon.co.uk> wrote in message
> news:jv70gq$v6u$1@dont-email.me...
> ...
>> Executable size is a poor measure of efficiency; the Ada runtime system
>> (RTS) provides a LOT of facilities that "Hello World" doesn't need. Any
>> decent sized application will need them, whatever language it is written
>> in.
>
> Right. We used to tell people that back in the early days of Ada, but few
> people bought that argument.

(playing the devil's advocate)

Does that mean that “not decently sized” applications are not Ada's  
target? Then, any one can define what “decently sized” is? It's not fair  
that when a compiler fails in an aspect (an aspect which is not relevant  
to its main audience, I agree), to get the point away with pretexts.

The Hello World program here, is a place‑holder for tiny applications.  
There may be good reasons for people to expect tiny applications to have  
tiny executable images: there may be a lot of them, whose size cumulates,  
and they may be launched often for a short time, in sequence; better a  
tiny executable image here. Then, the big Hello World image can give  
people an honest enough feeling of bloating or else poor dependencies  
management capabilities.

GNAT producing big executable images for tiny applications, and GNAT  
purpose not being at producing efficient executable image for that kind of  
application, is not a reason to push that issue away.

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-08-03 19:21           ` Yannick Duchêne (Hibou57)
@ 2012-08-03 20:21             ` Brian Drummond
  2012-08-04  2:48             ` Vasiliy Molostov
  1 sibling, 0 replies; 32+ messages in thread
From: Brian Drummond @ 2012-08-03 20:21 UTC (permalink / raw)


On Fri, 03 Aug 2012 21:21:15 +0200, Yannick Duchêne (Hibou57) wrote:

> Does that mean that “not decently sized” applications are not Ada's
> target? Then, any one can define what “decently sized” is? It's not fair
> that when a compiler fails in an aspect (an aspect which is not relevant
> to its main audience, I agree), to get the point away with pretexts.
> 
> The Hello World program here, is a place‑holder for tiny applications.
> There may be good reasons for people to expect tiny applications to have
> tiny executable images: there may be a lot of them, whose size
> cumulates, and they may be launched often for a short time, in sequence;
> better a tiny executable image here. Then, the big Hello World image can
> give people an honest enough feeling of bloating or else poor
> dependencies management capabilities.
> 
> GNAT producing big executable images for tiny applications, and GNAT
> purpose not being at producing efficient executable image for that kind
> of application, is not a reason to push that issue away.

You make a good case. And I am seeing executables of under 1K on the AVR, 
so it is definitely possible (though without much library or any RTS). 
I haven't tried linker settings or "strip" or other tools to see how 
small an executable I can get on Linux. 

But reducing executable size shouldn't be something we have to work to 
achieve; the tools should do it for us. Randy points out that non-Ada 
specific tools may not be well suited to helping us...

- Brian




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-08-03 19:21           ` Yannick Duchêne (Hibou57)
  2012-08-03 20:21             ` Brian Drummond
@ 2012-08-04  2:48             ` Vasiliy Molostov
  1 sibling, 0 replies; 32+ messages in thread
From: Vasiliy Molostov @ 2012-08-04  2:48 UTC (permalink / raw)


Yannick Duchêne (Hibou57) <yannick_duchene@yahoo.fr> писал(а) в своём  
письме Fri, 03 Aug 2012 23:21:15 +0400:

> Le Tue, 31 Jul 2012 06:19:58 +0200, Randy Brukardt  
> <randy@rrsoftware.com> a écrit:

> Does that mean that “not decently sized” applications are not Ada's  
> target?

Ada main target are processors (hardware), while typical "Hello world"  
rely on console output and/or libc stdout file operations (e.g. implies  
file system operations, including mapping of errno to exceptions and the  
rest), and therefore it is for testing something about related to high  
level I/O primitives and are environment dependent. So, the test to  
establish and compare sizes of "Hello World" executable is dumb (due to  
irrelevant conclusions about result).

To get the benefit on image size a developer can restrict compiler with  
usual basic operations, e.g. to build "The Hello World program here, as a  
place‑holder for tiny applications" a developer can import I/O operations  
similar to competitors (since test environment is the same, I suppose),  
e.g. using puts(3) from libc instead of ada.text_io.put_line. In this case  
you might want to discover that these image sizes are closest to be  
similar to ones in C. With more ada related restrictions applied to ada  
compiler you can get image sizes even smaller than you can imagine.

How much Ada with gcc (e.g. GNAT) can take in image size was tested by  
Stephane Carrez
(see http://www.vacs.fr/wiki/index.php/VACS:Projects:Software:Gel - "GNU  
Ada compiler works for creation of a 256 bytes program"), obviously clear.

Regarding to Janus, on some targets its run-time is based on direct  
interfacing with environment, and the resulting image size can be even  
smaller than the same in C (where libc acts as an interface to the same  
environment).

As you can see, ada is just more flexible than C (or any other competitor)  
in building images of any desired/required size, and even makes this  
comparison incorrect and meaningless.

-- 
Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-31 14:28   ` Marc C
@ 2012-08-04 14:07     ` Vasiliy Molostov
  0 siblings, 0 replies; 32+ messages in thread
From: Vasiliy Molostov @ 2012-08-04 14:07 UTC (permalink / raw)


Marc C <mc.provisional@gmail.com> писал(а) в своём письме Tue, 31 Jul 2012  
18:28:58 +0400:

> On Monday, July 30, 2012 8:45:45 AM UTC-5, Vasiliy Molostov wrote:
>
>> cons is that you will stuck with c.l.a.
>
> Given the signal-to-noise ratio here due to the wide breadth of  
> experienced developers that frequent this newsgroup, I'm hard-pressed to  
> see how relying on c.l.a. for Ada assistance could be considered a "con"!

> Marc A. Criley
> Ada Sub-reddit moderator

It was a joke of course, ada is everywere for now.

-- 
Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 19:33       ` Dufr
  2012-07-30 20:04         ` Patrick
@ 2012-08-06  9:01         ` Jacob Sparre Andersen
  2012-08-06  9:15         ` Pascal Obry
  2 siblings, 0 replies; 32+ messages in thread
From: Jacob Sparre Andersen @ 2012-08-06  9:01 UTC (permalink / raw)


Dufr wrote:

> What I expect to need, at this early stage, are libraries for text
> processing, which I guess are available as native Ada libraries.

Depending on what you mean by text processing, you may find them in the
standard libraries, as a part of the GNAT libraries or as third-party
Open Source libraries.

> Then I may need some basic (client-side) email functionality, and some
> library that allows me to retrieve webpages and ftp resources.

AWS has these features included.

Greetings,

Jacob
-- 
"USA fights for the right of the individual."
"Yes.  Those of the individual George W. Bush."
                                     -- with thanks to Olfax



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 19:33       ` Dufr
  2012-07-30 20:04         ` Patrick
  2012-08-06  9:01         ` Jacob Sparre Andersen
@ 2012-08-06  9:15         ` Pascal Obry
  2 siblings, 0 replies; 32+ messages in thread
From: Pascal Obry @ 2012-08-06  9:15 UTC (permalink / raw)
  To: Dufr


Dufr,

> Actually, I have not been programming much as yet. I expect to find
> the libraries that I need within the Ada userland. What I expect to
> need, at this early stage, are libraries for text processing, which I
> guess are available as native Ada libraries.

Ada.Text_IO.*
Ada.Strings.*

GNAT.AWK
GNAT.Regexp
GNAT.Regpat
GNAT.Spitbol.*

> Then I may need some
> basic (client-side) email functionality, 

AWS.SMTP.*

> and some library that allows
> me to retrieve webpages 

AWS.Client.*

> and ftp resources. Any suggestion on these?

Don't know for ftp.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Suitability of Ada as a general-purpose language
  2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
                   ` (6 preceding siblings ...)
  2012-08-01 23:57 ` Lucretia
@ 2012-08-06 20:52 ` gautier_niouzes
  7 siblings, 0 replies; 32+ messages in thread
From: gautier_niouzes @ 2012-08-06 20:52 UTC (permalink / raw)


Hello,

Coming from Borland Pascal, the ancestor of Delphi (long time ago :-) ), and other Pascal dialects, I'd say the main improvement with Ada is safety in terms of long-term development. As your code base is growing, you want to know that your code base will survive jumps like a compiler change or an architecture change (like Windows 32 bits to 64 bits, or Windows to Linux, or ...).
There is a comparison (not 100% up-to-date) here http://p2ada.sf.net/pascada.htm

Business, desktop applications ? Sure! It's my day job. And here is a company doing /only/ that: http://konad.de/english.htm . There are probably other Ada shops like that. Anyone ?

Cheers
Gautier



^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2012-08-13  9:03 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 11:43 Suitability of Ada as a general-purpose language Dufr
2012-07-30 12:12 ` Patrick
2012-07-30 12:37 ` Georg Bauhaus
2012-07-30 13:27   ` Patrick
2012-07-30 13:45     ` Dmitry A. Kazakov
2012-07-30 13:50       ` Patrick
2012-07-30 13:55         ` Patrick
2012-07-30 14:14         ` Dmitry A. Kazakov
2012-07-30 13:04 ` francois_fabien
2012-07-30 13:45 ` Vasiliy Molostov
2012-07-30 13:55   ` Vasiliy Molostov
2012-07-31 14:28   ` Marc C
2012-08-04 14:07     ` Vasiliy Molostov
2012-07-30 14:19 ` Ludovic Brenta
2012-07-30 14:34   ` Yannick Duchêne (Hibou57)
2012-07-30 15:26     ` Dufr
2012-07-30 16:05       ` Patrick
2012-07-30 16:11       ` Georg Bauhaus
2012-07-30 22:06       ` Brian Drummond
2012-07-31  4:19         ` Randy Brukardt
2012-08-03 19:21           ` Yannick Duchêne (Hibou57)
2012-08-03 20:21             ` Brian Drummond
2012-08-04  2:48             ` Vasiliy Molostov
2012-07-30 16:07 ` Ludovic Brenta
2012-07-30 16:45   ` Dmitry A. Kazakov
2012-07-30 18:03     ` Patrick
2012-07-30 19:33       ` Dufr
2012-07-30 20:04         ` Patrick
2012-08-06  9:01         ` Jacob Sparre Andersen
2012-08-06  9:15         ` Pascal Obry
2012-08-01 23:57 ` Lucretia
2012-08-06 20:52 ` gautier_niouzes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox