On 26 Mai, 17:46, Friedrich Dominicus <just-for-news-fr...@[EMAIL PROTECTED]
> wrote:
> scholz.lot...@[EMAIL PROTECTED]
writes:
> > On 23 Mai, 21:37, thomas.mer...@[EMAIL PROTECTED]
wrote:
> >> Speaking about programming language development.
> >> Did you look at what other languages do?
>
> Oh, yes we first named it EPHIL (Eiffel Python Haskell inspired
> language (however I forgot what why pythonesque about ;-)
>
> >> The language I am developing is Seed7.
>
> >> Have you looked at Seed7?
>
> I've looked at many languages, but just a very "shallow look" into Seed7
>
>> What do you think about it?
>
> I've not really an opinion about it.
>
>> What features does Q have that are not present in Seed7?
>
> I guess Q is a bit older and never touched any other use but us. So
> Seed7 will surely be magnitudes better tested, used etc. But I Seed7
> does not have one loop construct with a sliding exit condition.
> We could have wrote
>
> loop until some_exit
>
> ....
> endloop
>
> loop
> do this
> do that
> be happy
> until unhappy
> do something else
> yet somethin gelse
> endloop
>
> or
>
> loop
> xyz
> abc
> until exit_condition
> endloop
> so the until is "sliding ;-".
Since this loop has a middle exit, but not a hidden goto like a
break statement, it is still structured and can be defined in Seed7.
I have modified the syntax of the loop statement a little bit to fit
to the Seed7 philosophy. The following test program implements the
loop and does a little test with it:
$ include "seed7_05.s7i";
$ syntax expr: .loop.().until.().do.().end.loop is -> 25;
const proc: loop
(ref proc: statements1)
until (ref func boolean: condition) do
(ref proc: statements2)
end loop is func
local
var boolean: exitLoop is FALSE;
begin
repeat
statements1;
if not condition then
statements2;
else
exitLoop := TRUE;
end if;
until exitLoop;
end func;
const proc: main is func
local
var integer: number is 10;
begin
loop
writeln("stat1 " <& number);
until number = 0 do
writeln("stat2 " <& number);
decr(number);
end loop;
end func;
As you can see the keyword 'do' is used after the condition.
To be usable in the general case it needs a little poli****ng. The
versions of the loop, where the condition is at the top or at the
bottom, are not covered with the definition above. In Seed7 empty
space is not seen as an empty statement (there is a 'noop' statement
which could be used in this case).
The syntax descriptions of the top and bottom condition versions
are:
$ syntax expr: .loop.until.().do.().end.loop is -> 25;
$ syntax expr: .loop.().until.().do.end.loop is -> 25;
The semantic definitions af this two statements are left to the
reader. But it can also be argued that this versions are not defined
and explicit 'noop' statements must be used.
The other thing is: In Seed7 a variable is not automatically seen
as function returning a value. Therefore the 'loop' statement
needs also to be defined for just a 'boolean' condition instead of
a 'func boolean' condition. The definition of this statement is
similar to the one above.
> AFAIKT doesn't Seed have anything comparable to the DBC stuff from
> Eiffel. I guess one could program it and maybe it would feel well into
> place. I don't know.
Currently I have not enough knowledge about 'design by contract'
to answer this. I have to look into it.
> and as written it was thought of as a follow up to Eiffel so it should
> stress the "strength" points about Eiffel, avoid a few things we
> thought were left out. (side-effect free functions e.g)
This is not clear to me: Do you want side-effect free functions or
do you think they should be left out.
> > For me, i look at a language which offers me
>
> > a) no lisp or { } syntax
> this would have hold for Q.
>
> > b) closures (either by value or reference)
> this would have hild for Q
>
> > c) generic container cl*****
> as in Eiffel
>
> > d) garbage collector
> yes not without
>
> > e) native compiled language, no VM
> Q->C
I have already talked about that points elsethead.
> > f) very fast and therefore statically typed
>
> Don't know how fast it really would have been but I guess it would
> have been "fast" enough. I'm getting more in more in doubt that
> statically typed really is needed. And I'd prefer optional type
> information and some sort of "automatic" deduction of the type
Type inference has been suggested for Seed7 also. My answer to this
is here: http://seed7.sourceforge.net/faq.htm#type_inference
> g) good runtime as i need to use it for money not for toy project
>
> Well it's not even finished and large parts are not even implemented,
> so knock it out ;-)
> h) usable in large projects (10000 cl***** and 1MLOC lines)
>
> Well I guess the number of classed would have workd but I'M not very
> impressed by 1 MLOG, seems to be a bit too much for my taste...
> i) able to use multithreading
>
> I'm strictly against the currently way of doing threading as in C/C++
> etc. It's too complex to get right IMHO and I'd prefer some Erlang
> kind way of doing this everytime. For my taste this seems even better
> be suited for object oriented programming. And object should not be
> tampered with from all edged of the program. Read somewhere about that
> Threads can be considered the GOTOS of current programming.
> IMHO debuggability and maintainability can just be put aside with
> Threads.
Here I am with you. OTOH I would like to cover this area with Seed7.
> Fell free to disagree, but I doubt you could convince me that Threads
> are a "good" thing....
>
> Regards
> Friedrich
>
> --
> Please remove just-for-news- to reply via e-mail.
BTW. I do not suggest that you should not implement Q and use Seed7
instead. What I propose is:
You can define functionality you would like for Q in Seed7.
That additional functionality could be gathered in a library.
The 'loop' statement, statements which sup****t DBC, some containers
and more could be defined in this library.
If there are conflicts between Q and Seed7 functionality there
could be also a more radical solution. Seed7 is defined in the
"seed7_05.s7i" include file. You could replace that with "q_1.s7i".
The 'hi' interpreter would boot from that file and provide the Q
functionality.
Greetings Thomas Mertes
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, ****table, runs under linux/unix/windows.


|