What can I do with dynamic typing that I can not do with static typing? - <AUTHOR> http://programmers.stackexchange.com/questions/167305/what-can-i-do-with-dynamic-typing-that-i-can-not-do-with-static-typing <comment><USER2> Lots of people don't realize that strong/weak typing is orthogonal to static/dynamic typing. Strong typing systems will throw an error if the wrong type is used. A weakly typed language will attempt to coerce or cast the variable. Python is much more strongly typed than both Javascript and C.

Another dimension is the explicitness of your variable languages. This isn't quite orthogonal since static languages have to allow you to specify a type and dynamic languages have to have some way for you to not specify a type but many static languages allow you to infer a type and many dynamic languages allow you to specify types. (You can always use asserts if they don't explicitly allow it).

My point is that inferred types always have the potential to provide surprising results. It is unlikely in static languages, but it's possible. If you've defined "square x = x * x" it will allow you to square anything that has the splat operator defined for, even if that would be nonsensical. For that reason inferred static languages generally don't overload the splat operator, so it's a bad example. But I hope you still get my point.

<comment><USER3> _re: strong/weak/dynamic typing, coercion & overloading_

And the mix can produce interesting results. For eg. in Python:

      def double(x):
        return x * 2

      print double(2)    # => 4
      print double("X")  # => XX

If you were expecting a number to be returned then this isn't good :(

The * operator isn't overloaded in Perl so instead we get:

      sub double { $_[0] * 2 }

      say double(2);    # => 4
      say double('X');  # => 0

Perl is more _weakly_ typed than Python so 'X' get coerced to zero with the multiplication operation. So at least a number is returned but I would prefer a warning or error:

      use warnings;
      say double('X');  # produces runtime warning

      use warnings FATAL => 'all';
      say double('X');  # produces runtime exception

</comment></comment><comment><USER4> You can use a function with different types in a way the original programmer didn't think about. Obviously this has good and bad aspects.

My "whoa" moment with python typing came when I implemented euclid's algorithm (for the gcd of two numbers). Shortly later, I wrote a polynomial class, and then I was able to use my original function on polynomials _without changing a single character_

In some statically typed languages that would be possible if I'd thought to write my original function generically. But at the time I hadn't even thought about calling it with anything other than integers.

<comment><USER5> Playing statically-typed advocate for a moment: in Haskell, you wouldn't have had to put a type down for the function, and the compiler would have inferred the type

        gcd :: Num a => a -> a -> a

which means it is a function that takes 2 a's and returns an a, with the restriction that a is of typeclass[1] Num, that is numbers. So, very much possible and assumed without thinking about it too much.

[1] A typeclass is a like an interface.

<comment><USER6> Well, pray that the library function is general enough. Unfortunately, this is not the case for your gcd type, as gcd can be generalized to arbitrary commutative rings.

Nevertheless, writing generic code is of course possible with static types.

<comment><USER7> Well... kind of. You _can_ define a gcd operation on arbitrary commutative rings, but two elements of the ring don't necessarily have a unique gcd. If you want a unique gcd for any pair of elements, you need to specialize your commutative ring to a unique factorization domain.

If in addition you want to write your gcd function using the Euclidean algorithm, you need to specialize again to Euclidean domains (of which polynomials and power series are an example).

The `gcd` function in the Haskell base library operators on Integral types, which are the programmatic representation of Euclidean domains, so I would argue that it is "general enough".

</comment></comment></comment></comment><comment><USER8> The main thing that I see dynamic languages as having over static languages is metaprogramming. See [http://stackoverflow.com/questions/8276387/statically- typed-...](http://stackoverflow.com/questions/8276387/statically-typed- metaprogramming).

Metaprogramming is prevalent in python/ruby, regardless of how confusing it is, because it is super useful. Being able to dynamically construct types and classes (e.g. via decorators in python) allows you to do tons of stuff that is otherwise really hard for library writers, even though you shouldn't be using metaprogramming all over the place day-to-day. Rails, SQLAlchemy and a ton of other libraries/frameworks use metaprogramming all over the place.

Static languages lack this ability, but because it's so useful, they end up re-implementing the same thing anyway but using reflection/bytecode- manipulation/extra-compile-hooks/code-generation/etc.. like in Spring/AspectJ/Play/ASP.NET!

Although the end result is kinda the same, I'd argue metaprogramming via generating java source code is way harder than metaprogramming in python, where creating a new class and setting its methods or descriptors is as easy as creating/fleshing out any other object. Given how powerful/useful metaprogramming is, I think that that's the biggest gain of dynamic over static languages.

<comment><USER9> _Static languages lack this ability_

 _cough_ MetaOCaml [1] _cough_

 _cough_ first-class modules in OCaml [2] _cough_

explanation -- MetaOCaml provides what is essentially a typed _eval_ for Objective Caml. OCaml's first-class modules provide the ability to construct types, classes, and modules at run time.

In other words, statically typed languages _do_ have this ability.

[1] <http://www.metaocaml.org/>

[2] [http://caml.inria.fr/pub/docs/manual- ocaml-4.00/manual021.ht...](http://caml.inria.fr/pub/docs/manual- ocaml-4.00/manual021.html#toc81)

<comment><USER10> Could you please stop with the "cough" parts? It's rude and it adds nothing to the discussion.

</comment></comment></comment><comment><USER11> Both can do the same (they are turing complete), but some things are harder to do in statically typed languages because of the underlying implementation, like reflection or eval().

Static typing is safer (more compile-time checks) but more verbose. Type errors are found by the compiler before the program runs.

With dynamic typing you write less, but requires better understanding of the underlying types so you don't get runtime errors. Type errors propagate through the program until it generates a runtime exception or wrong results.

<comment><USER7> Python (dynamically typed):

        def square(x):
            return x * x

Haskell (statically typed):

        square x = x * x

<comment><USER10> Can you do

      f = lambda r, a, b: r(a), r(b)
      f(lambda x: x, 5, "Test")

in Haskell without writing types?

<comment><USER7> For those who don't realise, the challenge is to write a function `f` that takes three arguments, the first of which is a function which is applied to the second and third arguments and returned in a pair.

The difficulty with doing this in a statically typed system is that once you've fixed the type of the function you pass in, you can't then apply it to two _different_ types. The standard way to solve this would be to specify that the function you pass in is valid for all types [1]

        f :: (forall s. s -> s) -> a -> b -> (a,b) -- [2]
        f r a b = (r a, r b)

        f id 5 "Test"   -- returns (5,"Test")

However, the challenge also specified that you do it without writing a type signature for `f`. I admit that in this case I am pretty stumped. The closest I can get is to first define a wrapper

        data S = forall a. Show a => S a
        instance Show S where Show (S a) = show a

and then write

        f r a b = (r a, r b)

        f id (S 5) (S "Test")    -- returns (5,"Test")

but that involves wrapping everything up before passing it into the function, to disguise the fact that we really have different types.

There's an interesting point to be made here, though - "wrapping everything up in one type" is essentially what dynamic type systems do, except that it's baked into the language instead of being implemented by the programmer on an as-needed basis.

Here, my declaration for the type S says "any type as long as it has a Show instance" (which allows it to be printed). I could instead have specified "any type that has a Num instance" which would mean that I could pass in a mix of ints and floats, and still do arithmetic with them. I get some of the benefits of dynamic typing (flexibility) but I still get to keep type checking.

The Python approach is "any type, and we'll check at runtime that it has the appropriate methods". So it's ultimately flexible, but as a result loses any form of compile-time checking.

Looking at it this way, I think that the challenge you've set me is one that cuts to the core of the difference between dynamic and static type systems. No, I can't write the function you want in a statically typed language without doing _something_ clever with types. But the clever thing I have to do with types is re-invent duck typing, but in a limited way which still gives me compile-time checking.

Anyhow, thanks for the insightful comment. It certainly made me think...

[1] This requires the language extensions ExistentialQuantification and Rank2Types, but neither of those are particularly controversial.

[2] Note that the type signature

        forall a. a -> a

is inhabited by exactly one function - the identity function. This carries over to the Python example too - the function `f` isn't safe to use unless the first argument is the identity function, which makes it a bit of a useless function to define in the first place.

<comment><USER12> >> There's an interesting point to be made here, though - "wrapping everything up in one type" is essentially what dynamic type systems do, except that it's baked into the language instead of being implemented by the programmer on an as-needed basis.

This is imprecise - a dynamic language does not really need to "wrap everything in one type" - look at Dart or Groovy. What makes it 'dynamic' is the dynamic dispatch. All dynamic languages I know dispatch based on runtime argument types, but this is only one particular _form_ of dynamic dispatch. Declaring types in dynamic language typically is used at runtime merely as an assertion, that at this point the argument must conform to the said type.

Dynamic dispatch differs from Polymorphic dispatch in the way that polymorphic dispatch takes in account the runtime type of the target (the object whose method you are calling), but the types of the parameters are fixed at compile time.

Many dynamic languages also provide a way to customize the dispatch logic (i.e. call a default handler if no match exists) - typically via some form of Meta Object Protocol. Often the dynamic languages provide features like higher order functions, continuations, pattern matching, etc. but this has nothing to do with their dynamicity - same features are available in some static languages as well.

</comment></comment></comment></comment></comment><comment><USER13> You can more easily make type-related coding mistakes that won't be caught until after your app is in the customers' hands.

<comment><USER14> I believe you, because that intuitively makes sense, but can anyone give me a typical real-world example where this could easily happen?

So an application, say a web application in Python using some framework, what kind of type-related coding mistakes could you make? And which ones would be subtle enough to only be caught after it's in the customer's hands? (assuming a reasonable minimum of testing before that)

I'm asking not out of disbelief, but just because I'm having a real hard time coming up with an example that makes me "yeah I'd fall for that and only realize until after I delivered".

Is it possible that maybe, just general good coding style in Python makes it so that either you don't even consider sending a `str` to a function that expects a `float`, or that if you do (something like that) it fails almost immediately with a run-time Exception, way before you think of delivering?

For most of my Python programs, once they're done, if you'd analyze them, the types sent over all code paths probably would be static :) I'd think it pretty strange if a program would suddenly call functions with different parameter types, depending on user-input, _unless_ you actively decided that it should do so by design (like something that handles arbitrary JSON-like structures), in which case you probably intend to restrict the amount of types it will be intended to handle.

So in that sense, you end up with what is mostly a statically typed program in the end, even if written in a dynamic language, no?

One thing I do agree that if your program is written dynamically typed and intends to keep on being very dynamic about its typing even after it's done during run-time then, yes, it's probably almost impossible to make sure it does not crash or throw exceptions, given arbitrary user input. But in that case, often this is expected, and not the kind of program you'd consider an end-user application, but rather a sort of tool script thing that can indeed crash on unexpected input. Which is also useful :)

So, and correct me if I'm wrong, but I'd conclude that the difference is that with dynamic typing, there's less red tape during development. But a well written program intended for end users probably ends up with mostly static types _de facto_ because otherwise it'd be fairly unpredictable. _However_ , if you'd have used a statically typed language, you would not have to assume "well written" because the static typing brings guarantees with it.

<comment><USER15> Some advantages of static typing show up in programming in the small. Errors in forgetting to check for null/nil/None are a common class of errors that are caught by many static type systems. Switch/match statements that leave out possibilities without providing a default (especially if a new value is added to an enum) are also common errors that are caught by some type checkers.

One hidden (and seldom discussed) feature of static type systems is that in multi-team projects, they can enforce and document abstraction layers between teams. I've even seen static type systems act as impartial arbiters when an argument arises as to if a given change broke one side of an abstraction barrier, or if the change merely exposed a latent silent bug on the other side of the abstraction barrier.

</comment></comment></comment><comment><USER16> The crucial moment in my understanding of dynamic languages was when I was learning about the Abstract Factory pattern by implementing it in PHP. After writing different factory classes and all the shenanigans I've realized that all of that can be replaced with a simple

      $instance = new $classname(param1, param2)

</comment><comment><USER12> In a dynamic languages you can do dynamic dispatch - i.e. dispatching based on the actual runtime type of the arguments of a function, as opposed on the declared or statically inferred type. That among other things obviates the need for the visitor pattern and can also be used as rudimentary form of pattern matching.

</comment><comment><USER17> You can generate fieleds of ORM objects based on the values returned by a query. If you're writing a game, you can represent in-game objects directly with language objects and add more properties and methods when they're modified.

In short, you can cut down on abstraction layers when working with behaviors that are inherently runtime.

<comment><USER18> Just use a dictionary or hashtable.

<comment><USER10> But then, what have you really gained? A more cumbersome syntax? Because that's still unverifiable by the compiler.

<comment><USER18> That's kind of my point.

</comment></comment></comment></comment><comment><USER19> The the core of it for me is you can almost always do x under a particular static type system. But you can almost always do the same thing under /any/ dynamic type system.

</comment><comment><USER20> Meta programming is much much easier in dynamically typed languages like ruby. It completely eliminates the use of interfaces, because you can call any method on any object. If you want to do it defensively, just check if the object has the method you want on it before calling it.

I think statically typed languages have a lot of ceremony around doing something, whereas dynamically typed languages just get out of your way.

</comment><comment><USER6> What you can do with your statically typed language obviously depends on the strength of the type system. Haskell for example is quite good, but Java is very limiting.

Luckily there is a workaround for Javas static typing limitation: Casts. Every time a Java programmer uses a cast, you can see that static typing has limits.

</comment><comment><USER21> In mainstream statically-typed languages, you can't build a generalized curry function.

(define curry (f . cargs) (lambda moreargs (apply f (append cargs moreargs))))

<comment><USER18> C++ isn't mainstream?</comment></comment>


What It's Like Working for TaskRabbit - <AUTHOR> http://time.com/money/3714829/working-for-taskrabbit/ <comment><USER2> The NY Times had a much more nuanced story recently: [http://www.nytimes.com/2014/08/17/technology/in-the- sharing-...](http://www.nytimes.com/2014/08/17/technology/in-the-sharing- economy-workers-find-both-freedom-and-uncertainty.html)

HN discussion of it: [https://news.ycombinator.com/item?id=8189034](https://news.ycombinator.com/item?id=8189034)

</comment><comment><USER3> Can you imagine how much growth there would be in this type of work if we had universal healthcare? That's probably the only thing keeping many people chained to a desk.

<comment><USER4> With obamacare there really isn't any excuse for not having health insurance.

<comment><USER5> Obamacare tripled the rates in my state, while not really providing anything over what was provided before.

Nationally, the last time it was reported, the average increase in insurance costs was around 2x.

Obamacare also does not provide coverage for anyone that is near, or makes less, than the poverty line. It simply mandated by pen, rather than by a way, that the states absorb those people on their medicaid program (though the fed does assume the majority of the cost at least till 2022).

So there are quite a few excuses for not having insurance, such as its now more expensive for a lot of people, especially the ones that can't afford it.

<comment><USER6> It sounds like you're talking about the Medicaid "donut hole." The ACA intended for states to expand Medicaid to cover the poorest Americans, but thanks to an unexpected supreme court challenge many Republican-controlled states opted not to expand Medicaid, putting a lot of people into the catch 22 of making too much to qualify for the existing Medicaid program, but not making enough to qualify for the new Obamacare subsidies. It's a crappy situation that's being rectified little by little as those states are cutting deals with the Obama administration.

Here's how you can hack the system, though. The IRS (who's in charge of enforcing the subidies) has determined that there's no penalty if you end up making less money in a year than you had estimated that you'd make. So if you make $20k per year, but you need to make $25k to qualify for a subsidy, you can just enter $25k at healthcare.gov, and you'll get the subsidy. If you end up making less than that when you submit that year's taxes, you won't be penalized, and you won't have to give the subsidy back. IANAL, etc.

</comment></comment></comment></comment><comment><USER7> Well done, Time, you've created a webpage that is unable to scroll without javascript.

</comment><comment><USER8> Would be interesting to read about the weirdest jobs these taskrabbiters had taken, but would not be surprised if there is already a subreddit for that.

<comment><USER9> [http://www.reddit.com/r/TaskRabbit/](http://www.reddit.com/r/TaskRabbit/)

</comment></comment><comment><USER10> I don't understand. The first example charges $150 an hour for general labor. Who would pay that much for unskilled labor?

<comment><USER11> For 150 an hour, you could actually attract skilled labor...</comment></comment>


Who Are The 15 Percent Of Adults Who Don't Use The Internet? - <AUTHOR> http://marketingland.com/who-are-the-15-percent-of-adults-who-dont-use-the-internet-59964 <comment><USER2> I think that poll is incredibly biased and wishful thinking. I have been through too many neighborhoods around the country where people had neither the means or interest to do anything whatsoever online. I know several public schools in my region where the only computers are in the offices. We who exist online with our bread and butter dependent online, want desperately to see it as the world, but in all honesty it is not even remotely pertinent of the majority.</comment>


Seismic waves reveal giant structures deep beneath Earth's surface - <AUTHOR> https://www.newscientist.com/article/2245939-seismic-waves-reveal-giant-structures-deep-beneath-earths-surface/ <comment><USER2> > The shear wave echoes from a single seismogram are difficult to distinguish > from random noise, so the researchers used a machine-learning algorithm > originally designed for identifying trends in large astronomy data sets.

How does one convince oneself that such a machine-learning algorithm is finding genuine signal in the noise, rather than just generating echoes of its training data?

<comment><USER3> I asked this question if it really was Machine Learning last time this was posted and I don't think it was (Feel free to correct me)

It's - [http://sequencer.org/](http://sequencer.org/)

Pseudo-code - [http://sequencer.org/static/images/image1.png](http://sequencer.org/static/images/image1.png)

I find it much more exciting than ML because it's both real and seems to be a simple online service for scientists, which is pretty cool.

A video on it - [https://www.youtube.com/watch?v=KN-N7l5spmE](https://www.youtube.com/watch?v=KN-N7l5spmE)

<comment><USER4> On a cursory look it seems to construct a distance matrix between all pairs of items, and look for a spanning tree with that distance metric that is "elongated" \- i.e., less branching. Straightforward enough.

There seems to be a bit more, involving iterating over different scales and over different distance metrics, but that's not particularly principled or efficient.

</comment></comment></comment><comment><USER5> [https://en.wikipedia.org/wiki/Phlegraean_Fields](https://en.wikipedia.org/wiki/Phlegraean_Fields)

</comment><comment><USER6> Does lower S-wave velocity imply high-viscosity liquid?

And might that be due to water? Maybe oceanic crust carried by deep convection?

</comment><comment><USER7> Creatures moving through solid rock...

<comment><USER8> The Devil in the Dark?

<comment><USER7> Sorry I can't remember! I was thinking of a short story by either Clarke or Asimov

</comment></comment></comment><comment><USER9> I blame the Mayans.</comment>


A Note from Cecil Adams about the Straight Dope - <AUTHOR> https://www.straightdope.com/a-note-from-cecil-adams-about-the-straight-dope/ <comment><USER2> The Straight Dope from Cecil Adams is like lots of that neat content that was essentially the internet before the internet.

Books and mags like MAD Magazine, Nintendo Power, comic books and more were where you learned about life and it's cynicism, sarcasm and fun aspects, some with great write-ins.

Malls/bookstores where you socialized, record stores and movie theaters where you got your pop culture.

Arcades, convenience stores like 7/11 and video/game rentals to entertain yourself and play with others, bike your way over to the nearest adventure.

Bulletin boards, mailing lists, IRC and message boards of the early internet were really great and in-depth.

All of that greatness is turning to vaporwave nostalgia.

So long Cecil.

<comment><USER3> > The Straight Dope from Cecil Adams is like lots of that neat content that > was essentially the internet before the internet.

You start with this, and then go into more examples of "content that was essentially the internet before the internet" like going to 7/11 with friends, reading Nintendo Power, and riding your bike. That sounds a lot more like missing your childhood than any cultural changes, especially when your pre- internet internet includes things like IRC and message boards. It seems like you're just using "internet" as a synonym for "the present".

> All of that greatness is turning to vaporwave nostalgia.

The only criteria for being included in "that greatness" is that you enjoyed it and it's not popular anymore: it isn't turning to nostalgia, it's nostalgia by definition.

Replace Cecil Adams and the Straight Dope with whatever you like, and this is just as fitting of a sappy eulogy.

<comment><USER4> The grandparent comment makes a nice point. Humans imbue their lived environment with meaning and functionality.

Our lived environment now includes a whole different element, that of being ever connected in the present to a global information network.

This means that there is a real loss, to society, of the utility of previously physical common spaces. People derived meaning and value there, and it has gone away.

Losing something meaningful and valuable is sad. The fact that it happens a lot doesn't make it less so.

Obviously, the WWW offers all sorts of opportunities to create meaning and value, perhaps more.

But something fundamental has changed, in that we now engage in important social activities through telecommunications and mediated is experiences. This is devaluing sone types of social infrastructure that previously provided these functions.

I think we have crossed a "social singularity," from which there is no going back. Similar to other technologies that changed human societies profoundly, and permanently.

The other I was trying to recall what it felt like to "not have the internet," and I couldn't get the feeling back, even though I lived half my life like that.

</comment></comment></comment><comment><USER5> The author's point should be well taken about the unique value of forums like the Straight Dope Message Board.

A lot of Internet culture comes from, or grows on, newsgroups, web forums, and subreddits. It's hard to quantify what good thing we get out of the existence of these communities -- there is not some metric I can point and say "this -- this is what these forums are worth". But I know it's a big deal.

Nice to see that they recognized the value and are keeping this particular community up and running.

</comment><comment><USER6> It's really cool he's been doing this for 45 years. I stumbled on The Straight Dope book in the 80s, and it's hard to describe how cool this was to read, pre-Internet. So much cool info in clever and hilarious format, I read it for hours and over and over. A big salute to Cecil Adams.

<comment><USER7> Yes, I devoured trivia troves like the Straight Dope, the bathroom reader series and predecessors, which for me were the Book of Lists.

It is funny to go back now and see ones which have obvious errors. They will always have a place in my heart, I'm tempted to pick up all the books now so I will have them to reminisce.

</comment></comment><comment><USER8> My dad had the entire collection of Straight Dope books, so when he found out that I was frequenting Snopes.com when I was 11, he told me that they would be right up my alley.

He was right. I immediately fell in love with the combination of trivia and dry humor.

I quickly read through the set, and even sent a letter to Cecil (he did not respond and my letter wasn't published, but I did get a letter back from one of his assistants answering my question).

All things must come to an end, but I'm sad to see it go.

</comment><comment><USER9> I think anyone who has been around the internet a while will hold SD fondly. I wish it had become what Snopes is used for, minus the shady owner and partisanship.

</comment><comment><USER10> I'll be forever annoyed at him for the incorrect answer here: [http://www.straightdope.com/columns/read/1260/how-does- one-s...](http://www.straightdope.com/columns/read/1260/how-does-one-suck-in- a-piece-of-spaghetti/)

(And yes, I emailed him but got no reply.)

The simple answer is yes, air pressure can push even something limp like spaghetti. And yes, if you increase the pressure the limp spaghetti will be forced in.

Think of a limp bag of water. If you push on the end it just buckles. But if you squeeze everywhere but one, water will come out of that spot.

But despite that, it's a great resource!

Anyone else remember imponderables (the books)?

<comment><USER11> > Anyone else remember imponderables (the books)?

I used to read those voraciously in the late 80s/early 90s. Going to the book store and seeing that there was a new one was such a treat.

I wonder what experience will be similar for my kids.

</comment></comment><comment><USER12> So, I just checked his wikipedia page, and was shocked to find out that Cecil Adams is not a real individual person. He's a pseudonym for a rotating collection of ghostwriters, like Franklin W Dixon.

<comment><USER13> I've looked at his Wikipedia page, but can't find where it says it is a collection of writers. All I see is that it is a pseudonym.

<comment><USER14> It is also not confirmed that it is a sole author... "The true identity of Adams, whether a single individual or a group of authors, has remained unknown."

Keeping an authorship pseudonymous successfully for 40+ years is rather unusual. I'd argue saying it is a sole author is at least as speculative as saying it is a group.

<comment><USER15> I think it's rather obvious...

Cecil Adams is Satoshi Nakamoto.

<comment><USER16> Both are John Galt.

</comment></comment></comment></comment></comment><comment><USER17> The book _Return of the Straight Dope_ (copyright 1994) has this question "Why do so many public buildings want you to use the revolving doors rather than the regular doors?" After a brief discussion about protecting against loss of air conditioned or heated air, Adams concludes with:

So much for the rationalizations. The _real_ reason you're told to use the revolving doors is so the real estate operators of the world can test your willingness to play ball. Do you follow directions and use the revolving door, or are you one of those independent types who insist on doing their own thing and entering through the swinging version? If the latter, be forewarned: when Donald Trump takes over, you're history.

I thought it was funny at the time.

</comment><comment><USER18> Whoever "owns" the SD is about to realize they dont actually own the value. It's a dynamic thing. Readers, writers, community with norms, culture, etc...

If I were them, I would work with the people who value TSD to find a successor and carry on a good thing.

</comment><comment><USER14> For those wondering... [https://en.wikipedia.org/wiki/Cecil_Adams](https://en.wikipedia.org/wiki/Cecil_Adams)

<comment><USER19> Well, it is obviously not one person, but Ed Zotti is the 'editor in chief' and has been for a long time. He is definitely the "heart" of Cecil Adams as I know him. Sure others are involved, but, Ed has admitted he writes most of Cecil's words.</comment></comment>


Cloudflare Workers: Run JavaScript Service Workers at the Edge - <AUTHOR> https://blog.cloudflare.com/introducing-cloudflare-workers/ <comment><USER2> This is probably the best annoucement of a new feature I have ever read. It makes an analogy to an existing technology. It provides a clear description of the new feature. It provides clear examples of how to use the new feature with a link to a sandbox so you can run and modify the examples. And it explains the thought process behind the implementation. In additon, I didn't notice a single typo, spelling or grammar error.

Also, this feature is pretty cool!

<comment><USER3> > I didn't notice a single typo

JavaScript is spelled incorrect all over the place.

Awesome feature and post!

<comment><USER4> That would be "incorrectly".... be careful with criticism.

<comment><USER5> do you mean that one must be completely flawless?

<comment><USER6> Only when you're being pedantic.

<comment><USER5> i guess that leaves one's fate in the hands of passers by.

</comment></comment></comment></comment></comment></comment><comment><USER7> Hey all! This is my project at Cloudflare.

(You may remember me as the tech lead of Sandstorm.io and Cap'n Proto.)

Happy to answer questions!

<comment><USER8> Hey Kenton, should've guessed you were behind this. Lovely design, great work.

I'd be curious to learn more about the implementation (did you lift the existing SW implementation from blink somehow, or reimplement it)?

<comment><USER8> PPS - it is probably too late for this, but one of the last things I worked on at Google was Gin:

[https://chromium.googlesource.com/chromium/src.git/+/lkgr/gi...](https://chromium.googlesource.com/chromium/src.git/+/lkgr/gin/)

A bindings layer for v8 that was specifically intended to make implementing web-style APIs outside of Blink easier. At the time at least, refactoring things like SW out of Blink was ~impossible.

<comment><USER7> Doh, indeed, wish I had seen that earlier. V8's raw API is... tricky.

<comment><USER8> Darn, I wish you'd seen it too :). Sounds like you came to similar conclusion I did -- using C++ templates to stamp out v8::FunctionTemplate and ObjectTemplate instances.

I was pretty happy about how Gin turned out and always thought it would be nice to put it on Github where it would be easier for people to reuse.

But at the time Chromium still didn't allow all the modern C++ features, so Gin had to depend on base::Callback, which made it hard to extract cleanly.

</comment></comment></comment></comment></comment><comment><USER9> Obligatory transformation of cloud to you-know-what:

[https://cloudflareworkers.com/#9bdc354e936c05a4a1d7df7eb0d7f...](https://cloudflareworkers.com/#9bdc354e936c05a4a1d7df7eb0d7f672:https://blog.cloudflare.com/introducing- cloudflare-workers)

<comment><USER10> [https://cloudflareworkers.com/#1f3220d90979ded0b1f5413db0eac...](https://cloudflareworkers.com/#1f3220d90979ded0b1f5413db0eacf40:https://blog.cloudflare.com/introducing- cloudflare-workers) this fixes the styling issues :D

</comment></comment><comment><USER11> Kudos for re-using an existing API when one was already available in the same language for a very similar usecase.

Any time you commit to someone else's API -- whether it's an actual industry standard, or simply some de facto widely used paradigm -- you incur risks; conversely, now that you're a vested participant, consider being involved in the future of the spec so it can evolve where it needs to meeting emerging needs around its new uses.

<comment><USER7> Absolutely! One reason we wanted to get this out in public before it's ready is so we can properly engage with the spec writers (and the V8 team).

That said, I am amazed by how well the spec fits as-is. I don't usually like other people's API designs but in this case I think they did a really good job, and I've been pleased not to have to think about API design myself.

</comment></comment><comment><USER12> Paging HN user johansch from his comment on the Cloudflare Apps mitm JavaScript injection discussion 3 months ago:

johansch: _All I want is my code running on your nodes all around the world with an end-to-end ping that is less than 10 ms to the average client_

dsl: _Akamai Edge Compute is what they are asking for_

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

</comment><comment><USER13> This is fantastic. Fastly is great but hard to use with Varnish VCL, and no other CDN had any real scripting capabilities. The service worker API is also a lot better than serverless cloud functions or lambda@edge.

</comment><comment><USER14> Great product announcement post! I especially liked the Q&A section's reasons for not choosing alternatives.

Is the lack of maturity also the reason for not choosing something like vm2 for NodeJS [https://github.com/patriksimek/vm2](https://github.com/patriksimek/vm2)

<comment><USER7> I actually didn't know about that one.

Looking briefly, it looks like it's based on creating separate contexts, but not separate isolates. Contexts within the same isolate can be reasonably secure (it's how Chrome sandboxes iframes from their parent frames, after all), but they still share a single heap and must run on the same thread. Isolates can run on separate threads. We prefer to give each script its own isolate, so that one script using a lot of CPU does not block other scripts. We also want to be able to kill a script that does, say, "while(true) {}".

So yeah, it looks like a neat library but it probably wouldn't suit our needs.

</comment></comment><comment><USER15> This sounds like a really powerful feature. I love how it uses JavaScript, which makes it much more approachable for web developers.

My experience with Service Worker APIs hasn't been very positive, although I don't have any suggestions for ways it could be improved, so I apologize for the non-constructive feedback. Maybe after using it more I'll change my mind. I recognize that everyone involved is likely working hard to provide an API that's capable of handling a wide range of problems, many of which I likely haven't even considered.

Here's a more actionable complaint: fetch doesn't support timeout or abortion. I have a hard time understanding how this isn't a problem for more people. Say what you will about XMLHttpRequest, at least it supports these basic features. As an end-user, I always find it absolutely infuriating when things hang forever because a developer forgot to handle failure cases.

I'd love it if you published a locally runnable version. Aside from making it easier to configure and experiment, it would give me peace of mind to know that I could continue to use the same configuration if Cloudflare decided to terminate my service.

<comment><USER7> Abortable fetch actually just recently became a thing, as in the Github issue was closed 9 days ago. More info:

[https://developers.google.com/web/updates/2017/09/abortable-...](https://developers.google.com/web/updates/2017/09/abortable- fetch)

We'll be implementing soon.

</comment></comment><comment><USER16> Could this be used for HTTP Push across domains? I would love an easy way to take advantage of HTTP Push for assets hosted on S3 without routing requests to my origin server.

<comment><USER7> Yes, your worker can make subrequests to other domains, and serving some assets out of S3 is a use case we specifically want to enable.

I haven't looked into how specifically to expose HTTP Push in the API but that certainly seems like something we should support.

<comment><USER17> Please, add support HTTP/2 push!

This is very, very awesome work. My team has been working on enabling the PRPL pattern[1] and differential serving on a few platforms, and edge caching has been a problem. We've tried to use Vary: User-Agent, but that leads to low cache hits. This API would let us to much smarter UA sniffing at the edge.

From there we just need to parse some responses like JS and HTML, to be able to push their sub-resources, for an instant speedup and great caching for fine-grained deployments.

[1]: [https://developers.google.com/web/fundamentals/performance/p...](https://developers.google.com/web/fundamentals/performance/prpl- pattern/)

<comment><USER18> Http/2 push is interesting here. Beyon static assists I wonder about read API orchestration or equivalent of graghQL on edge. I.e a single request comes in and it's broken apart against catchable resources and pushed back to the client from cache where possible.

<comment><USER7> That's actually one of the canonical use cases we thought about while designing. It seems splitting graphql queries into cacheable chunks is a common need.

</comment></comment></comment></comment></comment><comment><USER19> So in a way this is similar to for example AWS Lambda ? It can process incoming http requests in many ways ? Fascinating idea.

Is there any indication on price level ? And what about runtime duration ?

<comment><USER7> It's actually somewhat different. AWS Lambda is intended to act as your origin server. Generally your Lambda functions run in a small number of locations, not necessarily close to users.

Cloudflare Workers will run in all of Cloudflare's 117 (and growing) locations. The idea is that you'd put code in a worker if you need the code to run _close to the user_. You might want that to improve page load speed, or to reduce bandwidth costs (don't have to pay for the long haul), or because you want to augment Cloudflare's feature set, or a number of other reasons. But, generally, you would not host your whole service on this. (Well, you _could_ , but it's not the intent.)

We haven't nailed down pricing yet, but we've worked hard to create the most efficient possible design so that we can make pricing attractive.

<comment><USER20>
      We haven't nailed down pricing yet

One of the things I like about AWS is the price doesn't jump from $0/year directly to $240/year the way cloudflare does.

<comment><USER21> Indeed, this would be the second product announcement from Cloudflare in 3 days that didn't have any pricing available.

</comment></comment></comment></comment><comment><USER22> Have you guys considered side channels?

Seems like whenever there's co-execution (VMs, JavaScript, etc) there seem to be side channel leakages.

<comment><USER7> We're certainly aware of them, but haven't spent a lot of time focused on this issue yet. Of course, the issue exists on all forms of shared compute. So if you're going to do crypto, you'd better make it constant-time. Which is... not easy in Javascript. (But we will provide the WebCrypto API, which might help.)

There is a theoretical solution that we might be able to explore at some point: If compute is _deterministic_ \-- that is, always guaranteed to produce the same result given the same input -- then it can't possibly pick up side channels. It's possible to imagine a Javascript engine that is deterministic. The fact that Javascript is single-threaded helps here. In concrete terms, this would mean hooking Date.now() so that it stays constant during continuous execution, only progressing between events.

That said, this is just a theory and there would be lots of details to work out.

<comment><USER23> > There is a theoretical solution that we might be able to explore at some > point: If compute is deterministic -- that is, always guaranteed to produce > the same result given the same input -- then it can't possibly pick up side > channels.

Doesn't this require the timing and interleaving with other processes also be deterministic? ...which seems hard to guarantee with modern CPUs, async IO, and shared execution.

<comment><USER7> If you don't provide (real) time as an input to the program, then non- determinism of time does not affect determinism of the program. At least, in theory. It's definitely a long way from there to practice.

<comment><USER23> That's true -- but "the program" is also any code using yours as a middle- step, which is the case of a network service is a huge number of people. So anything that requires total program control rather than subroutine enforced safety is a nonstarter.

The timing may occur outside of your control, and then statistical profiling used. If the timing of a reponse to a network request has a time component that depends on shared load, then you have a side-channel.

</comment></comment></comment></comment></comment><comment><USER24> I read the article, but I'm not sure what this technology is enabling really. Can it be thought of as a new player in the lambda/serverless category? Does it have any advantages to using other serverless stacks like aws lambda or azure?

<comment><USER7> The advantage is that the code runs close to your users. 90% of the people on Earth are within 10ms of a Cloudflare location, so by pushing your code out to the edge you can make your site faster. You also save on the cost of transmitting data around the world.

</comment></comment><comment><USER25> Seems like this plus the Cloudflare Apps could yield some interesting projects.

<comment><USER26> Yup. :-)

<comment><USER27> This seems like it has a ton of potential. I'm already thinking of the possibilities for my own Cloudflare-proxied sites.

I hope it's not priced too harshly. Hopefully an added monthly flat rate rather than per-request pricing?

</comment></comment></comment><comment><USER28> Sounds like this could be a pretty trivial way to load balance React prerendering. As long as the react code fetches all data in 1 call it should be at least as efficient as doing it all in Nodejs on your server.

<comment><USER10> Relevant example using Preact [https://cloudflareworkers.com/#87ec550da87ab3f7de756a4979c00...](https://cloudflareworkers.com/#87ec550da87ab3f7de756a4979c0085b:https://tutorial.cloudflareworkers.com)

</comment></comment><comment><USER29>
      - Is it "Cloudflare Workers" or "Cloudflare Service Workers"?
          A "Cloudflare Worker" is JavaScript you write that runs on Cloudflare's edge.
          A "Cloudflare Service Worker" is specifically a worker which handles
          HTTP traffic and is written against the Service Worker API.

Consufing naming convention. Now you have to say 'worker worker' or 'non- service worker' so nobody has to wonder if you meant 'service worker' when you only said 'worker'.

<comment><USER7> Not really, because once there are workers other than Service Workers, they'll have their own names. To be clear, a Service Worker is one kind of Worker. At the moment it's the only kind, but we could introduce others in the future. For instance, maybe we'd introduce a "DNS Worker" that responds to DNS requests.

Also note we didn't invent these terms. "Workers" and "Service Workers" are W3C standards.

<comment><USER29> Ok. If you're going to have a DNS worker, wouldn't it make more sense to call the http one the HTTP worker? Isn't DNS a service?

<comment><USER7> We called it a Service Worker because the API follows the W3C standard Service Worker spec:

[https://www.w3.org/TR/service-workers-1/](https://www.w3.org/TR/service- workers-1/)

[https://developer.mozilla.org/en- US/docs/Web/API/Service_Wor...](https://developer.mozilla.org/en- US/docs/Web/API/Service_Worker_API)

I agree that the naming is not completely intuitive, but these are the names that exist and so we're using them.

I'm not aware of any similar spec for DNS workers so I figure we'll use whatever name we want there.

</comment></comment></comment></comment><comment><USER30> Could this be used to make Cloudflare respond to HTTP POST requests?

<comment><USER7> Yep.

        if (request.method == "post") { ... }

</comment></comment><comment><USER31> Oh my. Is there any form of persistence, present or planned?

If there is - this means that there (eventually) will be a way to have logs from the edge servers. I'm just thinking about a worker that would collect the requests and responses data in some circular buffer, and try to push it to the origin server. Eventually, the data will get through, so no CDN-returned 52x ("web server is not responding" etc) errors would go unnoticed.

<comment><USER7> We won't offer writable storage at the edge in v1, but you could always make a background request to push these events back to some log service you maintain (on separate infrastructure from your main service to make simultaneous outages unlikely). Note that you can make background requests that happen after the main response has already returned (but still subject to the per- request CPU limits, etc.).

We're thinking about how to do writable storage, but it's tricky, since one thing we don't want is for developers to have to think about the fact that their code is running in hundreds of locations.

</comment></comment><comment><USER32> So, can I use this to do this:

Render your SPA (different index.html) when a login cookie is set and otherwise render your landing page (yet another index.html)? - Such that that my [http://example.com](http://example.com) can always be cached (unless it needs to hit the server where the same logic is implemented).

And in general, how do you manage your landing page vs. your SPA?

<comment><USER33> Maybe I'm not quite understanding what you're asking, but I think you can do this with client side service workers already.

</comment></comment><comment><USER34> This is really interesting; kudos to Cloudflare for launching what seems like a cool thing!

Also, agree with other commentators here; nicely-written blog post!

</comment><comment><USER35> Very nice. Are there plans to expand on it? For example, some way to allow state to be kept at the edge as well.

<comment><USER36> Yes. We plan to. We are releasing this to find out precisely what people need.

<comment><USER37> Some way to implement cache tagging and fast invalidation based on tags (a la Fastly) would be good. Without storage I can't see a way to keep a hash of currently valid tags - but I will play!

</comment></comment></comment><comment><USER38> Great addition to your services. I really want to see the pricing. Also I'm quite excited to see how this will play along with the apps concept. Do you plan also to introduce a monetisation system for the apps? It will be a good incentive then for developers to get some nice income.

<comment><USER7> As a matter of fact, the monetization part already exists: Cloudflare Apps is a thing today, including paid apps. Today, though, they are limited to injecting client-side code. Once Cloudflare Workers are integrated with Apps, they'll be able to include server-side code too. [https://www.cloudflare.com/apps/](https://www.cloudflare.com/apps/)

PS. There's an investment fund targeting Cloudflare App developers: [https://www.cloudflare.com/fund/](https://www.cloudflare.com/fund/)

</comment></comment><comment><USER39> Sounds very cool, but first thing that hit my head: Sounds like a perfect tool to DDoS someone?

<comment><USER7> We've thought of that, and it won't be. :)

</comment></comment><comment><USER40> This is really cool! I wonder if this will become the new "S3 API" and get everyone to copy^H^H^H^H implement it.

Also a little concerned about writing anything substantial without an onprem version!

<comment><USER7> Yes, it's my hope that Service Workers will be recognized broadly as the standard API for this.

FWIW I've seen several different folks saying they're working on implementing a Service Workers API shim on top of Node, which would be a great way to get an on-prem version, and should not be very hard to do.

</comment></comment><comment><USER41> This is excellent news! Now I wish AWS Lambda and alternatives also supported Service Worker API (Google Cloud Functions has express like API).

</comment><comment><USER42> How will billing work for this? It seems like I could conceivably write an entire application that just runs as a Service Worker.

</comment><comment><USER43> Is this similar to Amazon's Lambda@Edge?

<comment><USER44> Sounds like it. I think Cloudflare's edge (no pun intended) is going to be their 110+ locations to host this. As opposed to Amazon's 93 I believe? (If all cloudfront spots support lambda@edge that is) [https://aws.amazon.com/cloudfront/details/](https://aws.amazon.com/cloudfront/details/)

<comment><USER45> I would say at 117 edge locations vs 93 Cloudflare will have lower latency, but most notable in markets that most companies care least about. Probably of more importance is by using embedded V8 as opposed to a process-level sandbox running Node.JS, the Cloudflare service worker will have a much faster startup time in all locations. I seem to recall from tests in Lambda that we're looking at 40-50ms, which is actually substantial given how close these locations often are to the user. But the biggest edge in my books is CloudFront bandwidth is ridiculously expensive and Cloudflare doesn't charge (directly) for bandwidth. Bandwidth often being the single biggest line item in your AWS bill if you get a lot of traffic.

</comment></comment></comment><comment><USER46> offtopic: can cloudflare be used as a CDN for just assets? The cloudflare docs talk only about using it as CDN for an entire site.

<comment><USER27> Technically, yes, but as I understand it, they frown upon it and could potentially terminate your account. See this section of their ToS ([https://www.cloudflare.com/terms/](https://www.cloudflare.com/terms/)):

>SECTION 10: LIMITATION ON NON-HTML CACHING

>You acknowledge that Cloudflare's Service is offered as a platform to cache and serve web pages and websites and is not offered for other purposes, such as remote storage. Accordingly, you understand and agree to use the Service solely for the purpose of hosting and serving web pages as viewed through a web browser or other application and the Hypertext Markup Language (HTML) protocol or other equivalent technology. Cloudflare's Service is also a shared web caching service, which means a number of customers' websites are cached from the same server. To ensure that Cloudflare's Service is reliable and available for the greatest number of users, a customer's usage cannot adversely affect the performance of other customers' sites. Additionally, the purpose of Cloudflare's Service is to proxy web content, not store data. Using an account primarily as an online storage space, including the storage or caching of a disproportionate percentage of pictures, movies, audio files, or other non-HTML content, is prohibited. You further agree that if, at Cloudflare's sole discretion, you are deemed to have violated this section, or if Cloudflare, in its sole discretion, deems it necessary due to excessive burden or potential adverse impact on Cloudflare's systems, potential adverse impact on other users, server processing power, server memory, abuse controls, or other reasons, Cloudflare may suspend or terminate your account without notice to or liability to you.

I think in practice, unless you have a very popular website or are abusing it in some way, they probably wouldn't care or even notice. But you'd still be taking a gamble.

(I don't work at Cloudflare though so take whatever I say with a grain of salt.)

<comment><USER47> Wow, thanks for that info! Our enterprise account uses CF as a CDN for medium sized (~50MB) video files and I just assumed that they were ok with everyone doing that. I guess not.

I guess the answer for the OP then is, get an enterprise account and you can do whatever you want.

</comment></comment></comment><comment><USER48> This is really cool...but _why_?

<comment><USER35> I thought of a few use cases...

A more granular way to block requests than what cloudflare provides (IP, BGP AS, country)

Tokenizing credit cards at the edge if you have a payment provider that supports that, and are using CF's PCI compliant environment.

Injecting a unique ID into requests for log correlation. You get collisions if you do this via browser javascript for various reasons. I'm assuming v8 has a better Math.random(), or that you would at least be able to find a workaround since it's in one stack.

I'm sure there's more.

<comment><USER48> Also some good use cases. :)

</comment></comment></comment><comment><USER49> Can't you already do this with Fastly and Varnish?</comment>


WSJ: Get Ready for Inflation and Higher Interest Rates - <AUTHOR> http://online.wsj.com/article/SB124458888993599879.html

<comment><USER2> Deflation seems more likely:

Fiat World Mathematical Model

[http://globaleconomicanalysis.blogspot.com/2009/02/fiat- worl...](http://globaleconomicanalysis.blogspot.com/2009/02/fiat-world- mathematical-model.html)

 _Will this printing create [price] inflation? This is dependent very much on what money will do next. If banks will not lend and banks sit on that cash forever and ever like the great depression because the risk is too high and the banks do not know if the lending will end up in good assets or bad assets, and because banks are in so many bad assets now they probably will not lend at all._

 _That is the observation that Murray Rothbard made, that during the Great Depression that banks have chosen not to lend because the risk of accumulating bad assets was far to high. So they were sitting on massive reserves. That is what is developing right now._

 _A good example is what happened in Japan in 2001-2002 where the Bank of Japan pumped 300% at one stage and lending continued to collapse. I expect similar things to happen here. If lending will not increase we can conclude this will not be inflationary._</comment>


SEC approves 200+ million Americans as Angel Investors - <AUTHOR> http://www.lawgives.net/blog/equity-crowdfunding-what-does-regulation-a-mean- <comment><USER2> This is huge! Imagine if this existed during the time when Facebook was becoming a big deal and individuals could invest in it. Imagine, for example, if instead of that $2.5B pre IPO cashout going to one single investor it got distributed amongst 50,000 investors. That would $50K for each at a 1000 fold ROI. $50K is most people's yearly income =)

<comment><USER3> I'm imagining the hordes of frothing con artist sociopaths that are about to create flashy demo videos and cutout companies with lots of fakey "social proof" and cutout demos sold as real products.

Equity crowdfunding for the general public _should_ be a good idea, but unfortunately I'm afraid it's not. The asshole to elbow ratio is just too low. I'm deeply concerned that the entire seed stage market is about to get shat upon rather copiously. The frauds will actually drown out the good deals, since they'll almost by definition be better at flash and promotion.

A lot of people are really naive about this stuff. Organized crime will likely get involved. It will not be pretty. But hey, those companies that make flashy startup intro videos are about to do a lot of business.

<comment><USER4> It'll be just like Kickstarter. Yes there is fraud and yes there are well meaning failures but you also get huge successes like Oculus (and many others).

Just as there are sure to be well publicized stories about people getting fleeced -- there will be stories about other people getting rich.

<comment><USER3> The quantities of money are larger, which will attract a different class of scammer.

<comment><USER4> That does not change what I said.

Yes, there will be scams. And there will be successes.

</comment></comment></comment></comment></comment><comment><USER5> It's great that the SEC is moving forward with implementing the JOBS Act, but sadly what the SEC voted on isn't a good fit for startups and small businesses. It's more of an "IPO-lite" and for the most part only makes sense for companies that are a year or two away from going IPO.

On the upside, the "good stuff" from the JOBS Act (Title III) should be implemented by the end of the year.

</comment><comment><USER6> I'd like to launch a campaign for my startup users to have the possibility to participate in our seed round. Is there a website/service that can help with that ( something that could work like kickstarter )? AngeList and others are not really designed for this use case (at least there is nothing publicly available NOW)

<comment><USER5> Reg A+ (what was just voted on) is probably not going to be a good fit for you, since you're required to get approval from the SEC and need to periodically file audited financial statements. But the other part of the JOBS Act (commonly referred to as Title III) should be here by the end of the year. You should check out Wefunder (disclaimer: my startup), we'll be supporting the JOBS Act.

<comment><USER6> Don't mind getting approval (I am assuming it's a somewhat simple procedure) and submitting periodic audited financial reports. We (Bandhub) think it is very important for our users' community to have ownership in the company. And feel this is a great first step towards equity grants in online communities ( ala Reddit Notes ). So we are happy to go through hassles to get it done ( it it's useful for you guys we can be beta testers of your platform )

<comment><USER5> It's going to be closer to filing a Form S-1 (like with an IPO) than submitting a url and such, unfortunately. And it's probably going to cost tens of thousands of dollars in lawyer/accountant time before you can even start with Reg A+.

Users having ownership in a company can be a powerful thing, and I think we're going to see it more and more. Hopefully with the new SEC regulations companies like Reddit will be able to legally do what should be easy (gift people equity).

The upside is that the SEC reported to congress that they're going to get Title III (the part of the JOBS Act meant for startups and small businesses) implemented by October this year. I think that's going to be a much better fit for what you're looking for.

</comment></comment></comment></comment><comment><USER7> So, honest question, isn't public investment in shaky tech companies exactly what led to the early dotcom bubble?

Except now that it's before they even IPO, isn't it even more risky?

Genuinely curious, I was only 13 in 2000, so I didn't exactly know what was going on.

<comment><USER5> That certainly was part of the dotcom bubble, but not the cause of it. In addition to a very frothy public market there was an obscene amount of private money getting invested in companies with poor fundamentals. sama wrote a great article recently about bubbles.

There are a few things from the JOBS Act that protects against terrible things. People can't invest more than a certain amount in startups overall - your quota is based on your income or net worth and is either 5% or 10%, depending.

Additionally, these are long term investments - you can't easily flip investments and I think that'll play a big part in people's psychology. You can't buy a share of some hip photo startup (for example) and sell it to someone else in 6 months at a higher price. In many cases you're going to be holding your investments until the company exists. There are exceptions to this, but I think practically we won't see secondary markets for a long time.

Another thing (this is more specific to Title III - the crowdfunding part of the JOBS Act that we're still waiting on) is that companies have to publicly set a goal and meet it through a registered platform. So a shaky startup can't find 10 suckers to give them $1000, they have to set a real goal (e.g. $50k) and convince a crowd of people to give them money. It still will happen, but I think fraud will be much less common than well intentioned startup failure.

The best part (IMO) is that the economics of investing will be dramatically different, so people can invest $100. Startups are super risky, but with $5,000 you can invest in 50 businesses and spread the risk. Because they're startups many will fail, but it's less likely to get conned by 50 founders.

</comment></comment><comment><USER8> I'm completely in favor of individuals being able to invest in startups, especially since you can go to vegas and blow $30k in a weekend, to not be able to put $30k into a startup is a crime.

But this is going to make a bubble. IT will take a couple years to shake out, but I sure hope that as a result of this the change isn't reverted.

Yes, people will invest their money poorly, but nobody could do as bad as Social Security which in my grandfathers case, returned less than %3 fair value of his money (Eg: effectively a %97 loss[1]. Slot machines only produce a %98 loss!) And nobody has the option to avoid "investing" in social security.

[1] compared to putting the money in an index fund. At the time of calculation, the indexes had just crashed with the market, so the actual results %90 of the time would have been much more in favor of individuals.

<comment><USER9> Both of my parents died before drawing social security, they suffered a complete loss on all the money paid into it.

</comment></comment><comment><USER10> [https://news.ycombinator.com/item?id=9274602](https://news.ycombinator.com/item?id=9274602)

</comment><comment><USER11> Question: What about Title III?

I've seen mentions in this thread of it coming out by the end of the year. What are other peoples thoughts?

</comment><comment><USER12> pure democracy via capitalism... interesting. Are the masses smarter than the 1% is generous?

</comment><comment><USER13> I'm more interested in the Title III changes supposedly coming down the pipe, where you can file regulation D and then raise up to $1m from non-accredited investors, but _engaging in general solicitation._

This would be absolutely killer for independent films, which are badly in need of a financial boost at the bottom end of the market, and which in many ways resemble a specialized startup. On the negative side, they don't have a recurring revenue model of the same sort as a traditional product or service. On the positive side, the business process/manufacturing path of a film is very well understood.

Right now, some films are successfully crowdfunded. It works very well for documentariesthat address a topic which already has a dedicated interest community, and some kinds of fictional projects eg _Super Troupers 2_ met its $2m funding target in something ridiculous like 48 hours. But crowdfunding is _very_ heavily geared towards projects that have a pre-existing audience, sometimes through participation of a Famous Person. If you're trying to launch a film from scratch it's way harder, and it's harder again if you're not targeting a very specific demographic (which is why you see a disproportionate number of LGBT films on crowdfunding sites - it's a demographic that is underserved by Hollywood and one that's easy to connect with from a marketing standpoint). Paradoxically, the less money you are looking for, the more difficult it can be.

Small indie films already go down the regulation D route - pre-filing with the SEC, and then raising production/marketing costs through a combination of presales to distributors and by offering a limited number of equity blocks to accredited investors. But this is very very time-consuming. There are things like tax incentives to help, but they require a lot of administrative overhead and are more targeted at mid-sized projects from established producers, eg California tax incentives require a minimum budget of $1 million, presumably so to make the state's administrative overhead worthwhile.

It would be a huge change for indie films to be able to do general solicitation for sub-$1m budgets, and offset the lack of brand identity by offering investment participation instead, notwithstanding the high risks involved. Unfortunately, it looks like there won't be any movement on this before October of this year, meaining the earliest that Title III crowdfunding will take off is in 2016, nearly 3 years after the final implementation deadline set out in the 2012 legislation. I don't know if this is the fault of the SEC itself or if the agency is too underfunded to go any faster, but it's quite frustrating for those of us who'd like to raise capital int he micro- equity space.

[https://fundwisdom.com/article/brian-thopsey/title-iii- equit...](https://fundwisdom.com/article/brian-thopsey/title-iii-equity- crowdfunding-update-nonaccredited-investors)</comment>


Is the Universe a Hologram? - <AUTHOR> https://www.tuwien.ac.at/en/news/news_detail/article/9447/

<comment><AUTHOR> [https://en.wikipedia.org/wiki/Holographic_principle](https://en.wikipedia.org/wiki/Holographic_principle)</comment>


Beanstalk Guides - <AUTHOR> http://guides.beanstalkapp.com/

<comment><USER2> These guides are probably not as useful to the majority of the HackerNews audience, but I thought it might be helpful to explain why we're publishing these guides.

It's hard to believe, but absolutely true, that there are WAY more people who aren't using ANY version control than have made a clear decision about using one over the other.

The benefits of version control are clear once you start using them, but are less clear to people who haven't used it before. We want to illustrate that benefit while at the same time making it easy to learn about best practices and techniques to improve your entire development and design workflow.

It's been a fascinating process finding large dense communities of designers and developers who still have excuses for not using ANY version control. There's still a huge public service to be done for teaching version control basics and best practices to the audiences who don't have any significant adoption yet.</comment>


One Reason To Take New Search Engine Blekko Seriously - <AUTHOR> http://www.businessinsider.com/blekko-2010-11 <comment><USER2> I personally like the option to report spam results to filter them off my searches. I am tired of spammy results on Google.</comment>


Darpa teams up with NSF to develop ASICs tailored for ML applications - <AUTHOR> http://mil-embedded.com/news/darpa-teams-up-with-nsf-to-develop-asics-tailored-for-machine-learning-applications/ <comment><USER2> Using Tensorflow to generate Verilog to run Tensorflow? That's s flywheel that could destroy the universe.

In all seriousness, this is cool. Are there any writeups about the state of ASICs for ML? I understand Google TPUs to be the same thing but I have no clue what's going on under the hood.

<comment><USER3> Google Brain team homepage is a good general source of information [0], and the HotChips [1] conference is perhaps the best source for research information regarding latest ML ASIC designs from Google [2], Intel, ARM, Wave, IMG and others. Google TPU3 systems are discussed extensively, here [3].

[0]: [https://ai.google/research/teams/brain](https://ai.google/research/teams/brain) [1]: [https://www.hotchips.org](https://www.hotchips.org) [2]: [https://www.hotchips.org/wp- content/uploads/hc_archives/hc29...](https://www.hotchips.org/wp- content/uploads/hc_archives/hc29/HC29.22-Tuesday-Pub/HC29.22.69-Key2-AI-ML- Pub/HotChips%20keynote%20Jeff%20Dean%20-%20August%202017.pdf) [3]: [https://www.nextplatform.com/2018/05/10/tearing-apart- google...](https://www.nextplatform.com/2018/05/10/tearing-apart-googles- tpu-3-0-ai-coprocessor)

</comment></comment><comment><USER3> Thanks for sharing, it looks like a livestream of the event will be hosted, here: [https://www.youtube.com/watch?v=wuvCx6sFvt8](https://www.youtube.com/watch?v=wuvCx6sFvt8)

I've tried to ask whether registration is required (ie., for non-US citizens) but there was an error with .mil email address. Posting here in case someone from DARPA is reading: `local-part of envelope RCPT address contains utf8 but remote server did not offer SMTPUTF8.`</comment>


Soda Taxes Seem to Cut Soda Drinking - <AUTHOR> http://www.nytimes.com/2015/10/13/upshot/yes-soda-taxes-seem-to-cut-soda-drinking.html <comment><USER2> Or perhaps the soda tax and reduced consumption both stem from the same body of scientific evidence and anti-soda narrative? As a whole, consumers are shifting to healthier eating trends, soda's one of the obvious things to cut.

I agree with the last paragraph, the studies to date haven't shown much. It'd be interesting to compare state-by-state changes over the past 10 years.

</comment><comment><USER3> As a diet soda addict, I was always surprised that soda companies haven't just started pushing diet drinks more. Until the additives are deemed to be carcinogenic, the health benefits over regular soda are plain as day light and they can really mitigate the public health push back they are getting on their nondiet brands/varieties.

<comment><USER4> Isn't there a large body of research that show unexpected negative effects of diet drinks?

EG: [https://www.washingtonpost.com/news/to-your- health/wp/2015/0...](https://www.washingtonpost.com/news/to-your- health/wp/2015/03/17/bad-news-diet-soda-drinkers-your-favorite-beverage-may- lead-to-more-belly-fat-as-you-age/)

<comment> nommm-nommm Yeah and it may alter your gut bacteria in terrible ways [http://www.scientificamerican.com/article/artificial- sweeten...](http://www.scientificamerican.com/article/artificial-sweeteners- may-change-our-gut-bacteria-in-dangerous-ways/)

</comment></comment></comment><comment><USER5> Eminently logical. The question is what right does the government have to penalize a person for drinking soda, and the answer is "none whatsoever."

<comment><USER6> There is economic externality for the healthcare system in the future for excessive consumption of bad diets. If we want to reduce punishment to other taxpayers, it might be rational to nudge people towards healthier behaviors.

Such policy might include tax breaks for exercises, taxes on cigarettes, soda, etc. Tax subsidies for veggies, etc. Obviously solid evidence is needed before it is initiated.

There could be philosophical arguments that the government should not interfere with their citizens' lives. But this is more about charging the true (future) costs of actions, like carbon tax, rather than dictating behaviors.

<comment><USER7> There's no end to that road. What people do in the bedroom affects their health as well. Shall we tax the more risky sex practices?

<comment><USER8> Why stop there? We might want to monitor people each day via fitbit like devices that report back the data to ensure everyone is exercising the recommended amount. We can then tax or reduce taxes for the applicable individuals.

This could obviously be deemed a bit of a slippery slope fallacy, but I'd argue the above is probably more beneficial than taxing my soda if you truly want to reduce healthcare costs by having healthier individuals. But, who wants to go that far?

<comment><USER9> Personally, I would, if FitBit et al. were actually about health and not about sports-obsessed people bragging about their fitness activities. I definitely wouldn't mind being monitored for health with real-time advice on how to optimize it.

As for the bedroom thing, this is a bad kind of slippery slope argument (not all slippery slope arguments are fallacies). It's ignoring the fact that penalizing soda is not a binary +health/-health decision but a complex tradeoff that includes the magnitude of expected gains and the probable sentiment of the public.</comment></comment></comment></comment></comment>


San Francisco's Chinatown, before the earthquake (1896-1906) - <AUTHOR> http://mashable.com/2015/11/10/arnold-genthe-chinatown/ <comment><USER2> pretty cool photos!

wonder why everyone seems to wear hats back in the day. Maybe the photos shot in the winter? Even still, everyone seems to wear a hat, even though the style may be different from person-to-person

<comment><USER3> Good observation. It also looks like only kids has bright coloured clothing.

</comment></comment><comment><USER4> Man, they look cool as hell.</comment>


Aquameta: Web development platform built in PostgreSQL - <AUTHOR> https://github.com/aquametalabs/aquameta <comment><USER2> I think this is an awesome idea. I really like the Smalltalk approach of not using files and instead representing the structure of a program purely in memory. I also love the idea of drawing inspiration from spreadsheets and databases instead of representing programs purely in lines of code.

I applaud this effort and can't wait to try it out!

<comment> jagged-chisel Any long-lived executable sits in memory (notwithstanding paging, which the database server is also subject to), and such an executable is free to maintain any files it accesses in memory as well.

<comment><USER3> I think what was being referred to is the technique of defining a program, not as source code files which are then compiled/run in an interpreter, but as an in-memory VM environment (think REPLs). The memory-based environment can then be saved to a file, similar to making a core dump.

This changes the structure of programs from a file/disk based structure, to the potentially richer structure of the programming environment (e.g. graphs of objects). Although it comes with disadvantages like losing the tool inter- operability of files.

<comment><USER4> I have a hard time seeing advantages of ditching files. I like this concept, but you can have it both ways (come up with a graphical notation that you can then manipulate with graph like tools), but at the end of the day you need a source of truth, and the file metaphor (a named region of code) is hard to beat (impossible to beat?). Even databases store things as files.

<comment><USER3> File systems are just one approach to storage. Databases can use file systems, block devices, or object-based storage (such as distributed storage systems, e.g. Ceph, Amazon S3). Traditional file systems are, by themselves, inadequate for many use case, as they don't provide things like versioning.

The strength of the file system, is that much tooling already exists for it.

</comment></comment></comment></comment></comment><comment><USER5> I like their meta, and semantics layers.

In the past I've built a scheme similar to their semantics layer, where a bunch of additional metadata is associated with schema metadata via PostgreSQL's COMMENT statement (which lets you associate a free-form text comment with all sorts of schema elements). In that scheme we had JSON COMMENTs and a set of views that ultimately generates a nice JSON representation of a database's schema, including the JSON COMMENTs in the right places, and _that_ gave us UI control that we could then use to generate Admin-on-REST UIs from. And PostgREST can be used to get an HTTP JSON API for free.

For event pub/sub, I've written an used an alternative (all-PlPgSQL-coded) view materialization system that supports live-updating of materialized views as well as recording deltas, which then can be combined with NOTIFYs. Unlike Aquameta, the fact that NOTIFY requires no authorization, and its payload is free-form text, I feel queasy about sending out too much information in NOTIFYs -- instead I use them to drive queries for new deltas as recorded by the delta recorder mentioned earlier in this paragraph. The component that LISTENs for NOTIFYs then writes deltas to a file which is served with a special HTTP server that supports hanging GETs of files -- "tailfhttpd" \-- and any HTTP client can then be used to tail these files.

Anyways, the Aquameta scheme is pretty good.

EDIT: I've been tempted to write an authorization-for-NOTIFY patch to PG... I really don't like the idea that if I give someone direct access to the DB they can NOTIFY anything they like on any channel.

<comment><USER6> Dang some cool ideas in here.

Yeah trying to figure out how to annotate the schema was a big motivator for inventing the meta identifier system. Thought about using COMMENT for documentation, but once you have meta-ids, I thought it was cleaner to just put schema annotations in a different table.

Yeah I think the LISTEN/NOTIFY system in PostgreSQL is a bit primitive. Still working on that part of the project. We got NOTIFYs to propagate up through nginx over a WebSocket and get them into web-world that way, but that section of the project is still fairly immature.

<comment><USER5> What I like about using COMMENT with JSON content is that it makes it trivial to extend the schema in powerful ways, and then Aquameta's meta can be stateless views (and instead of triggers). That makes it much easier to swallow meta.

<comment><USER6> Oh, we actually split up meta into just the views or a additional extension for the update triggers. Yeah the updatable views are a giant foot gun. Essential in our case but not generally.

[https://github.com/aquametalabs/meta](https://github.com/aquametalabs/meta)

</comment></comment></comment></comment><comment><USER7> Tangential, from the introduction: "Centralized systems are BORING. The early days of the web were honestly more exciting, more raw, more wild-wild-west. We need to get back to that vibe." \- I adhere to that philosophy, anyone know of more projects towards that direction?

<comment><USER6> The long-term idea with Aquameta is that users run their own local database and make connections directly to their friends/peers to basically "git pull" new content as it appears via pub/sub. Then users would do the "browsing" on localhost. I still have some work to do figuring out all that NAT piercing p2p stuff, but some combination of WebRTC and headless chrome is showing some promise.

<comment><USER8> My favorite NAT-busting mechanism is Tor hidden services, The onion network provides the basic P2P overlay as well, so it keeps life simple. STOMP over WebSockets is cool, and I believe can be implemented without using any Chrome code these days.

<comment><USER6> Hadn't seen STOMP before, cool. I think making Tor a core part of the architecture is a little over-engineered in our case. The Internet is already a p2p network damnit! I like WebRTC because they seem to solve just the NAT- piercing problem specifically without a whole additional network layer.

<comment><USER8> I've worked with WebRTC NAT punching pretty extensively, and it is not the solution to your problem. STUN and TURN both require details like proxies with fixed IP addresses, specific DNS and SSL configuration, and so on. So for the nodes to be independent, most users will need to set those services up.

So while the added network layer of Tor (or any overlay network really) certainly adds a level of complexity, from the application standpoint it actually simplifies matters for the following reason: Your application doesn't need any longer to think about the _topology_ of the underlying IP network, as this implicit detail dragged in by direct IP connectivity use is abstracted by the overlay network. Instead, your application is able to interface with _any_ peer via (in the case of Tor) an HTTP proxy and a set of opaque base URLs.

IOW, you're going to need one or more additional daemons to make the P2P part go, and Tor is legitimately the simplest thing available _today_ that accomplishes this without ruling out other styles of overlay network from an architectural point of view.

<comment><USER6> Interesting.

I don't mind adding additional daemons to the system if it's essential. But, Tor also (as I understand it, given that this is a ways outside my core competency) adds a whole encryption and anonymization layer, which would be undesirable overhead in at least some scenarios, which is why it seems too heavy to be part of core. Maybe WebRTC isn't going to work reliably which would be very disappointing. I'd like to hear more about your experiences and could really use some help making a good decision here. Ping my email if you're available!

</comment></comment></comment></comment></comment></comment><comment><USER6> I'm going to Twitch stream the Aquameta install and give a little demo, and answer questions folks might have. 5pm CDT. [https://www.twitch.tv/events/j5MGrQ91TwSzRpo28wqGdw](https://www.twitch.tv/events/j5MGrQ91TwSzRpo28wqGdw)

<comment><USER4> Very cool. Does that record? Would like to watch later.

<comment><USER9> VOD is available - starts around 6min into the video.

[https://www.twitch.tv/videos/495999132](https://www.twitch.tv/videos/495999132)

<comment><USER6> I cut out the five minutes of me trying to figure out Twitch so here's a better link:

[https://www.twitch.tv/videos/496396478](https://www.twitch.tv/videos/496396478)

</comment></comment></comment></comment><comment><USER10> I guess this isn't that dissimilar from Git, except that when you snapshot your environment, you get everything (code, IDE settings, issue tracking, and persistent data) all in the same dump.

There's definitely something to this. I'm not sure that building the IDE on top of it is practical (partly because web IDEs are still pretty limited and partly because the scope is just enormous).

But if we had a way to version code that combines source, data, and issues, I'm super interested. It just needs to pipe into existing tools rather than recreating existing tools.

</comment><comment><USER11> Call me old fashioned, but I prefer my web app spread across a dozen servers, file systems, hundreds of virtualized processes, and few thousand folders, and employing a small army of system enginneers (sres) and developers to maintain.

<comment><USER6> Ha :)

</comment></comment><comment><USER12> This was announced on the Future of Coding Slack [1] not long ago. I encourage people who are into things like structured/projectional editors, visual programming and other wild re-imaginations of programming to join.

[1]: [https://futureofcoding.org/community](https://futureofcoding.org/community)

</comment><comment><USER13> SQL on Rails, 2006

[https://m.youtube.com/watch?v=Es9-l1up3r8](https://m.youtube.com/watch?v=Es9-l1up3r8)

<comment><USER14> Unfortunately that upload is only in 240p so most of the jokes are hard to read. I have a copy of the original version which I've uploaded here: [https://2by2.info/sql_on_rails_screencast2_lq.mov](https://2by2.info/sql_on_rails_screencast2_lq.mov) (VLC can play it).

<comment><USER15> I uploaded your file to Streamable: [https://streamable.com/o5g3f](https://streamable.com/o5g3f)

</comment></comment></comment><comment> jagged-chisel Experienced something like this early in my career when a co-worker discovered PL/SQL - he campaigned for putting the entire web app into an Oracle database with all the logic in stored procedures.

Experienced a slightly different take a few years later where Some Genius wrote an interpreter in stored procedures in an off-brand RDBMS. Web pages were a combination of HTML and his custom language, and these pages were stored in the database.

I have strong negative opinions about putting a web development platform entirely inside an RDBMS.

<comment><USER16> > _he campaigned for putting the entire web app into an Oracle database with > all the logic in stored procedures._

Oracle have already done this, it's called Application Express[0]. I used it for my last job. In practice it was pretty good for fast prototyping and iterating on database-backed apps. It took the schema as the source of truth and would add useful interface features based on it (eg, dropdown lists derived from foreign keys, converting some check constraints to javascript validation code etc).

But on the downside it was essentially untestable and version control meant dumping a massive file of autogenerated PL/SQL and checking it into git. For anything more complicated than basic CRUD and reporting you'd wind up cracking the hood to directly use PL/SQL and then skin it with APEX. The tradeoff being that you lost some of the roundtrip niceties.

I wouldn't recommend it in general, but it fit ... _OK_ in its context. It was included in the Oracle license, the org had experience with operating Oracle and it allowed each of us in a small programming group to build little apps to solve genuine business problems that were either too small to select OSS/COTS or too specialised to find anything to select.

The best part of the job was getting rid of painful processes built around sharing Excel and Word docs. I remember occasion when a user broke down in tears because a (to me) trivial app meant that a stressful, high-pressure, error-prone month-long process turned into a non-event. One of the best days of my career and I partially owe it to a platform that I think is, in most respects, a mistake.

[0] [https://apex.oracle.com/en/](https://apex.oracle.com/en/)

<comment> jagged-chisel This was before an official release, late 1990s. I'm sure he'd gotten his hands on either some documentation discussing the concept, or an early alpha release of Oracle's ApEx.

<comment><USER16> Oh very possibly.

Wikipedia reckons HTML DB (the original package) was released in 2004, but the APEX website clear claims to being 19 years old, which would put it circa 2000.

But in the meantime if you're doing late-90s CGI with Perl, why not `SELECT my_amazing_function()`?

<comment> jagged-chisel Hey, buddy, we were cutting edge with the brand-spankin-new ASP! (Although, we did have a Perl guy who insisted we'd be renaming all our .asp files to .aspl because MS had 'opened up' the scripting engine to take whatever language you'd want to write an engine for ... and a Perl engine existed at that moment.)

</comment></comment></comment></comment></comment><comment> 52-6F-62 Well, just glancing at that source code: I do not know Postgres like I thought.

<comment><USER17> Well, to be fair, you can do all sorts of things with Postgres if you build custom extensions for it

</comment></comment><comment><USER18> _Aquameta has been the life project of Eric Hanson for close to 20 years off- and-on. Functional prototypes have been developed in XML, RDF and MySQL, but PostgreSQL is the first database discovered that has the functionality necessary to achieve something close to practical, and huge advances in web technology like WebRTC, ES6 modules, and more have shown some light at the end of the tunnel._

 _Aquameta is an experimental project, still in early stages of development. It is not suitable for production development and should not be used in an untrusted or mission-critical environment._

Not really the basis for 'reference success stories' approach to evaluation. More, check out the repo and hack at Postgres, see where the hypothesis can be made pragmatic.

</comment><comment><USER19> Interviews of Aquameta:

[https://twit.tv/shows/floss-weekly/episodes/527](https://twit.tv/shows/floss- weekly/episodes/527)

[https://twit.tv/shows/floss-weekly/episodes/449](https://twit.tv/shows/floss- weekly/episodes/449)

</comment><comment><USER20> Their argument from the introduction that software can slow down a business by making changing/evolving the systems difficult and requiring programmers at every step, is an interesting one:

[http://blog.aquameta.com/introducing- aquameta/](http://blog.aquameta.com/introducing-aquameta/)

Obviously this is has been the panacea goal in business software forever and there's a long trail of failed companies or projects who tried to do this.

IMO it's always going to require specialized knowledge of a certain level of abstraction above the machine, it will never be as simple as pushing buttons in a GUI. The question is making the languages/frameworks simpler and lowering the bar.

In practice these sorts of things work great for simple scenarios but are very brittle one you start to. Just like Excel spreadsheets used like databases it will quickly turn into a hacky maze of things forced into places where it shouldn't be.

I'd also never think 'PLpgSQL' when it comes to simplifying things. I'm genuinely curious to see if they can pull it off... eliminating the file system part is also an interesting idea.

<comment><USER21> The MO of SV startups seems to be to slap together something that has product market fit while ignoring performance and scaling concerns, at first. Once you have enough customers and market, you then raise funding and use that to hire more experienced system folks who can make your system performant, efficient and scalable.

<comment><USER20> I wasn't talking about scaling performance wise. I mean scaling the problem set beyond the initial easy ones.

</comment></comment></comment><comment><USER22> Is this comparable to Oracle Apex, which is a web development tool written entirely in oracle PL/SQL?

<comment><USER23> Used Apex when it first came out (as HTMLDB). I've never found anything that compared to its speed in rolling out web based forms for internal use. At the time, it was the best BI tool for ad hoc queries around. Nowadays I use metabase, but I've often missed Apex speed and wished PG had it.

</comment></comment><comment><USER24> Cool concept!

Has anyone built anything in Aquameta? Would like to see some success stories.

<comment><USER25> I worked on Aquameta for a few years and I'll say that having a build running locally is a joy I've never encountered elsewhere in my career.

Every time I need a little app or something, instead of reaching for some SAAS product, I would just build a quick prototype for myself. I could make a prototype in a couple hours and over the course of a week or two I would polish it up when I had a few extra minutes. Rather than using something built for the masses, I could tweak the interface to my own taste and I owned all the data.

</comment></comment><comment><USER26> Greenspun's tenth rule may need to be updated for IDEs:

"Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of a JavaScript IDE." (previously Common Lisp)

</comment><comment><USER27> > Technical goals of the project include: > Allow complete management of the > database using only INSERT, UPDATE and DELETE commands (expose the DDL as > DML)

There might be other reasons - but note that postgres actually supports transactions and rollback of DDL - Oracle with full enterprise lisence has something similar (there's undo/a "trashcan" style cache for schéma modifications).

But in general (as far i understand; I have _not_ used this in anger) pg lets you simply BEGIN drop table (...) ALTER table (...) (who's, something wrong) ROLLBACK.

It's very neat, and not generally supported.

<comment><USER5> Yes, yes, but, it's nice to be able to treat schema as relational data itself. Indeed, the information_schema and pg_catalog already let you do that, but the information_schema is incomplete, and the pg_catalog is hard to use and unstable (that is, each release can change the pg_catalog backwards- incompatibly).

Besides letting you read schema via normal SELECTs on a well-designed meta- schema, something like Aquameta can let you run DMLs as DDls too. That means you can now generate and execute DMLs dynamically but without needing EXECUTE -- you can just have a bunch of normal INSERT/UPDATE/DELETE statements (including via CTEs) and generate schema from other data the same way you'd generate data from data. I think that's a big plus. But then I've worked with a database before that did this schema as data-in-a-meta-schema thing, and I find it very comfortable.

For example, without a metaschema you have to use CREATE THING IF NOT EXISTS then ALTER THING ... in order to apply schema changes. Whereas with something like Aquameta you just INSERT INTO ... WHERE NOT EXISTS ... (or with ON CONFLICT DO ...) and that's that. You can have one set of DDLs that create schema, and the same set of DDLs also updates schema. That's wonderful.

<comment><USER27> I'm still not entirely clear on why this is a good thing. Is it a preference - sort of hygienic unhygienic macros - for data structures?

Do you end up with old data in old schema - or is there some implicit conversion? Is a UPDATE that drops a column equivalent to dropping a column - and can you roll it back normally?

<comment><USER5> It's like functions that return functions: SQL that generates SQL. Normally, in PG land, one generates code using SQL, using the format() function, then one EXECUTEs it. That would still be the case for generated FUNCTION bodies, naturally, but for everything else you could just use DDLs on a small and well-tested metaschema that does this work for you.

Just as in Lisp you might rather not use eval but instead use macros, here you'd prefer to use DDLs on a metaschema over DMLs. Hygiene is one of the motivators.

And yes, you could DELETE from a view that represents columns instead of using ALTER TABLE ... DROP COLUMN ... All the usual transactional semantics apply. You can BEGIN, delete that row, and rollback, leaving the DB unchanged.

</comment></comment></comment></comment><comment><USER28> "Under the hood, Aquameta is a "datafied" web stack, built entirely in PostgreSQL. The structure of a typical web framework is represented in Aquameta as big database schema with 6 postgreSQL schemas containing ~60 tables, ~50 views and ~90 stored procedures. Apps developed in Aquameta are represented entirely as relational data, and all development, at an atomic level, is some form of data manipulation."

This is triggering painful flashbacks to SharePoint development.

<comment><USER29> What were the painful parts of SharePoint development?

<comment><USER30> What _were not_ the painful points of SharePoint development?

<comment><USER29> I don't know. That's why I'm asking.

</comment></comment></comment></comment><comment><USER31> reminds me of couchdb apps where you'd use document attachments to store html/public files and serve them directly from couch.

[https://docs.couchdb.org/en/2.0.0/couchapp/](https://docs.couchdb.org/en/2.0.0/couchapp/)

</comment><comment><USER32> This is actually really similar to on-premise SharePoint development; list data, content types, workflow definitions, front-end HTML, CSS, JS code are just stored in the back end database.

</comment><comment><USER33> Data driven applications are cool, I think I'd use Datomic over Postgres but it didn't exist 20 years ago

</comment><comment><USER34> Make sure you back up that database...

<comment><USER35> Lol you have a great advice over there

</comment></comment><comment><USER36> This greatly reminds me of my experience with AEM (Adobe Experience Manager). Web-based IDE, version control via OSGI bundles, content repository via Jackrabbit.

I did not enjoy my time working with it but it had some neat ideas and did do some things well.</comment>


Show HN: Inrevi – Just reviews - <AUTHOR> http://www.inrevi.com/

<comment><USER2> First, the shark eating people hands is disgusting in the normal, literal sense of the word. I wanted to leave the site as soon as I saw it. I know that the idea is to be funny. There are probably people with a macabre sense of humor. To me, the anthropomorphized shark is down in the uncanny valley. You might lose users on it too.

Second, the fact that I have to create an account to do anything makes this site useless. I've already got accounts on sites that I don't visit anymore, and that I only visited once. I've reached a point that I refuse to get any more such accounts. If a web site is not going to give me at least read access to some of its useful comments, I'm not going to use it.

</comment><comment><USER3> Without telling your users what your website is about, how can you ask them to signup on your home page ?

I dont like the dropdown interface for reviews. Make it flat like links below your header</comment>