comp.lang.ada
 help / color / mirror / Atom feed
* meaningfully/compellingly “advertising” Ada on StackOverflow
@ 2018-05-16 14:27 Dan'l Miller
  2018-05-16 14:35 ` Lucretia
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Dan'l Miller @ 2018-05-16 14:27 UTC (permalink / raw)


One thing to help Ada “cross the chasm” would be for each of the how-can-I-do-this-in-Ada questions posted here on c.l.a to also be posted in StackOverflow with (at least) the tag Ada.  Of course, there does exist some overlap of participants here on c.l.a with Ada participants in StackOverflow, but conversely there do exist some StackOverflow users who are knowledgable about Ada (or are genuinely-open-mindedly curious about Ada to have already explored Ada) who never or rarely visit c.l.a.

But the A#1 primary goal to accomplish regarding the posting of juicy/revealing questions about Ada code is for strangers who are full-fledged Ada-hater and Ada-agnostic and what-is-this-Ada-that-I-have-never-heard-of people to see actual Ada code that is beautiful and expressive and accomplishing real-world goals, reacting with:
1) “Oh!  Ada can do •that•?!  •That• easily?  •That• correctly?”
and
2) “Oh!  That is a whole lot more readable/safer/elegant in Ada than it would have been in C++ OO, in C++ metatemplate programming, in C, or in Java.”
and
3) “Hmmmmmmmm.  Maybe I ought to try to learn Ada a little bit (at least enough to participate meaningfully in this StackOverflow question).”

Of course, there is far less toleration over at StackOverflow for some of the lengthy free-wheeling debates that we have here at c.l.a, so questions & answers & comments over there should be a little more nose-to-the-grindstone pedagogical—fully mindful of StackOverflow's stern moderation.

Btw, I am not sure that topics that really get c.l.a's blood pumping (e.g., some corner case in Ada tasking; this-way-of-writing-Ada versus that-way-of-writing-Ada intense-conviction purist culture-dominance battles) are topics that would attract people to Ada over on StackOverflow (as opposed to scare them away from Ada).  Also, some dirty-laundry nits about potential mistakes in the ARM might always(!) be better here than over at StackOverflow.

But many of the let's-have-c.l.a.-do-my-homework-for-me category of questions probably should be cross-posted (in reworked StackOverflow-esque format) over at StackOverflow with (at least) the tag Ada to expand the size of the Ada-education audience to the wider population (and to StackOverflow's seemingly higher-up search results via search engines).

Plus the more times Ada is meaningfully mentioned in technical contexts on the WWW, the higher Ada that scores (directly or indirectly) on those perennial rankings of programming languages.  A quantifiable measure of success in this campaign would be measured by Ada moving up at least one position in any one (or all) of these popularity-of-programming-languages rankings that are always coming out (with usually C, Java, C++, and Javascript among the top positions in the ranking).  The goal is not to move Ada to the top five positions; the goal is move Ada from, say, position #22 to position #18.


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

* Re: meaningfully/compellingly “advertising” Ada on StackOverflow
  2018-05-16 14:27 meaningfully/compellingly “advertising” Ada on StackOverflow Dan'l Miller
@ 2018-05-16 14:35 ` Lucretia
  2018-05-16 15:06   ` Dan'l Miller
  2018-05-17  2:46 ` John Perry
  2018-05-18 15:43 ` meaningfully/compellingly “advertising” " John Perry
  2 siblings, 1 reply; 28+ messages in thread
From: Lucretia @ 2018-05-16 14:35 UTC (permalink / raw)


On Wednesday, 16 May 2018 15:27:12 UTC+1, Dan'l Miller  wrote:
> One thing to help Ada “cross the chasm” would be for each of the how-can-I-do-this-in-Ada questions posted here on c.l.a to also be posted in StackOverflow with (at least) the tag Ada.  Of course, there does exist some overlap of participants here on c.l.a with Ada participants in StackOverflow, but conversely there do exist some StackOverflow users who are knowledgable about Ada (or are genuinely-open-mindedly curious about Ada to have already explored Ada) who never or rarely visit c.l.a.
> 
> But the A#1 primary goal to accomplish regarding the posting of juicy/revealing questions about Ada code is for strangers who are full-fledged Ada-hater and Ada-agnostic and what-is-this-Ada-that-I-have-never-heard-of people to see actual Ada code that is beautiful and expressive and accomplishing real-world goals, reacting with:

You have to get them reading the ada tags first.


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

* Re: meaningfully/compellingly “advertising” Ada on StackOverflow
  2018-05-16 14:35 ` Lucretia
@ 2018-05-16 15:06   ` Dan'l Miller
  2018-05-16 22:48     ` Mehdi Saada
  0 siblings, 1 reply; 28+ messages in thread
From: Dan'l Miller @ 2018-05-16 15:06 UTC (permalink / raw)


On Wednesday, May 16, 2018 at 9:35:25 AM UTC-5, Lucretia wrote:
> On Wednesday, 16 May 2018 15:27:12 UTC+1, Dan'l Miller  wrote:
> > One thing to help Ada “cross the chasm” would be for each of the how-can-I-do-this-in-Ada questions posted here on c.l.a to also be posted in StackOverflow with (at least) the tag Ada.  Of course, there does exist some overlap of participants here on c.l.a with Ada participants in StackOverflow, but conversely there do exist some StackOverflow users who are knowledgable about Ada (or are genuinely-open-mindedly curious about Ada to have already explored Ada) who never or rarely visit c.l.a.
> > 
> > But the A#1 primary goal to accomplish regarding the posting of juicy/revealing questions about Ada code is for strangers who are full-fledged Ada-hater and Ada-agnostic and what-is-this-Ada-that-I-have-never-heard-of people to see actual Ada code that is beautiful and expressive and accomplishing real-world goals, reacting with:
> 
> You have to get them reading the ada tags first.

Chicken & egg problem.  But there do exist people over at StackOverflow who browse the newest-questions regardless of tags.  (That is how I first found out about Rust being far far more interesting than Go:  many of Rust's questions were compelling from a safety perspective, whereas many of  Go's questions were more in the how-do-I-write-Algol60-or-1990s-era-C++/Java-concepts-in-Go's-yet-again-different-for-no-good-reason-syntax ilk.)

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

* Re: meaningfully/compellingly “advertising” Ada on StackOverflow
  2018-05-16 15:06   ` Dan'l Miller
@ 2018-05-16 22:48     ` Mehdi Saada
  0 siblings, 0 replies; 28+ messages in thread
From: Mehdi Saada @ 2018-05-16 22:48 UTC (permalink / raw)


This time, not only could I read your entire long-winded post, but I laughed my guts out. I actually root for those debates between fanatics, even though there's much less I grasp (but there are parts I can, already). Especially the "ARM is wrong !" posts. Gives me this feeling of nerdiness I root for.

If some really have the time to dedicate into making, well, small or not so small equivalents of Ada gems, gathering them on a website seems appropriate, ain't it ?

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

* Re: meaningfully/compellingly “advertising” Ada on StackOverflow
  2018-05-16 14:27 meaningfully/compellingly “advertising” Ada on StackOverflow Dan'l Miller
  2018-05-16 14:35 ` Lucretia
@ 2018-05-17  2:46 ` John Perry
  2018-05-17  2:49   ` John Perry
  2018-05-18 15:43 ` meaningfully/compellingly “advertising” " John Perry
  2 siblings, 1 reply; 28+ messages in thread
From: John Perry @ 2018-05-17  2:46 UTC (permalink / raw)


On Wednesday, May 16, 2018 at 9:27:12 AM UTC-5, Dan'l Miller wrote:
> One thing to help Ada “cross the chasm” would be for each of the how-can-I-do-this-in-Ada questions posted here on c.l.a to also be posted in StackOverflow with (at least) the tag Ada. ...
> Plus the more times Ada is meaningfully mentioned in technical contexts on the WWW, the higher Ada that scores (directly or indirectly) on those perennial rankings of programming languages.  A quantifiable measure of success in this campaign would be measured by Ada moving up at least one position in any one (or all) of these popularity-of-programming-languages rankings that are always coming out (with usually C, Java, C++, and Javascript among the top positions in the ranking).  The goal is not to move Ada to the top five positions; the goal is move Ada from, say, position #22 to position #18.

I've been learning Ada recently for fun, and asked a couple of Ada questions on StackOverflow recently. The people who replied were really helpful.

Likewise, the Ada implementations on RosettaCode were both helpful to learn from and, back when I was visiting to look at something else, nice advertisements for the language.

I know that what follows below isn't the same, but it's related, so I hope you don't mind my mentioning it here: I came across this "Completely Unscientific Benchmark" where the guy seems halfway serious:

    github.com/frol/completely-unscientific-benchmarks

There was no Ada implementation, so I added one. It's quite a simple program: adding and removing ~10^6 nodes to a tree, and testing if the tree has a value. The Ada implementation I submitted is about as fast as the C++ implementation: he recorded it as 1.35x slower on his machine, but it still impressed him at the time as it was one of the fastest he had then.

I don't know much about Ada, and I basically implemented it by translating the C++ code to Ada, so it might be possible to improve the implementation. Things like that could be one way to improve Ada's reputation, and I'd be delighted to learn how I could have implemented it better.

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

* Re: meaningfully/compellingly “advertising” Ada on StackOverflow
  2018-05-17  2:46 ` John Perry
@ 2018-05-17  2:49   ` John Perry
  2018-05-17 21:25     ` meaningfully/compellingly "advertising" " Randy Brukardt
  0 siblings, 1 reply; 28+ messages in thread
From: John Perry @ 2018-05-17  2:49 UTC (permalink / raw)


On Wednesday, May 16, 2018 at 9:46:32 PM UTC-5, John Perry wrote:
> It's quite a simple program: adding and removing ~10^6 nodes to a tree, and testing if the tree has a value.

Argh. I knew as I was typing that that the description wasn't quite right, but I didn't think to correct it. It adds (10^6/3) nodes, attempts to delete (10^6)/3, and tests for a value in the tree (10^6)/3 times. Still, it's relatively simple.

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-17  2:49   ` John Perry
@ 2018-05-17 21:25     ` Randy Brukardt
  2018-05-17 23:27       ` Luke A. Guest
                         ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Randy Brukardt @ 2018-05-17 21:25 UTC (permalink / raw)


"John Perry" <john.perry@usm.edu> wrote in message 
news:a86dc533-a8f5-4d1c-9b4c-11d7963c6d15@googlegroups.com...
> On Wednesday, May 16, 2018 at 9:46:32 PM UTC-5, John Perry wrote:
>>> It's quite a simple program: adding and removing ~10^6 nodes to a tree, 
>>> and testing if the tree has a value.
>>
> Argh. I knew as I was typing that that the description wasn't quite right,
> but I didn't think to correct it. It adds (10^6/3) nodes, attempts to 
> delete
>(10^6)/3, and tests for a value in the tree (10^6)/3 times. Still, it's 
>relatively
> simple.

Did you try implementing that with the Tree container as opposed to using a 
raw nodes? Probably not quite as fast, but much less work to 
write/read/maintain (since the container does the storage management and 
provides most of the algorithms).

                          Randy.


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-17 21:25     ` meaningfully/compellingly "advertising" " Randy Brukardt
@ 2018-05-17 23:27       ` Luke A. Guest
  2018-05-18  1:22         ` Paul Rubin
  2018-05-18 20:42         ` Randy Brukardt
  2018-05-18  4:22       ` John Perry
  2018-05-18 11:10       ` Simon Wright
  2 siblings, 2 replies; 28+ messages in thread
From: Luke A. Guest @ 2018-05-17 23:27 UTC (permalink / raw)


Randy Brukardt <randy@rrsoftware.com> wrote:

> Did you try implementing that with the Tree container as opposed to using a 
> raw nodes? Probably not quite as fast, but much less work to 
> write/read/maintain (since the container does the storage management and 
> provides most of the algorithms).

The aim is to see how languages stack up. By using the standard containers
with their anti-tampering and other checks, you would be hobbling Ada in
this case.


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-17 23:27       ` Luke A. Guest
@ 2018-05-18  1:22         ` Paul Rubin
  2018-05-18  2:28           ` Dan'l Miller
  2018-05-18  2:57           ` Lucretia
  2018-05-18 20:42         ` Randy Brukardt
  1 sibling, 2 replies; 28+ messages in thread
From: Paul Rubin @ 2018-05-18  1:22 UTC (permalink / raw)


Luke A. Guest <laguest@archeia.com> writes:
> The aim is to see how languages stack up. By using the standard
> containers with their anti-tampering and other checks, you would be
> hobbling Ada in this case.

Ummph, the anti-tampering and other checks are part of Ada's safety
which is its main compelling feature.  If you turn them off then Ada no
longer brings any benefit compared with unsafe languages.

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  1:22         ` Paul Rubin
@ 2018-05-18  2:28           ` Dan'l Miller
  2018-05-18  2:59             ` Lucretia
  2018-05-18  2:57           ` Lucretia
  1 sibling, 1 reply; 28+ messages in thread
From: Dan'l Miller @ 2018-05-18  2:28 UTC (permalink / raw)


On Thursday, May 17, 2018 at 8:22:17 PM UTC-5, Paul Rubin wrote:
> Luke A. Guest writes:
> > The aim is to see how languages stack up. By using the standard
> > containers with their anti-tampering and other checks, you would be
> > hobbling Ada in this case.
> 
> Ummph, the anti-tampering and other checks are part of Ada's safety
> which is its main compelling feature.  If you turn them off then Ada no
> longer brings any benefit compared with unsafe languages.

Yes, I was thinking the same thing, up to a point.  Perhaps the maintainer of that repository can be persuaded that Ada deserves 2 rows for 2 different implementation tracks:
1) one design with full-fledged safety
and
2) one design with no-holds-barred anything-goes-that's-legal unchecked_*-features-galore pursuant to speed-of-execution.

It would be interesting not only comparing those 2 rows to other corresponding safe or unsafe languages, but also to each other:  Ada-purist versus Ada-ecumenical.  He seems to be emphasizing some definition of “naïve” though.  One or the other of these dual tracks for Ada might fly in the face of his definition of “naïve”.


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  1:22         ` Paul Rubin
  2018-05-18  2:28           ` Dan'l Miller
@ 2018-05-18  2:57           ` Lucretia
  2018-05-18  4:25             ` John Perry
  2018-05-18  4:37             ` Paul Rubin
  1 sibling, 2 replies; 28+ messages in thread
From: Lucretia @ 2018-05-18  2:57 UTC (permalink / raw)


On Friday, 18 May 2018 02:22:17 UTC+1, Paul Rubin  wrote:
> Luke A. Guest <> writes:
> > The aim is to see how languages stack up. By using the standard
> > containers with their anti-tampering and other checks, you would be
> > hobbling Ada in this case.
> 
> Ummph, the anti-tampering and other checks are part of Ada's safety
> which is its main compelling feature.  If you turn them off then Ada no
> longer brings any benefit compared with unsafe languages.

You don't get the point I made. That "benchmark" is to see how fast different languages go using the same algorithm, without using any safety features. If you hobble Ada by including them, you will make people think it's really slow. It's not about the safety features. Do you get it now?


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  2:28           ` Dan'l Miller
@ 2018-05-18  2:59             ` Lucretia
  0 siblings, 0 replies; 28+ messages in thread
From: Lucretia @ 2018-05-18  2:59 UTC (permalink / raw)


On Friday, 18 May 2018 03:28:50 UTC+1, Dan'l Miller  wrote:

> It would be interesting not only comparing those 2 rows to other corresponding safe or unsafe languages, but also to each other:  Ada-purist versus Ada-ecumenical.  He seems to be emphasizing some definition of “naïve” though.  One or the other of these dual tracks for Ada might fly in the face of his definition of “naïve”.

Exactly this.

P.S: Well done for keeping it short ;P

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-17 21:25     ` meaningfully/compellingly "advertising" " Randy Brukardt
  2018-05-17 23:27       ` Luke A. Guest
@ 2018-05-18  4:22       ` John Perry
  2018-05-18 20:52         ` Randy Brukardt
  2018-05-18 11:10       ` Simon Wright
  2 siblings, 1 reply; 28+ messages in thread
From: John Perry @ 2018-05-18  4:22 UTC (permalink / raw)


On Thursday, May 17, 2018 at 4:25:09 PM UTC-5, Randy Brukardt wrote:
> Did you try implementing that with the Tree container as opposed to using a 
> raw nodes?

No; I was just translating the C++ version. It uses a custom container, and I thought the point was to imitate that. [glances at Rationale for Ada 2012] Are we talking about multiway trees here? I don't see any trees otherwise.


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  2:57           ` Lucretia
@ 2018-05-18  4:25             ` John Perry
  2018-05-18  4:38               ` Paul Rubin
  2018-05-18  4:37             ` Paul Rubin
  1 sibling, 1 reply; 28+ messages in thread
From: John Perry @ 2018-05-18  4:25 UTC (permalink / raw)


On Thursday, May 17, 2018 at 9:57:53 PM UTC-5, Lucretia wrote:
> You don't get the point I made. That "benchmark" is to see how fast different languages go using the same algorithm, without using any safety features. If you hobble Ada by including them, you will make people think it's really slow. It's not about the safety features. Do you get it now?

I'm curious: did my implementation circumvent safety features? The only thing I can think of is the Unchecked_Deallocation, but that doesn't really affect execution time. I put it in there mainly because I thought there might be a memory issue (there had already been comments about some versions having a much larger memory footprint than others).

At this point you can probably tell I haven't quite grokked Ada yet.

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  2:57           ` Lucretia
  2018-05-18  4:25             ` John Perry
@ 2018-05-18  4:37             ` Paul Rubin
  2018-05-18 10:44               ` Lucretia
  2018-05-18 11:17               ` Ben Bacarisse
  1 sibling, 2 replies; 28+ messages in thread
From: Paul Rubin @ 2018-05-18  4:37 UTC (permalink / raw)


Lucretia <laguest9000@googlemail.com> writes:
> You don't get the point I made. That "benchmark" is to see how fast
> different languages go using the same algorithm, without using any
> safety features. If you hobble Ada by including them, you will make
> people think it's really slow. It's not about the safety features. Do
> you get it now?

No.  The Python and Haskell programs are slow because Python and Haskell
also have safety features.  The data signals the right conclusion: C is
dangerous and fast, while Python and Haskell are safe and slow.  A
completely standard cost-benefit tradeoff.  As a user I appreciate being
presented with this info so I can make an informed choice.

Ada's reason for existence revolves around safety.  The benchmarks with
the safety checks off are useless from my perspective as a C programmer.
If I want to write fast dangerous code I already have C for that.  If I
look at Ada at all, it's for the purpose of writing safe code.

So I care primarily about the speed of the safe version (in part so I
can compare it with Python and Haskell).  The unsafe version is just C
with bloated syntax and I'm content to keep using C instead.

I like Dan'l Miller's suggestion of having two Ada benchmarks, giving
both the safe and unsafe measurements.  Then people can decide what's
relevant to their own requirements.  Giving just the unsafe measurements
is uninformative or maybe even misleading.


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  4:25             ` John Perry
@ 2018-05-18  4:38               ` Paul Rubin
  2018-05-18 15:39                 ` John Perry
  0 siblings, 1 reply; 28+ messages in thread
From: Paul Rubin @ 2018-05-18  4:38 UTC (permalink / raw)


John Perry <john.perry@usm.edu> writes:
> I'm curious: did my implementation circumvent safety features?

Were there any unchecked array accesses or anything like that?  If not,
that's a big help.

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  4:37             ` Paul Rubin
@ 2018-05-18 10:44               ` Lucretia
  2018-05-20  7:54                 ` Paul Rubin
  2018-05-18 11:17               ` Ben Bacarisse
  1 sibling, 1 reply; 28+ messages in thread
From: Lucretia @ 2018-05-18 10:44 UTC (permalink / raw)


On Friday, 18 May 2018 05:37:26 UTC+1, Paul Rubin  wrote:

> I like Dan'l Miller's suggestion of having two Ada benchmarks, giving
> both the safe and unsafe measurements.  Then people can decide what's
> relevant to their own requirements.  Giving just the unsafe measurements
> is uninformative or maybe even misleading.

I think it would be better to have multiple implementations showing different levels of safety added tot he original and then one using the standard container, maybe one using the traits containers. Then people can get an idea of what slows what down and where.

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-17 21:25     ` meaningfully/compellingly "advertising" " Randy Brukardt
  2018-05-17 23:27       ` Luke A. Guest
  2018-05-18  4:22       ` John Perry
@ 2018-05-18 11:10       ` Simon Wright
  2 siblings, 0 replies; 28+ messages in thread
From: Simon Wright @ 2018-05-18 11:10 UTC (permalink / raw)


"Randy Brukardt" <randy@rrsoftware.com> writes:

> "John Perry" <john.perry@usm.edu> wrote in message 
> news:a86dc533-a8f5-4d1c-9b4c-11d7963c6d15@googlegroups.com...
>> On Wednesday, May 16, 2018 at 9:46:32 PM UTC-5, John Perry wrote:
>>>> It's quite a simple program: adding and removing ~10^6 nodes to a
>>>> tree, and testing if the tree has a value.
>>>
>> Argh. I knew as I was typing that that the description wasn't quite
>>right, but I didn't think to correct it. It adds (10^6/3) nodes,
>>attempts to delete (10^6)/3, and tests for a value in the tree
>>(10^6)/3 times. Still, it's relatively simple.
>
> Did you try implementing that with the Tree container as opposed to
> using a raw nodes? Probably not quite as fast, but much less work to
> write/read/maintain (since the container does the storage management
> and provides most of the algorithms).

I think this would be quite problematic.

https://en.wikipedia.org/wiki/Treap :

   "The treap was first described by Raimund Seidel and Cecilia
   R. Aragon in 1989;[1][2] its name is a portmanteau of tree and
   heap. It is a Cartesian tree in which each key is given a (randomly
   chosen) numeric priority. As with any binary search tree, the inorder
   traversal order of the nodes is the same as the sorted order of the
   keys. The structure of the tree is determined by the requirement that
   it be heap-ordered: that is, the priority number for any non-leaf
   node must be greater than or equal to the priority of its
   children. Thus, as with Cartesian trees more generally, the root node
   is the maximum-priority node, and its left and right subtrees are
   formed in the same manner from the subsequences of the sorted order
   to the left and right of that node."

So there's rebalancing on insertion/removal; _lots_ of tree
manipulation.


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  4:37             ` Paul Rubin
  2018-05-18 10:44               ` Lucretia
@ 2018-05-18 11:17               ` Ben Bacarisse
  1 sibling, 0 replies; 28+ messages in thread
From: Ben Bacarisse @ 2018-05-18 11:17 UTC (permalink / raw)


Paul Rubin <no.email@nospam.invalid> writes:

> Lucretia <laguest9000@googlemail.com> writes:
>> You don't get the point I made. That "benchmark" is to see how fast
>> different languages go using the same algorithm, without using any
>> safety features. If you hobble Ada by including them, you will make
>> people think it's really slow. It's not about the safety features. Do
>> you get it now?
>
> No.  The Python and Haskell programs are slow because Python and Haskell
> also have safety features.  The data signals the right conclusion: C is
> dangerous and fast, while Python and Haskell are safe and slow.  A
> completely standard cost-benefit tradeoff.  As a user I appreciate being
> presented with this info so I can make an informed choice.

Small point...  There's no C version, only a C++ version.  I just made a
C version and it seems to take about %85 the time of the C++ one.

Even more off-topic point: I think all the programs would be faster if
they did a conventional lookup, but they all use split and merge to
find matching values.  Is there an algorithmic reason for this?

<snip>
> I like Dan'l Miller's suggestion of having two Ada benchmarks, giving
> both the safe and unsafe measurements.  Then people can decide what's
> relevant to their own requirements.

Some of the other languages are represented with multiple versions,
presumably for similar reasons.

-- 
Ben.

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  4:38               ` Paul Rubin
@ 2018-05-18 15:39                 ` John Perry
  2018-05-18 15:48                   ` John Perry
  2018-05-18 20:47                   ` Randy Brukardt
  0 siblings, 2 replies; 28+ messages in thread
From: John Perry @ 2018-05-18 15:39 UTC (permalink / raw)


On Thursday, May 17, 2018 at 11:38:53 PM UTC-5, Paul Rubin wrote:
> John Perry <john.perry@usm.edu> writes:
> > I'm curious: did my implementation circumvent safety features?
> 
> Were there any unchecked array accesses or anything like that?  If not,
> that's a big help.

No arrays at all; it's just linked lists. It's dangerous inasmuch as pointers are dangerous, but I know from experience that Ada has certain rules to prevent pointer dangling.


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

* Re: meaningfully/compellingly “advertising” Ada on StackOverflow
  2018-05-16 14:27 meaningfully/compellingly “advertising” Ada on StackOverflow Dan'l Miller
  2018-05-16 14:35 ` Lucretia
  2018-05-17  2:46 ` John Perry
@ 2018-05-18 15:43 ` John Perry
  2018-05-18 16:40   ` Dan'l Miller
  2 siblings, 1 reply; 28+ messages in thread
From: John Perry @ 2018-05-18 15:43 UTC (permalink / raw)


On Wednesday, May 16, 2018 at 9:27:12 AM UTC-5, Dan'l Miller wrote:
> One thing to help Ada “cross the chasm” would be for each of the how-can-I-do-this-in-Ada questions posted here on c.l.a to also be posted in StackOverflow with (at least) the tag Ada.  ...

I hope you aren't too upset that I seem to have hijacked your thread! I do think this would be a worthwhile endeavor.

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18 15:39                 ` John Perry
@ 2018-05-18 15:48                   ` John Perry
  2018-05-18 20:49                     ` Randy Brukardt
  2018-05-18 20:47                   ` Randy Brukardt
  1 sibling, 1 reply; 28+ messages in thread
From: John Perry @ 2018-05-18 15:48 UTC (permalink / raw)


On Friday, May 18, 2018 at 10:39:14 AM UTC-5, John Perry wrote:
> On Thursday, May 17, 2018 at 11:38:53 PM UTC-5, Paul Rubin wrote:
> > John Perry <john.perry@usm.edu> writes:
> > > I'm curious: did my implementation circumvent safety features?
> > 
> > Were there any unchecked array accesses or anything like that?  If not,
> > that's a big help.
> 
> No arrays at all; it's just linked lists. It's dangerous inasmuch as pointers are dangerous, but I know from experience that Ada has certain rules to prevent pointer dangling.

I want to update on this. I can see two places where I might have circumvented safety features (besides using pointers/access types).

1) There are unchecked deallocations. This is one thing where I'm not too clear on: should one be doing this? The impression I had from what I've seen in Barnes' book is that one should not; apparently Ada is supposed to take care of this by itself, although it doesn't "garbage collect," either. I don't quite understand this -- does it have to do with the custom memory pools?

2) The instruction have the -gnatp option, which I think disables some checks. I used that at one point to see if it would speed up the code, and I thought it did, but I think it actually didn't in the end. So that could be removed; I actually tried experimenting with various pragmas to improve timing, without success.

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

* Re: meaningfully/compellingly “advertising” Ada on StackOverflow
  2018-05-18 15:43 ` meaningfully/compellingly “advertising” " John Perry
@ 2018-05-18 16:40   ` Dan'l Miller
  0 siblings, 0 replies; 28+ messages in thread
From: Dan'l Miller @ 2018-05-18 16:40 UTC (permalink / raw)


On Friday, May 18, 2018 at 10:43:50 AM UTC-5, John Perry wrote:
> On Wednesday, May 16, 2018 at 9:27:12 AM UTC-5, Dan'l Miller wrote:
> > One thing to help Ada “cross the chasm” would be for each of the how-can-I-do-this-in-Ada questions posted here on c.l.a to also be posted in StackOverflow with (at least) the tag Ada.  ...
> 
> I hope you aren't too upset that I seem to have hijacked your thread! I do think this would be a
> worthwhile endeavor.

Oh, I am not upset at all.  All ways of incrementally helping Ada “cross the chasm” in getting the word out to increase mindshare are welcome!

Also, please realize that the feedback that you are getting here on c.l.a regarding safe versus unsafe Ada is intended to be constructive criticism, likely pursuant to adding another full-fledged safe (e.g., with ISO-standard containers) design-in-repository & row-in-table for Ada.  I think that everyone here applauds any & all efforts that you are doing, regardless of purity of safety.  (Perhaps let someone else be the standard-bearer of safety-purity in that repository.)

I try to devise topics here on c.l.a that invigorate Ada, or at least invigorate motivations & fervor regarding polishing off Ada's tarnish to make Ada shine brightly.  (I remember throughout the 1980s the awe in which we as college students were in regarding both dominant Ada and the catch-up mode that scrappy C++ was in to come from behind to ‘beat’ Ada; it was heady exciting times back then that I haven't really seen again until perhaps Rust lately.*)  I never know precisely where the conversation will go when I make a stimulating top-level posting here on c.l.a, but replies/outcomes just like yours are exactly what I envision occurring when I post a stimulating top-level posting on c.l.a.  (Sometimes I do it via a stimulating reply on someone else's top-level posting too.)

* Java's big flash in the pan during the mid-1990s was a huge snoozefesh eye-roll by comparison.  Yea rah  big breakthrough for humankind:  named-goto-labels on continue & break, plus •lack• of truly solving the null-pointer problem phthphthphthpth.  Swing was Java's only truly great achievement but Swing could have been done in any language (e.g., Qt or WxWidgets on C++ if either one of them had had Sun Microsystems' then-deep pockets to bankroll them; or likewise an analogue of Qt or WxWidgets for Ada95).  Sun's deep pockets made Swing a success, not Java-the-language.

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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-17 23:27       ` Luke A. Guest
  2018-05-18  1:22         ` Paul Rubin
@ 2018-05-18 20:42         ` Randy Brukardt
  1 sibling, 0 replies; 28+ messages in thread
From: Randy Brukardt @ 2018-05-18 20:42 UTC (permalink / raw)


"Luke A. Guest" <laguest@archeia.com> wrote in message 
news:1559505943.548291689.457576.laguest-archeia.com@nntp.aioe.org...
> Randy Brukardt <randy@rrsoftware.com> wrote:
>
>> Did you try implementing that with the Tree container as opposed to using 
>> a
>> raw nodes? Probably not quite as fast, but much less work to
>> write/read/maintain (since the container does the storage management and
>> provides most of the algorithms).
>
> The aim is to see how languages stack up. By using the standard containers
> with their anti-tampering and other checks, you would be hobbling Ada in
> this case.

That depends on what axis you are considering "stacking up". You're probably 
right about the performance axis, but what about the readability/consiseness 
axis? There could be a *lot* less code using the tree container (since 
complex operations like iterations and storage management are built-in).

That's of course the problem with such sites (for all languages) -- there's 
almost always a choice of implementation techniques with any general purpose 
language, and one size does not fit all (you never get the best 
readability/performance/writability/maintainability with a single design).

                        Randy.



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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18 15:39                 ` John Perry
  2018-05-18 15:48                   ` John Perry
@ 2018-05-18 20:47                   ` Randy Brukardt
  1 sibling, 0 replies; 28+ messages in thread
From: Randy Brukardt @ 2018-05-18 20:47 UTC (permalink / raw)


"John Perry" <john.perry@usm.edu> wrote in message 
news:9620309c-8abc-4ff2-b631-73bbc72ee5d4@googlegroups.com...
> On Thursday, May 17, 2018 at 11:38:53 PM UTC-5, Paul Rubin wrote:
>> John Perry <john.perry@usm.edu> writes:
>> > I'm curious: did my implementation circumvent safety features?
>>
>> Were there any unchecked array accesses or anything like that?  If not,
>> that's a big help.
>
> No arrays at all; it's just linked lists. It's dangerous inasmuch as 
> pointers are
>dangerous, but I know from experience that Ada has certain rules to prevent
>pointer dangling.

Exactly: raw use of pointers is dangerous - you either get dangling pointers 
or leaks. And they're more work to use than the containers. They're best 
limited to implementing data structures where performance is paramount.

A container implementation handles memory management and much of the 
alogithms for you. That's easier to write, potentially safer, and may (or 
may) not be similar in performance. Which was the reason for my original 
question.

                        Randy.


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18 15:48                   ` John Perry
@ 2018-05-18 20:49                     ` Randy Brukardt
  0 siblings, 0 replies; 28+ messages in thread
From: Randy Brukardt @ 2018-05-18 20:49 UTC (permalink / raw)


"John Perry" <john.perry@usm.edu> wrote in message 
news:12f81e06-6fb0-49c9-9c6a-ed2615e96d32@googlegroups.com...
...
>2) The instruction have the -gnatp option, which I think disables
>some checks. I used that at one point to see if it would speed up
> the code, and I thought it did, but I think it actually didn't in the
>end. So that could be removed; I actually tried experimenting with
>various pragmas to improve timing, without success.

If checks are suppressed (including "container_check" for GNAT), I'd expect 
the containers be roughly the same performance as a hand-written list or 
tree. But you'd have to try it to be sure.

                      Randy.



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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18  4:22       ` John Perry
@ 2018-05-18 20:52         ` Randy Brukardt
  0 siblings, 0 replies; 28+ messages in thread
From: Randy Brukardt @ 2018-05-18 20:52 UTC (permalink / raw)


"John Perry" <john.perry@usm.edu> wrote in message 
news:7fae6587-8714-47c7-bba6-bf220dff969c@googlegroups.com...
> On Thursday, May 17, 2018 at 4:25:09 PM UTC-5, Randy Brukardt wrote:
>> Did you try implementing that with the Tree container as opposed to using 
>> a
>> raw nodes?
>
> No; I was just translating the C++ version. It uses a custom container,
>and I thought the point was to imitate that. [glances at Rationale for Ada
> 2012] Are we talking about multiway trees here? I don't see any trees 
> otherwise.

Yes, of course. The multiway tree is a generalization of more specific types 
like a binary tree. It's really a tree of lists, and most real-world trees 
(like HTML, parse trees, etc.) map easily to it.

                    Randy.


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

* Re: meaningfully/compellingly "advertising" Ada on StackOverflow
  2018-05-18 10:44               ` Lucretia
@ 2018-05-20  7:54                 ` Paul Rubin
  0 siblings, 0 replies; 28+ messages in thread
From: Paul Rubin @ 2018-05-20  7:54 UTC (permalink / raw)


Lucretia <laguest9000@googlemail.com> writes:
> I think it would be better to have multiple implementations showing
> different levels of safety added tot he original and then one using
> the standard container, maybe one using the traits containers. Then
> people can get an idea of what slows what down and where.

That sounds great.  I looked at a page about the traits containers and
it seemed like a better approach than the original ones, so they're what
I'd want to use given a choice.


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

end of thread, other threads:[~2018-05-20  7:54 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 14:27 meaningfully/compellingly “advertising” Ada on StackOverflow Dan'l Miller
2018-05-16 14:35 ` Lucretia
2018-05-16 15:06   ` Dan'l Miller
2018-05-16 22:48     ` Mehdi Saada
2018-05-17  2:46 ` John Perry
2018-05-17  2:49   ` John Perry
2018-05-17 21:25     ` meaningfully/compellingly "advertising" " Randy Brukardt
2018-05-17 23:27       ` Luke A. Guest
2018-05-18  1:22         ` Paul Rubin
2018-05-18  2:28           ` Dan'l Miller
2018-05-18  2:59             ` Lucretia
2018-05-18  2:57           ` Lucretia
2018-05-18  4:25             ` John Perry
2018-05-18  4:38               ` Paul Rubin
2018-05-18 15:39                 ` John Perry
2018-05-18 15:48                   ` John Perry
2018-05-18 20:49                     ` Randy Brukardt
2018-05-18 20:47                   ` Randy Brukardt
2018-05-18  4:37             ` Paul Rubin
2018-05-18 10:44               ` Lucretia
2018-05-20  7:54                 ` Paul Rubin
2018-05-18 11:17               ` Ben Bacarisse
2018-05-18 20:42         ` Randy Brukardt
2018-05-18  4:22       ` John Perry
2018-05-18 20:52         ` Randy Brukardt
2018-05-18 11:10       ` Simon Wright
2018-05-18 15:43 ` meaningfully/compellingly “advertising” " John Perry
2018-05-18 16:40   ` Dan'l Miller

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