#2048 So large sys pod

go4 Mon 29 Oct 2012

The sys pod contains:

DateTime
Date
Time
Duration
TimeZone
Month
Weekday

MimeType
Unit
Zip
Service
Uuid
Process
Regex

Version
Depend

Log
Test

I would prefer to see moving these non-core API to a new pod.

kaushik Tue 30 Oct 2012

+1. This could be one way to reduce the size of sys.js?

tcolar Tue 30 Oct 2012

I'm not to sure about the duration/Datetime stuff, in Fantom that's core to the language, there are even duration literals

I guess the rest could move but sys.pod is 300Kb, how is that huge ?

I guess the javascript is more of a valid point but then you would have to include many smaller javascipt and that's more complicated and usually network round trips are being avoided, in fact most jaavscript libraries do try to consolidate all in one big file for this reason.

Also it would break lots of existing code :-/

brian Tue 30 Oct 2012

All the date/time APIs are super core stuff and definitely belong in sys. They are basic types in most databases, XML Schema, and used by many other core APIs.

MimeType is used by File.

Version and Depend are used by Pod.

I made Log part of sys, because its a core low-level facility that everybody should share - not some optional add-on.

That only leaves a couple special cases like Process, Regex, and Unit. You could potentially move those to util or somewhere else. But it certainly doesn't seem like they really hurt anything - they are all very low-level system level functionality. It is really more a matter of opinion and taste than anything. And moving them would just cause a ton of pain in breaking changes.

DanielFath Tue 30 Oct 2012

@tcolar: minified jQuery (32KB) is considered bloated in JS world.

tcolar Tue 30 Oct 2012

If the worry is about javascript size, which is a vmore valid point, I think the solution to that would be to have in sys.js only what you need.

JQueryUI let's can create your own jquery-ui.js by picking which features you want, so maybe something like that would be cool.

More cool would be the compiler figuring out what you are using and generate the minimum javascript .... probably easier said than done though :)

DanielFath Tue 30 Oct 2012

Yeah, those are treeshaking algorithms. Apparently Dart language uses/will use it to generate JS.

go4 Fri 2 Nov 2012

There are some implicit rules:

  • compiler pod only depends on sys pod.
  • the literal syntax is limited in sys.
  • default import/using only is using sys.

It is possible to break all rules.

But I don't know any benefit to do this change.~~

Akcelisto Sat 3 Nov 2012

I think, sys pod too small. Early they contains concurrent pod. Now I always import concurrent pod.

Login or Signup to reply.