Announcing Rust 1.8 - <AUTHOR> http://blog.rust-lang.org/2016/04/14/Rust-1.8.html <comment><USER2> It's not mentioned in the post, but 1.8 also includes support for installing additional versions of the stdlib for other targets using rustup/multirust[1], which is huge for cross compilation:

      $ rustup target add x86_64-unknown-linux-musl
      info: downloading component 'rust-std' for 'x86_64-unknown-linux-musl'
      13.77 MiB / 13.77 MiB (100.00%) 1.47 MiB/s ETA: 0s
      info: installing component 'rust-std' for 'x86_64-unknown-linux-musl'

Which allows:

      $ cargo build --target x86_64-unknown-linux-musl

You can get a list of available targets with `rustc --print target-list`.

[1] [https://www.rustup.rs/](https://www.rustup.rs/)

<comment><USER3> Are official rustc and cargo releases to be expected for running natively on the tier2 platforms (e.g. official rustc for Linux on ARMv7 that targets Linux on ARMv7)?

<comment><USER4> It's probably not out of the question, though are there a lot of people out there who want to actually develop on e.g. Android rather than just targeting it?

<comment><USER5> My laptop is armv7 linux, and not being able to run rustc on it has been annoying. Well, I did find some binary of some old version somewhere, but it's of limited usefulness since it's old, and it didn't come with cargo, which also wants to bootstrap itself from a native binary. The last time I tried it, I couldn't even cross-compile an ARM rustc from x86_64, because the build scripts wanted to run the binary they were building. This is literally the only reason I've been using C and not Rust (which would have been a much more suitable language) for my latest project.

EDIT: Huh. I guess they do have binaries for arm linux now, at least for nightly and beta versions, as of literally two days ago.

</comment></comment></comment></comment><comment><USER6> They should probably change their terminology away from "RFC" for referring to Rust RFCs rather than IETF ones. Maybe RRFCs or REPs something?

In this document is a perfect example of the problem, they list several Rust RFCs by RFC number, then talk about IP RFC based loopback detection, expecting everyone to know that RFC 6890 refers to an IETF one and not a Rust one. I mean, most of us can infer that just by length of the number, but it is pretty ambiguous especially when they're used in the same document like this.

<comment><USER7> I always thought RFC was generic (and/or predates IETF). Is that not true?

<comment><USER8> It is generic and does predate IETF but it's ambiguous to which reference material if the number ranges intersect.

</comment></comment></comment><comment><USER9> I've been using Rust more and more for my personal projects. Frankly, I could not give a hoot about the memory management; it's pretty cumbersome to deal with. What I love about Rust is that it's a low overhead language that uses interfaces. I love interfaces! I honestly think that they're the best way to program.

<comment><USER10> I'm glad you like it :) I'm happy to see more emphasis on the productivity- related aspects of Rust. I talk about memory safety a lot because people ask questions like "what one feature makes you different from C++11?", but the productivity-boosting features like traits and Cargo are just as important in my mind.

<comment><USER11> The importance of Cargo / crates.io cannot be understated, I think.

I've found myself using Rust for little one-off tools and scripts lately because it's so darn easy to type `$ cargo new --bin foobar` on any of the three operating systems I use daily.

There's already a pretty nice ecosystem of web servers, graphics libraries, crypto libraries, etc. -- Not to mention the bindings to existing libs.

At the end of the day I always end up with wicked fast binaries that I can run on Windows, Mac, or Linux with fairly minimal fuss.

\---

I really haven't found a language that hits this niche the way Rust does, which is really strange to me considering Rust's mission statement.

No shell scripting language is that easily portable barring something like MinGW.

I've never had what I'd call a pleasant experience using Ruby, Python, or Javascript on Windows. Not to mention if the language runtimes / stdlibs don't demand it: many of the 3rd party libraries assume a *nix toolchain to build all the C extensions.

Go and Java probably come the closest to writing easily portable software, but I personally find writing Rust to be a more fulfilling endeavor.

\---

The other day I wrote a tool to deduplicate my image library in Rust. The first binary to compile worked perfectly on both Mac OS and Windows, ran wicked fast (on my SSDs anyways), and it was really a pleasure to write. -- Rust's iterators alone really make for some beautiful code.

\---

This was a really long-winded way of saying I love Rust, and thanks for all the hard work ^^,

<comment><USER12> Out of curiosity, what methods did you use for image dedupes? Simple file hash, or something more complex to find e.g. watermark vs no, different crops/scales, etc.?

<comment><USER11> At the moment it is just hash based, which actually remedied most of my immediate problem. (I have 8 drives in my workstation. Many of them are donors from computers long gone. [Portions of] my image library have just been copied around many times without much rhyme or reason. Now it's centralized and properly backed up.)

I did think about comparing images by similarity but ultimately tabled it for a later evening because:

\- I quickly realized I had a lot of reading to do

\- Resolving "similar images" conflicts is a fuzzier, more time intensive process since: (a) maybe the comparison is just plain wrong?, (b) maybe it's not strictly a worse crop, but rather two common aspect ratios which you'd like to keep, (c) maybe it's not actually "watermark" text but rather it's a meme or image macro, etc.

\- Personally: my real problem with images of varying sizes is that I download thumbnails by mistake. That's just PEBKAC and no amount of software can fix that.

(Now that I think about it: it might be nice to have a script which iterates over low resolution images and tries to find a large resolution version w/ Google Image Search.)

</comment></comment></comment></comment></comment><comment><USER13> I never got around to use Rust, maybe I'll get some good answers here on HN, how does Rust compare with Go/Python/Java?

<comment><USER14> They aren't really comparable. Rust is a lower level language that primarily competes with C++ (finally! C++ badly needs the competition). C++ is still around because it is one of the few languages that has a pay-as-you-go model to features and is not GCd, so, you can reasonably do things like write embedded software for micro-controllers, or kernels, etc.

Go, Python and Java (or any JVM language) are all high level garbage collected languages that focus on developer productivity. You pay certain costs just as the price of entry, like garbage collection, and the requirement for a fairly hefty runtime. In return you get various useful features.

Examples:

You would not use Rust to write a large complex webapp as part of a corporate team, that spends most of its time talking to databases or message queues. The best tool for this from your list would be Java.

You would not use Rust to write a small script to do system administration tasks or quickly prototyping a new idea. The best tool for this from your list would be Python.

You would not use Rust to write a small, simple command line tool that nonetheless could benefit from being garbage collected. You could use Go for that (I hesitate to say it's the best tool but plenty of people use it in that way).

<comment><USER15> I'm curious as to what makes you think that Java is preferable to Go for a large webapp that "spends most of its time talking to databases or message queues".

I would have thought that the Go's concurrency model would give it an edge.

<comment><USER16> > I'm curious as to what makes you think that Java is preferable to Go for a > large webapp that

because your large webapp is made by a large team, over a large time span. The same as you don't deploy on power8 but on x86, because x86 is more common than power8 and cheaper.

One of your java programmers leave ? replace him is easy Need to find java programmers ready to do shitty and boring debugging ? easy Your large webapp is in maintenance mode and nobody internally wants to touch it, so you decide to find a cheap company abroad to outsource the maintenance ? easy

Hard to find these three with Go (or rust, and I love both) because right now it's taught in no large scale university nor a lot of people have been exposed "accidentaly" by it. SO if you have been exposed to Go (or rust) and decide to stik with it it's because you actively decide to, not just because of market force. Hence so you don't belongs to those who will want to do shitty bug fixing 8 hours ago, nor to the price of a developer people hire just to have two more hands, nor the kind who will accept a job under-payed for a outsourcing company.

Java, permits your management to feel they can scale the development

<comment><AUTHOR> Not that this invalidates your point, but there are two university classes being taught in Rust right now; I had the pleasure of guest lecturing at Penn's yesterday, in fact. Here's hoping to more of those in the future.

I certainly agree this is a big plus for Java.

<comment><USER16> ah great to know ! I also hope to see more in the future.

here I was playing the devil's advocate, but to have been at both seat (having hard time to hire as a CTO and needing to fallback on PHP in one company / trying to push Rust in my current one) I now see why chosing a stack is not only about tehcnical merits.

</comment></comment></comment></comment></comment></comment><comment><USER17> Anyone know of any real world applications using Rust?

EDIT: [https://github.com/kud1ing/awesome- rust](https://github.com/kud1ing/awesome-rust)

I'm loving the pace of the release cycle! I don't think I can hold off the temptation to try it out - it's too shiny!

<comment><AUTHOR> I gave a talk at a conference this week called "Rust in Production". Some of the companies I highlighted included Dropbox, Skylight.io, and well, Firefox ;)

We're hoping to do more showing off of our production users in the future. Getting more production Rust in the wild is a big personal goal for me this year.

<comment><USER18> I think "Rust in Production" should be added to the FAQ. It does not seem to fit in with [https://www.rust-lang.org/faq.html#how-does-mozilla-use- rust](https://www.rust-lang.org/faq.html#how-does-mozilla-use-rust) or the following question regarding large rust projects.

Q: Which companies use rust in production? A: Dropbox, Mozilla, Skylight, OneSignal, etc with links to the relevant tech blog posts.

I think there once was such a Q but it seems to have gone or I can't find it anymore.

<comment><AUTHOR> Website stuff related to this is coming, don't worry.

</comment></comment></comment></comment><comment><USER19> Congratulations. Particularly, I think the Tier 1 i686 might get Rust more adoption by Windows C/C++ crowds in commercial sector. Improvements for large files in Linux might aid adoption in backup/archive and streaming servers. Just curious, did Dropbox's feedback have anything to do with that?

<comment><USER4> The large file improvements were only needed on 32-bit platforms, and I'd assume that Dropbox's servers are all 64-bit.

<comment><USER19> Alright,thanks. I was just curious if a single deployment on their level led to bugfixes or new features.

<comment><USER4> The Rust team has been in constant contact with the Dropbox team (I should know, I coordinated and attended the original meeting), and I can say for certain that feedback from Dropbox has helped to prioritize and inform the stabilization of several features.

<comment><USER19> Cool, cool. I figured that would be the case. Tge idea behind the questions is kind of my exploration into the many eyes idea. It mostly covers feedback from widespread, random use. Howevet, I figured a small number of smart, industrial users stress-testing a new language/compiler might provide higher than average quality feedback than even twice as many casual developers. So my advice was to try to get such testers soon as key stuff is stable.

Was the prediction accurate in that case? Sounds like it so far.

</comment></comment></comment></comment></comment><comment><USER20> Any word on linux-musl builds so that you can use official rust builds on alpine or void linux? Same question for FreeBSD builds.

<comment><AUTHOR> Regarding BSDs: [https://users.rust-lang.org/t/psa-rustc-cargo-can-now-be- ins...](https://users.rust-lang.org/t/psa-rustc-cargo-can-now-be-installed-on- arm-linux-netbsd-and-freebsd-using-rustup-multirust/5383)

We are still working on musl as a host, it's not there yet, in my understanding. Cross-compiling to it should be easy, but that doesn't help much if you're on Alpine.

<comment><USER20> Wait, is this a different rustup than rustup the shell script?

<comment><AUTHOR> Yes. I might as well take the time to elaborate on the history here.

In the beginning, there was rustup. And it was good. Then, Rust matured, and we started the release channels. Now there wasn't just "Rust 0.9", there was Rust stable, beta, 1.0, 1.1... so many versions. rustup.sh wasn't really built to handle that.

And so, multirust was born. mutlirust was/is a bash-based shell script that wraps up rustup and gives you the ability to manage multiple installs of Rust. And fun things like "this project uses rust stable, but this project uses Rust 1.1" and "please update every Rust I have installed". Stuff like that.

But it was a bash script. Nobody knew that this whole Bash in Windows thing was happening. And we already have a perfectly good, general purpose programming language that runs on all the platforms Rust supports: Rust! So the multirust-rs project was begun, to re-write multirust in Rust.

Once that started to become closer to being finished, we took a step back, looked holistically at all of this, and thought "If we started from scratch, what would we do?" [https://public.etherpad-mozilla.org/p/rustup-new- experience](https://public.etherpad-mozilla.org/p/rustup-new-experience)

And so, "rustup" was born. It's pretty much multirust.rs, but without trying to mimic the old multirust itself. There's still lots of stuff to do before it's ready to become the default way you manage rust installations: [https://internals.rust-lang.org/t/beta-testing-rustup- rs/331...](https://internals.rust-lang.org/t/beta-testing-rustup-rs/3316) and [https://github.com/rust-lang- nursery/rustup.rs/issues?q=is%3...](https://github.com/rust-lang- nursery/rustup.rs/issues?q=is%3Aissue+is%3Aopen+label%3A%22initial+release%22) And of course, many people will want to use their system package manager too. Choice is good. They also play together. But that's for another post, this one is already getting long.

You can find rustup here: [https://www.rustup.rs/](https://www.rustup.rs/)

<comment><USER20> Thanks for the backstory.

It's always much preferable to have as few dependencies for bootstrapping a platform as possible. Therefore, this is a good development.

Similarly, I'm hopeful the Python requirement in the new Rust based build system for rust itself will be removed sooner than later. Building Rust already requires Rust, so what's more logical than replacing the Python part with Rust. It will definitely be easier to get going than having to install some Python modules first. Same improvement should happen in servo's build system which since a few months or a little longer depends on virtualenv.

</comment></comment></comment></comment></comment><comment><USER21> Does anyone have any information about when/if we will see support for higher- kinded types in Rust? There is the RFC thread on Github ([https://github.com/rust-lang/rfcs/issues/324](https://github.com/rust- lang/rfcs/issues/324)), but I haven't been following the trajectory very closely, and a quick synopsis would be wonderful and appreciated.

<comment><USER4> Higher-kinded types are a far-future enhancement. There are several language- level features that I would expect to be prioritized far above HKT; off the top of my head: specialization (an early prototype implementation of this is in nightly), placement-new, type-level numerics, stabilized syntax extensions, and non-lexical borrows. Of those, all but the last is for the sake of runtime efficiency, whereas HKT is just about genericity and expressiveness (neither of which Rust extremely prioritizes, at least not relative to languages like Haskell).

</comment></comment><comment><USER22> I haven't quite looked but is there a timeline for when compiler plugins will be stabilized? Interested in using serde but would prefer using macros

<comment><AUTHOR> Not an exact timeline, but it's something that's being actively worked on. There's even an RFC: [https://github.com/rust- lang/rfcs/pull/1566](https://github.com/rust-lang/rfcs/pull/1566)

</comment></comment><comment><USER23> Does Rust still abort on OOM? I won't use it by choice while it does that.

<comment><AUTHOR> That's the standard library, not the language. You can use whatever semantic you want if you don't use the standard library, which is very easy to do.

<comment><USER23> And since most programs in any language will use that language's standard library (since that's the point of having a standard library), Rust systems in practice will not tolerate memory exhaustion. This property renders the whole system unacceptable to me.

<comment><AUTHOR> There is already an ecosystem of packages for OS development even, and we statically know if you use the standard library or not. Many libraries that don't require it have an option to turn it off.

I understand your skepticism, but we care about this use case and are working to make it easy.

</comment></comment></comment></comment><comment><USER24> A few days ago I posted a comment with my problems with C. Can you use Rust as a better C/cross-platform-assembly?

does it have native support for

\- vectorization/SIMD

\- hinting at likely branches

\- prefetching memory

\- forcing or blocking inlining

and all the magic in gcc C extensions

<comment><USER25> Manual SIMD intrinsics is getting there, not sure how far it has come by now: [https://github.com/rust-lang/rust/pull/27169](https://github.com/rust- lang/rust/pull/27169) I'm sure LLVM does a fair bit of vectorization under the hood too of course, but not sure whether better knowledge of aliasing lets it do _more_ or whether less undefined behavior sloppyness in Rust lets it do _less_ of it than for C++.

Branch hint intrinsic: an accepted RFC but not yet implemented [https://github.com/rust-lang/rust/issues/26179](https://github.com/rust- lang/rust/issues/26179)

Prefetch intrinsic: Looks like a rejected rfc [https://github.com/rust- lang/rfcs/pull/125](https://github.com/rust-lang/rfcs/pull/125)

Inlining: As far as I understand the attributes are #[inline(always)] and #[inline(never)] respectively.

<comment><USER24> Thanks for the links! This info is kinda hard to find if you're not in the loop.

But it looks like low level optimization is a low priority for the Rust project at the moment.

(prefetch is rejected b/c of insufficient testing and branch hinting might get hampered b/c Rust developers aren't trusted to use them correctly)

Maybe I'll revisit it in the future! Appreciate the help =)

</comment></comment></comment><comment><USER26> Finally I'll switch to Serde JSON :) I use beta and beta is 1.9 today, with awesome features stabilized!

<comment><USER2> Which feature in 1.9 relates to Serde?

<comment><USER26> Looks like I was wrong. Sorry.

</comment></comment></comment><comment><USER27> BTW, does rust come with some kind of ide support tools, e.g. a commandline tool for autocomplete?

<comment><USER28> Not natively for now, but racer can do it : [https://github.com/phildawes/racer/](https://github.com/phildawes/racer/)

IDE is a current goal : [https://www.rust- lang.org/ides.html](https://www.rust-lang.org/ides.html)

</comment></comment><comment><USER29> Great news!! Yet is vagrant a real contributor? Or someone messed up his git user.name?

<comment><AUTHOR> It's someone with a name 'vagrant' in their git info, yes. Not the company.

</comment></comment><comment><USER30> Anything big (bigger than usual) planned for 2.0?

<comment><USER31> After 1.9 1.10 will come. There is no plan for 2.0

<comment><AUTHOR> Yup. There's even one cool feature we already know will be in 1.10: stable bootstrapping. You'll be able to build Rust 1.10 with Rust 1.9. And Rust 1.11 will build with 1.10. And so on and so on. This should help packagers significantly.

<comment><USER4> Is there a tracking issue for this?

<comment><AUTHOR> No, just a PR: [https://github.com/rust- lang/rust/pull/32731](https://github.com/rust-lang/rust/pull/32731)</comment></comment></comment></comment></comment>


Lenovo COO Jumps Ship To Become President And CEO At Chip Maker AMD - <AUTHOR> http://techcrunch.com/2011/08/25/lenovo-coo-jumps-ship-to-become-president-and-ceo-at-chip-maker-amd/

<comment><USER2> Nice. I can't wait to see the laptop world in about two years.</comment>


3 simple steps to better Android app ratings and comments - <AUTHOR> http://blog.androidlicenser.com/33005564

<comment><USER2> This rubs me the wrong way. The developer is breaking his customers' apps with his copy protection, and then expects to get credit for "solving" a problem that shouldn't have existed in the first place.</comment>


Visualizing MNIST: An Exploration of Dimensionality Reduction - <AUTHOR> https://colah.github.io/posts/2014-10-Visualizing-MNIST/

<comment><USER2> For anyone interested in deep learning, I'd highly recommend checking out the rest of the articles on his blog. Very interesting and very well explained.

<comment><USER3> I second that, very well explained it would be nice to have a set of tutorials aimed around this field, like the ones of the matasano crypto challenges.

<comment><USER4> If you're looking for programming tutorials on deep learning with some theory on the side, I found these perfect: [http://www.deeplearning.net/tutorial/](http://www.deeplearning.net/tutorial/)

</comment></comment></comment><comment><USER5> There's a classic demo here: [http://www.cs.mcgill.ca/~sqrt/dimr/dimreduction.html](http://www.cs.mcgill.ca/~sqrt/dimr/dimreduction.html)

(warning: It uses principal component analysis which is less than ideal. See [http://blog.explainmydata.com/2012/07/should-you-apply- pca-t...](http://blog.explainmydata.com/2012/07/should-you-apply-pca-to-your- data.html) for details)

</comment><comment><USER6> If you'd like to see some t-SNE visualizations of word representations, see my site here:

[http://metaoptimize.com/projects/wordreprs/](http://metaoptimize.com/projects/wordreprs/)

</comment><comment><USER7> I think it is not acceptable for a webpage to max out my CPU, just by visiting the page. If it does it after I have pressed some button or something, it would be okay.

<comment><USER8> I know, right? Worse, looks to be some kind of analytics.

<comment><USER9> Author here.

While I do have Google Analytic, it's just regular Google Analytic and is definitely not responsible for the slow down.

The reason the page is slow is because it does live visualization of a bunch of algorithms on fairly large amounts of data (at least for javscript). There's a bunch of setup that needs to be done.

I could have the visualizations hang for a minute or two when you hit "play", or I can do the setup computations immediately on page load (and so, they're hopefully done by the time you reach the visualizations).

These computations are done in web workers, so that the main thread doesn't freeze up.</comment></comment></comment>


Nothing but net? Basketball science has more answers  - <AUTHOR> http://www.msnbc.msn.com/id/48270436/ns/technology_and_science-science/#.UAv7kHBFTUQ

<comment><USER2> Previous submission of canonical URL that reached the front page of HN yesterday with multiple comments:

<http://news.ycombinator.com/item?id=4276216></comment>


Promises, Problems and Product Development (Global Moxie) - <AUTHOR> http://beta.bigmedium.com/blog/product-development.shtml "Find the way to solve a problem that the customer has absorbed as a fact of life, a pain theyaEURXve borne so long they donaEURXt even realize itaEURXs there anymore." <comment><AUTHOR> The clincher: "That's where the opportunity lies to surprise and delight: Find the way to solve a problem that the customer has absorbed as a fact of life, a pain they've borne so long they don't even realize it's there anymore. Those opportunities rarely present themselves as feature requests."</comment>


Does Exercise Slow the Aging Process? - <AUTHOR> http://well.blogs.nytimes.com/2015/10/28/does-exercise-slow-the-aging-process/?partner=rss&emc=rss&_r=0 <comment><USER2> Life-long spontaneous exercise does not prolong lifespan but improves health span in mice [http://www.longevityandhealthspan.com/content/2/1/14](http://www.longevityandhealthspan.com/content/2/1/14)

Dose of Jogging and Long-Term Mortality : The Copenhagen City Heart Study [http://dx.doi.org/10.1016/j.jacc.2014.11.023](http://dx.doi.org/10.1016/j.jacc.2014.11.023)

Working up a sweat -- it could save your life [http://www.eurekalert.org/pub_releases/2015-04/jcu- wua040215...](http://www.eurekalert.org/pub_releases/2015-04/jcu- wua040215.php)

Lack of exercise kills roughly as many as smoking, study says [http://latimesblogs.latimes.com/world_now/2012/07/lack-of- ex...](http://latimesblogs.latimes.com/world_now/2012/07/lack-of-exercise- kills-roughly-as-many-as-smoking-study-says.html)

Every Minute Of Exercise Could Lengthen Your Life Seven Minutes [http://commonhealth.wbur.org/2013/03/minutes-exercise- longer...](http://commonhealth.wbur.org/2013/03/minutes-exercise-longer-life)

And so on. There's a lot more out there on exercise and mortality risk as determined from large epidemiological data sets in humans or cause-and-effect animal studies if you care to go look around. One present focus is trying to pin down the dose-response curve, for example.

Telomere length, as measured in the study linked here, isn't worth paying much attention to. There are many, many problems with linking average telomere length in white blood cells to specific outcomes in aging. In many ways it is even more of a fuzzy number than, say, BMI or exercise level.

<comment><USER3> The copenhagen study is one that stays with me. Over a period of 35 years, and ~17000 people, there are some interesting charts showing guidelines to optimise jogging for longevity.

If I recall correctly, the best benefit was for joggers to run three times a week for 7 kilometers at 7 kilometers per hour. This would give an extra five years of life, and as the parameters (#times per week, distance, speed) veered from this benefits declined along a bell curve.

<comment><USER4> Interesting bit about 7 kilometers per hour. That's almost walking speed.

</comment></comment></comment><comment><USER5> Quoting my genetics professor:

"Exercise affects DNA repair systems. So moderate exercise speeds metabolism, which increases free radical production, which damages DNA, which activates DNA repair systems which catch the damage caused by the exercise and perhaps some additional damage as well - that's good and probably increases lifespan. Exercising too much creates more damage than the DNA repair systems can catch - which is bad, and explains why very fit people are often unhealthy. Exercising twice a week seems to be the optimum for most people."

<comment><USER6> "Very fit people are often unhealthy"

Is this even true? It doesn't seem true.

<comment><USER7> Top level sportsmen are not known to live very long, so I'd rather say this is probably true.

<comment><USER8> Can you give some examples? That sounds like some old wives tale to me.

<comment><USER9> Here is a fairly in-depth analysis of the excessive running issue that made rounds through the press last year.

Must be read critically, particularly the argument about confounding factors, but it does a good job of introducing the various findings, actual data, and arguments from both sides of the issue.

In any case, when it comes to running, the consensus is that there are diminishing, eventually negative, returns.

[http://www.runnersworld.com/sweat-science/will-running- too-m...](http://www.runnersworld.com/sweat-science/will-running-too-much- kill-you)

</comment></comment></comment></comment></comment><comment><USER10> How do they know that the relationship isn't the inverse: people with slower telomerase reduction age more gracefully and are more likely to report being physically active because they have developed fewer disabilities? Their "critical window" (40-65) also lines up suspiciously well with when people's bodies start to get creaky.

<comment><USER11> There are studies which _can_ look at this, _if_ you can do long-term longitudinal studies.

Taking two otherwise identical populations, _particularly_ identical twin populations, and looking at how they respond to a regime of exercise vs. one without might work. The duration of such studies (years to decades) makes them _exceptionally_ difficult and expensive to carry out. And, of course, you don't get results for ages.

One of the more famous of these is the Framhingham Heart Study, begun in 1948, and now on its _third_ generation of participants. The original study included over 5,200 participants: [https://en.wikipedia.org/wiki/Framingham_Heart_Study](https://en.wikipedia.org/wiki/Framingham_Heart_Study)

</comment></comment><comment><USER12> Hormesis [1] is defined as a favorable biological response to low exposures to stressors and it is a fundamental concept in biology that applies at any given "resolution", so we have hormesis at the cell level up to hormesis at the whole body level.

In this tense, exercise is just an stressor and the key here is the amount of exercise: Too little and the hormetic response is not triggered; too much, and your body is not able to cope with it.

Given this, it is quite difficult to say if exercise, without any qualifier, is good or bad.

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

</comment><comment><USER13> METFORMIN does as per [http://qz.com/431663/scientists-want-to-treat-aging- like-a-d...](http://qz.com/431663/scientists-want-to-treat-aging-like-a- disease-and-they-already-have-drugs-for-it/)

<comment><USER14> Yeah, but the side-effects can be unpleasant (explosive diarrhea)

</comment></comment><comment><USER15> > _However, as Dr. Loprinzi points out, this study is purely associational, so > cannot show whether exercise actually causes changes in telomere length, > only that people who exercise have longer telomeres._

[https://en.wikipedia.org/wiki/Betteridge's_law_of_headlines](https://en.wikipedia.org/wiki/Betteridge's_law_of_headlines)

<comment><USER16> I don't think that that principle applies here. Betteridge's Law implies that the OP knows the answer to be "No". In this situation, the OP _doesn 't_ know the answer -- and so appropriately mentions that the headline is a question that researchers are actually asking and hoping to answer at some point.</comment></comment>


Horizontal partitioning at the MySQL level, great for growing Rails sites - <AUTHOR> http://spockproxy.sourceforge.net/

<comment><USER2> Whoa, now I can scale my Rails app!</comment>


China requires gamers to reveal real names and map them to IDs - <AUTHOR> https://www.theregister.com/2020/08/04/china_gamer_id_law/ <comment><USER2> South Korea does the same. Additionally, they limit the rights of gamers under 18.</comment>


Malware detection in Chrome  - <AUTHOR>

Anyone else seem to be getting malware alerts in Google Chrome this evening? I am running version 24.0.1312.56 m and nearly every site I go to pops up the malware detected page in Chrome saying it has detected malware from www.qcksrv.com. Can't seem to find anything about it and it happens from  multiple systems in multiple locations. Have run scans of all my systems with no results. Curious if anyone has any ideas? <comment><USER2> Yes, www.qcksrv.com, I'm even getting it for news.ycombinator.com. Came here to see if anyone knew anything.

<comment><AUTHOR> Just started getting it from news.ycombinator.com myself. I have tried searching Google with not much help. The only thing I found was a topic on Yahoo Answers with multiple people reporting the same issue tonight.</comment></comment>


Intel i7 loop performance anomaly - <AUTHOR> http://eli.thegreenplace.net/2013/12/03/intel-i7-loop-performance-anomaly/ <comment><USER2> Don't have a compiler handy (or for that matter anything more recent than a Core 2 Duo), but the thing to do would be to replace the call instruction with a same-length sequence of NOOPs to see if its an instruction alignment issue. He mentions making sure the loop header is aligned, but there are other alignment issues in play.

For example, in Intel processors with a u-op cache, a 32-byte fetch group that generates more than 18 u-ops has to go through the x86 decoder and cannot stream from cache.[1] The call instruction, being a pretty big instruction with that 32-bit immediate displacement, might force the loop onto two 32-byte lines, reducing the u-op count in each line below 18 and allowing the loop to stream from the u-op cache instead of going through the decoders.

In general, if adding instructions makes a loop go faster, it's some sort of alignment (maybe code layout is a better term?) issue. Intel CPU's have limits on things like the number of branch predictions per fetch group, number of decoded instructions per fetch group, etc. Some x86 CPUs can only track 3 branches in a 16-byte group, while it might be possible to encode 4 in unusually dense code. In such cases, the extra branch just won't be tracked by the predictor. Seemingly superfluous code can force some of the branches into a different 16-byte group, improving overall performance. (This can't be the case here, because there's just one branch, but it can pop up in branch-heavy code).

EDIT: Someone makes in the comments makes a good point that in any case, both loops should fit in the loop buffer, which is after the u-op cache, and so wouldn't suffer from the 18-uop limit mentioned above.

[1] See: [http://www.realworldtech.com/sandy- bridge/4](http://www.realworldtech.com/sandy-bridge/4)

<comment><USER3> _In general, if adding instructions makes a loop go faster, it 's some sort of alignment issue._

Not necessarily. In the early days of the P6 core, I found a simple loop which would take either 4.0 or 5.33 cycles depending on the internal CPU state -- exactly the same code, but running with an iteration count of 10^6 would take either 4000000 cycles or 5333333 cycles.

I had the good fortune to talk to a member of the team which designed the P6 core, and we concluded that this was due to a quirk of the out-of-order scheduler: In order to reduce circuit depths, the mechanism for finding and dispatching runnable uops wouldn't always dispatch the earliest available uops, and so -- _depending on how the incoming uops were aligned within an internal buffer_ \-- the P6 core would sometimes take a stream of instructions which could be executed in-order without pipeline stalls and run them out-of- order with less ILP.

In short, OOO cores are weird and horribly complicated and completely untrustworthy where performance is concerned.

<comment><USER4> With Atom switching to OOO are there any mainstream processors left that are in order ?

<comment><USER5> GPUs are generally in order as far as I know - it only does OOO optimization at compile time. In general I like high performance programming much more using CUDA than on CPU - the performance is usually much more predictable and as such the time investment tends to correlate pretty well with performance improvements.

<comment><USER6> GPUs are not only out of order but extremely synchronous in general with a restricted memory model that prevents memory stalls. Not only that, but multiple cores share the same control unit, which is why coherent branching across the cores is such a big deal (they all have to branch the same way or both branches have to be executed...).

<comment><USER6> Edit: I meant to say "GPUs are not only in order", they are definitely not out of order.

<comment><USER5> Coherent branching is also important on CPU to make use of your vector units, on GPU the payoff is just much higher. Furthermore you never have to do silly things like loop unrolling for vector unit optimization since you write all kernels as if they were executed scalar. Once coherent branching is not possible anymore you're usually dealing with random access over your data - even then the higher random access memory bandwidth can get you a speedup over one CPU socket, compared to dual socket you're about even.

Bottom line is you just have to think about GPUs in a slightly different way - they do have disadvantages (limited register/cache/memory per thread since you need so many of them), but things like branching aren't that big of a deal.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> I think It's because the branch target is a memory access, so the dcache causes the execution pipe to stall on the load. In the tight loop with a call, the branch target is a call and there is time enough to pull from dcache before the load data is needed. I suspect that the i7 can't pull data from dcache immediately the jne instruction, so you get a hiccup. Try adding a second noop in to tightloop as the target for jne.

<comment><USER8> The trace cache on that chip likely stores a u-op trace that _includes_ the target of the call instruction, which means the memory subsystem shouldn't even need to fetch it separately since it'll come straight back from the trace cache right in line as part of the instruction sequence.

<comment><USER9> I think you might be right about stalls.

Here is a version of the code that runs even faster than the asm("call foo") one by inserting nops between the load and the use of the loaded value. However it became even faster by inserting a few nops at the beginning of the loop too.

The fastest version that I could find is to do a prefetch of counter at the end of the loop .... speaking of which isn't that nopw that GCC uses for alignment a prefetch instruction too? Is the CPU tricked by the fake address used there?

      void prefetch() {
        unsigned j;
        for (j = 0; j < N; ++j) {
          counter += j;
          __builtin_prefetch(&counter, 0, 3);
        }
       }

       void nop_wait() {
        unsigned j;
        for (j = 0; j < N; ++j) {
          unsigned x = counter;
          /* 4 or more nops seem right, 3 nops are slower */
          __asm__("nop");
          __asm__("nop");
          __asm__("nop");
          __asm__("nop");
          counter = x + j;
          }
        }

      tightloop:
       3,000,314,154 cycles                    #    0.000 GHz                      ( +-  0.01% )
       2,400,971,094 instructions              #    0.80  insns per cycle          ( +-  0.00% )

       0.788256283 seconds time elapsed                                          ( +-  0.02% )

      loop_with_call:
       3,000,314,154 cycles                    #    0.000 GHz                      ( +-  0.01% )
       2,400,971,094 instructions              #    0.80  insns per cycle          ( +-  0.00% )

         0.788256283 seconds time elapsed                                          ( +-  0.02% )

      nopwait:
       2,679,341,970 cycles                    #    0.000 GHz                      ( +-  0.37% )
       4,000,906,874 instructions              #    1.49  insns per cycle          ( +-  0.00% )

         0.704209471 seconds time elapsed

vs

      prefetch:
       2,586,821,497 cycles                    #    0.000 GHz                      ( +-  0.54% )
       2,800,888,975 instructions              #    1.08  insns per cycle          ( +-  0.00% )

         0.679998564 seconds time elapsed

This is on a Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz

<comment><USER9> [can't edit previous post]

In fact replacing the nopw that is used for alignment by a prefetch instruction gives me something slightly even faster:

      00000000004004e0 <prefetchit>:
      4004e0:       31 c0                   xor    %eax,%eax
      4004e2:       0f 18 0d 87 04 20 00    prefetcht0 0x200487(%rip)        # 600970 <counter>
      4004e9:       48 8b 15 80 04 20 00    mov    0x200480(%rip),%rdx        # 600970 <counter>
      4004f0:       48 01 c2                add    %rax,%rdx
      4004f3:       48 83 c0 01             add    $0x1,%rax
      4004f7:       48 3d 00 84 d7 17       cmp    $0x17d78400,%rax
      4004fd:       48 89 15 6c 04 20 00    mov    %rdx,0x20046c(%rip)        # 600970 <counter>
      400504:       75 dc                   jne    4004e2 <prefetchit+0x2>
      400506:       f3 c3                   repz retq
      400508:       0f 1f 84 00 00 00 00    nopl   0x0(%rax,%rax,1)
      40050f:       00

         2,445,505,116 cycles                    #    0.000 GHz                      ( +-  0.52% )
         2,800,857,971 instructions              #    1.15  insns per cycle          ( +-  0.00% )

           0.643010038 seconds time elapsed

<comment><USER10> I think I've discovered that the target of the prefetch is irrelevant, and that what matters is that the store-to-load forwarding does not try to execute in the same cycle. For Sandy Bridge, I'm finding that I can get slightly better performance with a dummy load of an unrelated volatile variable:

      volatile unsigned dummy = 0;
      void loop_dummy_read() {
        IACA_START;
        unsigned j;
        unsigned dummy_read;
        for (j = 0; j < N; ++j) {
          dummy_read = dummy;
          counter += j;
        }
        IACA_END;
      }

</comment></comment></comment></comment></comment><comment><USER11> I tested on Intel Xeon W3680, which is at least 2 years old, and the result is opposite. Perhaps it only happens on newer CPUs?

      gcc -O2 -o main main.c
      perf stat -r 10 -e cycles,instructions ./main t

       Performance counter stats for './main t' (10 runs):

           2,408,573,034 cycles                    #    0.000 GHz                      ( +-  0.07% )
           2,401,351,221 instructions              #    1.00  insns per cycle          ( +-  0.00% )

             0.723734145 seconds time elapsed                                          ( +-  0.12% )

      perf stat -r 10 -e cycles,instructions ./main c

       Performance counter stats for './main c' (10 runs):

           2,802,522,431 cycles                    #    0.000 GHz                      ( +-  0.00% )
           3,201,523,974 instructions              #    1.14  insns per cycle          ( +-  0.00% )

             0.842082646 seconds time elapsed                                          ( +-  0.07% )

<comment><USER2> That's Nehalem u-arch, which (unlike Sandy Bridge and Haswell), does not have a u-op cache. So that's an interesting data point.

<comment><USER11> I didn't know about u-op and just looked it up. Could you explain it into more details? How does it involve in this case?

<comment><USER12> µ-ops stand for micro-operations. Behind their CISC frontend, modern [0] x86 (and x64) actually perform as RISC processors. x86 opcodes are translated to these µops on the fly, and executed.

I'm not familiar with the caching mechanism, but here's an educated guess. There are potential optimizations in the CISC -> RISC translation, according to the x86 opcode sequence (reorder operations in order to run some of them in parallel, for example), and it is possible to cache them, sparing cycles in the process, since the processor wouldn't have to analyze the code each time to perform the optimizations.

Edit: apparently, my guess was correct :-) Thanks to _Symmetry_ for the confirmation.

\--

[0] By modern, I mean "not ancient". The first processor to do that was the Pentium Pro.

</comment></comment></comment></comment><comment><USER13> I've run into something similiar on a different benchmark where inserting some 'nops' to the preamble for a function actually sped it up as much as 14% because it made the function align better with a memory boundary so the CPU could access it faster. Benchmarks, especially ones that don't control for the cases where 'luck'/alignment/register use/etc can influence the outcome, are terrible testcases to explore behaviour.

<comment><USER14> He mentioned in the comments that he ensured everything is aligned to 64-bit boundaries

<comment><USER15> 64 bit might not be the right alignment, and even aligned to 64 bit boundaries you can run into page and cacheline issues.

<comment><USER16> Don't you always have to pad back with nops (0x90) since the scheduler might be looking ahead for other instructions to execute (or maybe not, since it's seeing jmp back). Just wildly guessing here...

</comment></comment></comment></comment><comment><USER11> Another interesting point is that, only gcc produced binary has that behavior. clang generated is the opposite. Check this comment about testing on Sandy Bridge with gcc and clang: [http://eli.thegreenplace.net/2013/12/03/intel-i7-loop- perfor...](http://eli.thegreenplace.net/2013/12/03/intel-i7-loop-performance- anomaly/#comment-1298089)

<comment><USER17> This begs for comparing assembly dumps of both.

<comment><USER18> gcc acts RISCy -- load memory into a register, add registers, store register back to memory.

clang acts CISCy -- use a read-modify-write instruction to add directly in memory.

<comment><USER2> I'm surprised that GCC generates that code. Using read-modify-write instructions directly in memory has been better on x86 processors for quite awhile now, since both AMD and Intel support fusing the memory and arithmetic operations into a single micro-op.

<comment><USER19> Curiously enough, using separate reads and writes, with appropriate nop padding, seems to do better than any read-modify-write variation I tried.

By the way, read-modify-write is not fused altogether: only the write part is fused, so it generates 2 unfused uops (read, add), plus the fused uop for the write + address generation.

EDIT: Intel's compiler also generates read-modify-write code, but it ends up being slower than both gcc and clang.

<comment><USER10> I also have gotten better results with separate read, modify, and write instructions than with combined. I think this is because the separate assembly statements allow for more explicit scheduling.

</comment></comment></comment></comment></comment></comment><comment><USER20> Similar effects on a Haswell-era Xeon 1240v3:

        $ perf stat -r 10 -e cycles,instructions ./loop t

         Performance counter stats for './loop t' (10 runs):

             2,631,020,892 cycles                    #    0.000 GHz                      ( +-  0.34% )
             2,403,261,796 instructions              #    0.91  insns per cycle          ( +-  0.00% )

               0.713682287 seconds time elapsed                                          ( +-  0.39% )

        $ perf stat -r 10 -e cycles,instructions ./loop c

         Performance counter stats for './loop c' (10 runs):

             2,237,200,035 cycles                    #    0.000 GHz                      ( +-  0.31% )
             3,202,823,909 instructions              #    1.43  insns per cycle          ( +-  0.00% )

               0.606741377 seconds time elapsed                                          ( +-  0.29% )

</comment><comment><USER21> My armchair speculation:

\- tightloop() does nothing useful and is not realistic assembly code, so modern CPU optimisations aren't targeted for it

\- loop_with_extra_call() does nothing useful either, but might look like a more realistic instruction sequence - the call _could_ modify 'counter', making it _appear_ to be a realistic sequence which the CPU optimisations are targeted for.

End result: the CPU is better designed for handling cases like loop_with_extra_call(). In the real world this makes realistic code faster, and this benchmark is just a weird quirk.

Disclaimer: I am not qualified enough to say I know what I'm talking about.

</comment><comment><USER22> Could this be due to throttling down as per heat? First benchmark would cause more heat to be generated, thus throttling down going on?

<comment><USER23> The instructions per cycle is the interesting number. It is independent of frequency.

</comment></comment><comment><USER24> Boy. I know more or less informed speculation is the best we can do, but it would sure be fun if detailed information about the CPU were public so such things could actually be tracked down.

<comment><USER25> I agree, but asking this of Intel is the equivalent to asking Google to bare the details of their search ranking algorithm so that we could understand some odd search result. The clever tricks and optimizations they do in the cores are their crown jewels, just as the guts of clever, highly-tuned algorithms are for many software companies. It just so happens that many people have a high-level knowledge of modern out-of-order CPUs (just as many people have read Google's PageRank paper) and so can speculate about what _might_ be going on inside.

</comment></comment><comment><USER26> Looks like people have been there before:

[https://code.google.com/p/mao/wiki/NOPIN](https://code.google.com/p/mao/wiki/NOPIN)

The real question is whether any of these compiler heroics are actually any good or serve any purpose other than killing time and curiosity. No one knows how "optimized" NOP'ped code will fare on post-i7.

A modern Intel CPU is the most complex proprietary trade secret in the world. That's all Intel wants us to know.

</comment><comment><USER27> I know this may be silly to suggest but isn't this just a processor pipelining problem? I feel like it's extremely likely that the loop with the extra call just lets the processor carry on better than a variable that it has to forcibly reload and store (to be compliant with volatile).

My assembly is a little rusty but I would just assume that the processor is blocking on memory and the waits just add up.

<comment><USER8> I don't think this should be the case on the type of out of order superscalar pipeline that this core has, as far as I'm aware of it. If there's a bind on waiting for memory an instruction should sit in a reservation station until its data comes in and that should take the same amount of time in either case. (In addition, with trivial accesses like this, it is highly likely a prefetcher would predict the access and have it fetched from cache in time. Though perhaps prefetch behavior works better in the longer loop?)

My intuition is that this is more likely to be behavior related to the trace cache and rayiner's comment points out several good suggestions on what might be happening here.

On the other hand, given the likely difference in how these instructions may be represented in the trace cache, there may also be interactions between the order and groups of instructions dispatched from the trace cache and that may change how things occupy different slots in reservation stations. Which may change the amount of instruction level parallelism in the loop. It doesn't seem likely, but it may be the case.

<comment> Tuna-Fish Trace cache shouldn't be the issue because the loop is simply executing too slowly. Even with very pessimistic alignment, HSW should get well more than one instruction per clock from that loop.

The culprit is probably store-to-load forwarding. Memory ops cannot wait until the coast is clear like data ops do because the addresses are not known early enough in the pipeline, so they are dispatched well before it's even known that there will be a store-to-load hit. The system to maintain the memory model is very complex, not well understood outside Intel, and might conceivably include optimistic optimizations. In such cases, it's completely feasible that issuing another store in the pipeline might reduce the amount of work that is rolled back and needs to be redone.

<comment><USER2> > Even with very pessimistic alignment, HSW should get well more than one > instruction per clock from that loop.

Why? In Haswell, a store needs an AGU (ports 2, 3, or 7) and the store data unit (port 4). Even with perfect store-load forwarding, you can only write one value per cycle into the store buffer.

<comment> Tuna-Fish Instruction per clock, not iteration per clock. Each iteration of the tight loop takes 6 cycles there.

</comment></comment></comment></comment></comment><comment><USER28> Spent a few hours trying to look into this. The results so far suggest it has to do with the register renaming mechanism, but not completely conclusive. You can check out my notes here: [http://blog.skanev.org/2013/12/call-performance- weirdness.ht...](http://blog.skanev.org/2013/12/call-performance- weirdness.html)</comment>


Amstrad CPC emulator in Javascript - <AUTHOR> http://roland.antoniovillena.es

<comment><USER2> Wow, I'd love to see an 8256 - that's what I learned to program on. Actually, my first computer was a Sinclair ZX81, but... man, bump the table even slightly and the 16K RAM pack would dislodge and reboot the computer. So, really, it was the Amstrad that I first learned on. Great to see.

</comment><comment><USER3> Awesome, remindes me of the days I was writing an assember and a memory debugger in Z80 for my CPC. CPC had this nice concept of BASIC extensions with a pipe, e.g. |monitor . I this made BASIC a nice language on a CPC, because you could easily extend it with machine code.

</comment><comment> cgrand-net Amongst the games there's also Maxam, a Z80 assembler.

</comment><comment><USER4> Fantastic, now I can slip in the odd game of Target Renegade whilst at work!

</comment><comment><USER5> Just awesome :). Well done sir

</comment><comment><USER6> the 464 was my first computer. nice

</comment><comment><USER7> awesome! thanks!</comment>


Start Using Git on the Command Line Like a Pro in 5 Minutes - <AUTHOR> https://medium.com/@abuduba/start-using-git-on-the-command-line-like-a-pro-in-5-minutes-36a6e0007e9f <comment><USER2> Nice compiled list. I will have a list into restore and switch, to see if they fully replace the overloaded checkout interface.

"Pro things" that one might look into: interactive rebases. They are not that scary and very useful to clean up feature branches.

I also like utilizing HEAD~n. For example git diff HEAD~3 to check the diff of the last three commits</comment>


FriendFeed Blog: Simple Update Protocol: Update - <AUTHOR> http://blog.friendfeed.com/2008/12/simple-update-protocol-update.html

<comment><AUTHOR> Also see [http://venturebeat.com/2008/12/18/friendfeed-says-sup-to- a-n...](http://venturebeat.com/2008/12/18/friendfeed-says-sup-to-a-number-of- new-services/)

</comment><comment><USER2> I've been waiting 2 months to talk about this: <http://ourdoings.com/ourdoings-startup/2008-12-18></comment>


The Game Engine Black Book: Wolfenstein 3D, 2nd edition has shipped on paper too - <AUTHOR> http://fabiensanglard.net/gebbwolf3d/ <comment><USER2> This looks like a super interesting book. Masters of Doom really captured my imagination when I was young and is probably the #1 reason I'm in programming today.

Does this book have anything "actionable" or is it more an historical overview of the Wolfenstein engine? Will I have the knowledge to implement a similar engine afterwards? (Probably will get it either way, though)

</comment><comment><USER3> Decided to check it out, and from the very first chapter things are being miss represented, if not outright wrong :(.

Starts by claiming Amiga CPU was the reason game couldnt be ported, cites ~1MIPS CPU as evidence, 3 pages below tells you ~1MIPS 286 ran the game fine.

Tells you how the game was designed to take advantage of 386.

Spends tons of time describing 32bit 386 and its 387 floating point unit, without mentioning Wolf3D used neither.

Casually lies about Cyrix/AMD clones "delivering mediocre performance", while AMD made fastest 386 CPU in 1992, and Cyrix made fastest 387 coprocessor in 1992.

Google preview stopped there, I hope the rest is better.

<comment><USER4> Your logic is flawed. A MIPS-vs-MIPS comparison is justified, because the VGA card's chunky framebuffer meant you could update a lone pixel in one instruction, whereas the Amiga's planar framebuffer would require 5 separate passes (if e.g. in 32 color mode) to update the same single pixel.

<comment><USER3> Exactly, difference was in graphic handling, but beginning of the book tells you otherwise, completely concentrating on CPU power and glorifying 386(while wolf ran fine on 286). Maybe it was just padding, and later chapters rectify this "inaccuracy".

</comment></comment></comment><comment><USER5> Is there a preview anywhere?

<comment><USER2> The Play store has a preview: [https://play.google.com/books/reader?id=hel6DwAAQBAJ&pg=GBS....](https://play.google.com/books/reader?id=hel6DwAAQBAJ&pg=GBS.PA59)

<comment><USER5> Thanks

</comment></comment></comment><comment><USER6> A pacman at 40%?</comment>


When Is a Software Bug Not a Software Bug - <AUTHOR> http://garethbrading.com/2015/06/03/when-is-a-software-bug-not-a-software-bug/

<comment><AUTHOR> Trying my hand at this blogging thing stating with an annoying bug I've been wrestling with recently.

The layout of the page is still being worked on hence the horrible links at the bottom and the lack of post title</comment>


Show HN: a companion library to underscore.js - f_underscore.js - <AUTHOR> https://github.com/KrisJordan/f_underscore

<comment><AUTHOR> f_ is a library for wielding and welding iterator functions. It is designed to complement underscore.js' functions that employ iterator functions, like `map`, `filter`, `sortBy`, etc.

I've been using this on personal projects but just spent the weekend tidying it up and writing tests and documentation.

Documentation and sample code can be found here: <http://krisjordan.github.com/f_underscore/>

</comment><comment><USER2> Hey, I'm a fan of your recess framework and I wanted to stop by to say I was going to look into this library you published just based on that fact.</comment>


Nginx has been removed from Debian Stable - <AUTHOR> I searched Debian's packages and it looks like they've removed Nginx from the stable distribution (Jessie). It looks to be temporary as it's still in Sid, but I can't find any information on Debian's site. Does this indicate a problem with the previously available packages? From what's on my machine, the previously available version was 1.6.2.<p>Here are the search results, although they're liable to change when Nginx gets reintroduced: https://packages.debian.org/search?keywords=nginx&searchon=names&exact=1&suite=all&section=all <comment><USER2> No it hasn't. It's still listed at the link you posted, and I see no evidence that it was ever removed at [https://tracker.debian.org/pkg/nginx](https://tracker.debian.org/pkg/nginx) (if it had been removed, there would be a news item there with a reason). If you saw it missing on packages.debian.org, that must have just been a temporary website glitch.

<comment><AUTHOR> Here's the link to Nginx in Sid: [https://packages.debian.org/sid/nginx](https://packages.debian.org/sid/nginx)

The same link but for Jessie says "Package not available in this suite.": [https://packages.debian.org/jessie/nginx](https://packages.debian.org/jessie/nginx)

<comment><USER3> `Package: nginx (1.6.2-5)` is there just fine for me in Jessie and `1.9.6-2` in Sid.

</comment></comment></comment><comment><USER4> Some people may find this useful in the future: [http://nginx.org/en/linux_packages.html](http://nginx.org/en/linux_packages.html)

Besides stable and mainline versions of nginx it also provides other packages maintained by nginx such as nginx-nr-agent.</comment>


Show HN: My password - <AUTHOR>

Thought I'd share this because I find it useful: I don't want to use the same password on all websites but I can't remember a different password for each new service I register. I therefore use an algorithm in my head to construct the password. Say I want to create an account for yahoo.com. I always use the same user name. For the password, I apply my "algorithm" to the service URL. Eg. my algorithm could be "reverse the first five letters of the URL, make the now last char upper case and append '1337!'". So in the Yahoo example, my password would be 'oohaY1337!'. For gmail.com, it would be 'liamG1337!', etc. This way, I get unique passwords for each site, that are at the same time easy to remember. [It goes without saying that I am using a different algoritm than the above.] <comment><USER2> To a certain extent or limit, it's not up to the user to provide a secure password, it's up to the developers to ensure passwords are stored securely. Reversing the name of the service and prefixing it to the password doesn't provide much additional security, nor does appending a number, especially if the host has not encrypted it appropriately.

You would be much more suited to using a password manager that just generates secure passwords for each service (something like lastpass) – instead of relying on some obscure pattern in your head, because patterns instead of true randomness is sometimes the cause of lapsed security.

</comment><comment><USER3> In other words, if I can get ahold of _ONE_ of your passwords I have a pretty good chance of compromising _ALL_ of your passwords?

[https://lastpass.com/](https://lastpass.com/)

<comment><AUTHOR> Yes, but it's still better than using the same password on all sites.

<comment><USER4> Is it though? With this technique you would just need to grep a password dump for permutations of the service name. For the ones you find there is a good chance that the scheme is used on other sites. So now you can try the big sites with a high probability that the login works.

With password re-use you would need to guess if they re-use it. With this you know.</comment></comment></comment>


U.S. Supreme Court Upholds Travel Ban [pdf] - <AUTHOR> https://www.supremecourt.gov/opinions/17pdf/17-965_h315.pdf <comment><USER2> Unsurprising. In Con Law and Crim Pro we basically skipped the border cases because the upshot is that you have no rights at the border. That's been the law since King Tut.</comment>


Ask HN: Windows phone dev success/failure stories? - <AUTHOR>

Has any of you made any apps for Windows Phone 7? Any statistics, insights or anecdotes to share? <comment><USER2> I plan on blogging some detailed numbers soon for all my apps. Here is an example. This app does really well as a free app with ads. I have others that have done better as paid apps.

Sticker Draw Blog post with video <http://ideaindustries.net/sticker-draw-for- windows-phone-7/>

Marketplace link to free version [http://windowsphone.com/s?appid=e80104a9-c243-e011-854c-0023...](http://windowsphone.com/s?appid=e80104a9-c243-e011-854c-00237de2db9e)

I targeted the app at kids in the 2-8 year old range. I started out by making it a paid app priced at 1.29$. I released it early February. My thought was there is so much garbage out there something with a little bit of quality might do ok. It didn't. I also had trouble getting press from any of the wp7 sites. I added a free version using pubcenter ads in March as an experiment. I also put a "buy the full version" link on the menu.

Paid

93 purchases for paid version. It hasn't done well and I haven't seen an uptick from the buy the full version link. I did screw up here. I know some tricks now for getting better numbers for freshly released apps.

Ad Supported

89k impressions since launch 603$ in revenue Avg eCPM is 6.82$ (this is abnormally high but pubcenter does have high eCPMS) I'm getting 600-1000 impressions a day now.

As far as the development tools and process... I work in a shop that does all 3 platforms. I have some experience with Android and even less with iOS but I'm going to say this anyway: Windows Phone has the best platform and tools for mobile development. That may be hard to believe since the platform is so new but Silverlight is great and the tooling is mature.

<comment><USER3> (Disclaimer: former MS employee): Writing WP7 apps has always been a really awesome experience - making your app look awesome with animations and transitions as well as custom styles is really easy compared to iOS and Android. Being able to replace the look and animations of a control without having to subclass it (i.e. rewrite the interaction logic) is really powerful.

<comment><USER2> I saw your tweet. WTH happened? You do something you weren't supposed to? What happens to Rx?

<comment><USER3> Haha, didn't get fired, just moving to another job. Rx will be fine :)

</comment></comment></comment></comment><comment><USER4> I have 2 free add supported and 1 paid apps up:

Mustachio - [http://social.zune.net/redirect?type=phoneApp&id=3adc071...](http://social.zune.net/redirect?type=phoneApp&id=3adc0710-8a86-e011-986b-78e7d1fa76f8) Mustachio Pro - [http://social.zune.net/redirect?type=phoneApp&id=0ed1faf...](http://social.zune.net/redirect?type=phoneApp&id=0ed1faf3-4694-e011-986b-78e7d1fa76f8) Square Attack - [http://social.zune.net/redirect?type=phoneApp&id=a35d2c6...](http://social.zune.net/redirect?type=phoneApp&id=a35d2c6d-eb9a-e011-986b-78e7d1fa76f8)

Mustachio has been up for about 2 months, has about 4.5K downloads, and has made about $80. eCPM is about $1 with 2K impressions per day. Mustachio Pro is a paid version ( $0.99) without ads. It's sold about 70 copies so far.

Square Attack has been up for about 2 weeks, has about 2.5K downloads, and has made about $200. When first released, the eCPM climbed to $6-7 but has dropped a lot lately ($1-2). I'm guessing it has something to do with # of new users per day which has also dropped a lot. Square Attack is about 150 in the free games list so it's very hard to find even though its getting pretty good reviews. I'd love to know how the top apps got there since being the top apps list looks like the best way to advertise and the best bet at success.

<comment><USER5> I clicked on your link and got some confusing page about zune software.

[http://social.zune.net/redirect/preferences/clientrequired?R...](http://social.zune.net/redirect/preferences/clientrequired?ReturnUrl=http%3a%2f%2fsocial.zune.net%2fredirect%3ftype%3dphoneApp%26id%3d3adc0710-8a86-e011-986b-78e7d1fa76f8)

I guess this isn't like iTunes App Store preview pages where it goes straight there, and anyone can look.

Poor Microsoft, you just have to face palm. Ballmer you idiot, did you ever think people might buy your phone based on cool apps? I would have loved to do some WP7 development, I think the metro look is great, the tools sound good, there's just no damn way now.

</comment></comment><comment><USER6> Of the games powered by mogade.com (they are all WP7 games as far as I know), I can tell you that:

-The most unique devices 1 game has seen is 129824 (more than twice the next)

-The most game starts a game has seen in a day is 9928

-The most unique devices a game has seen in a day is 4914

Of course, exactly how/when developers are calling the stats tracking functions, I don't know. For all I know, the guy's got a for loop killing my server on game start...

</comment><comment><USER7> Well I found some numbers here: [http://www.farseergames.com/blog/2011/5/26/krashlander- numbe...](http://www.farseergames.com/blog/2011/5/26/krashlander-numbers.html)

</comment><comment><USER8> App development is great. Unfortunately, I've only ever seen 2 WP7 phones in the wild.

The low resale value of WP7 phones on eBay and CL suggests things aren't good, either.

<comment><USER9> WP7 is definitely a "good" platform. I've preferred having a WP7 over an iPhone for everyday use. If you're saying "things aren't good" in terms of sales, then you might be right...but the low sales are definitely not an indicator of the OS' quality in this case... but more an indicator of the lack of trust from the public in MS consumer products.

<comment><USER10> "an indicator of the lack of trust from the public in MS consumer products."

That doesn't sound right. Consumers are buying products like Windows 7 and Xbox 360 in droves, but they wouldn't be doing that if they didn't trust Microsoft. There must be some other explanation.

<comment><USER9> I was speaking relatively to Apple and Google products. When Apple announces something, millions of people flock to the nearest Apple store to marvel at the shininess of the products that "change everything...AGAIN". When Google announces something, millions have nerdgasms and scour the net for any bit of rumor or info they can find. When MS release something, millions go "WP7...what's that? Is that like an iPhone?"

</comment></comment></comment></comment><comment><USER11> Here's a gamasutra article on the various mobile OSes:

[http://www.gamasutra.com/view/feature/6440/smartphone_and_ta...](http://www.gamasutra.com/view/feature/6440/smartphone_and_tablet_rundown_.php?print=1)

The interesting quote from the article is from PopCap:

 _"It certainly hasn't resonated with consumers as anyone would like," says PopCap's Stein, who uses a WP7 device as his everyday phone. "Given the install base of Windows Phone devices, our games have actually sold quite well, and it monetizes very well for customers who have a Windows Phone. There just aren't enough of them right now."_

<comment><USER12> I expect a good game or app to do pretty well on any platform that has little competition and where the average app price is pretty high.

<comment><USER11> In general I agree. Although in terms of games, I think Windows Phone may already be on par with Android with respect to their marketplace. The Windows Phone games are quite impressive. Not iPhone yet, but moving quickly.

</comment></comment></comment><comment><USER13> We released an app around march

[http://www.bitsabound.com/GlutenFreeRecipes-Windows- Phone-7....](http://www.bitsabound.com/GlutenFreeRecipes-Windows-Phone-7.html)

There have been sales but not a lot which is expected given its a niche total sales are still sub 3 digits.

Development tools and development itself is awesome and I can say that given that I've apps for iPhone as well.

I use a WP7 device for daily use and it hasn't disappointed me for any use expect maybe that skype is still not available and MS has let carriers have too much control.

<comment><USER5> That looks pretty neat, but how do you buy it? I couldn't see a buy link on your page.

</comment></comment><comment><USER14> Installed the beta2 the other day. Built the usual hello world app so can't tell much about building larger apps. What I can say is I find the IDE and Emulator really snappy. Visual design is really smooth, much better imo than for example Android development using Eclipse. My $.02

</comment><comment><USER15> Just based on what I've seen around the net, on a per-user basis WP7 is more profitable for devs than android, but there just aren't enough users. Hopefully that changes soon. 3 competing (and equally large) platforms will be great for users as well as devs.

</comment><comment><USER16> For the following 6 apps :

-Earthquakes Monitor <http://plusapps.eu/Earthquakes-Monitor.html> -Frankfurt Airport <http://plusapps.eu/Frankfurt-Airport-Information.html> -Berlin Airport -Munich Airport -Athens Airport -Child Growth Standards

Trial Downloads : 1027

Purchases : 295

In my opinion the main problem with the Windows Phone Marketplace at the moment is the low sales numbers of devices. With the new version of the OS and the addition of NOKIA hardware Microsoft hopes that they can achieve a bigger market share.

</comment><comment><USER17> For a reason that I don't know and don't understand, their developer program is not supporting all countries in the world or most of them. That is why I can't start (I want to get into Mobile Development and I know C#), I can't publish my apps.

<comment><USER7> Look at Yalla Apps. Among 3 official third-party publishers, Yalla Apps has the lowest price. They have a list of "focused" countries, but you can publish via them regardless of where you from.

</comment></comment><comment><USER18> The development experience has been extremely good. Visual Studio + Expression Blend is perfect for rapidly prototyping apps and fine tuning animations.

As for downloads, I've found it's a lot easier to get your app noticed in the smaller marketplace. Also for a while ad revenue was very good. I made $50/day using PubCenter for ads in my games for a few months. After March 2011, however, something in the system changed (or maybe advertisers just started paying less) and my eCPM has dropped a lot.

</comment><comment><USER19> The smaller audience for W7 is a both a negative and a positive. Negative because (obviously) there are less customer out there. But positive because there is less development competition out there- you could probably carve out a decent niche with a good app.

</comment><comment><USER20> If you build a free apps with ads and use the MS mobile Ad Exchange, the eCPM's are pretty good.

</comment><comment><USER21> underthings

</comment><comment><USER22> Heh, I think it's actually incredibly telling that this question has 20 upvotes and has been around for an hour, yet no one has anything to say.

<comment><USER23> I think that implies Windows Phone was a bit of a failure perhaps?

Everyone wants to know how it's done, but maybe no one knows :(

<comment><USER24> Purely from what I've read it's capabilities atm are a bit of a failure. Honestly though, with Mango being release in about a month, that could change dramatically.

<comment><USER25> I also disagree. I have a WP7 phone and absolutely love the OS. The apps are lacking, and there are a few irritating missing features on my phone (no custom ringtones, can't turn off camera sound, apps can't access compass, etc) but on the whole, I really enjoy the experience.

<comment><USER24> I'm glad to here you like the OS, unfortunate about lacking apps though. Hopefully Mango changes that (thoughts on it?)

I'm actually getting a WP7 phone Tuesday myself. Any recommendations for apps, or anything once I get it?

<comment><USER25> Some of my often-used apps:

-Rowi (for Twitter)

-Wooter (woot.com app)

-YouTube

-Yelp

-TransitFinder and StopGoStopGo for Boston MBTA service alerts/schedules

-Skyview is a sorta-decent celestial constellation app

Games: -Shuriken Ninja, Angry Birds, geoDefense, Beards and Beaks, Plants vs. Zombies, Krashlander, Pandas vs. Ninjas (free Angry Birds clone)</comment></comment></comment></comment></comment></comment>


It is the narcissistic middle-aged, not the young, who love Facebook and Twitter - <AUTHOR> http://www.spectator.co.uk/the-magazine/features/5185908/it-is-the-narcissistic-middleaged-not-the-young-who-love-facebook-and-twitter.thtml

<comment><USER2> One 15-year-old writes about his friends, and dozens of writers mistake it for actual data.

In case my point is not clear: we don't actually know the demographic break- down of who uses social internet sites like Twitter and Facebook. At least, I don't, and I've never read anyone cite any studies. Consequently, this piece, and write-ups like it, are speculation.

<comment><USER3> Yes, this is an opinion piece, not based on any particular evidence, not the conclusion of a scientific study.

<comment><USER2> Opinion pieces are fine, as long as they explicitly state the status of the premise that they start from. In this case, the premise he starts from is "most users of social internet sites are not teenagers." Then the opinion part of the piece tries to explain why that is.

My complaint is that there's no evidence for his premise. In other words, he's trying to explain something that might not be true in the first place. I worry that he, and his readers, don't know the distinction.

</comment></comment></comment><comment><USER4> I think these kind of articles miss the point of "status updates". For most people, it's not really narcissistic behavior so much as it is efficient social communication. Of course you can find outliers, douche bags are everywhere with or without Twitter/Fb.

I can't tell you how many times I've caught a drink, attended a community event, or grabbed a bite to eat with my friend(s) simply because I read he was nearby, etc. Real-time communication makes things more exciting for people that like more spontaneity in their life. I think introverts tend to have a problem with it, and are the most critical of others having fun and socializing.

<comment><USER5> Maybe.

But if we look at the historical significance of the Internet, it was built by and has been largely dominated by introverts. The Internet has always kind of been the one place we can all "find each other" to have interesting, stimulating conversation while the rest of the world gabs about trivial things.

However, Facebook, Twitter (to some extent), et. al, have really brought extroverts in full-force to the Internet, and to some extent they are encroaching on our "space." The hype has definitely clogged up the noise-to- signal ratio, and weeding through all of the extraneous fluff can be tiresome.

So maybe it's not that introverts are exactly "critical," of the new narcissistic "lookie at me! lookie at magazine cover!" vibe the Internet has taken on, but that it subtracts substantially from what makes the Internet interesting.

<comment><USER4> I couldn't agree more with your last paragraph. :)

</comment></comment></comment><comment><USER6> Reminds me of this classic image: <http://i26.tinypic.com/e8lfu1.jpg>

</comment><comment><USER7> I would say that that's the vibe I get from Twitter on occasion.

</comment><comment><USER8> It is funny how the isolated impression of one 15-year-old is being used to define an entire generation's supposed social networking habits.

I am a boomer, but no particular fan of boomers, yet one who will stand up and say that boomers, like others, come in all shapes and sizes and are not all strutting peacocks, contrary to what the author says or implies.

And since when does using social networking to better connect with friends, or for any of a number of business, social, or other purposes, become a mere outlet for vanity?

Even if his premise were true, the author does a lame job of advancing it.

</comment><comment><USER9> How many times do we have to hear this tired screed about social media? Try googling twitter and narcissism, and you will see what I mean. Some of my brethren in the Christian community are the worst offenders. I mean, it's popular, so there must be something wrong with it, right? Narcissism is the closest they can come, and so they milk it for all it's worth.

</comment><comment><USER10> The medium doesn't make the message. Twitter provides wonderful control over what you see, and thus, it is what you make of it. Follow people that use it in a way that you, yourself, find useful.

</comment><comment><USER11> Whoa! It's like they know me. That's: <http://twitter.com/cdibona> for those looking to see how awesome I am.

Seriously though, did we need a link to obviousland today? It that what HN is for?</comment>


Homoiconic Faq - <AUTHOR> http://c2.com/cgi/wiki?HomoiconicFaq

<comment><USER2> Conclusion on the page:

> Q: Is Homoiconic much ado about nothing ? A: Yes, after much wasted > bandwidth on c2 this seems to be the only logical conclusion.

I would add my $.02 to the discussion. Homoiconicity is the "same" representation of program and data, and they give Lisp and Tcl as examples. I want add the following to the philosophical discussion.

Q: Are program & data representations really the "same" if data can represent invalid programs? E.g. the form (nil 3 4) is valid data, but invalid program in Lisp.

I would answer "no" to this question.

<comment><USER3> > I would answer "no" to this question.

You're declaring a conclusion that goes against the outcomes of several pages of heavy argument. When you do this, it's customary to attempt to support your position with arguments. :)

An only-somewhat-related anecdot. I remember sitting in the car with my sister and mother when I was young. My sister was learning to write. On this day, she asked what a fictitious word meant. She showed us a word she had written down, and then said it out loud. We didn't know what she meant. But we worked out that was playing with an idea: does the fact that we can use the tools to represent an idea (in this case, that you can form apparently words from letters) mean that it maps to an idea. As it happens, no.

<comment><USER2> > You're declaring a conclusion that goes against the outcomes of several > pages of heavy argument. When you do this, it's customary to attempt to > support your position with arguments. :)

The argument is the conclusion from the bottom of the page, which I quoted: much ado about nothing.

Then there's a long discussion about how machine code is not homoiconic, which I absolutely disagree with. In von Neumann architecture, and modern CPUs data == code, otherwise you couldn't make a JIT compiler.

</comment></comment></comment><comment><USER4> This is my understanding of homoiconicity. There's a good chance that I'm wrong. Comments and clarifications welcome!

\-----

Is homoiconicity about concrete syntax? I think the answer is _no_ , but I also think that this confuses lots of people because it's not explicitly stated.

Then is homoiconicity about abstract syntax? Let's say we have some arbitrary language, for which there's an eval function (input: abstract syntax tree, output: some data structure) whose job is to execute/evaluate a program in that language. Homoiconicity, then, is the case where the output data structure is also an abstract syntax tree, or conversely, that an abstract syntax tree is expressed in data structures of the language.

So for homoiconicity, the input and output of your eval function are of the same type (of course the type may be a complicated algebraic sum type etc.). Thus the input and output have the same domain. This means that you can take the output from eval, and throw it back into eval again without getting a type error.

If the input and output types of the eval function don't match, then the language isn't homoiconic.

Is this correct?

What I don't get is whether the eval function is available from inside or outside the language, or both.

I'm also unsure of whether homoiconicity is a property of a language, or of an implementation of a language.

<comment><USER5> The most coherent definition I can come up with is that homoiconicity describes the relationship between language syntax and a data representation, such that all valid programs can be parsed by a conforming data parser, and the parser output contains all the information required to compile or execute the program.

Thus, all programs are homoiconic to some data format (if only flat text files). The interesting thing about Lisp is that it's homoiconic to s-expressions, which it also provides powerful tools to manipulate. This paves the way for its macro system which provides compile-time support for processing s-expressions and treating the output as input to the compiler.

<comment><USER6> Your definition (already rather loose) covers only one direction. The point of homoiconicity is that code and data are the same, so they must be easily interchangeable _both_ ways, and also during runtime.

Even if you would consider flat text as an acceptable data format for homoiconicity, most languages ___don 't_ __fit that criteria. Can a random program in a random language (not expressly written as a quine) easily obtain itself in this representation? Can I easily write a function that, when passed _any_ arbitrary function as an argument, obtain the flat text representation of that function, modify it, and execute that modified function?

<comment><USER7> Does this even work properly for Lisps with lexical scoping? I'm not that familiar...

Modulo scoping, you can do that in JavaScript.

</comment></comment></comment></comment><comment><USER8> A simple example of homoiconicity:

(+ 1 2) is a list containing the 'plus' symbol the number 1 and the number 2.

(+ 1 2) is a program which when ran gives the number 3 as the result.

They are the exact same thing.

</comment><comment><USER9> If one is looking for degrees of homoiconicity, a useful question to ask is how hard it is for a program to modify its code and execute the result. In Lisp, it's very easy, so Lisp is meaningfully homoiconic.

For a C program to modify its code, it needs access to its source code (which it might not have) and a compiler (also not necessary) and the programmer has to write rather contrived code to modify the source, compile it, fork, and start executing the result. So C is not meaningfully homoiconic.

Or I suppose the C program could modify an executable directly, but that is even more contrived since it requires the programmer to work with a completely different representation (machine code) than the language of the original program.

<comment><USER10> That has little to do with homoiconicity.

What you wrote about is called 'reflection'

[https://en.wikipedia.org/wiki/Reflection_(computer_programmi...](https://en.wikipedia.org/wiki/Reflection_\(computer_programming\))

> reflection is the ability of a computer program to examine (see type > introspection) and modify the structure and behavior (specifically the > values, meta-data, properties and functions) of the program at runtime.

Ignore the rest of the Wikipedia page, it is not really useful, since the examples show only very simple reflection capabilities.

<comment><USER11> That wikipedia definition, IMO, is weird. I would limit reflection to modifying values, metadata and properties, not to modifying functions.

Limiting it to that is what allows strongly-typed somewhat ahead of time compiled languages such as Java and C# to have reflection.

And yes, C# has support for creating new functions at runtime, but that is not reflection, not in my book, and not in Microsofts's (if it was, they would have put it in the reflection namespace)

Modifying code is a step up. For example, in lisp, it is fairly easy to grab a function, walk its tree for use of integers, and replace every '3' by '4' and every usage of the '+' function by '-'

And the wikipedia examples are amazingly bad, indeed. _eval_ , as in the php example, has nothing to do with reflection. Neither does Objective-C's _performSelector_. You want to show _respondsToSelector_ ; that's what does the introspection part.

<comment><USER10> In Lisp it is relatively easy to change a function. A typical thing is 'advising', where some code is added to a function. This had been done to ordinary functions decades ago and Common Lisp added it as a standard to its object system.

> Modifying code is a step up. For example, in lisp, it is fairly easy to grab > a function, walk its tree for use of integers, and replace every '3' by '4' > and every usage of the '+' function by '-'

Actually it is not easy. Actually walking Lisp code is relatively complex. The code walker needs to understand built-in Lisp constructs, macros and more.

</comment></comment></comment></comment><comment><USER12> Is x86 machine code homoiconic? Or, generalizing, is any/all VN-arch machine code homoiconic? It's pretty obvious that (pure) Harvard-arch machine code _isn 't_, but VN?

(I'm talking about the interface here. Yes, I know that modern x86 processors are not really VN-arch internally. But they present the interface of a VN-arch processor to the programmer, which is what I mean here.)

<comment><USER13> I would argue: Yes.

When people _write_ machine code, you'll note they find it very easy to resort to code-that-writes-code and data-as-code-templates.

</comment></comment><comment><USER14> After reading this FAQ I got an impression that language with built-in AST reflection capabilities (i.e. equivalent of quasiquotes) should be considered homoiconic in a sense that the language exposes code as data. For example: Scala [1], Elixir [2] and Julia [3] all have native AST manipulation capabilities. But are those languages homoiconic?

[1] [http://docs.scala- lang.org/overviews/quasiquotes/intro.html](http://docs.scala- lang.org/overviews/quasiquotes/intro.html)

[2] [http://elixir-lang.org/getting_started/meta/1.html](http://elixir- lang.org/getting_started/meta/1.html)

[3] [http://julia.readthedocs.org/en/latest/manual/metaprogrammin...](http://julia.readthedocs.org/en/latest/manual/metaprogramming/)

<comment><USER10> 'Homoiconic' might want to require that the code and the code as data have the same internal (internal code and internal data) AND external representation (external code and external data). Also it would be really good if we don't need special AST data structures.

Thus we can read source code and then printing it makes it look the same (usually with some delta).

        CL-USER 6 > (let (program)
                      (format t "~%Enter a program: ")
                      (finish-output)
                      (setq program (read))
                      (format t "~%~%The entered program is: ~a" program)
                      (finish-output)
                      (format t "~%~%The result is: ~a~%~%" (eval program))
                      (values))

        Enter a program: (+ 1 2)  ; user input of a program

        The entered program is: (+ 1 2)  ; program output

        The result is: 3

</comment></comment><comment><USER15> I found, that implementing a LISP in a language you know, helps understanding.

I saw one which worked with JavaScript arrays and eval(): ['add', 1 , 2] etc.

It was rather crude, but it helped me.

But I didn't go deeper and tried to understand how Homoiconicity could improve my code.

<comment><USER16> True. I've seen very succint python eval, and my 'favorite' would be [https://news.ycombinator.com/item?id=3511100](https://news.ycombinator.com/item?id=3511100)

</comment></comment><comment><USER17> Homoiconicity is either a trivial property (we can define an AST!) or a not- relevant-to-macros one (probably best expressed as "we have quote", which is basically true of JS).

This post by Dave Herman nicely expresses the problems with homoiconicity as a concept: [http://calculist.org/blog/2012/04/17/homoiconicity-isnt- the-...](http://calculist.org/blog/2012/04/17/homoiconicity-isnt-the-point/)

</comment><comment><USER16> As for some kind of material test, I propose that a language which can be expressed in itself in a page, has the desired properties behind what people mean by homoiconic.

The fact that the small set of primitive abstraction LISPs (even though cons, read aren't necessarily trivial) use are enough to express/manipulate LISP. Doesn't have to be a data-structure thing.

<comment><USER10> Doesn't make much sense. Anyway, the whole concept of 'homoiconic' is underdefined. Plus: the word 'homoiconic' does not really fit well.

In Lisp we talk about that code is data, other than a string.

Thus we can construct programs by constructing data using the usual primitive data structure functions:

        ? (list '+ 1 2)
        (+ 1 2)

Note that Lisp does not use any special purpose data-structures for code. Nothing like special constructors for AST data structures. One does NOT have to call a MAKE-FUNCTION-CALL procedure. Lisp also does not need to construct programs as strings, where I would have to parse the language with string/stream operations to access individual elements of the program. A number 2 would be represented as text, not as numeric data as in Lisp.

Above is a valid program and it is a list of three elements. There are no strings involved. + is a symbol and 1 and 2 are actually real numbers.

Let's look at the 1:

        ? (describe (second (list '+ 1 2)))
        Fixnum: 1

The interface to executing code is the function EVAL. It takes code as data, and not a string.

        ? (eval (list '+ 1 2))
        3

<comment><USER16> I never mentioned or meant to imply strings anywhere.

I'm saying that lisp abstractions: cons, car, cdr, eq*, if, lambda... are enough to write eval in a page. To me the only reason it can be so short is that the abstractions and the interpreter are close to some sort of fix-point, an almost infinite regression in desugaring, and that's what people are thinking about when talking about code as data and homoiconicity.

</comment></comment></comment><comment><USER18> Is FORTH homoiconic?

<comment><USER12> FORTH is iffy. But ultimately I'd say no.

Many implementations of FORTH allow something close to homoiconicity. But _portable_ FORTH isn't homoiconic.

Portable FORTH has no issues with dynamic code _generation_. But it balks at dynamic code _manipulation_. SEE and such aren't portable. You cannot manipulate an already-compiled word in portable Forth.</comment></comment>


Ask HN: If you had unlimited talent and money, what startup would you do? - <AUTHOR>

<comment><USER2> Unlimited? Total world domination, with better marketing. (I think I'd be virtually ethically required to do it, on a line of reasoning similar to "I have infinite resources. The government of, without loss of generality, India does not. Giving them a tiny fraction of my resources didn't work out because they are observably incompetent, and this incompetence is killing Indians. Shucks. Oh well, since I have infinite resources, getting root on India is trivial for me. _repeat this analysis for almost all human institutions_ ")

</comment><comment><USER3> This is the first half of a zen koan, the second half is "why aren't you doing that?" part of a self discovery process to find where your passion lies.

</comment><comment><USER4> I don't think this would be the best thing to use unlimited talent and money, but I'd really like to work on a perfect code editor/IDE.

I find all editors I used somehow broken. I've used Emacs, Vim and Eclipse so far, and all of them seem at the same time appealing and defficient, each has something cool other two lack, and something that really sucks. (For example I love that I can has Haskell repl open as buffer in Emacs, but I hate Emacs keybindings). There are also a few editors I haven't tried yet (which I should do), and I'm aware that all of those I tried are customizable by plugins. Perhaps a huge pack of vim plugins would be solution here; but maybe we need some new concepts about editing, browsing and running code? I believe there are lots of things to try out there, and I hope that LightTable will deliver some new great tools, the kind of 'obvious in hindsight' ideas, that you can't live without once you tried them.

</comment><comment><USER5> Like Wowbagger the Infinitely Prolonged, with unlimited money, I would junk punch every single person who ever used the phrase "going forward" … _in alphabetical order_.

</comment><comment><USER6> The one I'm working on right now -- it's the startup I want to do the most at the moment. After, space junk cleanup, improve plastic recycling, software/games for medical compliance, and a cable channel/network with nothing but 80s tv shows and movies.

</comment><comment><USER7> Google Fiber to every home in the world and high bandwidth / low latency wireless across the world.

...given the assumption that were talking tech startup stuff.

</comment><comment><USER8> AI - a computer you can converse with.

World-scale MMORPG based on real geography.

Virtual worlds - transfer your consciousness to a digital substrate.

</comment><comment><USER9> World peace. End starvation. Real problems.

</comment><comment><USER10> It depends. Add "0% chance of failure", and I might have some ideas.

</comment><comment><USER11> The wording bothers me because I'm nitpicky.

If your talent was truly unlimited, you could do _every_ startup.

If your money was unlimited, then you would probably get assassinated.</comment>


U.S. Devs Are Sleeping on Flutter - <AUTHOR> https://blog.benroux.me/us-devs-are-sleeping-on-flutter/ <comment><USER2> > Flutter is the future of cross platform mobile development. Developers in > the US are going to be late to the party at the current pace.

So what? all the devs must rewrite their mobile apps in Flutter just because it is "the future"?</comment>


New 12-sided pound coin to enter circulation in March - <AUTHOR> http://www.bbc.co.uk/news/uk-38480180 <comment><AUTHOR> From the article:

 _Hidden high security feature - an additional security feature is built into the coin to protect it from counterfeiting but details have not been revealed._

So, security by obscurity. I wonder how long that will last.

<comment><USER2> It's already sort of known - iSIS. The coins have a radioactive doohicky.

[http://www.huffingtonpost.co.uk/entry/new-pound- coin_uk_5818...](http://www.huffingtonpost.co.uk/entry/new-pound- coin_uk_5818ba3de4b0ccfc956426c9)

[http://www.gizmodo.co.uk/2014/03/what-is-the-new-1-coins- isi...](http://www.gizmodo.co.uk/2014/03/what-is-the-new-1-coins-isis- security-system/)</comment></comment>


Ordinary people must have a say in deciding the future of the web - <AUTHOR> https://www.theguardian.com/media-network/media-network-blog/2012/dec/13/future-web-governance-standards <comment><USER2> couldn't agree less.

does the author not know that the web standards body have already forked once? it's not some crushing dictatorship that has no recourse.

broader input from more voices, lay voices, can only make it worse.

not that it matters. the standards bodies don't really have as much independent control as one would think. the browser makers, ie 3 large companies, internally decide what they want and implement it.

one of them is obsessed with owning user information, another with ecosystem lock-in but with a nod towards stronger privacy guarantees, and the other with catching up. as independent as the 4th might think they are, they are solidly attached to the teats of the others.

<comment><USER3> Surely there must be some way you could agree less?</comment></comment>