Theiling Online    Sitemap    Conlang Mailing List HQ   

OT: Power in programming languages.

From:Keith Gaughan <kmgaughan@...>
Date:Thursday, January 6, 2005, 14:02
Chris Bates wrote:

>> > and because there are some things difficult to do in perl which are >> > easier in C. So succinctness definately isn't all. >> >> Nope, it's down to problem domain. It's all problem domain. > > You basically seem to be agreeing with me. I didn't say C was always > easier. I was just arguing that succinctness wasn't power, and indeed it > isn't since different languages are designed to do different things > regardless of how succinct they are.
I disagree with your comparison. You can't compare C and C++ to the likes of Perl, Java and C++. They're aimed at different problem domains BTW, I kept on throwing O'Caml in there because I was hoping somebody'd pick it up. O'Caml manages to work well across both the systems and applications domains, and its compiler generates code as fast as any C++ compiler. It's succinct, and it gets out of your way, having type inference and inforcing neither an imperative nor functional style, nor does it require you to use objects if you want. Yet some parts of O'Caml are written in C, particularly things that need to be close to the metal such as basic heap operations, i/o, and the like. But O'Caml is still the more powerful language. Why? Because you have to worry about fewer things in O'Caml than you do in in C, types and memory being examples. This is the best measure of power. And it does it without sacrificing speed.
> Perl, being a high level language, > is more succinct than C, but there are some things that are difficult to > do in perl because they're way beyond what it was designed for (a text > processing and scripting language basically). I would not for instance > attempt to write an operating system in perl.
The same goes for C. But the reason why Perl is poor for writing low-level code in is that, like any high-level language, it doesn't provide direct access to the hardware. It doesn't make sense. C does, mostly. At least it gives you direct access to memory via pointers, and many compilers allow you to embed assembly directly into the code. But does the fact that you need to embed asm in places mean that asm's more powerful than C? No. Does the fact that people write bits of their Perl, Python and Ruby programs in C for speed make C more powerful? Nope. The amount of time and brainpower a language saves the programmer is a better measure. Working on the problem is better than code micromanagement.
> Note, we might be talking about different definitions of the word > power. I'm not talking about ease of doing things. THat isn't power. > Just because a car has an automatic gear box doesn't mean it's more > powerful than one with a manual. Power is how much you're able to do > with something, not how easy it is.
So am I, ergo O'Caml. If you define power by how close you get to the metal, assembly is obviously what you want. If being able to code close to the problem domain is how you define power, the likes of Ruby and Python are better. C is used as a jack-of-all-trades language. So is C++, and so is O'Caml. But O'Caml allows you to code closer to the problem domain than either the others without sacrificing speed. It's more powerful because it gives you more tools and better tools. K. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 03/01/2005

Reply

Mark J. Reed <markjreed@...>