The Artima Developer Community
Sponsored Link

Weblogs Forum
Heron.NET or JHeron?

22 replies on 2 pages. Most recent reply: Dec 25, 2004 12:38 PM by Alastair Patrick

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 22 replies on 2 pages [ 1 2 | » ]
Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Heron.NET or JHeron? (View in Weblogs)
Posted: Dec 9, 2004 8:51 PM
Reply to this message Reply
Summary
I am looking at rebuilding the Heron compiler in C++. I am surveying which platform developers would most like to see targeted whether it is native code, java virtual machines, .net, or other.
Advertisement
I currently have a Heron to C++ compiler written in Delphi. It was developed in a hackneyed fashion, and was started when I had no clue what I was doing. Now that I know a thing or two about compilers, I am likely going to rewrite the whole mess in C++. I am also considering the possibility targeting either the .NET platform or the Java Virtual Machine the next time around. I would like to hear whether targeting any particular platform would help increase the interest in Heron

Please share your comments, thanks!


Terje Slettebø

Posts: 205
Nickname: tslettebo
Registered: Jun, 2004

Re: Heron.NET or JHeron? Posted: Dec 10, 2004 3:32 AM
Reply to this message Reply
> I currently have a Heron to C++ compiler written in
> Delphi. It was developed in a hackneyed fashion, and was
> started when I had no clue what I was doing. Now that I
> know a thing or two about compilers, I am likely going to
> rewrite the whole mess in C++.

Not a comment about target platform, but for writing a language parser, then if you haven't already, you may want to consider Boost.Spirit, which lets you specify the grammar rather elegantly as approximated EBNF, directly in C++ (http://spirit.sourceforge.net/).

There's already a C++ preprocessor written using it (Wave).

Regards,

Terje

Glen Ritchie

Posts: 12
Nickname: gmanndsu
Registered: Dec, 2004

Re: Heron.NET or JHeron? Posted: Dec 10, 2004 9:05 AM
Reply to this message Reply
> I currently have a Heron to C++ compiler written in
> Delphi. It was developed in a hackneyed fashion, and was
> started when I had no clue what I was doing. Now that I
> know a thing or two about compilers, I am likely going to
> rewrite the whole mess in C++.

> I am also considering the possibility targeting either the
> .NET platform or the Java Virtual Machine the next time
> around. I would like to hear whether targeting any
> particular platform would help increase the interest in
> Heron

As I'm understanding it. You're going to build a "true Huron" compiler. So, no more Huron2c. Although, this is only one of several possible other implementations.
>> Good

Targeting JVM or .net. Hmmm. Your language's style is an interesting mix of C, Java, Pascal (Delphi).

I guess my vote would be "just for" continuing with freely available tools. i.e. Using Delphi bad. Using Bison, Flex, and gcc compatibility. Good.

I have to admit. I don't care much for Java. I'm not sure if it's language conventions would allow you to express Huron, to it's fullest ability? Besides, Java was usually slower on performance, than true C/C++, & the proprietary relationship with Sun. (I could be totally wrong. Ok, let me know.)

However, .Net as MicroSoft as made it. Is not to my liking either! As long, as you can use Mono, or entirely free tools with .Net. I would accept that.
---------


My other question is about "getting RAD" working. I like your design principles very much. Interesting, having a language kernel, and most things in libraries.

So, if you could. I would like to see the "ability" Python has for quick programs. It seems to match your design for code in libraries 'concept.'

Although, Python grammar doesn't match Huron Grammar, really.
---------

So, before I get too off topic. What kind of change are you looking for?

(1) A new Huron2.Jvm?
or (2) A huron compiler. Which, yes, is a huge undertaking. Something of at least two years work.

Glen

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Heron.NET or JHeron? Posted: Dec 10, 2004 9:37 AM
Reply to this message Reply
> As I'm understanding it. You're going to build a "true
> Huron" compiler. So, no more Huron2c. Although,
> this is only one of several possible other
> implementations.

Ther current Heron compiler is a true compiler. It does syntactic verification, type checking, everything. It just outputs C instead of machine code. This makes it more portable than native code, and means I don't have to worry about native code for every platform. Targetting JVM or CLI
wouldn't be much different.

> I guess my vote would be "just for" continuing with freely
> available tools. i.e. Using Delphi bad. Using Bison, Flex,
> and gcc compatibility. Good.

I agree except Bison and Flex are really really outdated, there are superior tools.

> I have to admit. I don't care much for Java. I'm not sure
> if it's language conventions would allow you to
> express Huron, to it's fullest ability?

Depends on how much work I do in the compiler. Everything can be translated, it is just a question of work.

> My other question is about "getting RAD" working. I like
> your design principles very much. Interesting, having a
> language kernel, and most things in libraries.

I think RAD is a long way off, as it would require good tool support.

> So, before I get too off topic. What kind of change are
> you looking for?
>
> (1) A new Huron2.Jvm?
> or (2) A huron compiler. Which, yes, is a huge
> undertaking. Something of at least two years work.


I am sorry but I don't fully understand the question, could you rephrase?

Thanks for your comments.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Heron.NET or JHeron? Posted: Dec 10, 2004 9:45 AM
Reply to this message Reply
> Not a comment about target platform, but for writing a
> language parser, then if you haven't already, you may want
> to consider Boost.Spirit, which lets you specify the
> grammar rather elegantly as approximated EBNF, directly in
> C++ (http://spirit.sourceforge.net/).

Hi Terje,

I am looking at it right now, and it seems very interesting. Can you share any more insight into it? Is it efficient and bug-free?

Thanks!

Glen Ritchie

Posts: 12
Nickname: gmanndsu
Registered: Dec, 2004

Languaging Posted: Dec 10, 2004 9:48 AM
Reply to this message Reply
Ok, I mis-understood. You do have a true compiler.

But, to re-phrase. Are you thinking of?
(1) huron2JVM or (2) huron2.net?
---

Why is getting tool support hard first? (To ask a dumb question.)

And do you like or not like the Python approach? Some of your general language features seem to match Python's approach.
---

Are you opposed to "gcc" built software? Linux focused first? I guess, I'll admit it. I am a Linux lover. (Did use Windows, 10 years ago. Actually, own Delphi v7 though.)

So, if you are going to change things. Why not stay with Delphi & just target code generation for JVM or .Net (Again, more confusion. Which .Net product? Some are open, most closed.)

Glen

PS. I understand. Your highest goal is to get it done, with least amount of work. Too many things are like that.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Languaging Posted: Dec 10, 2004 10:06 AM
Reply to this message Reply
> But, to re-phrase. Are you thinking of?
> (1) huron2JVM or (2) huron2.net?

I am thinking of both of these.

> Why is getting tool support hard first? (To ask a dumb
> question.)

I am only one programmer, and currently no one else is developing tools. I have to promote Heron, write tools for Heron, and write Heron documentation. It usually takes a team of people to write a compiler.

> And do you like or not like the Python approach? Some of
> your general language features seem to match Python's
> approach.

Python is a dynamically typed, loosely structured language that isn't very concerned with performance. I also don't particularly like the syntax.

> Are you opposed to "gcc" built software? Linux focused
> first? I guess, I'll admit it. I am a Linux lover. (Did
> use Windows, 10 years ago. Actually, own Delphi v7
> though.)

I love GCC. I thought originally I might have a better chance with the Windows market, but now I am rethinking things. That is one advantage of compiling to C though, it can be used by programmers with GCC. The only problem is that people want to be able to hack my source code as well, which is fine by me, I give it away, but they get confused when they see .pas files.

> So, if you are going to change things. Why not stay with
> Delphi & just target code generation for JVM or .Net
> (Again, more confusion. Which .Net product? Some are open,
> most closed.)

I need help, I need other programmers to eventually pick up some slack. Very few programmers are interested in Delphi source code. Heron would have a better chance of survival with a more mainstream code base.

Terje Slettebø

Posts: 205
Nickname: tslettebo
Registered: Jun, 2004

Re: Heron.NET or JHeron? Posted: Dec 10, 2004 10:35 AM
Reply to this message Reply
Hi Christopher.

> > Not a comment about target platform, but for writing a
> > language parser, then if you haven't already, you may
> want
> > to consider Boost.Spirit, which lets you specify the
> > grammar rather elegantly as approximated EBNF, directly
> in
> > C++ (http://spirit.sourceforge.net/).
>
> I am looking at it right now, and it seems very
> interesting. Can you share any more insight into it? Is it
> efficient and bug-free?

Regarding bug-free, it definitely seems robust and stable, yes. As you can see, it has been accepted into Boost (which is quite a statement of approval in itself).

Regarding efficiency, it uses static binding (the grammar is compiled as a C++ expression) so it should have potential to be very efficient, although I haven't seen any benchmarks around.

I haven't used it much, myself - only for a simple format-string use (i.e. "%<character>" in a string gets filled in with values).

It has a very modern/radical design, where you can attach "semantic actions" at each point along the parse tree. It also has full "lambda" support (but using that is optional). This calculator example should give you a feel for how it is:

http://cvs.sourceforge.net/viewcvs.py/boost/boost/libs/spirit/example/fundamental/phoenix_calc.cpp?view=markup

This uses Phoenix, Spirit's lambda, which supports things like closures, etc.

If I'd ever write a parser for a language, in C++, this is the first library/tool I'd consider (not lex/yacc, or other external tools), as it has the enourmous advantage of being able to encode the grammar directly in C++, so it may be used with any other code.

It is also well supported; the author is active at Boost, and they have a mailing list for it, as well (at the Spirit homepage).

If you wonder about Spirit's scalability to a programming language like Heron, it may be best to ask the author, himself (or at the Spirit list).

Also, feel free to contact me off-list at: tslettebo at broadpark dot no

Regards,

Terje

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Heron.NET or JHeron? Posted: Dec 10, 2004 11:03 AM
Reply to this message Reply
Looking at Wave gave me an idea, what if I put Heron on ice, and went back to HeronFront. HeronFront was a C++ code-generator which generated interfaces. This time around it would support also have built in support for AOP and DbC. Would there be any interest in that?

Syntax would be almost precisely the pseudo-code I use to describe the OOTL at: http://www.ootl.org/colls.html

Terje Slettebø

Posts: 205
Nickname: tslettebo
Registered: Jun, 2004

Re: Heron.NET or JHeron? Posted: Dec 10, 2004 12:09 PM
Reply to this message Reply
> Looking at Wave gave me an idea, what if I put Heron on
> ice, and went back to HeronFront. HeronFront was a C++
> code-generator which generated interfaces. This time
> around it would support also have built in support for AOP
> and DbC. Would there be any interest in that?

I think there definitely could be interest in that. I'd prefer to have support for such things in C++, directly, but after all, C++ was also once implemented as a front-end for C (CFront), so it's a start.

You might also want to peruse any existing proposals for this in C++ at the standards site, such as:

Proposal to add Design by Contract to C++ (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1613.pdf)

If you implemented something like this, it could be a much shorter way to get these things into the hands of developers, than them having to switch languages (and/or interface with another language).

I don't know of any existing proposal for AOP in C++, but that's also an interesting concept.

It seems that introducing a new language tends to be an uphill battle (as well as something of a chicken-and-egg problem: It tends to need a reasonable user base, to be considered a relevant alternative, but to get that... IOW, there was a reason C++ started from C... As well as being a good base language), so, yes, this could be a way for you to use your competence and initiative to reach a much larger audience.

Regards,

Terje

Vesa Karvonen

Posts: 116
Nickname: vkarvone
Registered: Jun, 2004

Re: Heron.NET or JHeron? Posted: Dec 10, 2004 12:13 PM
Reply to this message Reply
> I currently have a Heron to C++ compiler written in
> Delphi. It was developed in a hackneyed fashion, and was
> started when I had no clue what I was doing. Now that I
> know a thing or two about compilers, I am likely going to
> rewrite the whole mess in C++.

I'd like to make a radical suggestion that you write the compiler in O'Caml or Standard ML. A few years ago, I wrote a compiler with a colleque for a simple ML-style language (the usual features: type inference, pattern matching, partial application, ...). Before starting the project, we wrote a minimal compiler in both O'Caml and C++ for a toy language. The result was that the O'Caml version was easier to understand (in our opinion) and was considerably shorter than the C++ version, so we chose O'Caml. At the time, I was a newbie O'Caml programmer and had, well, quite a bit of experience in C++. During the project, we found that our choice was definitely the right choice. The O'Caml language (and other ML-style languages) is extremely well suited to writing compilers. Unless you have already writen something beyond a toy program in some ML-style language, I guarantee that you will learn a great deal in the process of writing a compiler in O'Caml or Standard ML.

Glen Ritchie

Posts: 12
Nickname: gmanndsu
Registered: Dec, 2004

Re: Languaging Posted: Dec 10, 2004 10:25 PM
Reply to this message Reply
> I love GCC. I thought originally I might have a better
> chance with the Windows market, but now I am rethinking
> things. That is one advantage of compiling to C though, it
> can be used by programmers with GCC. The only problem is
> that people want to be able to hack my source code as
> well, which is fine by me, I give it away, but they get
> confused when they see .pas files.
>
> > So, if you are going to change things. Why not stay
> with
> > Delphi & just target code generation for JVM or .Net
> > (Again, more confusion. Which .Net product? Some are
> open,
> > most closed.)
>
> I need help, I need other programmers to eventually pick
> up some slack. Very few programmers are interested in
> Delphi source code. Heron would have a better chance of
> survival with a more mainstream code base.

So, if I may ask. Why is Huron based in Delphi (Object Pascal) to start with? Or why do you "prefer" some concepts from Delphi conventions?

Plus, you know what the 'ultimate state' for a language is? Being able to produce it's own compiler. I think SmallTalk after the third or fourth version became this way.

Glen

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Languaging Posted: Dec 10, 2004 10:43 PM
Reply to this message Reply
> So, if I may ask. Why is Huron based in Delphi (Object
> Pascal) to start with? Or why do you "prefer" some
> concepts from Delphi conventions?

Heron is not based on Delphi. The compiler is written in Delphi. There are a few language similarities, but they are relatively few.

Btw, it is "Heron" not "Huron".

> Plus, you know what the 'ultimate state' for a language
> is? Being able to produce it's own compiler.
I think
> SmallTalk after the third or fourth version became this
> way.

Yes, that would indeed be a nice stage to be at. Until I get help, I don't think that is going to happen any time soon.

This is why I am thinking of revisiting the idea of a simple C++ code generator which takes the primary ideas of Heron and generates C++ code.

Glen Ritchie

Posts: 12
Nickname: gmanndsu
Registered: Dec, 2004

Re: Heron.NET or JHeron? Posted: Dec 11, 2004 8:44 AM
Reply to this message Reply
Sorry about that, yes - my mistake - Heron. I haven't heard of the Greek Mathematician, presumed a great crane.

Yes, I see you're right. A C++ code generator probably is more direct. WAVE sounded quite capable.

If I could ask one other question. If Heron was complete and a working system. Do you see it to be an interactive styled language, something like Perl with a shell? Or is it "best" just to be static in compilation, like C++.

Of course, I don't know of too many C++ dynamic languages. There has got to be some though.

Glen

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Heron.NET or JHeron? Posted: Dec 11, 2004 11:53 PM
Reply to this message Reply
> Yes, I see you're right. A C++ code generator probably is
> more direct. WAVE sounded quite capable.

My current parser project YARD, is significantly easier to use than Spirit. I will be posting it soon on CodeProject.com.

> Do you see it to be an interactive
> styled language, something like Perl with a shell? Or is
> it "best" just to be static in compilation, like C++.

Heron was designed primarily as a statically compiled language. Many of the features were designed with this in mind. At thes same time interactive/dynamic versions of Heron would still be more feasable than an interactive C++, because the grammar is far less complex.

Flat View: This topic has 22 replies on 2 pages [ 1  2 | » ]
Topic: Another Sprinkling of JavaPolis Previous Topic   Next Topic Topic: Event Driven Programming using Template Specializations in C++

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use