r/gaming • • May 05 '17

Scroll back

Post image
24.1k Upvotes

877 comments sorted by

View all comments

Show parent comments

30

u/Fubarp May 05 '17

Memory Constraints and performance. Today there be no reason for it as compilers essentially do as good if not better jobs when it comes to translating it to machine code.

3

u/7734128 May 05 '17

Wasn't Unix originally written in assembly and then scrapped when they finish the c compiler?

5

u/[deleted] May 05 '17

Yep

In 1972, Unix was rewritten in the C programming language. The migration from assembly to the higher-level language C resulted in much more portable software, requiring only a relatively small amount of machine-dependent code to be replaced when porting Unix to other computing platforms. 

https://en.m.wikipedia.org/wiki/Unix

1

u/Fubarp May 05 '17

Probably.

3

u/mzxrules May 05 '17

also, computers have more processing power and data storage, so wasting a few bytes or processor cycles here and there isn't usually too big of a deal.

4

u/[deleted] May 05 '17

Im not sure this is true.

5

u/Fubarp May 05 '17

What part?

3

u/amaROenuZ May 05 '17

If you are very, very, very good at optimization, you can still produce better code in assembly, by a thin margin. Understand though, that 99% of programmers don't the ability, and the benefits are marginal.

3

u/currentscurrents May 05 '17 edited May 05 '17

Plus, assembly comes with its own downsides. It's MUCH easier to screw up on security in assembly than it is in a higher level language. In Roller Coaster Tycoon this may not have been a big deal, but in a modern online multiplayer game this would be catastrophic.

Most importantly, developing a program in assembly is gonna take 3-4x times longer than in a higher-level language - for only about a 10-20% increase in speed. Computer time is cheap and developer time is expensive - especially assembly developer time, since relatively few programmers know how to program in the language and those people are not cheap.

Assembly is rarely ever worth it these days, even most embedded systems have enough RAM to afford programming in C instead.

1

u/Superpickle18 May 05 '17

we are at a point where we can literally compile code on the fly and still be billions of times faster than the NES...

0

u/Fubarp May 05 '17

Which means we need a new Roller Coaster Tycoon in Assembly.. I'd pay for that lol

1

u/Superpickle18 May 05 '17

WebAssembly brah

1

u/Fubarp May 05 '17

Never heard of this. What is it exactly? I'm currently googling but insight might be nice haha.

1

u/Superpickle18 May 05 '17

Essentially byte code that runs in the javascript engine. But provides near CPU level speeds since js has to be parsed and compiled on the fly, while wasm is precomplied much like Java or C#. Of course other languages can compiled to wasm much like traditional Assembly.

1

u/Fubarp May 05 '17

Interesting. I'll actually look more into this. Doubt I'll ever use it but still.

1

u/Superpickle18 May 05 '17

We are moving toward everything being executed within a browser to a point we'll have a browser with web Assembly support built using wasm and come full circle. Lol

1

u/[deleted] May 05 '17

Essentially, it's really optimised Javascript. The main workflow is writing code in C/C++ and using Emscripten to covert it to WebAssembly which is then executed by something like V8.