caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] libbin_prot, php-bin_prot, ppx_bin_prot_interop
@ 2017-03-07 19:13 Andre Nathan
  2017-03-08  7:08 ` Jeremie Dimino
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Nathan @ 2017-03-07 19:13 UTC (permalink / raw)
  To: caml users


[-- Attachment #1.1: Type: text/plain, Size: 1580 bytes --]

Hi

We have plans to make use of Jane Street's bin_prot-based RPC libraries
for some future projects, but one requirement is that we must
interoperate with clients written in other languages, namely PHP.

So I've been working on these 3 projects to make this possible:

* libbin_prot [1] is a C port of (most of) bin_prot, with added support
for RPC clients. This was written to avoid having to implement bin_prot
multiple times in other languages - one can just write bindings to the C
library.

* php-bin_prot [2] is a PHP extension binding libbin_prot. It supports
both PHP 5 and 7.

* ppx_bin_prot_interop [3] is a PPX rewriter that generates PHP code
from OCaml type definitions. It's written in a way that it should be
easy enough to add support for other languages, as it builds a
sort-of-AST that just has to be converted to strings in the proper
language syntax. It's a bit hackish but gets the job done. The
repository includes an example with an OCaml RPC server and a PHP client.

ppx_bin_prot_interop is not on OPAM yet because I'm relying on the
latest jbuilder version that is only available on Jane Street's
repository [4] as of now. You should still be able to use it via "opam
pin" if you want to give it a try.

[1] https://github.com/andrenth/libbin_prot
[2] https://github.com/andrenth/php-bin_prot
[3] https://github.com/andrenth/ppx_bin_prot_interop
[4] opam repo add janestreet
https://github.com/janestreet/opam-repository.git

Now that OCaml can talk to PHP, world domination should not be too far.

Cheers,
Andre


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [Caml-list] [ANN] libbin_prot, php-bin_prot, ppx_bin_prot_interop
  2017-03-07 19:13 [Caml-list] [ANN] libbin_prot, php-bin_prot, ppx_bin_prot_interop Andre Nathan
@ 2017-03-08  7:08 ` Jeremie Dimino
  2017-03-08 13:10   ` Andre Nathan
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremie Dimino @ 2017-03-08  7:08 UTC (permalink / raw)
  To: Andre Nathan; +Cc: caml users

Hi Andre,

This is really cool! Just a few days ago someone asked me if we could
talk to a RPC server from C, so it looks like we could use libbin_prot
right now.

BTW, I've submitted a PR for the 1.0+beta1 of jbuilder yesterday, so
it should reach opam soon.

Jeremie

On Tue, Mar 7, 2017 at 7:13 PM, Andre Nathan <andre@digirati.com.br> wrote:
> Hi
>
> We have plans to make use of Jane Street's bin_prot-based RPC libraries
> for some future projects, but one requirement is that we must
> interoperate with clients written in other languages, namely PHP.
>
> So I've been working on these 3 projects to make this possible:
>
> * libbin_prot [1] is a C port of (most of) bin_prot, with added support
> for RPC clients. This was written to avoid having to implement bin_prot
> multiple times in other languages - one can just write bindings to the C
> library.
>
> * php-bin_prot [2] is a PHP extension binding libbin_prot. It supports
> both PHP 5 and 7.
>
> * ppx_bin_prot_interop [3] is a PPX rewriter that generates PHP code
> from OCaml type definitions. It's written in a way that it should be
> easy enough to add support for other languages, as it builds a
> sort-of-AST that just has to be converted to strings in the proper
> language syntax. It's a bit hackish but gets the job done. The
> repository includes an example with an OCaml RPC server and a PHP client.
>
> ppx_bin_prot_interop is not on OPAM yet because I'm relying on the
> latest jbuilder version that is only available on Jane Street's
> repository [4] as of now. You should still be able to use it via "opam
> pin" if you want to give it a try.
>
> [1] https://github.com/andrenth/libbin_prot
> [2] https://github.com/andrenth/php-bin_prot
> [3] https://github.com/andrenth/ppx_bin_prot_interop
> [4] opam repo add janestreet
> https://github.com/janestreet/opam-repository.git
>
> Now that OCaml can talk to PHP, world domination should not be too far.
>
> Cheers,
> Andre
>



-- 
Jeremie

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

* Re: [Caml-list] [ANN] libbin_prot, php-bin_prot, ppx_bin_prot_interop
  2017-03-08  7:08 ` Jeremie Dimino
@ 2017-03-08 13:10   ` Andre Nathan
  0 siblings, 0 replies; 3+ messages in thread
From: Andre Nathan @ 2017-03-08 13:10 UTC (permalink / raw)
  To: Jeremie Dimino; +Cc: caml users


[-- Attachment #1.1: Type: text/plain, Size: 2315 bytes --]

That's great timing :)

I've updated the libbin_prot README to describe the RPC functions and
added a simple example code with an OCaml server and a C client.

Cheers,
Andre

On 03/08/2017 04:08 AM, Jeremie Dimino wrote:
> Hi Andre,
> 
> This is really cool! Just a few days ago someone asked me if we could
> talk to a RPC server from C, so it looks like we could use libbin_prot
> right now.
> 
> BTW, I've submitted a PR for the 1.0+beta1 of jbuilder yesterday, so
> it should reach opam soon.
> 
> Jeremie
> 
> On Tue, Mar 7, 2017 at 7:13 PM, Andre Nathan <andre@digirati.com.br> wrote:
>> Hi
>>
>> We have plans to make use of Jane Street's bin_prot-based RPC libraries
>> for some future projects, but one requirement is that we must
>> interoperate with clients written in other languages, namely PHP.
>>
>> So I've been working on these 3 projects to make this possible:
>>
>> * libbin_prot [1] is a C port of (most of) bin_prot, with added support
>> for RPC clients. This was written to avoid having to implement bin_prot
>> multiple times in other languages - one can just write bindings to the C
>> library.
>>
>> * php-bin_prot [2] is a PHP extension binding libbin_prot. It supports
>> both PHP 5 and 7.
>>
>> * ppx_bin_prot_interop [3] is a PPX rewriter that generates PHP code
>> from OCaml type definitions. It's written in a way that it should be
>> easy enough to add support for other languages, as it builds a
>> sort-of-AST that just has to be converted to strings in the proper
>> language syntax. It's a bit hackish but gets the job done. The
>> repository includes an example with an OCaml RPC server and a PHP client.
>>
>> ppx_bin_prot_interop is not on OPAM yet because I'm relying on the
>> latest jbuilder version that is only available on Jane Street's
>> repository [4] as of now. You should still be able to use it via "opam
>> pin" if you want to give it a try.
>>
>> [1] https://github.com/andrenth/libbin_prot
>> [2] https://github.com/andrenth/php-bin_prot
>> [3] https://github.com/andrenth/ppx_bin_prot_interop
>> [4] opam repo add janestreet
>> https://github.com/janestreet/opam-repository.git
>>
>> Now that OCaml can talk to PHP, world domination should not be too far.
>>
>> Cheers,
>> Andre
>>
> 
> 
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 19:13 [Caml-list] [ANN] libbin_prot, php-bin_prot, ppx_bin_prot_interop Andre Nathan
2017-03-08  7:08 ` Jeremie Dimino
2017-03-08 13:10   ` Andre Nathan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).