 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ken Hagan Guest
|
Posted: Thu Jun 26, 2003 7:19 pm Post subject: Re: Whats in store for C++ ? |
|
|
"Tom Houlder" <thoulder (AT) houlder (DOT) net> wrote...
| Quote: |
Ideally, the program should be compiled and linked in a few tenths
of a second after you have typed the last character that makes the
file well-defined C++. We can obtain this through caching and
tighter integration of the editor, the compiler and linker.
|
For sufficiently small programs, my system can already compile and
link in less than a second. For sufficiently large programs it is
impossible no matter what your language. Obviously most programs
sit somewhere in between, but build times haven't bothered me for
a number of years now.
In fact, making it easier to practice hack-n-debug programming is
a drawback. Modules need some benefits to outweigh that drawback.
Some or all of the following might qualify.
It makes it easier to learn C++.
It makes it easier to write large systems.
It makes it easier to catch mistakes.
It makes it possible to generate better code.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Michael Furman Guest
|
Posted: Fri Jun 27, 2003 12:29 am Post subject: Re: Whats in store for C++ ? |
|
|
"Ken Hagan" <K.Hagan (AT) thermoteknix (DOT) co.uk> wrote
| Quote: | "Tom Houlder" <thoulder (AT) houlder (DOT) net> wrote...
Ideally, the program should be compiled and linked in a few tenths
of a second after you have typed the last character that makes the
file well-defined C++. We can obtain this through caching and
tighter integration of the editor, the compiler and linker.
For sufficiently small programs, my system can already compile and
link in less than a second. For sufficiently large programs it is
impossible no matter what your language. Obviously most programs
sit somewhere in between, but build times haven't bothered me for
a number of years now.
|
Personally, I do not like fast compilation - it does not give me time to
think
(and, sometimes cancel it and do something else instead).
Michael
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Tom Houlder Guest
|
Posted: Fri Jun 27, 2003 12:30 am Post subject: Re: Whats in store for C++ ? |
|
|
"Ken Hagan" <K.Hagan (AT) thermoteknix (DOT) co.uk> wrote
| Quote: | "Tom Houlder" <thoulder (AT) houlder (DOT) net> wrote...
Ideally, the program should be compiled and linked in a few tenths
of a second after you have typed the last character that makes the
file well-defined C++. We can obtain this through caching and
tighter integration of the editor, the compiler and linker.
For sufficiently small programs, my system can already compile and
link in less than a second. For sufficiently large programs it is
impossible no matter what your language. Obviously most programs
sit somewhere in between, but build times haven't bothered me for
a number of years now.
|
Of course you can't build a full program much faster than today's
compilers do unless you happen to possess some completely
unknown wonder-technology.
But normally you only edit one file at the time and most often
only a single function. The compiler and linker should then run
in the background and highlight erroneous programming structures
just as an ordinary spell checker does. All complete statements
in a function, all complete functions in a class, all complete
classes in a file, etc should be compiled and linked behind your
back. When you change something only the necessary parts should
be recompiled.
If you change e.g. a class name or a namespace alias you might of
course end up having to recompile the whole system. But for most
of your daily editing there is very little CPU that's needed to
recompile and relink. A lot of caching is needed though.
But there is no magic here. In Chic we're experimenting with
exactly these things for context dependent completion. The idea
is that you should be able to use completion on what you've
just written while taking into account the rest of the file in
its current state. In the future we'll be able to feed a compiler
that can compile individual functions with every editing change
that happens.
| Quote: | In fact, making it easier to practice hack-n-debug programming
is a drawback.
|
Faster build times is definitely not a drawback. And with a
good type system and disciplined programming very few bugs
should go through the compiler, thus you will seldom even come
to the debugging stage.
--
Tom Houlder
[email]thoulder (AT) houlder (DOT) net[/email]
Chic - C++ without hassles
http://www.houlder.net
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Ed Avis Guest
|
Posted: Fri Jun 27, 2003 2:09 pm Post subject: Re: Whats in store for C++ ? |
|
|
"Michael Furman" <MichaelFurman (AT) Yahoo (DOT) com> writes:
| Quote: | Personally, I do not like fast compilation - it does not give me time
to think (and, sometimes cancel it and do something else instead).
|
Well it would not be difficult to write a wrapper
sleep 10; cc "$@"
or whatever the equivalent is on your system. So I think that
improving the speed of the compiler would keep everyone happy.
--
Ed Avis <ed (AT) membled (DOT) com>
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Ken Hagan Guest
|
Posted: Fri Jun 27, 2003 6:03 pm Post subject: Re: Whats in store for C++ ? |
|
|
Tom Houlder wrote:
| Quote: |
But normally you only edit one file at the time and most often
only a single function. The compiler and linker should then run
in the background and highlight erroneous programming structures
just as an ordinary spell checker does.
...[snip]...
When you change something only the necessary parts should
be recompiled.
|
That's what makefiles are for. Sure, they operate at a larger
granularity than single functions, but once you get compile-link
times for typical changes down below 5-10 seconds you've past the
point where they impede programmer productivity. I think we've
reached that point.
Besides, I'm the sort of guy who types the closing brace as soon
as I type the opening one and then "fills in" the body. Any system
that automatically rebuilds at that point is going to burning cycles
on a permanent basis, especially since I expect link-time code
generation and optimisations from any "next generation" product.
That steals time from the "cancer cure" screen saver that I run.
Your proposal is therefore anti-social. :)
| Quote: | But there is no magic here. In Chic we're experimenting with
exactly these things for context dependent completion. The idea
is that you should be able to use completion on what you've
just written while taking into account the rest of the file in
its current state. In the future we'll be able to feed a compiler
that can compile individual functions with every editing change
that happens.
|
Since this is already possible, it doesn't form a strong argument
for adding modules to the language.
| Quote: | Faster build times is definitely not a drawback. And with a
good type system and disciplined programming very few bugs
should go through the compiler, thus you will seldom even come
to the debugging stage.
|
....so there's seldom any need to build the system more than
once. :)
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Rayiner Hashem Guest
|
Posted: Sat Jun 28, 2003 12:35 pm Post subject: Re: Whats in store for C++ ? |
|
|
| Quote: | Personally, I do not like fast compilation - it does not give me time to
think
(and, sometimes cancel it and do something else instead).
I hope that is a joke. I can't think of any reason you might want to |
interrupt a compilation before it completes, except maybe if your
build system makes your computer explode running the final linking
step! Maybe "rm" should have a built-in 5-second delay?
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Tom Houlder Guest
|
Posted: Sat Jun 28, 2003 12:40 pm Post subject: Re: Whats in store for C++ ? |
|
|
"Ken Hagan" <K.Hagan (AT) thermoteknix (DOT) co.uk> wrote
| Quote: | Tom Houlder wrote:
But normally you only edit one file at the time and most often
only a single function. The compiler and linker should then run
in the background and highlight erroneous programming structures
just as an ordinary spell checker does.
...[snip]...
When you change something only the necessary parts should
be recompiled.
That's what makefiles are for. Sure, they operate at a larger
granularity than single functions
|
Even single functions isn't good enough, neither is individual
statements, you have to get all the way down to the tokens in
incomplete statements and analyze them and their surroundings.
| Quote: | but once you get compile-link
times for typical changes down below 5-10 seconds you've past the
point where they impede programmer productivity. I think we've
reached that point.
|
Imagine if it took 5-10 seconds to get an error message every
time you misspelled your user name or tried to cd down to a
misspelled directory. At least I would get furious. But we're
used to sluggish compilation. Lightning fast compile times will
open up entirely new possibilities.
| Quote: | Besides, I'm the sort of guy who types the closing brace as soon
as I type the opening one and then "fills in" the body.
|
So do I. Good tools must take such behavior into account.
| Quote: | Any system
that automatically rebuilds at that point is going to burning cycles
on a permanent basis, especially since I expect link-time code
generation and optimisations from any "next generation" product.
That steals time from the "cancer cure" screen saver that I run.
Your proposal is therefore anti-social.
|
You're entirely free to use your cycles as you wish. But
remember that the OS, the window system and an advanced
editor already use substantial CPU after every key you type.
| Quote: | But there is no magic here. In Chic we're experimenting with
exactly these things for context dependent completion. The idea
is that you should be able to use completion on what you've
just written while taking into account the rest of the file in
its current state. In the future we'll be able to feed a compiler
that can compile individual functions with every editing change
that happens.
Since this is already possible, it doesn't form a strong argument
for adding modules to the language.
|
It's only possible if you follow certain rules, basically if you
write solid code such as self-consistent header files and have
no order dependencies. But the bulk of the code out there has
one nasty little hack there and another there so it's a lot harder
to get things really good unless some issues are handled at the
language level.
--
Tom Houlder
[email]thoulder (AT) houlder (DOT) net[/email]
Chic - C++ without hassles
http://www.houlder.net
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Rayiner Hashem Guest
|
Posted: Sat Jun 28, 2003 11:08 pm Post subject: Re: Whats in store for C++ ? |
|
|
| Quote: | That's what makefiles are for. Sure, they operate at a larger
granularity than single functions, but once you get compile-link
times for typical changes down below 5-10 seconds you've past the
point where they impede programmer productivity. I think we've
reached that point.
First, it takes a lot of work to get a makefile setup that compiles a |
typical change in 5-10 seconds. Second, it doesn't always work. In my
current (fairly small) project, which uses CORBA, a change to a single
file requires reparsing many of the large header files generated by
the CORBA idl compiler. As a result, even a simple change can take
upwards of 30 seconds to compile on my 2GHz P4. Now, you can minimize
this time by smart layout of header files, but that requires
organizing the header files to satisfy the build system, rather than
organizing them logically. If C++ had a proper modules system, entire
chapters of fairly bad advice (cluttering headers with forward
declarations to avoid including large headers, fragmenting header
files into units smaller than what is logical, etc) could be removed
from books. And thanks to templates, you can't minimize build time
even if you try. Include Boost.Lambda in your project and watch your
compile times increase by 5-10 seconds for *each* file that uses
lambdas! And god help you if you make a tiny change to a header (even
in a comment) and have to sit through a recompile of 50% of the source
files in the project.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Andy Sawyer Guest
|
Posted: Sat Jun 28, 2003 11:39 pm Post subject: Re: Whats in store for C++ ? |
|
|
In article <bd6rq0$p94gd$1 (AT) ID-153032 (DOT) news.dfncis.de>,
on 23 Jun 2003 14:04:26 -0400,
Markus Werle <numerical.simulation (AT) web (DOT) de> wrote:
| Quote: | How do You perform compile-time differentiation in lisp?
|
eval-when-compile seems like an obvious place to start looking.
--
"Light thinks it travels faster than anything but it is wrong. No matter
how fast light travels it finds the darkness has always got there first,
and is waiting for it." -- Terry Pratchett, Reaper Man
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Thomas Hansen Guest
|
Posted: Sat Jun 28, 2003 11:41 pm Post subject: Re: Whats in store for C++ ? |
|
|
On 19 Jun 2003 04:24:38 -0400, there came a drop of sanity from Andy
Sawyer <andys (AT) despammed (DOT) com> containing:
| Quote: | In article <bcqd6d$lqugr$1 (AT) ID-144146 (DOT) news.dfncis.de>,
on 18 Jun 2003 22:13:09 -0400,
Albrecht Fritzsche <albrecht.fritzsche (AT) tiscali-dsl (DOT) de> wrote:
PS: As an aside - I must admit that a complete GUI program like the
following has quite some fascination. Any C++ program heading for the
same would look much more complex
class HelloWorld {
public static void Main()
{
System.Windows.Form.MessageBox.Show("Hello, World!");
}
}
(it's a complete C# program)
And the C++ equivalent is:
#include
int main() // or you can do the WinMain thing if you prefer
{
MessageBox( NULL, "Hello, World!", "", MB_OK );
}
(it's a complete C++ program)
Which doesn't "look much more complex" to me.
Maybe a bad example doing the messagebox thing, but still the concept |
is still very much alive...
Do THIS in C++!!!!
:
class X
{
public static void Main()
{
System.Windows.Forms.Form form =
new System.Windows.Forms.Form();
form.ShowDialog();
}
}
You would spend at least 20 times as much code unless you use QT, fltk
or something similar...
--
"FOOT-AND-MOUTH BELIEVED TO BE FIRST VIRUS
UNABLE TO SPREAD THROUGH MICROSOFT OUTLOOK"
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Vinayak Raghuvamshi Guest
|
Posted: Sun Jun 29, 2003 9:15 pm Post subject: Re: Whats in store for C++ ? |
|
|
Thomas Hansen <thomas.hansenNOSPAMORILLSUEYOURXXX (AT) adramatch (DOT) com> wrote
in message news:<c0lrfv4ig15vdgd0cmke8junglm6kug9nu (AT) 4ax (DOT) com>...
| Quote: | And the C++ equivalent is:
#include
int main() // or you can do the WinMain thing if you prefer
{
MessageBox( NULL, "Hello, World!", "", MB_OK );
}
(it's a complete C++ program)
Which doesn't "look much more complex" to me.
Maybe a bad example doing the messagebox thing, but still the concept
is still very much alive...
Do THIS in C++!!!!
:
class X
{
public static void Main()
{
System.Windows.Forms.Form form =
new System.Windows.Forms.Form();
form.ShowDialog();
}
}
You would spend at least 20 times as much code unless you use QT, fltk
or something similar...
|
So what does this code have to do with the C# language per se ? if you
use Managed C++, you can do the exact same thing using the same number
of lines. I think many folks are confusing the .Net platform with the
languages like C# that use that platform.
In what way is C++ using something like QT inferior to C# using .net ?
WAKE UP...
-Vinayak
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Rayiner Hashem Guest
|
Posted: Sun Jun 29, 2003 10:14 pm Post subject: Re: Whats in store for C++ ? |
|
|
| Quote: | You would spend at least 20 times as much code unless you use QT, fltk
or something similar...
But why wouldn't you use Qt or fltk? They are libraries that are there |
to be used, just like Win.Forms. Just because Win.Forms is a standard
part of .NET doesn't make it any easier to use than something like Qt
or fltk.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
John Potter Guest
|
Posted: Mon Jun 30, 2003 9:22 am Post subject: Re: Whats in store for C++ ? |
|
|
On 28 Jun 2003 08:34:24 -0400, [email]heliosc (AT) mindspring (DOT) com[/email] (Rayiner Hashem)
wrote:
| Quote: | In C++, compile speed is more important than in other
languages because there is no interactive compiler to allow you to
test algorithms out. The compile-debug-recompile cycle is a fact of
life.
|
Thank you very much. I now have a chance of understanding why C++ code
is hack-and-hope. I had been under the misconception that solutions
to problems were designed. I now understand that programmers have no
idea of how things work and only keep trying until they get something
like the specification. If it works x% of the time, that is good
enough. Quick compiles to reach that magic x are important.
John
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Tom Houlder Guest
|
Posted: Mon Jun 30, 2003 4:03 pm Post subject: Re: Whats in store for C++ ? |
|
|
"John Potter" <jpotter (AT) falcon (DOT) lhup.edu> wrote
| Quote: | On 28 Jun 2003 08:34:24 -0400, [email]heliosc (AT) mindspring (DOT) com[/email] (Rayiner Hashem)
wrote:
In C++, compile speed is more important than in other
languages because there is no interactive compiler to allow you to
test algorithms out. The compile-debug-recompile cycle is a fact of
life.
Thank you very much. I now have a chance of understanding why C++
code
is hack-and-hope. I had been under the misconception that solutions
to problems were designed. I now understand that programmers have no
idea of how things work and only keep trying until they get something
like the specification. If it works x% of the time, that is good
enough. Quick compiles to reach that magic x are important.
|
Thank you very much. I now have a understanding of what programmers
I will hire. As an average programmer writes about 30 lines a day he
doesn't really need a compiler, maybe not even a computer. He can
spend his day working out his algorithm on paper, give it to me and I
will
integrate his impeccable code into the system. Hey, that's what
FORTRAN programmers did in the 50's.
Have you ever worked on a large-scale C++ program? It's not the same
as a five-liner destined for Obfuscated C++.
--
Tom Houlder
[email]thoulder (AT) houlder (DOT) net[/email]
Chic - C++ without hassles
http://www.houlder.net
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Francis Glassborow Guest
|
Posted: Mon Jun 30, 2003 4:06 pm Post subject: Re: Whats in store for C++ ? |
|
|
In message <c5avfvcngd4b9jpqb4ieubaoabri9rfme5 (AT) 4ax (DOT) com>, John Potter
<jpotter (AT) falcon (DOT) lhup.edu> writes
| Quote: | Thank you very much. I now have a chance of understanding why C++ code
is hack-and-hope. I had been under the misconception that solutions
to problems were designed. I now understand that programmers have no
idea of how things work and only keep trying until they get something
like the specification. If it works x% of the time, that is good
enough. Quick compiles to reach that magic x are important.
|
Yes, in the days when a compile cycle had a 24-hour turn round if we
were lucky certainly motivated us to work on design rather than try it
and see. It is one thing to use a compiler to check for typos, quite
another to use it to test the correctness of our code or the closeness
to the required solution.
--
ACCU Spring Conference 2003 April 2-5
The Conference you should not have missed
ACCU Spring Conference 2004 Late April
Francis Glassborow ACCU
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|