Troy Martin wrote:UbarDPS wrote:Most compilers are self-hosting these days. C/C++ compilers can compile themselves, FreePascal can compile itself, and GNAT can compile itself - those are just a few examples. Lots of compilers have inline assemblers, and they've been self-hosting since the 1980s. You don't need to do compilers in Assembly, even if the compiler emits Assembly that is then assembled to object code by an Assembler (like the Compile-via-Assembly option that many C/C++ and other compilers have).
How do you think they were written before they were written (for self-hostingness)? Probably using another compiler or an assembler. ASM is an important thing.
Bottom line: Assembly is important, HLLs can be used if you either want something done for you or don't want to spend the time writing stuff out the hard way and getting practice for it, and people have different opinions.
/thread
I never said Assembly wasn't important; and, yes, you can write compilers in high level languages (there are hundreds of examples). After the compiler (and [language] implementation) is complete, you simply rewrite it in that language. FreePascal and GNAT have illustrated how this can be done, as have many other compilers (Delphi, for example).
Using Assembly in Compiler Construction is not on the level of being able to write a small OS in Assembly. The Compilers are written primarily in the HLL, and optimized in Assembly. Optimization comes after the initial coding, debuggin, and profiling. Not before. Using Assmebly as a way to pre-optimize algorithms [because you
assume yours will outperform a compiler] is not always the smart thing to do. An Assembly Coder cannot always outperform a Compiler. Some compilers have very aggressive (and [largely] correct) optimizers.
It's not about being lazy and wanting things easy, it's about productivity and turnaround - an area where HLLs are vastly superior to Assembly Language (if you take the time to learn them). That is the reason why
most non-embedded Operating Systems are written primarily in a HLL, with Assembly where needed. You are always free to profile you code and fine-tune it later, using Assembly where needed.
Read the post I responded to, and put my post into that perspective. The responses are too general, almost to the point of disingenuous...
Read the post, I have not disagreed with any of these sentiments IRT the importance or usefulness of Assembly - I have even stated that I still use it. I don't know where that other poster got the translation where I said Assembly was
useless.
I simply disagree that OSDev should require one to have Assembly Language knowledge required to write an Operating System in Assembly Language - and only Assembly Language. Architectural Knowledge != being an Assembly Language Guru. Assembly is just the lowest-common demoninator. Know enough so that you can get done what needs to be done in Assembler, or when it cannot be done [as easily] using a HLL or inline assembler.
I am quite aware that various things like drivers are written in assembly language, often. I know that there is a lot of embedded development done in [almost] 100% Assembly Language; however, I think learning Assembly Language to that level is a waste of time when you could be mastering a HLL that would allow for higher productivity, while using Assembly where required.
Are you going to rewrite all the software you want to port in Assembly because you don't have a firm grasp on C/C++ when your OS is complete? Are you going to write all of you APIs in Assembly (lol and using NASM to boot, must be great)?
I'm thinking ahead. How is this liberal use of Assembly actually help the development cycle down the road? My guess is that it will add unneeded complexity and make code-maintenance more of a nightmare than almost any HLL - that is, after all, one of the reasons so many developers (systems and application developers) have moved away from using Assembly Language as a primary development language... It will also kill portability, and contrary to what the other poster wrote - it does matter.
I don't want to have a circular argument. That post was quite clear.
A good understanding of Assembly is required, but being able to write a small OS in Assembly is not a prerequisite to [serious] OSDev [i.e. for Novices]. Sorry. I am quite aware that Assembly is a bit overrated at these forums (I have been lurking for quite a bit and reading thread back to 2005 or so), so I'll just leave it at that. (You'll free to respond though, I'm not saying that I will cease to acknowledge anything that anyone is saying... Just that I will agree to disagree
)
Thanks for you time.
LOL @ "/thread"... Seriously... People do have different opinions, but the thread doesn't end after you give yours.
DISCLAIMER: This is my Opinion.