comp.lang.ada
 help / color / mirror / Atom feed
From: Lucretia <laguest9000@googlemail.com>
Subject: Re: Ada Annoyances
Date: Wed, 21 Jun 2017 03:13:13 -0700 (PDT)
Date: 2017-06-21T03:13:13-07:00	[thread overview]
Message-ID: <d6b02354-93b5-4364-9fe5-3d22b47156e9@googlegroups.com> (raw)
In-Reply-To: <1ac5a44b-4423-443a-a7bb-2864d9abe78f@googlegroups.com>

On Wednesday, 21 June 2017 02:12:51 UTC+1, pyth...@gmail.com  wrote:
> I've recently been trying to learn some Ada, however, I've encountered a few annoyances. I tend to perhaps be a bit too concerned about performance, so I try to stay away from things like tagged types when I don't actually need them (which is most of the time). But for some reason, there are some features that seemingly require tagged types for no reason - custom indexing and iterators. 
> 

Your thinking is pretty stupid tbh. I've come across this numerous times. "Oh, don't use a virtual, it's slow!" It's "slower" because it needs another load, big fucking deal, CPU's are fast enough now.

In Ada, you can mostly do static calls, whereas with C++ you can't, so avoiding tagged types is really stupid because it's going to hinder what you can do.

Ada isn't as braindead as C++ so stop thinking in C++ ways when writing Ada, it's not the right thing to do.

I'm surprised you're even trying Ada given that most, if not all of it's types will have dope vectors, but you're not even checking to see what the compiler is generating, so you've no clue as to whether it's using a fast path or not.

> My specific case is a large buffer which I want to be able to pass around a sub-range of (i.e. I have concrete types). I could just use explicit functions to do what I want, but I'd really rather have the more convenient syntax of providing custom indexing and iterators.

The iterators have a specific interface that the designers wanted to enforce so it's easier to grasp. TBH, the current iterator stuff isn't that easy to implement.

> I just can't understand why these features require tagged types (especially because I can implement custom indexing and iterators in C++ without involving any kind of abstract classes or virtual functions). I assume though that the requirement is there for some reason, so I'm curious if anyone knows what that reason might be.

You mean, C++'s template "system?"

> I really want to like Ada, and there's some really cool things it does like allowing you to very exactly specify how types should be laid out in memory that are very useful for low level programming, but then I run into these features requiring tagged types when I very much don't need them, which just drives me crazy.

Stop thinking in C++ then and just use the language the way it's supposed to be used. The profile and see where your bottlenecks are, I'm betting they're nowhere where you think.

  reply	other threads:[~2017-06-21 10:13 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21  1:12 Ada Annoyances pythoner6
2017-06-21 10:13 ` Lucretia [this message]
2017-06-23 15:27   ` raph.amiard
2017-06-23 17:49     ` Randy Brukardt
2017-06-23 19:21       ` Niklas Holsti
2017-06-24  4:02         ` Shark8
2017-06-24 19:55         ` Simon Wright
2017-06-24 20:56           ` Niklas Holsti
2017-06-25 23:43         ` Randy Brukardt
2017-06-26 20:20           ` Niklas Holsti
2017-06-26 21:47             ` Randy Brukardt
2017-06-26 22:23               ` Dmitry A. Kazakov
2017-06-29 19:00               ` Niklas Holsti
2017-06-29 21:29                 ` Robert A Duff
2017-06-30  0:50                   ` Randy Brukardt
2017-07-03 20:39                     ` Robert A Duff
2017-07-04 19:52                       ` Niklas Holsti
2017-07-04 19:32                   ` Niklas Holsti
2017-06-30  0:47                 ` Randy Brukardt
2017-06-30 18:45                   ` Niklas Holsti
2017-06-30 20:06                     ` Robert A Duff
2017-06-29 21:12         ` Robert A Duff
2017-07-04 19:30           ` Niklas Holsti
2017-07-05 20:03             ` Robert A Duff
2017-06-23 19:22       ` Niklas Holsti
2017-06-30 15:02       ` Norman Worth
2017-06-30 23:49         ` pythoner6
2017-07-03  0:04           ` Randy Brukardt
2017-07-03 17:47             ` Jere
2017-07-03 19:43               ` Dmitry A. Kazakov
2017-07-04  2:18               ` Randy Brukardt
2017-12-17 13:47                 ` Prefixed notation for non tagged types Jere
2017-12-17 15:06                   ` Simon Wright
2017-12-17 15:33                     ` Dmitry A. Kazakov
2017-12-18 22:31                     ` Randy Brukardt
2017-12-19  0:40                     ` Jere
2017-12-19 23:04                       ` Randy Brukardt
2017-12-20 12:33                         ` Robert Eachus
2017-06-21 11:58 ` Ada Annoyances joakimds
2017-06-21 12:29   ` Pascal Obry
2017-06-21 14:52     ` pythoner6
2017-06-21 16:11       ` J-P. Rosen
2017-06-21 16:12       ` Dmitry A. Kazakov
2017-06-21 22:45         ` pythoner6
2017-06-22  7:29           ` Dmitry A. Kazakov
2017-06-22 10:29             ` pythoner6
2017-06-22 11:04               ` Egil H H
2017-06-22 13:30               ` Dmitry A. Kazakov
2017-06-22 19:22                 ` Niklas Holsti
2017-06-22 21:52                   ` Dmitry A. Kazakov
2017-06-23  9:33                     ` AdaMagica
2017-06-23 10:25                       ` Simon Wright
2017-06-23  1:00                 ` pythoner6
2017-06-23 15:23         ` raph.amiard
2017-06-23 16:10           ` Dmitry A. Kazakov
2017-06-23 17:41           ` Randy Brukardt
2017-06-23 18:56           ` Maciej Sobczak
2017-06-23 22:18             ` pythoner6
2017-06-24  8:05               ` Dmitry A. Kazakov
2017-06-24  8:35                 ` Maciej Sobczak
2017-06-24  9:07                   ` Dmitry A. Kazakov
2017-06-24 20:50                     ` Maciej Sobczak
2017-06-24 21:06                       ` Dmitry A. Kazakov
2017-06-25 11:33                         ` Maciej Sobczak
2017-06-25 14:32                           ` Dmitry A. Kazakov
2017-06-25 20:50                             ` Maciej Sobczak
2017-06-26  7:58                               ` Dmitry A. Kazakov
2017-06-26 13:24                                 ` Maciej Sobczak
2017-06-26 16:38                                   ` Dmitry A. Kazakov
2017-06-26 20:42                                     ` Maciej Sobczak
2017-06-24  8:34               ` Maciej Sobczak
2017-06-24 13:06                 ` pythoner6
2017-06-24 15:40                   ` Dmitry A. Kazakov
2017-06-26  0:06                 ` Randy Brukardt
2017-06-26 20:35                   ` Maciej Sobczak
2017-06-26 21:40                     ` Randy Brukardt
2017-06-27  7:23                       ` Maciej Sobczak
2017-06-27 20:38                         ` Randy Brukardt
2017-06-28  8:21                           ` Dmitry A. Kazakov
2017-06-28 20:50                             ` Randy Brukardt
2017-06-28 23:18                               ` Nasser M. Abbasi
2017-06-29  7:27                                 ` Dmitry A. Kazakov
2017-06-29 16:24                                 ` Jeffrey R. Carter
2017-06-29 16:51                                   ` Nasser M. Abbasi
2017-07-04 23:40                                   ` Luke A. Guest
2017-07-05  5:29                                     ` J-P. Rosen
2017-07-05 13:49                                       ` Dennis Lee Bieber
2017-07-05 17:49                                     ` Jeffrey R. Carter
2017-06-29 21:46                                 ` darkestkhan
2017-06-29  7:15                               ` Dmitry A. Kazakov
2017-06-30  0:42                                 ` Randy Brukardt
2017-06-30  7:36                                   ` Dmitry A. Kazakov
2017-06-28 13:07                           ` Maciej Sobczak
2017-06-27  7:26                       ` Dmitry A. Kazakov
2017-06-27 20:41                         ` Randy Brukardt
2017-06-28  7:57                           ` Dmitry A. Kazakov
2017-06-27 15:19                     ` AdaMagica
2017-06-27 16:32                       ` Dmitry A. Kazakov
2017-06-28 13:15                       ` Maciej Sobczak
2017-06-28 14:05                         ` AdaMagica
2017-06-29 21:17                           ` Robert A Duff
2017-06-30  7:44                             ` Dmitry A. Kazakov
2017-06-30  7:49                               ` J-P. Rosen
2017-06-30  8:28                                 ` Dmitry A. Kazakov
2017-06-30 10:14                                   ` J-P. Rosen
2017-06-30 10:30                                     ` Dmitry A. Kazakov
2017-06-28 20:53                         ` Randy Brukardt
2017-12-17 16:24             ` Mehdi Saada
2017-12-17 17:27               ` Dmitry A. Kazakov
2017-12-18 23:09                 ` Randy Brukardt
2017-12-19  9:25                   ` Dmitry A. Kazakov
2017-06-21 20:40       ` G.B.
2017-06-21 22:25         ` pythoner6
2017-06-26 11:01     ` Vincent
2017-06-26 11:15       ` Alejandro R. Mosteo
2017-06-26 16:35       ` Pascal Obry
replies disabled

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