C++ like script language
#1
Posted 30 January 2007 - 02:33 AM
I’m mainly looking for a C++/Java syntax-like (strongly-typed and object-oriented) language that binds well with C++, suggestions are appreciated.
Thank you.
#2
Posted 30 January 2007 - 03:34 AM
#3
Posted 30 January 2007 - 08:17 AM
#4
Posted 30 January 2007 - 12:44 PM
Why bother having a "strongly-typed and object-oriented" as your scripting language when you've already got a one in C++.
I'd recommend using DLL instead of scripts if that [c++] is what you want, and allow the ability to reload your code.
#5
Posted 30 January 2007 - 03:27 PM
eddie said:
As monjardin mentioned not strongly-typed (which I seek) and it has some annoying quirks (no explicit variable declaration, index from 1?). Other than that it seems like a fast, light and mature language.
dave_ said:
I'd recommend using DLL instead of scripts if that [c++] is what you want, and allow the ability to reload your code.
DLLs are not cross-platform and require compilation (which I want to avoid).
#7
Posted 30 January 2007 - 04:00 PM
#8
Posted 30 January 2007 - 05:14 PM
You may try out by yourself.
cu,
chris
#9
Posted 30 January 2007 - 11:28 PM
#10
Posted 31 January 2007 - 12:33 AM
monjardin said:
Ah. I don't think he mentioned strongly-typed/OO before he edited it again, hence my question.
Too bad - Lua's a great language. And strongly-typed is really over-rated in a scripting language: IMHO.
#11
Posted 31 January 2007 - 10:09 AM
eddie said:
cu,
chris
#13
Posted 31 January 2007 - 10:41 AM
dave_ said:
cu,
Chris
#14
Posted 31 January 2007 - 11:02 AM
Test driven development can be applied to both strong and weak typed, but with it, it doesn't matter if you've got strong or weak typing. If you write your tests properly you wont get stupid runtime errors.
Dynamic languages are gaining quite a bit of momentum at the moment.
I've just thought that you might not actually realise what weak typing actually is. Its not a complete absence of typing. It just allows implicit conversions more easily. It is actually possible for a weakly typed language to be type safe.
http://en.wikipedia....iki/Weak_typing
#15
Posted 31 January 2007 - 11:29 AM
And as for test driven develeopment you need to write lots of test cases that do not enshure, that everyone uses your classes and methods as they're meant to be. Those tests show only that all those stuff is working in the context of your test environment not necessarily in the context of the final complex software product.
cu,
chris
#16
Posted 31 January 2007 - 11:38 AM
You might be against TDD but you haven't argued for strong typing.
#17
Posted 31 January 2007 - 12:03 PM
- no implicit conversions that may result in behaviour not intended by the programmer.
- classes/methods have to be used as they are meant to be. If a function expecteds an integer you are forced to use that type. You're forced to use an explicit conversion otherwise that visualizes what's truly going on.
- In a truly strong-typed language you're also forced to declare the range of a type and *useness* of a variable. This way nobody can accidentally pass a 'null' reference when it's not allowed. Or pass wrong array sizes, etc. This makes software overall more safe and reduces debugging costs a lot.
- You can't lie by hacking around with address-operators and unsafe c-conversions making code less readable and errorprone.
- Software inspections are easier und much more powerfull what in turn safes you more time and money.
ok I'm now going to eat something. Back in a while...
cu,
chris
#18
Posted 31 January 2007 - 03:55 PM
Christian Weis said:
cu,
chris
I never said I didn't understand the benefits of a strongly typed language -- simply that it's over-rated in a scripting language.
First let me start off explaining the way I work with scripts -- I generally use runtime *as* compile-time. I love being able to reload scripts at runtime, and use that as valuable debugging time to make sure that everything's positioned correctly, or flowing in the right way, etc. I mention this not because it's super relative to the debate, but simply because it's how I use scripting, and therefore the difference between compile time and runtime is much smaller -- although it doesn't argue for/against strong/weak/dynamic typing, it does impact the way I work.
As for my point about strongly-typed being over-rated: I can appreciate how that thought might scare someone who's used to a strongly-typed system: "Why wait until the failure reaches further down your code, rather than at the spot where a compiler can catch it?". And I agree in part - it's nicer to have your errors sooner rather than later. But to be honest, it doesn't buy you much. It can make you feel comfortable that the type is indeed what you want it to be, but after all my years in working with languages like Lua, Python, JavaScript -- I've never found myself wanting that in those languages.
Perhaps it's because, like _dave alluded to, I find unit tests a much more important part of checking my code than strong-typing ever will be in those languages. I'd much rather catch those errors in a domain semantic way -- a way that has much more meaning to you as a programmer -- rather than a very elementary compiler semantic one.
But that's just been my experience.
#19
Posted 31 January 2007 - 04:50 PM
ains.
#20
Posted 31 January 2007 - 11:15 PM
eddie said:
Christian Weis said:
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











