pure-lang-users Mailing List for Pure (Page 12)
Status: Beta
Brought to you by:
agraef
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
(31) |
May
(422) |
Jun
(241) |
Jul
(268) |
Aug
(281) |
Sep
(109) |
Oct
(1) |
Nov
|
Dec
|
---|
From: Ryan S. <rya...@us...> - 2008-08-19 10:57:50
|
On Aug 19, 2008, at 05:20, Albert Graef wrote: > Ryan Schmidt wrote: >>> DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | >>> diff >>> test/prelude.log -; echo $? >>> >>> (That should print just the exit code '0' if everything is all >>> right.) >> >> It does print 0. > > Then everything should be all right and make check should work ok, too > (all make check does is in fact checking the return code of that diff > command). > > I'm beginning to suspect that ./pure might pick up an old installed > libpure.dylib from somewhere. Can you please run 'sudo make > uninstall', > verify that all libpure's have been exorcised from your system and > recheck? No, that's not it: >> Perhaps this output is helpful: >> >> $ DYLD_LIBRARY_PATH=. PURELIB=./lib ./pure -v7 ./lib/prelude.pure >> 2>&1 | diff -u - ./test/prelude.log > > That won't work. You need to pass -n before -v7 there. You're not passing -n before -v7. You're passing $(ECHO_N), and you've set $(ECHO_N) to empty on Leopard. But I don't think you should: >> The first part ("-n" being >> printed out) has been fixed, the second (the result going to the >> second line) has not. > > Hmm, I'll probably have to append that \c thingy, too. Will see what I > can do. I don't know about this "\c" thing. The issue is that "echo -n" on Leopard works, by design, in bash but not in sh. And your Makefile sets SHELL=/bin/sh. If I set $(ECHO_N) to "-n" and SHELL to /bin/bash the printing works correctly. Or you could call /bin/echo -n instead of echo -n, but I think setting SHELL to bash if bash is available is the proper solution. Here is the documentation on echo in Leopard: http://developer.apple.com/releasenotes/Darwin/RN-Unix03Conformance/ index.html#//apple_ref/doc/uid/TP40004772-DontLinkElementID_5 |
From: Albert G. <Dr....@t-...> - 2008-08-19 10:19:23
|
Ryan Schmidt wrote: >> DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff >> test/prelude.log -; echo $? >> >> (That should print just the exit code '0' if everything is all right.) > > It does print 0. Then everything should be all right and make check should work ok, too (all make check does is in fact checking the return code of that diff command). I'm beginning to suspect that ./pure might pick up an old installed libpure.dylib from somewhere. Can you please run 'sudo make uninstall', verify that all libpure's have been exorcised from your system and recheck? > Perhaps this output is helpful: > > $ DYLD_LIBRARY_PATH=. PURELIB=./lib ./pure -v7 ./lib/prelude.pure > 2>&1 | diff -u - ./test/prelude.log That won't work. You need to pass -n before -v7 there. > The first part ("-n" being > printed out) has been fixed, the second (the result going to the > second line) has not. Hmm, I'll probably have to append that \c thingy, too. Will see what I can do. > Something else: I'm noticing that I cannot cancel the "make check" by > pressing ^C. It just causes the currently-running test to fail, and > proceeds with the next test. Right. But you can kill the make process. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-08-19 08:37:54
|
On Aug 19, 2008, at 02:09, Albert Graef wrote: >>> Can you please send me the output of this command: >>> DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | >>> diff >>> test/prelude.log - >> >> No output! > > Hmm, that's how it's supposed to be. But still 'make check' fails? > What > does the following command print? > > DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff > test/prelude.log -; echo $? > > (That should print just the exit code '0' if everything is all right.) It does print 0. Perhaps this output is helpful: $ DYLD_LIBRARY_PATH=. PURELIB=./lib ./pure -v7 ./lib/prelude.pure 2>&1 | diff -u - ./test/prelude.log --- - 2008-08-19 03:34:56.000000000 -0500 +++ ./test/prelude.log 2008-08-19 03:25:20.000000000 -0500 @@ -1,4 +1,4 @@ -./lib/prelude.pure:70.0-23: symbol 'false' is already defined as a constant +const false,true = 0,1; f/*0:01*/$x/*0:1*/ = f/*0:01*/ x/*0:1*/; (f/*0:001*/.g/*0:01*/) x/*0:1*/ = f/*0:001*/ (g/*0:01*/ x/*0:1*/); void _/*0:1*/ = (); $ On Leopard, the -n flag is not passed to pure, I suppose because $ (ECHO_N) is empty, which was done to begin to fix the problem of the string "-n" being output during the testing and the result (passed or FAILED) being printed on the next line. The first part ("-n" being printed out) has been fixed, the second (the result going to the second line) has not. >> Separately: I tested on Tiger. There, prelude.pure and all other >> tests >> pass, except test017.pure which fails. I deleted test017.log and ran >> "make logs", and test017.log is different; attached. > > Yeah, apparently CLOCKS_PER_SEC differs from the usual value on some > Apple systems. Should be fixed in r537. Is fixed, thanks! Something else: I'm noticing that I cannot cancel the "make check" by pressing ^C. It just causes the currently-running test to fail, and proceeds with the next test. |
From: Albert G. <Dr....@t-...> - 2008-08-19 08:10:14
|
Hi all, in addition to the changes originally proposed, I also renamed the 'def' keyword in constant definitions to 'const' now, as Eddie originally suggested. The reason is that I soon want to use the 'def' keyword (which is still reserved) for macro definitions. Scripts and syntax highlighting files have been updated accordingly. (Libor, I updated your dates.pure example as well.) These changes are implemented in r539 (a rather big changeset since many source files were touched), updated documentation will follow in the next revision. Sorry for the short notice, I really want to get Pure 0.5 out of the door asap... Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2008-08-19 07:08:30
|
Ryan Schmidt wrote: >> Can you please send me the output of this command: >> DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff >> test/prelude.log - > > No output! Hmm, that's how it's supposed to be. But still 'make check' fails? What does the following command print? DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff test/prelude.log -; echo $? (That should print just the exit code '0' if everything is all right.) > Separately: I tested on Tiger. There, prelude.pure and all other tests > pass, except test017.pure which fails. I deleted test017.log and ran > "make logs", and test017.log is different; attached. Yeah, apparently CLOCKS_PER_SEC differs from the usual value on some Apple systems. Should be fixed in r537. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-08-19 06:18:57
|
On Aug 19, 2008, at 00:59, Albert Graef wrote: > Ryan Schmidt wrote: > >> Here it is, but it is the same prelude.log that is in your repository >> (hence no differences shown by "svn diff") > > Sorry, it was late. ;-) > > But if regenerating the log doesn't show any differences, then it > shouldn't fail on 'make check' either. Does it still fail there? > > Can you please send me the output of this command: > DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff > test/prelude.log - No output! Separately: I tested on Tiger. There, prelude.pure and all other tests pass, except test017.pure which fails. I deleted test017.log and ran "make logs", and test017.log is different; attached. |
From: Albert G. <Dr....@t-...> - 2008-08-19 05:58:27
|
Ryan Schmidt wrote: > Here it is, but it is the same prelude.log that is in your repository > (hence no differences shown by "svn diff") Sorry, it was late. ;-) But if regenerating the log doesn't show any differences, then it shouldn't fail on 'make check' either. Does it still fail there? Can you please send me the output of this command: DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff test/prelude.log - -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-08-19 04:21:19
|
On Aug 18, 2008, at 19:05, Albert Graef wrote: > Ryan Schmidt wrote: >> After running "rm test/prelude.log && make logs", "svn diff test" >> shows no differences. > > Surely not, but I need your version of the file now to compare against > my "golden" log. :) Here it is, but it is the same prelude.log that is in your repository (hence no differences shown by "svn diff") |
From: Albert G. <Dr....@t-...> - 2008-08-19 00:04:06
|
Ryan Schmidt wrote: > After running "rm test/prelude.log && make logs", "svn diff test" > shows no differences. Surely not, but I need your version of the file now to compare against my "golden" log. :) Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-08-18 23:59:37
|
On Aug 18, 2008, at 18:51, Albert Graef wrote: > Ryan Schmidt wrote: >> The prelude test failed; the log is attached. > > Probably not a big issue, given that all other tests pass. > > Could you please run the following: > > rm test/prelude.log && make logs > > Then please send me the newly created test/prelude.log so that I can > figure out where it differs on your system. After running "rm test/prelude.log && make logs", "svn diff test" shows no differences. |
From: Albert G. <Dr....@t-...> - 2008-08-18 23:50:50
|
Ryan Schmidt wrote: > The prelude test failed; the log is attached. Probably not a big issue, given that all other tests pass. Could you please run the following: rm test/prelude.log && make logs Then please send me the newly created test/prelude.log so that I can figure out where it differs on your system. Thanks, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2008-08-18 23:41:31
|
Eddie Rucker wrote: > Use to be, 0.5*x produced faster code than x/2.0. Well, I was pleasantly > surprised with the assembly output of "gcc -S -O2 test.c" produced > exactly the same output. Doesn't make a difference with Pure either, in fact even x/2 runs every bit as fast, and looks nicer. I've committed that version now. -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-08-18 23:33:37
|
On Aug 18, 2008, at 07:08, Albert Graef wrote: > I'm basically through with my 0.5 TODO list now (Windows port > notwithstanding; I can hopefully take a look at that later today). > So if > anyone is still listening, it would be nice if you could take the > latest > svn for a test drive. ;-) Ok, I tested r534 on Mac OS X 10.5 Leopard. The install_name stuff is working, so I could remove my patch, thanks. The prelude test failed; the log is attached. The issue with the pass or fail being printed on the next line on Leopard hasn't been resolved yet. |
From: Eddie R. <er...@bm...> - 2008-08-18 23:27:45
|
On Mon, 2008-08-18 at 18:25 -0500, Eddie Rucker wrote: Dang! I keep forgetting to put parenthesis around the r = sqrt (x*x+y*y) e.r. > sqrt is usually faster than sin and cos both in floating point hardware > and software. > > e.r. > > On Tue, 2008-08-19 at 01:16 +0200, Albert Graef wrote: > > Eddie Rucker wrote: > > > Sorry. > > > > > > sqrt (x+:y) = sqrt (0.5*(r+x)) +: sqrt (0.5*(r-x)) > > > when > > > r = sqrt x*x+y*y; > > > end; > > > > That looks neat, I think I'm going to use that. :) > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > pure-lang-users mailing list > pur...@li... > https://lists.sourceforge.net/lists/listinfo/pure-lang-users |
From: Eddie R. <er...@bm...> - 2008-08-18 23:25:37
|
sqrt is usually faster than sin and cos both in floating point hardware and software. e.r. On Tue, 2008-08-19 at 01:16 +0200, Albert Graef wrote: > Eddie Rucker wrote: > > Sorry. > > > > sqrt (x+:y) = sqrt (0.5*(r+x)) +: sqrt (0.5*(r-x)) > > when > > r = sqrt x*x+y*y; > > end; > > That looks neat, I think I'm going to use that. :) > |
From: Albert G. <Dr....@t-...> - 2008-08-18 23:15:10
|
Eddie Rucker wrote: > Sorry. > > sqrt (x+:y) = sqrt (0.5*(r+x)) +: sqrt (0.5*(r-x)) > when > r = sqrt x*x+y*y; > end; That looks neat, I think I'm going to use that. :) -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Eddie R. <er...@bm...> - 2008-08-18 20:50:02
|
Use to be, 0.5*x produced faster code than x/2.0. Well, I was pleasantly surprised with the assembly output of "gcc -S -O2 test.c" produced exactly the same output. test.c: ------------------------------ #include <stdio.h> int main(void) { double a, b, c; printf("Enter first num:"); scanf("%g", &a); printf("Enter second num:"); scanf("%g", &b); c = a/2.0; printf("%g\n", c); c = 0.5*b; printf("%g\n", c); return 0; } ----------------------------- Portion of the assembly: ----------------------------- call scanf movsd .LC3(%rip), %xmm0 movl $.LC4, %edi movl $1, %eax mulsd 16(%rsp), %xmm0 call printf movsd .LC3(%rip), %xmm0 movl $.LC4, %edi movl $1, %eax mulsd 8(%rsp), %xmm0 call printf e.r. |
From: Eddie R. <er...@bm...> - 2008-08-18 19:41:08
|
On Mon, 2008-08-18 at 19:49 +0200, Albert Graef wrote: > Eddie Rucker wrote: > > IMHO, the following rules should be added for pow: > > > > pow n::int (x%y) | > > pow n::bigint (x%y) | > > pow n::double (x%y) = pow n (x/y); > > Yes, you're right, I've added these now. After the last svn update I'm getting: > using math; > pow 3 (4%3); warning: rule never reduced: pow n::int (x%y) = pow n (x/y); warning: rule never reduced: pow n::bigint (x%y) = pow n (x/y); warning: rule never reduced: pow n::double (x%y) = pow n (x/y); 4.32674871092222 > When I looked in math.pure you have the following rules: pow (x%y) n::int | pow (x%y) n::bigint = pow x n % pow y n if n>0; = pow y (-n) % pow x (-n) if n<0; = 1L%1L otherwise; pow (x%y) n::double = pow (x/y) n; pow (x%y) (n%m) = pow (x/y) (n/m); pow x::int (n%m) | pow x::bigint (n%m) | pow x::double (n%m) = pow x (n/m); pow n::int (x%y) | pow n::bigint (x%y) | pow n::double (x%y) = pow n (x/y); You might want to cut the last three out? e.r. |
From: Eddie R. <er...@bm...> - 2008-08-18 19:30:22
|
Sorry. sqrt (x+:y) = sqrt (0.5*(r+x)) +: sqrt (0.5*(r-x)) when r = sqrt x*x+y*y; end; |
From: Albert G. <Dr....@t-...> - 2008-08-18 17:48:15
|
Eddie Rucker wrote: > IMHO, the following rules should be added for pow: > > pow n::int (x%y) | > pow n::bigint (x%y) | > pow n::double (x%y) = pow n (x/y); Yes, you're right, I've added these now. Thanks, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2008-08-18 17:32:21
|
Eddie Rucker wrote: >> > sqrt (1+:2); >> 2.23606797749979*cos (t/2)+:2.23606797749979*sin (t/2) Oops. Fixed. >> Another nice way of doing this is: >> >> sqrt (x+:y) = sqrt (0.5*(r+a)) +: sqrt (0.5*(r-a)) >> when >> r = sqrt x*x+y*y; >> end; a = ? > Oops. That r should be r = sqrt (x*x+y*y). -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2008-08-18 17:05:31
|
Eddie Rucker wrote: >> pow n::int (x%y) | >> pow n::bigint (x%y) | >> pow n::double (x%y) = pow n (x/y); Hmm, there's a reason that we have both ^ and pow, they're not the same. In Q, pow started out as a wrapper for the GMP bigint power function. The idea was to have a function that handles all the cases where exact powers can be computed. Unfortunately, when I ported that definition over to Pure, for some reason I decided that pow should also wrap the C pow function, maybe that was a mistake... I'll have to think about this. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2008-08-18 16:50:14
|
Eddie Rucker wrote: > Should the rule > > a%b = a if b == 1 || b == 1L; > > be added to math.pure or should this be defined by the user? That's not how it's supposed to work. % should always return rationals for any combination of integer and rational arguments. -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Albert G. <Dr....@t-...> - 2008-08-18 16:47:36
|
Eddie Rucker wrote: >> I also vaguely recall that someone volunteered to write a little test >> module for math.pure, or did I just dream that up? :) > > Was that me? I'll see what I can do ASAP. Not sure, but it would be much appreciated anyway. :) -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Eddie R. <er...@bm...> - 2008-08-18 14:59:55
|
On Mon, 2008-08-18 at 09:56 -0500, Eddie Rucker wrote: > Something bad is happening here for the complex numbers: > > > sqrt (1+:2); > 2.23606797749979*cos (t/2)+:2.23606797749979*sin (t/2) > > the angle t is missing. > > Another nice way of doing this is: > > sqrt (x+:y) = sqrt (0.5*(r+a)) +: sqrt (0.5*(r-a)) > when > r = sqrt x*x+y*y; > end; > > e.r. Oops. That r should be r = sqrt (x*x+y*y). I have to go to a Faculty Advising workshop now. Will return soon I hope. e.r. |