deliverance from complicated programing languages?

This is a discussion on deliverance from complicated programing languages? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; The goal is to create even greater applications then we have today. Therefore we need more easy programming languages. Logical, ...

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    88

    deliverance from complicated programing languages?

    The goal is to create even greater applications then we have today. Therefore we need more easy programming languages. Logical, if it`s more easy and it needs less time to program we can create better programs.

    For example I looked into ruby. It`s really great. Very easy to learn and foreign code is easy to understand some somewhat "logical". But it`s to slow and not possible to create "professional" big apps, for example I doub`t Firefox could be programmed in it with reasonable speed.

    C is MUCH harder (I hope no one argues which this opinion?), but it`s fast.

    Why not get all advantages together?

    The only thing we would need is a ruby to machine (not byte) code compiler. Will we get such a thing at some time? Or would it be really impossible to create such a compiler? Or do we need to wait until computers are so fast so the speed of the programming language does no longer matter?

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    It's possible to write a Ruby byte code compiler. Look at IronRuby. It's a project that creates MS DLR bytecode from Ruby code. I don't know how complete the project is (or how complete the DLR project is, even), but presumably, IronRuby should execute considerably faster than Ruby.

    The language itself plays a very small part in the speed of programs. It's all about the implementation. The original Ruby implementation is pretty simple, pretty extensible, and was pretty quick to program - the author wanted his new language to play with - but it's dog slow. Doesn't mean it's not possible to write a fast runtime for it.
    Similarly, there's CInt - a C interpreter. Guess what: compared to natively compiled C, it's very slow.

    On the other hand, the language does have some influence. Dynamically typed languages always have a speed penalty, because their variables must be capable of holding an object of any type. Sometimes you can determine, through static analysis, that a specific variable won't ever hold anything but a specific type, and you can optimize for that, but such static analysis is an enormous computation overhead and not practically feasible - even theoretically impossible in some cases, because dynamic languages like Ruby allow dynamic creation of code.
    A more realistic approach lies in tracing execution and just-in-time compilation. A piece of code is interpreted the first time it's executed, and the interpreter records information about it. On the second execution, this information is used to create machine code optimized for the same situation as the first execution, but if the situation is not the same, it will again be partially interpreted. Such deviation is noted, and better native code is created, and so on. The more often a piece of code is executed, the better the code becomes. This approach is used in virtual machines, of course, mostly with byte code.

    But this technology is young.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,556
    Usually, the easier the language is, the slower it runs due to the overhead it hides from the programmer. This is simply the way things work.
    Yes, it will probably be possible to create big applications like Firefox in a RAD language someday, but perhaps not today.
    There will always be a need for C/C++ I think, as there will always be a demand for RAD tools such as Visual Basic.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,441
    Quote Originally Posted by sept View Post
    Why not get all advantages together?
    One day someone may. This is not the end of programming languages design. The world is still turning. The fact we have different programming paradigms is also, as I see it, a proof that better programming methods are still being researched.

    However, software development is still in its infancy. I can only guess (hope, is a better word) the needs become increasingly complex, forcing software development in the same direction. In the light of this, there will always be a race between programming languages and market needs in terms of software complexity. What I'm trying to establish here is that complexity is not only a measure of the programming language syntax and semantics. It also relates to the problem the programming language is trying to solve at that time; something that seems obvious, but we overlook sometimes. So you can have an easy language to learn and program with. But if the problem is complex, the code needed to solve it will too become complex.

    ---

    As for speed (performance)... well, I'm very critic of this word. I think we overrate its importance. It is natural that, while discussing this topic lines like "this programming language is slow" or "performance is important" are commonplace. But let us be honest about it. Is it really that important?

    I say that for a very large percentage of what we do everyday, it isn't. This is not to say we shouldn't try and squeeze every cpu cycle out of our code when we can. This is to say instead we shouldn't do it when we don't have to if that presents us with new problems. If you take a critic unbiased look at whatever software you are developing at that time, you will see this is a big &#37; of your total code.

    This, after all, goes hand in hand with the same principles behind early optimization, which I should recall you is generally considered something one should avoid.

    So is ruby really that slow? Is C# really that slow? What about Java? No, they aren't for a large part of the world of problem solving. The exceptions to what I'm saying are there for everybody to see and are well known. However, just because I shouldn't develop a 3D game in Java, doesn't mean Java is slow. Same goes for C# or Ruby. It means they aren't the right languages for the task. Meanwhile, there are highly complex scientific programs developed in Java, for instance. So, are these languages really that slow?

    I suggest you put your hand over your conscious and give this a real thought. How slow is slow? This is the question, I guess. One that we seldom really ask.

    And for the last nail on the coffin of performance concerns...

    What will be faster? The same software developed not in Ruby, but C++. Or the same software developed in Ruby, but running on a better processor?

    You know the answer to this. Naturally, this is a generalization (this question would fail, for instance, the above 3D games). But you do know the question doesn't fail for a large part of the software domain.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,556
    Well, if we define slow as overhead per time period, then C# & co would be slow compared to C++, as they would take more cpu cycles to do the same as a C++ app.
    The whole reason we have C, for example, is that there is need for time critical code, especially on slow processors such as embedded.

    Many today do not heed the word "speed," but I really think they should. I think C# is bloated, for example, because it takes forever for a program compiled with it to start. And when it comes to complex tasks, these languages overhead adds to the time it takes, which, IMHO, is totally unacceptable since there are so many things on the computer that can take hours. If the code was just a little more optimized, imagine how many minutes could be cut off.

    Anyway, in the future when processors approach 128 x 1 THz, this may become irrelevant, but for today, I think it holds true.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,441
    Quote Originally Posted by Elysia View Post
    The whole reason we have C, for example, is that there is need for time critical code, especially on slow processors such as embedded.
    That is not the reason we have C. No programming language I know of was ever designed because "we needed performance". Check C history on wikipedia or other sources for the reason C exists.

    It is instead a characteristic of C. But other languages there are that outperform C in specific tasks.

    However you did use the word. Critical. That was my point all the time.

    I think C# is bloated, for example, because it takes forever for a program compiled with it to start.
    I have to confess I'm still to see a C# program "that takes forever to start". I have .net installed too on this aged PIII 1MHz with 500Mb RAM. And have been using software developed in C# (and have tried it myself) and I don't see what you see anywhere.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  7. #7
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,556
    Quote Originally Posted by Mario F. View Post
    That is not the reason we have C. No programming language I know of was ever designed because "we needed performance". Check C history on wikipedia or other sources for the reason C exists.

    It is instead a characteristic of C. But other languages there are that outperform C in specific tasks.

    However you did use the word. Critical. That was my point all the time.
    Not why C was invented, but why C still lives today, is what I meant. If we had no need for fast code, then we would see shifts towards more RAD, but C/C++ is still very popular, even today.

    I have to confess I'm still to see a C# program "that takes forever to start". I have .net installed too on this aged PIII 1MHz with 500Mb RAM. And have been using software developed in C# (and have tried it myself) and I don't see what you see anywhere.
    I'm thinking that's because you are "used" to "loading times." If something takes more than a second to start, I call it bloat because that's what most of applications, at least mine, take to start. It takes one second to start an MFC app and it takes 5 to start a .NET or C# one. Then I'd call it bloat, but it's all suggestive.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,441
    Quote Originally Posted by Elysia View Post
    Not why C was invented, but why C still lives today, is what I meant. If we had no need for fast code, then we would see shifts towards more RAD, but C/C++ is still very popular, even today.
    No. That's not the reason either was C is still a popular language. Please check the same sources for the real reason why C is still popular.

    If something takes more than a second to start, I call it bloat because that's what most of applications, at least mine, take to start. It takes one second to start an MFC app and it takes 5 to start a .NET or C# one. Then I'd call it bloat, but it's all suggestive.
    I believe you mean subjective. Yes, it is. Even more so, because I insist I don't see that happening here.

    Anyways yes, it's subjective. That was my point all the way. So it's not bloated. It's just slower. So, I'll ask again, how slow is slow?

    5 seconds to start an application on your machine is not slow. It's not worth a demerit of the programming language. That's just it.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  9. #9
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,556
    I believe you mean subjective. Yes, it is. Even more so, because I insist I don't see that happening here.
    Yes, of course... subjective. Silly dictionary.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Registered User
    Join Date
    Jul 2007
    Posts
    88
    Quote Originally Posted by Mario F. View Post
    As for speed (performance)... well, I'm very critic of this word. I think we overrate its importance. It is natural that, while discussing this topic lines like "this programming language is slow" or "performance is important" are commonplace. But let us be honest about it. Is it really that important?

    I say that for a very large percentage of what we do everyday, it isn't. This is not to say we shouldn't try and squeeze every cpu cycle out of our code when we can. This is to say instead we shouldn't do it when we don't have to if that presents us with new problems. If you take a critic unbiased look at whatever software you are developing at that time, you will see this is a big % of your total code.

    This, after all, goes hand in hand with the same principles behind early optimization, which I should recall you is generally considered something one should avoid.

    So is ruby really that slow? Is C# really that slow? What about Java? No, they aren't for a large part of the world of problem solving. The exceptions to what I'm saying are there for everybody to see and are well known. However, just because I shouldn't develop a 3D game in Java, doesn't mean Java is slow. Same goes for C# or Ruby. It means they aren't the right languages for the task. Meanwhile, there are highly complex scientific programs developed in Java, for instance. So, are these languages really that slow?

    I suggest you put your hand over your conscious and give this a real thought. How slow is slow? This is the question, I guess. One that we seldom really ask.
    Well, I am mostly interested in applications for end users. Example...

    Imagine you are Mozilla. Could you switch programming language to ruby? I don`t think so. It would be to slow on most average computers. Less people would use it and the less people use it the less money you earn. Therefore from commercial view the speed is REALLY needed in some cases (sure not all).

    I also don`t like it myself if apps needs loads of time to load or it lags while using it. Most programs I use are written in C or C++. Not because I am a fan, just because of felt speed.

  11. #11
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,556
    Indeed, I think this was my own point.
    Not to say C# is "slow," but C/C++ will always be faster than C#.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,441
    Quote Originally Posted by sept View Post
    Imagine you are Mozilla. Could you switch programming language to ruby?
    Well, I wouldn't if I were Mozilla because C++ has a larger user base and I could count on more people contributing to the code. Not to mention the fact Mozilla background and history is based on C and C++. It would be silly of me to pretend that much.

    However, say, a browser fully developed in Ruby capable of rivaling Firefox wouldn't shock me. The gecko engine is not a sublime piece of engineering. Far from that. I would wager Presto to be a superior engine (not to mention it's the only of the current 4 big ones that passes the Acid2 tests). And even if a browser/engine developed in Ruby was slower than Mozilla, but far more standards complaint and offering a richer functionality, wouldn't that be better?

    Again, ask yourself: How slow is slow? Say, 2 seconds extra, average, taking to load a page is unacceptable? Maybe for some. But it's not a reason to dismiss this language as a potential tool for just that if it happens I'm more proficient at it.

    Count two seconds in your head. Does that time span shock you? What if I told you the next computer processor would reduce that to just 1 second? And the next one to half a second?

    Well, I am mostly interested in applications for end users.
    Well, you should always learn more than one programming language. It's a matter of common sense. Even C or C++ aren't the best choices for some programming tasks. It will also give you more power over problem solving since you'll be the proud owner of more than one programming tool.

    As you well put it, it annoys you the fact C++ seems to overly complicate certain programming tasks, like that of developing for a GUI. It's not its fault really... it's the GUI API that complicates your life. But aside from that, what you should look at is spreading your knowledge through a few different tools and use the one that suits you best at the time.

    If you are developing a universal measurements converter, does it really matter if Ruby is slower than C++? Other things will instead come to your mind, like how fast can I do this in C++ or in Ruby? What language do I feel more comfortable programming with? Which one offers the least maintenance cost?
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  13. #13
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,673
    Quote Originally Posted by sept View Post
    Well, I am mostly interested in applications for end users. Example...

    Imagine you are Mozilla. Could you switch programming language to ruby? I don`t think so. It would be to slow on most average computers. Less people would use it and the less people use it the less money you earn. Therefore from commercial view the speed is REALLY needed in some cases (sure not all).

    I also don`t like it myself if apps needs loads of time to load or it lags while using it. Most programs I use are written in C or C++. Not because I am a fan, just because of felt speed.
    In my experience, software developers such as Mozilla don't really put performance on a pedistal as long as the demographics of the market make them capable of releasing something ever so slower (how many people are using PIV's now?). Instead I think the largest reason might be that Mozilla a) doesn't want to force people to install a third party graphics library that works with Ruby, b) likes the fact that C and C++ have decent exposure on 100&#37; of the market's platforms, or c) the industry is thinking that C and C++ are the only tools available that do socket programming well. Since web browsing applications need socket programming to work to some extent, and Mozilla has a desire to maintain its' own company code base (with which to base patch development, future versions, or new applications off of), I'm sure that has factored into their language decisions.

    What a language can do and how it's done often matters a great deal more.
    Last edited by whiteflags; 02-23-2008 at 08:27 AM. Reason: my spelling sucks ok

  14. #14
    Registered User
    Join Date
    Jul 2007
    Posts
    88
    Changing from C++ to ruby could work. Because someone who can C++ will be able to do ruby of course. It`s just much to slow. Wouldn`t take 5 seconds to render a page, but 30.

    For me two seconds matter. I use a special version of firefox, compiled special for my platform and rendering websites goes faster and with less lag.

    My interest is enormous but my time is limited. When I open a new windows i expect it to be open instant (felt for me) and not in 10 seconds. So for me it really matters. There are even people who complain about Firefox and prefer Opera because it renders still a bit faster and needs less ram.

    I also wrote before I started with C++ a little program with C# for me. The startup time and the feeling was really slow. I did send it to a friend and he asked me why it`s so slow.

    Of course there are times where the speed of C++ isn`t needed. For example for web programming just a few people use C++. Interpreted languages fit better here because there is already enough lag because of the connection.

  15. #15
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,441
    Quote Originally Posted by sept View Post
    There are even people who complain about Firefox and prefer Opera because it renders still a bit faster and needs less ram.
    Yes. Some people clearly don't get it.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Page 1 of 6 123456 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why C Matters
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 136
    Last Post: 01-16-2008, 08:09 AM
  2. Strange loop
    By D@rk_force in forum C++ Programming
    Replies: 22
    Last Post: 12-18-2004, 01:40 PM
  3. Languages dying
    By Zewu in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 07-29-2003, 10:08 AM
  4. Programming Languages
    By DarkViper in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-12-2002, 01:28 PM
  5. How can an api be accessed through other languages
    By Shadow12345 in forum Windows Programming
    Replies: 6
    Last Post: 10-21-2002, 07:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21