Yes, optimization is a great use for asm and can save a ton of time in operation.

The issue comes when you have to create this product for some end user and you have to add in all the icons and scrollbars, textfields, etc etc and make them all respond to inputs and what not. Java is no contest for quickness in creating the app, although it will be a bit more sluggish.

Its all the balance of creating versus operating.

No point in creating something thats going to be too old to use by the time its finished.

:idea:
I hear Sun is working on some type of new addon to Java thats supposed to be within the scope of machine level, at least the speed anyway. Could change some minds about straigt up asm someday.
Posted on 2004-09-27 19:02:13 by timoioi
Last time I saw java apps was the last time I wanted to see any,haven't installed the vm for firefox and never will. The last app was a simple interface to send srccode via LAN , and consisted of several buttons and a listbox - hadn't seen so slow and ugly interface in my life. The listbox scroll was so slow that I thought I'm running cool Flash with many effects on a 33MHz cpu instead of on a 2GHz Athlon ... :) still, a coder that no longer posts here has shown that some cool stuff can be made in java...
my point here is that instead of making possible for users to code lowlevel in java, sun have to get at least a bit good coders to make their UI better... and someone who isn't blind to determine UI default design :roll:
Posted on 2004-09-27 19:22:43 by Ultrano
I like asm becase i can make a EXE without an icon or with lots icons , but VB can not do (or i can't do it in VB,:(  ).
Now I can write lots of little programs using asm , i'll learn it everyday.
Thank u , Steve Hutchesson and  Iczelion , very much.
Posted on 2005-08-01 12:14:56 by shaojf2001
let me say: "when asm"
the c language represents an assembly preprocessor.
the benefit: some portability. the tradeoff: constructs more tricky than assembly itself.
asm good = even too easy
asm bad = difficult to maintain/change hudge program, need rewrite.

basic=interpreted script language (even if compiled)
dont't optimize (for code size) anymore.
Posted on 2005-12-01 07:13:36 by akidd86
I'm new to these forums, so..  well, I think i can post some of answers "why I like asm", since this topic is about that, isn't it?

Well, I started with C++ (mainly C) and it seemed magically to me..  this was until I first took a look at some assembly programs. After that, I started to dig deeper into the World of assembly, and read a few books (the best of all was "The Art of Assembly Language Programmers" by Randall Hyde (thanks Randy!))...  since then, I prefer to use asm so I can control every instruction (I use C++ mostly for testing and debugging, 'cause that's where they are much more powerful than asm for me  ;)).


Why Asm? Maybe because I don't want to be a lazy guy that thinks computers are simple (HLL tend to 'hide' and make things abstract, so you think 'it's easy', when in fact, the CPU and instruction set is pretty complex), and I think the phrase 'making it work is what matters' is not covering all the aspects (i.e. efficiency), so in my perspective, I need more than that (such as optimization). I am still trying to understand all the principles of hardware design, because I feel so wierd when I use C++ classes inheritance (mainly because it's so abstract, and because that has nothing to do with the CPU (how it reads instructions I mean  ;)), and also because it's very bloated and inefficient).

I also like Asm because I like to appreciate memory and CPU cycles...  a byte is still a byte, no matter if the user has 1MB or 256MB of RAM... same goes for clock cycles. Most people find an excuse for their bloated and inefficient programs -> the hardware will save me.  I chose asm because, even though there are tons of RAM or Mhz, I still appreciate every byte or cycle, because I can't find an excuse in that (and I am not old-fashioned, trust me  ;)). I usually ignore those people when they say that the hardware will save them.. after all, if hardware is better, why make software slower; a simple notepad typically requires very few memory and Mhz, but I've seen some people making one which required 100Mhz.. why? because they are lazy, or because they are abstracted by very High-level HLLs (like Visual Basic; C is not so high-level) and they think programming on a computer is easy? when, in fact, it's very complicated...  and why such a bloated application just for a simple "Hello World" program?

Thinking on that, I began to really understand every concept of the common PC.. and I'm still learning, by the way...  I really hate when HLLs abstract things from me, but sometimes I get to compile some C source code with my mind as I write.. heheh.. so I usually use C when I know it's not producing inefficient code..

Another reason for choosing asm might be because I like asm and it's fun, but that's not the strong one, you know.


As far as I'm concerned, compilers cannot optimize better than humans.. first, the human can simply look at the output of the compiler (i.e an .asm listing) and improve that code...  and humans can optimize certain sections of code because they special-optimize the task at hand; a compiler has no way to know if this section of code was designed for special purpose. Let me give an example:

Suppose you want to read some variable from memory, from a byte, into a 32-bit register... you know eax is right now smaller than 256, so in other words, it has the three high-bytes zeroed... the compiler will typically use a movzx instruction, or a xor and mov pair, because it simply cannot know this when statically compiling. This rule applies to all special-purposed sections of code..  Only the programmer knows what this code is really used for (and what's it gonna do).  Of course, you could add some special features to a compiler, like Visual C++'s __assume directive, but once these things get powerful, they will complicate the code a lot, and that's not the point in HLLs.

Of course, a beginning assembly language programmer will actualy do a lot worse than a compiler, but a professional assembly programmer will always beat a compiler. After all, the worst case scenario would be that the assembly programmer will simply look at what the compiler generated, and optimize that.  ;)


So, here I am... from a C++ freak, into an assembly language fanatic (and I mean a really optimizing-freak). Asm is also my 'chosen' language, because I prefer efficient code over easy code.



PS: I hope I have followed the forum rules, if not please please forgive me.. I'm new and I am still trying to, you know, get 'integrated' into these forums  ;).. again, I'm sorry if I have not followed the rules. please tell me so I will not do it again. And I didn't try to offense anyone, I'm just trying to explain "why I chose asm".. and my english is not so good, so please forgive wrong expressions, and I hope you understand what I wanted to tell you.


BTW: Great community. Keep up the good work, guys  :D

The Grey Beast
Posted on 2005-12-03 15:20:06 by The Grey Beast