<div dir="ltr"><br><br><div class="gmail_quote">On Sun, Oct 19, 2008 at 2:08 PM, Achim Schneider <span dir="ltr">&lt;<a href="mailto:barsoap@web.de">barsoap@web.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
What kind of things, barring coding on Haskell-less platforms and<br>
library interfaces would you choose to do in C++?</blockquote><div><br>You&#39;re asking a crowd that is heavily biased towards Haskell, what they would use C++ for?&nbsp; You should expect many answers to be of the form, &quot;Well, if Haskell doesn&#39;t work, I&#39;ll try generating C or C++ from Haskell.&quot;&nbsp; :)<br>
<br>Which means, people here often see other languages as target languages for code generators.&nbsp; Which is something I think is pretty cool.&nbsp; But, getting back to your question...<br><br>If I were considering writing something in C++ here are some of my considerations:<br>
1) Is the thing I&#39;m writing known to be easy to solve in C++?<br>2) Will writing it in C++ instead of, say, Haskell give me access to a developer pool that is superior for the task?<br>3) Will dealing with the very few drawbacks of laziness, in particular lazy IO or space leaks from laziness, end up dominating the development effort?<br>
4) Is it a work related project?<br>5) Am I just making a prototype or executable specification?<br><br>I put (2) and (4) up there because I think it&#39;s important to consider who you&#39;ll be working with.&nbsp; I can&#39;t really get way with using Haskell much at my day job because I&#39;m the only one there that wants to use it.&nbsp; The company has to deal with the code I create even if I move on.&nbsp; Also, programming is hard regardless of how cool your language is.&nbsp; So it always seems wise to work with the sharpest set of programmers that you can.&nbsp; Sometimes that means picking a particular language.<br>
<br>It&#39;s also important to think about the merits of the languages themselves, such as (1), (3) and (5) point out.&nbsp; If you&#39;re prototyping, Haskell is light years ahead of C++.&nbsp; Then again, optimizing C++ programs, while tedious and error prone, is understood by far more people than optimizing Haskell programs.&nbsp; Laziness can be unpredictable.<br>
<br>I like Haskell a lot and I&#39;d bias all my answers to the above 5 towards it, but C++ is also a very cool language.&nbsp; It&#39;s just cool for very different reasons than Haskell is cool. <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

I&#39;m asking &#39;cos I&#39;m learning C++ and can&#39;t get the proper motivation to<br>
do any program I can think of in it: If I need abstraction, I&#39;m<br>
thinking Haskell or Scheme, and if I&#39;m thinking performance, C itself<br>
more than suffices. <br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Plus template programming makes me shudder because of its atrocities<br>
against clear and straightforward FP, but that&#39;s a different matter.</blockquote><div><br>Heh.&nbsp; Yeah, it can be ugly, but it&#39;s also very powerful.&nbsp; The template system is Turing complete as you may know.&nbsp; Boost and Loki are two good examples of some of the cool things you can do with C++ if you really work the template system. <br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Coming to think of it, a compiler from a clean syntax to C++ templates<br>
sounds like a fun project... which I&#39;d do in Haskell.</blockquote><div><br>Ah yes, even you&#39;re thinking about code generators.&nbsp; It&#39;s a very common way to think in this community it would seem.<br><br>Jason<br>
</div></div></div>