A Crisis at the Edge of Physics - <AUTHOR> http://www.nytimes.com/2015/06/07/opinion/a-crisis-at-the-edge-of-physics.html <comment><USER3> What this article fails to take into account is the underlying politics at play here. You might think of all places, that science would be "politics free" but it's not. Far, _far_ from it.

For example, people working on string theory and people working on say, quantum loop gravity are somewhat at odds with one another. String theory may not see the QLG people as a direct threat but the QLG people _certainly_ sees string theory as competition. Now you may wonder, "In competition for what?" and the answer to that is a bit more obvious: Funding (money for research and their very own paychecks) and attention from their peers/media/press/etc. These people's very livelihoods are at stake.

If QLG was proven wrong tomorrow, it's not like the people who were doing that for the last 15 years can just jump into another field. There's plenty of incentive for "hostile science" as I like to call it. There have been some well-known physicists who have written entire books bashing their competition for this purpose (See: Peter Woit's "Not Even Wrong", which incidentally, is chuck full of so many inaccuracies someone else wrote a book disputing his book...)

So when I see articles like these, I like to check out who the author is. Do they have a reason to write this piece? In this case, it's Adam Frank and Marcelo Gleiser. Both are coincidentally astrophysicists at very respected universities. I wonder what they're working on?

It appears Marcelo Gleiser, one of the authors, just published an anti-String theory book which claims that "We don't need a Theory of Everything".

<comment><USER4> Yes, but it's possible that the points they raised were the reason they took that side of the debate. I don't think it's really useful to question people's motives, rather than just considering their arguments.

<comment><USER5> You can easily hide bias behind good arguments. Attention to motive is how you discover this bias. Humans are notoriously awful at dealing with bias, and you're suggesting that people remove one of the only tools they have against it?

<comment><USER4> It's often very difficult to determine another person's actual motives are. In this particular case, there's no way to know whether someone takes a side because of their bias, or has a bias because their honest opinion led them to invest a personal stake in it.

If the arguments are actually good, it doesn't matter what motivated a person to make them. Casting aspersions on motive is just a cheap way people avoid dealing with good arguments they don't like, perhaps because of subtle biases of their own.

</comment></comment></comment></comment><comment><USER6> The article fails to clearly distinguish two issues: what we take to be true, and what we choose to work on for the moment.

We need evidence backing up what we take to be true.

But we can and must be able to work on ideas without evidence for their truth. We must be given time to flash them out, to try and find ways to get evidence for them.

Wanting to pursue a possible explanation is not the same as believing that it's true.

<comment><USER7> Exactly.

Many of the people who work on string theory obviously believe it to be true in one way or another; it's hard to stay motivated otherwise. But the rest of the world need not care whether it is true or not. For the time being, it's just one untested hypothesis among many.

It can take years (or even decades) for a theory to grow to the point where it can produce testable hypotheses, and more decades (sometimes even centuries) to test those hypotheses. This is especially true for theories that deal with extreme scales of space and/or time, such as cosmology, geology, paleontology, and (at the other extreme) anything that deals with subatomic particles.

Gravitational waves [1], for example, have been predicted for almost a century now, but we still don't seem to know how to build a machine to detect them.

The last time this topic came up, I wrote a response titled "Why so impatient?" I'll leave the link below [2] in case anyone is interested.

[1] [https://en.wikipedia.org/wiki/Gravitational_wave](https://en.wikipedia.org/wiki/Gravitational_wave)

[2] [https://www.kijinsung.com/post/why-so- impatient](https://www.kijinsung.com/post/why-so-impatient)

<comment><USER8> Really liked your article =)

Long term thinking is really hard to do these days.

I'm 36 and my generation seems to take for granted that everything evolves at the same pace as most 20th century technologies have done so far.

This seems to be compounded by the prevalent market driven logic that prioritizes short term profit above all.

Putting these things in their correct historic timescale is very insight-full.

thank you =)

</comment></comment></comment><comment><USER9> This is mostly a problem with string theory. Here's a popular version of a critique.[1] Smolin's 2006 "The trouble with physics" is a book-length critique of it. Peter Woit' s "Not Even Wrong: The Failure of String Theory & the Continuing Challenge to Unify the Laws of Physics" is even more critical.

It's been a decade since that, and the experimental evidence for string theory remains nonexistent. As Fred Hoyle once wrote, "Science is prediction, not explanation". A theory with no experimental support cannot lead to usable technology, either.

Fundamental physics is currently stuck. There's a lot of denial about this. There's a whole generation of string theory faculty in senior positions. That's the problem.

[1] [http://www.theguardian.com/science/2006/oct/08/research.high...](http://www.theguardian.com/science/2006/oct/08/research.highereducation)

<comment><USER10> I know someone with a PhD in string theory. He eventually left the field - <USER2> just because it was (as he put it) "mostly bullshit", but because the popularity of the field was based on distortingly aggressive academic PR and self-promotion by rather too many researchers in the string theory community.

The other problem for physics is that so much of the talent works on Wall St doing things that are - for all practical purposes - useless, if not counterproductive.

So physics is stuck for two reasons, and won't start moving again until the culture changes enough to fix both problems.

Given the declining (political) value of long-term theoretical research in academia, and the relative impossibility of doing an original PhD exploring ideas outside the mainstream, I'm not expecting change any time soon.

This is beyond tragedy, because in terms of medium-term human survival, _nothing_ is more important than new science.

</comment></comment><comment><USER11> This article strikes me as having lost its focus in editing somehow.

One can hardly blame theoretical physicists for exploring above and beyond what the experimentalists are doing. It's not like there's a large body of more practical, down-to-earth problems being ignored in favor of these sexier, Nobel-bait questions.

I believe the point is that we are in trouble if something exciting doesn't happen at LHC; in this case, getting the _planet_ to fund an O($1T) accelerator to probe higher energy levels seems far-fetched. Theorists know this. This is a closely related point to the comment about the politics of theory.

I don't know that this automatically spells crisis. There are plenty of problems out there that require the mathematical talent of folks that can perform at this level. Eventually, when more data is available, the pendulum will swing back towards interesting theory.

After all, it's not the case that if there isn't some rush to a GUT before 2020, the human race loses.

<comment><USER12> Modern physics currently cannot explain what most of the universe is made of, as in the dark matter problem. While not exactly "down to earth" this would seem like a very pressing problem to me, that may be in need of more attention.

<comment><USER11> While I am as convinced as you about the urgency of these issues _in the context of physics itself_ , a crisis it is not. Not for physicists and certainly not for civilians.

<comment><USER13> You say that now, but when your sailboat gets eaten by a dark matter kraken you will sing a different song.

</comment></comment></comment></comment><comment><USER14> This is very frustrating for those of us that see the rather large problem in front of us - our apparent total inability to move around the stars, and only feeble ability to move around our solar system. This caps the lifespan of humanity (and most of the life we know) at about 500k years at best. So, even if we succeed wildly at our environmental and social problems, we'll end up with a single beautiful world getting smashed to bits by a meteor, gamma burst, or other uncontrollable, unavoidable cosmic event.

Physicists need to get their heads out of their political/philosophical asses and start earning their bread - which is nothing less than to justify our technological existence by discovering the knowledge that will help our species live longer. If not for this, I think we'd all be better off living on a planet of 200M people living in rural villages, leading simple lives that are as happy and fair and erudite as fate and culture allows.

<comment><USER15> Plenty of us are working on nuclear fusion, but funding keeps getting cut year after year. It's simply not as sexy and doesn't get as much attention as the cosmological kinds of questions.

</comment></comment><comment> loup-vaillant There's a difference between the epicycles and the multiverse (assuming we're talking about quantum decoherence, I don't really know about the others). See, the epicycles really were additional entities, and therefore a problem, with respect to Occam's razor.

Quantum decoherence is different: it merely follows the equations, and do _not_ posit any additional entity on top of them (such as a collapse). The consequence of removing that entity is multiple universes, but so what?

The problem with science is that it tends to favour the _first_ theory that fits the fact. Instead, it should favour the _simplest_ theory that fits the fact. [http://lesswrong.com/lw/qa/the_dilemma_science_or_bayes/](http://lesswrong.com/lw/qa/the_dilemma_science_or_bayes/)

<comment><USER16> I thought the multiverse "theory" the article talked about was not the many worlds interpretation of quantum mechanics, but the proposal that multiple universes are exploding like bubbles with the boundary of each expanding at the speed of light so no communication between them is possible. No?

You do bring up a valid point about occam's razor - i.e. It is a valid effort to come up with a strictly simpler theory that can explain already known observations than what is currently accepted. "Simpler" in the sense of fewer assumptions being needed. The difficulty is that we're often blind to the assumptions we're making in our theories and it can take a while for those to surface.

<comment><USER17> I wonder if that isn't essentially 'overfitting the data'. Any bounded data set can be modeled simply. But it doesn't predict anything. A useful theory would beget testable hypotheses.

<comment><USER16> They're not quite the same when it comes to physics, where you have the additional characteristic of _precision_ for theories. For a trivial example, "anything can happen anywhere at any time" certainly covers all observations and is simpler, but has no precision in what it forbids.

Any new theory in physics must have at least the same precision as the known theories. The problem in current physics-at-the-edge (raised by the article) is that these newer theories are coming up with so many ways in which universes can be formed that even though we're moving in the "simpler" direction by relinquishing fundamental some assumptions, we're losing "precision" in this sense. This is now happening to the extent that the very notion that the job of a scientific theory is to only explain the _observable_ universe is being called into question and theories that consider our universe to be just one of many universes with different parameters are also included in the play. At that point, the working assumption that all these universes that our mathematics invents actually exist though we cannot observe them, is a simpler view of the cosmos ... until we know better. However, the practical utility of such an expansive theory ends up being limited relative to the theory that it is trying to replace, since our ability to predict things in _our_ universe is not being improved on.

edit: What I'm trying to say is, I guess, that "precision" and "simplicity" are opposing forces that keep a check on overfitting.

</comment></comment></comment></comment><comment><USER18> I wonder if our understanding of the universe will ultimately exceed our ability to reason about it. Complexity can increase without bound but our brain's capacity to understand and model isn't increasing at all. Maybe we should find some way to make smarter physicists.

<comment><USER19> Very Zen. The failure to recognize the limitations of one's received cognitive instrumentation. And this instrumentation is empirically oriented so without empirical validation what have you got? And with emphasis placed on theories which are 'sufficiently elegant and explanatory' while setting aside the need for experimental confirmation merely sets the theorist up for 'The great tragedy of Science — the slaying of a beautiful hypothesis by an ugly fact' (Thomas Huxley)

</comment></comment><comment><USER20> Experiment is the arbiter of truth.

Without it, how could you know what's true?

<comment><USER21> For most professionals in this field, what's true is pretty irrelevant. Only what brings in funding is what matters. That's why unprovable theories have so much success. It's much better to have something no one can prove wrong and destroy your career than have something that can be. Newton was proved wrong by Einstein, after all, being shown to just be an approximation compared to relativity. So the next step forward is to make sure your theory can't suffer like that and dry up your funding. The next step forward for these people isn't more accurate models and truth, it is more fundable ones.

<comment><USER20> I am a professional in the field :). I make precision experimental tests of gravity.

If a line of physical theory never leads to something testable, is it a physical theory?

Elegance and beauty are major guiding lights for theory, but they can't be the end goal if our desire is to learn the nature of Nature.

Arkani-Hamed and others chasing the physical utility of the Grassmanian are a modern example of beautiful mathematics straining toward physically-testable theory. I expect you'll see more money flowing that way in the next few years.</comment></comment></comment>


If software, app, and web development was easy, everyone would be doing it - <AUTHOR> In other words, there would be little demand for us. <comment><USER2> The extent to which developers are taken advantage of is really concerning IMHO, you wouldn't tell a plumber how to fix a pipe so why is it that people think it's ok to constantly tell developers how to do their job?</comment>


Spamming Twitter Is Now Easier Than Ever - <AUTHOR> http://www.sitepoint.com/blogs/2009/02/10/spam-twitter/ <comment><USER2> Ok, so let me get this straight...

Spammer on Twitter: "Hey, let me tell you all about these products I want to sell you!"

Me: "No"

Spammer: "..."

What's that? Oh, yeah, I didn't follow the spammer, SO I NEVER HEARD FROM THEM AGAIN! Does that mean that there won't be twitter spam? that spammers won't target twitter? Of course not...

...but personally, I welcome twitter spam! Please, bring it on! Spam is all about finding that sucker born in the last minute who will buy your breast enlarging viagra penis pump. The only way to be spammed on twitter is to be enough of a sucker to follow someone trying to sell you stuff. Sounds like a match made in heaven.

</comment><comment><USER3> You can't spam on Twitter. The reason I say this, and some will disagree, is based on where your attention stream is.

In your inbox, that's where your attention stream exists. When something new pops in, you check. The reason email spam works is because it inserts itself into your stream. Whether you actually go and click through on whatever's it is your own damn fault though.

The reason that "spam" in the context of email can't exist on Twitter is precisely because you have an on/off switch for who's allowed to post into your attention stream. I used to follow Robert Scoble because he's interesting. But yammers on constantly about the most inane crap that it completely floods out the interesting stuff. Its like the man has ADD and a neural mind-reading prosthesis hooked up to a keyboard. Anyway, the point was that he was "spamming" me in a way, so I turned him off. Instantly my attention stream went from murky and muddy to useful again.

<comment><USER4> I think the issue is more that they're polluting the social network and the quality of links.

I'd bet that most of the "followers" that these bots attract are other bots that auto-follow anyone who follows them. Nevertheless, that increases the number of pages with a link to their site, from a high page-ranked site, and thus they profit. That's obnoxious and rude, to say the least.

This kind of noise isn't nearly as offensive to the service-user as email spam (for exactly the reasons you mentioned). However, Twitter could potentially be an interesting data set for study and experimentation, and these schmucks are souring the integrity of that data. Link-spamming is basically just a special case of this kind of general data-abuse.

</comment></comment><comment><USER5> I never got any spam on Twitter. Get a dozen follower invitations once in a while, when I post something, from people I never heard of (spam bots, probably). So I just ignore them. Don't even bother reading their profiles to check if they're actual interesting people or just bots trying to sell me stuff to enlarge specific parts of my body...</comment>


23andMe just laid off 100 employees as the DNA-testing 'fad' ends - <AUTHOR> https://www.businessinsider.com/consumer-genetics-company-23andme-lays-off-100-employees-2020-1 <comment><USER2> While scary if in the wrong hands, I hope testing gets cheap enough that everyone's DNA is on file somewhere.

DNA has already been doing good. Murderers that never got caught are now being caught through familial DNA..20+ years after the crime.

</comment><comment><USER3> I wish everyone had gone w/ the nat geo test instead of 23andme. Seems much more valuable and I liked my results more comparing the two.

</comment><comment><USER4> It seems more related to undermining users' trust by selling their data to GlaxoSmithKline two years ago.</comment>


Krita in 2018 and 2019 - <AUTHOR> https://krita.org/en/item/krita-in-2018-and-2019/ <comment><USER2> From 2004 to 2009, Krita was strongly focusing on being a generic image manipulation/painting application in the style of Photoshop or GIMP. Since 2009, the focus is squarely on painting: the Krita community aims to make Krita the best painting application for cartoonists, illustrators, and concept artists. \-- [https://krita.org/en/about/history/](https://krita.org/en/about/history/)

I was a user when the Krita team focused on painting. I admit that I was among those disappointing at that time because I naively wanted Krita to become open source Photoshop. I thought they were making a mistake in the direction they took. I'm happy I was wrong about that.

<comment><USER3> In practice I never went away from GIMP for most Photoshop-like tasks. Which isn't a signal that GIMP is great, but that I grew used to its deficiencies many years ago. And it has gradually improved: It has single-window UI now, after all.

For the two very most common bitmap editing tasks(color remapping and selection-based edits) it's OK and it even boasts some fancy features these days. For drawing, it has a workable set of brushes and fills, though I think Krita is the better app here now. For graphic design things(typography, layout, layers of procedural effects) too many things still involve a slow, indirect workflow, but there are signs of this problem being chipped away at.

(The single best tip I have for GIMP is: get in the habit of using the "/" key quick search instead of using the dropdown menus)

<comment><USER4> Do you have tips for text manipulation? Whenever I make dumb memes it's a pain to move around text on GIMP.

<comment><USER5> Experiment with the move tool setting that moves the active layer rather than moving the layer you select with the move tool. This can be really helpful with text.

This one is more obvious maybe: I also found learning the keyboard shortcuts really useful when working on a web comic.

</comment></comment></comment></comment><comment><USER6> It might be a little off topic, but I'd like to share a project which its intent is of growing krita reach and community: Pepper and Carrot, a cutesy comic 100% open (libre) made 100% with krita.

[https://www.peppercarrot.com/](https://www.peppercarrot.com/)

Even translations are community driven :)

Disclosure: I'm just a reader of P&C, who found the comic not so long ago and fell in love with it!

<comment><USER7> Pepper and Carrot is created by David Revoy. He works pretty much exclusively with free and open source. He has done a number of projects with Blender as well. He's quite the exceptional artist, and his videos are lovely.

<comment><USER8> He has great time lapse videos using Krita on his Youtube channel -- [https://www.youtube.com/watch?v=Hr7OPBxh5_o](https://www.youtube.com/watch?v=Hr7OPBxh5_o)

</comment></comment></comment><comment><USER9> I really liked this update for a couple of reasons not related to my opinion of the software itself: 1) it seems focused on informing, not propaganda. They report the good and the bad, and those are the facts; too many announcements sound like press releases. 2) they're making a commitment to regular reporting and communication of this nature - I really like this in software companies/projects. 3) it's not really dumbed down. They discuss features but they also discuss how the software works behind the scene, and what they would like to change. It feels honest, and that makes them a more believable project. We're subconsciously taught to emphasize the good and deemphasize the bad, and that leads us down the path of half-truths and corporate speak. This project makes me want to back it, because they seem to be willing to be forthright in their communication with me.

</comment><comment><USER10> Wow how have I never heard of this tool before? As a hobby digital artist I have even looked for something like Krita but never heard of it before seeing this post top of HN with no comments.

Does anyone who has been involved or kept track since earlier days have any insight into why this isn't more well known among the pantheon of digital illustration tools prescribed to budding artists? From the about page they've been around for a _long_ time! I'd love to understand the market forces that were in play here.

<comment><USER11> It was born as a part of KDE Office Suite which hadn't wide usage. After community of Krita users grew rapidly (for an FOSS piece without marketing) it was separated from the bundle. Also a good boost was a publishing at Steam in the first month of their Software Store.

<comment><USER12> The Steam version is a nice way to sell open source software. It has an additional interface designed for tablets, which is open source, but the free builds from krita.org don't include it.

<comment><USER13> The current steam version is same as the free version, with steam version you get automatic update, The tablet version is Krita Gemini, i think it is the older version, i don't know if it is still on steam, as recently steam version was updated

</comment></comment></comment></comment><comment><USER14> Tried Krita for the first time recently and was really pleasantly surprised!

It's very stable and very polished, and really intuitive to use. Out of all the open source graphics/image editing tools, it is definitely my favourite now. It rivals or even surpasses its proprietary competitors in both features _and_ usability, which is no small feat.

<comment><USER15> I use Krita "full time" (as in, quite often, it's not my job) for painting. It really is amazing for digital painting (with a graphic tablet), I definitely prefer it to Photoshop (and others) for painting.

However in other areas it's a bit lacking (vector graphics, and anything beyond simple-ish image manipulation).

A huge thanks to David Revoy who releases his "source files" and brush kits, they are tremendously helpful in terms of studying techniques he uses, and the brushes are simply and increase productivity a lot.

(edit: formatting/typos)

</comment></comment><comment><USER16> Lots of good stuff in this release, but the one thing that gets me real excited is HDR support. It really is a world of difference both authoring and experiencing HDR content, and sadly a lot of HDR content is quite bad conversions from SDR. What's even more exciting is this nugget of gold:

> We want to make sure that the support for HDR visuals becomes part of Qt > itself, so other applications can follow.

I love it!

</comment><comment><USER17> I'm really glad that they are doing great and I'm really happy to find a payment gateway that seems great! I had never heard of Mollie[1] and I look forward to using it! I noticed that it's a bit of a struggle to find the right one.

[1] [https://www.mollie.com/en/](https://www.mollie.com/en/)

<comment><USER18> How did you get from drawing software to payment gateways?

<comment><USER19> It seems like Krita uses that one: [https://krita.org/en/donation- analytics/](https://krita.org/en/donation-analytics/)

It's not mentioned on the Donate page itself though, so I'm not sure how they found that out in the first place.

<comment><USER20> Use the source, Luke!

</comment></comment></comment></comment><comment><USER21> Hopefully GIMP 3 on GTK+ 3 next year too.

</comment><comment><USER22> I wish there was an iPad version for this.

<comment><USER23> Not sure an ipad version could be possible, because of how the apple store and the gpl are incompatible.

<comment><USER24> End users can compile iOS apps from source and install them without paying the developer fee. It could be distributed as source.

<comment><USER25> They would have to rebuild (re-sign) and reinstall weekly. The opposite of Just Works.</comment></comment></comment></comment>


What if powerful languages and idioms only work for small teams? - <AUTHOR> http://weblog.raganwald.com/2007/11/what-if-powerful-languages-and-idioms.html <comment><USER2> I'm not disagreeing with the premise of the article, but I think the efficiency of a team has a lot more to do with its incentive structure, both social and financial, rather than its size.

<comment><USER3> Well, that's by far the most interesting response I've seen. may I quote you?

<comment><USER2> Absolutely :)

</comment></comment></comment><comment><USER4> Great article that completely blows the conclusion.

Small teams are great for any-sized project with concrete, defined goals -- even if those goals are changing. Problem: any software project that's been around in a large company longer than a year has multiple, conflicting goals. No amount of software productivity is going to enable business clarity. So in the natural course of business growth the business will generate software groups that focus on creating repeatable software projects. That's because the only rational response to the accusation of "you software people can't develop code" is to show how you are able to create any kind of solution the business guys want. It simply becomes a different set of goals. When you're small and hungry, you have clarity of mind -- you can't afford otherwise. When you're big and busy, software becomes part of a more political corporate culture.

I'd love to work on a small startup and make wonderful programs that change to world too. That's why I'm here. But I'm not naive enough to think that there aren't good reasons why large-scale software is in the state it is. It's not something some kind of simple slogan can describe or fix.

<comment><USER5> That's a good point.

Perhaps you don't have to live with this, though. I've been carrying this half-baked idea for a while: If small teams are so key it's worth trying to be really creative to retain them, by trying various refactorings on team organization.

You still have the problem of incenting high-quality workers, though. Which brings us back to startups.</comment></comment>


No Compiler – On LLVM, and writing software without a compiler - <AUTHOR> http://msm.runhello.com/p/1003 <comment><USER2> > And actually we're now entering a world where at minimum supporting LLVM as > a backend option is mandatory.

I would have said this too a few years ago, but Go is a huge counterexample. It's become very popular without using LLVM, and the compiler that does use a mature, optimizing backend (gccgo) doesn't get nearly as much use as the Plan 9-based one.

I should also mention that increasingly it's become popular to have a mid- level IR that you lower the AST to before lowering to LLVM IR. GHC does it, Swift is doing it, and Rust is working on doing it. The reasons are (a) you can do language-specific optimizations like devirtualization, which are often pretty hard to do in LLVM; (b) going from AST to LLVM IR is often a big, messy leap for any language that isn't C.

<comment><USER3> > I would have said this too a few years ago, but Go is a huge counterexample.

I've been wondering about this ever since Go came out. If I recall correctly, LLVM was already a viable option back then.

The latest release of Go earlier this week featured a pretty big revamp of their backend with a new SSA-based middle/backend. I wonder how much work went into that and could they have achieved that faster had they been on LLVM since day 1.

<comment><USER4> I'd like to know what is the downside of using LLVM. Why did they choose to write their own optimizer?

Anyway, the most difficult part of writing the compiler was probably the garbage collector.

<comment><USER5> > I'd like to know what is the downside of using LLVM.

Depending on C++ code and keep alive the belief that you can only create compilers in C and C++?

As many without experience in compiler development think.

Also, and this is specially painful when compiling Rust or Swift from source, saving themselves the pain of waiting around 4h for a clean compile.

<comment><USER6> LLVM does take a long time to compile, but four hours is an exaggeration. A mid-range computer can compile it in 30 minutes with -j4, and a good computer can compile it in 10 with -j8.

<comment><USER5> Core duo netbook with 4GB RAM and 5400 RPM hard disk.

I can assure you it really does take 4 hours.

And to bring the point home, I can link you to the Swift issue where I was discussing this matter.

<comment><USER7> A core duo isn't even in the realm of mid-range. That's very nearly a 10 year old processor!

<comment><USER5> Yeah, but it works perfectly well as a travel netbook for coding on the go.

Also I never had 4h builds with single core processors back when I was working full time with C++. The slowest ones were around 2h.

A core duo would run circles around those computer systems, hence my dismay how much hardware LLVM requires for building.

<comment><USER7> I would imagine compiler design has become much more complex in 10 years, and a low end i3 is something like at least 3 times faster than a core duo.

<comment><USER5> I would agree if other compilers, not LLVM based, took as much to compile.

Also that is surely a side effect how they are using C++, which desperately needs modules.

<comment><USER2> Those compilers don't do nearly as much optimization as LLVM does. It's hard to overstate how wide the gap between the classical compilers you like and LLVM/GCC truly is. LLVM has no fewer than three IRs, each with a full suite of compiler optimizations (four if you count ScheduleDAG). LICM, just to name one example, runs _at each stage_ (see MachineLICM.cpp). Turbo Pascal did nowhere near that level of optimization, and it produced unacceptably slow programs by modern standards.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> You may be better off building up the LLVM IR as text, vs. using the FFI builder. (If you want/need type safety as opposed to just waiting for the LLVM verifier to tell you what went wrong, you could write the builder in Lua.)

Here's a link with a Python example (along with a justification for this approach): [http://eli.thegreenplace.net/2015/building-and-using- llvmlit...](http://eli.thegreenplace.net/2015/building-and-using-llvmlite-a- basic-example/)

</comment><comment><USER9> So I've done basically the same thing with a few differences: (1) I chose Common Lisp as the language I would implement (2) I used C++ template programming to automatically generate wrappers for C++ library functions (like boost::python and luabind) so that I could expose C++ functions directly to Common Lisp. That allowed me to use the llvm C++ API directly.

The project is called clasp -> github.com/drmeister/clasp Send me a message - we should talk and compare notes.

</comment><comment><USER10> Instead of generate LLVM code, you could instead generate 'typed Lua' using Lua as a metaprogramming language. Then the 'typed Lua' can get compiled down by LLVM into object code.

This is what [http://terralang.org](http://terralang.org) does.

<comment><USER11> I never understood in simple terms what terralang is actually about. Even in your sentence, if typed Lua is being "generated" (i.e., it's the target) how come Lua is being used as a metaprogramming language (i.e., a language that does the generation).

I understand generative metaprogramming as consisting of a language that a human deals with, a language that gets generated. In the case of Terra/Lua it's not clear which generates and which is generated, or whether it's is a completely different approach (to which I say, what's the point).

On the Terra webpage, it says 'Terra is low-level' but then 'Terra is code embedded in a Lua meta-program', not to mention 'Terra-Lua programs'.

<comment><USER12> Essentially it's an implementation of the concept that metaprogramming should use the same semantics and syntax as normal programming. This is the case in Lisp, for example, but Lisp is not (or not typically) compiled, so Lisp metaprogramming is essentially limited to defining syntactic sugar. In Terra, metaprogramming (or multi-stage programming, as they call it), can actually result in improved performance compared to a typical C-like implementation of the same algorithm.

The website has a couple papers that provide benchmarks for some interesting test cases.

<comment><USER13> > This is the case in Lisp, for example, but Lisp is not (or not typically) > compiled …

Say what? Lisp is often compiled; the standard extensively discusses compilation[1] and — to address your point re. performance-improving metaprogramming — compiler macros[2] specifically exist in order to advise the compiler, e.g. for performance.

So, no, Lisp macros are _not_ limited to defining syntactic sugar. It's like I keep on saying: the Common Lisp standard from 1994 contains with its covers functionality that people _still_ don't know about.

[1] [http://www.lispworks.com/documentation/HyperSpec/Body/03_b.h...](http://www.lispworks.com/documentation/HyperSpec/Body/03_b.htm)

[2] [http://www.lispworks.com/documentation/HyperSpec/Body/26_glo...](http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#compiler_macro)

</comment></comment></comment></comment><comment> daniel-kun Been there, done that.

See [https://github.com/daniel-kun/omni](https://github.com/daniel-kun/omni) (look at the little gif in the "Status Quo" section, it will say more than 100 words).

I have the "Code Model" (that is what I call the AST, because there is no Syntax) up for a very little, C-like language, and I have a frontend that can manipulate parts of it. However, these are not yet combined, and I stopped working on it because I am in the middle of transforming my efforts into a Web App. This will allow you to edit and run a code model in your browser, and download a compiled binary when you are finished. Btw., you will be able to link code elements such as classes to online-ressources such as a task tracker, a diagram, a mindmap, etc. to have the whole ALM process embedded into your code base.

Sounds good? Sounds good to me.

</comment><comment><USER12> Interesting article. Looking at the code, it's pretty clear that this is not a particularly practical approach, but I think it points in the direction of where language design should head. Abstractions shouldn't be forced, unless absolutely necessary; forced abstractions lead to inefficiency.

I've been working on a related concept, but more along the lines of developing a low-level IR (LLIR) and corresponding syntax that allows direct coding in the LLIR. It would essentially be a portable assembly language. The LLIR could be then be compiled down to machine code for different architectures, or even run directly in a VM.

This isn't too different from the LLVM concept, except the IR would be a practical programming language, much like assembly. Furthermore, the IR would provide access control primitives (reference capabilities) that most languages do not support, but that are extremely useful for low-overhead secure computing and concurrent computing. These primitives could be especially useful in the design of exokernel OS's, and related applications.

<comment><USER14> Gosh, I thought C was "portable assembly". How would your LLIR differ from C?

<comment><USER15> C is not really portable assembly. It's full of undefined behaviour, for one.

</comment></comment></comment><comment><USER16> I've run into so many of these issues myself, trying to work through the forest of LLVM. The abysmal state of the generated docs and those cryptic segfaults are the bane of my existence.

So I started to slap together a little library that gives some order to the madness. I call it petard [0], for reasons that should be obvious if you've heard that word. At the moment I'm focused on JavaScript bindings, but the idea is to build a sensible object-based API that's simple enough to export pure C bindings to make FFI easy.

There's currently support for lots of the basics, but some significant issues too (lack of features as well as poor C++ style). Stern memory-management focused pull requests would be very welcome, and feature additions would be helpful, too.

[0]: [https://github.com/couchand/petard](https://github.com/couchand/petard)

</comment><comment> a-dub This seems like a fun way to poke around with LLVM but I don't see how this is any easier than writing down a grammar and feeding it into a parser generator...

"Writing a parser" sounds really annoying and complicated, but in my admittedly limited experience with ocamlyacc, it was easy peasy and dare I say it, fun!

The hard part I guess was defining the language and maybe that's what he's trying to avoid.

But even still, scripting around the AST building functions in LLVM and coding directly to them seems way more annoying to me in the long run. (especially the writing programs part)

But who knows, maybe I'm missing the point...

<comment><USER17> Here's the potential I see. Imagine if it was routine to write an application stack entirely in a repl language. Not just the application code - everything. You'd write your application code. Then other functions would dispatch the tree of application code to the LLVM API where it would be compiled. Then other functions could take the resulting artifacts and push them through to deployment.

Doing this at the moment would involve writing fiddly wrappers around lots of layers of technology - dynamically constructing makefiles, and shelling out to call things.

</comment></comment><comment><USER18> There's an enormous lump of complexity that this chap seems to be unaware of: the type system. This is the semantic analysis bit that he seems to think is done by LLVM, but it isn't.

It's like he mostly thinks of compilers as turning statements and expressions into executable code, but IMO that's one of the easier bits. Defining how different values interact, what operations are legal and aren't, and the runtime support - this is a lot of work, and in particular, it's different for every language, because it's what makes languages distinct.

<comment><USER19> I think she's a woman not a "chap". But anyways, you'd be relying on the IR semantics and checking to do the legwork for you. LLVM IR _is_ a language after all.

<comment><USER18> It is typed at a very low level. It doesn't cover interesting data structures, like hashes, vtables, closures, etc.

</comment></comment></comment><comment><USER20> This is the most kickass thing I've read all day.

</comment><comment><USER21> Seems like what he really wants is an LLVM assembler.

<comment><USER22> Yeah. LLVM IR is the most suitable representation for doing this kind of thing, but it's the one that's not compatible across LLVM versions. Maybe it would be worth defining an alternate format for the bytecode that can be read and written by external tools?

</comment></comment><comment><USER23> Excellent post highlighting the problem solving skills and tenacity of a talented engineer. Of course, this is also the "duct tape and paper clips" approach to writing software that I certainly would not advocate for production systems.

<comment><USER24> I don't know where you got the impression that he was doing any of this with the intention of putting it on production.

<comment><USER23> I didn't get that impression. I was trying to say that I admire the author without also advocating putting a bunch of clever hacks into production.

</comment></comment></comment><comment><USER25> For everyone here who mentioned building wrappers around llvm-c or llvm c++ api: there is a nice tool for automating this job (and many other similar things), it's called "Clang". Or, more specifically, cindex. It's easy to use Python + cindex to parse LLVM headers and spit out nice wrapper library for your language of choice.

And example of this approach: [https://github.com/combinatorylogic/clike/blob/master/llvm-w...](https://github.com/combinatorylogic/clike/blob/master/llvm- wrapper/rebuild.py)

</comment><comment><USER26> I really like the idea, why not hack a scripting engine to add bindings to itself, e.g. in Duktape JavaScript engine. Then a JavaScript function could use the C-API of Duktape to generate AST's at runtime for itself. But I think the VM would be the limit then... support for coroutines etc.</comment>


New Zealand Stock Exchange Down for Third Day in a Row Following Cyber Attack - BSG-Actual https://www.rnz.co.nz/news/business/424567/nzx-down-for-third-day-in-a-row-following-another-cyber-attack <comment> BSG-Actual Context: NZX has suspended trading for the third day in a row in response to a DDOS attack. It's unclear if the attack is market manipulation, an extortion attempt, politically or geopolitically motivated, or just someone doing it because they can.</comment>


Guido van Rossum Core Developer Grant - <AUTHOR> https://blog.europython.eu/post/182445638102/announcing-the-guido-van-rossum-core-developer <comment><USER2> Is there a way to donate to support this grant? I think this is great.</comment>


Tupac's performance was no hologram - <AUTHOR> http://www.smh.com.au/technology/sci-tech/tupacs-performance-was-no-hologram-20120425-1xkai.html

<comment><USER2> >However, a single holographic video call on a one-square-metre portal would require a data rate of approximately 200 terabits per second

I guess they just wanted an actual number to say, but that's complete nonsense. It says nothing about compression, frame rate, resolution, or anything you'd actually need to know to make that calculation. Besides that, as far as I know, there is no way to actually record holograms in real time, much less portably.

</comment><comment><USER3> Yes, we know.</comment>


Keeping Track of the Weird Stuff We Send into Space - <AUTHOR> https://www.atlasobscura.com/articles/weird-stuff-sent-to-space <comment><USER2> The article did not mention one of the weirdest: Elon Musk's "Starman" dummy and Tesla Roadster shot into Space on a Falcon Heavy Test Launch.

[https://en.wikipedia.org/wiki/Elon_Musk%27s_Tesla_Roadster](https://en.wikipedia.org/wiki/Elon_Musk%27s_Tesla_Roadster)

...though it seems the journal article does include it in the list of references:

[https://www.cambridge.org/core/journals/international- journa...](https://www.cambridge.org/core/journals/international-journal-of- astrobiology/article/profile-of-humanity-the-cultural-signature-of-earths- inhabitants-beyond-the-atmosphere/D2CAEED606AAF1EA45F7D5E7512E01D0)

</comment><comment><USER3> NASA ARES: Orbital Debris Program Office

[https://www.orbitaldebris.jsc.nasa.gov/](https://www.orbitaldebris.jsc.nasa.gov/)</comment>


Store your zsh history into a sqlite3 database - <AUTHOR> https://github.com/larkery/zsh-histdb <comment><USER2> OffTopic: I have always considered my (bash) history as a profound source of knowledge. I hope one day, some machine learning wizard will create a function extractor from history. Something like: "oh it seems you often chain those commands: .... Let me make a function for you. Here it is: ... How would you like to call it?"

<comment><USER3> Have you tried the "fish" shell? It's the closest I've seen to what you're describing, but not exactly the same.

</comment></comment><comment><USER4> This looks very cool! I especially love the attention to syncing and merging, as well as the section specifically for zsh-autosuggestions. However, I really wish there were performance metrics (e.g. "zsh-autosuggestions used to take me Xms but now they only take Yms, and I have Z entries in my history")

<comment><USER5> I don't have any timing data and I don't actually use the autosuggest thing (I wrote that for someone else who asked about it), but I can say that I have months of daily use in mine and there's no noticeable query delay or insertion delay so far.

Sqlite3 is to thank for that, it's a pretty amazing bit of engineering.

</comment></comment><comment><USER6> I've been using this for a while. I like the fact that it stores dates/times of command executed. I plan to combine this with org-mode to quickly get a report of all shell commands executed while I was working on a specific task. Helps if I want to convert it into a guide/blog post.

<comment><USER7> Not that it affects you, but for others that think have date/time in their history zsh supports this with their EXTENDED_HISTORY (setopt extendedhistory) option. Formats history as...

: <beginning time>:<elapsed seconds>;<command>

</comment></comment><comment><USER8> anyone know of something like this for bash?

<comment><USER9> I use this:

> export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date > "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date > "+%Y-%m-%d").log; fi'

It just logs everything into files per date, have come in handy at times.

</comment></comment><comment><AUTHOR> Reddit discussion:

[https://www.reddit.com/r/zsh/comments/67gsm8/a_thing_i_made_...](https://www.reddit.com/r/zsh/comments/67gsm8/a_thing_i_made_to_put_your_zsh_history_into_a/)

</comment><comment><USER10> why do i want to know how many times i type ls!!!!!

j/k This seems pretty cool

<comment><USER11> it stores those under _BORING_COMMANDS and doesn't log them.

Source: Read the source</comment></comment>


Radioactive WW2 night vision test (1941) - <AUTHOR> https://imgur.com/gallery/5TneUBi <comment><USER2> > This is a night vision test developed and published by WD Wright in WWII. It > relied on a radium light source (sadly no longer available) to provide a > calibrated, low level of illumination.

So this is an equipment to test human vision in the dark, not related to EO "nightvision" technologies that the term more commonly refers to today.

</comment><comment><USER3> The links at the bottom, unmangled:

[http://europepmc.org/backend/ptpmcrender.fcgi?accid=PMC21617...](http://europepmc.org/backend/ptpmcrender.fcgi?accid=PMC2161757&blobtype=pdf)

[https://en.wikipedia.org/wiki/Isaac_Pitman](https://en.wikipedia.org/wiki/Isaac_Pitman)

<comment><AUTHOR> Thanks!

</comment></comment><comment><USER4> For those who aren't aware, radium paint was used quite a bit prior to the 1970s or so as a glow in the dark material, typically used on watches and clocks to allow them to be read in the dark.

You can still find many of these old items on ebay and in antique stores. Typically they no longer glow in the dark due to the radiation breaking down the phosphors in the paint, but they remain radioactive because the half-life is > 1000 years.

(I only know this stuff because of my interest in old tube electronics and radios, some of which have radium dial clocks)

[https://en.m.wikipedia.org/wiki/Radium_dials](https://en.m.wikipedia.org/wiki/Radium_dials)</comment>


Online dating will always be broken, but it might be OK - <AUTHOR> http://alexshye.wordpress.com/2013/10/10/online-dating-will-always-be-broken-but-it-might-be-ok/

<comment><USER2> Online Profiles are not "Broken" as much as they are "embellished". By that, I mean that a big majority of users -- I would say as much as 95% amongst guys and 40% amongst girls -- embellish their profile in areas where they internally feel they are lacking / inadequate.

I have met 100s of guys from plentyoffish.com match.com and okcupid.com (before match.com acquihired them) and can say that most guys lie about their height, as well as their jobs. It's annoying for someone really attractive and intelligent like me because it wastes so much time!</comment>


One-line Tree In Python - <AUTHOR> https://gist.github.com/2012250 <comment><USER2> Very nice! I've been a bit leery though of defaultdict since it contributed to two different bugs in <http://norvig.com/spell-correct.html> \-- in less than a page of code, by a first-rate programmer, which was read by many thousands of others for years before anyone noticed the second bug. I'm not saying don't use this, I just have a little warning light blink on when I see 'defaultdict' anywhere.

<comment><USER3> Both of those errors seem like fundamental category errors. He's using a dictionary construct which effectively makes it so that _every_ key has a value, but then relies on dictionary membership when testing. This happens to work, but it makes little sense. (One could argue that 'foo in bar' should _always_ be True if bar is a defaultdict.) Seems to me like he should have checked the value of the word rather than using 'in'.

You make a good point about this being written by a known intelligent person and seen by many others who didn't see the bugs, but I think it's ultimately a lesson in thinking about semantics rather than behavior. This code relies too much on the _behavior_ of defaultdict rather than just what such a thing _means_. As long as what it means is kept in mind I think it should be safe.

But that's just, like, my opinion, man.

<comment><USER2> At some level it was sloppy thinking, yes; _most_ bugs have some obvious-in- retrospect reason they were stupid. You may be right about how to think about this one.

I've seen other defaultdict bugs -- this is just the case with the highest eyeball-count-times-attention product I can point to.

<comment><USER3> _If_ this bug was simply due to having the wrong concept of defaultdict, and _if_ the others you saw were the same, _then_ you can avoid the bugs forever by just having the right concept. Lots of ifs there, of course.

</comment></comment></comment></comment><comment><USER4> This is actually quite elegant and useful. I've done similar things time and time again with code like so:

        defaultdict(lambda: defaultdict(int))

That allows me to organically build dictionaries (mainly for stat building) using operands like +=.

<comment><USER5> Also check out collections.Counter.

      x = collections.defaultdict(collections.Counter)
      x['foo']['bar'] += 1
      X['foo'].most_common(10)
     Etc.

<comment><USER4> Excellent! I didn't know about that one!

</comment></comment></comment><comment><USER6> Neat. Works in Ruby, too.

      def tree; Hash.new {|h, k| h[k] = tree }; end
      t = tree
      t[:foo][:bar] = "foobar"  # => {:foo=>{:bar=>"foobar"}}

Probably more idiomatic to do it as a class, though.

      class Tree < Hash
        def initialize
          super {|h,k|  h[k] = Tree.new }
        end
      end

Btw. How do you post nicely formatted code?

edit - Thanks!

<comment><USER7> It works in Ruby because it works in Perl. :)

A little known fact is that it works in C++ STL too as long as the objects in your containers have default constructors that make sense. So a map<int, map<int, value_type> > does what you expect when you try: my_map[12][3] = some_value;

<comment><USER8> I was so used to the semantics of std::map that I was surprised it _didn't_ work that way in Python.

<comment><USER7> Autovivification through a rvalue (for clarity: the magic here is that x[a][b]=c works to create x[a] despite that index never seeing an assignment) has a long history in perl. The C++ feature is more limited in scope and AFAIK accidental -- it works because the automatic construction is a side effect of __reading __the value, which is often considered an undesired feature of STL (you can't use an expression that contains x[a] to test if x contains a, like you can in many languages).

And you may be less cynical, but I've had to explain this sort of thing to a huge number of C++ programmers, most of whom write STL code that looks like Java, with explicit initialization of all the intermediate containers.

<comment><USER8> Automatic construction is not really a "side-effect" of reading a value in std::map, it's an explicit design choice. They want users to be able to write code like this:

      std::map<std::string, int> dict;
      dict["one"] = 1;
      dict["two"] = 2;
      dict["three"] = 3;

If using operator[] on a key did _not_ implicitly mean "create an entry for this key if it is not there," the above would not work. Rather, you would have to write the above as:

      std::map<std::string, int> dict;
      dict.insert(std::make_pair("one", 1));
      dict.insert(std::make_pair("two", 2));
      dict.insert(std::make_pair("three", 3));

The reason being that std::map is purely a library, not a part of the language. It does not "know" that operator[] is actually being used as a part of an assignment.

<comment><USER9> Strictly speaking, it's a side effect, because it mutates an existing object. It's also a _surprising and bug-prone_ side effect (as mentioned upthread; also, Darius Bacon found a bug or two in Norvig's spell-corrector due to the corresponding behavior of defaultdict in Python) and an _avoidable_ side effect, although it's not avoidable in C++. In Ruby, Python, Smalltalk, Common Lisp, Lua, and many other languages, you can make this (or its weird-syntax equivalent) work:

        dict["one"] = 1;

without causing this to add "one" to the dictionary:

        if (dict["one"]) { /* ... */ }

even for a "dict" that is purely a library, not a part of the language.

The underlying problem is that C++ calls the _same_ operator[] in both lvalue and rvalue contexts. Which is pretty odd, really, when you think about it; it certainly doesn't generate the same code for indexing into native arrays in lvalue and rvalue contexts. All the other languages distinguish between the lvalue and rvalue contexts. Ruby calls [] or []=, Python calls __getitem__ or __setitem__; Smalltalk has #at: and #at:put:; Common Lisp doesn't have separate names for the two things, but one of them is defined with (defun foo (dict key) ...) and the other is defined with (defun (setf foo) (dict key) ...); in Lua, these are the metamethods __index and __newindex.

So it's sort of true that it's not std::map's fault, but C++'s. But not really. Stroustrup fixed several things about the way templates worked to make STL work better; he should have fixed this one too.

</comment></comment></comment></comment></comment></comment><comment><USER10> This is pretty good. I prefer the name I used when I needed it, though.

      dicts_all_the_way_down = lambda:defaultdict(dicts_all_the_way_down)

</comment><comment><USER11> A quick Lua version:

        do
          local mt = {
            __index = function(t, k)
              t[k] = tree()
              return t[k]
            end
          }

          function tree()
            return setmetatable({}, mt)
          end
        end

        t = tree()
        t.foo.bar = 'foobar'

</comment><comment><USER12> If only Haskell would let me do

      type MTree t = Map t (MTree t)

This version works though.

      data Tree t = Leaf | Node [(t, Tree t)]

<comment> scooty-puff The problem is that the type would be expanded indefinitely:

      Map t (Map t (Map t ...

Try:

      newtype MTree t = MTree (Map t (MTree t))

</comment></comment><comment><USER13> I would be interest to see this using the __getattr__ rather than __getitem__, so that this is also possible:

      users = tree()
      users.harold.username = 'hrldcpr'
      users.handler.username = 'matthandlersux'

<comment><USER14> Well, it's as trivial as you say. Just set __getattr__ = __getitem__ in your tree.

(Note though that there is/was a small bug(?) in CPython: <http://bugs.python.org/issue14658>)

<comment><USER13> Seems like it may take a little more than one line, this errors for me:

      >>> a = tree()
      >>> a.__getattr__ = a.__getitem__

<comment><USER14> Yea, sure it becomes more than one line (or at least I don't know a good one- line-way) but I wouldn't count that as an issue.

It errors for you because it is a defaultdict instance and doesn't allow attribute overwrites.

This should work:

        class tree(defaultdict):
            def __init__(self): defaultdict.__init__(self, tree)
            __getattr__ = defaultdict.__getitem__
            __setattr__ = defaultdict.__setitem__

Edit: It doesn't work with the simple assignment because of the mentioned bug. Ofc the fix is trivial. See the code from beagle3.

</comment></comment></comment></comment><comment><USER15> Jebus that was simple! I wish I'd thought of it.

</comment><comment><USER16> +1 This is a beautiful little recipe.

</comment><comment><USER17> This is a tree with labelled edges, not just a tree. This tree will not hold multiple values with the same label. I always imagine my trees to have no labelled edges.

Very cool though!

</comment><comment><USER18> related, but not as clever function to help with nested counters (with doctest showing usage):

        def incr_nestedctr(d, *keys, **kwargs):
            """
            >>> a = {}
            >>> incr_nestedctr(a, 'a', 'b', 'c', 'd')
            {'a': {'b': {'c': {'d': 1}}}}
            >>> incr_nestedctr(a, 'a', 'b', 'c', 'd')
            {'a': {'b': {'c': {'d': 2}}}}
            >>> incr_nestedctr(a, 'a', 'b', 'c', 'd', delta = -4)
            {'a': {'b': {'c': {'d': -2}}}}
            >>> incr_nestedctr({u'1.0': {u'0': 1, '5': 1}}, '1.0', '5', delta = 2)
            {u'1.0': {u'0': 1, '5': 3}}
            """
            delta = kwargs.get('delta', 1)
            thed = d
            for k in keys[:-1]:
                thed = thed.setdefault(k, {})
            thed.setdefault(keys[-1], 0)
            thed[keys[-1]] += delta
            return d

</comment><comment><USER19> In Perl, this is called autovivification: <https://en.wikipedia.org/wiki/Autovivification>

I've wanted something like that in Python at different times... thanks!

edit: Ha! The Wiki article even has basically the same code:

def hash(): return defaultdict(hash)

<comment><USER20> > I've wanted something like that in Python at different times... thanks!

Python's auto-vivification doens't allow Perl's hap hazard auto-vivification. Perl allows you to say:

        my $foo = {};
        $foo->{'blah'}[0]->{'bar'}++;

And after this statement, $foo will refer a hash which has the structure as accessed in the statement.

I don't think this can be done for a generalized case in Python. Whether I want is a totally different question.

<comment><USER21> Why is this haphazard? If you don't want reads to change your data structure shape in a well-defined manner, use 'exists' or make an immutable hash with Hash::Util.</comment></comment></comment>


Over 12,000 farmer suicides per year, Centre tells Supreme Court of India - <AUTHOR> https://timesofindia.indiatimes.com/india/over-12000-farmer-suicides-per-year-centre-tells-supreme-court/articleshow/58486441.cms <comment><USER2> For context, according to 2011 census there were 118 million farmers and 144 million farm labourers in India. 12,000 suicides per year puts the suicide rate at 4.5 per 100,000 people. This is lower than suicide rate of most countries.

</comment><comment><USER3> Aside: No, India Times, I don't want your fucking notifications, especially that I've never been to your site before, and it really turns me off from wanting to interact with your site entirely.</comment>


EC2 Alarm Actions - <AUTHOR> http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/UsingAlarmActions.html

<comment><USER2> It's great that Amazon keeps innovating. Or are they just using the tools from Netflix?</comment>


Dolphin HD browser for Android is swimmingly good - <AUTHOR> http://arstechnica.com/gadgets/reviews/2011/01/hands-on-dolphin-hd-browser-for-android-is-swimmingly-good.ars

<comment><USER2> FYI - I just uninstalled Dolphin last weekend because I couldn't figure out how to stop it from opening a new tab every time it launched.

<comment><USER3> You mean open its homepage? It never opened a new tab in addition to that (but I would love to disable that phoning home...).

</comment></comment><comment> mike-cardwell I've used Dolphin on my Android G1 running version 1.6 since they announced the flaw in the standard browser that allows websites to read your SD card. I'm assuming the default browser on my phone is still vulnerable to that and will be for some time to come.

</comment><comment><USER4> I've found opera-mini to be faster and just as good/better

albeit without gestures

<comment><USER5> But opera mini is HUGE.

</comment></comment><comment><USER6> I tried it and found it to be extremely over-hyped.

</comment><comment><USER7> I love Opera Mobile.. the interface is much simpler, the text zooming/wrapping features work nice.. and I still get my tabs.

</comment><comment><USER8> This works really well on a rooted nook color too. Much better than the stock browser that comes bundled.

</comment><comment><USER9> I like the gestures. Works well on the Galaxy Tab.

</comment><comment><USER10> The Dolphin Browser Mini is fantastic as well. While it doesn't have the HD's plugin system, it includes several of the popular ones in the quickly-accessed Toolbox.

Personally I find the HD version a bit gaudy and slow... which is why I prefer the Mini on my memory starved, dated but trusty Droid.

<comment><USER11> I liked Mini, but switched to Miren. Something about using a random Chinese browser on my handheld computer makes me feel like I'm in a William Gibson novel. Though it's less exciting now the name and description in the market are English. Also it's pretty fast and featureful too.

<comment><USER12> Appropriately, the photo for this story is from (the filmatization of) a Gibson novel.

</comment></comment></comment><comment><USER13> I discovered Miren Browser a couple of days ago and it does a phenomenal job. Faster load times than Dolphin Mini and iOS-like copy & paste.

One caveat is it's developed in China, so my latent racism is telling me it's also doing a phenomenal job of phoning home my private data.

<comment><USER14> I'm not sure that's racist - presumably you wouldn't feel the same way about something developed in Taiwan, or by ethnic Chinese living in California.

<comment><USER13> You are correct, endtime. I said latent racism but meant overt fear. :-)</comment></comment></comment>


The TypeScript Tax: A Cost vs. Benefit Analysis - <AUTHOR> https://medium.com/javascript-scene/the-typescript-tax-132ff4cb175b <comment><USER2> This is the most intellectually dishonest thing I've read in a while. Claims to have a bunch of data, then abandons the data as soon as its analysis time. It's pretty obvious the data collected didn't correlate with the author's preconceived idea of what he wanted to find. The whole article is a bunch of mental gymnastics trying to codify an opinion with so-called data points, but only the ones that concur with the hypothesis. Total garbage, whoever wrote this should be ashamed of themselves. If real science was carried out this way, we'd never have invented a microprocessor.

<comment><USER3> This is not an acceptable way to disagree on HN, no matter how strongly you feel. Please read the site guidelines and follow them when posting here.

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)</comment></comment>


The Other Side of Depression - <AUTHOR> http://www.annewheaton.com/the-other-side-of-depression/ <comment><USER2> > They talked extensively about how brain chemicals work and how medications > help to balance out those chemicals

The only problem with this is that it's essentially a PR line that both doctors and the general public have mistaken for science. We don't know all that many _facts_ about how brain chemicals work with regard to mood disorders. We have empirical results from clinical trials and broad use of antidepressant and antipsychotic medications, but there is no basis to believe that medications "balancing out those chemicals" serve to repair mood disorders.

If the medications helped, then great, I know they have helped a great number of people, but they also fail to help a great number more and these success stories have an unfortunate tendency to marginalize people that do not get good results from medication. It often results in victim-blaming, to make sufferers of depression wrong for stopping their medications for legitimate reasons (let's face it, all of these results are highly subjective), and for overstating the ability of our current medications to cure all mental ills.

<comment><USER3> The entire "chemical imbalance" model is a lie designed to make drugs easier to sell, and here's a simple pair of facts which prove that the science is bunk:

SSRIs increase levels of serotonin at the synapse when administered by preventing serotonin re-uptake and recycling, improving mood.

SSREs decrease levels of serotonin at the synapse when administered by enhancing serotonin re uptake and recycling, improving mood.

Two drugs with opposite effects achieve the same qualitative result, even though it can't be said that they produce similar quantitative results. Thus, vastly different quantitative profiles are correlated with the same qualitative results; X + 1 = X - 1.

On top of that, there's no way to even measure levels of synaptic neurotransmitters in vivo.

<comment><USER4> There are multiple serotonin receptor types, and the "selective" types of reuptake modifiers don't affect all of them all the time in all people.

That said, too much or too little serotonin absorbed by a specific set or another can have wildly different effects.

Too much serotonin is not a good thing. So you need to balance it. For some people, this means SSRIs, for some it means SSREs. That's the explanation for the imbalance model, and it does make sense given the science.

<comment><USER3> It's ridiculous to talk about "balance" when you can't actually measure any of the quantities you're trying to balance and don't even have a clear picture of what "balance" looks like qualitatively, never mind quantitatively.

Sure, blast a brain with drugs that aren't well understood and it'll behave differently, maybe "better" than before, relatively speaking-- but that's not a scientific model so much as a pragmatic clinical solution.

<comment><USER5> It's ridiculous to talk about "balancing" the flavors of your soup when you can't actually measure any of the quantities you're trying to balance and don't even have a clear picture of what "balance" looks like qualitatively, never mind quantitatively.

Sure, dump in a bunch of spices that aren't measured and it'll taste different, maybe "better" than before, relatively speaking--but that's not a scientific model so much as a pragmatic cooking solution.

<comment><USER6> What is your point? That is definitely not a scientific model.

</comment></comment></comment></comment></comment></comment><comment><USER7> Damn, I know of a similar story, but very different ending. I had a family member with depression try to get help. He started on Lexapro, and ended up committing suicide a week later. I had to sit there and read testimonials of people that lost friends and family attributed to taking lexapro to the mother of the deceased while she was beside herself, yet in insistent that I read.

I self medicate with marijuana. And more than just using it to make me happy, smart, excited and hungry. I grow pot medicinally as well and that makes me feel really happy. There is loads of scientific evidence that points to having a garden and lessening depression. From my experience, I can say that growing marijuana really lends itself to a lot of the benefits of having a garden. Because you can harvest 5 to 6 times/year it makes it something you need to work on every day. Progress is relatively fast, and if you do a good job, you can take it to a shop and get enough spending cash for that new macbook apple just announced. And if you are a champion, you can find your nugs in magazines. (my ghost og kush is featured in culture this month...) But ultimately nothing feels better than smoking my own herbs on Friday night after a long week of gardening and programming.

Just throwing it out there as another alternative for someone that is struggling. Been there, you just gotta find the light.

<comment> jon-wood > He started on Lexapro, and ended up committing suicide a week later. I had > to sit there and read testimonials of people that lost friends and family > attributed to taking lexapro.

I don't want to belittle you're experience, because losing a friend to suicide is always brutal, but I do feel that its important to look at reports of anti- depressants causing suicide with a critical eye.

Almost all ant-depressants carry a warning that they can cause suicide, but there are a couple of factors in that:

1\. Almost by definition, people who are prescribed anti-depressants are more likely to commit suicide in the first place.

2\. I can't find the source on this one, but I've certainly been told by psychiatrists that the first few weeks after going on anti-depressants carries a higher risk of suicide than before going on them. The theory is that during those first few weeks you've been given enough of a kick by the drugs to provide a bit of motivation, but you've not yet had the chance to address the actual cause of the problem. That combination can result in having just enough motivation to carry out your desire to kill yourself.

Unfortunately you'll often see doctors prescribing medication without then following it up with the necessary therapy to help their patient move on from whatever got them into the situation got them to this point to begin with.

<comment><USER8> >That combination can result in having just enough motivation to carry out your desire to kill yourself.

Have we ever had a testimonial from a failed suicide in these circumstances? In my case, as my depression and anxiety issues started going away, I suddenly realized how much of a complete weirdo others must see me as and felt shame comparing myself to others in my peer group who, without depression holding them back, have become much more successful. It was a brutal eye-opener for me. I guess when I was depressed I really didn't consider these things or they simply didn't bother me.

It really brought up a feeling of hopelessness, like I wasted my youth and thus will never catch up, or will always been seen as defective in some way. I guess it doesn't bother me much anymore, but given sudden clarity like that can be intimidating. I imagine if someone is already suicidal, it can be a tipping point.

<comment><USER9> > I suddenly realized how much of a complete weirdo others must see me as and > felt shame comparing myself to others in my peer group who, without > depression holding them back, have become much more successful. ... It > really brought up a feeling of hopelessness, like I wasted my youth and thus > will never catch up, or will always been seen as defective in some way.

Preach it brother! I feel the same damned way.

> I guess when I was depressed I really didn't consider these things or they > simply didn't bother me.

I _revel_ in my weirdness when my mood is different from others-- they're just polyannas. Makes it harder to make that appt. to get the meds adjusted.

</comment></comment></comment></comment><comment><USER10> The brain is an bodily system, just like any other. Disease can strike its workings and doctors can help with modern science.

That said, we're still understanding how the brain works. One recent study showed that depression often has an associated and underlying, undiagnosed, sleep disorder [1]. Treat the depression without treating the sleep disorder and the depression comes back. FYI: This work has not been published yet.

Given that scientists have just figured out that sleep clears the brain of toxins [2], similar to the lymphatic system clearing the rest of the body of waste, these results shouldn't be surprising. We don't know the exactly reasons why people get depressed, but the evidence is clear. Depression has a root physical cause just like any other illness.

[1] [http://www.nytimes.com/2013/11/19/health/treating- insomnia-t...](http://www.nytimes.com/2013/11/19/health/treating-insomnia-to- heal-depression.html)

[2] [http://news.sciencemag.org/brain-behavior/2013/10/sleep- ulti...](http://news.sciencemag.org/brain-behavior/2013/10/sleep-ultimate- brainwasher)

<comment><USER11> N=1, but yeah fixing my sleep pattern, while getting a work an exercise routine has pushed my depression into "remission" for the past two years. The problem was, I couldn't do all that when I was depressed, so I used Lexapro as a band-aid, I went on it for 4 months to stabilise while I sorted the other stuff out. Now I'm doing great! I'm wary of going on the medication for long periods of time, as the last time I was on it for more than 6 months the mental and physical side effects became horrendous. But it did help, and I'm glad I'm here today :)

</comment></comment><comment><USER12> I had better jump in here right away, because the last thread about depression on Hacker News basically got swallowed up by an n=1 anecdote, and while anecdotes are wonderful (we all prefer to make decisions based on anecdotes we feel we can relate to rather than based on statistics), it takes a lot more than one anecdote to represent a complicated subject.

As my last keystrokes about depression here on Hacker News pointed out, there isn't just one disease known as depression. Depression is a symptom pattern (prolonged low mood contrary to the patient's current life experience) found often in the broad category of illnesses known as mood disorders. Behavior genetic studies of whole family lineages, genome-wide association studies, and drug intervention studies have all shown that there are a variety of biological or psychological causes for mood disorders, and not all mood disorders are the same as all other mood disorders. I know a LOT of people of various ages who have these problems, so I have been prompted for more than two decades to dig into the serious medical literature[1] on this topic. (I am not a doctor, but I've discussed mood disorders with plenty of doctors and patients.) I've seen people who tried to self-medicate with street drugs end up with psychotic symptoms and prolonged unemployment, and I've seen people with standard medical treatment supervised by physicians thrive and enjoy well off family life. The best current treatment for depression is medically supervised medication combined with professionally administered talk therapy.[2]

The human mood system can go awry both by mood being too elevated (hypomania or mania) and by it being too low (depression), with depression being the more common symptom pattern. But plenty of people have bipolar mood disorders, with various mood patterns over time, and bipolar mood disorders are tricky to treat, because some treatments that lift mood simply move patients from depression into mania. And depression doesn't always look like being inactive, down, and blue, but sometimes looks like being very irritable (this is the classic sign of depression in teenage boys--extreme irritability--and often in adults too). Physicians use patient mood-self-rating scales (which have been carefully validated over the years for monitoring treatment)[3] as a reality check on their clinical impression of how patients are doing.

As the blog post kindly submitted here points out, a patient's mood disorder influences the patient's whole family. The more other family members know about depression, the better. Encouraging words (NO, not just "cheer up") are important to help the patient reframe thought patterns and aid professional cognitive talk therapy. Care in sleep schedules and eating and exercise patterns is also important. People can become much more healthy than they ever imagined possible even after years of untreated mood disorders, but it is often a whole-family effort that brings about the best results.

[1] [http://www.amazon.com/Manic-Depressive-Illness-Disorders- Rec...](http://www.amazon.com/Manic-Depressive-Illness-Disorders-Recurrent- Depression/dp/0195135792)

[2] Combination psychotherapy and antidepressant medication treatment for depression: for whom, when, and how. Craighead WE1, Dunlop BW.

Annu Rev Psychol. 2014;65:267-300. doi: 10.1146/annurev.psych.121208.131653. Epub 2013 Sep 13.

[3] [http://emedicine.medscape.com/article/1859039-overview](http://emedicine.medscape.com/article/1859039-overview)

<comment><USER13> Thank you very much, this is insightful.

> Encouraging words (NO, not just "cheer up")

Would you mind sharing a little on how to go about this exactly? To be clear, I'm not surprised that "cheer up" isn't the right way - but I don't know what is. I don't even know how to talk positively to, say, cancer patients, let alone sufferers of mood disorders.

<comment><USER14> I had cancer when I was younger, and the best place to start is to ask yourself: "Do I need to say anything at all?"

Unless you're a close friend (with whom the patient is completely at ease), then you're putting them in a position where they feel like they have to act strong, smile, and thank you for your concern. (For my situation, I got dozens of phone calls from people I hadn't heard from much in years. I had more than enough on my mind than to appease their desire to show their concern.)

Your concern is definitely appreciated, but you need to choose your moments.

As for what to say? I guess that differs culturally and your relationship. I'm Australian, and I was totally okay with a simple "ah, shit mate, that sucks" over a "if you need ANYTHING, call me* (*but don't actually call me)" \- I know I can call for help, and dozens of people can help, but all I really wanted was to be treated like a normal human. For instance, I was bald from the chemo and got a multi-colour clown wig as a joke present, which made me smile so much. It was a sense of "everything is normal despite being in the midst of chaos." I could count on my friends to distract me from the horrible reality of the situation when I was stressed/sad/confused.

And that is your job. Be a sincere option for distraction and advice when you're called upon. Trust them to ask for help when they need it..and they're much more likely to ask for it if they know you won't be overbearing/over- worried/judgemental/etc.

I don't know how well this advice applies to depression, but I think it's a good framework for being a good friend through most hardship.

(Sidebar: I'm more than happy to be a sounding board for approaching any cancer related issues you've got. Email's in my profile. I've heard all kinds of things, so don't think any question or issue is too simple or stupid!)

<comment><USER13> Thanks very much, your response is helpful. Thanks for the offer, too. Thankfully, I'm not struggling with this personally now, but I'm sure there are people here who are.

</comment></comment></comment></comment><comment><USER15> I had been on medication for a full year and it really helped me become more stable and content with life. I asked my doctor to increase my dosage because some days it just did not seem to be enough. He did, however it did not have the benefits I had hoped and it became harder to do things. So I started to ween myself off and now I am not dele dent on it.

However, like Wil, I seem to be getting angry at the most trivial things. I am considering starting again, but I am about to graduate and take my last finals in a week or two.

I have been scared of taking medication because of what ADHD meds did to me in my youth. Though now, knowing everybody on my mothers side and my sisters needed help for depression at some time or another, I highly support getting help in this domain.

</comment><comment><USER16> What do people do when they're unsure if they're "depressed enough" to be depressed? What about people who are "used to it" and consider themselves good at "dealing with it"? Go to a doctor anyway? Where do people start? With their regular physician? How do people find a therapist that won't jump at medication unnecessarily, and won't ignore you if you think you need it?

<comment><USER17> When something isn't right a long period of time, it's easy to lose perspective on what being well looks and feels like. It may be well worth it to explore your options now while it isn't urgent, until waiting until something changes and you can't deal with it anymore.

Therapists don't prescribe medication- the best they can do is refer you to a doctor or psychiatrist. They can often answer questions about medication though, and help you decide whether that path is right for you. Therapy isn't about medication, it's a different tool altogether.

<comment><USER18> > When something isn't right a long period of time, it's easy to lose > perspective on what being well looks and feels like.

I've found that this is one of the big reasons that many people I know don't seek help, or waited (too) long to do so. Especially for people living alone who can acceptably 'curate' their existence when around others, it's very easy to lose perspective on what is 'normal' or 'healthy'.

It's made me wonder if it might be good to consider going to a psychologist something akin to a yearly dentist checkup.

</comment></comment></comment><comment> josh-wrale I wish she would not have mentioned the kids' issues without their permission. Just the mention of such potentially brings social stigma to their life.

<comment><USER19> OK, but not mentioning it potentially brings social stigma to everyone. It's important to talk openly about mental health issues.

</comment></comment><comment><USER20> I liked the post because it shows the other side of a couple living with depression. I suffer from chronic depression and it is not easy to depend on medication every day with no prospect of "cure". The hardest part is dealing with the stigma associated with it, with people insisting that you are not doing the right thing and finding a way to get over it and free your self from medication.

I know that the "chemical imbalance" explanation is a poor excuse for "we don't know exactly how it works". But there are so many progresses done in our quality of living that were done because someone had a hunch and some practical, reproducible results showing that it worked. Think about the practice of washing hands when going from one patient to another in a hospital? When it was suggested, people couldn't see a connection with dirty hands and spreading diseases.

I lost a son that suffered from a mood disorder to suicide. It is heartbreaking and it happened when he was apparently getting over the hump of his darkest moments... I have other two children that also struggled with depression and what I found that worked the best for us so far is communication. Being opened about our struggles, talk therapy in conjunction with medication.

<comment> jon-wood This may be utterly inappropriate, but I just want to convey my sympathy for the loss of your son, I honestly can't imagine anything worse. You have my utmost respect for managing to carry on, and supporting your family through it.

</comment></comment><comment><USER21> Since 2001 I have had schizo affective disorder. I has destroyed my career.

I tried to write about mental illnesses and the startup community, which I think is something that needs to be talked about. But my submissions get deleted and censored.

Sometimes your best talent has a mental illness, how do you manage them? Most just fire that talent when they discover they are mentally ill. It is something that has to stop!

</comment><comment><USER22> Doctors are going to be very quick to put you on drugs. After taking the various drugs, talk therapy, etc..

As quaint as it may sound, diet and exercise (the only supplement to that I take is phosphatidylserine now) can really make a difference.

I'm not saying don't do the drugs (especially if your a severe case), but (at least my experience) the drugs are not necessarily as effective as things you can do without all the hassle/expense of prescription drugs.

</comment><comment><USER23> Is this astroturfing? It reads like an ad.

</comment><comment><USER24> Unfortunately (and especially because of the evidence of the cycle that begins with "the doctor increased has dose" and "added another medication"), Wil has a pretty good chance of having a poor outcome. Especially because his medical advice seems to include the deeply problematic "chemical imbalance' theory.

Reading Whitaker's "The Anatomy of an Epidemic" ([https://en.wikipedia.org/wiki/Anatomy_of_an_Epidemic](https://en.wikipedia.org/wiki/Anatomy_of_an_Epidemic)) should be required for anyone considering long-term use of neuroleptics, benzodiazepines, or anti-depressants. And for those who care for them.

</comment><comment><USER25> I cannot help but feel sorry for Will. It would be my worst nightmare to be processed by American psychologists to be placed on Big Pharma's latest medications.

<comment><USER25> For those down voters: I am British, we have the NHS.

Over here healthcare is not just another business, it is a public service. We grumble about the NHS but we love it too. With the NHS you don't have to second guess whether that doctor is after your wallet, or even think about it, he/she isn't.

By comparison the American healthcare system is something that, with a British perspective, appears to have something tantamount to 'Münchausen syndrome by proxy'. With the British NHS you can end up on pills all your life but there is not a business case for it. Meanwhile, in America, if you can be signed up for a smorgasbord of uppers, downers and a few off-label side orders for the rest of your days then Big Pharma is happy.

Here is one of my favourite books that describes what goes on:

[http://www.amazon.com/Blood-Medicine-Blowing-Deadliest- Presc...](http://www.amazon.com/Blood-Medicine-Blowing-Deadliest- Prescription/dp/0452298504)

<comment><USER26> I've been through the wringer with depression in the American system, this has not been my experience.

I've heard this particular chestnut often. In so far as I understand, if your doctor does this, they're committing malpractice. I'm not saying doctors don't do this, or someone's doctor doesn't, but this is not the norm. Not by a long shot.

<comment><USER27> Ditto. In fact, my psychiatrists have _loved_ generics, they don't want cost to get in the way of treatment.

(Caveat: generic mood stabilizers (used for treating bipolar disorder) that are also anticonvulsants have I've heard a bad history of not working like the brand name, First World manufactured originals.)</comment></comment></comment></comment>


Developing a safe and open source DIY Covid-19 diagnosis test - <AUTHOR> https://app.jogl.io/ <comment><USER2> This is the direct link to the project page: [https://app.jogl.io/project/118](https://app.jogl.io/project/118)</comment>