Discussion:
[fpc-other] $100,000 for C++ implementation of FPC's -CR option
Jonas Maebe
2015-08-13 20:47:10 UTC
Permalink
http://it.slashdot.org/story/15/08/13/1229239

In all fairness, they also optimise it so that they emit fewer checks
(if you check whether X of the correct type in one statement, you may
not have to check it again in the next etc) and hence reduce the run
time overhead. Still... :)
_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Nikolay Nikolov
2015-08-13 23:49:54 UTC
Permalink
Post by Jonas Maebe
http://it.slashdot.org/story/15/08/13/1229239
In all fairness, they also optimise it so that they emit fewer checks
(if you check whether X of the correct type in one statement, you may
not have to check it again in the next etc) and hence reduce the run
time overhead. Still... :)
Well, now all they need is a decent equivalent to Pascal's units
(instead of relying on preprocessor hacks such as #include), Pascal's
compilation speed, decent RTTI, class types (e.g. "class of tobject")
and C++ becomes a halfway-usable language :)

Nikolay
_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Ralf Quint
2015-08-14 00:37:21 UTC
Permalink
Post by Nikolay Nikolov
Well, now all they need is a decent equivalent to Pascal's units
(instead of relying on preprocessor hacks such as #include), Pascal's
compilation speed, decent RTTI, class types (e.g. "class of tobject")
and C++ becomes a halfway-usable language :)
"There are only two things wrong with C++: The initial concept and the
implementation.
-- Bertrand Meyer" :-P


Ralf

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Karoly Balogh (Charlie/SGR)
2015-08-14 08:02:20 UTC
Permalink
Hi,
Post by Jonas Maebe
http://it.slashdot.org/story/15/08/13/1229239
In all fairness, they also optimise it so that they emit fewer checks
(if you check whether X of the correct type in one statement, you may
not have to check it again in the next etc) and hence reduce the run
time overhead. Still... :)
Well, now all they need is a decent equivalent to Pascal's units (instead of
relying on preprocessor hacks such as #include),
Meet the C(++) Modules proposal:
http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf

I think CLang/LLVM already implemented it.
http://clang.llvm.org/docs/Modules.html

Almost like Pascal's units. :) Although they don't include namespaces and
not intended for binary distribution.

Charlie

_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Nikolay Nikolov
2015-08-14 09:16:47 UTC
Permalink
Post by Karoly Balogh (Charlie/SGR)
Hi,
Post by Jonas Maebe
http://it.slashdot.org/story/15/08/13/1229239
In all fairness, they also optimise it so that they emit fewer checks
(if you check whether X of the correct type in one statement, you may
not have to check it again in the next etc) and hence reduce the run
time overhead. Still... :)
Well, now all they need is a decent equivalent to Pascal's units (instead of
relying on preprocessor hacks such as #include),
http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf
I think CLang/LLVM already implemented it.
http://clang.llvm.org/docs/Modules.html
Almost like Pascal's units. :) Although they don't include namespaces and
not intended for binary distribution.
Yes, I know about them, but come on... Turbo Pascal introduced units in
1987 (in TP4). I think UCSD Pascal had them even before that (I never
used UCSD, so I don't know). Since then, they've become de facto
standard in pretty much every Pascal implementation that matters (even
though they're not in ISO Pascal). C++ has a draft proposal in 2012
(only 25 years after TP4) and only one compiler implementation in 2015.

Nikolay
_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Graeme Geldenhuys
2016-06-07 08:44:47 UTC
Permalink
Post by Nikolay Nikolov
Well, now all they need is a decent equivalent to Pascal's units
(instead of relying on preprocessor hacks such as #include), Pascal's
compilation speed, decent RTTI, class types (e.g. "class of tobject")
and C++ becomes a halfway-usable language
I've recently been familiarising myself with the Java language, and
later switched from using a plain text editor to using Eclipse IDE to
write my code. WOW, was I pleasantly surprised with Java and Eclipse.

- I could use compiled .class files created with Java 5, even though
I'm using Java 8. No recompile of the old code needed.
- Renaming a class in Eclipse is a single change - Eclipse even takes
care of the file name change.
- Because Java doesn't have a header unit (.h) or a Interface section,
renaming methods, types etc is a single edit change. No search and
replace needed.
- Write code that doesn't exist yet (eg: calling a method of a class
and with arguments). Then press Ctrl+1 and Eclipse implements that
method with the correct parameter types for you, in the correct file
and class. Awesome - especially if you code in the TDD style like
I do.
- Using Eclipse, I don't actually have to Compile my code - Eclipse
does it continuously in the background - that is also how it manages
to report errors or improvements against your code.
- Even though I'm using Java 8, I can tell Eclipse to recommend better
code, API usage etc against any earlier Java version. It knows
exactly what Java version supported what language syntax and
features. So the code generator will not generate code where certain
features did not exist in the selected compatibility Java version.
- Eclipse has an Outline Window, which shows you what a Pascal
Interface section would show. So even though Java doesn't have an
explicit Header or Interface section - it really isn't needed at
all, because the Outline Window tell you everything. Plus, simply
double click a method there and the code editor takes you to that
code. Want to rearrange the order of methods or fields? No problem,
and no need for Cut & Paste either. Simply select and drag them
around in the Outline Window, and Eclipse will move the actual code
for you.
- Enable Format on Save - so even if your indentation, alignment etc
are not according to the code formatting style you specified,
Eclipse will reformat your code on Save (all lines, or only changed
lines can be processed).
- Eclipse's Refactoring support is out of this world!


And that's just what I discovered in 2 days! I'm really starting to like
Java (and Eclipse) a lot. It has improved so much since my initial
introduction to Java from the late 90's.


Regards,
Graeme
_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other

Marco van de Voort
2015-08-14 09:00:10 UTC
Permalink
Post by Karoly Balogh (Charlie/SGR)
Well, now all they need is a decent equivalent to Pascal's units (instead of
relying on preprocessor hacks such as #include),
http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf
And Stroustrup is considering modules for C++17:

http://www.infoq.com/news/2015/04/stroustrup-cpp17-interview

_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Nikolay Nikolov
2015-08-14 09:33:28 UTC
Permalink
Post by Marco van de Voort
Post by Karoly Balogh (Charlie/SGR)
Well, now all they need is a decent equivalent to Pascal's units (instead of
relying on preprocessor hacks such as #include),
http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf
http://www.infoq.com/news/2015/04/stroustrup-cpp17-interview
Yes, I know about that too, but I'm still wondering why it took so long.
C++ has an "everything but the kitchen sink" approach, where they
introduce every programming language feature they can think of into the
language (they had generics before everyone else, they have multiple
inheritance, esoteric class inheritance modes ("protected inheritance",
wtf), template metaprogramming, etc.), so it's surprising modules took
so long.

Nikolay
_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Marco van de Voort
2015-08-14 10:13:19 UTC
Permalink
Post by Nikolay Nikolov
Post by Marco van de Voort
http://www.infoq.com/news/2015/04/stroustrup-cpp17-interview
Yes, I know about that too, but I'm still wondering why it took so long.
C++ has an "everything but the kitchen sink" approach, where they
introduce every programming language feature they can think of into the
language (they had generics before everyone else, they have multiple
inheritance, esoteric class inheritance modes ("protected inheritance",
wtf), template metaprogramming, etc.), so it's surprising modules took
so long.
I'm not deep in the C++ scene, Nico is probably better at answering this,
but if I would have to guess probably a matter of demand. Till now legacy
requirements outweight demand for a solution to this. Also because most C++
don't know or don't want to know the problems.
_______________________________________________
fpc-other maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Loading...