BASIC

Author Topic: Very Newbie question about INLINE  (Read 7791 times)

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Very Newbie question about INLINE
« on: 2012-Mar-19 »
HI in my future projects I like put INLINE commands... I think after all this time I not use, and yet it´s the time  :-[

Only a question, I think it´s truly but only for sure...

Making mathematics calculus INLINE it´s more faster than GLBasic... or I need to make the code in a real .Cpp Source and after implement in GLBasic, or it´s ecaxtly the same

Thanks in advance...

MrTAToad

  • Guest
Re: Very Newbie question about INLINE
« Reply #1 on: 2012-Mar-19 »
Technically it could be faster inline as you wouldn't have to deal with DGNat classes.  However, whether the actual speed increase is noticable is another matter :)

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Re: Very Newbie question about INLINE
« Reply #2 on: 2012-Mar-19 »
Thanks...

Offline TI-994A

  • Community Developer
  • Mr. Polyvector
  • ******
  • Posts: 112
  • You can do it in BASIC!
    • View Profile
Re: Very Newbie question about INLINE
« Reply #3 on: 2012-Mar-20 »
Technically it could be faster inline as you wouldn't have to deal with DGNat classes.  However, whether the actual speed increase is noticable is another matter :)
Hello again, MrTAToad.

Correct me if I'm wrong, but since GLBasic isn't an interpretive compiler, shouldn't it not make any difference? Classes or not, at most shouldn't it only affect the conversion process prior to compiling? After all, it does compile to standalone machine code executables, doesn't it?
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10723
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Very Newbie question about INLINE
« Reply #4 on: 2012-Mar-20 »
Absolutely. If you want more speed, get a better processor ;)
GLBasic is all compiled. You "might" be faster with using static arrays over the dynamic GLBasic ones. But in real life situations it won't affect the overall speed significantly. It introduces new, hard to find problems, though.

Offline TI-994A

  • Community Developer
  • Mr. Polyvector
  • ******
  • Posts: 112
  • You can do it in BASIC!
    • View Profile
Re: Very Newbie question about INLINE
« Reply #5 on: 2012-Mar-20 »
Absolutely. If you want more speed, get a better processor ;)
GLBasic is all compiled. You "might" be faster with using static arrays over the dynamic GLBasic ones. But in real life situations it won't affect the overall speed significantly. It introduces new, hard to find problems, though.
A confirmation from the CEO! Thank you for that. I must say that the spectrum of your cross-platform support is amazing, and although it's been a year since I purchased GLBasic, I'm pretty sure it's the ultimate tool for my mobile platform needs.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

Offline hardyx

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 491
    • View Profile
Re: Very Newbie question about INLINE
« Reply #6 on: 2012-Mar-20 »
INLINE is used often for manage complex classes or structures taken from C sources, or calling external functions in libraries. Making simple calculus in C is normally the same speed than GLBasic. If you use integers (%) is faster than floating point variables in all languages. This is important for portable devices.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10723
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Very Newbie question about INLINE
« Reply #7 on: 2012-Mar-20 »
On processors with an fpu, floats are no slower than ints.

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Re: Very Newbie question about INLINE
« Reply #8 on: 2012-Mar-20 »
Ok, a lot of thanks a lot, I thinked C++ it´s always the most faster languaje...   :x :x

Thanks to all replies

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: Very Newbie question about INLINE
« Reply #9 on: 2012-Mar-20 »
Ok, a lot of thanks a lot, I thinked C++ it´s always the most faster languaje...   :x :x

Thanks to all replies

No, machine code is (Yoda said)
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Re: Very Newbie question about INLINE
« Reply #10 on: 2012-Mar-20 »
Si ASM es lo más rápido, pero no me quiero imagina programar el iPhone o el Palm Pre en ASM, si el Amstrad ya es bastante follón, hacer que se mueva un caracter no me imagino como se debe hacer en los cacharros estos...


Offline TI-994A

  • Community Developer
  • Mr. Polyvector
  • ******
  • Posts: 112
  • You can do it in BASIC!
    • View Profile
Re: Very Newbie question about INLINE
« Reply #11 on: 2012-Mar-21 »
Si ASM es lo más rápido, pero no me quiero imagina programar el iPhone o el Palm Pre en ASM, si el Amstrad ya es bastante follón, hacer que se mueva un caracter no me imagino como se debe hacer en los cacharros estos...
¿Qué diablos? You can still do that, if you had ASM compilers for those phones. But ASM is not machine code.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Very Newbie question about INLINE
« Reply #12 on: 2012-Mar-21 »
When did that change?. As far as I recall ASM is basically mnemonics representing the raw hex numbers of the machine code to make it easier for us humans to write. I first programmed machine code in the late 70's by writing programs in asm on paper then manual converting the commands into hex from the cpu code list.

Sure asm provides some extras like labels etc but the end result is to all intents & purposes machine code with a 1 to 1 translation of mnemonic to cpu opcode. The exception to the rule is macros & such but this is not a lesson on asm.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2640
    • View Profile
Re: Very Newbie question about INLINE
« Reply #13 on: 2012-Mar-21 »
GLBasic, ironically, is actually a very nice platform for learning C++, a little basic wrapper can hide all the usual C project stuff allowing the user to concentrate on the inline or linked C. You can even use the GLB command set as a cross platform API from with the C, to a certain extent.
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline fuzzy70

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 828
  • Look left, Look right, LOOK OUT!!
    • View Profile
Re: Very Newbie question about INLINE
« Reply #14 on: 2012-Mar-21 »
I have always been "On the fence" so to speak regarding C/C++ in that I have never really got around to learning it or had a need for it's power so to speak. I can work out simple parts of code like loops, branches & conditions etc but beyond that I'm lost  :D

It is on my to-do list to learn some more of C/C++ as there are loads of useful code examples on gamedev.net & other sites for things like effects, engines plus lots of other things. I once converted an improved Bresenham's line algorithm from C in Blitz3d once & even though the Blitz code was 6-7x the length of the C equivalent it was still slightly faster than the native Blitz line command which surprised me.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)