This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
martin509's profile picture

AdvCC: CC done quicker.

Started by martin509, 28 February 2013 - 08:09 AM
martin509 #1
Posted 28 February 2013 - 09:09 AM
I have a small little idea: A new programming language for ComputerCraft that would be much more compact and easily parsed, although of course being harder to learn.
Let me explain.
Lua is an inefficient language memory-wise. An example would be;

textutils.slowPrint("Hello, this code is inefficient")
Which is stupid long when you could, in another (fictional) language, do this:

txt.slpr("Efficiency!")
If my assumption that smaller code is generally quicker is true, then this could seriously speed up CC.
"But wait, how will we switch to this hyper-advanced super-language?"
How about a little tag at the top of your programs to differentiate the two?
"Okay!"
Still, this needs something cool to make it more than faster Lua.
How about various functions that any experienced programmer knows and loves?
Logic functions like AND, OR, XOR, etc to perform on things like strings, ints, and bools.
Low-level manipulation of base things like the screen to make it do awesome things: mathematical patterns, screwing around with the text lines, SCREW TEXT MODE, and so on.
Why do all this, you ask?
In the olden days, on systems like the C64, Atari 2600 and Apple II, coders had to know tons of tricks to produce cool things.
For instance, California Games on, I believe the Apple II, used palette switches while in the middle of a scan-line to produce more colours at any given time, since any one palette was extremely limited.
I see the same sort of thing today with CC, especially in games, as coders try to get as much out of the emulated hardware as possible.
So I say give them the tools for optimization.
Give them AdvCC!

P.S. Please correct me if small code is not faster than long.
Skullblade #2
Posted 28 February 2013 - 09:46 AM
No new languages
martin509 #3
Posted 28 February 2013 - 09:54 AM
No new languages
sad face?
It would be optional, anyway.
Sammich Lord #4
Posted 28 February 2013 - 09:58 AM
This is doable in Lua if you write a interpreter.
martin509 #5
Posted 28 February 2013 - 10:33 AM
This is doable in Lua if you write a interpreter.
That would just slow the game down even more since it gets interpreted by lua, then by java.
This is the reason emulation is so demanding, btw.
Pinkishu #6
Posted 28 February 2013 - 10:56 AM
Theres no point, it doubt it would be much faster in processing, maybe in typing, once you memorize all the weird abbreviations

And you could do that already in lua

txt = {}
txt.slpr = textutils.slowprint

txt.splr("meow")

orso
immibis #7
Posted 28 February 2013 - 11:25 AM
Not short enough!


t.s("E")
Cruor #8
Posted 28 February 2013 - 11:26 AM
This is allready doable in plain Lua.
Locked.