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

XML-free Scala

13 replies
Stéphane Micheloud
Joined: 2011-09-28,
User offline. Last seen 42 years 45 weeks ago.

Hi all,

I just released an XML-free Scala distribution derived from the
official Scala source repository.

The archive files for Scala version 2.8.2.final, version 2.9.1.final
and revision r25713 (or newer) can be downloaded from the following
page:

http://lamp.epfl.ch/~michelou/scala/scala-noxml.html

Please send your feedback or report issues directly to the author.

Bye
--Stephane

Stefan Lampe
Joined: 2009-08-18,
User offline. Last seen 42 years 45 weeks ago.
RE: XML-free Scala

Hi,
I'm interested in the reasons behind this request - I don't have a strong opinion either way, but why is an xml-free scala seen as desirable? (The page you linked to didn't give much information other than a company wanted a version with no native xml support).
Thanks

----------------------------------------
> Date: Wed, 28 Sep 2011 14:14:15 -0700
> Subject: [scala-language] XML-free Scala
> From: stephane.micheloud@gmail.com
> To: scala-language@googlegroups.com
>
> Hi all,
>
> I just released an XML-free Scala distribution derived from the
> official Scala source repository.
>
> The archive files for Scala version 2.8.2.final, version 2.9.1.final
> and revision r25713 (or newer) can be downloaded from the following
> page:
>
> http://lamp.epfl.ch/~michelou/scala/scala-noxml.html
>
> Please send your feedback or report issues directly to the author.
>
> Bye
> --Stephane

Stéphane Micheloud
Joined: 2011-09-28,
User offline. Last seen 42 years 45 weeks ago.
Re: XML-free Scala

Hi Stefan,

There are several reasons; they can be found at the following links (I
mention 2 links on my page):

http://www.codecommit.com/blog/scala/working-with-scalas-xml-support
http://anti-xml.org/faq.html
http://code.google.com/p/scala-scales/
http://www.techworld.com.au/article/397692/a-z_programming_languages_fro...

Bye
--Stephane

On 09/28/2011 11:53 PM, Stefan Lampe wrote:
> Hi,
> I'm interested in the reasons behind this request - I don't have a strong opinion either way, but why is an xml-free scala seen as desirable? (The page you linked to didn't give much information other than a company wanted a version with no native xml support).
> Thanks
>
> ----------------------------------------
>> Date: Wed, 28 Sep 2011 14:14:15 -0700
>> Subject: [scala-language] XML-free Scala
>> From: stephane.micheloud@gmail.com
>> To: scala-language@googlegroups.com
>>
>> Hi all,
>>
>> I just released an XML-free Scala distribution derived from the
>> official Scala source repository.
>>
>> The archive files for Scala version 2.8.2.final, version 2.9.1.final
>> and revision r25713 (or newer) can be downloaded from the following
>> page:
>>
>> http://lamp.epfl.ch/~michelou/scala/scala-noxml.html
>>
>> Please send your feedback or report issues directly to the author.
>>
>> Bye
>> --Stephane
>

Philippe Lhoste
Joined: 2010-09-02,
User offline. Last seen 42 years 45 weeks ago.
Re: XML-free Scala

On 29/09/2011 01:00, Stephane Micheloud wrote:
> There are several reasons; they can be found at the following links (I mention 2 links on
> my page):
>
> http://www.codecommit.com/blog/scala/working-with-scalas-xml-support
> http://anti-xml.org/faq.html
> http://code.google.com/p/scala-scales/
> http://www.techworld.com.au/article/397692/a-z_programming_languages_fro...

OK, but why removing the feature is desirable? Does it reduces greatly the size of the
distribution? Does it prevent coders to use native XML support?
What about an actor-free distribution, for those using Akka (or other)? :-)

For the record, I believe there is some official (?) desire to integrate Anti-XML to
official Scala, perhaps combined with native XML syntax in Scala (with a compile-time
switch?).

odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
Re: Re: XML-free Scala

There's really no way official Scala can give up XML. Far too many
projects use it. And it generally works well. That said, there can
always be better solutions. That's why effort like AntiXML are good.
Just don't think that they will replace Scala XML tomorrow. They have
still a way to go to be even contenders for full replacement, and then
there would no doubt be a long discussion period about whether one can
do an easy migration to the new code base. If that discussion has
positive outcomes, there will be an even longer migration process
(measured most likely in years not months).

Cheers

MattRussell
Joined: 2009-07-22,
User offline. Last seen 45 weeks 3 days ago.
Re: XML-free Scala
On Thursday, September 29, 2011 9:50:47 AM UTC+1, PhiLho wrote: 

OK, but why removing the feature is desirable? Does it reduces greatly the size of the
distribution? Does it prevent coders to use native XML support?


Yeah, I'm also curious about the motivations for this. If you wanted to absolutely forbid use of Scala's support for XML (and you didn't trust your developers to comply), you could much more easily write a tool that scans the code-base for violations than maintain a fork of the compiler.
-- Matt
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: XML-free Scala
Hi,

Thanks for your work!

Is this already available in trunk with some configuration switch?

I saw that you also made it possible to produce a separate scala-actors.jar... any plans on further modularizing Scala?


Thanks and bye,


Simon
Tony Morris 2
Joined: 2009-03-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: XML-free Scala

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/29/2011 06:50 PM, Philippe Lhoste wrote:
> On 29/09/2011 01:00, Stephane Micheloud wrote:
>> There are several reasons; they can be found at the following links (I
>> mention 2 links on
>> my page):
>>
>> http://www.codecommit.com/blog/scala/working-with-scalas-xml-support
>> http://anti-xml.org/faq.html
>> http://code.google.com/p/scala-scales/
>> http://www.techworld.com.au/article/397692/a-z_programming_languages_fro...
>>
>
> OK, but why removing the feature is desirable? Does it reduces greatly
> the size of the distribution? Does it prevent coders to use native XML
> support?
> What about an actor-free distribution, for those using Akka (or other)? :-)
>
> For the record, I believe there is some official (?) desire to integrate
> Anti-XML to official Scala, perhaps combined with native XML syntax in
> Scala (with a compile-time switch?).
>

Just a personal anecdote. I am currently working on a project where the
resulting jar file size is an important consideration. The scala.xml
package gets in the way of this objective -- pretty annoying given that
I don't use it.

In general, if you subscribe to the rough rule that "introducing syntax"
alone is always costly, but that introduction of syntax would produce
some practical benefit from its specific detail, then you would ask the
question, "is the cost of introduction of syntax for XML a worthwhile
trade for the practical benefit it provides?" Regardless of your
opinion, I think this is a good way to approach the issue. FWIW, it is
my opinion that the answer is, "not even a close call."

Bob Jamison
Joined: 2009-07-23,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: XML-free Scala

On 9/29/2011 3:57 AM, martin odersky wrote:
> There's really no way official Scala can give up XML. Far too many
> projects use it. And it generally works well. That said, there can
> always be better solutions. That's why effort like AntiXML are good.
> Just don't think that they will replace Scala XML tomorrow. They have
> still a way to go to be even contenders for full replacement, and then
> there would no doubt be a long discussion period about whether one can
> do an easy migration to the new code base. If that discussion has
> positive outcomes, there will be an even longer migration process
> (measured most likely in years not months).
>
> Cheers
>
> -- Martin
>

Hi, all,

One of the best selling points of Scala was that it was relatively
immune from the inertia that has dogged Java and has left it with its
crufty, ill-formed and locked-into-90's API.

The answer is this: make a Scala 2.0 API. Make a clean break. Keep
supporting the old, but move forward with the new.

* XML and JSON and maybe other doc formats all need a common base.
Current XML is a solution without a problem. Wtf is "Metadata" in the
context of XML? Use good tech, like zippers.
* The schism between mutable and immutable needs to be fixed
(immutables + builders?)
* Clean up things like the parser combinators (currently do not support
context)
* Grok the good things from scalaz and elsewhere that can be found.

Bob

Philippe Lhoste
Joined: 2010-09-02,
User offline. Last seen 42 years 45 weeks ago.
Re: XML-free Scala

On 29/09/2011 12:29, Tony Morris wrote:
> Just a personal anecdote. I am currently working on a project where the
> resulting jar file size is an important consideration. The scala.xml
> package gets in the way of this objective -- pretty annoying given that
> I don't use it.

Yes, but you have Proguard or similar to cleanly remove unused features from a jar without
even having to recompile anything.

> In general, if you subscribe to the rough rule that "introducing syntax"
> alone is always costly, but that introduction of syntax would produce
> some practical benefit from its specific detail, then you would ask the
> question, "is the cost of introduction of syntax for XML a worthwhile
> trade for the practical benefit it provides?" Regardless of your
> opinion, I think this is a good way to approach the issue. FWIW, it is
> my opinion that the answer is, "not even a close call."

Well, I fear it is a bit too late for this topic at least...
In several interviews, Martin Odersky clearly stated that native XML support was a
sensible choice at the time, since it was so pervasive then (before Json was massively
used; or Yaml or other markup languages). IIRC, adding XML isn't really on his list of
design decisions he regret / stuff he would remove from Scala if there wasn't
compatibility issues. Unlike postfix operators...

I can see how this support can be convenient for some people: hey, it is just handy, out
of the box. And somehow seductive for quick hacking.
I regret it is technology oriented: type-safe string interpolation, for example, could
have been generalized beyond XML (back to macros?).
I also regret such support adds some complexity to the compiler (I suppose), and to those
needing to support syntax highlighting (my concern, obviously not one for the language
designers, of course) or other language parsing.

So I don't say such version is a bad idea, I was just genuinely curious of the motivations
for such work... ^_^'

Tony Morris 2
Joined: 2009-03-20,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: XML-free Scala

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/29/2011 10:34 PM, Philippe Lhoste wrote:
> On 29/09/2011 12:29, Tony Morris wrote:
>> Just a personal anecdote. I am currently working on a project where the
>> resulting jar file size is an important consideration. The scala.xml
>> package gets in the way of this objective -- pretty annoying given that
>> I don't use it.
>
> Yes, but you have Proguard or similar to cleanly remove unused features
> from a jar without even having to recompile anything.

I use proguard. This doesn't mean it is easy.

>
> So I don't say such version is a bad idea, I was just genuinely curious
> of the motivations for such work... ^_^'
>

It is a terrible idea according to some. I expect this is what motivates
the work.

Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: XML-free Scala

Just a personal anecdote. I am currently working on a project where the
resulting jar file size is an important consideration. The scala.xml
package gets in the way of this objective -- pretty annoying given that
I don't use it.


Wouldn’t it be sensible to push for further modularization then? E. g. splitting stuff into more pieces?
Jochen
Joined: 2009-09-08,
User offline. Last seen 1 year 31 weeks ago.
Re: XML-free Scala

are (x)html, svg, mathml, rss/atom, xml-mashups etc. etc. already out
of date ?

Native xml support in both Scala and Eclipse makes me just much more
productive doing web development.

On Sep 28, 10:14 pm, Stéphane Micheloud
wrote:
> Hi all,
>
> I just released an XML-free Scala distribution derived from the
> official Scala source repository.
>
> The archive files for Scala version 2.8.2.final, version 2.9.1.final
> and revision r25713 (or newer) can be downloaded from the following
> page:
>
>    http://lamp.epfl.ch/~michelou/scala/scala-noxml.html
>
> Please send your feedback or report issues directly to the author.
>
> Bye
> --Stephane

Philippe Lhoste
Joined: 2010-09-02,
User offline. Last seen 42 years 45 weeks ago.
Re: XML-free Scala

On 29/09/2011 20:19, Simon Ochsenreither wrote:
> Wouldn’t it be sensible to push for further modularization then? E. g. splitting stuff
> into more pieces?

Might be more important if Akka goes in the main distribution, even more if it comes with
all the related libraries! (several dozen of megabytes)
I don't know if these 3rd party libraries are necessary to Akka or just added because they
are handy.

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