JAVA as C (or C++) Front End

L

Luc The Perverse

I am bookmarking these pages for reading later. I think this glossary
could be a useful thing to look through just in general
 
L

Luc The Perverse

Well it's not the P4 with loads of ram that I concerned about! It is
the P-I with 46 Mb of ram, 2 missing because the onboard video card is
using it. :)
 
T

Thomas Fritsch

Luc The Perverse said:
If I write a Java program, I will expect it to be run by the JVM - that
does not bother me.

But to appeal to users who have never even heard of a command line, I
am going to need some form of system integration. In the case of
windows for instance, I will likely need a start
menu/desktop/quicklaunch icon - some programs call for right click
functionality of files.
You can create a small starter batch-file containing:
java.exe [java-options] %1
or if you want to supress the black command-window:
start javaw.exe [java-options] %1
Use this batch-file in startMenu, desktop, right-click-functionality, ...
 
L

Luc The Perverse

I didn't expect people to freak out. Java's benefits are its being
virtual platform independant, easy to implement with lots of libraries
available. In exchange it uses more ram and is slower. I thought
this was a fact, not a subject for flaming.

I wasn't trying to put down Java, nor did I think I was. Obviously I
feel Java is worthwhile or I would not be trying to integrate it with
my projects. I needed to state some form of justification for saying
why I wanted to use C or C++ at all, otherwise everyone would just say
to use only Java.

So I either say why I want to use C, and get flamed; or don't say and
have everyone just tell me to use only Java. Hmm..

No it doesn't matter if it takes 1 extra ms to bring up a GUI button,
dialog etc, but when I'm hashing an 800 Mb file, or calculating digits
of PI, or solving some NP complete equation I want to buy as much time
as possible. Sometimes this involves using C code, sometimes when I
notice the compiler is doing something really dumb, this involves using
assembly language. (I had a random maze generation program which I
noticed the compiled code was making horrible use of the available
registers, so I rewrote parts of it in assembly language.) The speed
up was not humanly noticeable unless you are making tens of thousands
of large mazes, but I did get a sort of personal satisfaction.

I guess I just don't know why this is such a sensitive subject. I
would go into a linux group and say I have no problem with linux,
except that the game makers are not porting the games I want to play to
linux (and wine is great, but I need a better computer) Until this
problem is resolved I will use dual boot.
 
L

Luc The Perverse

AHA! Supressing the black command window was something I did not know
how to do.

I could use something like a pif/lnk file to myself an icon and an
"English Name"
 
R

Roedy Green

I don't think its obsolete. I think it is an excellent learning
language. It is too easy to be spoiled by OOP, and then never really
learn how functions/data/objects interact. I also like that you can
do inline assembly language if you want to streamline a routine.

I would definitely not call C a learning language, any more than I
would throw assembler at someone to start. There are too many warts
that are irrelevant to the basic tasks of a newbie. They just
distract and confuse. Further I think people who start with OO will
write much better C if they learn it later after the OO habits are
ingrained.
 
A

Andrew Thompson

Luc said:
If I write a Java program, I will expect it to be run by the JVM - that
does not bother me.

But to appeal to users who have never even heard of a command line, I
am going to need some form of system integration. In the case of
windows for instance, I will likely need a start
menu/desktop/quicklaunch icon

...- some programs call for right click
functionality of files.

<http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html#information>
'association' element
 
R

Roedy Green

But to appeal to users who have never even heard of a command line, I
am going to need some form of system integration. In the case of
windows for instance, I will likely need a start
menu/desktop/quicklaunch icon - some programs call for right click
functionality of files.

You can set up desktop shortcuts. You can use installers that to the
user look just like the ones they use for C++ app installs. You can
use Applets which look to the user just like animated web pages. You
can use JAWS which automatically installs updates.
 
R

Roedy Green

In exchange it uses more ram and is slower.

I know you warned people with your name you like taking trollish
positions. It is an effective but annoying way to get information
quickly. See http://mindprod.com/jgloss/chargealong.html

Java the language is running on cellphones and PDAs where the ram and
speed requirements are much tighter than on your hypothetical desktop.

Java the language can be natively compiled with an optimising
compiler, just like C++. The only place where Java is inherently
slower that C++ is that it usually goes through a platform
independence layer to access the native GUI. C++/C is typically tuned
to the particular OS. You trade multiplatform for a speed. If you use
Rogue Wave or simpler product for platform independence in C++ you
have the same problem.

It has nothing to do with the language. Java itself has many features
that make it more optimiser friendly than C++. You would expect it to
correct many of the problems of C/C++. It had the benefit of the C/C++
experience.

If you want a faster GUI you can use SWT.

I bash Java myself, but at least I have been using it for a decade. It
is annoying when someone so ignorant and so cocky does it. You can't
compare two things until you are familiar with both.
 
L

Luc The Perverse

Roedy said:
I know you warned people with your name you like taking trollish
positions. It is an effective but annoying way to get information
quickly. See http://mindprod.com/jgloss/chargealong.html

Actually I have been using this name for about the past 5000 usenet
posts - kinda became second nature :)

The members of this group, yourself particularly, have been
exceptionally helpful.

Sorry I pissed you all off :)
 
A

Andrew Thompson

Chris said:
Andrew said:
(snip)
[ cannot say I'd ever heard of the security problem
re JWS ]

The one I was thinking of was (selecting a BUGTRACK archive almost at random):
http://marc.theaimsgroup.com/?l=bugtraq&m=111117420632213
and also see:
http://marc.theaimsgroup.com/?l=bugtraq&m=111160970209222

BTW, there's a newer one, fixed in JDK 1.5.0_2.

http://sunsolve.sun.com/search/document.do?assetkey=1-26-101748-1

No details the error are given -- which I take (uncharitably) to mean that it
is particularly ludicrous ;-)

Thanks for the tips, Chris.

As you might have guessed from the 'JWS/JOGL test..' thread,
I am currently developing JWS deployed Screensaver previews.

As a result of your tip, and some investigations at Sun,
I will be specifying a minimum version of 1.5 (the minimum
Java for the Saverbeans API) that should end up with most
users possessing a JVM version that fixes the known* security
bugs.

* 'Known security bugs have been fixed'
...replaced with unknown security bugs ;-)
 
Z

zero

I have identified that C is a stupid language to try to
inplement a GUI in


Making a GUI is C or C++ is pretty much the same: you just use the Windows
API (since you talked about EXE files in your first post I'm assuming
you're targetting windows). This is indeed not as easy as Java, but it's
not that hard. C++ does have a lot of visual libraries that facilitate the
tast when compared to C, but they are not part of the language. In
essence, creating a real Windows GUI is the same in all languages: you use
the Windows API. So I don't think you can say C is a stupid language to
create GUIs, it's the API that makes it easy or hard.
 
M

Monique Y. Mudama

Making a GUI is C or C++ is pretty much the same: you just use the
Windows API (since you talked about EXE files in your first post I'm
assuming you're targetting windows). This is indeed not as easy as
Java, but it's not that hard. C++ does have a lot of visual
libraries that facilitate the tast when compared to C, but they are
not part of the language. In essence, creating a real Windows GUI
is the same in all languages: you use the Windows API. So I don't
think you can say C is a stupid language to create GUIs, it's the
API that makes it easy or hard.

That being said, I find the Java AWT and Swing APIs, while initially
daunting and completely confusing, rather full-featured and mostly
sensible once I took the time to properly understand LayoutManagers and
such. So I do think you can say that Java does a pretty good job
providing a GUI API (with certain glaring exceptions, I'm sure).
 
R

Roedy Green

That being said, I find the Java AWT and Swing APIs, while initially
daunting and completely confusing, rather full-featured and mostly
sensible once I took the time to properly understand LayoutManagers and
such. So I do think you can say that Java does a pretty good job
providing a GUI API (with certain glaring exceptions, I'm sure).

Java had a big advantage. AWT was devised all a piece after watching
the evolution of the Windows api. Remember Windows started out on the
80286 before Intel had even mastered flat addressing and had a max
640K RAM. Sun had the benefit of X, Mac, etc. as models. Ditto with
Swing.

When something gradually grows, it shows. It has the look of a 100
year old jade plant.
 
A

Andrew Thompson

Roedy Green wrote:

Things that make you go, 'Huhh?'..
When something gradually grows, it shows. It has the look of a 100
year old jade plant.

errr... I have noticed a number of times that you quote
something visual, and I[1] end up with no idea what you are
talking about..

What is a 'jade plant'?

What is the significance of the 100 years?
Do jade plants have a 'use-by' date?

[1] (shrugs) Maybe it's just me..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,206
Latest member
SybilSchil

Latest Threads

Top