unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* sph.io libraries
@ 2014-07-08 13:52 Max
  2014-07-08 14:50 ` Taylan Ulrich Bayirli/Kammer
  0 siblings, 1 reply; 11+ messages in thread
From: Max @ 2014-07-08 13:52 UTC (permalink / raw)
  To: guile-user

Hi.

Have anyone worked with libraries from http://sph.io/
I found some basic documentation on dev website but can't find any code examples :(

I'm particularly interested in process and record modules.

cheers,
Max.




^ permalink raw reply	[flat|nested] 11+ messages in thread
* sph.io libraries
@ 2014-07-21 15:48 tantalum
  2014-07-21 16:15 ` Max
  0 siblings, 1 reply; 11+ messages in thread
From: tantalum @ 2014-07-21 15:48 UTC (permalink / raw)
  To: maxim.suraev; +Cc: guile-user

i am sorry, i am late... i was not subscribed to the list. i maintain
the site

yes, the site is unstable. despite that, it should always restart
automatically, please try again, and when you see a 403 that probably
means it is just starting, 502 that it just crashed ...

at first i had to rewrite the server. that lead to downtimes as i found
difficulties with sockets and signals, but that should be good now.
i had a segfault in guile-reader and i just removed the dependency for
now and try to write at least a bug report for that.
now, if it crashes again i think it could only be one thing - the
database, let's see.

until recently there was also a permission problem with the git
repositories: do you know about the setgid bit? i did not, and any time
i pushed new changes, the new files got the group of my user and not of
the git user which made the repository inaccessible to others. now i
have a test script and will look for continuous integration solutions.

those are things that are hopefully fixed, but what is not yet fixed is
that i have to take the site down after i added or deleted content (not
when editing) to import database changes. this is another reason for
downtimes that i hope to remove some day.

because, as always, there are so many things that can go wrong, if you
encounter a problem you can mail me at sph@posteo.eu and i will try to
fix it asap

thanks for you interest



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: sph.io libraries
@ 2014-07-22 11:12 tantalum
  0 siblings, 0 replies; 11+ messages in thread
From: tantalum @ 2014-07-22 11:12 UTC (permalink / raw)
  To: guile-user

> Neat. Just to double-check - the environment variables of my current 
> process are
> preserved or /tmp/mybin would run with environment consisting only of 
> variables which
> I've explicitly put into execute-with-environment?
the new process receives only the specified environment variables. but 
it should be no problem to pass it a
modified environment from the current process using guiles "environ" 
procedure
   (cons "XX2=LOL" (environ))
working example:
   guile -c '(import (sph process)) (execute-with-environment (cons 
"XX2=LOL" (environ)) "env")'

> the only interface to execve for guile
actually in guile the direct interface to execve is called execle 
(https://www.gnu.org/software/guile/manual/html_node/Processes.html#index-execle).
the "process" version does two more things:
- it adds the program name as the first argument, the usual calling 
convention. would have to be taken care of manually otherwise
- it may search $PATH
- it moves the "env" argument to the front to preserve the order of 
filename and rest-arguments

> Could you illustrate that with some code too? I do not plan to have 
> that many records
> so I'm not concerned with the speed that much :)

the getter/setter definitions where included in the last example. 
setting fields by symbolic name would look like this:
   (define triad (make-record-layout (quote (pid env num))))
   (define t (record triad pid "LOL" 5))
   (record-set! t triad (quote pid) 5011)

the getter/setter definitions could be shortened with a new single 
"define-" form which generates the bindings. i might add that and the 
current library makes this quite easy.
for reference, other record implementations already do this, but these 
implementations regard records as something more complicated.
https://www.gnu.org/software/guile/manual/html_node/rnrs-records-syntactic.html#rnrs-records-syntactic
https://www.gnu.org/software/guile/manual/html_node/SRFI_002d9-Records.html#SRFI_002d9-Records

if you do not want to deal with record-layouts, getters and setters,
you could use vectors which are like arrays in other languages (which 
could be records at the same time)
   (define a (vector 3 4 5))
   (vector-ref a 0)

or hashtables, which are like associative arrays or objects in other 
languages
   (import (sph hashtable))
   (define a (hashtable "a" 1 "b" 2))
   (hashtable-ref a "a")

or association lists, alists, which are lists and similar to 
two-dimensional arrays
   (import (sph alist))
   (define a (alist "a" 1 "b" 2))
   (alist-ref a "a")

(https://www.gnu.org/software/guile/manual/html_node/Association-Lists.html#Association-Lists
  
https://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Association-Lists.html#SRFI_002d1-Association-Lists)

> I can also have arbitrary number of fields in the record?
yes

> your libraries to be packaged and readily available in my distro 
> repositories
what is your distro?
there is a package for arch linux at least 
(https://aur.archlinux.org/packages/sph-lib-git)
and there is "guix", which seems to become the package manager for the 
gnu system, and might be interesting cross-distro. though as of yet i 
have not figured out how to make a package for it.




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-07-22 11:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 13:52 sph.io libraries Max
2014-07-08 14:50 ` Taylan Ulrich Bayirli/Kammer
2014-07-08 14:53   ` Thompson, David
2014-07-10 11:09   ` Max
2014-07-10 18:56     ` Taylan Ulrich Bayirli/Kammer
2014-07-10 18:59       ` Max
  -- strict thread matches above, loose matches on Subject: below --
2014-07-21 15:48 tantalum
2014-07-21 16:15 ` Max
2014-07-21 19:03   ` tantalum
2014-07-21 21:59     ` Max
2014-07-22 11:12 tantalum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).