[erlang-questions] Avoiding boilerplate code when using gen_server

Edmond Begumisa <>
Fri Mar 23 19:22:03 CET 2012


>
> On 22/03/2012, at 12:48 AM, Torben Hoffmann wrote:
>> The question was: why don't you use an IDL (Interface Definition  
>> Language) approach instead of writing all that code that has to match  
>> up in order to work?
>> <snip>
>> I have tried searching for it, but since IDL is so tightly coupled with  
>> CORBA I didn't really find anything but the ic application from the  
>> Erlang/OTP distribution.\
>
> There are two very different concepts here.
> (1) "An interface definition language *APPROACH*."
> (2) CORBA IDL.
>
> CORBA IDL is language independent as long as the language you are  
> pretending
> to be independent of is C++ or a close relative.  It is about as bad a  
> fit
> for Erlang data structures as you would expect it to be.  This is not to  
> say
> that Erlang cannot handle the data structures passed through a CORBA  
> interface.
> It can.  What I am saying is that CORBA doesn't handle Erlang data  
> structures.
>

Incidentally,

I attempted an XPCOM-Erlang bridge to try and marry Erlang with the
Mozilla Framework (XPCOM is similar to MSCOM/CORBA with IDLs etc).
Eventually I realised that keeping to two sides completely separate and
doing application-specific message passing was waaaaaay easier.

- Edmond -

On Thu, 22 Mar 2012 01:53:47 +0300, Richard O'Keefe <>
wrote:
> CORBA IDL is by no means the only, nor by a very long time the first,
> interface definition language, not even if we are talking about  
> interfaces
> for distributed programming.  The first time I used remote procedure  
> call was
> on a Xerox 1108 running Interlisp...
>
> There's no reason why some sort of "little language" for specifying  
> gen_server
> stuff could not be devised.  It might even be something that could be  
> plugged
> in using a parse transform.
>
> But step 1 is to be very very clear about what is repetitive and what is  
> not.
>
> Step 2 is to consider whether it can be done using higher-order  
> functions.
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the erlang-questions mailing list