An Uneducated View of Checked vs. Unchecked Exceptions - <AUTHOR> http://marcorogers.com/blog/09-27-2009/a-noobs-view-of-checked-vs-unchecked-exceptions <comment><USER2> Exceptions are now a 'way of life' for many different programming environments, the simplistic view is that they allow your program to 'catch' any unforeseen issues at a lower level in a graceful way.

The truth is that the 'handling' is often much less robust than it ought to be, which in turn will lead to the hiding of problems at lower layers.

A simple example would be an I/O error when reading a file, if you 'handle the exception' then you have done absolutely nothing to take care of the underlying problem.

Personally I'm a huge fan of spending the extra time required when writing lower level code to make sure that _all_ cases are handled properly, instead of throwing an exception at the slightest sign of trouble.

A pet example of this is the UTF-8 and unicode conversion library, when presented with an 'undefined' character lots of libraries will cause a whole series of exceptions to be triggered because of a single character issue in some data to be imported.

If such a library were defined 'properly' then you'd tell it what to do with 'bad' input, toss it, replace it with ##undefined character## (or any other string you come up with) or, in case you want it, throw an exception. The defaults should be sensible and should maximize productivity.

That way the user of such a library knows the library will handle the job with a minimum of fuss.

I see exceptions mostly being used as a way to be absolved from further responsibility from an issue, and that's really not the way they should be used.

Run time errors are uniformly bad, exceptions really are a form of runtime error and should be avoided as much as possible. Especially in lower level code.

<comment><USER3> I strongly disagree that exceptions are about catching unforeseen issues at a lower level. Exceptions should almost never be caught. A well-written program will have only a handful of exception handlers that don't repropagate the exception; ideally only one, at the highest level of the event loop or request handler.

As to your string decoder example, the sensible default should be to throw an exception, with an easily available out to replacements etc. as you suggest. String conversion across multiple code pages is an interesting example precisely because data loss is so easy, and if the problems aren't raised early in the data flow, it can be hard to figure out where it went wrong. The "default" manifests itself in Windows programs as '?' - rather annoying to debug when the first time you see it is on the UI, while other concrete are plentiful on the web. A very common example is balanced "smart" quotes, which frequently end up encoded in either the web page or the RSS feed in a different encoding than that described in the HTTP header, or in the meta tag, or according to the relevant standards, etc.

Yes, runtime errors should be avoided, but not by the lower-level code; rather, the lower-level code should throw exceptions when error conditions occur, but have ways and means for programs that care about the exceptional conditions to not throw exceptions. This isn't always possible, though. Consider TFA's example of file not found:

> _The caller can't recover from a file not found error_

The caller can test to see if a file exists before trying to read it, but non- transactional interactions like this with the file system are subject to races; the file might exist one microsecond and be gone the next. But it is also obviously true that the caller _can_ recover from a file not found error. Concrete example: consider a thumbnail generating service, which checks to see if a cached thumbnail file exists before doing the expensive work of creating it if necessary. Here, a file not found exception (perhaps caused by concurrent cleanup of cache, for random operational reasons) is indeed not fatal.

<comment><USER2> > Exceptions should almost never be caught.

That's exactly where the controversy lies.

The string conversion issue was brought up because I think it is an excellent case of 'programmer knows best', but the exception causes the whole dataset to be rejected, not just the one record out of 3.9 million that were fine. That's obviously sub-optimal. There has to be a better way to deal with that sort of thing, such as for instance an 'output' vector where data that couldn't be processed can be sent, or a series of warnings / errors attached to certain offsetts in your data. Then after running the conversion you can decide if you want to drop all of it (which is what happens now) and fix the input data, or discard those records (sometimes that is an option), or manually edit those and then run the import on those few records again.

Because exceptions are a mechanism you can then 'use' them for whatever you feel like. Just like you can use setjmp/longjmp in C for all kinds of creative stuff you can use exceptions to change the dynamic of your program. And this leads to some very difficult to trace code because exceptions break the normal flow.

Almost all exceptions in for instance the python mysql layer need to be handled by your application otherwise you will be exposing the user of your application (or website) to a runtime error and that is not good, not handling those is not really an option (unless you don't like your users much :) ).

So, in production grade software you'll find that almost all possible exceptions are indeed handled, and if possible as close as possible to the location of the error to make sure the fall-out of the problem is minimized.

Generally speaking, the higher up the handler the less information there is about the context of the exception, the smaller the chance you can handle it in a meaningful way.

This style of coding makes it not rare to see half the code to be about exception handling, the other half actual 'productive' code. Especially Java suffers from this very much.

<comment><USER3> For your string example, a callback would probably be the most flexible solution, but I still believe that not signalling corruption when it is found by library code is irresponsible. Batch processing code will have a loop; that's precisely where there _should_ be an exception handler, one that can log that there were errors with this particular record, so that attention can be brought in later. If the data isn't too important, then sure, minor corruption can be ignored, but it would be a terrible default.

Taking your database interaction example, here are the kinds of situations I could see, and responses:

* Failure to connect; this is pretty fatal, unless there's home-spun failover support, it should not be handled at a low level

* Query syntax / API error: this is a programming error, should be logged and the current process (request, whatever) aborted

* Constraint failure: choosing whether to handle constraints on the database side, or on the app server side, or both sides, is an architectural decision with tradeoffs. Ideally constraints should be portable, so that they can be transported all the way to the UI, and checked at every stage along the way. These constraint failures might be signalled through exceptions, but that's a tactical choice, and may not be the best one. Generally, exceptions only signal for the first error, but usually there is more than one constraint, and multiple actionable failed constraints should be propagated to avoid wasting the end user's time (consider the simplistic compiler which halts on first error).

My point is that exceptions should generally either be things you can't reasonably handle, with a non-throwing "out" for situations where you _do_ expect to be able to handle the problem. If you expect to be able to work around the issue, i.e. find a solution locally, low down in the stack, then you probably shouldn't be catching an exception in order to do so, unless that's impossible (like the race condition I mentioned earlier).

<comment><USER2> > My point is that exceptions should generally either be things you can't > reasonably handle

That we completely agree on.

As for that race condition, I think that a situation like that could easily be avoided by having a single task be responsible for maintaining that data structure and to send it messages to update the state atomically.

That way you avoid the race completely.

Race conditions usually are a sign of multiple parties having access to a single resource where you'd be better served having one 'handler' process in charge of the data object that multiple parties want to access. It can then be the arbiter of who has access.

If the changes are a-synchronous then you could use a 'fire and forget' style queuing mechanism where the only thing that matters is that you know the message was received, the more tightly coupled example you gave could be handled reasonably elegant with a client-server model where the server will handle only client at a time for a particular resource.

Data objects not being 'alive' enough is the cause of many race conditions, by assigning a handler you achieve two things in one go, the first is an abstraction of interaction with the data object to a series of messages to a handler, the second the removal of race conditions and their 'normal' solutions (such as locks).

<comment><USER3> The race condition example applied to a pretty global "single resource": the file system; and came from the example in the main article. In situations where you have greater control over the resource, I agree that serialization / independence of operations, whether by transactions, queuing, single arbiter, etc., is better.

</comment></comment></comment></comment></comment></comment><comment><USER4> I make the following observation: Everybody I've seen arguing in favor of checked exceptions in the past couple of years have argued about their theoretical benefits. Everybody who is arguing against them have argued about how they have not worked out in real life.

This pattern seems to recur a lot in programming debates, where people don't seem to realize that it doesn't matter how wonderful your theory is if when you try it out, it's wrong. That's where checked exceptions are.

The time for _theorizing_ about their effects on programs is long, long past. Who cares whether they theoretically force programmers to write better code? We now know that in reality, it actually results in worse programs the majority of the time. When theory and reality disagree, _theory is wrong_. Why anybody still talks about their theoretical design goals is beyond me.

As near as I can tell, the debate is over if you ignore the people who haven't let their theories catch up to reality. If someone's got a success story posted about how checked exceptions saved their program's bum, I'm interested in the link, but I haven't seen one.

(I say it that way because when you have something enough people will read you can always find someone to pop up and claim that "X is good", but I'm specifically asking for arguments that already existed prior to this post, to avoid selection bias effects.)

<comment><USER3> First up: I'm not a fan of checked exceptions.

But on the other hand, I must point out: checked exceptions certainly force you to address the issue of the exception being thrown, and as a result, the failure mode that they prevent can't occur, so the evidence you're seeking is more or less impossible.

On the other hand, checked exceptions have their own failure modes, down to human behaviour: rather than having to rewrite every method declaration on the call graph to throw the appropriate list of exceptions, some bad apples just catch exceptions and do nothing with them. This shuts up the compiler, but harms product quality.

IMO, the theory behind checked exceptions is actually fundamentally mistaken. Exceptions aren't much good if you're constantly trying to catch them. Exceptions work best if you write your code in a transactional style, more or less assuming that an exception can occur at any moment, on any operation. This can be tricky: it can force you to make or keep copies of structures when doing large structural modifications; but this difficulty is not strictly due to exceptions, as failures modes need to be dealt with in any case.

</comment></comment><comment><USER5> As a professional Java programmer, with some experience in various strongly typed languages (MLs, Haskell), I really liked the idea of Checked Exceptions when I first heard about them (and even when I used them in small projects in school). In principle, it seems like a way to allow for stronger static analysis and allows the compiler to make stronger safety guarantees. It also forces programmers to deal with oddball cases - instead of just ignoring them like we are prone to do with magic return values (a la C) or unchecked exceptions.

The problem is it never works. There are two common strategies that I've encountered to deal with 90+% of checked exceptions:

-Most code just bubbles the exceptions up the top layer (i.e., the UI), which clutters up every method signature along the way. The UI then has a big handler that catches all exceptions, and just logs an error and shuts down the program. Even on the off chance that the top-level could do something more productive, the problem is that the stack has been unwound too far and it's too late to fix whatever the problem is.

-The other common approach is to wrap every checked exception inside a custom unchecked exception that is just thrown. This is my preferred solution (at least it doesn't clutter up every method signature), but I have to explicitly convert every checked exception into an unchecked one - which is just a bit of a hassle.

I give Sun some props for trying out on a limb with a really cool sounding idea. But I think most people have realized it doesn't work very well in practice ...

</comment><comment><USER6> Bruce Eclkel's pretty much state the anti-checked-exception camp: <http://www.mindview.net/Etc/Discussions/CheckedExceptions> There are very good comments from both points of view. The blog was written several years ago, so his solution is somewhat dated.

I think checked exceptions are a bad idea for a couple of reasons. First is their most acclaimed benefit: they force you to deal with the exception immediately, even if you have no solution for it. You have to decide whether to catch the exception or add a throws clause, which changes the method signature and breaks it for any users of your method. The the default decision for many programmers is to log the exception and swallow it, intending to come back later. I have had to dig through applications to find sql exceptions that were caught but not dealt with.

The second big problem I find is the poor design of exception classes. It is not uncommon to find a class that throws a half-dozen exceptions. Every time you call a new method you have a new exception to deal with. Either it should have a single exception with different error codes for the different cases, or the exceptions should be subclassed from a master exception.

<comment><USER7> "I think checked exceptions are a bad idea for a couple of reasons. First is their most acclaimed benefit: they force you to deal with the exception immediately, even if you have no solution for it."

The use of the word "immediately" informs your misunderstanding of the purpose of a checked exception.

Checked exceptions are enforced at _compile time_ (thus "checked" exception). There is no such thing as 'temporal immediacy' at compile time (unlike _runtime exceptions_ ). There is potential for spatial immediacy (if we consider the static call stack), but that is not what the compiler cares about. (In other words, you can catch exception Foo at the call site and delegate handling up the call stack by throwing a Bar (cause: Foo)).

A compiler enforced handling of an exception declaration insures that the program handles the exception at some level in the call stack, as apparent to the compiler.

This whole (endless) discussion regarding checked/unchecked very much mirrors the static-typing/dynamic-typing discussion. You can either consider the merits pragmatically, or, you can adopt a dogmatic (religious) point of view that embraces one paradigm and dismisses the other.

<comment><USER3> Programming languages shape the way programmers solve problems. To use your terms, when a compiler forces one to deal with a problem with spatial immediacy (i.e. checked exceptions), and the language uses spatial colocation to represent temporal colocation to a greater or lesser degree (as most imperative languages do), then the programmer is being encouraged, quite strongly, to solve the problem in similar space and by consequence in similar time.

<comment><USER7> You make a very persuasive point, but I have reservation regarding the words "encourage" and "solve".

I would think the fact of the possibility of mapping exceptions (according to some abstraction order mirroring the layering of the overall system) calls for "acknowledge" instead of "solve".

And compilers can help with robustness of programs, but their influence on the robustness of programmers is not immediately evident. So perhaps "suggests" instead of "encourage" for a subset of programmers?

<comment><USER3> The failure modes of software written in C versus memory safe languages, with particular attention to security and buffer overflows, persuades me very strongly that languages (and their implementations, i.e. compilers) do indeed influence the robustness of programmers. What is a programmer other than the programs he writes?

</comment></comment></comment></comment></comment><comment><USER8> IMO almost all of the problems people have in practice with checked exceptions are from poor API design rather than an issue with checked exceptions themselves. The core Java APIs use checked exceptions for too many conditions which are not recoverable - causing a whole bunch of maintenance pain for no benefit. This is understandable considering that Java was the first mainstream language to really exercise the concept.

If used judiciously, I think checked exceptions do have benefits. There are classes of errors that are exceptional but also conceivably recoverable. The fact that they are exceptional means it is important to draw attention to them (they may otherwise be overlooked). The fact that they are recoverable justifies requiring calling code to make a choice - handle or propagate the error. Even in these cases, the code can get messy, but I see that as a fact of life: writing robust code isn't easy.

</comment><comment><USER9> I wrote a blog post a long time ago into a response of a big list someone made of exception handling anti-patterns which (in my opinion) are made possible by checked exceptions.

[http://www.rockstarprogrammer.org/post/2007/jun/09/java- exce...](http://www.rockstarprogrammer.org/post/2007/jun/09/java-exception- antipatterns/)

</comment><comment><USER10> Maybe it would be more useful to declare what types of exceptions method handles. Declaring what types of exceptions methods (throws|receives and not handles) should be optional. The way it is now is too much work and too little gain in typical setups.

<comment><USER6> IIRC that's what C++ does and I recently read that it's mostly ignored. Of course a compiler or IDE could detect what is caught and generate the javadoc equivalent. That would be useful.

</comment></comment><comment><USER11> try{ somecode(); }catch(Exception ex){ // eh this will NEVER happen }

<comment><USER12> Exactly! :-)</comment></comment>


Ask HN: Trademark protection on Google Play - <AUTHOR> When I try to publish an app in the play store using a trademark in the title like "Instagram" it will be rejected on trademark infringement grounds automatically (I think it's automatic).<p>How can I have Google do the same thing when someone uses my registered trademark in their app title? <comment><USER2> Third Bing result for "google play support trademark"

[https://support.google.com/googleplay/android- developer/answ...](https://support.google.com/googleplay/android- developer/answer/1085703?hl=en)

<comment><AUTHOR> Yes, but this requires me to have violations removed after those apps are already in the store instead of Google proactively blocking parties form using my trademark.</comment></comment>


Avoiding Startup Tarpits - <AUTHOR> https://hackernoon.com/its-not-a-feature-problem-avoiding-startup-tarpits-7d5ec4b8c81b?11-17-17 <comment><USER2> It seems I am one of those in the tarpit.

I think the problem for us engineering types is that there is so much bullshit around marketing, that it's offputting to us. That's the case for me at least. If I spend time/money on a feature, I know how long it will take, how much it will cost and when it will be ready. Compared to this, marketing seems like burning money with voodoo rituals.

It doesn't help that marketing efforts are only meaningfully measurable on a larger scale. If you're bootstrapping something yourself, you don't have 12k to spend on marketing this month. You have $300. It's easy to burn that $300 on adwords or facebook ads and get zero signups, with no meaningful data whatsoever.

The usual advice goes: hire a marketing expert. But how do I hire a marketing expert that a) isn't full of it, b) will even listen to me if my current budgets are in the hundreds of dollars?

I think the article is right on point, but I wish it pointed me to a way to deal with the marketing problem.

<comment><AUTHOR> If talking to your clients mostly gets you new feature requests, it either means your product isn't adequate yet or you're not asking the right questions. In a nutshell you want to get of feel of: \- What was going on in your clients' heads before they found you. What precise problem were they trying to solve. This'll give you insights on whether or not your product is adequate, and on how to phrase your landing page.

\- How they went about to look for you. What google search they did, whether they checked out reviews and how, etc. this is to better focus your SEO and adwords campaigns.

\- What their decision process looked like. Was it a single person making the call, or were several people involved? What objections got raised? What were their key decision criteria? Raise them in your sales copy or in drip emails.

\- Are they talking about your product? Would they? This is to help you spot segments with viral potential. Don't forget to politely ask for referrals if applicable.

\- And, of course, feedback on the product itself. But don't spend too much time on this, and don't promise anything or build expectations.

<comment><USER2> The product is adequate, because people are paying for it. It could be better, hence the feature requests.

The most important thing I always want to know is how they found me — unfortunately, for all of them it was via a search for a specific phrase. That doesn't help me at all: I am prominently featured for that search phrase.

No viral potential, this is a niche B2B product.

</comment></comment></comment><comment><USER3> [https://hn.algolia.com/?query=Avoiding%20Startup%20Tarpits%2...](https://hn.algolia.com/?query=Avoiding%20Startup%20Tarpits%20-inertia&sort=byDate&prefix=false&page=0&dateRange=all&type=story)

Original posting, 180+ points:

[https://news.ycombinator.com/item?id=15519190](https://news.ycombinator.com/item?id=15519190)</comment>


Fargo, online outliner and more with Dropbox storage - <AUTHOR> http://fargo.io/ <comment><USER2> I've been using Fargo since it was launched and highly recommend it.

I use it every day for jotting down quick notes, keeping a work journal, as well as planning out larger projects.

There's already an active community of programmers and writers using it to do some pretty interesting things. And the guys behind it are constantly listening to user feedback[1] to build functionality to match how people are _actually_ using the product.

If you're hesitant about connecting to Dropbox, give <http://littleoutliner.com/> a try. It uses the same outliner code as Fargo, but uses your browser's localStorage for the storage mechanism. It's really pretty cool.

If you do decide to give Fargo a try, make sure to open the Community Feed (Docs > Community Feed). If you can't figure something out after going through the very thorough documentation[2][3], feel free to shoot us a question.

[1]: [http://threads2.scripting.com/2013/may/mathewTaughtMeSomethi...](http://threads2.scripting.com/2013/may/mathewTaughtMeSomething)

[2]: <http://smallpicture.com/outlinerHowto.html>

[3]: <http://smallpicture.com/fargoDocs.html>

<comment><USER3> Thanks for the kind words Eric! :-)

</comment></comment><comment><USER4> Those who remember this family of Software might see some similarity ;-) : <http://en.wikipedia.org/wiki/Userland_Software#Frontier> Just look at the article for protocols that they introduced and popularised.

There's lots of other cool stuff under the hood that you probably won't notice at first, like:

\- It's a not just an outliner but it's also a outlined chat/collaboration tool. \- It's not just an outliner but it's also a Javascript programming environment. i.e. you can execute functions that that you write in the outlines. \- It's not just an outliner, it's a front end to your blogging platform.

Also, don't worry about connecting it to Dropbox. It sandboxes all it's activities under the Apps/Fargo folder so won't go crazy with your files.

Already there is a lot to try out and hopefully this will be the new frontier that we have been waiting for.

<comment><USER3> I really appreciate the enthusiasm, as co-founder of the company and one of two developers of the product.

However, you can't at this time edit full JavaScript apps in Fargo, you can run single lines of code using Cmd-/.

We do plan to make it a JS development tool, we use it that way ourselves, but first we want to release the server-side component.

It is today a very good workgroup tool. Here's a doc that explains how to set it up for a workgroup.

<http://smallpicture.com/fargoWorkgroup.html>

Dave

</comment></comment><comment><USER5> I couldn't figure out how to delete an item. Also kept getting "you have 1 synced document" growl notifications on Mac. Other than those issues, this looks to be really useful!

<comment><USER3> Click on the wedge in front of the item to be sure you're in structure mode. Then hit Backspace, or Cmd-X to cut.

This kind of stuff is explained in the Outliner Howto.

<http://smallpicture.com/outlinerHowto.html>

Glad you like it -- it _is_ really useful. ;-)

</comment></comment><comment><USER6> I've been a longtime workflowy user and recently started using Fargo. Here are my likes, dislikes and feature requests.

Likes: \- Dropbox storage \- Calendar outlines as well as free form outlines \- The 'Instant outline' communication model

Dislikes: \- Too much mouse, keyboard interaction due to Fargo's quasi- implementation of the vim like command-mode (structure) and insert (text) mode sans vim-like idempotent 'esc' and 'i' or 'r' toggles. \-- So, Enter in fargo lets one exit out of structure mode by opening a sibling node, (== vim 'o') - The lack of an 'esc' however forces one to use the mouse to get back to structure mode and than keyboard 'del' to remove this empty node. \-- A mouse click on a node in structure mode gets one into insert mode. (== vim i) \- To navigate up/down by keyboard requires one to switch from down arrow to right arrow at an indent. Why can't i just use the down arrow?

Feature requests \- Auto-convert all <http://> entries into <a href= links \- Support hashtags like workflowy \- Allow intra-outline linking \- Allow devs to build plugins / macros so they can customize it to suit their needs. \- Allow for multi-line outline entries (maybe a shift-enter)

</comment><comment><USER7> Would be nice to be able to see the application without linking it to my Dropbox.

<comment><USER3> You can use just the outliner here:

<http://littleoutliner.com/>

That's exactly the same outliner as in Fargo, using localStorage only.

The other consideration is that Fargo only gets access to a sub-folder of your Apps folder in your Dropbox. The folder is created just for the app.

So it's very well sandboxed.

</comment></comment><comment><USER8> Awesome! Just don't really understand why Dropbox storage is so much better than just using Workflowy.

<comment><USER3> Workflowy is an excellent product, but having the outlines in Dropbox means you have copies of the files locally and can share them with other apps that work with OPML, which is a fairly standard file format among outliners.

</comment></comment><comment><USER9> Clunky at best, especially via Smartphone.

No clue why I would use this over Evernote - which has Android, iPhone, Web Browser, and Windows Apps - all pointing to the same dataset in the cloud.

This app keeps forcing me to allow Dropbox.

Might be cool after a few revisions - right now seems like Alpha stage work.

</comment><comment><USER10> FYI, the keyboard shortcuts on <http://littleoutliner.com/> seem to prevent me from using cmd+opt+I or cmd+opt+U when the window has focus. cmd+opt+J works though.

</comment><comment><USER11> fargo is most definitely an interesting web-app, and i can see it being useful for many people...

dave is a little bit over-enthusiastic about it \-- there are literally dozens of writing tools that've been using dropbox for a long time now, to correct just one of his main brag-points -- but it's not a crime to love what you've made.

(nate kontny is similarly proud of his "draft", another writing-oriented web- tool that's newish and attracting a lot of fans with its qualities.)

we'll see what dave's users end up doing with it.

-bowerbird

<comment><USER3> We started a mail list for Dropbox users to find the software you're talking about. Maybe you'll join the list and post some links.

[https://groups.google.com/forum/?fromgroups#!forum/dropbox-u...](https://groups.google.com/forum/?fromgroups#!forum/dropbox- users)

Note I tried not to be enthusiastic about your comment. Didn't work. ;-)

<comment><USER11> you've censored me too many times for me to contribute to any endeavor that you control, dave, so i'd pass on your listserve anyway...

but such a listserve is largely unnecessary. it's easy enough to find such writing-tools, just by googling with the appropriate terms.

(or, if you wanna just go immediately to the most versatile: <https://www.textdropapp.com>; but fair warning, the yearly cost is $32+.)

besides, dropbox support was big _last_year_. this year, something better is now available. i'll leave you to your own devices to find it, dave, and continue to wish you the best of luck, even if i feel you haven't treated me so nicely.

and i certainly won't let your animosity color my view of your software, and the potential it has.

although, to be honest, i think your earlier take \-- that an outlining tool and a writing tool are two different types of tools, and need to retain their separate focus in order to be their best -- was the correct one, and your new hope that you can leverage fargo into a general writing tool is one that will ultimately flop. but hey, that's just my opinion, and i'd love to see your users prove me wrong, and do amazing stuff with fargo.

-bowerbird

<comment><USER3> Nothing changed in my view about the relationship between outlining and general writing tools. Fargo is an almost exact clone of the outliner I created in 1987.

Here's something I wrote recently on the subject.

[http://threads2.scripting.com/2013/april/outlinersAndWordPro...](http://threads2.scripting.com/2013/april/outlinersAndWordProcessors)

I'm doing the best I can, I don't feel any animosity toward you, I don't know where that's coming from.

Peace..

<comment><USER11> dave said:

> Nothing changed in my view about the relationship between outlining and > general writing tools.

> Here's something I wrote recently on the subject.

> > [http://threads2.scripting.com/2013/april/outlinersAndWordPro...](http://threads2.scripting.com/2013/april/outlinersAndWordProcessors)

right. and earlier, in march, you wrote something similar, here:

> > [http://threads2.scripting.com/2013/march/imNotMakingBlogging...](http://threads2.scripting.com/2013/march/imNotMakingBloggingTools)

but since then, you added markdown support, which seems to indicate movement toward writing and editing and publishing, in addition to the outlining.

further, you just recently retracted the march post, here:

> > [http://threads2.scripting.com/2013/may/mathewTaughtMeSomethi...](http://threads2.scripting.com/2013/may/mathewTaughtMeSomething)

and, as i said, i think your earlier take (in march and april) was more accurate, and that an attempt to go broader will cause fargo to lose focus, just as you said in the april piece. but, again, i would love to be proven wrong. because my tool-set attacks the issue from the other direction -- with a focus on the writing and editing and publishing of long-form documents -- and i've decided not to incorporate any outlining capability because i think it would blur that focus. but if your users can show me how to avoid that blurring, i will learn from them. but lacking that, i believe that (early) outlining is best seen as a good complement to (later) editing and publishing, at least for long-form documents.

 __*

> I don't feel any animosity toward you, I don't know where that's coming > from.

well, dave, you probably cannot be expected to keep track of all the people you censor and block.

but you have censored my comments more than once, and blocked me on twitter.

and while i am quite sure that you don't have any _personal_ animosity toward me, since you don't even know me, the acts of censorship and blocking are _not_ friendly ones. from your perspective, you're probably just "protecting" yourself from us "trolls". but i'd guess that you can imagine it looks different from my perspective.

so no, i'm not gonna contribute to a listserve where you can censor my input. i'll stay independent, so i can call you out when you're wrong, and give you credit when you do good.

-bowerbird

<comment><USER3> Blocking isn't something I have to answer to anyone for, it's a feature in Twitter that's useful to help keep down the flamage. I think it's one of their greatest innovations.

A little feedback -- you read a lot of meaning into things that are a lot simpler than you think. For example, the markdown support was added because it was coming up a lot in feature requests from users. It's just that simple. Nothing more to it than that.

I've always used MORE and its descendants to write. I wrote every DaveNet piece in MORE or Frontier or the OPML Editor. I write Scripting News in the OPML Editor. Outliners are good for writing.

Like I said, I don't dislike you, or even know you (as you point out). And it probably doesn't matter if you contribute to the mail list, but I don't see how it could hurt. Whatever.

<comment><USER11> dave said:

> Blocking isn't something I have to answer to anyone for

i wasn't asking you to "answer to" me for your blocking... if you want to ignore people like me who say things that we think you need to hear, go ahead and ignore us, i don't care. heck, that's the reason why so many people ignore _you_, dave.

> I think it's one of their greatest innovations.

i'm sure you do. but ignoring people is not an "innovation".

i was merely telling you why i wouldn't join your listserve, even if i did think it'd be useful. (and, as i said, i don't; i can get more information by simply searching around a bit. and further, the horizon of the cloud has eclipsed dropbox.)

> markdown support was added because it was coming up a lot

um, yes, dave, i quite well understand that it is your users who are moving you toward using fargo as a writing-tool, and that's precisely why i said i hope that they succeed with it, so i can learn from _them_ how to make such a dual focus work.

what you or i _think_ can work doesn't really matter (which is why i'm not interested in your effort to tell me what you think).

what matters is whether people can show me a way to make it work.

> I write Scripting News in the OPML Editor.

and finally, yes, dave, it's certainly possible to use an outliner to write lots and lots and lots and lots of short blog articles.

but that's not long-form writing. a _book_ is long-form writing, one cohesive entity that has an arc from the beginning to the end.

heck, mike cane has used twitter to "write" over 275,000 tweets, but i don't consider _that_ to be "long-form writing" either...

-bowerbird

<comment><USER3> Is this you?

<https://twitter.com/bowerbird>

BTW, the only reason I block people on Twitter is if they tell me to shut up (directly or indirectly) or if they make personal comments.

I've now read several of your rants here, and it doesn't surprise me one bit that I blocked you on Twitter.

You're a very inspired writer, but your inspiration is very very dark! Maybe you should write gothic novels with your fabulous writing tools. ;-)

<comment><USER11> um, no, that's not my account. that's an australian woman.

and i never told you to "shut up", directly or indirectly. plus, when i do use that phrase, it's only in a joking way, because i'm a poet and i believe very deeply in free speech.

also, i don't do "rants" -- my tone is always even-tempered, and i use reason, not emotion -- plus my inspiration is _not_ "dark", let alone "very dark", let alone "very very dark"... i take myself quite lightly, which is why i fly with angels. so no, i won't be writing any gothic novels any time soon. :+)

now, have a nice day.

-bowerbird

p.s. apologies to lurkers, for letting this go so far off-topic.

<comment><USER3> If you had done all that, I wouldn't have blocked you. :-)

<comment><USER11> this dialog has now become too boring for the lurkers \-- they care why you banned me even less than i do -- so i am officially leaving this thread at this time...

but notice that my participation in this thread started with:

> fargo is most definitely an interesting web-app,

> and i can see it being useful for many people...

it seems you can never say enough positive things about dave.

-bowerbird

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER12> This is great! I just love the Dropbox integration. My two suggestions:

\- Keyboard shortcuts for file operations.

\- 3-5 recently used icons accessible on the main interface.

<comment><USER3> Glad you like it! :-)

I've added your suggestion to our list of feature requests.

</comment></comment><comment><USER13> I highly recommend Fargo and its underlying OPML format. It is pretty much the only tab I keep open on my browser all day.

</comment><comment><USER14> I've been following Dave on outliners for a long while. I haven't made the switch from workflowy yet.

Would be nice if tools like subtask.com would layer nicely on outliners. IE the outline from Fargo could be used to create the mindmap or vice versa. Preferably keeping themselves in sync rather than importing/exporting manually.

</comment><comment><USER15> "Fargo is the only idea organizer that runs in the browser, cross-operating system with entirely cloud-based storage."

I'm actually quite fond of another one, Workflowy.

<comment><USER16> I use Workflowy as well, and Fargo didn't feel quite as convenient to me. One thing in particular I noticed was that moving an item to the same level as its parent is easier in Workflowy.

So I'm sticking with Workflowy for now. I just wish it allowed me to add multiline leaf items!

<comment><USER3> Workflowy is great.

In Fargo, if you want to move an item to the same level as its parent there are four ways to do it:

1\. Shift-Tab.

2\. Cmd-L.

3\. Drag it to the left with the mouse.

4\. Choose the Move Left command from the Outliner menu (useful on tablets and phones).

</comment></comment></comment><comment><USER17> way to aggressive - installing before reading? no thx, no matter how useful it could be or not! BAD PRACTICE

<comment><USER3> You can most definitely read about it before installing.

We have two buttons, one takes you to a product backgrounder and the other takes you to Dropbox. No one forces you to go one way or the other.</comment></comment>


Ask HN: Large number of function arguments in Python - <AUTHOR> Hi all,
So I am working on a python application that can take its input as cli args and as a JSON string. The number and type of arguments is the same for both.
I have a function, lets call it _main that is coordinating with other modules that needs all these parameters as input. Currently I am passing ~15 arguments to _main. It looks nasty, and I believe there are better ways to accomplish this.
One way could be to create a request class having @property defined for all these parameters. I can create an object by using parameters from CLI or JSON as required and pass this object to _main.
The downside is that _main is called only at one place. Is it worth the effort to create a class that will be used only once? Or I am better off creating a dict and passing as kwargs this function.
Most but not all of these parameters are needed by other modules that are called by _main. So, the request object created cannot be passed as is to other modules.
What are the best practices around this - to pass large number of arguments to functions?
thanks for taking the time to read this! <comment><USER2> Check out dataclasses[1]. It's in the standard library of Python 3.7 and there's a backport for earlier versions.

[https://docs.python.org/3/library/dataclasses.html](https://docs.python.org/3/library/dataclasses.html)

<comment><AUTHOR> Thanks, will look into it!</comment></comment>


Russian Roulette written in #PHP - <AUTHOR> https://www.codepunker.com/smile/russian-roulette

<comment><USER2> That's semantically correct.. but how do you spin again?</comment>


How the embeddability of Lua impacted its design (2011) - <AUTHOR> http://queue.acm.org/detail.cfm?id=1983083 <comment><USER3> I used Lua 5.2 (with 5.1 compatibility enabled) to embed in a C framework for building and executing data flow graphs. I implemented C .h header to JSON and back, and also an API wrapper generator, which really helped things along. The basic features include: co-operative FSM scheduler (using coroutines for sleep etc), structured FSM Engine, structured data pipes (stucture defined in C headers and piped in binary, but to Lua they look just like Lua tables syntactically), Event generation and propagation mechanism, ability to record and play back data pipe streams, fine grained MIDI parser and generators, and a bunch of other details. The embedding mechanism is generalised, and so there is alongside the Lua scripting a similarly complete FORTH drop in language, for those who might be interested. I think it's a pretty neat system, and works quite well.

The system had some turbulence during its inception in a now defunct very small company, but it all reverted to me. I would like to get it up on Github before I pass on (fairly soon, I fear), but need help fixing all the file headers, and some minor bugfixing. Volunteers? I have a minimal html description file if you'd like. But a build help file is needed.

</comment><comment><USER4> I'm missing the crucial design bits which would influence embeddability:

Do pointers move? How is the GC? How is the FFI? What are the FFI callback limitations?

With FFI callbacks, calling back into Lua functions and using Lua data you need either refcounting or a slow mark & sweep. Or just for FFI accessible data. Of you provide an API for this data to propagate moved pointers back to C.

<comment><USER5> Pointers do not ever 'move'. You also should never store variables (to userdata, memory chunks, strings, etc.) by pointers or anything like that according to documentation because they might be collected at any time. To stuff like tables or values you never ever get a pointer and having a pointer to a "Lua value" would make no sense because it's a small struct with just the type number (in case of nil that's all that matters actually) and then either an inline value (light userdata, bool, number, etc.) or a pointer to the actual GC object (thread, string, table, function, internal data structures, etc.). Lack of exposing internal data structures (there is Buffer in luaL but it's the only one I can think of and it's so simple and just to collect few results together it doesn't matter) is probably the reasons why LuaJIT is ABI and API compatible with Lua 5.1 despite implementing stuff very differently internally (like values in NaN tagged doubles to keep them in a 64 bit boundary instead of just placing fields normally in structs and letting compiler figure it out like stock Lua does).

There is a feature in luaL part of the C API called 'refs' but that's basically storing stuff in a table array and addressing it by ints and it's done all using the C API itself, it's not a VM or language feature.

There is also a weak reference system (where table can be marked to have key, value or both be 'weak' and allow collection if there are no 'strong' references anywhere to these objects) and that is part of the VM itself (GC specifically, the table processing code) and has some caveats with stuff like strings (they are interned in Lua) and it doesn't remove intelligently form tables serving as arrays.

To call a function from C you push it and its arguments onto the stack (of the main thread or the coroutine) and execute it with one of API functions (depending on what you're trying to do)[1], to call it in Lua you 'just' call it or pass it to pcall or a when making a coroutine.

A C function exposed to Lua like that must implement its 'protocol'[2] which is getting and returning arguments by interacting with the lua state pointer so it's an extra effort to wrap them or you can use a third party library (there are some, especially C++ ones which use templates to automatically wrap stuff, but I don't use any myself).

C and Lua functions are indistinguishable in most cases, they are called the same way, etc. but sometimes they differ, i.e. Lua functions can be dumped with string.dump.

There is no FFI (as there is in C#, JNI, etc.) as such. LuaJIT has an FFI that parses C declarations and it's quite nice IMO. There are also third party FFI libs but I know nothing about them. Using that also loses you all the nice to haves that Lua has like multiple return values (it's customary to return false or nil and an error message string on errors from many functions and it's impossible to write an iterator without multiple return values), interacting with lua state in the function, arg type check calls with automatic errors, etc.

The GC is a mark and sweep one, in 5.0 it was a stop the world one - <USER2> color, from 5.1 onwards it's incremental tri color with forward and back write barriers(see [0] for an explanation of what that means and how it works). In 5.2 there was also (off by default) generational one. I have no idea how that one worked and it was removed in 5.3. LuaJIT also uses mark and sweep from 5.1 but with improvements and for 3.0 there was supposed to be a quad color one. You of course have full control over it (stop, start, adjust speed, force a full cycle or a single step, etc.) to complete right now) from Lua and C via the right function. It does nothing fancy like compaction or copying/moving.

You are also responsible for the memory allocation (in 64 bit LuaJIT it's taken over and attempting to do that is an error) and the default alloc is just a malloc wrapper[3]. From 5.2 onwards you also get told during initial (i.e. not the resize) allocation what kind of Lua object is being allocated (it doesn't tell you about internal structures though, only the user visible Lua types) so that might help you make some decisions in the allocator. Lua VM never allocs memory or touches the system on its own in any way either.

If you want you can remove all the standard libs like os, io, etc. and not use any of luaL functions (they all are implemented using Lua C API only so they are 'userspace' and optional, not part of VM, they do not use internals of the VM itself). Even the require mechanism for importing libs is all userspace implemented (unlike like Python where it's part of the language, I think). It's also possible to recompile Lua and change what type the number is (double so 64 bit by default, plus 64 bit int in 5.3, there is convenient macro to force both to 32 bit in 5.3, for LuaJIT I'm not sure, it uses NaN tagging in a double and a handwritten asm to get its speed and compactness and I'm not familiar with its codebase like I am with the vanilla Lua), add a bit of extra space in front of the VM for direct instant access from C (space for 1 pointer by default in 5.3, no space before that) and a bunch of other configurable things. The codebase of PUC-Rio Lua (i.e. not some third party implementation like LuaJIT or Havok Script[4] - which I think they don't even sell but that Google still indexes and they have a testimony on the front page for...) is also easy to jump into if you know C and very small (c.a. 10k lines if you ignore the lexer+parser+compiler part, std libs and standalone lua and luac program sources).

Feel free to ask about anything if I was unclear. I am knee deep in Lua by now and I've even written about Lua internals for my engineer's thesis (in Polish) so I'd say I'm quite up there with my knowledge of its working and history and such compared to average Lua knowing person. I thought about recycling my notes to write an article about that but I don't really see a point because I'd largely be rahashing between source code itself (very readable!) and various resources like no frills intro to vm instructions[5], articles from the three Brazilian devs themselves, mailing lists, details on LuaJIT page, etc. If someone is interested about such an article then you can drop me an email( my email address is visible once you're logged in at [https://github.com/FRex/](https://github.com/FRex/) ) and if I get a few I might do it.

[0] - [http://wiki.luajit.org/New-Garbage- Collector#introduction](http://wiki.luajit.org/New-Garbage- Collector#introduction) [1] - [http://www.lua.org/manual/5.3/manual.html#lua_call](http://www.lua.org/manual/5.3/manual.html#lua_call) [2] - [http://www.lua.org/manual/5.3/manual.html#lua_CFunction](http://www.lua.org/manual/5.3/manual.html#lua_CFunction) [3] - [http://www.lua.org/manual/5.3/manual.html#lua_Allo](http://www.lua.org/manual/5.3/manual.html#lua_Allo) [4] - [https://www.havok.com/wp- content/uploads/Havok_Brochures/Hav...](https://www.havok.com/wp- content/uploads/Havok_Brochures/Havok_Script_2015.pdf) [5] - [http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInst...](http://luaforge.net/docman/83/98/ANoFrillsIntroToLua51VMInstructions.pdf)

<comment><USER6> FYI Lua 5.4 is bringing back a generational collector in a slightly different style.

Also, what is your thesis?

<comment><USER5> I don't really follow the development of Lua in any way.

Lua 5.3 was very underwhelming to me, I didn't care for the ints and bit operators _at all_ (and before 5.3 the one number type was a selling point) and it's annoying how there is such a clear strong split between 5.3 and LuaJIT because it effectively finalized the fork that 5.2 has sort of started. Some things (like Love2D, OpenResty and other performance conscious stuff) stuck with LuaJIT so basically a 5.1 on steroids with few 5.2 features. 5.1 also had the killer feature of incremental GC and came at a nice time and was the main Lua for almost 6 years so it stuck into gamedev a lot (which is where I picked Lua from, my hobbist gamedeving).

I also stick to 5.1 by default in my hobby gamedev to be able to bring in LuaJIT at any time and ignore 5.2 and 5.3 pretty much.

My thesis was about history of Lua a bit (rehashing what's on the main website plus few Roberto's articles pretty much) and then a lot about how stock Lua 5.1 is implemented (most of it is 1:1 transferable to other stock Luas) like how bytecode is executed, how does GC work, what does it mean Lua is register VM and not stack one, how are internal structures laid out, how functions and closures and threads work, etc. It's (official) English title was "Analysis of code of original implementation of Lua 5.1" but it is written in Polish ("Analiza kodu oryginalnej implementacji jezyka Lua 5.1"). I don't think it's available anywhere. That was my engineering (inżynier) thesis which I defended in February and I'm now doing a master thesis but it's purely mathematical CS stuff and not related to Lua at all.

<comment><USER7> As an aside, there's stuff on the lua wiki about sandboxing lua, how would you go about sandboxing lua to limit heap, cpu cycles, and os level api calls? For lua 5.1? For luajit? An example use case would be letting users upload scripts to run in game?

<comment><USER5> I never did that actually and it seems involved, hard and very limiting for what such a script could do.

I dislike talking about touchy high risk stuff like that in general since someone might think what I say is a list of things to do to be 100% secure and get burned.

What it says on [0] is a good start I guess: only textual code input, no bytecode (5.1 has bytecode verification but it was removed in 5.2 because it had flaws and gave false sense of security, there were examples of breaking stuff up with malicious handcrafted bytecode), white listing.

To not allow something (like os or debug libs) to be used just don't include it in the environment for that used supplied function (it does restrict you quite a bit though I guess...).

For memory you could use your own allocator and enforce a limit there (and probably set your own atpanic function in 5.1 and longjmp out of it because you might kill the entire program with the default one when Lua won't be able to alloc the error message itself, in 5.2 and 5.3 it's preallocated in the VM so that won't happen).

To prevent runaway Lua loops you can use the count debug hook and throw a Lua error in it, pcall will get that (just remember to reset it between calls because it doesn't reset to 0 on its own). Preventing runaway C loops is up to making sure you don't expose something that can get stuck. You could also set count to something low or use line debug hook and check the time in it and error out if the code took too long already but it might slow the code down too badly (depends on what you do I guess).

That stuff (mem alloc, debug hooks, panic, environments, etc.) is in the docs.

Long strings can also DoS the hashing algorithm and that might totally kill performance with tables, it's a trivial change to fix that yourself or use one of the patches[1]. It came up on the mailing list too. I'm sure it happens on 5.1, not sure about latest 5.2 and 5.3 right now and I don't have time to look into it.

LuaJIT doesn't also let you set the allocator on 64 bit and has some other issues with out of memory errors[2] (I don't know what they are exactly about). I guess it's out of the question if you're really paranoid (stock Lua 5.1 is also way easier to read, modify and compile IMO). I'm not very familiar with LuaJIT.

[0] - [http://lua-users.org/wiki/SandBoxes](http://lua- users.org/wiki/SandBoxes)

[1] - [http://lua-users.org/wiki/HashDos](http://lua-users.org/wiki/HashDos)

[2] - [http://luajit.org/status.html](http://luajit.org/status.html)</comment></comment></comment></comment></comment></comment>


Heroku Alternatives - <AUTHOR> https://www.quora.com/What-are-some-cheap-alternatives-to-Heroku-that-are-always-on?share=1 <comment><AUTHOR> I find this interesting that people are looking for cheaper alternatives to Heroku and completely agree that Heroku gets expensive fast, especially for hobby sites. But one thing to consider is the value that Heroku provides.

Heroku automates the provisioning and configuring servers, deploying code to those servers, scaling servers, etc. It's more than just cheap hosting.

If you're looking for cheap hosting, there's tons of alternatives out there. If you're looking for cheaper alternatives that provide the same value, the search gets a little tougher, and understandably so.

Edit - <USER2>

</comment><comment><USER3> Finding a replacement for Heroku seems to be on a lot of people's priority lists. Why?

What are the major issues people have with Heroku?

<comment><USER4> [https://www.reactiveops.com/blog/migrating_from_heroku_to_ku...](https://www.reactiveops.com/blog/migrating_from_heroku_to_kubernetes/)

This article gives a good explanation of when/why a company might decide to migrate away from Heroku.

Heroku provides a really great service, but one size fits all only fits for so long.

</comment></comment><comment><USER5> NodeChef is a very good alternative to Heroku for Nodejs apps. [https://www.nodechef.com/](https://www.nodechef.com/)</comment>


'I was stupidly overconfident': a South Korean coronavirus survivor's tale - <AUTHOR> https://www.scmp.com/week-asia/health-environment/article/3075170/i-was-stupidly-overconfident-south-korean-coronavirus <comment><USER2> Here in America what I've observed is that most people are overconfident, or just lazy, with regards to the coronavirus. Even though the epicenter of US outbreaks is here in Seattle, many are going about business as usual - attending dinner parties, going skiing, traveling, or whatever else. It's even worse when I speak to friends in other parts of the country, where there they are exercising no caution whatsoever except when forced to (by businesses closing responsibly or by local governmental action). The mortality rate and R0, along with asymptomatic qualities for many incubating humans, are causing people to not take it seriously even though we have all the information access to know better. I've seen coworkers and friends ridicule others for overreacting only to realize weeks later (when it is probably too late) that this is a very serious situation.

I am not sure what the solution is, or what the problem even is. The easy answer is that most people lack intelligence. Maybe a more generous answer is that most people are bad at evaluating anything beyond the short-term. But my gut tells me this is a cultural and social problem, rather than one cause by a lack of (innate/biological) intellectual capability or access to information. But if complacency can be so ubiquitous then how can a democracy hope to function, knowing the same crowds wield votes? I don't have the answers, just thinking out loud.

<comment><USER3> It's not a matter of intelligence or complacency. Humans are just obligate social animals. Most people _can 't_ voluntarily shut themselves away from the world, in the same way that a depressed person can't be happy or someone with ADHD can't sit down and focus.

</comment></comment><comment><USER4> It's not _that_ stupid to feel overconfident (aka normal) when there are no cases reported in your vicinity. After he got the disease he didn't do anything dumb.

There are 26 known cases in my state. I started self-isolating yesterday. Hopefully that wasn't too confident.

<comment><USER5> In my country of roughly 5.6 million people we now have > 800 cases. Diagnosed, so multiply at least by 10 or 20.

Day before yesterday, colleague handing over company car to me. He gets out, and needing hands for both his bag and the doorhandle he holds the key between his teeth. And is vocally offended when I refuse to accept it dumped into my gloved hand.

30 people use that car. I will not enter it without first rolling down the windows, and I will not touch anything in it without wearing gloves.

Those are the ends of the spectrum.</comment></comment>


Ask HN: Do i really need a css preprocessor? - <AUTHOR> Sass, LESS, most developers use a css preprocessor, but I don´t really see the use in them.<p>Should I still get used to using one for the sake of standards / etiquette? Do most of you find it worth it to use one? <comment><USER2> Having used both SASS and LESS professionally, I'll say that it's easy to end up with an over-engineered mess that's difficult to maintain and reason about.

That said, the tooling around both preprocessors is great, so it shouldn't be a huge burden to set it up. Because they're supersets of standard CSS, I don't see a reason why you wouldn't use one. Use the features you like, ditch the ones you don't.

</comment><comment><USER3> Yes, and no.

Yes they can really help you organize larger projects easily. With variables, you only have to write things once. If you change your "black" from #000 to #1a1a1a, for example, that's one change instead of dozens. Nesting is another useful feature that helps you separate one page/module from another, and keep everything contained. Mixins and functions are super-useful if you find yourself re-writing the same stuff over and over. Also, the preprocesing itself is a great way to "lint" your styles (in a surface-level way). If there's a syntax error, the preprocessor will just fail, exposing an issue that might have gone unnoticed if you were using plain css.

But no, they don't help you write the most efficient CSS. So if performance is your goal, you can probably write better/faster CSS if you target each element manually, rather than letting the preprocessor target based on your nesting.

And no, they don't help you alleviate cross-browser issues; that's what auto- prefixers and shims are for. Those are different tools, also useful.

And no, they don't help you keep your css tiny, that's what a concatenators, minifiers, and utilities like "UnCss" are for. Also great tools, but separate ones.

If you want to get all the benefits you can, your CSS build tool will need to include many different phases. Preprocessing is only one phase; but may be an important one, depending on what you're looking for.

Also,if you want to get started, just rename your .css to .less or .scss instead, and preprocess it. Both less and scss are supersets of css, (so all valid css is also valid less and scss). You can write vanilla css inside a less file with no issues. That way, if the urge strikes you to experiment with the features of the preprocessor, you can do so immediately.

</comment><comment><USER4> That depends: do you use JS frameworks that require a compilation step? If yes, then adding a step in there to compile your SASS or LESS code is easy and has big advantages.

If you're using PHP or Python and don't use a JS framework that requires compilation, then adding in tooling just for a css preprocessor might be more work than it's worth. In that case, it might be more advantageous to use whatever language you're using to generate css the same way you use it to generate html.

<comment><USER5> Afaik most modern PHP or Python frameworks have preprocessing build in as well. (Not always because of js). I see what you are saying tho, if you have a plain PHP application and edit code via FTP, SCSS is a huge step in between.

For every semi modern environment it should be a non issue.

<comment><USER4> That's a good point. PHP and Python run their own server instances these days instead of running in apache or nginx. I miss the simplicity of the old days. :)

</comment></comment></comment><comment><USER6> It depends on the type of work you do. If you are putting together a handful of pages and only plan on spending a few hours writing CSS then probably no need for preprocessor.

On the other hand, if you're a front end developer or you find yourself working on CSS multiple times a week then you should absolutely use a preprocessor.

There are tradeoffs between the two approaches, but preprocessors do save you time so the added complexity can be worth it the more you work on styling.

</comment><comment><USER7> Vanilla CSS is verbose, not DRY, and challenging to navigate and maintain.

You don't NEED a preprocessor. But as you find yourself writing larger CSS codebases or trying to do more sophisticated things with it, you may find yourself wishing for the features you get from a preprocessor.

</comment><comment><USER8> You can get some Sass/LESS benefit using PostCSS with CSSNext plugin. CSSNext will give you ability to use future CSS syntax now. If you want to go further, there is even a PostCSS plugin precss that can replace Sass/LESS. I just use CSSNext + autoprefixer + cssnano.</comment>


India orders anti-trust probe of Google for alleged Android abuse - <AUTHOR> https://www.reuters.com/article/us-google-india-antitrust-exclusive/exclusive-india-orders-anti-trust-probe-of-google-for-alleged-android-abuse-sources-idUSKCN1SG17O <comment><USER2> Indian anti trust mechanisms are weak and ineffective, many government owned companies are themselves indulging in activities which should invite anti trust measures, so I hardly see anything significant coming out of this move.

<comment><USER3> gov owned companies excuse for existing is the acceptance of the benefits to society if such enterprises controls the monopoly.

you don't expect the water and power dept leaving out a neighborhood just so the free enterprise have a chance there, do you?

<comment><USER4> The fact that govt owned/regulated monopolies make sense in some industries does not contradict what the OP says.

A very obvious example in India is the Indian airline industry. As an intern I worked with an investment bank on preparing a pitch for the sale of a private Indian airline, and the entire thing basically hinged on what the government wanted to do with the national airlines (which since then have been merged). The Indian government's recent inability to sell Air India has led them to take action that, at least to an outside observer who did some pretty in depth research, albeit a decade ago, appears to have been driven by reducing competition for the government airline.

</comment></comment></comment><comment><USER5> Recently there was this too (made quite some noise on social networks) : [https://www.androidpolice.com/2019/05/08/kiwi-browser- remove...](https://www.androidpolice.com/2019/05/08/kiwi-browser-removed-from- play-store-due-to-youtube-background-playback/)

Ok, this story is more about Google Play Store but I feel like there is maybe (in my opinion) some conflict and abuse of dominant position here too.

Felt like it was relevant will all the other Google stories in the last days (Nest for ex.)

<comment><USER6> Fuck man, this is ridiculous!

> Chromium-based Kiwi Browser attracted widespread attention last month after > it added support for desktop Chrome extensions. The app recently vanished > from the Play Store, and while some assumed it was due to the browser's new > extension support, it was apparently removed due to its ability to play > YouTube videos in the background — functionality that is supposed to be > reserved for the native YouTube app with a Premium subscription.

Fuck this shit man. As a kid I always wanted to work for Google. And now as a teen I find it hard to believe how they turned on the whole "don't do evil" thing.

It's like a friend put it the last time I was ranting about this:

"Its like funding out your childhood hero was a fraud :/"

<comment><USER7> I am rabidly against Google and people demanding breakup of Facebook, Amazon etc are really forgetting the snake in the grass, Google.

As I said before, everyone loves Google until it stomps them on their face.

People have been permanently banned from everything on Google for their bots stupid algorithm.

Fuck Google and fuck everything they stand for.

</comment></comment></comment><comment><USER8> Just about a decade ago Microsoft faced similar charges for bundling IE with Windows OS. By the time the dust settled on all litigations, the competition was decimated or attenuated to stay in business.

<comment><USER9> Windows isn't open source though.

<comment><USER10> Neither is Android.

AOSP is a very small part of what actually makes Android on the eyes of consumers.

<comment><USER11> Depending on how "what actually makes Android on the eyes of consumers" is defined, it's certainly possible to minimize the role of AOSP.

At the same time, we're getting articles talking about how Microsoft is now an "open source company" because their proprietary operating system can run Linux and some open source apps: [https://arstechnica.com/gadgets/2019/05/microsoft- the-open-s...](https://arstechnica.com/gadgets/2019/05/microsoft-the-open- source-company/)

<comment><USER12> I have to agree with him. I had to fix an app for a Huawei Honor 8x phone the other day. As the phone doesn't have Google Play Services and doesn't offer it in the app store - it's a huge pain using it. Enthusiasts can sometimes hack Google support on to an AOSP edition, but as app developers, we have to support what every day customers can do.

There are so many apps that won't work on it at all since Google has been steadily replacing AOSP services like location with Google Play proprietary versions. If you go to the open version of location services, you'll see there's a huge note at the top that you should really go use Google's version: [https://developer.android.com/guide/topics/location](https://developer.android.com/guide/topics/location)

And any app that requires that, isn't going to work on Android releases that don't have Google's blessing like Huawei.

<comment><USER11> The point regarding Play Services is valid, and if the parent comment had focused on that I would not have objected. But that doesn't mean AOSP is a "very small part" of Android or that it isn't open source.

The flip-side of your experience is that it highlights the existence of a large number of Android devices based on AOSP that don't run Google apps, particularly in the PRC. Aside from the Chinese market, you have a major company like Amazon selling millions of devices with their own AOSP fork on them. On an individual level, I can install Lineage OS on my unlocked devices and use apps from F-Droid as well as many others.

Play Services does have a significant foothold in many users' experiences, which bears discussion, but it doesn't invalidate AOSP. It is Android's open source nature that allows for forks and for apps to be shared across the Android ecosystem much more readily than programs developed for an actual proprietary operating system such as Windows.

<comment><USER10> Apps have been shared across PC-DOS, MS-DOS, DR-DOS, and several Windows variants, exactly the same was as Android for the last 30 years.

<comment><USER11> Really, DOS? And new versions of Microsoft Windows? That's not even remotely comparable to the situation with open source Android forks.

<comment><USER10> Yes, really.

<comment><USER11> And "Windows variants"? Comparing Windows backwards compatibility to the ability to run Android apps across different Android forks misses the point. All versions of Windows are proprietary operating systems owned by the same company: Microsoft. Amazon Fire OS, Lineage OS, and other Android forks are not.

<comment><USER10> Yes, Windows variants as well.

Microsoft does license Windows to the same OEMs that are having fun with Android, which just like on Android are allowed to do a certain level of customisations.

Windows is not only what comes with a PC.

The only big difference is that AOSP costs zero dollars, euro, yen,.....

<comment><USER11> The difference is that it's free and open source. ROMs such as Lineage OS do not need to pay for a commercial license to fork the code, and an app such as F-Droid can run natively on any Android device.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER13> The irony is strong with this one considering a lot of Government apps do not work without Google Play Services. Including incredibly popular payment apps like BHIM which was developed by NPCI (National Payments Corporation of India). I know cos I have a phone without Play Services and using Government apps is out of question. Thankfully, there are web alternatives for all servuces

<comment><USER14> NPCI, contrary to what the name seems to imply, is not a government company or organization. It's a consortium of government and private banks (including the likes of foreign banks like Citibank and HSBC). Its payment services are allowed by the RBI. Neither is the BHIM app a government app. It's an NPCI app.

<comment><USER13> Ah, seems that you are right. The government doesn't own it, but sure does seem to have a controlling stake through the Public Sector Banks.

</comment></comment></comment><comment><USER15> CCI, the government body in question, was formed about a decade ago. It already has couple of run-ins with Google:

1\. They fined Google INR 1 Crore in 2014 for refusal to provide information relating to a "search bias" case 2\. Later, on the same case Alphabet was fined INR 135.86 crores

</comment><comment><USER16> death by dozen cuts. If major countries keep fining and forcing them to change behavior eventually it will hurt

<comment><USER17> Countries probably need Android more than Android needs countries.

How would India like to have a choice between iOS & BlackBerry? Android losing India as a market would suck a bit for Android, but life would go on.

<comment><USER18> There is a little country called China that has plenty of "Android" phones that have no Google services.

</comment></comment></comment><comment><USER19> Isn't it election time in India?

<comment><USER20> Majority Indians don't give a shit about this or understand it enough to influence elections.

</comment></comment><comment><USER21> Make it "punishable by up to 5% of _global_ turnover over last three years" (kinda similar to GDPR) and stand back and see how quickly Google (I'm looking at you too Facebook, and Amazon) will change their shit show. India is at a position of strength wrt Google, Amazon, and Fb to easily force them to play nice. Now if only they realized it.

<comment><USER22> it's india, i doubt anything will happen besides some combination of judge/businessman/politician getting their hands nice and greased up. only reason they even care is because the EU got google to cough up already, they're in it for their pound of flesh.

<comment><USER23> I will disagree with you here. Cases which are in the public eye are settled without the things you mentioned. There are Indian government institutions which are honest. Financial regulator and watchdog SEBI is one such institution. I have worked in the financial services industry are we were scared of SEBI. Competition Commission of India is also nonpartisan and has never been in a corruption scandal as far as I know.

</comment></comment></comment><comment><USER14> Digital literacy is very poor in India. Most people in India wouldn't understand what a browser choice actually means, even if Google is forced to provide it. I'm sure Google would also frame the browser choice with dark patterns to make Chrome the default, so that it can continue earning money from ads since Chrome doesn't support extensions on Android (thwarting ad blocking).

Since this probe may take a year or longer (things usually take longer in India), the impact on Google would be very less. Google could figure out ways to appease the CCI without sacrificing much.

<comment><USER6> > Digital literacy is very poor in India.

You're very wrong here. Source: am Indian.

Edit: I think that you're an Indian too, from a previous comment. I don't know what age bracket you're in or what demographics you're exposed to, but digital literacy is not poor here at all, and is rapidly on the rise.

<comment><USER14> Your qualification of being Indian isn't enough (if it were, then this would be a tie). Knowing how to open Facebook or YouTube isn't digital literacy (though it can be considered as a very basic thing). Many poorer people struggle with this fact.

Maybe your education, social/economic standing and your circle of friends/coworkers hides others in the society and their hardships.

Digital literacy may be on the rise, but even "basic" things like transferring money from one bank account to another is out of the reach of many people. How many understand basic security principles and follow them? As I pointed out, what percentage even knows what a browser is and what alternatives exist?</comment></comment></comment>


The Future of Travel – How the industry will change after the pandemic - <AUTHOR> https://www.nytimes.com/interactive/2020/05/06/travel/coronavirus-travel-questions.html <comment><AUTHOR> Road trips, camper rentals.

Cruise ships as permanently docked floating hotels.

Rigorous hotel cleaning protocols.

</comment><comment><USER2> I doubt that the travel industry, or most industries will change.

This pandemic will end. Things will go back to 'normal'.

We've been through pandemics again and again through our species' history, most of them much more serious than this one. Things go back to normal.

What may happen is that existing trends may be given a boost (e.g. remote working, online retail/business), but that's not a 'change'.

<comment><AUTHOR> I liked my 'normal', took risks and worked hard over decades to create it. _sigh_

.

 _Why it will be so hard to return to 'normal'_ , BBC Future [https://www.bbc.com/future/article/20200424-why-it-will- be-s...](https://www.bbc.com/future/article/20200424-why-it-will-be-so-hard- to-return-to-normal)

 _Listen: We Can't Go Back to Normal_ , The Atlantic [https://www.theatlantic.com/health/archive/2020/04/world- aft...](https://www.theatlantic.com/health/archive/2020/04/world-after- coronavirus-pandemic/609775/)

 _We're not going back to normal_ , MIT Technology Review [https://www.technologyreview.com/2020/03/17/905264/coronavir...](https://www.technologyreview.com/2020/03/17/905264/coronavirus- pandemic-social-distancing-18-months/)

 _We're Not Going Back to Normal, but What Can We Go Back To?_ , New York Times [https://www.nytimes.com/2020/04/14/opinion/economy- unemploym...](https://www.nytimes.com/2020/04/14/opinion/economy-unemployment- covid.html)

 _We can do better than go back to 'normal'_ , Chicago Sun-Times [https://chicago.suntimes.com/2020/4/15/21222419/pandemic- nor...](https://chicago.suntimes.com/2020/4/15/21222419/pandemic-normal- covid-19-sun-times-letters-trump-stimulus-checks-coronavirus-homelessness)

 _Do we really want things to go back to normal post-Covid-19?_ , The Irish Times [https://www.irishtimes.com/opinion/do-we-really-want- things-...](https://www.irishtimes.com/opinion/do-we-really-want-things-to-go- back-to-normal-post-covid-19-1.4250554)

 _All the things COVID-19 will change forever, according to 30 top experts_ , Fast Company [https://www.fastcompany.com/90486053/all-the-things- covid-19...](https://www.fastcompany.com/90486053/all-the-things- covid-19-will-change-forever-according-to-30-top-experts)

 _Bill Gates Says the Coronavirus Will Change Life Forever_ , Inc.com [https://www.inc.com/justin-bariso/bill-gates-says- coronaviru...](https://www.inc.com/justin-bariso/bill-gates-says-coronavirus- will-change-life-forever-heres-how-to-adapt.html)

 _Just 9% want things to 'go back to normal' after coronavirus lockdown, says poll_, The Mirror [https://www.mirror.co.uk/news/politics/just-9-want-things- go...](https://www.mirror.co.uk/news/politics/just-9-want-things-go-21877899)

<comment><USER2> When people are in the middle of a crisis they overestimate the impact.

For example, as it happened 9/11 was NOT the end of skyscrapers...

This pandemic is not a very virulent one, we've seen worse no later than the 20th century. We'll be fine.

<comment><AUTHOR> I hope you're right. I'll try to check back in here in a couple of weeks when we see how the unlock is going.</comment></comment></comment></comment>


The World's 50 Most Valuable Sports Teams 2019 - <AUTHOR> https://www.forbes.com/sites/kurtbadenhausen/2019/07/22/the-worlds-50-most-valuable-sports-teams-2019/#611d2f0b283d <comment><USER2> >> 6 | Manchester United (Soccer), Value: $3.81 billion 1-Year % Change: -8% ,Owners: Glazer family, Operating Income: $238 million

Nice to See Manchester United dropping points, time for Glazers to fix the club (or leave)</comment>


10 Clojure One Liners - <AUTHOR> http://freegeek.in/blog/2011/06/10-clojure-one-liners/

<comment><USER2> Some of the examples need the require statement to work correctly. E.g. example 4 should be

      (require 'clojure.contrib.io)
      (def file-text (slurp "data.txt")) ; Reads the whole file
      (def file-lines (clojure.contrib.io/read-lines "data.txt")) ; Reads as a sequence of lines</comment>


Let's try and break my basic Node.js concurrent app - <AUTHOR> I build a NodeJS app that uses worker_threads for concurrency. Ultimately, I want to create an app that keeps track of all the online clients on a WebRTC network that I'll build.
What I want to see is how many clients can it keep track of at the same time. It identifies clients via their IP (which can be masked). It would be awesome if you could help me find its limits by doing the following:
1. Open 4-5 chrome tabs and navigate to https://clientcounter.herokuapp.com/total in all of them.
2. Open the console and paste the following code:
setInterval(()=>{fetch("https://clientcounter.herokuapp.com/subscribe",{method:"get",headers:{"x-forwarded-for":Math.random().toString(36).replace(/[^a-z]+/g,"")}}).then(e=>e.json()).then(console.log)},50);
3. Let it run for quite some time.
4. Tell your friends :)
The github repo (in case anyone is curious or would like to help) is: https://github.com/christosmaris/clientcounter
Thanks a lot in advance :D <comment><USER2> Interesting, I think you'd get more participants if you made it an actual website.

Instead of having to open the devtools and manually paste in the script, why not just have a script on a HTML page?

</comment><comment><USER3> If you're trying to load test then why not use a load testing tool like Vegeta or k6? You can use a list of ip addresses and have it set a special header with an IP address. Then your app could use the ip address in the header to keep track of clients.

You probably get better and faster results.</comment>


Show HN: Statuspage – A Lumen package for monitoring a Laravel or Lumen app - <AUTHOR> https://github.com/code-orange/statuspage <comment><AUTHOR> Hi HN, I built Statuspage because I wanted to make a status page for our Odyssey product[1]. The goal was to keep as much of the functionality of performing status checks and rendering a status page within the package as possible, while allowing for maximum flexibility in writing custom status checks for your specific application.

I'd be very happy to accept pull requests with new status checks!

[1]: [https://status.odysseyattribution.co/](https://status.odysseyattribution.co/)</comment>


Please review my startup - Savendar.com - use password "forum" - <AUTHOR> http://www.savendar.com The purpose of Savendar is to provide a place for people to find and share information about sales and promotions online. It's free for any user to post a sale, or leave comments. The difference between this site and existing competition is both the calendar view (savendar = savings calendar) and the description length limit (140 characters) making it easy to quickly browse the offers. Savendar is trying to build a community around this concept.
Obviously because it's still in beta there isn't an enormous catalog of offers, but enough to get an idea how it works.
This is a "loose" private beta. I don't want the whole world to see the site yet, but it's not locked down. You can access it directly here:
http://savendar.com/ui <comment><AUTHOR> The purpose of Savendar is to provide a place for people to find and share information about sales and promotions online. It's free for any user to post a sale, or leave comments. The difference between this site and existing competition is both the calendar view (savendar = savings calendar) and the description length limit (140 characters) making it easy to quickly browse the offers. Savendar is trying to build a community around this concept.

Obviously because it's still in beta there isn't an enormous catalog of offers, but enough to get an idea how it works.

This is a "loose" private beta. I don't want the whole world to see the site yet, but it's not locked down. You can access it directly here:

<http://savendar.com/ui>

<comment><AUTHOR> Also it currently only supports US and Canadian cities, but if the idea is well received it's a simple matter to add more countries and eventually languages...

</comment></comment><comment><USER2> I think a good idea, would be to scrape sites like fatwallet, slickdeals, and others for content. The sad thing is I don't think the calendar view is enough to attract this type of community. Any other differentiators ?

<comment><AUTHOR> Yes, if you can't find something you're looking for, you can make a request. The requests are short and sweet, 140 characters, and you can join groups to make sure only people who are interested in the same topics view the requests and respond.

The whole concept is about speed. I want to make it quick and easy to find what you're looking for. Many of the other sites force you to browse through dozens of pages and scroll for hours and read an enormous amount of text to find anything. Savendar is the exact opposite.</comment></comment>


Ask HN: How a phone can be more powerfull than a full size laptop? - <AUTHOR> As you may have seen, Fortnite will run at 60 fps on the latest Honor View 20 at a resolution of 1080 x 2310 with passive cooling and 0 noise (the game also runs at stable 30 fps+ on last year now 300 usd phones).(1)
Meanwhile, on the latest intel CPU (with integrated so called HD graphics GPU) at a resolution of 1280 x 720, the game performs at between 30 and 50 fps with considerable amount of noise and heat.(2)
So, my question is: how a 600 usd phone (300 usd in a year or so) can outperform by that much a 1,000 usd + laptop? It just beats me...
Are Intel/AMD chips that bad? Are Huawei/Qualcomm chips that good?
1. https://www.soyacincau.com/2019/01/23/honor-view-20-fortnite-60-fps/ 2. https://www.laptopmag.com/articles/play-fortnite-intel-hd-graphics <comment><USER2> From my understanding, post processing is completely different, like anti aliasing used, HDR pipeline used, shaders overall used, etc. [1] goes into detail what exactly might differ.

It's not like mobile phone is superior by any means to PC. One can compare TDP and figure out difference in raw performance. Is more that rendering techniques that give "diminishing returns" (in some peoples opinion) are exponentially more resource heavy, for example lightmaps (almost free even on mobiles) vs dynamic shadows (can be insanely expensive).

\- [1] [https://docs.unrealengine.com/en- us/Platforms/Mobile/Perform...](https://docs.unrealengine.com/en- us/Platforms/Mobile/Performance)

</comment><comment><USER3> The game is using lower resolution textures on the phone and probably a lot of stuff turned down beyond the settings available in the desktop version

Edit: The version running on the phone is basically incredibly optimized

<comment><AUTHOR> Might be the start of an explanation. It does looks pretty close to me, though: [https://www.youtube.com/watch?v=6xRAlPAhHtI](https://www.youtube.com/watch?v=6xRAlPAhHtI)

<comment><USER4> I took a screenshot from this video.

[https://i.imgur.com/z5Tm5zs.jpg](https://i.imgur.com/z5Tm5zs.jpg) \-- compare the quality of render marked with blue rectangles. Especially hand.

<comment><AUTHOR> Indeed a big difference. I would gladly accept this kind of graphics for 60 fps on a low end laptop, too bad it's not an option.

</comment></comment></comment></comment><comment><USER5> The same reason PlayStation and XBox can provide better graphics than a monster PC, despite having modest specs: When you are targeting a single model of CPU/GPU, you can do all sorts of optimizations.

<comment><USER6> This is so incorrect it physically hurt to read.

<comment><USER7> I would love to get the details on your comment.

<comment><USER6> A "monster" pc has raw processing power that consoles are not even close to. Whilst console games are optimised for targeted hardware, optimisation often means a reduction in certain graphical elements to allow the game to run smoothly. You can't run a console game on the same graphical quality that a monster pc could.

</comment></comment></comment></comment><comment><USER8> They have lots more development dollars thrown at them, basically. And they don't have too much cruft to haul around. Yet.

<comment><USER9> Development dollars correlate poorly with progress. It helps, but even an order of magnitude difference brings little extra gain.</comment></comment>


The Evolution of Computer Science [Infographic] - <AUTHOR> https://www.computersciencezone.org/evolution-of-computer-science-infographic/ <comment><AUTHOR> Great visual. The one thing missing (for me) is VisiCalc - which, at the time, broadened the utility of desktop computers.</comment>


GINN: Geometric Illustrations for Neural Networks - <AUTHOR> http://www.bayeswatch.com/2018/09/17/GINN/ <comment><AUTHOR> paper: [https://arxiv.org/abs/1810.01860](https://arxiv.org/abs/1810.01860)

</comment><comment><USER2> I think this is a thinly veiled Hendrick's Gin advertisement... /s</comment>


Flow: A Responsive Grid System & Generator - <AUTHOR> http://flow.gs

<comment><AUTHOR> I recently built this grid generator. The original iteration used percent based margins to create the gutters. However, I decided that I preferred fixed width gutters. Originally I used padding to set the gutter size. However, if the grid is to extend to the edge of its container, the first column element needs padding:0. This caused it to be slightly larger than the other columns as box-sizing needed to be set to border-box. So I opted to build the gutters using an invisible border-left to create the gutters. Then the grid container gets a negative left margin equal to the gutter size allowing the first and last columns to be flush with the edge of the container while remaining equally sized. This seems to have solved all my problems, however the system needs some cross-browser testing. Any feedback and bug reports will be very helpful for refining the code.

</comment><comment><USER2> Really neat demo, I like it. However, after switching to Bourbon Neat ([http://neat.bourbon.io](http://neat.bourbon.io)) and also checking out Susy ([http://susy.oddbird.net](http://susy.oddbird.net)) I don't think I'd ever switch back to a class based grid. Even the "semantic" grid options of Bootstrap 3 and Foundation 4 are naive by comparison.

The pre-processor mixins in Neat and Susy actually have the flexibility to create complex layouts. Nothing else really seems to be a good substitute.

<comment><AUTHOR> I've been looking at some of the SASS grid systems and I agree that they seem significantly more powerful than the humble CSS grid. Perhaps that will be an evolution (or add-on) of Flow down the road.</comment></comment>


A novel data-compression technique for faster computer programs - <AUTHOR> https://techxplore.com/news/2019-04-data-compression-technique-faster.html <comment><USER2> Interesting paper. The original concept is at [http://people.csail.mit.edu/sanchez/papers/2018.hotpads.micr...](http://people.csail.mit.edu/sanchez/papers/2018.hotpads.micro.pdf), and the follow up paper the article is written about is [https://people.csail.mit.edu/poantsai/papers/2019.zippads.as...](https://people.csail.mit.edu/poantsai/papers/2019.zippads.asplos.pdf).

Afaict the gist of the hotpads paper is this:

Dump the existing way we organize processor caching, instead make it look like generational gc where objects can move between different caches, and pointers can be re-written to point to the new cache level that the pointee is in.

<comment><USER3> I don't know if I understood it correctly, that their tested implementation depends on the circuits that operate faster than the cores:

"We have written the RTL for these circuits and synthesized them at 45nm using yosys [55] and the FreePDK45 standard cell library [23]. The compression circuit requires an area equivalent to 810 NAND2 gates at a 2.8 GHz frequency. The decompression circuit requires an area equivalent to 592 NAND2 gates at a 3.4 GHz frequency. These frequencies are much higher than typical uncore frequencies (1-2 GHz), and a more recent fabrication process would yield faster circuits."

<comment><USER4> Cores are usually capable of more than 3.4GHz, and only run slower for power reasons. So a tiny circuit at that speed wouldn't be a problem.

But they didn't give enough information to say how much headroom there is, with no details about how shallow/deep the circuit is or voltage or...

<comment><USER3> > and only run slower for power reasons.

And if there weren't power limitations we'd already have cores using even more GHz. So a solution which depends too much on having something running faster could be not too relevant to be even used in practice. That's why I pointed to that assumption, which is I think something which has to be understood before the solution can be considered usable.

<comment><USER4> 600/1400 gates is _so small_. If that gave even a .01% boost it would be worth the energy. It's basically zero in the total power budget, even at a high clock.

</comment></comment></comment></comment></comment><comment><USER5> Rob Matheson writes for MIT's Technology Review, which has a reputation for massively over-hyping anything done by MIT researchers. Just take the performance claims with a grain of salt until someone who doesn't work for MIT writes about it.

</comment><comment><USER6> This was interesting to read. It seems like a sophisticated, hardware-enabled generational GC on top of a managed heap.

It reminds me somewhat of an optimization that my colleague Brian Hackett implemented on the Spidermonkey JS engine, which would use runtime-type- tracking infrastructure to discover objects that had specialized constituents (i.e. a slot was always a boolean, and had never not been a boolean).

The system would notice this and then transition the object to a new layout with non-value-boxed entries where appropriate. Of course this included de- optimizations hooks to allow objects to transition back to the general "boxed" layout if mutations to the object de-specialized the slot.

This technique delivered some significant performance improvements when it came to computationally heavy, type-stable code (such as what we find in the Octane benchmarks). It wasn't as effective on type-unstable code.

I'd expect that for most traditional standalone programs written in a statically typed, managed language (e.g. Java) - this sort of approach has a lot of promise.

</comment><comment><USER7> Paper: [https://people.csail.mit.edu/poantsai/papers/2019.zippads.as...](https://people.csail.mit.edu/poantsai/papers/2019.zippads.asplos.pdf)

Seems this cannot be read without first understanding "object based memory hierarchies", which is new to me. This coauthor's page has a ton of related papers: [http://people.csail.mit.edu/poantsai/](http://people.csail.mit.edu/poantsai/)

</comment><comment><USER8> This reminds me of "RAM Doubler" from the mid 90s on 68030/40 Macs. [https://tidbits.com/1996/10/28/ram- doubler-2/](https://tidbits.com/1996/10/28/ram-doubler-2/)

I do remember the joy have doubling 16MB of RAM to 32MB.

<comment><USER9> yes!

And that scene from Johnny Mnemonic was priceless for me:

[https://www.youtube.com/watch?v=ftzx_EdLV_s](https://www.youtube.com/watch?v=ftzx_EdLV_s)

</comment></comment><comment> Digit-Al What happens if you're using a functional language?</comment>