Barrister in reverse

72 views
Skip to first unread message

Zach Lym

unread,
Apr 1, 2014, 10:45:51 PM4/1/14
to barris...@googlegroups.com
I want to port an existing RPC helper library I wrote to Barrister.  Can we throw the tools you have in reverse, generating proto IDL files using whatever can be gleaned from the function?  You could even tag the RPC client object using comments.

However, even just copying function names and variables and in-lining the original code and comments would save a lot of grunt work.

James Cooper

unread,
Apr 2, 2014, 6:45:31 PM4/2/14
to barris...@googlegroups.com
If you have a parser that can generate the Barrister IDL JSON format, then converting that to the IDL format would be pretty easy.  What language(s) are you parsing?

-- James


On Tue, Apr 1, 2014 at 7:45 PM, Zach Lym <indol...@gmail.com> wrote:
I want to port an existing RPC helper library I wrote to Barrister.  Can we throw the tools you have in reverse, generating proto IDL files using whatever can be gleaned from the function?  You could even tag the RPC client object using comments.

However, even just copying function names and variables and in-lining the original code and comments would save a lot of grunt work.

--
You received this message because you are subscribed to the Google Groups "barrister-rpc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to barrister-rp...@googlegroups.com.
To post to this group, send email to barris...@googlegroups.com.
Visit this group at http://groups.google.com/group/barrister-rpc.
For more options, visit https://groups.google.com/d/optout.



--

James Cooper
http://blog.bitmechanic.com/

Zach Lym

unread,
Apr 2, 2014, 6:52:55 PM4/2/14
to barris...@googlegroups.com
Javascript, PHP, Python, C++ and I'm sure I could find sibling bindings
for Ruby and Java.

-indo

On Wed Apr 2 15:45:31 2014, James Cooper wrote:
> If you have a parser that can generate the Barrister IDL JSON format,
> then converting that to the IDL format would be pretty easy. What
> language(s) are you parsing?
>
> -- James
>
>
> On Tue, Apr 1, 2014 at 7:45 PM, Zach Lym <indol...@gmail.com
> <mailto:indol...@gmail.com>> wrote:
>
> I want to port an existing RPC helper library I wrote to
> Barrister. Can we throw the tools you have in reverse, generating
> proto IDL files using whatever can be gleaned from the function?
> You could even tag the RPC client object using comments.
>
> However, even just copying function names and variables and
> in-lining the original code and comments would save a lot of grunt
> work.
>
> --
> You received this message because you are subscribed to the Google
> Groups "barrister-rpc" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to barrister-rp...@googlegroups.com
> <mailto:barrister-rp...@googlegroups.com>.
> To post to this group, send email to
> barris...@googlegroups.com
> <mailto:barris...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/barrister-rpc.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
>
> James Cooper
> http://blog.bitmechanic.com/
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "barrister-rpc" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/barrister-rpc/8VASv8tHQ0o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> barrister-rp...@googlegroups.com
> <mailto:barrister-rp...@googlegroups.com>.
> To post to this group, send email to barris...@googlegroups.com
> <mailto:barris...@googlegroups.com>.
signature.asc

James Cooper

unread,
Apr 2, 2014, 7:13:15 PM4/2/14
to barris...@googlegroups.com
Ah.. so to be clear, you want to extract functions from implementation code in those languages?  It seems like you need some way to parse an AST in each language.  Once you have that you could extract it down to JSON.  But I may be misunderstanding what you're trying to do.

cheers

-- James

Zach Lym

unread,
Apr 2, 2014, 7:19:39 PM4/2/14
to barris...@googlegroups.com
Yes, that's exactly what I'm trying to do. I assumed Barrister was
using AST but I, now that I think of it, it would be much simpler to
just have generic functions and types stored for each language.

Thanks anyway, I guess you could put it out as a wish list. I'm
surprised you don't have companies sponsoring your work.

-indo
signature.asc

Zach Lym

unread,
Apr 3, 2014, 5:39:57 PM4/3/14
to barris...@googlegroups.com, ja...@bitmechanic.com
Mind if I ask you a couple more stupid questions?

I don't have a formal CS background, but I'm working on a library and I'm trying to support as many languages as possible.  I'm sure this is a stupid question, but I would like to know why: have you thought of using another source-to-source compiler to generate additional bindings

Wikipedia lists multiple C++ transcompilers (PHP and LLVM -> C++) as well as J2ObjC, etc.  I can understand those might produce illegible output, but something like Haxe would add C++ and C#.

Thanks,
-Indo

James Cooper

unread,
Apr 4, 2014, 10:52:41 AM4/4/14
to barris...@googlegroups.com
On Thu, Apr 3, 2014 at 2:39 PM, Zach Lym <indol...@gmail.com> wrote:
Mind if I ask you a couple more stupid questions?

I don't have a formal CS background, but I'm working on a library and I'm trying to support as many languages as possible.  I'm sure this is a stupid question, but I would like to know why: have you thought of using another source-to-source compiler to generate additional bindings

Hi Zach,

I think I understand your suggestion: write a universal master binding in some language (e.g. Haxe) and then generate language specific translations of that for each target language.

I hadn't thought about that.  Two things come to mind that may make that difficult or sub-optimal:

(a) Reliance on language-specific libraries differs.  The big ones are HTTP and JSON.  Every language has a different standard library for that stuff, so I'm not sure how you'd represent that in a language neutral manner.

(b) Static vs dynamic language differences.  The Go and Java bindings are designed to work with structs/classes, whereas the dynamic bindings (JS, Python, Ruby, PHP) work against built in map/list types.  With Go and Java I use the reflection packages.

But I'd be interested in hearing other opinions.

-- James


 

Zach Lym

unread,
Apr 5, 2014, 12:03:11 AM4/5/14
to barris...@googlegroups.com

Close, I was thinking more along the lines of using Haxe or another transpiler to create a rough-conversion based on your existing sources. When I looked through the code, everything looked fairly normal.  There are PHP->Haxe and JS->Haxe libraries.  However, you could also get LLVM to handle the C++ conversion and there is Java -> ObjectiveC transpiler. 

What you say makes a lot of sense, I don't really understand how interfaces (such as with HTTP) are handled by something low level like LLVM.  However, I believe that Haxe has standard libraries for HTTP and JSON processing, it may be reimplementing in each language.

However, I'm sure personal interest has a lot to do with it, but I thought there might be other reasons.  I find it odd you don't have corporate sponsorship, you should start a few code bounties for different languages and see what happens.

Thank you,
-Zach Lym


--
You received this message because you are subscribed to a topic in the Google Groups "barrister-rpc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/barrister-rpc/8VASv8tHQ0o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to barrister-rp...@googlegroups.com.
To post to this group, send email to barris...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages