Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

EbonySeraph

Lower Level Languages

This topic is 5648 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been somewhat passive at learning ASM for the past few months. But then I have noticed a large number of people talking about higher level languages like C# and Java. It seems that using ASM is becoming less valued. Am I right in this assertion? It seems C++ with ASM optimizations isn''t the best way to program anymore - not like it ever was, but for game programming the best performance/development speed could come out of this combination. The reason I''m asking is mostly to know if learning a new high level language like C# or Java(knowing C++ now), would be more valuable than learning ASM. Out of humor...could there be an ASM.NET? That would be extremely funny and cool.

Share this post


Link to post
Share on other sites
Advertisement
hi,

It does seem that things are going higher rather than lower. my view leans towards these 2 facts:

1. compilers are very smart these days, its rare to find some code that you can write (natively) in ASM thats better than a C++ compiler can generate from C++ code.

2. it''s faster/easier to write in high-level code. maybe not the next Unreal-3/Quake-4 etc... but I highly expect some of the less taxing (processor) games to start saving development costs/time by using Java/C# etc...

just my thoughts!
Jack

DirectX 4 VB: All you need for multimedia programming in Visual Basic
Formula 1 Championship Manager, My Game Project.

Share this post


Link to post
Share on other sites
quote:
Out of humor...could there be an ASM.NET? That would be extremely funny and cool.


Please, kill me 1st.

Share this post


Link to post
Share on other sites
quote:
Original post by EbonySeraph
It seems that using ASM is becoming less valued. Am I right in this assertion?

It''s not an assertion, but it''s definitely correct. Programmer productivity is much more important than absolute screaming performance in most applications, and as processors become increasingly complicated hand-crafting high-performance assembly language becomes ever more difficult. Currently, very rarely will your hand-written assembly outperform compiler-generated assembly, particularly with optimizations turned on.

Besides, the biggest performance gains come from design improvements.

quote:
The reason I''m asking is mostly to know if learning a new high level language like C# or Java(knowing C++ now), would be more valuable than learning ASM.

I would contend that learning C# or Java is more valuable than learning assembly, not least because assembly language isn''t exactly a language: it''s an abstraction of the binary machine code that a specific platform executes, meaning that it differs for every processor (the Intel 80486DX is different - though only in subtle ways - from the Intel 80486SX; one of them lacks an FPU and all the attendant opcodes). If you write code in assembly, every time you transition to a new processor class you have to revisit significant portions of the codebase (even among the 80386-based Intel processors where new instructions and technologies can significantly alter code structure requirements).

Furthermore, JIT-compiled and runtime-interpreted languages are presenting potential benefits that can not be matched by static techniques, such as the possibility of tuning code as it runs for optimal performance on the particular processor/hardware combination - from the same source code.

quote:
Out of humor...could there be an ASM.NET? That would be extremely funny and cool.

Because of what I mentioned earlier (assembly isn''t really a language), there couldn''t be an ASM.NET unless a symbolically represented set of opcodes was employed - at which point we''d have an unnecessarily verbose high-level language. If you consider major syntax variations (AT&T vs Intel), then you''d understand how political this issue could also become. For reference, go take a look at how divided the (very small) LISP community is.

Share this post


Link to post
Share on other sites
One reason for the tendancy to higher level languages is their increased portibility (especially if portable libraries such as OpenGL are used); Java byte code of couse is so portable that it runs on any platform with a run time (windows, linux (mac as well?)) - similarly C# (except that I only know of a complete runtime for windows, equally that''s 95% of the home market).

That said there''s still a need for low-level programmers - who else is going to write the compilers! Some professional software will have low portibility requirements & be very power hungry - so optimisation will be required there (eg FEM - this can be using matrix operations on matricies of several thousand rows & cols).

ASM.NET - isn''t that called C# (or Java)?

Share this post


Link to post
Share on other sites
quote:
Original post by daerid
[quote]Original post by EbonySeraph
Out of humor...could there be an ASM.NET? That would be extremely funny and cool.


ASP.NET 80386 Assembly to .NET Intermediate Language Compiler

Actually, there is an ASM.NET, it''s called ILAsm. It is the assembly language for Microsoft Intermediate Language. It looks really weird and all, but you can use it. For a good article on it go here

-- Exitus Acta Probat --

Share this post


Link to post
Share on other sites
What about Win32 ASM? Its pretty straight forward, or at least I think it is. Really none of that mucking around with segment offsets. API calls are identical to those in VC++ just everything is seperated by a comma. Not that its a big factor but a simple window app in Win32 ASM is like 3k while one written in VC++ is like ~40k.

I screwed around with ASM to try and get a better understanding on how programming works, not to try and make something faster. I wish more schools made you take ASM just for that purpose.

Share this post


Link to post
Share on other sites
As has been said already - you are rarely going to write faster asm code than what a modern C++ compiler is going to generate with optimizations turned on. The bulk of your optimizations will be about picking the correct algorithms and datastructures for your programs. Compilers are never going to replace a bubble sort with a quick sort for you.

However, learning assembly is probably most helpfull for debugging your programs. Especially if you are writing in C++, being able to look at the generated ASM code in your debugger can be invaluable at times. Not saying every programmer needs to be an asm expert, but just being able to look at the screen and figure out what is going on can be a big help sometimes.

Still in the end, I think learning a high level langauge and a good design patern book would be more helpfull. Though knowledge is knowledge and you arent going to hurt yourself learning ASM.

Ratman

Share this post


Link to post
Share on other sites
Learn assembly. Learn assembly for different architectures. Learn x86 everybody''s favorite CISC (complex instruction set computer) machine, ARM/THUMB (gameboy advance) or Z80 (gameboy/gameboy colour/TI-83 graphing calculators) two examples of popular RISC (reduced instruction set computers) chips that are popular in embedded devices (lots of fun to program for). I''ve never done z80 though, but I''m 99.999% sure it''s a risc machine. That would make sence for an embedded processor after all. You don''t have to be an expert, but muck around with them a bit. If you get a half decent knowledge base of these different languages, computer architecture will make more sence, and with it, learning to write better code and an understanding of why that code can be executed faster. I''m working with ARM for the gameboy advance right now, and it''s alot of fun. Best of luck which ever way you go.

And just so I don''t seem TOO biased. I''ve screwed around with C# and I think its pretty cool. Was never a huge fan of java. I just finished off an auction system in java, it was a couple thousand lines of code. I was just staring at that mind corrupting code for link 6 hours tonight *puking noise*. Anyways, I suppose there both valid languages, and both have a strong following

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!