mapc | 2011-12-16 12:57
Generell discussion about the cube scripting language

RaZgRiZ | 2011-12-12 13:00



Cubescript is hard to read to those who are either too accustomed to reading everything with syntax highlighting or don't like cubescript in any way. Or when someone is truly horrible at doing things right. Apart from that however..

He may not be the first, or the second, or the third, what does it matter. For cubescript, it's practically the first command-line quick-connect script, with mine coming second but being SVN only. I do wonder however how you're doing to implement such a thing into the framework, is it based on cubescript at all? Or are you hoping to convert it to another language?

And i'm confident he will add the comments necessary. Would would go past thing chance for fame? ^_^
reply to 3starRaZgRiZ

mapc | 2011-12-12 17:46



(I switched from the gandalf acc to this one, sorry for the confusion).

Yes, apply 1 and 2 for me :D (but it is not that bad).
Sadly cbs is a very bad designed language: There is for instance only a global namespace and there is only strings. Even the lists are space separated, not escaped strings. (I'd like to give you a complete lists, but this would be one or two paragraphs of text, so not in this comment ;) ).

Yes, thats why I am thinking about integrating it :). However, command line again means a problem with the global namespace :(
The framework is entierely cubescript and aims at resolving some of the issues, nicer installation, plugin-based (no more hazzle with adding stuff to autoexec.cfg) and a little bit of namespacing:

(concatword $namespace $varname) = $value

Yup, hope so :)

Cheers,
mapc

srbs | 2011-12-14 04:46



@mapc
"I'd like to give you a complete lists, but this would be one or two paragraphs of text, so not in this comment ;)"
I'd love to see this list.

"Sadly cbs is a very bad designed language:"
Not every language NEEDS every feature known to the programming world. It is perfectly adequate for what it is designed for.

What isn't designed very well is, in fact, your "framework." For large projects like that, one should (as with all languages) first learn the features, quirks, and idioms of said language and design accordingly. And if my config.cfg file is some 500KB after using 0.9.4, I won't ever use it again, especially since every function of every script has variable names relating to the current plug-in

@Razgriz
"Would would go past thing chance for fame?"
wut?

srbs

mapc | 2011-12-15 12:48



@srbs

I do not criticize the lack of features in the language, but the way the language is designed (in other words: how you do, what you do with cbs).

Your last argument was an ad hominem argument (http://en.wikipedia.org/wiki/Ad_hominem) and therefore a rhetorical trick without being constructive at all. Please stop this, I am annoyed by this.
Your config file is that big, because the way configuration works (described below) and because of the lack of memory management (described also below). Big codebase => Big conf. This issue can not be resolved without having control of the configuration process. Sorry.
The framework is btw written with some of the issues below in mind. The usage of vars for every plugin for instance makes the whole framework much more secure.
The Points of criticism:

Everything is a string (partially lack of types)
Lists are space-seperated not-escaped lists
There are too many ways to generate and modify function-strings (e.g. macros, the three braces)
There are too many ways to call function-strings (macros, as closures...)
Metaprogramming is just string-modification and can be applied everywhere
There is just a global namespace
There are no named arguments, no function signatures
No deallocation possible
Inefficient config file
Operators are functions, but the function names are symbols
No error handling
Lack of C++ documentation (how does it work internally?)

Why this is bad:

Everything is a string means that everything is executable, which can enable an attacker to execute code in some cases. Although it is easily possible to write forkbombs and other malware for cbs, this is probably not really an horror scenario, because masterlist-providers can inject code anyway. There other scenarios, where this can be dangerous: It can lead to data(=>code,state) corruption if random data is executed (just imagine a bug where someone executes a long string of human language). Such a corrupted block might even spread…corrupted code generated more corrupted code with metaprogramming. (I call this disease cubic cancer ;) ). Also it makes debugging a lot harder and even can hide bugs, this of course goes hand in hand with error handling: No error handling => no error on code corruption.
The problems I just described could be contained a bit if there where types and function signatures anyway (line with 8 words, can not be called for function that requires 3 args; can not call a function that requires lists for a line of human language) and again…error handling.
Now there is a lot of problems with the seperation between data and code, but there is an additional problem: The usage of complicated string manipulation methods: You can use multiple Macros of different levels, macros are hard to distinguish from actual variables and their usage varys depending on the level of rect brackets. Calling a function seems to be equivalent with accessing the string one macro level deeper. Then there are two kinds of string defining symbols: [...] and "..." witch both output a string (or you can just use none of them), there are also round braces witch evaluate the code immediately. This is apperantly still a little buggy, because some strings are not recognized as entire commands and in some cases the macro modifier is not recognized (I remember, that I tried to fill a bug report about this/talk to the devs about this, I also remember that I have been somewhat unsuccessful).

The next big block of criticism is the available variable space: Ther is only the global namespace. Not a local one, no packages/namespaces, only one. In other words: You iterate over a list using I as iterator and one other function you call does the same: You are screwed. If someone else in a completely different script decides to call his var 'roster' too...you are screwed. But not only is the cbs-namespace a mess, cubescript is also one single memory leak. no RAM at all is being deallocated, try this:

testnum = 0
testmax = 2048

buildup = [ if (*smaller* $i $m) [ s = (concatword $s $s $s $s $s $s $s $s $s $s); i = (* $i 10); sleep 1 [ buildup ] ] ]
test = [
if (*smaller* $testnum $testmax) [
s = a
i = 0
m = (pow 1024 2)
buildup

sleep 1 [ test ]
]
]

The code above builds string with the size of 1M and deletes it. It does that 2048 times. The memory consumption here should not be higher than 4M (this is generous). Actually it needed about a second to fill my entire RAM.
The next thing is that the configuration is done by writing the entire state => corrupted data and functions written.
The lists are bad for the obvious reason (lets append "mapc is stupid" to the end of a list ;) ).
Operators are just badly designed, using symbols but the arithmetic of functions is inconsistent.
And at last: There are about 5 lines of comment in the entire cube engine, maybe one in the cbs code. This makes it very hard to understand the internals, even if you can read C++.

Well, I am pretty exhausted. There are some ways how you can work around this problems, I'll write them down tomorrow :) .
You said you think cbs is perfect for it's purpose, what makes you think that?
Cheers,
mapc
reply to mapc

skiingpenguins | 2011-12-15 20:38



cube script isnt supposed to be as fancy as you seem to want it. i think you should chill out, and maybe go to a different game if you want something with all these feature things. cube script serves it's purpose very well. don't mess with it.
reply to 3starskiingpenguins

mapc | 2011-12-16 01:06



@skiingpenguins

Excuse me? Do you have the faintest idea what my essay meant, have you ever spent a single thought on programming language design, have you ever thought a second about application design? Please, do not waste my time! If you did not understand what I said, that's ok. I'll even explain it to you (somewhere else), but a statement like yours is not worthy an answer and I won't feed the trolls again…
reply to mapc

Chaos | 2011-12-16 02:29



Cubescript is a low-level language; hence, it's applications don't really go beyond those for which it was designed. However, in my opinion, cubescript really servers it's purpose well, accommodating a wide range of uses that relate to the game.
reply to 1starChaos

Suicizer | 2011-12-16 08:30



? This maybe has nothing to do with your content, but CubeScript doesn't seems like a low-level programming language to me. I would rather take OpenGL as example for a low-level programming language as CubeScript.

0
points
 (0 votes)
User login
Users on Quadropolis
1 guest & no users online
10
points ]
 (1 vote)
Created 2020-05-16 23:15
1 week 3 days ago
Created 2020-05-14 12:56
1 week 5 days ago
224
points ]
 (23 votes)
Created 2012-10-20 09:56
7 years 31 weeks ago
Gangler
10
points ]
 (1 vote)
Created 2020-05-12 22:59
2 weeks 40 min ago
afroninja
46
points ]
 (5 votes)
Created 2020-01-15 07:47
18 weeks 6 days ago
20
points ]
 (2 votes)
Created 2020-04-29 18:35
3 weeks 6 days ago
LURKing
10
points ]
 (1 vote)
Created 2020-05-09 17:56
2 weeks 3 days ago
140
points ]
 (15 votes)
Created 2013-06-09 21:05
6 years 50 weeks ago
20
points ]
 (2 votes)
Created 2020-05-02 19:58
3 weeks 3 days ago
20
points ]
 (2 votes)
Created 2016-07-28 12:06
3 years 43 weeks ago
7YearBitch
20
points ]
 (2 votes)
Created 2020-03-16 20:09
10 weeks 1 day ago
70
points ]
 (7 votes)
Created 2020-01-24 22:26
17 weeks 4 days ago
40
points ]
 (4 votes)
Created 2020-01-23 12:57
17 weeks 5 days ago
30
points ]
 (4 votes)
Created 2020-01-26 14:10
17 weeks 2 days ago
170
points ]
 (17 votes)
Created 2011-09-05 14:13
8 years 38 weeks ago
Sauce
71
points ]
 (8 votes)
Created 2018-08-22 19:15
1 year 39 weeks ago
Lord Kv
160
points ]
 (16 votes)
Created 2015-03-12 14:45
5 years 11 weeks ago
45
points ]
 (6 votes)
Created 2009-08-15 13:37
10 years 41 weeks ago
MisanthropX
74
points ]
 (8 votes)
Created 2019-12-05 20:57
24 weeks 5 days ago
Redon
105
points ]
 (11 votes)
Created 2019-10-24 21:41
30 weeks 5 days ago
Who's new
  • Akari
  • LURKing
  • Antknee55
  • gmiz
  • impala97