Moving from TypeScript to Rust / WebAssembly - <AUTHOR> https://nicolodavis.com/blog/typescript-to-rust/ <comment><USER2> Whenever I write Rust, I have a lot of fun, but I'm still not sold on it for most web dev.

The analogy that comes to mind is that Rust is a really nice sports car with a great engine. It handles like a dream and you can feel the powerful engine humming while driving it. With the right open road, it's a great time. You can really optimize code, make great abstractions and work with data easily.

Unfortunately, web dev generally isn't a wide open road. It's a lot of little turns and alleys and special cases. Driving Rust in web dev is a lot of accelerating only to screech to a halt. I wrote a backend API for a side project in Rust. And true to what I said, Rust handled like a dream. But I didn't need the power. I spent most of my time screeching to a halt worrying about the plumbing between the various immature Rust libraries. And that's on the backend, which is way more mature compared to the frontend Rust libraries.

Judging by this post, OP managed to find a great open road in web dev to use Rust. I only wish I could find one as worthwhile.

<comment><USER3> This really nails why languages like PHP and Ruby have won out over static typed, compiled ones for application level web development. The web is a massive collection of disjointed, loosely coupled APIs that all (just barely) interoperate to provide a massive array of functionality. Languages that tend to work well with it are those that are highly flexible around the corner cases of these technologies, and allow you to quickly iterate through the process of gluing them together.

<comment><USER4> Won ? Ruby fell off a cliff once it got to a point where people had to maintain that shit in production - I'm currently working on a large mature RoR codebase and I'm switching jobs ASAP because it's incredibly painful to work with and feels like a dead end career wise - and I like the gig otherwise - good product and a decent team - but the technology is draining so much of my life energy on nonsense it's ridiculous. And the language is built for unmaintainability - standard functions being abbreviated to a single letter, 2 or 3 aliases for a single standard function (map/collect and such), Rails overriding the conventions of the language (! postfix). And then there's the architectural retardation of fat models, fat controllers and using mixins ("concerns") completely break encapsulation - all actively killing code reuse-

PHP has long been a meme and is mostly legacy stuff or bottom tier work.

Dynamic languages are adding static optional static typing because the value provided by tooling as the projects scales is undeniable.

It took ES6/TypeScript to drag JS out of the dump that it was with every library adding its own take on a class system - the maintainability jump from ES5 to TS is incomparable for anything larger than 1k LOC

<comment><USER5> I say this a lot, but if you are this irritated by Rails, then you ought to see the 20+ year old legacy C/C++ some of us get to work with ;)

<comment><USER6> This is one nice thing about working at Google. We have C++ codebases that are 20 years old, but you'd never be able to tell because they are still continuously worked on and even if not there's a team of people at Google who constantly run company-wide refactorings and the like to modernize things.

<comment><USER7> This is, IMO, one of the most underrated aspects of the monorepo, that has such a valuable impact over time.

It only takes a handful of extremely passionate engineers (and I really mean a handful, like less that 2% of engineers in an org) to raise the quality-floor of the _entire_ codebase.

<comment><USER8> For sanity, sustainability and fairness I would rather that read

It only takes a handful of extremely passionate engineers > It only takes a handful of paid engineers, full time assigned to the task

<comment><USER7> Anecdotally (I don't work at Google, and this might not apply there because it's such a _large_ company): At the monorepo companies I've worked at, of the 2% passionate I mentioned, maybe half have naturally gravitated towards working FT on the infra teams, the other half make very occasional but astronomical contributions, while working full-time on an actual product.

What I mean to say is that with a monorepo, you leave the door open to essentially passion-driven contributions made by the other half of that 2%. In non-monorepo environments, the barrier to uniform adoption is too high for someone that _isn 't_ full-time assigned to the task to justify.

Some people are genuinely passionate about this stuff, and _want_ to take on the task of migrating the entire code base, because it's a fun challenge and it'll improve their day-to-day work every day for the remainder of their employment. They're very rare, but they do exist, and with a monorepo those people are better-equipped to drag the company forward.

<comment><USER8> I don't get this - changing the _code_ is not the problem - this is a political / marketing issue.

I have some news - passion is not enough, and there are more than 2% of people working on things they are passionate about - it only 2% get lucky.

I can think of a few instances in my recent career at large monorepo company where I have built something on the scale of "passionate, could improve our working lives"

One died because ... well I gave up, two are used locally by my team and those I could persuade, whilst other solutions built by others for the same fix have gone on to be blessed officially, (ie replaced by grassroots competition) and one was replaced by a fully mandated and funded project that spotted the need and just steamrollered over all the local fixes.

One is still outstanding and I think well worth pushing still.

But I don't dream of the big win where suddenly the Board says "why, without your glasses Miss Moneypenny you look ravishing".

I get paid, I work, and I try and make the world a bit better where I can. I am passionate about it. But i don't write blog posts about how passionate I am.

Maybe I should :-)

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> > webassembly is faster than javascript

Everyone says this, but I would dispute it as misleading in a lot of cases. I've been experimenting a lot with wasm lately. Yes, it is faster than javascript, but not by all that much.

It's the speed of generic 32 bit C. It leaves a lot to be desired in the way of performance. My crypto library, when compiled to web assembly, is maybe 2-3x the speed of the equivalent javascript code. Keep in mind this library is doing integer arithmetic, and fast integer arithmetic does not explicitly exist in javascript -- JS is at a _huge_ disadvantage here and is still producing comparable numbers to WASM.

This same library is maybe 15 or 16 times faster than JS when compiled natively, as it is able to utilize 128 bit arithmetic, SIMD, inline asm, and so on.

Maybe once WASM implementations are optimized more the situation will be different, but I am completely unimpressed with the speed of WASM at the moment.

<comment><USER10> I also have a WASM crypto library, focused on hashing algorithms: [https://www.npmjs.com/package/hash- wasm#benchmark](https://www.npmjs.com/package/hash-wasm#benchmark)

I was able to archive 10x-60x speedups compared to the performance of most popular JS-only implementations.

You can make your own measurements here: [https://csb-9b6mf.daninet.now.sh/](https://csb-9b6mf.daninet.now.sh/)

<comment><USER9> Yeah, hashing in WASM seems to be fine in terms of speed, though 60x faster does still sound surprising to me. Hashes with 32 bit words (e.g. sha256) can be optimized fairly well in javascript due to the SMI optimization in engines like v8. I should play around with hashing more.

I was in particular benchmarking ECC, which is much harder to optimize in JS (and in general).

Code is here:

JS: [https://github.com/bcoin- org/bcrypto/tree/master/lib/js](https://github.com/bcoin- org/bcrypto/tree/master/lib/js)

C: [https://github.com/bcoin-org/libtorsion](https://github.com/bcoin- org/libtorsion)

To benchmark:

        $ git clone https://github.com/bcoin-org/bcrypto
        $ cd bcrypto
        $ npm install
        $ node bench/ec.js -f 'secp256k1 verify' -B js

        $ git clone https://github.com/bcoin-org/libtorsion
        $ cd libtorsion
        $ cmake . && make
        $ ./torsion_bench
        $ make -f Makefile.wasi SDK=/path/to/wasi-sdk
        $ ./scripts/run-wasi.sh torsion_bench.wasm ecdsa

</comment></comment></comment><comment><USER11> Hi Nicolo,

Here are my two (or more) cents:

1 - Javascript is fast enough for your use case. No one will notice the difference in a board game website.

2 - AI should probably be implemented in python anyway. As ugly as python can be, you shouldn't fight the world; there are too many free advanced AI algo implementations in python out there.

3 - Regarding "Limitations of TypeScript" (strict typing / data validation / error handling): first of all arguable claims, but moreover, even if you think rust is better in these concerns, they are not important enough to justify reimplementation, disregarding away typescript's advantages and taking the risk involved in a new language and toolset. Yes, I can see the appeal as a programmer to learn new stuff, but seriously you should have much better reasons to rewrite existing code.

BTW, also, if I would think of a rewrite, I would have gone with scala or python, both are slower on the web, but seriously, it will not amount to anything meaningful in your use-case. Scala has better typing, and contextual abstraction is a killer feature for DSLs like game mechanics specification. Python is the lingua franca of AI, and pypy has greenlets [1]! Which is much cooler than people seem to realize. Specifically, it should allow writing immutable redux-like command pattern operations, as regular code, without the weird switches everywhere.

BTW2, I've contributed to boardgame.io, please consider staying with open source. We can build something like boardgame-lab together.

[1] [https://greenlet.readthedocs.io/en/latest/](https://greenlet.readthedocs.io/en/latest/)

<comment><AUTHOR> Hey Amit, good to hear from you!

> Javascript is fast enough for your use case. No one will notice the > difference in a board game website.

No, actually. Have you seen how long boardgame.io's MCTS bot takes to make a Tic-Tac-Toe move? Not the end of the world, but certainly in need of improvement.

<comment><USER11> Yes, but AI search algorithms like MCTS are slow in general. Even with C, it will be very slow when you want the AI to be smart and consider many actions. IMO, you should train using python libs like [1] and move it to the browser with something like [2] OR run AI in the server. YES definitely writing an AI lib for the browser is a great goal, and as a programmer, it is super interesting. Still, it is tough, and time-to-market is much more crucial, as the entire codebase will change once it will interact with actual people.

[1] [https://github.com/datamllab/rlcard](https://github.com/datamllab/rlcard)

[2] [https://onnx.ai/](https://onnx.ai/)

<comment><USER12> Other than solved games like tic-tac-toe, game-playing bots can always use more performance because if you can search more efficiently, your bot gets smarter. Sometimes supposedly more sophisticated algorithms end up making things worse because they slow down the search.

It's an unusual area where functionality (what answer you get) and performance can't be separated. This is still true on the server.

<comment><USER11> To be clear, I'm not talking about the server implementation only about implementation on the browser.

And of course, Rust and C are faster than javascript, and it will be noticeable on search algorithms, but IMO, it will not cause user loss. It is smarter to get to the stage you have those users as fast as you can to validate this need.

So I would not go into implementing new AI libs in rust as part of a turn- based game engine just for the performance gain--mainly because it is a tougher project than building a turn-based game engine!

I would search for existing, viable solutions. As I said before, this includes server AI and server trained models running on something like tensorflow.js. Additionally, I will also try to research browser libs that may use compiled webassembly and webGL. In any case, I think it's not wise to build your own for this purpose.

</comment></comment></comment></comment></comment><comment><USER13> _[TypeScript] does not actually ensure that the data you are manipulating corresponds to the type that you have declared to represent it. For example, the data might contain additional fields or even incorrect values for declared types._

This is only a problem if you are mixing untyped code with typed code, isn't it? Like when you are parsing JSON, you need to do typechecking right then, rather than just using an "any" type. The only other situation I have run into this in practice with TypeScript is when I'm using a library that has slightly misdefined types.

<comment><USER14> > This is only a problem if you are mixing untyped code with typed code, isn't > it?

I find it a bit strange that people talk about this as "only a problem", as though it was some weird niche edge case and not an ever-present issue. The written-in-plain-JS ecosystem completely dwarfs the written-in-TypeScript one; unless you're doing something rather trivial you're quite likely to end up depending on a library that barely had the shape of its objects in mind during development, with typings (if they're even present) that were contributed by someone that's almost definitely not the actual library author.

Of course, if you're competent enough you can correct typings and always remember to run runtime checks on data that doesn't come from you and so on. But it's too easy for a beginner to fall into traps like mishandling data that comes from a dependency (especially when it's buggy/ostensibly has typings) - in my opinion, there should be a first-party compiler/linter option to enforce checks on any `any`.

<comment><USER13> You don't have to depend on badly-written untyped third-party libraries, just because there are a lot of them out there. Many projects and companies will avoid doing so. This is especially reasonable if your comparison is switching to a language like Rust; there are probably fewer third-party libraries available in Rust overall than there are libraries with accurate TypeScript definitions available.

<comment><USER14> "Badly-written" is of course subjective, but as for untyped/loosely typed I think it's a bit difficult to claim that people are avoiding using them when (for example) the typings for an obviously popular library like Express are chock-full of `any` types[0]. Including several (like request bodies) that should instead be `unknown`. I'm sorry but it's rather naïve to expect a beginner to TypeScript, especially one that's coming from JS, to not trip up at all using typings like that and a compiler/language spec that implicitly casts things declared as `any`.

0\. [https://github.com/DefinitelyTyped/DefinitelyTyped/blob/mast...](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express- serve-static-core/index.d.ts)

</comment></comment></comment></comment><comment><USER15> I don't know Rust and haven't done JavaScript for years but isn't JavaScript a bit more of a higher level language, which would make a developer more productive?

Rust being closer to the hardware should require more code, and effort, to accomplish the same task.

<comment><USER16> > isn't JavaScript a bit more of a higher level language

Rust has zero-cost abstractions that feel like using Ruby and a rich type system that makes it incredibly expressive. Working in other languages feels like going back to assembly.

I wouldn't want to design state machines in any other language. Rust's enums make it feel smooth as butter. They're a killer app. (The whole ecosystem is. Cargo. Package naming. Traits. So much good stuff.)

Rust is my most productive language now, and I work in Python, Java, and Typescript codebases frequently.

Edit: I'm being downvoted for expressing preference? What's with all the Rust hate? Learn it instead of being a hater. It's a wonderful tool, and it's silly to dismiss because you think people are being hipsters or something. There's a reason people love it.

<comment><USER17> I think a lot of the best the best things in Rust don't really have anything to do with low level programming per-se. And I find that for most applications, even with all of the extra goodness, the lack of a GC totally craters productivity. Its not because I'm fighting the borrow checker -- I got the hang of it pretty quick. But it means that every API is complicated by the need to think about lifetimes and ownership, having to think about different types of smart pointer, etc. It means you have to manage all of these silly little details which for most applications are pretty irrelevant.

This isn't a criticism of Rust; it's specifically designed for applications where those things _do_ matter. But for the overwhelming majority of apps they don't, and I'd reach for a different tool.

I've found that once I get into a rhythm and I've been working on something in Rust for a bit, it doesn't feel that hard to deal with all that. And a few times I've thought to myself "hey maybe the GC isn't actually buying you all that much?" But then I go back to a GC'd language and watch just how much faster stuff gets done. It's not even close. I think it's one of these things where your brain doesn't notice the time that goes by when you're doing what is essentially mindless busywork.

Part of this is also having come from doing a fair bit of stuff in Haskell, Elm, and a bit of OCaml; the best "high-level" language features are inspired by that language family (including enums) and so it feels like a better control for the difference a GC makes vs. js and friends. It makes a big difference.

<comment><USER18> What's puzzling is why a language designed for memory safety and low-level control and performance is even being considered for web development where they had the former all along and they generally don't care about the latter. Or if they do they use Java, Go or throw a couple dozen more servers at the problem.

<comment><USER19> With Java you only need to throw more RAM at the server. The performance is perfectly acceptable compared to something like Python or Ruby. You can always squeeze out more performance with Rust but the primary benefit is the lack of a GC.

<comment><USER20> I don't understand your last sentence. What benefits does lack of a GC have other than more performance?

</comment></comment></comment></comment></comment></comment><comment><USER21> Alon Zakai[1] gave a good talk[2] on the current state of WebAssembly, particularly on the current state of performance

1\. [https://twitter.com/kripken](https://twitter.com/kripken)

2\. [https://youtu.be/4ZMY3QE5t9o](https://youtu.be/4ZMY3QE5t9o)

<comment><USER22> I'm not certain exactly how LLVM works so I am not sure this is the right question to ask but - How does Web Assembly relate/compare to LLVM? Does LLVM solve the problem of a single binary that can be run portably?

<comment><USER21> There are not comparable afaik. WASM is also more ambitious, along with WASI (system interface) creating a portable final executable (compare to JVM), whereas LLVM is only a set of intermediate language and tools.

When this transition period goes away, LLVM should hopefully compile to WASM binary as a target. The current path described in the video of WASM -> C -> clang -> llvm -> native-binary is a temporary workaround afaik.

<comment><USER23> WASM isn't "more ambitious". It is a spec for portable bytecode, nothing more, nothing less.

LLVM is one of the best toolchains for many languages.

They are completely different things.

<comment><USER21> Yes, I agree. Wording wasn't right. What I meant was that it is trying to define a universal target with runtime system interface and such. The only reason I drew a comparison was that both are trying to bring standardization, but in different contexts.

</comment></comment></comment></comment></comment><comment><USER24> I spent the last 2 years making an online adaptation of a board game. I chose Typescript mainly because I was comfortable enough in this language and I don't regret this choice.

Typescript is, for me, the right balance between the strictness required to manage a mid-size codebase, and the looseness necessary to be productive (I definitely don't want to manage low-level things like memory when coding the gameplay of the board game).

On top of that, if your project is open-source, using JS/TS makes it more likely that someone can contribute to the project, compared to Rust, which has a higher learning curve.

Being able to easily share code between the client and the server is a big bonus too. The article points that with WebAssembly, it's possible to do it with any language, but I'm not sure it's stable enough to be used yet.

I'm thinking of making a library similar to boardgame.io (because I think there are some parts that could be done better), and I'll most probably keep Typescript for it.

Curious to see how using Rust for this will play out!

</comment><comment><USER25> Keep in mind that WebAssembly is not a silver bullet for performance, and carefully crafted JS application (written in engine-friendly way) will perform roughly the same or even better than its WA equivalent. I've rewritten chunk of my math-intensive app in AssemblyScript half a year ago - it took me about a month to fight through all the compiler bugs, I used every optimization possible (used floats everywhere, disabled array boundary checks, disabled GC for 70% of classes) and still end up with a binary that is 30% slower than the original JS code. It was mostly AssemblyScript's GC, which was extremely slow (and probably still is), and with GC completely disabled (which is an unfair advantage for WA) performance was almost the same.

<comment><USER26> That's pretty interesting. Could you share you project?

There are benchmark which compare JavaScript and AssemblyScript: [https://github.com/nischayv/as-benchmarks](https://github.com/nischayv/as- benchmarks) [https://github.com/nischayv/as- benchmarks/issues/3#issuecomm...](https://github.com/nischayv/as- benchmarks/issues/3#issuecomment-623159721)

<comment> benjamin-lee I'm not the OP but I can confirm in my own project, we found about a 10x performance gap between AssemblyScript and TypeScript. In essence, we're working on a rewrite of DNAVisualization.org[1][2], a serverless web tool for the interactive inspection of raw DNA sequences. We hoped that WASM would give us a performance boost but have been generally disappointed with both the performance and the amount of complexity involved in getting the tooling to work.

We did do a benchmark[3] and, unless we made an error (likely, given that all of us are new to WASM), found that JS was much faster for our simple algorithms. WASM had the approximate performance of our original pure Python implementation[4], so not great.

[1]: [https://dnavisualization.org](https://dnavisualization.org) [2]: [https://academic.oup.com/nar/article/47/W1/W20/5512090](https://academic.oup.com/nar/article/47/W1/W20/5512090) [3]: [https://github.com/Lab41/dnaviz/tree/benchmarks/benchmarks/a...](https://github.com/Lab41/dnaviz/tree/benchmarks/benchmarks/a..). [4]: [https://github.com/Lab41/squiggle](https://github.com/Lab41/squiggle)

<comment><USER26> I made PR which suggest some changes and fixes: [https://github.com/Lab41/dnaviz/pull/21](https://github.com/Lab41/dnaviz/pull/21)

<comment><USER26> As you can see AssemblyScript approx 4x-4.5x times faster now

</comment></comment></comment></comment></comment><comment><USER27> > Webassembly Is Faster Than Javascript

Just curious, how's the OP measuring this? Also, would be very interested in the stack - is OP using Yew/Seed/etc or server rendered pages with Rust?

<comment><AUTHOR> I'm just using an SPA written in Svelte on the frontend. I only use Rust for the game state updates.

About measurements, I just whipped up a quick benchmark comparing the JavaScript state updates with the WASM version. You do pay a cost crossing the JS / WASM boundary, but the WASM version is faster overall for my application. I'm not particularly concerned with performance at the moment (it was just a nice to have).

</comment></comment><comment><USER28> One thing articles like this always miss, and what I'm most keen on, is how exactly the bridging works. Is there a standard Rust wasm crate that exposes the DOM? Do you pass some struct with function pointers? Is the Rust code exposed as a black box with no connection to the outside world and you just call a few entrypoint functions? Can you call Rust from JS and JS from Rust? If you go JS->Rust->JS->Rust->JS and the innermost JS function throws an exception, is all that properly propagated up the stack?

<comment><USER29> There are two low-level bridges: js-sys provides bindings to all the ECMAScript stuff, and web-sys provides bindings to all of the rest of a browser environment, including the DOM.

> Can you call Rust from JS and JS from Rust?

Yes.

I personally have written some JS code that returns a promise, wrapped in wasm that turned it into a Rust Future, then converted that Future into a promise that I've returned to Javascript.

> If you go JS->Rust->JS->Rust->JS and the innermost JS function throws an > exception, is all that properly propagated up the stack?

Sort of. Rust doesn't use exceptions, but the binding converts a JavaScript exception to a Rust "result" type and vice versa at the boundary, so if you propogate it, it will get properly propagated.

</comment></comment><comment><USER30> I will only nitpick on the part about TypeScript not being type-safe enough, where extra fields are possible or wrong types can be sent over the wire.

io-ts [0] completely solves this issue, to the point where I don't think it's less type-safe than Rust in any practical manner. I've been writing apps in TS this way for the past year and I have quite a large codebase in production. The errors you mention do not happen.

[0] - [https://github.com/gcanti/io-ts](https://github.com/gcanti/io-ts)

<comment><USER31> I love things like this, but at the same time when I look at the API this library provides, it's not junior-friendly.

Even though I acknowledge it solves some problems I'd like to solve, if I put code using this library infront of a junior developer, they'd be paralaysed, and at best, if they weren't, write code with it that another junior wouldn't understand. That makes it difficult for me to justify introducing it.

<comment><USER30> I agree in principle, though in this particular case io-ts does not tend to produce incomprehensible code. Maybe if juniors use it, it would, but it's easy to encapsulate the IO codecs in their own modules where the functional style of io-ts/fp-ts does not leak out to other parts of the code and only types can get reused.

</comment></comment></comment><comment><USER32> In general, I think the significant improvement in Speed in case of WebAssembly binaries will be largely due to SIMD support. But performance gap between JS and WebAssembly is not at all deciding factor unless you are creating a high quality Games. There are lot of online games with low to medium graphics quality created using 2D canvas or 2D/3D WebGL libraries which run just fine on modern web browsers.

Most developers, at least in my experience see just plain Array and JSON. If they get themselves familiar with API like WeakRef (WeakSet/WeakMap), ArrayBuffer along with DataView and Various Typed Arrays (Int8, Int16, Int32, Uint8,Uint16,Uint32, Uint8Clamped and likewise for Float and BigInt) they can write Garbage heap friendly and more computation focused code.

Besides that, strictly speaking for standard web application development, JS ecosystem of libraries and frameworks are miles ahead for handling various kinds of UX/UI journey scenarios. Developer tools in the browser to do various kinds of performance inspection and profiling of the JS code.

I wonder why JS engines (like V8 for example) rely highly on Scalar instructions ? There is lot of scope to apply auto-vectorization and generate SSE, AVX, NEON (for ARM) instructions. If they implement this or at least provide some API like SIMD.js (one they abandoned in the past), it will make WebAssembly close to redundant unless you hate JS or other PLs which transpiles to JS.

</comment><comment><USER33> Rust is extremely poor for web apps and graphical interactive software in general. Having been using Beads (a competitor to typescript) for the last few months, i couldn't possibly build my food ordering app quickly in Rust. There are hundreds of art assets to manage, and every screen has to automatically re-flow depending on the resolution of the device. Without a concept of DPI and the ability to measure text, and have a layout system, all of which is built into the Beads language, it would require a very tedious programming effort. Most of the time coding a graphical interactive product is making it look nice on all the different sized screens; Rust does nothing for this very time consuming task.

Typescript may force you to use the awful CSS, but having some layout system is better than none. And we could also talk about event management, and sync between client and server, none of which Rust is particularly good at.

</comment><comment><USER34> As someone who has (mostly) enjoyed working with Python and JS (CoffeeScript in the past, and ES6+ and TypeScript more recently), and also dabbled in Ruby/Rails, I've been intrigued by Rust for a while. Its promise of being close in speed to C/C++, but safer and more ergonomic, sounds great. I have not attempted to build anything with it yet, but I've looked at what (I think) is enough examples to be familiar with its constructs, and have seen some benchmarks.

For systems software or libraries that are meant to be hooked into from, say, a JS/TypeScript environment (see [https://deno.land](https://deno.land), a promising alternative to Node), it seems like Rust has a lot of potential.

But for building applications (which is what I'm focused on currently) it seems Rust has a "No OOP for you!" attitude that gets in the way of modeling your application domain quickly. Yes, you can use impl and trait as an alternative to classes. But it seems like you have to jump through a lot of hoops; define your structs, define a trait for default behavior and remember that &self is provided as an implicit first argument to the methods (this is similarly cumbersome in Python), then define an impl for each corresponding struct (don't forget about &self!). As opposed to just declaring a base class and overriding when you need to in the subclasses. I am definitely not saying classes are the only way to do OOP, but at least give developers the option of using them.

I have found Swift attractive for application development because it gives you structs for one-off (value-based) data types, classes when you need an easy way to do inheritance and polymorphism (and/or need reference-based data types), and extensions as a more abstract way to enhance structs and/or classes (and/or enums). It doesn't force you to use classes (and the community appears to think protocols are a better construct), but the language remains approachable, and you can always start with classes then refactor to protocols when the need arises.

<comment><USER35> Is Vapor the rails-like go to web framework for Swift? Is it viable for indie hackers, or is it more like Java geared towards the enterprise? I find Swift interesting as a language because it seems that it's well balanced, usable for low level systems programming and higher level applications. But protocol first kinda indicates big design up front, something more geared towards enterprise usecases..

<comment><USER34> I don't have any statistics, but based on the amount of learning articles, books, etc. out there it seems like Vapor is the dominant Swift Web framework. Kitura looked promising, but IBM has stopped supporting it, so its future is not clear (the last commit to the main branch was in November 2019). Also, the two main Vapor devs are members of the Swift Server Work Group (with the other two being from Apple): [https://swift.org/server/](https://swift.org/server/)

I'm not sure how to answer your question regarding whether Vapor is viable for indie hackers, because I've only been skimming the docs and looking at small examples. But it seems to draw a lot of inspiration from Express.js and/or Ruby's Sinatra library. It doesn't seem to have the up-front complexity of something like Java's Spring Framework, although I understand you can use services and dependency injection if needed. So my first impression is it's easy to get started, but it enables you to refactor to something more complex if your application demands it.

<comment><USER35> Thanks for your answer. So Vapor for building APIs, not web monoliths, good to know. It kinda makes sense considering that most of the users will use mobile apps on the client side.

Personally I also find Elixir and the Phoenix framework very interesting.

<comment><USER34> No problem! Vapor does have its own template system if you don't want to build "just" an API: [https://github.com/vapor/leaf](https://github.com/vapor/leaf)

I have also looked at Elixir and Phoenix, but have not written any code in them. I have yet to really dive into anything outside the C-like languages (Python, JS, Java, Swift, Ruby, C, C++), and Elixir seems like a good reason to venture outside my comfort zone.

By the way, no pressure, but if you ever want to discuss Swift, maybe do some paired programming/studying, let me know. I'm still fairly new but I have experimented with building a Swift-to-CSS DSL that I would like to eventually spend more time on. If you want to email me, ragheed.almidani is the name, and protonmail.com is the domain.

</comment></comment></comment></comment></comment><comment><USER36> > For example, the data might contain additional fields or even incorrect > values for declared types.

I understand 'incorrect values' (this is true, see [https://github.com/Microsoft/TypeScript/issues/15480](https://github.com/Microsoft/TypeScript/issues/15480)) .

But TypeScript definitely doesn't like adding additional fields. Right now I'm working on TypeScript, added the new Fastify raw body plugin, and forgot to extend our custom Request type. The error is:

      Property 'rawBody' does not exist on type 'CustomRequest<DefaultQuery, DefaultParams, DefaultHeaders, any>'.ts(2339)

Ie, we can't just add a field.

Appreciate I may be wrong, or we have different definitions here, but I'd like to discuss.

<comment><AUTHOR> Something like this is valid TypeScript I think?

      interface MyType {
          a: number;
      }

      function process(value: MyType) {
          console.log(value);
      }

      const value = { a: 1, b: 2 };

      process(value);

</comment></comment><comment><USER37> > However, it [Typescript] does not actually ensure that the data you are > manipulating corresponds to the type that you have declared to represent it. > For example, the data might contain additional fields or even incorrect > values for declared types.

This made me curious, as it sounds like something that can be added as a transpiler option under tsconfig.json. But it turns out Typescript doesn't already have a support for "nominal" type, but there are some tricks one can leverage to achieve similar thing:

[https://medium.com/better-programming/nominal-typescript- eee...](https://medium.com/better-programming/nominal-typescript-eee36e9432d2)

</comment><comment><USER38> Does anyone know the progress on exposing browser APIs (and hopefully real JS objects) to WASM directly? I think its use-cases will remain pretty narrow until then, but I haven't heard much noise about those developments lately.

</comment><comment><USER39> I replaced Node.js with Rust ages ago.

It was a brutal learning curve but having the compiler cover everything I do is a massive advantage that never stops paying dividends.

</comment><comment><USER40> I am actually converting a work project from TypeScript to Swift as it makes the writing of code more fun and then just leverage either for the backend application or as part of web application via WebAssembly. Main reason it's easy to share the code with different targets (win32, arm, WebAssembly, osx) so its highly reusable. And I like Swift more as a language compared to Rust

Really enjoying it so far.

</comment><comment><USER41> Completely off topic, but I'm a front end developer who dabbles with a range of languages and also enjoys trying out new languages, but I've never really used a 'back-end' language and I've been trying to find one that works for me. What do people recommend nowadays? (Only asking as I've seen people talking about Rails/PHP/Node, etc.).

</comment><comment><USER42> Rust's type safety and error handling are helpful tools to have in your belt when gluing together the pieces needed for a web api. I have been working on a new product at my day job that has needed to change a lot as we learn and grow and I am happy with how Rust has been reliable in the face of that change.

</comment><comment><USER43> Good idea.

TypeScript is too Java/C# for my taste. Rust feels more OCaml-ish.

It has more predictable performance than JavaScript and often it can be better.

If Rust gets a bit more ergonomic (via language or crates) it could be a good alternative and finally save us from the horrors of Electron/Slack/Bitbucket/etc.

</comment><comment><USER44> I would like to get started with Rust & Game Development. Any resources for that?

<comment><USER45> [https://arewegameyet.rs/](https://arewegameyet.rs/)

Rust is not really there yet for game development, in my opinion. Amethyst is probably the most advanced 3D engine at the moment, but they are having some issues with picking an ECS implementation, and it's still very young.

There are a few 2D engines, but they are also not particularly mature either. Coffee looks interesting, although I haven't tried it.

For something lower-level, there's gfx.rs (Amethyst uses this), which is quite impressive. gfx-hal is quite nice for abstracting over DirectX/Vulkan/OpenGL/Metal/etc.

</comment></comment><comment> asdf-asdf-asdf i'm glad it worked for the author, and i am sure you can achieve better performance with Rust than with NodeJS, but i'd like to discuss some of the mentioned advantages:

in general, typescript is optimized for cooperating with other javascript code, to make it easy to drop it into a javascript-based project, and also, it does not really have it's own "runtime". typescript is javascript plus types. in fact, if you want to convert from typescript to javascript, you can take a typescript-file, and just delete all the type-definitions and you get a working javascript file (there are some exceptions to this, but it generally is true). this approach has it's downsides of course, for example,when you need to interface with a javascript (not typescript) module, you can easily, but you have to know what types it expects and returns,otherwise you might get invalid structures in your code. there are things that can help you there ([https://github.com/DefinitelyTyped/DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped)), and it works quite well in practice, but there is no 100% guarantee that the types will be correct.

>> STRICT TYPING (in typescript) For example, the data might contain additional fields or even incorrect values for declared types.

\- typescript is structurally typed most of time, so if you have a function that needs an `{a:string, b:string}`, and you send it an `{a:string, b:string, c:string}`, it will accept it. it's a different trade off,sometimes better, sometimes worse, compared to nominal-typing ([https://en.wikipedia.org/wiki/Nominal_type_system](https://en.wikipedia.org/wiki/Nominal_type_system)).

\- the part "even incorrect values", it should not happen in your own code. as i wrote above, i can imagine it happening when interfacing with other non- typescript code.

>> DATA VALIDATION: You have to write data validation code to ensure that you're operating on correct data in TypeScript. You get this for free in Rust...

in typescript if you want to read,let's say JSON data,and map it to a typescript-structure, and return an error if it does not have the correct structure, you can use libraries like IO-TS ([https://github.com/gcanti/io- ts/blob/master/index.md](https://github.com/gcanti/io- ts/blob/master/index.md)) to make that happen. i do not know how you get this "for free" in Rust, i know there are libraries like Serde ([https://serde.rs/](https://serde.rs/)) that do it.

</comment><comment><USER46> The gist of this article applies to switching from JS/TS to Uno/Blazor as well as they both support WebAssembly just as well, and they both get robust UI frameworks as a bonus.

</comment><comment><USER47> @nicolodavis I would love to hear your thoughts and reasoning for not using go + wasm compile target? Not as a critique but to understand your point of view.

<comment><AUTHOR> No reason except that I've written Go in the past and wanted to learn a new language :)

Comparing the two languages, I would say that Rust's enums and pattern matching make it easier to work with for my specific use case.

</comment></comment><comment><USER48> I like Rust but I would much rather use Swift for something like that especially if SwiftUI like thing was part of the deal.

<comment><AUTHOR> Note that Rust is only used for the state updates. All the UI stuff is TypeScript (using Svelte).

</comment></comment><comment><USER49> > For example, the data might contain additional fields or even incorrect > values for declared types.

Can you give an example?

</comment><comment><USER50> I guess AssemblyScript would have been a better option, given it being a language subset for WebAssembly.

<comment><USER51> Except that doesn't address any of the other reasons they preferred Rust...

</comment></comment><comment><USER52> As long as you use a language with a good, static type system, I don't care so much what you use. TypeScript or Rust, for all I care you can transpile Haskell into JavaScript if you feel adventurous. But don't use a dynamically typed language as the source language for anything that is supposed to be more than a simple script.

<comment><USER53> > But don't use

This is just cargo-culting static typing: "If I avoid dynamic typing at all cost, the cargo crates will surely rain on down!"

You'll find that picking a language is more of a business decision than the sort of technical static-vs-dynamic checkbox test you might use to pick the language of your next weekendware.

This kind of absolutist rule of thumb is more flame bait than morsel of wisdom.

<comment><USER54> This is the fallacy of the grey. Yes, there are nuances and special circumstances, but the overwhelming majority of the time, static typing is simply better. That's one of a small handful of clear consensuses from the last 20-30 years of programming language evolution.

<comment><USER53> It's not any better if business trade-offs make another decision better. You don't have "all things equal" trade-offs in the real world.

Want an easy concrete example? You and your cofounder have 10 years of Ruby experience and investors/customers who want a product yesterday. Or the deliverable that makes most sense is a PHP script that users can drag into CPanel because that's your customer base.

The tinkerer inside you always wants to try new things and convince you that some greener tech on the other side of the fence are going to make the difference. It's usually just procrastination from the actual hard stuff: building things people want, today.

<comment><USER54> > Want an easy concrete example? You and your cofounder have 10 years of Ruby > experience and investors/customers who want a product yesterday. Or the > deliverable that makes most sense is a PHP script that users can drag into > CPanel because that's your customer base.

True but facile. Sure, for every imaginable technology, there is a conceivable scenario in which that technology is the right choice. Doesn't mean there's no such thing as a good or bad technology.

> The tinkerer inside you always wants to try new things and convince you that > some greener tech on the other side of the fence are going to make the > difference. It's usually just procrastination from the actual hard stuff: > building things people want, today.

That's actually an argument for being more absolutist about the technical side: you're unlikely to be in the obscure circumstances where a dynamic language would actually be helpful, and even more unlikely to have that be more important than your business decision. So rather than carefully considering your circumstances and weighing up the tradeoffs, it's better to follow the consensus for what's a good general-purpose language (which these days means a statically typed language) and get on with building your business.

</comment></comment></comment></comment></comment><comment><USER55> If you push Rust to client-side WASM, can it still perform DOM manipulations?

<comment><USER29> Yes. It has to call out to JS to do so. It's implemented in a way that's forwards-compatible so once wasm can do so natively, your code will just magically get faster.

<comment><AUTHOR> That's right. For my use-case I decided to just stick with JS for UI stuff (using Svelte). I call into Rust code like a black box to update some state.

</comment></comment></comment><comment><USER56> A little disappointed not to see [https://www.assemblyscript.org/](https://www.assemblyscript.org/) included in the discussion. Especially since it removes the "JavaScript is slower than WASM" argument.

<comment><USER57> I'm not quite sure what you mean here, because AssemblyScript compiles to WASM, not JS.

<comment><USER58> I guess the argument was that you can write in JS (well, something that is close to TypeScript which is close to JS anyway) and compile to WASM, therefore the speed argument becomes invalid.

</comment></comment></comment><comment><USER59> That is quite a move. Like moving from USSR to USA.

</comment><comment><USER60> No substantial arguments in the article. Hackernews used to be one of the rare places where quality is valued. How can such a low content and low quality article get so high on the HN frontpage?</comment>


Spring Cleaning Repos - Open Sourcing all my ROR Apps - <AUTHOR>

Hackers,
My OSS Ruby on Rails applications:
RecipeTrees - source (https://github.com/nazar/recipetrees), site (http://receiptree.com)
A recipe database but with a twist: users can fork recipes for alteration; all forks are tracked via an acyclic graph. Other features: nutritional value calculation and inclusion of recipes within recipes. Stopped coding in late 2011.
Parlmnt - source (https://github.com/nazar/parlmnt), site (http://parlmnt.com)
Parlmnt scrapes Legislation information from http://parliament.uk and presents it in a more debatable manner. Provides data via a JSON/XML api. This is mostly a Backbone.js application. Still coding but is in early alpha. Helpers welcome.
MediaCMS - source (https://github.com/nazar/MediaCMS), site (http://pantherfotos.com)
A commercial media library supporting: photo/video/audio uploads with background processing with large format support. E-commerce mechainsms available for media up-loaders (i.e. price per image size, audio sample rates etc). A large Rails project clocking in at about 17,000 LOC. Stopped in early 2010.
DarkFallSage - source (https://github.com/nazar/DarkFallSage), site (he's dead, Jim)
DarkFallSage is a WowMaps type website aimed at the DarkFall MMO. Features: custom Google Maps tiles that use the game world map to overlay loot/mob information; mob/loot database; support for clans public/private forums; skill trees; discussions on each game item/skill. Stopped coding in 2010.
Waster - aka TheLastBunker.com - source (https://github.com/nazar/wasters), site (she's dead, Jim)
Wasters was aimed at the Fallen Earth MMO. Wasters was developed to catalogue crafted items, not too dissimilar from the Bill of Materials shipping problem. I re-invented the wheel on this one by figuring out the Materialised Path pattern. Stopped coding in 2010.
Live long and prosper. <comment><USER2> Props for doing this. Old projects are often a goldmine for people getting into a given framework, or people working on a similar idea.

<comment><AUTHOR> >are often a goldmine

I pretty much use these as snippet sources whenever required.</comment></comment>


Show HN: Transcrypt Python to JavaScript compiler now has static typechecks - <AUTHOR> http://www.transcrypt.org?static_checks <comment><AUTHOR> Static typechecking makes use of Python 3.5 type hints in combination with the MyPy open source typechecker.</comment>


Ask HN: What are some good references for learning machine learning? - <AUTHOR> <comment><USER2> [https://hn.algolia.com/?query=learn%20machine%20learning&sor...](https://hn.algolia.com/?query=learn%20machine%20learning&sort=byDate&prefix&page=0&dateRange=all&type=story)

[https://hn.algolia.com/?query=curated%20machine%20learning&s...](https://hn.algolia.com/?query=curated%20machine%20learning&sort=byDate&prefix=false&page=0&dateRange=all&type=story)</comment>


Ask HN: What is your New Years 2014 tech resolution? - <AUTHOR>

Mine is to learn Haskell <comment><USER2> Find, make and sell something people want, almost certainly aided by technology. I hate how vague it is too :)

</comment><comment><USER3> To learn Org mode and use it on a daily basis.

<comment><AUTHOR> Wow Emacs really can do everything!

</comment></comment><comment><USER4> Learning Ruby on Rails!

</comment><comment><AUTHOR> and to help my dad clean up his ridiculous Rails 2 apps</comment>


Yo - <AUTHOR> http://techcrunch.com/2014/06/18/yo-yo/ <comment><USER2> > Without ever having officially launched, co-founder and CEO Or Arbel managed > to secure $1.2 million in funding from a list of unnamed investors, except > for co-founder, angel, and Mobli CEO Moshe Hogeg, who participated in the > round.

Stuff like that really gets me. I see tons of start-ups that would have a fighting chance given that sort of investment and then lame stuff like this gets funding. Of course they're entirely free to spend their money any way they want, but was there really no place to spend that better?

Congratulations to the Yo team for furthering the research to the origins of the term 'dumb money'.

I guess if you timed it right you could use Yo to communicate in Morse, but that seems to be a waste of bits considering that each packet will activate a very large number of bits being sent where one would suffice.

<comment><USER3> I'm suspicious of the "unnamed investors". Has anyone done any fact finding, I'm betting these guys are just looking for PR, and saying they got 1.2m for a "Yo" app is a pretty good way to do it.

<comment><USER4> >>"unnamed investors" It's totally possible that these are legitimate, respectable investors, investing on information we aren't aware of. It's also possible (and more likely, in my opinion) that the unnamed investors are a relative of a founder, who invested in this to give them runway to do something else, or to potentially spur interest from other investors or acquirers.

</comment></comment></comment><comment><USER5> I just...what? I don't understand.

It's basically begging for you to switch apps after you get the "Yo" push notification. I can't really imagine a conversation which goes like this:

Me: Yo

Them: Yo

Me: Yo

Them: Yo

...

What I can imagine is getting a Yo from someone, switching apps, and being like "what's up? [p.s. dont fucking Yo me anymore. Just message me using a real app.]".

That "wut" app is similar in that you can't have a real conversation with anyone in particular, but it can at least be used for sharing secrets or something. I guess. Yo doesn't have such a use case that I can see.

They could maybe pivot it to act like tinder where if both of the parties yo eachother then it goes to a separate section of the app where they can actually IM eachother. But...idk. That doesn't seem particularly interesting/differentiating either.

I must be naive/short sighted.

<comment><USER6> A very large amount of my phone messages are actually null-content messages: my phone is very often a "I'm here" when picking someone up, or "let me in" or "done shopping, waiting for you" if I'm grocery shopping with someone.

Basically any time someone says "message me when..." there is no conversation when I message them. There is just a contentless phone call or text message. This is filling a communication niche that isn't well supported by the existing methods.

That said, I'm still not willing to install a new app just for that, but that doesn't mean there isn't value there.

<comment><USER7> The existing method, of course, is a standard SMS message that says "Yo". I've sent plenty of them.

<comment><USER8> presumably the value of the OP is that it reduces that friction of opening your SMS app and typing "Yo"

<comment><USER7> Given that a "Yo" usually follows a more detailed text message like "Text me when you're downstairs," I think the total finger-on-screen time would be higher to open the Yo app and search for the right contact.

I assume that Yo has another plan that they haven't gone public with yet, since "Company that just says Yo raises $1m" is more newsworthy than "Company to solve problem X raises $1m." They'll get people to download the app and then add the new functionality with an automatic update.

</comment></comment></comment></comment></comment><comment><USER9> I'm actually kind of surprised at the large numbers of HNers running to defend this thing, and those that expressed the equally valid opinion that this app is garbage have been downvoted into oblivion.

In this thread I've seen lines like: "Filling a communication niche", "It reduces that friction of opening your SMS app and typing 'Yo'"

What a surreal thread. It literally could have come straight from a script from HBO's 'Silicon Valley'.

<comment><USER10> Yeah, hilarious. Shit like this makes me wonder if we have reached "peak human" on this planet. Even raising a hint of suspicion at an obviously idiotic allocation of capital is regarded as "hating" or "not getting it". I can imagine aliens watching the spectacle of our civilization from beyond our view and wondering how we justify allocating 10x the NIH cancer research budget to stuff like whatsapp, snapchat, etc and having biochem/physics phds having better job prospects driving for Uber rather than advancing science.

</comment></comment><comment><USER11> I'm not what's more disturbing. The fact that it secured 1.2M or the mental gymnastics that people are doing to justify the existence of this app.

<comment><USER12> This.

<comment><USER13> Not sure if this is a typical forum comment or an observation on the meaning that can be given with a single word.

<comment> qu4z-2

      the meaning that can be given with a single word.

Very little in this case. There's a reason simple "This" comments are discouraged on HN. Having said that, I do agree that single words can contain a lot of meaning at times. This just ... isn't a great example.

<comment><USER13> Tens of thousands of people are finding some use for it, even if it's just novelty.

I could imagine yo'ing my wife to say "Thinking of you" while at work, or my brother to say "Not up to much if you want to Skype", etc.

I think they could easily start with something curious like this and then slowly extend it to something else (e.g., single word/term conversation elements where you get more choices the deeper the conversation goes).

How many naysayers were there (and still!) with something like Twitter? Yet I use Twitter many times each day.

</comment></comment></comment></comment></comment><comment><USER14> It's Facebook's "poke" feature (which I honestly love) in 2014. There's nothing wrong with it, but I struggle to find anything novel about it.

<comment><USER15> The innovation, such as it is, is to get a zillion people to install an app that gives the company a direct line into your notification bar. Think they'll never put an ad there?

<comment><USER16> well they're not allowed on iOS so no

</comment></comment></comment><comment><USER17> The onboarding process was really jarring. I expected to be able to use it instantly. Instead, I had to wait ~30 seconds while my username was registered, and now I'm sitting on my hands waiting for some SMS with a code that will allow me to login. Also, there's no easy way for me to use the app with other people without inviting them first (which, given my circle of friends and family, would have to be preceded by a sales pitch on why they should download this stupid thing in the first place).

As an app that prioritizes ease-of-use and fast communication, Yo really falls flat on it's face.

I'm not going to comment on the potential usefulness of this app, because I'm sure others will and I don't think it'll yield any particularly interesting discussion. References will be made to Snapchat and WhatsApp, the word "bubble" might come up, etc.

<comment><USER18> That's weird I didn't have to do an SMS code on Android.

<comment><USER19> You presumably gave the app permission to (among other things) read all of your texts when you installed it.

iOS's sandboxing mechanism doesn't expose text messages to third-party apps.

<comment><USER18> It doesn't have that permission on Android to read texts.

</comment></comment></comment></comment><comment><USER20> One of the author's jibes at Facebook is that it "causes depression among its users".

But what about TechCrunch itself? I would bet money that there's a correlation between TC readership and depression. Reading about pointless apps is a waste of anyone's time and will make you feel worse in the long run.

</comment><comment><USER21> Technology has a tendency to distill everything to its essence. This is just another step towards a world in which the number one film in the country is called "Ass" [1].

I'm 50/50 on this happening within a decade.

[1] [http://en.wikipedia.org/wiki/Idiocracy](http://en.wikipedia.org/wiki/Idiocracy)

</comment><comment><USER22> New startup idea: an app that only lets you say "hey" to people. It's called Navi.

I can't wait until the hackathons where everyone makes Yo clones unironically. It's going to create an innovation black hole.

<comment><USER23> >New startup idea: an app that only lets you say "hey" to people.

"It's like Yo, only with 'Hey' instead of 'Yo'"

<comment><USER24> It's "Yo" for "Hey"

<comment><USER25> Scott Brown would have something to say about that: [https://www.youtube.com/watch?v=rNkMwnsWdjc](https://www.youtube.com/watch?v=rNkMwnsWdjc)

</comment></comment></comment></comment><comment><USER26> Whether intentional or not this is essentially the "Transformative Hermeneutics of Quantum Gravity" of app development.

<comment><USER15> The Sokal App-fair.

</comment></comment><comment><USER27> I'm hoping that this app and the investment are really some kind of performance art project.

</comment><comment><USER28> Excerpt:

 _"It's really lightweight," said Arbel. "You don't have anything to open. The Yo is everything, it's all there is. You don't have a badge you need to remove or any hidden content. Just a Yo."_

Words fail me.

</comment><comment><USER29> What this is, I believe, is a tell-tale sign of the second bubble.

</comment><comment><USER30> Ridiculous as this sounds, there's a very interesting conversation happening on Twitter with Marc Andreessen about this apps' uses.

Apparently, the "missed call" phenomenon, where people will call someone else and hang up, is incredibly popular, especially in other countries (e.g. Bangladesh). It's a free way to communicate 1 bit of information, which in many cases is enough if the people know beforehand what they want to communicate. E.g., "come downstairs", "call me back on another line", etc.

I think one article mentioned that missed calls are _70%_ of the traffic of cellular operators in Bangladesh!

<comment><USER31> When I was in high school our local mobile networks brought out a feature called "Please call me" in which you used USSD to send an unbilled notification for another number to call you - you only got around 20 per day but that was more than enough. Most people seemed to use it to notify their parents that they were ready to be picked up from a prearranged place much like you're describing with missed calls.

</comment></comment><comment><USER32> The co-founder of Yo could sell ice to Eskimos. That's my kind of sales guy on my team.

</comment><comment><USER33> In Europe and a lot of developing countries, where missed calls aren't charged for - this kind of 'nudge' communication is pretty common. I have no idea if it'll work in the US but it's certainly valuable when both parties already have known context, e.g. 'I'll missed call you when I'm outside'

</comment><comment><USER34> 1693 words about an app that doesn't say much.

</comment><comment><USER35> Please, please, _please_ somebody buy this company for $10 million. This is the best chance in human history to bring Poe's Law to its absurdist conclusion.

<comment><USER36> I think your shooting too low. Million is so 2013. $10 Billion minimum!

</comment></comment><comment><USER37> What sparked my interest is that indeed there seem to be some words that are like a swiss army knife in possibilities. Yo is a prime example. It can mean hi, okay, no thanks, what's that, hey, a warning and the list goes on forever.

Trying the app it said to me that I could connect to Facebook through my settings. The app didn't have settings.

 _sad trombone_

Don't snort the 1.2 million at once, yo.

</comment><comment><USER38> Seeing all these deep critiques/breakdowns of this product makes me feel like I'm in 10th grade english class again.

</comment><comment><USER39> By far, this is the dumbest article I came across. Couldn't read it after first few lines. But god! This was huge article on an app that sends two words! :D Hah! Although comments on the article tickled me a bit.

</comment><comment><USER40> Facebook renames poke->yo, and eats their lunch.

</comment><comment><USER41> I don't know why I'm having a crack out of this. It's just so silly.

</comment><comment><USER42> A harbinger of a tech bubble?

</comment><comment><USER43> This just needs 1 more feature: the ability to reply "lo".

</comment><comment><USER44> They should've got to Aaron Paul before Microsoft did

</comment><comment><USER45> I just Yo'd about 15 times back and forth with a friend.

He just texted me "What's Up"

Mission accomplished I guess?

<comment><USER46> Everybody is laughing now but soon they launch:

Yo, buy this! Yo, emoji pack, Yo, plus! Yo, for enterprise.

Then suddenly their the next whatsapp.

<comment><USER25> "Yo Glass!" \+ "Gee, Yo Location" = "Yobiquitous Computing"

</comment></comment></comment><comment><USER47> Ortega y Gasset was right.

</comment><comment><USER48> Yo is already used by Yeoman, though...

</comment><comment><USER49> Yooooooooo If you know what I mean...

</comment><comment><USER50> Yo

</comment><comment><USER51> WAT?

</comment><comment><USER52> Yo :-)</comment>


Mayor unveils plan for $1.5bn Chinese business district in London - <AUTHOR> http://www.telegraph.co.uk/finance/china-business/10087727/Boris-Johnson-unveils-plan-for-1bn-Chinese-business-district.html

<comment><AUTHOR> Only yesterday it was announced "China Builds EU Beachhead With $5 Billion City in Belarus" <https://news.ycombinator.com/item?id=5783373></comment>


Show HN: RSS Feed for HN Favorites - <AUTHOR> https://hnfaves.com <comment><AUTHOR> I was trying to consolidate my bookmarks, but hn favorites was on its own island, so this basically allows anyone to subscribe to their favorites at [https://hnfaves.com/user?p=page?type=rss|atom|json](https://hnfaves.com/user?p=page?type=rss|atom|json)</comment>


She Loves Me, She Loves Me Not in C - <AUTHOR> http://www.cise.ufl.edu/~manuel/obfuscate/westley.hint

<comment><AUTHOR> "warning: eroticism unused in function main"</comment>


At Spain's Door, a Welcome Mat for Entrepreneurs - <AUTHOR> http://www.nytimes.com/2014/11/23/business/international/at-spains-door-a-welcome-mat-for-entrepreneurs-.html?ref=technology <comment><USER3> Spain is like phone companies: a welcome mat for outsiders, a nightmare for insiders.

Spanish companies can't have anybody working (i.e. 'dormant' state), they always need an "administrador" who pays a monthly 300€ self-employment tax. This kills companies in early stages unless they can break even quickly (3600€/yr while not having any income, plus maintentance expenses, is terrible)

Creating a company is bureaucratically difficult, I reckon it was on the bottom area in the latest "easiest countries to create a company on" report.

If you're an exporter, you can go bankrupt because you owe worker taxes to the State... while they owe you return of export VAT. I personally know a case of these. They owed the State about 300k€ while the State owed them 500k€ for more than a year. They couldn't "cancel out" the debt. That is outrageous. They had to file bankrupcy.

And finally, if you're a small company, you have to pay a lot of taxes, while if you're big and can pay big lawyers/accountants, Spain is equivalent to a tax haven (i.e. Ireland). This is true. Spain attracts big companies with a tax maze which allows the rich to evade taxes.

This is really disheartening for Spanish enterpreneurs. We're treated as second-class citizens... in our own country. Our taxes go to finance big, foreign companies. That sucks.

Sorry for all the negativity, I'm currently trying to start a company in Spain and I'm meeting a lot of friends who also have. This is the general sentiment. Spain needs to fix A LOT of things if they want to be enterpreneur-friendly, starting with THEIR OWN enterpreneurs.

<comment><USER4> Not negative at all. It is actually quite accurate. I started up in Spain 5 years ago and was the worst decision ever. Never again.

For several reasons our venture failed and I was stuck with hundreds of thousands of € in debt w/o any protection, with me and my co-founders scared of losing our homes, and severely affecting our personal lives.

Spanish gov is specialist in showing a big smile in the pics that appear in the press, but the evil is in the details. When things go wrong you're alone. There's not legal protection for failed startuppers. Starting up in Spain w/o resources is extremely difficult, and can really mess up your life _forever_.

Looking back, I wish I had started with a LTD in UK, and working from Spain (yes, you can). It's what I'm doing next.

My 0.02

<comment><USER5> How would the tax situation work with having a LTD in the UK and residing in Spain?

<comment><USER6> You would normally have to make payments into the Spanish social security scheme. The rules are actually quite complicated but if you live and work in Spain that's where you have to contribute to social security. Owning a UK limited company does not change that.

<comment><USER5> But would you have to pay tax on your limited company's turnover both in the UK and then subsequently in Spain?

<comment><USER6> No, the company would have to pay taxes (corporation tax, VAT, etc) only in the UK, and if you personally get something out of the company, like a salary or a share of the profits, then you have to pay income tax or capital gains tax and social security contributions in the country you live in (i.e. Spain).

There is some double taxation of course because the company first pays corporation tax on its profits and then you pay income tax or capital gains tax on any profits you take out of the company. But that is the same regardless of where you live. One way to mitigate this is for your company to pay you a salary.

</comment></comment></comment></comment></comment></comment><comment><USER7> I recall reading an article a few years ago where an entrepreneur was sued by the Spanish government after his company went under. Spain is, as is the rest of Europe, quite hostile to entrepreneurship. It seems like Spain is trying to attract people from outside rather than deal with the problems inside. If they could make it super easy to start a company, relax red tape for businesses under a certain size, and encourage Spaniards to start companies (not just in tech) and soften the blow of failure, I think only then is it time to start inviting in foreigners.

<comment><USER8> If you would like to register a business in the UK, go here: [https://www.gov.uk/register-a-company-online](https://www.gov.uk/register-a- company-online)

It says it takes 48 hours and costs £15. You must be at least 16, and you'll need an address -- it could be a rented post box so long as it's a full address.

As far as I can see, you don't need to be resident in the UK.

<comment><USER9> Indeed but bear in mind you are then obliged to submit annual tax returns for the company for which an accountant would charge you £300+

</comment></comment></comment><comment><USER10> I lived in Spain for 9 years and ran a company there for 7 of those - I would never do it again. Even with competent professional legal & accounting assistance it's a bureaucratic nightmare by the standards of most other places I've been. It's also not particularly cheap - contrary to what the article says, Berlin in my experience is much cheaper.

That said, it's a nice place to live, especially Barcelona, and that helps to attract foreign talent if you can't find good people locally.

<comment><USER11> I agree with you, the bureaucracy is tough in Spain especially with accountants who don't really know the rules either. I don't think it's less bureaucratic then Germany though, Germany is only more predictable. Absolutely true what you say about hiring, people from abroad love coming to Barcelona & there are extremely skilled local people ready to work their butt off if you give them a chance. Also there are very attractive reductions in social security costs available if someone you hire has been unemployed before.

<comment><USER12> I'd like to echo the Germany bureaucracy comments but also add that while it I'd true that Germany has lots of it, and sometimes it seems crazy that one department of governent won't talk to the other on your behalf, the vast majority of the rules I've come across seem to be perfectly logical when I've taken a step back and looked at them properly. German bureaucracy is about closing loopholes. They don't like them. Spanish and British bureaucracy often seems to be there for no reason that I can fathom!

</comment></comment></comment><comment><USER13> Moving to and living in a foreign country is a really great learning experience, but don't kid yourself - the sheer amount of bureaucracy involved in these entrepreneur-importing schemes plus the overhead of adapting to a new culture make them a net negative for any business you're starting.

Go if you want the adventure, but if you're really passionate about something you're working on, I'd recommend staying in place and working on it instead.

<comment><USER14> Bureaucracy can be dealt with by hiring a specialist legal firm. It sounds really expensive, but in many cases it's not - it's in 10-20K range, which is comparable to what it costs to move an established household from US/Canada to Europe. One can of course sell everything, move with just a backpack and do it frugally by trying to deal with all the formalities themselves, but that's certainly is taxing if you are over certain age or have family/kids.

<comment><USER15> That's exactly the kind of approach that inhibits entrepreneurship. It's very hard to see hurdles which kill non existent companies by preventing them from ever happening. There are big risky steps that happen before it feels real. The easier these steps are, the more likely it is that people take them.

Red tape that would not be more than an annoyance to an existing company kills off new companies. Maybe to an individual with decades of entrepreneurship 10-20k for a lawyer to handle stuff and make decisions about things he doesn't understand is fine, but to an average joe thinking about starting a business that represents a year or more of savings.

</comment></comment></comment><comment><USER5> It just seems to painful to even freelance in Spain, I can't imagine the loopholes to run a business. Such an awesome place but it really hamstrings itself.

</comment><comment><USER16> That all sounds nice but then you have this:

[http://tech.eu/news/spain-government-startup-tax- reform/](http://tech.eu/news/spain-government-startup-tax-reform/)

<comment><USER17> .. provided that the taxpayer has been a Spanish resident for at least ten out of the fifteen tax periods before the last tax period.

While not amazing for people who have been living in Spain all their life, this isn't really a big deal for foreigners moving to Spain to set up a business?

</comment></comment><comment><USER18> I am a spaniard. I currently run a business on ruby on rails-ember.js development based on Madrid and I also lived in San Francisco and Chile for a year in both cases. So, I will share my experience in three basic elements: life quality, tech community, business management.

First, about Madrid. Madrid is a really beautiful and nice for living city. You can work hard and enjoy the life at the same time. You dont need that much money to make a decent living (1 - 1.5k€/month). There is a decent community for developers. Moreover, the developers technical level is good or pretty good. Finally, starting a business and managing the business is hard. It is hard because you start paying those 300€ month that sometimes are a big wall. Also, there is a lot of paperwork: taxes every 3 months, hiring someone is the hell, requesting money requires more money in prints than the amount requested.

Chile: The quality of life in Chile is not as good as I expected. The people here is pretty familiar (closed circles) so engaging with new friends is not as easy as in Madrid or SFO. There is a lack of cultural life in the city.

The tech community in Santiago is growing fast but still small compared with Madrid and thousand miles away from SFO. The tech quality is also mid-low.

The management of business on the other hand is very easy. The main problem is when you come here without a link to Startup Chile Program because being a non-tourist here is really complicated. You need a kind of id number - <USER2> that cant be get until you 5 months after you arrive if everything goes right. You cant have a telephone number, internet or bank account without this number.

SFO is the heaven and the hell at the same time. Lots of interesting people around from everywhere. I was living on hacker community that made my living fun and interesting. The main probloem is the cost of living in the city. And this is a HUGE issue in the midterm for the tech community in SFO. It is too expensive. The community in SFO, no words, just amazing. (I dont say anything about creating/managing business because i have no experience).

Hope this small and partial insights help anyone :)

<comment><USER19> The high COL in the SF bay area has become a significant liability because people like you realize it's way too expensive here. It's affecting everyone from startups to really large companies who prefer to hire in the SF bay area, but cannot do so.

</comment></comment><comment><USER20> According to the World Bank's 2015 Doing Business report, Spain ranks 74 of 189 countries for starting a business. That doesn't sound like startup heaven, but on the bright side it improved 41 spots from being ranked 115 in 2014.

The data at the bottom of this link provides some good data on the time, cost and number of steps required to start a company in Spain: [http://www.doingbusiness.org/data/exploreeconomies/spain/](http://www.doingbusiness.org/data/exploreeconomies/spain/)

</comment><comment><USER21> My experience starting a company in Spain has been very bad. I'm not going to repeat what other people said already, but it took almost two months for the process to complete. Don't even think about starting a business there during summer.

</comment><comment><USER22> Despite I think that the new law is a huge step forward for Spain, the visas are nothing if there are not an infrastructure behind it. SV has a huge investors network that Spain just doesn't have.

<comment><USER23> Actually this may improve soon as it looks that Google ventures is paying attention to the opportunity of investing in a country with great weather and high-qualified engineers: [http://www.techrepublic.com/article/google-set-to- open-campu...](http://www.techrepublic.com/article/google-set-to-open-campus- madrid-to-drive-innovation-in-spain/)

<comment><USER22> I think maybe it could be an option in several years... right now, as Spanish, I think it's not the best place to launch your start-up by far. We could consider the political atmosphere too, next year is gonna be the president election and the country could be unable to be managed...

</comment></comment></comment><comment><USER24> The article goes into a lot of good detail about how much easier it is to get a visa & temporary residence. Let's assume that there was no uncertainty there, and you could instead get permanent residence and/or citizenship... After going through all that, what have you gained?

Why go there in the first place? It didn't look like the government was offering any sort of funding or tax relief for somebody who decides to start their business in Spain instead of anywhere else.

</comment><comment><USER25> The US has a similar deal, with E-1 and E-2 visas. You can buy your way into the US by investing $500K. This tends to be used more by people who made money outside the US and want to live there than by people doing startups. This is a treaty arrangement available only to citizens of countries which offer a reciprocal deal to Americans. Spain and most of the EU are is on the list; China (mainland) is not.

<comment> bjelkeman-again When we did it we didn't even need all the cash for it. Started a company in the EU. Built software on a seed investment. Had software startup valued at USD500k+ merge that into a US company with all the staff from the EU, six of us. Get E-1(2?) visas. Done.

</comment></comment><comment><USER26> Interesting. I've been looking for a way to get an easy multi-year visa in Europe, and I have a sole proprietorship that I want to incorporate anyway. Previously, I was looking at DAFT, but it would cost me several thousand dollars. Maybe Spain is the way to go?

</comment><comment><USER27> Is it bad to have a depressed local market though (to launch a company to)?

<comment><USER11> You can also use Spain as a gateway to the entire Spanish-speaking market, which is always an attractive option in case you plan to go international.</comment></comment>


Ask HN: Anyone in SF Interested in the Global Learning XPRIZE? - <AUTHOR> I just learnt about the Global Learning XPRIZE, and I'm looking for others interested in ideating concepts and possibly forming a team. You can see my contact info in my user page if you would like to talk further. <comment><USER2> We are a distributed group working to solve this challenge, and would really be interested in hearing from you and any others that want to work on this. Check out our site here: [http://www.dev4x.com](http://www.dev4x.com) and let us know if you want to join us.</comment>


Ask HN: What should Microsoft do to get its mojo back? - <AUTHOR>

The recent NYTimes article has generated plenty of discussion about Microsoft, most of it negative. But instead of focusing on what they've done wrong, I'm curious what people think they should do to gain back some of the relevance they've lost. And please, no "Fire all the management" comments. Here are a few ideas to start the conversation for better or worse:
1) Streamline the product line. Get out of the markets where you've just gotten in from being panicked. This largely means the content businesses and probably music. Stop being so fucking insecure about businesses where arch rivals are doing well and identify markets to get in to where you already have a natural advantage. This probably means other business markets vs. consumer. Bing seems to be doing pretty well but it should just be a hobby. Just going through your main nav on Microsoft.com shows you're spread WAY too thin. There's over 100 products on there.
2) Redo your website and come up with a consistent look and feel for everything. Your branding totally needs to change to give people a new vibe about the company. For the amount of money you spend on marketing, your website sucks. Fire whoever is in charge of it and start over using some boutique firms in New York or S.V.
3) If you can't outright cut projects/products, spin them off and give them their own identity. McDonalds owns Chipotle but you wouldn't know it from Chipotle stores, their focus on organic meat, etc. Given the polarization of your brand, this could work well in other areas.
4) Invest in some yCombinator/TechStars type incubators and create a more well known pipeline to the startup community.
5) You generated a ton of bad karma by keeping IE6 around for 8 or 9 years. Seems silly, but you lose a lot of cool points and generate a ton of frustration among the developer community you're trying to woo. Make sure future versions of IE rock, maybe even go to a webkit rendering engine instead of what you've got now.
6) Flatten the organization, introduce some perks not even Google has and publicize the hell out of them. Encourage more employees to blog and be open about the culture there and the good aspects of working there. Make Microsoft a cool place to work again.
7) Put up a pirate flag a la Apple in the eighties or some other rebel move for show. You need to look like you have an edge to put your competitors on notice that you're still the 800 lb gorilla in the room and you intend on kicking some ass once again. <comment><USER2> Don't be so obsessed with what Google and Apple are doing. Stop entering markets that they have defined. Instead of focusing on crushing the competition and stealing market share, focus on creating a new market according to your own vision, where there are no other players.

</comment><comment><USER3> 2 possibilities 1) less command and control 2) more command and control

1) less command and control

Fund a whole bunch of branch new products to be built by people not currently employed by MS. Start ups essentially although they may or may not be 100% owned by MS.

Make sure they are all separated from the rest of the company by an impermeable barrier featuring a moat, crocodiles and boiling oil.

Let them work on whatever they think is best without concern for where it fits into MS's broader strategy.

Some of them will be profitable. Some won't and will have to be shut down. Some will compete with the rest of MS. Some will compete with each other. So be it. That just increases the odds that one of MS's many arms will be successful.

Kind of like a VC firm but they don't necessarily need to be separate companies.

2) more command and control MS has so much going on that it must be impossible to keep track of everything. Shut down "me to" or otherwise failed products. Concentrate on a smaller set of things and do them better.

Whittle down the product offerings to a small set of strategically aligned products which can be carefully managed.

Be more like Apple I suppose.

</comment><comment><USER4> \- Push out a system patch (and a Silverlight update for those who don't download patches) that causes IE6 to post a warning bar at the top of every page it visits, with a link that they should upgrade because the IE6 browser is no longer patched. Also, pay a sum to Adobe to cause the latest Adobe Reader Plugin to issue this same warning.

\- Get out of the browser business. It costs you too much money and gives you too little in return. Let everyone use all the other browsers like Firefox, Safari, Opera, Chrome, and others. But if you plan to stay in it, then switch to the Webkit engine and please by all means support CSS3 just as good as Chrome does.

\- Push for open audio, video, and vector animation standards in HTML5, moving with the pack instead of against it, and don't even bother whether Adobe or Apple are on board with those plans.

\- Remember the years when Apple was going through the transition from the old OS to the new OS based on BSD UNIX? They had an arrangement where you could run old apps as well as new apps. Microsoft should do something similar, but with Novell Suse Linux.

\- Take MS Office back to the old interface before the funky menubars, and slim down the interface a good bit so that there aren't so many menu items by default.

\- Simplify the registry or eliminate it altogether. It's a mess. Linux guys love .conf files.

\- In the new Linux-based OS, once you lock in where settings are located, quit changing them dramatically because it angers people.

\- Give Steve Ballmer a golden parachute.

\- Merge the company with Novell. And if not that, then rename it so that it kind of helps with the new image.

\- Push for the elimination of software patent laws that you introduced in the first place. But, since that takes a long time to achieve, do the IBM approach for now. That approach is to gobble up a bunch of software patents, but do not sue people who infringe. In fact, legally protect those who infringe, who are also challenged in court, because it generates more business for you, instead.

<comment><USER5> The MS Office tool bar gets a lot of flack. But it's not aimed at you or I. My mum can use it. Nuff said. Many corporate customers (lots of money) have legacy applications that require IE6. Cluttering the browser more would not be helpful and would garner more ill will.

Backing out of the browser market and letting Apple/Google/Mozilla "win" would again be counter productive. IE8 is a good browser. Yes, its behind the others in many ways, but give them some more time. They had to build up from IE6, and I think they have begun to close the gaps quite quickly.

I agree with open video and audio being a good direction.

Merge with Linux? Why in the world would they do that?

I don't have experience with the registry, so I can't comment here, but again, a linux style replacement is not going to be in MS's best interests.

Ignoring the Linux part, yes, standardization is going to be key for them moving forward, and I think they have made some big steps with that in Vista => Windows 7.

Why?

I don't see how renaming possibly the biggest name in computing ("Microsoft") would help them in any way.

</comment></comment><comment><USER6> A very specific suggestion:

Push the Zune. With WiFi, HD decoding & output and significantly increased storage size, they could turn it from a pure iPod competitor to a significantly better SlingBox/iPod combo. If I walk into a friend's house and have it recognise the network, it should instantly start serving files over wifi, which any pc (Windows Media Center or XBOX, if you're looking for the tie-in) could play. If I want to charge it as it plays, or play particularly high-bandwidth content over a weak network, or output pre-decoded stuff, plug it in directly and stream it that way.

As it stands, it can 'only' play 720p. Also, at 16/32 gb options and with current transfer speeds onto the device, the zune can't really achieve this. With 64/128 it starts to be possible, and Wireless N might help for streaming via wifi. Perhaps USB 3.0 will help load it with content faster?

They need to milk the early adopter crowd as well, to win back mindshare the Zune has completely failed to grab from the iPod due to being such a "me too" project. This means working with all file formats at the very least, and arrangements with Hulu, Netflix, Spotify - if they don't already have them - would be good moves too.

</comment><comment><USER7> McDonalds does not own Chipotle, they sold their entire stake in 2006.

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

<comment><AUTHOR> ah, thanks for the clarification. was still a pretty good strategy on their part i thought...

</comment></comment><comment><USER8> Swap out the CEO. Ballmer has kept things even keeled and done a great job releasing Windows 7, why not go out on a high note and put in somebody that represents the future, not the past?

<comment><USER9> Not sure he'd be leaving on a high note. He does need to go though. He was never a visionary - he's always just been a good salesman like Larry Ellison. These guys win by shoving their products down the customer's throat. In the long run they always lose however. It takes vision to run a company. He obviously has none.

<comment><USER10> is ellison really not a visionary?

</comment></comment></comment><comment><USER11> Release that delicious, delicious looking courier tablet.

</comment><comment><USER10> my worthless suggestion:

i don't think the "old-schoolers" will ever respect the "kids" (actually they don't seem to be that young) in the r&d labs until they get their own credit in the "street" (market) - so things like integrating with windows/office/etc will always be hard if the managers think the direction goes against their interests, so..

.. put all the "edgy" projects into a special branch of the organization that depends only on the 'man' and:

\- give them full freedom to pursue the markets they see fit (this means they can go against established products etc)

\- let them adopt their own internal processes and tools (ye, that means macs and linux and ipods)

\- give them their own name if you don't want them initially associated with the microsoft brand

\- after proven success, start merging with the rest of the organization in a selective way (throwing away old processes that don't really work anymore, promoting the new guys into top positions, yada yada yada)

</comment><comment><USER12> This implies they had some mojo to begin with.

<comment><AUTHOR> I'm no Microsoft apologist by any means but come on, they rule the business world; they had to do something right to get there. Any company in the world would kill to have their products have 90%+ market share.

<comment><USER13> I'm not a Microsoft apologist either, but they did plenty right to get where they are. Read Accidental Empires by (almost Dr.) Mark Stephens.

Microsoft got to where they are because Bill Gates was one of the first people, perhaps the first, to see that there was going to be a large and enduring market for personal computing software and he had the ability to make MS a force in that market. PCs were a disruptive technology that (effectively) killed mainframes and minicomputers and created many new uses for computers.

Even if MS do everything wrong they are still going to be a large and profitable company for many years to come. Their software is a de facto standard in too many places now for that to change in a hurry.

Their business is now in a mature phase. That means that while profits are huge growth has declined. They should be using that war chest to fund new tech. Ballmer seems to be quite smart but I don't know if he's a visionary. Perhaps he should stick to milking the cash cow and ask Gates back to recommend where MS should invest.

<comment><USER14> Many tech companies succeed by maximizing their highs, making the most of their successes. This takes a substantial amount of risk, especially in the tech industry, but it's a very sensible business model that applies across several industries. Microsoft is unusual in that its pattern for success is not in maximizing highs (few MS products are considered best in class, let alone examples of exemplary execution and design) but rather in turning around and avoiding failures.

MS was headed for a crisis in the early 90s because their 16-bit consumer OS (Win 3.1/DOS) was a technological dead-end while their 32-bit next gen OS (Win NT) was not suitable for consumers due to excessive hardware requirements (namely a 4mb per process overhead for every 16-bit app, or a $150 premium for each 16-bit app running simultaneously). Instead, MS pursued an unusual hybrid approach (windows 95) that allowed a significant amount of the benefits of a 32-bit pre-emptive multi-tasking OS with more reasonable hardware requirements than OS/2 or NT. A solution that lasted another 6 years before finally being supplanted by their fully 32-bit Windows XP consumer OS. Similarly, MS recovered from the underwhelming Vista release with Windows 7. They turned around their shameful Live search efforts with Bing. They avoided disaster with the v1 XBOX, which was a reasonably popular system but a serious financial debacle, by halting production and putting out the XBOX 360, resulting in runaway popularity _and_ financial success.

This ability to make such dramatic saving rolls against failure is a defining characteristic for MS. There are a few other tech companies that have shown some degree of this capability (Intel and Apple, for example) but it is far more characteristic of MS (and far more responsible for their success). In an industry with a rich history of fast rising superstars that later flare out in catastrophic failure (Sun, Excite, geocities, myspace, Digital Research, Netscape, DEC, countless more) MS's three decade history of turning potential catastrophes into successes is at the core of what makes the company tick. It may not be as glamorous as other companies who reach Olympian heights of excellence, trail-blaze new markets, or revolutionize old ones but it's been an enormously successful strategy for MS.

Perhaps MS has lost the mojo and the guts to make these sorts of major saving moves any more (from my time at MS I fear this may be becoming true). Perhaps this sort of strategy is no longer relevant in an era of even faster technological change. Only time will tell.

<comment><USER15> Xbox overall is still _at least_ $5 Billion away from being profitable, possibly twice that.

What does Microsoft need to do to get back it's Mojo? Split itself into multiple seperate companies that actually need to compete in the free market and that can no longer consider wasting Billions on faulty hardware, losing a format war and missing explosive market growth opportunities as "success".

</comment></comment></comment></comment></comment><comment><USER16> They should have split into 3 separate companies as was suggested (and ordered?) a long time ago. Now's too late.

</comment><comment><USER17> I'd really be interested in seeing MS continue to develop out Microsoft Robotics, don't know if it makes the most business sense though.

</comment><comment><USER18> hmmm Bill Gates return? jus like Jobs return to Apple. as for mobile product, i want Surface technology in WinMo.

<comment><USER19> Surface uses giant infrared cameras and a projector for display (the medium has to be permeable to IR, so traditional screens don't work). You couldn't put that technology on a WinMo device. Their mobile division is basically dead in the water and I don't foresee any rescue.

</comment></comment><comment><USER20> I don't remember any time when Microsoft was "cool" or had "mojo", and I've been doing work since '88 at least. People who joined the scene in the mid '90s or later often think Microsoft is great -- because they don't know any better.

Microsoft is the McDonalds of software. Does McDonalds have a mojo? Did they ever?

</comment><comment><USER21> step zero: Fire Steve Ballmer

</comment><comment><USER22> Microsoft's sole, yet-painful solution: a hard-reboot across the board resulting in "Winux".

<comment><USER23> That's an interesting point. Their OSes, while fairly widely used, are weird relative to just about every other OS in existence.

The sole supplier of anything even close to it is a commercial entity. Getting software that wasn't written for it to run there is a pain. Moving software away from it is also a pain (but it's at least to their advantage).</comment></comment>


JavaScript Test-Runners Benchmark: A comparison of the most popular test-runners - <AUTHOR> https://medium.com/dailyjs/javascript-test-runners-benchmark-3a78d4117b4 <comment><USER2> Speed of test-runners is important, but in my opinion can't be top priority. Far more important is better flexibility of writing tests and bigger asserting tools. Thanks to that, you can write more test and coverage more code.

<comment><AUTHOR> I agree. We should consider several criterias. The speed becomes more important for huge number of tests when execution time starts to annoy developers.</comment></comment>


Parser Combinators Made Simple - <AUTHOR> http://sigusr2.net/2011/Apr/18/parser-combinators-made-simple.html <comment><USER2> A nice and friendly way to explain a concept that has a scary-sounding name. One little correction, though: your example for "alt" function says

      >>> iforwhileorfor = alt(matchstr('if'), matchstr('while'), matchstr('for'))
      >>> if_while_for('if')
      ('if', '')
      >>> if_while_for('while')
      ('while', '')
      >>> if_while_for('for')
      ('for', '')
      >>> if_while_for('foof')
      None

You need to either rename the variable to "if_while_for" or modify your function calls accordingly.

<comment><AUTHOR> Oops! Thanks for noticing this. I'll make a fix.</comment></comment>


Example of an 'AI' bot delivering excellent service - <AUTHOR> https://imgur.com/eth6suO <comment><AUTHOR> Not sure if this will be interesting/welcome here, but I just had this experience and it kind of blew me away.

I ordered a small load cell from Amazon. Shipping got messed up and they detected the exception and said it should arrive by April 31st. It didn't, so I just popped in to Amazon chat help and everything that you see in the image is what transpired next.

It figured out why I was there, provided a few reasonable canned responses, provided useful information in a natural tone and reassured me at the end that this will be handled one way or another.

All of this without bothering anyone on their end.

Clearly if the order status page was updated with this state I wouldn't have had to do this, but features can get wedged in a backlog and this provides a reasonable way to recover the customer experience without a lot of incremental cost.

Amazon gets blasted regularly for the decisions of their leadership, and sometimes that negativity can trickle down to the folks doing good work. Just wanted to recognize a small win here for the product and engineering folks that put this together. Nice job!</comment>