Bastion – Highly-available distributed fault-tolerant runtime - <AUTHOR> https://github.com/bastion-rs/bastion <comment><USER2> How is runtime fault-tolerance achieved? My understanding of Erlang is that the BEAM VM implements these capabilities (custom threads, supervision, restarts, hot reload), but it is one level removed and above actual code. And they implement their own user-space threading runtime in order to support them. But in Rust, there is no such runtime (or is Bastion implementing one?) and it seems like this is used as a library. I'm very curious.

I think another way to frame my question would be: which is the basic unit of parallel execution in Bastion? A thread? Or a separate process? There are mentions of lightweight processes and subprocesses in the README but it is rather vague what these are.

<comment><USER3> Erlang's use of m:n threading is orthogonal to fault-tolerance (perhaps not inside the implementation, but conceptually).

<comment><USER2> It definitely is not orthogonal. Suppose an OS thread goes into an infinite loop. How do you cleanly stop it (feel free to assume Linux/Windows/MacOS)?. In Erlang this is possible because of the custom threading implementation.

<comment><USER3> In Erlang that's possible because the program runs in a VM. Erlang could do the same with 1:1 and m:1 threading.

</comment></comment></comment></comment><comment><USER4> Could we hear a little more about the background of the project, including what it's being developed for? Really interested to learn more about the project, this looks great

</comment><comment><AUTHOR> Very appreciate the work on bastion, which really gets the spirit of erlang actor programming with the supervisor-ing strategy! The code is clean and well documented, and I cannot believe the project is not well-known by rust communities.

<comment><AUTHOR> BTW: They are working on Hot-Code Swap.

</comment></comment><comment><USER5> This looks promising, though the "No Forced Trait Implementations" seems to instead require using a strange looking msg!() macro?

[https://docs.rs/bastion/0.3.4/bastion/macro.msg.html](https://docs.rs/bastion/0.3.4/bastion/macro.msg.html)

Seems less clean to read than Riker ([https://riker.rs](https://riker.rs)), though that doesn't really do async well.

<comment><AUTHOR> Yes, the msg!() macro is a little painful to write. I think it can be refactored into the pattern like `impl Handler<Msg>`. But beyond that, it supports async/await naturally. :)

</comment></comment><comment><USER6> I have hard time understanding what this is. Is an alternative to docker somehow? What other framework/platform would bastion compete with?

<comment><USER7> So did it. I didn't know if it was a service or a library or if it integrates with something. Looks like it's a library for Rust. I think mentioning Rust would speed up the understanding of where this sits

<comment><AUTHOR> Yes. the title was changed which I wasn't aware of.

Origin title: `The missing part of actor-model programming in rust`.

</comment></comment></comment><comment><USER8> Looks like good work! I'm curious about why I might use this instead of Erlang.

<comment><USER9> I was also wondering if this is aiming to be _the Erlang for Rust developers_ , or rather _a better Erlang_. Either one would probably be worthwhile.

<comment><USER10> Out of curiosity, what would you be looking for for "a better Erlang"? Most if not all of my issues were syntactical, or things that were given up as tradeoffs that I can't qualify as "better", so I'm curious what someone else's impressions are here.

<comment><USER9> I'm honestly no expert on the subject. I have virtually zero experience with Erlang language. And I don't know a thing about Rust. However, if that counts I have read large parts of Joe Armstrong's PhD thesis about distributed systems and written plenty of Elixir.

It may be wrong to say we need a _better Erlang_ , but for modern web development we certainly could use a fair bit more compiler enforced type safety for writing more correct programs. Mostly due to the lack of a proper type system, Erlang is not particularly expressive as a language, although its primitives (processes & message passing) are well geared exactly for what it focuses on.

Erlang focuses strongly on fault-tolerance and subsequently on high availability, but I'm not sure this perk is so significant benefit anymore compared to various other runtimes spinning the wheels of your typical web server in a cloud setup. We rarely need to write servers anymore that keep running for many years straight without a restart, only patching code via hot reloads.

Just my take but since you asked, trading some fault tolerance for more correct programs would therefore probably be a fair trade-off for a _new kind of Erlang_.

<comment><USER10> Thanks for the reply!

Yeah; I always added type annotations to my code and ran Dialyzer...I wish there was a stricter compilation mode for that. That said, I really liked the 'optimistic' part of it, so I didn't spend a large amount of time correcting my type specs when proper testing proved it work.

I can agree with bfrog's comment too; Rust's typing can definitely help eliminate a bunch of classes of bugs...but honestly I'm not sure I ever ran into them using Erlang in production anyway. Immutable data + message passing tends to make it easy to implement things correctly, whereas some of Rust's more standout features seem designed to solve problems caused by the language itself picking a different set of tradeoffs (i.e., borrow checking as part of what is necessary to manage memory without risking it going out of scope prematurely, or being unable to be reclaimed at a deterministic time by the compiler). I'm not familiar enough with Rust myself to really comment though; I just know that in two and a half years of production Erlang, the only bug we ever encountered was caused by a C driver (and our own bad design in not circuit breaking calls to it, leading to restarts that trickled up the supervisor chain under heavier load than we'd tested for. None of which would Rust have been able to help us with. In fact, even the driver, the issue was an unnecessary network call that sometimes hit an empty cache, causing a huge network hiccup that led to an unhandled timeout). It got 'correctness' as well as 'fault tolerance'. At least as much as a language can (i.e., we could still implement the wrong things, such as when we implemented an O(N^2), but correct, algorithm, that we had to fix to an O(N) when we noticed certain calls being too slow)

</comment></comment></comment></comment></comment><comment><USER11> I wonder how this performs in comparison to actix[1] & axiom[2]?

1\. [https://github.com/actix/actix](https://github.com/actix/actix) 2\. [https://github.com/rsimmonsjr/axiom](https://github.com/rsimmonsjr/axiom)

</comment><comment><USER12> Runtime for what? Does it only run rust code?

</comment><comment><USER13> Odd name - bastion hosts, aka jumpboxes or homeboxes, are also the access points that bridge different security zones, like internet to a secure VPC.

</comment><comment><USER14> Can someone elaborate use cases for this?

<comment><USER15> To provide context, understanding this requires a little bit of background knowledge about concurrency paradigms.

In concurrent programming, there are a few mental models/approaches you can use to achieve it. Each of them have different "values systems" and tradeoffs, if you will.

In a nutshell, you have:

\- Locks (Mutex/Semaphore)

\- Communicating Sequential Processes

\- Software Transactional Memory

\- Actor Model

The Actor Model is a particularly powerful paradigm because it isolates processes and works via message passing and spawning. The reason why Erlang/Elixir are fault-tolerant is because of the BEAM's process model, any given process (more or lesss) can fail and it's not a problem due to isolation.

What this library allows you to do is architect applications in ways such that they are much more resilient to failure and easier to scale out + parallelize/distribute.

It doesn't have to be a networked application either, any code process can be an actor. It applies to any software.

If you want a great overview of the Actor model, there are some slides here which do a fantastic job of illustrating it:

[https://cs.nyu.edu/wies/teaching/ppc-14/material/lecture10.p...](https://cs.nyu.edu/wies/teaching/ppc-14/material/lecture10.pdf)

<comment><USER16> Do you have any good resources in learning more about these models / approaches?

<comment><USER17> I've only skimmed this, but it seemed reasonable.

[https://pragprog.com/book/pb7con/seven-concurrency-models- in...](https://pragprog.com/book/pb7con/seven-concurrency-models-in-seven- weeks)</comment></comment></comment></comment>


PHP Object Oriented Programming Reinvented - <AUTHOR> http://dhotson.tumblr.com/post/1167021666/php-object-oriented-programming-reinvented

<comment><USER2> The Common Lisp Object System is based on similar principles. "The Art of the Metaobject Protocol" by Gregor Kiczales, Jim des Rivieres, and Daniel G. Bobrow describes its architecture, along with protocol used to extend it. Despite it did not make it into ANSI spec, it is a de facto standard and is widely implemented.

</comment><comment><USER3> This may come off in a pejorative way but thats definitely not my intention...

Is the intention here to make PHP more Ruby like? If so why?

<comment><USER4> Upmodded for asking an interesting question, namely "why?"

Perhaps there is some sort of ideal that Ruby's author Matz and the author are both striving for. If Ruby is closer to the ideal than PHP, an observer who examines the two languages and this work may wonder if the intention is to make PHP programming more like Ruby programming, where is actuality the author is seeking the ideal.

This trick of perspective probably explains why so many people seem to reinvent Lisp over the years. They aren't trying to turn their languages into Lisp, they're seeking what Lisp's authors have sought over the years but haven't found another path towards the ideal.

As to why... PHP and Javascript are both very interesting because they are so widely deployed by default and have a very large "market penetration" amongst programmers.

Once you get past the "uncool factor," reaching PHP programmers is probably one of the highest value activities a toolsmith can pursue.

JM2C.

<comment><AUTHOR> Thanks for taking a look Reg.

Would you mind if I ran an idea past you?

The other idea I'm toying with is something similar, but having immutable classes. So basically every time you add a new method, instead of modifying the class you would return a brand new class.

Crazy? :-)

<comment><USER5> Running through that in my head, that's basically equivalent to subclassing. At least, I can't find a difference. (In fact if you do it the naive way you'll end up with something less functional than subclassing for no good reason, so you might as well just treat it as a subclass.) It also blocks monkey patching the original class, which I observe neutrally.

</comment></comment></comment></comment><comment><USER6> It's an interesting idea but it adds a lot of indirection and extra code for every method call. I'd like to see some benchmarks, but my guess is that this technique slows things down a lot.

<comment><USER7> I had the exact same thought. PHP is already dog slow... that's one of it's trade offs. An extra layer of indirection would kill it.

Also, you are losing a few important feature of PHP by doing this:

\- Type hinted arguments (<http://www.php.net/manual/en/language.oop5.typehinting.php>)

\- Static method calls

\- Autoloading

And there are a bunch of things that would become nightmarish to manage. For example, object serialization or cloning.

<comment><AUTHOR> I'm sure the speed is awful. But that's not the point.

Also, type hinting isn't all it's cracked up to be in PHP. In my opinion, type hints don't fit well in a dynamic language like PHP. The main problem I have is that you can't pass a decorator object to type hinted methods. Also, it makes it harder to pass mock objects for test cases.

Static method calls are possible, you can just add and call methods on the class object.

Autoloading probably isn't too hard to figure out.

You make a good point about serialisation. Closures can't be serialised. To be fair though, you can't do it in Javascript either.

<comment><USER7> > I'm sure the speed is awful. But that's not the point.

Fair enough. I can appreciate that you have done an interesting bit of hackery here. Along that vein, you might consider adding support for uniform access. With this, methods without arguments can be called as properties, and properties could be exposed as read/write or read-only.

> Also, type hinting isn't all it's cracked up to be in PHP.

This is a matter of taste, but I completely disagree. In my opinion, type hinting is one of the redeeming qualities of the language. It means that PHP is taking care of the sanity checks for you. Of course, I'm partial to strongly typed languages.

> The main problem I have is that you can't pass a decorator object to type > hinted methods.

Polymorphism allows you to do this. In the context of decorators, that usually means defining an interface.

<comment><AUTHOR> > Polymorphism allows you to do this. In the context of decorators, that > usually means defining an interface.

This doesn't work if you have a generic decorator class. You can't really make it implement all the interfaces you potentially want to use.

It's the same problem with mock objects in test cases. You can't pass them because the type check prevents it, even though in practice everything would work just fine.

</comment></comment></comment></comment></comment><comment><USER8> Reading on my mobile so its hard to tell but it looks a little like prototype based OO. The dynamic languages all sort of lend themselves to build your own OO hacks like this.

See Joose, Moose, and Cappucino for other examples.

</comment><comment><USER9> You'd think after five years in php I would have picked up on that nifty method to chain methods together.

(referring to :

function Obj($methods=array()) )

Awesome hack dude.

<comment><AUTHOR> Thanks. :-)

Although, usually I go for a static create() method instead of a function.

Oh man, I really wish they'd make constructors chainable. :-(

</comment></comment><comment><USER10> I like it. I wasn't aware you could have function names with the same name as a keyword.

Ninja edit: appears you can't, it has to be an undefined method caught with __call(). Neat.

</comment><comment><USER11> At first glance I was thinking this was prototypal, but upon a second look, it doesn't seem to be. It does however, seem like this approach would make it easy to get prototypal inheritance, no?

</comment><comment><USER12> As someone who has been coding PHP for over 5 years, I don't see any obvious benefit of doing OOP this way in PHP except for making your code look clever. Any explanation would be appreciated.

</comment><comment><USER13> Steve McConnell would like a word concerning non-idiomatic programming.

<comment><USER4> I have no objection to Mr. McConnell joining us, having his say, and explaining why his maxims are a greater good in the domain of PHP programming. Until then, perhaps you may want to make a point that you feel doesn't need an Argument from Authority?

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

<comment><USER13> It was kind of a joke.

<comment><USER4> Excellent! have another upmod for catching me out as a cranky old man :-)

<comment><USER13> Hey it happens to the best of us.

</comment></comment></comment></comment></comment><comment><USER14> Intersting idea, but what does this have that ruby or javascript doesn't?

<comment><USER15> I don't think that's the point. He didn't create a new language, he is working at bringing that style of programming to PHP development.

<comment><AUTHOR> Yup, I could have implemented this in pretty much any language with closures and some sort of __call / method_missing magic.

It's mostly just a fun hack to experiment with a different OO style. By no means would I recommend using it in any way.

Although, that said. A little language on top of this would be kind of neat...

</comment></comment></comment><comment><USER16> Component based object oriented-ish ala Ruby?

</comment><comment><USER17> ok, someone has to point that out: POOP'R?

<comment><AUTHOR> I did mention that it was kind of unfortunate.. ;-)

<comment><USER18> Unfortunate? Keep working on it, man. I want to say "PHPooper" during an interview some day.</comment></comment></comment>


Less Weird Quaternions Using Geometric Algebra - <AUTHOR> https://probablydance.com/2017/08/05/intuitive-quaternions/ <comment><USER2> For people trying to understand quaternions, the faster way to intuition is understanding axis-angle first. I think axis-angle is totally intuitive. First pick a direction (some 3d unit vector) and then rotate around that direction by some amount (so some scalar). Then convert those four numbers to quaternions

      qx = ax * sin(angle/2)
      qy = ay * sin(angle/2)
      qz = az * sin(angle/2)
      qw = cos(angle/2)

where (ax, ay, az) is the unit direction (ax^2 + ay^ + az^2 = 1) and angle is the amount you want to rotate.

[http://www.euclideanspace.com/maths/geometry/rotations/conve...](http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/)

[http://www.euclideanspace.com/maths/geometry/rotations/conve...](http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/)

</comment><comment><USER3> A couple things to add.

For notation, we would often see the basis vectors named (e_1, e_2, e_3) instead of (x, y, z).

The quaternions are the even-ordered subalgebra of the 3D exterior algebra. The exterior algebra has scalars (1), vectors (x, y, z), bivectors (xy, yz, zx), and pseudoscalars (xyz). The even-ordered subalgebra is scalars and bivectors (1, xy, yz, zx). Adding or multiplying two even-ordered multivectors will always give you an even-ordered multivector, and 1 is even-ordered, so the even-ordered multivectors form a subalgebra.

We can also conceive of this subalgebra, the quaternions, as a Clifford algebra. Clifford algebras are generalizations of exterior algebras. Instead of saying v * v = 0, we can put something else on the RHS, and for quaternions we can start with just two basis vectors e_1 and e_2, and then define e_1 * e_1 = e_2 * e_2 = -1. The third basis vector for quaternions is then just e_1 * e_2.

<comment><USER4> The odd-ordered subalgebra (x, y, z, xyz) is symmetrical to the even-ordered subalgebra (1, xy, yz, zx), and can also represent quaternions.

<comment><USER5> That doesn't work, the odd space isn't closed.

xx = 1

<comment><USER4> I don't know what I was thinking....

</comment></comment></comment></comment><comment><USER6> Quaternions are beautiful and natural, not weird, but I'm always happy when they get some attention! This was a very interesting article, thanks. It does seem to confuse quaternions in general with (unit) quaternions as used for rotating vectors. For example:

>So don't think of quaternions as a 4 dimensional hypersphere of radius 1

This is also a bit weird:

>But nobody would ever suggest that we should think of a rotation matrix as a 9 dimensional hyper-cube with rounded edges of radius 3.

Even weirder when they claim that the axis-angle interpretation of (unit) quaternions "breaks down".

Anyway, back in high-school when I first became fascinated with quaternions I certainly didn't expect to be working with them on a daily basis two decades later. The moral of this is that anything you learn can become crucial to your career...

</comment><comment><USER5> While we all learned in middle school geometric algebra that the even subalgebra of G3 is isomorphic to the quaternions, what is the relationship between the even subalgebra of G4 and the octonions?

If you write out a multiplication table, it seems that it's isomorphic. But... Octonions aren't associtive. Does the even subalgebra of G4 somehow lose associativity? Is it equivalent to Octonions with a cannonical multiplication order?

</comment><comment><USER7> Quarternions aren't weird. With a 2D angle we use 2 numbers (sin and cos) to calculate vector rotations. It turns out that in 3D we use 4 numbers.

<comment><USER3> There's a lot of hand waving in that phrase, "it turns out". Sure, "it turns out" that 3D uses four numbers. Why?

Geometric algebra explains that in a succinct way that also appeals to our intuition about geometry. Start by using bivectors to represent reflections, then take the closure of your bivectors and you get the even-ordered subalgebra. This will have dimension 2^(N-1)... so 2 for 2D, 4 for 3D, and 8 for 4D.

This, to me, takes the mystery out of _why_ quaternions can represent rotations, and it places quaternions in a coherent theory of geometry that works in any number of dimensions, not just 3D. Alternatively, we could accept that the math just happens to work out that way, or we could even show that quaternions are a double cover of SO(3), but all that does is analyze why something works, whereas the geometric algebra version is a bit less of a leap and builds quaternions from the ground up.

<comment><USER8> I think there is a lot of unintentional irony in what you wrote. You start out saying, "There's a lot of hand waving in that phrase..." and then go on to write:

"Start by using bivectors to represent reflections, then take the closure of your bivectors and you get the even-ordered subalgebra."

It reminds me of the running joke we had in graduate school. Any book whose title starts off with "An Elementary Introduction to..." was going to be very difficult.

<comment><USER9> There's definitely something a bit "just a monoid in the category of endofunctors" about that description. Which is not to say that it's not both true and helpful - it's just not very accessible. Perhaps if there was a one- sentence explanation of what a bivector was, it would be a lot clearer.

<comment><USER10> A bivector is a plane spanned by two vectors, with an associated orientation.

<comment><USER11> That hasn't helped!

<comment><USER10> In a geometric setting - if you have two vectors, you can position them so that both have one end at the origin. This spans a plane (test it out yourself in 2D or 3D space with two pencils, put the eraser at the origin for each; it's a parallelogram). The area of the plane will depend on the length of the pencils. You can assign an orientation to the plane by imagining a rotor embedded in the plane that spins either clockwise or counterclockwise.

<comment><USER11> Hmmm.

"The area of the plane will depend on the length of the pencils". Surely the area of the plane is infinite? The area of the _parallelogram_ will depend on the length of the pencils.

And I can't see how "you can assign an orientation to the plane" other than by changing the directions of the pencils. Again this description sounds like it refers to the parallelogram, not the plane.

And I don't know what a rotor is.

But other than that, I'm doing great.

<comment><USER10> Yes, when I said plane I really meant the parallelogram. By rotor I literally just meant "a thing that spins" \- you could draw a circle on the parallelogram with an embedded arrow describing the direction it is spinning - that arrow could either be going clockwise or counterclockwise.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER12> This helped me a lot to understand quaternions using simple algebra: [https://math.stackexchange.com/questions/147166/does-my- defi...](https://math.stackexchange.com/questions/147166/does-my-definition- of-double-complex-noncommutative-numbers-make-any-sense)

</comment><comment><USER13> This is great insight, but it seems a bit silly to act like you don't need a 4D / hypersphere representation when the 4th one is hiding in plain sight. For the not-quaternion to describe a rotation, it needs unit length in 4D, with the two components scaled as a sine/cosine pair.

</comment><comment><USER14> Geometric algebra is "easier" to understand than plain-old imaginary numbers? Pourquoi?

</comment><comment><USER15> > OK so what is this Geometric Algebra? It's an alternative to linear algebra.

No. Geometric algebra is a use case of linear algebra. How can it be an alternative?

> Before I tell you how to actually evaluate the wedge product, I first have > to tell you the properties that it has:

> 1\. It's anti-commutative: a \wedge b = -b \wedge a

> 2\. The wedge product of a vector with itself is 0: a \wedge a = 0

Redundant information. The latter follows from the former.

<comment><USER3> It's definitely an _alternative_ in the sense that it gives you an alternative framework for concepts that are taught under the banner of linear algebra in school. For example, it gives an alternative construction for quaternions as a subalgebra, and it gives the exterior product as an alternative to the cross product.

<comment><USER16> I'd say alternative is an unlucky choice of words. I'd rather say geometric algebra (GA) is an extension of linear algebra (LA). In order to really understand GA you need first to firmly understand LA. Then it becomes clear that all that GA does is to turn a Hilbert space into an algebra called a Clifford algebra, and to examine the geometric semantics of the various operations that pop up in the process.

Here are three great sources that helped me to understand GA:

1\. [https://www.amazon.co.uk/Geometric-Algebra-Computer- Science-...](https://www.amazon.co.uk/Geometric-Algebra-Computer-Science- Revised/dp/0123749425)

2\. [https://www.amazon.co.uk/Linear-Geometric-Algebra-Alan- Macdo...](https://www.amazon.co.uk/Linear-Geometric-Algebra-Alan- Macdonald/dp/1453854932)

3\. [https://www.amazon.co.uk/Algebra-Graduate-Texts- Mathematics-...](https://www.amazon.co.uk/Algebra-Graduate-Texts-Mathematics- Serge/dp/1461265517) , pages 749-752

The first source gives great motivation and intuition for GA and its various products. Its mostly coordinate free approach is very refreshing and makes the subject feel exciting and magical. This is also the problem of the book, it's easy to end up confused and disoriented after working through it for a while. The second source is great because it grounds GA firmly on LA, and makes everything very clear and precise. The third source gives a short and concise definition of what a Clifford algebra is.

<comment><USER3> My personal recommendation for a book on geometric algebra is the one by Hestenes, _New Foundations for Classical Mechanics_ ([https://www.amazon.com/dp/0792355148/](https://www.amazon.com/dp/0792355148/)). I was disappointed by _Geometric Algebra for Computer Science_ and I recently got rid of my copy when I moved to a new apartment, but I have a mathematics background and tend to prefer denser books.

I would say that "alternative" is a viable word here. Yes, you'll need a foundation in linear algebra to understand geometric algebra, but our classes and books on linear algebra go beyond what is necessary for understanding geometric algebra and introduce concepts (like the cross product) which have more natural equivalents in geometric algebra. I'm not even convinced that it's necessary to have a good understanding of matrixes in order to work with geometric algebra.

<comment><USER16> I guess we have to agree to disagree. GA is not an alternative to LA, as LA is the foundation of GA.

The main point of LA is not matrices, but linear operators, dimensionality, linear independence, bases, etc. Matrices flow naturally from that. If all you have been taught in LA is to manipulate matrices, then I can see why you feel about the relationship between LA and GA the way you do.

<comment><USER3> You're saying things that I agree with 100% which makes me think that there's something missing from my explanation.

I'm not talking about linear algebra as a field of mathematics in some kind of ideal sense here. Yes, obviously, it's a foundation for geometric algebra. You don't need to convince me of that.

However, elementary linear algebra _classes_ don't teach you about linear operators, they teach you about things like matrixes and cross products. In these basic classes, a "vector" is a "thing with X, Y, and Z coordinates". So when you get to physics, you use the cross product to write a formula for magnetic field. You have to remember that the magnetic field is transformed differently from other vectors according to some special rules. And engineers call this stuff "linear algebra". Mathematicians agree that it's linear algebra, but we know that there's a lot more to linear algebra that goes beyond that.

Alternatively, they could calculate the magnetic field using geometric algebra, and express it as a bivector, at which point all of those special rules vanish.

That's why Hestenes's book is called "New Foundations for Classical Mechanics". It's not that linear algebra is not the foundation for geometric algebra. It's that _classes taught in colleges_ which are called "linear algebra" teach you the concepts used by Gibbs and Wilson in the book _Vector Analysis,_ and these concepts don't generalize to different numbers of dimensions. GA does. Maybe the problem here is that we don't have a special name for that field of study which uses cross products, if had a different name for that stuff, say "vector analysis" after the book first appeared in, we wouldn't have a problems saying that "geometric algebra is an alternative to vector analysis".

GA is a nice alternative to the stuff they teach engineers scientists under the "linear algebra" banner.

Another example… look at Stokes' Theorem. The version with differential forms is a nice alternative to the version with just a cross product.</comment></comment></comment></comment></comment></comment>


Bannon suggests having too many Asian tech CEOs undermines 'civic society' - <AUTHOR> http://www.theverge.com/2016/11/16/13653490/steve-bannon-trump-presidency-chief-strategist-breitbart-tech-visa <comment><USER2> _Bannon responded: "When two-thirds or three-quarters of the CEOs in Silicon Valley are from South Asia or from Asia, I think . . . " he didn't finish his sentence. "A country is more than an economy. We're a civic society."_

.

I can't stress how important it is to read "Autocracy: Rules for Survival", an article by Russian journalist Masha Green. It's prescient, already.

[http://www.nybooks.com/daily/2016/11/10/trump-election- autoc...](http://www.nybooks.com/daily/2016/11/10/trump-election-autocracy- rules-for-survival/)

 _Rule #1: Believe the autocrat. He means what he says. Whenever you find yourself thinking, or hear others claiming, that he is exaggerating, that is our innate tendency to reach for a rationalization. This will happen often: humans seem to have evolved to practice denial when confronted publicly with the unacceptable. Back in the 1930s, The New York Times assured its readers that Hitler's anti-Semitism was all posture. More recently, the same newspaper made a telling choice between two statements made by Putin's press secretary Dmitry Peskov following a police crackdown on protesters in Moscow: "The police acted mildly—I would have liked them to act more harshly" rather than those protesters' "liver should have been spread all over the pavement."_</comment>


Why This Guy Rules - <AUTHOR> http://www.whyirule.com/

<comment><USER2> very interesting! i'd like to see more please!

-bowerbird</comment>


There's an iOS device attached to my Google account and I own no Apple products - <AUTHOR> http://penguindreams.org/blog/there-is-an-ios-device-attached-to-my-google-account-and-i-do-not-own-any-apple-products/ <comment><USER3> This is super easy to do accidentally if you log into Google while simulating a mobile device in Chrome devtools, because your user agent string tells Google what device you are using.

First verify you don't have an iPhone (or whatever) in your recently used devices: [https://security.google.com/settings/security/activity](https://security.google.com/settings/security/activity)

      1. Open Chrome incognito window
      2. Open devtools
      3. Toggle device mode to iPhone (or whatever)
      4. http://google.com
      5. Log in

Now go back to recently used devices and you should see the new device.

Occam's razor implies PEBKAC.

<comment><USER4> But it should still have sent an email.

<comment><USER5> Sure, if it was me logging into someone else's account (and there had to be some conscious effort based on his random password), I'd log in and delete the email immediately. Delete from inbox, delete from trash, refresh.it seems like you would notice that but no one spends 24 hours a day looking at their email. It probably wouldn't be that hard to slip by the best of us.

That's what two factor authentication is for. And not emailing the same account for login notifications. I just don't find this to hard to believe.

<comment><USER6> If you have a recovery email setup it will also receive that notification.

</comment></comment></comment></comment><comment><USER7> "I use a secure password algorthym." Maybe my notion of secure is wrong, but I didn't find it particularly secure ("Ensure your system always gives you a password between 8 and 9 characters long") or even convenient (absolutely no mention of password managers, system is based on memorization).

And then moments later: "I currently don't have two factor authentication."

Just seems like there's two people behind this post: one who is concerned about security and one who doesn't fully leverage tools to enhance their security.

Not ragging on the author. This just stuck out at me. I'm genuinely curious and would love a follow-up if author can discover what happened.

<comment><USER8> Quantitatively, how much more secure would using two factor authentication be over what the author is doing?

Edit: Assuming that someone only crafts 9-plus-character passwords that don't show up in dictionary attacks and aren't reused across sites, is 2FA going to secure that person much more? I'm not challenging 2FA. Actually, I'm just trying to motivate myself to use it.

<comment><USER9> If done properly, immensely.

Sites can log invalid password attempts, and unscrupulous sites could include attempted usernames and passwords. That basically gives them a dictionary of accounts to try, because let's face it, most people use the same password for multiple services. Sometimes people's muscle memory kicks in and they accidentally type their password into the wrong site, or the wrong field.

With Google's 2FA, you need access to either a pre-printed list of emergency codes, or the ability to see the person's incoming texts. That's where the "if done properly" caveat comes in. Google Voice is generally a bad idea. If someone accidentally gets into your email because you left it open, they also have access to your incoming texts.

<comment><USER10> I'd like to respectfully disagree. When done correctly, Google Voice can be as good as if not better than a traditional cell phone. I treat my email with more care than I treat my bank accounts. However, Google Voice is probably not as good as the app on your phone though.

<comment><USER9> [https://support.google.com/accounts/answer/185834?hl=en#gvoi...](https://support.google.com/accounts/answer/185834?hl=en#gvoice)

I remembered the advice, but not the reason. It's because you can easily lock yourself out of any way to get your otp. So maybe it's _too_ secure?

<comment><USER10> Ah. I have an app for my main Google account but for other Google accounts, I have them sent to my Google Voice number. (:

Mostly because I'm lazy and want to copy paste from hangouts on the computer.

</comment></comment></comment></comment></comment></comment><comment><USER11> The most likely explanation is that one of his devices visited YouTube over HTTP (not HTTPS) and his ISP "helpfully" installed some kind of caching proxy that returned the wrong cookies to the wrong user. ISP have been known to cause mixups like that when cranking up caching aggressiveness to 11.

<comment><USER12> That doesn't really explain an iOS device being attached to the account.

<comment><USER11> The ISP might have return his cookie to someone else running iOS. The fact that it only happened for a few hours might be explained by cache expiration.

<comment><USER13> If ISP's are returning cookies from the wrong users, wouldn't it also be possible for login credentials (stored within cookies) to be returned as well?

<comment><USER11> Login cookies are usually sent over HTTPS. Check your browser's cookie store, you'll see that Google services use so many of them, also because of the many hostnames and domains they are on. I suspect YouTube cookies because you can't use google.com ones directly on its domain. And the console mentions devices that have been used with the account, not that have been logged in or have attempted to do so (an important distinction), which points again to cookies. If he used Chrome or another browser supporting ChannelID, such a mixup would have no consequence, because Google's GFE would detect the situation and mint new cookies or redirect the user to a login page.

</comment></comment></comment></comment></comment><comment><USER14> _...manufactures are known to leave unpatched versions of glibc, openssl and the built-in web browser..._

Android doesn't use glibc.

</comment><comment><USER15> No 2FA? That's... an interesting security choice.

<comment><USER16> for YouTube viewing? really?

why would I go over the hassle to see cat videos? the worst that can happen is someone steal my like or generate fake ad revenue.

not everyone have their life attached to a google account.

<comment><USER17> > why would I go over the hassle to see cat videos? the worst that can happen > is someone steal my like or generate fake ad revenue.

...or log in with an iOS device and freak you out, leading you to write a blog post about it.

This is a blog post about possibly unauthorized access to a Google account, pointing out the lack of 2FA is perfectly valid given the context.

</comment></comment></comment><comment><USER18> One possibility is the author logged into an iOS device to check it out - e.g. one of the devices Apple stores have lying around for people to test out - <USER2> then forgot to logout, so when other people used YouTube on the same device, their views were logged under the author's account

</comment><comment><USER19> (EDIT): Left my slightly off-topic comment below as it may be useful to some people anyway; as the two child commenters pointed out, this doesn't necessarily relate. It seems as if this was an attack, the non-gmail email must have been compromised as well as I don't see a way to turn off these notifications.

From what I have seen assisting others with compromised Google accounts (most likely due to a phishing attack, but unconfirmed), emails that would give away the compromise are usually deleted---either manually or via a filter[1].

Sometimes these deleted mails can be retrieved because they not purged completely, but deleted mail does not show up in GMail search.

[1]: If you believe your account has been compromised, check your email filters, I've seen weird delete filters added to accounts.

<comment><USER20> But the email address on his account is not Gmail, so an attacker would have had to separately compromise his non-Google mail server to do achieve any of this.

<comment><USER19> Oh, its been a long day; I guess I forgot about that when I came back to comment. (EDIT:) Thanks for the correction.

<comment><USER20> I should have said, despite the fact that it doesn't fit in this specific case, your overall advice is very good. This is quite common and definitely something people should be aware of.

</comment></comment></comment></comment><comment><USER21> I had one interesting incident.. I was not able to access my twitter and gamil account both. The twitter account was associated with that gmail account. I had same password for both of them. I was able to recover my gmail as the attacker did not change the recovery email in my gmail account. And hence I could recover the twitter account too. Then again I set the same password for both of them. Next day same thing happened again. Then recovered both and set different password and since then it is fine.

I wondered how someone could hack so easily. The passwords were not easy and I can not believe that anyone could guess that. I also checked the last access time in gmail and there were no suspicious activity there.

</comment><comment><USER22> I'm curious to know what the author's gmail address is. I've experienced bad behavior with the ability to add or remove dots from the mailbox name. Apple (amongst some others) allows people to register iCloud accounts using unverified email addresses. It is obviously a big leap to think the YouTube app would respect the iCloud username.

</comment><comment><USER23> This is a long shot... But if you use Linkedin that could account for some of the videos. They recently added an autoplay feature for their videos on the home page that is very tedious to shut off. If you're logged into youtube on the same device it will play the videos and show up on your played videos on Youtube.

</comment><comment><USER24> Maybe the iViewedThis api endpoint on the YouTube ios app is not/was not checking tokens correctly?

</comment><comment><USER25> I can't figure it out so let's blame my Android phones running a hacked ROM cobbled together by script kiddies on XDA.</comment>


Nancy – A lightweight web framework for .NET - <AUTHOR> http://nancyfx.org <comment><USER2> If you like this sort of thing, and enjoy or are curious about F-Sharp, give Suave a look: [https://suave.io/](https://suave.io/)

There are two great tutorials for it: [https://www.gitbook.com/book/theimowski/suave-music- store/de...](https://www.gitbook.com/book/theimowski/suave-music- store/details)

and

[http://products.tamizhvendan.in/fsharp- applied/](http://products.tamizhvendan.in/fsharp-applied/)

which gets more into how suave actually works.

</comment><comment><USER3> I do a good bit of .Net webservice work and Nancy is my go to solution for throwing up an HTTP API. I've taken the same app from a Windows oriented ASP.net hosted to a Linux/Mono hosted self hosted service with very few changes to the code. Even in the new .Net Core/MVC6 world I think Nancy is a good option to consider given all the middleware and plugins available on NuGet.

</comment><comment><USER4> Looks like the beta version of Nancy now supports .NET Core.

Last I heard was this: [http://thecodejunkie.com/2016/02/22/working-full-time- on-get...](http://thecodejunkie.com/2016/02/22/working-full-time-on-getting- nancy-running-on-coreclr)

Digging into the code, it looks like the work has been merged in. I haven't seen an official announcement though.

I'll update [https://anclafs.com/#web](https://anclafs.com/#web) (edit: done)

<comment><USER5> Npgsql supports .ner core, as does Marten

<comment><USER4> OK, I'll update Npgsql. Not sure what you mean by Marten.

<comment><USER6> Marten is a .NET database client that uses PostgreSQL as a document-database:

[http://jasperfx.github.io/marten/documentation/documents/](http://jasperfx.github.io/marten/documentation/documents/)

<comment><USER4> Cool, Raven was a pain last time I used it. I'll try this next time I need something like that.

FYI this is now in [https://anclafs.com/#orms--dbs](https://anclafs.com/#orms --dbs) thanks to [https://github.com/phillip- haydon](https://github.com/phillip-haydon).

</comment></comment></comment></comment></comment><comment><USER7> Don't see the point of Nancy today with the latest MVC6 that can be made really light weight when one needs just a few end points without bloat. You're app can basically be a single class in your project.

<comment><USER4> The new MVC (or just Core now) is great, and much lighter / higher performance. However, it's still more like Rails than Sinatra (to use a Ruby analogy), which I guess is the niche Nancy is trying to fill.

<comment><USER8> Nancy Sinatra is the daughter of Frank Sinatra, hence "Nancy".

</comment></comment></comment><comment><USER9> There's a couple of podcasts from a while back where the HerdingCode [0] podcast folks interview the creators of Nancy:

[http://herdingcode.com/herding-code-123-andreas-hakansson- an...](http://herdingcode.com/herding-code-123-andreas-hakansson-and-steven- robbins-on-nancyfx/)

[http://herdingcode.com/herding-code-156-catching-up-with- and...](http://herdingcode.com/herding-code-156-catching-up-with-andreas- hakansson-and-steven-robbins-on-nancyfx/)

Also vaguely related their podcast about OWIN and Katana which Nancy can run on top of:

[http://herdingcode.com/herding-code-164-owin-and-katana- with...](http://herdingcode.com/herding-code-164-owin-and-katana-with-louis- dejardin/)

[0]: [http://herdingcode.com/archives/](http://herdingcode.com/archives/)

<comment><USER10> [2011] Hanselminutes Podcast 270 - Nancy, Sinatra and the Explosion of .NET Micro Web Frameworks with Andreas Håkansson:

[http://www.hanselman.com/blog/HanselminutesPodcast270NancySi...](http://www.hanselman.com/blog/HanselminutesPodcast270NancySinatraAndTheExplosionOfNETMicroWebFrameworksWithAndreasH%C3%A5kansson.aspx)

</comment></comment><comment><USER11> I really like Nancy - we've been using it for a couple years now, since MVC didn't really work with the OWIN/Katana self-hosted web-server components. I like it's style of explicitly defining your HTTP routes and handlers, versus the more implicit MVC style.

</comment><comment><USER12> The neat thing about this is that it breaks away from the tightly-integrated IIS/ASP.NET model (which, while normally a great thing for performance reasons, can be unwanted or overkill).

<comment><USER13> IIRC, ASP.Net <strike>5</strike> Core allows for stand-alone deployments, and uses the same libuv under the covers than Node does. The development on the open Core version of the .Net platform has been interesting to watch, and has me actually interested in looking into it again.

</comment></comment><comment><USER14> Best lightweight option out there for C#, but could be better.

I wish it used composition rather than overriding everywhere, to give you more flexibility in instantiating things dynamically.

I also didn't like how it tries to encapsulate the ioc controller. Makes it difficult when you want Nancy itself to be a dependency, or to run in a repl.

I would rather allow the ioc controller to manage the web server, like Jetty does it in the Java world. Not sure anything like this exists in C# land though.

<comment><USER15> Yes, the web server should be just another interface that the domain uses to communicate.

</comment></comment><comment><USER16> Love this framework, it has been a lifesaver when I need to implement an HTTP API in an existing Windows service, with no need to rely on IIS.

</comment><comment><USER17> For those who already have an OpenAPI/Swagger spec, you can generate NancyFx server stub using Swagger Codegen. Please refer to [https://github.com/swagger-api/swagger- codegen/wiki/Server-s...](https://github.com/swagger-api/swagger- codegen/wiki/Server-stub-generator-HOWTO#nancyfx-module) for more information.</comment>


GameCredits takes on Apple and Google with its blockchain-based app store - <AUTHOR> https://venturebeat.com/2017/08/17/gamecredits-takes-on-apple-and-google-with-its-blockchain-based-app-store/ <comment><USER2> Except it doesn't compete with Apple in any way...</comment>


Terrain rendering in fewer than 20 lines of code - <AUTHOR> https://github.com/s-macke/VoxelSpace <comment><AUTHOR> I stumbled upon this very good explanation (and demo) of the Comanche Voxel 2.5D engine reimplemented in JS and thought it might interest some HNers. I did not had the pleasure to play Comanche though I have fond memories of playing Apache in 1996.

I've been investigating the terrain generation / rendering quite a bit for the past ten days and have started to play with [https://threejs.org/](https://threejs.org/), webgl and shaders, the current result ([https://twitter.com/maxmre/status/933860624773283842](https://twitter.com/maxmre/status/933860624773283842)) is quite humbling when I see how nicely the Comanche engine works :)

<comment><USER2> Pretty neat, but I'm confused. You say it's in JS, and the demo certainly is, but the repo is in Python plus some extractors written in C, a few shell scripts, and Markdown docs. No JS in sight. At the same time, Github claims the project is 100% HTML ... I don't know what or who to believe!

<comment> s-macke The project is originally a fan page about the game Comanche and the Voxel Space engine. The web demo is just one part and contains mainly JavaScript. The tools directory contain the code which was used to generate the gif animations and the tools to extract the maps from the Comanche games. So you can ignore the python and shell scripts.

</comment></comment></comment><comment><USER3> Yeah, but imagine doing fractal landscapes on an 8-bit 6502 in 1984:

[https://www.youtube.com/watch?v=FbZ- chrOgGg](https://www.youtube.com/watch?v=FbZ-chrOgGg)

<comment><USER4> is this going to be 'rescue on fractalus'?

EDIT: It is! Had the commodore version - fun memories :)

c64: [https://www.youtube.com/watch?v=fjR33K_wuD8](https://www.youtube.com/watch?v=fjR33K_wuD8)

<comment><USER5> One of my all time favorite games, without a doubt. I used to play it on the Atari 800XL, but it had a different name, I believe. "Behind Jaggi Lines", I want to say.

Edit: fixed game name

<comment><USER6> Behind Jaggi Lines! was actually a development version that was pirated heavily amongst Atari owners. I played it on my Atari 800. It was the first game that actually made me jump out of my chair, scaring me. I can remember the moment vividly. Great game!

</comment></comment></comment></comment><comment><USER7> That is not 20 lines, that's 300+! Here is terrain rendered in 30 lines, with no textures either. [https://www.shadertoy.com/view/lslBz7](https://www.shadertoy.com/view/lslBz7)

<comment> s-macke Author here

The main algorithm fits easily in 20 lines. However, the JavaScript code is optimized and contains also the initializing routines and input device logic.

It is also a little bit unfair to compare this with shadertoy. He doesn't have to include the render algorithm but relies on a GPU. The Voxel Space engine just draws vertical lines and doesn't need a GPU.

<comment><USER8> Shadertoy shaders _do_ include the render algorithm. That shader is completely ray-traced, so the only real input that is used for that shader is the x, y coordinates and time. It's not using any of the GPU's polygon rasterization. It's stateless and is generating the terrain while it ray-traces it.

</comment></comment></comment><comment><USER9> Just a few years after Comanche was released I was sitting in a high school C++ class, content to explore the language with text adventures and RPGs. 3D graphics seemed vaguely mystical to me.

Next to me, however, was someone who seemed light years ahead of me. He had programmed his own voxel terrain rendering just like this. I had no earthly idea at the time how that was even possible.

In retrospect, he was not so much farther along, but he was passionate enough about game development to read books about these techniques and work out the details. I've always wondered what happened to him, and if he ever followed his passion to become a game developer...

<comment><USER10> C++ in high school in the 90s? We had Turing taught by our gym teacher ;(

<comment><USER11> We had Turbo Pascal taught by a math teacher, who read to us straight from a course binder and admitted to literally drawing the short straw in the teacher's lounge when they were figuring out who had to teach the computer class..

<comment><USER12> +1 TP by math teacher. Without him, I'd never have become a real programmer.

<comment><USER13> I only had TP7 back in the 90s. No math teacher needed. The help file teaches itself.

</comment></comment></comment></comment></comment><comment><USER14> Flashbacks to playing Delta Force in the 1990s as a kid. Looking through the binoculars at a long open distance (say 3500 metres), only to realise that the same hill repeats 3 times :-)

Delta Force 2, released in 1999, still used a voxel engine which could already be hardware-accelerated, supporting "stretched voxels" which were able to simulate high grass.

<comment><USER15> Oh, the memories! Delta Force 2 over multiplayer, with, I think, 30 players or more, on 56K was surprisingly fun! Advanced voxel engines are quite impressive.

<comment><USER14> I played both (1 and 2) almost exclusively in single player, completing every mission. SP missions in DF2 were much, much harder by comparison. Unlike the helicopters in DF1, the MIL Mi-24 Hind helicopters in DF2 were able to shoot at you and you were only able to eliminate them either with an anti-tank missile or with the grenade launcher. No matter how many magazines you emptied at a vehicle, it stayed there and didn't explode :-(

</comment></comment></comment><comment><USER16> Reminds me of this classic 4k demo which blew my mind back in 1993

[http://www.pouet.net/prod.php?which=4662](http://www.pouet.net/prod.php?which=4662)

[https://www.youtube.com/watch?v=_zSjpIyMt0k](https://www.youtube.com/watch?v=_zSjpIyMt0k)

<comment><USER17> The demoscene is still pumping out amazing stuff. Check out this ~5 minute 64K demo (2016): [https://www.youtube.com/watch?v=gX7ESVZ7T6Y](https://www.youtube.com/watch?v=gX7ESVZ7T6Y).

<comment><USER18> IMHO not very many 64Ks have reached the amazingness of this _11 minute_ one from 2000: [https://www.youtube.com/watch?v=Y3n3c_8Nn2Y](https://www.youtube.com/watch?v=Y3n3c_8Nn2Y)

...and for 4K, this one from 2009:

[https://www.youtube.com/watch?v=jB0vBmiTr6o](https://www.youtube.com/watch?v=jB0vBmiTr6o)

<comment><USER19> These dudes doin' mountains and oceans and music in 4K and yet it takes LinkedIn and the like like 9MB worth of assets to show me a bit of text.

</comment></comment></comment></comment><comment><USER20> Neat, great readme.

Everyone seems to be in flashback mode, so I'll add mine: I remember getting a good grade in my multiprocessing class by making a voxel terrain generator using mpi and with the same technique, but also with clouds (just think of upside down white mountains). But I just randomly generate them, without any lighting. The color of the voxels were determined by their height. Using (nice) color and height textures adds a lot indeed! It's a shame I didn't know that trick on that time, I remember playing with vistapro[1] or terragen[2].

[1] [http://www.creative-3d.net/images/vistaprointerface.jpg](http://www.creative-3d.net/images/vistaprointerface.jpg) (I had an older, ms-dos based version)

[2] [http://planetside.co.uk/](http://planetside.co.uk/) (It's great to see that it's still alive after so many years..)

</comment><comment><USER21> Here's my (old) take on a terrain renderer (more than 20 LOC, oh well):

[http://lou.wtf/earf-html5/](http://lou.wtf/earf-html5/)

For anyone who wants a refreshing/fun code project, strongly recommend implementing some kind of software renderer. A raytracer or raycasting engine like this one, or something more fundamental like a polygon renderer.

<comment><USER22> what would you say is the best resource for learning about building one from scratch in JS?

<comment> s-macke The simplest techniques for 3D rendering without relying on a GPU and WebGL are indeed (2.5D) raycasting engines (such as this Voxel Space engine). A short google search reveals for example:

[http://www.playfuljs.com/a-first-person-engine- in-265-lines/](http://www.playfuljs.com/a-first-person-engine-in-265-lines/)

Also read the readme file of this Voxel Space engine. Maybe this is already enough to understand the principle.

<comment><USER3> Loading .obj files is pretty easy, and basic triangle rasterization isn't too hard either. Still probably a bit harder than height maps.

</comment></comment></comment></comment><comment><USER23> Firefox Quantum gives me better FPS than Chrome for the provided demo :)

<comment><USER24> And Safari seems to give me better FPS than both Chrome or Firefox Q.

</comment></comment><comment><USER25> I love it!

How's the rolling in comanche done? The lines are no longer vertical then, so seems trickier.

Roll means the horizon is no longer horizontal by the way, what is labeled roll in the demo is actually pitch :)

<comment><USER26> In Comanche rolling is a skew, not a rotation. You never tilt too much so it's ok.

<comment><USER27> Two skews can also make a rotation in a 2D plane.

<comment><USER26> Yeah but the vertical skew came practically for free (just an offset before you start working on each column), which was very important for performance.

</comment></comment></comment></comment><comment><USER28> This is fantastic! I really enjoyed playing with the web demo. Thanks for open-sourcing it, and for the excellent explanation!

I have a bit of a fetish for old-school 3D tricks, I'm currently working on a 3D project for the Sega Saturn using jo-engine.

</comment><comment><USER29> Reminds me of Tim Clarke's Mars demo: [https://www.pouet.net/prod.php?which=4662](https://www.pouet.net/prod.php?which=4662)

<comment> s-macke When I saw the demo decades ago I was also totally amazed by it. And only 4k. I reverse engineered it with the Turbo Debugger under DOS. Found that most of the code was repetitive to prevent a slow loop construct. So it would have fitted easily into a 1k executable .

</comment></comment><comment><USER30> Hasn't Outcast (1999) used the same/similar techniques for terrain rendering.

The re-released it on GOG last year, and remade it this year with a Unity engine (all polygons now).

<comment><USER31> We had interpolation to "blur" the rendering + some other optimizations (mostly stemming from the fact that the engine inner loops where super heavily optimized (think VTune level optimizations)) (note that I didn't work on the voxel engine, it was a colleague; I just worked on optimizing the 3D triangle pipeline)

(edited for more clarity and info)

</comment></comment><comment><USER32> Spent so many hours playing this game on my 386....

[https://www.youtube.com/watch?v=sdqCjPsBeog](https://www.youtube.com/watch?v=sdqCjPsBeog)

</comment><comment> git-pull Would love to see a C++ implementation of this of this code, whether it's a test project or an example already available in open source.

This would also be a cool thing to give an example of across programming languages. Sort of like how [https://github.com/drujensen/fib](https://github.com/drujensen/fib) does it.

</comment><comment><USER33> Very well and concisely explained, kind of an eyeopener for someone who has never done any game/3D programming.

</comment><comment><USER34> fond DOS memories of [https://en.wikipedia.org/wiki/F29_Retaliator](https://en.wikipedia.org/wiki/F29_Retaliator)

[https://www.youtube.com/watch?v=qwJmlWdmP2M](https://www.youtube.com/watch?v=qwJmlWdmP2M)

</comment><comment><USER35> Where's the 20 lines of code? The code base is small, but looks like hundreds of lines, not dozens.

<comment><USER36> I counted 20 in the body of the README's Render function. I count it as one line if the block is a single line that uses a simple test to execute conditionally (for/if).

Once you understand the algorithm, it's conceptually even simpler than 20 lines.

</comment></comment><comment><USER37> The difference between Comanche and Game Gunship 2000 is remarkable. Very good write-up of the techniques.

</comment><comment><USER38> My only problem with this demo is that it is almost _too_ realistic. It makes me uncomfortable to view something like this and not be able to decide if I'm looking at a computer render or if I'm actually in an airplane flying over real terrain.

</comment><comment><USER39> It wouldn't load Map Comanche 3 - it's trying to load a non-existent image for it - [https://s-macke.github.io/VoxelSpace/maps/undefined.png](https://s-macke.github.io/VoxelSpace/maps/undefined.png)

<comment> s-macke Sorry, this in an error. The Comanche 3 map is not part of the Github archive. Try the outdated website if you want to see how a Comanche 3 map looks:

[http://simulationcorner.net/index.php?page=comanche](http://simulationcorner.net/index.php?page=comanche)

</comment></comment><comment><USER40> Perfect for an easter egg. I'm having higher-definition Excel 97 flashbacks... [https://www.youtube.com/watch?v=-gYb5GUs0dM](https://www.youtube.com/watch?v=-gYb5GUs0dM)

</comment><comment><USER41> traslate to :r4 in 95 lines of code (all)

[https://github.com/phreda4/reda4/blob/master/r4/Dev/vox.txt](https://github.com/phreda4/reda4/blob/master/r4/Dev/vox.txt)

</comment><comment><USER42> Wow, great demo. Even works on mobile!

</comment><comment><USER43> there are literally thousands of lines of code in this repo. This is bull shit.

<comment> s-macke The 20 lines refer to the pure rendering algorithm. Please read the description of the algorithm.

The repo contains also the scripts, to generate the GIF animations on the start page and the tools to extract the maps from the Comanche computer games.

</comment></comment><comment><USER44> looks well</comment>


PS4 owners will need PlayStation Plus subscription for online multiplayer - <AUTHOR> http://arstechnica.com/gaming/2013/06/ps4-owners-will-need-playstation-plus-subscription-for-online-multiplayer/?utm_source=feedly&utm_medium=feed&utm_campaign=Feed%3A+arstechnica%2Findex+(Ars+Technica+-+All+content) <comment><USER2> I find their wording interesting. Microsoft advertises their Xbox Live Gold subscription as " _as low as $5 a month "_; whereas Sony announced their as _" less than $5 a month"_.

</comment><comment><USER3> What's interesting is that it took most people a day to realize this. Well done Sony but this may cost you more long time as people don't like to get played...

</comment><comment><USER4> It's a change from PS3, but frankly worth it. Free games as long as you're a subscriber is the main reason why I've been a PS+ member for the past year.</comment>


I found that the company I work for is putting backdoor into mobile phones - <AUTHOR> http://security.stackexchange.com/q/15076/1061

<comment><USER2> Delete the backdoor code, with a commit message saying you have removed a security vulnerability. Watch them try to defend leaving the backdoor in the system (favorite excuse I've heard is 'we need it for troubleshooting!') - they can rollback the commit if they really want the backdoor in. Send out resume.

<comment><USER3> That seems kinda passive aggressive. Either complain through the proper channels... Or don't. But being sneaky doesn't help your cause.

<comment><USER4> That's not being sneaky at all; it's in the commit logs and he can announce it. It's just shifting the burden of action back to the people who want the vulnerability. In theory, the same. Practically, very different.

<comment><USER3> It's obviously not just a regular commit and everyone involved would know that. The commit log is not a proper place for a thinly veiled ethics complaint.

If you think something is wrong, have the courage to say so directly, don't hide behind a commit message.

<comment><USER4> As both employee and employer, it's my view that all employees should what they see as the right thing by default.

Personally, I think the poster should make the change and _then_ announce it. I'm not saying he should be cowardly. If anything, I think the cowardly choice is to futz around trying to get consensus an elusive around doing the responsible thing.

</comment></comment></comment></comment></comment><comment><USER5> Doesn't surprise me. In that circumstance, I'd quit via a letter to the shareholders.

That's what I did when I worked for a large nefarious killing machine provider when I had a tony stark moment, grew some balls and worked out what they were doing was utterly wrong.

I informed them that I was bound by British law as well which supercedes any corporate rules and contracts.

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

<comment><USER7> Haha, I was about to point out that I submitted this a day ago as opposed to this guy submitting it 6 hours ago...

</comment></comment><comment><USER8> Devil's advocate: assuming the company already quietly install updates, and the backdoor is not secured worse than the auto-update mechanism, this does not really give them additional capabilities. (Also, the phone likely already has more serious vulnerabilities.)

Of course, this exchange does suggest bad things about the company's ethics and competence.

<comment><USER9> The backdoor being called "backdoor" by this engineer already implies that it is not nearly as secure as the auto-update mechanism: the content is not signed by the company, it can't be disabled by the user, et c. I see no reason not to trust OP's judgement.

</comment></comment><comment><USER10> > I have found out recently that the remote assistant software that we put in > smartphone we sell can be activated by us without user approval.

Maybe I'm missing something, but it says nothing about what might possibly happen in case their remote assistant is remotely activated. Also it's unclear how large is their user base. Everyone kind of assumes serious implications, though.

IMO if this whole thing is true, it indicates that the company probably doesn't have good QA and development process in place. Otherwise either such a bug would not exist (most likely it was left for debugging purposes), or it would really be a product of an evil intent (and hidden from uninitiated developers).

</comment><comment><USER11> Seriously, is there any significant piece of hardware on stores nowadays that doesn't have multiple backdoors from application level down to the very microchips? Like [1].

[1] [http://articles.businessinsider.com/2011-06-27/news/30048253...](http://articles.businessinsider.com/2011-06-27/news/30048253_1_microchips- missiles-foreign-chip-makers)

<comment><USER12> What's your point? That it's status quo so don't worry about it?

<comment><USER11> My point is that this is outraging.

There are so many instances of this, it seems each week we hear from another backdoor like this[1].

[1] [http://it.slashdot.org/story/12/04/26/1411229/backdoor- found...](http://it.slashdot.org/story/12/04/26/1411229/backdoor-found-in- arcadyan-based-wi-fi-routers)

</comment></comment></comment><comment><USER13> I wonder if it's this Verizon Remote Diagnostics tool that started getting loaded onto a few phone models a couple months ago.

[http://www.engadget.com/2012/03/20/verizon-updates- revolutio...](http://www.engadget.com/2012/03/20/verizon-updates-revolution- with-remote-diagnostics-htc-turns-to/)

</comment><comment><USER14> contact EFF ? quit your job ?

</comment><comment><USER15> _We are not using this option, and it is probably there by mistake._

Aww, sweet innocence.

</comment><comment><USER16> Ask for partnership for not publicizing it :)

</comment><comment><USER17> please speak up. you should go to anybody and everybody you can and make your concerns known. it's possible that the people above you don't even know, but in the event they do, you should probably inform local news or someone.

I'm not saying that you should try and lose your job, but you should make your disagreement known.

</comment><comment><USER18> I would disclose to a security firm that I felt was trustworthy and let things go from there.

<comment><USER5> I'd suggest pastebin rather than a security firm. Security firms will shop you in 2 mins if they feel it's profitable.

</comment></comment><comment><USER19> Can't think of a catchy name for it, but maybe the StackExch team needs to start a "Programmer Confessions" forum.

<comment><USER20> A Codefessional?

I have one of those...

<comment><USER21> yeah it's called #defocus

</comment></comment></comment><comment><USER19> Can we assume this company is not Huawei/ZTE?

<comment><USER22> He said it was remote desktop software.

<comment><USER23> No, he said it was "remote assistant" software in "mobile phones."</comment></comment></comment>


Remember twich.me (node.js realtime chat)? Here is the source as promised. - <AUTHOR> http://github.com/isaacsu/twich

<comment><AUTHOR> This is the source code for the app I've been working on. It was featured in HN awhile back. <http://news.ycombinator.com/item?id=1590173>

This is the first time I'm open sourcing my code. Please be nice. Any feedback is welcome.

And a twich for the occasion <http://twich.me/opensource>

<comment><USER2> Just wondering, but is there a reason you chose not to write this 100% in node?

<comment><AUTHOR> I wasn't very good at node, and I wanted to get it up and running quickly. So I used node for the message passing and php for serving up the client files and routing the rooms.

I'd put it to technical incompetence more than anything else.

</comment></comment></comment><comment><USER3> I made a site just like this <http://yamr.net> to be able to group chat with friends/family/co-workers and not have them install anything (can go to yamr.net/any-room-name)

It's pretty cool seeing your site and what you decided to do differently. I'll be checking out your source later when I have time.

Mine is also built with php/node and I added socket.io so I could take advantage of websockets. I auto-log in users and keep chat history (although right now it only shows the latest 30 messages)

If you're looking to implement any features I have (like chat history) PM me and I'll share how I did it

</comment><comment><USER4> Thanks for sharing the code on github, I've been pouring over it for a little while now, and I'm inspired to try my own node project.

I see twitch is using php to render views, but I was wondering if anyone has tried any js template engines? I've used jqote (based off of John Resig templating engine, I believe) and it's pretty nice, but I'm curious if anyone else has had experience with any other js templating engines.

<comment><USER5> I'm using tuxychandru's grasshopper which does templating (an a lot more - it's a full fledged web server) in a relatively nice way. <http://github.com/tuxychandru/grasshopper>

Another good approach, if you're looking for something that specifically plays well with node, is to look at the modules page on the node.js wiki - it's served me well.

<http://github.com/ry/node/wiki/Modules>

</comment></comment><comment><USER6> Posted to The Changelog: [http://thechangelog.com/post/1422032099/twich-php- node-js-re...](http://thechangelog.com/post/1422032099/twich-php-node-js- realtime-web-based-chat)

</comment><comment><AUTHOR> I've created a forum for the twich project

<http://forum.twich.me/>

</comment><comment><USER7> Is there a Twich without node.js for a hosted account drop-in?

</comment><comment><USER8> did you run the code using a proxy http server? What is the server setup?

<comment><AUTHOR> No proxy. Just apache running on 80 and node running on 443

<comment><USER8> I only ask because watching the presentation that Ryan Dahl presented in 2009 ~ <http://jsconf.eu/2009/video_nodejs_by_ryan_dahl.html> mentions node.js isn't secure enough to use as a webserver for production use yet :)</comment></comment></comment>


When Haskell is Faster than C (2013) - <AUTHOR> http://paulspontifications.blogspot.com/2013/01/when-haskell-is-faster-than-c.html <comment><USER3> The title is a bit click-baity, but the core point is sound: C is not _fast_ , it's _optimizable_ [1].

If you just write readable, friendly C code it won't be all that much faster than normal code in a high-level language like Haskell—it might even be slower. I know, I've done that myself. But you never see that in benchmarks, do you? That's not what benchmarks are about.

Here's another illustration: we can compile high-level languages like Haskell and Scheme to C. Does this make them "as fast as C"? Yes—they're literally running as C. But also _no_. Hand-optimized C code is going to beat those compilers any day. It's not even close.

C is not magical performance sauce you can sprinkle over your code to make it fast. It's just a language that doesn't have much mandatory overhead (no GC, minimal runtime... etc) and gives you access to certain low-level knobs that you can twiddle to optimize your code. I mean, that's important and useful, but unless you're going to apply that level of effort _to your whole codebase_ , most of your C code won't be all that fast. Some applications need this level of optimization; most don't.

[1]: I actually wrote a little article about this myself too: [http://www.forbes.com/sites/quora/2014/01/09/can-a-high- leve...](http://www.forbes.com/sites/quora/2014/01/09/can-a-high-level- language-like-python-be-compiled-thereby-making-it-as-fast-as-c)

<comment><USER4> When talking about performance, C actually can have overhead though.

For example, people rely on how C lays things out in memory, so C compilers have to lay things out in memory in specific ways. Haskell doesn't have this constraint and so can do a bunch of tricks.

And then there are things where C cannot move a variable/optimise out a variable because it's unknown whether some unrelated bit of code my go poke at its memory.

Now one might say "well if you know what you're doing then you can get the compiler to do what you want." Everything's possible, since everything's turing complete. But I would consider "variables need to be somewhere in memory" to be mandatory overhead.

<comment><USER5> Variables _don 't_ necessarily need to be somewhere in memory. Compilers absolutely can and will notice if you never take the address of a variable to do this optimisation - it's very common for local variables in C to be materialised nowhere but in a register.

<comment><USER6> Thank you. ANSI C defines a language containing 32 words. And one of them is "register."

</comment></comment></comment></comment><comment><USER7> That's a great short read on the idiocy of over-optimization. I get a lot of similar questions when people learn that I write common lisp for a living - <USER2> most cases they go silent when I provide a sufficiently efficient solution to a problem that was just given to me in the meeting in which we were supposed to agree on a schedule for the implementation.... (which btw also happened a lot when I was mostly hacking in perl 15 years ago - if you haven't read "beating the averages"[1], read it now!).

[1] [http://paulgraham.com/avg.html](http://paulgraham.com/avg.html)

<comment><USER8> I'm a big scheme fan, and really enjoy programming in it..

but the lack of a real ecosystem is really starting to hurt my progress.

What suggestions do you have for lisp-1 -> lisp-2? While I prefer lisp-1 + syntax-parse, I'd rather have.. quicklisp. quicklisp is life. the quicklisp must flow.

<comment><USER9> He who controls the quicklisp controls the universe!

I personally would recommend clojure + cider + emacs for an excellent ecosystem and tooling.

<comment><USER7> > He who controls the quicklisp controls the universe!

Too true, that's my main complaint about ql since day 1. Give me a simple way to define a ql-repo hierarchy and I'll be fine with it. I did invest a few hours maybe 3 years ago but realized that it's too much work (research and patching) to allow for that. Recent developments (author pitching for money in ql context) make me even more worried :(.

</comment></comment></comment></comment><comment><USER10> If you're not using C/C++ to take advantage of locality of reference, low memory footprint and the things that make C/C++ fast then why the hell are you using it?

Seems like this should just be filed under "right tool for the job".

<comment><USER11> While I agree with this, I look around the history of programming and see that too much code was written in C, and too much is being written in C++. And writing even more of it is my day job.

One thing that slows down change is that new languages come with parallel universes called "runtimes". The D language ([https://dlang.org/](https://dlang.org/)) is an honourable exception (it has a runtime, but not a parellel universe).

But D is only an incremental improvement on C++, and somehow never took off. Maybe Rust will be the Saviour.

<comment><USER12> The advantage (one advantage?) of C is that if you write a library in C, then it can be used on any platform, and from any language. Basically every language has bindings into C.

<comment><USER13> Every language has OS ABI bindings, that on OS written in C, tend to be the same as the OS ABI.

<comment><USER12> [http://www.swig.org/](http://www.swig.org/)

</comment></comment></comment></comment></comment><comment><USER14> If you find yourself setting out to write Haskell that can outperform C, you will probably be disappointed. I love Haskell, but the myth that it just takes a little bit of elbow grease to make it as fast as C really needs to die. See for example: [https://chadaustin.me/2015/02/buffer- builder/](https://chadaustin.me/2015/02/buffer-builder/)

THAT SAID, I have a relevant story. IMVU used this file format called "CFL" for its 3D content. It was basically a kind of zip file except it used LZMA for asset compression. The original CFL library was written in C++, and while it worked fine, it was getting annoying to maintain and compile it, as well as inefficient to pass data from Python file buffers into C++ and back out. So one day I decided to see if I could replace it with a bit of Python code and pylzma. After I made this change, parsing our content files was _twice_ as fast. Having the code in a couple hundred lines of simple Python allowed me to optimize the data flows, minimizing copying from the file buffers into the LZMA decoder and then to the consumer of the data.

Sometimes the best way to make something fast is to write it in a safe, expressive language that lets you directly express your intent. :)

<comment><USER15> Where was the wasted time? Something about converting the data back and forth through the CFFI? Just convoluted data flow?

<comment><USER14> Convoluted data flow and unnecessary copies! The C++ implementation was thousands of lines and the Python one was a couple hundred, so it was much easier to see the path the data had to take.

</comment></comment></comment><comment><USER16> > I wrote the inner loop of the C to operate on a linked list of blocks

Linked lists are slow...

<comment><USER17> Linked list has extremely fast prepend/insert/delete operations compared to an array!

<comment><USER18> Not really. Depends how big your list is. If the answer is "not really that big" then cache misses and memory non-locality can cause linked lists to be less efficient. Besides, arrays actually have the same amortized time complexity as lists for dequeue operations. It's just in-the-middle deletions and insertions that can cause problems in arrays.

<comment><USER19> Using linked-list is not such an issue if nodes are not allocated with the general purpose allocator, and instead are allocated from a pool of memory addresses next to one another.

<comment><USER20> Then there's no point of using a linked list... A linked list is literally to connect distant memory addresses.

<comment><USER19> Such a linked-list using a linear pool of nodes is still useful if your algorithm makes many inserts and/or removals.

The leap you're making here is about how distant the memory addresses should be in general.

This is entirely dependent on your problem and your data-set.

<comment><USER20> A skiplist array is the proper structure to use. A linked list is never the right structure for a local block of memory.

</comment></comment></comment></comment></comment></comment></comment><comment><USER21> A ridiculous article. Yes, Haskell will outperform C if you write a crazily inefficient C program.

</comment><comment><USER22> 1\. The "reverse-complement" problem here is simply about reading a file, reversing strings and mapping a small set of characters to another one and printing the result. This is really a simple problem and there aren't a lot of optimisations to be done. Really this about having the fastest I/O library and thus doesn't seem like a good way to compare C and Haskell. If you look at the various solutions presented on benchmark games, the core algorithms are all the same and they only differ on how to read/write and the use of threads.

2\. The author talks about the importance of reducing cache misses due to pointer indirection and then proceeds by implementing a character buffer as a linked list of small buffers...

3\. The C version reads and writes character one by one, this can be greatly improved by reading/writing bigger chunks at once. Actually, the author points out this optimisation but says "that would require significant changes to the code;". So the author spent time optimising the Haskell version, but spending time optimising the C version is too much work? And then arrives at the conclusion Haskell is faster?

4\. Commenters on the author's blog cannot reproduce the results...

</comment><comment><USER4> A similar paper on Haskell's stream fusion has a pretty similar PDF filename ([http://research.microsoft.com/en- us/um/people/simonpj/papers...](http://research.microsoft.com/en- us/um/people/simonpj/papers/ndp/haskell-beats-C.pdf)). With benchmarks showing the "naive" implementation in Haskell of a simple stream problem beating hand- tuned C.

Haskell is still pretty well-defined in terms of execution, but freedom from how to manage memory is in itself a major liberator for the optimisers.

</comment><comment><USER23> I think it's worth pointing out though that idiomatic C is probably going to be more consistently performant. It seems common to run in to situations in Haskell where one change can cause 10X speedup, but I don't see that nearly as often with C code. I don't have a lot of evidence on hand to support this, just what I've observed personally. This seen fair? Relevant?

</comment><comment><USER24> I don't understand why someone thought it was a good idea to require that POSIX stdio should lock the thread. It slows down stdio several times compared to the nonlocking version, and it completely goes against "don't pay for what you don't use" as single threaded programs have to pay the cost too. And locking and unlocking the stream manually is like two lines of code, which a person writing MT code should be well capable of writing.

</comment><comment><USER25> C and Haskell have different strengths.

I've been programming in both for a while now, and I wouldn't use 'faster than C' as a selling point.

In my (limited) experience, what Haskell gives you is conciseness and abstraction. What C gives you is speed and 'close to the machine' programming for when you need it. I'm not sure this article provides any useful insights.

</comment><comment><USER26> previously on HN:

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

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

</comment><comment><USER6> "...you don't need C. Haskell will give you the same performance, or better, and cut your development and maintenance costs by 75 to 90 percent as well."

I want both the compiler from the year 2030 and the drugs this guy has.

<comment><USER20> Well he uses putc and getc which is IO bound to smithereens >.<

I guess you can call self-delusion a drug..

</comment></comment><comment><USER27> What tools did the OP use for profiling his C and Haskell code?

<comment><USER13> You can use ThreadScope for Haskell,

[https://wiki.haskell.org/ThreadScope](https://wiki.haskell.org/ThreadScope)</comment></comment>


According to the dictionary, "literally" now also means "figuratively" - <AUTHOR> http://www.salon.com/2013/08/22/according_to_the_dictionary_literally_now_also_means_figuratively_newscred/ <comment><USER2> >So it's okay to use literally to mean figuratively as long as you really, really, really need to do so? Hmph.

No need for the "hmph". It's how language works. Yes, a word can indeed have not only multiple meanings but also _contrasting_ meanings. And there's nothing wrong with that nor is there a need to be judgmental about it.

It's not a particularly new meaning either

[http://itre.cis.upenn.edu/~myl/languagelog/archives/002611.h...](http://itre.cis.upenn.edu/~myl/languagelog/archives/002611.html)

<comment><USER3> >And there's nothing wrong with that nor is there a need to be judgmental about it.

I agree that there's no need to be judgmental about it. I wouldn't fault a particular person using "literally" this way. I disagree that there's nothing wrong with this kind of language drift.

While it's nobody's fault, it makes English poorer. There are already lots of general-purpose intensifiers. English doesn't particularly need another one. The previous formal definition of "literally" was comparatively specific and fulfilled a useful role neatly and succinctly. I can't think of another single word to fulfill this role in the future.

I feel similarly with the phrase "beg the question", which in common usage now means simply "raises the question" or "invites the question". It doesn't bother me because I think people who use it this way are stupid; it bothers me because there is no synonym for "begs the question" which is equally succinct.

<comment><USER4> >While it's nobody's fault, it makes English poorer. There are already lots of general-purpose intensifiers. English doesn't particularly need another one.

I'm more than a little bothered by this line of reasoning. Spoken languages aren't like programming languages, where having many ways to express the same thing can be seen as a detriment. Having more ways for one to express oneself can only make the language richer.

<comment><USER3> In a vacuum, having another intensifier is a good thing even if it's very similar to existing intensifiers. My point was that getting another marginally useful intensifier at the expensive of a very useful clarifier makes the language less net poorer.

In other words, "literally" meaning "figuratively" means it can no longer be unambiguously used to mean "not figuratively". The latter function is more useful than the former because there are lots of existing words for the former and only a few for the latter.

</comment></comment></comment></comment><comment><USER5> I think people get confused over how dictionaries work. They aren't meant to dictate usage of language, but reflect it. If "literally" has come to mean its opposite in a large proportion of common usage, then that's what it means now. No matter how bizarre that may seem...

Another way of thinking of this is as a foreigner learning English for the first time. If you hear someone using the word "literally" and you don't know what it means, you will look it up in the dictionary and expect to find _all_ the various possibly meanings.

<comment><USER6> I attribute it to a misunderstanding of what authority is.

People believe, and thusly treat, authorities as prescribers. As people who tell you what to do. That's not what an authority is. An authority is a heuristic. It's someone who has heard the question before and can answer it faster than reinventing the wheel.

That's what a dictionary is. Someone else went and surveyed all the uses of a word and documented it so that you don't have to do it yourself.

An authority is a search engine. Being authoritative is being a _good_ search engine.

<comment><USER7> Ack. "Thusly". I see that far too often for every use to be "ironic". It is not a word, it is a joke at the expense of illiterate people, and now the joke is stale. Stop using it.

<comment><USER8> Nonsense, the dictionary says it was used correctly:

[http://dictionary.reference.com/browse/thusly](http://dictionary.reference.com/browse/thusly)

</comment></comment></comment></comment><comment><USER9> Next up: "exponentially" to mean "a lot!", when there's just a single comparison being made and nothing in context which is varying.

I think I'll have to be a snob and side against the masses and the "linguists" on that one. A lot depends on who you hang out with and read, I guess.

</comment><comment><USER10> Obligatory Oatmeal: [http://theoatmeal.com/comics/literally](http://theoatmeal.com/comics/literally)

</comment><comment><USER11> It is posts like this that make me realize how slow and outdated traditional media is, when they need almost a week to publish an article after it has been trending on front-page of reddit.

<comment><USER12> > It is posts like this that make me realize how slow and outdated traditional > media is ...

On the topic of correct grammar, s/media is/media are/

</comment></comment><comment><USER13> I'm all for descriptivist language, but there's a difference between a new word or meaning coming around because people widely use it, and a common error that does not become right just because it became too common.

It's a difference in perception. I'd argue that even with a descriptivist language, you need three things to produce new words or meanings: widespread usage, widespread understanding, and a perception of correctness (or at least the absence of perception of incorrectness). "literally" has only one of those. That's the same reason that "their" doesn't grow new meanings for "they are" and "a location distinct from 'here'": that error is widespread, and mostly understood in context, but nigh-universally perceived as incorrect.

<comment><USER14> > I'm all for descriptivist language, but there's a difference between a new > word or meaning coming around because people widely use it, and a common > error that does not become right just because it became too common.

There isn't. At least not in any objectively recognisable way. You (and I mean you specifically) can obviously look at a new use and say "this is a new meaning" or "no, this is an error", but that's a subjective judgement and others would think otherwise. It is as impossible as being given a copy of a movie and being asked, by only inspecting the movie, to tell if this was copied from a legal DVD or downloaded from a torrent.

Just look at the verb "to troll (on an internet forum)". It comes from the practise of trolling in fishing, where you tie a bait to a cord and drive your boat around, drawing the bait through the water and waiting for some fish to take it. A lot of people, however, connect it with the race Troll, thinking of it as the practise of a big, nasty creature coming out from under and bothering people. That's not helped by calling the people who do it "trolls". Was the original, fishing term wrong? Was the person who coined the name Troll for a race of fantasy creatures wrong? Were the people who connected trolling with Trolls and subsequently called trolls "trolls" wrong? For bonus points: if two words are written the same and pronounced the same, can they be different words, or are all their meanings different meanings of the same word?

<comment><USER13> > You (and I mean you specifically) can obviously look at a new use and say > "this is a new meaning" or "no, this is an error", but that's a subjective > judgement and others would think otherwise.

Hence me talking about "widespread". If the consensus of the vast majority of people says that a usage is incorrect, then a helpful dictionary should properly document that that usage will be perceived as incorrect. Writing "there" when you mean "their" or "they're" usually produces a sentence that can be understood in context (our language parsers are remarkably resilient), but will make the writer look like they either don't know or don't care, and will create a strong negative impression in those who read it.

Dictionaries should document widespread usages, even incorrect ones. Dictionaries often attach information to meanings like "archaic" or "frequently misused as" or "frequently confused with".

For example, a dictionary can and should add a note to "their" saying "frequently confused with they're and there". There's absolutely nothing wrong with that. But as long as the vast majority of people consider sentences like "there sentence structure needed some work" incorrect, a dictionary should not claim that "there" is a possessive pronoun without attaching the caveat that anyone reading it will consider it incorrect.

(This response applies to several replies.)

</comment></comment></comment><comment><USER15> I've always thought the misuse of "beg the question", if not actively fought and corrected, would be precedent for all manner of linguistic perversions. Just this week I saw it misused in the New York Times by a quoted scientist. This case of "literally" is just us reaping what we sew for not towing the line.

[http://begthequestion.info/](http://begthequestion.info/)

<comment><USER16> The thing is, "beg the question" as it is used in everyday language is much more transparent and easier to understand than its 'proper' usage.

If you want to describe that specific fallacy in some way, there's a lovely phrase for that which already exists, describes the fallacy better, and uses fewer words - "petitio principii".

"Beg the question" used in this sense strikes me as redundant, inaccurate as a translation and a description, clunky, and pointlessly confusing. I hope its misuse is not actively fought, and that people who wish to describe the fallacy find a better way of doing so.

<comment><USER17> > The thing is, "beg the question" as it is used in everyday language is much > more transparent and easier to understand than its 'proper' usage.

Even better, it is _impossible to confuse_ with the "proper" usage (because it is distinct syntactically) _and_ makes the "proper" usage more transparent and easier to understand.

The everyday form is transitive, its always " _< foo>_ raises the question _< bar>_" and means "Accepting _< foo>_ creates the need for a resolution of the issue _< bar>_".

The "proper" form is intransitive, its always simply " _< foo>_ raises the question", meaning " _< foo>_ invokes the _petitio principii_ fallacy". This can be rephrased, however, as " _< foo>_ creates the need for a resolution of the issue _< bar>_" where _< bar>_ is the proposition argument _< foo>_ was offered to justify, as it is stating that the argument depends on the conclusion it was offered to support.

</comment></comment></comment><comment><USER18> I don't have a problem with dictionaries documenting this travesty of language; their makers are merely doing their jobs. I am, however, angrily resentful of the fact that ignorant and barely literate people, often obnoxious simpletons hauled before TV cameras to share their ignorance with the nation, are able to dumb down the language by blurring and fuzzing the definitions of words in common usage.

A related pet peeve is the ghastly aberration of saying "I could care less" to express the exact opposite. Is there some kind of sneaking Orwellism going on, where black becomes white and good is evil? Is it to do with the fact that TV has replaced the written word, and the Internet lets the illiterate publish to vast audiences without the benefit of a competent editor?

I am (literally) literally enraged about this.

</comment><comment><USER19> The story and much of the commentary I've seen on it seems misplaced because of a conflation of the descriptive vs. prescriptive nature of dictionaries.

The addition of this "figuratively" meaning to "literally" doesn't represent and endorsement of it. The dictionary is being descriptive of what is out there.

At the same time the statement "it's okay to use literally to mean figuratively" seems to indicate that the author sees the dictionary as being prescriptive; that its appearance in the dictionary, ipso facto, "legitimizes" it.

The bottom line is: you still sound like an idiot using it in that way. Its description in the dictionary is not prescriptive of its usage.

</comment><comment><USER17> There is a problem with this definition, but its not the usual one that people complain about ("its the opposite of the 'real' meaning").

The figurative meaning of "literally" _isn 't_ "figuratively", its an _intensifier_ for a situation in which the fact that the usage of the modified word is figurative is already clear from context.

</comment><comment><USER20> "really" is no different. "this is really shit" and "this is literally shit" aren't far apart in the base words but people will judge the second far more harshly than the first. neither of them actually mean "figuratively", they are used to add emphasis like "very"

</comment><comment><USER21> This reminds me of how Arabic is commonly described as "a language in which every word has its own meaning and exactly the opposite, and a third meaning of some kind of camel".

</comment><comment><USER22> I know language changes with time, but I can't help but feel a little saddened by this, as if an unruly mob had overrun the academy.

</comment><comment><USER23> This is plain silly. When people say "literally", they don't intend to say "figuratively". They literally intend to say literally.

It's one thing to define a word, another thing to re-define a word to correct the speaker's intentions. Unless the definition includes a /sarc tag, then it's totally cool.

</comment><comment><USER24> Flammable equals Inflammable? What a country!

</comment><comment><USER25> Dictionaries also contain the words "ain't", "widdershins", "gallimaufry", and "cunt". Just because words exist or just because they have one possible meaning doesn't mean that suddenly you are forced to use them or ignore instances where language is used in a way you dislike. Go ahead and call people out on uses of the word "literally" in a figurative sense, there's nothing stopping you whether that usage is recorded in a dictionary or not.

<comment><USER26> On the other hand, calling out a popular usage and giving the reason that it's "wrong" (rather than something you dislike on purely arbitrary grounds), is almost always baseless intellectual snobbery.

</comment></comment><comment><USER12> I popularized this issue a few years ago:

[http://arachnoid.com/wrong/#Dictionary](http://arachnoid.com/wrong/#Dictionary)

Now it's suddenly "big news".</comment>