unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* 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
* [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

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-07-21 17:14 [ANN] a lot tantalum
2014-07-21 22:15 ` Max
  -- strict thread matches above, loose matches on Subject: below --
2014-06-23 19:32 tantalum
2014-06-24  0:38 ` David Thompson
2014-06-24  8:50 ` 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).