Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

LSL: Support Constants

Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
06-24-2004 15:59
It's very useful and proper to use constants in programming. However, we *must* waste valuable script memory wasting simulating constants with variables.

Can we get a Linden answer? I know I'm not one of your precious Island owners or somebody who pesters you on the RL telephone. Can we get an answer? :mad:
_____________________
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
06-25-2004 11:05
I support giving Hank an answer.
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
06-25-2004 13:50
I support Oz's post, but only because my post is under his. Anyone want to give me a leg up?

(I'd just rather have more memory for the scripts to use.) :)
_____________________
~ Tiger Crossing
~ (Nonsanity)
Jules Llewelyn
Lonely Heart
Join date: 10 May 2004
Posts: 11
06-25-2004 14:11
All right, I support Tiger's post :D
_____________________
<--There is nothing to see here, move along-->
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
06-25-2004 14:14
I support that Jules support Tiger that supports Oz supporting my initial...
...er, never mind. I give up! :rolleyes:

:D
_____________________
Darwin Appleby
I Was Beaten With Satan
Join date: 14 Mar 2003
Posts: 2,779
06-25-2004 14:39
Seconded.
_____________________
Touche.
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
06-25-2004 15:22
Constants aren't, variables don't.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
06-25-2004 16:12
Although I like nice compiler features like supporting constants, I dont believe it should be placed high on the list of things to implement. Implementing constants would not really decrease the burden on script memory (AFAIK). I mean, why would it?

Constant declaration:
final integer FOO = 192;

Text size: 24 bytes
"integer" datatype size: 4 bytes
Total amount of space used: 28 bytes

Variable declaration:
integer FOO = 192;

Test size: 18 bytes
"integer" datatype size: 4 bytes
Total amount of space used: 22 bytes

You wont really see much memory usage or speed improvement (maybe even a decline), unless optimization techniques such as constant variable inlining were implemented as well. Cory has stated before (I think) that creating an optimizing compiler just for LSL is a bit too difficult/time consuming task for him at this time.

==Chris