Slashdot Mirror


Mirah Tries To Make Java Fun With Ruby Syntax

An anonymous reader writes "Java is performant, widely adopted and eminently portable, however, its syntax is largely inherited from C++ along with some of its esoteric unfriendliness. Mirah aims to place a friendly face on Java through the implementation of a syntax whose primary concern is developer friendliness (think Ruby/Python/Groovy), and route of least surprise. The result is a truly cogent alternative syntax delivering readability, expressiveness and some compelling new language features."

295 of 444 comments (clear)

  1. Uh... by msauve · · Score: 1, Insightful

    "Performant" is not "a truly cogent alternative syntax delivering readability, expressiveness and some compelling new language features." It's not even a word.

    --
    "National Security is the chief cause of national insecurity." - Celine's First Law
    1. Re:Uh... by cultiv8 · · Score: 1

      Exactly, you have to have a PhD to make up words.

      --
      sysadmins and parents of newborns get the same amount of sleep.
    2. Re:Uh... by Blakey+Rat · · Score: 1

      You can tell something's aiming for maximum readability when its description uses the word "cogent."

      Note to Slashdot pedants: that's a joke. Please do not define "cogent" in the response because I do not give a crap.

    3. Re:Uh... by Anonymous Coward · · Score: 1

      "Ain't" is a contraction of "are not" or "am not", thus the usage "He ain't" is always incorrect, regardless of your views on the status of the word "ain't" itself.

    4. Re:Uh... by Junior+J.+Junior+III · · Score: 2

      It seems like a perfectly cromulent word to me.

      --
      You see? You see? Your stupid minds! Stupid! Stupid!
    5. Re:Uh... by mooingyak · · Score: 2

      Normally I'd honor that request, but the irony in this particular case got the better of me.

      (from dictionary.reference.com)

      1. convincing or believable by virtue of forcible, clear, or incisive presentation; telling.
      2. to the point; relevant; pertinent.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    6. Re:Uh... by snookums · · Score: 5, Interesting

      "Prepend" isn't a word either, but technical people use it a lot because there is a specific meaning there that needs a word -- to append at the beginning. Strictly speaking you could use "prefix" as a verb, but that word has a connotation of adding a small fixed string to the beginning of one or more items. "Prefix all international phone numbers with a + symbol." "Prepend the header before sending the request."

      Similarly there is a need for a concise expression meaning "of adequate performance" without stretching to "high-performance" (especially since High Performance Computing has a specific meaning of its own). Unfortunately, in the modern language of hyperbole, terms like "adequate" and "acceptable" have negative connotations along the lines of "not really good enough but better than nothing". So, we, as an industry, have invented a jargon word "performant" to express the idea that a thing has a level of performance sufficient that you don't need to worry about it and can look for optimisations elsewhere in your system.

      --
      Be careful. People in masks cannot be trusted.
    7. Re:Uh... by larry+bagina · · Score: 1

      None of those definitions apply to Java.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    8. Re:Uh... by severoon · · Score: 1

      Nothing bothers me as much as the incorrect usage (well, what I consider incorrect usage) of works like biweekly, bimonthly, etc, to meet twice per X. These words mean every two X, not twice per.

      Unfortunately, years back the dictionary added these incorrect and ambiguous usages so that now these words can "officially" mean either twice per, or every two. Two conflicting definitions makes them useless. (For those of you who may be wondering, the proper way to say twice per X is with the prefix semi-, as in semiweekly, semimonthly, etc.)

      The confusion arises from the fact that half-ness and two-ness are obviously related; does bisect mean "cut in two" or "divide in half"? If you consider other bi- words, it quickly becomes clear that the intended meaning has to do with two-ness. Bicycles exist along with unicycles and tricycles, and the comparison is clear...and I don't even want to know what you think bisexuality is if an interpretation based on half-ness makes sense to you...

      --
      but have you considered the following argument: shut up.
    9. Re:Uh... by BluBrick · · Score: 1

      "Performant" is not even a word.

      Well, "performant" is a word in French and in Dutch, and it exactly means what you'd think it means.

      Are you so stupid that I really need to remind you that the article was not written in either French or Dutch? It was written in English. I'll accept that perhaps the author is not well-versed in English, and makes a few gramatical errors. But only a fool would suggest that because a similar word exists in another language, English speakers might understand it. For a very simple example, the German word "doktor" does not really mean what most English speakers would think.

      --
      Ahh - My eye!
      The doctor said I'm not supposed to get Slashdot in it!
    10. Re:Uh... by Haeleth · · Score: 2

      Nothing bothers me as much as the incorrect usage [...] of works like biweekly, bimonthly, etc

      Really? You find that more offensive than genocide, pedophilia, and split infinitives put together?

      Unfortunately, years back the dictionary added these incorrect and ambiguous usages so that now these words can "officially" mean either twice per, or every two.

      I don't think you know how dictionaries work. There are many English dictionaries, none of which is "the" dictionary. The presence of a word or meaning in a dictionary does not make it "official", nor does its absence necessarily mean it isn't a "real" word. It just means that the word or meaning has or has not been spotted by the dictionary's compilers and deemed sufficiently widely used and well attested to be worth documenting.

      Two conflicting definitions makes them useless.

      Many words have two conflicting meanings. Somehow our language gets by just fine in a state where "hot" can mean "cool" and "bad" can mean "good".

      And it would make the dictionaries less useful if they omitted one of the definitions. The purpose of a dictionary is not to define language but to describe it, to help you understand what other people mean. If a dictionary did not give both definitions, when someone tried to find out what a sentence containing the word "bimonthly" meant, half the time they would get a clear, unambiguous, and completely wrong answer. It's far more helpful for a dictionary to point out that the word is ambiguous than to pretend it isn't when it is!

      For those of you who may be wondering, the proper way to say twice per X is with the prefix semi-

      That's also probably a bad idea; semi can also be a vague prefix meaning "not quite". A lot of people, including myself, would naturally interpret "semimonthly" to mean "happens once a month, but not every month".

      The best, most easily comprehensible, and only unambiguous way to say "twice per X" is to use more than one word: try "twice per X" or "twice a(n) X". Similarly, for "every two Xes", try "every two Xes" or "every other X".

    11. Re:Uh... by Capt.+Skinny · · Score: 3, Informative

      Hate to tell ya, but once the dictionary adds a definition to a word, that definition is no longer incorrect.

      Dictionary definitions reflect modern and changing language usage by the public. It's like a democratically elected office for words: members of the general public choose words based on misinformation, stubbornness, and the way their parents, friends and teachers choose their words. Dictionary editors are like the electoral college: they look at what the general public has chosen to use for words and definitions, then choose for themselves which of those make it into the dictionary. Not everyone will agree on the new word or definition, but in a few generations it will be history and no one will care. When was the last time you heard anyone bitch about Grover Cleavland being elected?

    12. Re:Uh... by Rary · · Score: 1

      "Prepend" isn't a word either, but technical people use it a lot because there is a specific meaning there that needs a word -- to append at the beginning.

      "Prepone" is a similar one, meaning "to move a scheduled date forward" (as opposed to "postpone", where the date is moved back). It's commonly used in India among English speakers, but most North American English speakers I know have never heard it.

      --

      "You cannot simultaneously prevent and prepare for war." -- Albert Einstein

    13. Re:Uh... by ian_from_brisbane · · Score: 2

      I don't even want to know what you think bisexuality is if an interpretation based on half-ness makes sense to you...

      Bisexuality is being half homosexual and half heterosexual.

      I know a guy who is 'semisexual', but he's taking tablets for that :)

      But seriously I agree with you on 'bi' vs 'semi'.

    14. Re:Uh... by oliverthered · · Score: 1

      load up on gun and tell your friend it's fun to loose and to prepend.

      or do you mean the writing a letter version of here's one I made earlier?

      append (to add onto) you can append the request to the header in a stream... of are we talking string concatenation..

      you would encapsulate the http request.

      prefix postfix suffix affix

      affix would be at either edge/face, hopefully no one would be dumb enough to assume affix e8 was a grave thing to do.
      suffix on the end
      prefix before
      postfix would be to release some crappy PDF viewer software that's buggy then spend the next god knows how many years adding bloat and bugs.

      I think full performance is the current technical term; Taken from full speed usb vs hi-speed usb.

      performant would be in good working order. or O(good)

      --
      thank God the internet isn't a human right.
    15. Re:Uh... by angel'o'sphere · · Score: 2

      Well, if performant is not a word ... then I simply don't get it.

      I use performant since I speak/write english, that is perhaps 25 years. What word would you use instead if you want to say this is more performant than that? Or if you simply want to say "a" is performant?

      Perhaps we europeans "invented" that word by simply assuming it is existing in english ... as your parent pointed out, the word is not only French and Dutch, it is also German.

      Best Regards

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    16. Re:Uh... by aiht · · Score: 1

      load up on gun and tell your friend it's fun to loose and to prepend.

      Well played... I do believe Mr. Cobain just turned in his grave.

    17. Re:Uh... by tnk1 · · Score: 1

      Who exactly gives anyone the power to make up new words anyway?

      The Queen does. And she's pretty pissed at you right now for messing with her English.

    18. Re:Uh... by gandhi_2 · · Score: 1

      we usually say "bump-up" the meeting.

      we only use prepone to postpone meetings that haven't even been planned yet.

    19. Re:Uh... by Sir_Lewk · · Score: 1

      The queen can lick my sweaty balls.

      signed, the rest of the english speaking world

      --
      "linux is just DOS with a UNIX like syntax" -- Galactic Dominator (944134)
    20. Re:Uh... by germansausage · · Score: 1

      Exactly correct. Once enough dumbfucks use the word "reactionary" to mean "over reacting" the original meaning of "extreme conservative" will be lost. Some perfectly splendid words have the misfortune to sound like they ought to mean something they don't. Enormity has already lost its original meaning.Tell me, is the English language better off or worse off for it?

    21. Re:Uh... by RzUpAnmsCwrds · · Score: 1

      "Performant" is not "a truly cogent alternative syntax delivering readability, expressiveness and some compelling new language features." It's not even a word.

      If you believe in descriptive linguistics, "performant" is absolutely a word. And as someone who writes software that actually has to deal with human language, prescriptive linguistics means that my system doesn't work. Which means that I don't get to write cool papers.

      In English, no one person or organization has the power to decide what is and is not a valid word. You can either deal with that or you can pretend that complaining will change things. It won't.

    22. Re:Uh... by gripped · · Score: 1

      Language evolves. The use of "Ain't" in English is far more complex than thou attest.

    23. Re:Uh... by omfgnosis · · Score: 2

      This is just ridiculous. "Ain't" is a word culled from common usage, and there is no way formalizing it will overcome its common usage meaning, which is [negation of] ["to be" conjugation]. The conjugation of "ain't" to any pronoun is "ain't". And if you lived anywhere that "ain't" is actually used in common speech, you would know this. "He ain't" is perfectly valid, if "ain't" is valid.

      Your explanation is reductionist, and exactly what would be expected from someone who wants English to be a "living language" but still subject to dead rules. But "ain't" is a perfect example of how languages evolve, discarding or sidestepping rules so that even a "contraction" might have none of a contraction's characteristics (which it ain't got; it's neither a combination nor elision of the original words, whichever conjugation of "to be" you pick).

      Now go'onan'gitcha some pie and quitcherbitchin'.

    24. Re:Uh... by omfgnosis · · Score: 1

      she's pretty pissed

      Well then she should lay off the sauce.

    25. Re:Uh... by omfgnosis · · Score: 1

      Bisexuality is being half homosexual and half heterosexual.

      Actually, it's not. It's a misnomer at least twice over. Strictly, it's being anything other than "straight" or "gay" but including attraction to both the "opposite sex" and the "same sex", anywhere on the "Kinsey scale" (0.0...1 through 5.9...9) except 0 or 6. In common usage, it is also commonly used for people who are not "straight", not "gay" and also have attractions not described on the "Kinsey scale" (including attractions to people who are intersex and/or genderqueer, as well as attractions which entirely disregard sex or gender).

    26. Re:Uh... by tzot · · Score: 1

      What a hypocrite!

      Were you this negative about the Queen before she made you a Sir?

      --
      I speak England very best
    27. Re:Uh... by squizzar · · Score: 1

      Well, in that case, sir, I hope you will not object if I also offer the doctor my most enthusiastic contrafibularities

    28. Re:Uh... by silanea · · Score: 1

      [...] I don't think you know how dictionaries work. [...]

      The PP does not know the difference between a descriptive lexicon, which he/she wrongly criticises, and a prescriptive lexicon, which he/she should rather have bought but which indeed comes with its own share of issues.

      --
      Rudolf Hess edited Mein Kampf. He was the very first grammar nazi.
    29. Re:Uh... by pthisis · · Score: 1

      "Prepend" isn't a word either

      There is a word "prepend" in both the OED and Merriam Webster's.

      there is a specific meaning there that needs a word -- to append at the beginning

      That's not what it means, though. It means premeditate--e.g. "he planned her murder with malice prepended". It's kind of a shame that computer science people co-opted an existing word rather than creating a new one, but it's not as though "prepend" in the dictionary sense was all that common.

      --
      rage, rage against the dying of the light
    30. Re:Uh... by msauve · · Score: 1

      Ladzyfirth. That means you're full of acedemic bullshit.

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    31. Re:Uh... by MichaelSmith · · Score: 1

      I use performant since I speak/write english, that is perhaps 25 years

      What 25 years? You don't come over as an authority on English. That said, performant works as an english word for me.

    32. Re:Uh... by Brian+Feldman · · Score: 1

      Awesome post. That makes perfect sense to me as a (presumably) fellow developer.

      --
      Brian Fundakowski Feldman
    33. Re:Uh... by AlecC · · Score: 1

      It is a word - to me. I read the summary and received what I believed to be the author's meaning without a stutter in my reading. Therefore it achieved what words are meant to do - carry meaning. It may be an ugly neologism, but you can only fight that by using what are, in your opinion, the correct alternatives, and have them carry the day by their superior usefulness.

      --
      Consciousness is an illusion caused by an excess of self consciousness.
    34. Re:Uh... by domatic · · Score: 1

      "Performant" is a perfectly cromulent word.

    35. Re:Uh... by menkhaura · · Score: 1

      IBYM "than he/she/it attesteth" or "than thou attestest"

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    36. Re:Uh... by frank_adrian314159 · · Score: 1

      Tell me, is the English language better off or worse off for it?

      Yes. A living language is usually better than a dead one. Ask the ancient Romans.

      --
      That is all.
    37. Re:Uh... by The+End+Of+Days · · Score: 1

      The English language has no feelings, so your question is meaningless.

    38. Re:Uh... by DaVince21 · · Score: 1

      Did your intended message get through? Then it doesn't matter. "Performant" raises questions about what the author means, however.

      --
      I am not devoid of humor.
  2. Re:Performant is not a word. by lennier1 · · Score: 1

    The only time I've seen that wording was in German.

  3. Proof Reading? by Anonymous Coward · · Score: 1

    "So if your [sic] finding you are loosing [sic] your marbles with the geological pace of Java production I implore you to give it a go."

    At least this implies more time was spent on their development than their website.

  4. Looks almost as nice as JRuby, but not quite. by ron_ivi · · Score: 2

    If someone wants to invent a language, why make it so very very close to an existing popular language?

    1. Re:Looks almost as nice as JRuby, but not quite. by sproketboy · · Score: 1

      Agreed. The continuous wheel reinventing that goes on is so tiresome.

    2. Re:Looks almost as nice as JRuby, but not quite. by SanityInAnarchy · · Score: 3, Insightful

      Because it compiles down to native Java, without any of the JRuby overhead.

      --
      Don't thank God, thank a doctor!
    3. Re:Looks almost as nice as JRuby, but not quite. by mthamil · · Score: 1

      Look at Java and C#, it worked well for them.

    4. Re:Looks almost as nice as JRuby, but not quite. by Headius · · Score: 1

      JRuby already does compile Ruby to JVM bytecode. Mirah is an entirely separate language that's statically typed, but borrows some syntax from Ruby.

    5. Re:Looks almost as nice as JRuby, but not quite. by RegularFry · · Score: 1

      Considering that the same person is responsible for both, I think you'd have to ask him, but I suspect that the lessons learnt from one informed the other.

      --
      Reality is the ultimate Rorschach.
    6. Re:Looks almost as nice as JRuby, but not quite. by SanityInAnarchy · · Score: 1

      I doubt such an animal would ever happen.

      It seems like people are using Mirah where they really need something that's effectively native Java, but they can't stand looking at the ugliness that is the Java language. I believe the original use case is making the JRuby code itself (most of which is written in Ruby) easier to work with, particularly for Rubyists.

      Another good use case is for appengine-jruby -- Google App Engine may arbitrarily spin up or spin down instances of your app on demand, so startup time is essential -- basically, any given page load might boot your app. JRuby adds a few seconds to that start time. So you write your app in something like Rails or Sinatra, but maybe you port the homepage over to Mirah.

      Besides, Rails already runs on JRuby. I'd guess most people who are using Rails don't really care about the JRuby overhead for their Rails apps, so they'd mainly be using Mirah, again, anywhere they would otherwise have to write raw Java -- maybe you want to optimize something by writing it in Java, but not C, since Java is easier (and doubly so with Mirah), and JRuby calling Java is probably better than JNI.

      Oh, and whoosh, I know, but I can't resist answering a good question even if it was asked sarcastically.

      --
      Don't thank God, thank a doctor!
    7. Re:Looks almost as nice as JRuby, but not quite. by robbrit · · Score: 1

      The guy who's making Mirah is the guy who made JRuby. I'm assuming he's taking a lot of the same code-base for this one so a lot of the work is already done!

      Also I think he did this because he wants a few things that aren't part of Ruby:
      1) Static typing via type-inference
      2) No jruby.jar hanging around everywhere. This just compiles straight to bytecode using the regular Java runtime.

      From what I've heard from the guy, he really likes most of Ruby (the syntax, blocks, mixins) but there are a few things he'd like to change. Mirah appears to be his project to do that.

  5. Why Mirah instead of Scala, Clojure, Groovy, JRuby by Ichoran · · Score: 5, Insightful

    Mirah looks to me so far like a waste of effort. It has somewhat nice syntax, granted, but if you really want to use Ruby syntax with the JVM, there already is something that does that: JRuby.

    If you just want simplified syntax, Groovy is just as simple and looks more familiar to Java programmers.

    If you want simplified syntax and powerful new programming tricks, Scala and Clojure do this far better. If you ignore the Scala libraries and half its features, you get everything that Mirah was designed to do.

    The language designers should do a better job explaining why this is worth paying attention to.

  6. Groovy? by zmughal · · Score: 1

    How is this any different than using Groovy or even JRuby?

    1. Re:Groovy? by davester666 · · Score: 2

      It's something new. It welds the hot flash-in-the-pan of today with the hot flash-in-the-pan of yesteryear.

      --
      Sleep your way to a whiter smile...date a dentist!
  7. Uh... isnt that Groovy? by Foofoobar · · Score: 3, Interesting

    Doesn't Groovy and Grails already do that? Speaking as a LAMP developer who uses Groovy/grails, I figured that WAS Java's answer cause I'm having a blast and dumping PHP like a hot potato.

    --
    This is my sig. There are many like it but this one is mine.
    1. Re:Uh... isnt that Groovy? by glwtta · · Score: 1

      Doesn't Groovy and Grails already do that?

      They are not all that similar; for one thing, Groovy is dynamically typed and Mirah is static (with possible dynamic extensions coming in the future).

      --
      sic transit gloria mundi
    2. Re:Uh... isnt that Groovy? by kaffiene · · Score: 1

      I guess the difference is that Mirah is fast. It's just a thin veneer over Java as far as I can tell.

  8. What about Jython? by mickwd · · Score: 2

    If the goal is "to place a friendly face on Java through the implementation of a syntax whose primary concern is developer friendliness (think Ruby/Python/Groovy)", then perhaps the "route of least surprise" would be to offer some assistance to Jython (python running on Java), as it's been around for over a decade already, but seems to have been a bit neglected in the past couple of years.

    I'm pretty sure there is an existing implementation of Ruby, too.

    1. Re:What about Jython? by Foofoobar · · Score: 1

      Jython will grow organically if people like it. If they dont they it won't. Easily solved.

      --
      This is my sig. There are many like it but this one is mine.
    2. Re:What about Jython? by lennier1 · · Score: 1

      Reminds me of when they ported ColdFusion to Java because a) they wanted to reach more platforms and b) J2EE was such a pain in the ass.

    3. Re:What about Jython? by AusIV · · Score: 1

      My understanding is that Mirah is designed to compile down to Java byte code, while Jython runs a Python interpreter on top of the JVM. There are a number of philosophical and technical differences between these paradigms.

    4. Re:What about Jython? by SanityInAnarchy · · Score: 1

      What's more, JRuby exists, and Mirah doesn't compete with JRuby. In fact, it seems one of the motivations for its creation was to make it easier to hack on JRuby itself, which is, after all, quite a lot of Java code.

      --
      Don't thank God, thank a doctor!
    5. Re:What about Jython? by Unequivocal · · Score: 1

      Great point. I hate digging into Java code, but if I could write java libs without the painful syntax I would be more inclined. Now that you point it out, I suspect the JRuby guys are in the same boat. They'd be more likely to contribute to Java libs if they could write in syntax less like java and more like ruby. This seems like a pretty big win for JRuby also b/c it might unleash a horde of ruby devs into javaland (well, hopefully only the good ones).

    6. Re:What about Jython? by SanityInAnarchy · · Score: 1

      I don't know that this matters so much, since we could always ship Ruby code with a JRuby dependency. In fact, I'm fairly sure there are tools for packaging a JRuby app into a war file, so it shouldn't be too hard to make a JRuby jar.

      It's more for the places where you need Java, and you can't use JRuby. I was first introduced to it with appengine-jruby, which lets you run Rack apps (including Rails apps!) on Google App Engine. Awesome, but App Engine has a quirk where unless you're paying for a reserved instance (and maybe sometimes even then), Google will automatically scale your app up and down by spinning up new instances of it on demand.

      This means any given page load might boot your app, and JRuby adds seconds to that. Mirah, on the other hand, runs just like Java, but you can actually convert simple Rails controllers almost directly, and some templates even work -- so you can take the pages that you care the most about, or at least the ones that are going to be hit first, and convert those to Mirah as needed, while leaving the rest of your app in JRuby.

      Another example might be something like Rawr. I'm not sure how it's done now -- I think they just have some Java code. It's not much, but getting rid of that and just using Ruby would be nice.

      Still, I can't think of ever wanting to use Mirah instead of JRuby, only being forced to do so. After all, JRuby already gives me the part of this equation I want -- I can use pretty much any Java library in JRuby, and it pretty much works exactly the way I'd expect, I almost never have to look up how to do something. I just pretend it does what you'd think it would do -- I even sort of pretend it was written in Ruby -- and it just works.

      --
      Don't thank God, thank a doctor!
    7. Re:What about Jython? by DragonWriter · · Score: 1

      I'm pretty sure there is an existing implementation of Ruby, too.

      Charles Nutter, the creator and lead maintainer of JRuby, is also one of the creators of Mirah. I'm pretty sure he is aware that JRuby exists. What Mirah offers compared to Java is the clean, expressive syntax that lets you get to the point. What Mirah offers compared to JRuby and other JVM dynamic languages is static typing, direct callability from Java (since Mirah classes are Java classes), better performance, and (closely related to the preceding point) not dragging around a big runtime library.

  9. Re:Performant is not a word. by Heliologue · · Score: 2

    Actually, yes it is. It's been used in computing at least as far back as 1977.

  10. Guess it depends on how old you are by Sabalon · · Score: 3, Insightful

    well...what languages you started with. Looking at that, the c++ based code is perfectly readable, but I can't make heads or tails of the other. In fact, reminds me of perl and objectiveC - just start hitting all those shifted characters - they each signify something special.

    Am waiting for :
    Draw Pacman;
    Draw Ghosts;
    Ghosts chase pacman;
    Pacman follows joystick movement;

    1. Re:Guess it depends on how old you are by zippthorne · · Score: 1

      Try applescript.

      What you want is a version of it that has enough performance and capability to be a full application language, which the current implementation patently does not.

      --
      Can you be Even More Awesome?!
    2. Re:Guess it depends on how old you are by wood_dude · · Score: 1

      Your Pacman script has a certain Forth'ness about it. :)

    3. Re:Guess it depends on how old you are by drb226 · · Score: 1

      game pacman ghosts = do draw pacman
      ________________________draw ghosts
      ________________________let ghosts' = ghosts `chase` pacman
      ________________________let pacman' = pacman `follows` joystick_movement
      ________________________game ghosts' pacman'

      There's some Haskell for ya. Now go define the initial pacman and ghosts, and the methods draw, chase, and follows

    4. Re:Guess it depends on how old you are by phantomfive · · Score: 3, Insightful

      Really? I mean, you're missing such basic things as do you want the ghosts to catch Pacman every time, or do you want him to be able to escape? Do you want Pacman to keep moving after the joystick is returned to center, or do you want him to stop? The problem with every simplified language I've seen so far, is that you still need to be able to express what you want precisely, and that adds complexity to your language. You have to figure out what you want the computer to do in the corner cases.

      Unless you have AI behind your language, but then it's not really the same.

      --
      "First they came for the slanderers and i said nothing."
    5. Re:Guess it depends on how old you are by dkleinsc · · Score: 2

      In other words, the real problem of programming is usually not the language.

      The real problem tends to be that computers have to get information that's far more specific than humans do. For instance, pretend you're moving to a new apartment, and you tell your buddies who are helping you to "put the dresser over there in that corner." Simple, clear, instruction, right? But your buddies will figure out for you that they can't put it right up against the wall because there's a radiator there, that the drawers need to be facing away from the wall, that the placement of this window means that it makes more sense for the drawers to be facing west rather than north, etc etc. Even a 12-year-old with cerebral palsy is far better at understanding a situation and adapting to new information than the best computer can manage right now.

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    6. Re:Guess it depends on how old you are by heathen_01 · · Score: 2

      Corner cases are no longer important. They can be filled in post release with patches.

    7. Re:Guess it depends on how old you are by swilver · · Score: 1

      Even AI won't help. Give 10 programmers the above instructions and you'll get 10 different results, with subtle and not so subtle differences.

    8. Re:Guess it depends on how old you are by phantomfive · · Score: 1

      good point

      --
      "First they came for the slanderers and i said nothing."
  11. Re:Performant is not a word. by Progman3K · · Score: 1

    It IS in French.
    I agree it grates the ear in English though...

    --
    I don't know the meaning of the word 'don't' - J
  12. Ruby syntax is fun? by shish · · Score: 2, Interesting

    Is it just me who finds ruby even more cryptic than perl? Reading why's poignant guide, I loved the presentation of the book, and really wanted to love the language, but every time he said "read this code out loud, it makes perfect sense, doesn't it?" all I could think of was "you, my dear little cartoon foxy friend, have clearly been snorting too much of the good white stuff. I'm going back to python now" :-(

    --
    I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
    1. Re:Ruby syntax is fun? by mooingyak · · Score: 1

      I strongly prefer ruby to perl (despite that I current make my living doing perl dev), but I couldn't stand Why's Poignant Guide. Found the Dave Thomas book vastly better.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    2. Re:Ruby syntax is fun? by Nimey · · Score: 1

      More to the point, this Ruby-style syntax is a hell of a lot easier to write and understand than Java's verbosity.

      --
      Hail Eris, full of mischief...

      E pluribus sanguinem
    3. Re:Ruby syntax is fun? by JAlexoi · · Score: 1

      Unless you redefine nil...

    4. Re:Ruby syntax is fun? by fbjon · · Score: 1

      Strangely, I find it harder to understand but easier to write... I think it's all down to experience anyway.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    5. Re:Ruby syntax is fun? by TheTyrannyOfForcedRe · · Score: 1

      Not me. I love Ruby. I hate Perl. I had to support a large Perl codebase at a former job. It was a nightmare.

      --
      "Liechtenstein is the world's largest producer of sausage casings, potassium storage units, and false teeth."
    6. Re:Ruby syntax is fun? by OrigamiMarie · · Score: 1

      Wow. I had never seen that book before. At some point during the third page, I decided that it was exactly like Ira Glass had decide to write a Ruby guide.

    7. Re:Ruby syntax is fun? by cronius · · Score: 3, Insightful

      I don't remember where I read it, but I read somewhere that Ruby works as a "programming skill amplifier." As in, if you're a great programmer, Ruby allows you to write beautiful code, but if you're a poor programmer, Ruby will allow you to write the most hideous thing that your processor has ever seen.

      And I agree. For better or worse, I think it's a testimony to the power that lies in the language.

      --
      Life is Reality
    8. Re:Ruby syntax is fun? by trbs · · Score: 1

      That's my thoughts exactly :) I love the idea of ruby, much like I love the idea of purely functional programming languages or highly prototyping language like Javascript. (specially modern JS from Mozilla not the outdated stuff you find in many browsers) But the syntax of some of these languages are just.... horrid... why would anybody want to write code using cryptic symbols in 2011 ? This is where languages like Python have a big upper hand. It's easy to write, it has a strong focus on being well written and understandable (even years after writing the code) and very very fast. Besides that.. it allows you to very easily interact with other languages like c / c++ or Fortran.

    9. Re:Ruby syntax is fun? by e70838 · · Score: 1

      I am a Perl lover. I think that Perl allows to write code that matches the way you think about the problem to be solved.
      You have a lot of freedom in code writing, as a result, the coding style depend a lot of the personality of the previous developer.
      The developer of your Perl codebase was perhaps a moron, or had a way to think too different than yours.
      This freedom allows to write very bad code. I think that Ruby is very similar to Perl concerning freedom, you may also encounter very badly written code in Ruby.

    10. Re:Ruby syntax is fun? by cerberusss · · Score: 1

      Found the Dave Thomas book vastly better.

      That's because Dave Thomas is actually a god, in a two-headed pantheon with Andy Hunt. Of course any books by either of them are better than anything else, edible or non-edible.

      I have my own little shrine for them in the living room, with the Pragmatic Programmer book in the back.

      --
      8 of 13 people found this answer helpful. Did you?
    11. Re:Ruby syntax is fun? by AvitarX · · Score: 1

      Does that make it the new perl?
      Easy to write, hard to read?

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    12. Re:Ruby syntax is fun? by Unequivocal · · Score: 1

      I also think it's the book not the language. I prefer Ruby to Perl and Python, by a lot, in terms of writing code (running code is another story - for that I prefer Lua!).

      The ruby language is by far the most expressive and intuitive syntax I've ever used. I'd encourage you to give it another try, and for example use Dave Thomas' Prag Prog book not _why's. (My girlfriend loved reading _why's book but I don't think she ever got a strong handle on the ruby internals, which isn't what that book was for - she just liked reading it!).

    13. Re:Ruby syntax is fun? by Unequivocal · · Score: 1

      Yeah so true - it's the interpreted language family's version of assembler!

      You can dig yourself into such a deep bunch of dog doo in Ruby if you want.

    14. Re:Ruby syntax is fun? by Unequivocal · · Score: 1

      That's a good point. But I'd suggest that in my experience there are lot of perl libs that I simply can't read at all, and most ruby libs I dig into are "figureoutable." Probably that's a cultural thing -- perl devs often know the system so well they write hard to read code at the expense of compactness and internal elegance. Internal elegance in ruby (by culture) often values readability.

      I'll be curious what you think!

    15. Re:Ruby syntax is fun? by e70838 · · Score: 1

      Yes, I fully agree that some cpan libs are very difficult to understand. I think that the authors of these modules try to demonstrate their very high level of expertise in Perl by optimizing their code using the most advanced features.
      It is not "normal programming", it is somewhere between art and snobism.
      In ruby, you have less incentive for tricky constructions and people use generally longer identifiers that help understanding the intent.

  13. I prefer C++ syntax by Jorl17 · · Score: 3, Interesting

    Yes, that's right, I prefer C++ syntax and coding style. Efficient, does exactly what I tell it to and makes sense in my head. All this Python/Ruby etc just makes my head blow up. I often code in those languages and I see them as very useful (and easy to work with), but I still prefer C++ syntax.

    --
    Have you heard about SoylentNews?
    1. Re:I prefer C++ syntax by Nimey · · Score: 1

      I prefer C++ syntax myself, but Java's take on it is /shit/. Between the two, I'll take Bjarne's language any day.

      --
      Hail Eris, full of mischief...

      E pluribus sanguinem
    2. Re:I prefer C++ syntax by Nimey · · Score: 1

      The verbosity, mostly. It's like C++ and Cobol had a love child.

      --
      Hail Eris, full of mischief...

      E pluribus sanguinem
    3. Re:I prefer C++ syntax by gangien · · Score: 2

      how is it a bad thing? i can look at code i'm completely unfamiliar with and get a good idea of what's going on... much harder to do without it..

    4. Re:I prefer C++ syntax by Brian+Feldman · · Score: 1

      Are you kidding me by comparing C++ and Java? They're not even similar languages! VM versus machine code, GC versus low-level memory, single-inheritance and interfaces and supercalls and generics versus multiple-inheritance and templates and explicit ancestor calls.

      Yes, the syntax is also not the same. Poignant.

      --
      Brian Fundakowski Feldman
    5. Re:I prefer C++ syntax by jonescb · · Score: 1

      I agree. The first language I learned was C, and I still like the syntax. The number one reason why I chose to learn Python/Django over Ruby on Rails is that Python's syntax is much more like C and it was easier for me to learn. You can almost write Python just like C without types.

  14. Re:Performant is not a word. by atheistmonk · · Score: 1

    It's a perfectly cromulent word.

  15. Re:Performant is not a word. by WrongSizeGlass · · Score: 1

    It just isn't.

    Performant is a perfectly cromulent word.

  16. Dumbing down programming by amightywind · · Score: 1, Troll

    Java is C++ for dummies. Mirah is Java for morons. It is a shame the programming world has forgotten about Scheme. The programming state of the art hasn't improved in 20 years and isn't going anywhere. Python is vile.

    --
    an ill wind that blows no good
    1. Re:Dumbing down programming by lennier1 · · Score: 1

      Java? Do you mean the language itself or the modern frameworks which have buried the language under a ton of various XML files?

    2. Re:Dumbing down programming by IBitOBear · · Score: 3, Insightful

      He did share them... stop trying to "solve" the problem of programmers needing to know how to program by writing languages that try to cover for dummies. We have plenty of languages that dummies can use safely. The problem has been solved.

      Computer languages are like power tools. They can be "so safe, but no safer" before they start losing function. They just _don't_ make a band saw that any 12 year old can use in complete safety. Same for joiner, circular saw, planer, or just good old knife.

      Tools are _not_ supposed to be _safe_. They are only supposed to be "no more dangerous than necessary". We make cheap plastic toy versions of tools for kids to practice with, but eventually they either go away or they have to learn to use the real thing.

      I will believe in these "for dummies" versions of language the day a contractor shows up at my house with a Fischer-Price nail gun that will actually hold up sheet rock but is safe enough to hand to my neighbor's 5 year old.

      The "clever new idea" is that people don't _deserve_ to operate in fields where they are unwilling or unable to learn the skills required. This is just as true of my profession (programming etc) is it is true that my programming acumen doesn't mean that I should be able to walk into CERN and have a go at the LHC even though I know squat about high-energy physics.

      Read the signature line (v v v v v v v v), it is a truism.

      --
      Innocent people shouldn't be forced to pay for inferior software development.
      --"Code Complete" Microsoft Press
    3. Re:Dumbing down programming by iluvcapra · · Score: 1

      I dunno, I disagree with where you're going with this. When you say some people don't "deserve" programming tools that meet their skills, that sounds a lot like saying people don't deserve to paint unless they go to art school, or turntablism isn't "real" music and the people that make hiphop music are beneath recognition because they don't understand the rules of "real" music.

      I'm a sound designer by profession, I've never received formal education in development-- it's taken about 10 years for me to get enough C down to write an RPN calculator for timecode. I started out with filemaker scripts, and then Ruby scripts, and that's still what I use most of the time. The problem is I don't have the money to pay a developer do make my tools, and available tools, particularly open source ones, are overengineered and unusable by nonprogrammers. I have very specific ideas and tools, and devs just don't understand my work, they don't have my 10 years of experience with sound effects and filmmaking.

      Ultimately, the more people that can code, the better code will be. We shouldn't be shutting people or because they don't understand arbitrary rules about wether the "to" or "from" comes first on the arg list.

      --
      Don't blame me, I voted for Baltar.
    4. Re:Dumbing down programming by Anonymous Coward · · Score: 1

      Physical tools aren't turning complete, so the metaphor breaks down when comparing toy tools to "toy" languages. And how exactly do you decide what is a toy language and what isn't? Is C a toy language compared to assembly? Smalltalk compared to C++? Scheme a toy compared to CL? Do you base it on how far abstracted the language is from the bare metal? Whether it's static or dynamic? Compiled, interpreted or intermediate? Whether it users curly braces, begin-ends, parens or white space? Multi-paradigm or single?

    5. Re:Dumbing down programming by glwtta · · Score: 1

      What on Earth are you ranting about? Who said anything about "safety"?

      For the last 15 years or so, the main goal in language design has been programmer productivity. That whole "we shouldn't be using systems programming languages for application development" thing was solved a long time ago. Because it was a stupid argument to begin with.

      Not to mention that Mirah has the exact same feature set as Java, so I'm not really sure what's being dumbed-down here.

      --
      sic transit gloria mundi
    6. Re:Dumbing down programming by sco08y · · Score: 1

      All that boilerplate is directly because Java has no templates. (I like Java's generics, they did generics right, but generics aren't templates.) And C++ templates could be awesome, but they are so painful to use.

      Scheme is great. Code and data are the same structure, and any time you need a new language feature, you just write a macro and, blam, the language does what you want, no BS. I'd only use it over LISP because the Scheme community seems to be more active, especially with new flavors like Rocket.

      The other language that's promising right now is Haskell, since it has beautifully simple but powerful syntax, and incredible type system, and ghc has an awesome template system that will hopefully be part of the core language before too long.

    7. Re:Dumbing down programming by amightywind · · Score: 1

      Yeah, the Java frameworks are a whole other world of hurt. At least they were when I boycotted the language 10 years ago. XML has been a curse. That is another reason to like scheme. The program and data representation are indistinguishable.

      --
      an ill wind that blows no good
    8. Re:Dumbing down programming by lennier1 · · Score: 1

      Don't worry. Frameworks like JBoss Seam (web application framework) will make sure you'll get the worst of both worlds. ;)

  17. Re:Performant is not a word. by WrongSizeGlass · · Score: 2

    I realize that this is a bit off topic, but is there any chance you'd be willing to apply for the obviously vacant /. submission editor job?

  18. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by pavon · · Score: 4, Informative

    From what I gathered on their website, Mirah was created by one of the main JRuby developers in order to create a language that fits in better with the JVM capabilities and Java ecosystem than a strait port of Ruby. The end result should offer better performance and cleaner integration with existing Java code then JRuby, while providing nicer syntax than Java.

    Groovy is slow as snot, and I wouldn't use it for anything other than perhaps a user scripting language for a java application, and even for that I think there are better options. No clue how Mirah compares to Scala. That was my first question as well.

  19. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by Anonymous Coward · · Score: 1

    All of those require extra runtime jars. Mirah emits java byte code with no dependencies other than the jvm. Mirah, having the benefit of going directly to the jvm is MUCH faster than JRuby, but less flexible at runtime. Mirah attempts to make the design time eperience as fun and fast as Ruby, but with the runtime performance of pure java. (oh, and the primary guy behind JRuby, Charles Nutter aka headius, is also behind Mirah)

  20. Aiming at an existing target by Patrick+May · · Score: 2

    Eventually it will reach the perfection of Lisp.

    1. Re:Aiming at an existing target by DrVxD · · Score: 1

      I very much doubt it. To reach Lisp's level of perfection, one must start with unbounded elegance - and then add copious simplicity.

      --
      Not everything that can be measured matters; Not everything that matters can be measured.
  21. Re:what. ever. by lennier1 · · Score: 3, Funny

    Can't be helped. Every time someone takes a crap another offshoot of C seems to appear.

  22. Re:what. ever. by pavon · · Score: 4, Informative

    Objective-C and C++ were created at the roughly same time, with the early work done without any knowledge of each other. OPPC (the early version of Objective-C) was written around 1981-82. "C with Classes" (the early version of C++) was written around 1979-83. The first books documenting Objective C and C++ were released in 1986 and 1985 respectively.Objective-C was standardized (as part of OpenStep) in 1994, while C++ became an ISO standard in 1998.

    Apple didn't choose to use it because C++ wasn't different enough; they chose to use it because that is what the NextStep was written with back when Objective-C and C++ were both still in their infancy.

  23. Ruby and LEAST SURPRISE? by Dahamma · · Score: 4, Insightful

    This I don't get. If you want "developer friendliness" and "least surprise", use a syntax with the (relatively) minimal set of keywords/tokens to accomplish your task. Ruby has basically incorporated the syntax and conventions of every major programming language of the last 30 years...

    And I guess you could call it "developer friendliness" if you want to let people freeform program in whatever style they want, with no two developers tending to use the same syntax for the same implementation - but at this point in my career (ie having worked for half a dozen companies and realizing what you write now may exist for decades), I consider a major component of "developer friendliness" as "easily comprehensible and maintainable by the next developer".

    1. Re:Ruby and LEAST SURPRISE? by bart416 · · Score: 1

      You forgot to mention Ruby and Java have some of the worst syntax possible really. Inconsistent use of capital letters is the main problem really. To give an example of what I mean (yes I know it doesn't actually occur like this, but due to lack of any particular name popping up in my head this will do to show the problem): throwException and ThrowException. The issue with this is that you'll run into "method does not exist" and you'll be looking all over your code except to the capital letters of the particular function, cause it follows the same naming scheme as the one above it. Think again!

      And I don't see why you would want anything to run on the JVM anyway now that I come to think of it. It's only as crossplatform as Sun/Oracle made it. They have to spend months to port it to a new platform since it's written in C/C++. Hence why the claim that it can outperform an application written in those two is a joke unless the developer was drunk at the time he wrote his code, and even then. Stick to standard C/C++ and use a general GUI library like GTK or Qt and your application will be just as portable, you have your freedom of syntax, good development tools (no need to stick to annoyances like Eclipse, Netbeans, ...), etc. .

    2. Re:Ruby and LEAST SURPRISE? by simoncpu+was+here · · Score: 1

      If you want "developer friendliness" and "least surprise", use a syntax with the (relatively) minimal set of keywords/tokens to accomplish your task.

      You mean, something like C?

    3. Re:Ruby and LEAST SURPRISE? by Splab · · Score: 1

      I've never encountered this problem with Java libraries - using eclipse will enforce camel case in your own program. What exactly are you referring to?

    4. Re:Ruby and LEAST SURPRISE? by prionic6 · · Score: 1

      If standard C/C++ is "just as portable" and the JVM is written in C/C++, why would Oracle need months to port the JVM to another platform?

    5. Re:Ruby and LEAST SURPRISE? by Dahamma · · Score: 1

      It's not my fault your ideas have line breaks...

    6. Re:Ruby and LEAST SURPRISE? by Dahamma · · Score: 1

      Wait, what's so great about Ruby syntax? It does resemble C and C++. It also resembles Perl, bash, and even Python in a few ways. I guess you found some combination of that you found unique. Sorta how throwing a big pile of shit at the wall can still look like art if you get lucky ;)

      Sorry, bad joke. I know it's not nice to make fun of a religion... :P

    7. Re:Ruby and LEAST SURPRISE? by bart416 · · Score: 1

      Cause java itself isn't as platform independent as it claims to be. Good luck trying to get your GUI to display correctly on every supported OS. All cause they don't use a standardised library like GTK or Qt really.

  24. Eight Words by FrankDrebin · · Score: 1

    Java is performant, widely adopted and eminently portable...

    So much bullshit in just eight words.

    --
    Anybody want a peanut?
    1. Re:Eight Words by pookemon · · Score: 1

      Probably written by a Netbeans developer who thinks Matisse is the Bee's knees and who also thinks that a refactor fucking up all your xml files is ok.

      --
      dnuof eruc rof aixelsid
    2. Re:Eight Words by Exclamation+mark! · · Score: 1

      I think the above comment said it best: Java? Do you mean the language itself or the modern frameworks which have buried the language under a ton of various XML files? Java itself ain't that bad. The frameworks and XML hell designed by vendors to lock you in... definitely awful. Enterprise software is the problem.

      --
      I'm a wanker.... and loving it!
    3. Re:Eight Words by Rick+BigNail · · Score: 1

      > performant

      Yes! We need code to run on 216 cores computer!

      >Widely adopted

      It works on VMS. Enough said.

      >eminently portable

      It's mostly true :)

  25. Re:Performant is not a word. by pwizard2 · · Score: 1

    There's a reason why nobody uses Java for desktop applications; it's too damn slow!

    10-15 years ago, I would definitely agree with you. Unless you are building a hugely complex application, Java is fine for lightweight to mid-range software. For instance, I'm currently building a fairly lightweight cross-platform Java-based frontend for GnuPG (something that has been sorely needed for a long time) and my application runs as fast as anything else on the system even when it has several threads running at once. Java applications can even look native these days (Swing's Windows and GTK widgets are fine, but I admit the OS X look still needs some work) so you aren't even stuck with that hideous cross-platform look anymore if you don't want it.

    --
    "It is a denial of justice not to stretch out a helping hand to the fallen; that is the common right of humanity."
  26. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by shutdown+-p+now · · Score: 2, Informative

    JRuby and Groovy are primarily dynamic languages.

    Scala significantly extends the Java object model. Consequently, only a few basic Scala notions map directly to Java and can be used from there. A lot of advanced stuff is not easily accessible.

    Clojure is Lisp - 'nuff said.

    Mirah seems to be mainly about syntactic sugar. Judging by the few samples on the front page, it brings Java roughly to the level of C# 4, except with a nicer syntax. But it's still strongly typed (unless you use "dynamic"), and its notions, such as classes and methods, map one-to-one to corresponding Java ones.

  27. LISP by sourcerror · · Score: 2

    I would agree with you if I hadn't seen LISP.

  28. Re:Performant is not a word. by pwizard2 · · Score: 1

    oops.. this reply got inserted into the wrong thread, it was supposed to be a follow-up to "Java & Ruby: Not known for high performance"

    --
    "It is a denial of justice not to stretch out a helping hand to the fallen; that is the common right of humanity."
  29. Re:Performant is not a word. by just_a_monkey · · Score: 1

    Agreed. Slashdot should headhunt this guy.

    --
    How inappropriate to call this planet Earth, when clearly it is Ocean.
  30. Re:Performant is not a word. by lennier1 · · Score: 1

    ^^ Nobody's perfect (even if CowboyNeal claims otherwise).

  31. I like C++ syntax by gatkinso · · Score: 2

    Never thought it hard to understand.

    Different strokes I guess.

    --
    I am very small, utmostly microscopic.
    1. Re:I like C++ syntax by brantondaveperson · · Score: 1

      All of your 'don't compile' examples compile perfectly fine for me (VS2008) - and I have no trouble understanding what they do.

      Which is to say of course, that none of them do anything except pass types around templates, but I'm sure you see what I mean.

  32. What else is not a word by z-j-y · · Score: 1

    Slashdot is not a word.
    Wikipedia is not a word.
    Google is not a word.

  33. Define "performant" by yk4ever · · Score: 1

    Performant, you say?
    Java has almost C-like speed when it comes to numerical computations, that's true.
    But what about huge memory overhead? or long startup times?

    And, on an unrelated note, I'm totally with the "Ruby is insane, Python's way cleaner" crowd. Syntax must be compact, but strict.

  34. Is it me only liking static langs? by rickla · · Score: 1

    Groovy is fine and this is just more of that I guess, but although I like grails, I am Mr. static. I get code completion, errors discovered before my users, and I am not sure what the difficulty with the C++ syntax is. Things like groovy closures etc look different but I think are hard to maintain and reuse. I even precompile jsp to avoid user discovered issues.

    1. Re:Is it me only liking static langs? by moonbender · · Score: 1

      I think, all other things being equal, a static code base is also easier to get into when you're new to it. Especially (but not only) because the tool support is much better or more thorough.

      --
      Switch back to Slashdot's D1 system.
    2. Re:Is it me only liking static langs? by binary+paladin · · Score: 1

      I like static typing when I'm developing applications. I like dynamic when building web apps. There may not even be a rhyme or reason to that beyond the fact that it's just the way I've always done things.

      That said, loose typing (PHP, JavaScript) always gives me more of a headache than it solves.

  35. Re:Performant is not a word. by Seumas · · Score: 1

    Do the needful.

  36. java + fun by binaryseraph · · Score: 1

    (java + fun) < (fun)

  37. Re:Performant is not a word. by Javagator · · Score: 1

    I agree. There was a big increase in Java's UI (Swing) performance with the release of JDK 1.6. For CPU intensive applications I would still use C++.

  38. I like the Java syntax by jfbilodeau · · Score: 4, Interesting

    I may be the only programmer in the world that is willing to admit it, but having programmed in Java since version 1.0, I really like the syntax. And yes, I do find Java a lot of fun, especially for serious enterprise development. The thing I presently hate the most about Java is that new 'Oracle' thing.

    --
    Goodbye Slashdot. You've changed.
    1. Re:I like the Java syntax by OrigamiMarie · · Score: 1

      Me! I also like working in Java.

    2. Re:I like the Java syntax by mdmkolbe · · Score: 1

      I agree as industry languages go, Java isn't all that bad.
      But it does sadden me since it is more a statement about industry languages more than Java.

      There are many mature industry-strength languages out there that are much easier and nicer to work with and have astounding features like you wouldn't believe (e.g. some measurably reduce bug rates by a factor of ten). Unfortunately, they aren't widely used in industry dispite being industry strength. Most of those languages haven't made it outside accademia as they are viewed as "too hard" for ordinary programmers. That makes me sad. It's like the difference between a windows programmer that has to write a 50 line batch file to do his processing versus a linux programmer that does the same in a single five-program pipeline.

      Then again I'm abount to finish a PhD in programming langauges, so I may be biased. And to be fair most of the resistance to these langauges may have more to do with compatability with legacy code.

    3. Re:I like the Java syntax by mad.frog · · Score: 4, Insightful

      Really? You really like writing

      Stop right there: it's not a question of writing, it's a question of reading.

      I spend *waaaaay* more time *reading existing code* than I do writing new code. Designing a language to optimize readability is IMHO far more important than trying to save a few keystrokes.

      In the example above, I find the Java syntax completely readable, though clearly not as terse as it could be. The second example I find readable as well, but not vastly more so than the Java example.

      If you're optimizing for coding time, you're doing it wrong.

    4. Re:I like the Java syntax by prionic6 · · Score: 1

      I'd say it depends on the portion of your code that uses anonymous inner classes with only one method. If you use them sparingly, you don't really need the syntactic sugar of an "anonymous method" / closure. If you use many of them, you might soon have a memory / performance problem, and a anonymous method may help with that if it's implemented differently. Or not.

    5. Re:I like the Java syntax by angel'o'sphere · · Score: 1

      I look forward seeing a paper about your research, as I like to know which languages you are refering to.

      Best Regards

      angel'o'sphere

      P.S. Feature wise I'm a big fan of groovy and scala but on both I have trouble with readability.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    6. Re:I like the Java syntax by hey! · · Score: 2

      I like big brackets and I can not lie
      you Python programmers can't deny
      when a module's checked in with a bitty interface
      and a dozen different kinds of brace
      you whip out static code analysis
      and do a little logical bris...

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    7. Re:I like the Java syntax by lehphyro · · Score: 1

      Actually you'd write something like this: Collections.sort(list, SomeClass.COMPARATOR); So readability and maintainability is better than your closure example. SomeClass would be in its own .java file like this: public class SomeClass { public static final Comparator COMPARATOR = new Comparator() { ... } }

    8. Re:I like the Java syntax by heathen_01 · · Score: 1

      The other point of course is that no java programmer is going to type all of that anyway. Your IDE will write it all for you with just a few keystrokes.

    9. Re:I like the Java syntax by hey! · · Score: 1

      The problem with your example is that the two versions don't mean the same thing. The first example guarantees that someComparator can be used with objects supporting the SomeClass interface, and stipulates that it won't work with objects that don't. The second example provides no such guarantees. Which is better depends on what happens later in the code.

      You might say that kind of static checking isn't really necessary much of the time, and you'd be right. You can always roll your own type guarantees (e.g. by checking prototypes in Javascript), but then your code gets much more complex. You have to look at *net* simplicity over a project, not simplicity in one line of code. Whether a weakly typed language is simpler or not depends on how often you end up rolling your own type checking, and how often you need to do things that are convenient in weakly typed languages like adding mix-in interfaces to objects dynamically.

      Given that Java requires the programmer to provide type guarantees, the addition of generics to Java makes the language both sounder and (net) simpler. Prior to that you had to cast every object you had to swear on your honor as a Boy Scout that an object taken out of a List or Set supported some API by casting it on every single retrieval. That was true even when the code that put the object there didn't belong to you. Java generics eliminate that repated, knee-jerk, boilerplate typecasting on every retrieval at a slight cost in verbosity when you declare the container object. That's a net win for Java programmers, and the practice of restricting generic containers to certain object types is a net win on some (but not all) projects.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    10. Re:I like the Java syntax by kaffiene · · Score: 1

      You're not the only one. I really like Java too. And I'm no newb - I've developed professionally in C, C++, Delphi, C#, VB, Javascript, Pascal, LISP and for a number of decades (three, to be exact). I do agree that there are some issues with Java - a little type inference would go a long way in my opinion. I quite like the idea of closures. Some of the deprecated packages should finally disappear... but these are all small issues. Java/JVM fills a gap that no other language does right now. It's not perfect and I'm sure it will eventually be superseded, but it's a mighty powerful beast right now. I like it a lot.

  39. Re:Performant is not a word. by Anonymous Coward · · Score: 1

    German. Java. Fun.

    This is the correct iteration. You have to have all three of these for it to work properly. There is no way that you can be non-German, and find Java to be fun. That just couldn't work.

  40. Re:Performant is not a word. by Capt.+Skinny · · Score: 1

    Great command of the English language! You've earned a gold star for the day. Maybe tomorrow you can educate us all in arithmetic.

  41. PataPata makes Java fun with JavaScript syntax by Paul+Fernhout · · Score: 1

    https://sourceforge.net/projects/patapata/
    (My project...)

    But, really, why not just use Smalltalk, which helped inspire Ruby and so on? :-) We need a good Smalltalk for the JVM...

    --
    A 21st century issue: the irony of technologies of abundance in the hands of those still thinking in terms of scarcity.
    1. Re:PataPata makes Java fun with JavaScript syntax by angel'o'sphere · · Score: 1

      There are plenty of SmallTalk implementations for the JVM ... google is your friend.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:PataPata makes Java fun with JavaScript syntax by Paul+Fernhout · · Score: 2

      There are only a few, and they are not "good". Can you otherwise suggest one you think is other than a toy?

      --
      A 21st century issue: the irony of technologies of abundance in the hands of those still thinking in terms of scarcity.
  42. Re:Pry my curly brackets from my cold dead hands by Anonymous Coward · · Score: 1

    I still think curly brackets are the best way to denote blocks

    Nonsense, indentation is. In fact, it is such a good way that all Java programmers indent their source code even though the language doesn't enforce it. Given that, curly brackets are clearly superfluous, and they usually cost you 1-2 lines per block, unless you use a crazy indent style.

    Oh by the way, even my captcha agrees: "indent" :o)

  43. Not even about syntax for me. (informative rant) by IBitOBear · · Score: 5, Interesting

    I am a guy who loves computer languages. I had a lot of fun with Ada for gawd's sake. I am pursuing erlang at the moment. Thought about haskell but it was just too big to play with...

    So keeping that in mind?.... Java and the JVM was a non-starter for me.

    Every time a new object oriented language comes out the purists start with "we don't need multiple inheritance" and so on, and they always end up having to hack it back in as some half-conceived junk (see "interfaces" providing, at a later date, all the much shat upon "complexity" of multiple inheritance with none of the ability to provide a default implementation, so then you add delegation which is all the default implementation with none of the inheritance etc...). "Java doesn't have pointers" my pasty white behind, every object is a pointer in java, you just can't use them properly, but they do manage to use pointers to prevent first class object copying, so then they added clone() etc.

    Then they "didn't need" proper destructor behavior, we have a finalize that would run at some time in the future, but really the code out to know when the last object reference is going out of scope so it can call a destructor manually if it wants. That was a stopper for me.

    See they coded their "every other language should have remained pure" hubris into their virtual machine, they encoded it into their hardware, from inception they designed their system to be limited and resistant to repair. So no thank you. So now Ruby fans want to take their niche language and cram it into the fundamentally flawed Java VM. Ooooohhh sign me up!

    I swear the language feels like it was designed on a dirty napkin by someone who had no grasp of scope or symmetry.

    Might as well be Python (I am old enough to remember RPG and COBOL Coding Forms, saving one apparent character, e.g. "}", (because in Python ":[newline]" is the same as "{" so what did we save again?) for the privilege of using white space, and counting tabs, as a control structure. And save the "but now we have editors to help us so that doesn't matter" tripe, we had coding forms to "help us" etc. And I suppose its okay to hack off a foot because you can alwasy get a peg-leg to help you too?

    Why is it that each new generation of "language designers" insist on reinventing the same old square-wheels of the previous generation and calling it new?

    Now get of my damn lawn... (yes, this rant makes me feel old, but come on people, imagine where we would be going if you would just stop trying to reopen the same tapped out mines...)

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  44. The Python language is a steaming pile of shit by TheTyrannyOfForcedRe · · Score: 1, Interesting

    Coming from someone who writes a lot of Python and currently has a lot of Python code in production, the Python language is a steaming pile of shit. Yep, I said it. It's as if Guido specifically went out of his way to choose the worst possible option at every design decision. The only things Python have going for it are a comprehensive library, "better than Ruby" performance, and mindshare. I would much rather code in Ruby, Java, C/C++, Lisp, Scheme, Smalltalk, or assembly than Python. Sadly, about 50% of my production code must be in Python. Sucks to be me!

    --
    "Liechtenstein is the world's largest producer of sausage casings, potassium storage units, and false teeth."
    1. Re:The Python language is a steaming pile of shit by oliverthered · · Score: 1

      ahhh.. and the fucking immutable retiredness of the types. I think that shows you the target audience of VB 6 programmers it was aimed at.

      --
      thank God the internet isn't a human right.
    2. Re:The Python language is a steaming pile of shit by Adam+Jorgensen · · Score: 1

      Wow, someone who actually has the guts to say this :-)

      Congrats :-)

      I don't hate Python as much as you, but having had to work with it properly now for a while I have found a lot of things I don't like, most especially the whole fiasco with the GIL...

    3. Re:The Python language is a steaming pile of shit by Unequivocal · · Score: 1

      I'm with you. A project I'm working on has a bunch of Python devs so against my better judgment I let them use python for our solution. I would literally rather write in Javascript than Python. There I said it.

  45. Developer friendly means what exactly... by Anonymous Coward · · Score: 3, Insightful

    If C/C++ were so developer un-friendly you would not find them under the hood of pretty much every new language that claims 'developer friendly,easier,etc etc etc ' that came out in the last 20 or so years. Take Java , .NET etc all have some sort of C under the hood.
    It's not that C/C++ is not developer friendly. It's that a lot of developers(apparently) are simply not that good to begin with. While Java , C#, JRuby etc etc etc make things 'easier' (according to some people at least) they ALSO hide a lot of things that a GOOD developer _should_ know in orderr to understand what is going on under the hood.

    I see and hear a lot of kids fresh out of University that never even used C/C++ (which frankly baffles me to this day) ask question like " What is a refference","Oh i thought the GC would take care of that"

    1. Re:Developer friendly means what exactly... by VortexCortex · · Score: 2

      If C/C++ were so developer un-friendly you would not find them under the hood of pretty much every new language that claims 'developer friendly,easier,etc etc etc ' that came out in the last 20 or so years. Take Java , .NET etc all have some sort of C under the hood.

      To be perfectly fair -- The first thing you do with a new chipset after you have an assembly compiler is to create a C compiler. Once you've bootstrapped the C compiler, subsequent versions of the C compiler can be written in C. Only then, do you begin building the other languages on top of C (unless you have a good cross-compiler -- in which case I suppose you can compile Ruby, Java, Perl, etc right for that chipset -- but the device drivers on that new hardware won't be written in one of these languages, so you'll still need to be able to compile assembly and C first).

      So, all the other languages are written in C because it's cross platform, and you're pretty much guaranteed to have a C compiler available for any set of hardware. The only alternative to C or C++ for language design is assembly or, Flying Spaghetti Monster forbid, machine code...

      Recently I've had the "fun" of coding up a simple OO language in assembly for x86, then adapting it to take advantage of x64 -- Were the language implemented in C I would have just recompiled it on the x64 machine. (Yes I know about LLVM, but this self-taught man likes to teach himself things like compiler design by thinking through "how would I make a compiler", then implementing the ideas, and finally reading about how others solved / optimized the task -- It's amazing how many similar solution concepts arise given the problem domain even when you have no prior knowledge of the field; Evidence that "inventions" aren't all that unique and idea monopolies are atrocious)

      Perhaps there are so many languages written in C/C++ because those are the low level languages that are commonly compiled into machine code, and are not platform dependent?

    2. Re:Developer friendly means what exactly... by angel'o'sphere · · Score: 1

      This has two general miss conceptions.

      First, regardless what programming "environment" you use, there is always something going on under the hood and all good programmers know what is going on in their programming environment.

      The second miss conception is: you think one would need to know it. No, in C++ you need to know it otherwise you can not really program in C++ at all. OTOH in Java it is a nice to have if a developer knows such "under the hood things". But he is not required to know it.

      And your fault basically is: no the JVM is not hiding ANYTHING a good developer _should_ know. Everything the JVM offers is _inside_ of the JVM and it is not _hidden_ ... as said before: a good Java developer knows that stuff.

      So, why exactly should a Java developer know, while he is developing on Windows x86 and will deploy on Solaris SPARC how many registers the processor has? And why should a C++ developer need to know that, either?

      Most people claiming stuff like you did, simply have no clue at all what a "virtual machine" is and what it does.

      So, it baffles you that a freshling form the university does not understand those three different C++ lines:
      Type t1;
      Type *t2 = new T2();
      Type &t3 = t1;

      Sorry, me it does not baffle at all, because explaining the difference and all the implications easily takes 10 pages in a book (parameters of those types, constness ... the various positions where a pointer declaration might have the word const)

      No offense, I don't want to disregard your knowledge. Your mistake simply is, you don't think about thinking and learning, you only think about programming. Most programmers with your attitude don't realize they learned all the stuff they know during 20 - 30 years. And they don't realize 90% of that knowledge is handy ... but obsolet.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  46. Java is not for scripting. by Urza9814 · · Score: 2

    This kind of syntax is great if you're doing scripting. Small programs. For anything large though, that looks absolutely horrid. I can't see myself using a language like that for anything more than a few dozen lines, and even then I'd rather use regular Java.

    Seriously, what is it with people wanting to get rid of the braces, for example? I can't tell you how many times I've been trying to debug Python code and determined that the whole damn program was failing because someone forgot a single space. Usually the compiler doesn't even complain. There's a reason C and Java and so many other languages use the braces. It's not because they wanted to piss off programmers.

    1. Re:Java is not for scripting. by jaydonnell · · Score: 1

      my editor shows me if someone fucked up python indenting. begin/end is even easier. I really don't understand the complaint.

    2. Re:Java is not for scripting. by mad.frog · · Score: 1

      Smaller does NOT automatically mean "easier to read", in Python I often find the opposite is the case.

      If I'm scrolling through unfamiliar Python code and see

            def foo(somearg):

      If I want to know the expectations of "somearg" I'm going to have to (1) hope for a comment, (2) analyze the body of foo, or (3) analyze all the callers of foo. Or some combination.

      If I'm scrolling thru similar Java code and see

            public function void foo(SomeType somearg)

      I have a much better idea about the input specifications.

    3. Re:Java is not for scripting. by kaffiene · · Score: 1

      Heh. Amen, brother!

      I find it amazing that people come out with stuff like this - Coffeescript as a replacement for Javascript is another good example. They parade the exclusion of a couple of braces or semicolons as if they've solved Fermat's Last Theorem. It's a very prevalent attitude in the scripting crowd - script X is better than general purpose language Y cause it has one or two less characters in it - as if that is in ANY way relevant.

  47. Re:Pry my curly brackets from my cold dead hands by PwnzerDragoon · · Score: 2

    I'm not sure you'd call this an "argument", but I do most of my coding in Python. Now that I've gotten used to its syntax, whenever I have to use a bracketed language like C++ or Javascript I get annoyed with having to deal with all these superfluous braces. Maybe it's just personal preference, but I don't miss them in Python.

  48. Why this and not JRuby? by dublinclontarf · · Score: 1

    There are two advantages to Mirah.
    1) It doesn't need to load the Ruby standard library, so it's really quick to start up and uses less resources, this is important if you're using Google app engine, meaning much MUCH lower spin up time.
    2) Static typing, it brings it with a ruby syntax, bringing along the associated speedup. Essentially it should execute at the same speed as Java.

    --
    http://my.telegraph.co.uk/dublinclontarf
  49. Re:Pry my curly brackets from my cold dead hands by Anonymous Coward · · Score: 1

    Some nice coding shortcuts but I still think curly brackets are the best way to denote blocks, anyone got arguments against using them?

    I have never understood the desire to get rid of the {, they stand out from all the keywords and names. Whereas end, which is easiest to see at a glance in this sentence the curly bracket or end.

  50. er... word fail... by IBitOBear · · Score: 1

    Slashdot, Wikipedia, and Google are "proper nouns" as such they have a definition based on their usage. Names (e.g. proper nouns) are magical in languages. They define themselves. That is, there is no uncertainty when a new string of letters or phonyms are assigned as the proper name of a unique entity.

    As used, "performant" is apparently an adjective. When used without a proper preceding or trailing contextual definition it has no actual meaning. We are left to infer a meaning because of the similarity of the word to other words, but that has no warrant of being the actual meaning intended by the speaker.

    Now you can "coin a word" any time you like in English, thats true, but when you do so coin a word you need to provide a proper definition. If I write "Java is gafault" is that "absent of faults" or "chock-full of faults"? The suffix "-ant" and "-ent" ("a" vs "e" depends on the preceding consonant) when used in an ajective context usually caries a "minimum required" leading to the state being described. Being "complaint" does not bring along, for instance, a promise of anything more than minimum acceptability. Look at all the -ant and -ent ajective words, compliant, complacent, etc. none imply excellence.

    So did the poster mean "it grudgingly meets minimum required performance parameters" or what?

    The problem with this word not being a word is that it doesn't have a common meaning to the audience. Its marketing speech. It sounds like it has gravitas but you can't be held to it having any absolute value. Its like if someone said "100% faster". Is that twice the speed by some measure? Is that "now it is instant"? is it twice its old speed or twice the speed of some external metric. e.g. faster than what and when?

    So performant sounds all serious and impressive, but it doesn't _mean_ anything at all (yet).

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  51. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by jaydonnell · · Score: 1

    scala and clojure requires you to include their jar in order to run. This has a negative impact in some circumstances. Mirah compiles to pure java bytecode and requires to additional libraries to run.

  52. If true, ... by tqk · · Score: 1

    You could make me interested in web development. Good luck with that.

    --
    "Tongue tied and twisted, just an Earth bound misfit ..." -- Pink Floyd.
  53. Sucks to be your employer by pem · · Score: 1

    if you hate the language you have to do that much work in so much.

    1. Re:Sucks to be your employer by TheTyrannyOfForcedRe · · Score: 1

      I don't know how you came to that conclusion. Not all employers are under the delusion that a room full of smiling happy faces means higher productivity and better code quality.

      Some employers don't give a flying fuck whether or not their employees have fun at work. There's a reason it's called "WORK" and not "PLAY". When did this crap about being happy at work start anyway?

      In the case of the Python code I was talking about, I am my own employer so I guess you were right in a accidental way. Sucks to be me...but because I have to write Python code not because my worker (me) dislikes writing Python code.

      --
      "Liechtenstein is the world's largest producer of sausage casings, potassium storage units, and false teeth."
  54. Re:Two things by danbuter · · Score: 1

    I'd think Groovy would fill the niche Mirah is trying to occupy, minus the syntax.

  55. Re:Performant is not a word. by MisterMidi · · Score: 1

    Are you sure about that? I'm Dutch, but I've never heard about performant (there are some sources but I'm pretty sure they stole that non-word from English) and dope just means drugs (I've never seen anyone dipping their beans in sauce, but if we would do that, we would probably call that dipsaus). The rest sounds correct. Also: apartheid, candy, cookie, drugs, santa claus and many more.

  56. It's okay to coin a word if you define it... by IBitOBear · · Score: 1

    Prepend is a neologism true enough, but it has a clear meaning and a unique definition, said definition being easily accessible to both inquiry and contextual meaning.

    Now lets look at "performant", it seems to be an adjective. Adjectives ending in -ant, -ance, or -ent (depending on the preceding consonant) generally mean "meets a minimal requirement". See "conformance" and "compliant" etc. These words also carry a requirement of a secondary reference to an external entity. One must be conformant or compliant with respect to something.

    So does the speaker mean to say that the language barely meets some minimum requirement of performance? And if so where is the standard of that performance documented?

    I have no problem with the coinage of this usage. It is, incomplete and therefore meaningless. It might as well say "new and improved". It is pure marketing speech designed to manipulate the reader into assigning gravitas to the statement without meeting any of the requirements necessary for clear communication or concise meaning.

    So in this case "performant" is pure "word fail" by a want-to-be intellectual.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
    1. Re:It's okay to coin a word if you define it... by Draek · · Score: 1

      So does the speaker mean to say that the language barely meets some minimum requirement of performance?

      Yes, as the GP explained.

      And if so where is the standard of that performance documented?

      It's not 'documented' anywhere, as it depends on the individual expectations of each user.

      It is, incomplete and therefore meaningless.

      The eternal bane of informal languages.

      So in this case "performant" is pure "word fail" by a want-to-be intellectual.

      Not really, at least not moreso than any other word in the English language.

      --
      No problem is insoluble in all conceivable circumstances.
    2. Re:It's okay to coin a word if you define it... by omfgnosis · · Score: 1

      Now lets look at "performant", it seems to be an adjective. Adjectives ending in -ant, -ance, or -ent (depending on the preceding consonant) generally mean "meets a minimal requirement". See "conformance" and "compliant" etc. These words also carry a requirement of a secondary reference to an external entity. One must be conformant or compliant with respect to something.

      By that logic, "he was compliant" would be invalid; it's not valid, it just leaves the compliancy's reference to implication by context. With this in mind, "performant" too leaves the "performancy's" reference to implication by context, and the context surely modifies its meaning. In some cases "performant" means "meets minimum performance expectations"; in others, it means "exceeds baseline performance". Seriously, no one has any difficulty inferring these meanings. Accept that it's become a word.

    3. Re:It's okay to coin a word if you define it... by obarthelemy · · Score: 1

      or may be the OP is just French, and slipped back to his/hers native tongue, which has a few very handy words in our field: performant (speedy, efficient), informatique (computer science, computers...), telematique (want out of fashion, was kinda a text-only internet before internet);

      Actually, telematique kinda means telecomputing. And 'im wondering what the difference is between those very passé words, and cloud computing ? The rainbow ?

      --
      The Cloud - because you don't care if your apps and data are up in the air.
    4. Re:It's okay to coin a word if you define it... by obarthelemy · · Score: 1

      Please do apply the same stringent criteria to several words you're using: incomplete, meaningless, intellectual... Are you sure they're clearly defined and you can use them ?

      This should be fun. Though a little long.

      --
      The Cloud - because you don't care if your apps and data are up in the air.
    5. Re:It's okay to coin a word if you define it... by Unequivocal · · Score: 1

      Performant is helpful in tech communications at times. It helps to refer to gradations in meaning, exactly along the lines you refer to. If I'm discussing two solutions and I say one is going to be more performant, this is not marketing speak. This is a quick statement enabled by this word that permits the recipient of the communication to understand that I'm talking about performance issues and not something else. I could have said "going to have better performance" instead, but I don't see why anyone should care which word is used? If the issue is that performant technically doesn't exist as an English word, then 25% of my technical vocab has got to go as well. I believe that the word "contact" used to be unacceptable as a verb?

      You're right that saying a solution "is performant" is silly and like all marketing borrows the word from a valid and grounded use.

  57. Call me a cynic, but... by Anonymous Coward · · Score: 1

    All 3 languages quoted as being "friendlier" than Java are interpreted languages with very late binding. JavaScript is "friendly", if you want to use the metric of "Git 'er Dun!".

    A lot of the unfriendliness of Java is that it requires you to get a lot of things right before it will even compile. As opposed to all of the above "friendly" languages which not only can't discover some bugs until after the stuff has already been dumped to production and actually run, but could go to production having one of its source files replaced by a complete random sequence of un-interpretable characters. Or a Perl script. But I repeat myself.

    1. Re:Call me a cynic, but... by Headius · · Score: 2

      Mirah is statically-typed, like Scala or Java, so there's no late binding. That was an explicit goal in designing the language. The fact that after looking at examples you didn't realize Mirah's statically typed makes me smile, since it shows the syntax truly does cover up the typing.

  58. Re: Not even about syntax for me. (informative ran by SanityInAnarchy · · Score: 3, Interesting

    I don't like Java, but I do have a couple of issues here:

    Java doesn't have pointers" my pasty white behind, every object is a pointer in java,

    Every object is a reference in Java. There is a world of difference between a name which refers to some object and an integer which might refer to some object, but you can still do integer math, and the object might not even be there anymore...

    This is almost as if you're trying not to see the advantages. No more segfaults. No double-frees, no crazy-ass debugging where the wrong method gets called because your pointer is pointing to the wrong (or a corrupt) vtable, and you really have to try to get a memory leak.

    they do manage to use pointers to prevent first class object copying, so then they added clone() etc.

    And the number of times I should've just passed the original object, vs the number of times I really didn't want it to implicitly clone something? Again, I have to give this one to Java, with the caveat that the interface to clone() kind of sucks. Ruby has dup, and all objects have it by default. Implementing clone() in Java is a pain, and if an object doesn't implement it, you're SOL.

    the code out to know when the last object reference is going out of scope so it can call a destructor manually if it wants. That was a stopper for me.

    Really? This?

    Think back to all the destructors you've ever written in C++. How many of them can you count that did more than free memory? In other words, how many destructors have you ever written which aren't entirely replaced by the garbage collector?

    I can pretty much count them on one hand. Filehandles, DB handles, etc. Yes, it sucks, but having to close a filehandle vs having to free every bit of memory I ever allocate? I'll take the filehandle.

    So now Ruby fans want to take their niche language and cram it into the fundamentally flawed Java VM.

    Wait, what?

    You haven't mentioned a single issue with the JVM. Your complaints have been about the Java language. Surely you can tell the difference?

    Oh, alright, you had one other complaint: You don't like the lack of proper destructors. Guess what? Ruby doesn't have them either. Ruby has finalizers, just like Java. Of course, I don't see anything about the JVM's design that prevents a language from implementing destructors anyway.

    It's also funny how you, like most of Slashdot, seems to have missed the point: JRuby exists, and is pretty much neck and neck with the official C Ruby implementation in terms of performance. It's just as stable, and almost everything that works in one implementation works in the other -- kind of like how you can have multiple C compiles.

    This article was about Mirah, which is not Ruby, nor trying to be. It's a way to make Java suck less, at least syntactically. If your gripe isn't with the syntax, you probably won't care about Mirah.

    And for a bit of balance, here's the features I really, really miss in Java:

    • Closures
    • Better setters/getters
    • Operator overloading (or something other than the retarded handling of == vs equals)
    --
    Don't thank God, thank a doctor!
  59. I disagree utterly... by IBitOBear · · Score: 2

    Java is a waste of cpu and, if carefully optimized, it can _almost_ be nearly about as good as the same code written, unoptimized, in C++.

    And now Oracle "owns" Java and has announce Jihad on the Infidels, it will only get worse.

    Java is now, and has always been, a comfortable fur-and-satin trap for the unwary.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
    1. Re:I disagree utterly... by angel'o'sphere · · Score: 2

      Java is a waste of cpu and, if carefully optimized, it can _almost_ be nearly about as good as the same code written, unoptimized, in C++.

      This statement is plain wrong.
      C++ is optimized per compilation unit.
      Java is optimized during execution and jit compiling.

      A simple example:
      Two classes, D1, D2 with same base class B and a virtual member function / method called f().

      In C++ the call of that member function *always* goes via the vtab.

      In Java the call is dispatched directly as soon as the JVM/JIT compiler realizes that D2 is not used int the program and all instances of B are in fact D1s.

      There are plenty of more such examples.

      Best Regards

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:I disagree utterly... by u17 · · Score: 1

      C++ is optimized per compilation unit.

      I encourage you to look up link-time optimisation (LTO). It's been in gcc for a while, and I doubt they were the first to implement it.

    3. Re:I disagree utterly... by angel'o'sphere · · Score: 1

      LTO only works on templates AFAIK ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  60. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by Headius · · Score: 4, Informative

    The original goal of Mirah was to create a language that looked nice, compiled down to a form as direct and fast as Java, and did not require you to drag a runtime library along with you. You take Mirah code in and get JVM bytecode (in .class files) out. There's no extra dependencies; you're not shackled to an extra jar file just because you wrote "hello world".

    Mirah has much of Ruby's syntax only because we liked Ruby's syntax. The Ruby class libraries are not there, and Mirah is not Ruby. It's statically typed, with Ruby's clean syntax and some of Ruby's surface-level features (like simple iteration and closures).

    I guess you're right, we need to do a better job explaining why it's useful. I have an article coming that emphasizes that this is simply a "javac" alternative that happens to have Ruby syntax, and hope to clean up the web site too.

  61. oh and... by IBitOBear · · Score: 1

    The JVM is not that much more than the old P-System and P-Code reinvented by people who didn't learn from the past. It is "art" sure, but it isn't "fine art" that has advanced the human condition by any stretch of the imagination. It just had better P.R.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
    1. Re:oh and... by angel'o'sphere · · Score: 1

      The JVM is not that much more than the old P-System and P-Code reinvented by people who didn't learn from the past. It is "art"

      Why are you so cynical? If you would look closer to the JVM byte code you would see it is 75% a clone of the old P-System. Only the area regarding method calls and constructor calls and monitors is "new".
      The creators of the JVM are well aware of the old P-System ...

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  62. Another example of an obnoxious long-term mania by Angst+Badger · · Score: 1

    This one goes all the way back -- at least -- to defining begin and end macros in C that resolve to { and } for the benefit of people who thought Pascal was the shit. And the answer, substituting the appropriate languages, still is that if you think Pascal is the shit, use Pascal. Don't try to disguise C as Pascal.

    With the JVM, things are a little different, since the JVM itself is a platform, albeit one designed in tandem with a particular language in mind. Writing a JVM backend for languages other than Java does actually make sense. Butchering Java to make it vaguely resemble some other language is just as pointless, counterproductive, and obnoxious as trying to make C more like Pascal.

    I've been coding since the 70's and have used most of the major languages from FORTRAN onwards, along with the design methodologies that have risen and fallen with them. Aside from choosing a language at the appropriate level -- some tasks are better handled in Java or Perl or Python than C and assembly language -- the main rational reason to prefer one language over another is determined by the codebase and workgroup you're working with. You'll get more done with a bunch of Java programmers and an ass-ton of legacy Java code by continuing to code in Java than you will by starting over in some other language.

    Almost everything else is just pointless churn generated by people who fell in love with a particular language or methodology (often the first one they mastered), who then develop a mania for getting everyone else to admire their hobby horse as much as they do. Thanks, but no thanks. We already have religion for that kind of irrational, aggressive stupidity, and you can see how well that has worked out. I don't claim to be immune to the instinct: my particular favorite is C, but it's been more than a decade since I used it professionally. These days, I use PHP (ugh), C# (not bad, even if it is from MS), a bit of Perl, and an unbelievably large amount of my current least favorite, ECMAscript. They all do the job they're called to do. The associated development tools make a much bigger difference than the language itself.

    These days, the current blind enthusiasm is for Ruby and Python. Big fucking deal. The language advocates were just as full of shit when it was Java, Perl, C++, C, BASIC, and COBOL. (Okay, they were especially full of shit about BASIC and COBOL.) They'll be just as full of shit in two or three years when Ruby begins to decline and some other Algol-derivative with minor syntax tweaks and cute jargon catches the fancy of the next crop of undergrads who think they're being revolutionary because they don't have the experience yet to know they're getting hot and bothered about reinventing something from ten or twenty years ago. Meanwhile, the actual work of trying to get software to be more useful to actual users will continue, and the software that actually succeeds in that role will almost certainly not have a cute name beginning with the first letter or two of the implementation language.

    --
    Proud member of the Weirdo-American community.
    1. Re:Another example of an obnoxious long-term mania by Reality+Master+101 · · Score: 1

      I'm actually kind of curious why you "ugh" PHP. I've been doing a lot of PHP programming lately, and I have to say, as of PHP 5.3, it's evolved into a pretty decent language. 5.4 is even better (which I unfortunately can't use yet). Yes, it has its legacy quirks (0 == '' comes to mind), but then, what language doesn't? And PHP (surprisingly) destroys Perl when it comes to speed, especially string manipulation. Yes, PHP in the past was pretty brain damaged, but what do you specifically dislike about the modern language?

      I'm not saying PHP is a *great* language, but you know what, it's far better than it used to be, and it's almost pleasant to use these days. I'm reminded of a (paraphrase) quote regarding computer languages: "The only languages people don't bitch about are the ones that no one uses."

      --
      Sometimes it's best to just let stupid people be stupid.
    2. Re:Another example of an obnoxious long-term mania by Angst+Badger · · Score: 1

      My main objections to PHP are its excessive memory consumption, lack of even optional type discipline, lack of optional predeclaration of variables like with Perl's use strict, amazingly crappy error reporting, and its kludgy lexical scoping rules. To be fair, other than that, it's actually not anywhere near as awful as people like to say, and used intelligently, it's actually pretty decent. I'm mostly just tired of using it and tired of writing web apps -- I'd rather be writing desktop applications -- so I'm probably a little overly sensitive to its flaws. So yeah, I bitch about it because I use it a lot.

      Whether it's faster than Perl really depends on what you're doing with it. PHP arrays can operate like Perl hashes and lists, which is convenient, but it also means that every array element has both a scalar offset and an associative key regardless of how you're actually using it, and that (along with some other metadata) consumes unreasonable quantities of memory. In a local, single-user app, that's not necessarily a disaster, but in a data-intensive high-traffic web app, it can be a real pain to manage memory use. It can also lead to some really frustrating bugs if an associative array key happens to be a literal numeric value, though PHP does the right thing with dynamic typing a lot better than Javascript does.

      --
      Proud member of the Weirdo-American community.
    3. Re:Another example of an obnoxious long-term mania by Reality+Master+101 · · Score: 1

      I agree with many of your quirks, though you may be unaware of a few mitigations:

      1) You can declare variables in function parameters as 'array' or specific classes, so that is some amount of type discipline.

      2) You can get somewhat of a 'use strict' by doing: "error_reporting(E_ALL | E_STRICT)". It's not perfect, but it's better.

      3) Error reporting can be improved considerably by setting up your own error handler using 'set_error_handler' and 'set_exception_handler'. Your error handler can also translate normal php errors into exceptions (one 'gotcha': make sure you check the function error_reporting() before throwing an exception, for when '@' operator is used). I have some boilerplate that I bring along to new projects. It displays error detail, back traces, and emails me upon errors. The one thing that still sucks is that you can't capture certain fatal errors, like syntax errors.

      So yeah, PHP does have legacy baggage, but at least it gives you ways to somewhat escape the baggage.

      --
      Sometimes it's best to just let stupid people be stupid.
    4. Re:Another example of an obnoxious long-term mania by Angst+Badger · · Score: 1

      Ah, nice. Thanks for the tips!

      --
      Proud member of the Weirdo-American community.
  63. Re:Performant is not a word. by mug+funky · · Score: 2

    i would find it easier to believe Timothy is Australian, based on the hours he posts and the fact that 80% of his stories involve Australia somehow (not complaining here, but it definitely stands out).

  64. Re: Not even about syntax for me. (informative ran by walterbyrd · · Score: 1

    Now get of my damn lawn

    No, you get off my lawn. I still prefer straight-up C. I think the whole object oriented thing works better in theory, than in practice.

  65. Not that complex or unreasonable. by IBitOBear · · Score: 2

    Lets see...

    g() wont compile because "std::vector" inside g(), is not explicitly coupled to the template definition of g() so it could be anything. Add "typename" and then it is unambiguous. Might as well ask why "any car" and "every car" are not the same sentiment in English.

    struct s is in no way dependent on class T, so there would be no difference between an s and an s, so the "template " has no meaning or purpose. The fact that you have to remove the syntatic no-op noise is not that complex and every language will fail you for it. Might as well ask why "float char x;" will not compile in Java.

    Not all tools are intended for use by people unwilling to learn how to operate them correctly, in fact none are. And all tools and procedures have a "Deep end" unless thy are inherently too shallow to be useful. Not everybody should or will be happy out beyond the breakers just because some people are. That doesn't mean we should put up chain fences to keep people going out there because "the shore-huggers would be made to feel inferior when they see others exceed them".

    You can only dumb-down the planet so far before it becomes counter-productive.

    [but thanks for reminding me about typename... 8-)]

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  66. Semicolon trouble again by Animats · · Score: 2

    Mirah has semicolon trouble. It's an "you don't need semicolons, except where you do" language. Note that some of the import statements in Mirah end with semicolons. Either there's some obscure reason for that, or the code they're showing doesn't really work. How do they do multiline statements? Please, not backslashes at the end of the line again. (Or worse, a syntax where a backslash followed by invisible whitespace, then a newline, has different semantics than without the whitespace.)

    Python's indentation-based syntax seems to work out better, At least since the compiler got smart enough to understand when mixed spaces and tabs introduced visual ambiguity.

    Mirah also seems to have a "you don't need declarations, except where you do" mindset. Historically, that's a bad decision. Almost every language that started out without declarations later backed into having them. FORTRAN, BASIC, C, and Perl all started out without much in the way of declarations. Python is one of the few typed but declaration-free languages that has succeeded. Arguably, Matlab is another.

    Is Mirah really a front end to Java, or simply a dynamic language that targets the Java virtual machine? You can do something similar with .NET, running IronPython to the .NET VM.

  67. Re: Not even about syntax for me. (informative ran by VortexCortex · · Score: 1

    I am a guy who loves computer languages. I had a lot of fun with Ada for gawd's sake. I am pursuing erlang at the moment. Thought about haskell but it was just too big to play with...

    So keeping that in mind?.... Java and the JVM was a non-starter for me.

    I happen to agree, although I've had to learn & use Java for well over a decade. Java's main selling point is that it's cross platform -- Building cross platform C code is just as easy (C was designed to be cross platform).

    Applications more complex than a terminal program have to talk to the APIs available on the platform / OS. Unfortunately Windows & *nix don't offer the same API for things like networking, threading and window management... However, this still doesn't make Java interesting to me in terms of cross-platform portability because of libraries like OpenGL, Qt, GTK+, SDL, etc.

    The fact that Java requires a byte-code interpretor means that it's slower than code compiled into native machine code. The benefit of "write once" code still doesn't remove the "debug everywhere" requirement either. This means I'll have to have the hardware anyway in order to test my Java apps on it... and if that's the case, why not just compile C / C++ code for the hardware?

    You still have to compile Java, so it's not appealing as an embedded user scripting language (if you do, you have to trust that the user has the correct Version of Java installed or include a huge 100+MB JRE tag along).

    The JVM is supposed to be safe because it's a VM, interpreted byte code -- Well, Actually, it's not. For the sake of performance Many JVMs compile the byte-code into machine code and run your program right on the metal...Just In Time (JIT). Is this more secure than a native binary executable? Perhaps, but I wouldn't call it "Safe". Browser JavaScript engines are now doing the same thing for performance. Running untrusted JS or Java as machine code on the CPU fills my guts with dread.

    Don't get me wrong. I like scripting languages such as Perl, Python, etc (not PHP), JavaScript, and interpreted languages like Java. However, each language has a set of use-cases that it excels in. Lisp and (lately) JavaScript are great embeddable scripting languages. Python is a good dynamic language. Perl is wicked fast at handling text and is a great glue language (Perl modules in C == fast).

    Java tries to be the kitchen sink, but that's the role that C / C++ fills. With cross platform C/C++ Application / UI libraries available, Java just doesn't seem the right choice for many of our new projects. Whenever I find a problem that Java can be applied to, something smaller, faster, or easier is also on the list.

  68. Re:Pry my curly brackets from my cold dead hands by walterbyrd · · Score: 4, Insightful

    Problem is: when I look at your python code, I don't know if I'm looking at spaces, or tabs, or some combination of both. Not without a hex dump, or something. And one invisible character out of place, and god-only-knows what sort of unexpected results I get.

    Also, I probably can not cut-and-paste your code into mine, and have it work, without substantial modification.

    Then there is the serious issue of emailing code, or cutting-and-pasting from a web-site.

    Too bad that practically everybody on slashdot thinks of BASIC as GW-BASIC. Most versions of BASIC, that are less than 30 years old, actually have it right - no curly brackets, no counting spaces and tabs either.

  69. Re:Performant is not a word. by mug+funky · · Score: 1

    just like "Immersive"

  70. Re:Performant is not a word. by pwizard2 · · Score: 1

    I've found that OpenJDK6 is really good on Linux and most distro repositories have it. Apple did deprecate their own JVM last year, but OpenJDK has made progress recently and is probably going to be the new standard JVM on OS X based on what I've heard. Apple's in-house JVM releases have always been horribly out of date, so it would be better if people could use the newest OpenJDK instead if they need to. It's really sad.. OSX used to be one of best best Java development environments since Java came stock but since Apple insisted on controlling everything it degenerated into the worst since Java5 was the latest version for the longest time. (there was an experimental Java6 package available for Leopard a while ago but Apple actually took it down! If you wanted to run new Java stuff on Leopard, you were SOL) Apple only bothered adding Java6 to Snow Leopard even though Java6 had been out for years already by that time. Apple's Java 6 implementation *still* treats Java programs like second class applications... it's obvious that Apple wants people to develop using Objective C instead. *sigh*

    I haven't really used C#, so how are the tools better? The only thing I have against C# is that it is Microsoft-centric and you need to make sure your stuff works properly on Mono if you do any sort of cross-platform development. (like I do) If I have to load Mono to get C# stuff working on Linux and Mac, what is the advantage over Java? I already know Java and the languages are similar, so it shouldn't be too hard to pick up C# if need be.

    --
    "It is a denial of justice not to stretch out a helping hand to the fallen; that is the common right of humanity."
  71. Don't be too hard on COBOL by spaceyhackerlady · · Score: 1

    I try not to be too hard on COBOL. It dates back to the pre-Cambrian of computing, and they just didn't know any better. We're still stuck with it, though I count my blessings that nobody has ever tried to get me to write programs in it.

    My biggest objection to Java is I've never seen an application written in Java that didn't totally suck shit. The company I work for went bust because a couple of people took a course in Java, convinced the Powers That Were to use it and Java Server Pages for a bet-the-company project, went crazy with their newfound knowledge, couldn't make it work, and down the tube we went.

    ...laura

  72. yes, that... by IBitOBear · · Score: 3, Interesting

    I _massively_ use destructors for doing more than freeing memory, particularly in multi-threaded code.

    Iet's see...

    closing files.

    Releasing, e.g. _unlocking_ regions of files shared between applications (e.g. matching flock() calls between constructor and destructor to lock and release records at precise times).

    Terminating protocols semantically and _then_ closing sockets instead of just closing sockets.

    Issuing signals on the _last_ release of a mutex that is coupled with a condition variable instead of on every release of a nested mutex.

    Unlocking and dismissing shared object libraries (e.g. undoing dlopen()) when, but not before, the last instance of any/every object dependent on the shared object file goes out of scope.

    Preventing "Cruft" in my heap by doing "deep" memory frees of complex structures as soon as I no longer need them instead of at "some random time in the future if ever".

    Changing modes and states on devices using ioctl() etc. (e.g. when the last "raw" use of the controlling terminal goes out of scope you put the terminal back into line mode until/unless you need to bring it back into raw mode.)

    Resetting hardware on last use.

    Emulating devices and subsystems that, by definition, reset themselves on last use.

    Doing all of the above with "exception safety" without having to write a ass-ton of "finally" blocks (though I _do_ whish C++ had "finally" 8-).

    Doing all of the above in "deep structures" so that my objects are true active objects instead of just nested hunks of memory.

    You are like a blind guy asking "when was the last time you really used your eyes for anything but reading" because you have never heard of art, when you presume destructors are "really just for freeing memory" you demonstrate a horrific limitation in your understating of object, functional, and event driven programming.. Just because you don't understand the non-beginner ways to use a construct doesn't mean the construct is only used the way a beginner would use it.

    Meanwhile:

    I lived through the "P-System" and "P-Code" the shortcomings and costs overheads and raft of annoying assumptions built into the JVM are a "given" to me. Sorry for not doubling the size of my rant to make you happy. I work with too many system internals to think the JVM is a win. You go back to treating your heap as executable, and over-stressing your CPU translation look-aside buffers, and leave me alone... 8-)

    In counterpoint:

    I think closures are overrated, but I don't disparage them because I recognize that the fact that just because "they have never been particularly necessary or useful to anything I have done" doesn't mean that they are unnecessary or useless to persons other than I. Plus you can pull the same thing more or less in C and C++, for a limited number of variables, by returning a pointer to a nested function, but like eeew.... Closures do typically require an executable data segment, which I find impure, but all of java requires an executable data segment so who am I to judge. Closures are just the latest brand of secret sauce to allow people to throw memory at a problem instead of logic. 8-)

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
    1. Re:yes, that... by SanityInAnarchy · · Score: 2

      Releasing, e.g. _unlocking_ regions of files shared between applications (e.g. matching flock() calls between constructor and destructor to lock and release records at precise times).

      Fair point, though I don't know that this saves you from the problem of locking in general. For a significantly parallel app, I'd be looking at either more granularity (Erlang) or less.

      Unlocking and dismissing shared object libraries (e.g. undoing dlopen()) when, but not before, the last instance of any/every object dependent on the shared object file goes out of scope.

      This makes sense, but it also doesn't seem to match where Java is used most these days -- in a server environment, where people tend to just load everything and let it run.

      Preventing "Cruft" in my heap by doing "deep" memory frees of complex structures as soon as I no longer need them instead of at "some random time in the future if ever".

      This is the part that GC is for. If you absolutely need that memory back immediately and you have the benchmarks/profiling to back it up, then you're right, you need a language like C.

      But GC has gotten pretty damned good. Closing filehandles immediately makes sense, because the OS limits how many of those you can have open, but memory? Depending on what you're doing, GC can actually perform better than manually freeing those structures.

      Changing modes and states on devices using ioctl() etc. (e.g. when the last "raw" use of the controlling terminal goes out of scope you put the terminal back into line mode until/unless you need to bring it back into raw mode.)

      Interesting... I can't remember ever having to do that.

      Resetting hardware on last use.
      Emulating devices and subsystems that, by definition, reset themselves on last use.

      And now we're definitely beyond the realm of "application development", I would think.

      Doing all of the above with "exception safety" without having to write a ass-ton of "finally" blocks (though I _do_ whish C++ had "finally" 8-).

      Ruby developed a clever approach to this using blocks, which are effectively closures. The general pattern is:

      open 'filename' do |file|
      # ... do a bunch of stuff with "file"
      end

      This translates into, "Call the 'open' method, and pass it this block of code." That method would be defined something like:

      def open filename
      file = real_open_file filename #whatever it is, I don't remember
      begin
      yield file
      finally
      file.close if file.open?
      end
      end

      The 'yield' calls the block you passed. Effectively, you can develop an API which defines a scope in which you get to work with the file (or whatever it is), and the API handles the exceptions.

      You are like a blind guy asking "when was the last time you really used your eyes for anything but reading" because you have never heard of art,

      More like, I'm an engineer who doesn't often think of working with art, to the extent that the analogy works at all. See...

      you presume destructors are "really just for freeing memory"

      I didn't ever assume that.

      They are, however, for freeing resources, which fits very nearly every single use case you mentioned. And maybe it's just the code I worked with, but it did seem like most of the time, destructors are there to free memory.

      Hell, most of the time, a destructor was only there as a defined virtual in case any descendant classes wanted to free some memory.

      I work with too many system internals to think the JVM is a win.

      And my work tends to be too far removed from system internals to think th

      --
      Don't thank God, thank a doctor!
    2. Re:yes, that... by mmcuh · · Score: 3, Interesting

      You are like a blind guy asking "when was the last time you really used your eyes for anything but reading" because you have never heard of art, when you presume destructors are "really just for freeing memory" you demonstrate a horrific limitation in your understating of object, functional, and event driven programming.. Just because you don't understand the non-beginner ways to use a construct doesn't mean the construct is only used the way a beginner would use it.

      Also, freeing memory manually in C++ is almost always the wrong way of doing things. There are plenty of adaptable containers in the standard library, and when you want to write you own and actually do need to keep track of memory directly there are smart pointers that deallocate whatever object or array they're pointing to when they go out of scope. Raw pointers and manual deallocation are only needed in very special cases, like when you're writing lock-free data structures or have to deal with C APIs.

      C++ really isn't about manual memory management, it's about scope-based memory management. You don't have to free things manually, and yet you can be completely certain of when a certain chunk of memory is deallocated.

    3. Re:yes, that... by deKernel · · Score: 1

      Well, I can give you one area where manual memory management is needed: fire-and-forget work. I have tons of custom logging (think log4cpp but on roids) that has worker threads that receive messages and do work based upon data received. If your data is larger than 2 integers basically, you are hosed unless you manually allocate memory before the call and let the receiver free the memory.

    4. Re:yes, that... by MadKeithV · · Score: 1

      Doing all of the above with "exception safety" without having to write a ass-ton of "finally" blocks (though I _do_ whish C++ had "finally" 8-).

      I hope none of your non-trivial destructors allow any exceptions to escape, or you will not be exception safe after all. I love C++ as well, but "doing lots of stuff in destructors" and "exception safety" are like cats and dogs living together.

    5. Re:yes, that... by nschubach · · Score: 1

      RE: File Handles...

      Last time I checked, XP (NT5) was 10,000 (per process) and Linux was 75,000 (per login.) Is this really an issue?

      I've coded multi-threaded apps to process 70,000+ result files per day. Even though I can't load them up at one time and wouldn't want to because the SQL server would cry about me injecting that much data. I schedule the job to fire off every half hour and grab the files as they come in during the day. I just can't think of a time when I'd want to open 10,000 files at once.

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    6. Re:yes, that... by jgrahn · · Score: 1

      I _massively_ use destructors for doing more than freeing memory [...]

      AOL. In addition to that, if you're using destructors to free memory, you may be doing something wrong. If the class members are all real objects (including standard containers or various smart pointers) all that is taken care of already.

    7. Re:yes, that... by mmcuh · · Score: 1

      That's exactly what smart pointers like tr1::shared_ptr or auto_ptr is for (and unique_ptr in the upcoming standard). Initialise the auto_ptr with your allocated data, pass it to the worker thread. When the worker thread lets the auto_ptr copy go out of scope the memory will be deallocated. If you need reference counting, use tr1::shared_ptr instead. It will be moved out of the tr1 namespace in C++0x.

    8. Re:yes, that... by IBitOBear · · Score: 1

      Thank you for agreeing with me, even if you wrote it like a correction...?

      I tend to use smart pointer so that I never have to call delete, except in those rare cases where I want to.

      Hence the whole list of other things I actually use destructors for.

      --
      Innocent people shouldn't be forced to pay for inferior software development.
      --"Code Complete" Microsoft Press
    9. Re:yes, that... by SanityInAnarchy · · Score: 1

      It's not just the limit, it's that it impacts performance, and sometimes you really do want to make sure stuff gets flushed to disk.

      In any case, the main problem isn't that you want to open 10k files at once. It's that you want to open maybe 10 files at once, and then a different 10 files, and so on. The only reason your finalizer will ever be called is if the GC cleans up that object. But it's not going to clean up that object because you're low on filehandles, only when you're low on memory.

      It's also not just files, but, say, database handles, sockets, etc.

      This is one of two main annoyances I have with GC'd languages, the other being that while I think I have seen languages shrink their heaps (I think?), they do it on their own sweet time. It'd be really nice if there was a way for garbage collectors and caches to register themselves with the OS, so that when the OS itself is low on memory, it can ask stuff to GC and/or purge caches.

      Then again, 99% of the time, the block hack does what I want to do.

      --
      Don't thank God, thank a doctor!
  73. Re:hahah what? by Darkfred · · Score: 1

    There are more than 5 natively compiled languages. You lose.

    --
    ----- 70% of all statistics are completely made up.
  74. Re:Because syntax is _everything_. by Darkfred · · Score: 1

    No, all functional languages are basically the same.
    Syntax is 5%.
    95% of understanding a program is well labeled functions and data structures.

    Syntax only matters early in your career when everything is still greek, even your own language.

    --
    ----- 70% of all statistics are completely made up.
  75. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by johanatan · · Score: 1

    Clojure *is* LISP; which is precisely why we *don't* need Scala and Mirah.

  76. Re:Pry my curly brackets from my cold dead hands by Darkfred · · Score: 1

    Blocks: I don't care how you denote them but DENOTE them. Seems that language developers these days are trying to reinvent fortran. Not exactly the model of fast error free programming.

    For scanning speed I would prefer a single character bracket, quote, parenthesis whatever vs multi character tags. But as long as there is some opening and closing for which I can receive syntax errors rather than silent bugs I am happy.

    --
    ----- 70% of all statistics are completely made up.
  77. I use straight C as well by IBitOBear · · Score: 2

    (For prospective, I learned my "C" using "cc" on Unix System Vr3...)

    I agree that most of the C++ I have seen has been pretty abysmal, but that's not the paradigm's fault, nor a fault of the language. The average professional in _any_ field is, by definition, pretty average, and tautologically therefore not "excellent".

    I can say the same thing for overly clever C programmers. There is a reason that the Obfuscated C contest is more popular than the obfuscation contests of any other language.

    The problem is, of course, that if you only have a hammer every problem looks like a nail. C++ is object oriented, but unlike other object oriented languages, it is not _limited_ to pure object oriented behavior. There is nothing C can do that C++ cannot. (It is, of course, not optimal to use the C++ compiler to compile purely straight C since it will bring along some plumbing etc, but thats not a killer if you use GCC anyway as.)

    So yea, you get a lot of people who learned languages instead of programming and you get a mess that focuses best on one limited paradigm. Knowing when to object and when not to object in C++ is a non-trivial task. Throwing away the object ability because you either are not good at it yet or have never seen it done right is just a sign of stagnation (IMHO of course).

    So I am sure we all feel safer if you stay where you are and don't over-reach your understanding. We fully wish more people woud just stop venturing out, making a mess, and then blaming their tools.

    Your disdain for "the whole object oriented thing" is quite different from my disdain of Java and the JVM for being irredeemably flawed. After all, every time you have put a function pointer inside a structure or built a set of libraries that use a specific set of structures you have been using "the object oriented thing", if only dimly in your own awareness.

    The problem with most "object oriented programmers" and their "object oriented programming sucks" counterparts is a limit of comprehension in the form of overly literal thinking. They see/hear the inevitable, and massivly flawed "car analogies" a then they roast on that spit. They try to put "drive" in "car" when they full well that cars do not drive themselves. That is the fail because they, having picked a metaphor for a block of code, fail to use that metaphor consistently. Once they violate their own designs they find themselves trapped, beached if you will, on a shore of mismatched functional domains.

    The hardest thing for an author to learn is that writers block is what happens when you write words you love that just don't fit the story. The only cure is to start hitting paragraph delete until you are back to where the story makes sense.

    The hardest thing for a programmer to learn is that you likewise have to toss out bad code instead of trying to fix it when you get to a place where the code you wrote, or inteed your object designs and functional signatures, don't properly fit the job you are tying to accomplish.

    Once I learned to delete my mistakes I became an outstanding "object oriented" programmer. Likewise for "functional programming" and "procedural programming". Its all the same skill.

    Only a poor craftsman blames his tools. Only a fool uses a tool he knows is broken. Only an idiot things those statements are in conflict.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  78. Re:Pry my curly brackets from my cold dead hands by Compaqt · · Score: 1

    The funniest thing is where hipster languages attempt to drop the brackets because they're "cruft", and then they end up having to add back in $START and "end" keywords to replace them.

    Is "end" really much better than "}" ?

    --
    I'm not a lawyer, but I play one on the Internet. Blog
  79. Re:Mirah is for Pascal people that don't like C++ by FlyingGuy · · Score: 2

    Hey Fuck off! There is nothing wrong with Modern Pascal Implementations like Delphi. Its OOP Model is better then C++ or any of those other bastardized bits of cruft. If you want real OOP like it was envisioned then stick with LISP or SmallTalk, but if you want to get work done...

    --
    Hey KID! Yeah you, get the fuck off my lawn!
  80. Re:Performant is not a word. by ThePromenader · · Score: 1

    ...but what they all do is; make programming fun, intuitive and, above all, extremely productive.

    ...but what they all do is: make programming fun, intuitive and, above all, extremely productive.

    Fixed that for you. Colons are usually for presentations of thought or situation (subject intro: subject), semicolons are for two phrases common through thought or consequence (situation; consequence). It took me a while to figure that out, especially since practically no-one outside of the written press use colons and semicolons anymore. No, programmers don't count in this context ; )

    --

    No, no sig. Really.

    ThePromenader
  81. Mirah is simple? by WaffleMonster · · Score: 2

    def length
    @length
    end

    In C I don't need to explicitly declare sections declaring things... How is this an improvement?

    puts "I got a #{a.getClass.getName} of length #{a.length}"

    Am I supposed to be impressed with this #{} cold fusion nonsense? I'll take perl string syntax over this any day of the week.

    Oh yea and best of all it compiles to crappy java bytecode.. It is not the java language that sucks it is the limitations of the JVM and the army of gross hacks that continually pile up for the sake of backwards compatibility.

  82. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by devent · · Score: 2

    "Groovy is slow as snot, and I wouldn't use it for anything other than perhaps a user scripting language for a java application, and even for that I think there are better options. No clue how Mirah compares to Scala. That was my first question as well."

    You use Groovy if you like to do some dynamic stuff. I don't think it will be faster with anything else anyway.
    If you don't want the dynamic stuff but still like Groovy, there is Groovy++.

    --
    http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
  83. Re:Performant is not a word. by GAB_cyclist · · Score: 1

    I'm flemish, 'performant' may not be used often in the Nederlands, it is the word we use in Belgium. Living together with a french population tends to have it's influences.

  84. Re:Performant is not a word. by LingNoi · · Score: 1

    Have to disagree with you there. When I run two or more java apps at the same time then they all crawl. A typical usage might be something like playing Minecraft while running Vuze in the background.

    When running one java application at a time I agree, it's as fast as any other program but I think it's unrealistic to say it does in real life practical situations where you have more then one app running in java. You can visually see the slow down.

  85. Re:Pry my curly brackets from my cold dead hands by pmontra · · Score: 1

    No, it isn't and this is perhaps the first thing I noticed when I started using Ruby. However for some reason it makes the code immediately easier to read, and I was coming from about 20 years of C, Perl and Java. Maybe it's the useless { we're spared with: we usually know where a block starts, we just don't know where it ends and this is the problem of Python's invisible block endings (you mistype a space or tab and you don't understand why your program is not behaving as expected).

    There is another bonus for getting rid of }: some national keyboards don't have { and } on their layout and programmers have to play with the ALT keys to get them (the details depend on the OS) or (software-)switch to the English keyboard and have their fingers know by hearth where the keys are (this is what I do in the editors). So internationally speaking not having { } is a good choice. Too bad Ruby uses { } to define the omnipresent hash tables. Maybe [ ] would have been good enough as the interpreted should be able to understand the difference between an array and a hash. Anyway {} is a much better choice than PHP's obnoxious array().

  86. Re:Pry my curly brackets from my cold dead hands by LingNoi · · Score: 1

    The brackets in c++ have a specific purpose and aren't redundant. They define "scope". Making them only for if and while statements means that you wouldn't be able to define scope.

    http://msdn.microsoft.com/en-us/library/b7kfh662(v=vs.80).aspx

  87. Re:Pry my curly brackets from my cold dead hands by MechaStreisand · · Score: 1

    Too bad that practically everybody on slashdot thinks of BASIC as GW-BASIC ...

    George W. Basic?

    --
    Disclaimer: IANAL. This post is, however, legal advice, and creates an attorney-client relationship.
  88. Integer.parseInt again by pmontra · · Score: 1

    I looked at the examples and it could have mistaken it for Ruby with type declarations in the method definitions. But then I noticed n = Integer.parseInt(args[0]) if args.length > 0 Why couldn't they add a to_i method to the String class (or Object, or whatever) and turn that line into n = args[0].to_i if args.length > 0 as in Ruby? All those Java's Class1.parseClass2 methods always looked funny to me.

  89. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by inglorion_on_the_net · · Score: 1

    Thank you for the clarification. So it's close to Ruby, but statically typed. That's actually really exciting. I'm going to give this a spin. Also, are you looking for help with this project?

    --
    Please correct me if I got my facts wrong.
  90. Re:Pry my curly brackets from my cold dead hands by Compaqt · · Score: 1

    PHP- yeah, array() is braindead. They could have gone with something like [], but they just didn't have that level of imagination.

    In vim, % goes from the start of a block ("{") to the end, and vice versa. I was going to ask if it does the same for $START/"end" , and I checked: it doesn't, which is lame, and (for me), another reason to prefer C-syntax languages: Java, PHP, Javascript.

    --
    I'm not a lawyer, but I play one on the Internet. Blog
  91. Re:Meanwhile: Ruby not so good. by cronius · · Score: 1

    But Ruby? Its a mess. A wash. An over thought and inconsistent pile of -blarg!-. No matter how many places you try to stick it, you will never find the magical context where it isn't overblown and too ugly to mainstream.

    You bash on Ruby, but it's hard to understand why since you don't explain what's so bad about it. For example, could you please explain to me what's inconsistent in Ruby?

    --
    Life is Reality
  92. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by Headius · · Score: 1

    I am definitely looking for help with the project. Currently, the codebase is a bit tough to follow, so I'm mostly trying to refactor and clean it up. If you want to start digging in, getting familiar with the codebase and helping fill out the wiki (on github) would be excellent :)

    And make no mistake about the relationship with Ruby; it's purely syntactic. The APIs and class libraries are that of the Java platform. Only Ruby's syntax and some superficial language features are from Ruby.

  93. Re:Java & Ruby: Not known for high performance by SirJorgelOfBorgel · · Score: 2

    No, it just isn't.

    I'll skip on Java being a horrible language, everybody who isn't a Java fanboy and has used a fair number of languages already knows this.

    But nearly as fast as C++ or just 10% slower ? That's not my experience, at all. Of course, first I could comment on how calling a language slow or fast is at best strange, as it often really depends on the compiler / interpreter / assembler (ok not that one), and what exactly you are trying to do with it.

    Then I could perhaps comment on other native languages, for example C(--), or Object Pascal. Both of which are still significantly faster than Java. Or perhaps assembler could be mentioned. A response could be how C is just as fast as assembler, or that its ridiculous to be hand-optimizing in assembler, or nobody remembers how to do it, etc. And sometimes that would be true, but there are various use-cases where it isn't. Most programmers just never (or rarely) encounter these use-cases.

    Perhaps we could discuss productivity. How fast is it to develop something (ie costs) vs execution speed. C# has Java easily beat if you don't need to support anything that isn't Windows. Better language, better libraries. Finding a good Java coder is more difficult (and thus costly) as well due to the huge fragmentation of toolkits and frameworks for Java. Not to mention that for C# you can use Visual Studio, which is simply the best IDE there is. Comparing for example Eclipse to Visual Studio and having Eclipse coming out on top - that just makes anybody who has used both extensively question your sanity. Eclipse is just so much slower than Visual Studio, that aside from all the great features Eclipse doesn't have, you halve your productivity just by the need to constantly wait on your IDE. Sure, it's only a second here, half a second there, but it happens several times a minute. That difference alone is easily worth the price of Visual Studio several times over. Seeing as Eclipse is also made in Java, I guess that's another hit for Java's speed as well.

    We could discuss what things you could do with the language. Let's take image manipulation as an easy example. Say I would like to perform channel auto-optimization on an image in code (without depending on an external library to do it for me). The code is straightforward enough, just a few loops and a few calculations, with millions of iterations. It can easily be the case that the C equivalent of this code runs in milliseconds, while the Java code runs in seconds (if not minutes). Quite a bit bigger difference than 10%. In my experience, in things like these, C# has Java beat speedwise as well, though not by that big a margin. And that's an example where speed matters. Of course, we could also discuss enterprise business logic. It may well be that Java is only 10% slower there, but that's a place where speed doesn't matter nearly as much as the logic isn't usually the bottleneck and it is easy to throw more hardware at it.

    Which brings me to the conclusion: nothing in your comment makes any sense at all. Java may indeed be only 10% slower than C++, but this is in instances where speed doesn't really matter in the first place. Java is certainly not the fastest thing you can get after C++ by any margin. And in the game industry the difference is far bigger than 10%, since that usually involves a lot of memory manipulation logic for high end games which is something Java is especially horrible at, and the speed difference is orders of magnitude greater than the 10% quoted. Sure, there is lots of boring business software built in Java, but I've yet to encounter the case where it was actually the best tool for the job in practise, taking into account all the other dependencies of the package. Not saying those cases don't exist, I can imagine a few of them.

  94. Re:Pry my curly brackets from my cold dead hands by Compaqt · · Score: 1

    Not sure if you know what GW-BASIC is, and you're just joking, but, back in the day, GW-BASIC was the version of Basic you had if you bought an IBM PC compatible computer with MS-DOS.

    It later morphed to QBasic/QuickBASIC and then VisualBasic.

    --
    I'm not a lawyer, but I play one on the Internet. Blog
  95. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by inglorion_on_the_net · · Score: 1

    Alright! Having read about Mirah some more, I definitely see exciting possibilities. I will also check out the mailing lists and see what ideas are floating around for language features. I might have to add a few of my own. But first, getting familiar with the existing code base sounds like a great place to start. Now to find some time next to my job ...

    --
    Please correct me if I got my facts wrong.
  96. Re:Pry my curly brackets from my cold dead hands by pmontra · · Score: 1

    You made me remember why I didn't like "end": vim's % key didn't work. Luckily I use emacs most of the time (vim only for occasional editing) and there are elisp packages that grok Ruby's syntax and correctly highlight the start and the end of blocks. So that turned out to be a very minor hassle.

    About PHP: agreed. And why on earth they had to inflict the mandatory $this-> on us?

  97. Re:Pry my curly brackets from my cold dead hands by SirJorgelOfBorgel · · Score: 2

    Agreed on the loops.

    As for the bracket columns, why does it really matter to you if somebody else does it ? I personally prefer the opening bracket on the end of the first line (assuming the first line is short, not long) because it saves a near-empty line, so (a) more code fits on my screen without messing with readability and (b) when glancing over code I don't mistake it for a white-line, which would usually indicate some logic break (much like paragraphs in a "real" language). I see no real problem with putting it on its own line, it's just not the way I personally prefer it.

    Proper indentation fixes the problem of code block visibility, any decent IDE has easy buttons to move blocks or "beautify", and moving the cursor over } should really highlight the corresponding {.

    Use the brackets for any logical code block including ifs and whiles, use proper indentation, use white-lines where necessary, use a decent IDE, there really is no issue with one versus the other. I could see your point as defendable when coding in notepad, but well.. ;)

  98. Re: Not even about syntax for me. (informative ran by roman_mir · · Score: 1

    Deep cloning in Java is stupid, so I always implement my own simple way to clone: serialize the object into a byte array, de-serialize it, cast it.

    It's not as wonderfully quick as cloning memory via a pointer, but it works.

  99. Re: Not even about syntax for me. (informative ran by dkf · · Score: 1

    Implementing clone() in Java is a pain

    Too many classes don't implement it that should (and far too many don't narrow the return type correctly!) but thinking about shallow vs deep copies is something you have to do anyway in any language with mutable-model values. That's because you've got to decide when to preserve identity of the contained values and when to duplicate it, and there's no real shortcut to it.

    Languages where all values are formally immutable are much simpler in this regard. Either they require you to make a copy when doing an update, or they only allow an in-place update when nobody else is looking, both of which are conceptually similar (and the latter can be fast too, despite taking more code to implement).

    --
    "Little does he know, but there is no 'I' in 'Idiot'!"
  100. Re:Pry my curly brackets from my cold dead hands by dkf · · Score: 1

    Problem is: when I look at your python code, I don't know if I'm looking at spaces, or tabs, or some combination of both. Not without a hex dump, or something.

    Anyone mixing spaces and tabs in python (or haskell) code deserves exactly what they get. Luckily, code editors in python mode will normalize spacing to use one or the other, precisely because it's a pain to mix them. (I don't particularly care for Python — it doesn't work in the way I prefer to think — but attacking it over the syntactic way it does blocks is pretty dumb. Unless you're insisting on using Notepad.exe to write code, but that'd just be very dumb anyway.)

    --
    "Little does he know, but there is no 'I' in 'Idiot'!"
  101. Re:Meanwhile: Ruby not so good. by Jeeeb · · Score: 1

    See the plain truth is that the JVM is a least-common-denominator. It is an interpreter for gawd's sake, and one that knows it is sufficiently crap that it has a "just in time compiler" so that it can set itself aside whenever it realizes that it is too much crap for the code it is running. But it still suffers from the conceit that it is ever _not_ too much crap... why not just JIT the entire code base? And if that, why not just compile the code base once to begin wiht? Yes, then it woudlnt' be a "VM" but come on, competing with runtime to run a compiler? Really? Because you know that compiled code would be "better"? But "not always"? REALLY?

    Because JIT compiling allows the optimizer to take advantage of features like SMD4 without having to compile for that, and allows you to perform optimizations based on run-time analysis. The LLVM project is JIT vm written specifically to take advantage of these sorts of potential optimisations. Despite being a relatively young project C/C++ code compiled into LLVM bytecodes has shown better performance than code compiled into native-binaries using GCC.

    In the case of Java, the JVM in server mode beats out plenty of compiled languages and comes quite close to C/C++ on the programming language shootout. A lot of the difference could easily come down to the fact that with the JVM array bounds checking, RTTI and virtual methods are unavoidable (and very nice to have imo).

    Aside from potential performance advantages using a VM also has the advantage that it gives you nice run-time errors with things like a NullPointerException with a nice stack trace rather than just getting a seg-fault. This IMO is probably the biggest plus.

    If Ruby, the language, wasn't full of... um... "crap"... the ruby-to-native-C translations would _naturally_ run much faster than the ruby-to-JVM JRuby just by virtue of not being in the VM. But lo and behold, that's not the case Ruby is _modeled_ on the mistakes of Java and its ilk. Perl-to-C has many of the same problems, and likely Python would as well. They just don't labor under the misapprehension that if they could just find the right platform things would be better. They make themselves the best version of themselves possible. Perl does a damn good job of being Perl, and Python "does okay" for being plagued by that stupid white-space thing, and having a completely unstable incompatability between V2.X and V3.

    This is just completely, entirely wrong.

    Firstly JRuby is fast because it compiles (presumably on the fly) the Ruby code into jvm bytecode and then uses the jvm to run the byte-code. The JVM (written in C++ I believe) is a much a better piece of software than the conventional Ruby vm and therefore despite the overhead of compiling Ruby into jvm bytecode in Java it still manages to match the performance.

    I'm not sure what the "ruby-to-native C translations" are that you're talking about. CRuby takes a ruby file transforms it into an intermediate bytecode and runs that bytecode in its own vm. Same as JRuby except JRuby uses the JVM. Almost the same as Java as well except that Java is compiled ("transformed") into bytecode prior to running

    Even if all your facts had been right your statement still would've failed basic logic 101. Why would all the "crap" that Ruby's filled with (apparently according to you) make the "ruby-to-native C translations" (See above for an explanation of what actually happens) slower than Ruby-JVM which would presumably also have to deal with Ruby's "crap"

    The best you could hope for is getting adopted by Apple and re-branded iRuby since those apple fans will seemingly buy into anything as long as someone in a black turtleneck tells them to. iRuby won't be any less craptacular than Ruby, but it will have a home...

    Ahhh... going for a troll mod I see

    So calling it Mirah or JRuby isn't going to matter... it deserves the JVM and good luck to it I say.

    Obviously you found the summary difficult to comprehend. So let me help yo

  102. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by Glock27 · · Score: 2

    One "new" language (for some value of new, it's a few years old but was only recently released on a large scale) is Gosu, which has some very nice features. It is closer to C* syntax, which is nice from my perspective (I understand maybe not from others lol).

    I'm a fan of terse, maximally expressive languages as I think they maximise productivity both for development and maintenance. Gosu seems close to a sweet spot.

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
  103. Re:Big Picture (Open Source Trolling?) Here... 8-) by Glock27 · · Score: 2

    Do you honestly think that after taking on Goggle for the non-Java-but-Java-like innards (I forget the name... Davlik?... something like that) of Android they are gonna let cacao or any of the other JVMs slide?

    This part of your (apparently) ADD inspired rant is beside the point. Languages that run on top of the JVM are orthogonal to whether or not some particular JVM is legal. Even without open source JVMs (gasp) there will still be performant JVMs from Oracle and IBM. The world goes on. ;-)

    Most likely the Dalvik tempest in a teapot will be resolved via a typical cross-licensing arrangement between Oracle and Google.

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
  104. Re:what. ever. by Glock27 · · Score: 2, Insightful

    Apple didn't choose to use it because C++ wasn't different enough; they chose to use it because that is what the NextStep was written with back when Objective-C and C++ were both still in their infancy.

    There were better reasons than this. C++ is not well suited as a systems programming language. That's why there's still not a single major OS that uses the C++ object system at the system level. BeOS was the single failed experiment in this regard - remember the loveliness of "reserved slots"?

    Objective-C's dynamic features make it a much better foundation for systems programming. Its relative simplicity is also attractive.

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
  105. Re:Pry my curly brackets from my cold dead hands by AC-x · · Score: 1

    Given that, curly brackets are clearly superfluous

    If you denote blocks then you can indent automatically, but if you rely on white space like Python you can't rescue indentation or paste code into a block without having to edit the indentation (can any editors do this automatically yet?). If you press shift-tab one to many times in Python and don't notice you've destroyed all your blocks.

    Now Ruby, that has block markers anyway ("end"). It's good practise to leave a line after the end of a block which } fills rather nicely, but to me "end" doesn't look as good unless you put an extra blank line after it.

    If someStatement
          DoSomething()
          OrOther(someValue)
    CarryOn()
    AsYouWere()

    -

    If (someStatement) {
          DoSomething()
          OrOther(someValue)
    }
    CarryOn()
    AsYouWere()

    -

    If someStatement
          DoSomething()
          OrOther(someValue)
    end
    CarryOn()
    AsYouWere()

  106. Re:Because syntax is _everything_. by RegularFry · · Score: 1

    I find the assumption that one's career should consist of only one language quite sad.

    --
    Reality is the ultimate Rorschach.
  107. "Stupid" by demon+driver · · Score: 1

    Whatever most English speakers really think about the German word "Doktor" (sic!), "performant", which is a common word in German, too, wouldn't really be the first German word to become part of the English language. Wow, how stupid those must have been who first used the words "kindergarten" and "rucksack" among an English speaking audience...

  108. Re:Performant is not a word. by Racemaniac · · Score: 1

    peformant can be used as a dutch word. and for performance we can use "performantie". Maybe it's not the most common word, but it is used. Can be dependent on whether you're from belgium/the netherlands, and maybe even the region you're from :)

  109. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by aliquis · · Score: 1

    If your Groovy code is slow then you're doing something really wrong.
    When I write Groovy, it's almost as fast as Java.

    Does not compute.

  110. Re:Java & Ruby: Not known for high performance by angel'o'sphere · · Score: 1

    Sorry, but your post makes me shudder ;D

    C# is a better language than Java? Well I could also say DreamFall is the best language in the world ... you never heard about it, sad.

    In other words if you find one language better than the other one, some points you like or some points you dislike would be appreciated, otherwise your statement is moot.

    Regarding the IDE especially Eclipse ... again this is a matter of taste. Eclipse is lightning fast, no idea why you feel different.

    Same is true for features. You claim MS VisualStudio has more? Rofl ... how many third party add ons do you have installed? And who cares about the number of features if you only need 10% of them?

    You don't like the availability for Java libs? Sorry, people use Java in the Enterprise because 90% of the nifty stuff comes for Java first (like inversion of control containers, persistence frameworks/managers, automatic distributed computing, prevaylers, test frameworks, build tools, byte code enhancers/aspect oriented programming)

    And the worst thing which makes your post completely pointless: .Net is running only on very few platforms.

    angel'o'sphere

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  111. So this Mirah removes the esoteric parts of java? by hey! · · Score: 1

    Does it work on the adjectives in Slashdot postings?

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  112. Just read a great quote a few weeks ago: by Qbertino · · Score: 2

    It's from the days when Java was all the hype and goes something like this:

    "Java is a new language that combines the clean concise and easy syntax of C with the blazing speed of Smalltalk."

    Can't remember from whom it is but it definitely is the best quote on Java I've heard so far. :-)

    --
    We suffer more in our imagination than in reality. - Seneca
  113. Re:Pry my curly brackets from my cold dead hands by mr_da3m0n · · Score: 1

    Problem is: when I look at your python code, I don't know if I'm looking at spaces, or tabs, or some combination of both. Not without a hex dump, or something.

    Yeah, you do -- PEP8 style guide recommends 4 spaces soft tabs. If your editor shows hard tabs as 4 spaces you can easily find out. Python code won't run if you use a _mixture_ of both. You have to pick one and stick with it. So it's only a perceived issue, really. If what you're pasting isn't how you're writing code, it's a simple matter of hitting ':retab' in vim.

  114. Re:Performant is not a word. by Sique · · Score: 1

    Completely offtopic, but Dollar comes from "Joachimsthaler", whit Joachimsthal (today Jáchymov) being a small miner's town at the czech-german border where a silver coin called "the Joachimsthaler" was minted. Later on the name was shortened to "thaler", and that's where all the other languages (slovenian: tolar, english: dollar etc.pp.) got it from.

    --
    .sig: Sique *sigh*
  115. Comment, Question, Conclusion by Sla$hPot · · Score: 1

    Ugly!, Why?, No

  116. Re: Not even about syntax for me. (informative ran by Saint+Stephen · · Score: 1

    Composition is less brittle than inheritance.

  117. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by e70838 · · Score: 2

    I think the main defect of Ruby is its library. This library lacks of naming consistency and suffers from confusing name aliases. The Java library is a lot better.
    The syntax of Java is poor, it is not very concise and the syntax of recent additions (generic, enumerate) is not very clear.
    I think a next step would be to write a translator from java to Mirah, to stop using jvm (either switch to dalvik or openjdk), then to say good bye to Oracle.

  118. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by Ichoran · · Score: 1

    The most advanced Scala notions do not map to Java, agreed. So if you don't use them, what's left is a language that fills the design goals of Mirah, as I said. If the goal of Mirah is not "Nicer syntax!" but "Language with same limitations that you love from Java!" then the designers could make that more clear.

  119. Re: Not even about syntax for me. (informative ran by HyperQuantum · · Score: 1

    Every object is a reference in Java (...)

    This is almost as if you're trying not to see the advantages. No more segfaults. No double-frees, no crazy-ass debugging where the wrong method gets called because your pointer is pointing to the wrong (or a corrupt) vtable, and you really have to try to get a memory leak.

    No more segfaults... instead, you get NullPointerExceptions. You still need to make sure your reference actually points at something.

    What I don't like most about languages like Java and C# is that they lack the notion of const objects. You are never sure if it's safe to pass an object to another function, because it might modify that data behind your back. The same goes for returning data from an object to a caller: if you return a piece of internal data from the current object (say, a list of some sort), you better hope the caller doesn't modify that list or its elements. So without const you either have to copy (or even deep-copy) everything before you pass it on, or have a loud warning in the comments saying "don't modify this data!!!".

    --
    I am not really here right now.
  120. I just don't care anymore. by Brian+Feldman · · Score: 2

    I know, I fell in love with Ruby many years ago and I still enjoy its expressiveness and ability to let me complete an entire project rapidly. I still use it when I can do something completely stand-alone that has no performance impact on anything, but it isn't something we've adopted at work or anything, officially, as we have Java and C++. There's also plenty of entrenched C, and fellow developers know most old C is a bear compared to something modern, streamlined and extensively-peer-reviewed like an open source OS... but that was my first experience with good code and so I am utterly comfortable with only C and no OO capabilities, as well, but there is zero impetus for doing straight C over C++ outside of OS kernels.

    I do know what I enjoy working with the most. It's not all of the bizarre choices of syntax and convolution, but powerful and low-level language feature base of C++, and perhaps not Java's ultra-stringency (although not having to double-declare prototypes is wonderful, and Eclipse does make building the program scaffolding up from scratch a breeze). I can be productive writing essentially the same kind of software in C++, Java or Ruby but the last decade taught me that other than possible ridiculous amounts of boilerplate (*cough* headers for languages in the C lineage), the choice of platform is not going to end up altering the amount of time it takes to do the project other than that portion.

    I look at these examples and I do appreciate the visible elegance of more compact and expressive languages. But I also don't see any reason to not use Java on the Java VM because it is extremely capable on its own and high-level enough that an IDE can truly handle ALL of the boilerplate connections for you. It's plenty readable, and plenty writable as long as you aren't sticking with old tools that don't do code-completion. I'm not going to become much more productive by having functional programming facilities, am I? I don't even have to create my interfaces ahead of time -- the IDE handles pushing method declarations out from the class to an ancestor interface with a few clicks.

    It could be that while I do adore the Ruby syntax I don't see any particular reason to favor functional programming over procedural. Note that C++ actually supports functional programming perfectly well, however, most standard C++ APIs do not use that sort of convention, favoring only the procedural/class method system.

    --
    Brian Fundakowski Feldman
  121. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by Ichoran · · Score: 1

    Only the "drag a runtime library" does not also describe Scala (and possibly Clojure, though it's questionable whether static-type-annotated Lisp "looks nice"). If that were an important concern, personally I would have made scala-lite that drops all but the essential core library support, and where the compiler auto-inserts the remaining stub into the main class file (which is pretty much what you get when you use Proguard on a Scala project that doesn't use the extra Scala libraries explicitly). But if the "no library" part of the puzzle is really important, then I at least see the point. (Or if you just like Ruby-style syntax enough that anything else is not acceptable.)

  122. Re:Your "understanding" is nonsense. by e70838 · · Score: 1

    Yes, but Jython brings the usual python library with it. The soup resulting of mix up of python library and java library is not very clean.
    Python is a clean language with a decent library. Jython is not.
    The purpose of Mirah is to replace the not very good syntax of Java by a smart syntax derived from Ruby, only focused on being a better syntax than Java.
    The result should be a clean language better than Java.

  123. Re:Pry my curly brackets from my cold dead hands by Anonymous Coward · · Score: 1

    >Problem is: when I look at your python code, I don't know if I'm looking at spaces, or tabs, or some combination of both.

    Editors usually show tab characters as a right arrow.

    >And one invisible character out of place, and god-only-knows what sort of unexpected results I get.

    Actually, it defaults to treating a tab the same as 8 spaces, so no surprises.

    >Also, I probably can not cut-and-paste your code into mine, and have it work, without substantial modification.

    Huh? Why?

    >Too bad that practically everybody on slashdot thinks of BASIC as GW-BASIC. Most versions of BASIC, that are less than 30 years old, actually have it right - no curly brackets, no counting spaces and tabs either.

    begin sentence
                    No they don't have it right.
    end sentence -- why is that even here?

  124. Re:Wrong/Unimportant Problems by nschubach · · Score: 1

    My problem with C/C++ is not the curly braces... in fact, I love the idea that a curly brace could be a block of independent code assignable to a variable and passed around like an object (ie: Javascript) ... I'd also argue that segregating logical blocks of code into bracketed notation would make it easier to thread off blocks of said code while having the compiler pass along only the variables needed to process said chunk. Also, garbage collection (I feel) falls in that same chain of thought.

    What pisses me off about C/C++ is the insistence on header files to declare everything you are going to define in another file. Why can't I take a cue from the ECMA standard and code C++ methods that way? (This is probably the biggest hurdle I've been fighting myself over when I read the books and tried to learn C++... the amount of "boilerplate"/"standard" code.) Sure, you can do it all in one file, but that introduces issues with the compiler and calling methods in classes that are not compiled yet.

    --
    Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  125. Re:Wrong/Unimportant Problems by e70838 · · Score: 1

    All you says about C++ is correct. The problem of C++ is not readability.
    The main problem of C++ is "what is executed is not what is written": there are many implicit constructors, converters, destructors or overloaded operators that are added during compilation. In general the bugs are in code you do not see. With the templates, the bug may be in code that do not even exists yet. Overloads of operators and namespace usage bring a lot of headache when mixed.
    I hate also C++ because of all the problems I have encountered when I needed to mix different COTS libraries.
    I do not think that a new syntax front-end would help to be more productive in C++.
    The 5 languages Perl,Python,Ruby,OCaml and GHC have proved to allow very fast coding speed.
    The main common point is the attention given to the syntax.
    I have used Java quite a lot these last years and I am pretty convinced that coding would be faster if the syntax was less stupid.
    The syntax is not the main problem of C++, but for Java, it is a very important one.

  126. Re:Pry my curly brackets from my cold dead hands by nschubach · · Score: 1

    Except that I don't like typing "end." ;)

    I grew up on GWBASIC and QuickBasic and I don't miss that at all. I have grown to respect the curly braces.

    --
    Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  127. Re:Pry my curly brackets from my cold dead hands by nschubach · · Score: 1

    I'm an end-liner... I think having one line dedicated to a symbol is best reserved for ending a line of thought, not starting one.

    If you are so concerned about lining up code, use tabs. A character specifically designed to line things up.

    Also, I block everything including case statements and single line conditionals. Putting braces on a new line would make my PageUp/Down buttons hate me.

    --
    Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  128. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by menkhaura · · Score: 1

    as direct and fast as Java

    Tee-heh, kids these days :)

    --
    Stupidity is an equal opportunity striker.
    Fellow slashdotter Bill Dog
  129. Closures rock by microbox · · Score: 1

    It is not merely throwing memory at a problem: closures provide a simple and clean design pattern that can really cut down on cruft. Wish C++ had them, even though the language is already a dangerously complex mess.

    --

    Like all pain, suffering is a signal that something isn't right
  130. Really? You find that more offensive than genocide, pedophilia, and split infinitives put together?

    What's so offensive about wanting to brutally genocide pedophiles?

  131. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by Headius · · Score: 1

    A Java to Mirah translator would be great! Currently there's a Mirah to Java compiler, for tools that must have Java source. But if it were possible to convert Java code directly to Mirah, it would definitely make migration faster.

  132. Re:Because syntax is _everything_. by Darkfred · · Score: 1

    I was implying that as you progressed in your career you would learn more than your starting language and stop being confused by the different syntax's used. Once you pick up 5 or 10 and can filter what was once noise all functional languages start looking the same.

    --
    ----- 70% of all statistics are completely made up.
  133. Re:Performant is not a word. by lennier1 · · Score: 1

    There's always Mono, but that's a longer story.

  134. Re: Not even about syntax for me. (informative ran by benhattman · · Score: 1

    So keeping that in mind?.... Java and the JVM was a non-starter for me.

    Every time a new object oriented language comes out the purists start with "we don't need multiple inheritance" and so on, and they always end up having to hack it back in as some half-conceived junk (see "interfaces" providing, at a later date, all the much shat upon "complexity" of multiple inheritance with none of the ability to provide a default implementation, so then you add delegation which is all the default implementation with none of the inheritance etc...).

    Wait. What? You do know interfaces were there from the start right? Here's an example, the much hated cloneable has been in the language since 1.0 - http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Cloneable.html.

    And like the rest of your rant, you're glossing over the real problem with this language feature you like. As frustrating as single inheritance can be, multiple inheritance simply does not work right. If you don't die from the dreaded diamond anti-pattern, you may have to manually rewrite each method with explicit indirection to clarify which call is intended.

    There's so much truly annoying about Java, and you seemed to have missed it all for design decisions that actually make sense. Garbage collectors aren't always good, but to claim a language that provides them is terrible is just insane.

  135. Well they are heavy and dense anyway... by IBitOBear · · Score: 1

    It sure is throwing memory at problem. A closure is a snapshot of memory from a context so that you can peer back into that moment of time to the values in place at the time, to arbitrary depth.

    In C++ you have to return the information explicitly. That is you have to decide at the "moment of closure" what memory you are going to save rather than having the environment do a graph completion of rechable data and store it.

    By the way if you know the data you are actually going to use you can construct a functor, or (terribly) collect that data in a function and then return a pointer to a nested function that "can see that outer scope"... eeeew...

    So yea, in some language you can get the non-select clone of memory to arbitrary depth so that you don't have to selectively save the information yourself.

    That's is the very definition of throwing memory at a problem.

    (I know the technologies quite well, and I know their implications. Closures in your language of choice were implemented in C so by definition you can implement them in C. But like I said its just the latest secret sauce...)

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
    1. Re:Well they are heavy and dense anyway... by SanityInAnarchy · · Score: 1

      A closure is a snapshot of memory from a context so that you can peer back into that moment of time to the values in place at the time, to arbitrary depth.

      That's the most obvious implementation, but it's not the only possible implementation. For one, unless the code in that closure has a call to "eval", you can pretty much read the symbols in it and figure out which variables it needs access to. In other words:

      In C++ you have to return the information explicitly. That is you have to decide at the "moment of closure" what memory you are going to save

      In a proper implementation of closures, it's still deciding what memory you're going to save, and it's doing it at compilation time -- so the net result is the same, you just have to do less work. What's more, in a language with a Java-like memory model (which Ruby kind of has), it's copying either primitives or references, not whole objects, so it's quite cheap.

      Closures in your language of choice were implemented in C so by definition you can implement them in C.

      First, not necessarily. I'm fairly sure there are Lisp compilers that were not written in C. Also, given the state of the best closure-enabled VMs or compilers, the C "implementation" is effectively a compiler written in C -- it's certainly not just translating the construct from that language into C.

      Second, that's as irrelevant as saying, "Everything in language X was written in something which was written in something which eventually was written in assembly. By definition, you can implement anything in language X in assembly." Would you rather use assembly than C++?

      The point of closures isn't that they enable you to do anything you can't do in any other language -- Turing-completeness means that anything you can do in one language, you can emulate in another.

      The question is, how ugly is it going to be?

      You answered this yourself. You went "eeeew" every time you suggested a way of getting at the functionality in C++. In Ruby, a closure is do...end, and it's quite efficient, considering that this is how most loops are implemented:

      mylist.each {|x| ... }

      Figure most of your for loops would be replaced by that. Yeah, they're going to want to optimize the hell out of that.

      Now, I have to ask:

      I know the technologies quite well, and I know their implications.

      If that's true, it is possible I'm missing something. Is there a reason my suggestion wouldn't work? That is, is there a reason a closure has to actually create a snapshot of memory, or is it enough for it to conceptually do so?

      --
      Don't thank God, thank a doctor!
  136. You sir, are proving my point. by IBitOBear · · Score: 1

    Those things Java calls references are actually _pointers_. If you can write "VariableName = null_value" then its is a "pointer" because it "may point at something". A reference _always_ references something valid for its entire lifetime. That is the the _definition_ of the difference. Since a "Java reference" can be null, its a pointer not a proper reference. [Most people who "don't get" pointers think the status has something to do with being able to move the pointer relative to its previous value, but they are wrong. The fact that you can "walk a tree" using the *ahem* reference *ahem* until the reference is null... well that's what pointers are son.]

    But you are right in one thing, interfaces are NOT multiple inheritance and I made that clear in my post. They are, as stated, the ugly side-on hack that had to be grafted into Java because the single inheritance tree being fixedly rooted in "Object" prevented them from "un-making" their original mistaken belief that an object never needs to have common ancestry with more than one family tree.

    To put it in biological terms, Java was built around the asexual reproduction paradigm, but over time most (but not all clearly) living systems discover that sexual reproduction is superior and nine-out-of-ten organisms in the ecosystem end up benefiting from the genetic line of multiple ancestors. So to with objects, but since Jave has no gametes, they had to introduce parasitism by creating a way to graft on shriveled little side-definitions to the objects linage.

    So you sir, are a fan boy who needs to read up on the technology before you go correcting people who have done.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  137. Re:Meanwhile: Ruby not so good. by SanityInAnarchy · · Score: 1

    It's hard to imagine how you could be more wrong.

    The fact that Ruby to C produces code "neck and neck" with ruby running inside the JVM is pretty much a universal indictment of Ruby,

    On the grounds of... what? Performance comparable with... what?

    See the plain truth is that the JVM is a least-common-denominator.

    It is, but only in a certain context -- in particular, enterprise applications. It's certainly not a least-common denominator for desktop apps -- look how many people have to install Java just to get Minecraft running.

    It is an interpreter for gawd's sake,

    You pretty directly contradict this with:

    and one that knows it is sufficiently crap that it has a "just in time compiler"

    You know what? C can be interpreted, too. You wouldn't run it that way, though, would you?

    So, Java can be interpreted. It can also be compiled. The JVM includes both.

    What about this implies the JVM "sucks"? That it has more features? Or that some of its features aren't a good idea all the time (interpreter), so it automatically chooses a more appropriate mode of operation (compiling)?

    why not just JIT the entire code base?

    To reduce startup time. You do understand the difference between just in time and ahead of time, right?

    And if that, why not just compile the code base once to begin wiht?

    You know what? gcj does just that.

    But then you lose the runtime flexibility. Reflection can be useful, for one, and that pretty much demands that you keep some sort of intermediate representation around. And then there's the part where I can compile a program for one architecture on one OS, and copy the bytecode files to another architecture and OS, and expect it to work.

    Why don't you ask the JavaScript developers why they don't just compile everything? They do compile quite a lot, and I think they might even be doing a better job than the JVM, but a language that dynamic just doesn't make sense as a binary blob.

    And then there are the pathological cases where runtime-optimized code can perform better than ahead-of-time compiled code, because the runtime can take into account what is actually happening.

    claiming it is new, novel, "a work of art" or any other damn thing is...

    Something I see no one here doing. Strawman much?

    Ask yourself why JINI had to be invented?

    Because there's tons of stuff written in C.

    Yes, you can occasionally get a speedup by translating chunks of your program from Java to C. Ask yourself why it's only isolated libraries that do this, and not large chunks of applications. Turns out Java is "fast enough" -- half the speed of C is still plenty fast for most applications, especially with the other advantages you get.

    Ask yourself why JIT?

    Again, why are you seeing JIT as a bad thing, and why are you seeing it as not part of the JVM?

    The whole "compile once, run anywhere" thing is a _lie_ for two reasons.

    I guess that program I wrote on my x64 Linux, then sent to someone else running a 32-bit Windows machine, was a figment of my imagination?

    (1) the results "run anywhere" but only for _extremely_ constrained definitions of "anywhere"

    Any desktop OS is still pretty damned good. The only reason it's not more relevant is that web browsers have gotten good enough that most of the original use cases of desktop Java don't matter anymore.

    you "compile once" so the JVM can compile it again and again during runtime.

    You mean, so it can compile it once per run, once it determines that it's worth compiling that chunk of code.

    --
    Don't thank God, thank a doctor!
  138. Re: Not even about syntax for me. (informative ran by SanityInAnarchy · · Score: 1

    No more segfaults... instead, you get NullPointerExceptions.

    Which throw a beautiful stacktrace, and generally take a few minutes to debug.

    By contrast, a segfault may be caused by code that lives in an entirely different part of your program because you somehow screwed up how you're handling pointers.

    What I don't like most about languages like Java and C# is that they lack the notion of const objects.

    I really don't miss it, because it didn't really seem to have well-defined semantics in the first place. Java does have 'final', but it doesn't quite do the same thing.

    However, when this is actually an issue, you can either use deliberately immutable classes, or you can copy it ahead of time. Not as nice as const, partly because it's not universally supported -- but neither is const.

    There is a solution I've used from time to time which is kind of gross, but very workable -- since well-designed Java APIs use interfaces, if I need to return an object or pass it to another object and be absolutely sure it won't be modified, I can create an immutable wrapper object -- tedious, but not hard.

    Incidentally, this is one reason I love Ruby -- such wrapper objects are relatively easy to create, and I can write libraries to make them easier. No need to implement every single method in the interface, I can just give it a list of methods to proxy and let it do the rest.

    --
    Don't thank God, thank a doctor!
  139. Since I must... (sorry for your fail...) by IBitOBear · · Score: 1

    template<class D>
    struct Closure {
        const D Datum;
        Closure(const D & datum): Datum(datum) { return; }
    }; ...
    if (test)
    return Closure(cruft);
    else
    return Closure(other_cruft);

    God, you are so right... I wish I could do this in C++... well maybe someday...

    oh wait...

    Well its not possible in C though right? bzzzt... wrong... see [ http://grub.enbug.org/NestedFunctions ] though in this case the "closure" only lives for the duration of enclosing composite expression vial the "thunk" mechanism.

    Or "for_each(x.begin(),x.end(),functor_type(takes,these,four,args));" to apply an instance of functor_type(initialized with four values at runtime) to each element of sequence x.... oh the freaking humanity, writing all none of those nested loops in C++ just killed me to death...

    (now I left off all sorts of syntatic and semantic sugar from a fully body of ready to use code, but _seriously_ dude, this is not that hard. that new. or that special. _Every_ functor of complexity greater than O(1) is likely to be a closure. By the time you are using smart_ptr, Function Pointers. References. Carrying references through iterators, and tons of other possibilities, well doggie, you have it all with none of the waste.

    Your language was written in my language dude, if my language couldn't do it yours wouldn't be able to do it either. Like smoke and mirrors it is all memory and pointers. The fact that _you_ don't know how to do it doesn't mean that it isn't done every day. That whole thing you dismiss about the nature of this language inside language _remains_ _true_ whether you dismiss it or not.

    Really, your shiny new toy is nothing special... sorry.

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
    1. Re:Since I must... (sorry for your fail...) by microbox · · Score: 1

      Sure you can do it in C++, it is just a royal pain in the ass in comparison. Since programming is fundamentally about managing complexity, this is an important factor. Supplying a block of code, and having all of the relevant parameters bound is simpler than constructing a new type, initializing it correctly, and hoping that library X makes use of it.

      Spend some time outside of C++, in a functional programming language, and you will find it hard to go back. That is my experience.

      --

      Like all pain, suffering is a signal that something isn't right
    2. Re:Since I must... (sorry for your fail...) by IBitOBear · · Score: 1

      I have spent my time with many languages. Yes, to get exactly the behavior I want without throwing excessive memory or language overhead I have to make a whole template class that meets the requirement. The horror.

      Note that you are simply wrong. Your assumptions are flawed in terms of what is possible and they remain flawed in terms of it being "a royal pain in the ass". You take a contrived-for-example sample code and get all "well mine is easier". Well dude, mine will run in linear time and involves none of that executable data on a stack frame (e.g. the number one vector for buffer over-runs and system smashing, one so pervasive that hardware manufacturers actually changed the way me make CPUs in order to defeat that hole that your language _requires_).

      You want to get into a measuring contest? I can whip out boost::qi and write an entire recursive descent parser in overloaded operators like "source >> double_ % ','" to parse and store a list of one or more floating point numbers separated by commas. But unlike your interpreted language it can be fully optimized at compile time, long before it sees the first line of input or a single CPU cycle on my production hardware.

      I can write a six-line functor that will recursively express an entire tree to any complexity and depth with visual indentation.

      Of coures it takes marginally more effort to make a finely crafted expression of algorithm; just as it takes more effort to hand-craft a piece of fine-crafted leather and hardwood furniture than it takes to assemble a press-board and wing-nut ikea bookshelf.

      Now understand I put together a heck of a lot of bookshelves as well. The number of little scripts I make each week or month is legion. I match the available tools to the job at hand. The other day I had to slap out a six-line event driven serial terminal program in tcl (it can be done 8-) because I couldn't change the software load on the classified device that was the only thing near the other classified device that I needed to talk to using a USB to serial dongle. [quite annoying too, because every time I pressed ctrl-break I had to type the program in again.]

      The facts are thus: Every language has a purpose and a fan base. No language is the be-all or end-all of languages. Many languages have features that are not as unique as the fan base believes them to be. Once you know how to program, the language is pretty much just a choice of _which_ _way_ you want to have your hands tied. I am "fluent" down to "workable" in C, C++, Erlang, Ada, TCL, BASIC, Pascal, COBOL, Bash, Lisp, awk, SQL, expect, chat, a few specialty languages of my own invention (to stretch the point a touch), Forth, Postscript, Perl, NetExpert (lord save me from that), Php, a little Java (but eeew), lua, and I am sure there are others I have forgotten.

      The way your pet language applies one set of data to another is not going to impress me very much. Honestly "array slicing" in Ada was the last paradigm that really impressed me, especially as a way to create and destroy tasks. Not because it was somehow unbelievable but because the syntax was so elegant.

      Then again the use of matching in Erlang is right up there too. Erlang would be my favorite interpreted language today if it weren't such a puzzle language (pick up a piece of erlang a year after you last looked at it... blarg! 8-). I am still having fun with erlang, but it isn't gonna make me set aside my C/C++ primary.

      And yes, I can be won over by elegant syntax. Your closure syntax isn't it. Ruby sure wasn't it. Java and the JVM hasn't been it for a very long time.

      And don't even dare try to lecture me about Managing Complexity and then say "hoping library X makes use of it". In a compiled environment we _know_ which library is going to use what. It's your interpreted languages where you toss data into a resolver and then have to hope. It's impossible, more or less, to write C++ that will fail to dispatch a method when a method is called. Not so for Java and other interpreted lang

      --
      Innocent people shouldn't be forced to pay for inferior software development.
      --"Code Complete" Microsoft Press
    3. Re:Since I must... (sorry for your fail...) by SanityInAnarchy · · Score: 1

      Note that you are simply wrong. Your assumptions are flawed in terms of what is possible and they remain flawed in terms of it being "a royal pain in the ass".

      Does not follow. Being subjective is not "simply wrong."

      Well dude, mine will run in linear time and involves none of that executable data on a stack frame

      Congratulations! You just proved that closures can run in linear time and do not require executable data on a stack frame.

      It'd be nice if you actually admitted you were wrong, earlier, when these were exactly your complaints about closures, as a language feature.

      (e.g. the number one vector for buffer over-runs and system smashing, one so pervasive that hardware manufacturers actually changed the way me make CPUs in order to defeat that hole that your language _requires_)

      That code written in my language cannot ever cause.

      It's kind of funny how backwards you have this. In C -- and, by extension, C++ -- hardware manufacturers actually changed the way we make CPUs in order to force you guys to not accidentally execute data, because fundamentally, pointers are all just integers, after you remove the "smoke and mirrors".

      By contrast, it is impossible to write Ruby code which has a buffer overrun. It is possible for the interpreter to have an overrun, sure -- but it's also possible for CPUs to have security flaws. (And before you say it, by "interpreter" I really mean "VM", and by "VM" I really mean "Runtime".)

      It's ironic, really. In Ruby, it's true, I could "eval" a string and thus turn user input into executable code right at that point. But until I actually call "eval" (which I generally don't), there is no way a user can enter a string which can make my program execute arbitrary code.

      You can write C++ that is reasonably safe -- yes, I'm aware that C++ strings are. But then, there's always stuff like gets() lurking around the corner, and it isn't realistic to write C++ without using pointers at some point.

      You want to get into a measuring contest? I can whip out boost::qi and write an entire recursive descent parser in overloaded operators like "source >> double_ % ','" to parse and store a list of one or more floating point numbers separated by commas.

      Contrast to:

      source.split(',').map(&:to_f)

      Built into the language, and a bit more readable than your example, I think. But get back to me when you have something comparable to rspec.

      But unlike your interpreted language it can be fully optimized at compile time,

      So what? Was I ever once suggesting that Ruby is as fast as C?

      What's more, I'm not convinced languages like Ruby can't be optimized, even at compile time. They just generally aren't. Ok, it's being compiled again and again every time I start my Rails server. In what world does it matter that it takes a few seconds for the app to start, if it's then going to be running continuously for months?

      No language is the be-all or end-all of languages.

      We're again in complete agreement!

      And yes, I can be won over by elegant syntax. Your closure syntax isn't it. Ruby sure wasn't it.

      Note that you are simply wrong.

      Or are you willing to say that this is also subjective?

      It's impossible, more or less, to write C++ that will fail to dispatch a method when a method is called.

      "More or less."

      It is, in fact, possible to write C++ that will dispatch to the wrong method when a method is called.

      Suppose you cast a pointer to void, then back to another type which is compatible with the type you started with -- maybe a parent type, maybe a child type. This is how things work in C with void pointers, and it's how they work

      --
      Don't thank God, thank a doctor!
  140. Re:Java & Ruby: Not known for high performance by angel'o'sphere · · Score: 1

    Well, nevertheless I assume it is a matter of taste. I found the .Net libraries poorly crafted rip offs of the Java ones.
    I can not follow you at all that you find them superior.
    Regarding generics, sorry, .Net and Java use the same approach to generics ... except for primitive types. The are both completely identical for any practical purpose ... and I don't liek generics, give me templates please. ...

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  141. Strawman. by SanityInAnarchy · · Score: 1

    Before we go any further, you need to demonstrate some reading comprehension:

    Your language was written in my language dude, if my language couldn't do it yours wouldn't be able to do it either.

    I addressed this argument, at length, and rather than refute any of my arguments, you're ignoring it and repeating your own. That strongly suggests you didn't read my comment at all.

    Again: "Your language was written in my language" is as relevant to the topic at hand as the fact that all languages being discussed are Turing-complete, and that your language was written in assembly. The implication of your argument is that we should all use assembly, since it "by definition" has all features of all other languages. Do you really believe that?

    Taking it a step further, as much as you talk like you understand how VMs are implemented, you still use an argument which suggests that Ruby code is compiled to C or C++ first, and then executed, and while there have been some interesting attempts, this was never the mainstream approach. Ruby closures are not implemented this way, and do not depend on any closure-like syntax you could build in C/C++.

    God, you are so right... I wish I could do this in C++... Well its not possible in C though right?

    I never once claimed these were impossible, and when people start strawmanning me, I generally stop listening.

    In fact, I explicitly said that it was technically possible, thanks to Turing-completeness.

    now I left off all sorts of syntatic and semantic sugar from a fully body of ready to use code,

    Yes, you did, and that is exactly what counts. With your model here, my "each" example is now at a minimum:

    mylist.each(Closure(cruft));

    Contrast to:

    mylist.each{|x| ... }

    Your example is already more needlessly verbose before you even get to the actual data. It looks as though you need at least some preprocessor hacks, probably built on top of something like nested functions -- ugly as hell, compared to what you'd be able to do with at least anonymous functions.

    well doggie, you have it all with none of the waste.

    If you really believe that, you understand far less about high-level languages than I do about C++. Please explain how smart_ptr prevents me from ever having a segfault, from my own stupidity or otherwise.

    --
    Don't thank God, thank a doctor!
  142. Words w/2 meanings? No cognitive dissonance: why. by Web+Goddess · · Score: 1

    We have lost so many words needlessly. Rapeseed is an oil seed once grown mainly in Europe. Today we are aware that some food oils are healthy, and some are not; when people noticed that Rapeseed oil is healthier than others, it became a celebrity cooking oil. How to market it, though? Rapeseed oil? um... gRapeseed? um... today, we call Rapeseed oil "canola oil."

    I thought it was sad we've lost Rapeseed as a socially appropriate crop, but then, why go on growing a crop called Rapeseed when the word represents an act that is so repugnanat?

    Further musing on philosophy that stems from a dictionary "fixation" of a term: flammable and inflammable. Let's move on beyond the obvious confusion. WHY are there ambiguous terms like this? As a scientist, I suspect there is a category of things that are so important, we only need to know the existence of the problem, not its polarity. In other words, only one meaning is important, while the other can generally be discarded.

    Consider the word pair, flammable/inflammable. We need to know if something can catch fire. It's a special context. We look across the campfire and worry that the dancing children will catch on fire, and we shout out, "Are their banners ___?!" ( We never look across the campfire and wonder if that (say, an iron grille) might _not_ catch on fire, and shout out, "___!?" )

    Such terms are very special. They are a barometer for our species' priorities.

    I was once really bothered by the flammable / inflammable conflation, but the more I grow, the more comfortable I am with words that are defined by common useage, not because "there's nothing we can do about it" but because "perhaps common usage knows more than I do about this word."

    Love, the Word Goddess