The Mirah Language: bringing modern features to the JVM without runtime overhead
drdobbs.com
drdobbs.com
The original goal for this was to allow Mirah to be used in places where Java source is required, like GWT apps. We've kept it going over the years (thanks to Ryan Brown, my co-conspirator).
3-part tutorial on how to write Android apps in Kawa: http://androidscheme.blogspot.com/2010/10/introduction-to-an...
What I found was that it seemed to be (mostly) possible, but there was NO documentation on how to do most things. With someone's help, I got the tutorial working, except for 1 last bit at the end that wasn't really necessary yet. I never did figure out how to do that bit.
This is the tutorial: http://www.droidnova.com/android-3d-game-tutorial-part-i,312...
The part I never got working was the 'queueEvent' bit of the 'onTouchEvent' bit. Without queueing it, I could get it to work, but I could never figure how to queue it like that.
My sources as I left them: https://github.com/wccrawford/Hello-Mirah--Android
Without any documentation or real info out there on Mirah, it was incredibly frustration just to get that far.
I realize it's a new language, but I can't recommend its use at this point. It needs to mature and gather a community before it's worth investing serious time in.
Cool example.
* docs (as mentioned)
* some kind of javadoc / rubydoc mechanism (perhaps there is?)
* a NetBeans plugin
* a pony
OK, maybe I can get by without the last one :-)
I've been thinking about a MirahDoc format. I think we could pretty much do it like JavaDoc. Potentially even make it work with Doclets.
There is an old NB plugin based on the Ruby plugin, but I doubt it works now. We'd love to have help here. The plugin is on github: https://github.com/mirah/mirah-netbeans-plugin. Of course we'd like help supporting Eclipse and IntelliJ too.
I've spent the last several days trying to solidify a distribution (.zip), maven artifacts (with David Calavera's help) and refactor the codebase to make it more approachable. Last night I made some edits to the mirah.org web site, and today I may try to work on the wiki. There's definitely a lot missing as far as documentation and support, but we'll get there.
I appreciate your feedback and links to your projects. They will help us learn what needs to be better documented, and also help us produce better error/info messages from the compiler.
We'd also love to have your help :) This is OSS of course, so anything you can do to document your experiences (blog posts, add to wiki on github, ...) will help us and others.
http://github.com/technomancy/ferrante
It took a lot of diving into undocumented things; it's definitely at the point where to do much you have to be ready to blaze your own trails. Though while writing Ferrante I factored out a bunch of the icky build things in Pindah, so it's much easier now: http://github.com/technomancy/ferranteIt's a huge improvement over a year ago, when I had to get Charles to fix a bunch of compiler issues just to get the simplest of apps to compile: http://github.com/technomancy/Garrett
Charles Nutter is insane. I've got to find a way to use this myself. Maybe for his encore he'll rewrite JRuby in Mirah, just to show Mirah is everything Java is and more. Or maybe the world will explode, who knows.
Actually, that was part of the motivation behind Mirah; Rubyists don't want to contribute to the parts of JRuby that are implemented in Java.
See https://github.com/thbar/opaz-plugdk/tree/master/plugins/Dub... for an example.
Looks very similar to ActionScript 2, with shades of Scala. Really neat looking language.
Anyone know where the `param: Type` (i.e., parameter name colon type) convention came from? I've seen it more frequently lately, and I wonder if it's easier to parse than Java's `Type param` (or my favorite: `param Type`)?
The param:type notation I largely just stole from Scala, but it seems (in my novice opinion) easier to parse as well. It also fits better with optional type declarations, which we have in the case of interface impl or class extension (easier to omit syntax on the RHS than on the LHS for a typical parser).
It's easier to parse if your type syntax uses juxtaposition. "Some int" is a valid type, so it would make "<type> <var>" harder to parse. It's hard to tell when the type ends and the variable name starts without backtracking.
Since languages like Haskell and ML (and Scala, to a lesser extent) do type inference, type annotations are often unnecessary, and so having the type listed after the name probably makes more sense in that context: what's important is the name, and variable-specific type hints are usually there for the compiler, not the human reader. The exception is functions, which very often get type definitions just because it's very helpful to have that information as a human. Since ML/Haskell-like languages have multiple function definitions and rely on pattern matching, the postfix type notation fits in very well:
func :: type1 -> type2
func a = ...
func b = ...http://en.wikipedia.org/wiki/Pascal_(programming_language)#P...
But Pascal stole from Algol. Nothing new under the sun...
Has anyone written anything in mirah thats been deployed? I assume it can be built pretty much in the same way as any java project.
But last time I tried it, there was massive compile time overhead (30 seconds for hello world, on a eee PC). Has that changed? I'm possibly getting it confused with a bunch of JVM languages that I tried out at the same time.
- Performance equivalent to Java for equivalent code
Pass.
- No language-imposed runtime library
Failed. 5mb runtime lib.
- No more (or not much more) complicated than Java
It depends. For some, Scala feels much more streamlined than Java. For others (esp. those used to dynamic languages), the type system is a huge pain.
- Beautiful
Certainly much more beautiful than Java.
- Perfect integration with JVM libraries
Use existing JVM libs without change.
- Extensible
Major language features such as actors are all libraries. Very easy to embed DSLs.
As far as the others go...I don't disagree. Perfect integration with Java is perhaps a bit debateable, since you can't overload constructors, can't define real static methods Java can see, and so on. But those are minor items.
I don't intend Mirah to be a Scala-killer either. Scala is more of a platform now than just a language, and if you're on that platform, you have my blessing. If, however, you just want something to replace javac everywhere you use Java today, I believe Mirah is a better fit.
My prayers have been answered! A better java has arrived!
My use case is fine with Scala: no deployment issue, no Java legacy other than using a few libs, and everything else is fresh in Scala. So far I'm very happy with the choice. FP makes things really compact.
I like Mirah for the fact that it can generate Java source code (vs. JVM bytecode). I would imagine there are many cases Java compatibility down to the source code level would be desired.
Anyway, good job!
It does require Java 7 and there's no plans to make it work on Java 6-. Unlike the rest of Mirah, this feature (if you use it) does require a runtime library, since Java 7 / invokedynamic do not ship anything builtin for choosing a target Java method. We use Attila Szgedi's "dynalink" project, which provides a default dynamic linker based on Java language specification method selection rules.
Long story short: yes, Mirah can support dynamic dispatch as well, but it needs a little bit of runtime library to support that.