Author Topic: Believe It Or Not !!!  (Read 127599 times)

0 Members and 2 Guests are viewing this topic.

Offline Fanny Pack

  • Hero Member
  • *****
  • Posts: 645
  • Milliwatts: -20
  • Gender: Male
    • View Profile
Re: Believe It Or Not !!!
« Reply #60 on: September 03, 2009, 05:55:34 am »
First, all .NET applications are compiled to native code.  The difference between a C++ app and a .NET app is that a C++ app is shipped as a precompiled binary file.  A .NET application is shipped as an Intermediate Language assembly that gets compiled on the user's machine sometime prior to running it. 

In the normal case, such as with Spaghetti, the code gets compiled to native code as necessary.  This means when you start the application.  Once it gets compiled, it doesn't have to happen again until the next time you run the application or restart the computer or however it gets cached. So, when you start a .NET application there will be a slight delay due to this compilation.  But after it gets past that hump, it runs at speeds that are similar to C++.  Some code will run slower and some will run faster.  Math intensive code is likely to run faster in .NET because the code is compiled with the optimizations for the CPU turned on.  With C++, you have to compile it to the least common denominator CPU or else the code won't run on the low end systems.  So, the high end systems don't even get to take advantage of their advanced processing instructions in most C++ compiled applications.

Back to NGEN.  NGEN lets you precompile a .NET application so that it sits on your hardrive in a compiled state.  So, when you start it, there isn't that compile delay.  It is already done.  You could run NGEN on Spaghetti after it installed if you felt like it.  Or I could do it in the installer.  But, with relatively small sized apps like Spaghetti it doesn't make much difference since .NET compiles really fast.

Back to Intermediate Language that I mentioned at the start.  Intermediate Language is the native .NET language that all higher languages such as C#, VB.NET, managed C++, J#, F#, Delphi.NET etc. all compile to.  The syntax is similar to assembly language but not so low level.  A .NET application in DLL or EXE form is really just this source code stuffed into a file.  When you run the file, or NGEN it, the IL file is converted to native code, and then it gets executed.  So basically, .NET just puts the compiler onto the user's machine.  An advantage is that people can learn .NET languages that they feel comfortable with and the assemblies will all work together.  I can use a VB.NET DLL as easy as I can use a C# DLL, etc.  I obviously speak to all of those C DAC drivers with .NET just fine.

There is more to .NET than that, though.  It is a complete language and class library.  It is a managed, meaning that it takes care of garbage collection for you.  When you are done with an object it disposes it for you.  You don't have to delete objects.  But, you can use pointers, and you can have memory leaks, and you can call C, C++, and COM functions from .NET and it will work pretty much seamlessly.

A disadvantage of .NET is that is comes with a pretty big framework .  But, that is a one time cost and it comes with current versions of Windows anyway.  Also, the .NET framework is already NGENed so it sits on your machine as native code.  This allows .NET applications to be distributed in very small packages since all of that Windows Forms code is already sitting on your computer waiting to go.

C++ is a fine language but .NET is much more advanced.  Computer Science is the study of using computers to help mankind.  How can you argue that C++ is pure computer science when it is more difficult to use than .NET?  .NET is a result of computer science.  C++ is just a lower run on the ladder.    Just as an abacus is an even lower rung.  Who cares?  As long as the tool builds the prject?
« Last Edit: September 03, 2009, 06:35:54 am by Hyena »

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Believe It Or Not !!!
« Reply #61 on: September 03, 2009, 01:05:22 pm »
Quote
C++ is a fine language but .NET is much more advanced.

Not it is not.

It is much more specialized.

It might get you farther, faster within the world of MS.

But I can take my knowledge of C & C++ and use it universally on any computer anywhere!

I don't need to know anything about what libraries may or may not be there.

I know what's there; a blank text editor!

C & C++ follow IEEE rules of digital information storage and they are ANSI certified!

James.  :)
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline Fanny Pack

  • Hero Member
  • *****
  • Posts: 645
  • Milliwatts: -20
  • Gender: Male
    • View Profile
Re: Believe It Or Not !!!
« Reply #62 on: September 03, 2009, 06:12:45 pm »
In a thread talking about FLTK you say you don't need to know anything about libraries? 
What about SDL or whatever it is?  That's a library.
I call BS on what you say.

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Believe It Or Not !!!
« Reply #63 on: September 03, 2009, 07:32:22 pm »
I wrote EZFB.

It is a Linux video system API.

It talks directly to the video RAM.

That was my original library for LaserBoy development.

Other than the standard C/C++ libs, it was 100% my own code.

As I said, I like to start with an empty text editor!

I'd be just as happy to keep it that way, but SDL gives me an address to copy a bitmap to in any OS.

James.  :)
« Last Edit: September 03, 2009, 08:07:43 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline Fanny Pack

  • Hero Member
  • *****
  • Posts: 645
  • Milliwatts: -20
  • Gender: Male
    • View Profile
Re: Believe It Or Not !!!
« Reply #64 on: September 03, 2009, 08:12:01 pm »
You didn't invent the for loop.

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Believe It Or Not !!!
« Reply #65 on: September 03, 2009, 08:48:15 pm »
I don't know what to say to that.  :P

James.  :)
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline meandean

  • Sr. Member
  • ****
  • Posts: 466
  • Milliwatts: 13
  • It's about sight AND sound.
    • View Profile
Re: Believe It Or Not !!!
« Reply #66 on: September 03, 2009, 08:49:09 pm »
  Even in the multi-platform C++ world, you're going to depend on something to help you out (SDL, FLTK), so it's all a matter of
living with someone else's rules to be effective, but the concept of writing code without having to think much about the end user's system is compelling.

  Does MS offer any products that are written in .net?
"Patience is for the dead."

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Believe It Or Not !!!
« Reply #67 on: September 03, 2009, 09:09:22 pm »
... so it's all a matter of living with someone else's rules to be effective ...

Writing directly to the display as a chunk of ram is about as generic as it gets.

You can do that on computers that don't even offer any console or command prompt.

James.  :)
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline Fanny Pack

  • Hero Member
  • *****
  • Posts: 645
  • Milliwatts: -20
  • Gender: Male
    • View Profile
Re: Believe It Or Not !!!
« Reply #68 on: September 03, 2009, 09:41:46 pm »
You are right.  That's how I used to program my TRS-80. 

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Believe It Or Not !!!
« Reply #69 on: September 03, 2009, 09:59:56 pm »
Really?

So you could control the color of every individual pixel?

Or are you just saying that you wrote to a screen full of character cells?

Cause I used to do both of those things on my Commodore-64.

But, to be honest, I relied on calling code that I did not write.

I had a graphics routine in Commodore BASIC.

What's your point?

For the purpose of displaying 24-bit color vector art at any resolution that the display will support, I think it is exactly what you need to get the job done.

Today's computers are not any better than the ones we had in 1982. They're just bigger and faster. It's all the same stuff.

James.   :)
« Last Edit: September 03, 2009, 10:07:20 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline Fanny Pack

  • Hero Member
  • *****
  • Posts: 645
  • Milliwatts: -20
  • Gender: Male
    • View Profile
Re: Believe It Or Not !!!
« Reply #70 on: September 04, 2009, 06:28:30 am »
TRS-80s had memory mapped video but it wasn't pixel based.  Although, you could do that indirectly.  It was byte based and each byte contained 6 pixels.

But anyway, I use directX for my display on Spaghetti.  I don't have to worry about resolution or bits because the video card does that processing for me.  I just set my world size and tell it the size and location of my vectors, triangles, etc and it rendors it for me in 2D or 3D.  If I wanted, I could create the entire bitmap and then copy it to the video card.  That's what you are doing.  But, when dealing with vector art, it makes sense to hand the vectors off to the video card and let it draw them don't you think?  For one thing, it takes the burden off the main CPU and improves performance.  LaserBoy is all about speed, right?  Granted, there is no DirectX for linux but I assume you could use something like OpenGL which is supported on all platforms.

Offline Fanny Pack

  • Hero Member
  • *****
  • Posts: 645
  • Milliwatts: -20
  • Gender: Male
    • View Profile
Re: Believe It Or Not !!!
« Reply #71 on: September 04, 2009, 06:31:57 am »
Today's computers are not any better than the ones we had in 1982. They're just bigger and faster. It's all the same stuff.

That isn't true at all.  But, if you truly believe that it explains why you are dealing with them using antiquated methods.  I'm actually quite impressed with your achievements based on the tools you are using.  But, does it really make sense to build houses using only hand tools in this day and age?  Things like libraries are like buldozers, power saws, and Liquid Nails.

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Believe It Or Not !!!
« Reply #72 on: September 04, 2009, 02:49:23 pm »
I don't use a bulldozer to plant petunias.

It's a matter of getting EXACTLY what I want.

It's also a matter of training myself to know that this stuff isn't really so complicated that I need to rely on the work of other people.

It's a matter of personal pride.

The idea that there are "those guys" in the "ivory tower" who write all that "magical stuff" such that "mere mortal programmers" can coble together working applications is actually somewhat of a challenge to me, personally.

I am one of "those guys" and I write that "magical stuff" !!!

I absolutely MUST understand every aspect of what I'm doing on a computer!

The core hardware elements of a computer have not changed since about 1948!

Concepts of computer science and programming languages have developed quite a bit.

It is my choice to understand as much of that as possible.

The best way for me to understand it is to recreate it myself and work with it directly.

In the process, I have "accidentally" learned SO MUCH other stuff, that I never would have encountered any other way.

It's also a matter of portability and scalability. I can compile generic C/C++ on just about any kind of computer. I don't need to worry about the OS or if I can make OpenGL calls or whatever...

I abosolutely DO NOT enjoy programming because it's easy!

I love it because it is always more complex than I can currently understand!

James.  :)
« Last Edit: September 04, 2009, 02:57:45 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Believe It Or Not !!!
« Reply #73 on: September 04, 2009, 03:14:08 pm »
Then there is another matter.....

As hardware becomes faster and bigger, operating systems tend to grow and fill up the added capacity.

Imagine what it would be like if programmers thought about resources like they did back in the days when you could actually count from 0 to the end of your RAM, out loud, in English.

Think of the kind of speed and power you could have if you could use a full featured modern computer as a platform for your own embedded application.

Your process IS the computer.

A totally stripped out Linux kernel with frame buffer support is about as close as you will ever get to that.

James.  :)
« Last Edit: September 04, 2009, 03:16:31 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Believe It Or Not !!!
« Reply #74 on: September 04, 2009, 03:22:39 pm »
I think what it really comes down to......

is the fact that I am very lazy.  ;D

I hate to RTFM.  %)

I really do not like to have to read and learn about other people's libs and stuff.  :P

So I get a half-assed idea and find that it is easier and more fun to make it all myself.

James.  :)
« Last Edit: September 04, 2009, 08:17:55 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.7 © 2008-2024, SimplePortal