- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Scala Automatic Resource Management Incubator Project
Sun, 2009-10-04, 02:31
All,
I believe that before (or while) introducing a good I/O library, Scala should include a way to perform automated resource management (open/closing a file before reading lines, etc.).
To that effect, I've pulled ideas/reworked scalax + some applications of it we used at my work place along with integrated to Paul Phillips's Exception DSL to create the following ARM library: http://github.com/jsuereth/scala-arm
The goal if this library is as follows
I'd like to start work on a SID, possibly by using a github WIKI page to kick it off. That way contributors can keep track of revisions and work concurrently. I'm only going to open up the project to users who have filled out/submitted the Scala Contributor Agreement and are willing to release their works under the Scala license.
The library requires SBT 5.5 to run (along with a custom built version against a latest scala nightly). If you're interesting in joining/contributing to this project, please let me know!
- Josh Suereth
I believe that before (or while) introducing a good I/O library, Scala should include a way to perform automated resource management (open/closing a file before reading lines, etc.).
To that effect, I've pulled ideas/reworked scalax + some applications of it we used at my work place along with integrated to Paul Phillips's Exception DSL to create the following ARM library: http://github.com/jsuereth/scala-arm
The goal if this library is as follows
- Easy to use
- Extendability to various concepts (Transactions and Sockets/Streams for now)
- Functional
- Works well in for expressions
I'd like to start work on a SID, possibly by using a github WIKI page to kick it off. That way contributors can keep track of revisions and work concurrently. I'm only going to open up the project to users who have filled out/submitted the Scala Contributor Agreement and are willing to release their works under the Scala license.
The library requires SBT 5.5 to run (along with a custom built version against a latest scala nightly). If you're interesting in joining/contributing to this project, please let me know!
- Josh Suereth
Sun, 2009-10-04, 03:27
#2
Re: Scala Automatic Resource Management Incubator Project
Good question. My idea basically revolves around the notion of building up a list of things to perform inside an ARM block and then pulling out the reuslts. So anything that *doesn't* return "Managed*" is something that will open/close the sequence.
I'll see if I can upgrade the doucmentation. I'm also going to see if I can get SBT to build a scaladoc site and push it to a github pages branch so you can go to http://jsuereth.github.com/scala-arm and see the appropriate scala-doc APIs.
- Josh
On Sat, Oct 3, 2009 at 10:12 PM, Daniel Sobral <dcsobral@gmail.com> wrote:
I'll see if I can upgrade the doucmentation. I'm also going to see if I can get SBT to build a scaladoc site and push it to a github pages branch so you can go to http://jsuereth.github.com/scala-arm and see the appropriate scala-doc APIs.
- Josh
On Sat, Oct 3, 2009 at 10:12 PM, Daniel Sobral <dcsobral@gmail.com> wrote:
I briefly looked at the wiki, and it isn't clear when opening/closing happens. Could you make it more clear?
I like the opt/either thing, but I'd prefer toOption, toEither. Then again, I was on the losing side of Seq/Sequence. :-)
On Sat, Oct 3, 2009 at 10:31 PM, Josh Suereth <joshua.suereth@gmail.com> wrote:All,
I believe that before (or while) introducing a good I/O library, Scala should include a way to perform automated resource management (open/closing a file before reading lines, etc.).
To that effect, I've pulled ideas/reworked scalax + some applications of it we used at my work place along with integrated to Paul Phillips's Exception DSL to create the following ARM library: http://github.com/jsuereth/scala-arm
The goal if this library is as follows
- Easy to use
- Extendability to various concepts (Transactions and Sockets/Streams for now)
- Functional
- Works well in for expressions
I'd like to start work on a SID, possibly by using a github WIKI page to kick it off. That way contributors can keep track of revisions and work concurrently. I'm only going to open up the project to users who have filled out/submitted the Scala Contributor Agreement and are willing to release their works under the Scala license.
The library requires SBT 5.5 to run (along with a custom built version against a latest scala nightly). If you're interesting in joining/contributing to this project, please let me know!
- Josh Suereth
--
Daniel C. Sobral
Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.
Sun, 2009-10-04, 12:17
#3
Re: Scala Automatic Resource Management Incubator Project
On Sun, Oct 4, 2009 at 3:17 AM, Josh Suereth wrote:
> I'll see if I can upgrade the doucmentation. I'm also going to see if I can
> get SBT to build a scaladoc site and push it to a github pages branch so you
> can go to http://jsuereth.github.com/scala-arm and see the appropriate
> scala-doc APIs.
I could do with seeing a few not-quite-so-toy examples. How about a
simple socket based server where the resources being managed are the
listening socket and the accepted socket.
Cheers,
Miles
Sun, 2009-10-04, 14:17
#4
Re: Scala Automatic Resource Management Incubator Project
No problem.
I have a (similar) library being used to manage J2EE UserTransacrion's
at work. I can port that over quickly, along with file parsing code.
I'll post an example echo server with sockets. Perhaps someone can
upgrade this to http at some point?
Also, the biggest issue with ARM in scala that I've experienced is
that if you do not have an explicit "actually execute this block in an
arm" functions, then things can get confusing with returns.
Right now you can try to "acquire and get" an iterator that works on
an open resource. This is why I added the ManagedTraversable (which
ensures the resource is open while traversing). I have explicit "opt"
and "either" methods to pull from a "TranslatedResource", and only
foreach and the "acquireAndGet*" methods will execute blocks on
ManagedResource.
Anyone have any ideas on how to require "safe" return values from arm
blocks?
Currently if I enable flatMap on ManagedResource it is not obvious how
to correctly for-yield results from said resource.
- Josh
Sent from my iPhone
On Oct 4, 2009, at 7:12 AM, Miles Sabin wrote:
>
> On Sun, Oct 4, 2009 at 3:17 AM, Josh Suereth
> wrote:
>> I'll see if I can upgrade the doucmentation. I'm also going to see
>> if I can
>> get SBT to build a scaladoc site and push it to a github pages
>> branch so you
>> can go to http://jsuereth.github.com/scala-arm and see the
>> appropriate
>> scala-doc APIs.
>
> I could do with seeing a few not-quite-so-toy examples. How about a
> simple socket based server where the resources being managed are the
> listening socket and the accepted socket.
>
> Cheers,
>
>
> Miles
>
Sun, 2009-10-04, 15:37
#5
Re: Scala Automatic Resource Management Incubator Project
Hi,
you might want to have a look at the continuation-based socket server
example:
http://lampsvn.epfl.ch/trac/scala/browser/compiler-plugins/continuations...
The basic pattern is as follows:
for (socketChannel <- acceptConnections(80)) {
println("Connect: " + socketChannel)
for (req <- readRequests(socketChannel)) {
...
}
println("Disconnect: " + socketChannel)
}
Despite the seemingly sequential loops, the implementation uses NIO
and task runners underneath and is fully asynchronous. Resource
management is hidden from the user inside the foreach methods, using
continuations to orchestrate the underlying NIO primitives.
- Tiark
On 04.10.2009, at 15:15, Josh Suereth wrote:
> No problem.
>
> I have a (similar) library being used to manage J2EE UserTransacrion's
> at work. I can port that over quickly, along with file parsing code.
>
> I'll post an example echo server with sockets. Perhaps someone can
> upgrade this to http at some point?
>
> Also, the biggest issue with ARM in scala that I've experienced is
> that if you do not have an explicit "actually execute this block in an
> arm" functions, then things can get confusing with returns.
>
> Right now you can try to "acquire and get" an iterator that works on
> an open resource. This is why I added the ManagedTraversable (which
> ensures the resource is open while traversing). I have explicit "opt"
> and "either" methods to pull from a "TranslatedResource", and only
> foreach and the "acquireAndGet*" methods will execute blocks on
> ManagedResource.
>
> Anyone have any ideas on how to require "safe" return values from arm
> blocks?
>
> Currently if I enable flatMap on ManagedResource it is not obvious how
> to correctly for-yield results from said resource.
>
> - Josh
>
> Sent from my iPhone
>
> On Oct 4, 2009, at 7:12 AM, Miles Sabin wrote:
>
>>
>> On Sun, Oct 4, 2009 at 3:17 AM, Josh Suereth
>> wrote:
>>> I'll see if I can upgrade the doucmentation. I'm also going to see
>>> if I can
>>> get SBT to build a scaladoc site and push it to a github pages
>>> branch so you
>>> can go to http://jsuereth.github.com/scala-arm and see the
>>> appropriate
>>> scala-doc APIs.
>>
>> I could do with seeing a few not-quite-so-toy examples. How about a
>> simple socket based server where the resources being managed are the
>> listening socket and the accepted socket.
>>
>> Cheers,
>>
>>
>> Miles
>>
Sun, 2009-10-04, 15:57
#6
Re: Scala Automatic Resource Management Incubator Project
Wow,
This looks really neat, I'm going to dig in. Thanks!
- Josh
On Sun, Oct 4, 2009 at 10:27 AM, Tiark Rompf <tiark.rompf@epfl.ch> wrote:
This looks really neat, I'm going to dig in. Thanks!
- Josh
On Sun, Oct 4, 2009 at 10:27 AM, Tiark Rompf <tiark.rompf@epfl.ch> wrote:
Hi,
you might want to have a look at the continuation-based socket server example:
http://lampsvn.epfl.ch/trac/scala/browser/compiler-plugins/continuations/trunk/doc/examples/continuations/Test17Webserver.scala
The basic pattern is as follows:
for (socketChannel <- acceptConnections(80)) {
println("Connect: " + socketChannel)
for (req <- readRequests(socketChannel)) {
...
}
println("Disconnect: " + socketChannel)
}
Despite the seemingly sequential loops, the implementation uses NIO and task runners underneath and is fully asynchronous. Resource management is hidden from the user inside the foreach methods, using continuations to orchestrate the underlying NIO primitives.
- Tiark
On 04.10.2009, at 15:15, Josh Suereth wrote:
No problem.
I have a (similar) library being used to manage J2EE UserTransacrion's
at work. I can port that over quickly, along with file parsing code.
I'll post an example echo server with sockets. Perhaps someone can
upgrade this to http at some point?
Also, the biggest issue with ARM in scala that I've experienced is
that if you do not have an explicit "actually execute this block in an
arm" functions, then things can get confusing with returns.
Right now you can try to "acquire and get" an iterator that works on
an open resource. This is why I added the ManagedTraversable (which
ensures the resource is open while traversing). I have explicit "opt"
and "either" methods to pull from a "TranslatedResource", and only
foreach and the "acquireAndGet*" methods will execute blocks on
ManagedResource.
Anyone have any ideas on how to require "safe" return values from arm
blocks?
Currently if I enable flatMap on ManagedResource it is not obvious how
to correctly for-yield results from said resource.
- Josh
Sent from my iPhone
On Oct 4, 2009, at 7:12 AM, Miles Sabin <miles@milessabin.com> wrote:
On Sun, Oct 4, 2009 at 3:17 AM, Josh Suereth
<joshua.suereth@gmail.com> wrote:
I'll see if I can upgrade the doucmentation. I'm also going to see
if I can
get SBT to build a scaladoc site and push it to a github pages
branch so you
can go to http://jsuereth.github.com/scala-arm and see the
appropriate
scala-doc APIs.
I could do with seeing a few not-quite-so-toy examples. How about a
simple socket based server where the resources being managed are the
listening socket and the accepted socket.
Cheers,
Miles
Sun, 2009-10-04, 16:17
#7
Re: Scala Automatic Resource Management Incubator Project
Here's a socket example.
More to come. I'm going to dig into this continuation + nio stuff and see what I can glean from that as well.
- Josh
On Sun, Oct 4, 2009 at 7:12 AM, Miles Sabin <miles@milessabin.com> wrote:
More to come. I'm going to dig into this continuation + nio stuff and see what I can glean from that as well.
- Josh
On Sun, Oct 4, 2009 at 7:12 AM, Miles Sabin <miles@milessabin.com> wrote:
On Sun, Oct 4, 2009 at 3:17 AM, Josh Suereth <joshua.suereth@gmail.com> wrote:
> I'll see if I can upgrade the doucmentation. I'm also going to see if I can
> get SBT to build a scaladoc site and push it to a github pages branch so you
> can go to http://jsuereth.github.com/scala-arm and see the appropriate
> scala-doc APIs.
I could do with seeing a few not-quite-so-toy examples. How about a
simple socket based server where the resources being managed are the
listening socket and the accepted socket.
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://www.chuusai.com/
http://twitter.com/milessabin
Sun, 2009-10-04, 16:27
#8
Re: Scala Automatic Resource Management Incubator Project
On Sun, Oct 4, 2009 at 4:16 PM, Josh Suereth wrote:
> Here's a socket example.
To be honest, that looks surprisingly heavyweight and like Daniel it's
also not immediately clear to me where the open/close bracketing
comes. Could you add comments to the code indicating those points?
Cheers,
Miles
Sun, 2009-10-04, 16:37
#9
Re: Scala Automatic Resource Management Incubator Project
Part of this excercise is to make this lighter weight, hence my earler
questions about how to ensure open/close are performed correctly.
I can add comments noting where close happens.
Sent from my iPhone
On Oct 4, 2009, at 11:26 AM, Miles Sabin wrote:
>
> On Sun, Oct 4, 2009 at 4:16 PM, Josh Suereth
> wrote:
>> Here's a socket example.
>
> To be honest, that looks surprisingly heavyweight and like Daniel it's
> also not immediately clear to me where the open/close bracketing
> comes. Could you add comments to the code indicating those points?
>
> Cheers,
>
>
> Miles
>
Sun, 2009-10-04, 16:57
#10
Re: Scala Automatic Resource Management Incubator Project
Updated: http://wiki.github.com/jsuereth/scala-arm/socketexample
Also remember that this library is just a starting point for discussions. I'm hoping to outline the issue areas in an ARM API so we can address them and make a final solution.
So far I think we've identified that demarking the opening/closing of resources is important, as well as finding a way to ensure the user only extracts "non-resource-bound" items from the ARM block.
Anyway, please propose alternate solutions. Would you like access to the wiki?
- Josh
On Sun, Oct 4, 2009 at 11:26 AM, Miles Sabin <miles@milessabin.com> wrote:
Also remember that this library is just a starting point for discussions. I'm hoping to outline the issue areas in an ARM API so we can address them and make a final solution.
So far I think we've identified that demarking the opening/closing of resources is important, as well as finding a way to ensure the user only extracts "non-resource-bound" items from the ARM block.
Anyway, please propose alternate solutions. Would you like access to the wiki?
- Josh
On Sun, Oct 4, 2009 at 11:26 AM, Miles Sabin <miles@milessabin.com> wrote:
On Sun, Oct 4, 2009 at 4:16 PM, Josh Suereth <joshua.suereth@gmail.com> wrote:
> Here's a socket example.
To be honest, that looks surprisingly heavyweight and like Daniel it's
also not immediately clear to me where the open/close bracketing
comes. Could you add comments to the code indicating those points?
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://www.chuusai.com/
http://twitter.com/milessabin
Sun, 2009-10-04, 19:17
#11
Re: Scala Automatic Resource Management Incubator Project
Hi Josh,
you might find this useful:http://www.saager.org/2007/12/30/automatic-resource-management-blocks.html
p
On Sun, Oct 4, 2009 at 5:48 PM, Josh Suereth <joshua.suereth@gmail.com> wrote:
you might find this useful:http://www.saager.org/2007/12/30/automatic-resource-management-blocks.html
p
On Sun, Oct 4, 2009 at 5:48 PM, Josh Suereth <joshua.suereth@gmail.com> wrote:
Updated: http://wiki.github.com/jsuereth/scala-arm/socketexample
Also remember that this library is just a starting point for discussions. I'm hoping to outline the issue areas in an ARM API so we can address them and make a final solution.
So far I think we've identified that demarking the opening/closing of resources is important, as well as finding a way to ensure the user only extracts "non-resource-bound" items from the ARM block.
Anyway, please propose alternate solutions. Would you like access to the wiki?
- Josh
On Sun, Oct 4, 2009 at 11:26 AM, Miles Sabin <miles@milessabin.com> wrote:
On Sun, Oct 4, 2009 at 4:16 PM, Josh Suereth <joshua.suereth@gmail.com> wrote:
> Here's a socket example.
To be honest, that looks surprisingly heavyweight and like Daniel it's
also not immediately clear to me where the open/close bracketing
comes. Could you add comments to the code indicating those points?
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://www.chuusai.com/
http://twitter.com/milessabin
Mon, 2009-10-05, 00:27
#12
Re: Scala Automatic Resource Management Incubator Project
Actually, you can accomplish the same thing in the API I've started as a sample discussion point. The code is adapted from Scalax.IO and some production libraries I use at work, so I have some ideas of the complexities involved with ARM.
The simple lightweight version is still there in my API, however I wanted to have depth when you need it. Here's what the above blog sample would look like in my API
vs. the original
So now my question is this: What's "heavyweight" about my API?
On Sun, Oct 4, 2009 at 2:09 PM, Peter Hausel <peter.hausel@gmail.com> wrote:
The simple lightweight version is still there in my API, however I wanted to have depth when you need it. Here's what the above blog sample would look like in my API
for(pi <-ManagedResource(new PipedInputStream)){
for(po<-ManagedResource(new PipedOutputStream(pi))) {
po.write('A');
Console.println((pi.read).asInstanceOf[Char]);
}
}
vs. the original
for(pi<-new ManagedResource(new PipedInputStream);
po<-new ManagedResource(new PipedOutputStream(pi))) {
po.write('A');
Console.println((pi.read).asInstanceOf[Char]);
}
So now my question is this: What's "heavyweight" about my API?
On Sun, Oct 4, 2009 at 2:09 PM, Peter Hausel <peter.hausel@gmail.com> wrote:
Hi Josh,
you might find this useful:http://www.saager.org/2007/12/30/automatic-resource-management-blocks.html
p
On Sun, Oct 4, 2009 at 5:48 PM, Josh Suereth <joshua.suereth@gmail.com> wrote:
Updated: http://wiki.github.com/jsuereth/scala-arm/socketexample
Also remember that this library is just a starting point for discussions. I'm hoping to outline the issue areas in an ARM API so we can address them and make a final solution.
So far I think we've identified that demarking the opening/closing of resources is important, as well as finding a way to ensure the user only extracts "non-resource-bound" items from the ARM block.
Anyway, please propose alternate solutions. Would you like access to the wiki?
- Josh
On Sun, Oct 4, 2009 at 11:26 AM, Miles Sabin <miles@milessabin.com> wrote:
On Sun, Oct 4, 2009 at 4:16 PM, Josh Suereth <joshua.suereth@gmail.com> wrote:
> Here's a socket example.
To be honest, that looks surprisingly heavyweight and like Daniel it's
also not immediately clear to me where the open/close bracketing
comes. Could you add comments to the code indicating those points?
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://www.chuusai.com/
http://twitter.com/milessabin
Mon, 2009-10-05, 00:57
#13
Re: Scala Automatic Resource Management Incubator Project
Josh,
why have you stripped all IO stuff that exists in scalax.io? For
example, InputStreamSource abstract class. I find it more useful then
basic ARM stuff.
S.
On Sun, Oct 4, 2009 at 05:31, Josh Suereth wrote:
> All,
>
> I believe that before (or while) introducing a good I/O library, Scala
> should include a way to perform automated resource management (open/closing
> a file before reading lines, etc.).
>
> To that effect, I've pulled ideas/reworked scalax + some applications of it
> we used at my work place along with integrated to Paul Phillips's Exception
> DSL to create the following ARM library:
> http://github.com/jsuereth/scala-arm
>
> The goal if this library is as follows
>
> Easy to use
> Extendability to various concepts (Transactions and Sockets/Streams for now)
> Functional
> Works well in for expressions
>
> I'd like to start work on a SID, possibly by using a github WIKI page to
> kick it off. That way contributors can keep track of revisions and work
> concurrently. I'm only going to open up the project to users who have
> filled out/submitted the Scala Contributor Agreement and are willing to
> release their works under the Scala license.
>
> The library requires SBT 5.5 to run (along with a custom built version
> against a latest scala nightly). If you're interesting in
> joining/contributing to this project, please let me know!
>
> - Josh Suereth
>
Mon, 2009-10-05, 01:17
#14
Re: Scala Automatic Resource Management Incubator Project
I'm proposing a separate library from I/O. i.e. these are the fundamental resource traits from scalax.resource with a few twists I made for use in Scala 2.8.0 along with some things I learned from production use.
If we only want ARM in the context of I/O then that's fine. I thought it might deserve it's own lirbary/SID as it had the same in scalax. It's also a fairly small library, so I was hoping this could be a real test of the new incubator process and vet out how things should work on this list.
So I guess the first question here really should be: Do you think Automatic-Resource-Management deserves its own library?
- Josh
On Sun, Oct 4, 2009 at 7:49 PM, Stepan Koltsov <stepan.koltsov@gmail.com> wrote:
If we only want ARM in the context of I/O then that's fine. I thought it might deserve it's own lirbary/SID as it had the same in scalax. It's also a fairly small library, so I was hoping this could be a real test of the new incubator process and vet out how things should work on this list.
So I guess the first question here really should be: Do you think Automatic-Resource-Management deserves its own library?
- Josh
On Sun, Oct 4, 2009 at 7:49 PM, Stepan Koltsov <stepan.koltsov@gmail.com> wrote:
Josh,
why have you stripped all IO stuff that exists in scalax.io? For
example, InputStreamSource abstract class. I find it more useful then
basic ARM stuff.
S.
On Sun, Oct 4, 2009 at 05:31, Josh Suereth <joshua.suereth@gmail.com> wrote:
> All,
>
> I believe that before (or while) introducing a good I/O library, Scala
> should include a way to perform automated resource management (open/closing
> a file before reading lines, etc.).
>
> To that effect, I've pulled ideas/reworked scalax + some applications of it
> we used at my work place along with integrated to Paul Phillips's Exception
> DSL to create the following ARM library:
> http://github.com/jsuereth/scala-arm
>
> The goal if this library is as follows
>
> Easy to use
> Extendability to various concepts (Transactions and Sockets/Streams for now)
> Functional
> Works well in for expressions
>
> I'd like to start work on a SID, possibly by using a github WIKI page to
> kick it off. That way contributors can keep track of revisions and work
> concurrently. I'm only going to open up the project to users who have
> filled out/submitted the Scala Contributor Agreement and are willing to
> release their works under the Scala license.
>
> The library requires SBT 5.5 to run (along with a custom built version
> against a latest scala nightly). If you're interesting in
> joining/contributing to this project, please let me know!
>
> - Josh Suereth
>
Mon, 2009-10-05, 01:57
#15
Re: Scala Automatic Resource Management Incubator Project
On Mon, Oct 5, 2009 at 04:12, Josh Suereth wrote:
> I'm proposing a separate library from I/O. i.e. these are the fundamental
> resource traits from scalax.resource with a few twists I made for use in
> Scala 2.8.0 along with some things I learned from production use.
>
> If we only want ARM in the context of I/O then that's fine. I thought it
> might deserve it's own lirbary/SID as it had the same in scalax. It's also
> a fairly small library, so I was hoping this could be a real test of the new
> incubator process and vet out how things should work on this list.
>
> So I guess the first question here really should be: Do you think
> Automatic-Resource-Management deserves its own library?
No, because IO stuff depends on ARM.
As I said before, for me, ARM itself is not a critical missing part of
the standard library, but IO is.
Impementation of IO worth inclusion into the standard library, ARM
alone is not. IMHO.
S.
> On Sun, Oct 4, 2009 at 7:49 PM, Stepan Koltsov
> wrote:
>>
>> Josh,
>>
>> why have you stripped all IO stuff that exists in scalax.io? For
>> example, InputStreamSource abstract class. I find it more useful then
>> basic ARM stuff.
>>
>> S.
>>
>>
>> On Sun, Oct 4, 2009 at 05:31, Josh Suereth
>> wrote:
>> > All,
>> >
>> > I believe that before (or while) introducing a good I/O library, Scala
>> > should include a way to perform automated resource management
>> > (open/closing
>> > a file before reading lines, etc.).
>> >
>> > To that effect, I've pulled ideas/reworked scalax + some applications of
>> > it
>> > we used at my work place along with integrated to Paul Phillips's
>> > Exception
>> > DSL to create the following ARM library:
>> > http://github.com/jsuereth/scala-arm
>> >
>> > The goal if this library is as follows
>> >
>> > Easy to use
>> > Extendability to various concepts (Transactions and Sockets/Streams for
>> > now)
>> > Functional
>> > Works well in for expressions
>> >
>> > I'd like to start work on a SID, possibly by using a github WIKI page to
>> > kick it off. That way contributors can keep track of revisions and work
>> > concurrently. I'm only going to open up the project to users who have
>> > filled out/submitted the Scala Contributor Agreement and are willing to
>> > release their works under the Scala license.
>> >
>> > The library requires SBT 5.5 to run (along with a custom built version
>> > against a latest scala nightly). If you're interesting in
>> > joining/contributing to this project, please let me know!
>> >
>> > - Josh Suereth
>> >
>
>
Mon, 2009-10-05, 02:07
#16
Re: Scala Automatic Resource Management Incubator Project
But you can't have one without the other? I think that means we need to discuss ARM, at least in the context of I/O. It'd be nice to have a building block for which I/O can work.
Honestly, I use ARM more often than I use I/O at work. So for me the situation is reversed.
- Josh
On Sun, Oct 4, 2009 at 8:49 PM, Stepan Koltsov <stepan.koltsov@gmail.com> wrote:
Honestly, I use ARM more often than I use I/O at work. So for me the situation is reversed.
- Josh
On Sun, Oct 4, 2009 at 8:49 PM, Stepan Koltsov <stepan.koltsov@gmail.com> wrote:
On Mon, Oct 5, 2009 at 04:12, Josh Suereth <joshua.suereth@gmail.com> wrote:
> I'm proposing a separate library from I/O. i.e. these are the fundamental
> resource traits from scalax.resource with a few twists I made for use in
> Scala 2.8.0 along with some things I learned from production use.
>
> If we only want ARM in the context of I/O then that's fine. I thought it
> might deserve it's own lirbary/SID as it had the same in scalax. It's also
> a fairly small library, so I was hoping this could be a real test of the new
> incubator process and vet out how things should work on this list.
>
> So I guess the first question here really should be: Do you think
> Automatic-Resource-Management deserves its own library?
No, because IO stuff depends on ARM.
As I said before, for me, ARM itself is not a critical missing part of
the standard library, but IO is.
Impementation of IO worth inclusion into the standard library, ARM
alone is not. IMHO.
S.
> On Sun, Oct 4, 2009 at 7:49 PM, Stepan Koltsov <stepan.koltsov@gmail.com>
> wrote:
>>
>> Josh,
>>
>> why have you stripped all IO stuff that exists in scalax.io? For
>> example, InputStreamSource abstract class. I find it more useful then
>> basic ARM stuff.
>>
>> S.
>>
>>
>> On Sun, Oct 4, 2009 at 05:31, Josh Suereth <joshua.suereth@gmail.com>
>> wrote:
>> > All,
>> >
>> > I believe that before (or while) introducing a good I/O library, Scala
>> > should include a way to perform automated resource management
>> > (open/closing
>> > a file before reading lines, etc.).
>> >
>> > To that effect, I've pulled ideas/reworked scalax + some applications of
>> > it
>> > we used at my work place along with integrated to Paul Phillips's
>> > Exception
>> > DSL to create the following ARM library:
>> > http://github.com/jsuereth/scala-arm
>> >
>> > The goal if this library is as follows
>> >
>> > Easy to use
>> > Extendability to various concepts (Transactions and Sockets/Streams for
>> > now)
>> > Functional
>> > Works well in for expressions
>> >
>> > I'd like to start work on a SID, possibly by using a github WIKI page to
>> > kick it off. That way contributors can keep track of revisions and work
>> > concurrently. I'm only going to open up the project to users who have
>> > filled out/submitted the Scala Contributor Agreement and are willing to
>> > release their works under the Scala license.
>> >
>> > The library requires SBT 5.5 to run (along with a custom built version
>> > against a latest scala nightly). If you're interesting in
>> > joining/contributing to this project, please let me know!
>> >
>> > - Josh Suereth
>> >
>
>
Mon, 2009-10-05, 02:17
#17
Re: Scala Automatic Resource Management Incubator Project
All~
I disagree, I think that ARM is extremely important for inclusion in a standard library. All actively managed resources (like JDBC and thread pooling), benefit from good ARM support.
Matt
On Sun, Oct 4, 2009 at 8:49 PM, Stepan Koltsov <stepan.koltsov@gmail.com> wrote:
I disagree, I think that ARM is extremely important for inclusion in a standard library. All actively managed resources (like JDBC and thread pooling), benefit from good ARM support.
Matt
On Sun, Oct 4, 2009 at 8:49 PM, Stepan Koltsov <stepan.koltsov@gmail.com> wrote:
On Mon, Oct 5, 2009 at 04:12, Josh Suereth <joshua.suereth@gmail.com> wrote:
> I'm proposing a separate library from I/O. i.e. these are the fundamental
> resource traits from scalax.resource with a few twists I made for use in
> Scala 2.8.0 along with some things I learned from production use.
>
> If we only want ARM in the context of I/O then that's fine. I thought it
> might deserve it's own lirbary/SID as it had the same in scalax. It's also
> a fairly small library, so I was hoping this could be a real test of the new
> incubator process and vet out how things should work on this list.
>
> So I guess the first question here really should be: Do you think
> Automatic-Resource-Management deserves its own library?
No, because IO stuff depends on ARM.
As I said before, for me, ARM itself is not a critical missing part of
the standard library, but IO is.
Impementation of IO worth inclusion into the standard library, ARM
alone is not. IMHO.
S.
> On Sun, Oct 4, 2009 at 7:49 PM, Stepan Koltsov <stepan.koltsov@gmail.com>
> wrote:
>>
>> Josh,
>>
>> why have you stripped all IO stuff that exists in scalax.io? For
>> example, InputStreamSource abstract class. I find it more useful then
>> basic ARM stuff.
>>
>> S.
>>
>>
>> On Sun, Oct 4, 2009 at 05:31, Josh Suereth <joshua.suereth@gmail.com>
>> wrote:
>> > All,
>> >
>> > I believe that before (or while) introducing a good I/O library, Scala
>> > should include a way to perform automated resource management
>> > (open/closing
>> > a file before reading lines, etc.).
>> >
>> > To that effect, I've pulled ideas/reworked scalax + some applications of
>> > it
>> > we used at my work place along with integrated to Paul Phillips's
>> > Exception
>> > DSL to create the following ARM library:
>> > http://github.com/jsuereth/scala-arm
>> >
>> > The goal if this library is as follows
>> >
>> > Easy to use
>> > Extendability to various concepts (Transactions and Sockets/Streams for
>> > now)
>> > Functional
>> > Works well in for expressions
>> >
>> > I'd like to start work on a SID, possibly by using a github WIKI page to
>> > kick it off. That way contributors can keep track of revisions and work
>> > concurrently. I'm only going to open up the project to users who have
>> > filled out/submitted the Scala Contributor Agreement and are willing to
>> > release their works under the Scala license.
>> >
>> > The library requires SBT 5.5 to run (along with a custom built version
>> > against a latest scala nightly). If you're interesting in
>> > joining/contributing to this project, please let me know!
>> >
>> > - Josh Suereth
>> >
>
>
I like the opt/either thing, but I'd prefer toOption, toEither. Then again, I was on the losing side of Seq/Sequence. :-)
On Sat, Oct 3, 2009 at 10:31 PM, Josh Suereth <joshua.suereth@gmail.com> wrote:
--
Daniel C. Sobral
Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value.