In Medieval Europe, No Outfit Was Complete Without a Personal Eating Knife - <AUTHOR> https://www.atlasobscura.com/articles/medieval-knives <comment><USER2> Steven Pinker talks about this in his book _Better Angels of our Nature_. Ending the habit of personal eating knives was part of the "civilizing process" that drastically reduced the murder rate in Europe, because people stopped walking around armed quite so much.

<comment><USER3> So much for "an armed society is a polite society", I guess.

<comment><USER4> That premise is true, just not in the way you think. Societies with uncontrollable violence tend to have informal codes of politeness designed to prevent violence and are far more likely to have gangs with honor codes. This does not necessarily make the society less violent, it just means you have more rules to navigate so you don't lose your protection or piss off some powerful person.

<comment> rv-de I noticed that in cultures where violence is a more accepted form of behavior it is much less likely that someone will bump into me on a busy street. In places like Split (Croatia) or Istanbul there is more natural inclination to grant some space when passing. The most bumps I get in Germany with Munich claiming the first place. I used to joke that the citizens of Munich simply aren't afraid enough of getting stabbed or beaten up and hence use any minor inconvenience as an opportunity to make a statement.

<comment><USER5> Where in the world are you getting the notion that violence is more accepted in Croatia or Turkey than in Germany?

<comment><USER6> According to Wikipedia, the per capita homicide rate of turkey is approximately 3.5 times higher than that of germany. Croatia is actually less than that of Germany, although they did fight a very nasty war in the early 90's and that may have colored some people's perception of the country.

<comment><USER5> What does per capita homicide have to do with a culture's being accepting of violence? I mean we're still talking about very low absolute levels. Anecdotally, having been to all three countries, I approximately encountered the same level of violence, _i.e._ nil. So really, I'm lost here. Are there any specific violence-proscribing laws in Germany that somehow don't apply in Turkey or Croatia?

<comment><USER6> If a given place has a higher level of homicide, doesn't it logically follow that more people there resort to violence as a means to solve problems? Your personal anecdote doesn't really disprove the actual statistics. Most countries have laws against bribery and corruption, although I doubt you'd define a countries acceptance of bribery and corruption on the basis of whether there are laws prohibiting it.

<comment><USER7> > If a given place has a higher level of homicide, doesn't it logically follow > that more people there resort to violence as a means to solve problems?

Correlation is not causation, and definitely not logic. A high homicide rate is not indicative of a trend in problem solving, it is indicative of a safety issue.

Specially, a high homicide rate is often the result of warfare. In the absence of conflict with a different nation, usually this means gang warfare. In that case, homicide is sometimes a business tactic, and sometimes tribal.

In some societies, human life isn't as valuable, or there is a precedent for settling disputes with violence, or insignificant problems are dealt with harshly, and so homicide sometimes is a problem solving tool. But it's also sometimes a cultural quirk.

My example is Baltimore, Maryland. Often the city with the highest murder rate, this is a result of gang disputes and the drug trade. The people are friendly and neighborly, and it's got a similar culture to a liberal Southern city.

<comment><USER6> So you're saying that more people committing violent crimes doesn't indicate that more people there commit violent crime? I don't think your example really helps your point at all - more people probably die in Baltimore as a victim of a random act of violence than similar people in marginally less violent places.

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER8> My redneck is showing, but I feel a little naked if I go out the door without either my Leatherman or my Mercator in my pocket. I have even been known to pull it out and use it as an eating knife from time to time...

<comment><USER9> People judge you until it's useful. If I received a dime whenever I've used my pocket knife to cut steaks when everyone had only picnic plastic knifes I would be rich by now.

<comment><USER10> One advantage of an Opinel, is that it doesn't look too out of place as a steak knife. The other advantage: It's cost is very reasonable, especially for the quality of blade you get.

<comment><USER11> I can also attest that their chance to pass an airport security inspection when forgotten in some pocket of a backpack is surprisingly high.

<comment><USER12> And if you have to give it up at airport security because you forgot it was in your pocket, oh well, $15 will set you up with a new one.

</comment></comment></comment></comment></comment><comment><USER13> Pretty sure I read somewhere that the reason we moved to having blunt knives and forks set at the table was because people used to frequently get into disagreements at the dinner table and stab each other, and so it became a requirement to leave one's dagger/sword whatever outside.

<comment><USER14> What's a blunt fork? It would be incredibly easy to kill someone with any ordinary metal fork.

<comment><USER15> I don't know about incredibly easy, but certainly possible. If you stab somebody in the chest with a fork, it won't penetrate as deeply as a dagger, and there's a higher probability that the ribcage will stop the blow and spare the internal organs. Forks are less-lethal utensils.

<comment><USER14> Sure, but the chest is the worst possible place to attempt to stab someone. It's full of ribs.

Stab them in the head, or the neck, or the gut.

</comment></comment></comment></comment><comment><USER16> In Medieval Europe ? My grand-father (who had been working an office job in the city since the 50's) always had his Laguiole along. He even used it in the restaurant. It was certainly standard behavior before WWII in rural areas.

<comment><USER17> George Orwell mentioned the practice in a letter in 1936.

> The trouble is that the socialist bourgeoisie, most of whom give me the > creeps, will not be realistic and admit that there are a lot of working- > class habits which they don't like and don't want to adopt. E.g. the typical > middle-class socialist not only doesn't eat with his knife but is still > slightly horrified by seeing a working man do so.

<comment> rv-de I was just wondering how having only a knife helps with eating. The knife will just make the food bite-sized - though, how do you fixate the meal while cutting? Then it struck me - you'll use your other hand for that and also for moving the piece to your mouth. I'd argue this is the actual problem with this BYO-knife-mentality.

<comment><USER18> If you hold your knife in the right hand you hold the food item in your left. You then cut towards your right thumb, pinching the piece between your thumb and the knife as it comes loose. You can then bring the piece to your mouth with your right hand. As you do this, you turn hand such that the edge of the knife is downwards and the back of the knife is towards your face. The knife is horizontal and the point of the knife is towards your left.

That's hard to put in words but it's not hard to do at all.

<comment> rv-de that's more or less what I wrote. but in many cultures touching food with your bare hands for the purpose of eating is considered barbaric. that's why I suspect that the problem isn't the knife - it's having to use your fingers.

</comment></comment></comment></comment></comment><comment><USER19> The knife is considered the most important tool of all time... perhaps not to eat with, but handy in general:

[https://www.forbes.com/2005/08/31/technology-tools- knife_cx_...](https://www.forbes.com/2005/08/31/technology-tools- knife_cx_de_0831knife.html#4af9ae6516ee)

Socialization seems to be turning knives into taboo things to carry and use out of the kitchen.

<comment><USER20> Knives are generally useful, but not specifically useful. They are often a good substitute for a more appropriate tool. One can use a knife as a can opener, or to cut down a sapling, or to dig a foreign object out of a wound. It may be that a knife is the most generally useful tool of all time: if one can only have one tool, it should almost certainly be a knife. Part of that generality includes misuse, and people tend to have more specifically-useful tools (such as can openers, saws, and surgical implements), which tend to be both less useful and less misuseful (because that's a perfectly cromulent word, no matter what spellcheck says).

<comment> ur-whale Most recently used mine to pull out a credit card from an ATM that wouldn't regurgitate it.

Got a bunch of odd looks from folks in the crowd around me, but got my card back.

</comment></comment></comment><comment><USER21> But not a single image of said knives.

<comment><USER22> Yes, what a wasted opportunity! From googling, maybe something like this?

[http://www.ragnarsmarket.co.uk/product/medieval-eating- knife...](http://www.ragnarsmarket.co.uk/product/medieval-eating-knife- personal-knife-type-1)

or

[https://myarmoury.com/review_tod_15c_eating.html](https://myarmoury.com/review_tod_15c_eating.html)

<comment><USER23> I don't know, but the article says they were similar to daggers. Don't those usually have two edges?

<comment><USER22> I'm not sure. Wikipedia says-

"A dagger is a knife with a very sharp point and one or two sharp edges, typically designed or capable of being used as a thrusting or stabbing weapon."

</comment></comment></comment></comment><comment><USER24> Man I would love to go back to everyone carrying a belt knife. They're so useful. In my state in America it's actually illegal to conceal a fixed blade knife longer than a few inches, but perfectly fine to belt carry (open carry).

I often carry a swiss army knife, opinel, or bushcraft knife with me.

</comment><comment><USER25> You don't have to go that far back. My grandma carried a knife to church. She was from rural Croatia.

My father still carries a knife, and he still uses it for eating fruit.

<comment><USER26> I carry an Opinel in my pocket for eating in the office kitchenette or even in public places.

<comment><USER27> Good job you're not in the UK (I assume) - you'd get arrested for that. Locking knives are illegal in public [1]

[1] [https://www.gov.uk/buying-carrying-knives](https://www.gov.uk/buying- carrying-knives)

<comment><USER28> That is so lame. Non-locking knives are simply a danger to the user. Doing any sort of vigorous knife work it's just a matter of time before you accidentally shut your hand in it, speaking from experience.

<comment><USER29> Disposable plasic knives are also banned in public, unless you are using it to eat. From [https://www.gov.uk/buying-carrying- knives](https://www.gov.uk/buying-carrying-knives)

stealth knives - a knife or spike not made from metal (except when used at home, for food or a toy)

<comment><USER30> > Disposable plasic knives are also banned in public,

No they're not.

</comment></comment></comment></comment></comment></comment><comment><USER31> _During the Middle Ages, forks weren't really part of the picture in Europe._

Supposedly, Catherine de Medici brought the fork from Italy to France and popularized it:

[https://www.cooksinfo.com/catherine-de- medici](https://www.cooksinfo.com/catherine-de-medici)

[http://www.courtneyprice.com/fork-you-said-catherine-de- medi...](http://www.courtneyprice.com/fork-you-said-catherine-de-medici/)

[https://wonderopolis.org/wonder/when-was-the-fork- invented](https://wonderopolis.org/wonder/when-was-the-fork-invented)

</comment><comment><USER32> I find myself using the chop sticks kept in my backpack far more often at restaurants than the pocket knife.

<comment><USER33> chopsticks are useful too, especially when you can't easily wash your hands and want to eat something a bit messy, but they only work for food well cut up in advance...

<comment><USER32> In cases where food isn't cut up, I'll often use both the chop sticks and pocket knife.

Once my chop sticks competency reached the point where they started feeling like finger extenders I started using them quite often. I much prefer putting bamboo sticks in my mouth over anything metal or plastic.

<comment><USER34> Yeah, same with me. What's your feeling about plastic chopsticks and metal chopsticks (Korean style)? I've seen telescoping extending chopsticks made of metal for camping, always wondered if they were any good. I suspect not. I personally camp with wooden, non-bamboo chopsticks.

<comment><USER32> Any kind of wood over all else.

If a restaurant brings out metal chopsticks with my food, the wood ones from my bag come out.

Telescoping metal chopsticks sounds like a solution looking for a problem personally. It's not like bamboo disposable chopsticks weigh much, just stick them somewhere.

<comment><USER34> Me too. I guess telescoping means you can reduce the length of the rigid portion to keep them in smaller spaces, like on your belt or something. There's a whole culture of that around Hong Kong, for example. Everything must clip to belt - otherwise, not cool. I only half joke.

</comment></comment></comment></comment></comment></comment><comment><USER35> I believe Henry Petroski's _Evolution of Everyday Things_ begins by describing Western eating utensils. It also goes into similar stories about sandpaper, paperclips, and other everyday items. Great read if you enjoyed this article.

<comment><USER36> I rather think that causation goes the other way.

If you enjoy that, then you'll enjoy this article. However I enjoyed this article but still rate that book as the most boring book that I've ever managed to finish.

</comment></comment><comment><USER37> The first person to paint true to life peasants was Pieter Bruegel. Until the renaissance people painted for kings, queens and the church. Bruegel is therefore an excellent source for being able to determine if this story is true.

If you look at his paintings then only the men are carrying knives. None of the women are. Why is this and can someone prove me wrong? I am not that familiar with his work and have not checked everything he painted yet I have not seen women with knives in his art.

<comment><USER10> I should think a peasant woman of the time would wear a knife concealed beneath her skirts.

<comment><USER37> Nope. I had to ask my favourite search engine since my observation on the topic was not deemed that relevant here. Surprisingly simple answer:

"At many medieval dinner tables men and women ate in couples from a bowl shared between them, and when they did, men were expected courteously to serve their female partners, cutting portions of meat for them with their knives."

So that explains my observation of the paintings from the era that only show the men with knives.

</comment></comment></comment><comment><USER38> In my country (Italy) AFAIK you're not allowed to carry a knife (any size, even the smallest) in any public place (pub, restaurant, post office, ..). Even on the streets or driving the law enforcement officers could ask you for a sound motivation to carry it.

<comment><USER39> You can carry a folding, non locking knife anywhere in Italy

<comment><USER38> I am not a lawyer but checking out some sources it looks like you're not allowed to do that. Relevant law should be law 110/75 article 4.

</comment></comment></comment><comment><USER40> A personal eating knife seems like the perfect accessory to my utilikilt!

\---

Also when did atlasobscura become the new hotness?

<comment><USER41> > _Also when did atlasobscura become the new hotness?_

Links to it pop up regularly on HN, and have been for some time. Usually there's something interesting on both ends.

<comment><USER40> Im not saying that they are not interesting -- Its just seemingly that they have only relatively recently become super popular...

</comment></comment></comment><comment><USER42> I highly recommend the book mentionned in the article - 'Consider the Fork', for those interested in cooking.

A great book with many interesting topics (the personnal knife is just one of them) !

</comment><comment><USER43> What would be the fastest way to kill someone with a push-pin? Asking for a friend.

I can think of puncturing their eyes or their genitals if I wanted to make the thing painful, but that wouldn't kill them any faster I reckon.

<comment><USER44> Likely via the carotid artery or perhaps the femoral artery if you were up close and very personal, but this is mostly an exercise in futility.

<comment><USER45> I'm not sure you could reach those arteries with a push-pin.

<comment><USER44> The carotid is right under the skin on the sides of the neck. Academically, I suspect you absolutely could reach it with a push pin.

In Jiu Jitsu, you're taught to squeeze on the sides of the neck for a choke. The goal is not to cut off the air supply via the throat so much as the blood supply to the brain via the carotids. Many people pass out in 20-30 seconds of directed relatively gentle pressure on the carotids.

<comment><USER46> We were recently talking about choke holds in Krav Maga, and it's shockingly fast when the sides of the neck are squeezed. Within about 5 seconds, for me, I start to get tunnel vision and a profound sense of panic.

<comment><USER29> That's how they taught us to choke people during basic training in the USMC, and collectively referred to the chokes as "blood chokes" because you cut off blood supply to the brain. It's suprisingly easy to choke someone unconcious just by twisting the sides of their shirt collar, or grabbing someone from behind and squeezing the arteries on their neck with your forearm and bicep. The scariest part about doing it during training is that you don't know that you're about to blackout because you can still breath fine, it's just that none of the oxygen is getting to your brain.

</comment></comment></comment></comment></comment></comment><comment><USER47> The two medieval monks can explain what's going on in that picture:

[http://the-toast.net/2015/02/11/two-medieval-monks-invent-di...](http://the- toast.net/2015/02/11/two-medieval-monks-invent-dinner-parties/)</comment>


The Absolute Minimum Every Software Developer Must Know About Unicode - <AUTHOR> http://www.joelonsoftware.com/articles/Unicode.html <comment><USER2> A few things I wish I could tell all newbies about staying out of trouble with Unicode:

* Use UTF-8 for external text, whenever possible. If your collaborators have other ideas, bribe them with tasty cookies or something, because this right here solves a lot of hassles. There are some circumstances in which a different encoding might have its advantages, but it is tremendously reassuring to be able to say "Ah, text! I shall decode it as UTF-8!" and be right. This has the advantage of being compatible with ASCII input, and avoiding the perennial UTF16/UCS2 confusion.

* Make it explicit that you're using UTF-8. For example, if you're making a web page, be sure to set "Content-Type: text/html; charset=utf-8" in the HTTP headers, to make the browser's content encoding detection trivially correct.

* When dealing with strings in your favorite programming language, always know whether it's an array of Unicode code-points, or of bytes in UTF-8, or some third messed-up thing. Not all strings are the same kind of thing! Unless your programming language has this distinction enforced by its type system, of course.

* Be aware when you're crossing the boundary between Unicode code points and Unicode in some external encoding. Decoding can fail, so be prepared. It's best to reject invalid text as early as possible.

* When in doubt, use other people's code for Unicode handling. For most of the crazy crap you run into in the wild, there is well-tested crazy-crap-handling code.

<comment><USER3> > * When dealing with strings in your favorite programming language, always > know whether it's an array of Unicode code-points, or of bytes in UTF-8, or > some third messed-up thing.

What is an 'array of Unicode code-points'. I actually reread the article thinking that my unicode chops were getting rusty if I didn't know what that meant, but after rereading it, I still don't know what you mean.

[I wrote a half a dozen 'do you mean _____' suggestions, but I think I'll just let you explain. :) ]

<comment><USER2> Sorry for the unclear wording; I meant "an array of fixed-width values, each of which stores a single Unicode code-point". For example, any program that stores text in UCS-4: an array of 32-bit values, each holding a single code point.

This is how way too many people think that UTF-16 works: each code point gets 16 bits, and you have an array of them, so you can count characters, do O(1) random indexing, and so on. This is a harmful myth, of course. Code points do not correspond neatly to glyphs, and UTF-16 is a variable-width encoding, although most people don't use code points outside the basic multilingual plane, so a lot of people can get away with pretending that it's fixed-width, until they can't.

The most maddening instance of this confusion that I've seen so far is in Python's Unicode string handling. Guess what happens when you run this Python code to find the length of a string containing a single Unicode code-point:

        print len(u"\U0001d11e")

This will print either 1 or 2, depending on what flags the Python interpreter was compiled with! If it was compiled one way (the default on Mac OS X), then it uses an internal string representation that it sometimes treats as UTF-16 and sometimes as UCS-2. With another set of flags (default on Ubuntu, IIRC) it will use UCS-4 and do the Right Thing. For the same task, Java gets the string length right, but requires you to explicitly write the string as a UTF-16 surrogate pair: "\uD834\uDD1E".

The redeeming virtue that both share is that they will do the right thing if you treat everything as variable-width encoded, use the provided methods for encoding and decoding, and avoid the hairy parts left over from when people naively assumed that UTF-16 and UCS-2 were the same thing and that they ought to be enough for anybody.

<comment><USER3> Thanks, that's a great clarification.

</comment></comment></comment></comment><comment><USER4> Amusingly enough, Joel's company does not follow Joel's preaching.

I tried to convince Fog Creek to abandon the obsolete, non-standard and proprietary 8-bit Windows-CP1252 character encoding in the E-mails that FogBugz sends. They refused, reason given: "joelonsoftware.com is a blog. Fog Creek Software is a business."

<comment><USER5> Not sure what you're talking about; FogBugz sends UTF-8 email.

<comment><USER6> I just looked at my FogBugz email from today morning, it is indeed using CP1252 character set. See: <http://i.imgur.com/nV3V6.png>

I think this could be because you use messagelabs.com to send out the emails.

<comment><USER7> It sends CP1252 emails if all the characters used fit. If they don't, it uses UTF8. That way, people with old mailers can still read them (more realistically, people reading the raw email can read them out of the database or from traffic dumps), because .NET has a tendency to base64 encode the body the instant you set charset to UTF8, and I don't unbase64 in my head.

Try including the funny character of your choice in an email. It should show up just fine.

<comment><USER6> You are right. I created another test case with Chinese character and the email is now UTF-8. See: <http://i.imgur.com/LeaX8.png>

I think this is a very good compromise.

</comment></comment></comment></comment></comment><comment><USER8> I remember when this was first posted. RSS was new, Movable Type 2.x was hot shit, the future of the web was XML and real hackers were parsing it with regular expressions and duct tape. Everything was supposed to be Unicode, except the webdev community was 99.999% NorthAmerican and everybody knew plaintext "is supposed to be ASCII" anyway.

Fast forward 8 years... I've joined Stack Overflow about a week ago and my first accepted answer was about Unicode and string handling in Python 2.x. Just yesterday I was thinking I should reread this exact post, to refresh a few points and keep shooting fish in that barrel. I guess I should be grateful Python 3 has gone full-Unicode... except that now people ask how to emit ASCII with it. And the Python community is among the most clued-up on the subject (probably as a reaction to how bad it was handled in 2.x).

And I'm not even a fucking software developer.

</comment><comment><USER9> "EBCDIC is not relevant to your life. We don't have to go that far back in time."

I wish this was the case. And for 99% of you it might be. But there's still lots of EBCDIC (and antique COBOL) out in the wild that increasingly has to interact with the real world. One of the chunks of telephony software I'm responsible for has to interface with an EBCDIC system, requiring some basic translation to UTF-16. (And then eventually has to pass some of this now UTF data back to the EBCDIC system.) Not exactly difficult until you get to the various numeric encodings and no one can decide if they want Binary-Coded Decimal, Pic9s, pure int, signs, which endianess (if they even know about endianess), et cetera.

EBCDIC wasn't dead in 2003 when Joel wrote this and it certainly (and unfortunately) isn't dead in 2012.

<comment><USER10> Yup, if you have to work with old iSeries servers, or just about anything dealing with old retailers in eCommerce, you've probably touched it one time or another.

Fortunately, the recode program makes it easy to switch between different encodings.

</comment></comment><comment><USER11> I don't mind the repost. Every time I read this I've learned more, gotten more context and encountered more problems with character encoding, so every time I get more and more out of the essay.

I wouldn't even think about reading it unless I saw it posted on HN. However as long as I've got to deal with character encoding problems like this:

<http://ibm-china.jobs/branch-admin-lan-zhou/jobs-in/>

I'll still reap some benefit out of re-reading this essay.

</comment><comment> buff-a FTA: "The traditional store-it-in-two-byte methods are called UCS-2 (because it has two bytes) or UTF-16 (because it has 16 bits), and you still have to figure out if it's high-endian UCS-2 or low-endian UCS-2."

Written in 2003, 7 years after UCS-2 was obsoleted by UTF-16 because Unicode 2.0 was too big for just 16 bits. UCS-2 is not UTF-16. Windows NT wasn't UTF-16 either, IIRC.

Of course, Microsoft kept telling everyone that 16bits-per-character is Unicode.

[1] <https://en.wikipedia.org/wiki/UTF-16>

</comment><comment><USER12> Here's my follow-up: The Absolute Minimum Every Software Developer Must Know About Unicode _encodings_ :

Just use UTF-8.

<comment><USER13> It's really not that simple.

If you do a lot of string manipulations, you're better off with either UTF-32 or dumbified (16-bit fixed) UTF-16, otherwise you will have to count characters from the beginning of the string every time you need to access the nth character within the string. Moreover, if you deal with a text with a lot of characters between 0x0800 and 0xFFFF (e.g. East-Asian languages) you're much better off with UTF-16 as you will save a whole byte per character.

<comment><USER2> How often do you need random access by code point? In every case I can recall, if random access by UTF-8 offset wasn't the right thing (which it usually was), then random access by code point wouldn't be either. Almost all string offsets you'll ever have to deal with come from having a program look at a string, and in that case, you can just use UTF-8 byte offsets. What sort of text processing are you doing where this isn't the case?

As for East Asian text, you have a point: it _will_ usually be shorter in UTF-16 than UTF-8. Before making this decision, though, ask yourself how much that extra space is worth to you. Is it worth dealing with possible encoding hassles? (The answer to this may be yes, but it's a question that should be asked.) Also, on a lot of data, there are many characters from the ASCII range mixed in with the East Asian text. I did an experiment a while back where I downloaded some random web pages in Chinese, Japanese, Korean, and Farsi, and compared their size in UTF-8 and UTF-16. Because of the amount of those documents that was HTML tags, all four pages ended up smaller in UTF-8.

<comment><USER13> Maybe I'm missing something but I'm not sure if I understand you question. How would you write even a simple parser without being able to access the contents of the string randomly by the character index?

<comment><USER2> You _can_ access the contents randomly. Just use the index in bytes, rather than characters. Let's look at a really simple parsing task as an example: splitting tab-delimited strings, in UTF-8. First, you find the indexes in the string (in bytes) of the commas, then you use those to split out substrings. This is exactly the same code you would use with plain ASCII text, and in fact a lot of programs designed to process ASCII work unmodified with UTF-8.

Another example: for a lex-and-yacc type of parser, you can use regular expressions to split a string into tokens, and then use a parser on that stream-of-tokens representation. None of this requires character indexing; just byte indexing.

</comment></comment></comment></comment></comment><comment><USER14> Seems the article need some updates?

>> In UTF-8, every code point from 0-127 is stored in a single byte. Only code points 128 and above are stored using 2, 3, in fact, up to _6_ bytes.

In Wikipedia:

>> UTF-8 encodes each of the 1,112,064[7] code points in the Unicode character set using one to _four_ 8-bit bytes

Reference: <http://en.wikipedia.org/wiki/UTF-8>

<comment><USER15> I dont get this actually.

Say a UTF8 string is ae 31 c1 12.

Now how do we decide whether it has the characters "31","c1","ae","12" or the characters are "ae 31" and "c1 12" or even "ae","31 c1" and "12".??

EDIT: Never mind!..found my answer here [http://stackoverflow.com/questions/1543613/how-does- utf-8-va...](http://stackoverflow.com/questions/1543613/how-does- utf-8-variable-width-encoding-work)

<comment><USER2> The tldr is that UTF-8 is a prefix code: no valid character is a prefix of any other.

<http://en.wikipedia.org/wiki/Prefix_code>

</comment></comment></comment><comment><USER16> I'm not sure why HN's duplicate checker doesn't find this, but:

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

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

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

<comment><AUTHOR> Sometimes it misses, although in some cases I think it might be related to age: after a certain time it's fun to revisit and given that the base changes no doubt some current readers weren't around when it was last posted.

</comment></comment><comment><USER17> Also worth a read <http://stackoverflow.com/a/6163129> (Perl and Unicode and why it's really hard)

<comment><USER18> Ouch. And here I thought PHP made it needlessly complicated to use UTF-8: [http://malevolent.com/weblog/archive/2007/03/12/unicode- utf8...](http://malevolent.com/weblog/archive/2007/03/12/unicode-utf8-php- mysql/)

<comment><USER19> Perl actually has one of the best Unicode supports (second only to ICU). This guy worked on it, so he's listing all the edge cases (bulk of the post), explaining how to get rid of backward-compatible brokenness (and maybe Perl needs a quicker way to saner defaults), and explaining how to do work that requires explicit handling.

</comment></comment></comment><comment><USER20> I've wanted to get one of these for years: <http://www.cafepress.com/nucleartacos.26721820>

(I do not work for cafepress)

</comment><comment><USER21> The only thing I remembered on my first lesson on character codes was: ASCII a stupid question get a stupid ANSI!

</comment><comment><USER22> I suspect the reason so many people don't know about is because they don't care enough. (I don't care enough). This is not an interesting enough topic for most devs to bother with unless something has broken or isn't working write and Unicode "problems" are suspected to be the reason.

<comment><USER4> …and this is exactly why this essay should be regularly reposted. If you write any software that is used by people other than yourself, you should care, because they will most likely find it broken.

Also, if you write software for money, ignoring Unicode is just plain incompetent. I can't count the number of times I've had packages shipped to "Biały Kamień" or "Bia&#322;y Kamie&#324;" street instead of "Biały Kamień". If you expose even a single name or address field in your software, you need to handle Unicode.

And yes, you need to handle Unicode even if you want to limit yourself only to the US market. Your customer might have an umlaut or an accent in his name.

<comment><USER22> > If you write any software that is used by people other than yourself, you > should care,

I agree and I should know better. I even opened the link. But after reading for 10 seconds, I closed it. I just wasn't motivated enough. Even had to fix bugs and issues related to this just last month. But every time I do, I just go and find out enough to solve the problem and then never really dig deeper. Don't really know why it is this way.

<comment><USER23> How did you manage to learn anything in your profession then? Really, that is a short and well-written post, which shouldn't take more than minutes from your schedule.

<comment><USER22> > How did you manage to learn anything in your profession then?

I cared about it. I will forget to eat and sleep if I am studying something I am motivated about. The rest I just learn as needed only if am forced to (read "when stuff breaks"). Not a very good approach I guess.

</comment></comment></comment></comment></comment><comment><USER24> Off topic: Has anyone got a link to case insensitive string comparison that also ignores accent differences?

For instance, when I search on Facebook for names, I never type accented e-s, but it stills brings up my friends who have accented e-s in their name.

<comment><USER25> Depends upon the language I guess. Here's an example in Perl: <http://stackoverflow.com/a/5163247/93865>

</comment></comment><comment><USER26> While you're enjoying this classic article (and I _do_ re-read it every time it's posted), you may wish to also take in Tim Bray's - in my opinion equally classic - article about Unicode.

<http://www.tbray.org/ongoing/When/200x/2003/04/06/Unicode>

Tim has spent more time working with bodies of text [1][2] than many of us, so his perspective is very useful and the article is thoughtful.

[1] Oxford English Dictionary [2] XML committee

</comment><comment><USER27> I will just add - Unicode isn't hard - until you have to display or otherwise deal with Right-To-Left languages and their invisible control characters.

I find out that even working as a user with text that is right-to-left in places and in other places left-to-right is _hard_. It's quite easy to deal with it programatically, but only before you have to _display_ it somehow.

Ok, sorry my ramblings.

</comment><comment><USER28> There seems little point when the 2nd most popular browser (Chrome) won't correctly display Unicode.

[http://en.wikipedia.org/wiki/Mathematical_operators_and_symb...](http://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode)

square square square

Contrast with Firefox

</comment><comment><USER29> I can't say it qualifies as the absolute minimum everyone should know, but I highly recommend reading the book Unicode Demystified if you're the kind of programmer who wants to understand how everything works.

</comment><comment><USER30> When I was beginning to learn HTML, this article helped me get a grasp over encodings etc... Thanks @spolsky. I started following your blog after reading this :)

</comment><comment><USER31> I thought decorum dictated that an aged post should have the year in brackets or something similar! A lot has changed in the last 8 & half years.

<comment><USER32> He says

"When I discovered that the popular web development tool PHP has almost complete ignorance of character encoding issues, blithely using 8 bits for characters, making it darn near impossible to develop good international web applications, I thought, enough is enough."

So that hasn't changed.

<comment><USER33> This is FUD. It's really not difficult to use the mb_* family of functions to deal with unicode in PHP. If you're writing a new app, this is trivial. If you're working with an existing app, it's obviously more difficult, but far, far from impossible.

<comment><USER25> Of course you _can_ manipulate utf-8 in PHP, else it would have died long ago. But as a matter of fact PHP 6 was a failure, and unicode is still an afterthought that you must hack around with special functions in PHP5.

<comment><USER33> Well, there's almost no string handling built-in to PHP as a language at all, it's just provided as part of the standard library. So instead of using one part of the library (the standard string functions), you use another (the mb_* string functions.) I don't really see how that's a hack. The one thing that could go wrong is if you don't have the mb_* extension, but that's easily rectified, and hasn't been something I've seen in the wild in the past few years.

I'm not saying PHP's UTF-8 handling is great by any means, but the claim was that it's "nearly impossible." I'm suggesting that one should instead say "Building a UTF-8 compliant site in PHP is annoying, and requires more work than one would prefer, but if you do a bit of research, it's not that hard."

<comment><USER25> > _I don't really see how that's a hack._

Because if you switch encoding you need to modify the code. All languages actually supporting utf-8 use the very same functions whatever the encoding is, eventually you simply need to declare that you're using utf-8 but that's all.

</comment></comment></comment></comment></comment></comment><comment><USER34> too long, he must be enjoying writing for the purpose of writing itself.

</comment><comment><USER35> I love how Joel manages to come off as a total snarky douchebag in his writing.</comment>


Scientists have grown a brain in a petri dish and taught it to pilot an F-22 jet simulator - <AUTHOR> http://frostfirehive.com/scientists-have-grown-a-brain-in-a-petri-dish-and-taught-it-to-pilot-an-f-22-jet-simulator <comment><USER2> No, they haven't. It's hard to explain what they did do since it was so overcomplicated, but bear with me.

They took a few thousand rat neurons and placed them on electrodes. At that point, each neuron's charge could be measured as it fired. A neuron doesn't fire instantly and stop - its charge rises sharply, then falls over time. The graph of a neuron firing resembles a bell curve.

Now that the charge of an individual neuron could be measured, they selected two (one to control the F-22's roll, and one to control the elevation) and began the simulation.

First, imagine a steady, level plane. We say that the plane's error is 0 degrees. Now roll the plane 5 degrees clockwise (or counterclockwise). The error is 5 degrees. So the plane's error is known, and maxes out at 180 degrees (inverted flight).

Second, imagine the graph of a neuron firing: <http://img515.imageshack.us/img515/3873/graphet3.png> ... We'll say that if we sample from the left side of the graph, we've sampled at X=0 degrees. If we sample from the right side of the graph, we've sampled at X=180 degrees.

Third, a technique exists to deaden a neuron's response. This technique is applied throughout the simulation, so the graph you're looking at is slowly being squished toward the bottom (the dashed line).

Let's say our plane has an error of 10 degrees. Go ahead and sample the graph at X=10. You know what X=10 was at the start of the simulation (the solid line), and you know what it is currently (the dashed line). They use the difference between those values to determine the airplane's corrective action.

Since the simulation starts with the solid line equal to the dashed line, our airplane takes no corrective action and continually plows into the ground. Eventually, the dashed line departs from the solid line enough to cause significant corrective action, and the plane flies straight and level. There is no learning involved, and no decoding of neural communication protocols. They're just decrementing a variable - only the variable is a firing neuron.

It's basically a hi-tech Rube Goldberg device.

You can read the paper here: <http://neural.bme.ufl.edu/page13/assets/NeuroFlght2.pdf> ... If you can't read a scientific paper, try. It's good to be able to know when a scientist is full of it.

<comment><USER3> This "journalist" should be ashamed of him/herself. What a load of crap.

This is no more amazing than putting a rock on a string and telling a computer to correct the plane's roll when the rock moves away from 0 degrees.

Also, the article has the greatest use of hyperbole-by-parentheses ever: "... what scientists are calling a 'live computation device' (a brain)."

<comment><USER4> I don't find this report noticeably bad. The paper did call the brain a "computational device." It was a "simple" experiment and simple paper. There is also nontrivial effort going into the numerous little steps, crammed into the methods section, that brought about this experiment.

palish's comment is informative but not absolute: depending on your interpretation, the headline may not be sensationalist at all. The software was, as described, an "F-22 flight simulator." Confusing to the general public? Yes. Shameful? Not really.

I also disagree that it's a high-tech Rube Goldberg machine. The analogous term for EECS folks would be "hack." It's like saying a wiimote mod for an FPS is a Rube Goldberg machine... which isn't _false_ , but misses the point, don't you think? As a hack, I think it's very interesting. Not surprising, not epochal, but cool nonetheless. A plane can be flown by software, or by bioware, neither approach is perfect at the moment, so "hacks" like these serve their purpose.

<comment><USER3> Interesting thoughts.

But the fact remains, they weren't really using the neurons as a "brain", which is what the article/headline claims, they were just using sophisticated software to find an ewualibrium point and self-correct.

They were hacking the neurons, yes, but only at the most basic level of neuron function. The author misrepresented the facts by suggesting it was "learned" behavior, and that is, I think, shameful.

If the neuron cluster actually learned something, then it would be pretty amazing.

</comment></comment></comment></comment><comment> daniel-cussen If this is true, it is kind of ridiculous. That's pretty cool that they can do that.

edit: I read palish's comment. It _would_ be cool _if_ they could do that.

</comment><comment><USER5> Next thing you know, the brain in a petri dish will be a leading light in the Church of Scientology. _In to the danger zone_

<comment><USER6> Naahhh, a brain in a dish could never raise enough $ to become a high level scientologist. Plus everyone knows that Hollywood cares nothing about brains!

Although, it would be crazy-cool if scientologists were to go around saying "Gee, brain, what do you want to do tonight?"

<comment><USER3> What the scientologists do every night...</comment></comment></comment>


Show HN: Construct 3 browser game editor – free for 2 weeks for Newgrounds jam - <AUTHOR> https://www.construct.net?v=9 <comment><AUTHOR> Hi everyone, our browser-based game editor Construct 3 is completely free for the next two weeks for the Newgrounds/Construct gamejam - the theme is "Good things come in threes". Would welcome any feedback on the editor! Links to full announcements:

[https://www.scirra.com/blog/206/its-time-to- jam](https://www.scirra.com/blog/206/its-time-to-jam)

[http://www.newgrounds.com/bbs/topic/1423023](http://www.newgrounds.com/bbs/topic/1423023)</comment>


Redesign Student ID Card - <AUTHOR> http://cs.brown.edu/courses/csci2951-l/ciliazz/redesign.html

<comment><USER2> I would prefer the old design a student ID doesn't need so many personal details about a student.

Mine didn't even had a picture.</comment>


Ask HN: Little hacks that make your life easier? - <AUTHOR> Everyone has those own little workarounds that make life easier.
Here are a couple of mine -
1. Using AutoHotKey to write my signatures, frequently used expressions (ex: plm becomes "Please let me know if you need some more information." , answers to frequently asked queries by customers, open specific files with a keyboard shortcut)
2. Using IFTTT : This tool helps a lot. One of the ways I use it is to save my monthly utility bills (arriving in Gmail) automatically every month direct in my chartered accountant's shared dropbox folder. That email in turn is auto archived, so such bills are completely out of my way.
What are your time saving hacks that you use frequently? <comment><USER2> A common one, but undeniably useful: find a type of sock you like, buy a _bunch_ of them, then throw out or donate your old ones. Then never sort those socks again.

<comment><USER3> I've done this with all of my shirts, pants/shorts, and briefs as well.

<comment><USER4> Have you ever had an issue with people asking why you wear the same shirt all week?

</comment></comment></comment><comment><USER5> 1\. Synergy

I use Synergy to use my netbook's keyboard and touchpad for my workstation. I just zoom everything up on the workstation and lay back on the bed and code. Very cool. Bash alias on both systems is "synergize"

The next thing that I am going to do is switch the server and client roles automatically so that when I am using the workstation I would be able to control my netbook.

2\. Tmux

I ssh to the workstation from my netbook and attach to a running Tmux session. Feels like working locally.

3\. Redshift

Decrease brightness in the evening, I have a bash alias called "soothing" which does the job.

4\. Wake on Lan

Start the workstation in the bedroom if I am in another room. Bash alias "wakywaky"

5\. Map Caps Lock to Esc

Just do it. Useful if you are a vimmer.

6\. Vimium

Useful if you are a vimmer.

7\. A simple text file to track TODO's with vim

Vim makes it super easy to track TODO items. No plugin required. You can move around and makes changes quite fast.

<comment><USER6> Related to #7, I use a shell alias to open vim with three splits:

        alias wl="vim -o $HOME/worklog/{todo,progress,done}"

Tasks flow down the splits. If you'd prefer tasks to go left-to-right, use `-O`.

<comment><USER5> Nice. I am stealing this. I have the leader mapped to <Space>. And I move around splits and tabs using this.

        "New horizontal split
        nmap <leader>s :split<CR>

        "New vertical split
        nmap <leader>v :vsplit<CR>

        "New tab
        nmap <leader>t :tabe<CR>

        "Easy close
        nmap <leader>q :q<CR>

        " Split navigation
        nmap <leader>j <C-W>j
        nmap <leader>k <C-W>k
        nmap <leader>h <C-W>h
        nmap <leader>l <C-W>l

        "Tabs like Vimium
        noremap <S-j> :tabprevious<CR>
        noremap <S-k> :tabnext<CR>

<comment><USER7> You should check out `:help CTRL-W_v` and most of `:help opening-window` in general; the first few of your shortcuts are already in Vim by default. I had similar shortcuts until a serendipitous trip into the help docs.

<comment><USER5> You are right. I used to use them but pressing Ctrl was a pain in the pinky finger. :sp and :vs is 2 more keys to press. Using Space as a leader makes everything available at the flick of my thumb. I rarely ever move my eyes to the command pane.

I forgot to mention that I have mapped Space+P to CtrlP fuzzy finder. That too is a one pinch like operation, even though it requires two keypresses.

</comment></comment></comment></comment></comment><comment><USER8>
        echo 127.0.0.1 news.ycombinator.com >> /etc/hosts

<comment><USER9> Whats this do?

<comment><USER10> Easily increases your productivity by factor of 2-4.

<comment><USER11> On a busy news day, probably closer to 8 for me. Seriously. It can be a real problem. I actually took the plunge and did this for a while, and now I feel I've built up enough self-control to not need it. The difference has been amazing.

</comment></comment></comment></comment><comment><USER12> When I'm paying with a card I hold my wallet until I get my card back. I wrote myself a script and have my dot files on github to make setting up a new machine quicker. Tons of gmail filters. Ian's knot to tie my shoes (I know, doesn't really save time, I think there's an XKCD that shows the break even point on time investments like that). Aliases like 'helpme' that remind me of some Git commands I always forget. Brush my teeth while peeing.

Yeah, mostly stupid little things.

<comment><USER13> I like these tips: \- Holding your wallet also helps you be sure to put the card back in your wallet and not someplace else. \- I think everyone agrees that the dotfiles one is useful \- I personally need a better shoelace know as opposed to a faster one haha, but always fan of when people are willing to do something unconventionally and better

</comment></comment><comment><USER14> My shirt rack has three "zones". Clean clothes go in zone 1. When I take out a shirt, I put a special color hanger in its place. At night I hang up my shirt in the next zone, or chuck it in the hamper as appropriate.

My memory for little stuff sucks, so this makes it easy to wear each one three times.

<comment><USER15> or wear a clean shirt every day. Just sayin.

<comment><USER16> A clean shirt on a clean body probably isn't gettin too dirty to wear after one or two wears.

Not washing clothes until they need to be washed is probably environmentally beneficial - saving all that water and energy.

</comment></comment></comment><comment><USER17> I am terrible at remembering things, so for parts of my daily routine, I will just remember the number of things I need to grab/do, rather than the things themselves.

For example, there are 9 things I need to put in my gym bag when I pack it before going to the gym/work. Remembering that there are 9 things is much easier for me than remembering that list of 9 things, so I can just count as I'm packing and know when I'm done, and the probability of something foreign getting in is very low (although I have on occasion packed two pairs of socks instead of socks + underwear - never a fun way to start the day).

Or another example - I need 4 things in my pockets before I leave for work - keys, wallet, phone, work badge. The count of 4 is way easier for me to remember than the 4 things themselves.

<comment><USER3> Why wouldn't you just keep a list in your bag?

</comment></comment><comment><USER11> A Mac app called Alfred has saved me countless hours. It comes with a clipboard manager (extremely useful), and the ability to create custom workflows/hotkeys, which I use to switch back and forth between Skype, Chrome, and Sublime. iTerm2 already has a hotkey feature built in, but if it didn't I'd have made one (takes <30 seconds).

Following Gary Bernhardt's advice, mapping Caps Lock to a modifier key (he recommends Control I think, I mapped it to Alt) has been awesome.

Aliasing common Git commands to 2-3 letter commands has been nice. gc -> git commit, gaa -> git add --all, gpom -> git push origin master, etc.

Vimium for Chrome is nice if you're used to Vim keybindings for navigating.

hop is a command-line tool for jumping to directories (or SSH'ing into servers). Immensely valuable.

<comment><USER18> We have an internal wiki page with custom alfred formulas for our company.

"customer <email>"

"domain <domain>"

"logs <logs>""

It makes life for engineers, support, and sales much more efficient.

<comment><USER11> I wish there were enough Mac users at our company to make this worthwhile. Is your whole team on OS X?

<comment><USER18> No, but in general company laptops are macbooks. They play nicely with virtualized operating systems, SSHing into *nix servers, windows via bootcamp, etc.

The Alfred formulas are shared more out of courtesy than a company need.

</comment></comment></comment></comment><comment><USER19> If I need to take something with me out of the house that I don't normally take (i.e. NOT my laptop bag, keys, etc), I leave it on the floor beside the door out of my apartment. Which means I can't help but look at it when walking out the door.

<comment><USER11> My fiancee used to think I was nuts for doing this! This entire thread has really helped validate a lot of my personal habits. Thanks, HN.

</comment></comment><comment><USER20> ag. I use this tool between 50 and 100 times a day.

[https://github.com/ggreer/the_silver_searcher](https://github.com/ggreer/the_silver_searcher)

<comment><USER21> How does it compare to just using git grep?

<comment><USER22> It works outside of git repositories and is faster than grep or awk.

<comment><USER23> Especially helpful in emacs with projectile (which has a function projectile- ag). Create a quick binding to locate all the FIXMES and feel free to experiment. Maybe it should also open file and mark the lines in a new frame for ultimate bug squashing...

</comment></comment></comment></comment><comment><USER24> As someone who use git quite a lot, I have created a TON of aliases for it, so that I have to type very less. Sometimes, I have created bash functions as it needs to handle some logic too.

For example: gl (git log), gb (git branch), gr (git remote -v), gpom (git push origin master), gpuom (git pull origin master), gcam (git commit -a -m), gcaa (git commit --amend -a), gc <github-ID>/<repository> (git checkout -b [https://github.com/$1](https://github.com/$1)), etc

<comment><USER25> This is exactly what I did when we started our current project at work, on which we use Git. I also made aliases gl, gr, gb. gc means 'git commit -m' for me, and I have gco for 'git checkout', gcb for 'git checkout -b', gpod for 'git push origin develop' and gpud for 'git push upstream develop'. Made my life so much easier. :)

</comment></comment><comment><USER18> Create a public link to your availability from google calendar and share it with people to decrease the time it takes to schedule meetings.

</comment><comment><USER26> The Mac OS text-to-speech tool is awesome for proofreading.

Another use for it is to be read blog posts to while doing the dishes and making coffee.

<comment><USER22> You can also use it from the terminal with the `say` command, e.g. `say -f myfile.txt`

</comment></comment><comment><USER27> Resealable sandwich bags. I use them to portion food, either raw or cooked, and freeze. It means even if I'm working 50+ hours this week I can cook a couple of meals on Sunday and be sorted for the week. It also means that, since I live communally but cook by myself, I don't have to eat the same meal for four days in a row.

<comment><USER18> I use ball jars. They are reusable, they basically never spill during transit, and they fulfill multiple other roles.

</comment></comment><comment><USER28> I can't recommend LastPass enough. Also, PIA for VPN. I put a little cash and my credit card in my phone case so that I have only one thing to carry and always have money on me. I really liked f.lux when I used windows, if only I had a decent replacement for ChromeOS.

<comment><USER29> I really want to like LastPass, but I can't get over all of my passwords being stored on someone elses server. Doesn't that seem like a terrible security risk?

<comment><USER30> Well, this scares me:

[http://techcrunch.com/2014/07/11/lastpass-finds-security- hol...](http://techcrunch.com/2014/07/11/lastpass-finds-security-holes-in-its- online-password-manager-doesnt-think-anyone-exploited-them/)

[http://arstechnica.com/security/2014/07/severe-password- mana...](http://arstechnica.com/security/2014/07/severe-password-manager- attacks-steal-digital-keys-and-data-en-masse/)

<comment><USER31> The LastPass vulnerabilities affected only bookmarklets (used by less than 1% of LP users, according to LP) and OTPs (no estimates for use).

I've been using LP for over a year, didn't know either feature existed until the disclosure: I use it strictly for its main capability, encrypted and unique site passwords.

</comment></comment></comment></comment><comment><USER32> I don't use deodorant. At all. I haven't for about two years now. And I guarantee you that I have less underarm smell than you.

Every morning I splash a squirt of rubbing alcohol under each arm. No smell, no white powder, no creepy aluminum salts.

<comment><USER33> > no creepy aluminum salts

As someone who's used them for probably a decade now, I wonder what you think is creepy about them?

Also, I've read about some rubbing alcohols not being safe for long term use, have you heard this, and what have you settled on?

<comment><USER34> possibly alzheimer's disease. ...or maybe not.

[http://www.webmd.com/alzheimers/guide/controversial- claims-r...](http://www.webmd.com/alzheimers/guide/controversial-claims-risk- factors)

</comment></comment></comment><comment><USER35> Get a dressing gown/robe if you want to be warm at night but don't want to sleep with heavy clothing, and want to be decent if someone knocks at the door.

Sounds obvious, but I never realized how useful it is.

</comment><comment><USER4> Instead of keeping squishy balls at my desk, I have something that resembles Thor's hammer, except it's weighted. I play with it idly during the day[0], which helps strengthen my grip and forearms. I started doing this when my hands started to show signs of RSD. Haven't had an issue with it since.

[0] I don't swing it, as I'm too worried about accidentally hitting somebody.

</comment><comment><USER36> My credit card details are saved in my Gmail account because when I want to buy something online my wallet is usually in another room

I feel the risk is low, I trust google enough and there's really no risk as a cardholder anyway

<comment><USER16> The risk is low, but if the issuing bank finds out that your CC details were stored online they'd refuse to cover you if you were hit by fraud.

</comment></comment><comment><USER37> Stopped shampooing and conditioning hair (they either have chemicals, are expensive or smell terrible).

My showers take 5 minutes. Saves time, water and hydrates your skin.

</comment><comment><USER38> Work from home if possible.

</comment><comment><USER39> collapsable comments for HN</comment>


Writing a RISC-V OS in Rust: System Calls - <AUTHOR> http://osblog.stephenmarz.com/ch7.html <comment><USER2> For inspiration, have a look at the plan 9 syscall table:

[http://aiju.de/plan_9/plan9-syscalls](http://aiju.de/plan_9/plan9-syscalls)

This is how you make a simple yet flexible OS. Use an rpc protocol to do all the talking to objects within the system which are exposed as files. It's very REST like and allows any programming language to interact with those objects by reading/writing them as files. So you have a very uniform interface that eliminates a lot of binaries as now simple scripts can handle the work of reading and writing those files. Then realize that you can easily export those files to other machines on a lan or the internet. So the tcp stack of an internet facing machine can be exported and mounted on multiple machines who now all talk to the internet via that one machines tcp stack. And that can even be done across the net to bypass "great firewalls". Bye bye nat.

<comment><USER3> > Use an rpc protocol to do all the talking to objects within the system which > are exposed as files.

At some point, you're just adding pointless layers of indirection by doing this. NT tried this approach, and it is anything but "simple".

You can do _many_ things quite naturally by interacting with bytestream-like or block-like objects that are exposed via some sort of hierarchical namespace ("files"), but this doesn't really cover _everything_. Some things may be better done, even in a script, by interacting with a "binary" that in turn just wraps a binary library exposing some kind of ABI.

<comment><USER4> I don't disagree, per se, but designing for the exception is also a good way to end up with a mess. You have to carefully measure the impact (performance, maintenance, developer impact, etc.) of every special case.

</comment></comment></comment><comment><USER5> >"Each mode has a different ecall cause. If we make an ecall in machine mode (the most privileged mode), we get cause #11. Otherwise, if we make an ecall in supervisor mode (typically the kernel mode), we get cause #9."

Could someone say if the kernel runs in Supervisor mode what is the intention of machine mode in RISC-V?

<comment><USER6> Stuff like "this board/chip needs real time response in order to not melt itself despite not being able to trust that the OS is hard real time" like System Management Mode was originally intended.

It's also been handy for trying out supervisor mode concepts and adding software based support on chips that don't support all the features like hypervisor extensions.

<comment><USER7> right, afaiui basically you can trap on unimplemented instructions and emulate risc-v extensions without hardware support (very cool imho)

this short video explained it well (to me anyways): [https://www.youtube.com/watch?v=4JIvnWEs_pA](https://www.youtube.com/watch?v=4JIvnWEs_pA)

(hypervisor trap explanation at 11m20s mark)

</comment></comment></comment><comment><USER8> I just wonder what chances any new general-purpose OS kernel may have against Linux.

<comment><USER9> I suspect that whatever replaces Linux will probably involve a paradigm shift at the lowest level. Perhaps capability-based IPC, perhaps seamlessly integrating local and networked nodes, etc. It's going to take major major improvements to move the world off of the Linux kernel.

<comment><USER6> I imagine it's going to be an exokernel that can run pretty arbitrary user lands as if they were containers, built on cap based security.

If anyone agrees with me and wants to help out making that happen on an open source code base, hit me up.

<comment><USER10> I don't have time to work on this, but I highly recommend looking at using the erlang Virtual machine as your exokernel environment.

<comment><USER11> Why BEAM? I know it's good, just curious why this specific use case.</comment></comment></comment></comment></comment>


EFSA report considers risks of eating insects - <AUTHOR> http://www.bbc.co.uk/news/science-environment-34476742 <comment><USER2> Using artificial selection to breed good tasting insects could make insects more palatable, in the same way artificial selection has wildly changed the physiology of other livestock. It's something that will happen inevitably if the industry gains traction, but getting a head start would be interesting.

Long-term, making insects more desirable to consumers could reduce the amount of live stock raised, and indirectly influence emissions and global warming.

<comment><USER3> Bonus: breeding cycle for insects is amazingly short compared to livestock.

</comment></comment><comment><USER4> There's huge potential in this space. I worked on a project in college where we examined the viability of using Black Soldier fly larvae as a protein source for animal feed. It's a surprisingly high quality protein and also provides oils that can be processed into biofuels. The larvae can also be further processed to extract chitosan [1], which can sell for $100/kg [2](depending on quality).

Of course, there are many challenges around mass-rearing of insects, especially for human consumption.

[1] [https://en.wikipedia.org/wiki/Chitosan](https://en.wikipedia.org/wiki/Chitosan) [2] [http://www.alibaba.com/showroom/chitosan- price.html](http://www.alibaba.com/showroom/chitosan-price.html)</comment>


Critical Perspectives on Provable Security - <AUTHOR> https://eprint.iacr.org/2019/1336 <comment><USER2> Very amusing:

"Given the small probability of successin attacking the sociological, cultural, and psychological causes of the quality controlproblem, it is natural to look for a high-tech fix. After all, computers have so often cometo rescue us from the consequences of warped incentives and human laziness, carelessness,and incompetence. We've seen how computers have reversed the decline of K-12 educationin America, online instruction has turned undergraduates into hard-working and creativelearners, the information superhighway has reduced inequality between the rich and poorand between the Global North and Global South, smart appliances will solve the energyproblem and bring global warming to a halt, and social media and the internet havestrengthened American democracy and prevented the election of demagogues, liars, andbigots. By the same token it stands to reason that computer- generated proofs will removehuman error from provable security papers. At least that's how it looked twelve yearsago when the first author wrote the first of two papers [221, 222] critiquing automatedtheorem-proving."

</comment><comment><USER3> An interesting cryptography game would be to present you one of the many protocols mentioned here and ask you to break it. You have 100 points, and you can buy hints for various amounts.</comment>


Quality of life in the USA(California and Colorado esp)? - <AUTHOR>

I have always wanted to move to the USA. Attitude is better(especially towards entrepreneurialship), taxes are lower but perhaps most importantly, weather is better(I live in Sweden).
However is California all it seems to be? I think constant sunshine, wealthy, surfing, skiing, climbing. I could live an active outdoor life there.
But then there is perhaps high house prices and apartments, overpopulation, pollution(?), crime etc.
Is Colorado(Denver, Boulder, Colorado springs) better?
How is the USA overall? Is Europe better? I don't like the stupid socialist attitude of pretty much all european governments, on the other hand I don't dig US foreign politics much either(I'm fairly libertarian). <comment><USER2> Personally, I prefer California to Colorado.

The outdoors stuff really is quite a draw in California. I have traveled extensively and I don't believe anywhere else in the world compares to the landscape diversity of California. In the Bay Area alone, you have beautiful (but cold) beaches, a weird, eccentrically beautiful urban area, a giant bay, 3 hours to world-class mountains and skiing, 1-2 hours to other beaches, a mystical hilly farm-beach-fog-redwood wonderland (Marin County) that I have not seen anywhere else, etc. It's also very diverse and you can meet any sort of person from any background, and eat any sort of food. I would say for those factors, it definitely is "all it seems to be."

I have numerous friends from Canada, the Netherlands, Japan, France, the UK, Germany, Norway, Croatia, Denmark and Mexico who now live in Silicon Valley or SF and vow to never live anywhere else again.

On the downside, California has horrible traffic, high housing costs, high school education is terrible, the state is as good as bankrupt, there are immigration issues, weird old-standing racial segregation issues (all the black people live in Oakland), problems with violence, in LA there is pollution, if you are ever stuck in the out-state areas, there are a lot of scary hillbilly people with monster trucks and guns, etc.

Some people are truly affected by politics and state budgets and health care and that sort of stuff, and if you are one of those people it might be a headache. I do know people who packed up and moved to Germany, or wherever. But I've been to Germany and I would pick California, even with all it's problems.

It's definitely worth visiting for a year or two if you have the opportunity. If the chaos proves too much to deal with you can always move back to Sweden.

</comment><comment><USER3> Recomendation: Come check out Vienna Austria first.

I am a "U.S. Citizen", "born in the USA", whose parents were also "born in the USA". I moved my family to Vienna, Austria 8 years ago. I have for 4 years, owned and operated my own business, a GmbH here.

Vienna. The #1 city in the world 2 years in a row.

<http://www.mercer.com/qualityoflivingpr#City_Ranking_Tables>

First U.S. City, HONOLULU is at #31 with San Francisco at #32.

Insurance: US versus Austria

Three years ago, my daughter, at the age of 14, was diagnosed with morbid Juvenile Rheumatoid Arthritis, a life threatening condition. She spent 4 weeks in a hospital, with the total out of pocket cost of 280 euro for her meals. 100 % of the hospital costs and medical procedures was covered by insurance which costs my family 2400 euros per year.

In the U.S., in 2003, we paid $15,000 per year for insurance, with a $5500 per person deductible. My wife had her Gaul Bladder removed, and it cost us $11,000 deductible + all of the customary procedures which the insurance companies routinely refuse to pay until you take them to court.

My daughters hospital stay, and continuing medical treatments in the U.S. would certainly have led to a filing for bankruptcy (70 percent of all bankruptcy filings are due to medical bills). Instead, the annual costs of treatments in Austria is 240 euros per year, continuing hospital visits, and Methotrexate Injections.

FYI: Higher education is 100% taxpayer funded in Austria.

As long as a large majority of the U.S. voting public continue to believe that taxes are "theft" rather than paying their "fair share" of the "high financial costs of personal freedom and safety", and continue to refuse to admit that affordable healthcare is a basic human right, staying in Europe is a much better option in my opinion.

<comment><USER2> I spent a month in Vienna, Austria.

The price you pay for that sort of quality of life is that it is also perhaps the most boring place on earth next to Zurich or the other Swiss cities listed in that particular top 10.

<comment><AUTHOR> How are those places boring? No nightlife(can't be true)?

<comment><USER2> The Swiss are very insular and unfriendly. The Austrians are a little better. However, in both places it seemed impossible to meet any local person. I will say though that I used to be a skateboarder and hung out in Laussanne, and the skate crowd there was great, as they usually are throughout the world. The nightlife is very strange, IMO. The clubs play a weird mix of pounding techno and horrifying "classic oldies" music. I could not find anything to do at night besides a "club." (In the USA there are coffee shops, or simple bars, or bookstores that stay open late, or even lit parks to play basketball, soccer, etc) No club in these countries were as weird as German nightclubs, though. Vienna does have a large range of classical music type stuff, which is why I was there.

I have not been to any of these places since 2002, so perhaps things have improved. Take it with a grain of salt, I was also just a tourist. In contrast, it's very difficult to describe any aspect of California as "boring" unless you are an angsty teenager stuck in the burbs...

</comment></comment></comment></comment><comment><USER3> I lived in Boulder Colorado for 2.5 years, and really enjoyed climbing "the flatirons", Longs Peak, and many of the other 14k peaks.

Boulder is an awesome town, sadly it has all of the same problems of the rest of the US.

Now I get a sane and sensible government, safety, compassion for the poor, excellent free education, and the breathtaking Swiss and Austrian Alps to climb!

Check out the annual Vienna Research Festival which took place this weekend!

<http://www.science.co.at> [http://www.zit.co.at/views/event-single- view/article/das-wie...](http://www.zit.co.at/views/event-single- view/article/das-wiener-forschungsfest-2010/73.html)

The MetaLab, one of the very first "hacker spaces" in the world. <http://metalab.at/wiki/English>

Everything is modern and clean here, and you really see your tax dollars providing a better community for all.

One of the largest open air rock concerts <http://www.2010.donauinselfest.at/>

New Years celebrations:

<http://www.stadt-wien.at/index.php?id=silvesterpfad-wien>

Ice Skating at city hall: <http://www.wienereistraum.com/>

</comment><comment><USER3> I am a Republican, a conservative, a believer in limited government, and a parent to this current generation now entering college, and I have much to regret.

I lived in the "silicon valley" of California from 1979 – 1984 and again from 1988 – 1993.

Upon my first arrival, my first year of high school, I was in for a terrible shock, to find having left a first world schooling to arrive in a 2nd world dilapidated school system.

Prop 13, and the likewise self centered legislation were the cause of this precipitous decline.

Yes, we were indeed blinded by charismatic personalities such as Ronald Reagan. I believe in hard work, and looking out for others less fortunate, and investing in my community.

I am proud of my country, proud to be an american citizen, proud of the majority of its hard working and deeply caring people. I however, am revolted by the state and federal governments of the past 30 years.

A government that largely reflects the will of a small number (however a majority loyal voting group) blind and ignorant, shrill, largely self centered and mean spirited people. These are members of my own political party, and largely conservatives in the Democratic Party.

I have been very fortunate to travel widely across the globe for business purposes. I have been in nearly all of the "great cities" of the world. I was shocked and surprised to find several countries with far better quality of life than that which I found in the U.S., thus began my "great awakening education" as to the cause of the ills of our great nation. I looked in the mirror and found myself to blame. I spent the next 3 years attempting to convince ANY of my fellow (majority voting) U.S. citizens in the error of their ways. Having spectacularly failed to do so, I packed up our family and moved to a new country.

I left the U.S. 8 years ago, with my wife and 3 children, to move to Vienna, Austria (ranked for 2 years in a row as the best city in the world).

The tax rate for the average middle class citizen here is 50 %. It is the closest thing to heaven, one can find on this earth. I do not mind at all, paying far more in taxes, as I can clearly see the benefits of doing so.

As an american, as a conservative republican, I suffer a continuing Cognitive Dissonance, unable to resolve the seemingly incompatible simultaneous support of aspects of the SPÖ, the Social Party of Austria. The evil socialism, which as americans we were raised to believe, was so thoroughly "UN-American", and threatened america. I have seen the centrist socialist ideals succeed here in Austria, where right wing conservatism has clearly failed america.

Austria also has a small shrill, bigoted, and self centered group of people like those who ultimately dethroned america's prosperity. They are known as the FPÖ, the so called "freedom party of Austria", and their brethren the BZÖ, and their sympathizers in the ÖVP. However these people are but a small (however growing) minority of the voting group.

Left unchallenged, they shall ultimately destroy the Austria they claim to want to preserve. I do my best to educate all Austrians that these persons are misguided, and show them the United States as proof of the fate which certainly awaits them, if they remain on their self destructive course of politics.

Vienna is a social democratic city. As an American, I find it largely balanced. People have good jobs, guaranteed high quality healthcare (socialized medicine), and provide nearly free (300 euros per semester) higher education. The society takes care of its most needy of citizens.

Yes they have entirely too much bureaucracy, and yes the politicians are highly paid (far more than in the US), however surprisingly as a result they are largely honest and uncorrupted persons.

Austria has an unemployment rate of 4.7 percent vs 9.6 for the US.

[http://www.newsweek.com/2010/08/15/interactive- infographic-o...](http://www.newsweek.com/2010/08/15/interactive-infographic- of-the-worlds-best-countries.html)

</comment><comment><USER3> If you want to live in a community of self centered people, who never speak with their neighbors (the famous California 7 foot tall privacy fence, and gated communities).

The beaches are beautiful, however you had better be rich and live close, as most now take several hours to get to, if at all possible (forget finding a parking place after 8AM).

The cost of housing is CRIMINAL, all of the infrastructure is crumbling, the value of all of your hard earned tax dollars is squandered, with no visible trace of their impact on the quality of life and community.

California has WAY TOO MANY PEOPLE NOW, it was a far better place in the 70's

</comment><comment><USER3> Vienna is one of the key research and development cities in the world.

A very strong investment environment for startups.

<http://www.wien.gv.at/forschung/>

SchnitzelConf is a 1-day, full-contact conference in Vienna, Austria on September 7. The focus: creating products, launching businesses, and charging real money. <http://schnitzelconf.com/>

</comment><comment><USER3> An American creates a startup in Vienna

[http://unicornfree.com/2010/why-im-putting-on-a- bootstrappin...](http://unicornfree.com/2010/why-im-putting-on-a- bootstrapping-conference-in-vienna/)</comment>


I'm waiting again [for Apple to review my App] - <AUTHOR> http://handyapp.com/2010/02/im-doing-it-again

<comment><USER2> From what I've been reading in places like Touch Arcade, review times are going down significantly. I submitted my app (<http://tcgcounter.com>) on Monday night, it changed to In Review the next morning, that evening it went to Ready For Sale, and was on the app store about two hours after that. Super fast.

<comment><AUTHOR> Just got approved - 35 hours.

Guess I'll give it a go again!

</comment></comment><comment><USER3> I think this is trolling, and if it's not, it's pretty poor form. It's also not very interesting.

<comment><AUTHOR> Sorry, it wasn't intended as a troll.

My own experience probably bumps up my interest with other's experiences with the app store and it's approval process.</comment></comment>


Gaslighting at Work: How to Recognize It–and Stop It – Career Contessa - <AUTHOR> https://www.careercontessa.com/advice/gaslighting-in-the-office/ <comment><USER2> Gaslighting should definitely be understood by more people. There are many who use it to take advantage of others.

This piece is a quick intro with references to more. Highly recommended, wish I could upvote more.

Thank you for sharing!</comment>


The Navy Unveils "Cicada": Now Even the Drones Have Drones - <AUTHOR> http://www.dailytech.com/The+Navy+Unveils+Cicada+Now+Even+the+Drones+Have+Drones/article23650.htm

<comment><USER2> I have a feeling, looking back, that the birth of weaponized drones will be far worse for our world than the invention of the nuclear bomb. they're already being used domestically in the United States by law enforcement, which raises some pretty disturbing prospects. and now other countries (e.g. China) are creating drones at a breakneck pace....

</comment><comment><USER3> tl;dr

        Big drones have little drones,
        upon their backs to launch them
        And little drones have lesser drones
        An so on ad infinitum

        And the great drones, themselves, in turn
        Have greater drones to go on;
        While these again have greater still,
        And greater still, and so on.

</comment><comment><USER4> Clever idea to use the logic boards as wings.

<comment><USER5> This made my jaw drop; it's such a smart idea. I'm sure the voltage regulators and diodes benefit from a nice atmospheric cooling too.

<comment><USER6> They had to put in heaters for the high altitude model :)

Commercial electronics have 0C as lower operating bound, although milspec is -40C.

</comment></comment></comment><comment><USER7> I can't help but imagine that whoever has the bad luck of fighting against against the drones and robots of US will feel much like in Terminator 3, except the drones and robots won't attack on their own, but will be manned or sent by the US military instead.

<comment><USER8> at least they will learn to hate technology instead of the us.

<comment><USER9> The drones will become the new 'face' of the US in this possible future. They will still hate us, but they will see us less and less as human beings because most people in the affected areas will only ever be dealing with drones.

<comment><USER10> It'll make false flag operations really blood easy.

</comment></comment></comment></comment><comment><USER11> Yo dawg, I heard you like drones...</comment>


Speeding up webpack performance with parallel builds - <AUTHOR> http://tech.trivago.com/2015/12/15/parallel-webpack/ <comment><AUTHOR> Hey there! The team that was working on that is watching this post if you have any questions.</comment>


Typing Nix - <AUTHOR> http://www.tweag.io/posts/2017-05-23-typing-nix.html <comment><USER2> I love Nix. NixOS is my primary development operating system. However, the Nix language itself is syntactically _ugly_ , and this proposal makes it even uglier. Parentheses, sigils and special characters (esp. semicolons) are line noise — the less of it the better.

Why they wouldn't take the most (syntactically) beautiful functional programming language out there — Standard ML? It would work perfectly for such a task. Or the second contender — Haskell. If C-like syntax is desired, the best contendant is probably Swift.

I cringe every time I have to edit a .nix file (and I have to do it a lot).

<comment><USER3> I love the Nix language and I generally distrust aesthetic feelings about programming languages.

Neither SML nor Haskell are optimized for expressing deeply nested records with many string literals, for example. The multiline interpolated strings in Nix are extremely much better than in SML or Haskell. The way records and arrays are written is great: SML and Haskell both suffer from the tedious problem of using separators between items instead of after each one; in Nix each item can always be moved without messing with separators.

I think Nix is an engineering marvel up to and including the language design. If you can make a better surface syntax and demonstrate it by translating some significant part of Nixpkgs, I'd be very interested, but I think in general the language is the way it is because that's what made most sense for the system's designers.

<comment><USER4> > If you can make a better surface syntax

... [http://gnu.org/s/guix](http://gnu.org/s/guix)

Lisp is pretty good at lists.

The only important language is the derivation language sent to the daemon. Nix spends so much time building up inputs... for shell scripts. I always felt like they would have been so much more successful if they chose some other, more popular language to generate derivation.

<comment><USER3> I dig Guix, but Lisp is also one of the most commonly reviled syntaxes, so it's hard to say it's clearly better, or that Nix would enjoy more adoption with S-expressions.

<comment><USER5> Reviled by people who have never used it.

</comment></comment></comment></comment></comment><comment><USER6> Neat. Somewhat related is hnix [0], a community effort in re-implementing the Nix expression language in Haskell.

While so far the focus has mostly been on implementing the expression language as is, hnix being written in Haskell could be attractive for enriching the language with fancier features:

" _Because now that it 's in Haskell, now that a lot of other hackers could get involved, we could do things like add optional typing to the Nix language._" — J. Wiegley

For more on hnix check out Haskell Cast's Episode 13 [1] with John Wiegley.

[0]: [https://github.com/jwiegley/hnix](https://github.com/jwiegley/hnix)

[1]: [http://www.haskellcast.com/episode/013-john-wiegley-on- categ...](http://www.haskellcast.com/episode/013-john-wiegley-on-categories- and-compilers)

</comment><comment><USER7> There's also Guix in case anyone is interested. It uses Guile/Scheme for everything instead of Haskell.

<comment><USER8> I think that all the efforts to fix or re-implement the Nix language have vindicated Ludovic, the Guix maintainer, who chose an existing general-purpose language instead.

<comment><USER9> Except GUIX is more of a political project and part of the GNU "stack". It's a noble goal and I think it's great they're doing it. (It's people doing work on their spare time, so more power to them!)

But I wonder if that will help or hinder it in the end. It's also unclear to me what Guile brings other than fracturing the Scheme/Lisp/Racket community further (there are other Schemes that are older, seemingly just as clean, and often more powerful). Seems like mostly NIMBYism, but I might be offbase

<comment><USER10> > NIMBYism

Do you mean NIH syndrome?

<comment><USER9> yeah, thanks for the correction

</comment></comment></comment></comment></comment><comment><USER11> How does Nix compare with conda[0] ? I could not find any useful resource, in my team we were hesitating between the two, for packages management ; finally we went for conda because it (seems)is better documented and package description is easier to write for newbies. And also we are a Python shop, so other devs felt more comfortable with conda. Personally I prefer Nix, though, and I wanted to advocate for it but the only main difference I could find is that Nix sits on top of the kernel (including libc...) whereas conda uses the system libc.

[0]: [https://conda.io](https://conda.io)

<comment><USER12> I wrote this document: [http://catern.com/posts/deps.html](http://catern.com/posts/deps.html) which briefly compares both Conda and Nix among other things.

(warning: it's very pro-Nix :) )

<comment><USER13> Not to put down Nix, but some of the arguments about other systems have counterexamples. For instance, it's common in rpm or dpkg distributions to have multiple versions and implementations of things, and richer dependencies than simply on packages. You can also do unprivileged installation into a separate root with, say, fakechroot or PRoot, and you need something like that to install and run Nix unprivileged, don't you?

There are comparisons with alternatives in at least the propaganda for Spack and 0install, though the same criticism might apply to those -- I don't remember.

<comment><USER12> rpm and dpkg don't support having multiple versions and implementations of things simultaneously installed. Not sure what you mean by richer dependencies.

>You can also do unprivileged installation into a separate root with, say, fakechroot or PRoot

Yes, but that's the only way to (safely) use such package managers without privileges; so that's not viable to do for production.

>and you need something like that to install and run Nix unprivileged, don't you?

Install, yes. Run, no. Setting up Nix does require root, but once it's installed on a system it can be safely used without privileges by all the users on the system. That's very valuable in itself, but it's especially interesting when you consider providing access to a single Nix store over a network filesystem, or providing it to multiple different virtual machines or containers.

<comment><USER13> On RHEL 6 I count eight different packages implementing the MPI standard -- multiple versions of three implementations of essentially the same API -- which can be installed together. The richness is that dependencies are not generally simply on packages; MPI packages provide things like "mpi", "openmpi(x86-64) = 1.10.3-3.el7", "libmpi.so.12", and config(openmpi) = 1.10.3-3.el7".

My Guix installation runs using a with privileged access to the store, and Nix is the same as far as I know. I don't know why Nix would be a particular advantage on our HPC networked filesystems, and it's not clear it's tenable for users to be able to DoS the store by installing an arbitrary amount of software in limited shared space.

It may well be that Nix makes the right set of trades-off against other possibilities for a given situation, but thta seems at least not completely clear cut.

</comment></comment></comment></comment></comment><comment><USER14> I'm pleasantly surprised to see so many Nix enthusiasts milling around in this thread and I'd like to encourage people to step up and do their part in helping improve and maintain nixpkgs. It's really not that hard, and it's the main area I would say Nix could do with some improvement. Adopt a package today!

<comment><USER15> I tried doing some non-trivial contributions, and unfortunately there's currently some degree of a problem where there are not enough people actively revieving contributions and having enough authority in the project to be able to merge with confidence. Is it maybe not enough sponsorship for the project, compared to its popularity? Or does it not have a person with enough organisational experience in non-profits?

</comment></comment><comment><USER16> The problem with Nix in terms of typing is that it relies a lot on key/value dictionaries ("attribute sets" in Nix parlance). These data structures are dynamic in nature. All a static type checker can say is "yeah this is an attribute set". In addition, Nix does not offer a way to define new disjoint data types.

Conversely in Guix most of the data structures are disjoint record types. Scheme (the implementation language of Guix) is dynamically-typed, but there are sanity checks we can do on records both at macro-expansion time and at run time, such as checking whether all the required fields are defined and no extra field is passed. Concretely, this means that users get clear syntax errors or run-time type errors.

Nix and Scheme are both dynamically typed, but they have a different typing story.

Disclaimer: Guix hacker here.

</comment><comment><USER17> Sure it would be nice to have types for refactoring, but a more useful set of features would be:

\- baked in fetchurl, fetchgit for easier bootstrapping

\- a functional dsl for rendering filesystem hierarchies - instead of the find/sed/awk galore. 50% of the time when my nix recipe breaks it's not a nix syntax issue but something with bash. (reading nix is an exercise in learning new unix features)

\- drop the channel feature entirely and make releases immutable tar files with hashes. I use nix as a build system on macos and right now a nix-channel update is a sure way to break all my builds which is the opposite of nix's promise

EDIT: formatting

<comment><AUTHOR> For your last point, you don't have to use the channels (which will anyway be deprecated at some point iirc), and you can pin the nixpkgs version in your nix files (like it is done in [https://garbas.si/2015/reproducible- development-environments...](https://garbas.si/2015/reproducible-development- environments.html))

</comment></comment><comment><USER18> Funny: Nix is short (or colloquial) for "nichts" in German which further means "nothing" in English.

So the CTA "Get Nix" is kinda funny for German speaking people :)

PS: Greetings from Austria!

<comment><USER19> I believe that this meaning is even intentional, the original author of nix (Eelco Dolstra) is from the Netherlands. The name comes from the fact that by default, nothing is available in build environments in nix.

<comment><USER18> Cool, thanks for clarifying :)

</comment></comment></comment><comment><USER20> I'd like to bring up another sort-of alternative: [http://habitat.sh](http://habitat.sh)

It's not exactly in the same space as Nix, but not very far from it, either. In Habitat, you use a language that felt to me quite similar to Arch Linux's PKGBUILDs, but extended with container-specific things like service ports etc. Habitat outputs containers that can be started in various orchestration technologies, like Kubernetes or Mesos/Marathon.

<comment><USER21> It's interesting and very similar to Nix, but I still didn't figure out purpose of it, especially why it heavily uses Docker. Many people use Docker for the same functionality that Nix provides: bundling application with its dependencies, not for isolating groups of processes from each other.

<comment><USER20> Docker images is one of the supported formats when exporting packages. Others at the moment are aci, mesos and tarball.

</comment></comment></comment><comment><USER22> > Configurations in Nix are written in a full-fledged programming language, > featuring all manner of primitive datatypes (numbers, strings, file paths, > etc), anonymous records and first-class functions. This is a very big deal > for writing configurations in the large. Functions allow code reuse and > abstraction, two crucial ingredients without which writing out > configurations by hand would become unwieldy.

Off topic but this brings up a good point I've been curious about for a long time. Does anyone know why VimL is such a terrible language?

It's fascinating to think what potential it could have with a modern language natively supported like this. The use of Python/Lua etc seem like complicated hacks on top of it, not to mention the API with tons of globals.

<comment><USER23> Slightly related: Why does Github call Vimscript "VimL"?

<comment><USER22> It's not just Github, the Vim filetype is "viml". It's a standard name for the language. Most likely meaning Vim Language.

<comment><USER23> No, it's not. The filetype is "vim", and the filetype detection code explicitly calls it "Vim script": [https://github.com/vim/vim/blob/4670490673ed98502a09b74fbabe...](https://github.com/vim/vim/blob/4670490673ed98502a09b74fbabe785b47e3d289/runtime/filetype.vim#L2384-L2385)

<comment><USER22> You're right, apologies, I was thinking of the Syntastic/Neomake plugin which both use "VimL" as an identifer, which I had just set up this past weekend and I mistook that as the Vim filetype identifier.

Regardless Wikipedia says:

> Vim script (also called vimscript or VimL) is the scripting language built > into Vim.

[https://www.wikiwand.com/en/Vim_(text_editor)#/Vim_script](https://www.wikiwand.com/en/Vim_\(text_editor\)#/Vim_script)

It's also colloquially referred to VimL across the web.

For those looking for an answer, the 3rd result from googling "VimL" is a question on StackOverflow "Why does VimL suck?" which does a good job of answering my question:

[https://www.reddit.com/r/vim/comments/1bf672/why_does_viml_s...](https://www.reddit.com/r/vim/comments/1bf672/why_does_viml_suck/)

</comment></comment></comment></comment></comment><comment><USER24> Nice.

Half-OT: How is the new CLI coming along? AFAIK there was an effort to make Nix usage a bit more like known from other package managers.

<comment><USER25> There's an effort to make Nix's CLI better, but not necessarily like other package managers.

The design is at [https://gist.github.com/edolstra/efcadfd240c2d8906348](https://gist.github.com/edolstra/efcadfd240c2d8906348)

The issue is at [https://github.com/NixOS/nix/issues/779](https://github.com/NixOS/nix/issues/779)

<comment><USER24> One year, and still not closed...

Is this an ongoing process and most of it is already released or is this still in the making?

</comment></comment></comment><comment><USER26> Just a heads up to the author that the link to Nixpkgs is not working, shows up as [Nixpkgs][nixpkgs]

E: In the paragraph titled "NIX TODAY".

<comment><AUTHOR> Thanks, it should be fixed now</comment></comment>