* [ANN] a lot
@ 2014-06-23 19:32 tantalum
2014-06-24 0:38 ` David Thompson
2014-06-24 8:50 ` Max
0 siblings, 2 replies; 5+ messages in thread
From: tantalum @ 2014-06-23 19:32 UTC (permalink / raw)
To: guile-user
several gpl3 licensed guile modules:
sph-lib - a collection of libraries and example implementations
cli: quickly create a command-line interface
test: write and execute code tests
test-performance: compare performance between arbitrary procedures
lang-plcss: language for creating cascading stylesheets
lang-scm-format: scheme code formatter
scgi: interface for the creation of long-running web applications
web-html: includes a multipart-form-data parser that can do stream
parsing and supports unlimited part-nesting
tree: processing tree-like lists
string: includes string-replace-string, a fast replacer procedure
type-signature: reader/writer for a type-signature syntax
process: includes procedures for process chaining like with bash and pipes
... and more, about 77 altogether
http://sph.io/content/187
sescript
scheme datum to ecmascript transcompiler
so you can write javascript using scheme syntax. supports all
ecmascript and the r6rs library-form
http://sph.io/content/413
sc
a scheme datum to c transcompiler
like sescript, but for c. supports all c.
this thing works, already wrote programs with it
http://sph.io/content/3d3
guile-fuse
bindings to FUSE - filesystems in userspace
probably linux specific because i do not know how to set up autotools
(and how i could do this without cluttering the project directory)
http://sph.io/content/467
web-app
a framework for web applications - scgi support, a design based on
fundamental scheme data types and short response times (2ms for plain
text responses on my computer)
http://sph.io/content/66b
because this all is new, there are likely many things that need fix and
improvement. i am happy to make things work.
the website employs most of the aforementioned
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANN] a lot
2014-06-23 19:32 [ANN] a lot tantalum
@ 2014-06-24 0:38 ` David Thompson
2014-06-24 8:50 ` Max
1 sibling, 0 replies; 5+ messages in thread
From: David Thompson @ 2014-06-24 0:38 UTC (permalink / raw)
To: tantalum, guile-user
tantalum <sph@posteo.eu> writes:
> several gpl3 licensed guile modules:
>
> sph-lib - a collection of libraries and example implementations
> cli: quickly create a command-line interface
> test: write and execute code tests
> test-performance: compare performance between arbitrary procedures
> lang-plcss: language for creating cascading stylesheets
> lang-scm-format: scheme code formatter
> scgi: interface for the creation of long-running web applications
> web-html: includes a multipart-form-data parser that can do stream
> parsing and supports unlimited part-nesting
> tree: processing tree-like lists
> string: includes string-replace-string, a fast replacer procedure
> type-signature: reader/writer for a type-signature syntax
> process: includes procedures for process chaining like with bash and pipes
> ... and more, about 77 altogether
> http://sph.io/content/187
>
> sescript
> scheme datum to ecmascript transcompiler
> so you can write javascript using scheme syntax. supports all
> ecmascript and the r6rs library-form
> http://sph.io/content/413
>
> sc
> a scheme datum to c transcompiler
> like sescript, but for c. supports all c.
> this thing works, already wrote programs with it
> http://sph.io/content/3d3
>
> guile-fuse
> bindings to FUSE - filesystems in userspace
> probably linux specific because i do not know how to set up autotools
> (and how i could do this without cluttering the project directory)
> http://sph.io/content/467
>
> web-app
> a framework for web applications - scgi support, a design based on
> fundamental scheme data types and short response times (2ms for plain
> text responses on my computer)
> http://sph.io/content/66b
>
> because this all is new, there are likely many things that need fix and
> improvement. i am happy to make things work.
> the website employs most of the aforementioned
>
Wow! Thank you for all of these neat projects! web-app and sescript
are particularly interesting. I haven't had a chance to look at any of
the code yet, but I hope to get the chance sometime soon.
To make building the software easier for myself and others, I recommend
taking the time to learn how to write automake and autoconf files. I
don't know the autotools very well myself, but reading the configure.ac
and Makefile.am files of other Guile projects helped me a lot.
Thanks and happy hacking!
--
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANN] a lot
2014-06-23 19:32 [ANN] a lot tantalum
2014-06-24 0:38 ` David Thompson
@ 2014-06-24 8:50 ` Max
1 sibling, 0 replies; 5+ messages in thread
From: Max @ 2014-06-24 8:50 UTC (permalink / raw)
To: guile-user
Excellent work.
The most interesting for me are process and record. Are there some code examples?
For instance I'd like to execute binary at /tmp/mybin with environment variable
XX2=LOL - do I call it like:
(execute-with-environment 'XX2=LOL' /tmp/mybin)?
That's a long running process so I'd like to be able to send signals to it - will
this function return pid which I can use?
How do I store that into record alongside with LOL (value of variable I've set earlier)?
(make-record myrec)
(record-append pid LOL)
The greatest possible improvement would be if every documentation entry would include
code sample but it's tremendous amount of rather boring work so I would be happy to
see any sort of examples.
thanks,
Max.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANN] a lot
@ 2014-07-21 17:14 tantalum
2014-07-21 22:15 ` Max
0 siblings, 1 reply; 5+ messages in thread
From: tantalum @ 2014-07-21 17:14 UTC (permalink / raw)
To: maxim.suraev, guile-user
> Are there some code examples?
except for process-chain-* probably not, but i put that on my todo list.
something like this should work:
(execute-with-environment "XX2=LOL" "/tmp/mybin")
working example:
guile -c '(import (sph process)) (execute-with-environment (list
"XX2=LOL") "/usr/bin/echo" "test")'
but this is using the system call "execve", which leads to the whole
guile process being replaced by the specified program. (execve syscall
reference: http://man7.org/linux/man-pages/man2/execve.2.html)
"process-create" creates a new parallel process
---
(define pid
(process-create
(lambda ()
;this will be executed in a completely cloned new process in the
background
(execute-with-environment "XX2=LOL" "/tmp/mybin"))))
;now, still in the guile process, send a signal to the new process
(kill pid SIGINT)
---
now what happens is that a new process is created by cloning, and is
then immediately replaced by your program. as far as i know this is the
only way on linux or similar systems to archieve this.
for storing values in a record it would probably be best to use a record
setter procedure. the library supports setting fields by symbolic name,
but that is slower.
in general, as a sidenote, a record like this differs from an
association list for example, in that the keys are not stored inside the
data-structure, but separately: the "layout" stores the field names and
the positions of where the field values are stored in the records.
example:
---
(define myrec (make-record-layout (quote (pid env))))
(define-record-accessors myrec (myrec-pid (quote pid)) (myrec-env (quote
env)))
(define-record-setters myrec (myrec-pid-set! (quote pid))
(myrec-env-set! (quote env)))
;two different ways to create a record
(define a (record myrec pid "LOL"))
(define b (make-record myrec))
(myrec-pid a)
(myrec-pid-set! a 3)
(myrec-env-set! b 2)
---
EOM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANN] a lot
2014-07-21 17:14 tantalum
@ 2014-07-21 22:15 ` Max
0 siblings, 0 replies; 5+ messages in thread
From: Max @ 2014-07-21 22:15 UTC (permalink / raw)
To: tantalum, guile-user
21.07.2014 19:14, tantalum пишет:
>> Are there some code examples?
> except for process-chain-* probably not, but i put that on my todo list.
>
> something like this should work:
> (execute-with-environment "XX2=LOL" "/tmp/mybin")
>
> working example:
> guile -c '(import (sph process)) (execute-with-environment (list
> "XX2=LOL") "/usr/bin/echo" "test")'
>
> but this is using the system call "execve", which leads to the whole
> guile process being replaced by the specified program. (execve syscall
> reference: http://man7.org/linux/man-pages/man2/execve.2.html)
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?
>
> "process-create" creates a new parallel process
> ---
> (define pid
> (process-create
> (lambda ()
> ;this will be executed in a completely cloned new process in the
> background
> (execute-with-environment "XX2=LOL" "/tmp/mybin"))))
>
> ;now, still in the guile process, send a signal to the new process
> (kill pid SIGINT)
> ---
> now what happens is that a new process is created by cloning, and is
> then immediately replaced by your program. as far as i know this is the
> only way on linux or similar systems to archieve this.
Yes, that's totally fine.
>
> for storing values in a record it would probably be best to use a record
> setter procedure. the library supports setting fields by symbolic name,
> but that is slower.
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 :)
> in general, as a sidenote, a record like this differs from an
> association list for example, in that the keys are not stored inside the
> data-structure, but separately: the "layout" stores the field names and
> the positions of where the field values are stored in the records.
> example:
> ---
> (define myrec (make-record-layout (quote (pid env))))
> (define-record-accessors myrec (myrec-pid (quote pid)) (myrec-env (quote
> env)))
> (define-record-setters myrec (myrec-pid-set! (quote pid))
> (myrec-env-set! (quote env)))
Hmm... looks like a boilerplate - I thought those are generated automatically.
> ;two different ways to create a record
> (define a (record myrec pid "LOL"))
> (define b (make-record myrec))
>
> (myrec-pid a)
> (myrec-pid-set! a 3)
> (myrec-env-set! b 2)
> ---
I can also have arbitrary number of fields in the record?
(define triad (make-record-layout (quote (pid env num))))
(define t (record triad pid "LOL" 5))
thanks,
Max.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-21 22:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-23 19:32 [ANN] a lot tantalum
2014-06-24 0:38 ` David Thompson
2014-06-24 8:50 ` Max
-- strict thread matches above, loose matches on Subject: below --
2014-07-21 17:14 tantalum
2014-07-21 22:15 ` 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).