And Monads for All: The State Monad - <AUTHOR> http://rcardin.github.io/design/programming/fp/monad/2018/11/22/and-monads-for-all-state-monad.html <comment><USER2> The practice of using image macro memes in the middle of technical discussions needs to stop.

<comment><USER3> They're fine but they are not used correctly in this article. it comes off as very cringy

<comment><USER4> Since they are used incorrectly in a consistent way, I can again suspect it's done on purpose. Like the "Use the force, Harry" (e.g. [https://me.me/i/use- the-force-harry-gandalf-8062768](https://me.me/i/use-the-force-harry- gandalf-8062768))

<comment><USER5> No, the author is simply unaware. Look at the comments:

Commenter: "Man, you are not using these memes correctly..."

Author: "Well, maybe. Which ones would you suggest?"

</comment></comment></comment></comment><comment><USER6> > This very complex object coming from the Category Theory

This statement doesn't serve any other purpose than boosting the author's ego. Either that, or they don't know what they are talking about.

<comment><USER5> I believe the author meant something like "intricate". English is not their first language.

</comment></comment><comment><USER7> I think this article makes a simple concept seem unnecessarily convoluted. The first paragraph says:

> This very complex object coming from the Category Theory is so important in > functional programming that is very hard to program without it in this kind > of paradigm.

May I try to dispel this myth that monads (and functional programming ideas in general) are complex?

New functional programmer are often faced with a dilemma: how do I do side effects (e.g., mutable state) in a purely functional way? Isn't that a contradiction? In 1989, Eugenio Moggi gave us a compelling answer to these questions: monads. The idea of monads originally comes from category theory, but category theory is not at all necessary to understand them as they apply to programming.

We start with this: since a pure functional programming language doesn't have step-by-step _procedures_ built into the language, we instead have to choose our own suitable representation for impure programs and define a notion for composing them together. For example, a _stateful program_ (a program that has read/write access to some piece of mutable state) can be represented by a function which takes the initial state and returns a value and the new state (as a pair).

So, for example, if the mutable state is some integer value, then stateful programs that return a value of type `a` will have this type:

      Int -> (a, Int)

Let's give that type constructor a convenient name:

      StatefulProgram(a) = Int -> (a, Int)

One key piece of the story is that this type constructor is a _functor_ , which is just a fancy way to say that we can `map` over it (like we can for lists):

      map(f, program) = function(initialState) {
        (result, newState) = program(initialState)
        return (f(result), newState)
      }

Then, if we have a stateful program which produces a string (i.e., its type is `StatefulProgram(String)`) and a function `stringLength` which takes a string and returns its length, we could easily convert the program into a new program that returns the length of the string instead of the string itself:

      newProgram = map(program, stringLength)

Another way to phrase this is: we can compose a stateful program with a pure function to get a new stateful program. But that's not quite enough to write useful programs. We need to be able to compose two stateful programs together. There are a few equivalent ways to define this. In Haskell, we would have a function pronounced _bind_ that takes a stateful program and a callback. The callback gets the result of the stateful program and returns a new stateful program to run next.

      bind(program, callback) = function(initialState) {
        (result, newState) = program(initialState)
        newProgram = callback(result)
        return newProgram(newState)
      }

Some languages call this function `flatMap` instead of `bind`. In JavaScript, this is like the `then` function for promises. Whatever we call it, we can easily use it to write a helper function which sequences two stateful programs:

      sequence(program1, program2) = bind(program1, function(result) {
        return program2
      })

This amounts to running the first program, throwing away its result (see that the `result` variable is never used), and then running the second program.

One more ingredient is needed to make this `StatefulProgram` idea really useful. We need a way to construct a stateful program that just produces a value without touching the state. We'll call this function `pure`:

      pure(x) = function(initialState) {
        return (x, initialState)
      }

Here's what makes `StatefulProgram` a monad:

a) First of all, it needs to be a functor. That amounts to having a `map` function like we defined above.

b) We need a way to construct a `StatefulProgram(a)` given an `a`. That's our `pure` function.

c) We need some notion of composition. That's given by our `bind` function. (And note that `sequence` is just a special case of `bind` where the callback doesn't use its argument.)

Category theory also gives us some common sense laws that monads must satisfy. For example, `bind(pure(x), callback) = callback(x)`.

The brilliant insight of Eugenio Moggi is that these three functions are essentially an interface for any kind of side effect. Mutable state is just one example. We could represent other kinds of side-effectful programs in the same way. For example, a program which returns _multiple times_ could be represented as a list. Then the `map` and `flatMap`/`bind` functions are exactly what you expect, and the `pure` function just constructs a list with a single element. Other examples of monads are IO (for interacting with the operating system), continuations (for doing fancy control flow), maybe/optional (for programs that may return a `null` value), exceptions, logging, reading from an environment (e.g., for threading environment variables through your program), etc. They all have the same interface, which is represented in Haskell as the `Monad` type class (type classes are Haskell's notion of interfaces).

Haskell also provides a convenient syntax called `do notation` for working with monads (this is a vast generalization of the async/await syntax that is creeping into some popular languages). For example, a stateful program that reads the state and mutates it could be written like this:

      program = do
        x <- get     -- Read the state
        put 3        -- Update the state
        pure (x + 3) -- Return what the state used to be plus 3

In our syntax, that would be equivalent to writing:

      program = bind(get, function(x) {
        return bind(put(3), function(result) {
          return pure(x + 3)
        })
      })

That callback hell is quite an eyesore, and I think that's one of several reasons why monads are not very popular outside of the Haskell community.

<comment><USER8> I have read a large number of articles that tried to explain these concepts but they never stuck. This comment just blew them all away. The concept seems almost obvious now haha

<comment><USER9> It is an obvious and very useful abstraction you use a lot in many different languages. The gp explanation might be the best I've read about monads.

</comment></comment></comment><comment><USER10> What is this syntax from hell the article is throwing at us without any introduction?

<comment><USER6> I believe that this is Scala

</comment></comment><comment><USER11> I wish Scala could hide monads in syntax as well as Haskell does

<comment><USER12> Scala's for comprehensions resemble Haskell's do-notation quite well. So there is some syntax to work with monads in Scala.

The big difference is that Scala's for isn't guarantied to be a pure expression.

<comment><USER13> I just wish for..yield didn't look quite so much like a loop.

</comment></comment></comment><comment><USER14> Don't mind the weenies, this is a wonderful explanation!

</comment><comment><USER15> Functional programming was invented by Backus to solve the problem of interchangeable parts. Unfortunately, he did not finish his work, and as a result people are still trying to paper over the missing hole in the theory. State monads as described above make the process of storing and manipulating state a very obscure and mysterious process. This additional complexity and abstraction can only add to the lifecycle cost of software generated using this technique, with an attendant increase in maintenance cost. If you were to take a 10 year old, and give them basic training, would they be able to understand this? I doubt it, yet computers at their core are incredibly simple. So a better paradigm awaits.

<comment><USER16> The state monad, in spite of the scary name, is an incredibly simple idea, being about functions with this signature:

S => (A, S)

That's it. Of course this doesn't include the definition of the monad instance, however those operations come very naturally from trying to work with, to manipulate these functions. In fact many people reinvent the state monad.

Furthermore this does a great job of simplifying impure functions that manipulate state, because for those functions the state evolution does not appear in the signature. Or in other words the state is still there, as an implicit input and output to your function, but the type system can no longer protect you and the function's output will be dependent on the history of all previous function calls. That's anything but simple.

And yes, I believe you can explain it to 10 year olds. If the 10 year old can understand functions, he can understand this as well. Your grandma might have a problem with it though.</comment></comment>


Google promoted Texas gunman fake tweets - <AUTHOR> http://www.bbc.co.uk/news/technology-41915065 <comment><USER2> My summary of the article: An algorithm designed by Google engineers to promote upcoming stories does exactly what it was supposed to do, and people who don't understand why Google employees did not manually review just one out of one hundred thousand things that the search engine indexed that day are suprised.

Google Search is a content aggregator that show you what it thinks you are most likely to click on. It does not know about politics, it cannot fact check, it does not think care about effort journalism, the only thing that matters is what stories generate more ad revenue.

Of course, Google will try to police its results better after this incident, but they can't effectively do this without mass censorship. If you don't believe me, see the recent YouTube drama over monetization.

<comment><USER3> Could you explain why it is good for society for Google to not give a shit about what it promotes?

I mean, the point of limited liability is not to give investors a path to profit regardless of all other things, it is to encourage investments that are beneficial to society. If it isn't working, we should retink it.

<comment><USER4> > I mean, the point of limited liability is not to give investors a path to > profit regardless of all other things, it is to encourage investments that > are beneficial to society. If it isn't working, we should retink it.

From my understanding, a limited liability company exists to protect the business members and shareholders from legal action of their private persons. I.e. if the business goes under due to a poor product or something, they can't be held personally liable. That doesn't mean they are excused from criminal behavior, they can still be liable for some of that.

However, in either case there is no "benefit to society" clauses. It's simply a legal construct to protect people. In this case, Google did what they did... They probably weren't criminals though

<comment><USER5> Yes, exactly. The point of Limited Liability is _not_ simply to create a guaranteed path to profit (in fact it does no such thing; LLCs go bankrupt every day, and members can lose every penny they have personally invested).

Though there is no explicit "benefit to society" clause, that is the basic rationale for limited liability. It's an incentive to allow members to define the extent of their personal financial exposure. In so doing, they are more willing to invest in businesses, which can produce a net benefit to society (e.g. by employing people, paying taxes, etc.).

</comment></comment></comment></comment><comment><USER6> I feel like there's a big push to blame "fake news" and related phenomena on tech companies right now.

Fake news is created and shared by people. Tech is just one of the vehicles through which we share it.

The problem isn't tech, it's people. Fix the root cause with education and the tech will reflect it.

<comment><USER7> The problem is that tech companies aren't just showing you everything everyone says... they're picking and choosing what to show you.

The 10,000ft overview is that they show you whatever keeps you coming back or staying on-site longer. This gives them more ad impressions and makes them more money.

Therefore, if their algorithms determine that showing you fake news, lies, and other socially-destructive and false propaganda is more profitable... they can and will do that.

So the question is, how do we regulate what the tech-utilities get to filter from your view? Should we regulate? It's not the regulation of speech, but rather the regulation of the willful filtration of speech for profit.

i.e., "dont show this guy dissenting views to his position or he'll stop coming back", where does that fit into our needs as a society and how should our laws tackle it, if at all?

<comment><USER8> I just wish people were able to collectively give up social media. I completely abhor the stranglehold its placed on culture and media, especially for the younger generation. It has dumbed everything down into what will get clicks, and is extremely invasive to boot. The only thing we "gain" from having social media as a society is advertisement.... which is essentially a way to get us to consume goods we wouldn't be consuming otherwise (i.e. waste). I don't see anything good coming from replacing the more or less natural human social structure that evolved over millions of years increasingly with an app designed to get us to buy goods we don't want, or get just 5 more minutes of attention. Such a waste of humanity's minds and effort.

Ultimately I really don't think you can say that Google/FB's dominance is a net positive for humanity. Sure we get to enjoy a lot of "free" goods, but those goods are merely a vector through which advertisements can learn more about us. Google/FB wouldn't be rolling in it if advertisers weren't making money off from advertising through them.

I see it almost as a maladaptive coping mechanism adopted by our society at large. We have a completely self-destructive reliance on perpetual inflation- beating growth, and at this point some of the most important mechanisms driving this growth are highly sophisticated advertisements designed to squeeze every last bit of consumer spending out of the economy as is possible. Not only that, but they've collectively convinced almost all of humanity to whore out all of their own personal information just so they can browse meme pages or check up on old high school acquaintances. It's absolutely disgusting behavior that to me resembles the informed preying on the ignorant.

<comment><USER7> A couple points and devil's advocacy on a couple as well:

Search is as bad as social, even if we give up social, it'll be hard to replace search (I read Wikimedia is working on something... a nonprofit search would be a fantastic asset to the world.)

Advertising generates a lot more than waste, in fact it may advertise to you a tool that you didn't know existed that prevents waste. Maybe rechargeable batteries or a water filter so you don't buy water bottles or who knows what, that sword cuts both ways. The ethics of advertisers and the lack of regulation in advertising though is easy to attack. That stuff is a mess.

As for Google being a net negative, I lean to your side of the argument but I think it'd be difficult and both sides would have a lot of merit; other search engines are just less efficient; think of all the man-hours of wasted research Google has saved by giving you the right result the first time, it must be billions of hours annually, maybe more. A lot of time and money has been spent competing, and the competition hasn't gotten much closer in terms of actual search results, so, if Google didn't exist, we may just be at a loss for that stuff.

<comment><USER9> Neither is intrinsically bad for society, merely the monetisation model. "State owned" search/social would obviously be even worse, however, so there isn't a clear path to having a version of either of those things which actually have as their primary aim the things Google/Facebook claim to.

</comment></comment></comment></comment></comment><comment><USER10> Not sure what to think here... Google's 'public liaison for search' says _" Google briefly carried tweets with dubious info "_[0] without defining further what that means - except their Twitter results are changing _" second by second"_[1], and later assuring that it _" only happened for a few thousands who searched for his name"_[2].

This was not my experience. I took a screenshot of my search results at 9:06PM ET [3], e.g. 1-2+ hours after the egregious tweets (which were already prominently featured within 30-40 minutes, if not earlier, as several other sources suggest[4]).

I might be missing something, but it seems disingenuous to suggest that this only happened for a short period of time, while downplaying the matter by vaguely and generally hinting at second-by-second dynamic tweet update algorithms.

Also I even think the claim that only a few thousand people saw this may be disproven by Google's own statistics. According to Google Trends, searches for Devis Patrick Kelly peaked between 7-9PM ET [5] - so before I took the screenshot that night.

I find it very hard to believe that only a few thousand people saw this over the 2+ hours when this peaked on that night. Based on the Google Trends graph[6] it seems the vast majority of searches happened during the peak, and I suspect it's reasonable to assume that millions have searched for his name since his name was publicly revealed?

[0] [https://twitter.com/dannysullivan/status/927713318172635137](https://twitter.com/dannysullivan/status/927713318172635137)

[1] [https://twitter.com/dannysullivan/status/927713426440253440](https://twitter.com/dannysullivan/status/927713426440253440)

[2] [https://twitter.com/dannysullivan/status/927713578827653120](https://twitter.com/dannysullivan/status/927713578827653120)

[3] [https://imgur.com/a/ao4kK](https://imgur.com/a/ao4kK)

[4] [https://www.theregister.co.uk/2017/11/06/google_twitter_fake...](https://www.theregister.co.uk/2017/11/06/google_twitter_fake_news/)

[5] [https://imgur.com/a/lAh12](https://imgur.com/a/lAh12)

[6] [https://trends.google.com/trends/explore?date=2017-11-05T05%...](https://trends.google.com/trends/explore?date=2017-11-05T05%202017-11-08T06&q=Devin%20Patrick%20Kelly)

<comment><USER11> More than likely it is Google trying to downplay it, but it's their search being gamed - the BBC article is actually inaccurate as far as I'm aware, as at least in the case of Sam Hyde, I was under the impression he was in on the joke, though I may be wrong.

Regardless, the length of time probably isn't as important as the frequency with which this occurs, as the search frequently returning verifiably wrong or fake information is probably a bigger issue. The length of time it lasts is just a symptom of the tool providing news without the news being curated.

</comment></comment><comment><USER12> Yes, there is bad information on the Internet. Yes, when you aggregate tons of user content some inaccurate things will be there. Go somewhere else BBC, NYT, WaPo. We know, you'd like to see a content regulated Internet. I wouldn't and I'm weary of seeing these articles day in and day out.

Beside why are articles from newspaper on HN front page so much lately?

From HN guidelines: Off-Topic: "Most stories about politics, or crime, or sports, unless they're evidence of some interesting new phenomenon....... If they'd cover it on TV news, it's probably off-topic."

This self serving media policy seeking doesn't belong here IMOP. It's not interesting, it's not informative. Shouldn't be constantly on front page day after day.

</comment><comment><USER13> >Google's Danny Sullivan - "We want to get this right"

I feel like in a better world that would be, "We are legally obligated to get this right or stop trying."

</comment><comment><USER14> A little off-topic, but on similar lines: searching for "demagogue" on google, gets you a Trump's picture: [https://i.imgur.com/qFJk9io.png](https://i.imgur.com/qFJk9io.png)

I wonder how that ends up happening, is google able to sum up popular opinion or is this someone's mischief?

</comment><comment><USER15> I wonder when we finally get mandatory electronic locks on guns. Having an electronic license for a single gun could have prevented this man from using a whole battery of guns.

It makes little sense that we can have more sophisticated locks on an iPhoneX than on guns.</comment>


The Cost of Cloud Storage - <AUTHOR> https://www.backblaze.com/blog/cost-of-cloud-storage/ <comment><USER2> We've shared the underlying cost of building Storage Pod storage servers for years. This takes a higher level approach and breaks down overall costs including datacenter/power, people, bandwidth, etc. Happy to try and answer additional questions.

Gleb from Backblaze</comment>


Ask HN: Which companies' tech blogs do you read? - <AUTHOR> <comment><USER2> In total I follow around 130 different RSS feeds (just for tech blogs). These range for esoteric scheme blogs to Netflix, Uber, Facebook Engineering. It came to a point where I had a really hard time prioritizing everything, so I implemented a fairly naive algorithm to rank them. I found the most interesting stuff was coming from FAANG, so I would give their engineering blog posts a few extra points (multiply by 2). I really like Julia Evans and always learn something from them, so her blog is currently a multiple of 5 for me (the highest).

I have been toying around with making this aggregation a weekly newsletter, but currently it's just a landing page and an Elixir/Phoenix app (what I use to keep track of my RSS feeds). If anyone's interested: [https://unicorndigest.com](https://unicorndigest.com)

<comment><USER3> Because I have not settled yet, what feed/RSS reader do you use

<comment><USER2> A custom Elixir/Phoenix application I wrote. I'd recommend Feedly for anyone who has a small amount of feeds they follow (I think I have over 200 different sources at the moment), but I need custom ordering that Feedly doesn't offer which is why I wrote my own.

<comment><USER3> Would you mind sharing, I didn't find it in your github.

I was thinking about Elixir recently anyway ;)

</comment></comment></comment></comment><comment><USER4> Depends on my interests at the time but I prefer the blogs where the tech is open source so mostly Twitter[1] and LinkedIn[2] for me. I also follow Airbnb[3] primarily for their blogs on Data and ML (the area in which I work). Have occasionally looked at Uber and Netflix for some of the posts related to Big Data and ML.

[1] [https://blog.twitter.com/engineering/en_us.html](https://blog.twitter.com/engineering/en_us.html) [2] [https://engineering.linkedin.com/blog](https://engineering.linkedin.com/blog) [3] [https://medium.com/airbnb-engineering](https://medium.com/airbnb- engineering)

</comment><comment> git-pull Quick link of post mortem blogposts: [https://gist.github.com/cheapRoc/d9e73fe05480330c1e36410cbdf...](https://gist.github.com/cheapRoc/d9e73fe05480330c1e36410cbdf0e867)

The best company blogs I see are ones that have their own open source projects. Like Facebook. Where they break off a generally usable piece of their codebase into a library.

Nothing beats a nice version release with an update on all the features and improvements it brings.

[https://reactjs.org/blog/2014/02/20/react-v0.9.html](https://reactjs.org/blog/2014/02/20/react-v0.9.html)

So I consider open source subsidiaries as "company tech blogs". Let's try to keep things purely to blogs:

[https://stripe.com/blog/engineering](https://stripe.com/blog/engineering)

Favorite post was their post mortem: [https://web.archive.org/web/20160126093909/https://support.s...](https://web.archive.org/web/20160126093909/https://support.stripe.com/questions/outage- postmortem-2015-10-08-utc)

This was Stripe's 2015 outage with the database index change ([https://news.ycombinator.com/item?id=10365798](https://news.ycombinator.com/item?id=10365798)) I presumed it was an index involving customer ID, but it wasn't specific.

</comment><comment><USER5> I don't necessarily read all of them, but ICYMI there is a curated list of engineering blogs - [https://github.com/kilimchoi/engineering- blogs](https://github.com/kilimchoi/engineering-blogs)

</comment><comment><USER6> None except I want to buy their stock.

Lately: [https://jobs.zalando.com/tech/blog/](https://jobs.zalando.com/tech/blog/)

</comment><comment><USER7> CloudFlare occasionally: it is consistently interesting.

</comment><comment><USER8> Persona's (MySQL/DB related) occasionally.

</comment><comment><USER9> Etsy</comment>


A successful Git branching model (2010) - <AUTHOR> http://nvie.com/posts/a-successful-git-branching-model/ <comment><USER2> I've got a much nicer branching model- try not to have one. Everyone works off master, and you aren't allowed to check in code that won't run in production. Hide unfinished features behind feature flags, and never merge/push a change that won't pass tests/CI.

The chaos of huge feature merges (a key source of bugs I've experienced) is minimized. You deploy fixes hourly, not weekly (or later monthly when it just won't seem to pass CI). The time between code being written and a bug being seen can be reduced to minutes and hours, making finding the root cause a breeze.

Just my preference, but very open to debate.

<comment><USER3> Feature flags are a nice idea, but nobody outside of Facebook seems to be embracing them. The tooling just isn't there. Some concrete questions:

\- How do you prevent your codebase from becoming if-statement spaghetti?

\- How do you prevent new features from being leaked to the user? They'll see the new features in the front end source code. At many companies this isn't an acceptable tradeoff. So do you preprocess the release code and strip out the disabled feature flags? With what?

\- What do you use to control feature flags? Just a json file filled with `"foo-bar-feature": true/false`, or something more sophisticated like a control panel that you can use to say "10% of our users will see this feature"?

<comment><USER4> > _Feature flags are a nice idea, but nobody outside of Facebook seems to be > embracing them_

I worked at Etsy from early 2012 to late 2015 and I used feature flags every day I was there.

> _How do you prevent your codebase from becoming if-statement spaghetti?_

You remove the feature flag checking code when you turn off or turn on the feature. It's an extra deploy, but it needs to be part of the prod/eng process. This is the most salient issue of feature flagging in my experience and something you need to get ahead of from the get-go.

> _How do you prevent new features from being leaked to the user?_

You branch at the server/request level, not the client level, so there is no set of features that gets displayed, it's just what the server returns.

> _What do you use to control feature flags?_

You can use a service like LaunchDarkly or Optimizely or you can write your own service, or you can have a file in memory. Usually it starts simple with boolean toggles and evolves into a ramp up system that let's you selectively target users. The important part is that you need to be able to change features without redeploying code.

<comment><USER3> _You remove the feature flag checking code when you turn off or turn on the feature. It 's an extra deploy, but it needs to be part of the prod/eng process. This is the most salient issue of feature flagging in my experience and something you need to get ahead of from the get-go._

I don't understand. I was asking about the development source code, not the code delivered to the user. The dev source code isn't stripped of if- statements, right? That's where the feature flag toggling lives. But then it seems like it's easy to devolve into spaghetti.

 _You branch at the server /request level, not the client level, so there is no set of features that gets displayed, it's just what the server returns._

Ok, but how? I'm not playing dumb. Assume an express server. You want to put a feature flag into your codebase. What is step #1 (and #2 and ... #N) to achieve this?

I looked up LaunchDarkly. $299/mo for basic team support. Uhh... That's almost the cost of WeWork office space.

Are feature flags really so nascent that there isn't a FOSS solution for it?

<comment><USER5> > The dev source code isn't stripped of if-statements, right?

When I use a feature flag as an alternative to branching, then I delete the if statements once the feature becomes permananent and gets released to all users. It's analogous to merging a branch. Obviously I'd leave it there during QA and A/B testing, but once toggling is no longer necessary, I remove the toggle.

> Ok, but how? Assume an express server.

You probably have feature flags already and just didn't call them that. But normally in any given project, there are multiple ways to wrap a feature in a toggle.

Here are a couple of examples I use:

\- I use handlebars for my frontend templating. When I have a feature that needs to serve or withhold some HTML to/from the user, I put the feature flag in my JSON file of variables that get passed to handlebars. Handlebars has a way to wrap HTML with a boolean test.

\- I use the Google Closure compiler to optimize, uglify, and minify my code. When I need a feature flag that is code only, and I don't want users to accidentally get exposed, I use a boolean @define in JavaScript, and wrap feature code in an if statement. When the Boolean is false, Closure compiler removes that block from the output code.

\- I set up my own JSON file of config constants that are injected into the code during build. If I have a feature flag to A/B test something, or that I do want released to users but has a secret switch to enable, then I put the constant in the JSON file, and write UI code to toggle the flag. This one usually generates more code than the two above, but whenever I decide that the feature is either dead or permanent, I remove all the code to enable and disable the feature.

\- For fully dynamic toggling, I put my boolean config variable into my database. I use Firebase which is a giant pub-sub, so I wrap the toggle in a subscription to the database variable, which might then (for example) inject some HTML and/or toggle the CSS display attribute of some things on my page.

> Are feature flags really so nascent that there isn't a FOSS solution for it?

No, feature flags have always been around, since long before branching. There isn't a FOSS solution for it separate from your framework(s) because how they work depends entirely on your stack. They're also normally really simple, adding the dependencies of another project just to have a boolean in your config file or in your code is usually overkill. That said, there are FOSS and commercial solutions for A/B testing, which is usually a feature flag workflow, but it comes with lots of other stuff you might not need, like the reporting, analytics and statistics parts.

<comment><USER6> > I delete the if statements once the feature becomes permananent

Right. In theory. Does this really scale when there's more than a dozen developers touching the same code paths? It's not just you scratching off your own TODOs, it's multiple entagled condiditionals. Can you really delete your flags with confidence that this does not affect any other code path?

Which brings me to my real question: How you you guys test this stuff? When I have experimented with feature flags before this has been to much detriment for testing. Suddenly the new payment API our provider will launch in June needs to be tested with the new backend we'll launching Tuesday, and with the new asynchronous database driver our DBAs wants us to migrate to. And so on. The complexity explodes. Especially when the features have dependencies external to you.

When everything is in master and everything must be in shippable condition you need to test everything with everything else, while previously the new payment API in June could live in it's own branch and test on their own schedule and not bother everyone else everytime the payment provider's test environment took a nosedive for some reason.

So you either end up with brittle tests that can take days to execute, or you end up scratching a lot of the less pressing combinations. Which brings us to the situation above. How can you then be confident to remove conditionals without testing the newly exposed code paths?

It is so far my suspicion that most people who speak of feature flags as an alternative to branches either work with trivial products where most developers fit in a small room (in which you are not the use case for these things) or talk out of some theoretical conviction which has yet to meet with reality. These things are hard, because of all those details which seem small if you squint enough.

<comment><USER5> To be clear, I personally use branching a lot (e.g., for sprint-sized features) and I create new feature flags rather infrequently (for multi-sprint sized features or for A/B tests), and only for pretty large features. But I can see reasons why some teams/environments do go, or want to go, feature-flag always. Before git, feature toggles were more widespread as a workflow.

As far an entanglement with other code, I would evaluate this wrt branching. If it's entangled, the branching analogy is a merge conflict. The most common case is you can delete the toggle without conflict, and occasionally you have to spend ten or twenty minutes untangling. Every once in a rare while it gets messier.

For testing, the prod tests run the prod config, which is likely with all optional feature toggles turned off. My team would run our own tests with our feature toggles turned on, but not with other teams' feature toggles. I don't run all combinations of features. Usually, a feature toggle will also wrap new tests that belong to that feature.

Again, the same question you ask applies to a branch workflow. Do you run all possible branches at the same time? Is it an exponential combinatorics problem to have multiple branches? Not really, each team runs the tests for the features they work on. Same either way.

The great thing about feature flags for testing is that you have greater control over who is exposed to your new feature. With a feature toggle, you can expose some teams in your company outside of your own, without exposing the whole company. You can expose 10% of your customers and do testing without inflicting bugs you didn't forsee on 100% of your customers. If there's an emergency, you can limit the damage radius with a well designed feature flag. Branches can do this only to the extent that the merge structure allows it, and they can't help with customer testing.

> It is so far my suspicion that most people who speak of feature flags as an > alternative to branches either work with trivial products [...] or talk out > of some theoretical conviction which has yet to meet with reality

I think I know why you feel that way, but that sounds (to me) like you haven't been exposed to (and so can't imagine) workflows outside of git branching. I mean no insult, but you are jumping to conclusions from lack of experience. Feature toggles as a pseudo-branching workflow predate git by decades, they are used on the largest codebases in the world -- did you miss the comments in this thread from MS and Google?

Feature flags are used in nearly all repos where branching exists. It's not one or the other, you can use both workflows at the same time. A/B testing is based on feature toggles, and all sizable websites on the web are doing A/B testing constantly. Chances are high that you use them already and just haven't yet recognized that they're the same thing we're talking about. If you have config files for your project, then you have feature toggles. If you ever change a value in one of them, then you could instead branch your code, remove the config variable and rewrite the code that used to reference the feature flag to be hard coded instead. Is that making sense?

FWIW, just to put some specifics and back up my own 'conviction' with real world examples, I've been on teams that used feature toggles to test and ship features during the production of several animated films, movies you probably saw. When I worked in film, it predated git. We had a hierarchical repo, but there were no branches, only pushing to master and feature flags.

When I worked in games, the team I lead used feature flags to support cross- team testing on a $1B console franchise.

At a certain web company, in addition to constant A/B testing, my team shipped features to customers who signed up to be on the 'beta' versions of features before they were rolled out to all of the >1M users. We used feature flags to control which teams internally could see & test certain features, and we used feature flags for either long-running or large cross-team features when branching & merging would cause undue amount of branch noise.

And at my own startup now, I prefer to wrap my features in feature flags even when I'm branching. That way I can back out a feature when it causes problems or has bugs without having to do git surgery or even risk a merge conflict. With a few thousand active customers, this has saved my ass multiple times.

<comment><USER6> > If it's entangled, the branching analogy is a merge conflict.

I like this observation. As long as two developers touch the same code, you will have a conflict. Now your choice will be where to best place that conflict. In an SCM, in conditional statements, or somewhere else.

> For testing, the prod tests run the prod config, which is likely with all > optional feature toggles turned off.

I don't understand this. If you are going to activate a new feature in prod, surely you test it first? Or do you start testing all over again before you switch on a new codepath? Feature toggles must also include externalities such as backend systems changing their APIs. Even if you are forwards compatible, you must take care so your application doesn't break when that happens, and that means testing in advance.

If you really follow the master-is-production branch free model all merging must cease before you activate a feature in prod? That doesn't sound very practical.

> Do you run all possible branches at the same time? Is it an exponential > combinatorics problem to have multiple branches? Not really, each team runs > the tests for the features they work on.

A team can not be responsible for testing only their own development work, they must also know that it works with other people's changes that might activate before theirs does. That cross team communication is hard enough using branches, but at least teams do not disturb each other's testing. That enables asynchronous development. In a master must always be production model, which seems to be what most branchless development people seems to advocate, every combination is blocking. That's the difference.

> The great thing about feature flags for testing is that you have greater > control over who is exposed to your new feature.

Right. I'm not saying that feature flags are useless. I'm just questioning that it can be used instead of branching in non-trivial projects. There are a lot of use cases where it makes sense, for example user interface stuff where branching unnecessary.

As you point out, feature flags are just a new term for application configuration. We've had that forever. It is as an alternative to developing in branches I question it. We generally don't celebrate making everything an option.

> I mean no insult, but you are jumping to conclusions from lack of > experience. Feature toggles as a pseudo-branching workflow predate git by > decades, they are used on the largest codebases in the world -- did you miss > the comments in this thread from MS and Google?

Oh, absolutely. I type this because I want to hear from people with experience. What I meant by "my suspicion so far" is that the experience with branchless development I've heard so far is either trivial or theoretical. There's a lot of pointing at Facebook as a good example but not much in way of first hand knowledge.

And yes, I did notice the comments. The Microsoftie called it "if-statement hell", the Google commenter said it "impacted developer velocity" primarily because of the testing requirements. The former can perhaps be explained with culture, but the latter matches my experience exactly. These comments concerned feature flags in general however, not branchless development which is a special case of it.

Your examples from the game and film industry sounds like it could be made workable, but I imagine that development looks different from the average ERP system or backend service. Certainly with smaller startups you shouldn't overcomplicate matters.

<comment><USER5> > If you are going to activate a new feature in prod, surely you test it > first?

Yes, my teams test features before pushing to master regardless of branch strategy. What I meant is that the prod/master/nightly tests stil run the prod config as-is. Teams run tests, but features under toggles aren't tested using the master branch's automation tests until the feature is turned on. Exactly like how a team branch won't get tested in the nightly run until merged.

The QA dept. is typically running the staging branch, which is whatever got pushed to master, but hasn't gone live yet. When I turn on a toggle, it's just like I merged a branch, so QA starts testing the new features at that point. When we want extra testing, we set the feature toggle so that QA is exposed and the public is not, then if it passes, the code goes live with the feature toggle turned off.

> A team can not be responsible for testing only their own development work

When we test feature toggled code, my team runs all the automation tests with my team's features turned on. Similar to how we'd run tests as if our branch was merged into master, but without pushing the merge.

What we don't do is speculatively run tests with other teams' feature toggles turned on. Exactly like how you wouldn't run tests against someone else's unmerged branch. Their features are tested against ours after one of the teams turns their own toggle on, once one of the features is made public -- to at least our teams if not everyone.

> The Microsoftie called it "if-statement" hell

I've heard first hand accounts about their branch hell too. And it's a worse hell than I've ever seen personally. From about 10 years ago, not today, so I don't know how different it is, but someone in Research said it took a full month of merging and conflict resolution for a code merge in any given dept. to propagate to the rest of the company.

If that's happening, feature toggles definitely won't fix it. There is a chance it could make things worse.

I'd tend to agree if you strictly feature-flagged all commits as a complete replacement to branching, it would probably be ugly. Git is useful, and branches are a nice workflow for most dev.

My criteria is to choose the one that makes sense. Feature toggles are currently better IMO for long-running feature dev or very large features, branches are better for medium sized features. Adding, merging, then removing a feature toggle during a single sprint is more overhead than it's worth.

What we did in games before git was everyone pushed to master at all times (or whatever they called it in Perforce, or the lovely SourceSafe before that.) Most people did not wrap their features in toggles. We lost a ton of developer velocity due to someone checking in a bug that broke the build for everyone who pulled after that. More often than not people would hurry to try and fix their bug rather than revert, occasionally checking in further bugs. Company- wide breakage was a weekly occurrence. Those were dark days, it was ridiculous. Feature toggles were the only safety mechanism we had, which is maybe why I see them in such a positive light.

I would not recommend going whole hog with feature toggles and eschewing branches. But I do recommend trying one or two and feeling out exactly how the whole process would work for you from start to finish. They are still useful in a branch environment, especially for features that would cause lots and lots of branch noise.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER7> The advice here given to avoid using "master" branch for development, and advice to create non-default branch named "develop" (or variations thereof) is quite harmful.

If you must have a "release" branch or "stable" branch, ok, go for it, but leave the "master" for developing. Why? Strive to have sane defaults.

Frankly, the idea that somebody must check out some extra special branch after cloning repo in order to start properly developing, is not sane.

<comment><USER8> > Leave the "master" for developing.

IMHO do developing always on topic branches, never on master.

This keeps master available for fully-working software, such as for the most- recent successful build using continuous integration, or for always-available deployment, or for external users, etc.

To create topic branches, here are git alias commands that you can customize as you like for your git workflows:

        topic-start  = "!f(){ b=$1; git checkout master; git fetch; git rebase; git checkout -b "$b" master; };f"

        topic-finish = "!f(){ b=$(git branch-name); git checkout master; git branch -d "$b"; git push origin ":$b"; };f"

        branch-name = rev-parse --abbrev-ref HEAD

<comment><USER7> What's the point of running CI on a branch that's effectively for tracking releases only?

We run CI on master branch and fix any build breaks or regressions immediately. (That's the job of unit tests and integration tests.)

In fact, if your team is smaller, you do release from master branch directly, just tag the release revisions. Then if you need to hotfix it, check out the tag, make a branch, cherrypick a fix to the branch, and do point release from the branch: problem solved.

That's if the client running the (older) release version is large enough to justify releasing hotfix instead of doing fix to main stream and just asking to upgrade to latest release.

Yes to topic branches. Yes to "cactus model" of rebasing the topic to master. No to the idea that you need extra long-lived "develop" branch in parallel to master.

<comment><USER8> > What's the point of running CI on a branch that's effectively for tracking > releases only?

I'm recommending using master as the _output_ of a successful continuous integration, and thus always ready for release.

I'm rejecting any git flow that has any developer pushing any code directly to master, while hoping/guessing that master branch integration will succeed.

Caveat: Bugs will still happen.

Caveat: There are more-advanced release processes such as blue/green, alpha/beta, canary/throttle, etc.

Caveat: There are more-sophisticated integration techniques such as an internal private master branch that differs from an external public master branch. YMMV. Use the right tools for the job.)

<comment><USER3> _Caveat: There are more-advanced release processes such as blue /green, alpha/beta, canary/throttle, etc._

What does Facebook do? It's hard to imagine that they slow themselves down this much. They tend to hide features behind feature flags, but is it known what their CI process is like?

<comment><USER9> Github pushes topic branches to production and if they don't cause troubles _then_ merges to master. The idea is that _good state_ is defined as _works in production_ not just _passed CI tests_.

</comment></comment></comment></comment></comment></comment><comment><USER10> It is good exercise to actually learn this branching model and then use it in practice. You will soon realize that most projects will suddenly start taking unnecessary toll on you just because now you want to maintain multiple branches and it is a huge PITA.

Instead just follow this simple routine - stay as close to the master as possible. If a temporary diversion is needed, create a new branch (and maintain both master and the diversion for a while). Delete the diversion once the job is done.

If you are never able to delete the diversion, it is not your git branching model that failed, it is you and your code who failed. Diversions may be long term (and I hope you have the workforce to maintain that branch as well) but still finite time. How to prepare that diversion is a software engineering problem and not git's fault.

<comment><USER11> How does this work if you have multiple ongoing changesets?

I'm often working in 3 different features at once, all needing to be merged separately in the review process

<comment><USER12> Merge from master back to your branch.

This is how my team handles merge conflicts: your branch must cleanly merge for the pull request to be approved (which means you must resolve conflicts in your branch first). If there are two branches that may conflict in terms of functionality (but not at a source level) we call that out, and have the people involved reviewing both. When it comes time to merge, we usually merge the first one done to master, merge master to the second, then do extra testing in the second branch before merging it.

Sometimes if we know one branch blocks the other, we simply merge one to the other, but then still go to master separately. This makes the pull request review much simpler and keeps the code isolated while not duplicating effort. This works best when a big bug has a quick and simple but incomplete fix, and a more risky and complex but complete fix, or when there's multiple aspects to a new feature. We can decide to ship the first branch earlier if necessary.

</comment></comment></comment><comment><USER13> Do not use Git Flow for a web application deployed on your own infrastructure (SaaS, microservice, mobile backend, etc.). It will slow down development and make your software less reliable.

The entire purpose of Git Flow is saving up changes to release later, e.g., saving up for a weekly release event. Don't do that! Deploy your changes as soon as they are ready, if they aren't ready don't merge them into a shared branch. If you do Continues Delivery you don't need "hotfix" branches because every changes goes out as soon as it is ready, so you don't need any of the complexity of Git Flow.

By saving up changes for a release event it means more things are getting released at once. If there is a problem after deployment it will be harder to narrow down the cause. Git Flow fosters a harmful development mentality where developers merge untested changes to the develop branch, then move on, and expect someone to test and stabilize their changes before release. With trunk- based development ([https://trunkbaseddevelopment.com/](https://trunkbaseddevelopment.com/)) or GitHub Flow ([https://guides.github.com/introduction/flow/](https://guides.github.com/introduction/flow/)) developers take ownership of their code, and only merge to master after they have tested it. With a good deployment pipeline they can own their code all the way to production.

Git Flow also encourages humans to think about and make up version numbers, like 15.0.5. This is a pointless waste of brain power, web apps don't need version numbers. The artifact systems (packages, containers, etc.) may need something, but it can just be an incrementing number that no on thinks about.

Git Flow wastes so much time, and makes everything it touches so complex, all to enable the harmful behavior of saving up changes for later, and enabling the pointless use of version numbers.

Trunk-based development and Continues Delivery is the default way people develop, it is how you would work if you had a one person company with one customer. It also is how the biggest web companies in the world work. It scales from smallest to largest. Just use trunk-based development. Stay away from Git Flow.

Edit: Fixed spelling of incrementing.

<comment><USER14> > Git Flow also encourages humans to think about and make up version numbers, > like 15.0.5. This is a pointless waste of brain power, web apps don't need > version numbers.

Version numbers are used to represent specific states of the project in order to have fixed testable and auditable versions. It's what the user sees when he needs to check which software version he's using when talking about the software he's using, and what programmers need to know when they need to work on bugs/features present in previous versions of the software but not on others. If your app needs to be debugged and there are peopleother than yourself using, testing or working on the software, it needs version numbers. Otherwise, everyone will needlessly waste their time.

Version numbers waste as much brain power as knowing the name of someone you need to contact on a daily basis. You don't need to make up version numbers because plenty of people already did that. For instance, Semantic Versioning is a thing.

[http://semver.org/](http://semver.org/)

<comment><USER13> Notice I said "web application deployed on your own infrastructure".

While you said "[versions are] what the user sees when he needs to check which software version he's using when talking about the software he's using, and what programmers need to know when they need to work on bugs/features present in previous versions of the software but not on others."

In good SaaS products users don't see version numbers. What version of Gmail are you using? What version of GitHub? They don't have versions. There are also only two versions of your software, what is deployed and what us being deployed (or multiple "being deployed" if you have multiple canaries). Engineers can look up build numbers and changes in the CI system or other internal tracking tools without humans making up version numbers.

Semver is great for libraries and shipping applications, where third parties need to know about breaking changes so they can adjust their applications or configuration.

When deploying your own app to your own infrastructure, Semver wastes people's time. I've worked at a company that switched to Git Flow right before I started. I've seen so much time wasted by people discussing versions and branches. Should I merge to develop or a release branch, or is it a hotfix, should it be 15.1.0 or 15.0.1, or no, someone else claimed 15.0.1 before me, now I'll rename my branch to hotfix-15.0.2, oh 15.0.3 is done being tested before my 15.0.2, so they will rename to 15.0.2 and I'll rename to 15.0.3, oops I forgot to merge their changes into my 15.0.3 so I reverted 15.0.2, now I need to deploy 15.0.4 that has the changes from 15.0.2 and 15.0.3.

Seriously, no joke, this is what happens what you try to use Git Flow for a web app.

</comment></comment></comment><comment><USER15> For a moment I thought: Has someone figured out something better than git- flow? But no, it's the original git-flow article again.

It's good, but now exactly "news". Every git user should be aware of git-flow, even if you do have a better way of using git.

<comment><USER16> > Every git user should be aware of git-flow

Agree. Every git user should be aware of it and should use it on a project at least once so they know to avoid it forever after.

<comment><USER17> Why avoid it?

<comment><USER18> Because it's complicated and most people don't need that complexity at all. For some reason a lot of people happily jumped on the band wagon when this was released and started writing scripts to make it more bearable.

If you have multiple versions of your codebase that you need to maintain for a longer time to justify those release branches, gitflow might be for you. IMO GitLab flow is much more applicable for most people: [https://about.gitlab.com/2014/09/29/gitlab- flow/](https://about.gitlab.com/2014/09/29/gitlab-flow/)

</comment></comment></comment></comment><comment><USER19> I've used the git-flow approach successfully with a small team working on a medical product (so, embedded software system) -- every feature branch had to be reviewed before being merged with `develop`, which was submitted to nightly, extensive functional tests (initially one-hour long, eventually kept as a nightly subset of the more than 24-hours complete QA run) before it could be approved as a new (monthly) release and be merged with `master`. Every new feature branch was automatically treated to quick continuous integration tests, and available for manually-triggered full functional tests (on the target devices).

This approach ensured that we had a full trace of development work, (signed) code reviews, and software changes -- compatible with FDA audits.

We also automated collection of code coverage data during functional tests, to inform analysis and revisions of the battery of functional tests.

<comment><USER9> Interesting. How did you do signed code reviews?

<comment><USER19> We used PRs with BitBucket for all code reviews. The reviewer(s) had to digitally sign their final approval of the review comments+answers and of the related code changes, if any.

The only way to merge a feature branch into `develop` was via the PR + code review process.

<comment><USER9> Was it something like exporting PR history to a file and then signing (X.509/PGP)? Thanks for answers, it looks like a nice, lightweight auditable system.

<comment><USER19> No, simpler than that; we used the BitBucket web interface to enter the approval message and click the approved button to allow for merge. These actions are recorded and visible in the overview page of the PR.

However the BitBucket server's web interface was not approved/validated for long-term storage and evidence for the audit trail, so the PR owner was responsible (before triggering the merge) for saving a PDF copy of that PR page and committing the PDF file into a git-controlled code-review directory.

So it's digitally signed to the extent that your account/identity is recorded in the approval step and in the collection of PDFs. I did ask about a more systematic export method but it was not considered important given the PDF- based approach.

<comment><USER9> Pragmatic and simple. Thanks for taking time to describe it!

</comment></comment></comment></comment></comment></comment><comment><USER20> GitLab has a good discussion on Git flow too. [https://about.gitlab.com/2014/09/29/gitlab- flow/](https://about.gitlab.com/2014/09/29/gitlab-flow/)

</comment><comment><USER21> Prior discussion: [https://news.ycombinator.com/item?id=1966820](https://news.ycombinator.com/item?id=1966820)

</comment><comment><USER22> This was very much valid before the docker workflows came to happen.

Now maintaining two mainline branches forces you to break "don't build a container per environment" cardinal rule. Trunk based development should be the go-to repository strategy for dockerized apps.

<comment><USER23> What's the purpose of that rule?

<comment><USER22> If you properly externalized the configurations, Docker provides bit-by-bit parity between environments granted you use the same image.

This results in increased confidence to test environments and lessening the chances of a surprise during production deployments. It is the next logical step in immutable deployment paradigm[1].

[1]: [https://martinfowler.com/bliki/ImmutableServer.html](https://martinfowler.com/bliki/ImmutableServer.html)

<comment><USER23> But why not use the typical solution of having two testing environments, in this case based on "develop" and "master", with the latter being bit-by-bit equal to what gets deployed?

<comment><USER22> What purpose does it serve but to double QA efforts. If you are testing the same stuff both in develop and master, why not just test only one and save some time. Ramming gitflow into a docker workflow efficiently is not really possible I believe.

</comment></comment></comment></comment></comment><comment><USER17> How is this feasible for projects worked on by multiple development teams?

</comment><comment><USER24> Oh I guess no one has posted it this month, let's argue about git again.

</comment><comment><USER25> (2010)

</comment><comment><USER26> @dang this is old

<comment><USER27> It's okay if it's old, but it should have a (2010) year tag to inform potential readers.</comment></comment>


Opinionated Game framework like Rails? - <AUTHOR>

Is there any opinionated Game engine/framework like rails?<p>Preferably for web based games, but its ok if its not so. <comment><USER2> Does and won't exists.

Rails is a server web framework based on ruby.

You should look for javascript game frameworks instead :)</comment>


Ask HN: With https can domain owner snoop traffic? - <AUTHOR> background: I am using a free ddns provider that let's you set up sub domains on other (willing) people's tlds. I got a lets encrypt cert on my site and force https everywhere.<p>Am I wrong in thinking this makes my traffic immune from a man in the middle attack by the owner of the tld? <comment><USER2> The domain owner is in more or less the same position with HTTP and HTTPS: normally they don't see any of your traffic, but since they control the domain they can change its DNS entries to wherever they want. CAs will happily take their control of DNS or the target location as proof that they own the domain (which is true) and give them a certificate, allowing MITM that's not obviously visible to the visitor but leaves discoverable traces.</comment>


Firefox brings smooth video playback with the fastest AV1 decoder - <AUTHOR> https://hacks.mozilla.org/2019/05/firefox-brings-you-smooth-video-playback-with-the-worlds-fastest-av1-decoder/ <comment><AUTHOR> AV1's been making good progress in Firefox. This 1080p60 video has gone from being essentially unplayable in AV1 to now being _almost_ perfect on my 5-year old, AVX2 enabled laptop in Firefox 68 beta:

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

My system consistently drops frames at the point the jeep drives up the hill and then recovers for the remainder of the video. Other than that it's fine.

You can enable AV1 on YouTube via TestTube ([https://www.youtube.com/testtube](https://www.youtube.com/testtube)) and you can check if a video is in AV1 via right clicking on the video and selecting Stats for Nerds. If it's AV1 the codec will be "av01".

<comment><USER2> Here on Firefox it just goes up to 480p...

<comment><USER3> I'm not sure if it's because I'm on Firefox Nightly, but I get 1080p@60.

Proof: [https://i.imgur.com/JoT2wsM.png](https://i.imgur.com/JoT2wsM.png).

<comment><USER2> Not doubting you. I guess is just some hardware detection? Or don't know... [https://imgur.com/a/8nTkQEj](https://imgur.com/a/8nTkQEj)

</comment></comment></comment></comment><comment><USER4> On Linux Firefox suffers from lack of hardware decoding and encoding (it doesn't plug into vaapi), which makes performance quite bad on laptops. I suspect something like WebEx, for example, works horribly in result. Or may be it's just Cisco not doing a good job. Conferencing experience with their WebRTC client in Firefox on Linux is horrendous.

<comment><USER5> We were just talking about VA on Linux. There is a chance for it to be enabled soon.

<comment><USER4> Oh, that's great to hear! I thought this might come into focus, once WebRender is officially released.

By the way, how is the progress for WebRender over Vulkan?

<comment><USER5> Current state of Vulkan port is that the correctness is on par with GL, minus a few driver bugs. We still need to re-architect WebRender a bit in order to get the performance advantage over GL.

</comment></comment></comment></comment><comment><USER6> With Firefox 67 on a quad core Mac I'm getting solid video playback on AV1 on Youtube 1080p

If you want to test this right now, here is how to enable AV1 in Youtube and test videos.

Goto the youtube testtube page and click "Always Prefer AV1" [https://www.youtube.com/testtube](https://www.youtube.com/testtube)

AV1 Beta Launch Playlist

[https://www.youtube.com/playlist?list=PLyqf6gJt7KuHBmeVzZteZ...](https://www.youtube.com/playlist?list=PLyqf6gJt7KuHBmeVzZteZUlNUQAVLwrZS)

And click "stats for nerds", if it's working it should show "av01" under the Codecs tab.

[https://i.imgur.com/eKTFaYU.png](https://i.imgur.com/eKTFaYU.png)

<comment><USER7> Thanks, I used the Halo video[0] to compare, a couple of notes. \- Youtube seems to have limited the AV1 support to 1080p, 1440/2160p are not available, anyone any idea why? \- The load on my CPU (MB Pro 2018 quad-core/ FF DE 67.0b9) seems about the same but I do seem to be dropping significantly less frames, not sure though.

[0] [https://www.youtube.com/watch?v=Fmdb- KmlzD8&list=PLyqf6gJt7K...](https://www.youtube.com/watch?v=Fmdb- KmlzD8&list=PLyqf6gJt7KuHBmeVzZteZUlNUQAVLwrZS&index=6)

<comment><USER8> > Youtube seems to have limited the AV1 support to 1080p, 1440/2160p are not > available, anyone any idea why?

They probably don't reencode 1440+p (there are 8K videos too) in AV1 as of yet.

</comment></comment></comment><comment><USER9> No mention of power efficiency though. Hardware decoders are good for more than just performance.

</comment><comment><USER10> On the one hand this is great, it's hard to argue that it isn't a good thing to have a very fast CPU-based AV-1 decoder built into Firefox.

On the other hand, I'm wondering how long this decoder will be relevant, especially considering it could still take a while before AV-1 video will be widespread on the web. I fully expect everyone and the kitchen sink will have hardware decoding before long, which is vastly superior over any software implementation.

<comment><USER11> > our latest figures showing that 11.8% of video playback in Firefox Beta used > AV1

It seems remarkably popular already.

<comment><USER12> YouTube started testing AV1 - I would not be surprised to learn that's most of that number alone. Video format market share is tricky to measure because just a few sites like YouTube, Netflix, Vimeo, Twitch, etc. represent a huge fraction of the total streaked bandwidth even though there are so many other sites which publish video on the web.

<comment><USER13> Yeah, last I remember, Netflix and Youtube alone use something like 50% of the internet's entire bandwidth. Video is pretty data heavy though so I'm sure there's a huge push to switch to something more efficient.

</comment></comment></comment></comment><comment><USER14> About half of the frames get dropped for me. [https://i.imgur.com/MeLQXST.png](https://i.imgur.com/MeLQXST.png)

</comment><comment><USER15> Has anybody published an analysis that clearly demonstrates AV1's compression efficiency over HEVC?

I've seen claims of benefits, and analysis versus h.264, but not the clear evidence that HEVC is going to become obsolete.

<comment><AUTHOR> Here's one. See the "High Quality (AV1) Report":

[http://www.compression.ru/video/codec_comparison/hevc_2018/](http://www.compression.ru/video/codec_comparison/hevc_2018/)

As for HEVC's obsolescence, Leonardo Chiariglione, founder and chairman of MPEG, thinks AV1 has the bigger future because HEVC's licensing is too messy:

[http://blog.chiariglione.org/a-crisis-the-causes-and-a- solut...](http://blog.chiariglione.org/a-crisis-the-causes-and-a-solution/)

</comment></comment><comment><USER16> still can't get smooth 4k60fps vp9 playback when using speed more than 1.5x on youtube, meanwhile in chrome it works fine

<comment><USER17> I know you're serious but it's hard to take that complain seriously.

<comment><USER16> I mean it's the only way u can watch steve from gamers nexus without falling asleep from his voice, great content otherwise...

<comment><USER17> I don't need to see Steve in 4k60fps though... I mean his hair flips are epic and all but still.

<comment><USER16> True, but if I am watching videos I'm feeling lazy and I shouldn't have to turn down resolution just for his videos because they're in 60fps instead of 30 when in Chrome it works fine (I'm using tampermonkey script which switches all videos to the highest resolution with 4k as a limit).

</comment></comment></comment></comment></comment><comment><USER18> Any updates on the free hw decoder by Google? I am hoping to test it on a FPGA (if possible)

</comment><comment><USER19> So this basically brings Firefox on par with Chromium, which was already using dav1d?

</comment><comment><USER20> Why isn't there a sample?

<comment><AUTHOR> Try it on YouTube. Turn on AV1 via TestTube: [https://www.youtube.com/testtube](https://www.youtube.com/testtube)

Try the AV1 test playlist: [https://www.youtube.com/playlist?list=PLyqf6gJt7KuHBmeVzZteZ...](https://www.youtube.com/playlist?list=PLyqf6gJt7KuHBmeVzZteZUlNUQAVLwrZS)

And you'll find many other YouTube videos encoded in AV1 up to 720p. Try popular music videos or movie trailers for examples. Check that it's AV1 by right clicking on the video and selecting Stats for Nerds.

</comment></comment><comment><USER21> Wish they could fix full-range video (for any format) playback first :/

<comment><USER22> I've filed bugs about this before, part of the problem is that every node in the chain needs to handle video ranges correctly. Once you introduce hardware decoders you can be in bad shape here because the range becomes a guess. Depending on which GPU vendor you have and what OS you're on, there may be a system-wide default output range (and a separate default for videos without range information), and the range assumptions may depend on application. If you use nerdy video compositors like madVR you can get them to tell you how much info they have on video ranges, and in many cases the answer is 'none' so they guess. At least on Windows, it is a fact that some of the range issues are not under Firefox's control, because some of this stuff is delegated to the decoder and to the video driver. (You can configure it in NVIDIA's Control Panel application, fwiw.)

In practice people seem to solve this by just using limited range all the time because it's much better to have limited range content displayed without expansion than to have full range content erroneously limited->full expanded and have a bunch of the range destroyed. If you try to stream to Twitch, for example, they tell you to use limited range, and it will look VERY bad in most players (not just Firefox!) if you disregard the advice. I've also had problems with full range uploads to YouTube that can't be attributed to Firefox.

EDIT: Checked my bug history. For the NVIDIA + Windows + Firefox combo, here is the workaround for range issues along with an explanation of why Mozilla has no way to fix it in this scenario. [https://bugzilla.mozilla.org/show_bug.cgi?id=1229304#c8](https://bugzilla.mozilla.org/show_bug.cgi?id=1229304#c8)

<comment><USER21> Firefox does not support full-range video _at all_ , even with software decoding.

See bug ticket: [https://bugzilla.mozilla.org/show_bug.cgi?id=1459526](https://bugzilla.mozilla.org/show_bug.cgi?id=1459526) Or just test this: [https://bug1459526.bmoattachments.org/attachment.cgi?id=8984...](https://bug1459526.bmoattachments.org/attachment.cgi?id=8984703)

Firefox's video support in general is pretty poor compared to Chrome. It doesn't support RGB or 4:4:4/4:2:2 YUV video either.

>here is the workaround

I knew that bug too, but that's a different story. That is about Firefox having problem to playback _limited range_ video properly with nV graphic card (and it's partially nVidia's fault than Firefox).

Chrome used to have that bug too, but they have fixed it.

(Firefox team on the other hand, didn't plan to fix it for Win7 at least: [https://bugzilla.mozilla.org/show_bug.cgi?id=1410693#c1](https://bugzilla.mozilla.org/show_bug.cgi?id=1410693#c1) ).</comment></comment></comment>


Ask HN: Morse code easter eggs - <AUTHOR> I wanted to insert a visible but really discreet morse code easter egg on my company website and I'm curious if anyone knows other websites that have done something similar. I will not put the URL here because I don't want it to look like I'm promoting my company or anything, but I would really want to see how/if others have done this. I've added it as an "active" selector for the "what we do" menu item. The morse code basically explains in two words what we do :) <comment><USER2> Somewhat related:

Columbia is notorious for kidnappings, with kidnapping victims often being held for as long as 12 years.

The Columbian military teamed up with musicians to create a song, with the following message in morse code embedded in it:

"Nineteen people rescued. You are next. Don't lose hope."

Because many of the kidnapped victims were ex-military, they hoped that they would be able decode the message embedded in the song.

They played the song on the radio for months, reaching millions of people.

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

</comment><comment><USER3> does bathroom tile count? [http://studiowhimsy.blogspot.com/2010/08/pike- place-market-s...](http://studiowhimsy.blogspot.com/2010/08/pike-place-market- secret-message.html)

</comment><comment><USER4> [http://qi.com/infocloud/morse-code](http://qi.com/infocloud/morse-code)</comment>


Ask HN: TN-1 to H1-B or Green Card - <AUTHOR> I'm a Canadian currently on a TN-1 visa. What's the best way to transition to H1-B or Green Card? Can I apply for an H1-B while being on the TN without any repercussions?<p>Thanks! <comment><USER2> Disclaimer: don't take this as a legal advice, consult with your employer's immigration lawyers.

From my experience: yes you can apply for H1-B while on TN without repercussions. I've been through this several times before winning the lottery.

<comment><USER3> Isn't it the case that you can't leave and re-enter the US after doing that though?

Edit: re-enter OR renew your TN.

<comment><USER2> I think it's the case with TN to green card transition, which is also technically possible but lies in legal grey area.

As far as I understand TN-1 to H1-B is a straightforward and above the table process: my employer's lawyers OK-ed all my trips and didn't warn me about any potential complications on the border. But again, do not take it as a legal advise, I'm speaking from my limited personal experience.

<comment><USER3> Gotcha, I was thinking of the Green Card application. H1-B is dual-intent, so all above board there.

</comment></comment></comment></comment><comment><USER4> get married</comment>


The Value of Water on the West Coast - <AUTHOR> https://news.vice.com/article/the-value-of-water-on-the-west-coast-and-why-california-is-so-screwed?utm_source=vicenewsfb

<comment><USER2> _Energy companies use billions of liters of the province 's surface water for fracking natural gas, and only paid slightly more than a dollar per million liters_

That's on top of what the bottling companies use (hundreds of million liters for bottlers) for a few dollars.

This pricing does not look like water is a sparse commodity and so much on the difference it makes not to water your lawn.

</comment><comment><USER3> Water should be a public resource that is controlled. When it comes to corporations making profits off of a resource they pay almost nothing for, this is a travesty to the public good. I pay local taxes to support water purification, but I don't profit for it - I shouldn't be subsidising profitable businesses.

</comment><comment><USER4> There is a long (and, to me, fascinating) history behind the current water distribution situation in the western US. Authoritative book on the subject is Marc Reisner's "Cadillac Desert."</comment>


A Visual Expedition Inside the Linux File Systems - <AUTHOR> http://www.cs.jhu.edu/~razvanm/fs-expedition/ <comment><USER2> Great document, a joy to explore. Does anyone know of similar documents, exploring deeply technical topics with visual language?

<comment><USER3> There is a document on CPU memory by Ulrich Drepper :

[http://www.akkadia.org/drepper/cpumemory.pdf](http://www.akkadia.org/drepper/cpumemory.pdf)

Also see other articles by Ulrich.

</comment></comment><comment><USER4> Beautiful formatting and diagrams.

<comment><USER5> Yeah, I kept thinking it was a PDF or something and was amazed it wasn't.

It also loaded really fast.

</comment></comment><comment><USER3> It looks interesting but I just skimmed over it. Not sure how useful the info will be.

I'll definitely have a more detailed look later.

Thanks for posting.</comment>


The Most Diverse Cities Are Often the Most Segregated - <AUTHOR> http://fivethirtyeight.com/features/the-most-diverse-cities-are-often-the-most-segregated/ <comment><USER2> This doesn't surprise me. People tend to self-segregate. All else being equal, people will tend to live near other people of similar backgrounds.

Now let's say you're a purple person (fictional race chosen to avoid invoking any unintended implications) moving into a town that's 50% purple and 50% green. There are lots of places to live near other purple people. Some of those places will probably be places you like and can afford. So you'll naturally join your co-purpleists.

Now let's say you move to a different city that's 5% purple and 95% green. There's probably only a couple of places where you can live among other purples. Odds are pretty good that those places don't suit you. You'll be much more likely to choose to live among the greens.

<comment><USER3> Here is an agent based simulation that illustrates this concept:

[http://nifty.stanford.edu/2014/mccown-schelling-model- segreg...](http://nifty.stanford.edu/2014/mccown-schelling-model-segregation/)

<comment><USER4> One interesting thing of note about the Schelling segregation model is that you still get segregation/clumping even when the threshold is relatively low:

>For the remainder of this explanation, let's assume a threshold t of 30%. This means every agent is _fine with being in the minority_ as long as there are at least 30% of similar agents in adjacent cells.

In addition, when the threshold is too high, there's a large amount of churn that happens, due to constantly dissatisfied agents moving around and having "undesirable" agents coming in.

I wonder if there has been work on adjusting the Schelling segregation model to give different threshold/"tolerance" values to different types of agents.

I also wonder if there have been attempts at applying this model to real-world racial data. Given the several most recent recordings of census data for race, could there be an analysis that concludes, "the arrangement we have is, if assumed to be a Schelling segregation model, most likely to have arisen as a result of a tolerance threshold of X%"?

<comment><USER5> One thing I found fascinating is that, with a sizable majority (I set red to around 80%), the minority actually becomes _less stable_ if you set a moderately low threshold for moving. With a high threshold (like t=67%) you get very rapid clumping as both reds and blues try to move into areas where they're in the majority. But with a low threshold (like t=25%) the few majority people who are isolated move, minorities quickly fill the open spots, and then the only remaining locations for minorities are completely surrounded by the majority (while no more majority members ever move). So the minorities just shuffle around between a bunch of unacceptable locations, none of which give them the 2 minority neighbors they require. Then there's a sudden transition when t gets low enough, at around 16% -- the minority will tolerate having only one similar neighbor as long as there's also an empty spot, and therefore they stabilize very quickly.

So when the threshold is high, there's a lot of churn early but then stabilization. When the threshold is low, the tolerant majority stops churning quickly and therefore stops opening up spots the minority finds desirable.

</comment></comment></comment></comment><comment><USER6> Not sure why it claims maximum diversity is ideal. In NYC people often prefer to live in the neighborhood of their ethnicity where there will be many stores with what they like, in their language, and many speakers of their native language among other benefits.

<comment><USER7> I'm not sure why maximum integration is considered ideal either.

<comment><USER8> I do consider maximum integration ideal.

The more you segregate people, the easier it is to start wars and other violent conflict. Many Americans have no problem with bombing (or droning) Iraqis, for example. There would be more outrage if you droned black people in Baltimore. But even in Baltimore the segregation causes problems.

It's just human nature, to create in-groups and have special morality for them, and modern societies should fight it, by intermixing people. Democracy and social equality are good instruments to do so. Ideally on planetary scale, but were not there yet.

It can also be seen as a tradeoff. With segregation, you get a more closely knit community in the inside, but less to the outside. Conflicts occur in both scenarios, but there are different ways to dissipate it. Interacting with people you don't know that well dissipates the conflict often and by very little, which may be frustrating and lead to less happiness. Closer-knit community may dissipate conflict to the outside at once, with violent results. So it's really choose your poison situation - be perpetually unhappy in individualism or be happier now but risk a larger war from time to time.

</comment></comment></comment><comment><USER9> Robert Putnam's research has also shown some of the complications that come with diversity:

[http://onlinelibrary.wiley.com/doi/10.1111/j.1467-9477.2007....](http://onlinelibrary.wiley.com/doi/10.1111/j.1467-9477.2007.00176.x/full)

He does not support the conservative interpretation of his work that "diversity is bad":

[http://chronicle.com/blogs/percolator/robert-putnam-says- his...](http://chronicle.com/blogs/percolator/robert-putnam-says-his-research- was-twisted/30357)

<comment><USER10> I don't think conservatives believe diversity is "bad", just that it's not worth stacking the deck in otherwise merit-based processes to produce.

<comment><USER2> I've seen plenty who think diversity is outright bad. There are plenty more who think as you say, of course.</comment></comment></comment>


Ask HN: TeachyourselfCS or FunctionalCS which to choose to self learn CS? - <AUTHOR> Hi HN. Hope you're all safe at home without getting infected. I'm looking to self learn computer science especially since I have a lot of time wfh currently. I already have a background in programming and data structures. I was hoping to follow a curriculum to fill in the gaps I have.
I came across 2 resources
* https://functionalcs.github.io/curriculum/
* https://teachyourselfcs.com/
Can anyone please give me feedback on which one to follow / which is better and why? Any feedback about the resources would be much appreciated. Thank you so much. <comment><USER2> I've been following teachyourselfcs and I find it great. The resources mentioned are top notch. I just had a look at the functionalcs link and it seems to have 2/3 resources per subject compared to 1 per subject in teachyourselfcs. I feel this will make it more easy to not get stuck with paralysis by analysis.

I don't know if the other curriculum is superior or not though. Someone more experienced should pitch in regarding that.</comment>


California voters to get mail-in ballots for 2020 election - <AUTHOR> https://www.reuters.com/article/us-health-coronavirus-usa-california/california-voters-to-get-mail-in-ballots-for-2020-election-governor-idUSKBN22K2T3 <comment><USER2> This is important not only for the Presidential election (which is mostly a foregone thing anyway), but is a big boon to all the down-ballot races. Folks will have time to research other choices at home.

More than that, main-in ballots go a long way towards reducing voter disenfranchisement. No need to wait in long lines (way easier if you've got a job that allows that!) or take time off work on a Tuesday.

Honestly, there's no good excuse for all states not following suit.

<comment><USER3> > Folks will have time to research other choices at home.

How does this have any relationship whatsoever to the way in which the vote is cast?

People can already research to their hearts content without mail-in-voting.

<comment><USER4> Assuming you're asking in good faith it's a lot easier with mail in voting because when you get the ballot you can see all the names and search each category before choosing.

It's easier than also having to find out what is on the ballot, searching, and then remembering each person when you go.

I usually spend a couple hours at home voting and searching before sending the mail in, something that would be a lot harder to do effectively if I had to go in person.

<comment><USER3> I understand what you're saying, but why not just mail people the ballot information ahead of time without actually casting votes? Let them pencil it in and bring it with them?

<comment><USER5> If you're already mailing people the ballot information, what do you gain by asking them to then come in person to the polling station? It's an objectively simpler user experience. You're asking a lot of people to research ahead of time, make their decision, save that decision for election day, and then make time in their busy workday to go wait in line to vote.

</comment></comment></comment></comment></comment><comment><USER6> Just yesterday a plan for a mail-in election was scrapped in Poland. It was an extremely rushed thing (the voting was to happen this Sunday), but from what I understand, the plan was to at least have designated mailboxes. This would allow to somewhat track what happens with the ballots. A giant post service's delivery operation was stopped at the last moment. I haven't seen the concerns about secrecy of voting, and voting for other people in your house, properly addressed. Now the ruling party promises work on "better regulations" before the actual presidential election.

I'm really curious how Americans will handle all this.

Generally, I'm very skeptical about all cute ideas that complicate voting and may introduce doubts about its legitimacy. The whole point of a vote is that the elected people have a strong title to whatever prerogatives they have.

<comment><USER4> California has had mail in voting for years.

This is just extending it to everyone by default.

<comment><USER6> This (partial mail-in voting) also has been available in many European countries, but you had to qualify e.g. with a physical disability. I think when there is fewer of such votes, it can be easier to ensure that they are legitimate and pay attention to the procedures. You know to expect only a few of them, for example.

I've also heard about postal voting in Britain producing many problems when there were wider experiments with it[1].

[1] [https://www.theguardian.com/uk/2005/apr/05/politics.localgov...](https://www.theguardian.com/uk/2005/apr/05/politics.localgovernment)

<comment><USER7> Well, California had 8.5 million mail-in ballots in the last national election, 65% of the total. Mail-in voting in California was available to everyone even before this, not just to people meeting special criteria.

This just makes it the default.

<comment><USER6> I was interested about the source, and apparently you can check these numbers here[1]. I don't say that this solves the problems for me, but an interesting statistic nonetheless. Seems like another example of American politics being very different.

[1] [https://www.sos.ca.gov/elections/historical- absentee/](https://www.sos.ca.gov/elections/historical-absentee/)

<comment><USER8> It's California in this case but not every state allows this. Some states, for example, will make you wait in long lines in the middle of a global pandemic just to vote.

</comment></comment></comment></comment></comment></comment><comment><USER9> This is a important step, assuming if the US Postal Service doesn't get gutted before it happens.

A major RNC donor is poised to become the next Postmaster General of the USPS and it's part of the current administration's plan to surely gut/privatize the USPS and suppress mail-in votes. [http://www.washingtonpost.com/politics/top- republican-fundra...](http://www.washingtonpost.com/politics/top-republican- fundraiser-and-trump-ally-to-be-named-postmaster-general-giving-president-new- influence-over-postal-service-officials- say/2020/05/06/25cde93c-8fd4-11ea-8df0-ee33c3f5b0d6_story.html)

<comment><USER10> HN is about one step away from becoming reddit with this type of baseless speculation. There is no indication this administration wants to suppress votes, the president has explicitly said he wants to institute voter ID's to protect the security of our elections, but you're going to take the word of a WP reporter who've perverted every statement he has ever made? The opposition is suspiciously against voter ID by the way.

<comment><USER11> Donald Trump is a pathological liar; I am skeptical of every word that comes out of his mouth.

He has also come out against mail-in voting since he feels it will destroy GOP chances at the ballot box. So yes, I do believe Trump is more concerned about voter suppression then election security.

[https://lawandcrime.com/2020-election/trump-says-gop- would-n...](https://lawandcrime.com/2020-election/trump-says-gop-would-never- win-again-if-democrats-voting-provisions-made-it-into-stimulus-bill/)

</comment></comment></comment><comment><USER12> California already has mail-in ballots, FYI. All this order does is send them to all registered voters instead of just those who requested a mail-in ballot.

</comment><comment><USER13> This thread has two or three very vocal, antagonistic and ignorant actors using lazy rhetorical tactics to agitate, deflect and confuse what is a very straightforward topic: mail in voter fraud doesn't exist and aggressive attempts to say it does are a part of a large, discriminatory and frankly old set of tactics of voter intimidation. These posters offer no evidence of the fraud they are FUDing up because there is none.

</comment><comment><USER14> We can just pencil in a California Biden win now.

<comment><USER15> Perhaps, but we already could.

</comment></comment><comment><USER16> Until Team Trump starts recruiting 'thousands of volunteers' to assist voters.

</comment><comment><USER3> Yikes. How are they determining if a resident moved away from CA? What about if they're dead? What about if they're voting for another relative, friend, or neighbor that isn't paying attention?

It seems that without voter ID, this is destined for fraud.

<comment><USER17> When you mail in your ballot you sign it, and the signature is checked to verify it is yours. If you vote for your friend or neighbor, then you need to steal their ballot and forge their signature. You also need them to not notice that they didn't get a ballot and not report it missing/stolen. The rest of the questions apply equally to in-person voting, which are all figured out.

Voter fraud also almost never happens because the person committing the fraud is taking enormous risk for literally zero gain. People aren't stupid. Most people don't even vote anyways, why are they going to go to all this effort to commit fraud.

<comment><USER14> > signature is checked to verify it is yours

Are you sure? That doesn't seem right. How are they verifying it?

<comment><USER17> With voter ID, how do poll workers verify the person on the ID is you?

The answer is the same. They look at it. This isn't rocket science.

<comment><USER18> A government issued ID complete with matching home address and picture is a LOT more difficult to fake than just some scribbling on a piece of paper. Even better - swiping the card and running the data on the magstrip on the back and comparing to what the government has on that ID is almost impossible to forge.

Who didn't forge their parent's signature in grade school once in a while? It's trivial to fake signatures - particularly since most people aren't trained Graphologists.

Heck, my local grocery store requires me to swipe my government issued ID just to prove my age to buy some beer... they scan your government issued ID to get into some bars and clubs even... but we won't allow that at the voting booth?

<comment><USER19> > Who didn't forge their parent's signature in grade school once in a while?

True. But a malicious actor would need to forge hundreds or thousands of signatures convincingly. And firstly get their hands on the signature database.

<comment><USER18> Or just make up signatures that have the person's name in them.

I highly, highly doubt and am very skeptical of this supposed signature database and how well it can verify a person's signature. It just sounds like hocus pocus to me.

<comment><USER19> > I highly, highly doubt and am very skeptical of this supposed signature > database

Why? California DMV has your signature on file when you get a driver's license.

> how well it can verify a person's signature.

I think people do that, not software.

<comment><USER18> > California DMV has your signature on file when you get a driver's license.

They make you sign on a small digital screen that barely registers your pen movements. The one on my license looks like a 3 year old drew some scribbles on it. It definitely doesn't resemble my pen-and-paper signature and I can't be alone in that.

> I think people do that, not software.

How can they get through 15-30 million ballots in anything resembling a timely manner? This entire thing sounds made up it's so absurd.</comment></comment></comment></comment></comment></comment></comment></comment></comment>


ClojureScript: Graal.js REPL Environment - <AUTHOR> https://clojurescript.org/news/2018-11-02-release#_graal_js_repl_environment <comment><USER2> Additionally, the Graal team has done some great work to ensure that the JavaScript produced by ClojureScript runs quickly under Graal.js. For more details, see [https://github.com/graalvm/graaljs/issues/29](https://github.com/graalvm/graaljs/issues/29)

</comment><comment><USER3> Polyglot Ruby is invoked from Clojurescript which transpiles to JS which runs on GraalJS implementation running on GraalVM extension to the JVM?

this is both impressive and terrifying.

<comment><USER4> Yea, I'm sure it's impressive work far beyond my skills, but that sounds like a monument to complexity. There are a lot of things to not like about Smalltalk, Forth, and Lisp, but their systems seem to be so much more knowable.

Put another way, I question the longevity of these franken-systems. I doubt people will be maintaining each one of those layers in 10 years let alone 40. I used to make fun on Cobol and Fortran a lot, but now see that we've traded some inefficiencies for a large jump in systems complexity. Yea it only takes 5 pages of code for your app, but another million are being executed. I guess the economics make sense and the developer speed of development and more systems to target makes it worth it.

<comment><USER5> Have you tried to make a "Hello world" in Microsofts latest creation? Far away are the days of 58 bytes hello world examples.

<comment><USER4> I'm mostly a high level dynamic language guy, but have played with hello works in Nim, D, Ada, C++, and C on Linux and Windows.

I believe most are in the 400kb range iirc.

<comment><USER4> Just tried GFortran on Linux and it was 16kb if that helps.

</comment></comment></comment></comment></comment><comment><USER6> So happy to see options for Cljs expanding. Glad I took those horrendous NodeJS dev jobs after a year of Clojure in the data pipeline, for the modern JS RT exp. I am just chillin' out of tech and waiting for things like this to make me employable again, as I build my dream stack at Starbucks each morning. It's like waking up is going into the dream lately :).

<comment><USER7> I've had a wonderful time designing a Santorini (the board game) clone[0] in clojure/script. The game logic is written once and used on the client for local play and on the server for realtime multiplayer.

The polymorphism clojure offers (multimethods here) came in handy for dispatching websocket messages, and for drawing pieces onto the board.

[0] [https://buildtowers.club](https://buildtowers.club)

</comment></comment><comment><AUTHOR> Supports GraalVM 19.0.0

[https://twitter.com/mfikes/status/1126627560157253632?s=21](https://twitter.com/mfikes/status/1126627560157253632?s=21)</comment>