Re: Java or C++?
- From: Jon Harrop <usenet@xxxxxxxxxxxxxx>
- Date: Fri, 11 Nov 2005 09:28:26 +0000
CTips wrote:
>> That's about 300LOC in ML and is a (tiny) first step towards writing a
>> compiler for a FPL.
>
> OK. I suspect that you're talking about basic type inference not the
> Alex Aiken et.al. "enhancements".
I've never heard of Aiken. Do you mean this specifically:
http://citeseer.ist.psu.edu/aiken93type.html
The derived works by Damas and Mycroft are more famous. I had a look at the
former but not the latter. There are many other extentions as well, e.g.
the rest of OCaml's type system.
>> What if you have better things to do with your time than implement all
>> memory management by hand?
>
> I haven't noticed it cutting down on my productivity at all. Of course,
> for the stuff we do, its the algorithms do tend to be complex, so I
> assume for someone who does simple algorithms and/or small programs the
> memory management might dominate [though I find it hard to believe]
I found it prohibitively tedious to factor code without fundamental
constructs like closures, and prohibitively error-prone without static type
checking.
>> Again, I don't contest that C is great for trivial programs where you can
>> actually list the "intervening steps". For anything intrinsically
>> complicated, C is hopelessly ineffectual.
>
> Lets see: compilers - C. OSes - C. Real-time programs - C. EDA tools -
> C. Network routers - C. Care to name something that is intrinsically
> more complicated than those programs? (Well, I can think of a few that
> might be - a bunch of numerical programs, some medical imaging stuff,
> FEM packages, ATC, SABRE - but I suspect several of those are done in C
> as well)
If you mean there are some such projects written in C then yes, sure,
especially old ones. However, the cores of OS's are probably best written
in C. Hard real-time programs maybe, not soft real-time though (e.g.
visualisation). EDA tools, no. Network routers, no.
As for more complicated stuff, there's lots of more complicated stuff like
compiler writing, theorem proving, CAS, scientific computing,
visualisation, concurrent programs, IDEs...
>> Have a play with some more modern languages like OCaml and Haskell.
>
> I don't know - what does OCaml have that, say, LISP with CLOS does not?
Brevity.
Better performance.
More expressive type system.
Static type checking.
Easier functional programming (HOFs, currying etc.)
....
> Or (apart from the object stuff) that ML does not?
Better pattern matching.
Easier-to-use parsers.
Macros.
....
> Basically - I have all the power I need in C. I've seen what can be done
> in other langauges. It can pretty much all be recreated inside C.
It can "pretty much" be recreated in any Turing complete language, so that
isn't a valid argument in favour of C.
--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.
- References:
- Re: Java or C++?
- From: Jon Harrop
- Re: Java or C++?
- From: CTips
- Re: Java or C++?
- From: Jon Harrop
- Re: Java or C++?
- From: CTips
- Re: Java or C++?
- From: Jon Harrop
- Re: Java or C++?
- From: CTips
- Re: Java or C++?
- From: Jon Harrop
- Re: Java or C++?
- From: CTips
- Re: Java or C++?
- From: Jon Harrop
- Re: Java or C++?
- From: CTips
- Re: Java or C++?
- From: Jon Harrop
- Re: Java or C++?
- From: CTips
- Re: Java or C++?
- Prev by Date: Re: What languages have simple syntax?
- Next by Date: Re: what prgramming laguage
- Previous by thread: Re: Java or C++?
- Next by thread: Re: Java or C++?
- Index(es):
Relevant Pages
|