comp.lang.ada
 help / color / mirror / Atom feed
* AWS (Amazon Web Services) Libraries for Ada
@ 2019-09-10 12:37 jsinglet
  2019-09-10 14:21 ` Shark8
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: jsinglet @ 2019-09-10 12:37 UTC (permalink / raw)


Hi All,

I'm working on a project where I will be using AWS services (S3, SQS, and SNS to start) and I was wondering if anyone knows about a ADA library for these services. 

I've looked around and don't see one --- would my best bet be to build a binding to the C++ AWS apis?

Best,
JLS

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

* Re: AWS (Amazon Web Services) Libraries for Ada
  2019-09-10 12:37 AWS (Amazon Web Services) Libraries for Ada jsinglet
@ 2019-09-10 14:21 ` Shark8
  2019-09-10 15:11   ` John Singleton
  2019-09-10 15:01 ` Lucretia
  2019-10-03 14:08 ` Olivier Henley
  2 siblings, 1 reply; 8+ messages in thread
From: Shark8 @ 2019-09-10 14:21 UTC (permalink / raw)


On Tuesday, September 10, 2019 at 6:37:04 AM UTC-6, jsin...@gmail.com wrote:
> Hi All,
> 
> I'm working on a project where I will be using AWS services (S3, SQS, and SNS to start) and I was wondering if anyone knows about a ADA library for these services.
No, not offhand; though I try to avoid external dependencies like (ag) Amazon Web Services and so haven't really looked.

> I've looked around and don't see one --- would my best bet be to build a binding to the C++ AWS apis?
Perhaps, perhaps not.
I don't know how their API is designed because I haven't used Amazon Web Services, but perhaps the best way to answer this question is to look at it from the other way (eg inside-out vs outside-in) — think about things from the Ada-client side (package-client more than network-client) — ask "how do I want my interface to look?" and build from there, with the package-body providing the interface to the Amazon Web Service dependency.

Given that there are other/different languages that use the Amazon Web Service API, some of them quite different from C++, it is likely that the API is "language independent" to some degree; this in itself is a property that you should bear in mind:
(1) a thin binding to the C++ API implementation is going to expose all the design choices and C-semantics workarounds to your binding;
(2) a thick binding will require a bit more work, especially if you want to design to Ada's strengths;
(3) in any case, you *MUST* consider the strengths and weaknesses of your choices. Sure "--fdump-ada-spec" is easy, but working around it in your design might be more work than directly writing the thick binding.

I wish I could be more/actual help though.

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

* Re: AWS (Amazon Web Services) Libraries for Ada
  2019-09-10 12:37 AWS (Amazon Web Services) Libraries for Ada jsinglet
  2019-09-10 14:21 ` Shark8
@ 2019-09-10 15:01 ` Lucretia
  2019-09-10 15:13   ` John Singleton
  2019-10-03 14:08 ` Olivier Henley
  2 siblings, 1 reply; 8+ messages in thread
From: Lucretia @ 2019-09-10 15:01 UTC (permalink / raw)


On Tuesday, 10 September 2019 13:37:04 UTC+1, jsin...@gmail.com  wrote:
 
> I'm working on a project where I will be using AWS services (S3, SQS, and SNS to start) and I was wondering if anyone knows about a ADA library for these services. 

I would seriously doubt there is one.
 
> I've looked around and don't see one --- would my best bet be to build a binding to the C++ AWS apis?

If they have C rather than C++ API's, use that, it'll be a ton easier. If they don't, it's not going to be pleasant, see https://github.com/Lucretia/test_binding for an example of how to do it by hand.

GCC and G++ have switches to create bindings, but these bindings once generated need to be wrapped in an Ada layer to do things properly, such as destructors, i.e. they don't get generated and don't work. When we (charlie5 on #Ada) last looked, the app would crash in certain circumstances.

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

* Re: AWS (Amazon Web Services) Libraries for Ada
  2019-09-10 14:21 ` Shark8
@ 2019-09-10 15:11   ` John Singleton
  2019-09-10 20:09     ` Shark8
  0 siblings, 1 reply; 8+ messages in thread
From: John Singleton @ 2019-09-10 15:11 UTC (permalink / raw)


On Tuesday, September 10, 2019 at 10:21:33 AM UTC-4, Shark8 wrote:
> On Tuesday, September 10, 2019 at 6:37:04 AM UTC-6, jsin...@gmail.com wrote:
> > Hi All,
> > 
> > I'm working on a project where I will be using AWS services (S3, SQS, and SNS to start) and I was wondering if anyone knows about a ADA library for these services.
> No, not offhand; though I try to avoid external dependencies like (ag) Amazon Web Services and so haven't really looked.
> 
> > I've looked around and don't see one --- would my best bet be to build a binding to the C++ AWS apis?
> Perhaps, perhaps not.
> I don't know how their API is designed because I haven't used Amazon Web Services, but perhaps the best way to answer this question is to look at it from the other way (eg inside-out vs outside-in) — think about things from the Ada-client side (package-client more than network-client) — ask "how do I want my interface to look?" and build from there, with the package-body providing the interface to the Amazon Web Service dependency.
> 
> Given that there are other/different languages that use the Amazon Web Service API, some of them quite different from C++, it is likely that the API is "language independent" to some degree; this in itself is a property that you should bear in mind:
> (1) a thin binding to the C++ API implementation is going to expose all the design choices and C-semantics workarounds to your binding;
> (2) a thick binding will require a bit more work, especially if you want to design to Ada's strengths;
> (3) in any case, you *MUST* consider the strengths and weaknesses of your choices. Sure "--fdump-ada-spec" is easy, but working around it in your design might be more work than directly writing the thick binding.
> 
> I wish I could be more/actual help though.

Thanks for all of this. 

I think combined with Lucretia's suggestion to use the C API, a thick binding makes a lot of sense to me. Granted, if you look over the API, it's generally fairly reasonable. 

Another option I am considering is just talking to it directly; the API is REST (and older support for SOAP). It will require plumbing through the docs a bit more, but perhaps a native REST implementation would be the best, and pure Ada...


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

* Re: AWS (Amazon Web Services) Libraries for Ada
  2019-09-10 15:01 ` Lucretia
@ 2019-09-10 15:13   ` John Singleton
  2019-09-10 15:18     ` Lucretia
  0 siblings, 1 reply; 8+ messages in thread
From: John Singleton @ 2019-09-10 15:13 UTC (permalink / raw)


On Tuesday, September 10, 2019 at 11:01:31 AM UTC-4, Lucretia wrote:
> On Tuesday, 10 September 2019 13:37:04 UTC+1, jsin...@gmail.com  wrote:
>  
> > I'm working on a project where I will be using AWS services (S3, SQS, and SNS to start) and I was wondering if anyone knows about a ADA library for these services. 
> 
> I would seriously doubt there is one.
>  
> > I've looked around and don't see one --- would my best bet be to build a binding to the C++ AWS apis?
> 
> If they have C rather than C++ API's, use that, it'll be a ton easier. If they don't, it's not going to be pleasant, see https://github.com/Lucretia/test_binding for an example of how to do it by hand.
> 
> GCC and G++ have switches to create bindings, but these bindings once generated need to be wrapped in an Ada layer to do things properly, such as destructors, i.e. they don't get generated and don't work. When we (charlie5 on #Ada) last looked, the app would crash in certain circumstances.

Hi Lucretia,

Thanks for your reply. 

There *is* an C API, but it isn't official. I was looking at how they structure the API and it looks like REST -- so I'm wondering if perhaps my best path forward isn't just to talk directly to the REST API. I'll lose the automatic support for loading credentials but that should be easy enough to implement...


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

* Re: AWS (Amazon Web Services) Libraries for Ada
  2019-09-10 15:13   ` John Singleton
@ 2019-09-10 15:18     ` Lucretia
  0 siblings, 0 replies; 8+ messages in thread
From: Lucretia @ 2019-09-10 15:18 UTC (permalink / raw)


On Tuesday, 10 September 2019 16:13:35 UTC+1, John Singleton  wrote:

> Hi Lucretia,
> 
> Thanks for your reply. 
> 
> There *is* an C API, but it isn't official. I was looking at how they structure the API and it looks like REST -- so I'm wondering if perhaps my best path forward isn't just to talk directly to the REST API. I'll lose the automatic support for loading credentials but that should be easy enough to implement...

Yeah, don't bind to it then. I thought it might've been a rest api, there are json libs and you can open sockets with gnat no problem, so it'd be better to have a proper lib implementing the rest api.

Luke.

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

* Re: AWS (Amazon Web Services) Libraries for Ada
  2019-09-10 15:11   ` John Singleton
@ 2019-09-10 20:09     ` Shark8
  0 siblings, 0 replies; 8+ messages in thread
From: Shark8 @ 2019-09-10 20:09 UTC (permalink / raw)


On Tuesday, September 10, 2019 at 9:11:08 AM UTC-6, John Singleton wrote:
> 
> Another option I am considering is just talking to it directly; the API is REST (and older support for SOAP). It will require plumbing through the docs a bit more, but perhaps a native REST implementation would be the best, and pure Ada...

I think AWS (Ada Web Server) has some direct interfacing for SOAP.
Also, while I've never used WSDL (Web Service Description Language), there's a generator bundled with Ada Web Server; see:
1) https://docs.adacore.com/aws-docs/aws/using_wsdl.html 
2) https://www.mankier.com/1/wsdl2aws
3) https://www.adacore.com/gems/gem-101-soapwsdl-server-part / https://github.com/AdaCore/aws/blob/master/tools/wsdl2aws-generator.adb

As for Amazon Web Services, try:
https://dacemirror.sci-hub.tw/proceedings-article/a7b35be2b1babf5eb372fbfa734d645b/elhog2011.pdf
http://javadox.com/com.amazonaws/aws-java-sdk/1.3.26/com/amazonaws/services/sns/AmazonSNSAsync.html
--though this is from a light search and some stuff indicated WSDL and SOAP might be discontinued.

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

* Re: AWS (Amazon Web Services) Libraries for Ada
  2019-09-10 12:37 AWS (Amazon Web Services) Libraries for Ada jsinglet
  2019-09-10 14:21 ` Shark8
  2019-09-10 15:01 ` Lucretia
@ 2019-10-03 14:08 ` Olivier Henley
  2 siblings, 0 replies; 8+ messages in thread
From: Olivier Henley @ 2019-10-03 14:08 UTC (permalink / raw)


The REST way, the work of Stephane Carrez may be a good place for inspiration:

https://github.com/stcarrez/ada-util/blob/master/samples/facebook.adb


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

end of thread, other threads:[~2019-10-03 14:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 12:37 AWS (Amazon Web Services) Libraries for Ada jsinglet
2019-09-10 14:21 ` Shark8
2019-09-10 15:11   ` John Singleton
2019-09-10 20:09     ` Shark8
2019-09-10 15:01 ` Lucretia
2019-09-10 15:13   ` John Singleton
2019-09-10 15:18     ` Lucretia
2019-10-03 14:08 ` Olivier Henley

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