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
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 :)
"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
"Would would go past thing chance for fame?"
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)
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?
reply to mapc
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