News for hackers. Stuff that matters.
Re:Libsass – C implementation of a Sass compiler by leif on Monday November 25, 2013 @08:50PM (#6798535)
I'm not a web guy, but isn't sass a CSS generator, as in something you run once before deploying anything? What's the advantage of speed for something like this?
Re:Libsass – C implementation of a Sass compiler by twhid on Monday November 25, 2013 @10:11PM (#6798866)
Real world example: our project was taking almost 1 minute to compile via Ruby (all CSS).

Using sassc (libsass) that went to 5 seconds.

Development was where we saw real gains, different sections that would take 4-6 seconds to compile, went down to <500ms (our asset watcher is smart enough to compile only blocks of Sass files that are associated, not the entire site's Sass). Meaning that in the time it takes you to switch to your browser and refresh, the Sass would be compiled to CSS.

Made my devs life much, much better!

Re:Libsass – C implementation of a Sass compiler by lightblade on Tuesday November 26, 2013 @01:38AM (#6799552)
Whoa! 5 seconds is still a long time. If you don't mind me asking, how many lines of SASS does the project have?
Re:Libsass – C implementation of a Sass compiler by twhid on Tuesday November 26, 2013 @10:28AM (#6801826)
>22,000 according to wc -l /*.scss (thanks stackoverflow!).

Edit: > 24,000 (counting all files this time ;-)

But I noticed that files missing a newline at the end weren't being counted correctly (missing 1 line in the count).

Re:Libsass – C implementation of a Sass compiler by hcatlin on Monday November 25, 2013 @08:58PM (#6798571)
So, when big companies like Linkedin generate their Sass projects, it can take hours on a single machine. Tons of programmers all working in Sass.

At Moovweb, some of our customer's projects can take 30 seconds just for the Sass to compile for fairly straightforward sites.

Re:Libsass – C implementation of a Sass compiler by gkoberger on Monday November 25, 2013 @09:01PM (#6798580)
Seriously? I believe you, but if it's taking hours then it seems like the problem isn't as much with SASS but rather the way they write CSS or their build process. If they only recompiled changed files, there's no way it could take "hours".

Even if they recompile everything... all CSS needs to be interpreted by the browser at some point. How much CSS do they have?

That being said, what are the speed comparisons like?

Re:Libsass – C implementation of a Sass compiler by icambron on Tuesday November 26, 2013 @02:02AM (#6799625)
Yeah, I'd love to hear more from Hampton on the hours thing. What actually takes so long? Why does the number of developers matter? I've worked on some substantial (though not LinkedIn-sized) projects that used SASS and I've never clear seconds in compilation time.

Though I completely get the portability aspect.

Re:Libsass – C implementation of a Sass compiler by hcatlin on Tuesday November 26, 2013 @12:09PM (#6802584)
They use https://github.com/linkedin/archetype which is an extension on top of Compass. Including all those libraries can mean a TON of memory and processing is required. Mixins calling mixins calling mixins. Plus, custom ruby extensions, etc. The needs of organizing hundreds of developers logically and making sure the code is optimized can be a hauss.
Re:Libsass – C implementation of a Sass compiler by icambron on Tuesday November 26, 2013 @12:51PM (#6802853)
Thanks.
Re:Libsass – C implementation of a Sass compiler by drdaeman on Monday November 25, 2013 @10:28PM (#6798929)
Hours?

Either they have several gigabytes of CSS output (ouch) or they're using a ZX-Spectrum as a build machine. Or, possibly, they're constantly recompiling, like doing a change in SASS a hundred times per second.

Otherwise, interpreted script-based parser (given that it's written properly, algorithm-wise) should be sufficiently performant to produce results in a sane time.

Re:Libsass – C implementation of a Sass compiler by leif on Monday November 25, 2013 @09:00PM (#6798576)
Ok, that's more drastic than I thought. I think I get the point now.
Re:Libsass – C implementation of a Sass compiler by jhgg on Monday November 25, 2013 @08:52PM (#6798541)
Saves a bit of time when you're in the edit your scss/sass files -> refresh browser workflow. A designer friend of mine always complains about how slow the ruby sass compiler is for larger projects, but he says the time saved in writing stylesheets with it beats the time spent having to wait for them to compile.
Re:Libsass – C implementation of a Sass compiler by akhleung on Monday November 25, 2013 @08:55PM (#6798559)
On huge projects, Ruby Sass can be quite slow, taking several seconds or even minutes to compile. If you have an interactive, iterative workflow where you're constantly refreshing the styles, having a faster Sass compiler can be a godsend.
Re:Libsass – C implementation of a Sass compiler by WalterSear on Monday November 25, 2013 @10:20PM (#6798902)
Every tiny change requires a recompile. On a really complicated site, that could be 30 seconds or more. And CSS is a >visual< language, that looks subtly different in all browsers and eventually requires a lot of 'stabbing in the dark' to find the perfect compromise.
Re:Libsass – C implementation of a Sass compiler by nadinengland on Tuesday November 26, 2013 @04:19AM (#6800100)
If you were making small changes to see what worked in different browsers, rather than editing the CSS or SASS, it may be more beneficial to use the browser's Web Tool to do it live!
Re:Libsass – C implementation of a Sass compiler by WalterSear on Tuesday November 26, 2013 @01:18PM (#6803049)
Yes, but only when you are making small changes to a single, and relatively static, page. And, you need to make the same changes in every browser at once. And, then you need to verify that the css changes you made correspond to the sass changes you make in the main document.
Re:Libsass – C implementation of a Sass compiler by TylerE on Monday November 25, 2013 @08:53PM (#6798549)
Depends. Many newer frameworks (Rails, at least, specifically) do not pregenerate but instead compile on the fly and then cache, at least in development mode.

Also, the canonical SASS implementation is in Ruby, which is a fairly heavyweight dep if you need it JUST for to compile SASS

Re:Libsass – C implementation of a Sass compiler by dpritchett on Monday November 25, 2013 @08:53PM (#6798548)
Faster deploys means more deploys means more features and fixes and a better chance of survival. See: John Boyd.
Re:Libsass – C implementation of a Sass compiler by colechristensen on Monday November 25, 2013 @09:18PM (#6798656)
With a C binding, this library is usable in more or less every language under the sun without messiness.

Written in the correct way, a library like this will compile and run on a 15 year old OS, and will probably run on plenty of OSes in 15 years. The dependency hell of building old language binaries with a dozen badly supported other libraries doesn't exist when you link to libc/libstdc++/etc.

There ought to be a speed advantage, but it definitely isn't the only motivation.

Re:Libsass – C implementation of a Sass compiler by ufo on Monday November 25, 2013 @09:29PM (#6798703)
What do you mean by "written in the correct way"?
Re:Libsass – C implementation of a Sass compiler by colechristensen on Monday November 25, 2013 @09:45PM (#6798769)
Written in a way to make the second half of that statement true :)

This involves things like keeping linked libraries to a minimum (and only to use ones which are commonly part of a default unix install), actually testing on a few different platforms, using standard build tools (despite their wonkiness), avoiding (compiler|architecture|OS)-specific features, and all sort of other guidelines that one should follow when trying to write portable software.

Re:Libsass – C implementation of a Sass compiler by chrisbolt on Monday November 25, 2013 @08:52PM (#6798543)
Speed of deployment, especially for larger sites with more CSS to process.
Re:Libsass – C implementation of a Sass compiler by clarle on Monday November 25, 2013 @08:57PM (#6798566)
If you're in a language that allows C bindings, then it makes it easier to port a SASS library to that other language.
Re:Libsass – C implementation of a Sass compiler by habitue on Monday November 25, 2013 @09:18PM (#6798653)