flat assembler
Message board for the users of flat assembler.

Index > Heap > Do you need C++?

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
vid wrote:
Quote:
__cplusplus, you mean - not upper-case . And I don't see how that's ugly, it's 6 lines total you need to add... and it's only necessary if you have a C-compatible interface that you want non-C++ code (C, asm, ...) to be able to call, anyway

also there is need for some special declaration of funcs which need to be called from assembly (which we of course need so often). And that is AFAIK non-portable-over-compilers, so you need another "header for every compiler", etc...

Razz Wink

You mean stdcall vs. C vs. fastcall, for instance? Yeah, that isn't standardized, but it's easy enough to work around without too much fuzz. Would it have been nicer if it was standardized? Certainly.

_________________
Image - carpe noctem
Post 22 Feb 2008, 01:01
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
i also meant exporting symbol with C name decoration, not C++ one.
Post 22 Feb 2008, 01:26
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
vid wrote:
i also meant exporting symbol with C name decoration, not C++ one.
That's exactly what extern "C" does Smile

_________________
Image - carpe noctem
Post 22 Feb 2008, 01:36
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
[angry]
NO!
stop the discution about the CCCCCCCC.
[/angry]
i don't need C, and if one day i want to code C like code, i will make it in asn$m, with fasmlib Wink
Post 22 Feb 2008, 01:40
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
edfed: are you still in your teens, or is it just because you're from france? Wink
Post 22 Feb 2008, 01:50
View user's profile Send private message Visit poster's website Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
BTW... I have an interesting question for you. If were allowed to learn only *one* programming language, which one would you choose? ASM, C, C++, Python, whatever? Very Happy
Post 22 Feb 2008, 03:35
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
OzzY wrote:
BTW... I have an interesting question for you. If were allowed to learn only *one* programming language, which one would you choose? ASM, C, C++, Python, whatever? Very Happy


Unless it was for specific needs, I'd probably say C++ - I do believe it's the single language you can get most out of. But I certainly wouldn't want to limit myself to one language.

_________________
Image - carpe noctem
Post 22 Feb 2008, 07:38
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
OzzY wrote:
BTW... I have an interesting question for you. If were allowed to learn only *one* programming language, which one would you choose? ASM, C, C++, Python, whatever? Very Happy
What do you mean by "asm"? Because there is x86 asm, ARM asm, Z80 asm, PPC asm, ... lots of options. If you mean all asm's then I would choose asm, if you mean a specific asm then it would not be very useful for me.
Post 22 Feb 2008, 07:42
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
forever young.

ALL ASMs
Post 22 Feb 2008, 12:19
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
That's exactly what extern "C" does

interesting, i always thought it only affects external dependencies, not exporting symbols from current module
Post 22 Feb 2008, 12:52
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
f0dder wrote:

Quote:
Do you have any experience with C++, or are you just plain ignorant talking out of your ass?


Please avoid such rude "hints" in future, thanks.
Post 14 Mar 2008, 03:44
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
DOS386 wrote:
f0dder wrote:

Quote:
Do you have any experience with C++, or are you just plain ignorant talking out of your ass?


Please avoid such rude "hints" in future, thanks.

Then you better stop throwing silly blanket statements like "C++ is crap" Smile

_________________
Image - carpe noctem
Post 14 Mar 2008, 06:59
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
f0dder wrote:
Then you better stop throwing silly blanket statements like "C++ is crap" Smile
I wouldn't say it's crap, but it's really silly or hard.

Like I said, C is very well structured and systematic (and C++ has some nice additions like references, too). But the OOP approach is simply silly and very difficult to understand. NOTE: I said understand, not "follow up what the code does". You can follow 'what the code does' with comments too. My point was: do you know what is executed, and how when you look at OOP code? I do not get why some people like OOP, but perhaps I am the weird one. When I look at OOP code, I find highly-obfustaced and hard to understand code -- some people even use blank member functions, which confuses me even more Mad!

And before you ask, I do have experience with C++ Razz
Post 17 Mar 2008, 12:50
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Quote:
do you know what is executed, and how when you look at OOP code?
Yes, I actually do - I might not know the 1:1 code generation, especially when program-wide/global optimization is enabled, but I have a pretty good idea of it, and can always check an assembly listing if I need to.

Point is that I don't need 1:1 knowledge of what code is generated, or I wouldn't be writing in a HLL. I know the performance pitfalls to avoid, and I can profile my code if it turns out that what I written isn't fast enough (and while my workstation is a quadcore with 8 gigs of ram, I have older boxes to test on - including a P2-350/64meg).

Quote:
I do not get why some people like OOP, but perhaps I am the weird one. When I look at OOP code, I find highly-obfustaced and hard to understand code
Perhaps you haven't worked with OOP enough, or perhaps you're just not wired for it Smile. I will also blankly admit that a lot of the C++ code you see on the internet is absolutely pure shit, and there are a lot of ways to shoot yourself in the foot, and write crappy & non-performing code.

There's some really nice things you can do with OOP code, though - especially because of object constructors/destructors. Using wrapper objects to handle resource allocation (and de-allocation!) go a long way in fighting against resource leaks, you can write safer/easier thread synchronization code, et cetera.
Post 17 Mar 2008, 14:11
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
f0dder wrote:
(and while my workstation is a quadcore with 8 gigs of ram, I have older boxes to test on - including a P2-350/64meg).


Wow, C++ must be bloatier than I remember. Smile

Actually, I can't wait for the day for that workstation to become your older box. (Ah, the future, so much promise.) Razz
Post 17 Mar 2008, 17:38
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
rugxulo wrote:
f0dder wrote:
(and while my workstation is a quadcore with 8 gigs of ram, I have older boxes to test on - including a P2-350/64meg).


Wow, C++ must be bloatier than I remember. Smile

*grin*

The 8 gigabytes of RAM was pretty much overkill, but memory modules were cheap, and it does mean I can run a lot of virtual machines at one time, that I can create a RAMdisk large enough for holding a DVD ISO, etc.

Many of my four cores sit idle most of the time, but it's nice when compiling large projects, when running multiple virtual machines, etc. Also, I have a lot of audio CDs I'm ripping to lossless FLAC for archival purposes, having multiple cores speed up the compression process nicely Smile

_________________
Image - carpe noctem
Post 18 Mar 2008, 00:40
View user's profile Send private message Visit poster's website Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
What about Object Pascal? Could it be a good substitute to C++?
I think current Object Pascal implementation of Free Pascal supports even generics.
Maybe it's a more readable language?
Post 18 Mar 2008, 05:14
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
OzzyY: dunno - I haven't really used pascal since the Turbo/Borland Pascal days (6.0 and 7.0, including 16bit pmode), apart from a few dabblings in Delphi. I left Pascal because there were no 32bit compilers back then, and I never really looked back.

Imho the syntax/readability differences between object pascal and C++ are pretty small, but OP felt a bit more restrictive, and some type checking that didn't make sense (char requiring typecasts before you can use it as an integer...). Also, C/C++ is probably the single language that has received the most attention, so compiler code generation quality is pretty high (well, at least for intel, MSVC, GCC - don't bother with Borland).

If I were to use another langauge than C++, it wouldn't be ObjectPascal, because they're too similar, and ObjectPascal doesn't offer any benefits as far as I can see. Objective-C might be worth learning, it's pretty different than C++ and is used for Mac OS X stuff. For scripting/prototyping, Python is very nice. For embedding, LUA is nice and lightweight.

And then there's all those funky & more or less academic languages, but I haven't had much incentive to look at those. LISP might be theoretically beautiful, but it's parenthesis soup and not very practical to me Smile
Post 18 Mar 2008, 05:27
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
f0dder wrote:
DOS386 wrote:
f0dder wrote:

Quote:
Do you have any experience with C++, or are you just plain ignorant talking out of your ass?


Please avoid such rude "hints" in future, thanks.

Then you better stop throwing silly blanket statements like "C++ is crap" Smile


NO. It's you who is wrong - this is a FASM forum, not a C++ forum Idea

BTW, we know now what happens if I pause responding to this thread: you just move elsewhere with your boasting: link1 link2

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 07 May 2008, 08:44
View user's profile Send private message Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
C++ code to read an unknown length line of text:
Code:
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string line;
    getline(cin, line);
    return 0;
}
    

Code the above in C, and you will understand why C++ is better and needed.

Then try coding the same in asm, for different kind of processors + OSs.
Mind boggles!

It is right to say that the C++ program uses pre existing C++ compilers+libs across all processors+OSs models.

But the stupid thing is to ignore them, since, they are there anyway.

And yes, to the original poster (Ozzy?), you do not need C++! Shocked
Enjoy asm Rolling Eyes

_________________
Attitude!
Post 07 May 2008, 12:43
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
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
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.