Re: URL classes in node and Scala-JS

On 9 Jul 2014, at 18:18, Markus Lanthaler <markus.lanthaler@gmx.net> wrote:

> On 9 Jul 2014 at 17:56, henry.story@bblfish.net wrote:
>>> Note that the Uri library in ScalaJS is only 278 bytes or so long
> uncompressed!
>>> 
>>> -rw-r--r--  1 hjs  staff   278B  7 Jul 11:03 http-model-uri-opt.js
>> 
>> Euh. Of course that was too small to be true :-D
>> 
>> -rw-r--r--  1 hjs  staff   609K  9 Jul 17:38 akka-urijs-test-opt.js
>> 
>> That is what is left after compressing the code that is built on a parser
> called parboiled,
>> a powerful library called shapeless, and the scala libraries used by the
> akka code.
>> So any code that one writes will probably never be much bigger than that.
>> Note also that this is uncompressed. It compresses down to
>> 
>> -rw-r--r--  1 hjs  staff   128440  9 Jul 17:38 akka-urijs-test-opt.js.gz
> 
> Really? 130k just for processing/parsing URIs?

yes.
But my guess is that it still will be close to that when I write a whole RDF library,
that is type safe, easy to use, with RDF to OO mappings, parsers and more. The reason
I think that is that:

  1) they are going to keep working on improving the size of the code generated ( perhaps 
    making it more modular )
  2) as I mentioned that the js generated pulls in a huge number of libraries in Scala which 
   I will be reusing anyway. ( Scala gives us the equivalent of underscore, and a huge number of
   other libs )

In any case I can wrap the node js URL library in a type safe way at the cost of what is 
probably just a  few 100 bytes.

Henry


> 
> 
> --
> Markus Lanthaler
> @markuslanthaler
> 
> 

Social Web Architect
http://bblfish.net/

Received on Wednesday, 9 July 2014 17:25:28 UTC