Programming Language Implementation – Part 0 – Tools and Setup - <AUTHOR> http://marcofiset.com/programming-language-implementation-part-0-setup

<comment><AUTHOR> Hi guys, this is the follow up post of a new series I introduced 2 days ago: A Beginner's Guide to Programming Language Implementation. Today we'll be setting up our development environment, and get started with the actual programming next week.

<comment><USER2> Damm, in php ;)

But still great. I'm in the same boat (to build a language) and this is a bit closer to it (I will add -hopefully- pattern matching, union types, a relational algebra).

Suggestions (I have read now dozens of things like this):

\- Something that is not made clear with interpreters is: I need a garbage collector? What happened with memory?

\- I haven't see how manage imports/modules. Look like all the toy interpreters are for run everything at once.

\- Any hint in how improve error messages at parsing, if possible.. That depend in what use to parse it..

\- Know how do math is nice, but I have wonder, what are the minimun necessary of functions to lift from the host language to make possible to build the standard library from INSIDE the interpreter? So, print is built-in, but maybe map and list?

\- I see the introductory post, and think could be nice to support at least List/Arrays (ie a container of things).

\- The interpreter code I have seen, in the AST processing have the tendency of be hard to read (with single letters vars and things like that), so consider that too.

Looking forward to your series!

<comment><AUTHOR> I had a feeling that people would pick at the choice of PHP as an implementation language, but hey, that's part of the game ;)

The code structure will be exactly the same as if I had implemented it in C# or Ruby, so not following the tutorial simply because it's PHP is not a very good reason IMHO.

I will be completely honest with you, some things your asked for are beyond my current knowledge. I began to think about how the standard library could be implemented, but not experimented with this yet. Fortunately, it will be a long time before we get to that point in the series, and I will have figured out how to do it ;) Same thing for modules and imports.

Don't worry about the code, I will try my best to make everything as clear as possible.

Your input is greatly appriated, don't hesitate to give me feedback like this all along the way :)

</comment></comment></comment><comment><USER3> Looks interesting.

Do you already have a working implementation and if so can we see it?

<comment><AUTHOR> I wouldn't want to spoil it for you ;)</comment></comment>


I've closed my Reddit account - <AUTHOR> http://blog.liw.fi/posts/bye-reddit/

<comment><USER2> > From my point of view, it's changing to the worse. He made it clear that as > long as Reddit itself does not get into legal trouble, and harrassment isn't > too overt or particularly public, it's OK now.

Could you please provide references for this statement?

From my perspective it looks like:

-he will not reverse Pao's moves [1],

-he will still not allow harassment or bullying [2],

-reddit will now be more transparent [2],

-no more non-spam shadowbanning [3]

[1] [http://www.bloomberg.com/news/articles/2015-07-11/new- reddit...](http://www.bloomberg.com/news/articles/2015-07-11/new-reddit-ceo- says-he-won-t-reverse-pao-s-moves-after-her-exit)

[2] [https://www.reddit.com/r/IAmA/comments/3cxedn/i_am_steve_huf...](https://www.reddit.com/r/IAmA/comments/3cxedn/i_am_steve_huffman_the_new_ceo_of_reddit_ama/cszu3cv)

[3] [https://www.reddit.com/r/IAmA/comments/3cxedn/i_am_steve_huf...](https://www.reddit.com/r/IAmA/comments/3cxedn/i_am_steve_huffman_the_new_ceo_of_reddit_ama/cszv2lg)

You can read the full AMA here: [https://www.reddit.com/r/IAmA/comments/3cxedn/i_am_steve_huf...](https://www.reddit.com/r/IAmA/comments/3cxedn/i_am_steve_huffman_the_new_ceo_of_reddit_ama/)

</comment><comment><USER3> I have never understood this argument. As a person of colour, I have been at the receiving end of hate and threats many times, including on Reddit. That doesn't stop from going to it and why should it? Unless Reddit is explicitly and only doing this, I don't care. There are hundreds of good subreddits that are strictly moderated and harassment is not allowed. And yet there are others which I cannot stand. But I can easily ignore those.

Should we stop using the Internet because there is violent stuff and discriminatory content? Or should we using Twitter for the same reasons? Where does one draw the line and how?

</comment><comment><USER4> After a while I realized that all this "freedom of speech" talk is really just a euphemism for "let us form hate groups and post pictures of 13 year olds in bikinis."

</comment><comment><USER5> I can't admit i read reddit publicly without fear of being associated with misogynistic trolls that excuse rape. it's like saying you're on 4chan or worse.

<comment><USER6> That honestly reflect more on the people you associate with than on reddit.

</comment></comment><comment><USER7> Nice try Pao :D</comment>


Search ALL Craigslist using Google - What's the problem? - <AUTHOR>

A lot of talk has been made about real-time results to search all of Craigslist, like crazedlist. But what about Google sites like allofcraigs.com?
I have posted ads on Craigslist that have indexed by Google within 2 hours. There is a small benefit to the delay, as most spam ads are flagged before Google indexes them. Fact is, nobody is going to search all of Craigslist using crazedlist, or allofcraigs.com, to find important items they can find locally, that's what craigslist is for. Therefore, real-time results are not that advantageous over sites that use Google custom search.
Thoughts? <comment><USER2> I agree - You forgot a few other benefits to using Google to search all Craigslist.

1\. Quicker over-all search 2\. Relevant ads pertaining to a search query. 3\. Easy to use

I created allofcraigs.com for fun, and I'm surprised by the response so far. Thanks for the mention. Best regards</comment>


Facebook buys Vidpresso's (YC W14) team and tech to make video interactive - <AUTHOR> https://techcrunch.com/2018/08/13/facebook-vidpresso/ <comment><USER3> Before he started Vidpresso, Randall was helping out my YC batch with feedback on their demo day pitches. It wasn't his job - he was just being helpful. The nicest guy you'd ever meet.

Props to Randall on all the hard work building Vidpresso over the years - <USER2> congrats on the exit!

<comment><USER4> Dude thanks so much. Clerky has saved my bacon so much!

<comment><USER5> Loops now, dude.

</comment></comment></comment><comment><USER6> > By 2016, it was telling hiring prospects that it was profitable, but also > that, "We will not be selling the company unless some insane whatsapp like > thing happened. We're building a forever biz, not a flip." So either > Vidpresso lowered its bar for an exit or Facebook made coming aboard worth > its while.

<comment><USER7> Unfortunately there seems to be high incentive and little downside to claim 'we will not sell easy'. You get the upside adoption by any customer concerned with longevity, and when you decide to fold for pennies you write a blog post about your incredible journey.

I get it. You get tired of a product, it doesn't do as well as you hope, but you still want to get acquihired and make sure your hardworking engineers don't end up on the street. Nonetheless, its frustrating when evaluating a startup's product and use 'longevity' as a factor.

<comment><USER4> The product isn't going anywhere for our customers. That's a big reason we did the deal.

<comment><USER8> What does it mean by "bough the talent and the tech, but not the company"?

<comment><USER9> I think that's a poorly-worded way to say "the product will be built into facebook itself"

<comment><USER10> Hmm, I think it's a legal thing to get the right money to the right people (by affecting taxes or liquidation preferences or...)

If Facebook buys the company's IP but not the company itself, and the company pays out that cash in dividends and winds down operations, people could get paid quite different amounts than if Facebook had purchased all of their outstanding stock outright.

<comment><USER11> Buying the company can sometimes be buying certain liabilities they don't want to deal with.

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> Not sure what your plans are but I think there are tremendous upside into bundling their solution natively into the juggernaut that is Facebook Video/Watch. As much as the company has been decried for its influence lately, it means that innovations for acquisitions get to be put in front of a billion people or two (including getting support from engineers who dedicated years to getting code to run on quirky mobile OS).

A personal note to the team, as Facebook is very much a manage-your-own- journey company: I would strongly recommend you look into professional application, as in, Workplace.

A. that means a free trip to London for you, which is always cool. You get to meet more people with whom to joke: "It's in the middle of a swamp! — I know — Why?! – I don't know."

B. there are tons of applications, roughly empowering internal equivalent to Coursera. Any solution that I know about (and it's alas a lot: worked for 20+ companies) is bad, expensive, dysfunctional and impractical.

Getting people to use video to document their workflow, think about edge- cases, etc. is the most impactful thing I can imagine because it introduces billions into structured logic in their tasks, allows them to step from code- as-Excel-spreadsheet into code-as-a-system.

Workplace is already teaching a lot of businesses to be open, transparent, interest-driven, to record interaction for later use without closely-defined audience, etc. That happens a lot through Workplace videos — in spite of that tool being very feature-poor. Adding editing, slide-control and later something closer to choose-your-own-adventure, tests, etc. that would be incredible.

I hope you can demonstrate that there is a lot of great things to be done with interactive videos.

<comment><USER13> The latter part of your comment sounds like "The Circle." Does every interaction need to be recorded and logged?

<comment><USER12> I'm not talking about interactions but processes: things that other part of the organisation relies upon. Think things like bus-factor.

</comment></comment></comment><comment><USER14> Yet another example that if people want to put their money where their mouth is w.r.t not being bought out, only trust a not for profit organization.

<comment><USER15> I'm confused by the idea that this is bad in some way. The point of business is to make money. For startups in particular, the entire commercial goal can roughly be broken down into one of three things:

1\. Build a lasting private business (Mailchimp) 2\. Go public (Facebook) 3\. Get acquired (Instagram)

Obviously, I'm ball-parking here, but 99% of startups with "successful" outcomes happen via acquisition. For the vast majority of most startups, acquisition is the only viable outcome other than failure.

<comment><USER16> Point is, don't go around promising that you are in it for the long haul when you can't/won't made good on it.

</comment></comment></comment><comment><USER17> It's strange that the investors would agree to having the team and tech aquihired. What's in it for them?

<comment><USER18> Optics of having a portfolio company "acquired by fb", non-zero returns (more relevant for angel, for VCs it's pretty much the same as nothing), frees up mental energy to focus on other companies.

</comment></comment><comment><USER19> Was this something like OBS is for Twitch/YouTube streamers? Where you can set different scenes and overlays that are pretty interactive when connected properly to whichever platform's API!?

<comment><USER20> Yeah, though a bit more complex than that. It basically allowed companies to create professional broadcast-like workflows with a Tricaster and complex setups using Facebook Live and other protocols.

When I worked at Mashable and Facebook was paying us to make a certain amount of Facebook Live content a month (a practice Facebook started in mid-w2016 and stopped in mid-2017, which was painful for the media companies that had hired out teams to produce that content), we used Vidpresso to make the broadcasts look more professional, with updated lower-thirds, easy multi-camera switches, pre-recorded playback via Tricaster, etc. I don't remember if we used Vidpresso at Gawker/Gizmodo Media Group or not, but the software was definitely powerful for live broadcasts.

IIRC, Vidpresso was one of the first solutions to get certified to use the various Facebook Live APIs and it really changed what types of video we were able to produce.

I've known Randall a long time and am thrilled for him and his team that they could make this exit. This is the sort of thing Facebook should be offering its larger media customers.

<comment><USER19> That sounds amazing - truly a tool to make life easier to many. Love it

</comment></comment></comment><comment><USER21> Congrats! Facebook could not have gotten anybody better to make live video awesome. I'm excited to see what the future holds for the fb/vidpresso combo.

<comment><USER22> The future holds advertising and collecting usage data, what else can it hold?

<comment><USER21> That is a little too reductionist. It can hold a lot of things. Millions of people get all of their facts and information from live video. A lot of it is delivered by cable tv right now, but in the same way that TV news overtook newspapers, Facebook will overtake cable. People have watched moon landings, walls falling, and the birth and death of democracies, all live--and there were always advertisers paying the bills.

I know that we're in the middle of an awakening of sorts about personal data, but that doesn't negate the value that services like Facebook can offer. I may be naive, but I think this is a step in the right direction.

<comment><USER22> Advertisers are just a bunch of people paying money to blast our ears and eyes with spam about their products. They're not philantropists. They're not financiers.

Facebook is a vehicle for said spam, disguised as a social network. Yes, it has to offer _some_ value, otherwise no one would stare at the ads.

Putting Facebook and advertising in charge of providing facts and information is a stupefyingly bad idea. It's already shown that it can't provide either.

And if they really want to do it, then they should be regulated.

<comment><USER21> I agree that regulation is a good idea. Throughout history, news and facts have always been provided to most people by groups with vested interests in controlling the prevailing narrative. It started in churches, moved to papers and has taken a lot of forms over the years. Moneyed parties have always used their resources to sell products, ideas, and agendas via these channels. Companies like Facebook are different because they allow near-universal access.

Facebook doesn't provide the information, they provide a platform and tools for anybody to be a publisher. Anything they can do to improve the platform is a good idea.

All this is to say: Facebook has done a great thing by bringing Randall and co. on board and should continue to bring new ideas and talent in, through whatever means they can.

</comment></comment></comment></comment></comment><comment><USER23> Congrats dude!

<comment><USER4> Thx!!

</comment></comment><comment><USER24> Excited for Randall. Good on FB.

congrats to you and the team

</comment><comment><USER25> props to the team! we were fellow best-in-class products at NAB YEARS ago. haha

</comment><comment><USER26> Congrats, Randall and team!

</comment><comment><USER27> Probably the only way they can hire decent talent anymore.

<comment><USER28> I've joined Facebook today as part of the Vidpresso team. The opportunity to build something that can reach a large group of users is attractive: basically everything I've worked on for the past 15 years has been very niche.

As long as the SV giants have that global scale and keep demonstrating that they value engineers, I don't think they'll have trouble hiring.

<comment><USER16> Does it matter that the end goal will be to funnel all the innovation, countless developer hours, and blood sweat and tears into selling ads?

<comment><USER28> For live video, nobody really knows how to make selling ads even work. It's actually an interesting challenge to try to come up with formats where ad monetization makes sense for the content producer — I'm convinced they'd have to be compelling formats for audiences first.

<comment><USER29> ...

[cricket] ...

[pavlov questions the meaning of his/her work] ...

[cricket]

<comment><USER28> You don't know anything about me. I've spent years working on various products that were paid by users, not advertisers. Guess what? Selling software licenses is very hard. You can't blame me for not trying though.

Video is traditionally ad supported — after all, nobody ever paid for broadcast TV. But preroll/midroll ads that interrupt content don't work well in live online video. Interactivity offers potential new avenues to sell people stuff that they might actually want. I don't know if it will work, but it's worth exploring.

<comment><USER22> Why is it so hard to admit thay you sold out and are working for an evil company?

Yes, you're not killing baby seals or helping give people cancer. You're just working for the company that surveils a large part of humanity, tries to get them addicted to tapping stuff, deceives them into buying stuff, "accidentally" gets involved into election manipulation, etc. They're also working hard at getting their hands on medical and banking information.

All around great guys, those Facebook employees.

<comment><USER30> Maybe you're right; but attacking someone personally is not an ok way to express how right you are on HN. Please post civilly and substantively, or not at all.

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

<comment><USER22> I don't want to be right, I want the people that are abusing others to realise that they are doing a bad thing.

My message was too inflammatory and I have to rethink my approach to not run afoul of the rules. This has to be said though: a large reason people think it's ok to work for companies like Facebook is because there's almost no social pressure against it, including here.</comment></comment></comment></comment></comment></comment></comment></comment></comment>


Why Google or Yahoo should buy Twitter. - <AUTHOR> http://laserlike.com/2008/11/14/why-google-or-yahoo-should-buy-twitter/

<comment><USER2> _Twitter offers a potentially superior signal to noise ratio than blog content_

Does anyone agree with this? I don't think brevity implies a greater density of information; often it means there's none at all.

There's no context to real-time information, no opportunity for its audience to either discuss or ignore it, and therefore no way to judge its relevance. The author seems to feel that the sheer _newness_ of a Twitter feed guarantees its importance, but I think the chances of 140 characters written five minutes ago being more relevant than the topmost Google result is close to nil.

<comment><USER3> I don't think it has anything to do with SN ratio, but attention. Twitter gets quite a bit of time from each person a month, and therefore it is a valuable service.

<comment><USER4> from how many people though? i'm willing to bet not that many.

</comment></comment></comment><comment><USER5> I would think Yahoo is having enough trouble with their own business model. To me, it wouldn't make sense to take on something that's, so far, been almost impossible to monetize.

</comment><comment><USER4> too expensive for how much money it brings in. plus, it doesn't add anything to the google experience.

does twitter hold any patents? i read a while back that software patents don't apply unless they are somehow linked to hardware.

</comment><comment><USER6> Please, no, those guys have fucked up enough start-ups already, leave Twitter alone!

<comment><USER7> Video of you crying like the "leave Britney alone" 'guy' please...

<comment><USER6> Can't... all my tears were spent on previous start-ups.

</comment></comment></comment><comment><USER8> doesn't google own jaiku? and isnt jaiku just twitter++?

<comment><USER9> Twitter has much more mindshare than Jaiku, at least among the people I know.

<comment><USER10> yeah and it doesn't help they closed down invites for n months after they got acquired and wasted time porting their codebase over onto app engine

</comment></comment></comment><comment><USER11> where is uncov dude when you need him? twitter is another example of a service that is slavishly adored by a microaudience but means nothing to 99.999% of the rest of the world and NEVER WILL. frankly yahoo would make more money acquiring dear abbey, fantasy badminton or more outlandish horoscopes.</comment>


Apple is about to do something their programmers definitely don't want - <AUTHOR> https://medium.com/make-better-software/apple-is-about-to-do-something-their-programmers-definitely-dont-want-fc19f5f4487 <comment><USER2> I think open plan offices are great. I hope all the companies I compete with adopt them. ;-)

</comment><comment><USER3> Summary: Open plan office.

Side note: Apple is wasting money, I've noticed that when companies start doing that, they are their way to failure because employees notice and stop worrying about productivity and resources.

</comment><comment><USER4> I've seen a few companies do this. They save big on rent but the impact on productivity is evident.

I guess they are rich enough to waste their employee's time to save a few square feet.

</comment><comment><USER5> I really doubt that Apple, with all its secrecy and internal compartmentalization is going to put its programmers in an "open office". Some teams maybe.

</comment><comment><USER6> Content-free click-bait "summary" ? HN expects better...</comment>


Ask HN: Would you give your parents a Chromebox? - <AUTHOR>

<comment><USER2> No, I think the iPad + optional Logitech keyboard-case is a better solution. The price of a Chromebox is very wrong for what you get out of it. Even a Nexus 7 I'd choose before a Chromebox.</comment>


Big News in Databases - <AUTHOR> http://use-the-index-luke.com/blog/2016-11/big-news-in-databases <comment><USER2> Technically, I agree that limit/offset paradigm is flawed, however, the author just dismisses a valid criticism of keyset pagination with the following:

"keyset pagination has some limitations: most notably that you cannot directly navigate to arbitrary pages. However, this is not a problem when using infinite scrolling. Showing page number to click on is a poor navigation interface anyway—IMHO."

Sorry, but NO. Infinite scrolling sucks, because it fills the page (and therefore memory) with lots and lots of entries, and disallows me to quickly navigate to exact place in the view I need. If I know that what I seek was approximately on page 12 of last search result, I will go straight there (1 click) and navigate from here. I hate downloading the entire history and scrolling from the beginning.

Infinite scrolling is fine the first time, but on repeated visits is just not an option and destroys everybody's valuable time.

<comment><USER3> I agree that infinite scrolling is terrible, but pagination based on nothing more than the rank isn't great either. Why do I need to guess that names starting with a 'G' could be on page 12 (no 14, no 13)? Just paginate by the first one or two letters then. When doing so, you can benefit from database indices again while improving usability.

<comment><USER4> The old Right Stuf website catalog [1] (old catalog not accessible) would list their pages with the first two letters of the first item's title on the page. I found it immensely helpful, and even "borrowed" the idea for a directory on a local govt website (also no longer accessible).

[1] [http://web.archive.org/web/20071016095932/http://www.rightst...](http://web.archive.org/web/20071016095932/http://www.rightstuf.com/)

</comment></comment></comment><comment><USER5> It would be nice if the article could also link to the original announcements of stuff like the parallel execution, with clause support etc (it does link it on one or two occasions). It's a bit sparse on details and this would give people the opportunity to dive deeper.

</comment><comment><USER6> I'll be interested to hear if MySQL's CTEs are optimization fences like in postgres (one of the few gripes I have with pg).

<comment><USER7> Agree. A great code management feature like CTEs is limited to less data- intensive operations because of this :(

<comment><USER8> To each their own. The fact that CTEs are optimization fences in PostgreSQL is one of its dearest features for me: it allows me to insist on a particular execution plan by lifting an index scan into its own CTE. This is important specifically when there's a lot of data and I can't take a chance with the planner getting it wrong.

<comment><USER9> This is why I wish PostgreSQL just had explicit hints. Their argument against is sensible as it does increase the maintenance cost, but when features become defacto planner hints then readability suffers more.

<comment><USER8> I'm surely not the first to think of this idea: but wouldn't it be nice if we could just select from an index directly? Postgresql already represents indices as relations. Then we don't need to make comments executable, we preserve the spirit of SQL semantics, and give the user control to insist on a particular index.

<comment><USER6> It was different in a few ways, but I used to do that with db2 on the as/400, you had physical files (tables) and logical files (indexes) and you could select directly from the logical files - but they were more like materialized views that were sorted in a particular way than exactly an index.

But I agree, it would be a nice ability to have.

</comment></comment></comment></comment></comment></comment><comment><USER10> >Parallel Queries >Commercial databases can do it for decades, but in the open >source database scene it is unique:

That's wrong. Open Source Ingres did it for many years too Of course unlike PG they are not on the Hype train ...

<comment><USER6> Not being on the hype train is a strange characterization - their last release was over two years ago, and its not like its just not popular in certain circles - there are less than 500 questions on SO for ingress verses almost 50k for postgres. Are you saying that it deserves more attention? As much as mysql/postgres/mssql and others in this article?</comment></comment>


NixOS 16.09 released - <AUTHOR> https://nixos.org/nixos/manual/release-notes.html#sec-release-16.09 <comment><USER2> If you found out through gdb that your code compiled with -O0 was still somehow optimized by gcc, or if you found out that your gcc did not optimize your code aggressively enough although you gave it -Ofast, check out this issue [0].

[0] [https://github.com/NixOS/nixpkgs/issues/18995](https://github.com/NixOS/nixpkgs/issues/18995)

Yeah. The devs believed it was okay to make gcc -O2 by default and impossible to override from the command line you gave to gcc.

If you encountered this issue I hope google could quickly bring you to that issue on github. Good luck and don't waste hours to figure out why.

<comment><USER3> Related: enabling debug symbols for all packages by default (in a separated output): [https://github.com/NixOS/nixpkgs/issues/18530](https://github.com/NixOS/nixpkgs/issues/18530)

<comment><USER4> Having debug symbols enabled should be the default in my opinion. Especially in a partially self-compiled distribution like NixOS. The threshold to submitting bugs should be low.

Unf I'm seeing a unicorn (GitHub fail whale) currently, so I cannot see the issue.

</comment></comment></comment><comment><USER5> If I had to give a one sentence summary of this release, it would contain "security" and "closure size".

Thanks to the core devs who made this possible.

</comment><comment><USER6> > the closure size of a minimal NixOS container went down from ~424 MiB in > 16.03 to ~212 MiB in 16.09

Oh nice. Very impressive.

</comment><comment><USER7> I use NixOS for my personal development and on professional projects that are live on NixOS right now. AMA

<comment><USER8> What do you do for Haskell development?

<comment><USER7> At work we use nix+cabal, not nix+stack. Not for any compelling reason other than we've been in business longer than stack has integrated with nix. We have a repo for our consolidated framework that implements our workflow and ops infrastructure parameterized on the project we're building, so we check this in as a submodule in a new project. One thing we do in particular is that we generate nix expressions from cabal files at build time, so we only need to maintain one without updating the other with cabal2nix with every change.

With all this in place in a project, building is as easy as nix-build. Development is as easy as nix-shell. For convenience we have scripts that wrap the workflow for activating a ghci or ghcid shell and some other functions. Deploying to AWS is easy, even though I've never done it myself.

One problem we have is build times with nix. In order to ameliorate this, we have a build server set up with the out of the box nix infrastructure. A developer only needs to build when they make their own changes; within a few minutes of a push the build server will compile the new project derivations and they'll be available to everyone else as binaries. It all Just Works.

As for specifics, the currently implemented Haskell infrastructure in Nix is pretty good. For my personal development I have a few auxiliary scripts a friend of mine cooked up to do very streamlined development. I'm still getting used to it so I can't say much on that front, but it's a very thin wrapper over the stuff in nix. The nix language is really gnarly, but if you can grok it then you can program your build environments in a purely functional way, and that's amazing! I would recommend to every developer that they set up their environment the way they want it. Nix is very flexible and robust. It will handle everything for you, you just need to tell it what you want.

</comment></comment></comment><comment><USER9> Quick question, the url [https://nixos.org/nixos/download.html](https://nixos.org/nixos/download.html) lists the same url for both 32 and 64bits iso, I wonder if these are multiarch images or just an error.

<comment><USER10> An error for sure, we're on it!

<comment><USER9> Aight, have fun. And thanks for the rest.

</comment></comment></comment><comment><USER11> Just did the upgrade an hour ago (from 16.03) super fast and easy and everything still works. Great job nixos team.

For those wondering the procedure is basically nixos-channel add /path/to/16.09

nixos-rebuild switch --upgrade

<comment><USER12> Because of how Nix works, upgrading should leave your system in an identical state as if you had done a fresh install.

You can even downgrade if you want. I've switched to unstable and back to 16.03 (and now to 16.09) without a reinstall and everything still works perfectly.

</comment></comment><comment><USER13> Hardened builds. Excellent work.

</comment><comment><USER14> The main issue I had while using NixOS is that it has a small and somewhat broken set of packages. This is compounded by the very incomplete Nix documentation - its way too hard to create new packages.

<comment><USER10> I agree the documentation needs work. It can be a real exercise in institutional knowledge sometimes to piece things together. I'd love to help you package something new, or fix an existing package if you would like. The thing that kept me going is how easy it was to fix ... after learning the incantations.

I think the project as a whole would welcome suggestions on where to improve docs as well, and would _definitely_ appreciate some new docs being written. It is hard to do this once you're too familiar :(.

<comment><USER15> I don't use NixOS, but would raising documentation bugs the same way you raise bugs against code help?

<comment><USER10> I would imagine so :)</comment></comment></comment></comment>


Show HN: Stellar – Git for PostreSQL and MySQL - <AUTHOR> https://github.com/fastmonkeys/stellar <comment><USER2> Generally the hardest thing with version control on a database (for an evolving codebase) is separating unrelated changes - such as schema changes vs content updates - and branching and merging those changes in sync with the code dependencies. Another issue is non-destructively replaying development changes into test/production environments.

So for example, you might have a feature branch that includes some schema changes and some value modifications, and a content branch that includes a bunch of inserts into a few content tables that happen to include foreign key references to each other (so you need to maintain referential integrity when replaying those updates/inserts).

I don't see anything in the description that indicates this tool address those problems. For me, those are really the only problems that a DB version control system ought to be focused on. Speed of snapshotting is not all that important in a development environment as you typically work on a cut-down dataset anyway. A minute or so to take a snapshot a few times a day isn't a huge deal, whereas taking more frequent snapshots doesn't seem like something that adds any value, if it doesn't address any of the other problems.

<comment><USER3> This sounds like something Sqitch would help with.

[http://sqitch.org](http://sqitch.org)

<comment><USER4> FWIW, I found shmig [1] much simpler than sqitch.

Last I used sqitch, it returned a zero value on error, which made me leery of using it for scripted deployments.

[1] [https://github.com/naquad/shmig](https://github.com/naquad/shmig)

<comment><USER5> Please file a bug report. [https://github.com/theory/sqitch/issues](https://github.com/theory/sqitch/issues).

</comment></comment></comment></comment><comment><USER6> I wish projects like these would always include some basic info in their README about: (1) how it works, and (2) how it might fail.

<comment><USER7> There are only like 700 lines of Python code. Figure it out and submit a pull request to update the README.

<comment><USER8> So it's yet another toy project with grandiose, overblown claims ("git for databases"? seriously?!)

An honest update to the README would be to take the whole thing down several notches, if nothing else then to avoid the kind of confusion the post you're replying to expresses.

<comment><USER7> I really don't think we have to get so worked up about that kind of thing. If you don't like it, just ignore it.

</comment></comment></comment></comment><comment><USER9> If anyone's interested in git-like storage systems then it's work checking out Irmin [1]. Previous discussion is at [2].

Excerpt: _" Irmin is a library to persist and synchronize distributed data structures both on-disk and in-memory. It enables a style of programming very similar to the Git workflow, where distributed nodes fork, fetch, merge and push data between each other. The general idea is that you want every active node to get a local (partial) copy of a global database and always be very explicit about how and when data is shared and migrated

Irmin is _not _, strictly speaking, a full database engine. It is, as are all other components of Mirage OS, a collection of libraries designed to solve different flavours of the challenges raised by the CAP theorem. Each application can select the right combination of libraries to solve its particular distributed problem. "_

[1] [http://openmirage.org/blog/introducing- irmin](http://openmirage.org/blog/introducing-irmin)

[2] [https://news.ycombinator.com/item?id=8053687](https://news.ycombinator.com/item?id=8053687)

<comment><USER10> I've spent a day looking at Irmin, trying to figure out the JSON CRUD interface, but there's just no documentation, and the irc channel is pretty much dead. The code looks good, but it's my first introduction to OCaml, coming from Clojure. Would love to see some more documentation on it.

<comment><USER9> Irmin's still being developed, hence not many docs at the moment. Apologies there was no-one responding in irc (I assume you mean #mirage - there are usually 30+ folks there). The mailing list is quite active and is a good place to pose questions.

[http://lists.xenproject.org/cgi- bin/mailman/listinfo/mirageo...](http://lists.xenproject.org/cgi- bin/mailman/listinfo/mirageos-devel)

</comment></comment></comment><comment><USER11> So, it appears to just copy tables around within the database. I wouldn't want to use this on a DB over a few MB in size. Sure, restores are "fast" (a table rename), but copies are not so much.

I can't imagine this would be kind to a production database (lots of cleanup from copied & deleted tables), and would consume a lot more space than a gripped logical backup of the tables in question.

<comment><AUTHOR> I have regularly used this with database that's nearing 1000 megabytes. I don't particularly mind slow snapshotting because my workflow is more about restoring database back to baseline than taking copies.

Please don't use this for production. It is not stable enough and you only end up with lost data.

<comment><USER11> Why not use a binary backup method? Faster to backup and restore.

<comment><USER12> Agreed. I've been successfully using mylvmbackup on 10gb+ databases for a few years now.

[http://www.lenzg.net/mylvmbackup/](http://www.lenzg.net/mylvmbackup/)

<comment><USER13> We use our own lvm solution at work, works great, we do something like pgsnap to swap to the snapshot or pgsnap master to work on the master. I'll check this out.

</comment></comment></comment></comment></comment><comment><USER14> Why does the author compare it to Git? The functions this software performs are no where near those performed by Git. Nor it is a proper version control system.

</comment><comment><USER15> This sort of thing is useful, but already supported by Postgres through transactional DDL. Migrations that fail will have their transaction reverted.

<comment><USER16> The use case which this really excites me about is automated testing from the GUI level. If the performance is good enough, this would be really useful for restoring DB state in between tests.

<comment><USER17> ASP.NET developers using TransactionScope can use [http://amnesia.codeplex.com/](http://amnesia.codeplex.com/) to manage distributed transactions for automated UI testing.

</comment></comment></comment><comment><USER18> From the code:

        INSERT INTO %s.%s SELECT * FROM %s.%s

Yeah, good luck with that.

<comment><USER19> What's wrong with that? _Assuming_ you escape the table names correctly, that seems reasonable. And if you can't escape the table names, you're going to have a hard time dynamically generating queries anyway. Parameterized queries are a baseline requirement for _values_ , but are rarely supported by client libraries for things like table or schema names.

<comment><USER18> Nothing wrong with the syntax, it's just that if you're going to create an entire mirror of your database, you might as well use mysqldump. (Plus it'll actually be portable).

</comment></comment></comment><comment><USER20> Nice. I wrote a similar tool for Rails / ActiveRecord models: [https://github.com/bronson/table_differ](https://github.com/bronson/table_differ)

It takes snapshots and computes diffs between snapshots or the live database. It lets me drop and re-import some of my app's tables, then compute the minimum set of changes between the previous import and the new import. I wouldn't call it "git for ActiveRecord models" but it appears to be similar to this project.

Comments welcome! The docs, as always, could use some help.

</comment><comment><USER21> The implications for this extend beyond backing up your database.

Imagine a world where daily time-series data can be stored efficiently: This is a lesser known use case, but it works like this: I'm a financial company and I want to store 1000 metrics about a potential customer. Maybe the number of transactions in the past year, the number of defaults, the number of credit cards, etc.

Normally I would have to duplicate this row in the database every day/week/month/year for every potential customer. With some kind of git-like storing of diffs between the row today and the row yesterday, I could easily have access to time series information without duplicating unchanged information. This would accomplish MASSIVE storage savings.

FWIW efficiently storing time series data is big problem at my company. No off the shelf solution makes this easy for us right now, and we would rather throw cheap hard disk at the problem rather than expensive engineers.

<comment><USER22> Have you looked at Datomic? It seems to fit your problem description well.

<comment><USER23> +1 for Datomic, seems to be right in the wheelhouse for this problem.

</comment></comment></comment><comment><USER24> Maybe I'm missing something, but I didn't see anything with regard to indexes, users, stored procedures, views or what not.

Seems like it's for table schema snapshotting in a database without any external storage.

Browsing through the code, I see that it's highly table centric using SQLAlchemy.

</comment><comment><USER25> Line 53 of [https://github.com/fastmonkeys/stellar/blob/master/stellar/o...](https://github.com/fastmonkeys/stellar/blob/master/stellar/operations.py) is

                    CREATE TABLE %s.%s LIKE %s.%s

This made me think of a table called

                    create table `a; drop table users;`  (col int);

... which works in mysql.

I don't know if the stellar code will trip over something like this. But mysql (SQL) shouldn't even allow names like that.

<comment><AUTHOR> Yes, Stellar will probably trip over this. Similarly, if the attacker can edit stellar.yaml, they probably can edit your .bashrc as well.

Im adding this to my TODO list.

</comment></comment><comment><USER26> Unfortunate name, excellent project :)

<comment><USER27> To elaborate on what this comment may be referring to. A Ripple (cryptocurrency) fork was recently released with the name of Stellar.

<comment><USER28> It's also the phonetical-match to an iPhone app:

[https://steller.co/](https://steller.co/)

</comment></comment></comment><comment><USER29> Shameless plug for mite: [https://github.com/jdc0589/mite- node](https://github.com/jdc0589/mite-node) Simple migrations that take advantage of everything you already know about git and sql, plus some other cool stuff.

It's not too mature yet, the readme is mediocre at best, and it has some issues that will popup when working with a team, but it's pretty damn useful.

</comment><comment><USER30> While not exactly the same thing, I've recently found and started using [https://github.com/nkiraly/DBSteward](https://github.com/nkiraly/DBSteward) to specify schema and then store the spec in my repo with the code. It also supports diffing the current schema against a previous one, so that nice upgrade sql scripts can be generated.

</comment><comment><USER31> Interestingly they don't show MySQL benchmarks in the readme; I suspect it might be because the MySQL implementation is pretty basic

[https://github.com/fastmonkeys/stellar/blob/master/stellar/o...](https://github.com/fastmonkeys/stellar/blob/master/stellar/operations.py#L48-L71)

<comment><AUTHOR> MySQL support was definitely an afterthought and could probably be improved (maybe tracking the binary files directly?).

</comment></comment><comment><USER32> I expected something related with Stellar coins.

Looks like a good project, I definitely want an easy way to manage development databases.

</comment><comment><USER33> This is a nice project. I used to have my database dump tracked by git (in binary mode). anytime my db changes I'll have to overwrite the file with the new database dump and include it with the commit.

I'm just wondering if this project offers anything special/better than the method I described.

</comment><comment> iso8859-1 how does this compare to time travel queries? [http://en.wikipedia.org/w/index.php?title=Temporal_database#...](http://en.wikipedia.org/w/index.php?title=Temporal_database#cite_ref- SQL2011_1-2)

<comment><USER34> Any databases that you would recommend for for temporal logic?

</comment></comment><comment><USER35> How does it work? Where does it breakdown? Why are these things not in the README?

<comment><USER36> Because its not doing anything magic whatsoever.

[https://github.com/fastmonkeys/stellar/blob/master/stellar/o...](https://github.com/fastmonkeys/stellar/blob/master/stellar/operations.py#L35-L73)

</comment></comment><comment><USER37> Just a small correction; it's not PostreSQL, it's PostgreSQL.

</comment><comment><USER38> Folks might confuse this with the Stellar currency (stellar.org). You might give some emphasis in the title.

</comment><comment><USER39> Looks very nice, could you put up some practical examples?

</comment><comment><USER40> Typo? Shouldn't it be PostgreSQL not PostreSQL?</comment>


The Mystery of Zach, the All-Too-miraculous Medical AI - <AUTHOR> https://thespinoff.co.nz/the-best-of/06-03-2018/the-mystery-of-zach-new-zealands-all-too-miraculous-medical-ai/ <comment><USER2> Fascinating. Does this man really have any traction, or is he just good at finding a single stooge to advocate for him and generating news articles?

</comment><comment><USER3> This reminds me of the Italian cold fusion guy that was in the news a while ago. What happened to him?</comment>


Review: How I Used Fiverr & What I Got For $50 (10 gigs) - <AUTHOR> http://www.outsource.io/fiverr-review-what-you-get-for-50-dollars-10-gigs

<comment><USER2> And now I'm wondering if the two comments below the article were purchased by the author...

There does seem to be value in Fiverr, though, especially stuff like the "fix my CSS" job. (disclaimer: I was NOT compensated in any way for this comment and I have never used Fiverr before)

</comment><comment><USER3> There's some great gigs on Fiverr, but from the post it seems like you only had some mediocre results.

<comment><AUTHOR> the results were pretty good, actually

</comment></comment><comment><USER4> The font looks awful.</comment>


Apple iMac Pro and Secure Storage - <AUTHOR> https://duo.com/blog/apple-imac-pro-and-secure-storage <comment><USER2> _The unique pairing here provides some very important security properties that prevent the memory chips that comprise the SSD itself from being physically removed from the system and connected to a different system, or from having their contents extracted from the chips and flashed onto SSD chips in another system._

Yet more sadness for data recovery companies and those who've lost files and want their services. Full disk encryption has been around for a long time and, well-implemented, will let you recover the encrypted data to transfer to new media (so the DR company can't see your secrets either, but you haven't lost anything.)

IMHO encryption should be opt-in --- contrary to what those advocating it think, not every piece of data I have needs to be encrypted, and I certainly have plenty more personal files that I would rather have become publicly accessible than lost forever. It's a tradeoff between "if someone hacks in, they can read my data too" and "if something goes wrong, _no one_ can read my data, including myself" and I think this tradeoff needs to be a more explicit choice.

<comment><USER3> In general, lack of encryption enables passive surveillance. I think a better solution than opt-in encryption could be on-by-default, with a multi-party recovery scheme.

<comment><USER4> Doesn't Windows have an option to have Microsoft keep a key in escrow? Seems like a reasonable compromise for most people.

<comment><USER5> I can't imagine Apple offering this option -- it doesn't really align with their strengths (privacy first) and weaknesses (data centers). They'd need to fix so much of iCloud first.

<comment><USER6> [https://support.apple.com/en-us/HT204837](https://support.apple.com/en- us/HT204837)

> _If you 're using OS X Yosemite or later, you can choose to use your iCloud > account to unlock your disk and reset your password_

> _If you 're using OS X Mavericks, you can choose to store a FileVault > recovery key with Apple by providing the questions and answers to three > security questions. Choose answers that you're sure to remember_

> _If you don 't want to use iCloud FileVault recovery, you can create a local > recovery key. Keep the letters and numbers of the key somewhere safe—other > than on your encrypted startup disk_

<comment><USER7> Take a look at this blackhat talk from Apple's head of security Ivan Krstic, where he explains the mechanism they use to secure credentials stored in the cloud: [https://youtu.be/BLGFriOKz6U?t=22m31s](https://youtu.be/BLGFriOKz6U?t=22m31s)

</comment></comment></comment></comment></comment></comment><comment><USER8> These use-cases for specialized processors are prime examples of how Apple's software-hardware bundling can give their products some really cool advantages over competitors.

I'm not a security specialist though -- so I'm curious how valuable these extra hardware protections are to the security community at-large.

<comment><USER9> I know of at least one place where the MacBook Pro fingerprint sensor is approved for authentication, but the only other approved devices are dedicated hardware (security tokens).

<comment><USER10> >MacBook Pro fingerprint sensor is approved for authentication

does the fingerprint sensor API return a signed response from the fingerprint sensor or SE? or is it a simple yes/no?. if it's the latter, the whole thing is security theater.

<comment><USER11> Why does that make a difference?

If it's a signed response, at some point there's another piece of code that checks that the signature is valid and returns a yes/no.

I think the reason Apple's sensor was mentioned in this instance was due to how Apple handled storage and usage of biometrics as described in here [https://www.apple.com/business/docs/iOS_Security_Guide.pdf](https://www.apple.com/business/docs/iOS_Security_Guide.pdf)

Compare that to, say, other laptop vendors: [https://support.lenovo.com/us/en/product_security/len-15999](https://support.lenovo.com/us/en/product_security/len-15999)

<comment><USER12> It depends on where you're authenticating to. If you're authenticating to yourself, then sure a signature is will just be converted to a yes/no and be no better. But if you're authenticating to a server, the server can do the signature verification, whereas a server looking at a yes/no that a client sends would be mostly useless.

</comment></comment></comment></comment></comment><comment><USER13> _In order to understand Apple's decision to switch from the older Serial ATA (SATA) interface to the higher-performing Non-Volatile Memory Express or NVMe, we recommend reading Ramtin Amin's excellent deep-dive into its implementation. The main advantages of using NVMe to provide SSD storage access are that by using all the available parallel operations possible with modern flash-based storage over a four-lane PCIe connection, much better I /O speeds can be achieved compared to older HDD-specific interfaces._

Kinda surprised that this needed an Apple-specific explanation. I mean, didn't all board manufacturers move toward NVMe simply because it's faster than ATA?

</comment><comment><USER14> In these days, a lot of SSD makers have AES engine inside, it encrypts and decrypts on-the-fly. I don't understand the usage of AES in T2.

<comment><USER15> The NVMe storage doesn't look like an SSD and doesn't have a traditional disk controller.

</comment></comment><comment><USER16> We've had hardware accelerated AES FDE on SSDs forever, I think since the Samsung 840pro...

</comment><comment><USER17> I'd like to know if this will help enable support for more authentication methods at boot time for unlocking full disk encryption, such as Yubikey challenge-response or smartcard PKCS #11. Sort of a drag if you're using token-based login but you still need to memorize a password for FDE.

</comment><comment><USER10> feels over engineered to me. a TPM + OS FDE (with AES acceleration) probably gets the same performance without the need for special parts.

<comment><USER18> I assume the goal is to prevent the OS from needing to know the key.

<comment><USER10> what's the problem with letting the OS know the key? it already has access to all the files! the only use i can think of is some sort of multi-user system where you can't trust the kernel, but if you can't trust the kernel, it's already game over.

<comment><USER19> > what's the problem with letting the OS know the key? it already has access > to all the files!

How about when your device is locked in sleep mode. The main processor should lose the key to a certain set of files, as does on iOS.

<comment><USER10> that's more of an argument for encrypting filesystem instead of full disk encryption (which I agree would help in that situation), not an argument for having a custom security co-processor. you can accomplish the same thing with TPM: by using PCR sealed keys for the OS files, PCR + password sealed keys for private/personal files, and wiping the second set of keys every time you lock the computer.</comment></comment></comment></comment></comment>


New report on the cellular effects of a calorie-restricted diet in rats - <AUTHOR> https://www.salk.edu/news-release/eat-less-live-longer/ <comment><USER2> The only reason a study like this works is because it takes place in a controlled environment where they can actually starve the rats (or sometimes make genetic changes that reduce the rats hunger.)

Study after study and clinical experience shows that low calorie diets are really hard for humans "in the wild" to maintain in practice. People who are on them constantly complain of hunger (in the mid-20th century these were actually called "semi-starvation" diets), and go back to their previous weight as soon as they are done. That's why a lot of modern dieting has oriented around low carb / high fat because it means that you get enough calories, but the composition of your macronutrients causes you to lose weight. You don't have to go as low as Keto to get these effects (that's 5-10% carbs) and certainly don't need to entirely cut out fruit, etc. And the results have been observed clinically for 100+ years.

This, however, hasn't prevented academic nutritionist after academic nutritionist from pushing these narratives without any clinical experience. Can you imagine being at least a little hungry for 20 years... the equivalent time span in humans to get the effect reserved here in rats? That's insane. And, more bluntly, probably not doable.

If you're skeptical of this try dropping your caloric intake by 30% for two weeks and tell me how you feel :)

<comment><USER3> To echo other replies, ketogenic and other diets diets with specific protocols (IF) do work, but primarily for behavioral reasons. That is, you're just not that hungry. Or if you eliminate an entire meal (IF), you "save" a ton of calories.

Yes there are subtleties around actual macronutrient composition and gut flora, but the effect appears to be minimal. Find a keto person eating 5000 calories of bacon per day and I guarantee they're not losing weight.

For what it's worth: I'm a big fan of keto for cuts.

<comment><USER2> This actually isn't entirely true. You're operating under the "energy in- energy out" theory of weight loss, but human regulation of body fat is more complicated than that.

Specifically, we store energy in adipose tissue in the form of body fat after a meal (think of it like storing data on disk) and then when we are low on energy we burn that fat (load that data "in-memory"). However, a lot regulates when we burn fat. Blood sugar and insulin levels signal to the body not to burn fat and those come directly from carbohydrates. Additionally, carbohydrates are the initial energy source that is turned to fat. So with no carbs all your body knows how to do is burn fat for energy, and no additional intake of carbs means that there is no excess energy to store as fat to begin with. So, actually, even with a 5000 calorie diet you might see some weight loss... because your body has literally nothing (no carbs) to store as fat.

However, keto and low carb diets do have the benefit of the fact that they are entirely sustainable (unless you're really addicted to bread) so I agree in that way they are behavioral :P

<comment><USER4> > You're operating under the "energy in-energy out" theory of weight loss, but > human regulation of body fat is more complicated than that.

I hear the "energy in-energy out" being dismissed like this often, and while I do agree with you that our bodies are more complex than that, I want to say that in practice this adage more or less just works, indeed to the degree that it's valuable to have in common knowledge to inspire folks to lose fat.

Particularly, if you want to lose fat, you reduce your caloric intake (and what you are consuming, shoot for higher protein intake and lower carb intake). In addition to this, do some aerobic exercises. This is really it. If you do this you're nearly guaranteed to lose fat. I did this, my peers did this, it's really simple, the only hard part is finding the motivation to start and having faithful long-term committal to a routine.

<comment><USER5> The thing is that "energy in-energy out" works if you make some changes while keeping everything else constant.... and we're really, really bad at keeping everything else constant.

Add extra activity, and the natural effect will be an increased appetite that'll nudge you to eat more calories - and it's not a given the effect of that extra activity will be a calorie deficit, the increase in appetite can easily be _more_ than what you spent in those exercises.

If you _try_ to reduce caloric intake, that's a very different beast than actually reducing caloric intake - if you try to reduce caloric intake by skipping carbs at lunch, it can result in reduced activity (so less calories out) and a strong nudge to "cheat" at other meals or snacks; and again it's plausible to get to a situation where the unintended compensation is larger (and opposite) than the behavior modification that you made.

 _That_ is the problem with the "energy in-energy out" model - one does not simply change the 'energy in' or 'energy out' part and expect that other things will stay constant either magically or through sheer willpower.

</comment></comment></comment></comment></comment><comment><USER6> Somewhat tangential. I often see people treating different diet restrictions that make you healthier as if they were competitors. Low carb/high fat, versus low calories, versus intermittent fasting. They imagine the different orientations as startups in a winner-takes-all market and pump their preferred one _against_ the others.

I think a better way to frame a healthy diet is that you should aim to follow all three and realize that they (obviously) help each other work. These are collaborative orientations, not competitive.

You can control i) what you eat (low carb/high fat), ii) when you eat (intermittent fasting), and iii) how much you eat (low calories).

You should be following at least one of them at all times, two of them often, all three of them sometimes.

<comment><USER7> Totally agree. Each diet may affect different pathways; we probably want to engage in all of them to a degree.

Recently I have been pondering how we should eat if higher protein increases all-cause mortality and higher carb diets increase all-cause mortality, so I've come up with my seasonality hypothesis: basically we would experience periods of lower carb or lower protein diets historically, which would engage each of these various beneficial pathways we have.

For instance, and this is my hypothesis: we wouldn't eat wooly mammoth for breakfast lunch and dinner every day, we would eat nothing but it for three days, once a month. Dense carbs would come sporadically ("yay, we found a bee hive" twice a year) and fruits (carbs) would blossom in either only spring or fall.

<comment><USER8> While you are possibly correct that those may be somewhat realistic historic diets, why do you think they would be favorable to a longer, healthier life?

Evolution doesn't generally optimize for longevity, it only optimizes for reproduction. The lifespan of most animals in the wild is much shorter than what can be achieved with a carefully controlled diet.

<comment><USER9> Humans have a long childhood and even the availability of the grandparents can increase the chances of survival of the child. So we adapted to live longer.

<comment><USER10> Reminds me of cephalopods and their outright suicidal reproduction in contrast. It involved a specific gland and when removed they would starve themselves to death anyway.

Granted it is a very different niche in the ecosystem but it hints that it is a matter of self-perpetuation where longer lifespan in this case is a side effect.

</comment></comment></comment></comment></comment><comment><USER11> I've done strict calorie tracking for restriction, keto as well as IF.

The best I've ever felt was keto, the easiest for me to adhere to was calorie tracking. It's marginally harder if you eat out a lot, but if you cook for yourself and can throw everything on a food scale for a week or so until you get an idea of what's servings of your most commonly-eaten foods looks like, tracking calories made losing weight for me and reducing my daily eating almost comically easy. There's a switch in my brain somewhere that works really well when I have to enter the calories of everything that goes in my mouth into an app....suddenly that cookie or those chips that were so hard to resist aren't a thing for me at all....my brain manages to yell "200 calories for THAT?? Nope." I found myself eating more at the end of the day just to hit my total calories and macros.

<comment><USER12> The easiest way I found to stay on a diet as a lifestyle (instead of dieting for a bit and then stopping and regaining the weight) is alternate day fasting.

I found I can't just decide never again to eat the things I like and never again feel sated. Feeling hungry constantly isn't exactly my idea for the rest of my life.

Alternate day fasting lets me survive a day with no calories knowing that the next day I can be sated and eat (almost) whatever I want.

I have also found that when I eat every other day I put much more attention to what I eat on those days -- I mean, if I just did not eat yesterday and I won't eat tomorrow I want to eat well today. Even if I am going to eat sweets -- I will try to go for something better and not feed myself with garbage.

I also found that alternate day fasting is good willpower training. Being able to restrict myself from eating for an entire day somehow trains me to be better at other things that require willpower.

<comment><USER13> So are you saying that you continually eat only every other day? Or is this just something you do time to time? Curious as much as anything. How long have you been doing this?

<comment><USER12> I have lost 25kg (55 pounds) over a course of a year. Half of that was intermittent fasting (one day eating for about 10 hours, then no calories for the rest, about 38 hours) but accounts for 3/4 of results.

When not eating I would not eat or drink anything that has any calories in it. I typically drink water, black coffee or green tea.

I have also tried longer fasts from time to time (2-7 days typically, 2 weeks once) and then I would supplement with vitamins, l-tryptophan and lean broth/bone broth in moderate quantities (a cup a day), just for safety and general well-being (l-tryptophan is precursor to serotonin and mildly anti- depressant).

Intermittent fasting is hard at the beginning but after about 2 weeks I get used to new regime. It seems it is the same every time I start it anew. It might be getting easier but I think that's because I already know what to expect.

Also, when intermittent fasting it is much easier to start longer fast. I find, when fasting for more than 2 days first two days to be the hardest.

</comment></comment></comment></comment><comment><USER14> Since people are sharing anecdotes I might as well share mine. I've personally tried IF, keto, calorie counting, and various combinations of all three. I've only ever lost weight when doing some form of calorie counting, and since that's easiest for me without putting other restrictions on my diet, I've settled on just tracking calories long term.

<comment><USER15> I have a lot of success with high fat / high protein diets because they let me function better with lower calories.

I subscribe to the church of keto / slow carb in broad strokes. I think there is a hormonal element that we don't fully appreciate that relates to our ability to lose weight effectively.

My frustration with pure calories in / calories out is the rumination I do with how much calories we really extract from certain foods. I am convinced (as some science agrees) 100 calories of sugar and 100 calories of bacon aren't handled the same. I also wonder about how some people must have faster digestive systems and if it moves through faster are you still extracting the same calories as someone else...

<comment><USER16> From what I understand, 100 calories of bacon and 100 calories of sugar is the same. Though there are other compounds in those that may trigger effects in your body.

That said, how calories are measured is from an average approximation. It is true that different people may yield slightly more or less calories from the same foods. Calories are what your body extracts from the food post digestion.

That said, I've never seen strong indicators that the maximum and minimum are that far apart. So it could be that you are a huge outlier and your body extracts way more calories from food A then the average person, or way less. But I think those chances are slim, that is, for you to be such an outlier.

</comment></comment></comment><comment><USER17> Do we actually know whether these effects are triggered by calorie restriction in general, as opposed to restriction of some specific nutrient that's happening incidentally to the calorie restriction protocol? I seem to remember some reports from ~10 years ago that protein restriction, and possibly even restriction of specific amino acids, has shown similar effects.

<comment><USER18> I think it's very clear that is the calorie restriction that's increasing lifespan. It's worked across many studies on almost every organism tested

<comment><USER19> Have we ever gotten clarity on whether these are starvation diets pushing the subjects below what would normally be considered healthy weight? Vs reining in over-eating behavior?

E.g. if we imagine running this on humans, are we talking about a BMI of 20, or 16?

</comment></comment></comment><comment><USER19> Many of the observed effects at least distantly remind me of the known effects of exercise.

I wonder if there's an intersection, e.g. without adjusting your eating habits, exercise results in an _effectively_ calorie-restricted diet?

If there is no intersection, I wonder which is more valuable than the other? Not much exercise is going to be happening on a starvation diet.

<comment><USER20> I think during physical work your muscles consume glucose. Potentially large amounts. The liver gives up it's stores of glycogen. Afterwords the liver will efficiently take up glucose to replenish it's stores of glycogen. I think that dynamic is a lot better than the insulin mediated glucose to fat conversion dynamic you get with sedentary people.

</comment></comment><comment><USER21> I don't think I'm mentally capable of following this kind of diet for a very long time. It just makes you hungry and less productive. It also weakens you in terms of physical strength.

<comment><USER22> That's why I go to gym at least 3 times a week. I build muscle to increase my "static" calories burn - and obviously burn calories while lifting weight. I kicked sugar as well.

</comment></comment><comment><USER23> especially in lab rats, the null hypothesis is that lab rats eat too much and too regularly.

this may or may not generalize.

</comment><comment><USER24> I watched part of Aubrey de Gray on Joe Rogan yesterday. He said that fasting (which is caloric restriction if not identical to it) has a smaller effect on lifespan for animals of greater mass:

Roughly

\- worm: 5x longer lifespan by fasting

\- mouse: 50% longer

\- dog: 10% longer

\- human: 1-2% longer

I'd be interested to hear support or refutations of this. It seems like something that should be pretty well studied by now.

</comment><comment><USER25> Original title: "Eat less, live longer Salk scientists show how caloric restriction prevents negative effects of aging in cells"

What it should have been: Are you a lab rat? Eat less, live longer! Salk scientists show how caloric restriction prevents negative effects of aging in cells _of rats_

</comment><comment><USER26> I have read that calorie restriction can "reset" the immune system. How do you eat calorie restricted diet without getting very thin?

If you eat 30% less than you should calories do you not eventually get so thin that you die from under nutrition?

<comment><USER17> It was 30% below a "normal diet" (presumably some reference diet for lab rats), not 30% below maintenance. Weight loss wouldn't continue indefinitely.

</comment></comment><comment><USER27> so how does this translate to my day to day?

can i skip breakfast and eat whatever i want for 6-8 hours, ala IF?

does the window of consumption not matter, and i just need to eat fewer calories on the day?

<comment><USER28> I don't have any formal education on this topic, but I did lose a bunch of weight and keep it off, partly thru intermittent fasting, so I can offer anecdotal evidence.

For me, simply, it's easier to eat less calories if I intermittent fast. For some reason, if I don't eat breakfast or lunch, I find my hunger is actually sometimes _lower_ , and I don't need to eat a bigger dinner to make up for it.

Certainly eating low-g.i\high-carb foods seems to make me get hungry again very easily.

I also had really good luck with keto, and sometimes a combination of both.

I believe the reason is something to do with blood sugar and insulin not spiking as much, but I'm not a biologist in the slightest.

<comment><USER29> Eat less & eat often - doctor recommended me once. And its works fine. He also said fasting and "don't eat breakfast or lunch" are destructive, regular feeding matters.

<comment><USER28> I don't believe the research and evidence are going that way.

That being said, I will concede that specifically for some (not all) people with some eating disorders, restricting intake can be detrimental to recovery as it increases the chance of a binge later in the day. If you have binge eating disorder, be aware of that if you're considering intermittent fasting.

<comment><USER30> > That being said, I will concede that specifically for some (not all) people > with some eating disorders, restricting intake can be detrimental to > recovery as it increases the chance of a binge later in the day. If you have > binge eating disorder, be aware of that if you're considering intermittent > fasting.

This is exactly why I don't do that well with fasting, and I don't even have an eating disorder. With anything more than 16:8, it's very easy for me to start binge eating, so the whole thing becomes counterproductive.

Every time I seriously lose weight (usually twice a year, once after winter and once after Christmas), it's eating small, high protein/low-carb meals every 3 hours or so. That puts just enough volume into my stomach to keep the hunger pangs at bay.

</comment></comment></comment></comment></comment><comment><USER31> I wish that it was possible to do a caloric restriction study on people who work out. I spent most of my 20s eating roughly twice as much as average and hitting the gym 3-4 times per week and I never felt better, especially after 20 rep squat sessions that naturally raise hormones like testosterone and HGH.

I occasionally cut calories to lose weight or train my metabolism to be "ready" for emergency situations (which was honestly camping or going broke, not exactly military excursions), but in my experience it basically felt like death. Like I could feel my body catabolizing muscle and I had flu-like symptoms if I took it too far for too many weeks.

Anecdotally, my parents' boomer generation felt that bodybuilding was generally a waste of time. If you watch old movies from the 60s and 70s, people were especially lean. And then unfortunately juicers in the 70s, 80s and 90s ruined the reputation of bodybuilding so everyone figured that being strong meant taking steroids. It's only been in the last 5-10 years or so that I've noticed a resurgence in natural bodybuilding (check out Jeff Nippard, Steve Cook and Mike O'Hearn for examples of what's possible natty).

So personally I really feel that lifting weights from about 15-16 years of age for life probably replicates many of the health effects of calorie restriction. Like, Arnold Schwarzenegger did some of his best work in his 40s when he was in better shape than most people in their 20s. Many athletes in their 70s and 80s look like they're 50.

An untrained human bench presses about 100 pounds. When I was growing up, a 300 pound bench was considered mastery. Today with YouTube and better workout programs and supplements, that's probably 400-500 pounds. I personally would choose to have 3-5 times average strength (anything above 4 is metahuman IMHO) rather than spend my life at a withered calorie restricted strength of 1/2.

Of course ethically, it would be better for the planet if nobody worked out I guess. That's a separate discussion though, and I feel that some of the downside could be alleviated if the extra calories came from relatively benign sources like rice and beans. So my question is, is this all just vanity? Or would a diet/exercise approach be comparable to calorie restriction?

<comment><USER32> Seems to me like working out you just naturally need more calories. So it's the same thing - you use more calories than you eat. Like how Michael Phelps are something ridiculous like 10,000 calories a day while training.

<comment><USER33> You can eat like a pig and perform de facto caloric restriction if you work out hard enough. No need to subscribe to whatever diet religion is in vogue on instagram; just burn more calories than you take in and you will loose weight. It's a basic physics equation.

</comment></comment></comment><comment><USER34> I recently read a copy of Isaac Asimov's "The Chemicals of Life." Written in 1954, the book talks about how and why our bodies work. It hardly mentions DNA and focuses on the larger structures of enzymes, proteins, vitamins, and hormones. Some of the information is outdated in its presentation, but the book still holds up in almost all areas. (Also, I had never realized Asimov was a Professor of Biochemistry. He knew his stuff in this area.)

The first chapter of the book is titled, "The All-Important Protein." This struck my 2020, DNA-oriented mind as an odd starting point, yet Asimov was very clear: "all life is protein." The book is remarkably lucid, and here's one of the best portions of the book:

"Suppose the food you ate contained very little fat. That wouldn't bother your body a bit. It would take the carbohydrate you eat and turn it into fat. It happens all the time. Everyone knows what starchy foods will do for the waistline.

"If both fats and carbohydrates are low, the body is still not at a loss. It can manufacture both out of the proteins of the diet.

"Where the body _does_ get stuck is in the case of a shortage of proteins. It cannot manufacture proteins out of fats and carbohydrates. Proteins require nitrogen, and neither fats nor carbohydrates have any. So proteins can only be obtained for the body by making certain that protein is in the food. It is impossible to live on a diet of starch, butter and sugar. You can get all the energy you need, but you can't build tissue."

Asimov places heavy emphasis on the two primary categories of what our body cannot naturally produce: essential amino acids and vitamins. Amino acids are the building blocks of proteins. The human body cannot produce nine of these amino acids, and we term these to be "essential" (Asimov said there were only eight; the necessity of histidine for adults was not yet established in 1954.) We must acquire the essential amino acids from a source outside our body. If we don't acquire these essential amino acids, our bodies will fall apart. Wikipedia says "protein deficiency has been shown to affect all of the body's organs and many of its systems" [1]. Asimov later discusses the importance of vitamins, or "atom groupings, which the body cannot make for itself and must get from the food it eats." Without vitamins, we cannot produce certain coenzymes and will fall ill and possibly die.

Essential amino acids and vitamins. I've been focusing my diet on the acquisition of those in correct quantities. My diet-optimizing function seeks to minimize sugar, maximize protein, and moderate the rest. So far, it seems to be working well; I still build muscle at the gym and fat stays off. Wonder if this is what keto basically optimizes for as well.

So many articles about bodily function I've seen online jump straight to considerations of DNA. Certainly, this approach is more accurate, though I do wonder if we the layperson are approaching health issues with too much detail. To analogize to software, it's like we're trying to debug our complex C++ program by pouring over the binary. The issues are far more likely to be with what we're putting in than what's already there.

Sources:

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

</comment><comment><USER35> _"This gives us targets that we may eventually be able to act on with drugs to treat aging in humans."_

Oy. Why do we do this nonsense? Why can't it just be research that helps us better understand how to eat healthy?

/pet peeve

<comment><USER10> Two reasons. First the drug could provide better results than the most perect diet it is worth researching period. It is under fewer constraints than an organic system.

Second, because the theoretical good and the actual results don't align. We could end many STDs by only monogamously coupling for a generation but that isn't going to happen and virginity pledges haven't helped at all.

If "the right way" doesn't actually help in practice can it even be called right?

<comment><USER35> The problem with virginity pledges is that it's a policy of "just don't find any way whatsoever to meet your needs." Generally speaking, dietary advice doesn't boil down to "All food: bad! People who eat are all going to hell! Stop desiring food at all, you evil sinner you!"

I don't think research into how to eat well really compares one-for-one to morality policies of "sex is always bad and we will allow for one and only one right way to ever get laid while still making you feel like shit for wanting it at all."</comment></comment></comment>


Thoughts on 2 Years as a Remote Robotics Consultant - <AUTHOR> https://msadowski.github.io/2-years-remote-consulting/ <comment><AUTHOR> Hi HN!

I've put this article together and thought some of the points I'm making might be relevant for you - especially these about remote work and self-employment. If you have any questions or need some tips then feel free to comment here or send me an e-mail (you'll find it in my profile description)

<comment><USER2> Nice article. Would be interested to hear your thoughts on ROS 2, I haven't tried it out yet. Good luck with your consulting business!

Not a fan of that fake soldier-robot video that keeps popping up on HN. I think it misrepresents the robotics industry and it's horribly violent.

<comment><USER3> My industrial-robotics perspective TLDR on ROS2: the biggest thing it changes is the transport layer, and the transport layer wasn't the reason industry didn't adopt ROS1.

<comment><USER4> What reasons dominated?

<comment><USER3> A few reasons:

1\. Why would you? Having a bunch of nodes communicating with each other makes pretty graphs for a dissertation, but if you really just want to get something done, calling a library is much easier than messing with launch files and dealing with message passing and asynchronous behaviour. It brings in a ton of new complexity to solve issues which are only complicated to people who don't know how C++ threads or coordinate systems or other robotics bread and butter work. It reminds me of that quip, "You had a problem and tried to solve it with ROS, now you have 2 problems."

2\. ROS is designed as a framework, not a library. This means that it's very hard to pick and choose the pieces you like, rather it is all or nothing. It also ends up with a lot of lock-in, and as a result code written for ROS is very hard to take into another context.

3\. A lot of ROS tries to just 'make it work', regardless of if things are only partially configured, misconfigured, etc. If this is a one-off proof of concept then this is fine. If someone dies because things are misconfigured, I want the tools to complain very, very loudly, and preferably not work at all.

4\. Unit testing in ROS environments is a pain. It is more oriented around doing simulation, but the simulation is the top level thing. This means something like business logic that depends on the simulation working in a certain way, or on the outputs of the simulation, is hard to verify the correctness of. This is unacceptable in a business environment.

5\. Tooling. Why does it need its own package manager, its own build system? It even has its own runtime dependency analysis. Just use CMake, and the OS tools. Please please please. Deployment is such a pain!

Anyways this is just off the top of my head. Consider the later points, and then go back to the first one, of "Why should industry use it?" To me, there isn't sufficient motivation for the added complexity ROS brings.

</comment></comment></comment></comment></comment><comment><USER5> I'd like to underscore the "mastermind group" idea, because it's been immensely helpful for my own consulting career. I've been having lunch with a close friend and consultant (now CMO) every Friday for the past few years, and it's a huge difference, albeit difficult to quantify. The benefits include accountability, refining ideas, reducing stress, exchanging consulting tips and lessons learned, motivation, and more.

<comment><AUTHOR> Thanks for your input! Would you have some advice on running the group? Do you have some specific format of the meeting or do you just say what's on your mind? About accountability - do you kind of 'homeworks' between the two of you or is it more about following through and acting on the discussion you had?

<comment><USER5> We follow a loose format:

1) How's the day going? 2) Interesting updates, wins, observations, challenges from that week. 3) What challenges are coming up next week, and how to solve them? 4) What's a proud moment from this week? (We wanted to add a touch of positivity and recognizing successes.) 5) Open discussion - Whatever's on your mind lately, want feedback on, etc.

There's accountability but not strict homework.

<comment><AUTHOR> These are great! Thanks for sharing!

</comment></comment></comment></comment><comment><USER6> First of all, it's really cool...badass even, that you were able to get this off the ground.

Second of all, I am curious to the specific nature of the work that you do 80% of the time.

Do you write software for off-the-shelf robots? Do you add components to off- the-shelf robots? Do you design the components AND write the software?

Is there any design from scratch for things like having a robot that does a very specific task?

Why aren't you starting a Roomba competitor? (You don't have to answer this one...or any of these really, but I am genuinely curious in a way)

<comment><AUTHOR> 80% of the time would be probably software development/integration. Some tasks/requests would look like this:

* We have a working robot now, and this robot will need to perform very repeatable tasks by driving through waypoints. Let's design a state machine that would do that. * We need to make a system for outdoor mapping using a LiDAR. Can you suggest off the shelf LiDAR and localization system that we could use and then integrate everything in ROS? * My robot has misconfigured local navigation and it's not listening. Could you have a look? * The rangefinder we are using on the drone is not performing well. Can you look through the logs and help us troubleshoot it?

Quite often the work requires me to integrate existing software. ROS (Robot Operating System)is amazing for this, as it has lots of open source packages, where some of them work really well out of the box.

I rarely add anything to off-the shelf robots. Most of my clients are making their own robots and want help with architecting/programming these systems. I don't design any components (I don't have almost any experience with electronics). I can do some simple CAD design if needed but my clients are better of hiring someone for CAD anyway.

I'm not sure what do you mean by robot designs from scratch - if you mean robots that you could build and program yourself then yes, there are plenty! I've listed some of the ones I liked the most in Awesome Weekly Robotics ([https://github.com/msadowski/awesome-weekly- robotics](https://github.com/msadowski/awesome-weekly-robotics)).

Currently I don't think I would try to compete with someone like Roomba. It would take huge amount of money to create robots like these at scale for the low price of these units. Also all the electronics need to be certified (at least with a CE mark, but I expect something else would also be needed). Rarely one person can pull something like this off from A to Z.

If I'm ever to start a company I would like to try to grow it organically. If I ever get a really good idea I'll definitely give it a shot.

<comment><USER6> Thanks for the full reply! That's even cooler then it initially sounded.

<comment><AUTHOR> You're welcome! Yes, it's very cool. Unfortunately my job is kinda my hobby now and I'll need to change it somehow.

</comment></comment></comment></comment><comment><USER7> Id love to know how you got your first clients. After being at AWS for about 3 years, I have been working in humanoid robotics in Japan for another 3 years and am really eager to do something on my own and get out of the Japanese work-life balance nightmare. Any advice is appreciated.

<comment><USER8> Do you have a portfolio site? I know someone who is looking for robotics freelancers.

<comment><USER7> Sorry I dont have anything besides my Github: [https://github.com/chrislgarry](https://github.com/chrislgarry). All of the robotics work I have been doing is confidential and theyre quite strict about that.

</comment></comment></comment><comment><USER9> I cannot fathom how anybody could either come up with the idea of taking screenshots from a computer desktop continuously whilst working for a client (in order to somewhat _prove_ productivity, I assume) or is comfortable to a degree with a contracting company taking screenshots from a computer while working for a client.

Really, I can't grasp the absurdity of some people's mind sometimes and wonder about their morality (UpWorks in this case, not yours. Just to be clear.). Not everything that maybe is technically doable is also ethical. If you comply to such practices, I think it will have an impact on your self-esteem and self- respect. Just try to imagine how other fellow hackers, developers or software engineers you admire would think of the idea getting screenshot'ed every other minute in order to control them.

<comment><USER10> I recently made the transition from full-time software engineer at bigco to independent consultant, so maybe I can help explain.

There's a fairly large mentality shift between salary work and contract work. When you're salaried, you're supposed to work eight hours yes - on paper. Really it's generally accepted people work 4-6 hours a day, with the rest being filled with lunch break or internet browsing or doing online chores or whatever. There is a tacit understanding between employer and employee about this, so any steps by the employer to monitor daytime computer usage is understandably seen as breaching this understanding in a misguided attempt to get employees to work more hours - or exposing the employee to arbitrary punishment if management wants to selectively undermine them for breaking rules that everyone breaks.

It's different when you're contracted per hour. When you carve out an hour for a client, it's game time. No faffing around on Facebook, no checking financial statements. You do the work. Does this mean you have to work a full 8 hours? Absolutely not. Just do part-time contracts to fill up as many hours as you want to work, then charge more per hour. Your hourly contract rate will be much more (2x or more) your hourly salaried rate anyway. So, since you're actually factually working during the contracted hours, I don't really mind whatever desktop screenshot system they want to use.

On another note: actually working 40 hours a week basically sucks. Let's acknowledge how good a deal we have as full-time tech employees and show solidarity to our brothers & sisters who do full-time shift work. Pushing full-time work down to 32 hours a week or less is a very worthy goal.

<comment><USER9> Thanks for your remarks. Few things come to mind: First I'd never charge by hour but have (at least) daily rates and I'd suggest every other independent software contractor to follow the same principle.

Second, there is no correlation between the amount of ASCII chars outputted per hour and the productivity/net gain for the client (at least for the type of work I'm doing for whatever that matters). Sometimes I do have to think hard about a problem for a longer period of time, maybe executing on a few ideas before finally presenting and motivating a solution I came up with for a given problem. That doesn't mean my computer desktop looked _productive_ the whole time. In fact much of the important work maybe even done on a sheet of paper.

<comment><USER10> For upwork you also have the option to pay per deliverable. Unfortunately this opens you up to the risk of your time estimates being off by a lot, thus lowering hourly pay.</comment></comment></comment></comment>