The End of Native Code?
psycln asks: "An average PC nowadays holds enough power to run complex software programmed in an interpreted language which is handled by runtime virtual machines, or just-in-time compiled. Particular to Windows programmers, the announcement of MS-Windows Vista's system requirements means that future Windows boxes will laugh at the memory/processor requirements of current interpreted/JIT compiled languages (e.g. .NET, Java , Python, and others). Regardless of the negligible performance hit compared to native code, major software houses, as well as a lot of open-source developers, prefer native code for major projects even though interpreted languages are easier to port cross-platform, often have a shorter development time, and are just as powerful as languages that generate native code. What does the Slashdot community think of the current state of interpreted/JIT compiled languages? Is it time to jump in the boat of interpreted/JIT compiled languages? Do programmers feel that they are losing - an arguably needed low-level - control when they do interpreted languages? What would we be losing besides more gray hair?"
We might be loosing our ability to spell the verb "lose".
No, wait, too late.
Has the author of this article ever USED any non-native code powered applications? Stuff written in Java and .Net (especially Java) runs like crap. Even with a fance new dual core processor and gigs of RAM, running a simple non-compiled word processor will bring your system to a standstill.
When your web-based-datastore gets 50,000 inserts per second, hovers between 15 and 20 billion rows and endures a sustained query rate of 43,000 queries per hour, tell me which part of it you want to coded in PHP.
Didn't we already do this with lisp, like 40 years ago?
As the overhead of interpreted languages gets smaller (through faster systems, JIT, and other optimizations), its inevitable that eventualy we'll all be using one (unless you are one of the few people who have to program the virtual machines, the JIT compilers, etc).
And this is a good thing, because it means more independance from certain CPU architectures.
Someday, you will be able to use any OS on any CPU and any Application on any OS. This is one step in that direction.
-- Senior Software Engineer, Attorney appearance services, locallawyerapp.com.
No, no, obviously, they're loosing grey hair in the same sense that one "looses the dogs" -- i.e. they're setting the grey hair free.
On every computer I use with Windows it takes up to 20-30 seconds to launch Java. Web page have a little "yes, you have Java" applet? Prepare for a massive slowdown. I'd hate to see what it does with applications that may just appear to hang the computer while Java launches. And don't get me started on taht stupid "Welcome to Java 2" dialog that pops up from the taskbar.
Now on my Mac, things are different. Java applets launch just as fast as Flash if not faster (basically, instantly). This is on my G4 so things would only be better with a CoreDuo. Same goes for applications. I've been using an appilcation called YourSQL for over a year. It accesses a MySQL server and works great. It's very fast, has a perfectly native interface. You would think it is a native app, but I recently discovered that it's Java. The end use would NEVER notice that kind of thing except I was trying to debug a problem in my own code so I went to invesitage how it worked. It was Open Source and when I downloaded it... it was Java.
Java is fantastic on Mac OS X. I don't know how fast it is on Linux. But as long as there is a 20-30 second launching penalty on Windows, Java will never be accpeted. I don't think .NET has this problem, but probably because MS is keeping it memory resident in Vista even if no one is using it.
Then again, maybe Mac OS X preloads Java. I don't know if it has tricks, or if the Windows implementation is just that bad.
Comment forecast: Bits of genius surrounded by a sea of mediocrity.
At this point, there is still a lot of development happening in "native" languages. Additionally, there are projects in motion to turn bytecode from environments like Java and Python into native code. One of the reasons a lot of people are seeing this seemingly massive movement is because of the technologies these "non-native" solutions leverage. Take both Java and .Net - the support libraries are huge and designed to (more or less) work together.
All of that said, I'm a bit sick of either having to put up with the limitations of some of the languages that end up as native code or distributing some runtime environment with my app that immediately gives my users an impression of my product. For that reason, I've started to use D - http://blogs.itoperations.com.au/chris/software/la nguages/language-choice-is-a-compromise/. If you can't be bothered reading my convoluted blog (there's more coming on the subject, along with a project release in coming weeks), go on over to the language's home - http://www.digitialmars.com/d/index.html. It has the vast majority of C++'s features (and more), Java/C#-style syntax and ease whilst compiling to native code.
You're going to get a lot of the same sort of responses now - lots of people arguing about a requirement that these non-compiled programming languages aren't suited for. Every language has a different purpose when its creator(s) decides what direction to take.
Death by snoo-snoo!
The old saw is to not optimize until you have to. Write in an interpreted language, but be ready to dive into native code when the need for speed arises.
(a) 'loosing': oh jesus christ
(b) the obvious answer is that native vs interpreted is basically simply the balance of developer cost versus cost of end-user resources (ram, cpu, users time). Interpreted code is getting faster every day, no matter what "OMG JAVA IS SO SLOW DUDE" geniuses on the interweb tell you, but there'll always be problem spaces where a 5% speedup pays huge dividends.
there is no need to sign your posts. this isn't usenet. your username is right there above your post. stop it.
Outside of introspection and like technologies there is no reason why code cannot be compiled natively. Linux users are aware of compiling java code natively, microsoft is working on a native c# compiler, so why is it that everyone else things it's still okay to compile to byte code or scripts. It's not; end of story. I do not like when every new processor that comes out is stomped on by new programs requiring more resources to do the same job. How many java programmers use runtime reflection or introspection? How many programs is it actually needed? If you're not using that, then you should compile natively. Just because Vista is wasting precious resources on it's silly aero glass, etc, doesn't make it right for everyone else too. What happens when someone tries writing a kernel in an interpreted language? Stage 3 bootloaders'll throw us into a JIT environment now. I could just imagine the efficiency there. Native languages are the way to go and we're in for big problems if they don't stay around.
There will always be native code because it is faster. When code needs to perform better, rather than be more flexible, people will always go back to Asm and other such low level languages.
And yet even though c was 200x slower most people now program in C or a "higher" language, why? Portability and ease of use. Isn't that what interpreted languages offer us more of?
Yeah... people keep saying that. Okay, lets take the benchmark I hear about most: http://kano.net/javabench/ "The Java is Faster than C++ and C++ Sucks Unbiased Benchmark". Unbiased my foot. "I was sick of hearing people say Java was slow" is not a good way to start an unbiased benchmark. Lets have a few more problems:
Y'know, I think there's a reason for that...
Y'know, a couple of decades ago I was running non-native applications on a 7Mhz system with 1MB RAM (my old A500). They were fast, but not quite as fast as native. I'm now using a system in the region of 500 times faster, in terms of raw CPU, and with 2,048 times more memory. And y'know what, non-native stuff is fast, but not quite as fast as native. Something about code expanding to fill the available CPU cycles, methinks...
Of the development I do, about 60% is in non-native code (mostly java) and about 40% is in native code (usually C++). What I have found is this:
Java is the language I use the most, and it's good for small programs. It's definitely noticably slower for large applications, but I don't think that's the big reason that a lot of developers don't like it. Swing is nice, but the problem with Java and a lot of other "modern" languages is that they try so hard to protect the developer from themselves and enforcing a certain development paradigm that the same features that make it really nice for writing small program end up standing in your way for large and complex application development. Looking at the other side of the issue, C++ is fast, it can be fairly portable if it's written correctly, and has a huge amount of libraries available. C++ will let you shoot yourself in the foot, but the reason is that it's willing to stand out of the way and say "oh really want to do that? ok...". This makes it easy to write bad/buggy programs if you don't know what your doing, but if you pay attention, have some experience, and a plan for writing the software, then C++ can be less stressful to develop.
Aside from a reasoned argument, I think a lot of developers are just attached to C/C++. I know that I just enjoy coding in C++ more than in Java. Not that Java is bad- and it can be fun to code in at times, but the lower level languages just give me more of a feeling of actually creating something on the computer- as opposed to some runtime environment.
Finally, one major reason to stick with C++ is that many interpreted languages aren't really as portable as they pretend to be. A language like C++ that really is only mostly portable, and then only if you keep portability in mind, can sometimes be more portable than other languages that claim to be perfectly portable and then make you spend weeks trying to debug the program because things are fouling up.
Famous Last Words: "hmm...wikipedia says it's edible"
Overall, I think the answer is yes. As far as .Net goes, there are a lot of advantages to having libraries and applications in a format that can be just-in-time compiled or pre-complied to native code on installation. Certainly, for MS it is a big advantage, as they don't have to target a lowest-common denominator of CPU features. Another advantage is that .Net does have pretty decent interoperability with native libraries. So, if you need the native performance, you can use a native library to try and gain some performance back without going totally native.
.Net to precompile libraries to native code. Used correctly, it can improve cold start times.
As for Java, I think it has a couple of issue that gives it a bad impression. Certainly, it's integration with native code could be improved (JNI is pretty hairy at times). Also, it seems that the current JREs don't have a lot of native tweaks to increase startup time. Certainly, I think Java could use a utility like ngen for
The choice of language does not determine if something is cross platform. It has more to do with the choice of toolkits. If you are using GTK or wxWidgets you are pretty safe for being cross platform. C/C++ are cross platform languages, but if you use MFC and COM, they're not.
Even if I use Java or C#, but don't use a cross platform toolkit (e.g. Windows Forms would not be cross platform), the application won't be cross platform.
It doesn't matter if the language compiles to byte code, if that byte code doesn't use a cross platform toolkit, it won't be cross platform.
Things you think are in the Constitution, but are not.
Mac OS X treats Java as just another app framework, equivalent to Cocoa or Carbon. (I'm fairly certain I've seen an older version of that diagram that also listed Classic in that layer.) I imagine they've done a bunch of optimizations to tie it into the system, though I don't know whether it launches the runtime at boot or not. You've probably noticed that on Mac OS, you get your Java runtime from Apple, not from Sun or IBM.
The downside is that things don't work quite the same as they do in Sun's Java runtime, so there are differences between Java-on-Windows and Java-on-Mac. For instance, my wife is an avid Puzzle Pirates player, and the game client is a Java app. There've been Mac-specific bugs in the past, and at one point a major slowdown appeared when the game was run on a Mac. It hasn't been fixed, so while she can still do crafting on the Mac, whenever she does anything multiplayer, she has to switch to the Windows box.
I am not expecting to be loosing arrows from my bow any time soon, but I am hoping that the /. editors can stand to be losing some O's from the summary. :)
And wtf is "loose"?
Silly question. The answer is and will always be: No.
Commodore 64 BASIC was interpreted. Computers now are obviously powerful enough to run 64 BASIC code very quickly. Does that mean native code should have been abandoned years ago because technology advanced enough to allow C-64 code to run quickly? JIT code will always be slower than native code and because the complexity of both JIT and Native code programs will get more complicated as the technology advances interpreted code can never catch up.
List of things you cannot loose:
- your gray hairs (unless you can command them somehow)
- control
- the big game
- your way
List of things you could be loosing:
- the hounds
- your belt
- an arrow
- responsibility
Did you ever notice that *nix doesn't even cover Linux?
~ $ file /usr/bin/amarok /usr/bin/amarok: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.6, dynamically linked (uses shared libs), stripped
/usr/bin/amarokapp /usr/bin/amarokapp: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.6, dynamically linked (uses shared libs), stripped
~ $ file
amarok-1.4.0/amarok $ ls src/
*snip* a bunch of C++ source and header files.
Come again?
Sticking feathers up your butt does not make you a chicken - Tyler Durden
Now find me one CPU that can do a decent simulation of the physics of continuous media. Why isn't there any game where you ride a surfboard realistically? Why do meteorologists use the most powerful number crunching systems in the world to be wrong in 50% of the cases when predicting weather a week ahead?
And what about artificial intelligence and neural networks? Find me a CPU that can do a decent OCR, or speech recognition. What about parsing natural language? Why can't I search in Google by abstract concepts, instead of isolated words?
No matter how powerful CPUs are, they are still ridiculously inadequate for a large range of real world problems. When you go beyond textbook examples, one still needs to squeeze every bit of performance that only optimized compilers can get.
It's "LOSING"! L-O-S-I-N-G! One "O". Just one.
The opposite of "win" or "gain" is "lose".
"Loose" rhymes with "Goose". It can be used as a verb, but it means something different than "lose".
Geez, doesn't anybody read any frickin' books any more?! If you read books once in a while, you would actually learn to spell.
OK, you can mod me down, I'm done.
You are in a maze of twisty little passages, all alike.
I took java last spring for a MIS course and I was expecting the usual slow load times with things like netbeans. The class was taught with java 1.5 and I noticed it was fast. All the java applets just loaded including the java programs netbeans on my system.
Oddly I wondered why Azuerous and frostwire seemed to not be that slow anymore as well. I figured I just assumed java didn't suck as I thought it did.
Now I know why.
For the slashdotters reading this, I highly recommend upgrading to java 1.5 on your machine. You will certainly notice a speedup as I did.
http://saveie6.com/
Don't you hate that answer?
Yes, we are seeing more development in non-native code but, it gets it's power from the underlying libraries and core code that is native. The line between them gets fuzzy when you toss in JIT and scripting to native code compilers. It really depends on the problem area. If I'm just parsing apart a bunch of log files to make reports Perl or Python would be the best. Web apps seem to benefit from the safety net of non native code but I'm sure there are exceptions.
OTOH there are plenty of apps that need all the speed and memory the machine can provide. My current job involves real time financial data delivery. Writing that in Python or Java would (probably) not work out too well. OS code that works directly with hardware will probably stay in assembler or C. Fast low level stuff is what allows the slower high level stuff to be useful.
Either way you still need to know what you're doing because in the end both native code and interpreted code run as opcodes on a CPU and use hardware resources. You need to mind memory use in Java just like C. Just in different ways. You've need to watch what you do in inner loops in both Python and C++. Linear lookups can cause scaling problems in Perl, Java, Python or C/C++.
It all depends on how fast you want to get from problem to solution, how much hardware you can throw at it, how complicated the problem is, how much time you have and many other factors.
Languages are tools, not a religion. The broader your knowledge the more tools you have at your disposal. Pick the best one for the job at hand.
The obscure we see eventually. The completely obvious, it seems, takes longer. - Edward R. Murrow
Ok, assuming the post isn't flamebait... This issue keeps coming up. A good programmer should understand that the language choice depends on the task at hand.
If you're making a pretty GUI, you may want to use an easy-to-use and portable language and may not care about performance as much. If you're creating a high-performance backend, or doing some realtime processing, an interpreted language is practially useless.
Before deciding which paradigm is superior, you must narrow down the question to a type of task. Since the variety of tasks we use software for does not seem to be shrinking, it seems that this issue will not be resolved decisively anytime soon.
BASIC had its problems, warping a generation of programmers (including me), but it was small and light and didn't take long to learn unless you wanted to enough find tricks to get real work done.
FORTH was smaller, lighter, and faster. It was overly self-important, considering its reinvention of the subroutine to something new and radical, but if you wanted to program toasters or telescopes it was the language to use. Postscript was somewhat of a Forth derivative.
P-Code was a nice portable little VM you could implement other things on.
And then there was Java, which grew out of Gosling's experiences with NeWS, a Postscript-based windowing system. If you wonder why you're not using Netscape and maybe not using Java, and why you've probably got Windows underneath your Mozilla, it's because it became obvious to lots of people that Netscape+Java was a sufficiently powerful and easily ported environment that the operating system underneath could become nearly irrelevant - so Microsoft had to go build a non-standards-compliant browser and wonky Java implementation and start working on .NET to kill off the threat. It wasn't that conquering the market for free browsers was a big moneymaker - it was self-defense to make sure that free browsers didn't conquer the OS market, allowing Windows+Intel to be replaced by Linux/BSD/QNX/MacOS/OS9/SunOS/etc.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
This isn't necessarily good for the processor market, because it makes everyone stick to the same standards, even if they're ineffiecient. Oh cool, Company X has designed a processor with a cool new feature that will make programs wayyyyy faster! Oh wait, there's that darn high level language, too bad it'll never be used. Of course, it may be beneficial, because people's progress would be channeled into one direction, however this is only useful for so long, before true innovation almost comes to a standstill.
Just my $0.02.
I'm a Software Engineering Consultant who works in the avionics industry. While the enterprise application market may be moving that way, avionics certainly is not. I program about 80% C code, 15% C++ (helper apps), and 5% Assembly Code. The cost involved in certifying any sort or interpreter or JIT compiler is not worth it to anyone doing saftey critical RTOS work. Any speed in application development would be offset by several orders of magnitude in the effort to make that language available to the embedded platform through a certification process which would likely take a large team of developers several years. And maybe by then the cost of the hardware will have dropped enough to support it. Right now the product I work on has 512kB of Flash and 1MB of RAM, and it runs on a ultra low power 20MHz processor.
But for all you folks working in the application sphere, I'm sure things are heading that way as portability becomes a larger issue between OS's and architectures as the market moves away from a Windows based x86 monoculture. But for those of us working on products that include hardware, extra cycles aren't in the budget since they drive up the per unit cost.
Subject: Re: The End of Native Code?
Body: No.
OOOor he could have a twitch in his finger from drinking toooo much cooffee. I get thooose all the tiiimmme!
... there's no time to loose!
(or is that "there's No-Time Toulouse!")
The one edge that naitve code will always have over interpreted code is that naitive code can just be loaded and fed to the CPU. An added concern is that most comptuers are doing more than one thing at a time. If all the CPU had to do was interpret one program and run it, that would be one thing. But if the CPU is trying to run 5 or 12 apps, and it has to interpret more than one of them, then there will be a bit of a logjam.
END COMMUNICATION
Write in an interpreted language, but be ready to dive into native code when the need for speed arises.
OK, I'm developing for an 8-bit NOAC (6502 based) microcontroller clocked at 1.8 MHz. Does the need for speed arise here?
Interpreted & JIT languages are "within a constant factor" of native code's speed, and CS students are taught that such things don't matter. ;-)
And for many types of apps, they really don't. Ten times slower than instantaneous, is instantaneous.
But people use computers for lots of things, and believe it or not, some of those things are still CPU-bound, and take so much work that humans can perceive the delay. Your word-processor is 99% idle so surely it doesn't need to be native, but you know that somewhere on this planet, a poor shmuck is staring at an hourglass icon, waiting for a macro to finish. The real question is: who cares? Is that guy's time worth more, or is the programmer's time worth more?
As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
Chances are there will always be both...the only one that can die is interpretters... Heres some reason why: -You cant write an operating system in an interpretted language... -There are some things you can only do in a native language, and interpretted language have the easy portability thing going on for them... -Interpretters have been around for a long time and they arnt going to go away any time soon You cant think native code is going to be dead just because someone makes a popular interpretter...there are just some things an interpretter cant do... Besides, ASM is so awesome who would ever want it to go away...:P
Anyhow, you give me the magic for, e.g, parsing natural language and I guarantee you that even if you take a 20% performance hit for running the magic in Java instead of assembly it won't matter as I can always buy more iron and if your magic actually does what you say it does I'll have money to spare.
Help poke pirates in the eyepatch, arr.
One of the oldest analogies in computing is comparing algorithms to cooking recipes. We even have books like "Numerical Recipes" and "Perl Cookbook".
Well, to me, interpreted languages are like frozen dinners. They will do if you come home late at night and are too hurried and hungry to cook a proper meal. But C is like a fully equipped kitchen. It takes *much* more skill to cook a proper meal than to heat a frozen dinner in a microwave oven, but the results are incomparably better, not to mention the pleasure you get from doing it the right way.
If we all quit using native languages, then what are we going to use to a) write embed code, b) write drivers, c) write operating systems and d) write the interpreted languages that we use to replace our native ones?
Does anyone remember USCD UCSD P-SYSTEM?
The sun/microsoft handling of Java and Java standards did nothing to help its adoption.
.net/mono
Yet, it seems Java is one of the most used languages.
This web site, http://www.tiobe.com/index.htm?tiobe_index (seems to be in netherlands and uses search engines to calculate the ratings) lists:
1- Java 21%
2- C 18%
3- C++ 10%
I use C++, and although that's x-platform, its usage is Windows specific (COM, ATL, etc). That's because I don't need a Mac/Linux version of my software. IFF I did, I'd have to either
- manage my C++ abstractions more carefull to avoid os dependencies
- use Java
- Dare I say it,
If I had to make some crystal ball 4 year look ahead, I'd say the MS os dominance will increase the use of JIT languages, especially with the runtimes being included in the os (Vista).
C++/CLI, there.
http://superconfigure-supergroove.appspot.com/
Native code? You mean machine code of course. On some architectures you could go deeper and deal with micro-code.
Maybe you mean code that depends on a knowledge of the hardware. What about bios interrupts? How is making a bios call different than calling a Basic routine on a Vic-20? There is nothing keeping me from creating a machine whose native language is Python (what you call machine code would then become micro-code).
Even the 'C' language is a fair bit abstracted from the hardware. For instance, in the embedded world I can write 'C' code that is easy to port between different chips. As a system gets more resources, the requirement to write tight code decreases and one can take advantage of languages that are more abstracted from the hardware.
I guess my answer to the question is: "Who cares?"
I think they might have meant USians as apposed the the THEMians.
Just my thoughts as i wing it through this world. Don't give them too much credit.
We win together or suffer without.
loosing != losing
Can most hobbyists afford its 400 USD price tag?
Software will always expand to fill available resources with useless secondary gimmicks. I mean, look at Vista and its requirements. You would hope that when purchasing a PC that the available resources you are paying for will be used by applications you use. Instead, looks like the OS will be eating most of that up. It is the operating system's job to facilitate applicatons' access to resources, not to squander them on mostly useless (although arguably pretty) features.
Is PC133 SDRAM still available for purchase at a reasonable price? Or should I buy a whole new computer instead in order to take advantage of various flavors of DDR SDRAM?
I don't run real-time anti-virus or anti-spyware. I start the periodic check and then go eat dinner, and I use safe hex methods (including Mozilla technology and a NETGEAR firewall router) to not get infected in the first place.
These days I program mostly in Java / C# with occasional quick-n-dirties in PHP. However, for system programming you'd want something low-level like C (or even assembly). For an OS, compilers, assemblers, drivers, or anything real-time you'd want a non-interpreted language. Same goes for the interpeter (like a JVM) or a JIT.
And before you say hardware support for interpreted language - do a quick search on Japan's fifth generation project.
[Insert pithy quote here]
HD video (1920x1080, rgb, 30fps) is 186 megabytes per second. Processing that with an interpreted or even JIT language is going to be many orders of magnitude slower than hand-coded C, or GPGPU, or whatever the flavor of the month is. Yes python and ruby are super productive. But my time writing the code is only spent once; the poor schmucks out there using it will be using it every day for years.
People doing HD postproduction really care about every cycle per pixel because the factors are so large: if you can turn a overnight render into a lunch-hour one, or lunch hour into a coffee break, or coffee break into near real time, that matters a lot. That time to the video guy is what the edit-compile-debug loop cycle time is to the programmer.
--ST
The java crowd keep sending those benchmarks where java performs greatly. But still, any big app I take to test runs like crap. Even the java-coded tools used to create java programs themselves perform like crap. Its a pain to use that. Even eclipse runs like crap, in computers were everything else runs just fine.
When I run so-called-compiled code under an emulator like Bochs, *poof* it's no longer native. In theory, it can be very managed if the emulator is capable of doing sophisticated things like moving threads around virtual processors based on the potentially-changing resources available on the underlying host environment, adding processors or memory on the fly (assuming an OS that supported such things), etc., things clearly beyond the abilities of most "native" PCs.
The reverse is true if I pass my java source- or byte-code through a compile-once/not-JIT "native" compiler. Managed code suddenly goes native.
I predict people will work in the environment that is most efficent for them, where efficiency takes into account development costs, maintenance costs, run-time costs, political costs, etc. etc. etc.
There's also the question of "what exactly is managed code." If your program compiles against an exception-handling library, as most large programs today do, is that not a primitive form of code management? Granted, you may have to write your own management layer, but it's still not totally unmanaged. Even running as a process in a modern OS is a form of management, since a fatal-to-the-process error can invoke OS-level clean-up routines to close files and return resources.
To borrow from Shakespear: Managed or unmanaged, that is the question.
The answer depends on your perspective.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
I think things may start going the way MS is pushing with C#: Managed apps with unmanaged parts. I mean after all, is a UI really going to get much faster in native code than the .NET runtime? Even if it is, would you notice? Ok so code the UI part all in a managed environment. Then, code the time critical stuff in a language that compiles natively and hook the two together (VS does a great job with this). You get the speed where you need it, but the advantage of easy coding for most of the project.
I could see that becomming popular.
Thinking back a few years, iirc the first Apple Mac had the Quickdraw graphics package written in machine language, didn't it? Not assembler, but instructions made of hand-mapped binary digits. It's the reason why those early Mac GUI's were able to extract such amazing graphic performance out of the Motorola 68000.
You can still buy Zilog Z8's, and embedded applications still exist for them.
Do not mock my vision of impractical footwear
You have NO IDEA how complicated safety critical certification is for aircraft. One CANNOT certify the high level language, one must certify the object code. Unless of course you can tell me in a paragraph or two how you can GUARANTEE that the compiler ALWAYS in EVERY SITUATION creates PREFECTLY CORRECT output.
Remember, this ain't no FPS game, people DIE if you get it wrong.
Remember how not too long ago NASA sent a probe that completely missed an entire planet? And that was a whole lot of smart boys with fancy degrees.
Picture the same thing, but with your mom/sister/dad/wife on the plane and it 'loosing' control and crashing because somebody THOUGHT they the compiler always worked.
You cannot hope to have interpreted code running on different architectures with the hope that it runs indentically on each architecture. The point is that native code (and programmers writing such code) take advantage of architecture specific features.
For example, look at the floating point unit on the x86 architecture. It supports 4 kinds of rounding modes (round to nearest even, round to positive infinity, round to negative infinity, round to zero).
If someone were writing a scientific application, the possibility that he needs to change the rounding mode of the CPU could arise for various reasons. Such a task is simple in languages such as C.
Java however does not support any rounding mode other than round to nearest even. The reason for this is that some architectures do not support multiple rounding modes (that may be false, since the rounding modes are part of the floating point standard, and any architecture that supports floating point *should* support them), and therefore supporting architecture specific code would make it not portable, defeating the purpose altogether.
-David the Great (www.scurvydogs.org)
We wrote the same search engine code in 4 languages, PHP, ASP, C++ & JavaScript. The results are published here, http://www.wrensoft.com/zoom/benchmarks.html
In summary, C++ was 4 times faster than PHP, and in turn PHP was 3 times faster than ASP and JavaScript was truly appalling. I can't think of many applications that wouldn't benefit from being 4 to 12 times faster.
In my opinion, the real advantage to bytecode is nothing more than ease of distribution. With bytecode and virtual machines, you don't need to worry that one of your boxen is a Mips processor, another one is running a Sparc, and the gaggle of other boxen are x86es. It also allows for much easier sandboxing. However, Bytecode loses a fair amount of speed, slows down loading time, gives no extra amounts of safety, and is, in general, compiled while it's running anyways (Just In Time compilation). Additionally, for most applications (not applets), sandboxing is disabled. The runtime checks may just as well be inserted into assembly code directly, rather than checked by a virtual machine. Even binary code can be created during runtime and executed from compiled code (well, unless you enabled W^X in the OS, in which case a VM is a way of cheating and working around that security). As a matter of fact, this "generated code" method is used from within Gnu C for closures (nested functions that can reference the enclosing scope). In my opinion, any program tied to a single machine for most of it's life (eg: something that would run on Windows .NET) should probably be compliled, since there is absolutely no advantage to a virtual machine. For things like Java applets, I can see a purpose.
now native code must execute a small fraction of instruction numbers for the same task. Less instructions means less energy. As hardware vendors strive to lower the chip power, the pressure to cut energy bill may one day fall to the shoulder of software guys.
For large systems, especially developed in-house, perl wins over java and c++ due to the higher developer productivity. I guesstimate we get a 5x productivity improvement by using perl rather than java in our core systems.
Remember the 90/10 rule - your application will probably spend 90% of its time in 10% of the code.
Once interpretters are fast enough for UIs to be first class, it makes sense to take a hybrid approach. Implement functionality in the interpretted lanugage and then override that critical 10% of the code (or whereever your critical execution path is) with native versions.
"It is our blasphemy which has made us great, and will sustain us, and which the gods secretly admire in us." - Zelazny
Well, of course Vista uses more power than any one interprited language! After all, it's written in C# running in an interpriter written in Visual Basic 6 running in a copy of Windows ME on an 8088 emulator written in Smalltalk using the old Alto runtime in an Alto emulator on a PDP-11 emulator running a port of Exec-8. The PDP-11 emulator is written in an analgram of Java and QBASIC on UAE. And, of couse, the base system on which UAE runs is Xenix with the Microsoft Bob enhancement pack.
How to enable garbage collection on a system without protected memory: #define malloc() ((void *) rand())
I am a Pascal programmer from ancient days and have been pretty much a Delphi person on account of my Pascal affinity and other requirements, but I have implemented GUI apps in C++, C#, Java, Matlab, and VB. I am seriously looking at Java/Swing as the next wave of what started as DOS/Turbo Pascal and got reimplemented in Windows/Delphi. Java simply couldn't do in 1997 what I was doing even at that time in Windows, just plain couldn't from the standpoint of features and performances. Java is not-quite-there-yet with the features I use in Windows, but it is much farther along in 2006 than in 1997 and is closing the gap with graphics acceleration and other features. It may surpass Delphi for what I do if it proves to be easier to do multi-threaded apps to take advantage of multi-core.
While my complex data visualization stuff is a long way off from being done in Java, the sort of simple data visualization stuff that I was doing in 1997 under Windows works quite well under Java, and it works equally well under Linux. If anything will get me to switch to Linux it will be that I have a collection of graphical data visualiztion programs for the work I do written in Java that will work equally well under Linux. While I can write a faster program with more features in Windows, the Java implementation is proving good enough for a lot of stuff that I am doing and it breaks me loose from Windows as well.
SUN seems to be in this Java business for the long haul, seemingly spinning their wheels making it available for free and always being a step behind Windows in features. But at some point Java/Swing programs will have accumulated enough performance and features that they are good enough for what people want to do, and they have the added advantage of not being tied to Windows. This idea that something like Java could transcend the OS may yet happen for client GUI apps.
Although Interpreted languages are running faster then ever, this is proportional to the speed of native languages, which are inherently faster by nature.
By the end however, if EVERYTHING turns into interpreted people will no longer whinge that they need to find the version for their OS, they have to go off and download the interpreter the developer decided to use, make sure its up to date, and make sure they get the one for their os (because an interpreted interpreter would be slow). You could say that once you have all the interpreters you dont need to worry, but do you??? You need to keep them updated, you now get bugs in the programs you use AND in the interpreter it uses, etc.
Yes i know interpreted languges are useful, but they will never fully replace native coding.
Back in the days of MS-DOS and 5Mhz 8088 CPU's with 640M of memory Advanced Voice, the company I worked for, ran an 8 port voice mail on an XT and it worked just fine. Matter of fact, when the ultra-fast 8Mhz and 12Mhz 80286's came out we ran a 24 port voice mail that worked great. The interesting thing is that every one else was trying to run C-coded voice mails, and struggling like hell to get them to work, our stuff just chugged along like the Energizer Bunny. And what was it programmed in? PC-Bus, aka Datapoint's Databus, an intrepreted database language. The actual source code is compiled into bytecode, which is intrepreted by a runtime interpreter. Note that 1CTI, the company that now uses that code, still runs it and it's evolved additions, except they're now compiled/run using the Sunbelt PL/B compiler/interpreter. Note that there are two versions, one for Windows and one for Linux. The basic code is the same, the difference being one uses Windows calls for some specialized stuff and the other uses Linux calls. Other than that, the code is the same. FYI, the code is an event-driven single-thread state machine.
The first will always have to be native. It just has to be.
The second will be for a while yet. Any performance demanding app will still care about the blah-percent overhead. Last I checked, my JVM only gets half the megaflops of native code. I want to skip that 50% overhead.
I'm guessing that getting a lot of that overhead back will come from moving from just-in-time compilation to install compilation that can take longer and do more optimizations.
Start Running Better Polls
Seriously.
Lots of people are debating the technical merits of interpreted vs. compiled performance. But the technical reality isn't what drives success. Perception and marketing often matter more.
There is a common belief in the market that native code runs somewhat faster than interpreted code. This means that a product that is native is perceived to run faster than a product that is interpreted, on the same hardware. Is this true? Maybe, maybe not. But so long as people believe this to be true, c-level people making strategic decisions will pick platforms based on their ability to market the product. While there are plenty of times when a product is sold to run on an overpowered systems, there are always customers who want to scale a product to the point where performance is an issue, or who want to be able to scale the product; such customers will shop on performance, and native vs. interpreted can be an issue.
I hear people say how wonderful XX language is for doing X, Y, Z, and everything else plus the kitchen sink.
Anyone here read the article on how Amazon.com is setup? How its all split off into smaller applications that do minimal work and minimal interaction?
I have one program at work that can handle around 5,000 hits a second. No, not minute, SECOND.
Its a authentication system handling a few hundred servers, of which some of these servers get upwards of 200k hits per minute.
The program that handles the work? A small multiplexing C application, on a single server.
Its hardware fail-over, not load balanced, in case of problems. Of course, its been years since it had a problem, it just works.
Java, PHP, perl, they all have their place. Typically I hear that place being how wonderful they can do 10k things at once.
Sometimes you just want a FAST, SMALL, efficent and easy to understand piece of code that isn't layered by everyones ideal world and isn't refactored 50 times as everyone comes out with the newest and greatest things.
For me, C still has a place, and I can't see that being replaced anytime soon.
My application runs in a small, single server. As all our wonderful Java and perl applications have needed more hardware, it chugs away, with its own set of new features, but on the same hardware, same memory, nice and happy.
You can optimize the other languages, and I've written C extensions to both perl and Java. Optimized away, refactored, etc. But nothing beats how low-level you can optimize a C program, and how it'll still perform years and idiologies later, on the same hardware, upgrade after upgrade.
You might find that the D programming language is right up your alley. It seems to match most of your requirements.
Being a long-standing member of the computer/console emulation community, I have seen many applications written in native code and some in other languages such as Java. If applications such as these are rewritten in non-native forms, we are looking at the emulation community taking a HUGE hit no matter how fast processors get. The whole point of emulation is the fine balance between compatibility and performance. Programmers who are looking to emulate processor intensive devices are going to use machine code, most likely assembler, to make their creation worthwhile to the average user. Not everyone will have a top-of-the-line processor every year one is released. Some programmers in the emulation world have opted for exact cycle emulation which is already a huge exchange of performance for compatibility. Coding this type of application in non-native form would make demands on the processor increase, causing an energy-saving processor to use more electricity to run an application. While this may not seem to be a concern of an individual, it would actually cost a business with multiple computing units more money in energy usage over the course of a year or so. Some businesses do use emulation technologies in a lot of areas; not all are emulated on hardware expansion devices either.
but at the same time, if your writing code that handles a massive database or a butload of connections every minute, then every bit of performance matters and your probably going to want to get down and dirty w/ C code.
it also depends on what interpreted language we are talking about. From what i have seen, Java under the right conditions can perform just about as fast as any C++ code, but if your talking about python (as much as i love python) you can kiss any real performance goodbye.
: in the end, never will be a blanket programming language for every application. When designing your application, take a look at what your domain is and from there find out which language best fits your needs. It really is as simple as that.
Java is compiled natively. If you only have an interpreter for Java you may want to upgrade; Hotspot and JIT compilers that compile to native code have been available for about seven years now for major server/workstations OSes. Time to update your software as well as your knowledge of the subject!
Dynamic compilers such as Hotspot are highly effective; they are able to do optimizations that are very difficult or impossible for static compilers (runtime statistics directed compilation, "virtual" method inlining, etc.)
So why is it that every time a new paradigm comes out we think the greatest hammer ever has been created and all the world is just the nail we've been looking for.
There's another performance issue you're forgetting: Multiple runtimes.
.NET makes Windows development not suck. Even Javascript will be useful as a desktop language come KDE 4. And all will run on reasonably modern hardware rather well.
.NET runtime, and a Python runtime, and Mozilla's XUL runtime all sitting in memory at once, each running one or two programs. That "reasonably modern" computer if yours is now not quite so spiffy, is it?
.NET". Sun's is "just do it all in Java". The open source world is largely ignoring the question entirely. :-)
Sure, well-written Java with the right non-Swing toolkit can be quite nice. Python can do wonderful things. PHP runs mission-critical aviation systems that get zillions of hits.
Now try running all of them at once.
Now you have the Java runtime, and the
Of course, MS's answer is "well just do it all in
That said, I do believe that "managed language" programs are the future. There are entire classes of bug and security hole that simply cannot exist in a language where you aren't futzing with memory directly (C/C++). I don't believe it's even possible to write a buffer overflow in Python or PHP (not sure about the others). The runtime, yes, but that's written once. You pay a cost for that, but in the long run it is a worthwhile cost.
Qt is about the only non-managed system I'd want to even think about coding for on the desktop or server. Handhelds and embedded systems, though, are an entirely different animal.
--GrouchoMarx
Card-carrying member of the EFF, FSF, and ACLU. Are you?
As other posters have noted, many large applications can now be written in a combination of native and interpreted code. Web apps are a classic example, but in our neurophysiology lab, we're just completing a new data acquisition system that does real-time data acquisition from several types of A/D converters at up to 20kHz, writing all data to an SQLite database. The system is written on OS X and the combination of Objective-C and Python with PyObjC has let us pick at will between native and interpreted code. The real-time loop at the core of the system is written in C, the more stable parts of the system are written in Objective-C (along with the Cocoa framework, the most productive language/framework combo I've ever used for desktop apps) and the more quickly changing aspects of the system are written in Python and wrapped as OS X bundles by py2app. Our users are physiology researchers and they can now write code in python to customize the operation, including stimulus generation and experimental protocol; they don't need to ever touch native code. Development was a breeze and the users' productivity in changing the setup between experiments has increased as well.
Adding to the mix, most of our users do their data analysis in Matlab (another interpreted language). We've written a set of Matlab MEX files (loadable libraries that allow native code to be called from within the Matlab environment) with a similar scheme (a mix of Objective-C and PyObjC) to allow users to retrieve data from the SQLite database.
So the original poster's question could more accurately be summed up as, what ratio of native versus interpreted code is best for your application? The next question is not whether native or interpreted code is coming or going, but what each is going to do to make integratino of the two easier.
The irony of the tagsoup is delicious...
No, stupid programming maybe... yes.
"All you have to do is be fragile and grateful. So stay the underdog." Chuck Palahniuk, Choke
Language recursion at its finest.
Large frameworks are incredibly slow.
... probably not me, though!
... if you're wondering why your Visual Basic script running an Access program has occaisionally odd behavior when integrated with your .Net application ... well, you wouldn't build a car out of rusty steel, corroded aluminum, out of date paint and then worry about quality would you?
.Net , Perl, you name it.
... nor would you write an OS in assembler, unless you wanted it to be way better than anything out there (and in 30 years, perhaps, you might be done with the boot screen!).
... maybe there is a reason most tools and OS are made in USA.
e.g. dual 800 mhz G4 tower is slower than a Mac SE
- How so, you say?
Specifically, one can type as fast as one can on a Mac SE and not have the keyboard and GUI fall behind.
15 years later, the Mac G4 written with gargantuan Objective C frameworks is slow at accepting typing - original Mac OS and apps had a lot of assembler.
Sure, Java and interpreted languages are slow - one can't always tell the difference, though. If you have Java or PHP or Perl scanning files in the background for header information, it may not matter.
On the old C/C++ compiler vs. a Human argument: There is a Japanese guy (forgot his name), who makes an excellent living speeding up compiled C/C++ code for scientific applications where it has to run fast - in assembler. So, yes, (some) programmers are faster than the compiler
Re: Java on Mac, ever notice that you run a Swing app, leave it open for 48 hours or so, come back and the GUI is gone (just a white area). Java on Mac OSX has serious bugs and I imagine has been abandoned long ago, in terms of bug fixing.
Sure, program as high level as you want. Use the best platform you can find, though
Not a rant against Microsoft, almost all high level tools have serious issues GCC, Java,
Neither would you beat an aluminum car body out by hand, most likely
Why the Indians or Chinese don't just throw 10k engineers at writing a better OS and apps in assembler, and blow all this old American Detroit style lack of quality stuff out of the water, I don't know
Except that "South America" != "America".
I'd think that computer people could understand the difference. The 'South' in 'South America' is part of the string, it's not a prepended descriptive modifier.
"South America" is not a region of a larger area known as "America." "South America" is the name of a particular region (actually, an entire continent), period. (In the same way that "South Dakota" is the name of a place, and not just a southern region of some place called "Dakota.") Occasionally we confuse the issue by calling North America, Central America and South America collectively "The Americas", but there you have to be aware of the plural 's'. "The Americas" means 'multiple Americas.' If the area being dicussed was actually 'America,' then there'd be no need for the plural.
So to sum up:
"North America" is a continent, and includes the regions claimed by the United States of America, Canada, and Mexico.
"South America" is a different continent entirely,
"Central America" is a distinct geographic region between North America and South America, although it's considered to be part of the continent of North America.
"The Americas" is a term used to refer to North America, Central America, and South America collectively,
"America" is a shortened or common term for 'The United States of America,' a country located in North America.
The common uses of the words really have no conflict; it's all pretty clear to me.
"Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
In other words, you're likely to be forbidden to distribute compiled binaries at all. A lot of programs that hobbyists would compile are under GNU GPL or another license that forbids adding restrictions against commercial fields of endeavor.
Linux only. So I can either spend $400 on the Windows compiler or spend $400 on purchasing Linux-compatible hardware to replace my Linux-incompatible hardware. And I still can't compile the Linux kernel and distribute the resulting binary because the non-commercial license is incompatible with the GPL. Hmm...
If your program is I/O-bound, interpreted is probably fine. If your program is CPU-bound, then the question is whether it's in system libraries (video decompression, number crunching) or in your code (specialized algorithm). Only in the latter case will the performance be affected by an interpreted language. As modern operating systems provide more and more specialized services, the need for compiled user code is diminishing.
it depends on what you need, an interpreted laguage will always need more memory and resources than a native code, even the JVM is made with c++ and drivers are too as well, and c++ is portable enough (java is more portable just because you doesn't need to recompile for any cpu you use).
I ) where heavy or vital process are implemented under a native code and the common process are done with java or other languages, but this kills the portability of the application :) .
Now, in the modern world companies not only program for the PC but there are servers, handhelds, cellphones and another apps where the memory really matter, for example: compare the available apps under a mobile device which uses brew apps (verizon mobile for example) and those which j2me apps (sprint or virgin); at this level (mobile apps) is not a good idea to use java "because it is portable" because most of those phones has the same kind of cpu (arm9 or arm7) and even if those where different you would need to modify your app because every phone has different specifications (display screen, sound support, memory, etc), in which case has no sense at all because you still have to modify your source code for each device.
At the PC, it is not a good idea to have your 1gb-sized app made in java it would be a waste of resources for example netbeans, let it open for 4 hours and see how much your memory is consumed (leaks?) I have seen lot of cases where simply closing the app is not enough and you have to reboot the pc, I would never say a customer "Your app is slower because it was done in java in order to have it more portable", another thing is you can't develop drivers or operating systems under an interpreted language, (no, not even vista, the core is not develop in an interpreted language).
the worst thing about native languajes is (IMAO) you have to be confident about the VM, if the VM has a vulnerability or a memory leak then you have it unless you use a jit compiler (which had to be developed under a native language).
Some apps would convine native code with interpreted code (http://java.sun.com/j2se/1.4.2/docs/guide/jni/JN
As computers get more powerful, programs will get more complex.
There will always be those who need that little extra bit of speed, or who can sacrifice portability.
Nothing really get's faster in the technology world. We all know that.
I'm old enough to remember when all "serious" programs were written in assembly, and compiled code were looked down upon as "too slow" or "only for wimply programmers."
What language do you code the interpreter in?
-- Alastair
Let's consider a modern implementation of Common Lisp. It has an interpreter and a native code compiler. (To be fair, many have only compilers, and a few only have (bytecode) interpreters, but in all cases interpreter-like and compiler-like interfaces are exposed). The native code compiler can be run ahead of time, or when the program loads. Common Lisp supports all three models of compilation. Usually, you use whichever is most appropriate for the task at hand. When you're debugging, you interpret the code, because it gives better diagnostics. When you deploy, you compile the code, to get good performance. Theoretically, if you could run, e.g., a "Lisp applet" in your browser, you might use JIT compilation. Incidentially, this compilation-model-agnostic nature doesn't have to be exclusive to Lisp implementations. All three models can be applied to any programming language, and a programming language implementation could theoretically support all of them. The advantage to doing so would be that you would get the advantages of all of them: easier debugging with interpreted code, greater speed with compiled code, and greater portability with JIT-compiled code.
Thing is, the closer to the iron you program, the faster your system's going to be. Going from Java to C makes a noticable speed difference on every system I've ever tried it on. That speed difference will mean an advantage in an increasingly competitive market, and because of that companies will still try to do things in C (Or even assembly language.)
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
And this is a good thing, because it means more independance from certain CPU architectures.
And in other news, a mysterious link is discovered between bad spelling ("loosing", "independance") and advocating interpreted languages.
Acutally could there be something here? After all, writing native code does demand a greater attention to detail than the quick-and-dirty way...
Sure it's quick and easy to code in a high-level interpeted language - and the performance hit isn't too severe.
But when your app consists of 1,000 lines of your code and another 5,000,000 lines in some proprietary runtime library, how do you maintain your app properly? Do you really believe that the NET runtime is bug-free?
Go find a programming language. And a computer. Any ONE OF EITHER. Type one "Hello World" program into it. Run it. *Then* and *only* then, you are a salty veteran code-grinder fit to post hardball hacking questions to the geekiest site on the Internet.
That why eye always use May spill checker. There art know spilling miss takes in this post. And ewe forget to capital eyes Nazis.
All misspellings and grammatical errors in the above post are intentional and part of my artistic expression.
Portability is a silly reason to use byte coded languages if you have access to the source code. Hello World in C is more 'write once, run anywhere' than any java program. Linux and GCC wouldn't support more platforms if they had been written in Java or C#. Byte codes are primarily about distributing obfuscated pseudo-source code. Their primary purpose on open systems is backwards compatability, bundling distribution mechanism, and allow people to write non-free programs more easily. Besides, cross platform is more about consistent libraries than language features. A reason Java failed on the desktop is because you cannot write nice cross platform GUI code. You end up with a least common denominator mess of expected features missing, HIG guidelines ignored, and alien look and feel.
For quickly turning multi megabyte data sets A into multi megabyte data sets B, you just can't beat writing one script and running it on all the different architectures at my disposal with no compiling. Just run the damn script. I have libraries of various Perl modules for doing different things and I can run them from anywhere.
I know Perl isn't as fast as our compiled Fortran codes, but for the ease of use to do post processing, you just can't beat the flexiblity.
This question was boring 20 years ago. The short answer is to use a compiled binary where appropriate and use an interpreted language where appropriate. The difficult part is knowing when to use one vs. the other and in some cases it is not a black-or-white choice.
Of course, monolinguists will insist on writing everything in their language of choice because they don't want to learn any other language or the other language is "too hard" (or worse, isn't supported in their IDE of choice). The sad statement is that if this attitude persists, there will be nobody to write the VMs or JITs for the "non-native" languages.....
Of course, your mileage may vary.....
Until a interpreted language will let me
-> Get a pointer to a frame buffer
-> Phys to linear map a devices register space into user memory space.
-> Access said memory space.
-> Provide deterministic performance on my embedded system while fitting inside a small memory footprint
-> Access IO ports.
-> Set up protected mode (GDT, LDTs, IDT) and far jump the processor into it.
The answer for me will be no... But if you asked me write a web based content managment system, I'd be rolling out the php and mysql. Since the beginning of computing there have always been a secret special sauce the will solve EVERYTHING. But at the end of day, most languages that have survived the natural selection process and end up widely used have atleast something they are really good at. It's all about choosing the right tools for the right jobs...
There's no ANSI-standard JAVA, or ISO Java; so you're not really sure what language you are writing in, whether it will mean the same thing in a year's time. Or whether there are defects in the interpreter (of course there are). Also, it's less environmentally friendly; in these 'carbon-conscious' days you would do well to remember that it will take more electricity to run an interpreted program ...
The problem isn't native-code vs interpretive code. It's that our native code languages are terribly flawed.
Programming backed itself into a corner with C and C++. They're useful languages, but they're not safe. Now this has nothing to do with performance; you can have safety in a hard-compiled language. Ada, the Modula family, and the Pascal/Delphi family did it. The problem is that, because of some bad design decisions in C (the equivalence of arrays and pointers being the big one), you have to lie to the language to get anything done. This makes safety hopeless. The basic problem of C is that you have to obsess on "who owns what" for memory allocation purposes, and the language gives you no help with this. The language doesn't even adequately address "how big is this". With those two design defects, we're doomed to have memory safety problems. Which we do.
C++ at first seemed like an improvement, but as it turned out, C++ adds hiding to C without improving safety. Note that this seems to be unique to C++; no prior language did that, and no language since has taken that route. Attempts have been made to work around the problem within the structure of C++, but with limited success. The "auto_ptr" debacle and the endless problems of trying to make sound reference-counted allocation work reliably indicate the fundamental limitations of the language. You just can't fix those problems in C++ without breaking backwards compatibility. (See my postings in comp.std.c++ over the last decade for more details on this.)
Java was invented mostly to get around the memory safety problems of C and C++. The fact that Java is usually semi-interpretive has nothing to do with the language design; that's a consequence of Sun's original focus on applets. There are native-code compilers for Java; GCC contains one. There are competitive advantages of locking the user into a giant environment (J2EE in the Java world, .NET in the Microsoft world), which is part of why we're seeing so much of that. But it's not a language design issue.
Microsoft came up with C# as their answer to Java, and most of the same issues as with Java apply.
What's so embarassing about all this is that it's quite fixable. The solutions were known twenty years ago. If you have a language where the language knows how big everything is, and the subscript checks are hoisted out of loops at compile time, you get safety with high performance. There were Pascal compilers that got this right in the 1980s.
On the allocation front, you can use either garbage collection or reference counting to automate that process. Java and C# are garbage-collected; Perl and Python are reference-counted, and in practice, programmers in those languages seldom have to think about memory allocation issues. Allocation overhead can also be hoisted out of loops. Java compilers are starting to do this, allocating temporary variables on the stack. Reference count updates can be optimized similarly. There's nothing to prevent using these techniques in a native-code compiler.
And that's how we got to where we are today, with buffer overflows, zombies, and blue screens of death, papered over with a layer of inefficient interpreters. Fortunately the hardware people have held up their end and made it possible to live with this, but we on the software side should have the understanding and grace to be embarassed by it.
A lot of folks use languages like PDL, IDL, MatLab, Octave, or even NumPy to do array processing, and tout the fact that for large arrays those languages run "essentially as fast as C". But that's bullshit. All those languages vectorize their operations in exactly the wrong order - if you have a hundred million datapoints and you want to do six operations on each one, each of those vectorized languages will dutifully swap each of your hundred million datapoints out of RAM into the processor, multiply it by seven (or whatever), and push it back out to RAM before pulling them all back in to add six to each one. What you really want is to vectorize in pipeline order, doing all the operations you plan to on each data point once and for all so that you can take advantage of your processor's nice, fast cache. Nobody has (to my knowledge) figured out a way to do that, that is robust enough for an interactive/JIT language, so just writing it in "C" and getting the loops nested in the right order can speed you up by a factor of more than 10 on a modern AMD or Intel CPU.
While for developers code may count it doesn't for users. If native code dies is only a questions if developers are able to build easily native code as if none-native code. As long as there are useful tools around. An these days this can be safely answered with yes.
On the other side users care at lot for native GUIs. As long as users are able to distinct e.g. a Java application from a binary (native code) application within 5 min. of using, vendors selling SW have to care for native code which produces far better native GUIs than none-native code.
Yet the SW industry does not work as in other branches. Since development costs is the driving force other considerations have to be taken into account. So for inhouse development, where users complains don't matter that much, none-native Java is favored and forced. On the other side in the free world and the commercial vendors there's no alternative to native GUIs therefore native code.
Yet the future of native versus not native isn't decided so far. With the hyped AJAX there's a none-native technique on the rise while with wxWidgets/wyoGuide (http://wyoguide.sf.net/) there's a now superb cross-platform native technique available. So it might be that in the end there's a draw between native and none-native going along very well.
O. Wyss
See http://wyoguide.sf.net/papers/Cross-platform.html
Oh yea, that is JUST what I want...
Java Version 4, runtime 3 release 2.1.7b that won't run unless I have 9 other runtimes installed to support it.
You want to know why it won't be java? Because Java SUCKS at marketing their crap and keeping it simple. Dot Net 2.0... Done. No Beans / EJB / Servlets / crap. You install the runtime and it RUNS. I cannot tell you how many times I have had to work with Java code only to find that the client has some OTHER Java runtime, and a container, etc and NONE of the code I wrote works. I am now officially on the I HATE JAVA mailing list.
For most general purpose programming, sure interpretive languages will get better. The CLR's role will need to expand to encompass that of a compiler and an installer. IL's need to be capable of resource awareness, in addition to maintaining platform independence. Development environments would still build IL assemblies, but the first task of the average runtime library would be to polish up the IL in the native context of the target system (OS, processor, bus, etc.), then persist that output.
Parallelism might take some heavy retraining for those not used to it, but even this can be eased along by constructs like method attributes and compiler hints.
Except in extreme instances, the really hard work of multi-core enabling executable code will be put in by the IL, compiler and CLR designers, not by the average keyboard jockey. I'd also imagine that as these things continue to evolve, the problem of managing an expanding array of entry points into hardware resources will be handled by some of those additional hardware resources themselves.
Pi Ran Out
Why is it that as soon as processors get more powerful, memory becomes cheaper and hard disks get bigger, the next operating systems and applications suddenly need a lot more of it; but still present you with essentially the exact same thing?
Programs written in interpreted languages need higher systems specs to run at the speeds we are used to. Sure, the modern systems can handle it no problem; but shouldn't faster computers mean faster programs and response times? Instead we get the same or only slightly faster results because we program them in slower ways because it's easier and faster for us to do it that way. Maybe we're all just getting lazy.
And with operating systems, I mean Vista in particular: by the system requirements you can tell it's a resource hog. I was horrified by the system requirements of XP when it was released, and after I upgraded and started using it I asked myself: 'What was the big deal? How is this better than 2000 besides a shinier interface?' What about Vista requires the system specs it asks for? The even shinier interface?
No more Java geeks who think that people actually want to use Java applications. Speaking as a Mac/Linux user, I can say that having portability is simply not worth the bloat and hideousness of a Java application. I'll hold out for native apps in GTK/Qt or Cocoa, thanks. And I know that Windows users are not exactly hurting for native applications. So what the hell is the point? The only people who seem to actually like using Java applications are Java developers. The problem is that you lose so much OS integration by building a one-size-fits-all application.
-matthew
"THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
Official "Vista Capable" Requirements:
800 MHz CPU, 512 MB RAM, DirectX 9 graphics card w/ 32 MB RAM, 15 GB free space.
Official "Vista Premium Ready" Requirements:
1 GHz CPU, 1 GB RAM, DirectX 9 card with Pixel Shader 2.0 and WDDM support, 15 GB free space.
I think either the author or Microsoft is out of touch with reality a bit, but I've running Vista with 1 GB RAM better than expected, and that tend to matter much more than the CPU speed from my experiences.
Beware: In C++, your friends can see your privates!
Ain't it funny, that if you want to use interpreted language, you definitely want to have the Virtual Machine or Interpreted written in native, to save as much on CPU as possible?
Ain't it the final bottomline of using interpreted code -- interpreter itself being native?
Doesn't it mean that the supporters of interpreted want, and rely on the native stuff teh most?
One guess where 99% of the ccycles arae in that
I'll take a guess! And it's even the one you want me to guess. The db2 instance. That's the fucking *point*. The fast C code that's executing has already been written.. some of it is in the python interpreter, some it is in the ksh and php interpreters, most of it is in the db2 interpreter. Very fast algorithms doing what they do best: optimized, super fast loops operating on static types.
That is WHY python and other interpreted languages achieve the speed they achieve.. because what they do is allow you to glue together C code written by other people. And, because the Python code is much simpler, you can understand the interactions between the fast code more easily, and see where your code fails to perform well. It's always because you're putting loops together inefficiently and making poor design choices, not because of the speed of the interpreter--and now that your code is short enough for you to see that, you can fix it.
Your application logic doesn't need to be super fast. It needs to be super agile, so you can refactor and accommodate changing requirements and make smart decisions about which pieces you are going to use and how you are going to use them together.
C won't die, at least, not for a long, long time*, and that doesn't bother me, a hardcore Python programmer, in the least. Somebody has to do the dirty job of writing those fast loops. Meanwhile I'll be here zipping through the application implementation.
*It will eventually be replaced by Pyrex, of course.
It's rare that you're presented with a knob whose only two positions are Make History and Flee Your Glorious Destiny.
I'm currently working with a military simulation network. That means that speed is of the essence, and memory is tight. We already are using 3GB and more of RAM, and we could expand to use any that we are theoretically given. If there's memory overhead from the interpreted language, it's unacceptable. If there's a speed penalty from an interpreted language, it's unaccpetable. There are times when code is written that is nowhere in the realm of good coding because, yes, function calls do take time because not everything can be inlined. There are others working on the same project using interpreted languages, but they're not able to work at the resolution that we work at. To mirror some other comments, if you're writing GUIs, or database apps, or web apps, then interpreted languages may work just fine for you. I never intend to do those things as I think I'd be bored beyond belief. I write algorithms...and I use native code.
ahem.. you obviously have not done java extensively, for client side apps you are set with a vm, thats it, everything else has to be bundled in the jar. For server side apps, a jee container does it in conjunction with a vm, everything else should be bundled in the ear or war file... seems hard? Programming java is a different issue, if the vm and jee server do not fullfill you needs you have to go jar shopping, which is not too bad, good ides bundle most of the stuff you need and basically a webapp is a push of a button.
There's a whole number of reasons why native languages are still in very heavy use in a number of environments and industries. The original post plays down the performance concerns but they are a real consideration for many products. Compare the user experience of a Java GUI application to a native C++ one of comparable functionality. Even if the C++ product uses MFC or somesuch it will still be faster, more responsive and leave more CPU and RAM around for the other apps. Embedded systems often don't have enough system resources to make an interpreter or vm workable at all. Some applications (i.e. games) are engineered specifically to use as much system resources as possible, in order to provide the best possible user experience. A vm might take 2ms per frame and 4MB of RAM (or quite a bit more in some cases) that's a pretty serious thing for a game, you might have to remove something (or several things) to free up enough resources for that, and it would add nothing to the user experience at all.
In my experience this is not really the case at all. Decent C compilers are available for almost every single platform in existence, most interpreters and vm's are compiled on C compilers. In contrast many vm's are confined to specific platforms, or have only patchy support for platforms other than PC.
Platform support aside I would also assert (without any actual proof) that the consistency between platform implementations for a given C++ complier is far in excess of the consistency between platform implementations for most vm's.
Also, vm languages often need extra (native) runtime modules to access specific API's which are not available through the language itself. This means that if a required runtime module is unavailable for a given target platform, the application developer is basically barred from it until it becomes available (or they write their own native module to access the API).
Finally, vm and interpreted languages almost always require more setup of their target environment(s) than native languages. Most of these kinds of languages have no concept of a linker, so all module binding is done dynamically (i.e. at runtime). Obviously some OS's (i.e. windows) lean towards dynamic bindings for native code as well, but native languages are equally capable of both. When you're writing any kind of consumer targeted software, telling people that they need to download the latest jvm (or whatever) and wait another 20 minutes (if you're lucky) for that to download and install just so that they can start to install your software is a sure way to send them to your competitors... If it doesn't then get them started on setting their CLASSPATH.
This is an arguable point at best. While such languages are often easier to both learn and to start new projects for (i.e. no build scripts etc.) I wouldn't say that there's a clear winner for overall development time. It often depends on what you're trying to write. Generally lots of string manipulation and calls to standard system modules (i.e. file system etc.) are simpler in interpreted languages (provided that you're not trying to keep your memory footprint down) but some other things are easier in native languages (i.e. encryption or math which requires specific and consistent accuracy).
Garbage collection is often cited as a feature of interpreted languages which decreases development time (because developers don't need to worry about memory allocations and deallocations) but garbage collection is also available in native languages, it's just not popular. Also, doing 'advanced' things in interpreted languages is often quite a bit more tricky than their native counterparts (i.e. function pointers - the C# equivalent is far more complex).
In general (l
I think the call of managed code may be in the distant future.
I recently wrote a Quake 3 BSP renderer in C# and it averages around 300 FPS with lightmapping unoptimized.
I also recently ported a raycasting engine from C++ to C# and it performs beautifully in 100%
C#.
$(SUBJ) is if software development would move from native code or P-Code or Java to something that does source compilation stage also in JIT (I am awed with what Psyco does, but I'm sure there are many other possible options). See - it's nice that OOo or Mozilla are open source but it's sure as hell that I don't have dedication to download source for it, dependencies and spend a day or two just trying to compile it. Now - if this software would be available in "runnable source" form then I think we will have 10x number of developers compared to now. As it stays - barrier to entry is too high.
I think at least Python in its _current_ form is suitable for writing an office suit or browser, not to mention "simpler" apps. And I don't see why other languages cannot achieve same level of efficiency.
I've been making a living contract coding C++ and Qt for about four years now. I've also used Java, PHP, python, and a couple of other languages for various projects. I really like Java as a language, I think PHP is pretty nice and useful and I absolutely adore python. But the C++/Qt combo is what I enjoy most.
.NET, where Mono only implements part of the environment.
.NET are almost non-existing. Why? Performance. These systems are based on slow processors and always too little memory. But with a little extra care, I can use the same C++/Qt combo to solve the projects here.
.NET application to Qt (this was one of the rare Windows only contracts) because the performance of the .NET app was so horrible it was going to be rejected by users. And the Microsoft engineers who helped this company solve the issues kept saying "the next version will fix all your problems". Well, after three new versions that didn't fix anything, they decided to get rid of .NET and hired my company to rewrite it in Qt. And they are incredibly happy with the result. The application outperforms the old .NET app in every single way. Even on large workstations. For this company, managed code is something they might look at again in some distant future.
I'm very much into cross platform - usually all my projects have to run on Linux and Windows. My experience from this tells me it's not more difficult to do in C++/Qt than it is in Java, but you need to know what to avoid. The Java saying "write once, compile anywhere" is marketing bs. Java apps needs porting, just like anything else. It's even worse for
I also work a lot in embedded devices, and in this area the Java and
Another case where performance mattered: I got a contract to port a
The one thing that can get more complicated with native code is deployment. The Java way of packing everything in a single jar file often works really well. With native code you have to care about library versions, binary compatibility, and different OS versions. This is a real problem, that managed code has much better answers to.
My experience is that it is not more difficult to write code in native C++/Qt than in Java. The outcome of it is more difficult to install and deploy, but after it is solved, you will get an application that has a better look'n'feel to it.
Bo Thorsen,
Thorsen Consulting.
As for web apps, hardly anyone uses native code to render HTML but a lot of what goes on behind the scenes such as database drivers, interpreters, zip libraries etc are native (if they work at all). The browser too is native.
So there is really no 'end' for native code.
You see this? This is a C style comment. We're not going away any time soon my friend.
*/
press [TAB] to let VS.NET auto complete 10 new lines of code for you,
instead of looking up the docs and killing your hands.
yeah. i wish netbeans crew would "steal" all coolnessheit from VS.NET into java.
it's all about the ide.
Why? Because Python makes it easy to use the right data structures for the job. It is trivial to use hash tables, trees, and all that in Python. Not only are such data structures easy to use (a = {} is all it takes to create a hash table), but crucially, they are easy to print, and easy to input on the command line, making debugging a breeze. Yes, C++ has STL, but you cannot match the easyness of creating and printing data structures on the fly in Python (I assume Ruby, etc, are similar).
Thus, in Python I tend to think carefully which is the best data structure and algorithm for the job. In C, I tend instead to be lazy, and use the data structures that are easy to use (what's that, arrays?). As a result, on small data sets, my C code is typically 4-5 times faster than my Python code, but on large datasets, I often get O(n log n) algorithms in Python where my lazyness in C yields O(n^2), and this shows.
As a result, I am now a convert to Python (and I want to try Ruby). The programs I write are faster when it matters, easier to write, no memory leaks, no segmentation faults, no memory management, no worries... there is NO way back.
1990 actually. vs 1987 for PERL, 1990 for Python, 1995 for PHP, and 1995 for Ruby.
You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
The only downside is that a great number of slashdotters would suddenly have an unmanageable amount of free time.
Java was supposed to be "write once, run anywhere," but wound up being "write once, debug anywhere." It never lived up to its multiplatform reputation.
Even if it had delivered in this respect, I don't really think it would have mattered. (And I know that this is going to earn me some enmity from some of you, but I don't really care.) The fact is that nobody really cares that much about cross-platform compatibility. It's the sort of thing that geeks get excited about, but most people in the real world could care less about. Most people choose their computer to be task-specific. Whatever kind of software you make, chances are that most of your customers will use a single platform, and the rest are just not numerous enough to spend a lot of time worrying about.
I think the parent has this almost completely backwards.
As the complexity of enviornments increases (many cores, multi-chip packages etc) it's going to be harder to compile a program to binary that can take advantage of the resources on all the systems it will run upon. It may work really well on one configuration, and may run on many, but it won't make the most of the resources in many cases.
VMs have access to information about the runtime environment and can dynamically compile byte codes to binary to take the best advantage of the available resources - some can even re-compile on the fly to tighten up performance based on feedback from the environment. From a developers POV a program can run on many platforms, and can run as well on all of them.
I have implemented GUI apps in C++, C#, Java, Matlab, and VB. I am seriously looking at Java/Swing
/Swing. The close similarity allover makes the differences in developer convenience positively glaring. Yes, a lot of it is just syntactic sugar to you language people, but boy do you get tired of writing it the long way when you know how much easier it could have been. The GUI APIs show a similar trend, Swing making you do all sorts of unneccesary stuff before you can get to the point.
I'f you've wokred wit GUIs in C#, I can tell you right now that you will be very frustrated with Java
sudo ergo sum
There, fixed some typos for ya.
"An average apple tree nowadays holds enough fruit to fill several baskets, weaved in your local apple-centric basket-weavery, which are carried by human power, or simply loaded onto a truck. Particular to Golden Delicious afficionados, the announcement of new apple tree fertilizer means that future apple trees will laugh at the nominal apple load requirements of current baskets (e.g. hearth baskets, berry baskets, ribbed baskets, and gourds). Regardless of the negligible vitamin C per pound hit compared to oranges, major fruit farms, as well as a lot of freelance fruitpickers, prefer oranges for major baking projects even though apples are easier to bake a pie with, often have a shorter development time, and are just as powerful as citrus. What does the Slashdot community think of the current state of apples versus oranges? Is it time to jump in the boat of apples? Do pastry chefs feel that they are losing - an arguably needed - dose of vitamin C when they eat apples? What would we be losing besides lemon merengue?"
Ai feer it wud saund mö laik ei mix bitwiin e swiidis ef and ekoslovääkiun...
America should have been called "Columbia" afterall. :-P
Seriously, for me, a spanish guy, "America" may mean "North America" + "South America" or USA depending on the context. This sometimes may lead to confusion...
And of course Slashdot just HAD to not support Unicode...
Yes, a lot of it is just syntactic sugar to you language people,
Syntactic sugar is a phrase devised by programming language types to justify incompetent HCI design in their pet language. E.g. programmer: "but your choice of using ancient hungarian for keywords makes the language difficult to use in practice". PL-type response: "ah that is just syntactic sugar".
Syntactic sugar is like syrup for pancakes: judicious amounts make them infinetely more palatable, but it does not mean that the more syrup the better.
I'm not sure that we've moved that much. I think Gosling and the other originators of Java are still pushing in the wrong direction with GUI; see his remarks on Eclipse / SWT.
It is not a Java problem per se, but goes right back to the issue of creating cross-platform client apps in the first place. Many of us like to think of the OS as something that provides services - disk access, windowing, etc - that look like they can easily be abstracted - and they can. However, as well as being OS, Windows, OS X, KDE and GNOME are platforms - a set of programming APIs and a philosophy.
Rather than transcending these differences, Swing is yet another variation. Potentially you could make a Swing app that did look and behave identical to a Windows app - but it would feel plain wrong on OS X. The reverse is equally true (well, just about - I don't think you can use the top-of-screen menu bar in Swing apps).
I think SWT may be the better approach - it's not write-once run-anywhere, but you are reducing the amount you need to port. And as said above, you need to consider the philosophical differences between platform HCI anyway.
Ironically one of the few really successful Java GUI apps I know is a data visualisation tool - it mostly consists of OpenGL calls so it's a bit of a misnomer to say it's Java, but it's back to the point that it's the APIs that count. OpenGL is a nice x-platform API.
'Capitalists of the world, unite! Oh
That's
Java and C# are garbage, collected;
There are many dialects and accents of english spoken in britain and
in just england itself so you can't say there is such a thing as
"british english". However , given the language is called "english" I think
its fair to say that whatever dialects and accents are spoken in england
can safely be called "english" and any spoken in other countries called
english.
After all, you don't say "french french" when you speak about the french
spoken in france , though you will say "canadian french".
My point: use the right tool for the right job. C++/Native is good for large-scale computations involving floating-point calculations over large arrays of data. C#/Java are faster on data structures manipulation programs like formula translation algorithms, etc.
Here are my two challenges for everyone.
1) The challenge for those who claim C#/J#/Java is faster than C++
Rewrite my Win32 Tetris with software background animation in a JIT language and make it faster than the C++ implementation. (BTW, the initial version was written in Java/SWT, then Java/AWT till it finally got ported to C++/Win32).
2) The challenge for those who claim C++ is faster than C#/J#/Java
Rewrite my SQEMA (a modal logic algorithm) implementation in C++ and make it faster than the Java implementation.
Here are the sources of the above-mentioned applications:
http://myjavaserver.com/~dimitertg
Side note: Don't mind the intimidating license of SQEMA. I will change it to something nice when I get to 1.0 (that should be next week since it must be completed by then).
I have tried both challenges and failed miserably.
As for the prize for those who complete the challenge - well, nothing, except the pride you may take in what you have achieved.
I think there'll always be a need for native code, as there are some things you simply cannot do with interpreted/JIT languages. For instance, I'm working on a WIN32 application in C++ which performs a low level analysis of a hard disk drive and displays the results in a dialog box. Whatever about Swing, the low-level stuff is nigh on impossible in most interpeted languages. You also have to remember that most of these languages provide a high level of abstraction over the actually hardware your programming, so it's impossible to gain an understanding of what your program is doing in memory and in CPU registers when EVERYTHING is shrouded in namespaces and classes provided by the language vendor. One option is to use a native interface like the JNI, but I used that when developing my disk application for Unix and it was fairly horrible.
Please allow me to jump into all this Java discussion. In my opinion Java is becomming more and more cluthered and obese. Every new version they put in a lot of new functions but also want complete backwards compatibility. Another major problem is those JVM's that are drifting away from eachother, some applications need their own special JVM.
In the +/- 16 years of development you can't just keep adding stuff, it just becomes to big/large. The concept is (imho) very good, and they are moving in the right direction. The thing we need is a major company (like Sun) that takes the risk of dropping all backwards compatibility and make a whole new version with good straight forward rules and syntax.
When that happens, with a good VM and JIT, people will start using it..
My blog: http://www.redcode.nl
why do i force users to download 30MB .net framework to run 300KB IE toolbar?
thats NOT written in native code.
.net are certainly taking vbs share of the desktop market (primerally internal apps that users are forced to use) as well as a large chunk of the server side but they don't seem to be touching the major commerctial apps!
java and
note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
The line between interpreted and compiled, however, is blurring. Languages that are traditionally compiled can sometimes now be interpreted, and vice versa. There exists both a C interpreter and a Lisp compiler, for example. One could write a performance-hungry program in, say, Perl, run it normally (using a Perl interpreter) for testing, and compile it when it's ready for use.
Also, interpreted and compiled languages can play nicely together if you let them. Guile Scheme, for example, can be embedded in a C program. There also exists a feature of Perl that allows the use of C libraries from Perl code. There is nothing stopping one from writing the core of a program in C and allowing extensions/plugins to be written in Scheme; in fact, several programs (i'm looking at you, GIMP) take this approach.
Many excellent points by many posters about the "life" left in native code. Let me add my $0.02. We have a system that has a fundamentally non-parallel* execution profile where it is hard to determine the "full" scope of the objects that will be touched by a given transaction. We keep all our data in memory and so we are starting to care about the organisation of a data structures so that we can keep more and more of them on the L1/L2 cache to avoid having to go to memory to get records that we just looked at (its just too slow). From a singe processor (obviously a multi processor machine but one of them used to 100% by the system) we seem to be seing around 40K transactions per second.
With that as background, native code to us means that we are able to control, influence and ensure the code path that each transaction is executing and thus squeeze as much as possible out of the single transaction path that we are constrained to use. It also means that we can truly _find_ the sluggish parts of the most commonly executed code and make them X% faster thus making the system almost X% faster itself.
*Whether our problem is parallelisable or not is an interesting question but since it is like that the most popular objects will be involved in the vast majority of transactions then it is very hard to think of a way that paralleising the process will give us any real benefit since we woul have to handle the locking/deadlocking and race conditions for a fractional increase in performance, all of which is probably going to cost more than that fraction for all the other transactions as well.
"The first thing to do when you find yourself in a hole is stop digging."
An average PC nowadays holds enough power to run complex software programmed in an interpreted language (...)
2 15
Apparently, Intel does not agree with you:
http://www.behardware.com/news/lire/10-06-2006/#8
If even a relatively simple GUI of driver control panel is considered unsuitable for "non-native" technology, then it is understandable why more complex desktop applications are still far away from being routinely developed in such languages.
In my personal experience, I'm yet to see "non-native" application that does not feel sluggish compared to a similar native application.
It takes a couple of seconds for medium-complicated stuff to fire up on my P3-800 at work, but nowhere near as bad as Windows. Linux treats it the same as perl or python - just uses the java runtime to execute it.
My recent experiences with some rather well-coded Java stuff has even made me give up my native prejudice against it (formed in 1998-99, when it truly did suck). The GUIs went from hideous to okay...
Why can't I mod "-1 Idiot"?
The key here is the application you're writing - The vast majority of enterprise apps do more or less the same thing -
1) They put a form onto the screen
2) They wait for some user input
3) They perform a database search on the basis of that input
4) They perform some basic math (multiplying the unit price by 1.05 to add sales tax for example)
5) They put some data back into the database.
When you look at the app's behaviour, it's actually waiting for something most of the time - Waiting for the user to press a key, or for the database to return some result.
It doesn't matter how fast your code is - All apps "wait" at the same speed.
The scenario I've shown above may be generic - but it's what the majority of enterprise applications do. In this scenario it's very hard to justify writing the app in a 3GL or Assembler.
There are plenty of other scenarios, though, where no matter how fast processors are, or how cheap memory is, there is going to be an advantage in writing native code. Any very complex math, massively parallel task management, device drivers etc will, in general, be more suited to a lower level language. But even here, I think that exceptions can and will emerge - Domain specific higher-level languages will increasingly do a "better job" of creating fast code than we can.
In practice higher-level languages, scripting languages, 3gls and Assembler have co-existed for decades and will continue to do so. Better approaches to interfacing and re-use should actually make this even easier to do - So we'll use higher level tools and scripts to tie things together, paint UI's and do lots of groovy IO and presentation layer stuff, while invoking services that have been implemented using all sorts of lower-level techniques.
There's a cultural factor too... I've seen evidence of "language machismo" in my time... developers insisting that their hand crafted code will "always be better than that nasty generated stuff" - In my experience, while this is sometimes true, it isn't always the case. So perhaps we need to exercise a little more circumspection when we sit down to make our choices?
Being half Dutch half Belgian, I am surprised at this claim that the Kingdom of the Netherlands is younger than that of Belgium. (Not that anyone over here would care), in fact Belgium got its independence from the first king of the Netherlands. As far as I know there has not been any constitutional change in the Netherlands after that? Where did you get the 52 years?
As to that claim that some languages are older (welsh), well, that only meens they have been spoken in the same place longer. How that makes them have any priority over languages which have moved within or between continents i fail to see. All natural languages have gradually evolved, and could not point to a particular date and say "this is the birthdate of a new language"
End of native code? Maybe for people that aren't working in an environment that requires them to write performance-crtitical code or real-time applications, but as a computer science PhD student in the field of computer graphics / visualization, non-native code is out of the question as far as I'm concerned (and "no", Java is *STILL* not up to these tasks, no matter what some of its fanboys have you believe).
I agree with Animats that C++ si full of security holes - the lack of checks is what gives C++ the 'native speed'.
But after some years of dealing with C++ memory leaks, buffer overflows, smart pointers going dumb, incomprehensible templates,
code which compiles but does nothing (see below), you want change. More C++ rants here and here.
And now Bjarne Stroustrup wants to create another version C++09? That's just wrong.
My suggestion: Think about moving.
Move to Java via http://jazillian.com/trial.html,
or translate your code to C# on code2code.net.
Disclaimer: code2code is my web site.
PS. Example of code that compiles with GCC and microsoft's CL.EXE but never does what it seems to do -
It never calls fct2():
Ai feer it wud saund...exactly the same, just be spelt differently.
The Kingdom of the Netherlands, comprising Netherlands, Netherlands Antilles, and Aruba is a federation established 1953.
OK, perhaps that is a *bit* pedantic. Even so, the Netherlands has been a parliamentary democracy since 1848. The US is still older.
-- *~()____) This message will self-destruct in 5 seconds...
Isn't the virtual machine patented by Kodak?
Is there any truth to the rumor that Windows Vista had big chunks of managed code ripped out because of performance issues? If that's what happened, they certainly couldn't admit it...
Last week in my local newspaper, an article about budget cuts for the city schools began with a sentence using "loose" when the writer meant "lose". And yes, the ironing was delicious.
From the original and widely debate between Linus and the guy who wrote Minix Linus wrote 'loose' where he intended 'lose'. In his honor, Linux users always spell it that way. (I'll leave it for someone else to provide the link or quote if they want some quick karma)
- start here: Assembly eplaces many tasks formerly accomplished in hand-written machine code. But I can write much smaller programs by manually plugging/unplugging these-here vacuum tubes
- "macro-assembly" allows programmers to code for different cpu instruction-sets simultaneously. But, but... the hc11 has an extra 16-bit register than the 6809, I can shave 2 bytes off your macro-code, you lazy bastard!
- C replaces assembly in the majority of roles traditionally set aside for assembly. Your sacrificing all that speed to save time. (snickers at your times-two multiplication expressions)
- c++ blah blah c. blah blah syntax sugar blah blah
...
....
Wash rinse repeat. In 10 years the Java camp will mock the young 3DUML-on-rails punks that use tactile feedback gloves.The JIT compilers and virtual machines don't make it easier to port between platforms. .NET is difficult and time consuming.
Java code only runs on the java virtual machine, porting that to the python interpreter or
If you are refering to being able to run the code on different hardware platforms then software virtual machines make different hardware platforms pointless in creating because to the software they are all the same.
Portability is silly if it makes you unable to take advantage of any of the features of the platform you're developing for.
- Jesse McNelis
...and that is all I have to say about that.
http://jessta.id.au
Regardless of the negligible performance hit compared to native code,
spoken by someone who does not know what they are talking about.
Compare a Java app speed compared to an Assembly app compiled. the assembly app will kick the java app's arse so hard it will have ran about 90 times before the java app even started the interpeter.
In a nutshell, programmers and computer scientists are uncomfortable with the fact that there's actual HARDWARE in the system, and this somehow taints their pure, beautiful software designs. That is to say, they unconsciously can't stand that software has to run on hardware. So, they've invented "virtual machines" to abstract away the icky hardware with all of its yucky "engineering hacks". Of course this is justified with the old, battered strawman of "portability". But really it's all about not having to worry about registers, MMUs, memory addresses (physical and virtual), I/O ports, etc.
But if you forget that ultimately, software is nothing more than machine code being interpreted by a CPU, then you've lost a huge part of what computers are all about.
Joel Spolsky says it best (OK, it's dated, but substitute Java for Pascal, and it still applies):
The conspiracy is that the software industry has moved in a direction to accommodate people who don't understand pointers. To acknowledge pointers would be to admit that there's machine-addressable memory in the system, which would be to admit that there's hardware in the system.
And we can't have that, can we?
In the course of every project, it will become necessary to shoot the scientists and begin production.
Java apps are written by developers who only care about themselves, not their customers.
No sig today...
The European Commission has just announced an agreement
whereby English will be the official language of the EU rather than
German which was the other possibility. As part of the negotiations,
Her Majesty's Government conceded that English spelling had some
room for improvement and has accepted a 5 year phase-in plan that
would be known as "Euro-English".
In the first year, "s" will replace the soft "c". Sertainly, this will make the
sivil servants jump with joy. The hard "c" will be dropped in favour of
the"k". This should klear up konfusion and keyboards kan have 1 less
letter.
There will be growing publik enthusiasm in the sekond year, when the
troublesome "ph" will be replaced with "f". This will make words like
"fotograf" 20% shorter.
In the 3rd year, publik akseptanse of the new spelling kan be
ekspekted to reach the stage where more komplikated changes are
possible. Governments will enkorage the removal of double letters,
which have always ben a deterent to akurate speling. Also, al wil agre
that the horible mes of the silent "e"s in the language is disgraseful,
and they should go away.
By the fourth year, peopl wil be reseptiv to steps such as replasing "th"
with "z" and "w" with "v". During ze fifz year, ze unesesary "o" kan be
dropd from vords kontaining "ou" and similar changes vud of kors be
aplid to ozer kombinations of leters.
After zis fifz yer, ve vil hav a reli sensibl riten styl. Zer vil be no mor
trubl or difikultis and evrivun vil find it ezi to understand ech ozer. Ze
drem vil finali kum tru!
617B3B7F7E7C7D7F00EOF
I personally think that the cost in watts to execute an interpreted program is greater than a native binary. Shouldn't we be thinking about the electrical cost? Surely we should be burning coal/gas for more useful things rather than some glitzy program.
Why UNIX?
I have yet to be impressed by a Java application on the desktop. Everyone cites IntelliJ as a great example of Java on the desktop. It makes me cringe when it has to garbage collect occasionally, pausing for a couple of seconds. (GC may be faster than manual memory usage over the long term, but if it stops the user from getting anything done, it is slower in their eyes.) It consumes, on average, two hundred megabytes of RAM. The interface mimics a native application, getting it wrong in several places. Several common keyboard accelerators just do not work.
We need better native languages, thats all. D looks like it could step up here and fill that gap.
To merely ask this question shows that you've never done serious amount of real work programming.
First of all every problem has a tool that's going to solve the problem best. Sometimes it'll be java, sometimes C, C++, python, ruby, php, etc, etc.
And second of all JIT compiled or virtualized languages often offer little benefits (in terms of what you've prescribed -- which is very little) over natively compiled languages. What I mean is... there's nothing inherently "better" about virtualized code. It's great in certain cases but that's it!
Did you even think about the question before asking it? Would you write a top-tier 3d game in java? How about an office suite in python?
The answer is no, and no. Not because java and python are bad (in fact they're great!), but rather because there's another tool that's better suited to the job.
Think before asking. It's a sad day when this makes it to the front page.
This is a fake dilemma.
6 151.aspx
Languages compiled into bytecode can be JIT-compiled into native code, or they can be pre-compiled into native code using a utility like Microsoft's NGEN. And when you are pre-compiling you have all the time in the world to optimize.
In a small but non-trivial program you can usually get C++ to beat Java and C# by throwing away all the high-level features and programming in what can be called "C with templates". But as soon as you start relying on, say, std::basic_string you may get surprised to see that C# and Java are winning. Java and C#'s GC-heap allocated strings are faster than C++'s basic_string if you use them in data structures because in Java and C# you only allocate the string once and pass it around by reference, where in C++ the each copy of basic_string is either going to allocate separate copies of its contents or do thread-safe reference counting which is unfriendly to the processor's cache.
I can also provide examples where real-world C++ will provide significantly better performance than Java or C#.
On a real-world program the performance of C# or Managed C++ is going to be roughly the same as the performance of C++, while depending on the problem Java may trail a little bit because it lacks structures so some data cannot be packed as tightly thus leading to more cache misses.
To see an example of C++ and C# being pitted against each other on a real-world problem take a look at the follow thread:
http://blogs.msdn.com/ricom/archive/2005/05/10/41
As I said, this is a fake dilemma. A more interesting question is how does the performance of mostly dynamically typed languages (Python, Ruby, Lisp) compare to the performance of statically typed languages (ML, Java, C#, C++)?
Peter Norvig has some numbers from four years ago:
http://www.norvig.com/Lisp-retro.html
On a real-world problem without external bottlenecks (database, network) dynamically typed languages can expect to be between two and five times slower than statically typed languages, though the trend is expected to worsen somewhat due to the expanding gap between the speed of the processor and main memory.
Also note that Lisp has by far the best performance among the dynamically typed languages. Companies that write Lisp compilers have been working on the problem far longer than the authors of Python and Ruby, and have significantly better type inference engines and compiler back-ends.
Dejan
The end is coming. If we complete our project - http://gotdotnet.com/Workspaces/Workspace.aspx?id= cc3191af-1b3c-425c-a21d-4729196ec37e
The idea is to produce mutable OS core with MSIL to x86 compiler build in it.
Join.
C++ likes to hide things from the programmer... There are so many cases of this, I won't even list them to prove my point. If you're a C++ programmer, you'll know what I mean.
If you're not a C++ programmer, then the best way to describe it is like this:
There was a Tom and Jerry cartoon where Tom finally catches Jerry in his hands. As he peeks into a hole made by his fists, he sees Jerry peeking into his own tiny hands. Tom is curious what is in Jerry's hands and tries to look, too. Jerry pulls his hand away and hides it out of Tom's view. Now Tom is really curious and has to kindly ask Jerry to show him what he's hiding in his hands. Jerry then gets his fist near Tom's eye and then gives him a big sucker punch in the eye and runs away.
Tom is the programmer (you) and Jerry is C++. You *think* you have control. But when you want to look very closely at things, then Jerry won't let you. You have to do a few things "against the spirit of the language" in order to get your work done (or else have a very costly rewrite for very marginal additional features.) After you have done this dirty deed, Jerry will sock you in the eye some time later. You don't know when, and you think you got away with it, but it'll happen... usually before a critical deadline because that's when the highest volume of code changes occurs. Of course, you feel kind of dumb that Jerry did this to you. But there are so many countless ways, you can always get caught by a new one, and then eventually he tries an old trick on you that you forgot about. An experienced programmer will sort of just accept that this abuse is part of why he gets paid so much.
C++ is like this Tom and Jerry cartoon where Jerry sucker punches Tom in the eye. Until we invent a language that doesn't do that, we will be stuck in this prehistoric age where future generations will look at our existing programming languages in puzzlement in the same way as we now look at doing math in Roman numerals as peculiar and unintuitive.
Whether the code itself is interpreted or native compiled is irrelevant to our progress in software development.
You would think that by now someone would have invented a better language to replace all of our existing ones. But then again, you would have thought that the Romans would have invented a numeral system that allowed them to progress in mathematics to a point where they could understand how their multiplication tricks worked:
http://www.phy6.org/outreach/edu/roman.htm
But that never happened, and similarly, Western civilization may expire before we have a competent programming language.
I think Eve Online (in its current state) goes to show that interpreted languages can be a favorable choice to develop in. From what I have read, it uses Stackless Python extensively, which is what they are claiming makes the online game as fast as it is (c/c++).
To be fair, delegates (which is most likely what is being discussed) are not syntactic sugar. They're a feature of the CLR allowing one to treat functions as objects. Although Java and C# are not very different languages (to say the least), delegates are a language feature of C# that Java could really use (many people use anonymous classes or lots of seperate classes with single methods to achieve what can be done with simple methods in C#), particularly for GUI functions.
I agree though; "syntactic sugar" is a term that is bandied around altogether too often. Syntactic sugar is accused of reducing a languages base simplicity to gain the advantage of making a specific use-case simpler, but it's not as simple as that in practice. Some "syntactic sugar" extends well universally and acts to enhance the language — it's a question of good design.
For numeric intensive code it's more like a 3x hit for .NET. And yes, I have test cases that measure that.
Ian Ameline
I'm sick of cliched sensationalist articles with the sensationalist titles, how about you?
.NET this is pretty easy: "unsafe" sections and "managed" sections can originate in the same project and even the same source code, so you can optimize those critical 10% of your code where 90% of the time is spent (you prolly know the cliche), and use managed to take benefits of the advancements in the platform.
As always this is a non-existant problem hyped up by people that don't have a clue.
First, the performance hit of managed code is not "negligible". For tasks that rely on raw math power it can be significant, like 3D engines, data processing and so on.
But if you're doing, say, a rich client, your code will most likely just call existing multimedia, communication and input API-s. Then managed code's performance hit is next to nothing since most of the time is spent processing the commands from the API-s, not your own code anyway.
Thing is: can we drop the raw power of native code and go all managed: hell no. And we never will. While plenty of consumer applications have good performance on managed code, there will always be a class of professional software where 20% better performance means potentially tens of hundred of dollars saved for a middle-sized company.
But the big miss in the article is that managed and non-managed code can coexist. In
So wait, we were talking about end of what again?
Try 2x or more speedup. See the Programming Language Shootout.
While a good question is posed, I the answer it easy to see. Just think back a few years, when the current thinking said "If you want it coded right, use assembler". Soon C came into fashion, and then a host of "higher level" languages. If an interpreter fits the bill, they'll go there, albeit a bit cautiously. When programmers are forced to do more and more, in each piece of code, they'll seek the clearest path to that goal.
Male ponytails do not ever look cool.
I work in one of the major weather modeling centers in the United States.
.. But, they were translated for the sake of translating them, not for any specific gain (after all, the models are mainly ForTran), so what did anyone expect?
A lot of stuff can be done in slower languages, because we CAN do it in parallel in order to maintain speed, such as the evaluation, translation, and storage of weather observations from around the world.
But, when it comes time to do the serious math-intensive number-crunching that we call running our weather models, speed is the need (second only to accuracy, of course).
If we could get the models clean enough and fast enough that we could model the weather across the entire globe in less than an hour, our customers would want the models run every hour. As it is, some of the models run on a 3 hour schedule, and a couple run on a 6 hour schedule.
Yes, most of the models originate in academia. The vast majority end up being tweaked by our own resident weather mathematicians (and their pet programmers) within a matter of weeks of becoming part of our production system, or even while the resident weather math geeks are still evaluating them!
The majority of users only care if the system is fast enough that they don't have to wait for results. We've reached the point where the majority of the time, the language chosen for an implementation has a trivial impact in that evaluation. Weather modeling is one of those seriously slow processes where native code versus interpreted code can still have an impact significant enough to be obvious to the end user.
Frankly, some of our pre-processing and report generation tools that have been translated into JAVA were done poorly enough that those tools are notably slower than the old ForTran code they replaced . .
Wow what a surprise - more posts about grammer and other attempts to be funny rather than acutal answers. One wonders why anyone takes the time to send a question with all you commedian wannabes out there filling up the thread with crap. Too much free time on your hands I guess.
Are you going to compile new binaries for every architecture and combination of cores?
As a Gentoo user that is an emphatic yes!
an ill wind that blows no good
In my college years I would have been seriously against the idea of not programming Native. I was a huge C/C++ fan and thought that programming languages such as java were evil. But in all honesty... These days... Programming in C/C++ is more of a pain than it is worth. They (and most nativly compiled languages that I know of) fall (far) behind languages such as C# and Java when it comes to ease of maintenance and OO prettyness (yeah C++ supports OO but ANSI C++ OO is fugly). I'd hate to say it but the only people who should be working with native are the folks and Microsoft, Apple and the OOS community. Developing operating systems and programming tools to allow the rest of the world to not deal with the uglyness of native code.
I personally find it sad that certan people are blaming the native languages for the rise if JIT programming languages. Programming languages are tools, nothing else. How well that tool is used is entirely dependant on who is using it. The TRUE reason for the rise in JIT compiling and interpreted languages is simple: People are lazy. Lazy people means lazy code. So while the actual runtime speed between 2 programs made by experts may be similar, since lazy programmers write lazy code interpreted programs will be lower and less efficient.
In reflection, a language like c++ makes lazy programming nearly impossible.
What is this? Now we want to dumb down our future? No matter how fast processors evolve it's always better to porgram them natively! My Dual Core G5 screams, especially when you take advantage of the altivec core.
I guess some people are worried about what happens when more people can harness the pwer of the microprocessors comming up.
Jack the ripper screams on my dual core G5. Yes I run Linux on my g5 as well as OS/X. Dsniff works great as well.
remeber, when it comes to code, GO NATIVE!
Sticking feathers up your butt does not make you a chicken - Tyler Durden
That's why optimizers use heuristics.
Patrick Doyle
I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
If your native code is running as slow as interpreted, I would really recommend getting that looked at. It would seem that people are losing the ability to write clean code since the crutch of interpreted languages is hiding so much of the finer grains of computer science.
First of all, when experienced programmers write big systems in interpreted languages, you can rest assured that they know what they are doing and are doing the benchmarks to make sure they aren't losing performance where they need it. If they need special, high-performance algorithms or libraries, they will figure out the minimal set of C/C++ primitives they need and make them a native code library inside the scripting language.
And whether code is "clean" really has nothing to do with the language. People can write clean Perl code and unclean C code.
Finally, "the finer grains of computer science" are absolutely and positively not concerned with the kind of low-level mess that C exposes.
I'm currently working on learning SDL in C/C++ for exactly that reason.
Good, so you are in a very early stage of your development as a programmer. As you mature, you'll figure out how to get the job done without wasting all your time on C/C++ programming.
In general, when experienced programmers use languages like Python or Ruby with native code plug-ins, or when they use languages like Java or C#, they produce code with better performance and fewer bugs than straight C/C++, simply because they end up having more time implementing good data structures and focussing their efforts where it counts.
If Java is any indication of how interpreted languages will work...then they can all go screw themselves. There are times when just the Java VM takes more memory and CPU power than freakin' Command and Conquer: Generals! It's currently using 370,000K of memory and about 30% CPU usage...and my CPU's bad but it's not THAT bad...AMD Athlon XP 2200 running at 2 GHz. And keep in mind, that's just Java. The programs you run under it suck up even more!
If the trend is towards virtual machines, why are we using emulated virtual machines? Things like VMware are taking off, and Intel has Virtualization Technology (TM) that essentially allows a program to run another protected mode task, with any privilege level, and simply trap any privileged IO operations. If any mainstream OS implemented it right, they could basically do what "386 Enhanced" mode did for older programs, and sandbox them while running at full speed for the rest of the code (that doesn't require interaction with the sandbox to decide whether it's okay, or redirect it to host resources).
ttuttle is a rankmaniac
I'm an engineer and I regularly write programs that my PC fails to "laugh off". End of native code, my butt.
I guess i'm surprised to see as much chatter about comparing compiled languages, when really he's questing compiled vs interpretted... regarding THAT, I'll stick with C/VB6/pascal as "compile" languages and Java/.NET as interpretted...
.NET, which has been ported to *nix (mono, granted a work in progress)... I can take the code from VS/Grasshopper/notepad, and run it in ASP.NET or apache (i'd say more but i don't know their progress on porting winforms to X)
.NET frameworks for RH or mac... instead they leave it up to the rest of the world to copy their framework and perform our own implimentations... granted either side could "dream up" a better optimized solution, they have a paid workforce they could choose to attack such a problem...
That said... I agree with a lot of people that compiled can (will?) always produce slightly faster results (~5%) than interpretted... there is a cost of overhead (mitigated by advanced optimizations and techniques of course) that simply cannot be entirely ignored... even if it's a single CPU cycle used to switch contexts...
But that is not what the original post was asking either. The post asked whether it's worth sticking to compiled languages vs interpretted... so what BENEFITS do you get from either...
Sure interpretted languages are limited by overhead... but that said, can you "do more" using the interpretted languages than in compiled. Similar to Intel's current per-wattage computing... how much can you do with the given resources (computing power and time)... I tend to believe that interpretted languages are worth the investment... Similar to seperation of logic, interpretation is the seperation of architecture... in line with that, any overhead associated with interpretted languages are in the interpretter... if the interpretter can be optimized (just as any other technology improves as new techniques are discovered and implemented), then that cost of overhead can be reduced to a minimum, per architecture. That done, as a developer (choosing to use an interpretted language), I now have gained the benefits of a minimal overhead (compared to compiled per-arch versions) with no effort on my part... and as I use the given libraries (again, optimized by their maintainers/blah) I can make use of these optimizations without having to know much about them myself.
This lends a lot of power to the developer, being given tools (interpretted languages) that are cross platform, and are optimized
"now", but more importantly can be further optimized down the line to improve even existing interpretted languages.
It's the same as seperation of GUI/logic/data... it removes some of the details, abstracts them into the interpretted language, and more than any of that, it means that optimizations can be made per section of code (module/function/etc), without affecting other code, which can benefit ALL code (using the interpretted language).
To be practical, sure you see Java everywhere... unfortunately java is also open to implementation (gotta trust the interpretter), so you get compatibility problems and such... but take
Lastly, I think that it'd be nice to see the framework creator (MS for dotnet, etc) take responsibility in porting it to diff architectures... I'd like to see MS create
my $0.02
There are several reasons.
.NET have already far surpassed Java desktop usage on their respective platforms (and Mono makes both sets of APIs cross-platform if you want).
.NET is a better platform for developing Windows apps anyway.
(1) Java's market presence for UI applications has been decreasing: applets have largely disappeared, and the JRE is preinstalled on fewer and fewer desktops.
(2) Even on OS X, where Java is pre-installed and exceptionally well supported and integrated, there are few applications written in Java, and even fewer written in Java using Swing.
(3) Java's UI classes don't integrate well with native desktops, and it is impossible with them to write a cross-platform UI that conforms to every target platform's conventions.
(4) Within the span of just a couple of years, Mono and
(5) Sun's licensing and compatibility requirements have made Java unattractive for Linux desktop distributions, and it seems doubtful that that will change (it looks like Sun may open source their implementation, but the specs will probably remain restrictive).
(6) As far as cross-platform GUIs go, the most widely used tools are wxWidgets, Qt, Tcl/Tk, and Gtk, plus their various language bindings (even Eclipse uses its own toolkit, not Swing).
But at some point Java/Swing programs will have accumulated enough performance and features that they are good enough for what people want to do, and they have the added advantage of not being tied to Windows.
And that attitude is why Java/Swing isn't succeeding. As a Linux and Mac user, I don't want cross-platform scraps thrown to me, I want high-quality applications that integrate well with my desktop. And given that people are creating those based on Gnome, KDE, ObjC-Cocoa, and Mono, I have no incentive for using Java applications. Of course, Windows users don't have any interest in third-rate Java replacements for their native apps either, and
Even better, the Gnome, KDE, and Mono apps even run on Windows, so that even Java's cross-platform aspects are uninteresting.
SUN seems to be in this Java business for the long haul,
Well, that's another problem: I think many people are unconvinced that Sun is in anything for the long haul; the company has serious problems.
Like the parent says - It Depends.
(1) What is the target application, does it have latency requirements? You may not want to use Java if it does - or program like your writing code for Javacard or J2ME (Create your objects at startup and don't just new yourself into GC hell).
(2) You probably want to think about the algorithm first. A 100x faster native CPU won't do much good if your algorithm is coded O(n!) vs O(n^2) on the interpreted platform.
(3) Bandwidth is money, latency is forever.
(4) It was once said that LISP / PROLOG were too memory hungry. Big Institutions could afford memories of say 4 MB and fast CPU's. Now you quite possibly have more than 5 VAX MIPS in your cellphone and more memory than that late 70's / early 80's VAX too.
Here's a final question. Suppose your requirement was to write the embedded code for a medical radiation therapy machine. The machine has to: 1) Turn on and off the beam. 2) Rotate the beam around some axis.
Screwing up could mean fatality. What language / environment would you use then? Imagine your loved one has to lie on this thing.
Java with the GC possibly getting in the way?
C? -- Pointer smashing?
C++ -- Ditto...
Lisp, Mercury, Erlang, Ada, Modula 2, Eiffel, Assembler? No software?, hardware? / a finite state machine?
Hint for googling: Therac-235.
ScottGu's Blog: Handling 1.5 Billion Page views per day using ASP.NET-2.0
Rather then writing efficient and powerful native software, write system crippling interpreted applications so that you never realize the fullest potential of your brand new hardware? For what purpose, so that you can write an application that targets both 90% of the worlds Windows users on PCs AND the other 10% of mismatched users using alternative *nix based OS'es on a variety of hardware?
Sorry, as a Windows programmer, I will target the 90% and forget about the rest. I will earn a good living making native Windows software without worrying about crippling my software so that it can run poorly on the other 10%. If Open Source advocates create a Wine or other Windows emulator that can run my software, good for them, I will even optimize my code so that it runs more efficiently under Wine, but I will not abandon my largest marketshare by crippling my software in order to cater to the other 10% who don't believe in paying for software.
Vista will offer me a whole new level of expression and creativity, using their native API's. I am no longer constrained to creating apps with static grey boxes. Making a cross platform application, most UI is terribly utilitarian and uninspired. While there ARE exampled of decent cross platform applications (FireFox) for instance, most shareware open source software is crap and pure examples of why you need to define a target market rather then trying to appeal and cater to everyone.
Java still isn't improving. The few Java based desktop applications I have tried still cripple a reasonably powerful Dual Core AMD system. I mean, the system becomes sluggish and almost unusable if I have th Java applications UI visible. As soon as I minimize the Java application, the system snaps back to full speed. When Sun can make Java run as fast as native code (or even come withint 90%) without crippling the OS then I would consider using cross platform interpreted code, but not until then.
I have only ever found python to be effective for writing quick system scripts to perform repetitive tasks. I would shudder to have to write a actual application using the script language.
I don't see the end of native code any time soon. The argument that just because you have a beefy system that can run interpreted languages quickly isn't sound. I bought that beefy system so that I can maximize its effectiveness, not just make do with software that runs at 50% capacity, even at optimal conditions.
Why hasn't someone created a Java co-processor? I mean, create a hardware bit that can be slapped in as an add-on card, or embedded on the motherboard to run Java as fast as running native code on general CPUs? I mean, if Sun was serious about Java as a universal cross-platform language, then why not put some of their hardware development skills into making a Java co-processor. In the worst case, you have to run Java as a software virtual machine, but if you believe in Java and want it to succeed, then you will buy the co-processor and run Java in an optimize hardware machine.
I haven't thought of anything clever to put here, but then again most of you haven't either.
Who cares that it never does what it seems to do -- that's not a useful piece of code. Why would you write something like that?
I am in Ohio. Not exactly the booming IT state. I went to the university several years ago as a Computer Science major where I was taught C and C++ . I had a friend who was a few years ahead of me. He loved Linux, hated windows and thought everything should be written in C or Lisp. He graduated with degrees in CS and Math and I left after two years to take a full time job as a junior programmer (php, java, coldfusion). My buddy with the two degrees took a job at an ISP for 9 dollars an hour where he worked for about a year then took a job as a chef. He said he couldn't handle working in software because everything was so jacked up. There is no market in Ohio for a C/Lisp on Linux programmer.
.NET job. (Likewise easier to find a Windows job over a Linux job) Businesses prefer those because having a shop who uses Microsoft/Interpreted code is cheaper to maintain than having a Linux/C shop. Employees are easier to find and will work for less money.
Goes to show that most programmers out there will work for a small/medium sized business where implementation times and budget are far more important than a 10-20% optimization. The software won't have to handle 100 inserts per second let alone 100,000.
Everyone has to make a living. Fact of the matter is, it's easier to come by a Java or
Ideally, every programmer should know deep low-level computer theories and program in such, but in a real world, it's just not practical for most cases.
JIT compilers aren't "interpreters", they are real compilers. And not only do they not "struggle" with optimizations, they open up the ability to perform optimizations that batch compilers simply cannot reasonably perform. For example, they offer template instantiation without the bloat associated of C++ templates, they perform dynamic method inlining, and they optimize code for the specific set of processors and communication hardware available on a given piece of hardware.
The profusion of architectures, as well as extensive code reuse, are what is increasingly driving JITs, and the more complex and parallel hardware gets, the more import JITs become because batch compilers are hitting a brick wall there.
Ah, if it only were as simple as "Java is 5% slower than native". Unfortunately, performance can't be characterized that easily.
In real life, Java is as fast as C/C++ on microbenchmarks.
In real life, Java is also often slow as a pig, not because of the byte code or JIT, but because of the way class loading works, the way JNI works, library bloat, and lots and lots of other problems.
Java has given a bad name to JITs, but it has also demonstrated their potential.
The languages used may have changed, but the amount of (and use cases for) interpreted vs. native code hasn't changed that much over the decades. Shiny-new Java didn't change it, neither did .Net. Nor will Ruby on Rails. It's the same old song, covered by some fresh new 'hip' band.
If you lump together Java, C#, and interpreted languages, you really don't know what you're talking about. Java and C# are natively compiled languages, they just happen to perform compilation at runtime.
And for high performance computing, that's the future, because that's what's needed to adapt software to the specific hardware and data you have; batch compilers simply can't do that.
Java itself has lots of problems for high performance computing, but don't confuse a particular implementation with the approach. You'll likely see JIT-based Fortran implementations become widely used in the future and Fortran-specific JITs for high performance computing.
I've been writing business applications exclusively in PHP for almost 4 years. WHen I attended PHPCon in 2002, Rasmus Lerdorf was the keynote speaker. During a question and answer session, one attendee asked about the limitations of PHP in computationally intense situations. Rasmus said to write your business logic in C and call those binaries from PHP. Since that time, various PHP compilers have emerged which may may or may not make the whole issue irrelevant. I've never felt it necessary to either write external C routines or compile a PHP app because the apps I've written perform acceptably on commodity hardware. I love C and C++ dearly, but writing userland business applications in C is just way too much hassle.
But what interpreted language can I use to write a device driver? Or a web browser? Or an operating system?
Interpreted and compiled languages have coexisted peacefully for decades. It is reasonable to conclude that they will continue to do so.
I personaly would like to see a language that has the ability to be both interpreted and compiled. That way you could have the best of both worlds. If you need the low-level functionality certain parts could require compilation if used, but if you just want something quick and don't need that access you could interpret it. This would reduce the need to learn as many languages, and would make for a powerful platform for programmers. Now all we need is an able bodied group to come up with such a language.
The greatest of all weaknesses is the fear of appearing weak. ->JB Bossuet, Politics from Holy Writ. 1709
You sound like a 5-year-old when you use "How come" to generate a question. Try subject-verb inversion and the use of a proper interrogative like "why". Thus:
becomes
You're welcome.
Working in a LARGE corporate environment, I see this entire discussion as moot. Corporations are trending toward the complete elimination of GUI desktop apps in favour of RIA (Rich Internet Applications). Write them once, run them anywhere. Traditional BATCH processing is accomplished through services, daemons and objects.
Java's place in on the server. JSP is OK, but I wouldn't want to write full-blown RIA's in it. Look at FLEX or CF for your front-ends, then write the objects you need in Java to support you RIA front ends and appropriately represent your backend. J5EE with all the new Hibernate stuff, Generics, etc... as well as the stuff in the new concurrent package give you so much power and flexibility in writing FAST, solid, flexible frameworks, why would you want to use anything else.
Opinion:=TMyOpinion.Create(Me);
What if every piece of software was written to use the minimal amount of ressources needed to do its job?
As a professional game developer, I am amazed at how slow my favourite PC apps run these days, native or not. When I can do physics simulations, AI, complex animation, networking, and render 10 of thousands of objects with tons of processing to set them up, all in 33ms, on the PSP's 222Mhz cpu with 24Megs of RAM available to me, Why the hell does my Azeureus take 20Megs of my 512Megs of memory and 3% of my 2.8Ghz, even when I'm not downloading anything!!
I am sick and tired of lazy developers wasting cycles left and right on the assuption that the machines are so powerful they shouldn't care. imagine if gas consumption and cars were thouht of the same way.. And these developers then assume they own my machine.
Have you ever tried running Azureus, Maya, Visual C, Media player, outlook, some RSS feed thingy, an Antivirus, Google desktop, Trillian, Picasa, Word, Excel, ITunes, Photoshop, Google Earth, and a bunch of windows in firefox, all at once, and all of them being responsive and super fast? No Way!
But that's what my system should be able to handle if apps were written properly, and still have enough idle time for the SETI grid. These apps should be able to load and close in less than 1s too.
And no, don't listen to the BS about unnecessary optimization will slow down development.. it's all about common sense and good architectures, and not releasing the first test code that works and call it beta forever.
Stop the waste cycle!!
Give me native code over interpreted code any day! End users (at least the ones with knowledge of such things) are always complaining about code bloat and how, in spite of improvements in hardware speeds, software always seems to be running slower.
I think it's time to go back to native assembly programming.
- Any decent C++ programmer will always put the OS-specific code in an abstraction layer. C++ has many ways of allowing this, ranging from macro's to templates and everything in between. These features even enable portability without sacrificing speed, since the choice of function happens at compile-time. So this so-called portability issue just doesn't hold.
- For a lot of applications, optimal performance simply is the only way to get the job done. JIT Languages often have high-level objects providing functionality that takes lineair time where one would expect constant time performance. Building these objects yourself int a JIT language simply isn't going to make things run any faster, since the atomic components have to much overhead to be good candidates for such low-level operations. C++'s STL templates on the other hand have well-defined operation times. By the way, these lineair/constant time issues won't just go away as computers get faster.
- With JIT-languages, you have no control over the underlying virtual machine on which the program will be running if it's a program that will be downloaded by many people and run on a client machine. If that VM has a security flaw, then your program will have one too. With precompiled programs, you can choose your compiler and have full control over security. You can even decide to link statically to minimize the number of external dependencies that could be a security threat. He who controls (or manufactures for that matter) the VM also controls your program. God knows who's out there wanting your program to be less performant than theirs. And how will you ever find out?
And finally, just take a look at topcoder.com to see what programming language is used most by the people occupying the top 10 highest ranks. It's not a JIT language, but C++. That alone says a LOT to me.
Am I biased? I've written in both C++ and C#. While I even enjoyed writing in C#, I never felt the power as I felt while writing in C++. True, for every downside there's an upside to the JIT languages, but IMHO, the cons of the JITs just don't weigh up to their pros.
Native code will and should always be around.
And what if there's nothing behind the door until it is being opened?
We know that native assembly and low-level compiled code always tends to be faster. We know that JIT/interpreted languages provide a great tool-set to work with (reuse, reuse, recycle). Sure one could make arguments on both sides why these aren't true, and why one truth could apply to the other. The real questions aren't being asked here. These questions need to be asked:
1) What added value does the JIT/interpreted code base bring to the table for end-users (not programmers)?
2) What added value does the native code base bring to the table for end-users (not programmers)?
I think there are many value-added propositions when both questions are answered. The truth I think is that we can't live without EITHER model. IT benefits from the JIT/interpreted codebase, and mathematical computation applications (games, science, etc.) benefit from native code.
There is a place for both in our world. Let's just accept this and move on.
Native code is going to always be around. Someone has to WRITE the Virtual Machines. C is STILL valuable after all of this time.
.Net Virtual Machine will still need programmers to write them and add to them. Kernels will still need to be written and X windows will still need to exist.
What you WILL find is that applications programming may all switch to Java or C#. The reason is it is very hard to have some of the traditional problems with programs with a properly coded JVM. Sure, buffer overflows can happen in the JVM, but it's way less likely to happen in Java/C#. That means the applications will need less work over time. With that said, the JVM's and the
Gorkman
If Microsoft wants to demonstrate how fast managed code is, then why dont they write their drivers and their lower level os in managed code? But, as you'll notice, they don't. There are reasons for that - its just not fast enough, and garbage collection has too many problems (wasted memory, pauses, etc)
I had a pentium 2 233 with 64 megs of ram and a 6 gig harddrive. I primarily used my computer to run windows, ms office, diablo, IE and Netscape, winamp, and an antivirus program. Today I have a brand new computer and do almost the same thing. I run a "better" version of windows and office, I have a "better" video game or two, I run a newer improved IE and Firefox, still have winamp but its "better" than the v2 I had, and I have antivirus from the same company. The only thing new is a divx player. So how come with 10 times the processing power and 8 times the memory and 50 times the harddrive space its not really all that much faster and in some ways it slower. Could it be how things are coded these days. No that can't be. Newer is better.
C Source ==> gcc ==> Native Code
Java Source ==> javac ==> hotspot vm ==> Native Code
Java can be interpreted, just as C can be interpreted. Referring to Java as an interpreted language reveals the poster suffers from the widespread anti-Java prejudice that is based on complete and total ignorance of how modern Java VMs operate.
Delegates are *really* arrays of function pointers that have the conveniant notation of being able to call the entire array with one line of code. This is handy when thats what you want to do (event/subscriber pattern). Its horrible when you actually want JUST A FUNCTION POINTER :)
Religion is a gateway psychosis. -- Dave Foley
As much as I'd love to love Java, and as much as I know most people would if it truly delivered all that it promised, there are a lot of issues with it that can tend to cause problems. One example that bit my company:
d =4263113d =4912686
Our company writes and sells a large medical imaging archival system, and one of the components of it is a web-based front-end using Tomcat, which accesses the backend database for pretty much everything.
Recently a feature was added to our software which opens a database connection to the various other servers in the system to check the status of their queues. This worked fantastically in testing, but when it was deployed, we found sites whose frontend became completely unresponsive.
After some digging, our developers found these:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_i
http://bugs.sun.com/bugdatabase/view_bug.do?bug_i
The long and the short of it is that JDBC calls (DriverManager.getConnection()) are sychronous, meaning that you can only be opening one connection at a time. This works fine in an ideal circumstance, but if one of the hosts you're trying to connect to happens to be off the network, then all threads in all apps in that JVM have to wait before they can open a connection.
As a result, when our background thread cycles through the databases to check the status of their queues and comes across a down server, DriverManager.getConnection() blocks - for three minutes! - while the TCP connection times out. This means that our entire application locks up completely, since every action requires a database connection. Sun's response?
'Introducing a change such as this risks breaking existing applications that have come to expect this behaviour.'
I like Java, but problems like this are just absurd. In C, I could either rewrite the library, or (preferably) change the source of the existing library. Failing that, I could fork separate processes instead of threads (ugly and inefficient). In Java, I don't have this option, because it affects the entire JVM. Fortunately, there is a workaround, but it's not a particularly fantastic one.
Java/C#/etc have a great deal of benefits over C/C++/etc, but there are always going to be problems as long as someone else decides what should be fixed and how. The real question is whether or not, for your application, the benefits outweigh the (potential) drawbacks.
I am seriously looking at Java/Swing as the next wave of what started as DOS/Turbo Pascal and got reimplemented in Windows/Delphi.
.) As a former J2EE developer, let me also state that Sun is very slow with fixing critical bugs, and many more of those bugs appear on typical desktop applications than the server.
If you are looking for the next One Great Language (as I was last year) I'd strongly urge you to look beyond Java for a few practical reasons:
1) Sun and IBM may be gung-ho on Java, but it's losing ground compared to Python, Ruby, C#/Mono, etc. (Check this out too: http://oodt.jpl.nasa.gov/better-web-app.mov
2) As a language, Java is "OK" but not all that great, and it doesn't look like it's going to get much better over the next decade. "Better" in this case means how quickly you can write good abstractions.
3) Its lack of a Java-certified yet free-as-in-speech runtime stack is a problem. I wouldn't commit any of my future livelihood to the sufferance of any vendor, Sun or otherwise.
4) Java doesn't integrate that well with non-Java code. JNI is a pain to use (I've done it), the APIs that do talk to the OS are lowest-common-denominator and hence usually incomplete for any serious work, forcing you into JNI. If you're going to use a platform that insists on a clear separation between its runtime and the underlying OS, you may as well go with Lisp and at least get multiple free implementations and serious language abstraction.
Anyway, I'm not trying to preach here, Java's got a great place and powers a lot of the world. It's just (to me) not a good choice for the One Great Language, he one that you switch your primary problem-solving-think into. It would be like deliberately choosing to use Cobol in 1988 when Turbo Pascal was already available.
I'm one of them: The early Java GUI tools were a well-thought-out abomination that sent droves and droves of developers in search of better solutions. A lot of them saw VB just sitting there, and all their customers were on Windows anyway, and now Java's in an irredemable hole as far as GUI development goes. This is good, because innovative projects often start as a reaction to suckage elsewhere.
So Java itself will never make a serious dent in the realm of GUI clients. The reason is very simple: AJAX and SaaS are using the interface provided by the browser. Browsers have reached a capability threshold that is making them the client-side platform of choice.
We're reaching the point where, as far as desktop machines are concerned, the OS simply the framework for a windowing system, and the windowing system is simply the framework for the browser, and all HCI will happen in the browser. Sure, the server-side of the app may reside on the same system, and be written in just whatever language happens to be there, but all it will do is exchange XML and HTML with Firefox.
The OS is becoming an afterthought, and the Windowing system is an afterthought with skins. The browser is where it's at, and MS is gonna be hurtin' if people see Vista as merely the tool behind the tool behind the tool they use to get their jobs done.
This is not my sandwich.
article here
MS-Windows Vista's system requirements means that future Windows boxes will laugh at the memory/processor requirements of current interpreted/JIT compiled languages
That is, of course, unless it is the consumers who laugh at Vista's absurd requirements, and just stick with Windows XP. Anyone who wants the pretty eye candy can just spend a few bucks for Stardock's Object Desktop, which works without the hardware investmnent. As for the so-called security enhancements, we all know that, for every vulnerability fixed in Vista, Microsoft will introduce two more, thanks to their Insecurity By Design principles.
So the assumption here is flawed. Vista will have little or no impact on memory/processor power out there in the real world.
"My country, right or wrong; if right, to be kept right; and if wrong, to be set right." --Senator Carl Schurz (1872)
Short and simple, interpreted/virtual machine code has its place, but it does not make porting easier. Simple programs can be written in *any* language and be easily portable, obviously, some more than others, but all pretty easy.
Once you get in to complexity: memory constraints, performance constraints, large processing, and so on, interpreted and vitual machine systems directly impact the viability of the code. A virtual machine or interpreted system can use more than an order of magnitude more resources than a well coded C/C++ program. If your program is a couple megabytes, well, 20 or so megabytes is not too bad for Java. If your program takes a gig of RAM, then 10 Gig may make your program unworkable.
Then there's porting, don't get me started. Most of my time coding in "portable" java is figuring out the differences in the different virtual machines.
Like I said, an easy program is easy, almost any language and environment will do. More complex programs require more direct control over the actual processing.
Actually that's only true of multicast delegates — there are some which only ever point to one function, although they're obviously not used so much since the main use of delegates is the event/subscriber pattern.
Of course, there's always the issue that function pointers, in most implementations, are inherently unsafe, so they're quite hard to wedge into a "safe" language like C#. It's one of those quandary things. I'm not convinced that, in the paradigm that C# implements, there's all that much use for function pointers as it is, though.
JIT compiled languages give you native binaries... don't group .NET with python, et al - it makes no sense to do so.
Do you really not understand the difference, or are you simply a fan of some of the interpreted languages and are looking to manufacture some sort of fake equivalence as an excuse to use them?
Your argument amounts to "we will have a huge amount of ram and CPU cycles, therefore we can feel free to waste them on interpreted code rather than compiled native binaries". Huh? Good luck with that - I am sticking with .NET and C#.
You're not really asking about interpreted vs. compiled languages. What you're really asking is whether computers have gotten fast enough for us to stop using low-level languages and let the computer handle many of the details in high-level ones.
But, I think the whole question is bollocks because it's based on an incorrect assumption.
There is no inherent tie between LLLs and compiled code, and HLLs and slow, interpreted code. Some HLLs can be compiled into very fast native code. A quick scan of the comments tells me that the name has already been dropped, but I'll put in my plug for Common Lisp. It allows you to use interpreted functions and compiled functions both in the same environment, so that you can develop code quickly, then compile it to get a speed boost. If you need more low-level control to get some extra performance in a bottleneck, you can even do things like declare data types and lower compiler safety levels for individual functions.
Lisp was doing this decades ago, and it was even being used for operating system code in the Lisp Machines. So, computer power really has no relevance to the issue. I think the real barrier to adoption of these kind of high-level techniques is not in the machines, but the beliefs of developers who still think that real programmers do thier own pointer math.
--WH--
I am a Pascal programmer from ancient days
I'm sorry, you lost me there when I spit out my coffee on my keyboard.
Pascal was a language written to teach people to code, not to actually
get work done.
Interpreted languages, or scripting languages as I like to call them, GENERALLY are real crappy with memory management, bloated, pigs of software.
Perl is a lovely exception.
But Java or Matlab or VB seem to thrive in using as much RAM as possible to get a job done. Any serious work I do in any of them I end up re-writing in C/C++ in order to streamline the RAM usage and make the program work reasonably.
And this is the main reason Java will not take over as a dominant desktop theme. People actually like programs to work and not lock up the machine and screech it to a halt.
Real programmers manage their own memory usage, and don't think of it as a nuisance, but as a mission critical objective, because too many scripting engines are REALLY bad at it. Java on linux is a great example. It is real buggy and locks up a lot, and cannot do ANYTHING without loading 250 MBytes of libraries into RAM. That's crap, and it will always be crap. It is possible to write scripting engines that do not suck, and when that happens in something like Java it WILL take over because programmers want their programs to work first and foremost, and secondarily want to code it quickly.
I'll add to this rather pointless discussion: We're talking about colloquial language here, which is highly region-dependant. Don't expect things to have just one meaning. For example this is how words are used in my region (Northern Germany, more specifically the Bremen region):
"North America" is a continent.
"South America" is another continent.
"Central America" is what's between the above.
"The Americas" is not used at all and most people would tell you that "America" is used in the singular.
"America" is an ambiguous descriptor used for either North America, North and South America or the United States of America. South Ameria is usually called by its full name.
"American" or "Ami" (say: "uhmmie") is an ambiguous descriptor used for an inhabitant of North America, an inhabitant of America (where the exact continent is not explicitly mentioned), an inhabitant of the USA or a large sugar cookie made from sweet dough related to the "Black and White" cookies that came to Germany during the occupation (cf. de,wikipedia.org).
There is no unambiguous term used to refer to an inhabitant of the USA, except for the term "US American", which is not used colloquially.
USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
Talking about bringing out the grinders. Anyway.
I agree that people are going to be buying ever larger and more powerful systems. Yes, this will make bloat less important. Yes, this will give jit type languages a bigger role in larger applications.
I'd rather the future become more charming. http://charm.cs.uiuc.edu/
Having to work for a living is the root of all evil.
There's another advantage, though: interpreted environments typically provide a great deal of introspection, reflection & dynamism. One can redefine functions & methods, extend classes, extend the environment and such at runtime.
And of course Common Lisp offers the portability & flexibility of an interpreted language with the speed of a compiled language: yes, it's a language as dynamic as Python or Perl (much more so, in fact) which is compiled down to native code. How's that for nifty?
There is a philosophical reason to go to a high-level for all this. If you observe evolution in all its forms it always goes from low-level stuff to high-level stuff (from tools making to society behavior, with countless examples in all fields like business, economics, etc). In our brains, it just make sense for us to always think in ever-higher levels, because if we had to keep track of all the previous details we'd spend more time dealing with details than with the goals of what we're trying to accomplish.
Note that this is nothing new in software engineering. Most software a few decades ago was written in low-level code, even assembly language. If you did a survey then about the ratio of low-level to high-level coding, and compare it to a survey today, you'd realize that we do not even ponder about where things are going, as there is plenty of evidence today to tell us that going higher-level is the path the software industry is taking.
Native coding will become more and more of a niche, first to do Operating Systems, Drivers, Kernels and such. But eventually I can see even a fully-operational OS being written in a high-level language. In a sense that's what's happing today when you combine all the Web Services and tools we find today on the Web.
So, it's just a matter of time before everyone codes in high-level languages, and even today's high-level languages will seem low-level by what we're going to replace them in the future.
The performance hit is not always negligible (there's a reason why numerical work is still coded in Fortran), and I'd like to see the "intepreted language" that has shorter development time and is more powerful than OCaml. And what's more widely available than C? Probably only BASIC.
Besides, being compiled/interpreted/something-in-between is NOT a property of a language but of a language's implementation. Use Haskell and you can choose between all three. There are more things than C- and Perl-lookalikes.
The level of control you need as a programmer is related to the work that you are doing. If you are writing an O/S, low level network app, embedded system app, etc, then you'd better have the control afforded by non-managed code. If you are just writing web-based business logic programs then higher level languages are a better fit. Overall though, as they move languages to fit the lowest common denominator those of us that were forced to learn the lower languages will find their value increased. Not to mention that those understand the more diffcult programming concepts encompassed by managing memory or multithreading are going to better grasp other languages and complex concepts (if you don't believe me, study compliers and see how related all programming language concepts are).
Now who else thinks the first 100 comments on this thread are what make slashdot a venting forum for offtopic issues?
- Kal`Goblez
Well it's time for another opportunity for Java to take off on the client side. I think it might have a chance should a couple of things happen.
First, Sun needs to open source Java. There are tons of bugs in Swing and that section of the code could benefit the most from the open source community in my opinion. Sun has been negligent of Swing off and on in favor of more profitable ventures on the server or on mobile phone specific stuff. If, instead of voting on your highest priority bug on sun's dev site, people were actually able to *fix* bugs...If, it were set up so that new features could be added fairly quickly, Sun could see Swing swing into action. If they don't open source Java or have too much bureaucratic work involved, then Swing might just be left as a hobbyist prototype-like portion of Java.
Second, I wonder if SWT will catch on. Eclipse is doing some very good work with 3.2 and the synchronized release of several projects in Callisto (http://www.eclipse.org/callisto). They are making it easier to do SWT client-side apps. If they execute well and developers pick up on this, Java could also make it big on the desktop.
I think both have to occur for Java to really take off on the client side though. We'll see.
First, your interpreted language has to use "native code." Second, in applications that are CPU bound, like scientific computing, the overhead of an interpreted language is not acceptable. Third, the largest computer market, embedded processors, will, in all likelihood, always compile to native code.
Why choose between compiled and interpreted languages? You can have the best of both worlds: http://www.tinycx.org/. It extends C to include many features from high-level interpreted languages to improve C coding productivity without sacrificing performance and C integration.
Err... the first public release of Java was on 23 May 1995. There might have been some code for it in 1990, but it sure wasn't ready for release.
But the other dates you quote are first release dates. You're comparing apples & oranges.
(Admittedly, Java's was the longest period without public release... of the others, Ruby had the longest such period having been started in 1993) (All information from Wikipedia. Look it up yourself.)
Seriously, Xant, since when is Python hardcore anything ?
"Perl is a lovely exception."
I am sorry you lost me there when I choked on my coffee. Perl is pathetic attempt at a good scripting language. Having learned several languages now I have to say Python takes the cake "I am a scientific programmer". If however I wasn't doing computational work I would almost certainly use Ruby. I hate perl. I despise Perl. Perl Sucks. Perl blows snot rings...bet ya don't know what a snot ring is do ya? That's becuase you program with Perl! j/k btw
I used perl for several years. I honestly hated it from teh get go.
what?
See Herb Sutter's concur project. Unfortunately, I think you need IE to view this, but it demonstrates some pretty interesting ideas for incorporating thread support into C++. It's not about library support, but about language support. I highly recommend this video if you've ever used C++ in a heavily multithreaded environment.
f iles/Default.htm#nopreload=1&autostart=1
http://microsoft.sitestream.com/PDC05/TLN/TLN309_
"It sucks balls". Seriously, the only people who think Java is a usable language are Java programmers and the managers stupid enough to listen to them. People complain constantly about the performance of Windows, but are more than happy to drag their machine down by running a Java app. Java is best left doing what it's best at: putting stupid ripples under images on a webpage.
Which is more painful? Going to work or gouging your eye out with a spoon? Find out!
http://www.workorspoon.com
Yeah, sure. And I work on DB apps that are MEGA petabytes and double in size every 3 days - the largest database in the world, bigger than all the smaller databases combined. We use Perl, Common Lisp, C and programmable array processors with proprietary languages.
There's so much bullshit flying on this thread that we'll have to sink the ship just to clean off the decks.
Regardless of the negligible performance hit compared to native code...
...are just as powerful as languages that generate native code.
...current state of interpreted/JIT compiled languages?
Some of us work on projects where multiple orders of magnitude is not considered negligible. Anybody who's actually delivered software of any complexity understands this. Twit.
"Substantially more powerful in many cases" would be more accurate. And since there's no point in using any interpreted language that is not, I'd abbreviate that to "substantially more powerful" and be done. In other words, your attempt to sound neutral on the subject is transparent. Twit.
Uhm, don't JIT compiled languages output native code to be run? We could argue about whether it's better to compile early or late, but... And anyway, JIT compiled languages are really not much more powerful, if at all, than compiled languages. Java and C# are incremental improvements, at best, over modern C++. It's the interpreted languages that are really more powerful, so you're conflating 2 subjects. Twit.
Interpreted languages are very very useful. And there are also very many projects where they are simply not appropriate.
In most San Francisco bars, patrons dally about with their cigars exposed. The Englishman would be quite confused I'm sure. But the Frenchman? Right at home...
What about the English spoken in Wales?
It's British English; it's a standard throughout Great Britain, not just in England.
The real difference to me between compiled and interpreted is not the speed. It never really has been. It is the typing. There are areas where I want static typing, such as large architectures with many developers touching related code. Compiler type checking can be very valuable in such cases.
On the other hand in projects with more isolated nodules, lots of shallow glue, or quick turnaround prototyping, I like the freedom of dynamic typing.
Note that languages like haskell, Java, and C# really fit into the compiled camp, not the interpreted camp...and they are all static typed. JIT is still compiled. True interpreted languages are more like python, perl, lua, and sh.
I think compiled and interpreted are very complementary, and I personally like stack of python/C++/lua. Extend python with C++ which in turn embeds lua. lua is easier and faster than python for script embedding, while python is easier to extend and has more libraries for the orchestration/glue role.
I've not yet seen a virtual machine that was fully useful. The inform z-machine, java, Apple's early forray into running old Mac software on the PowerPC, the SoftPC that ran Windows on a Mac. They all had limits. While they can emulate a processor, they are still a virtual machine. While there's a certain security in running applications within a virtual machine (if theres a crash, it happens within the virtual machine and hopefully doesn't affect other applications, or in Java's case Java is prevented from greatly affecting the system at all) I'm not convinced it's worthwhile to market full-fledged applications written in virtual machines.
.NET. That, I'm sure cuts down on development time and opens their products to more platforms, but I'm sure it's limiting in what their developers can actually do.
I will have to say, however, that the enterprise software market has embraced the virtual machine. Many enterprise groupware apps are written in Java and
But England is only one unit of the collective that is Great Britain. British English is the standard throughout Great Britain. Great Britain is not England. It's also Wales and Scotland. Complicating the matter is that there are still Gael folk in Wales and Scotland, but that doesn't change British English from being the standard English throughout Britain.
t he_English_language
Look on Wikipedia and you will also find these variations of English within Britain:
English English
Scottish English
Welsh English
(among others)
Here is a complete list of dialects of English:
http://en.wikipedia.org/wiki/List_of_dialects_of_
Note how many dialects there are within Britain!
C and C++ are just poorly designed languages for medium to large projects. The problem isn't native code, it's language design.
My current favorite language design is D (Digital Mars D). Unfortunately, it's still Beta and doesn't have any libraries to speak of, and won't link to GCC libraries. (There's an offshoot of it that will, called gdc, but building it requires recompiling gcc.)
Python and Ruby are very nice languages, but I would prefer not to choose them, and take the performance hit. Python, however, at least has the libraries (and so does Ruby in some areas). Python and Ruby are nicer languages than D, but they intrinsically have the performance hit of an interpreter (virtual machine). This causes much problems when you are trying to multi-process your code. So far my best answer is multiple independent processes that communicate over sockets...at one VM/process...I'm really hoping that D either matures rapidly or acquires the ability to link to gcc C libraries. If your code slows by a factor of two every time your processor speed doubles...then you aren't getting ANYWHERE.
I think we've pushed this "anyone can grow up to be president" thing too far.
Take a look at Erlang, it's an interpreted language from Ericsson and can support that sort of load. It's used mainly for soft real-time constrained, telco applications. There's an old video demonstration of the language available here.
Perl is very C oriented in its syntax.
I shouldn't have excluded Python. Both Perl and Python are reasonable in memory management, as in a simple "Hello World" program doesn't require 250 MBytes of RAM to execute.
Others, not so much, ESPECIALLY Java.
I do mostly scientific programming, I use Matlab for a lot of quick and dirty stuff, Perl when it requires a little more programming, and C/C++ for any real heavy computing because the others are JUST TOO SLOW. There is no good reason that Matlab or Perl or Python should be 10 times slower and use many times the RAM as C/C++, but they do. And Java is a complete memory hog, off by an order of magnitude.
Speaking of Erlang, have you seen the video?
About 20K a year!
Boom boom.
I really would like to see Iron Python work out :)
Religion is a gateway psychosis. -- Dave Foley
I'll second j1mmy's comment.
Were you expecting x to be set to whatever value fc2() returned? If so, you need to pay attention to operator precedence and write this instead: "in x = (fc1(), fc2());". As it is, I believe that optimizing out the call to fc2() is allowed, although I'm not enough of an expert to say that with 100% certainty.
Okay, a more obvious example. Take the TI-85, the calculator I used in high school. Speed it up by a factor of a million. It doesn't get any more accurate, because it's still using the same number of bits to calculate. It doesn't magically gain the ability to solve problems that it couldn't before (unless the problem are time or memory-bound). The advantage to hardware improvements come from the ability to use the right algorithm, instead of hacks to bring in an answer in an acceptable amount of time.
So what happens when you run existing genetic algorithms or neural nets on a computer that's 1,000,000 times faster? I agree that running Word or Quake on a 1PHz computer would be silly, but protein folding or QCD is not. The algorithms already exist, it's just the problem size that is CPU/memory limited. Technically the algorithms may have scalability problems, but if you have a magical computer that's just a million times faster instead of having a million times more processors, the current algorithms will work just fine.
Despite what the VM fanboys like to spout, performance does still matter for a lot of applications.
What do we lose? Speed. Duh. You had to ask?
For those who haven't seen it, Panda3D is a game engine with a Python interface. It is the system underpinning Disney's Toontown MMO game for kids (IE required, because the website needs ActiveX). Panda3D is a full-featured game engine for Windows and Linux (with an unstable port to OS X; the Windows release tends to lead the pack). It has support for graphics, sound, networking, UI, collisions, physics, AI, and the Cg-shader language for high-end graphics cards. On top of that, the developer gets the advantage of a built-in engine profiler (for ironing out those trouble spots), an object placement tool, and the regular reflection, auto-documentation, debugging features, and libraries of the Python language. It's also open-source.
We used Panda3D on a project and were able to go from scratch to a complete product in a matter of two months. I sincerely doubt we'd have had that kind of turnaround with almost any other language / engine combination. From the nifty things specific to Python (pickling, solid dynamic typing, interactive runtime mode, runtime mutable classes) to the simple things that you expect from any high-level language (strings as a type, as opposed to "bag of characters;" automatic memory management; exception objects), we used about every aspect of the system to keep our project on-time and on-budget. If we had chosen a system such as SDL / C++, I suspect that the memory management issues alone would have bogged us down terminally.
Personally, I think there are a couple of lessons to be learned from the Panda3D example:
So there's one programmer's experience with hig
Take care,
Mark
There is a solution...
Well, it's a case of which "unsafe" things you allow, I suppose. I don't personally think that direct memory manipulation through pointers and the like helps you if you're using a rich language, and you don't want to actually write something which manipulates memory as its primary function (like a garbage collector or whatever). Dynamic typing is a different matter though, particularly for Rapid Application Development. Another fun-looking language for the CLI is Boo, which is "Python-inspired", with (optional) stronger typing and more influence from CLI languages, rather than an actual dialect of Python, as IronPython is.
I agree. I hate Java...I'm also opinionated!! LOL. I am a C++ code for the most part. When forced to use a scripting language I have found that python is the easist to extend and embedd. It's all just a matter of opinion for sure, but I will say that once I was convinced to learn Python I did have to conceed that it was the most maintanable language simply because it doesn't allow 50 million way's to do something. Just my thoughts tho.
what?
Since when do standards bodies make for a higher quality specification? They exist as a political process to ensure a wider 'supported' specification & to ensure stakeholders get their say at the table.
The Java langauge spec is very well defined, and there's more than one reference implementation of a JVM available to study... which is why you tend to see a lot of separate codebase VMs for Java (Sun v. IBM v. BEA JRockit v. Aonix v. kaffe v. GCJ) and value added derivatives of Sun's implementation (HP has variants for Tru64, UX, OpenVMS, and NonStop, and some have OS-particular features). Compatibility wise, they broadly work well with minor issues -- see BEA's support matrix, for example.
-Stu
Which you will see is possible, once you get away from your preconceptions.
I knew this conversation would be full of misconceptions as soon as I saw that it classified non-native languages as "interpreted/JIT". Runtimes like Java and .NET have not been based on either interpreters or Just-In-Time compilers for almost a decade. They use dynamic compilers which optimize on the basis of what the program is actually doing. This is something that no C++ compiler can do. This kind of optimization can result in "interpreted" applications that are actually faster than native apps. Not always, of course — it depends on what kind of application you're running. But it does happen.
Also the notion that optimization is about producing the most efficient machine language possible has been obsolete since about the time they stopped using Z80s in PCs. Software applications nowadays are more than symbol crunchers: they consist of complicated I/O and network components, which have to work together for the app to run efficiently. And adding multicore processors to the mix does not reassert the importance of micro-optimization. Quite the opposite: a multicore application is a concurrent (what people used to call "multithreaded") application. Actually, concurrency has been important ever since processors got so painfully fast — but now that the Mhz wars have been replaced by the multicore wars, concurrency is 10 times as important. And the best native code compiler on the planet does nothing to help a concurrent program run better. Only a good concurrent runtime can do that.
When early releases of the Java runtime ran so slowly, everybody blamed the fact that it was based on a simple bytecode intpreter. That was certainly part of the problem, but there were many other parts. One of these was the fact that Java's concurrency API was absurdly primitive and inefficient. That's no longer the case. And with a modern, powerful concurrency API, the Java runtime can handle your umpteen-core systems as well as any native code runtime.
... Java was invented mostly to get around the memory safety problems of C and C++ ...
It was invented as an attempt to break Microsoft's hegemony. If it could be a good language too, that was OK.
--
phunctor
To the people who say "Since computers are faster speed difference for interpreters vs. compiled languages is negligible":
1) when computers get faster their uses expect the computers to do more work: process more data, make more decisions, create better quality images/etc. So CPU power should and will go to perform
tasks specified by the algorithms, instead of spending time in the
run-time subsystem of a given programming language
2) "good-for-all" memory management models deployed in today's scripting languages are not specialized enough to support
the needs of large-volume data processing applications: locality of reference, coherence of caches on multi-cpu systems have to considered
from the application design stage, and therefore should be appropriately reflected in the programming model (and the languages that hide that, therefore are not appropriate)
-----
To the people who say that '99%' is spent in the database:
If it spends time in the database, I assume it means the application
is accessing data from hard disks and that's where most of the cycles are spent. So to get your applications run faster, you have to get data off the disks into Database's shared memory pools, or better into your applications memory cache. And that requires effective memory management, effective algorithms/low run-time overhead: again good
reason to use compiled languages
--------
To people who mix C and C++ in one sentence and then argue
the shortcomings of C as they are shortcomings of C++: get a clue
They are not the same. Study boost library.
---------
To people that say that C++ is not cross platform or
does not have 'enough' library support for effective development work
Dowload and install: Boost, wxWidgets, OTL and ACE: those
4 libraries are standard tools these days and will let you
develop effective and rich applications on any platform: from
hand-held to real-time systems to multi-CPU servers
--------
To people who say that C++ is too low-level: they are
probably the same people who think that there is no
need to know how Binary trees are organized, or that you have to
sort an array before doing a binary search. If that's too low-level
then you are not in the right business: as applicaton developers must understand how the data is to be organized for a particular pattern of access, for nothing more but just performance considerations.
-----------
To people who say that C++ days are numbered in business application
development and that support of vendors will be dropping:
Virtually all of the money making products of Microsoft/Sun/Oracle/IBM
are written in either C++ or C, all of the C++ compilers support C,
all of them will be constantly improved and enhanced to support new
hardware architectures and all of them will constantly be improved and revised to provide best possible performance for a given hardware platform.
----
And finally to the people who say that the error rate is lower
because there are 'no pointers to deal with' in Java or Python:
You do not deal with pointers when you program in sophisticated
langauges like C++ with Boost/STL, you deal with references, auto_ptrs and such. And also if you do need to deal with pointers, it is only because you choose so and you have a good reason to do so (like manage blocks of memory effectively for your specific need) -- and yes tha requires skills, just like it requires skills to deal with any resources:
threads, data base connection, file handles, etc -- so if you are not qualified enough to deal with memory management, than most likely you are not qualified to deal with other resources as well...
I would also ask that people study Boost Library with C++ and Occaml language, both compiled, one supports effective type-safe imperative language paradigm the other supports very good functional language paradigm. Both allow for custom memory management (although do not require it), both provide native compilation option, both support majority of the platforms out there (with C++ having a clear edge in platform support, market share, books, knwoledge pool/etc).
It's not my choice of a license; it's the program's author's. Besides, as I mentioned earlier and you conspicuously omitted in your reply, neither the compiler nor the binaries it creates work with my Linux-incompatible hardware.
This is another fine example of an article, by a member of the Java community, which attempts to wrestle the Java language from its stereotype of being used in mostly CPU idle applications. The whole notion of moving completely towards interpreted language applications is laughable. Java has its place and uses; web applications, gui interfaces, and anything else that's sits idle 99% of the time. The argument that processors are fast enough to run all applications written entirely in an interpreted language follows the comment, "Who needs more that 640k of memory?" That's easy to answer, everybody that likes to push the performance envelope, write a deterministic application, benchmark their system to death, or tweak a system to the hilt for sh*ts and giggles. There are a lot of folks in this category. Embedded application engineers relying on deterministic behavior would be foolish to get in bed with Java. Sure Java can make it last longer, but we want a quickie this time. Sorry, no time for foreplay. Trying to get something to happen every 5 microseconds, such as a good portion of modern medical equipment, would be tough with Java garbage collection and etc. looming nearby. Have fun sorting that out. Sure it can be turned off but there are numerous Java related barriers preventing high performance deterministic behavior. Found a bug in the JVM? Ugh, try debugging that or worse try to get Sun to do it without a truckload full of cash. Writing a cutting edge game? Could you imagine a project manager asking engineers, how can we make this Java coded game run faster without impacting the schedule much? Oh..Oh..Oh...me! I can answer that! Try C/C++ with inline assembly where needed and throw out the Java code. He'd pass out. The Java versus C++ battles are as contrived as they can get. Why does the Java community pick on GCC and a limited set of code examples? Then they use Sun's flagship Java implementation against an open source compiler. That's like pitting Pee-Wee Herman against Mike Tyson. The simple reason is Java can't hang with a reasonably complex high performance application written in C/C++. A better route than trying to push Java bloat on the rest of the developer community would be to deep six Java all together and push for a standard C++ threading model (boost threads), network interfaces (many already exist), a windowing framework (give us something better than the FLTK), and etc. With these tools in hand code written in C++ can be compiled for a wide variety of platforms more easily. We get the speed, flexibility, multi-platform usage with the same code base, and most importantly we can say bye-bye to Java.
If I had to have a programmer code a not-so-trivial application for me, then...
I wouldn't trust him to do it properly if he had no experience with low-level languages, because it is my opinion that a good coder must understand what happens between his code and the hardware aswell as he should have some knowledge about optimization and mission-critical algorithms*.
I wouldn't pay him if he had no experience with high-level languages, because he'll end up using too much time coding and optimizing instead of planning and designing the application structure, management, etc.
Of course, if I needed a non-mission-critical GUI-app to be coded within a short timeframe, I certainly wouldn't ask for a programmer with years of C-experience, but still the additional knowledge wouldn't hurt.
Once again, The-right-tool-for-the-right-job (tm) is the way to go.
Replacing most of the native code with interpreted one? Nah. You wouldn't want your database software/search engine/OS/compilers (calm down, just kidding) coded in a high-level language, would you?
IMO, low-level won't die, since there will always be need for mission-critical programs... and there's still something the high-level code needs to run on.
*Yes, these are necessary. How many search- and sort-algorithms do you know and know how to code? How many modern applications can do without? How many of those algorithms can be, of course after some optimization, executed in C (or Assembler if you really need those cycles...) much faster than in any high-level language?
FACT: .Net bytecode can be compiled when the program is installed.
No, I will not work for your startup
FYI, we do know the answer to that question.
An average PC nowadays holds enough power
No, a PC will never hold enough power, period. There always will be something that will need all of its power and more, therefore ASM will always be used for some tasks that need to be highly optimized.
You just got troll'd!
Yes, we are seeing more development in non-native code but, it gets it's power from the underlying libraries and core code that is native. The line between them gets fuzzy when you toss in JIT and scripting to native code compilers.
And thus the problem with phrasing the question as it was: the performance hit (if any) comes from using non-native code, while the development speedup (if any) comes from using a high-level language. These are orthogonal. (Imagine a C interpreter.)
Everybody seems to assume native=low-level, and high-level=interpreted. That's somewhat true today, but there's nothing that says it has to be this way. Pull open your favorite Lisp compiler and try disassembling some high-level code.
What we (as developers, and users) really want is high-level, native/compiled/optimized code. Then we wouldn't have to have these sort of discussions. Unfortunately, programmers are lazy, so the general trend over the past few decades has been to add a little more functionality to C, and to add a little more speed to HLLs -- but (at the risk of sounding like Just Another Lisp Nutcase) of all the languages I've seen only Lisp has had both great optimizing compilers and high-level constructs.
Perhaps a more realistic solution to this problem is better profilers. Slow algorithms are slow in any environment, and a good profiler will help you eliminate them from any language. Unfortunately, most profilers these days still aren't very good. We tend to get solid compilers, and then decent debuggers, and maybe if we're lucky a semi-usable profiler.
(well, just about - I don't think you can use the top-of-screen menu bar in Swing apps)
:)
System.setProperty("apple.laf.useScreenMenuBar", "true");
Without looking at the documentation, I am not sure if this works with J2SE 5, but for 1.4.x Swing apps it works nicely.
Arr! The laws of physics be a harsh mistress!
I have experimented with Python, and Python is great. But it lacks an intrinsic array type, and arrays are as necessary as oxygen for numeric, audio signal processing, frame buffer graphics/image processing, and related work. Yes, there is NumArray and Numeric and NumPy, but a defined array type is a work in progress and there is far from universal adoption of any of them with frame buffer packages. Python is compared with Lisp, and even Lisp came around to having an array type which I understand was well-implemented with slices and all of that, but the Python array situation remains a work in progress. Java on the other hand has an intrinsic array type -- arrays are objects, but they are special types of objects where iterating over the subelements is almost as fast as native code.
Matlab -- very popular in the scientific community for data visualization -- also has intrinsic array types and is highly interoperable with Java and interoperable between the Matlab and Java array types. While there is a movement to develop libraries to make Python a FOSS alternative to Matlab, Python and Matlab don't readily interoperate, and Python doesn't interoperate with Java unless you go the Jython route, which is almost a whole other language, or go with some JNI support packages from CPython that are not actively supported.
Java has the much maligned Swing, but the BufferedImage class and the Graphics.copyArea() method are pretty much direct replacements for CreateDIBSection (frame buffer support) and ScrollWindowEx() (scrolling) in Windows -- I don't see anything equivalent in wxPython or in .NET/Mono/C# apart from "unsafe code" for that matters.
So people tell me the browser, not Java is the platform. Great, I am going to have to figure out how to blast arrays to frame buffers in AJAX and get those images to scroll.
Maybe I am jumping on the Java bandwagon too early -- maybe there is this product/project for implementing scientific data visualization called Python on Steroids, Matlab only following sound software development principles, that is this really well integrated object framework for such apps that is just coming out. Don't know. What I do know is that everything has its product development cycle, and Windows flopped around as a toy for 10 years (Windows app: Dog slow! RAM hungry! I can do graphical apps with mouse selection in DOS (I actually went that route)! They are much faster! DOS games, data visualization, even word processors were much faster in DOS). Then Windows 95 came along. Java is about at the same depth into its development cycle.
Python? That too has a development cycle. Maybe in a couple years it will have the features I want. Maybe I should ignore Java and wait for Python to come around.
My point is that everything has its development cycle and it can take a long, long time for products to reach maturity. Java look and feel all wrong, load times too long? There was a time when Windows was a wart on top of DOS with all of those odd fonts that didn't look right on the low resolution monitors of the day, and you had to run Windows first before you could run your Windows app.
Java, like pre-Windows 95, is a wart on top of the OS that seems foreign to the native OS, but it is a wart that runs on top of multiple OS's. Windows was an abstraction of the underlying PC, and oh the complaints about resource usage, slowness, and loss of access to the hardware and especially the graphics frame buffer. Windows fixed that with a combination of Moore's Law and the WinG initiative and later DirectX to
Listen up pilgrim, we have the right to call ourselves Americans because everyone on our continent wants to be one!
This is my sig.
The early Java GUI tools were a well-thought-out abomination that sent droves and droves of developers in search of better solutions.
Netcode Constructor looked promising, but then Netscape bought them and it disappeared.
September 2011: Looking for Cocoa/iOS work in Boston area Cocoa Programmer Quincy, MA
Fortunately, tools to hide source code for trully interpreted (dynamic) languages also exist (here is a sample catalogue of JavaScript, Perl and VBScript obfuscators), though sometimes they require adaptation of source code.
Thanks very much. Hopefully someone will mod your post informative.
Now I know it's actually a case of people not bothering, rather than it being technically difficult.
Or to be closer to my original point - it's the philosophical rather than technical differences that make cross-platform GUI hard.
'Capitalists of the world, unite! Oh
Hmmm. There was a publically released formal spec for Java unlike the other languages. I agree that a formal spec is not the same as a working release. But neither is it a fragmentary prototype or something like that. You can actually start teaching yourself the language if you have a spec and think it is reasonably firm.
I don't know exactly when the spec became available, but I know I reviewed it intensively in 1992 or 1993 before deciding that the proposed data structure for the IL was going to be an ungodly mess -- bad enough that I'd pass on devoting a year or two preparing for a Java wave that might never materialize. I was told later that the data structure laid out in that spec was not, in fact, the way that data actually ended up being represented. I'm not sure where I got that 1990 date from, but I did look it up and the sources looked credible. Trying again, I find a lot of dates, for the beginning of Java mostly around 1991.
I'll plead guilty to comparing oranges to tangerines.
You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
Why can't we have interpreters for compiled code, and compilers for interpreted?
That is to say, when I'm developing and/or debugging, I'd much rather be running my C/C++ code through some form of interpreter, and watching/debugging as events occur. No mysterious segmentation faults, no inserting a gazillion "printf('Works at line X'); ", statements to find that one screwed up line or even character.
By the same token, I'd love to have more interpreted languages happily compile. Perhaps it could boost the speed a bit, and sometimes it would make the packaging a bit more convenient. Also useful when there are things in one's code you just don't want visible (even though I am a fan of open-source, some security/etc routines are best left safe from the unwashed masses). Between the two, neither one is better than the other, but there's no reason we shouldn't be able to enjoy the best of both worlds.
Even though the JIT and interpreted languages are (nearly) as fast as native code in execution, in practive they are not. Languages like C# and Java make it very easy to create many wastfull objects. In C/C++ you don't have convinence of a garbage collector to clean up your mess. In C/C++ you have to keep strict record keeping of all of the objects, and as a result objects get reused more often.
I have found that C#/Java software runs slower only because the coding style does not enforce object reuse.
Fast Federal Court and I.T.C. updates
From recent actions by Microsoft, it appears that Microsoft's goal is to make native code unsuitable. It is very likely that NT 7.0 will not run native code unless it is digitally signed (or it is so sandboxed that it doesn't matter).
It is impossible to hack DRM when you can't run native code, and that's probably what it's all about.
Melissa
"Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
The problem with interpretted languages is that when you write very complex programs in them, it becomes very difficult to control performance and debug complex operations. Occasionally, actually no, often, you run into limits or bugs imposed by the runtime environments.
With Native code, you control the binary. You can code around limits. You don't run into threading bugs or native interface issues. In addition, counter to the authors claim, interpretted languages are not all that much easier to port to other platforms. C++/C code with standardized libraries typically ports as easily as very complex java applications. I've been there and done both. I have just as many problems porting an interpretted language that has been optimized to take advantage of its platform as I do porting native code that uses portable libraries.
So the original poster is incorrect in many of their assumptions. People use native code to maintain control of their projects. Once you tie yourself to a VM of some sort, you are its bitch and you have to live with that. Performance be damned because you don't control their code. Once you hit a bug in the VM, you are screwed.
Here is an example- I built a J2ME application that runs perfectly in the reference VM under Windows and Linux. So when I take this "portable" code over the the Treo 650 JVM written by IBM, I run into a threading issue where the GUI can crash the JVM (and the whole phone) if too many GUI events occur while you are executing network activity on another thread. This is a problem with the JVM on the platform. No patch is available. The code runs perfect on a PocketPC or a BlackBerry, but the supposedly portable application fails miserably in this situation on the Treo 650. It turned out that this was the target device too, and this problem could not be worked around without resorting to native code. So the entire development cycle was wasted and we are still waiting to see if IBM fixes this problem in the JVM. We shelved the product for the time being because we had sunk too much time into it to spend more time writing it as a native application. If we had begun as a native application, it would have ran perfect.
In addition, the Treo 650 JVM will not allow a program to run on a background thread, whereas you can do this on the BlackBerry and PocketPC platforms, so the behavior of the application is different.
If I had it to do again, I'd write it as native code. We didn't need it to run on a PocketPC or a BlackBerry, but we had this great idea that J2ME was "portable". Its only portable if you want to write hello world. Don't be taken by claims of portability that lock you into something you can't debug. This was a costly mistake.