DSL for Android development

As a yet to be published iPhone hacker, now somewhat saddened by the AppStore bouncers, I've turned to Android. I have a lot of Java and J2ME experience but only eight months with Haskell. I hate java. The JVM is awesome. Clojure is wish-fulfillment for Android right now. Having used Chicken (scheme) in the past for generating applications for people I know that compiling language A to language B can be very successful, especially when the end-user doesn't know or care how he got his app, only that it works. So... where would be a good place to start with a DSL that could produce Java code as its output? This is new to me! I've written simple lexers and parsers and I know the ropes on that front but I don't know haskell well enough yet to know how to go about it. I am thinking that I'd need to create data types for the major classes, or maybe not, if i can produce my own abstraction that generated multiple classes in the output etc and so i descend into confusion about where to start! I suspect that state carrying monadic types will be prevalent, good job I understand monads. Yes that was sarcasm. I've done the Scheme-in-48 hours thing, so I am ok with parsec. I did consider writing a "true" language that will code-generate java instead of a DSL, that's still in my mind too. As I understand DSL, it's up to me to invent my language to work within the "domain" of Android and then make it create Java code for subsequent feeding to the android tools. As a first guess, I am going to study the "Hello Android" example and then see how I could create a DSL around that little program. As I see it, programming boils down to just a couple of things: function calls and decisions. I appreciate that there is more to it: XML files and images etc to be bound in but that's nothing a good bash script won't fix for me! Thanks, Sean Charles. PS: I know this is a *big* thing to take on but I love big and I love learning so let's rip this one to bits.

On Mon, 27 Jun 2011 15:04:55 +0100
Sean Charles
As a yet to be published iPhone hacker, now somewhat saddened by the AppStore bouncers, I've turned to Android. I have a lot of Java and J2ME experience but only eight months with Haskell. I hate java. The JVM is awesome. Clojure is wish-fulfillment for Android right now.
There are other choices. Have you looked into Scala or Groovy?
So... where would be a good place to start with a DSL that could produce Java code as its output? This is new to me! I've written simple lexers and parsers and I know the ropes on that front but I don't know haskell well enough yet to know how to go about it. I am thinking that I'd need to create data types for the major classes, or maybe not, if i can produce my own abstraction that generated multiple classes in the output etc and so i descend into confusion about where to start!
This seems like an odd approach.
I did consider writing a "true" language that will code-generate java instead of a DSL, that's still in my mind too.
If by this, you mean generating JVM byte codes directly, I'd be
interested in why this is a second choice behind generating Java?
Generating JVM shouldn't be noticeably harder, should result in better
code, can be moved to Android, and is the path taken by other
languages running on the JVM.
Sorry I can't help directly - but I'm also interested in Android
development and hate Java (and find the infrastructure around it
disappointing.)

On Mon, 27 Jun 2011 15:04:55 +0100 Sean Charles
wrote: As a yet to be published iPhone hacker, now somewhat saddened by the AppStore bouncers, I've turned to Android. I have a lot of Java and J2ME experience but only eight months with Haskell. I hate java. The JVM is awesome. Clojure is wish-fulfillment for Android right now. There are other choices. Have you looked into Scala or Groovy? Yes. I learned them both about two years ago having at that point become
So... where would be a good place to start with a DSL that could produce Java code as its output? This is new to me! I've written simple lexers and parsers and I know the ropes on that front but I don't know haskell well enough yet to know how to go about it. I am thinking that I'd need to create data types for the major classes, or maybe not, if i can produce my own abstraction that generated multiple classes in the output etc and so i descend into confusion about where to start! This seems like an odd approach. Only if you consider my complete ignorance of DSL-s and how to 'do
On 27/06/11 18:47, Mike Meyer wrote: thoroughly peeved with "Java the language" and looking for other things. I've kind of settled with Clojure if people want me to produce Java applications purely out of personal choice as I know LISP and it felt familiar. them'. LMAO. This would be a personal 100% green-field venture, ground-breaking, new territory, pioneering never done it before kind of venture for me, to learn new tricks and things.
I did consider writing a "true" language that will code-generate java instead of a DSL, that's still in my mind too. If by this, you mean generating JVM byte codes directly, I'd be interested in why this is a second choice behind generating Java? Generating JVM shouldn't be noticeably harder, should result in better code, can be moved to Android, and is the path taken by other languages running on the JVM.
Sorry I can't help directly - but I'm also interested in Android development and hate Java (and find the infrastructure around it disappointing.)
I hadn't considered generating byte-codes! I've used Jasmin in the past and I actually own a copy of the JVM book from way back. Now *that* would be interesting although Dalvik is slightly different in what it accepts as byte codes I hear. Strewth, the possibilities abound!

On 27 June 2011 15:04, Sean Charles
So... where would be a good place to start with a DSL that could produce Java code as its output?
I think you might find you need a GPL (general purpose language) for Android development rather than a DSL... As a language, Scheme is roughly small enough that a Scheme compiler can retargetted to other hosts (e.g. generate JVM bytecode rather than native assembler or portable C). It would be possible to do this for Glasgow Haskell, but pragmatically there probably isn't much will - it would be a substantial engineering effort.

On Mon, Jun 27, 2011 at 15:55, Stephen Tetley
can retargetted to other hosts (e.g. generate JVM bytecode rather than native assembler or portable C). It would be possible to do this for Glasgow Haskell, but pragmatically there probably isn't much will - it would be a substantial engineering effort.
I think someone's already working on it. The backend work that makes it possible is also why GHC can produce LLVM code, but I think that was actually a "let's see if this works" with the new backend that was designed to support targeting the JVM, CLR, Dalvik, etc. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
participants (4)
-
Brandon Allbery
-
Mike Meyer
-
Sean Charles
-
Stephen Tetley