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."
"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
One, no one is going to program in a language named Mirah. Perhaps if it was named M...
Two, there are already several better languages written for JVM.
The only time I've seen that wording was in German.
"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.
Well, in German it is...
If someone wants to invent a language, why make it so very very close to an existing popular language?
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.
Yo I heard you like turds so I put a turd on your turd so you can use crap while you use crap!
How is this any different than using Groovy or even JRuby?
The author of TFA is not on good terms with the English language. In particular, they have no idea how to use commas, apostrophes, or semicolons. (Hey, I'm not the best author, either. But the article could definitely use some editing.) I'm no editor, but this might do for a start:
Performant is in the summary, not the article, but I would be surprised if the anonymous submitter were someone other than the author of the article, given the summary writer's inability to string words together coherently. I'm assuming they'll see the comment here. (I'm too stubborn to allow Disqus comments and post this on their blog.)
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.
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.
Actually, yes it is. It's been used in computing at least as far back as 1977.
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;
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
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
Just what the world needs. Java is sooooo complicated. Can't someone please make it friendlier, because learning another language will make my life soooo much better. (written while learning Objective-C after holding out for years. I guess C and C++ just weren't different enough for those narcissists addicted to thinking different)
What's wrong with JRuby? And who did Roja Buck have to blow to get front page on slashdot?
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?
It's a perfectly cromulent word.
It just isn't.
Performant is a perfectly cromulent word.
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
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?
Oh no! Muphry's Law claims another victim!
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.
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)
Eventually it will reach the perfection of Lisp.
Java is performant
[citation needed] And no, not to some microbenchmark that shows some super-specialized test case taking advantage of a JVM optimization where some looped method call in Java was faster than a looped method call in C++. For example, rewrite something like x264 and show that you can get even half to 2/3rds the performance in pure Java (no cheating using C or assembly libraries) and then you might have a case for "performant".
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".
And when they make a compiler that understands natural language, we will learn that programmers can't speak that, either.
It seems like such a subjective thing. Why are people obsessed with syntax?
So much bullshit in just eight words.
Anybody want a peanut?
Mirah is from the JRuby guys (it actually shares JRuby's parser). It's main advantage over Groovy, Scala, and Clojure (aside from Ruby-like syntax ;-) it that it compiles to pure Java byte-code without requiring an additional runtime library. An original motivation for experimenting with Duby was to make it easier for Ruby programmers to contribute to the JRuby core.
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."
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.
Java is the fastest thing you can get, after c++. (That means 10% slower.) And there's plenty of boring business software is built with java (yes, desktop software). However for the game industry that 10% is pretty big deal, and they've already heavily invested in their mature c++ engines.
"You people are idiots" is my only comment to them really. Stop inventing languages and APIs nobody will use.
I would agree with you if I hadn't seen LISP.
Some nice coding shortcuts but I still think curly brackets are the best way to denote blocks, anyone got arguments against using them?
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."
Agreed. Slashdot should headhunt this guy.
How inappropriate to call this planet Earth, when clearly it is Ocean.
Hey look. It's a Java retard responding to a C/C++ retard. How uncommon.
FYI, both of you are harmful to your respective camps.
^^ Nobody's perfect (even if CowboyNeal claims otherwise).
Never thought it hard to understand.
Different strokes I guess.
I am very small, utmostly microscopic.
Slashdot is not a word.
Wikipedia is not a word.
Google is not a word.
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.
Slashdot's hiring process is no different than that of any other modern American tech company: post a flyer of the job description ("Editors must be fluent in English, with strong proofreading skills and interest in the tech sector") on the inside of a utility closet door, leaving it up for 24 hours to comply with American labor law, before promtly removing it.
Then they hire 3 cent / hr. Indians to do the editing from overseas, citing a "lack of qualified domestic candidates." The only exception is Timothy, whose real name is Amit Sharon, who works straight from Israel as part of Mossad's American Media Subversion Division.
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.
Do the needful.
(java + fun) < (fun)
Yes, but as long as it is tied to Oracle, I don't give a fuck one about the dead platform that is Java. That applies to all the decent Java-based languages out there: Scala, Groovy, JRuby, JPython ...
Too bad everybody hates the .NET Framework because Scala would have a better home there. Yeah go ahead and mod me down, but I mean it.
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++.
The only time I've seen that wording was in German.
"Performant" is also a word in French and Dutch. It would not be the first time that English inherits a word from these languages (or the other way round - in France & Germany they have a problem with "computer" being a word). For example: example (French/Latin), Dollar (Dutch: daalder, German: Taler), dope (Dutch: a white sauce to dip your beans in), taptoe (Dutch), dike (Dutch), wildebeest (Dutch), etcetera (French)...
Thank you for your informative analysis (or at least your ability to go read project web site, which can be quite rare here. 8-)
This whole article _still_ seems like a big steaming pile of "who cares" to me. Ruby lost its slot in the language wars, so they brought us "rails" which lost again. Now they want to lose again by moving their syntax and whatnot into Java and the JVM, which is busily being "monitized" (e.g. sued into niche status) by Oracle after their acquisition of Sun.
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?
Talk about chasing rainbows into a sewage pumping station...
Have the Ruby people made a run at reviving their "nicer" niche syntax inside "mono" a.k.a. C-pound (=that was the troll I warned you about 8-) yet? If not that is clearly their next stop on this tour of "eh, whatever" they are taking.
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
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.
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.
Great command of the English language! You've earned a gold star for the day. Maybe tomorrow you can educate us all in arithmetic.
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.
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
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."
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"
Could the Ruby wieners, please leave Java alone, some of us have serious work to do.
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.
Why are people so obsessed with plot? Movies should just be sound-bytes, special effects, and explosions, just ask Michel Bey. (however you spell his name.)
Seriously dude, syntax is _everything_ in any language for any purpose. Study up man. What is the first pass the compiler makes? What is the first thing a programmer has to parse when reading someone else's code? If it weren't for syntax this post would could be a sorted list of words and repetition counts, but it would have no meaning.
"kill not I" from Star Trek original series... what does it mean as wrtten? the plea for mercy: "kill I not", or the promise to behave: "I not kill"...?
syntax is _everything_ in every language.
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
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
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
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.
You could make me interested in web development. Good luck with that.
"Tongue tied and twisted, just an Earth bound misfit
if you hate the language you have to do that much work in so much.
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.
A quick perusal of the Jython site, or even just Jython's wikipedia page, would inform you that you have no idea what you're talking about. Jython compiles to Java bytecode.
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
java is a shitty language for people who love languages. it's good for enterprise development, it's consistent and the design principles are such that a near-retard can write it effectively. it's not meant to be expressive (not to confuse expressive power and expressiveness but i can't think of a better word).
on the other hand, the jvm is a work of fucking art.
as a fellow lover of languages (except i chose haskell instead of erlang ;) ), i think you are prematurely judging the ecosystem and are worse off for it
You'll hate me, but you should have coded it in C# instead of Java, it's a more modern language with better tools. And Java is slowly being 86's from the desktop. It's an add on for Windows. Depreciated under OS X, and not supported consistently under Linux.
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.
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:
Don't thank God, thank a doctor!
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
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.
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
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.
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).
It's common to reach a stage as a developer where you can contrast and compare different syntaxes and how they perform for different tasks. It's also common at this point to believe that your experience with software universe is sufficient to believe you can create something in your spare times that competes with tried and tested languages whose syntax and functionality has been mathematically analyzed by people who knew about this stuff at the same time you were just grasping exactly what the squigglies around a for statement actually do.
All I see here is restatement of the syntax. This is great fun to play with, until the time comes to put some real instructions into a real-world problem.
The c++ syntax _is_ perfectly readable. Most of the boiler plate flies off the keyboard anyway and takes little/no time. Some of the low-hanging fruit (like type inference for assignment statements) is not orthogonal to future standards updates in c++ (e.g., 'auto' in c++0x). I've never understood the hatred for curly-braces anyway. There are bigger problems in languages to solve:
Better inter-process/thread semantics/expressiveness
Better implementations of type inference in the systems languages (OCAML type inference in c++)
Finer grained garbage collection control (multiple garbage collectors on all slab caches, or no caches, not just the heap)
Better integration with static analysis tools (making c++ AST more visible to debuggers, editors, taggers, static analysis tools, etc...)
Better meta-programming facilities (code-gen that can access compiler AST and symbol tables, not just macros, and not template metaprogramming, something like D)
The list goes on. Farting around with a syntax front-end is an epic waste of time.
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.
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
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.
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.
"Groovy is slow as snot"
One the of values of groovy is that when performance is _actually_an_issue_ ... you can seamlessly, transparently and comfortably fall back to java.
Jruby on the other hand, requires ridiculous amounts of memory.
Additionally, groovy has been making great strides in general performance with later releases.
FInally, there's groovy++
http://code.google.com/p/groovypptest/
http://groovy.dzone.com/articles/groovy-action-how-make-5000
just like "Immersive"
think about vala, it has made it easier for non-C programmers to use C.
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."
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
reading the comments in this thread reminds me why i rarely read comments on slashdot.
mirah is java, with a friendlier type system and ruby-like syntax. like jruby, but without having to drag around a huge runtime library, or maintain language compatibility with a language with no spec (ruby).
mirah compiles directly to bytecode, just like java, so it's as fast as java. it has type inference, so types are still there if you want/need them. the syntax is a matter of religion and/or taste, i tend to like it. you also get the entire corpus of java frameworks and libraries for free.
i personally am _more_ excited about mirah than i am about jruby (or even ruby for that matter).
charles nutter is one of the main (the main?) guy behind jruby for those who (for some reason) think this is some sort of attack on jruby.
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
That was beautiful!
Then you shouldn't be writing software. Seriously.
One more language? No problem. But say that Java has a bad syntax, just because is not like pascal! WTF! Java has a VERY simple syntax, much more simple than C++. The only fun of Mirah is to make, for pascal lovers, a easier way to use the JVM. And one thing, have you ever hear about Eclipse IDE? If you want a good way to make Java simple to code, use a good IDE. The days where the syntax of a language is what make it easy to use where gone. Today what defines a language is a good IDE. Without Eclipse, our work with Java will be much more slower and a pain in the ass. I like the idea to have a new language there, they are always a new way to do things, and can bring new ideas and innovation. But I don't like the purpose, a language "easier than Java" just because make it like Pascal or Perl.
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
And that, my friend is exactly your problem. You love programming languages, but you don't love programming. You concentrate on the flaws of the language, as if that's really what matters and not the flaws of the code. Sheesh, get over it. Creating a programming language isn't about creating some kind of perfect thing, it's about fulfilling a need.
It fills me with the urge to defecate.
Objective-C already has much easier syntax than that.
Anything to make Scala go away, what a piece of shit.
Clojure *is* LISP; which is precisely why we *don't* need Scala and Mirah.
(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
You're not alone. there is a lot to like about static typing. Being able to know that all your code paths handle types correctly at compile time instead of at run time is very valuable. Also some dynamic languages have a great deal of boiler plate in every function to deal with multiple types because really a string is not the same as an integer and is not the same as an array or table, and some per-function decisions have to be made on how to handle these additional cases.
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, which makes Mirah doubly pointless.
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?
Keep in mind that this whole byte-code compile thing running inside a virtual machine definition is the UCSD P-System (circa 1975 or so). Its reliable, the voyager space craft are running the P-System even as we speak. But claiming it is new, novel, "a work of art" or any other damn thing is overselling the cow.
Ask yourself why none of the "good" math libraries are written in java bytecode? Ask yourself why JINI had to be invented? Ask yourself why JIT?
The whole "compile once, run anywhere" thing is a _lie_ for two reasons. (1) the results "run anywhere" but only for _extremely_ constrained definitions of "anywhere" and (2) you "compile once" so the JVM can compile it again and again during runtime.
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.
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. 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...
So calling it Mirah or JRuby isn't going to matter... it deserves the JVM and good luck to it I say.
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
performant = notaword.
...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
Who's the fairest of them all?
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.
"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
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.
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.
From the programming samples:
puts "I got a #{a.getClass.getName} of length #{a.length}"
Put that string where, stdout, stderr? What if I want to print a variable only, do I have to put it in quotes with the #{} magic, or if not, what happens, when that variable is a string that contains #{xy}? .substring(0, 5)?
Is that a.length a field called length or a function called length(), and how do you specify parameters like in
How do you write something like System.out.println("Sometimes you need " + ((char) 0xA7) + " special characters");?
I think this coding style breaks all the clarity and consistency that Java's syntax had; it looks like a shell script, and it seems to have the same problems and limitations as shell script syntax.
Lousy Smarch weather.
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.
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.
Etymology: perform v. + -ant suffix1, perhaps after e.g. informant n.
A person who performs a duty, ceremony, etc., a performer.
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.
NO, pointers are NOT the same as references.
NO, interfaces are NOT the same as multiple inheritance
the whole point of Java is that it enforces policies and contracts on the language level that would have to be mere conventions in other languages. And before you come and tell me that its "just syntax" blablab, every single goddamn turing complete language can theoretically perform the same things, its ALWAYS "just conventions". And now get off my lawn.
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.
LOL
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.
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.
You can't handle the truth.
The *finalizer* is called by the JVM, and 99% of the time you'd want custom cleanup code it's a memory-based issue anyway... so it makes sense to leave it under the aegis of the garbage collector.
For all the other times, you can use things like PhantomReference (which AFAIK has been present for more than a decade now) to set up your own little timed checking thread or whatever you desire in order to figure out when the object is well and truly gone.
If your Groovy code is slow then you're doing something really wrong.
When I write Groovy, it's almost as fast as Java.
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'!"
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
I love you. I'm tired of all the pointy haired managers that see 'Java/Oracle/bullshit' on the magazines they read and then frown whenever I mention anything like Linux/BSD/C/best practices tested through time which -slight heresy- happen to work flawlessly. No wonder Java has taken off in the enterprise environment: It's ignorance + power at work, a deadly combination. Java is big, is powerful, has a multibillion company full of bastard managers behind, just as ignorant as you, you can't go wrong! Java is all about process and nothing about problem solving or creativity, which means the minion programmers are interchangeable at the flick of a finger. Corporate bliss! Thank god Java exists and Oracle pried it off the idealist paws of those Sun punks!
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...
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 :)
Mirah is kind of a ruby dialect for the java vm. Sounds good at first, but even if a library is written in pure ruby, it cannot be used in mirah.
The complete ruby ecosystem is unusable in mirah. Additionally, the mirah interpreter is far from complete.
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.
http://msmvps.com/blogs/jon_skeet/archive/2005/12/22/79631.aspx
Admittedly from a while ago(and several versions) but a very respected programmer (in both the java/c# communities) though eclipse was much better(and only seems that he started liking VS when he installed resharper which added a lot of stuff to VS that he was used to in eclipse).
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.
Does it work on the adjectives in Slashdot postings?
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
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
Yes, C# is a far better language than Java. It takes the best of Java's syntax and semantics, but discards the shitty parts. Then it adds syntax and semantics that Java very badly needs, like properties, proper generics, and lambda functions.
The .NET standard library is significantly better than the Java standard class library, as well.It's far cleaner and much more sensible in many respects. It really makes Java's class library look like the steaming pile of feces that it is.
I was a long-time C, C++ and Java developer on Solaris and Linux. As much as I prefer developing on a *nix system, I have to admit that C# and .NET are so much nicer to work with.
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.
Ugly!, Why?, No
Composition is less brittle than inheritance.
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.
Load of horse shit! C# is only used on Windows. C# is ripped off from Java. The only reason any Windows developer uses it because of the lack of support for Visual Basic in .NET.
Don't know where you get your facts but Java is fully supported for Linux. Oracle is taking over Java development for Apple, as Oracle has done for Windows and Linux.
You ignorance is outstanding.
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.
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.
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
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.)
What the hell are you on about? They're objects, in the OO sense. No more than that.
>It's statically typed
Thank you!!!
I have to agree... Java code may be verbose, but at least you can figure out what it is doing. When I read Ruby code I routinely see lines of code best described as "and then a miracle happened".
as direct and fast as Java
Tee-heh, kids these days :)
Stupidity is an equal opportunity striker.
Fellow slashdotter Bill Dog
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
Really? You find that more offensive than genocide, pedophilia, and split infinitives put together?
What's so offensive about wanting to brutally genocide pedophiles?
Are you adequate?
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.
while we're pointing out errors,
"etcetera (French)"
what is commonly written "etc." (as an abbreviation of a single word) is actually two words "et cetera" meaning "and the rest"
going even further, cetera is borrowed from a similar Greek word if I recall correctly (been 25 years since HS Latin).
There's always Mono, but that's a longer story.
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.
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
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
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!
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
Well, nevertheless I assume it is a matter of taste. I found the .Net libraries poorly crafted rip offs of the Java ones. .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. ...
I can not follow you at all that you find them superior.
Regarding generics, sorry,
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
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:
Contrast to:
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!
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