skaller | 5 Mar 2007 05:06
Picon

monomorphisation pass

I have added a monomorphisation pass to the optimisation process.
This pass is currently done before inlining, and makes monomorphic
clones of Felix functions, procedures, classes, and variables.
Types other than classes, and primitives are not monomorphised.

The main reason for doing all this is so that polymorphic calls
to virtual functions of typeclasses become monomorphic which
allows them to be instantiated, and subsequently inlined,
so that there is zero performance penalty for using 
virtual functions.

Strangely this didn't fix the dispatch to 'ge' in Takfp ..
well not so strangely, since this was monomorphic anyhow.
The reason is probably that the dispatch is an "apply_prim"
which isn't considered for inlining.

The actual intent is to do a round of polymorphic inlining
first, THEN monomorphise, then do another round of inlining.
The first round is mainly to reduce the total number of
functions that the monomorphisation has to handle, the
second round inlines virtual functions that couldn't
be instantiated in the first round.

This job took over a weak and uncovered numerous difficulties
in the representation. By the far the most difficult issue
in general is that the algebraic data types used by the
compiler have invariants, and ones which change depending
on the processing phase .. and these currently have to be
'remembered'.

(Continue reading)

Erick Tryzelaar | 5 Mar 2007 05:19
Picon

felix blog alpha

Hi Guys,

So, you can see the pretty alpha version of a blog here: 
http://idle-minds.net. It's still missing some features, such as posting 
mails to the mailing list and trac integration. But check it out, and 
let me know what you guys think!

Oh and John, I made an account for you to play around with, I'll mail 
that to you separately.

-e

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Erick Tryzelaar | 5 Mar 2007 05:24
Picon

Re: felix blog alpha

Erick Tryzelaar wrote:
> Hi Guys,
>
> So, you can see the pretty alpha version of a blog here: 
> http://idle-minds.net. It's still missing some features, such as posting 
> mails to the mailing list and trac integration. But check it out, and 
> let me know what you guys think!
>
> Oh and John, I made an account for you to play around with, I'll mail 
> that to you separately.

Oh, and I'd like to actually get a real domain for felix. What should it 
be? All the easy ones, like http://www.felix.com and 
http://www.felix.org are taken. We could do http://www.felix-lang.org, 
to copy ruby. Any better ideas?

-e

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
skaller | 5 Mar 2007 06:58
Picon

Re: felix blog alpha

On Sun, 2007-03-04 at 20:19 -0800, Erick Tryzelaar wrote:
> Hi Guys,
> 
> So, you can see the pretty alpha version of a blog here: 
> http://idle-minds.net. It's still missing some features, such as posting 
> mails to the mailing list and trac integration. But check it out, and 
> let me know what you guys think!

Well the ticket tracking is several orders of magnitude better
than SF. The site also seems fast. Through some magic,
the svn repository is already browsable.

Is idle-minds your domain name Erick?

--

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Erick Tryzelaar | 5 Mar 2007 08:26
Picon

Re: felix blog alpha

skaller wrote:
> On Sun, 2007-03-04 at 20:19 -0800, Erick Tryzelaar wrote:
>   
>> Hi Guys,
>>
>> So, you can see the pretty alpha version of a blog here: 
>> http://idle-minds.net. It's still missing some features, such as posting 
>> mails to the mailing list and trac integration. But check it out, and 
>> let me know what you guys think!
>>     
>
> Well the ticket tracking is several orders of magnitude better
> than SF. The site also seems fast. Through some magic,
> the svn repository is already browsable.
>
> Is idle-minds your domain name Erick?
>   

Yup! It's my toy domain. The trac website is pretty cool. A couple 
months ago I set up automatic mirroring of the sourceforge subversion 
database into trac, if you remember that conversation. It rsyncs every 5 
minutes.

-e

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
(Continue reading)

Erick Tryzelaar | 5 Mar 2007 08:32
Picon

Re: felix blog alpha

Erick Tryzelaar wrote:
> Hi Guys,
>
> So, you can see the pretty alpha version of a blog here: 
> http://idle-minds.net. It's still missing some features, such as posting 
> mails to the mailing list and trac integration. But check it out, and 
> let me know what you guys think!
>
> Oh and John, I made an account for you to play around with, I'll mail 
> that to you separately.

There's a couple things left to do before I'd want to make it live. Most 
importantly is getting each blog message get emailed to a mailing list. 
I first have to find a good html2text converter, or set up 
reStructuredText conversion (http://docutils.sourceforge.net/rst.html), 
or something, first though. John, how would you prefer things since 
you're the target user?

-e

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
skaller | 5 Mar 2007 08:57
Picon

Re: felix blog alpha

On Sun, 2007-03-04 at 23:32 -0800, Erick Tryzelaar wrote:
> Erick Tryzelaar wrote:
> > Hi Guys,
> >
> > So, you can see the pretty alpha version of a blog here: 
> > http://idle-minds.net. It's still missing some features, such as posting 
> > mails to the mailing list and trac integration. But check it out, and 
> > let me know what you guys think!
> >
> > Oh and John, I made an account for you to play around with, I'll mail 
> > that to you separately.
> 
> There's a couple things left to do before I'd want to make it live. Most 
> importantly is getting each blog message get emailed to a mailing list. 
> I first have to find a good html2text converter, or set up 
> reStructuredText conversion (http://docutils.sourceforge.net/rst.html), 
> or something, first though. John, how would you prefer things since 
> you're the target user?

I'm not the target user .. I'm already reasonably committed to
Felix.

There is a tension between generated and hand coded information.
Generated information is of course also hand coded, but it is
hand coded at a higher level. For example the Felix grammar
in ISO C/C++ style format is actually generated from the
Ocamlyacc source file.

In theory with a suitable tool, the language description
should be 'literated' in the same file to ensure a complete
(Continue reading)

Chris King | 5 Mar 2007 13:36
Picon

Re: monomorphisation pass

On 3/4/07, skaller <skaller@...> wrote:
> I have added a monomorphisation pass to the optimisation process.
> This pass is currently done before inlining, and makes monomorphic
> clones of Felix functions, procedures, classes, and variables.
> Types other than classes, and primitives are not monomorphised.

Awesome, I had a feeling something like this would make an appearance soon... :)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
skaller | 5 Mar 2007 14:13
Picon

Re: monomorphisation pass

On Mon, 2007-03-05 at 07:36 -0500, Chris King wrote:
> On 3/4/07, skaller <skaller@...> wrote:
> > I have added a monomorphisation pass to the optimisation process.
> > This pass is currently done before inlining, and makes monomorphic
> > clones of Felix functions, procedures, classes, and variables.
> > Types other than classes, and primitives are not monomorphised.
> 
> Awesome, I had a feeling something like this would make an appearance soon... :)

You aren't subscribed to felix-impl mailing list?

--

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
skaller | 5 Mar 2007 15:33
Picon

Re: monomorphisation pass

On Mon, 2007-03-05 at 15:06 +1100, skaller wrote:
> I have added a monomorphisation pass to the optimisation process.

> The main reason for doing all this is so that polymorphic calls
> to virtual functions of typeclasses become monomorphic which
> allows them to be instantiated, and subsequently inlined,
> so that there is zero performance penalty for using 
> virtual functions.

> Strangely this didn't fix the dispatch to 'ge' in Takfp ..
> well not so strangely, since this was monomorphic anyhow.
> The reason is probably that the dispatch is an "apply_prim"
> which isn't considered for inlining.

It aint so :) The reason is simpler: virtual functions are
marked 'noinline'. Here's the reason:

// total order
typeclass Tord[t]{
  inherit Eq[t];
  virtual fun lt: t * t -> bool;
  virtual fun gt(x:t,y:t):bool =>lt(y,x);
  virtual fun le(x:t,y:t):bool => not (gt(x,y));
  virtual fun ge(x:t,y:t):bool => not (lt(x,y));
  virtual fun max(x:t,y:t):t=> if lt(x,y) then y else x endif;
  virtual fun min(x:t,y:t):t => if lt(x,y) then x else y endif;
}

Consider the ge function. If we inlined the default definition, we'd
be left with a dispatch to lt. However we could have had:
(Continue reading)


Gmane