Help - Search - Members - Calendar
Full Version: Every scripting-language sucks
Hydrogenaudio Forums > Misc. > Off-Topic
Lyx
Every high-level language sucks! At least for me.

Why? Well, lets first outline the scenario. We have a massive multiplayer RPG, implemented in MUD-style but with a graphical UI here - currently planned, designed and coded by two guys - one of those two is responsible for the scripting-side. Since most of the game-logic and mechanics is done on the scripting side, thats a damn lot. That person is me.

If you've played a RPG before, then you can probably guess that alot of object-oriented stuff is going on behind the scene. And that in a nested way: for example, we may have a player, that player has a collection of properties - the properties in turn are divided into subtypes, etc. etc. So, if you wanna design a partially clean API usable for quest-scripts, etc., then this means that you need to have something like: worldobject.playerchar.properties.strength.current

Since i'm new to scripting language (but definatelly not untalented - i learned and understood the OOP-paradigm in 2 days!). My next task would be to find a suitable high-level scripting-language for the project. And thats when i learned that every HL-language sucks!

My first stop on the trip was LUA.
Lua tries hard to seem intuitive. To let you understand it without understanding how to code. Additionally, its fast and geared towards embedding (which is important, since my code would be embedded into a C++ server written by the other guy). Well, the problem is that lua basically is a great big hack. It isn't intuitive. It isn't powerful. It isn't simple. But it tries to seem so by throwing a truckload of sugar into the mix and making everything "implicit". So, you dont know what it does behind the scenes, and rely on it doing the right thing(reminds me of windows). Problem is, it doesn't "guess" right - especially once your needs become more demanding than writing config-files! So, the illusion doesn't work, but at the same time you cannot stop it from trying to "asume" what you want it to do. Besides, LUA has no classes. Yeah, there is a hack to "emulate" classes, but the result is a similiar hackfest like the "try to be intelligent"-aspect of it. In short, LUA sucks!

Then i gave python a try. Python has a wonderful approach in terms of modules and namespaces(remember the nested player-properties thingie). It has multiple inheritance. It has so many datatypes, that you loose track of them. Oh, and it doesn't have "end" in block-structures - instead, it enforces rigid indenting, and setting lineends at the right position. In other words: blockstructure is controlled via formatting, not via code! Its also not much help in browsing through forums and mailinglists, a good amount of the python community are ignorant zealots. One thing i learned with python, is that coding is no fun.... this changed with the following language...

Ruby. Ruby is a wonderful OO-Language, with an intuitive syntax, following the "everything is an object"-idea, builtin RegExp and a friendly community. Suddenly, coding was fun again, and i didnt have to think about "how" to express my solution in code, but instead could focus on problem-solving itself, instead of on the language. Well, until i learned that ruby sucks! Ruby has no efficient facility for explicit namespaces. In addition, when you get it to "kinda" do it, then you get a funny namespace1::namespace2::object.method syntax. Oh, and its mixin/modules model sucks. You see, i dont think that the argument "you can do shit with multiple inheritance, so we shouldn't let you do it in the first place" is a good argument. By that logic, we should take all sharp objects out of peoples lives, because they COULD be used to do shit. Responsibility, anyone?

In the meantime, i also took a closer look at the classics - from the flexible but encrypted Perl-syntax, to the braces-maze of Scheme to the innovative but embedding-hostile smalltalk.

The last language i took a closer look on was IO. IO is fast, small, powerfull, prototype-based(instead of classes), AOP-capable, embeddable language with a simple syntax. Oh, and multiple inheritance and namespaces the way you want it. Sounds great? Fine, then start learn it with almost no documentation and not a single newbie-friendly tutorial - cause it was just invented in 2002 and isn't ready for mainstream-use yet.

Conclusion: every scripting-language sucks! I guess there's a reason, why gamedevs still create their own in-house languages - because the existing ones aren't fun.

- Lyx
Dibrom
rolleyes.gif

By the way, scripting languages and high level languages are not the same thing.
Woodinville
This is hardly an audio topic, but did you look at LPC (the language, not the speech coding algorithm)?

That's LPC as in LP Muds. I don't recall a reference site for it any more, but one has to exist.
Lyx
QUOTE(Woodinville @ May 26 2005, 01:04 AM)
This is hardly an audio topic, but did you look at LPC (the language, not the speech coding algorithm)?

That's LPC as in LP Muds.  I don't recall a reference site for it any more, but one has to exist.
*


I'll give it a closer look later today - thanks for the hint. Yup, its not an audio-topic - thats why it is in "off-topic".

- Lyx
KikeG
You don't like python because you have to indent blocks? I program in plain C, and every block I write is indented. It's a good practice for making clearly readable code. Python just removes the brackets at the blocks. I think that the need to have to indent code blocks in python is a poor excuse por dismissing it.
Lyx
QUOTE(KikeG @ May 26 2005, 08:59 AM)
You don't like python because you have to indent blocks? I program in plain C, and every block I write is indented. It's a good practice for making clearly readable code. Python just removes the brackets at the blocks. I think that the need to have to indent code blocks in python is a poor excuse por dismissing it.
*


But *for* readability, i *want* END's or opening/closing brackets around blocks. To me, good indenting alone doesn't make for good readability. The python-way for my taste is a paradox: it tries to enforce readability in one area, by removing a readability-feature in another area. Besides, for readability, there are cases were non-strict indenting makes sense.
However, the indenting-aspect was not the only reason why i disliked python. The language and "feel" of it is just unsymphatic to me. As an example, with every other language, i easily understood how OO and classes works - when i read the classes-chapters of python, i became so confused, that i forgot how OOP works for a while. Those are just example - the language, documentation and community just overally doesn't feel inviting to me.

However, i've got to say that among all those languages, only python and Io may be interesting. Because python at least gives me all "what" i need - even though i dont like the "how"-aspect of it.

But i'll probably consider other possibilities first, before doing a fallback to python.

- Lyx
KikeG
Ok, you made yourself clearer this time.
Lyx
In case anyone cares about it (i suppose no *g*). Here's what happened.

After trying out an entire museum of languages, we came to the conclusion, that it is quite stupid to change to a different language which is suboptimal for the task, just because the namespace-syntax and -features suck.

So, we returned to ruby and decided to write a preprocessor instead - so that we could use namespaces however we like, and when a script gets loaded a preprocessor throws a bunch of RegExps at it which convert the "imaginary" parts of the code into real ruby-code.

- Lyx
Dibrom
QUOTE(Lyx @ Jun 2 2005, 09:33 AM)
In case anyone cares about it (i suppose no *g*). Here's what happened.

After trying out an entire museum of languages, we came to the conclusion, that it is quite stupid to change to a different language which is suboptimal for the task, just because the namespace-syntax and -features suck.

So, we returned to ruby and decided to write a preprocessor instead - so that we could use namespaces however we like, and when a script gets loaded a preprocessor throws a bunch of RegExps at it which convert the "imaginary" parts of the code into real ruby-code.

- Lyx
*



If you have such a hard time getting something to match your approach, and you have to go through this much trouble to finally get it to work, have you ever considered the possibility that your approach is simply wrong?

Seriously, most of the languages you've touched upon are not as bad as you make them out to be. Furthermore, there are a lot of other languages you didn't even mention (functional languages, etc.).

It really sounds to me like it's your approach to solving a particular problem that is either poorly designed or just too inflexible to be implemented in an idiomatic fashion according to the languages that meet the overall functionality that you need.

OO style programming may not even be the best way to go in your case -- it's certainly not the best programming paradigm overall and in many cases has a lot of disadvantages over other approaches. And even within OO, you don't always need namespaces/inheritance. Objective-C for example doesn't really have namespaces, and inheritance is usually frowned upon in favor of composition. And it works. It sounds kind of like you're expecting some of these other languages to have a very similar style implementation of OO to C++, but in some cases they depart from that because C++'s OO style isn't really that great. Inheritance works well in C++ because of the way the typing system is, but in other languages which are dynamically typed (many of the "scripting" languages) for example, it's not needed as much.
Lyx
I think we have a misunderstanding here, caused by me not mentioning something which i should have mentioned.

The namespace-syntax thing is a purely cosmetic issue(which will later affect usability) - and it is only important for designing the scripting-API with which others can later add content to the gameworld. In the case of this project, a syntax is needed which among scripting languages only python does provide. But python is not well suited for the rest.

Ruby and OO is perfectly well suited for the project. Its just that its syntax makes it difficult to design a visually good and clean scripting-api for this project. MI would have been helpful, but we can do without it, if thats the only drawback.

So, instead of choosing the language depending on the desired API-look, we choosed to instead pick the language which is overally best suited for the project, and then "cheat" with a preprocessor to give the API the desired look.

So, yes - there was something wrong with our approach. But in a different sense: We became distracted by an issue which should not dictate the rest of the code.

- Lyx
rjamorim
I believe you are mostly right, except for the thread title. You should remove "scripting-" from there tongue.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.