tfib.scm

2009-07-26 Thread Juhani Viheräkoski
At least I could easily put raw logs available to my webpage, I run the 
benchmarks by hand anyway. Then I could try to polish my hacked benchmark 
suite and send it upstream. There were some bugs introduced by my porting 
efforts, I *think* I've fixed them all now :) If someone wants to try it it's 
now available at

http://moonshine.kapsi.fi/bench-guile.tar.bz2

I am currently running the benchmarks and I will put the results for master 
(compiled and interpreted) and 1.8.6 in text format to 
http://moonshine.kapsi.fi/guile-results when finished. I'll try to hack 
something neater during the next week or so. BTW, does anyone know if there 
are guile bindings for any graphic library as I couldn't find any? If there 
aren't, I'll do it in perl then, although I don't especially like perl.


Hi,

Results for guile-head are there, however not for 1.8.6 because I think 
there is a problem with threads (at least the same testcase works with git 
version). This program creates lots of threads but should only take some 
milliseconds to run on Linux. It goes into an infinite loop, or at least
takes a very long time to execute as it run for several hours in the 
background while I was doing something else. Testcase attached.


--
Juhani


;--

(define (run-bench name count ok? run)
  (let loop ((i count) (result '(undefined)))
(if (< 0 i)
  (loop (- i 1) (run))
  result)))

(define (run-benchmark name count ok? run-maker . args)
  (newline)
  (let* ((run (apply run-maker args))
 (result (run-bench name count ok? run)))
(if (not (ok? result))
  (begin
(display "*** wrong result ***")
(newline)
(display "*** got: ")
(write result)
(newline)

(define (fatal-error . args)
  (for-each display args)
  (newline)
  (exit 1))

 (define (call-with-output-file/truncate filename proc)
   (call-with-output-file filename proc))

;--

; Macros...

; Specialize fixnum and flonum arithmetic.

;; This code should be used when f64vectors are available.
;(def-macro (FLOATvector-const . lst)   `',(list->f64vector lst))
;(def-macro (FLOATvector? x)`(f64vector? ,x))
;(def-macro (FLOATvector . lst) `(f64vector ,@lst))
;(def-macro (FLOATmake-vector n . init) `(make-f64vector ,n ,@init))
;(def-macro (FLOATvector-ref v i)   `(f64vector-ref ,v ,i))
;(def-macro (FLOATvector-set! v i x)`(f64vector-set! ,v ,i ,x))
;(def-macro (FLOATvector-length v)  `(f64vector-length ,v))
;
;(def-macro (nuc-const . lst)
;  `',(list->vector
;   (map (lambda (x)
;  (if (vector? x)
;(list->f64vector (vector->list x))
;x))
;lst)))

(define make-thread call-with-new-thread)
(define thread-join! join-thread)
(define (thread-start! x) #f)
(define-macro (bitwise-or . lst) `(logior ,@lst))
(define-macro (bitwise-and . lst) `(logand ,@lst))
(define-macro (bitwise-not . lst) `(lognot ,@lst))


; Don't specialize fixnum and flonum arithmetic.

(define-macro (FLOATvector-const . lst)   `',(list->vector lst))
(define-macro (FLOATvector? x)`(vector? ,x))
(define-macro (FLOATvector . lst) `(vector ,@lst))
(define-macro (FLOATmake-vector n . init) `(make-vector ,n ,@init))
(define-macro (FLOATvector-ref v i)   `(vector-ref ,v ,i))
(define-macro (FLOATvector-set! v i x)`(vector-set! ,v ,i ,x))
(define-macro (FLOATvector-length v)  `(vector-length ,v))

(define-macro (nuc-const . lst)
  `',(list->vector lst))

(define-macro (FLOAT+ . lst) `(+ ,@lst))
(define-macro (FLOAT- . lst) `(- ,@lst))
(define-macro (FLOAT* . lst) `(* ,@lst))
(define-macro (FLOAT/ . lst) `(/ ,@lst))
(define-macro (FLOAT= . lst)  `(= ,@lst))
(define-macro (FLOAT< . lst)  `(< ,@lst))
(define-macro (FLOAT<= . lst) `(<= ,@lst))
(define-macro (FLOAT> . lst)  `(> ,@lst))
(define-macro (FLOAT>= . lst) `(>= ,@lst))
(define-macro (FLOATnegative? . lst) `(negative? ,@lst))
(define-macro (FLOATpositive? . lst) `(positive? ,@lst))
(define-macro (FLOATzero? . lst) `(zero? ,@lst))
(define-macro (FLOATabs . lst) `(abs ,@lst))
(define-macro (FLOATsin . lst) `(sin ,@lst))
(define-macro (FLOATcos . lst) `(cos ,@lst))
(define-macro (FLOATatan . lst) `(atan ,@lst))
(define-macro (FLOATsqrt . lst) `(sqrt ,@lst))
(define-macro (FLOATmin . lst) `(min ,@lst))
(define-macro (FLOATmax . lst) `(max ,@lst))
(define-macro (FLOATround . lst) `(round ,@lst))
(define-macro (FLOATinexact->exact . lst) `(inexact->exact ,@lst))

(define-macro (GENERIC+ . lst) `(+ ,@lst))
(define-macro (GENERIC- . lst) `(- ,@lst))
(define-macro (GENERIC* . lst) `(* ,@lst))
(define-macro (GENERIC/ . lst) `(/ ,@lst))
(define-macro (GENERICquotient . lst)  `(quotient ,@lst))
(define-macro (GENERICremainder . lst) `(remainder ,@lst))
(define-macro (GENERICmodulo . lst)`(modulo ,@lst))
(define-macro (GENERIC= . lst)

Merging libguile-i18n with libguile

2009-07-26 Thread Ludovic Courtès
Hi,

szgyg  writes:

> 5. Parameters in libguile_i18n...@libguile_i18n_major@_la_LDFLAGS is
> wrong (libguile/Makefile.am line 135). Please copy from other .so's
> LD_FLAGS, as the others build fine.

I've seen this report before, but FWIW, I've been thinking about merging
libguile-i18n into libguile.  I created it as a separate library long
ago, but I'm not so sure the library size justifies it (on
x86_64-linux-gnu, `.text' is 35 KiB, which is 19% of the 649 KiB of
current libguile's `.text').

What do you think?

Thanks,
Ludo'.





Re: Quasisyntax broken?

2009-07-26 Thread Ludovic Courtès
Hi Andreas,

Andreas Rottmann  writes:

> I think I filed one for Guile several years ago, and think you assume
> rightly; 

Yes, you're on file.

> I guess that might be a problem; OTOH it would be (IMHO) kinda dumb to
> have to ignore/rewrite all the perfectly (L)GPL-compatible BSD- and
> MIT-licensed code that's out there, as you cannot expect the
> respective authors to all sign copyright assignments for Guile...

Yes, of course.  We already have code not copyright FSF such as
`psyntax' and `match'.

Thanks,
Ludo'.





Re: Quasisyntax broken?

2009-07-26 Thread Andy Wingo
Hi,

On Sat 25 Jul 2009 23:30, Andreas Rottmann  writes:

> Andy Wingo  writes:
>
>> On Fri 24 Jul 2009 00:35, Andreas Rottmann  writes:
>>
>>> Andy Wingo  writes:
>>>
 On Fri 03 Jul 2009 02:04, Andreas Rottmann  writes:

> Playing around with Guile's now-in-core syntax-case support (using Git
> HEAD as of today), I found that quasisyntax seems quite broken:

 We've spoken over IRC since then, but for those that do not frequent
 there, it's simply not implemented. You can implement it in terms of
 with-syntax, though. Did you have a patch for that, Andreas?

>>> Yep, the patch is attached:
>>
>> What is the license of this code?
>>
> It's under the (unmodified) MIT license, see
> 

Hm. I have no idea what this means for Guile. It seems we need either a
disclaimer or an assignment. Now, it seems that something happened in
the past with psyntax which would seem to go against this, though:

commit 9d1a28471c4e69ee151a85d44fa69bf102ec
Author: Jim Blandy 
Date:   Mon Oct 19 13:43:50 1998 +

We can't include Kent Dybvig's syntax-case macro expander in the
core Guile distribution, because we don't have copyright
assignments for this code.  We can certainly distribute them as a
separate package, but Guile should be FSF code.
* syncase.scm, psyntax.pp, psyntax.ss: Removed.
* Makefile.am (ice9_sources): Removed syncase.scm, psyntax.pp, and
psyntax.ss.
* Makefile.in: Regenerated.
* Makefile.am (ice9_sources): Add getopt-gnu-style.scm.
* Makefile.in: Regenerated.

But then:

commit a63812a2fef2f81b8c4eca04c858e42b62e455f9
Author: Jim Blandy 
Date:   Mon Oct 19 15:38:05 1998 +

Talked to Stallman.  Actually, the syntax-case copyright is no
problem.  Duh.
* Makefile.am (ice9_sources): Revert last change.
* syncase.scm, psyntax.pp, psyntax.ss: Added again.
* Makefile.in: Regeneretade.

So I don't know what the deal is. I'll defer to Neil and Ludovic.

> it would be (IMHO) kinda dumb to have to ignore/rewrite all the
> perfectly (L)GPL-compatible BSD- and MIT-licensed code that's out
> there, as you cannot expect the respective authors to all sign
> copyright assignments for Guile...

Yes, I agree.

Cheers,

Andy
-- 
http://wingolog.org/




Re: Quasisyntax broken?

2009-07-26 Thread Ludovic Courtès
Hi,

Andy Wingo  writes:

> Hm. I have no idea what this means for Guile. It seems we need either a
> disclaimer or an assignment.

My understanding is that it's OK if we have bits of code not copyright
FSF, if there's a good reason to do so (and there is one, here).

After some reading, I see this (info "(maintain) Copying from Other
Packages"):

 When you are copying code for which we do not already have papers,
  you need to get papers for it.  It may be difficult to get the papers
  if the code was not written as a contribution to your package, but
  that doesn't mean it is ok to do without them.  If you cannot get
  papers for the code, you can only use it as an external library (*note
  External Libraries::).

But later on (info "(maintain) External Libraries") basically says that
it's easy to incorporate free third-party code like this.

At any rate we already have precedents for this (`psyntax' and `match')
so I'm not worried.  Maybe we can ask Karl Berry and RMS just to make
sure.

(Note that the so-called "GNU" Bazaar doesn't have a single line
copyright FSF.)

Thanks,
Ludo'.





Wide strings and the VM

2009-07-26 Thread Mike Gran
Hi-

I wonder if I could get someone to check out what I've done with wide
strings and the VM on the string_abstraction2 branch with commit
efb042...

That code is quite confusing, and I may have made a mess of it.  And, I
wasn't sure about alignment.

I daresay that this Unicode string stuff is now a genuine alpha.  It is
feature complete: wide chars, wide strings and symbols, Unicode-capable
SRFI-14, and VM / compiler updates.

Unicode capable regex will, unfortunately, have to wait until
libunistring finishes their implementation.

Still have old ideas from Andy to incorporate, though.  More testing, of
course.  And some speed improvements are probably necessary.

--Mike