[Dynamite] compile status / radical idea

Ian Holmes ihh@fruitfly.org
Sat, 15 Apr 2000 15:46:52 -0700 (PDT)


Thanks Ewan - that is fantastic, nice work.

> a) I have a cvs repository. It is at /home/birney/repository - module -
> telegraph. Layout is reasonably self explanatory

Great. Is this at bio.perl.org? I'm afraid I've forgotten my
bioperl password. I guess I can check it out anonymously.

> b) I had to do quite a bit of editing to get the basic C generated by the
> compile to work. This is checked in as Edits in the compiler directory - I
> could not make good sense of the idlstubs perl - this is common with
> compilers as the parse tree is usually at odds with the logical output...

Yes - I started modularising idlstubs so that the IDL-to-C mapping sits in
a separate text file & is more legible. But this is on hold for the
moment.

> The src/SeqModule has the generated *and then edited* .c files in them.
> Ian - you need to check out the repository if possible and go through my
> edit points. Once we get the idlstubs program generating valid and correct
> C that will really help us.
> 
> I had a crisis in confidence about whether we should be writing our own
> compiler or not. Or whether we should be going to C++. Or standard C CORBA
> mapping. I got over it. We should see how this pans out and then reasses
> what is going on. At the end of the day, the implementation from well
> defined definitions is the easiest part of this project. (if a little
> tedious).

I've had similar crises of confidence. I'm not entirely over them.

Last night, while looking at the Ensembl website, I had the fairly radical
idea that we should do it all in perl. It may not be as stupid as it
sounds...

Benefits:

	* no need to reimplement bioperl objects (eg sequences)
	* can use essentially same object model as planned for the IDL
	* get something working quickly (BIG advantage...)
	* Perl ideal for code or XML generation
	* can optimise by selectively rewriting portions in C later
	* Biologists like Perl

Drawbacks:

	* runs slow
	* less portable
	* Perl objects weakly typed & poorly encapsulated
	* large amount of code wastage (we've put quite a lot of effort
          into this IDL-to-C mapping) (although the IDL-to-C might still
          be useful if we decide to mix & match Perl with C)

I realise this is an awkward thing to mention now that Ewan has just done
all this work on the IDL-to-C mapping. Hmmmmm. Oh well - can I ask you
both to think about it? We can put off deciding for a bit.

Thanks a lot for your comments & praise btw Ewan..

Ian

> 
> 
> Cat'ing the Edits in so that Ian has a idea of what to do.
> 
> BTW - Ian - awesome perl script. Your perl level is way above mine.
> 
> 
> # generic problem in putting * in the wrong place for pointer-to-func
> # declarations
> typedef euString (*Seq_LightSeq_name_ptr) (Seq_LightSeq);     /* pointer
> to nam
>  method */
> 
> 
> # line missing ;
> void Seq_unref_impl (void*);          /* implementation destructor */
> 
> # to get size information into seqmodule_priv.c it needs to include
> # seqmodule_impl.h
> #include "seqmodule_impl.h"
> 
> 
> # casts from eu_malloc/eu_calloc to pointer types in priv.c
>  
>   switch (lightSeq->_priv.ref--)
>     {
>     case 0:
>       Seq_LightSeq_raise (lightSeq, Seq_LightSeq_BadReferenceCount);
>       break;
>     case 1:
>       (*lightSeq->_priv.unref_impl) (lightSeq->_priv.deriv);   /* call
> implemen
> ation destructor */
>       (*lightSeq->_priv.swansong) (lightSeq->_priv.deriv);     /* call
> Euclid d
> structor */
>       break;
>     default:
>       break;
>     }
> 
> 
> # structs need to have _str removed in the callocs to build them
> seqmodule_priv.c: In function `Seq_SeqImage_calloc':
> seqmodule_priv.c:94: `Seq_SeqImage_str' undeclared (first use in this
> function)
> seqmodule_priv.c:94: (Each undeclared identifier is reported only once
> seqmodule_priv.c:94: for each function it appears in.)
> 
> 
> #duplication of Euclid ref/unref/dump calls for Seq and other objects
> # in priv.c
> 
> # no cast in unref chains in impl.c
> void Seq_unref_impl (void* seq)
> {
>   Seq_LightSeq_unref_impl (((Seq)seq)->lightSeq);     /* chained
> unref_impl */
> }
> 
> 
> # type mismatch between pub.h declaration of dump_impl and impl.c
> # stub function. solved by editing pub.h
>  
> 
> 
> -----------------------------------------------------------------
> Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
> <birney@ebi.ac.uk>. 
> -----------------------------------------------------------------
> 
> 
> _______________________________________________
> Dynamite mailing list  -  Dynamite@bioperl.org
> http://www.bioperl.org/mailman/listinfo/dynamite
>