Re: [Chicken-users] go routines for chicken

2013-11-28 Thread Moritz Heidkamp
John Cowan co...@mercury.ccil.org writes:

 There is also a Ruby Flavored Erlang called Elixir which has become
 quite popular:  see http://elixir-lang.org.  They are all compatible
 at the Erlang VM level.

And don't forget The Concurrent Schemer:
http://the-concurrent-schemer.github.io/scm-doc/

Moritz

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-28 Thread Moritz Heidkamp
John Cowan co...@mercury.ccil.org writes:

 Quite right, though I don't consider either point essential.  Limited
 mailboxes are useful to prevent livelock (though at the risk of deadlock),
 and perhaps they should be retrofitted into the egg.

Indeed, having thought about it some more it is probably possible to
implement both things on top of the mailbox primitive. Not very
convenient, but possible :-)

Moritz

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-28 Thread Daniel Leslie
That lays the type safety burden upon the developer at run time and not the
compiler.
On 28 Nov 2013 10:18, Moritz Heidkamp mor...@twoticketsplease.de wrote:

 Daniel Leslie d...@ironoxide.ca writes:

  Go also enjoys a rather robust Channels system, which is sort of like
  Scheme's ports, only it's type-safe by design.

 How are Scheme ports not type-safe? The main difference is that Scheme
 ports are limited to just a single type (i.e. characters) but that
 doesn't make them type-unsafe, no? :-)

 Moritz

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-28 Thread Peter Bex
On Thu, Nov 28, 2013 at 07:17:58PM +0100, Moritz Heidkamp wrote:
 Daniel Leslie d...@ironoxide.ca writes:
 
  Go also enjoys a rather robust Channels system, which is sort of like
  Scheme's ports, only it's type-safe by design.
 
 How are Scheme ports not type-safe? The main difference is that Scheme
 ports are limited to just a single type (i.e. characters) but that
 doesn't make them type-unsafe, no? :-)

Actually, it's two types: Characters and the eof-object's type.  And in
Gambit, there are other ports as well, from which you can only read
objects (like their directory-ports).

Cheers,
Peter the smartass
-- 
http://www.more-magic.net

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread Moritz Heidkamp
Hi Piotr,

m...@freeshell.de writes:
 Is there anything comparable in Chicken Scheme? If not, how
 complicated would be to make such an implementation?

I am trying to port Clojure's core.async module in my very limited spare
hacking time to CHICKEN right now. This should be what you are looking
for. I will announce it here once something usable comes from that.


 I understand that Chicken only offers very limited threading
 capability.

Well, it's only limited in the amount of cores you can utilize (1) and
what kinds of functions you can run in parallel (e.g. FFI calls usually
block all threads). This is orthogonal to Go-style channels, though.

Moritz

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread Moritz Heidkamp
John Cowan co...@mercury.ccil.org writes:
 The mailbox egg provides the equivalent of Go channels.

That's not quite right, is it? E.g. it is not possible to multiplex
across mailboxes (as with Go's select statement) or limit their size (at
least not out of the box). Those are quite essential provisions for
programming in a CSP style, at least to my (so far fairly incomplete)
understanding.

Moritz

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread mfv

Hi, 

 I am trying to port Clojure's core.async module in my very limited spare
 hacking time to CHICKEN right now. This should be what you are looking
 for. I will announce it here once something usable comes from that.

That is great news. I will watch out for that egg, even if it might take
some time hatch it.
 
  I understand that Chicken only offers very limited threading
  capability.
 
 Well, it's only limited in the amount of cores you can utilize (1) and
 what kinds of functions you can run in parallel (e.g. FFI calls usually
 block all threads). This is orthogonal to Go-style channels, though.

I see. I am not knowledgable in the area compilers/threads/OS processes, let
alone in the magic that makes fairly efficiant C code come out of chicken.
However, I imagine the the limitation when it comes to core usage is linked
to the transcription technique of scheme to C. 

Otherwise one could peek in the C source of the go routines and translate
them to chicken, no?

Cheers!

  Piotr


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread mfv
On a sidenote:

It seems that there is an analgon to go routines on Erlang, which can be
accessed the LFE (Lisp Flavoured Erlang). However, that would require to
learn the entire Erlang VM ecosystem.


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread Hugo Arregui
On 27/11/13, m...@freeshell.de wrote:
 On a sidenote:
 
 It seems that there is an analgon to go routines on Erlang, which can be
 accessed the LFE (Lisp Flavoured Erlang). However, that would require to
 learn the entire Erlang VM ecosystem.

A Lisp Flavoured Erlang, what nice!. 


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread Jörg F. Wittenberger

Am 27.11.2013 20:32, schrieb Hugo Arregui:

On 27/11/13, m...@freeshell.de wrote:

On a sidenote:

It seems that there is an analgon to go routines on Erlang, which can be
accessed the LFE (Lisp Flavoured Erlang). However, that would require to
learn the entire Erlang VM ecosystem.

A Lisp Flavoured Erlang, what nice!.



Having implemented a language inspired by Erlang in LISP (Scheme that 
is) and in a byzantine fault tolerant way atop; I feel from skimming 
over the discussion that I more or less have seen those related problems 
in practice.  However the code I wrote to cope with them is for sure not 
conforming to any pre-defined API.


Without making any promises (((and having already droped the page titled 
walkthough from this go chan's docs, thus given that go is about as 
great a search term as scheme makes pretty sure that I will not really 
be able to find it back again))): could I you please send me pointers to 
what is considered the canonical documentation of features and 
requirements a go-channel has to solve?  ((I have only so much 
screen-reading time left per day because of my health. I'd rather just 
use it to code ahead instead of digging through stuff from the net.))  
However for the same health issues I have a little too much spare time  
:-/  And as indicated: chances are that all I have to do is adapt some 
already tested code to fit the API as per spec.


let's try

/Jörg




___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread Daniel Leslie
Go Routines are much like Chicken's SRFI-18 threads, except that they can
multiplex over multiple *real* threads if one should block.

Go also enjoys a rather robust Channels system, which is sort of like
Scheme's ports, only it's type-safe by design.

Wiki actually has a nice and short break-down on this:
https://en.wikipedia.org/wiki/Goroutine#Concurrency

-Dan


On Wed, Nov 27, 2013 at 1:22 PM, Jörg F. Wittenberger 
joerg.wittenber...@softeyes.net wrote:

 Am 27.11.2013 20:32, schrieb Hugo Arregui:

 On 27/11/13, m...@freeshell.de wrote:

 On a sidenote:

 It seems that there is an analgon to go routines on Erlang, which can be
 accessed the LFE (Lisp Flavoured Erlang). However, that would require to
 learn the entire Erlang VM ecosystem.

 A Lisp Flavoured Erlang, what nice!.


 Having implemented a language inspired by Erlang in LISP (Scheme that is)
 and in a byzantine fault tolerant way atop; I feel from skimming over the
 discussion that I more or less have seen those related problems in
 practice.  However the code I wrote to cope with them is for sure not
 conforming to any pre-defined API.

 Without making any promises (((and having already droped the page titled
 walkthough from this go chan's docs, thus given that go is about as
 great a search term as scheme makes pretty sure that I will not really be
 able to find it back again))): could I you please send me pointers to what
 is considered the canonical documentation of features and requirements a
 go-channel has to solve?  ((I have only so much screen-reading time left
 per day because of my health. I'd rather just use it to code ahead
 instead of digging through stuff from the net.))  However for the same
 health issues I have a little too much spare time  :-/  And as indicated:
 chances are that all I have to do is adapt some already tested code to fit
 the API as per spec.

 let's try

 /Jörg




 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-27 Thread John Cowan
Hugo Arregui scripsit:

 A Lisp Flavoured Erlang, what nice!. 

http://lfe.github.io/

There is also a Ruby Flavored Erlang called Elixir which has become
quite popular:  see http://elixir-lang.org.  They are all compatible
at the Erlang VM level.

-- 
One Word to write them all, John Cowan co...@ccil.org
  One Access to find them,  http://www.ccil.org/~cowan
One Excel to count them all,
  And thus to Windows bind them.--Mike Champion

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-23 Thread Andy Bennett
Hi,

 However, the Go runtime will exploit OS-level threads under the hood if a
 goroutine blocks, and Chicken will not.

If you're not using the FFI and the Chicken runtime blocks due to a
SRFI-18 thread blocking then, AIUI, there is a bug in Chicken.




Regards,
@ndy

-- 
andy...@ashurst.eu.org
http://www.ashurst.eu.org/
0x7EBA75FF


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] go routines for chicken

2013-11-22 Thread mfv
Hi, 

I recently stumbled over a package for Python that allows to use the
golang go routines concurrency model (https://github.com/stuglaser/pychan). 

Is there anything comparable in Chicken Scheme? If not, how complicated
would be to make such an implementation? I understand that Chicken only
offers very limited threading capability. 

Regards, 

  piotr

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] go routines for chicken

2013-11-22 Thread Daniel Leslie
At present, and to the best of my knowledge, there exists no similar
capacity in Chicken which uses *real* operating system-level
*thread*concurrency.

However, there are numerous eggs that will help with *process*-level
concurrency:

http://wiki.call-cc.org/man/4/Unit%20posix
http://wiki.call-cc.org/eggref/4/scsh-process
http://wiki.call-cc.org/eggref/4/posix-shm
http://wiki.call-cc.org/eggref/4/termite

There's a few more, but their names elude me at the moment. Try asking on
#chicken on irc.freenode.net

-Dan


On Fri, Nov 22, 2013 at 7:22 PM, m...@freeshell.de wrote:

 Hi,

 I recently stumbled over a package for Python that allows to use the
 golang go routines concurrency model (https://github.com/stuglaser/pychan
 ).

 Is there anything comparable in Chicken Scheme? If not, how complicated
 would be to make such an implementation? I understand that Chicken only
 offers very limited threading capability.

 Regards,

   piotr

 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users