6 ms·
A C implementation of a Sass compiler
- dcope 14y agoMisleading title and description. This is actually written in C++.
- telemachos 14y ago> While libsass is primarily implemented in C++, it provides a simple C interface that is defined in [sass_inteface.h]. Its usage is pretty straight forward.
- eridius 14y agoA C implementation of a Sass compiler "implementation of". Not "interface to".
- deleted 14y ago[deleted]
- telemachos 14y agoFair enough. My point was really just that the README discusses the specifics in more detail. The title of this thread is taken straight from the project's Github page. I don't think the title is wilfully misleading. I do think there are more interesting things to talk about regarding the project.
- eps 14y ago^ "misleading" comment. PS. Upvote if you got it :)
- pjscott 14y agoCool! So if you want to, for example, embed Sass compilation in a web framework in $YOUR_FAVORITE_LANGUAGE -- Python, Haskell, some weird dialect of Scheme, whatever -- all it would take is a few lines of code to wrap a few C-style function calls.
- pestaa 14y agoThis is quite fantastic. I think I'm going to make the switch very soon! I hope this'll save a few hundred milliseconds every time I hit `:w`. That happens a lot when I can stand the look of my ugly designs. On the other hand, I don't see the long-term benefit clearly that would justify writing this in C++. Most of these open source mini-movements hit maintenance and motivation barriers after some time, not performance ones. Although this could mean Sass overcame the prototype phase quite successfully. Also, at first sight it seems to me that the author of this library is the same as of Sass' itself. (Please correct me.) In this case, congratulations! Must be a real pleasure to see such a big improvement to what once was a pet project. :)
- akhleung 14y agoActually, I'm the primary developer of the library (I work with hcatlin). Large Sass projects can take a long time to compile (more than several seconds), so the performance increase should not be dismissed. Also, providing a C/C++ library makes it easier to embed Sass in other languages and platforms.
- deleted 14y ago[deleted]
- alanh 14y agoAre there plans to e.g. make the Sass gem we all use take advantage of this native code? That is, will I one day do a `bundle update` and be rewarded with speedy asset compilation?
- akhleung 14y agoThere's a proof-of-concept Ruby gem, which will mature as libsass matures. https://github.com/hcatlin/sassc-ruby https://github.com/hcatlin/sassc-ruby
- zampano 14y agoI just saw hcatlin's presentation on the future of Sass at RailsConf and he mentioned that large codebases (>50k lines) could take over 30s (think he said sometimes up to 2 minutes). One of his key points was that, since Sass is partially aimed at non-technical designers, it needed to be both faster and more accessible.
- deleted 14y ago[deleted]
- semanticart 14y agoThis is super exciting in terms of speed, but I'm saddened that the indented-style syntax isn't supported. https://twitter.com/#!/hcatlin/status/194558078098747393 https://twitter.com/#!/hcatlin/status/194558078098747393
- ddagradi 14y agoThat syntax has been essentially deprecated for a while now. I think one of the most important aspects of SASS syntax is that any valid CSS3 file is a valid SASS file and compiles without error. This can't be true of the indented-syntax, which has two downsides: * It's a huge barrier to entry for anyone new to the framework when they already know CSS. * It makes porting and/or incorporating existing CSS unnecessarily complex. (The same things could be said about HAML, but people generally have no problem writing HTML, while CSS is still a fluid and ever-changing system). The indented-syntax is way nicer to look at, but it's a good thing that it's heading off into the sunset.
- alanh 14y ago“any valid CSS3 file is a valid SASS file” — Clearly you mean .scss. I imagine you’ll fix that in a minute :) I’m also not so sure that this parser can only handle one of the two SASS syntaxes — what gives you that impression?
- ddagradi 14y agoToo late to edit anyways, but we're both right on this one. SCSS is a Sass syntax. ".scss" and ".sass" are both Sass files. Their docs tend to name the languages in titlecase, and the formats in all caps. That surely won't confuse anyone!
- drewyeaton 14y agoThat's false actually. There is a "new" syntax, but the popularity of the language is in many ways due to the terse, easy-to-read original syntax—it's not going away and it's not deprecated.
- binarycrusader 14y agogithub readme for this project points to sass-lang.org; I'm pretty sure that's supposed to be sass-lang.com.
- agentgt 14y agoIts C++ not C. Although I suppose you could refactor it or call it from C.
- pjmlp 14y agoPlease fix the title, it is a C++ implementation. Besides that, going native, great job!
- jvc26 14y agoSlightly bemused by the licensing agreement: > Any contribution to the project are seen as copyright assigned to Hampton Catlin. Your contribution warrants that you have the right to assign copyright on your work. This is to ensure that the project remains free and open -- similar to the Apache Foundation. That seems a little non-standard to me?
- riffraff 14y agonot too uncommon, similar things exist elsewhere http://en.wikipedia.org/wiki/Contributor_License_Agreement http://en.wikipedia.org/wiki/Contributor_License_Agreement
- jvc26 14y agoSlightly bemused by the licensing agreement: > Any contribution to the project are seen as copyright assigned to Hampton Catlin. Your contribution warrants that you have the right to assign copyright on your work. This is to ensure that the project remains free and open -- similar to the Apache Foundation. That seems a little non-standard to me?