Slashdot Mirror


New Intermediate Language Proposed

WillOutPower writes "Sun is inviting Cray (of supercomputer fame) and IBM (needs no introduction...) to join and create a new intermediate run-time language for high-performance computing. Java's bytecode, Java Grande, and Microsoft's IL language for the Common Language Runtime, it seems a natural progression. I wonder if the format will be in XML? Does this mean ubiquitous grid computing? Maybe now I won't have to write my neural network in C for performance :-)"

36 of 440 comments (clear)

  1. What's the point? by Sheetrock · · Score: 2, Insightful
    We've already established that moderate proficiency in a high-level language with a good optimizing compiler is worth far more than mastery of assembly in today's environment, what with the size and scope of most programming tasks nowadays. Creating an intermediate language seems to couple the worst inefficiencies of high-level programming and assembly micromanagement: something akin to writing 'machine code' directly for a Java VM to optimize your application instead of just writing the darn thing in C, compiling it to the three platforms it's going to run on, and getting a 300% speed boost.

    What's wrong with making a good compiler that writes directly to machine code? I would think Cray and IBM would be even more inclined to do so, given their control over the hardware their software will run on.

    --

    Try not. Do or do not, there is no try.
    -- Dr. Spock, stardate 2822-3.




    1. Re:What's the point? by plastik55 · · Score: 4, Insightful

      Because a well-designed intermediate language will help optimization. Being somewhat higher-level than raw machine code, not yet having to worry about the specific details of registers and pipelining, makes it easier to perform higher-level optimizations because the IL can be more easily analyzed. And when you compile from IL to the target you will have just the same opportunities for platform-specific optimizations as if you had compiled straight from the source language.

      The other benefits of using an IL are manifold. New languages can be implemented without having to write a compiler for each platform. New architectures can be supported without having to write compilers for each language.

      --

      I have a positive modifier on Troll. When I mod someone Troll their karma should go UP!

    2. Re:What's the point? by iabervon · · Score: 5, Insightful

      All good compilers use at least one intermediate language. It's practically impossible to do good optimizations otherwise, even on a single platform. For example, you want to inline functions if that would improve performance, but in order to determine whether it improves performance means that you need to look at things like register allocation, which depends on things like the machine code implementation of complex expressions; however, inlining a function needs to be done with the higher level information about flow control and the structure of the function call. So you basically can't do any of the interesting optimizations without a good intermediate language.

      Furthermore, getting from the high-level langauge to the intermediate language is cross-platform, which means that any optimizations done at this level are then available to all of the code generators for different platforms; this code is reused across back-ends. It also means that you can support multiple front-ends with the same back-end, and make your C++ and Java automatically compatible by virtue of sharing an intermediate language, and they also both benefit from the same architecture-specific back-end.

      There's no reason that having an intermediate language means that you'll stop compiling at that level and use an interpreter for the intermediate language to run the program. In fact, gcc always compiles its intermediate language into machine code, and it can compile Java bytecode into machine code as well. Modern JVMs compile the bytecode into native machine code when the tradeoff seems to be favorable, and they can do optimizations at this point that a C compiler can't do (such as inlining the function that a function pointer usually points to).

      An intermediate language essentially pushes more of the skill into the optimizing compiler, because the same optimizing compiler can be used for more tasks. Also, if the compiler is used at runtime, it can optimze based on profiling the actual workload on the actual hardware. This is especially important if, for example, IBM decides to distribute a single set of binaries which should run optimally on all of their hardware; you run the optimizer with the best possible information.

    3. Re:What's the point? by tomstdenis · · Score: 2, Insightful

      " it's anything but slow"

      It's also a memory hog! ;-)

      Kiddin. Whatever I code in C. I let the compiler sort out what platform it runs on. [hint: I write portable C code so it doesn't matter]

      Tom

      --
      Someday, I'll have a real sig.
    4. Re:What's the point? by btakita · · Score: 1, Insightful

      So, one of the ideas behind C# was to make an intermediate laguage (MS-Java-byte-code, if you will) which could be quickly compiled for the CPU in question. Stick a system call envrionment and garbage collector around it and you have [roughly] what C# is.

      Another Java programmer, who has almost no experience with .NET, yet thinks he has enough "understanding" of .NET to put it into a nutshell. However, you're not as bad as most people.

      Why C# falls short, I can't say.

      Could it be that there is less than a snowflake's chance on the Sun that Sun Microsystems would suggest .NET over Java? It's corporate politics!! If Microsoft were trying this, they would be pushing .NET instead of Java.

      Anyways, why are there a bunch of Java programmers, ignorant of .NET architecture and capabilities, who are so intent on slandering .NET? If people criticize something, shouldn't they at least understand that thing first?

      I've only looked at the Java machine, never at how C# represets a program.

      At least you admit you have no experience with .NET.

    5. Re:What's the point? by Tim+C · · Score: 2, Insightful

      Please, enlighten us. I'm not trolling, incidently - I'm a Java programmer professionally, although I admit that I've not really looked too deeply into Java's bytecode, but I'm training myself in C# and .NET - I have a genuine interest.

      Anyways, why are there a bunch of Java programmers, ignorant of .NET architecture and capabilities, who are so intent on slandering .NET? If people criticize something, shouldn't they at least understand that thing first?

      Same reason you get C/C++/Perl programmers slandering Java, and Linux zealots slandering Windows, Windows zealots slandering Linux, vi users slandering emacs, etc, ad nauseum - people around here have a tendency to either hate what they don't know, or try it once, hate it, and never touch it again, remaining ignorant of how it has improved since.

    6. Re:What's the point? by HiThere · · Score: 2, Insightful

      I will consider "fair treatment" for NET once I'm convinced that it isn't tied by patents or copyrights or other legal restrictions to the implementations that MS chooses to allow.

      OTOH, I'm dubious of Java for similar reasons. But Sun is in less of a position to be abusive.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    7. Re:What's the point? by angel'o'sphere · · Score: 3, Insightful

      Ah, come on, that is anything but not insightfull ...
      What's wrong with making a good compiler that writes directly to machine code?
      a) it wont run on my phone, because no one will port teh compiler
      b) it wont run on my new internet enabled microwave, because no one want to port the compiler
      c) it wont run on my cars electronic, as no one want to port teh compiler
      d) it wont run on the next ESA space probe, the Venus Express, because no one want to port the compiler
      and so on.
      Whats wrong with having an ultimative VM designed and freeing all software developers from all porting issues for one and for ever?
      Whats wrong with having an ultimative VM designed and freeing all hardware developers to be braked out by compatibility issues?
      Come one, code geeks. Make a step into the future!! A 4 GHz Pentium is about 16 million times faster than my Apple ][ which I used 15 years ago. Why should I be burdened with coding habits over 20 years old? I dont want to write 10 to 100 lines of assembelr a day, because it expresses far less in terms of instructions than 10 to 100 lines of C. And I dont want to write 10 to 100 line sof C a day becaue it expresses far less in terms of instructions than 10 to 100 lines o C++ ... and so on for Smalltalk, Python, LISP ...
      We need more different higher level languages and more VMs, as it is easyer to make a new VM than a new processor. We do not need more compilers for the same old languages just because one built a new processor somewhere ... which is wasting 80% of its die (and 80% of its resources, energy put inot its production, waste produced and released into the environment) to be "compatible" with some old 8086 invention.
      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    8. Re:What's the point? by Mike+McTernan · · Score: 5, Insightful

      In terms of compiler optimisation, the higher the language the better. Strict typing and a language that allows the compiler to infer more about the call tree should enable better global optimisation. Lower level languages suffer from the problem that the programmer is explictly describing how to do something, and not what it is trying to do; thus the compiler can just unroll loops and perform peephole optimisations.

      If a language was sufficently high enough that you could describe to the compiler that you were implementing a recursive function (e.g. shell sort), the compiler should then be able to perform fold-unfold optimisation and convert the code into a more efficient tail iterative function. Fans of Haskell and similar languages might recognise this. Some C compilers will convert recursion to iteration where possible, but this is only in simple cases.

      The fact is that today, even as C has reached maturity and as high level as it is, there are still some optimisations that are impossible because of subtleties of the language. For example, multiple pointers may point to the same memory, but depending on how the pointers are assigned, the compiler has no idea that this is the case, and has to follow the code in a literal fashion.

      My personal view is that languages like Java still have a lot to offer. I would like to see a lot more investment in the compiler to perform better optimisations, and would also like to see a compile on install system for Java like C#; if I run an applcation it would atleast be nice if the compiled parts were cached somewhere. This I believe could make good performance gains, and it's interesting that Sun's Server Hotspot VM actually performs more optimisation when compiling a class than the Client VM, however, because of the increase in time taken to load and compile a class, the Client VM omits some optimisation techniques to favour speedier loading. I guess this descision is to make GUI's more responsive and reduce app load times; compile at install would remove this constraint. We should be going to higher level languages, not lower, and concentrate on getting to compiler correct.

      --
      -- Mike
    9. Re:What's the point? by whereiswaldo · · Score: 2, Insightful

      Why didn't they play the "patent card" with Win32? They could have raked in the dough by charging every application developer a licensing fee.
      Because it has anti-trust all over it and would hurt Microsoft more than help it.. The same thing applies to .NET.


      That may be so that antitrust would come into play, but I really doubt that is the reason Microsoft hasn't charged app developers licensing fees for Win32.
      The real value of an operating system is the applications that run on it. Microsoft wants everybody to be writing applications for MS Windows, and not for other operating systems. It is in their best interest not to charge licensing fees to allow people to write on their OS.

      On the other hand, it is not in their best interest to have a lot of people writing applications for Linux and other operating systems (since that adds value to those operating systems). For this reason, I would not be surprised if Microsoft tried to hinder development on other platforms, however that may be accomplished. The bottom line really is, it's up to them what they want to happen with .NET, not you.

  2. GCC by norwoodites · · Score: 4, Insightful

    Sun should have invited us GCC developers also to help out with this because most of us want a way to do Inter modular optimizations but we have the FSF looking over our shoulder on how we implement it, right now (the mainline) you have to compile all the source files at the same time to get IMA to work correctly and you have to say to produce an .o file first.

  3. *SIGH* by mike3k · · Score: 3, Insightful

    No wonder we have to keep making faster CPUs just to maintain the same performance. Is Java on a PIII or G4 any faster than hand-optimized assembly code on a 486 or 68030?

    Soon we'll need a 10 GHz CPU just to be able to boot tomorrow's OS in less than 5 minutes.

  4. Re:XML ? by Anonymous Coward · · Score: 2, Insightful

    Good god. XML is VERY VERY good for what it was designed for: semantic markup of texts. It is not very good as a straightjacket on a programming language.

  5. Need more info... by devphil · · Score: 3, Insightful


    The article is very light on details.

    The low-level software would have some support for existing computer languages. But users would gain maximum benefit when they generated the low-level code based on the new technical computing language Sun has asked IBM and Cray to help define.

    Huh?

    So, how many languages are being proposed here? A new "low-level" one, plus a higher-level "technical computing language" designed to make the most of the lower-level one? Just what's so special about this new low-level language that requires a specific new language to get the "maximum benefit" out of it? I don't have to write in Java to be able to compile to the JVM bytecode. For that matter, I could write in Java and compile to some other assembly language.

    New back-ends ("low-level languages," if I understand the article) are added to GCC all the time. We never needed to add a whole 'nother front-end just for them.

    I suspect that the real situation is less weird, and the journalist got confused... or heck, who knows, maybe they're proposing half a dozen new languages. It's Sun, after all.

    Maybe now I won't have to write my neural network in C for performance :-)

    Odd. I wouldn't have thought you'd need to do that these days anyway.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  6. Reminds me of the old quote... by Waffle+Iron · · Score: 5, Insightful

    "There is no problem in computer science that cannot be solved by adding another layer of indirection."

  7. Re:Buzzword compliance by Tim+C · · Score: 3, Insightful

    Language neutral? Perhaps I'm just skimming your linked-to article too quickly, but this is what leapt out of the page at me:

    "Parrot is strongly related to Perl 6... Perl 6 plans to separate the design of the compiler and the interpreter. This is why we've come up with a subproject, which we've called Parrot that has a certain, limited amount of independence from Perl 6." [emphasis added]

    That certainly doesn't sound like it's been designed with language neutrality in mind. For what it's worth, MS's IL was designed with at least four languages in mind - VB.NET, C#, managed C++ and J#, and a couple of dozen others have been or are being ported to it, including Fortran, Cobol, Haskel, and (iirc) even perl.

    As you say, the article is over two years old, so maybe they've changed their goals since then - but that article at least gives a very strong impression that Parrot is tied intimately in with Perl.

  8. Parrot assembly? by Ars-Fartsica · · Score: 2, Insightful

    I thought an open, peer-reviewed, high performance IL/runtime was exactlywhat Parrot was trying to accomplish.

  9. Re:XML ? by mrogers · · Score: 2, Insightful
    The days that loading binaries from disk into memory was a significant performance hit are long gone...

    Haven't used Mozilla recently, have you?

  10. Why wonder if it will be in XML? by Anonymous Coward · · Score: 1, Insightful

    Are you in management?

    I would imagine that the data for this new IL would be very uniform, like assembly. Unless they plan on adding gobs of metadata, there is absolutly no need for XML. XML is very useful tool, but don't forget that if you give someone a hammer then everything will look like a nail.

    Would you represent an array of bytes using XML just because you can? This IL will most likely be a sequence of well-defined binary tokens. What would it benefit from XML? Maybe programs/functions/classes can have some XML metadata, but the actual sequence of commands will most likely be a chunk of binary data.

    If it was useful/practical to have an IL language specified in XML, then Microsoft would have done so with MSIL already. BTW, don't bother bashing MS about the usefulness and practicality of their products. MS has some brilliant engineers so at least give them some credit for trying to make a decent IL.

  11. Re:Didn't we do this once before? by angel'o'sphere · · Score: 4, Insightful

    I recall a system based on USCD Pascal. I also :-) Except it was slow. Well, on my Apple ][ it was good for the fastest code after Assembler. It only got catched when Z80 coprocessors with CPM and Turbo Pascal came en vouge.
    I did really a lot of programming in UCSD pascal, and long UCSD p-code was the most wide spread operation sytem/virtual machine.
    If you need performance write it in assembler or
    use nicely optimized C.

    Assembler loses all higher level abstractions, like inheritance, interface implementation, class relationships(relations, aggregations and compositions), thread synchronization. The same is true for C, besides that it is on source level not able to express higher level concepts. You might use assembler instead of C.
    How do you optimize assemberl? The operation system, the non existing, but hypotetical VM, the loader, the processor, none of hem can optimzie "assembler". I mean: In Java Byte Code I have all the higher level abstractions of the system inspectable via reflection etc. In assembler I have nothing.
    New bytecodes, able to express more higher level informations e.g. like prarallelization, or even this problem: consider you have an CPU server, consider you have code migrating to youor server, consider you want to trust that code, consider, the "owner" of the code does not want to trust you .... So you need a VM on your CPU server, able to execute encrypted bytecode, so hat you as owner of the CPU dont see what the code is calculating. BUT you, a CPU server, you dont want your system compromized, or the code of other clients compromized by any piece of code.
    Or, consider this, you want byte code as an mobile agent, similar to the scenario above, but it should be allowed to replicate over a GRID, but only under certain restrictions.
    You want to optimize every replica at the VM where it is finally executed, to take an optimum of resources on that point. How do you do that in "assembler"?
    Modern byte codes will be likely even closer to the constructs of the high level languages than byte code is. Resource allocation, object creation, class loading, higher level concepts, like delegation, parallelism, synchronization(on multiple mutexes probably), serialization, distributed(pervasive) computing, probably OODB support build in, probably a light weight EJB like execution environment, probably a 4 level hierarchy of VM, meta container, container and executed code ... probably where the VM is itself only "executed" code inside of a meta cotainer. That means modern VMs probably will extract core VM features like garbage collection and thread scheduling outside of the VM into a library, and every piece of code may "class load" its own garbage collection schema. Consider differnt garbage collectors per thread and not per VM.
    Well, I could continue for a day with improvements ....
    What's the benefit to yet another
    layer of abstraction?


    The benefit is to optimze on that layer of abstraction and then to project/generate/assemble the optimzation down onto the machine layer(or the next lower layer).

    angel'o'sphere

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  12. UCSD Pascal by Detritus · · Score: 3, Insightful

    For its time, UCSD Pascal was an excellent language and operating system. Its main problems were price and politics, not performance or technical issues. Many people, including myself, wrote software for it. The speed penalty of the p-code interpreter was offset by the compactness of p-code, which was important on the memory-constrained PCs of the time. UCSD Pascal, like other alternative operating systems of the period, could not compete with MS-DOS and PC-DOS, which sold for well under $100, on price.

    --
    Mea navis aericumbens anguillis abundat
  13. Grid by AaronGTurner · · Score: 2, Insightful

    There are several issues with regard to current programming techniques and grid computing for HPC. Some include:

    • Legacy code - both user code and 3rd party libraries such as NAG.
    • Matching OSes. Java alleviates this to some extent at the expense of performance . Also not all JVMs are equal. If you can use more resources then slower, less efficient execution isn't such a problem. I.e. a balance between ease of use and code efficiency. Good java code helps!
    • Matching executables and dynamic libraries. Static compilation helps.
    • Matching system capabilities for additional tools, such as MPI, PVM etc
    • Licensing
    • Data replication, transfer, etc

    Java isn't a bad way to offer the capability to run your code on many platforms, but it is easy to write slow code that really doesn't match the HPC speed requirement, although some do use it for HPC. Faster bytecode or JVMs that do ecen better at optimising bytecode would be a help, but I am not sure if there is enough algorithmic information left in the bytecode to allow the best optimisations on all architectures. Perhaps this is where the new initiative is aimed?

    An alternative route is to publish capabilities for processing via web or grid service type mechanisms and then use brokers and discovery services. This would work well for widely used production codes, e.g. charm, fluent, etc

  14. Re:Buzzword compliance by penguin7of9 · · Score: 3, Insightful

    Parrot looks like it will be a nice intermediate language for languages like Python, Perl, and Java. But Parrot lack the right primitives for an intermediate language for high-performance numerical computing.

    Right now the only widely used intermediate language that comes close to being suitable for high-performance numerical computing is Microsoft's CLR (JVM actually still has better implementations, but it lacks important primitives like value classes).

  15. Re:64bit Ints and 128 bits Longs by Anonymous Coward · · Score: 1, Insightful

    Or just enable automatic overflow into arbitrary precision bignums like lisp has had for several decades now...

  16. SUN does not understand High Performance Computing by Anonymous Coward · · Score: 2, Insightful
    Having tried to write HPC apps in Java, there are some very serious problems with the current JVM.
    1. Lack of scientific data types, such as complex numbers.
    2. Lack of multidimensional arrays.
    3. Inept implementation of floating point arithmetic.
    4. Poor choices for defaults, such as array bounds checking and pretty printing ascii I/O.
    5. Onerous penalties for JNI calls and serialization.
    6. Intermindable process for correcting deficiencies with the language.
    SUN has not displayed an understanding of HPC. Adding OpenMP or other "HPC" friendly capabilities to the VM is not going to correct design decisions with remove performance from "High Performance computing.
  17. Re:Next try? by bckrispi · · Score: 5, Insightful

    Java is on the retreat??? Wow, I've been gainfully employed as a Java architect for the past five years; it musta' been a fluke. IBM, Oracle, Novell, et al must not know what their doing by investing millions in building their products around the Java platform. Come to think of it, there are sooo many alternatives to Java for enterprise, server-side computing. Thank you for your insight. I'll turn in my resignation and pick up a .Net book tomorrow.

    --
    Xenon, where's my money? -Borno
  18. Re:Didn't we do this once before? by voodoo1man · · Score: 4, Insightful

    Sure, as long as your class looks just like a C# one. Need multimethods, dynamic class redefinition, method combination, a non-crippled model of multiple inheritance, or maybe even prototypes? You're out of luck, because for this interoperability to work, your classes will either have to be C# classes or you have to make them look like ones, and .NET doesn't give you a Meta Object Protocol to do it.

    --

    In the great CONS chain of life, you can either be the CAR or be in the CDR.

  19. Oh god by mcc · · Score: 2, Insightful

    So now it's considered a defeat or a "retreat" to create a new and improved version of one of your products?

    Hey, I heard that Microsoft just released a new version of their OS and called it "Longhorn". cn I say "Ok, so now that WinXP is on the retreat they try to enter a new area?"

    Personally, I would consider "Hm, Microsoft seems to be catching up to us. Let's make something better than current Java OR .net." to be the most extreme sign of life possible. Honestly I wish they'd done it sooner.

  20. Re:Not unreadable XML () by kurt_cagle · · Score: 2, Insightful

    In all honesty, the XML would be generated at a level where hands would likely never touch it, more likely through a series of transformations. Having written XML generators for C++, C# and Java, I've found that the XML is, by itself, very verbose, because it is fundamentally a meta-level description. You wouldn't write:

    <func optargn="burp">arg1 arg2 arg3 lst</func>

    you'd write

    <function name="foo">
    <param name="arg1" type="xs:string"/>
    <param name="arg2" type="xs:integer"/>
    <param name="arg3" type="cplxOpj"/>
    <param name="arg4" type="xs:string" optional="yes"/>
    <!-- implementation code -->
    </function>

    In all likelihood, the fragment will have been generated via a UML interface or something similar, and this would then be produced through a simple transformation.

    Before objecting to the cost involved, consider that both an XML parser and an XSLT transformation are fairly straightforward finite state machines, and could very easily be dropped into firmware (something that is already beginning to happen). Because of the ubiquity of XML, firmware processing of XML is making more and more sense, and once you have that, it becomes a natural for building ILs and related compiler technology.

  21. Massive parallelism that doesn't suck is hard by Animats · · Score: 2, Insightful
    This is yet another attempt to breathe life into the boondoggle of massively parallel architectures.

    Over the last few decades, there have been many exotic parallel architectures. Dataflow machines, connection machines, vector machines, hypercubes, associative memory machines (remember LINDA?), perfect shuffle machines, random-interconnect machines, networked memory machines, and partially-shared-memory machines have all come and gone. Some have come and gone more than once. None has been successful enough to sell commercially in quantity. Very few of these machines have ever been purchased by any non-government entity.

    There are two ends of the parallelism spectrum - the shared-memory symmetrical multiprocessor, where all memory is shared, and the networked cluster, where no memory is shared. Both are successful and widely used. Everything in between has been a flop.

    Despite decades of failure, people keep coming up with new bad ways to hook CPUs together, and getting government agencies to fund them. It's more a pork program than a way to get real work done.

    By the time one of these big wierdo machines is built, debugged, and programmed, it's outdated. A few years later, people are getting the same job done on desktops. Look at chess. In 1997, it took Deep Blue to beat Kasparov. Kasparov is now losing games to a desktop four-processor IA-32 machine.

    Figuring out more effective ways to use clusters is far more cost effective than putting a National Supercomputer Center in some Congressman's district in Outer Nowhere. There's a whole chain of these tax-funded "National Supercomputer Centers". The "Alabama Supercomputer Center" has ended up as an ISP for the public school system, hosting E-mail accounts and such. It's all pork.

  22. JAVA vs. .NET by digitaltraveller · · Score: 2, Insightful

    Putting corporate politics aside, what would be nice from a technical perspective is an intermediate language that is register-based. Microsoft decided to copy java so thoroughly they also copied java's mistakes by making the .NET runtime a stack machine. Market reality tells us Intel/AMD is not going away anytime soon, it would have been wise to make MSIL fit more nicely into the x86 architecture for performance purposes.

    The mono/.DOTGNU projects are similarly unfathomable. It will be nice to have these tools available to run more bloated GUI's, but if one of these projects really wanted to differentiate itself, that project should instead focus on a C# to native-compiler using gcc's backend and let the other project focus on a compiler-to-MSIL. I guarantee you that project would become the 'winner'.

    1. Re:JAVA vs. .NET by Anonymous Coward · · Score: 1, Insightful

      I doubt that's a significant problem. Remember you're only talking about the structure of the intermediate language here - it's quite possible to do JIT compilation from a stack based lanuage to a register based machine.

      All you need is a compiler clever enough to substitute the use of registers for the most frequently manipulated stack locations in a given code fragment. Java and .NET are both capable of doing this. IANAJCW (JIT Compiler Writer) but I believe that stack based languages are in general a pretty good format for compilers to work with.

      Register based langages are more complex - especially if the number of registers in your intermediate langauage does not match your target hardware. You'd probably want to convert to some other intermediate format (maybe stack based?) so that you could make sense of the register allocations.

  23. Re:Didn't we do this once before? by cakoose · · Score: 4, Insightful

    I think what he's saying is that the syntax isn't the only thing that defines a language. A language's type system probably plays a more important part in defining how the language works.

    With .Net, it may seem like you have a lot of interoperating languages, but they're all basically the same language with different superficial characteristics. VB developers complain about how VB.Net is totally different from previous versions of Visual Basic. It's because they gutted its internals and implanted C#. I wouldn't be able to tell the difference because I see similar syntax, but someone who really knows the language will detect a different core.

    That's not to say that different type systems cannot be emulated. Nice is a language with Java-like syntax but with a much better type system (among other things) and it still runs on an ordinary JVM. However, any interoperability will have to be at the level of the lowest common denominator. If you want to call Nice code from Java, your interface ends up losing or having to give up some power.

    You really can't even share libraries between truely different languages. The STL just doesn't fit into the Java/C#-style type systems (though generics is a step towards accomodating the STL). Perl libraries are also distinct. Imagine dealing with a Haskell-style lazy list in your C# code. It just wont feel right.

  24. Re:Didn't we do this once before? by NickFitz · · Score: 3, Insightful
    You might use assembler instead of C

    Unless you really need to use every cycle, you're better off writing in a high level language and then recoding the critical portions (as identified through thorough profiling) in assembly language. (I speak as one who needed to use every cycle when I was a games programmer in the 80s. I've often thought of doing an all-assembly, no OS required app today, just to see how ludicrously fast it would run.)

    How do you optimize assember?

    You gain extensive experience with the procesor and platform to which you are writing, and you work bloody hard. It also depends on whether you are optimising for space or speed. For example: writing a game for the Amiga, I was told by the customer that it had to run on machines with half a meg of RAM (the entry-level machine). I once spent a whole day seeking a way to save 12 bytes; the first part of the solution involved recoding a routine using a different algorithm. The rewrite saved me 8 of my 12 bytes, and executed in the same number of clock cycles (that was a crucial constraint). I then got the other four bytes by using the interrupt vector for an interrupt I'd disabled. As I was writing to the silicon (not even using any ROM routines), I could get away with this. I wonder what kind of warnings a modern C++ compiler would throw up for this kind of behaviour ;-)

    Assembly language is fun, but life can be too short. I had to spend so much time fitting the above-mentioned game into half a meg that, by the time it came to market, 1Mb was the standard required by all games anyway.

    Assembler loses all higher level abstractions... In assembler I have nothing

    If you design your code well you have plenty. Even when you inline code to save the overhead of call/return, you will be aware of the functional purpose of those 50 instructions considered as a single entity. The same discipline required to write well-constructed code is needed for assembler. It's similar to using an old version of BASIC, with only GOTO and GOSUB for transferring control; although it allows the sloppy thinker to produce spaghetti code, a good coder will adhere to the same abstractions as they would use in a higher level language.

    I'll stop rambling about the past and go and write myself a Forth system now :-)

    (P.S. p-code was extremely cool. When I first got acquainted with Java, it was the first thing I thought of. Plus ca change, plus ca ne change pas...)

    --
    Using HTML in email is like putting sound effects on your phone calls. Just say <strong>no</strong>.
  25. Re:Just one more reason to Free Java by elflord · · Score: 2, Insightful
    Sun allows anyone to use Java for free but nobody can modify the language itself except for Sun. In order for Java to become for Free Software and Gnu/Linux what VB became for Microsoft, Java has to be Freed and put out under the GPL.

    First, you've made the mistake of confusing the language with an implementation of the language. These are different things entirely. I'm not even sure what it would mean for the language itself to be "free". Maybe if it were submitted to a truly open standards group (like ANSI/ISO C and C++) that would make it more "free" but I don't see how that would help. Of course having a good free implementation of the language is important, but that doesn't mean that Sun needs to provide that implementation. gcc is not provided by the original implementors.

    Of course there are free software implementations of java.

    As for releasing java under the GPL -- I don't see it happening. Releasing it under an appropriate open source license would help Suns implementation become more popular, but they wouldn't be able to make money licensing their source code.

  26. Re:*Sigh* how will decimal ruin this. by jared_hanson · · Score: 2, Insightful

    Do you even know what you are talking about anymore?

    Intermediate languages are essentialy a processor independant instruction set. You compile down to this instruction set and then let the virtual machine translate to the native instruction set, hence cross platform. These intermediate languages are binary and have no concept of decimal or hexidecimal.

    --
    -- Fighting mediocrity one bad post at a time.