Hi everyone,

I would like to announce the initial release of event-lang, an
experimental Racket library that simplifies the creation of complex
synchronizable events.

https://pkgd.racket-lang.org/pkgn/package/event-lang

Event-lang provides a primitive expression lifting form,

  > (pure 123)
  #<evt>

some event combinators,

  > (sync (fmap + (pure 1) (pure 2)))
  3
  > (sync (app (pure +) (pure 1) (pure 2)))
  3
  > (sync (bind (pure 1) (pure 2) (λ xs (pure (apply + xs)))))
  3

and a collection of event-friendly alternatives to base Racket forms
and functions.

  > (sync
     (event-let
      ([x (pure 1)]
       [y (pure 2)])
      (pure (list x y))))
  '(1 2)

Composite events make progress by synchronizing constituent events,
either concurrently or in a predictable sequence. Synchronization
results can be ordered as specified,

  > (let ([t0 (current-inexact-milliseconds)])
      (define (now) (- (current-inexact-milliseconds) t0))
      (sync
       (async-args
        (pure (cons 1 (now)))
        (pure (cons 2 (now)))
        (pure (cons 3 (now))))))
  '(1 . 0.200927734375)
  '(2 . 0.14990234375)
  '(3 . 0.178955078125)

or as completed.

  > (let ([t0 (current-inexact-milliseconds)])
      (define (now) (- (current-inexact-milliseconds) t0))
      (sync
       (async-set
        (pure (cons 1 (now)))
        (pure (cons 2 (now)))
        (pure (cons 3 (now))))))
  '(2 . 0.0771484375)
  '(3 . 0.093017578125)
  '(1 . 0.123046875)

The project has three outstanding objectives:

1. Provide a sophisticated lifting form

  to simplify usage of the provided constructs. The event/event module
  contains a first approximation. Its construction was tedious and
  error prone, so I commented out the docs.

2. Provide a full-blown #lang event/racket/base

  for producing whole modules of events and event constructors from
  ordinary Racket code in a principled manner.

3. Provide support for static analysis of synchronization behaviors.

  Event programming in Racket is a curious form of meta-programming,
  and a few simple compile-time checks could reduce cognitive
  overhead.

This pre-release is a request for feedback in anticipation of a
production-ready version 1.0. I would like to round out the base
collection and devise a comprehensive testing plan, with a stretch
goal of re-introducing the sophisticated lifting form. At the moment,
I'm using event-lang daily and adding base constructs as needed. Feel
free to do the same or request your favorites.

Please take a look and let me know what you think.

Eric

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to