Announcing Rust 1.2 - <AUTHOR> http://blog.rust-lang.org/2015/08/06/Rust-1.2.html <comment><USER2> I am currently evaluating Rust for a project where speed is important (I am working with graph data in the context of code analysis). Although I find Rust very appealing I still see C++ as the better option, mostly because I fear that Rust would lack good suppport libraries (e.g. for talking to DBs, generating/parsing data formats such as JSON or for generating cryprographic hashes) and that I would end up implementing many of those myself. As of today, many Rust wrapper libraries (e.g. for BerkeleyDB) seem to be written by a single author, which makes me wonder about their stability and maturity even more.

I wonder if this is an irrational fear though. Has anyone here implemented a large project with many external dependencies (DB, data serialization, interfacing with other programming languages etc.) in Rust? If so, what were your learnings and would you do it again?

I find that the discussion about whether a programming language is "good" or not always focuses on the core features of that language and less on the actual system of support libraries that are available for it and that make it actually useful in a real-world setting.

<comment><USER3>
        Although I find Rust very appealing I still see C++ as the better option, mostly
        because I fear that Rust would lack good suppport libraries (e.g. for talking to
        DBs, generating/parsing data formats such as JSON or for generating cryprographic
        hashes) and that I would end up implementing many of those myself. As of today,
        many Rust wrapper libraries (e.g. for BerkeleyDB) seem to be written by a single
        author, which makes me wonder about their stability and maturity even more.

Rust is in its very beginning[1]. Only time can tell if it will have a rich set of support libraries that are stable and mature.It has one big advantage over C and C++ in this regard.

 _It has a central repository for all the support libraries._

I always found it difficult to assess the stability and maturity of libraries for C or C++ found on the internet. Of course there are the standards, like libpng or zlib, and you know they must be good because so many projects use them. For more exotic tasks you are on your own. With a central repository, you can at least estimate the popularity of a certain library. crates.io shows a download count for example. Also many other popular languages have one

       Java     Maven
       Perl     CPAN
       TeX      CTAN
       PHP      PECL, PEAR
       Python   PyPI
       Ruby     RubyGems
       R        CRAN
       Node.js  npm
       Lua      LuaRocks
       Haskell  Hackage

[1] I know that Graydon started it over 5 years ago, but from user standpoint Rust is more a child of 2015.

[2] [https://crates.io/](https://crates.io/)

<comment><USER4> Package managers have their own problems. Unless they are curated well they lead to many libraries that all claim to do the same thing. I wont name any specific examples, but using some of the above takes a fair amount of judgement in how rock solid the package is.

<comment><USER3> I, for my part, think I'm still better off with a central repository with problems than without one.

For Java there are commercial curated Maven repositories and I'm not aware of anything like that for C/C++. So Cargo can be an enabler for Rust in big corp.

<comment><USER5> I think a better design would be a p2p system with crates.io being a tracker and official seeder.

<comment><USER6> It's a nice approach in theory. Not so great in practice.

Whether we like it or not most developers are hired by a company. And for most medium to large companies there is no way they are going to let a P2P system go through their firewall.

Many don't even allow developers to access official repositories which is why products like Nexus (repository proxy) exist.

<comment><USER5> The standard clients don't need to seed by default. Provided there are organizations willing to seed, they could share the costs between themselves.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> 1.2 is great (the nascent MSVC support is especially promising), but I'm most excited by the ongoing work in nightly to completely overhaul the compiler middle-end. The high-level overview is that the middle-end is being refactored to operate on its own intermediate representation instead of the raw AST, which should open the door to a whole host of improvements in compiler speed and code generation. It's technical debt whose bill is long overdue. :)

<comment><USER8> Will the MIR/HIR stuff also help with adding features? I'm thinking of things like non-lexical scoping/SEME regions/etc. which might be easier to implement with it.

<comment><USER9> Yep, the MIR allows the compiler to understand control flow more accurately and more precisely. Non-lexical lifetimes in particular are one of the big features that the MIR should help enable.

</comment></comment></comment><comment><USER10> Well, as I usually do when a new Rust comes out, I tried recompiling some programs that used to work. So far, not so good:

        > cargo clean; cargo update; cargo build;
        Updating registry `https://github.com/rust-lang/crates.io-index`
        Compiling libc v0.1.8
        Compiling regex-syntax v0.2.1
        Compiling memchr v0.1.3
        Compiling aho-corasick v0.3.0
        Compiling regex v0.1.41
        /home/john/.cargo/registry/src/github.com-0a35038f75765ae4/regex-0.1.41/src/lib.rs:394:34:
        394:51 error: #[feature] may not be used on the stable release channel
        /home/john/.cargo/registry/src/github.com-0a35038f75765ae4/regex-0.1.41/src/lib.rs:394
         #![cfg_attr(feature = "pattern", feature(pattern))]
                     ^<comment><comment><comment><comment><comment>~
         error: aborting due to previous error
         Could not compile `regex`.

Looks like Rust 1.2 broke Rust's regular expression module. Somebody isn't running enough regression tests.

<comment><USER9> The `cfg_attr` explicitly means that the `feature(pattern)` (the problem here) only gets activated when someone opts into it by activating regex's `pattern` feature, and by activating it they're opting-in to being nightly-only, i.e. outside the core stability guarantees of the stable releases.

Could you post your Cargo.toml?

<comment><USER10>
        [package]
        name = "hello_world"
        version = "0.0.1"
        authors = [ "John Nagle <firstname.lastname@example.com>" ]
        [[bin]]
        name = "hello_world"

<comment><USER10> I dunno. Probably Cargo had some previous state stored somewhere that 'clean' didn't clear. I don't have time to figure out the internals of yet another weirdo build system.

<comment><AUTHOR> Okay! That's not consistent with how Cargo is supposed to work, so if you can share anything, please open an issue. Sorry about that.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> Nice to see bors in the contributor list!

<comment><AUTHOR> Bots are people too! /r/botsrights! :)

</comment></comment><comment><USER11> My current dream: Rust compiling to C, WebAssembly, .NET and JVM. We could finally have a fast, powerful, memory-safe language that can run anywhere without requiring a runtime or GC.

<comment><USER12> I don't really grok what this means - WebAssembly, .NET, and the JVM _are_ runtimes, how does Rust compiling to them lead to a future that doesn't require a runtime?

<comment><USER13> Rust doesn't require it's own runtime but will be able to use existing ones eventually.

</comment></comment></comment><comment><USER14> The improvement in build speed is just exciting. Thank you to anybody that made it possible.

<comment><USER7> There are still enormous improvements to be made! In a year I think we'll be astounded at what we'd managed to put up with all this time. :)

<comment><USER15> Is there a master tracking bug for compilation speedup ideas? Just curious.

</comment></comment></comment><comment><USER16> Which projects are the most notable Rust users as of today?

<comment><USER7> In addition to nathan7's answer, there's also terminal.com (and I'm assuming here that we're not counting Mozilla's usage of Rust in Servo (and soon Firefox)). There are other companies putting various pieces of Rust code through their paces and we have outreach programs to help these companies in their explorations (I don't like name-dropping before announcements are fully ready, I'll be able to say more later this year).

In general though, remember what a young language Rust is (May wasn't that long ago!) and understand that large and notable projects take time to appear. Docker didn't appear until Go 1.0 was one year old, for example.

</comment></comment><comment><USER17> Isn't Rust the next C?

<comment><AUTHOR> That depends on what you think of as being the core of C. Or, for example, some see Rust as the next C++, which is itself the next C, so is Rust _transitively_ the next C?

Programming languages never die, so I don't have a personal opinion on this point, exactly. For me, I would only write C code if I was working on a C project, or if I couldn't get a Rust compiler for the target platform. My starting point would be Rust, it would have to be disqualified for me to use C. Then again, I am the most biased person possible... (and also prefer C to C++) But regardless, C will never, ever die, so talk of Rust 'killing' or 'replacing' C is misguided, in my opinion.

<comment><USER18> I'd consider a language dead if there were no (or very little) new projects being done in it. For example you might say COBOL is alive because many financial institutions still run COBOL services, but you'd be hard pressed to find someone who would advocate to start a new standalone COBOL project.

(Queue person who started a COBOL project last week..)

In that sense, I think Rust has a real shot at at least severely wounding C++ or at least opening the door for the real C++ killer (it might be that Rust is a smidgen too strict in the mut ref department to really kill C++, I'm encountering a lot of push back from experienced C++ devs). We're talking about a 15 year timescale though, so that's at least 3 era's of computing.

<comment><AUTHOR>
      > I'm encountering a lot of push back from experienced C++ devs

Yeah, this bit is really interesting. It seems fairly split, though I'm not sure in what ratio. Some C++ devs are really into it, but others are very opposed. When you're used to total freedom, but then the compiler yells at you, there can be frustration...

We've also seen a _tremendous_ amount of interest from people who don't strongly identify as a 'systems programmer' at present. RustCamp was last weekend, and the audience is very broad. It's a classic "growing the pie" situation: Rust may or may not take away some of C++'s audience, but it very well just might make the pool of systems programmers significantly larger. We'll see!

<comment><USER19> For me it's not really the freedom. I already said that elsewhere, but: I don't mind when the compiler yells at me. I just don't like the compiler to criticize my coding style by default. Initially, I liked Rust because it reminded me of C++. But then I began reading the book and basically it was full of statements about the coding style I prefer (and will keep) being bad. That's an incredibly stupid reason, but it kind of keeps me away from the language. But it's also the fact that C++ still is very widespread and has tons of libraries.

I wouldn't say never, of course. I'm looking forward to using Rust. Just not now.

<comment><USER20> Every language has different idioms. In many cases, what works in C++ doesn't work in Rust. Generally, anything the book says is bad you should take as qualified to mean bad in the context of Rust programming, not programming at large.

<comment><USER19> Sorry, I didn't make it clear enough. I was primarily referring to code formatting. Spaces instead of tabs, for example, or not writing opening curly braces on separate lines. These things are a matter of taste and should be friendly recommended at best. Guidelines for idioms are important and should occur as early as possible in the book, so that's perfectly fine.

<comment><USER21> I don't think telling you how to format your code for a particular language is a bad thing. I am quite happy using { on a new line in C# but on the same line in JS, using underscore_separated_method_names in C and camelCasedMethodNames in Java. To me, once you've been round the block with more than one or two languages you can get used to whatever style, but using the style for the language that you're writing in is something you should try to do for other people who read your code.

Reading Java code that uses undercore_separated_method_names or C# code that uses camedCased immediately makes me think the author doesn't know what s/he's doing.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER22> How long until every minor Rust release is no longer a front page event on HN? Nothing against the language, but this doesn't really offer a whole lot in terms of discussion; reflected by the (current) point totals: 102 points and 4 comments.

<comment><USER23> I'm not even a rust user (tried it out a little haven't had the time..). I really enjoy the rust posts here though.

Watching the language evolve has been interesting for me. Its an interesting language for a variety of reasons. Those that did a lot of c/c++ programing are probably the biggest fans.

This post wasn't the greatest, but good to see where things are going/ improvements being made.

<comment><USER24> Normally I avoid making comments that are essentially upvotes, but I wanted to make it clear that acomjean is not an unusual case. I also haven't really used Rust much, but I've followed it's development since the 0.3 days when it was a completely different language. I find the kind of design ideas that go into it very interesting and I get especially excited by the fact that _it 's actually a serious language now_.

I think Rust strikes a chord with a lot of people, even those with no investment in it.</comment></comment></comment>


How Wikipedia's reaction to sudden popularity is causing its decline - <AUTHOR> http://www-users.cs.umn.edu/~halfak/publications/The_Rise_and_Decline/ <comment><USER2> Wikipedia has so many rules and restrictions around editing an article that the only people who can invest enough time to learn them are people whose time is otherwise worthless.

I once saw a great example when a notable athlete was traded from one team to another... I think it was a famous basketball player, but can't remember _who_. On a whim I checked the article history page and saw the same pattern: a new user to Wikipedia would make the edit, and it was quickly reverted by one established editor.

When I looked at the talk page, the WP editor made it clear that it was Official Wikipedia Policy that even though both clubs had announced the trade, and news was being carried on multiple outlets, the trade wasn't _official enough_ until the NBA released a daily transfer list with his name on it. All five new editors were threatened with WP:3RR and WP:yaddayadda instead of encouraged. But hey, when the list was officially released twenty-five minutes later the editor who got the page locked got to make the edit. Great job guys! Way to add value to the project!

This _same behavior_ happens on every site where authority is meted out based on activity, not ability. I once tried to correct an elisp entry on a Stack Overflow answer: my edit was autorejected because it had less than five characters difference. So I added a fairly pointless comment to get past the automatic rejection, only to have someone reject it because the comment wasn't sufficiently useful (go figure). I was finally able to get someone to make a correction by going into the Stack Overflow chat and trying to explain things... except the user, who freely admitted to never using emacs before, messed up and made things worse. Whatever. My give-a-fucks were all out. It's probably still wrong!

<comment><USER3> The counter argument would be that 100 people are going to go to wikipedia and try to update the team for a popular player. But who's going to do it for the last man off the bench? A system that makes sure all updates are made properly, if a little less timely (and we are probably talking one day later), is not a bad thing.

<comment><USER4> I don't see how making sure are made properly should forbid that 100 people are going to go to wikipedia and try to update the team for a popular player.

The Problem with Wikipedia is that Wikipedia does not want to reflect truth, or reality or facts or objectivity however one might call it, but verifiability.

That is why they revert to false statements, even if they know so.

<comment><USER5> Is that such a bad thing really? Wikipedia already has a terrible reputation in research and academics, most people simply refuse to accept any information off it because "anyone can edit it."

Insisting on verifiability is a necessary evil if Wikipedia wants to have even a modicum of credibility. Maybe the standards are far too stringent, but verifiability is tangible, and the 'truth' isn't.

<comment><USER4> Wikipedia will never, ever be accepted by the academic community, no matter what kind of rules are implemented, als long as it stays a wiki.

And once one accepts that one can drop this stupid principle. For me it seems the only reason it exists is to pander the academic community. But it's a hopeless and one sided love.

It does not improve quality, it does not improve credibility, the best thing about it that is produces funny feedback loops.

<comment><USER5> What other system would you propose that would ensure that articles are as uniformly objective and factual as possible? It's all right to claim that anyone should be allowed to edit an article, but the fact is that internet communities have consistently shown that without extremely heavy-handed moderation to uphold standards, they can quickly devolve into echo chambers where only one opinion or one set of facts is heard.

Articles about NBA players are not a good example of this, but I can easily think of plenty of other topics which would involve extremely loud and opinionated fringe communities who are very motivated to broadcast their views to the world. I can't think of any way to limit the influence of these communities except by insisting that every article have impeccable sources.

The cost of this insistence on sources is that sometimes utterly obvious edits may be reverted unless they can be properly sourced, but I think it is an acceptable price for maintaining consistent standards of quality across the wiki.

Also, I don't agree that the system only exists to pander to academia. Every encyclopedia in the world has standards of quality to which their articles must conform. The only difference between these other encyclopedias and Wikipedia is the speed with which they are updated.

Now I don't know about you, but I don't go to Wikipedia to get the latest news. I go there to learn stuff with the belief that this stuff will be correct. I don't care if players' teams are updated hours instead of seconds after a trade. I care much more about whether this information is correct. Verifiability builds trust, and I don't see how Wikipedia could continue to exist without it.

</comment></comment></comment></comment></comment></comment><comment><USER6> Fixing WP is simple. Edits should go through a formal draft->pink->red review cycle. Right now they go through a edit->immediate rejection cycle.

By policy anybody should be able to submit draft edits, and these edits should hang around in a review queue for a large-ish group of reviewers to look them over and thumb-up, thumb-down them in a "pink" review. Any acceptance or rejection should require 3 or 4 thumbs up or down. If a thumbdown is given, the reviewer _must_ state what's wrong with the edit (bad spelling/grammar/poor citation, whatever).

If the edit is ultimately rejected, the person who submitted it now has 3 or 4 pieces of feedback, hopefully one of them useful. Now they can fix the edit, resubmit and now it goes to the red review.

If the edit passes it goes to the red review.

Red review is the same, but if it passes it becomes "published" and the change is made. Red reviewers should be the top editors of WP. Because the pink review should filter out most of the crap, they'll hopefully be dealing with higher level stuff and their rejection rates should be lower. Only in cases where the edit somehow was _really_ bad, should they reject it.

Now here's the other thing. If a red review results in a rejection, the submitter has to start over, but the editors that _passed_ it in the pink review are penalized in some way. Perhaps a Karma system (e.g. to become a red reviewer, you must have pink reviewed correctly 500 edits or something, to become a pink reviewer you must have 200 edits succeed). Red reviewers with too high of a rejection/pass ratio may lose their editing powers as well in case some power-mad editor starts bulk deletionist policies.

This way people can both submit edits _and_ be engaged as editors (so they can both see the crap that editors have to deal with and participate in improving WP at the meta-level).

Problem editors can also be flagged by contributors, an editor with some number of flags (say 10) by different submitters should be reviewed. After each review, the number of flags that will cause the next review should increase (maybe double or something). This will keep high quality editors in place and not waste time reviewing editor's work.

<comment><USER7> You've pretty much described "Flagged revisions" (1), which has been in testing since 2008 or thereabouts and has been adopted by a bunch of non- English Wikipedias, most notably German. Despite years of debate about the pros and cons, it has not been adopted on the English WP, although a very watered down version called "Pending changes" has been live since Dec 2012 (2).

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

(2) [https://en.wikipedia.org/wiki/Wikipedia:PC2012](https://en.wikipedia.org/wiki/Wikipedia:PC2012)

<comment><USER6> So why isn't PC2012 the way of the world?

An important feature of my proposal is also to hold reviewers accountable...a notable feature that's missing in the current WP world. (I'm sure there's some purposefully byzantine process to do so today, but hell if a casual contributor can figure it out).

</comment></comment></comment><comment><USER8> Here is my anecdote:

I wanted to know more about my representative to the state legislature. First I went to Wikipedia. It had a stub page, with only basic biographic information. Checking elsewhere, I found that the FBI and IRS raided his office, home, and business some time ago. His chief of staff, his business partner, and and a former staffer that became a judge were all convicted of fraud and/or tax evasion. Other than this, his political career was a whole lot of nothing.

So, having done this research, I put it into the relevant Wikipedia article, with appropriate references to news articles and legal documents, carefully noting that he himself was never charged with anything. Reading between the lines, I realize that the authorities tried to get his subordinates to roll over on him, but failed - but that kind of subjectivity doesn't belong in an encyclopedia article.

Anyway, less than a minute later, the change was reverted because of "vandalism". Whoever reverted it had either not even glanced at the change, or was a supporter of this politician, protecting his page from negative information. Probably the former, but who knows?

This was the last, and worst, example of me wasting my time trying to contribute to Wikipedia. I have had every single change I have ever made to Wikipedia reverted (going back years). Sometimes I have done it anonymously, sometimes I have logged in; it doesn't make any difference in my experience. What seems to matter is if you're willing to put in the time to master Wikipedia's bureaucratic procedure, which I am not. I just don't bother anymore. So to me, this article makes perfect sense.

But I have to admit that I still read Wikipedia all the time. It is without question, the most useful web site there is. It's not as comprehensive as I would like, and for subjective information it's actually quite bad, but I think that in general it seems to be getting better over time, on both counts. So I don't know if you can say it's declining.

By the way, despite him either being a crook, or merely employing crooks on his staff, I voted for him anyway, just last week. I really don't have a vendetta against this guy.

<comment><USER7> Got link to article/your version? It's easy enough to restore your edit, and/or raise it on the talk page. WP has lots of ways to deal with people protecting pages from 'negative' info, although they do unfortunately require a fair bit of bureaucracy and patience.

</comment></comment><comment><USER9> I used to contribute to wikipedia. I stopped after a number of articles I created were deleted by "notability nazis". There is a strong favoritism of what people think is notable over what actually is. The rules are not followed and many things that should be removed aren't while things that should stay are removed.

I am not interested in participating in a system where my hard work is discarded regardless of excuses.

<comment><USER10> Even if I understand why the rule/criterion exists, notability is a particularly problematic Wikipedia rule. Just about everything is notable if you get local enough (whether in terms of location, field, community, etc.) And the proofs of notability, such as they are, end up being (ironically) rather rooted in things like publication in dead tree periodicals or books even if that makes actual verification difficult.

So you end up with notability being rather arbitrarily decided by admins who see nothing wrong with long articles on obscure pieces of geek fandom while being unconvinced about the notability of people like influential executives at major companies, journalists, and the like.

<comment><USER11> Arbitrary decisions are a huge problem in Wikipedia. We get round this problem at Newslines by replacing notability with newsworthiness. If someone has news written about them then it is suitable for inclusion.

<comment><USER12> That's far too easy to game, though, and even works on Wikipedia. Just the other day, I searched for a particular boutique marketing firm, and found they had a Wikipedia entry, complete with 20-30 references.

All of which were basically from the same small, inexpensive PR campaign.

Wikipedia runs a serious risk of becoming a commercial echo chamber (if it hasn't already).

What're you guys doing at Newslines to prevent it from turning into a vehicle for self-promotion?

<comment><USER11> It's only a problem on an encyclopedia because it's not relevant to its mission. As primarily a news archive we don't care as much about PR (Almost all company news is PR anyway), and if it became a problem we would flag it so it could be seen by those who are interested in it (There's value in having a PR archive too), and hidden by those who don't want to see it. The user should be in control. One man's PR is another man's news.

</comment></comment></comment></comment></comment><comment><USER13> I've seen a lot of complaints about Wikipedia here on Hacker News over the years. Yet I also see a lot of comments and even submissions of new stories that come straight from Wikipedia. This love-hate relationship suggests that Wikipedia has plenty of strengths along with its weaknesses. May I ask a question of everyone here? Suppose an Elon Musk or another philanthropist established an Online Encyclopedia X Prize, setting up a financial incentive to try to build something better than Wikipedia. If there were a prize for a new-and-improved free, online encyclopedia, what criteria should be used for awarding the prize? What could a new project do to show it is building a good encyclopedia, and that it deserves a cash prize to keep its growth going as it wins user acceptance? What specific goals would show that the project passed a reasonable "finish line" in a race to build a viable competitor to Wikipedia?

I am a Wikipedian. My experience as a Wikipedian suggests that Wikipedia's administrators need to be much more alert than they have been to the possibility that the Wikipedians motivated by money (or by ideological bias) will stay with the project and persist in making edits contrary to Wikipedia policy. They edit more articles, and edit in greater numbers, than most admins guess or notice. And the point-of-view-pushing editors often inject so much wikidrama into discussions about how to improve articles that they drive away the participation of conscientious editors who know reliable sources about the article topics. A new effort to build a free, online encyclopedia with lots of user input (which I would enthusiastically support) would have to figure out how to deal with this problem.

In respectful disagreement with some comments posted earlier in this thread, I think that most Wikipedia articles on many subjects are _terrible,_ actively misleading and very poorly sourced. I am trying my best to fix articles on the topics for which I have the most reliable sources. (I have an office full of reference books for writing projects I do for my paid work.) It has been a long, slow slog since 2010 for me to improve the sourcing and make more neutral in point of view some of the most-read articles about the psychology of human intelligence, for example. Many Wikipedians don't read books, but only look up information on Google University, and think that anything that isn't found in an online source is not a verifiable fact. That makes the editing process very slow.

<comment><USER14> It should not involve humans in its aggregation and moderation. Needs to be intelligent enough to gather information and categorize it without the biases of a human being.

<comment><USER15> This would presumably use automatic systems developed by humans, who'd also judge the ability of the systems to gather and organize accurate and relevant information according to human standards. Doesn't that just push the biases into a less obvious domain?

</comment></comment></comment><comment><USER16> One possible solution is for Wikipedia to have two versions - one with a very conservative editorial policy, and a second with a very loose, liberal one. Occasionally material that has proven it's worth in the second gets merged into the first.

<comment><USER17> That's actually a good idea.

</comment></comment><comment><USER18> The need is too great to have the service that wikipedia provides, if people are becoming less willing to keep it accurate then that is interesting. If people are consistently finding inaccurate or uninformative articles then they will search for their information somewhere else

I found this page where you can listen to the 'sound of wikipedia', basically a different guitar string is plucked at a different pitch when certain changes are made to wikipedia articles. It is pretty cool in the sense that it shows a lot of changes are being made, however you are able to see and hear the amount of changes made by bots, which is surprisingly few

[http://listen.hatnote.com/#fr,en](http://listen.hatnote.com/#fr,en)

<comment><USER19> That link is great! Watching the page gives you a much more visceral sense of how wikipedia actually works, and ~all the things in the world that people might care about. Click "about" to read the key. (e.g. purple blobs are bots)

It is also especially fascinating to watch during a time with realtime news you care about. I've seen edits to Rosetta and Philae while just watching briefly!

</comment></comment><comment><USER11> As someone building a direct competitor to Wikipedia for crowdsourced biographies and news-based pages [1], I have come to the conclusion that the wiki software while responsible for the site's success, is also the cause of its inevitable decline.

The software causes almost every problem that people complain about, mainly because it lets real or imagined experts have too much power over the page. It's simply easier for an editor to reject new information, than to go through the pain of adding it. In one case, I struggled for weeks to try to get a simple sentence into the site, only to be harassed by the site's administrators, when I challenged a particularly ambiguous rule. Entrenched editors such as William Connolley [2] on Global Warming, act as guardians for whole sections of the site, and do not allow any dissenting opinion, censoring and minimizing views that do not suit their agenda. So much of this is simply unnecessary in a better designed system.

As a result of the open nature of wiki editing, Wikipedia has built up an increasingly restrictive, massive, rule set of how to reject information, which makes it increasingly difficult to add new information. Many of those rules, such as those for notability, conflict of interest, and reliable sources are ambiguous and arbitrarily applied, giving even more power to editors and admins, instead of content creators. This means that the site has become rigid and nobody wants to maintain it. The quality of pages is declining rapidly. It is also very easy to harass other people on the system, so much so that women and minorities are virtually excluded.

We have taken a different approach with great results. By avoiding the page- based metaphor and giving better tools to our editors have created a system that makes it easy to add information without being harassed. We also pay our writers and editors, and are implementing a revenue share system so they can actually get some benefit from their work. So far our writers have added 25,000 posts without a single edit war, and zero harassment. 80% of them are women.

[1] [http://newslines.org](http://newslines.org) [2] [http://en.wikipedia.org/wiki/William_Connolley](http://en.wikipedia.org/wiki/William_Connolley)

<comment><USER20> I run a mediawiki based information site, and I disagree the following statement:

> _The software causes almost every problem that people complain about_

The real problem is:

> _As a result of the open nature of wiki editing, Wikipedia has built up an > increasingly restrictive, massive, rule set of how to reject information_

Wikipedia is not longer a place setup so people contribute information, it's a place set up to reject the addition of information (as you point out).

It's been a goal of my wiki to be the precise opposite, and it's been very interesting to see people go from "I hate wikis b/c of Wikipedia's stupid rules" to "huh, my edit was accepted" to "wow, this is extremely useful and collaborative".

I believe a wiki is not inherently bad, it's all the rejection rules they've built on top that are the problem.

<comment><USER11> Hi, I checked your site out. It's a useful resource. However, it appears you are making it by yourself mainly. When you get a lot of users on your wiki you will have to make a lot of rules, or ban a lot of users. I used to run my site on MediaWiki too and moved to WordPress. I don't know if that would work for your content though.

<comment><USER20> > _When you get a lot of users on your wiki you will have to make a lot of > rules, or ban a lot of users_

I'd like to hear your reasons why you think this will be needed?

As long as the edit is something useful to traveling overland, it's allowed. That's the only rule, and I think it's the only rule that will ever be needed.

<comment><USER11> The objective of any crowdsourcing system is to find people who know more about the topic than you. However, oftentimes those people are dicks. You need rules that will allow you to get their content without them causing you (or them) a lot of grief.

</comment></comment></comment></comment></comment><comment><USER21> This page just cries out for a date. When was it written? I can't tell. The latest reference is 2012, but that leaves a 2-year period. I tried the PDF. No date there, either. Try the citations. Finally: 2013. But that's 'way too much work to answer an obvious question.

So, everyone -- including Mr. Halftaker -- when you publish _anything_ , put a date on it!

</comment><comment><USER22> I've contributed a bit to Wikipedia, including a couple recent new articles, and I have never experienced this. Maybe I'm so extraordinarily skilled that nobody would inflict ham-handed moderation on me, but I don't think that's the case. Probably it's just that I'm not so glaringly awful that I should be discouraged from contributing again.

I think the drop in new-contributor retention is an intended effect, an example of the system succeeding.

</comment><comment><USER23> This claim keeps coming up. Reality is that Wikipedia is mostly done. All the important article were done years ago. Now it's just maintenance. Look at incoming new articles - spam, minor politicians and sports figures, etc.

Paper encyclopedias followed the same pattern. Creating Encyclopedia Britannica was a huge job. Annual maintenance was done by a small staff.

<comment><USER24> Not even close. If you're interested in a particular area of history and you've read a few books on the subject, you'll know that Wikipedia is missing reams of useful information.

Maybe Wikipedia is ok for current stuff and the 20th century, but it barely scratches the surface for most of medieval Europe, for example. There's absolutely no need to be constrained to the terse articles and limited scope of a traditional encyclopedia in this respect. In fact, Britannica has substantially _more_ information on certain topics.

<comment><USER10> Agreed. Most obvious modern stuff, especially things that are well-known in popular or tech/geek culture. But I'm constantly surprised how many topics, including technical ones, are little more than stubs or are actively bad. Mind you, there's a lot of material that doesn't follow these generalizations but it's very inconsistent.

<comment><USER25> By its very nature, the "popular stuff" is the stuff that more people are interested in. If the "popular stuff" is done, then there's going to naturally be fewer people interested in fleshing out the "unpopular" stuff.

<comment><USER26> That seems to assume things not in evidence -- maybe the other entries would be more popular if they were referenced more, and they'd be referenced more if they were more fleshed out.

<comment><USER25> You could reference "Vacri's cheese preferences" on every page on the web, and it still wouldn't be as well fleshed out as the topic of WWII on Wikipedia, particularly if vacri and his close associates weren't particularly interested in providing the info. Frequency of reference follows popularity more than popularity follows frequency of reference.

Or perhaps another example: most politicians have some sort of twitter or facebook account listed on their promotional material. It doesn't make those twitter accounts particularly popular, despite being frequently referenced.

</comment></comment></comment></comment></comment></comment><comment><USER27> After my experience in DMOZ, I have carefully NOT joined Wikipedia as an editor. However, I make minor spelling, grammatical and/or stylistic changes when I notice the need. I also correct obvious factual errors. I usually don't introduced NEW facts, but I delete false existing ones if I notice them.

And hey -- if I'm not perfect by the standards of "No Original Research" or even "Neutral Point of View", I don't have a role that allows me to be punished. I just move things in the right direction (by Wikipedia's standards as I understand them) as far as I can be bothered to, then go on with my life.

<comment><USER28> If you are making changes when you notice the need (and thank you for that work!), then you ARE an editor of Wikipedia. That's what that word means.

<comment><USER27> True enough. But I'm not a member of the organization. :)

</comment></comment></comment><comment><USER29> Well here's another useful correlation: the first iphone launched mid 2007, the peak of the active editors graph. Perhaps the rise of mobile is the true cause here.

<comment><USER30> Twitter, Tumblr, Facebook and smartphones are all in full effect by that point. 2007 has got to be Eternal September for the Web.

</comment></comment><comment><USER31> I wonder why nobody has forked Wikipedia yet. There's no restriction to doing so, is there? To avoid having super high server costs, it could even be a "soft-fork", where only the pages which are edited are stored locally, all other content is fetched from the original.

If these restrictions are really affecting the quality of the articles in Wikipedia, we'll see the quality of the articles on the fork grow, at which point they can be merged back by Wikipedia.

<comment> muuh-gnu > I wonder why nobody has forked Wikipedia yet.

Wikipedia _was_ forked, several times. The reason you dont seem to know about them are:

1\. The added utility was not sufficient to make an impact strong enough to pull people away from wikipedia.

2\. The added no utility to the fork at all or made things bad at Wikipedia even worse.

Wikipedia is like democracy, it is the worst free encyclopedia we have, except all the others.

<comment><USER32> Forking is not enough, the whole thing has to get out of it's wiki format and be transitioned into some kind of purpose built system, the wiki approach was great for growing fast but is hell to maintain or understand when used for content and administration in parallel. The best thing I could think of would be a streamlined kind of git with repositories for every article and an easy to understand ticketing system and maybe the possibility to have concurrent versions of articles one branch for the deletionist and notability enforcing kind and another inclusive one.

<comment><USER11> See my comment above. We have solved most of the problems for crowdsourced news-based pages and biographies at Newslines. We cut out almost all Wikipedia's problems by focusing on newsworthiness as the standard of inclusion; letting users create posts based on news events, not long-form articles; and using a standard post approval process.

</comment></comment></comment></comment><comment><USER33> Hell is other Wikipedia editors. Truly.

</comment><comment><USER34> I agree with the submission: I think there is potentially a problem of test edits, or unsourced edits, being reverted automatically or in an unpleasant manner, and that newcomers can easily be discouraged from contributing. I think part of it is a problem with the culture, and part of it is a necessary evil: when articles achieve higher quality overall, there is bound to be less adding and more discussing about what to add, so more changes will not make their way to the article. (This is the case for any document, you start with a lot of writing and then there is a lot of painful editing, I don't see why it would be different here.) Also, the more you try to structure and source the articles, and the harder the syntax is going to be, compared to the time where you could just write anything and add it to the article.

Yet, for all of this, I have never been able to understand why, whenever a discussion about Wikipedia comes up on HN, so many people complain about getting all their changes reverted. I have edited Wikipedia for years and I think at most 3 cases did I see something reverted for no good reason. Maybe this is because I edit in less controversial areas (computer science), or because most of my edits are just typographic fixes, or because I also edit on different Wikipedias (especially the French one), or because I'm vaguely familiar with some of the customs or policies?

It would be really nice if people complaining about bad reverts could provide links to the diff of their edits, the reverts, and the subsequent discussion if any. One nice thing about Wikipedia is that the history is always public, so if something valuable has been reverted for bad reasons, it can be seen, and added back; if someone seems to be discouraging new users from contributing, anyone can see it and let them know; and if there was a misunderstanding, maybe we can see that the two sides were of good faith.

It's a bit frustrating to see everyone complain but never have links to objective facts where you can see what went wrong and try to understand why.

</comment><comment><USER35> > algorithmic tools used to reject contributions

Kind of reminds me of Twitter banning all my games that let users tweet scores using their APIs as being too much like a full Twitter client. It's pretty obvious Twitter just aimed a bot at everyone and didn't actually look at who they were banning.

</comment><comment><USER25> The title of the article is based on the faulty premise that fewer editors means a decline.

Edit: the first sentence of the abstract indicates that they don't mean a _literal_ decline in pure numbers :)

</comment><comment><USER36> And, sooner or later someone might get access to stackexchange logs (they aren't open, are they?) and say the same.

<comment><USER37> [https://archive.org/details/stackexchange](https://archive.org/details/stackexchange)

</comment></comment><comment><USER38> My brief story to add to the general theme is:

* I knew personally that a regionally important corporate lobbying group was funding a ballot measure. (For the moment assume I am correct: this was not a 'secret': everyone in local politics knew this. It just wasn't 'official')

* I edited the organizations wikipedia page to state that the group was promoting the ballot measure.

The edit was reverted.

Was I going to spend time trying to track down obscure articles on local newspaper websites to prove this to wikipedia? No.

It just wasn't worth it.

I have come to the conclusion that the really interesting information is still in peoples heads.

I rarely find wikipedia turning up in my searches any more - in particular anything "controversial" or anything where there is moneyed interests involved who are interested in suppressing the other side.

I actually don't see a solution for Wikipedia. It is trying for some sort of 'objective' encyclopedia. This is well and good for questions like what is an atom in the 21st century. However, lets pretend that it is a 1901. "What is an atom?" was controversial and the back and forth that would have been interesting to know as a 1901 reader would be edited out of the 1901 version of Wikipedia.

Quite simply for me:

* something is interesting if it is "controversial" (global warming, health care, etc.)

* I am not interested in an "objective" sanitized view. I have a bias and I am not interested in hearing about the "controversy about global warming". Therefore I am biased toward sites predisposed to my perspective.

* Others have different preferred bias.

* Trying to come to a group decision where both sides are convinced that their side is correct is impossible ( in particular if one side is paid to not change their mind )

* If something is really important (i.e. job critical) I want to go to a source expert that I trust irregardless of what the 'crowd' thinks. I know what the standards I am applying to determine who I regard as the expert.

* rarely search for important things and find the wikipedia article interesting

Therefore:

* Wikipedia as a common community encyclopedia only works for the uninteresting 'factoids' that are not important

* I filter out wikipedia when looking at the google results when I am looking for something I really care about getting correct.</comment>


Train your own image classifier with Inception in TensorFlow - <AUTHOR> http://googleresearch.blogspot.com/2016/03/train-your-own-image-classifier-with.html?m=1 <comment><USER2> This is great! I was just writing a small script to prepare data for TensorFlow CNN image classification based on a custom dataset using SciKitFlow, but the InceptionV3 model is super cool and it looks like the have an implementation with almost compatible API to what I was writing [1].

I'm super impressed by what's coming out of Google's TensorFlow. Their ImageNet InceptionV3 model is a delight to play with in python!

[1] [https://github.com/tensorflow/models/blob/master/inception/d...](https://github.com/tensorflow/models/blob/master/inception/data/build_image_data.py)

<comment><USER3> You might be interested in this, it uses same model to create a very simple bare bones implementation of Approximate Visual Search. [https://github.com/AKSHAYUBHAT/VisualSearchServer](https://github.com/AKSHAYUBHAT/VisualSearchServer)

</comment></comment><comment><USER4> This is awesome --> "In order to make research progress faster, we are additionally supplying a new version of a pre-trained Inception-v3 model that is ready to be fine-tuned or adapted to a new task. We demonstrate how to use this model for transfer learning on a simple flower classification task."

Fine-tuning these models for different applications has been a great way for me to build out new things without relying on an enormous fleet of K40s to train a new set from scratch. Lots of progress in this field, thanks to the whole team for releasing this.

</comment><comment><USER3> This is a great news, the earlier released model had some limitations such as it could not be used with a batch. With this and multi GPU training, TensorFlow is now a good alternative to Caffe.

Here is my project with TensorFlow inception model. [https://github.com/AKSHAYUBHAT/VisualSearchServer](https://github.com/AKSHAYUBHAT/VisualSearchServer)

<comment><USER5> Is the ami mentioned in your README still available? Searching for ami-b80f0ad2 in community AMIs is not turning up any results.

<comment><USER3> Yes its available in the Northern Virginia region.

[https://www.dropbox.com/s/owp7fxwwtlutw8n/Screenshot%202016-...](https://www.dropbox.com/s/owp7fxwwtlutw8n/Screenshot%202016-03-10%2002.51.11.png?dl=0)

</comment></comment></comment><comment><USER6> Is anyone using Java for running the TensorFlow examples?</comment>


Stronger than aluminum, a heavily altered wood cools passively - <AUTHOR> https://arstechnica.com/science/2019/05/chemically-treated-wood-could-send-excess-heat-to-space/ <comment><USER2> > But it gets better. The sugars in cellulose are effective emitters of > infrared radiation, and they do so in two areas of the spectrum where none > of our atmospheric gases is able to reabsorb it. The end result is that, if > the treated wood absorbs some of the heat of a structure, wood can radiate > it away so that it leaves the planet entirely.

This is the best bit. Put enough of this stuff on roofs and it can _directly_ mitigate the greenhouse effect, by emitting IR that goes through the atmosphere and off into space.

<comment><USER3> I suspect roofs are about 0% of the Earth's surface.

<comment><AUTHOR> It'd reduce energy consumption for air conditioning. Also, while rooftops are a small part of the global Earth surface (75% of it is not really a good place to put roofs on), the figure is much higher in cities and urban areas where, and it's not a coincidence, we spend a lot of energy keeping things cool.

Let's not forget cellulose is mostly made of CO2 removed from the atmosphere, which also helps a bit.

The only way it'd be better is if it were also a good material to build PV panels with.

<comment><USER3> It will not make much difference if it's reflected to space or not, though.

<comment><USER4> Of course it will. This is the idea behind space mirrors - reflecting 1% of sunlight is enough to completely counteract global warming. The radiation has to leave the atmosphere though.

<comment><USER5> as far as reflection goes, whenever I see a satellite photo of Africa and I look at the bright, sandy Sahara Desert, I always wonder: does it help? or does it hurt?

<comment><AUTHOR> You should see it in infrared

<comment><USER5> ah! that would be interesting!

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> "the process involves dumping the wood in concentrated hydrogen peroxide and boiling it. While I wouldn't want to drink boiling, concentrated hydrogen peroxide, it's not an especially difficult chemical to handle safely."

Diluted hydrogen peroxide is safe but in concentrated form it is one of the most dangerous substances. Early rocketry experiments used it as an oxidizer and it's generally considered too unsafe.

<comment><USER7> [https://yarchive.net/space/rocket/fuels/peroxide.html](https://yarchive.net/space/rocket/fuels/peroxide.html)

While there are some storage headaches -- the stuff decomposes slowly no matter what you do, so you must provide for tank venting -- otherwise peroxide is much easier and safer to handle. Its bad reputation is half outright myth and half the result of 1940s experience with seriously impure peroxide. To quote a friend, a rocket-propulsion professional, who investigated the matter as part of a study some years ago:

"As far as we could find out, the stories about problems with peroxide were just that, stories... Peroxide, now, seems to only very rarely do anything exciting, at all. And, even then, it seems to never do many of the things attributed to it in the stories."

Henry Spencer

<comment><USER8> That would be this Henry Spencer: [https://en.wikipedia.org/wiki/Henry_Spencer](https://en.wikipedia.org/wiki/Henry_Spencer) to bring in some hackish context.

<comment><USER9> I still remember Henry's contributions on comp.lang.c _thirty years ago_.

</comment></comment></comment></comment><comment><USER10> This is a lot like "transparent wood".[1] The lignin is removed as the first step. The transparent wood people put a clear polymer in.

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

<comment><USER11> Epic video by NileRed trying to make transparent wood [https://www.youtube.com/watch?v=x1H-323d838](https://www.youtube.com/watch?v=x1H-323d838)

<comment><USER12> Thought of this when I read the article. Probably similar process.

</comment></comment></comment><comment><USER13> I wonder how similar it is to Roechling's Lignoprotect bulletproof densified wood panels - [https://www.roechling.com/industrial/products/composites/gfr...](https://www.roechling.com/industrial/products/composites/gfrp- cfrp/ballistic-panels/)

edit - Since reading about densified wood, I have been wondering about if you can get paper to join to itself using pressure and the right chemicals. If so, you could form it into tubes by rolling it round a metal bar, and maybe even make the laminated paper bicycle from Gibson's Virtual Light.

<comment><USER14> Isn't that effectively the construction material for the ship Albatross in 'Robur the Conqueror' ?

<comment><USER15> Absolutely, yes. Paper compressed with an hydraulic press.

</comment></comment></comment><comment><USER16> "The researchers estimate that covering an apartment building with the treated wood could save about 35 percent of the energy used for cooling." Is that compared to the average building or a building covered with another kind of white plating? Because the latter would be super impressive while the former would mostly just state the obvious: white things don't heat up from sunlight as much as non-white things.

<comment><USER17> The difference between white and other colors is definitely not 35%. Less than 10% apparently for paints [https://www.europhysicsnews.org/articles/epn/pdf/2007/01/epn...](https://www.europhysicsnews.org/articles/epn/pdf/2007/01/epn07102.pdf)

</comment></comment><comment><USER18> The challenge of lignin decomposition is why we have (most) coal.

[https://www.nationalgeographic.com/science/phenomena/2016/01...](https://www.nationalgeographic.com/science/phenomena/2016/01/07/the- fantastically-strange-origin-of-most-coal-on-earth/)

<comment><USER19> And cellulose it said, but suitable microbes have since evolved?

</comment></comment><comment><USER20> Is it still flammable though? I can't see anyone cladding an apartment building in flammable material, especially not after the Grenfell tower fire.

<comment><USER21> It seems lignin actually has flame retardant properties, so unless they are adding some additional chemicals to make this wood fire resistant, it is probably even more flammable than normal wood.

<comment><USER22> Yeah, cellulose is highly flammable. That's why early film was so problematic

<comment><USER23> Well, the big reason early film is kind dangerous is that it was nitrocellulose, and so had plenty of nitro-groups just waiting to have a little fun...

<comment><USER22> Ah, my bad. Thank you for correcting me!

</comment></comment></comment></comment></comment><comment><USER24> Wonder if this can be worked like normal wood and can be produced in the standard dimensions. One of the advantages of azek and other PVC sidings is that you can use your normal tools.

<comment><USER25> You can cut aluminum using woodworking tools if you need to. Assuming it's just for siding/roofing I see no reason a chop saw with an appropriate blade couldn't cut it.

<comment><USER26> Yeah, carbide blades will eat aluminum like butter. Just the other day I cut off a 3" x 3" slab of aluminum block with my table saw in 3/4" cuts. Wasn't sketchy, the saw didn't bog down at all, in fact ive cut woods that were far more difficult than that solid aluminum block.

</comment></comment></comment><comment><USER27> How does its lifetime compare with ordinary wood? Does it rot easily?

</comment><comment><USER28> I wonder if you can still cut and engrave it with a CO2 laser (10.6 µm). It might be a very interesting material to work with.</comment>


MaskedVByte: SIMD-accelerated VByte - <AUTHOR> http://maskedvbyte.org/ <comment><USER2> The 'PDF' link at the bottom is for the old version of the paper. The current version (v2) is available here:

[http://arxiv.org/abs/1503.07387](http://arxiv.org/abs/1503.07387)

</comment><comment><USER3> Is "Conventionsl VByte decoder" on page 2 correct? Why the end-of-integer condition is b<=128 and not b<128?

<comment><USER4> I think you are right, and it looks like a mistake. And maybe it's just late at night, but some of the assignments to 'c' look wrong too. We went over the text many times, but the figures got much less review. I'll send a correction to Daniel tomorrow. It looks like you signed up just to post this --- thanks, and welcome to HN! Send me email (click on my username) if you'd like credit in the Changelog.</comment></comment>


Ask HN: Can it be un-f'ed? - <AUTHOR> Whoever did it, it's clear to everyone with a pulse at this point that Epstein was murdered.
Does anyone here have any sort of constructive insight into how we can subordinate our international elite to the rule of law?  Or was that a fiction to begin with?
And before someone goes, "reeeeeeeee! political!", keep in mind that this underpins everything.  What's the point of quibbling over EULAs, patents, equity, markets, GPL vs MIT, etc, etc, if, at the end of the day, an adversary with enough money can just buy their way out of the rules and do whatever? <comment><USER2> I have a pulse; I'm not going to believe unsubstantiated speculation without seeing anything that resembles evidence.

<comment><AUTHOR> Are you saying that our international elite are bound by the law just as much as everyone else? That was the question topic. Epstein was offered merely as a case-in-point.</comment></comment>


Added some non-js social share buttons - <AUTHOR> http://tosbourn.com/added-some-non-js-social-share-buttons/ <comment><AUTHOR> haha, just wanted to check out if those buttons actually work. they do.

<comment><USER2> great thing, but why reposting this 3 years after initial blogpost?

<comment><USER3> Probably because it is intellectually interesting and that's the high level guide for Hacker News submissions in the guidelines.

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


For Kids, Learning Is Moving - <AUTHOR> http://nautil.us/issue/40/learning/for-kids-learning-is-moving <comment><USER2> I work for Head Start 3-5 year old Federal Program to help them catch up with their peers. It is very impressive how far many of the children come. The issue is the tail effect of the students. How long does it last. I blame the school system's non-developmentally appropriate approaches to early education students. Kindergarten is the new 1st grade. Children are sat behind desks and pushed to read and read with speed right away. It really is sad. My daughter in Kindergarten for 10 minutes of recces at the end of the day.</comment>


Florida Boomer Caught on Video Cutting Brake Lines of Public E-Scooters - ga-vu https://gizmodo.com/florida-boomer-caught-on-video-cutting-brake-lines-of-p-1838691831 <comment><AUTHOR> >The man, who's apparently one of those lawless Baby Boomers we keep hearing about.

These types of statements bring no value to any conversation other than to incite anger and inflame social classes.</comment>


Ask HN: Dealing with client squeezing in extra scopes? - <AUTHOR>

So I'm dealing with a client who is now adding more things to do than was budgeted for under the original document. There's so many hidden "but this should work like this which I didn't mention in the original scope", that I cannot actually continue working on this job. I told them X amount of budgeted hours was spent on implementing the extra stuff on top of the original scope. I'm going to have to charge another X hours for me to complete.<p>Did I do the right thing? I got a little bit angry but this seems to be the case when you work with people who seem to treat software like hiring sweatshop labor workers. <comment><USER2> Just explain that you and he have a contract, your price was based on what was agreed in the contract, and you should be allowed to fulfill the original, mutually agreed contract. Then, if the customer wants more, negotiate a new contract.

If you don't do this, you risk moving into the verbal contract domain, and, as Sam Goldwyn famously said, verbal contracts aren't worth the paper they're written on.

</comment><comment><USER3> I know lots of engineers who, when the customer asks for more, get angry. I do it myself! But I try to treat it as an opportunity. Smile and say, "I'd be happy to add these items to the project. It will cost an additional $x and y days." It's especially hard when it's a flood of tiny changes, so in that case you might have to group a bunch together to help demonstrate that it's a significant addition to the original scope. Just try to have a positive attitude about it, that of course you can do what the client wants, and you're happy for the extra business!

<comment><AUTHOR> yes I did exactly that. I felt angry but didn't express it in any way, these were tiny changes and lots of them, so I said it flatly, these will take time and will cost X hours.

If he comes back saying "bet I could do this faster", I would tell them good luck. If he insists I do it for free, I would tell them it would force me to cut corners and would hurt me and the project in the long run.

</comment></comment><comment><USER4> Changes in scope are normal in any project based business, and the agreements between all parties should reflect that reality.

Getting mad wasn't the right thing. Sending an invoice after the fact is kind of the right thing. The right thing is to send a proposal for the additional work when additional work is requested and to lay out a formal process for changing the scope in your initial contract. .

</comment><comment><USER5> That's the risk of fixed-price contracts.

Some clients will withhold final payment until you do lots of extra things. Following the sunk cost fallacy, having put a certain amount of time into the project, you'll do more so you can get paid. In most cases, the client knows it's impractical for you to sue them. You either have to do the extra work for free, or write off the time you already spent as a loss.

Another risk I noticed with fixed-price contracts is that the client almost always doesn't have a proper spec. If I help them write a proper spec, then they can post it on the freelance sites and hire someone cheaper to implement it. If you start a fixed-price contract without a proper spec, you wind up with the problem you're having.

Now, I just flat-out refuse fixed-price contracts.

</comment><comment><USER6> I go with flat-priced projects as much as possible. I break the project into milestones, each one priced and paid separately. If there's extra scope added but not a ton, I don't mind because I've already priced this in. If things get excessive, I can point to the milestone and show that we didn't plan for it.

</comment><comment><USER7> Not sure that this is the same case, but the articles is interesting and in the comments there are some discussion about feature creep: "How to charge clients: flat fee vs. hourly rate?" [https://news.ycombinator.com/item?id=2909101](https://news.ycombinator.com/item?id=2909101)

</comment><comment><USER8> You are a professional, watch this video, and act like one.

Mike Monteiro - fuck you, pay me [http://vimeo.com/22053820](http://vimeo.com/22053820)</comment>


Open Problems in Theoretical Computer Science - <AUTHOR> http://a3nm.net/work/research/questions/ <comment><USER2> Open problems in Homotopy Type Theory: [https://ncatlab.org/homotopytypetheory/show/open+problems](https://ncatlab.org/homotopytypetheory/show/open+problems)

</comment><comment><USER3> #1 What is the complexity of boolean matrix multiplication?

#2 Is there a parallel algorithm for GCD?

</comment><comment><USER4> Author here, thanks for the comments! I added two problems to [http://a3nm.net/work/research/questions/#well-known- conjectu...](http://a3nm.net/work/research/questions/#well-known-conjectures) following ideas here.

<comment><USER5> I have just answered one of those problems here. [http://cstheory.stackexchange.com/questions/20245/subset- of-...](http://cstheory.stackexchange.com/questions/20245/subset-of-a- bipartite-graph-with-maximal-number-of-minimal-unmatched-vertices) I hope I didn't misunderstood the problem.

<comment><USER4> Thanks a lot! I think you understood the problem correctly, I checked your argument and it seems correct to me, see [https://cstheory.stackexchange.com/questions/20245/subset- of...](https://cstheory.stackexchange.com/questions/20245/subset-of-a- bipartite-graph-with-maximal-number-of-minimal-unmatched- vertices#comment77255_33603)

We have no specific plans for this result but it's always comforting to have an answer after all and know that it's in P. Plus this way I learnt about the existence of submodular functions. :)

List updated ([http://a3nm.net/work/research/questions/#complexity-of-an- as...](http://a3nm.net/work/research/questions/#complexity-of-an-assignment- problem-with-subsets)). Thanks again for making me remove the first problem from this list!

<comment><USER5> np. There might be ways to speed up the running time for this special case. Naive algorithm using submodular minization + maximum matching as an oracle would take around O(n^c) where c is probably more than 10.

</comment></comment></comment></comment><comment><USER6> Fun fact: the problems are a lot more hard to understand if you're browsing with Javascript disabled.

<comment><USER4> Sorry about this, it should now be fixed, and I submitted it upstream: [https://github.com/mitya57/python-markdown- math/pull/10](https://github.com/mitya57/python-markdown-math/pull/10)

Thanks for reporting!

</comment></comment><comment><USER7> One of the big problems is to find a lower bound on some cryptographic algorithm. We think that factoring is hard, but there is no proof of this. The knapsack problem, used in the first public key system, was thought to be hard, but isn't.

<comment><USER8> My understanding is that factoring is NOT believed to be NP-hard. Can you point to literature that suggests it is? Researchers and professors I've spoken to seem to think it lacks the inherent structure that many NP-complete problems seem to have. My (nonexpert) personal belief is that it will be one of the next problems to fall.

<comment><USER9> Factoring is almost certainly not NP-hard. That would mean that NP is contained in BQP which would be a staggering result. While there are some NP problems that are in BQP the idea that somehow NP-complete problems are solvable in polynomial time on a quantum computer seems kinda ridiculous to me. I'd be happy to be proven wrong some time in the future though.</comment></comment></comment>


Wikimedia Launches WikiVoyage - <AUTHOR> http://www.wikivoyage.org/

<comment><USER2> Explanation: WikiTravel fell into the hands of a company called Internet Brands, users got dissatisfied, they forked the wiki on August 2012 and created WikiVoyage under Wikimedia's wing. It offers the same content as WikiTravel up to that date.

Long story: [http://gyrovague.com/2012/07/12/wikitravel-editors- abandon-i...](http://gyrovague.com/2012/07/12/wikitravel-editors-abandon- internet-brands-join-up-with-wikipedia/)

</comment><comment><USER3> I occasionally check in on and modify the WikiTravel page for Singapore (e.g. to warn about scammy shops here), and when I heard about the impending launch of WikiVoyage, I switched over right away. It seemed odd to me that an open, collaborative resource like WikiTravel should be owned by a profit-driven entity that had acquired it and was trying to monetise it. The lawsuit from that entity was the rotten cherry on the top.

Congratulations to Wikimedia, the WikiVoyage team, and jpatokal (and thanks for making the Singapore article so comprehensive and accurate). I hope the migration is smooth and the SEO quickly works itself out in WV's favour. I for one will be linking to it whenever I have the opportunity.

<comment><USER4> Open, collaborative resources and being commercial aren't necessarily mutually exclusive. Fundamentally, open content isn't that different from open source, and while it's not _easy_ to monetize free things without being evil, it's certainly possible: see eg. Red Hat. And WikiHow (<http://www.wikihow.com/Main-Page>) is a great example of how you can run a for-profit wiki without selling out to the dark side, see eg. their About page: <http://www.wikihow.com/wikiHow:About-wikiHow>

But you do need a long-term perspective and a genuine rapport with the community, which is why 'traditional' companies taking over open source projects and adopting corporate command-and-conquer strategies to run them tend to crash and burn. Oracle and the trail of devastation they've wreaked with OpenOffice and MySQL is probably the canonical example, and Internet Brands is their open content equivalent.

And oh, thanks for the thanks ;)

<comment><USER3> It's certainly possible, as you said, but it takes a philosophically aligned company to do it, and those are a rare breed indeed - very much the exception to the norm. By default I'd assume any traditional profit-oriented company that _acquires_ an open resource to be likely to mess things up as it tries to extract revenue. (This is directed at @mmahemoff too - StackOverflow is a good counterexample, but again an exception.)

I look forward to location-enabled WV guides/maps on mobile, if that ever becomes available - that would be amazingly useful. I'm often tempted to look towards tourist-oriented functionality in my own web/app project, but would like it if the market winner turned out to be an open resource rather than a crowdsourced-yet-profit-driven one.

'welcome :)

</comment></comment></comment><comment><USER5> From: <http://en.wikivoyage.org/wiki/Compton>

WARNING: Compton suffers from a very high crime rate due to the gang violence, which is well-documented. It is recommended to stay no more than as long as necessary. Danger increases during the night time.

Helpful!

<comment><USER4> Well, it _is_ helpful, if you didn't grow up in the US listening to NWA and thus eren't aware that Compton's synonymous with "inner city ghetto".

But yes, there's a fair bit of useless "advice" on the site. It's human nature to try to be helpful, even when much of the advice offered is common sense. Hence this policy:

[http://en.wikivoyage.org/wiki/Wikivoyage:No_advice_from_Capt...](http://en.wikivoyage.org/wiki/Wikivoyage:No_advice_from_Captain_Obvious)

</comment></comment><comment><USER6> Wikivoyage is already working out great. Most of the contributors have moved over to the site including Evan (one of the co-founders).

But one of the real benefits of the change has been that there is now integration with the other Wikimedia sites: the same login that one uses to edit Wikipedia works to edit Wikivoyage, and a fair few Wikipedia admins and regulars have jumped in to help Wikivoyage out.

In addition, Wikivoyage now has direct inclusion of images from Wikimedia Commons, so if you are writing a travel guide, you can just hop over to Commons and find an image, rather than having to upload your own like you did on Wikitravel. And there is an international community of people who curate that image collection.

Now that the contributors have mostly moved over, Wikitravel are now just descending into spammy oblivion, while Wikivoyage adds new and fresh content, fixes mistakes and so on.

All the while Wikitravel employees seem to be going around spamming blog posts and posting about how this is all an "anti-capitalist" conspiracy against them. Well, sorry, it's pure capitalism: if your service sucks, people will go to another provider. That your service sucks so much that you are being beaten by a non-profit... well, just the free market at work.

</comment><comment><USER7> Perhaps I'm missing something. How is this different from WikiTravel?

<comment><USER8> WikiTravel was purchased by Internet Brands, the same company that owns FitDay and FlyerTalk. The community clashed with the new owners and the Wikimedia Foundation agreed to maintain a fork.

<comment><USER9> Too bad. I really prefer the name WikiTravel. Clearer and simpler.

</comment></comment></comment><comment><USER10> It works surprisingly good. Tried it out for my hometown "Suceava", a small forgotten city from northern Romania. The information one gets is really useful and seems to be mostly accurate.

<comment><USER11> _mostly_ accurate?

<comment><USER12> In the world of travel guides, _mostly accurate_ is pretty much the gold standard.

</comment></comment></comment><comment><USER13> I can't help it.

It's Wikivoyage, not WikiVoyage.</comment>


What is Erlang-Style Concurrency? - <AUTHOR> http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/ <comment><USER2> The more play around about Erlang, the more it makes absolute sense. This is a concurrency done right. And I say this having done concurrent programming in Java and C (both pthreads and LAM/MPI).

The share-nothing, message passing paradigm beats the pants off Java concurrency. Threadpools and monitor based locking is fine if only 10% of your codebase is going to be concurrent, but it gets old fast.

MPI is pretty cool. LAM is a decent implementation. But as with any C API, there is a lot of low-level cruft to doing it right. pthreads is both cumbersome and fragile. Also kernel level threads, while they have scheduling benefits, tend to be more expensive to spawn/kill.

Erlang really abstracts away all this messiness and provides non-blocking send and selective receive with message buffers. If only it had better string literals. (Implementing infinite loops with infinite recursion also gives me chills. But then I guess you couldn't implement a while loop with single value variables.)

<comment><USER2> The edit expired, but I feel embarrassed about those first two sentences so let me correct them:

 _The more I play around with Erlang, the more it makes absolute sense. This is concurrency done right._

This is the problem with posting to HN early in the morning. :)

</comment></comment><comment><USER3> Selective receive seemed unimportant, but I read the PDF presentation at the bottom to find out why he thought it was important. And I think he's right.

Basically it allows your process to simulate synchronous calls (by sending, then entering a state where you won't receive any other messages besides the one you're waiting for). And in certain cases, you _really_ want those synchronous calls (sometimes, it just doesn't make sense to handle any other events until the synchronous call returns).

He uses a hardware example to make it clear -- say you have to issue commands to hardware in a certain order, but with delays between them. In a non- blocking system, you have to write a complicated state machine to handle all the events and buffer the ones which are not "hardware is ready for next command". With selective receive, you can use selective receive between hardware calls: send to the hardware, receive only the "hardware ready", send again.

</comment><comment><USER4> I'm curious fast message sends need to be to be considered "fast". IIRC, until recently Erlang used a separate heap and mailbox for each process, so each message send required a full copy of the message. That fast enough? Otherwise Erlang didn't really have Erlang-style concurrency.

I think that Erlang now uses a shared heap for messages with message passing just being a pointer copy into the receiving process's mailbox. But concurrent shared-heap GC is much harder to get right than per-process heaps, so I'm asking mostly to simplify implementation of my own concurrent programming language. :-)

<comment><USER5> Nope, as of now each process has a separate copy, even when they are both on the same node. "The exception is large binary objects, which are handled specially by placing them outside the normal data areas and using reference counting to keep track of them. They are not copied when sent as messages between processes on the same node." [http://erlang.org/pipermail/erlang- questions/2006-September/...](http://erlang.org/pipermail/erlang- questions/2006-September/022739.html)

</comment></comment><comment><USER6> So - what other languages do qualify - all or in part?

<comment><USER7> This lua paper looks interesting, though I don't like the way they pass code as strings:

[http://docs.google.com/gview?a=v&q=cache:G3KOwdPfnsAJ:ww...](http://docs.google.com/gview?a=v&q=cache:G3KOwdPfnsAJ:www.inf.puc- rio.br/~roberto/docs/ry08-05.pdf&hl=en&gl=us)

<comment><AUTHOR> There's also ConcurrentLua (<http://concurrentlua.luaforge.net/>), which is a more deliberate attempt to port Erlang-style concurrency to Lua. It doesn't have pattern matching for selective receive, IIRC, and doesn't enforce lack of local state, but is otherwise mostly there. It implements lightweight processes via Lua coroutines, which are cheap _co-operative_ mini-threads, the other concurrency model that (IMHO) makes sense.

I've played with it a bit and it seems well-designed, but at the time I hadn't done much serious with Erlang, and felt it would make more sense to learn the Erlang idioms (supervisor trees, etc.) _from Erlang itself_ and come back to ConcurrentLua later. I'm very interested in it, though - Lua is one of my favorite languages.

It also seems to be the work of one grad student, who since graduated (and may have moved on). OTOH, it's a rather small project, since Lua (as with Scheme and Termite) already provides most of the necessary infrastructure in the core language (it's mostly a scheduling wrapper for coroutines and some distribution primitives), so forking it wouldn't be terribly difficult.

<comment><USER7> I've checked out both concurrentlua and luaproc in the past and they seem quite similar (both use cooperative scheduling via co-routines). I initially liked luaproc more because the channel-based message passing approach in luaproc seems to me to be inherently more flexible than message passing based on process id's. luaproc leads to a particularly elegant implementation for the chameneos-redux benchmark, for example.

concurrentlua seems more maintained, though; it showed up on luaforge more than a year ago and its latest update was in May, which to me means that the creator is interested in continuing the project. I believe this is the paper that introduced concurrentlua:

[http://docs.google.com/gview?a=v&q=http://www.google.com...](http://docs.google.com/gview?a=v&q=http://www.google.com/url?sa=t&source=web&ct=res&cd=7&url=http%3A%2F%2Fweb.it.kth.se%2F%257Ejohanmon%2Ftheses%2Feleftherios.pdf&ei=J16tSvyUFNuDtge_84ipCA&rct=j&q=lua+concurrency&usg=AFQjCNFS547GSgQNhY-W7x0QEGipJH-9Lg)

luaproc's luaforge page is here, for comparison's sake:

<http://luaforge.net/projects/luaproc>

<comment><AUTHOR> Thanks! I was looking for the ConcurrentLua PDF - it isn't linked on the project site anymore.

IIRC, luaproc was put up on luaforge because people on the mailing list read the paper and started asking if the source was available.

There are also about a half dozen other concurrency packages for Lua, which at first seems rather odd. As a language, it has quite a few semi-official extensions, but unlike Scheme (with its standard and several implementations), it's because the language designers are very serious about keeping the core language small and portable for embedding. You can import the ~800k of source into your project tree and fork it as necessary, compile it down to a ~200k library, etc. In practice, this means that people contribute Lua extensions that help it can work nicely with whatever funky C++ game engine they're using, etc., as well as more general libraries.</comment></comment></comment></comment></comment>


How to implement have_many/belong_to RSpec matchers - <AUTHOR> https://medium.com/@azbshiri/how-to-implement-have-many-belong-to-rspec-matchers-b7410668802f <comment><USER2> This is terrible testing practice. Instead of testing behavior by creating and interacting with associated objects, it's testing syntax and method definitions. You should never test implementation, you should test behavior. These tests can be made to pass by creating methods with these names that don't actually behave properly at all.</comment>


Does the Universe Have a Purpose? - <AUTHOR> http://www.templeton.org/questions/purpose/index.html

<comment><USER2> Do ultravague questions have a purpose? There's a question I can answer.

Define "purpose".

I'm going to the store to buy some eggs. There's a purpose. Is the universe trying to get some eggs? If so, mission accomplished.

<comment><USER3> That's quite a heavy burden for one person. What if the store is closed?

</comment></comment><comment><USER4> Luckily the universe has a meta-object-protocol and an ability to modify it's own abstract snytax, so to speak.. thus it's purpose can be dynamically redefined at run time. While creating much confusion it's also really freaking cool. I personally don't believe in an afterlife beyond garbage collection but who's to say what that freed memory will make room for??

</comment><comment><USER5> I take 'purpose' to be a 'reason' or 'justification' for being. Therefore the question presupposes a reasoner or justifier, which one might assume to be a creator who needs a reason or justification.

So 'no'. ;-)

</comment><comment><USER6> The uni/muiltiverse is a computer, I believe that our universe is a subset of higher dimensional universes populated with matter and energy, so it seems very possible that the computational capacity of our universe is of some use to whatever matter and/or energy is populating the higher dimensional universe. I refer to these entities as our Higher Dimensional Overlords.

<comment><USER7> In other words, our universe is a map-reduce... it explains everything!

</comment></comment><comment><USER8> ¯\\(º_o)/¯

</comment><comment><USER9> The physical scientists lean towards maybe, maybe not, while the humanitarians, theologians, and life sciences types lean towards yes.

Personally, I think multiple universes explain everything.

<comment><USER10> Physicists, astronomers, and astrophysicists - 3 Yes or most likely yes(the link to Paul Davies' essay lists his answer as "Perhaps", but in the essay, he consistently argues in favor of the universe having purpose), 2 No or most likely no.

Chemists - 2 No, although de Duve's essay does not seem to disagree with finding a greater meaning in the universe, but merely with the terminology of the question.

Humanities and social sciences - 2 Yes.

Theologians - 2 Yes.

Computer scientist - 1 Yes.

It seems to me to be inaccurate to claim that the physical scientists tend towards uncertainty. None of them express uncertainty in their essays answering the question. They are fairly evenly split between belief in purpose for the universe and lack of such belief, however.

Your judgment about the theologians, social scientists, etc. leaning towards yes is much more supported by their answers, since they all did say something which is equivalent to yes.

<comment><USER11> I don't think a sample space of 12 people, however eminent they are, isn't enough to make a general statement like this. Sorry!

<comment><USER10> Of course not, but if one does make a generalization based on this small sample as the person I was replying to did, one's generalization should agree with the data.

</comment></comment></comment></comment><comment><USER12> If the universe is entirely defined within its own context (which I believe it is) then it is its own purpose.</comment>


Microsoft Silverlight 1.0 Launches, Will Support Linux - <AUTHOR> http://mashable.com/2007/09/04/silverlight-1/ <comment><USER2> Heh, trying to install on Linux, their web site gave me a 404 on "<http://www.microsoft.com/silverlight/undefined>". undefined is the new NULL :-)</comment>


Show HN: Github Bagdes application - <AUTHOR> http://githubbadges.com/ This is the application that weights only 10k zipped content. I created it as weekend project for 10kappart competetion. Since they still not published it, I decieded to put on my own :) <comment><AUTHOR> Hi All,

This is the application which is only 10k of zipped content, completely client side! I've created it as weekend project for 10k appart competetion.</comment>


EA and Activision Blizzard CEOs Featured in 'The 100 Most Overpaid CEOs' Report - <AUTHOR> http://www.gamasutra.com/view/news/337304/EA_and_Activision_Blizzard_CEOs_featured_in_The_100_Most_Overpaid_CEOs_report.php <comment><USER2> Comments moved to [https://news.ycombinator.com/item?id=19231079](https://news.ycombinator.com/item?id=19231079).</comment>


Look forward in anger (on personal animosity in Silicon Valley) - <AUTHOR> http://www.economist.com/business-finance/displaystory.cfm?story_id=15716776

<comment><USER2> (Mock quoting the author): Which I'm going to add to by describing Google as " _lebensraum_ -seeking".

For the print edition of _The Economist_ that's pretty incendiary.</comment>


Preemptive Scheduling of Erlang NIFs - <AUTHOR> http://hansihe.com/erlang/elixir/c/2016/07/26/erlang-nif-preemptive-scheduling.html <comment><USER2> Very cool article. I like learning about these kinds of hacks.

Btw, it seems the author is also the author of this cool project:

[https://github.com/hansihe/Rustler](https://github.com/hansihe/Rustler)

It is a library which helps write Rust NIFs for Erlang, I am following that.

I see both Erlang/Elixir and Rust as one of the best platforms today, which focus on practical safety and fault tolerance. Combining the two is a great idea in a large system. Erlang's VM is solid and battle tested, at the core of many vital projects and systems. Rust probably brought the most innovative language feature recently -- compile time lifetime and safety checking.

<comment><USER3> With people writing NIFs in Rust, how long until someone writes a new BEAM- compatible VM in Rust? The existing C implementation of the BEAM VM could be incrementally rewritten in Rust. I was browsing the BEAM source code recently and the C coding style is rather dated, e.g. lots of #ifdefs and even function declarations without prototypes.

</comment></comment><comment><USER4> To add to the point of one of the "better solutions": if you've got a native library that does heavy lifting (for example, a game physics engine), and you want to "integrate" it with Erlang, please don't use NIFs. Use ports. Write a small C-process wrapper around your native library and talk to it over streams or sockets or shared memory. Use the OS's pre-emptive scheduler for what it's for.

Externalizing your bulky native code into its own port-programs heavily increases your system's robustness. Very few native libraries implement a Rust-like set of safe abstractions and then rely solely on them; most just do stupid native things with pointers _et al_. So most native libraries likely _will_ abort() at some point or another. When the one you're relying on does, it will of course take down "its own OS process." You don't want that OS process to be _your Erlang node_. You want that crash to be isolated such that the only state that's destroyed is the corrupted state of the subsystem that caused the crash. And then you want a supervisor running in your Erlang node to see the dead port and restart it, so the system can keep chugging along.

Of course, if you want that to be a _low-overhead_ solution, then you should try as much as possible to _cache_ anything you'd have to repeatedly send to the C process, within the C process. Treat your externalized native-library "processor" server like an SQL database server: insert complex state into it, get handles back, then manipulate the state _without retrieving it_ by using high-level queries and commands on those handles. (I say cache, but I don't mean _persist_. The state your Erlang node hands a port-program should all be _derived_ state that the Erlang node holds the canonical copies of, that you can feed into the port-program again _when_ it crashes. Treat port-program state like state in memcached.)

\---

ETA: I've never seen this design myself in the wild, but I've heard it suggested a couple of times, and it's kind of a cool idea:

Instead of a native C port-program, you can get the same set of advantages as the above from making your library a set of "dirty" NIFs running in _its own isolated Erlang node_. The Erlang runtime itself doesn't have much overhead, so it's pretty cheap to use Erlang as the way to "network-enable" each library you have into its own server process. Then your "business logic" Erlang node can communicate with your native-library-wrapper Erlang node, over the Erlang distribution protocol (which is very cheap if they're on the same machine.) Saves you a bunch of hassle in trying to beat C into a form that does IPC protocol-handling well.

<comment><USER5> > trying to beat C into a form that does IPC protocol-handling well.

The opposite worked at least once: have Erlang code deal with C-friendly structures.

Last time I got to work on an Erlang project, we needed an external C program to do some network stuff we couldn't do in Erlang. We just defined a simplistic protocol easy to parse from C, with {packet, 4} framing (each message was preceded by a 4-byte length) wrapped around the messages. Pretty much any format easy to parse or generate in C is trivial to deal with in Erlang.

<comment><USER6> If you can share, I'd love to know what network stuff you couldn't do in Erlang?

<comment><USER7> Raw sockets? ICMP? AF_UNIX? netlink? IPsec? tun/tap devices (under Linux)? Pick any.

</comment></comment></comment></comment><comment><USER8> On Linux you can use makecontext to create a new stack and swapcontext to jump to it. That API was once defined by POSIX but deprecated after pthreads was added to the standard. It's still useable on Linux and several other OSs, with the caveat that you probably don't want to load or enable pthreads for your process. (I think you can mix the two in glibc today as glibc references thread-local data structures through a dedicated register, whereas a long time ago it was kept at the base of the current stack and so incompatible with alternate stacks. But other OSs might have problems and things might change in the future wrt glibc, too.)

Another solution which is actually (probably?) POSIX compatible is to use sigaltstack to create a new stack, save your current context with setjmp, invoke a signal, call setjmp to save your altstack, then longjmp back to your original position. Now you can jump back and forth at will, everything copacetic. Calling longjmp from a signal handler is perfectly legit and POSIX is careful to preserve that ability. But for obvious reasons you have to be very careful how you accomplish it.

Now, once you throw an interval timer into the mix things get tricky. Normally you would need to worry about the signal arriving while the C code is in async-unsafe library routines, but Erlang might be (I don't know for a fact, though) one of the few large projects that only ever uses signal-safe syscalls like mmap, read, write, etc. If it's only ever the user library executing libc code then there shouldn't be a problem.

One thing I really wish POSIX (or at least Linux) supported is per-thread signal handlers. With per-thread signal handlers you could bundle this magic into libraries in a clean manner in a multi-threaded process by preserving and restoring the existing signal mask, sigaltstack, and signal handler(s). Currently you can only preserve the first two; the third is process-global. I was working on a project recently where I caught SIGSEGV on a page fault, longjmp'd back, doubled the relevant memory buffer (or aborted if the address wasn't managed), and then restarted the computationally expensive operation. This allowed me to remove all the bounds checking code and resulted in a very significant speedup. But touching global state makes it very messy and not suitable for packaging into library form as these days it's best to assume a multi-threaded process environment.</comment>