Executable semantics in C

2011-04-27 Thread Robert Clipsham
Just read another excellent article by John Regehr, this time about executable semantics: http://blog.regehr.org/archives/523 They seem to be creating a pretty complete system for identifying bugs and reducing test cases. A similar tool could be useful for D, it's a huge task though. Of cou

Re: Executable semantics in C

2011-04-27 Thread bearophile
Robert Clipsham: > They seem to be creating a pretty complete system for identifying bugs > and reducing test cases. A similar tool could be useful for D, it's a > huge task though. Given that D is a new language, the first duty is to put less traps/undefined situations in the language, compar

Re: Executable semantics in C

2011-04-27 Thread bearophile
> even when this doesn't allow a perfectly efficient mapping on every CPU. Look at Ada to see how this is done. Ada runs on small CPUs&RAM too. Bye, bearophile

Re: Executable semantics in C

2011-04-27 Thread Timon Gehr
> Given that D is a new language, the first duty is to put less traps/undefined > > situations in the language, compared to C, even when this doesn't allow a > perfectly efficient mapping on every CPU. > > Bye, > bearophile I think it is a good idea to just define the order to be left-to-right (e

Re: Executable semantics in C

2011-05-03 Thread Bruno Medeiros
On 27/04/2011 22:20, Timon Gehr wrote: Quiz: What does the following code compute? import std.stdio; import core.exception; void main(){ int a,b; int[int] aa; scanf("%d %d",&a,&b); try{aa[a]=aa[b];printf("Y\n");}catch(RangeError){printf("N\n");} } What was your

Re: Executable semantics in C

2011-05-04 Thread Robert Jacques
On Tue, 03 May 2011 08:20:42 -0400, Bruno Medeiros wrote: On 27/04/2011 22:20, Timon Gehr wrote: Quiz: What does the following code compute? import std.stdio; import core.exception; void main(){ int a,b; int[int] aa; scanf("%d %d",&a,&b); try{aa[a]=aa[b];prin

Re: Executable semantics in C

2011-05-04 Thread Bruno Medeiros
On 04/05/2011 14:45, Robert Jacques wrote: On Tue, 03 May 2011 08:20:42 -0400, Bruno Medeiros wrote: On 27/04/2011 22:20, Timon Gehr wrote: Quiz: What does the following code compute? import std.stdio; import core.exception; void main(){ int a,b; int[int] aa; scanf("%d %d",&a,&b); try{aa[a]=

Re: Executable semantics in C

2011-05-06 Thread Timon Gehr
Robert Jacques wrote: >On Tue, 03 May 2011 08:20:42 -0400, Bruno Medeiros > wrote: > >> On 27/04/2011 22:20, Timon Gehr wrote: >>> Quiz: What does the following code compute? >>> >>> import std.stdio; >>> import core.exception; >>> void main(){ >>> int a,b; >>> int[int] aa; >>> scanf("%d %d",&a,