* 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-21 15:48 sph.io libraries tantalum
@ 2014-07-21 16:15 ` Max
2014-07-21 19:03 ` tantalum
0 siblings, 1 reply; 11+ messages in thread
From: Max @ 2014-07-21 16:15 UTC (permalink / raw)
To: tantalum; +Cc: guile-user
Wow, that sounds like a lot of maintenance burden - have you considered using open
source hosting which specialize on fixing those?
Something like https://gitorious.org/ or http://hub.darcs.net/ depending on your vcs
preference. On a related note - using something like jekyll or hakyll to generate
plain-text website content could solve db issue once and for all while improving
security at the same time.
Getting back to the question which got me interested in your libraries in a first
place - do you have some working examples?
I'm especially curious in 'process' and 'record': I'd like to spawn plenty of
long-running processes while setting env. variable to process-specific value and
saving process pid into some data structure for further interacting with it.
For example, I'd like to spawn proc1 with DISP=X1, proc2 with DISP=X2 etc and I'd
like to save that into record with (proc1, X1, pid1), (proc2, X2, pid2)
How do I implement it using 'process' and 'record' from sph.io? How do I later access
pid2 for example? How do I iterate over all the records?
The existing docs are nice but they are too brief for newbies :(
21.07.2014 17:48, tantalum пишет:
> 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-21 16:15 ` Max
@ 2014-07-21 19:03 ` tantalum
2014-07-21 21:59 ` Max
0 siblings, 1 reply; 11+ messages in thread
From: tantalum @ 2014-07-21 19:03 UTC (permalink / raw)
To: Max, guile-user
> How do I implement it using 'process' and 'record' from sph.io? How do
I later access
> pid2 for example? How do I iterate over all the records?
a few examples are included in the other message i sent. maybe it
already clears things up a bit. (reference
http://lists.gnu.org/archive/html/guile-user/2014-07/msg00023.html)
the records are just elements in memory like for example a hashtable or
a vector.
to iterate over multiple records you could store them in a list and then
iterate over the list.
(for-each
(lambda (element) (display element))
list-of-records)
to store them on disc you would need to use files or a database and find
a way to get vectors in and out of there.
if there are not thousands of records it could be as simple as
(call-with-output-file "filepath" (lambda (file) (write list-of-records
file)))
(call-with-input-file "filepath" (lambda (file) (read file)))
> have you considered using open source hosting which specialize on fixing those?
yes, but for now decided to host the repositories myself. the
git-repositories otherwise do not require much maintenance effort. but
of course servers can go down or permissions amiss. i may re-evaluate
the hosting decision in the future.
nice, i did not know jekyll. seems useful.
i currently use the database for its specific features that may be
useful for new functions on the site and experimentation. so for now i
stick with it, but thanks for the tip.
> The existing docs are nice but they are too brief for newbies :(
i hope to improve that in the future. the site is in a relatively early
stage. i know that most documentation pages do not have any real intro
that explains the library, for example.
On 2014-07-21 18:15, Max wrote:
> Wow, that sounds like a lot of maintenance burden - have you considered using open
> source hosting which specialize on fixing those?
> Something like https://gitorious.org/ or http://hub.darcs.net/ depending on your vcs
> preference. On a related note - using something like jekyll or hakyll to generate
> plain-text website content could solve db issue once and for all while improving
> security at the same time.
>
> Getting back to the question which got me interested in your libraries in a first
> place - do you have some working examples?
> I'm especially curious in 'process' and 'record': I'd like to spawn plenty of
> long-running processes while setting env. variable to process-specific value and
> saving process pid into some data structure for further interacting with it.
>
> For example, I'd like to spawn proc1 with DISP=X1, proc2 with DISP=X2 etc and I'd
> like to save that into record with (proc1, X1, pid1), (proc2, X2, pid2)
>
> How do I implement it using 'process' and 'record' from sph.io? How do I later access
> pid2 for example? How do I iterate over all the records?
>
> The existing docs are nice but they are too brief for newbies :(
>
> 21.07.2014 17:48, tantalum пишет:
>> 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-21 19:03 ` tantalum
@ 2014-07-21 21:59 ` Max
0 siblings, 0 replies; 11+ messages in thread
From: Max @ 2014-07-21 21:59 UTC (permalink / raw)
To: tantalum, guile-user
21.07.2014 21:03, tantalum пишет:
>
> a few examples are included in the other message i sent. maybe it
> already clears things up a bit. (reference
> http://lists.gnu.org/archive/html/guile-user/2014-07/msg00023.html)
That's excellent, thanks!
>
> yes, but for now decided to host the repositories myself. the
> git-repositories otherwise do not require much maintenance effort. but
> of course servers can go down or permissions amiss. i may re-evaluate
> the hosting decision in the future.
Having some personal website offline due to experiments is not a big deal. But
personally I'd love to see your libraries to be packaged and readily available in my
distro repositories - and they tend to be picky about upstream availability. Btw,
jenkins works fairly well for many projects as a continuous integration system. I was
surprised but your 'process' lib is the only interface to execve for guile I've been
able to find - I kinda expected that to be part of standard library. That's why I'm
so kin on the source availability - your project looks like the missing piece I've
always needed from guile :)
cheers,
Max.
^ 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
* 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
* Re: sph.io libraries
2014-07-08 13:52 Max
@ 2014-07-08 14:50 ` Taylan Ulrich Bayirli/Kammer
2014-07-08 14:53 ` Thompson, David
2014-07-10 11:09 ` Max
0 siblings, 2 replies; 11+ messages in thread
From: Taylan Ulrich Bayirli/Kammer @ 2014-07-08 14:50 UTC (permalink / raw)
To: Max; +Cc: guile-user
Max <maxim.suraev@campus.tu-berlin.de> writes:
> Have anyone worked with libraries from http://sph.io/
I remember trying to visit that page a while ago and finding it to be
down, currently I still can't open it, at the moment it returns the
plain text "offline" for a GET on /. Does it work for others?
Taylan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sph.io libraries
2014-07-08 14:50 ` Taylan Ulrich Bayirli/Kammer
@ 2014-07-08 14:53 ` Thompson, David
2014-07-10 11:09 ` Max
1 sibling, 0 replies; 11+ messages in thread
From: Thompson, David @ 2014-07-08 14:53 UTC (permalink / raw)
To: Taylan Ulrich Bayirli/Kammer; +Cc: Guile User
On Tue, Jul 8, 2014 at 10:50 AM, Taylan Ulrich Bayirli/Kammer
<taylanbayirli@gmail.com> wrote:
> Max <maxim.suraev@campus.tu-berlin.de> writes:
>
>> Have anyone worked with libraries from http://sph.io/
>
> I remember trying to visit that page a while ago and finding it to be
> down, currently I still can't open it, at the moment it returns the
> plain text "offline" for a GET on /. Does it work for others?
Offline for me, too.
- Dave
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: sph.io libraries
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
1 sibling, 1 reply; 11+ messages in thread
From: Max @ 2014-07-10 11:09 UTC (permalink / raw)
To: guile-user
Works for me now.
Here is direct link just in case: http://sph.io/content/187
cheers,
Max.
^ 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-21 15:48 sph.io libraries tantalum
2014-07-21 16:15 ` Max
2014-07-21 19:03 ` tantalum
2014-07-21 21:59 ` Max
-- strict thread matches above, loose matches on Subject: below --
2014-07-22 11:12 tantalum
2014-07-08 13:52 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
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).