.oisyn said:
My god. I hope I never have to work with a language that you designed. Syntactic sugar helps a great deal with respect to productivity and code maintainability. Your argument could have just as well been to use assembly, because you can do anything with assembly. And why add, if you can increment? Why multiply, if you can add?
I think you may have misunderstood me. I meant that the features should not be *hard-coded* into the language. There will still be for loops, and they'll work exactly as they do now, except that they're part of the library and you can write similar looping constructs at your will.
At the lowest level, the language *will* be similar to assembly, however there will be mechanisms for abstraction so that you can write code at a high level.
Quote
Why have closures, if you can have regular function pointers which can't be defined in local scope and which can't access the variables out of the local scope, which doesn't matter because you can just as well put all the local variables in the struct and pass it to the global function. No thank you ma'am, I'm pretty fine with a language construct that allows me to express myself in a less verbose way which makes me more productive, my code less error-prone and more readable.
Again, things like closures would not be part of the core language, but instead would be part of a library. The obvious advantage being that, if you don't like how closures worked then you could modify the source yourself, or you could write a new style of closure that worked for your particular needs.
Quote
structure is important feature of software (code) for us humans.
I don't see where I said that we should remove structure from languages. OOP is one way to structure programs. Is it the best? I don't think so, and that's why I'm trying to find better ways.
Quote
Show us what you have and let's discuss it, I'll be glad. Or contact me on ICQ, SKYPE, ..., it's a nice discussion.
I'd be happy to discuss it, but my ideas are still immature, and it's all still in my head. I've already given a few characteristics of what the language would be like, but as I explained earlier I haven't solved some core problems yet, and the solution to those could completely change the language (from being imperative to declarative). As such, I don't see any point trying to develop anything concrete until I solve those problems.
---
I don't mean to be come across as hostile. I just don't understand your "people are happy, so let's just live with what we've got, even if you think it could be improved." That doesn't really strike me as a good mindset for progress.
Quote
No you couldn't. After you have the two iterators for splicing, there could be third iterator adding/removing values in between the iterators messing up the count values. I made design decision in my list implementation to maintain list size within the list class and only allow splicing of an entire list to another in O(1) time. It's much more rare to splice than ask for the size of the list.
That doesn't make it impossible, it just makes it more difficult. You know whether the 3rd iterator is between the first two or not (due to linear traversal), so you know how it is effecting the count.
Regardless, I only need to argue the specific case here. What I'm saying is that there *are* situations where having extra information could dramatically improve performance, but in many cases that information would only be available if you modify subfunctions.
A similar problem is stream fusion. Let's say you wanted to do this:
for (int i = 0; i < n; ++i)
foo();
for (int i = 0; i < n; ++i)
bar();
Of course, this can be improved by joining the loops (provided bar() doesn't rely on specific side-effects of foo()):
for (int i = 0; i < n; ++i)
{
foo();
bar();
}
But what if you had already factored out the loops?
foo_loop();
bar_loop();
The only way you can merge the loops then is to break the structure of your program (or hope the optimizer can do it for you).
And that really is what I see as a core problem of many imperative languages: they often force the programmer to choose between fast, unstructured code, and slow, structured code. I don't believe that programmers should ever have to make that decision.