Languages (was: Portability (offtopic))

In real life, my guess would be that, at least in a short perspective (10
years or so), the best bet is to clean up C++ - not trying to get people
to
learn an entirely new language. However, if it’s small, nice and easy
enough
to grasp, while still providing both the low level and the high level
power
of C and C++, it might stand a chance.

Wasn’t Java created to solve a lot of C/C++ problems while avoiding that
people learn an entirely new language?–

Olivier A. Dagenais - Software Architect and Developer

Oh man… let’s not bring Java into this! :wink:

But you’re right, Java was meant to be OO from the ground up.

(it’s funny, Java started OO, but then got “procedural” extensions in the form
of JSP and Javascript… so it’s somewhat worked backwards from C…)On Wed, 21 Feb 2001, you wrote:

Wasn’t Java created to solve a lot of C/C++ problems while avoiding that
people learn an entirely new language?


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >

Well, it also creates a great deal of problems, and it doesn’t provide
anything like the low level control of C - and it’s not supposed to. It’s a
high level language, as opposed to C.

C++ is also a high level language, but it’s one of very few that is also a
mid level language © by definition. That makes it pretty much as close to a
universal, all purpose language as you can get.

C is similar to C++ in relation to many languages, but on a lower level. You
have everything from the lowest levels (except self modifying code, context
switches and the like) up to almost the level of Pascal.

Taking Pascal as an example here; that is a language that is utterly useless
for low level programming, and even for DSP code and similar. You only end up
piling workaround on top of workaround, ending up with code that’s unreadable
and cannot be properly optimized by the compiler. However, Pascal (at least
in the modern, extended forms) is a language that makes it very much harder
to do serious mistakes than C.

You can’t have it all - but C and C++ give almost everything at a cost that
the majority of programmers are ready to pay. One may claim that every
problem has it’s tool. So, are you going to use 3 - 5 different languages for
every program…?

Not me. C + C++ == 1.5 languages, and they can deal with almost any problem
in an acceptable way, so I’d rather learn to handle their weaknesses than
learn a bunch of other languages, finding interpreters/compilers, sort out
the linking/integration problems and all that.

If one really needs to do lots of work in an area where these languages suck,
there’s always the classical GUI toolkit solution; write up a preprocessor
that translates some custom extensions into real code. That usually results
in a syntax and level of error checking that beats any "general purpose"
language.

//David

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Thursday 22 February 2001 01:48, Olivier Dagenais wrote:

In real life, my guess would be that, at least in a short perspective (10
years or so), the best bet is to clean up C++ - not trying to get people
to learn an entirely new language. However, if it’s small, nice and easy
enough to grasp, while still providing both the low level and the high
level power of C and C++, it might stand a chance.

Wasn’t Java created to solve a lot of C/C++ problems while avoiding that
people learn an entirely new language?

Maybe an indication that it doesn’t work to pretend that the world is object
oriented…? hehe

//David

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Thursday 22 February 2001 02:39, Samuel Hart wrote:

On Wed, 21 Feb 2001, you wrote:

Wasn’t Java created to solve a lot of C/C++ problems while avoiding that
people learn an entirely new language?

Oh man… let’s not bring Java into this! :wink:

But you’re right, Java was meant to be OO from the ground up.

(it’s funny, Java started OO, but then got “procedural” extensions in the
form of JSP and Javascript… so it’s somewhat worked backwards from C…)

of JSP and Javascript… so it’s somewhat worked backwards from C…)

I heard that JavaScript began as “LiveScript” at Netscape, and then when
they saw how uber-popular Java had become, they renamed it. :slight_smile:

-bill!

On Thursday 22 February 2001 01:48, Olivier Dagenais wrote: > > In

You can’t have it all - but C and C++ give almost everything at a cost that
the majority of programmers are ready to pay. One may claim that every
problem has it’s tool. So, are you going to use 3 - 5 different languages for
every program…?

Within reason, of course, and you have to weigh your options carefully
(see below).

Not me. C + C++ == 1.5 languages, and they can deal with almost any problem
in an acceptable way, so I’d rather learn to handle their weaknesses than
learn a bunch of other languages, finding interpreters/compilers, sort out
the linking/integration problems and all that.

Well, I suppose you must also do CGI scripting and relational databasing
in C/C++… :slight_smile: In many cases you don’t need to do linking or integration
because your language is fully interpreted (as in Perl or Java) and your
entire project is written in it! The difficulties you have described often
solve more problems than they create, while stubbornness not to learn a
new language often produces convoluted “solutions” that are difficult to
maintain and modify. In many cases, this is something you can live with,
but occasionally this problem that could be better solved with another
language is too big a part of your whole project that it would clearly
benefit from being either wholly rewritten in that other language or
somehow combined with other languages.

If one really needs to do lots of work in an area where these languages suck,
there’s always the classical GUI toolkit solution; write up a preprocessor
that translates some custom extensions into real code. That usually results
in a syntax and level of error checking that beats any "general purpose"
language.

Try using this approach to write a custom AI engine for an RTS or
something similar! C/C++ definitely suck at this, and an RTS is
definitely the sort of thing that would benefit from a multi-language
approach. What I would do is write the bulk of the program in C or C++,
but do the AI core in Lisp, Scheme, or Prolog. Embed an interpreter for
the language chosen in C or C++.

By the way, writing AI for even a simple game is not something you want to
do in C or C++. I’ve tried. I once wrote an AI engine for a simple card
game, starting in C, but after a week’s worth of frustration, I found a
book on Scheme and in another week was able to produce an AI engine that
was much cleaner and simpler than my abortive attempt in C. With Guile
available the integration went fairly swiftly. (BTW, I only have the
sources for the AI engine with me; the whole project was done in a mix of
VB, C, and Scheme)

Most of the time you are right, the extra effort of learning a new
language and figuring out how to make everything fit is not worth it.
However, one must learn how to weigh the options available and not to be
too reluctant to actually learn a new language when it will clearly
produce long-term benefits and simplify the problem significantly.

Well, we’ve somehow stumbled onto language issues in software engineering
with this thread! It’s clearly one where opinions run deep…On Thu, 22 Feb 2001, David Olofson wrote:


Rafael R. Sevilla <@Rafael_R_Sevilla> +63 (2) 4342217
UP Diliman Mobile Robotics Laboratory +63 (917) 4458925
OpenPGP Key ID: 0x0E8CE481

Something like that. I personally loathe the language (tho I use it :stuck_out_tongue: )
because of all the lack of accepted standards across browsers.

…but steering to a topic that’s somewhat more on-topic :wink:

Would there be any way to use SDL in Java?

I know you can use GCC to compile Java down to native binaries for the hardware
it’s on… does anyone suppose there might be a way to use that to include
SDL in Java? (I admit, you’d need to do some heavy wrapping on the lib to make
it more strictly OO for Java…)

Not that I really /use/ Java much (too much overhead, too much other stuff
;)… but I noticed on gcc.gnu.org/java/ that they do mention “libgcj”… not
sure how this whole GGC/Java thing works… but I would assume there would be a
way to use SDL with it…On Wed, 21 Feb 2001, you wrote:

of JSP and Javascript… so it’s somewhat worked backwards from C…)

I heard that JavaScript began as “LiveScript” at Netscape, and then when
they saw how uber-popular Java had become, they renamed it. :slight_smile:

-bill!


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >

Im working on a Java JNI wrapping for SDL, just havent had time to
release it yet due to massive overload at work.
but its nearly finished, except some lowlevel-pixel-stuff that im not
sure how to handle.

but the basics work, surface blitting etc.

I’ll post later when its released.

/Lomax of Probe> ----- Original Message -----

From: criswell@geekcomix.com (Sam Hart)
To:
Sent: Thursday, February 22, 2001 4:40 PM
Subject: SDL under Java? (was Re: [SDL] Re: Languages (was: Portability
(offtopic)) :wink:

On Wed, 21 Feb 2001, you wrote:

of JSP and Javascript… so it’s somewhat worked backwards from C…)

I heard that JavaScript began as “LiveScript” at Netscape, and then when
they saw how uber-popular Java had become, they renamed it. :slight_smile:

-bill!

Something like that. I personally loathe the language (tho I use it :stuck_out_tongue: )
because of all the lack of accepted standards across browsers.

…but steering to a topic that’s somewhat more on-topic :wink:

Would there be any way to use SDL in Java?

I know you can use GCC to compile Java down to native binaries for the
hardware
it’s on… does anyone suppose there might be a way to use that to include
SDL in Java? (I admit, you’d need to do some heavy wrapping on the lib to
make
it more strictly OO for Java…)

Not that I really /use/ Java much (too much overhead, too much other stuff
;)… but I noticed on gcc.gnu.org/java/ that they do mention “libgcj”…
not
sure how this whole GGC/Java thing works… but I would assume there would
be a
way to use SDL with it…


Sam “Criswell” Hart AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >