The Artima Developer Community
Sponsored Link

Weblogs Forum
Macros and Type-Systems

35 replies on 3 pages. Most recent reply: Oct 11, 2005 1:19 AM by Steve Donovan

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

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Lexical scoping Posted: Oct 4, 2005 3:14 PM
Reply to this message Reply
Advertisement
> Assuming that curly braces are used to denote
> blocks/scopes, then the above seems rather meaningless to
> me. The last two f(); calls should be
> compile-time errors (unless, of course, an outer scope
> contains another definition of f).

Yes you are correct, thank for pointing that out. What I had intended was something like:


function g;
{
int x;
{
def f() {
return x;
}
g = f;
}
g(); // fine
}
g(); // runtime error, f was destroyed when x was destroyed.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 4, 2005 3:27 PM
Reply to this message Reply
> I'm a bit too lazy at the moment to dig my bookshelf for
> references, but I think that Pascal already incorporated a
> very similar idea. The idea is that a procedure may
> contain nested procedures that may refer to the local
> variables of the surrounding procedure. This was called
> block structure:
> http://www.google.com/search?q=block+structure+pascal .
> Actually, I think that there are several languages that
> effectively incorporate the same idea. In Lisp parlance it
> was called downward funargs:
> http://www.google.com/search?q=downward+funargs .

In Pascal at least you could not return a function from a function.

There is some discussion of upward and downward funargs at http://en.wikipedia.org/wiki/Funarg_problem

The proposed Heron closures technically solve both the "upward funarg problem" and "downward funarg problem".

I found this quote at http://www.delorie.com/gnu/docs/emacs/cl_21.html, which is interesting:

"Many closures are used only during the extent of the bindings they refer to;"

Vesa Karvonen

Posts: 116
Nickname: vkarvone
Registered: Jun, 2004

Re: Macros and Type-Systems Posted: Oct 4, 2005 4:52 PM
Reply to this message Reply
> There is some discussion of upward and downward funargs at
> http://en.wikipedia.org/wiki/Funarg_problem
>
> The proposed Heron closures technically solve both the
> "upward funarg problem" and "downward funarg problem".

Hmm... Really? The "upward funarg problem" means to implement first-class functions with lexical scoping.

> "Many closures are used only during the extent of the
> bindings they refer to;"

I assume that you are implying that the above is a good justification for not providing first-class functions. It isn't. You could use a similar justification to ban almost any language construct.

Let me quote a story from the book Psychology of Computer Programming by Gerald Weinberg (pages 210-211 in the silver anniversary edition):


PROGRAMMING LANGUAGE DESIGN

It is impossible to begin a discussion of psychological principles of
programming language design without recalling the story of ``Levine the
Genious Tailor.'' It seems that a man had gone to Levine to have a suit
made cheaply, but when the suit was finished and he went to try it on, it
didn't fit him at all. ``Look,'' he said, ``the jacket is much too big in
back.''
``No problem,'' replied Levine, showing him how to hunch over his back
to take up the slack in the jacket.
``But then what about the right arm? It's three inches too long.''
``No problem,'' Levine repeated, demonstrating how, by leaning to one
side and stretching out his right arm, the sleeve could be made to fit.
``And what about these pants? The left leg is too short.''
``No problem,'' said Levine for the third time, and proceeded to teach
him how to pull up his leg at the hip so that, though he limped badly, the
suit appeared to fit.
Having no more complaints, the man set off hobbling down the street,
feeling slightly duped by Levine. Before he went two blocks, he was
stopped by a stranger who said, ``I beg your pardon, but is that a new suit
you're wearing?''
The man was a little pleased that someone had noticed his suit, so he
took no offense. ``Yes it is,'' he replied. ``Why do you ask?''
``Well, I'm in the market for a new suit myself. Who's your tailor?''
``It's Levine---right down the street.''
``Well, thanks very much,'' said the stranger, hurrying off. ``I do
believe I'll go to Levine for my suit. Why, he must be a genious to fit a
cripple like you!''
Would it be inappropriate to concot a version of this story called
``Levine the Genius Language Designer''? The first problem in discussing
language design is that we do not know the answer to that question. We do
not know whether the language designers are geniuses, or we ordinary
programmers are cripples. Generally speaking, we only know how bad our
present programming language is when we finally overcome the psychological
barriers and learn a new one. Our standards, in other words, are shifting
ones---a fact that has to be taken into full consideration in programming
language design.


Speaking from my own personal experience, I never really saw how bad C and C++ were until I really learned a few other languages. Likewise, I doubt that anyone can appreciate first-class functions before they have learned them thoroughly. Instead of looking for evidence to avoid implementing first-class functions, you should be learning more about programming with first-class functions. Only when you really master them will you be in a position to make the choice of whether to support them or not.

Vesa Karvonen

Posts: 116
Nickname: vkarvone
Registered: Jun, 2004

Re: Lexical scoping Posted: Oct 4, 2005 5:33 PM
Reply to this message Reply
No, what you are explaining here isn't a solution to the upward funarg problem. It isn't really extremely novel either. For example, here is a similar example in Emacs lisp:


(let ((g nil))
(let* ((x "value of x")
(f (lambda () (insert x))))
(setq g f)
(funcall g))
(funcall g))


When you execute the above, you'll get an error stating that "Symbol's value as variable is void: x".

You are just cleaning up the semantics a bit (making the latter funcall fail immediately and (hopefully) treating downward funargs lexically), but it isn't really a solution to the upward funarg problem. (The birth of Lisp with dynamic scoping was really an accident (a bug!) that set back progress in programming languages for a long time.)

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 4, 2005 8:16 PM
Reply to this message Reply
> > There is some discussion of upward and downward funargs
> at
> > http://en.wikipedia.org/wiki/Funarg_problem
> >
> > The proposed Heron closures technically solve both the
> > "upward funarg problem" and "downward funarg problem".
>
> Hmm... Really? The "upward funarg problem" means to
> implement first-class functions with lexical scoping.

I don't have any definition other than the wikipedia one to work with, which is specifically: "The upwards funarg problem is the problem of passing a function as a value returned "upwards" from a function call". That definition I satisfied.

> > "Many closures are used only during the extent of the
> > bindings they refer to;"
>
> I assume that you are implying that the above is a good
> justification for not providing first-class functions.

I am saying that it indicates that the proposed closures, has some usefulness over not having any kind of closures.

By the way, I wish you would try to be less patronizing and sarcastic. That story and the previous google links were really annoying. If you don't start being more polite, I see no reason to continue conversing with you.

Vesa Karvonen

Posts: 116
Nickname: vkarvone
Registered: Jun, 2004

Re: Macros and Type-Systems Posted: Oct 4, 2005 10:14 PM
Reply to this message Reply
> "The upwards funarg problem is the problem of passing
> a function as a value returned "upwards" from a function
> call". That definition I satisfied.

That definition may be unnecessarily confusing due to the use of redundant words like "passing" and "upwards". If you google for "the upward funarg problem" you'll find that the first hit points out that it means to be able to return functions (or procedures) as values, which isn't fully supported by your idea.

> That story and the previous google links were really annoying.

In what way are google links annoying? I take extra time to provide google links to save others the trouble and you find it annoying. I would understand it if the google links were posted with no explanation or motivation whatsoever (like you often see in usenet), but that isn't the case here.

The story is from Gerald Weinberg('s book) and I personally found it quite telling. Weinberg notes that the story is a favorite story among his readers (page 11.ii). One insight that one could draw from the story is that it can be very difficult to see the limitations of a language when one is only intimate with that language. Again, I personally find that I underestimated the "practical" expressive power (in a very informal sense) of combinators for years after I first learned about basic combinator techniques. I wish I had read more articles on combinator libraries 5 years ago.

> If you don't start being more polite, I see no reason to
> continue conversing with you.

I have no reason to be politically correct, but don't worry, I'll stop posting here.

Rinie Kervel

Posts: 26
Nickname: rinie
Registered: Oct, 2005

Re: Macros and Type-Systems Posted: Oct 4, 2005 11:49 PM
Reply to this message Reply
> > Doesn't this spell 'side effects' / globals considered
> > harmfull.
>
> Why do you say that, and what specifically do you mean by
> it?
Well in your example 'x' is automagically incremented.
As long as you can read the source you may see that,
otherwise you can get suprises like C's errno/strtok ...
>
> > I was taught Pascal with blockscope / nested functions
> and
> > later switched to C/C++ being only 2 level (or 3
> including
> > class level)
> >
> > So what is the benefit of closures?
>
> Things like:
>
>
> def output_all(list a)
> {
>   int x; 
>   def out(object o) { 
>     write(x++); 
>     write(" : ");
>     write(o); 
>     write('\n');
>   }
>   a.witheach(out);
> }

>
Whats wrong with a.witheach(out, &x) ?
Or making an 'out' class with current line as a member function?

> > Is the model of only
> > local variables, parameters and / or class members not
> > much clearer with regards to sideeffects?
>
> I don't believe it to be so.

Well as an other posting said, I think you can solve your problem by allowing only calls to f() where x is in scope.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 5, 2005 6:33 AM
Reply to this message Reply
> That definition may be unnecessarily confusing due to the
> use of redundant words like "passing" and "upwards". If
> you google for "the upward funarg problem" you'll find
> that the first hit points out that it means to be able to
> return functions (or procedures) as values, which isn't
> fully supported by your idea.

My proposed closure can be passed from a function as a value.


{
int x = 42;
def f() : function {
def g() : int {
return x;
}
return g;
}
object o = f();
int y = o();
}


> > That story and the previous google links were really
> annoying.
>
> In what way are google links annoying? I take extra time
> to provide google links to save others the trouble and you
> find it annoying.

I know how to use a search engine, and I google every term you use which I don't know or understand. Placing links to google search results, seems to imply that I can't or won't search for results myself. It seems however that I misinterpreted your actions, and for that I apologize.

If you could provide links to specific papers, or sites which would be appropriate, that would be useful.

> One insight that one could draw from the story is that it
> can be very difficult to see the limitations of a language
> when one is only intimate with that language.

You are implying that I am only intimate with one language, and one paradigm. This is an untrue criticism which I hear frequently and I find particularly frustrating. Simply because I prefer imperative, non-garbage-collected languages, doesn't mean that I am unaware of the advantages of other systems and don't think about them in depth.

> Again, I
> personally find that I underestimated the "practical"
> expressive power (in a very informal sense) of combinators
> for years after I first learned about basic combinator
> techniques. I wish I had read more articles on combinator
> libraries 5 years ago.

I am open to learning new things and expanding my horizons and I try to read up on areas which are incomplete.

I would appreciate it if you engaged me in intelligent discourse rather than attempting to lecture me about my lack of knowledge of combinatory logic. I agree, I don't have extensive knowledge of the techniques. It doesn't mean automatically that my ideas aren't worth considering. You seem to dimiss my ideas automatically because you don't have respect for my work.

And I agree that there is a lot going for a languages where you can prove mathematically that programs are sound. However, users of my language, for the most part, aren't going to be reading papers on combinatory logic or type-systems. I want to keep a very practical approach to the design of Heron.

> > If you don't start being more polite, I see no reason
> to
> > continue conversing with you.
>
> I have no reason to be politically correct, but don't
> worry, I'll stop posting here.

All I ask is that you please be more respectful. You have a wealth of knowledge to share, but I have trouble getting to it because (a) you don't give my ideas the benefit of the doubt and (b) you continue to attack my lack of knowledge rather than educating me.

Greg Jorgensen

Posts: 65
Nickname: gregjor
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 7, 2005 12:46 AM
Reply to this message Reply
I'm curious to know what kinds of programming problems you have that would prompt you to design and implement your own language. I get the impression from your postings that none of the available languages are sufficiently powerful to do what you want to do with them. I understand getting frustrated with the shortcomings of specific languages, but when I'm able to choose among even the small number of languages I am proficient with I can usually pick one that makes me happy and gets the job done.

I am genuinely curious to know if you decided to create your own language because you can't solve your development problems with an existing language, or if Heron is more of an intellectual exercise. What is it about modern programming languages that you find "eternally frustrating?" Is the frustration from real development projects you can't implement? Can you give an example of a real application that will be enabled by Heron, but not by C++, Java, Smalltalk, Scheme, Ruby, take your pick?

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 7, 2005 10:48 AM
Reply to this message Reply
> I'm curious to know what kinds of programming problems you
> have that would prompt you to design and implement your
> own language.

Improved productivity.

> I get the impression from your postings that
> none of the available languages are sufficiently powerful
> to do what you want to do with them.

I can do most of what I need in virtually any language, unless it requires high performance. Most of my beef is about how hard it is to express certain ideas in various langauges. I want a truly multi-paradigm language.

> I understand getting
> frustrated with the shortcomings of specific languages,
> but when I'm able to choose among even the small number of
> languages I am proficient with I can usually pick one that
> makes me happy and gets the job done.

I don't want to switch languages. Too often I need the features of one language in the middle of using another. Cross-language development is too complicated for my liking.

> I am genuinely curious to know if you decided to create
> your own language because you can't solve your development
> problems with an existing language, or if Heron is more of
> an intellectual exercise. What is it about modern
> programming languages that you find "eternally
> frustrating?"

Productivity, efficiency, lack of support for unexpected paradigms.

> Is the frustration from real development
> projects you can't implement?

No, it is about frustration from devlopment projects which are hard to implement using a paradigm of my choice.

> Can you give an example of a
> real application that will be enabled by Heron, but not by
> C++, Java, Smalltalk, Scheme, Ruby, take your pick?

No I can't. I could do anything in virtually any language, unless really high-performance is needed (e.g. device drivers console games, spreadsheets, databases, compilers, IDE's, debuggers, media players, file managers, etc.) which narrows the choice of language significantly.

Greg Jorgensen

Posts: 65
Nickname: gregjor
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 7, 2005 2:03 PM
Reply to this message Reply
So you want a single language that improves your productivity by supporting multiple paradigms and more expressive constructs? And it must be fast to execute?

To justify the enormous time and effort that will go into designing and implementing a new language and building the necessary infrastructure of libraries, tools, and documentation, you have to expect some pretty big productivity and/or performance improvements spread over a lot of people. If the productivity improvements are merely incremental (and perhaps limited to a small community of programmers who share your vision), the effort that goes into Heron will never be recovered in actual development projects. That is what I was getting at by asking if Heron will solve real development problems or if it's more of an academic or intellectual challenge.

I'm always interested to find out what motivated a language designer to create something interesting, whether it's Wirth's Oberon, Stroustrup's C++, or Matz's Ruby. I'm still curious to know specifically which paradigms you want to unify in Heron, and how you expect to improve expressiveness and programmer productivity. I don't have a clear picture of the ideas and goals behind Heron other than your postings, which seem more focused on specific features and their implementation, and on run-time performance.

> I can do most of what I need in virtually any language,
> unless it requires high performance.

Do you mean that no languages available to you have sufficient performance, or that the languages that give you fast execution are insufficently expressive or powerful or productive? Do you expect that Heron will generate faster code than a C compiler? I'm curious what performance requirements you face.

> Most of my beef is about how hard it is to express
> certain ideas in various langauges. I want a truly
> multi-paradigm language.

Expressiveness was a big motivator behind C, Oberon, Lisp, C++, Perl, Python, Ruby and probably most modern languages. C was at least partially a counter to the weaknesses and limitations of Fortran and Cobol. C++ improved C's type system, encapsulation, and abstractions. Perl streamlined jobs that were done with sed, awk, and shell scripts into an (arguably) cleaner and faster language. What specifically will Heron do that will make it more expressive than C++?

An example of one of those "certain ideas" that are so hard to express in modern languages would help me understand what is driving Heron. If I am forced to work with Visual Basic I will wish for the expressiveness and power of Python, but I haven't found myself at a loss when I can choose a better language. I am still curious to see a real programming problem that is simply too hard to express in C++, Python, Ruby, Lisp, or some other available modern language.

> I don't want to switch languages. Too often I need the
> features of one language in the middle of using another.
> Cross-language development is too complicated for my
> liking.

I don't like cross-language development either; that wasn't what I meant. I meant that when I can choose among the languages I know I have always been able to pick one that suits me and the problem. I can't always choose the language because I work for other people most of the time and usually the platform and language (and often a lot of the code base) is already chosen for me. If writing your own new language is your solution, that implies that in your work choosing that new language will be an option available to you -- that you will switch languages from (say) C++ to Heron at some point on a real project.

> No, it is about frustration from devlopment projects which
> are hard to implement using a paradigm of my choice.

It sounds like you get a lot more freedom to choose languages and tools and paradigms than most of us. That's why I asked for an example of the kinds of projects you do in your professional work.

> No I can't. I could do anything in virtually any language,
> unless really high-performance is needed (e.g. device
> drivers console games, spreadsheets, databases, compilers,
> IDE's, debuggers, media players, file managers, etc.)
> which narrows the choice of language significantly.

Do you really get to work across so many different application domains in your professional work? Few programmers I've known have worked in more than one or two of those domains. I generally don't work on high-performance code, but I used to (a long time ago), and when I did it was Fortran + assembly, or Forth, or C if I was lucky, so maybe I don't understand the kinds of high-performance applications you work on.

Thanks!

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 7, 2005 3:25 PM
Reply to this message Reply
> So you want a single language that improves your
> productivity by supporting multiple paradigms and more
> expressive constructs? And it must be fast to execute?

Yes.

> To justify the enormous time and effort ...

I don't actually have to justify anything. ;-)

> you have to expect some pretty big
> productivity and/or performance improvements spread over a
> lot of people.

I do.

> If the productivity improvements are merely
> incremental

Very small changes can make very big differences. Classes added to C for instance. Templates added to C++. These represented major paradigm shifts, but at the beginning appeared miniscule.

> the effort that goes
> into Heron will never be recovered in actual development
> projects.

That is a possibility, though I have confidence it won't happen.

> That is what I was getting at by asking if Heron
> will solve real development problems or if it's more of an
> academic or intellectual challenge.

> I'm always interested to find out what motivated a
> language designer to create something interesting, whether
> it's Wirth's Oberon, Stroustrup's C++, or Matz's Ruby. I'm
> still curious to know specifically which paradigms you
> want to unify in Heron,

Generative, generic, dynamic/reflective, functional, object-oriented.

> and how you expect to improve
> expressiveness and programmer productivity. I don't have a
> clear picture of the ideas and goals behind Heron other
> than your postings, which seem more focused on specific
> features and their implementation, and on run-time
> performance.

I apologize, I haven't really painted a clear picture. Part of that is because Heron is still in little pieces on the floor and I am trying to focus on getting a solid prototype working first.

> > I can do most of what I need in virtually any language,
> > unless it requires high performance.
>
> Do you mean that no languages available to you have
> sufficient performance, or that the languages that give
> you fast execution are insufficently expressive

This one.

> or
> powerful or productive? Do you expect that Heron will
> generate faster code than a C compiler?

I expect that a Heron programmer will be able to generate more efficient code, with signficantly more ease, by using generative programming techniques such as template meta-programming. Furthermore a Heron programmer will be able to design more sophisticated software with much less code.

> I'm curious what
> performance requirements you face.

Right now I am writing an interepreter and translator. An efficient interpreter is kind of important for serious work.

> What specifically will Heron do that will make
> it more expressive than C++?

One of the big things is orovide explicit support for template meta-programming for generative programming and unify it with the macro system. Another big ticket feature is duck-typing. After that it is a big long litany of small changes. It is relatively easy to improve on C++ when you stop holding on to C compatibility.

> I am still curious to see
> a real programming problem that is simply too hard to
> express in C++, Python, Ruby, Lisp, or some other
> available modern language.

Here are a few hard problems I have encountered:
- implementing an efficient matrix library with overloaded operators.
- efficient duck-typing
- efficient universal types
- concept checking

> Do you really get to work across so many different
> application domains in your professional work?

With all due respect, my work experience is not something I care to discuss or defend.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 7, 2005 4:04 PM
Reply to this message Reply
> What specifically will Heron do that will make
> it more expressive than C++?

I think perhaps the best way to answer this question is: I want to be able write a library like Boost ( http://www.boost.org ) or the STL, with far less code and in a manner which is comprehensible to the average programmer. If you are familiar with Boost source code, you'll know what I am talking about, check out some source code at http://www.ootl.org/boost/tuple/detail/tuple_basic.hpp.htm for a prime example.

Even though it is nightmarish code, it does represent something the fact that at least in C++ you can create brand new ideas and tools which weren't built directly into the language.

One major goal of Heron is that the language should be able to be extended in new directions with relative ease by writing new libraries, which can be as efficient as if the features were directly built into the language.

Greg Jorgensen

Posts: 65
Nickname: gregjor
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 7, 2005 4:47 PM
Reply to this message Reply
Thanks for your replies. I detect just a little irritation from you, and your responses bounce between flip and defensive. When you post a bunch of articles asking for opinions on a project you clearly take seriously, you shouldn't be put off by people who take the time to express their interest and curiosity in your project.

> I don't actually have to justify anything. ;-)

Maybe I didn't use "justify" in the right sense. If you want me or anyone else to read your postings and comment on them, I think you should be prepared to back up your statements with something that will justify your implicit request that some of us pay attention. Asking what your project has to offer that will justify me or other programmers investing our interest and time is, I think, a legitimate question. It's a question I asked when I first heard about C++, Java, Python, and pretty much every new language I learned. Until now I've never had the opportunity to ask the language designer, though, and I thought you were offering that opportunity.

You say that you expect big productivity and performance improvements for a lot of people. Is it not acceptable for me to ask you to flesh that claim out a little more? I'm assuming that if Heron was a big secret you wouldn't be posting about it on Artima, so now that you've got my attention am I out of line asking some questions about it?

> I apologize, I haven't really painted a clear picture.
> Part of that is because Heron is still in little pieces on
> the floor and I am trying to focus on getting a solid
> prototype working first.

Actually that's what both intrigues and worries me. I can't tell if there is a big plan for Heron and you've actually got some paradigm-shifting tricks up your sleeve, or if you're cobbling something together without a big plan or really new ideas and hoping it will turn into something. And I think that's a legitimate question to ask since I took the trouble to read your postings -- because maybe you are onto something and that would be exciting. But I can't tell for sure and I'm getting less confident the more I read your evasive and terse replies whenever someone starts to drill down.

> I expect that a Heron programmer will be able to generate
> more efficient code, with signficantly more ease, by using
> generative programming techniques such as template
> meta-programming. Furthermore a Heron programmer will be
> able to design more sophisticated software with much less
> code.

I'm always interested in getting more efficient code with less work on my part. Can you say more about your ideas? Compare what you're doing to something I know, like C++, Lisp, Smalltalk, C#?

> Right now I am writing an interepreter and translator. An
> efficient interpreter is kind of important for serious
> work.
> ...
> Here are a few hard problems I have encountered:
> - implementing an efficient matrix library with overloaded
> operators.
> - efficient duck-typing
> - efficient universal types
> - concept checking

Those all seem to be problems you're facing in developing Heron; I was asking about the programming problems that led you to lose your enthusiasm for C++ and other languages and decide to create Heron. Did you run into a programming problem (other than designing a new language) that got you started -- some of your postings seem to say that. Or did you start from an intellectual/academic view of the shortcomings of C++ and decide to fix the problems and/or add to the language (as Wirth did with Oberon, and Stroustrup did with C++)?

> One of the big things is orovide explicit support for
> template meta-programming for generative programming and
> unify it with the macro system. Another big ticket feature
> is duck-typing. After that it is a big long litany of
> small changes. It is relatively easy to improve on C++
> when you stop holding on to C compatibility.

That first part doesn't completely make sense to me; STL is about as meta as I want to get with C++. I like the duck typing, but you can already get pretty far with C++ generics if you don't mind the ugliness. I guess it's not a big selling point now but those of us who didn't learn C++ as our first language only looked at it because of the C backward compatibility. I know that the language was technically weakened by that decision, but it got traction with programmers because of that decision. I take it that Heron will not be backward-compatible with C++ then?

> With all due respect, my work experience is not something
> I care to discuss or defend.

I didn't ask you to defend anything, just to give an example of a programming problem you faced that led you to design a new language. Here's what I was hoping for: I alluded to writing high-performance graphics code (oil exploration/mapping stuff) a long time ago in Fortran, C, and assembly, and I could use that experience to illustrate my frustration with Fortran (to say nothing of x86 assembly language) without giving away any personal details or who I did the work for or whether the project succeeded and made me rich or not. I could use that experience to describe how I was led to Ratfor (the Fortran pre-processor described in the book "Software Tools,") which solved some of my Fortran issues, and from there to C, which seems like a cruel trick today, but only if you never had to use what came before it.

All I was asking for was some context to understand what got you started and where you are going with this project, and what experiences and expertise you bring to the computer language design arena. And I asked because I assumed that you posted your articles in a discussion forum because you wanted to discuss, not because I want to critique your career. Sorry if I touched a nerve.

Christopher Diggins

Posts: 1215
Nickname: cdiggins
Registered: Feb, 2004

Re: Macros and Type-Systems Posted: Oct 7, 2005 6:17 PM
Reply to this message Reply
> Thanks for your replies. I detect just a little irritation
> from you, and your responses bounce between flip and
> defensive.

Sorry about that.

> Actually that's what both intrigues and worries me. I
> can't tell if there is a big plan for Heron and you've
> actually got some paradigm-shifting tricks up your sleeve,

No big plan, just a bunch of small changes trying to arrive a language which satisfies me.

> I'm always interested in getting more efficient code with
> less work on my part. Can you say more about your ideas?
> Compare what you're doing to something I know, like C++,
> Lisp, Smalltalk, C#?

I don't have time right now, but I'll try to post about it later.

> > Right now I am writing an interepreter and translator.
> An
> > efficient interpreter is kind of important for serious
> > work.
> > ...
> > Here are a few hard problems I have encountered:
> > - implementing an efficient matrix library with
> overloaded
> > operators.
> > - efficient duck-typing
> > - efficient universal types
> > - concept checking
>
> Those all seem to be problems you're facing in developing
> Heron; I was asking about the programming problems that
> led you to lose your enthusiasm for C++ and other
> languages and decide to create Heron. Did you run into a
> programming problem (other than designing a new language)

These are problems I encountered trying to implement certain libraries in a way which made sense to me in C++ but I was too limited by the language to go further than a certain point.

I naturally think about software in terms of classes, contracts, interfaces, and crosscutting concerns. I can easily express efficient, and correct software designs, with relatively little work using a mix of features from different languages such as AspectJ, Eiffel, C++, and ML. However when it comes down to it no single language provides a mix of paradigms, which matches the way I think about software. This is why I am developing Heron.

I hope this answers your questions more satisfactorily.

Flat View: This topic has 35 replies on 3 pages [ « | 1  2  3 | » ]
Topic: Announcing Ruby Code & Style Previous Topic   Next Topic Topic: Threading Terminology

Sponsored Links



Google
  Web Artima.com   

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