Re: Data Dictionary and Configuration Files with Guile Scheme

2010-08-20 Thread Romel Sandoval
Thanks Thien-Thi that's exactly what I was trying to achieve.

El mié, 18-08-2010 a las 20:20 +0200, Thien-Thi Nguyen escribió:
> () Romel Sandoval 
> () Thu, 05 Aug 2010 12:15:44 -0500
> 
>What do you think?
> 
> I use Guile-PG (several modules) and a homegrown metainfo table
> accessible via ‘(ttn-do zzz various-db) personal-pgtable-defs’ et al:
> http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#zzz-various_002ddb
> 
> Here is ~/.pgtable-defs, omitting some parts:
> 
>   ;;; ~/.pgtable-defs --- database descriptions -*- scheme -*-
>   
>   ;; Keyword Expansions
>   ;; --
>   
>   ((#:pk "PRIMARY KEY")
>(#:u  "UNIQUE")
>(#:nn "NOT NULL")
>(#:mf "MATCH FULL")
>(#:dc "ON DELETE CASCADE")
>(#:uc "ON UPDATE CASCADE")
>(#:r  "REFERENCES")
>(#:tz "WITH TIME ZONE"))
>   
>   ;; Database Table Definitions
>   ;; --
>   ;;
>   ;; ((DB-1 (TABLE DEF ...) (TABLE DEF ...) ...)
>   ;;  (DB-2 (TABLE DEF ...) (TABLE DEF ...) ...) ...)
>   ;;
>   ;; Some day `infer-defs' will be able to round-trip these...
>   
>   (("ttn"
>   
> ("sw_maint"
>  (vbool #:nn)
>  (url  text #:nn)
>  (mon  text #:nn)
>  (name text #:pk)
>  (orig text)
>  (mtim timestamp[]))) ; 0: mon
>   
>("gnuvola"
>   
> ("updbad"
>  (time timestamp #:pk)
>  (causetext)
>  (errmsg   text))
>   
> ("updok"
>  (time timestamp #:pk)
>  (wroteint4)
>  (read int4)
>  (rate float4)
>  (totalint4)
>  (speedup  float4))
>   
> ("updfiles"
>  (file text)
>  (move char)
>  (time timestamp #:r "updok" #:dc #:uc
>   
>   ;;; ~/.pgtable-defs ends here
> 
> This file consists of two forms.  The first is (hopefully)
> self-explanatory.  The second describes two databases:
> 
>   db   tables
>   ---  ---
>   ttn  sw_maint
>   gnuvola  updbad, updok, updfiles
> 
> Each table's columns are further described in a way that really ought to
> be queryable from the backend, so that is a Code Enhancement Opportunity
> for the Guile-PG reflection module alluded to by the "Some day" comment.
> 
> Although i think SQL is ugly (and thus concur in jest, i believe,
> with Andy Wingo's admonition :-), Guile-PG makes it livable.  E.g.:
> http://www.gnuvola.org/software/guile-pg/qcons-notes.txt
> 
> So, to answer your question: yes, sexps work fine as a Data Dictionary.






Re: Data Dictionary and Configuration Files with Guile Scheme

2010-08-20 Thread Thien-Thi Nguyen
() Romel Sandoval 
() Fri, 20 Aug 2010 09:10:14 -0500

   Thanks Thien-Thi that's exactly what I was trying to achieve.

Cool, we can "relate". :-D



Re: thread safe functions

2010-08-20 Thread rixed
> The same goes for Scheme code. If you have found something in `format'
> that is not thread-safe, do let us know.

Well, apparently for format this was already known, see the last sentence of 
this old msg from Marius Vollmer :

http://www.mail-archive.com/bug-gu...@gnu.org/msg01949.html

But if you want an entry in the bug tracker I can add one :-)


Re: Latest guile 1.9 segfault in GC

2010-08-20 Thread rixed
> Guile 1.9's interpreter is slower than 1.8's interpreter, but 1.9 has a
> compiler, and compiled Scheme runs much faster than 1.8.

"much faster" is very nice to hear !

> You're probably not hitting the compiler for some reason. (...)
> To work around it for now, call `load' from scheme. I know it's ugly but
> at least you get the speed that way. Use scm_primitive_eval (scm_list_2
> (scm_from_locale_string ("load"), path)).

Thank you I will give it a try, but I remember having seen messages on stdout 
dfrom guile pretending that it was compiling my code, and having seen some 
bytecode in the cache. But maybe everything was not compiled. I will try and 
report next monday.

Again, thank you all for your good work and support !