The Artima Developer Community
Sponsored Link

Weblogs Forum
What's next for Heron?

18 replies on 2 pages. Most recent reply: Jan 27, 2006 2:54 AM by Terje Slettebø

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 18 replies on 2 pages [ « | 1 2 ]
Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: What's next for Heron? Posted: Jan 26, 2006 8:08 PM
Reply to this message Reply
Advertisement
> You wrote you had implemented the program in C++, could
> you have posted the code for that version, too?


int main(int argc, char *argv[])
{
string s;
char c = getchar();
while (c != EOF) {
s += c;
c = getchar();
};
for (int i=s.size(); i >=0; --i) {
putchar(s[i]);
};
}


> It seems the Heron version uses an Array class/interface,
> could you have posted the code for that, as well?


interface Array[type T]
{
requires
{
def count() : uint;
def _subscript(uint n) : T& {
pre(n < count());
inner;
}
}
}


By the way your question "could you have posted" is a rhetorical question, rather than an actual request. It is a small grammatical error, but if I didn't know you better it would have sounded like a snide comment. I just thought you would appreciate knowing this.

Calvin Mathew Spealman

Posts: 13
Nickname: ironfroggy
Registered: Aug, 2005

Re: What's next for Heron? Posted: Jan 27, 2006 1:41 AM
Reply to this message Reply
OK. I'll play the Devil's Advocate. Nice and simple string class, but how well does it play with unicode? If it doesn't then why do I care about it at all? A good unicode type is essential before anything useful is built on a bad string class that doesn't support unicode. So what's next?

Terje Slettebø

Posts: 205
Nickname: tslettebo
Registered: Jun, 2004

Re: What's next for Heron? Posted: Jan 27, 2006 2:45 AM
Reply to this message Reply
Thanks for the code.

> By the way your question "could you have posted" is a
> rhetorical question, rather than an actual request. It is
> a small grammatical error, but if I didn't know you better
> it would have sounded like a snide comment.

Why not just assume the worst? ;)

Seriously, no, it was meant as an actual request. So maybe "Could you (please) post the code?" would be correct? The use of "could" was for politeness; certainly no offence or snide comment was intended, and thanks for letting me know of the possibility of misunderstanding.

I only asked for the code, because it's difficult to assess your claims of brevity and elegance, without seeing the actual code (I thought you might have written a string class in C++, as well).

As there doesn't exist much, if any, documentation for Heron at this point (at least what I've been able to find, except for example code), I'm trying to understand your code. One thing I'm wondering about is where memory allocation happens (in your code), and also if you could briefly explain the "inner" construct? I know it's been discussed in other threads, but for people not having read those, it may be helpful. Perhaps also briefly explain what the main features of your program does, such as "requires" and "extension". Again, I know it has been discussed elsewhere, but it could be good to have it in one place, together with the program, allowing people to better assess the language and code.

Terje Slettebø

Posts: 205
Nickname: tslettebo
Registered: Jun, 2004

Re: What's next for Heron? Posted: Jan 27, 2006 2:54 AM
Reply to this message Reply
A few more things: Are exceptions supported in Heron, and can the memory allocator throw an exception? I ask, because from the code you posted, I don't see any allocation and cleanup-code. Does the code use RAII for resource management?

Flat View: This topic has 18 replies on 2 pages [ « | 1  2 ]
Topic: Multiple Contexts, Information Reuse, and Backpointers Previous Topic   Next Topic Topic: Desktop Linux Just Died


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us