This page is no longer maintained — Please continue to the home page at www.scala-lang.org

YAML parser in Scala

6 replies
andrey
Joined: 2010-02-16,
User offline. Last seen 1 year 32 weeks ago.

Hi,
I am the creator and maintainer of a YAML parser for Java
(http://code.google.com/p/snakeyaml/)
I am impressed by the possibilities available in Scala and I plan to
port the library to Scala
to have a better interface for those who may need it.

Is anybody using YAML in Scala ? What are the problems ? What can be improved ?
Can somebody propose the general interface for the Scala version ?

Since it will be a new application I plan to support Scala 2.8.0 onwards.

You can also create an enhancements request
(http://code.google.com/p/snakeyaml/issues/list)

Regards,
Andrey

Doug Tangren
Joined: 2009-12-10,
User offline. Last seen 42 years 45 weeks ago.
Re: YAML parser in Scala
haven't tried it out yet but this guy's got one http://github.com/daltontf/scala-yaml
-Doug Tangren
http://lessis.me


On Fri, Mar 5, 2010 at 11:24 AM, Andrey Somov <py4fun@gmail.com> wrote:
Hi,
I am the creator and maintainer of a YAML parser for Java
(http://code.google.com/p/snakeyaml/)
I am impressed by the possibilities available in Scala and I plan to
port the library to Scala
to have a better interface for those who may need it.

Is anybody using YAML in Scala ? What are the problems ? What can be improved ?
Can somebody propose the general interface for the Scala version ?

Since it will be a new application I plan to support Scala 2.8.0 onwards.

You can also create an enhancements request
(http://code.google.com/p/snakeyaml/issues/list)

Regards,
Andrey

Doug Tangren
Joined: 2009-12-10,
User offline. Last seen 42 years 45 weeks ago.
Re: YAML parser in Scala
also, a common lib for handling scala configs is configgy - http://www.lag.net/configgy/
-Doug Tangren
http://lessis.me


On Fri, Mar 5, 2010 at 11:34 AM, Doug Tangren <d.tangren@gmail.com> wrote:
haven't tried it out yet but this guy's got one http://github.com/daltontf/scala-yaml
-Doug Tangren
http://lessis.me


On Fri, Mar 5, 2010 at 11:24 AM, Andrey Somov <py4fun@gmail.com> wrote:
Hi,
I am the creator and maintainer of a YAML parser for Java
(http://code.google.com/p/snakeyaml/)
I am impressed by the possibilities available in Scala and I plan to
port the library to Scala
to have a better interface for those who may need it.

Is anybody using YAML in Scala ? What are the problems ? What can be improved ?
Can somebody propose the general interface for the Scala version ?

Since it will be a new application I plan to support Scala 2.8.0 onwards.

You can also create an enhancements request
(http://code.google.com/p/snakeyaml/issues/list)

Regards,
Andrey


Tim Dalton
Joined: 2010-03-06,
User offline. Last seen 42 years 45 weeks ago.
Re: YAML parser in Scala
Andrey,

I'm the guy with the github project. You are more welcome to use my work as starting point. It is far from a complete implementation, just an exercise in writing parsers that I put out on github to see if it would generate any interest.

It seems to me that Scala's built-in support for XML means there is less demand for YAML support in Scala.

Tim

On 3/5/2010 10:34 AM, Doug Tangren wrote:
1d70e29c1003050834h55679df2mfdadcb46c3e9bfb9 [at] mail [dot] gmail [dot] com" type="cite"> haven't tried it out yet but this guy's got one http://github.com/daltontf/scala-yaml
-Doug Tangren
http://lessis.me


On Fri, Mar 5, 2010 at 11:24 AM, Andrey Somov <py4fun [at] gmail [dot] com" rel="nofollow">py4fun@gmail.com> wrote:
Hi,
I am the creator and maintainer of a YAML parser for Java
(http://code.google.com/p/snakeyaml/)
I am impressed by the possibilities available in Scala and I plan to
port the library to Scala
to have a better interface for those who may need it.

Is anybody using YAML in Scala ? What are the problems ? What can be improved ?
Can somebody propose the general interface for the Scala version ?

Since it will be a new application I plan to support Scala 2.8.0 onwards.

You can also create an enhancements request
(http://code.google.com/p/snakeyaml/issues/list)

Regards,
Andrey


andrey
Joined: 2010-02-16,
User offline. Last seen 1 year 32 weeks ago.
Re: YAML parser in Scala

Thank you Tim.
But I have already the complete YAML 1.1 parser.
I just wanted to introduce Scala interface.
Apparently there is no need. Is it because perfect Java-Scala
interoperability or just no one is using YAML in Scala ?

On Sat, Mar 6, 2010 at 4:32 AM, Tim Dalton wrote:
> Andrey,
>
> I'm the guy with the github project. You are more welcome to use my work as
> starting point. It is far from a complete implementation, just an exercise
> in writing parsers that I put out on github to see if it would generate any
> interest.
>
> It seems to me that Scala's built-in support for XML means there is less
> demand for YAML support in Scala.
>
> Tim
>

David Copeland
Joined: 2009-06-16,
User offline. Last seen 42 years 45 weeks ago.
Re: YAML parser in Scala

I would not say there is no need for YAML; it is a useful tool to have
in the toolbox, and provides a needed and useful alternative to XML
and JSON for serialization; that type info can be encoded in YAML
makes it a good fit for this purpose in Scala, given Scala's focus on
typing. Further, it is a much more widely-used format than
Configgy's, so it seems like a benefit to have a scala-ized interface
to your parser.

To answer your question on interface design, I have only used your
library very briefly in a side project, but I would think that the
manifests feature of 2.8 (and implicit objects/params) might allow
your Scala API to require less type information being passed-in than
the Java version.

Dave

---
My Blog: http://www.naildrivin5.com/blog
Scala Tour for Java Developers: http://www.naildrivin5.com/scalatour
Fork me on Github: http://davetron5000.github.com

On Sat, Mar 6, 2010 at 1:23 PM, Andrey Somov wrote:
> Thank you Tim.
> But I have already the complete YAML 1.1 parser.
> I just wanted to introduce Scala  interface.
> Apparently there is no need. Is it because perfect Java-Scala
> interoperability or just no one is using YAML in Scala ?
>
>
> On Sat, Mar 6, 2010 at 4:32 AM, Tim Dalton wrote:
>> Andrey,
>>
>> I'm the guy with the github project. You are more welcome to use my work as
>> starting point. It is far from a complete implementation, just an exercise
>> in writing parsers that I put out on github to see if it would generate any
>> interest.
>>
>> It seems to me that Scala's built-in support for XML means there is less
>> demand for YAML support in Scala.
>>
>> Tim
>>
>

andrey
Joined: 2010-02-16,
User offline. Last seen 1 year 32 weeks ago.
Re: YAML parser in Scala

> I would not say there is no need for YAML;
I do not say there is no need for YAML. I say there is no need to
spend time to port a Java library to Scala.

At the moment I do not posses enough knowledge in Scala to design a
flexible and powerful API.
I know SnakeYAML's limitations comparing to PyYAML. In Python they use
mixins (via multiple inheritance), duck typing, metaclasses, functions
as first-class objects, generators (continuations ?). Since nothing is
available in Java I had to find a compromise. The solution is not
always effective. Scala's powerful type system may help but it would
require to re-design the code.
Another approach can be to provide just another facade for the
existing core. But it may limit the possibilities.
I think I will better wait. (contributions/suggestions are always welcome !)

-
Andrey

On Sat, Mar 6, 2010 at 9:59 PM, David Copeland wrote:
> I would not say there is no need for YAML; it is a useful tool to have
> in the toolbox, and provides a needed and useful alternative to XML
> and JSON for serialization; that type info can be encoded in YAML
> makes it a good fit for this purpose in Scala, given Scala's focus on
> typing.  Further, it is a much more widely-used format than
> Configgy's, so it seems like a benefit to have a scala-ized interface
> to your parser.
>
> To answer your question on interface design, I have only used your
> library very briefly in a side project, but I would think that the
> manifests feature of 2.8 (and implicit objects/params) might allow
> your Scala API to require less type information being passed-in than
> the Java version.
>
> Dave
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland