Re: Java or C++?
- From: CTips <ctips@xxxxxxxxxxx>
- Date: Thu, 10 Nov 2005 22:52:49 -0500
Jon Harrop wrote:
CTips wrote:
Ah, now I see the problem. You're just not used to dealing with competent programmers. As a data-point, in the distant past, I implemented hindley-milner type inference in under a week.
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".
Second time around would probably be 2-3 days. Its pretty straight-forward, as
algorithms go.
Yes.
Hmm...I wonder whether the disconnect between people who use GC and people who denigrate it is a matter of capability. If you find it hard to get memory management right in C,
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]
Note that there is also a set of people who prefer C to C++ as well, mostly because of the predictability of the language. If one knows exactly what one wants done, one would like to work in an environment where all the intervening steps are as light-weight as possible. ANSI C is probably as light-weight as it gets, barring Forth.
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)
As an aside, I have implemented a JVM and a Prolog interpreter, and worked on both parallel and distributed GC. I've programmed *extensively* in LISP (starting on DEC-10s) and still have vague memories of the CLOS vs. LOOPS debate. I've used ML (SML/NJ) and Scheme a little. I've used Smalltalk on Xerox boxes [dandelions?]. I've used C++ since the cfront2 days. I've also written applications in SIMULA and developed hardware in VHDL. I've developed a light-weight environment for Forth (well, F-CODE).
My conclusion - if you're doing general purpose programming, C is the best language to use. You can get precisely what you want.
[BTW: the list above is nowhere near complete. I have developed at least a mid-sized program in PL/I, Ada-83, Python, Pascal, Modula-2, FORTRAN, various shell, vasious asm, and probably a few other languages that I've forgotten.]
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? Or (apart from the object stuff) that ML does not?
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.
.
- Follow-Ups:
- Re: Java or C++?
- From: Jon Harrop
- Re: Java or C++?
- 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++?
- Prev by Date: Re: Java speed: Reality versus theory?
- Next by Date: Re: What language would you use if you never cared for the world?
- Previous by thread: Re: Java or C++?
- Next by thread: Re: Java or C++?
- Index(es):
Relevant Pages
|