hello from jabr

18 views
Skip to first unread message

Justin Bradford

unread,
Jul 28, 2011, 7:44:29 AM7/28/11
to The Mirah Programming Language
I just wanted to say hello. My name is Justin, and I'm jabr on on
github. I would love to contribute more to mirah!

I have branch with final and synchronized (with a few limitations),
but what really matters is that I'll be writing a bit more "Java" at
work in the coming months, and if possible, I'll simply be committing
the 'mirah -j' output of my Mirah code.

Justin

Roger Pack

unread,
Jul 28, 2011, 11:21:22 AM7/28/11
to mi...@googlegroups.com
I have branch with final and synchronized (with a few limitations),

Submit pull request :)
Then ask for commit rights!
-roger-

consiliens

unread,
Jul 28, 2011, 1:25:15 PM7/28/11
to mi...@googlegroups.com
On 07/28/2011 05:44 AM, Justin Bradford wrote:
> if possible, I'll simply be committing
> the 'mirah -j' output of my Mirah code.

The source compiler currently has two issues [1], it's broken and the
generated code is far from being "pretty printed."

If you're willing to potentially manually edit every generated file and
deal with bazaar Java code, then it's possible [2]. Once the issues I
mentioned are fixed, then the source compiler work flow will be much
less painful.

[1]
http://groups.google.com/group/mirah/browse_thread/thread/f06833c4a28b6407/b19756177cab5458

[2] https://github.com/consiliens/blog/wiki/Mirah

Nick Howard

unread,
Jul 28, 2011, 1:37:37 PM7/28/11
to mi...@googlegroups.com
I'm pretty sure it's working now. The test suite runs the jvm test cases through both Mirah's bytecode generation as well as source code + javac. The current release might not support it though.
--
-Nick Howard
http://blog.baroquebobcat.com/


consiliens

unread,
Jul 28, 2011, 7:01:47 PM7/28/11
to mi...@googlegroups.com
On 07/28/2011 11:37 AM, Nick Howard wrote:
> I'm pretty sure it's working now.

It's still not working on the latest code from github. The test case in
the bug report fails.

http://code.google.com/p/mirah/issues/detail?id=49

Robert Lumley

unread,
Jul 28, 2011, 7:54:48 PM7/28/11
to mi...@googlegroups.com
Hi all, i'm blind and love the format of mirah,  I have been trying for over a week now to get the android tts to work in mirah.  i'm haveing all sorts of errors, one i noticed you have mentioned here on the list is my mirah-0.0.8 does not show all the parse errors, how do i add the patch to fix this?  the other thing is one of my files imports android.speech.tts.TextToSpeech and i can access a constant TestToSpeech::SUCCESS at the top but near the bottom of my code another constant fails saying it can't be found TextToSpeech::QUEUE_FLUSH.

any ideas or help greatly appreciated.
below is the offending text :)

package com.telmaron.talkinghome

import android.speech.tts.TextToSpeech

class Talker
 def initialize(context)
  @ready = false
  init_listener = TtsInitListener.new do |status|
   if (status == TextToSpeech::SUCCESS)
    @ready = true
   else
    shutdown
   end
  end
  @tts = TextToSpeech.new(context, init_listener)
 end

 def say(text)
  if @ready
   @tts.speak(text, TextToSpeech::QUEUE_FLUSH, nil)
  end
 end

 def shutdown
  @tts.stop
  @tts.shutdown
  @tts=nil
 end
nd

ps: also i thought ruby was not space depentdent, thats why i dislike python is you have to have the indents right or the code fails. So i am asumeing mirah is space dependent?

thanks

Robert Lumley

unread,
Jul 28, 2011, 8:33:32 PM7/28/11
to mi...@googlegroups.com
sorry if you have already received this, but this is my  third submit as i thinkt he first two went out from the wrong email address :)

Roger Pack

unread,
Jul 29, 2011, 12:03:49 AM7/29/11
to mi...@googlegroups.com

  > ps: also i thought ruby was not space depentdent, thats why i dislike python is you have to have the indents right or the code fails. So i am asumeing mirah is space dependent?  

It shouldn't be space dependent, since it uses "end" to close its blocks typically.

Robert Lumley

unread,
Jul 29, 2011, 12:43:09 AM7/29/11
to mi...@googlegroups.com
thats what i thought, but my code seems to get a mis aligned error every
once and a while and i have to space around and align all the def and
ends up before it will parse. hmm. i'll try again maybe i must have
missed and end or something those few times.

thanks for the reply. i hope some one can answer the other question
though, i've re written this code 30 or 40 times from various examples
and just can't get it to work. the code i attached was inspired from the
talker class included in the assets folder of ruboto.


Roger Pack

unread,
Jul 29, 2011, 11:35:09 AM7/29/11
to mi...@googlegroups.com
On Thu, Jul 28, 2011 at 5:54 PM, Robert Lumley <rlu...@telmaron.com> wrote:
Hi all, i'm blind and love the format of mirah,  I have been trying for over a week now to get the android tts to work in mirah.  i'm haveing all sorts of errors, one i noticed you have mentioned here on the list is my mirah-0.0.8 does not show all the parse errors, how do i add the patch to fix this?  the other thing is one of my files imports android.speech.tts.TextToSpeech and i can access a constant TestToSpeech::SUCCESS at the top but near the bottom of my code another constant fails saying it can't be found TextToSpeech::QUEUE_FLUSH.

What if you reference both at the top? Does it compile?

Charles Oliver Nutter

unread,
Jul 29, 2011, 1:14:32 PM7/29/11
to mi...@googlegroups.com
On Thu, Jul 28, 2011 at 9:43 PM, Robert Lumley
<robertlu...@gmail.com> wrote:
> thats what i thought, but my code seems to get a mis aligned error every
> once and a while and i have to space around and align all the def and ends
> up before it will parse. hmm. i'll try again maybe i must have missed and
> end or something those few times.

Thanks for your email, and I'm glad you find Mirah a nice language to use.

Roger is right, there should be no "significant whitespace" in Mirah.
If you''re having a problem please file a bug on Github and we'll look
into it.

> thanks for the reply. i hope some one can answer the other question though,
> i've re written this code 30 or 40 times from various examples and just
> can't get it to work. the code i attached was inspired from the talker class
> included in the assets folder of ruboto.

Can you formulate an example that doesn't depend on any Android libs?

- Charlie

Charles Oliver Nutter

unread,
Jul 29, 2011, 1:17:59 PM7/29/11
to mi...@googlegroups.com
On Thu, Jul 28, 2011 at 10:25 AM, consiliens <consi...@gmail.com> wrote:
> The source compiler currently has two issues [1], it's broken and the
> generated code is far from being "pretty printed."
>
> If you're willing to potentially manually edit every generated file and deal
> with bazaar Java code, then it's possible [2].  Once the issues I mentioned
> are fixed, then the source compiler work flow will be much less painful.

I'd love to see someone incorporate a small Java pretty-printer into
the -j output. It wouldn't be hard, and you'd get code out that almost
looks hand-written.

- Charlie

John Woodell

unread,
Jul 29, 2011, 1:44:02 PM7/29/11
to mi...@googlegroups.com
Extra credit if you can collapse the fully-qualified class names, and insert the appropriate import statements at the top of the file. I assume running the bitecode through an existing decompiler could generate something like this.

Robert Lumley

unread,
Jul 30, 2011, 4:07:28 AM7/30/11
to mi...@googlegroups.com

i'd have to find something in the java libraries that requires a
callback like the listneres do in android, as i'm pretty sure thats
were the code is messing up even though i can't prove it yet :)

I mean, if i take out everthing but the basic activity it compiles and runs.

Justin Bradford

unread,
Jul 30, 2011, 5:31:10 AM7/30/11
to mi...@googlegroups.com
I've already had a pull request merged. And while merging it, headius
offered commit and said to write this list saying hello.

I know Ruby very well and I know the JVM very well, but I'm not a Java
guy, and I despise the "Java workflow". Ant/Maven are a bad joke, and
the xunit testing style makes me want to vomit.

The "Java workflow" has consistently sucked for more than a decade
now, and while I like Mirah, life is too short to "go Java" to use it.

I'll toss code at you, but I'm never going to write xunit tests. And
if I ever have to write some ant/maven xml syntax to do something I
need with Mirah, then I will move on.

Java doesn't just suck because the language is bad. It mostly sucks
because everything built in, for, or around it is "enterprise" crap.

Justin

consiliens

unread,
Jul 30, 2011, 4:21:15 PM7/30/11
to mi...@googlegroups.com
On 07/30/2011 03:31 AM, Justin Bradford wrote:
> I'm never going to write xunit tests.

Do you consider RSpec an improvement?

Daniel Solano Gómez

unread,
Jul 30, 2011, 4:44:03 PM7/30/11
to mi...@googlegroups.com
On Sat Jul 30 03:07 2011, Robert Lumley wrote:
> i'd have to find something in the java libraries that requires a
> callback like the listneres do in android, as i'm pretty sure thats
> were the code is messing up even though i can't prove it yet :)
>
> I mean, if i take out everthing but the basic activity it compiles and runs.

I haven't had the time to look at your code to figure out what may be
going wrong. I thought I point you to something I wrote some time ago
which may or may not help you:

https://github.com/sattvik/decafbot/blob/85a465cf1840ee5a5a5a5ce9b538f637c433144d/jvm-lang/mirah/src/decafbot/mirah/Talker.mirah

All of the AtomicBoolean, handler, sayLater code, if I recall correctly,
is because the TTS initialisation has to occur on the UI thread, so any
attempt to use it before it is initialised will fail, block, or do
something else terribly wrong.

Sincerely,

Daniel Solano Gómez

signature.asc

Justin Bradford

unread,
Jul 31, 2011, 3:48:24 AM7/31/11
to mi...@googlegroups.com

Yes. RSpec has its own issues, but it is an improvement.

Robert Lumley

unread,
Aug 1, 2011, 2:05:46 AM8/1/11
to mi...@googlegroups.com
> Daniel Solano G�mez

wow, looks like i was close but you do something neat here i m miessed,
you implemnt on the same class as the other code, where i have two
different classes. I already had your code downloaded by the way, just
didn't know this was in there, it looks like the talker fomr rubto as
well. I might have mine working if i can figure out one thing, i have
two classes.
class TalkerInitListener
in this class i do
Talker.ready = 1

class Talker
i've tried
def ready=(value:int)
and
def ready_set(value:int)

and i always get and error on the TalkerInitListener sayind it can not
find Talker.ready_set(int) on the talker class

While i'm talking about this, does mirah not support the attr_accessor?
and if not what does method= map to on the other class?

ps: anyone reading the space issue i talked aobut previously is only a
warning it says something like line: 9 end block at line 5: mis aligned
warning. but the code seems to still compile ok.
thanks much all :)

Reply all
Reply to author
Forward
0 new messages