>hello world in C++ using stdio
>disassemble, it's about 4 pages
>hello world in C++ using iostream
>disassemble, it's about 80 pages
Hello world in C++ using stdio
I mean
When you think about it
Isn't it x86's fault?
>Use muh extensions
>Compiler becomes horribly bloated and insane just to squeeze 1-2%
Iostream is better because it's what i'm used to.
>try it
>c++ version is only 350 bytes larger
what kind of fucked up compiler you using OP
Why both of the files are cpp?
Why are you using g++ to compile c?
reading comprehension
Take a look at the print function in python, coupled with all the abstractions the whole thing goes through, and C/++ are nothing compared to it. It's just more visable.
mines about 550K larger for iostream
Have you made sure you're building using -O3 or the equiv? and also its not news that iostream is pretty large and slowish (compared to stdio) but much more typesafe.
Try using github.com
Its typesafe, fast and has normal function call syntax (versus iostream's
It also comes with a modern implementation of printf (fmtlib.net
I don't have O3 in my compiler, it defaulted to Ot
>I don't have O3 in my compiler
Throw it into the trash right now
This is getting interesting.
>I don't have O3 in my compiler, it defaulted to Ot
Its the stdlib write your own print() and strlen() or dynamic link to the platform stdlib. I would do the former.
how do i implement that, is it a syscall? I've always used printf or iostream
if anyone is interested:
open-std.org
>they told me all Jow Forums does is fizzbuzz in C
>it's much, much worse than they thought
if you want it to be smaller then stop statically linking your c++
msvc is not a good compiler
both are me and if you combine that advice you have to deal with the fact that some dynamic linking on windows is actually broken (ie ship a folder full of MS-API_CORE blah blah blah dlls)
What shit compiler are you using? Try MinGW-w64 or Clang.
Who cares how big it is?
It's going to use only relevant parts of it?
msvc compadre
thought it was something like printf("hello world");
wtf.
Uninstall it. Isn't that the shit compiler that doesn't even support C99 and creates registry entries for how often an executable is ran?
yeah windows is shit, use a real OS that actually pins library versions so dynamic linking isn't just for gags
I like windows
i like your mom but i'm smart enough to know not to stick around at her house on nights and weekends
d-dad?
no, this is tyrone
i've never heard someone seriously try to argue that gcc > msvc
You're disgusting.
what if he said he like Mac/UNIX?
I never really understood assembly generated by C++ code. When you compile a C++ code that only contains a std::string for example, you will get a hundred lines of code in assembly.
that makes two of us
lurk more faggot
What don't you understand? It's linking to the std::string object that has a billion methods and dependencies, which all have their own methods and dependencies
It adds up quick
Go look at how much adding a vector adds
>std::string object that has a billion methods and dependencies
if you're looking at the disassembly it's supposed to have culled the unnecessary methods in the linker.
iostream is buffered and there is
It's a pain to reverse.
just write to stdout
Why aren't you using radare if you are "reversing it"?
>Use more abstractions for easier time coding
>Pay for it in resources
Truly surprising yes
What you are referring to is C. The non faggot programming language that is not bloated and not niggerlicious like C++. C++ is for faggots and pajeets. Your solution should be simple and elegant, most C++ programmers don't know this. Instead of doing the simplest solution they write some clusterfuck in C++
I use it. But it's always a pain to reverse even if we can see the strings.
I've heard about radare before and learning some reverse engineering now, is it worth to look at?
>a solution in C
>simple and elegant
Choose one. C as a language is simple. Anything beyond fizzbuzz written in C is an atrocious clusterfuck.
Don't waste your time with radare it's unusable
Go download a copy of Ida, there was a 7.0 leak a while ago
Why radare is unusable?
I don't really want to use a proprietary software.
he would have invited me over 'for drinks'
For comparison, bare minimum assembly on 64 bit Linux is 15 lines, 8 instructions:
.globl _start
.data
string:
.ascii "hello world!\n"
length=.-string
.text
_start:
movq $1, %rax
movq $1, %rdi
movq $string, %rsi
movq $length, %rdx
syscall
movq $0x3C, %rax
xorq %rdi, %rdi
syscall
do you even need to exit? can't you just continue and get segfault or something?
Sure, but then it's not comparable to something compiled.
could also just jmp . until the end of time, but that's not very good either.
It's too bloated, has a billion features that don't work well
I know one of the main contributors, and he doesn't even use it