PureScript: a statically typed language which compiles to JavaScript - <AUTHOR> https://github.com/purescript/purescript <comment><USER2> PureScript developer here. Happy to see this here, and happy to answer any questions.

<comment><USER3> Is there any particular reason why PureScript was designed with a single number type (so no proper ints)? I know that's how JS sees things, but now with a whole proper type system it would seem like we should have proper numbers? I admit I haven't read the entire docs, is there a way to e.g. have the type checker ensure a number field such as a year in a date isn't assigned a non integer?

<comment><USER2> It has been discussed before: [https://github.com/purescript/purescript/issues/396](https://github.com/purescript/purescript/issues/396)

The reason I have been against the idea so far is that an integer type is easily accomplished using the FFI and user code. Here is one example (not quite what you're asking for, but hopefully instructive): [https://github.com/darinmorrison/purescript- int64](https://github.com/darinmorrison/purescript-int64)

<comment><USER3> As long as it is efficient and compiler supported (I.e an int add ends up as the proper instruction, and improper assignment ends up as a meaningful compiler error) I think the implementation doesn't matter. Going to Natural numbers and such feels like a separate topic from just having efficient and type safe (modulo overflow) integers.

</comment></comment></comment></comment><comment><USER4> Seeing these types of experiments are always interesting but just like CoffeeScript it requires learning two languages instead of one [so you an debug] which makes it a hard sale. Why not just write clean JavaScript? I know many want to make JavaScript the assembly language of the web but JavaScript is so much more complex than assembly I'm not sure that's necessarily a good goal to have.

Granted I would love for more languages to be usable on the web; even if I thought JavaScript was the best language it's always good to have competition and alternatives. But I think that has to come through browser support. I wonder how feasible it would be to generate some sort of byte code similar to how Java and others work with the JVM.

<comment><USER5> I wish a fraction of the effort going into "fixing" javascript went into fixing the real abomination: the DOM API (and CSS). Then everyone would benefit, even people using Dart, Coffeescript, and TypeScript.

<comment><USER6> I wish people would just realize that JavaScript isn't going anywhere and make the effort to understand it instead of trying to gloss over the quirks of it.

Understanding the key parts of writing JS (closures, scope, GC, etc.) isn't all that hard and it seems like more efforts are geared towards an abstraction layer and/or framework than just learning the language in the first place.

I think it's syntax and familiar looking and feeling environment cheerfully misleads people into thinking they are in a comfort zone, while they thrash around throwing sand in their own eyes, albeit with a familiar looking bucket and shovel.

<comment><USER7> It's rather condescending to assume the only reason somebody might dislike Javascript is because they didn't understand it.

<comment><USER8> Condescending yes, but more importantly, entirely wrong.

</comment></comment></comment></comment></comment><comment><USER9> It's been picking up a lot of steam lately! Bodil gave a great talk on it at Strange Loop last week: [http://www.youtube.com/watch?v=yIlDBPiMb0o](http://www.youtube.com/watch?v=yIlDBPiMb0o)

</comment><comment><USER10> Here's a gem to use PureScript files with Rails and the asset pipeline. It let's you add and compile PureScript files similar to how CoffeeScript files are added. [https://github.com/romaimperator/purescript- rails](https://github.com/romaimperator/purescript-rails)

</comment><comment><USER11> Saw two great talks about PureScript at Strange Loop last week, one by the language designer, Phil Freeman, and another by Bodil Stokke. Both the language and — almost equally importantly! — the accompanying book seem really well done to me.

<comment><USER12> Indeed, the book covers a large set of very interesting topics without ceremony.

</comment></comment><comment><USER13> What's the advantage over something like TypeScript which is a superset of JavaScript but supports types as well?

<comment><USER14> If you want types like Java, TypeScript's probably a good choice. However, if you want the flexibility or the guarantees a powerful type system gives you, TypeScript's not going to cut it.

</comment></comment><comment><USER15> Typescript vs Elm? Fight!

(I.e. what are the relative strengths and weaknesses of these two "modern languages targeting JS" offerings?)

<comment><USER16> I think you meant Purescript vs Elm. disclaimer: I have used neither.

Elm has its own package manager, not sure if that is good or bad!

The biggest difference is that Elm is almost incidentally a similar strongly typed functional programming language and its biggest focus has always been on FRP (functional reactive programming) to simplify UI programming in the browser.

<comment><USER15> Yes, I meant Purescript.

</comment></comment></comment><comment><USER17> Just bought the book today ($10 is too low!). After a few nixos hiccups today, so far so good :-)

</comment><comment><USER18> From the project docs: "Generate simple readable Javascript" \- isn't this more of a disadvantage than an advantage? the created Javascript code won't be high performance, which matters a lot in mobile today.

<comment><USER2> "Simple readable JavaScript" as opposed to the sort of output you might expect from compilers for other Haskell-like languages which attempt to preserve Haskell's semantics. Certainly there are cases where using techniques from pure functional programming can lead to poor performance (monadic recursion jumps to mind), but it is perfectly possible to write fast code using PureScript. And if you really need to squeeze out every last bit of performance, you can always write code in JavaScript and use the FFI.

<comment><USER19> What's monadic recursion?

<comment><USER2> Consider a recursive function like factorial:

      fact :: Number -> Number
      fact 0 = 1
      fact n = n * fact (n - 1)

This will build stack frames and fail with a stack overflow for large inputs. We can fix this by using tail recursion and an accumulator:

      fact :: Number -> Number
      fact = go 1
        where
        go acc 0 = acc
        go acc n = go (acc * n) (n - 1)

The PureScript compiler will recognize that every recursive call is in tail position, and will convert the function to a while loop.

If we want to perform side-effects during the recursion, we typically use a monad to track the type of side effect in use. For example, we can use PureScript's Eff monad to trace information to the console:

      fact :: Number -> Eff (trace :: Trace) Number
      fact = go 1
        where
        go acc 0 = do
          trace "Done!"
          return acc
        go acc n = do
          trace "Keep going ..."
          go (acc * n) (n - 1)

In the case of the Eff monad, the PureScript compiler employs some special tricks in the optimizer to enable the tail call optimization, so we're still OK. But this is only possible because Eff is defined in the standard library (at least until we implement custom rewrite rules).

In the general case, the compiler only sees applications to the monadic bind function of the underlying monad. For example, if we use the Writer monad instead:

      fact :: Number -> Writer String Number
      fact = go 1
        where
        go acc 0 = do
          tell "Done!"
          return acc
        go acc n = do
          tell "Keep going ..."
          go (acc * n) (n - 1)

which is equivalent after desugaring to the following code:

      fact :: Number -> Writer String Number
      fact = go 1
        where
        go acc 0 = tell "Done!" >>= \_ -> return acc
        go acc n = tell "Keep going ..." >>= \_ -> go (acc * n) (n - 1)

This is an example of "monadic recursion" \- a recursive function whose return type uses some monad. In this case, the recursive calls are no longer in tail position, so the compiler cannot apply the tail call optimization. The result is that the compiled JavaScript might blow the stack for large inputs.

The point is that idiomatic Haskell code is often not appropriate in JavaScript because of the different semantics, so it might not be appropriate in PureScript either. The good news is that many Haskell idioms have corresponding PureScript idioms (often using the Eff monad).

<comment><USER19> Thanks! Another trick I've seen used is `naked' avoiding recursion in your code, and relying on combinators implemented in some optimized lower level code. Would that work with PureScript?

<comment><USER2> Yes - in fact, that's the approach we encourage for working with immutable arrays: [https://github.com/purescript/purescript- arrays](https://github.com/purescript/purescript-arrays)

</comment></comment></comment></comment></comment></comment><comment><USER20> I find JS a thoroughly unpleasant language to work with. When will we reach the point where JS could be abstracted away entirely? (Just like how I never need to interact with assembly language any more.)

<comment><USER21> There are several paths:

1\. JS as an assembly language. This is what emscripten[0], a LLVM bytecode- to-JS does, by following the asm.js specification[1]. This is for CPU- intensive tasks, not DOM manipulation. You can use any language that has a LLVM frontend.

2\. JS as a target language, from a specific, new language. Those include cleaner variants that keep the same semantics (CoffeeScript, TypeScript, maybe Dart, ...) or more innovative ones, such as Elm[2], which is written in Haskell too. I'd say that a big innovation that makes the life easier is FRP (which is at the heart of Elm or React.js).

I fail yet to see what advantages PureScript brings compared to Elm.

0: [https://github.com/kripken/emscripten](https://github.com/kripken/emscripten) 1: [http://asmjs.org](http://asmjs.org) 2: [http://elm-lang.org/](http://elm- lang.org/)

<comment><USER2> > I fail yet to see what advantages PureScript brings compared to Elm.

I think they fit different use cases. Elm is excellent at interactive web apps using FRP. PureScript is a little more general purpose and has a few type system features which Elm currently does not (type classes and rank N polymorphism). Also, PureScript's generated code is a bit simpler and doesn't need a runtime library.

</comment></comment></comment><comment><USER22> For those of you who want to see some code:

[https://leanpub.com/purescript/read](https://leanpub.com/purescript/read)

</comment><comment><USER23> I'm new to this but can someone enlighten me about what is the advantage of using this over pure JS?

<comment><USER24> Type correctness can help eliminate an entire class of bugs (type mismatch bugs) found in dynamically typed languages, or various gotchas with implicit typecasting.

<comment><USER25> This is where I find programmers who are comfortable with static languages struggle with dynamic languages. There is a lack of understanding and this is yet another language trying to fix something that isn't fundamentally broken.

<comment><USER2> I think it really depends what you're trying to do. There's definitely a class of problems where the impact of a runtime type error would be low. But there are plenty of other cases where you want to constrain what you or your users can do at compile time.

</comment></comment></comment></comment><comment><USER26> One thing I couldn't see anywhere - is PureScript strict rather than lazy?

<comment><USER2> It uses JavaScript's evaluation model - i.e. strict, but you can write lazy code using libraries, such as purescript-lazy.

<comment><USER26> Interesting, thanks - I've been interested in a language like the Haskell.Next that SPJ described: strict evaluation but with effects controlled by monads. I'll give it a look!

</comment></comment></comment><comment><USER27> Great language, but javascript code is clean, why not only keeping javascript style and adding typechecking and es6 by default..

<comment><USER28> Javascript being clean is your own (possibly misinformed) opinion.

<comment><USER29> I agree that's a matter of opinions but I think that the OP has a point. JavaScript is easy to understand for everybody coming from C, Java or PHP even if its core is very different from those two languages. Haskell might be cleaner but it's difficult to get for people that used only procedural languages, which are most of the programmers working today (especially if the expected domain for PureScript is web programming, frontend or backend).

There is a functional language called Elixir which runs on the Erlang virtual machine. Elixir has been designed to look like Ruby even if it's very different. That makes Ruby programmers (and maybe Python ones too) feel at ease in their first approaches with the language. When you realize how different the two languages really are you already grokked enough of Elixir to keep you going. There isn't that feeling of "oh my, I can't make it" one might have when looking at code like this [http://svn.openfoundry.org/pugs/src/Pugs/Eval.hs](http://svn.openfoundry.org/pugs/src/Pugs/Eval.hs) when knowing only about C/Java/PHP/Python/Ruby

Anybody knowing Ruby or possibly Python should compare that with this [https://github.com/elixir- lang/plug/blob/master/lib/plug/con...](https://github.com/elixir- lang/plug/blob/master/lib/plug/conn.ex)

So, my take is that if a language designer wants to create a functional language that will lure really many procedural programmers into it, s/he has to design something that looks like C or Java. PureScript is too much like Haskell (plus I hate indentation-sensitiveness, but that's _almost_ only a subjective matter). Time will tell.

<comment><USER30> Easy to understand != clean

Javascript has enough implicit behavior and then some to make working with it a nightmare unless you remain extremely diligent with your coding practices. To a large extent, it's been around long enough for this to not be a major problem anymore, but is this an acceptable state of affairs for a language that dominates web programming? I'd expect most people to say "no".

</comment></comment></comment></comment><comment><USER31> Looks nice, but my employer will never use anything other than JavaScript as browser language, unless a customer asks to do so.

<comment><USER32> Get a better employer. I can understand thinking that e.g. existing options are not mature enough, but "never" is a stupid policy.

<comment><USER31> Quoting myself

> unless a customer asks to do so.

which I agree with.

Since 1986 I already have seen too much technology come and go, to be convinced to use "language of the month" at work.

</comment></comment></comment><comment><USER33> Ew</comment>


Ways to bootstrap a startup: on the side - <AUTHOR> http://joel.is/post/2890790294/bootstrapping-on-the-side <comment><USER2> The biggest down side to this approach is potential IP hassles if your employer decides they want what you've been working on. It's always a good idea to look over your employment agreement carefully before heading down this path. Better yet tell them what you're thinking ahead of time just to cover yourself.

<comment><USER3> Better yet, tell them what you're working on, and _get a signed statement that they're cool with it_. Informal agreements may not survive a change in management.

(It may be less important to take care of these details in California, where, as I understand it, state law generally keeps employers from claiming rights to what their employees do on their own time, with their own equipment. But the devil's in the details, and it's probably best to talk to a lawyer about the limits of those provisions before taking anything for granted. And most other states are far less friendly to employees than California...)

</comment></comment><comment><USER4> There's a really good comment on there I'd like to quote:

"I'd only add that, from my own experience, it is more fruitful to avoid emulating the larger team mentalities when you're a single soul company. Specifically, don't aim for MVP, where your first version is this pale shade of your bigger plan. Instead, aim for MVB, or 'Minimum Viable Business'. Make that first version the whole enchilada. It forces you to think about small products that can be profitable on their own without additional effort, rather than always waiting for the next sign post. When you build up several profitable but small businesses, then you can choose which of those to evolve into a more ambitious version of itself. "

This is probably the biggest lesson I learned as well when I was trying to build a startup product on the side of freelancing for a living. When you are solo its infinitely more useful to build up a functional business with cashflow than work on something where you need to scale up to hit milestones before you make money.

When you need cash to pay your bills, it is very difficult to prioritize putting new effort into something that won't make money in the short term...

</comment><comment><USER5> i also think it's a good idea to get a 'bootstrap startup' partner on the side that can help keep your project moving forward when you get stuck with real work (and can't get back to startup for a while), smooth out the burnout risks, and help overall momentum and morale when things get tough.

ideally, it would be someone that shares your 'ramen profitability' and complements your skill set.

</comment><comment><USER6> A lot of true stuff in there, but I don't see a single "way" to bootstrap your startup. A "why bootstrap" title would have been a bit better, this one is pretty misleading for me.

<comment><AUTHOR> Hmm, I guess that is a little misleading. What I meant was to bootstrap by working "on the side" instead of "working in waves" (long stretch of full-time work to build up funds and then a long stretch of full-time on startup). That's the "way" I was talking about in this article, by contrast to my previous article on "working in waves" - <http://joel.is/post/2106915988/bootstrapping-waves>

</comment></comment><comment><USER7> i'm working at work, coding side project at some nights, read some hackernews, techcrunch AND have one wife and two small kids. imagine how focused i am and on what! )))

<comment><USER8> My family is taking the brunt of the impact of my project. My 3 kids are a bit older, youngest is 8. My wife is doing virtually all the parenting and household management. My weekends and evenings are written off to coding, but the biggest sacrifice if from my wife and kids.

When you have a family don't underestimate the impact that running a startup has on them.

I only hope this turns out not to be a false economy.

<comment><USER7> thanks... sure i can't code in every evening, or i go blind or mad.. or single, all of which are not the options

</comment></comment></comment><comment><USER9> I'm currently in the same boat, working fulltime for a UK accelerator/incubator project, and then working on SlideReach (<http://slidereach.com>) in my evenings and weekends. The big challenge I'm facing is of choosing what to work on in my limited time, but thats where getting feedback early and often should help.

</comment><comment><USER8> Joel.

Spot on, I commented on some of the problems I'm facing on quora....e.g. "You also have your day job keeping an eye on your proceedings, and if its a good place to work you will inevitably get sucked into putting some extra effort in towards the end of projects, detracting from your startup."

<comment><AUTHOR> That's a very good point. I guess if possible it is best to try and make your "day job" contract or freelance work with more flexibility than employment. That way you can to some extent dictate how you work, i.e. you can make it fairly clear that you only work 9-5 and that work outside that would be charged for.

I have two great clients at the moment who I am doing contract web development work for and since they're also both startups it works quite well and I can contribute a lot in terms of startup experience as well as just development, and I think that is valued. I'm always aiming to do my best for them and help them move forward as fast as possible, but there is definitely a clear distinction between that work and my startup.

</comment></comment><comment><USER10> Great post, I'm trying to do the same, Its a really hard to make decision to quit day job and work on startup, especially if you are working in a good company and benefits, working on the side until the startup is profitable/raise money is the way to go.

</comment><comment><USER11> great post. "Constraints make you focus." I couldn't agree more. Since I am going through a similar thing there was no time before when I thought my work was so efficient when working on this startup.

</comment><comment><USER12> I do this and the biggest issue I've had so far is trying to talk with people from the businesses in my target market, who only work from 9 until 5.</comment>


SQL, NoSQL, and Scale: How DynamoDB scales where relational databases don't - <AUTHOR> https://www.alexdebrie.com/posts/dynamodb-no-bad-queries/ <comment><USER2> This is why DynamoDB has become my datastore of choice lately.</comment>


Parallel Programming: I Told You So - <AUTHOR> http://www.linux-mag.com/id/7526 <comment><USER2> I don't see any reason to claim "I told you so."

For decades, parallel programming was only done by people in the high performance world. It was (is) difficult and often painful. The languages, APIs and paradigms were broken in various ways. But they got the job done, and the relatively few people who actually needed to do it were able to.

It's only now that parallel programming is moving into the mainstream. Hence, it's only now that it's worthwhile for computing as a field and an industry to pour the resources into making parallel programming "easier." The benefit from doing it before was marginal.

</comment><comment><USER3> More interesting details here: <http://thirdcog.eu/pwcblocks/>

You get read-only access to stack variables, read-write access to stack variables defined with __block, and you have to copy the block explicitly to the heap if you want to call it outside of its scope, and then manually free it.

</comment><comment><USER3> "C blocks" == closures?

<comment><USER4> They're immutable, though. (For sake of parallelization.)

<comment><USER5> Proper closures in a pure language are immutable, too.

<comment><USER4> Well, sure, but that's not usually what people are talking about when they mean closures.

</comment></comment></comment></comment><comment><USER6> "Some simple algorithms can be developed that allow remote cores (other nodes) or even heterogeneous cores (different types of nodes) to be used by the program."

Does this mean blocks and GCD would allow easier cluster and cloud computing too? Or maybe use all the CPUs in a household to complete tasks?</comment>


Show HN: An educational blockchain implementation in Python - <AUTHOR> https://github.com/julienr/ipynb_playground/blob/master/bitcoin/dumbcoin/dumbcoin.ipynb <comment><USER2> > It is NOT secure neither a real blockchain and you should NOT use this for > anything else than educational purposes.

It would be nice if non-secure parts of implementation or design were clearly marked.

What's the point of education article, if bad examples aren't clearly marked as bad? If MD5 usage is the only issue, author could easily replace it with SHA and get rid of the warning at the start. If there are other issues, how can a reader know which parts to trust?

Even if fixing bad/insecure parts are "left as an exercise for the reader", learning value of the article would be much greater if those parts would be at least pointed at.

<comment><AUTHOR> OP here.

erikb is spot on in the sibling comment. This hasn't been expert-reviewed, hasn't been audited so I'm pretty confident there is a bug somewhere that I don't know about.

It's educational in the sense that I tried as best a I could to implement the various algorithmic parts (mining, validating blocks & transactions, etc...).

I originally used MD5 because I thought I would do more exploration regarding difficulty and MD5 is faster to compute than SHA. In the end, I didn't do that exploration, so I could easily replace MD5 with SHA. I'll update the notebook to use SHA, but I'm still not gonna remove the warning :)

I'll also try to point out more explicitly which parts I _think_ are not secure.

<comment><USER2> > I'll also try to point out more explicitly which parts I think are not > secure.

Things I've noticed:

* Use of floating point arithmetic.

* Non-reproducible serialization in verify_transaction can produce slightly different, but equivalent JSON, which leads to rejecting transactions if produced JSON is platform-dependent (e.g. CRLFs, spaces vs tabs).

* Miners can perform DoS by creating a pair of blocks referencing each other (recursive call in verify_block is made before any sanity checks or hash checks, so they can modify block's ancestor without worrying about changing its hash).

* mine method can loop forever due to integer overflow.

* Miners can put in block a transaction with output sum greater than input sum - only place where it is checked is in compute_fee and no path from verify_block leads there.

<comment><AUTHOR> Those are all very good points I didn't think about, thanks for these.

I'll fix the two bugs with verify_block and the possibility for a miner to inject invalid a output > input transaction.

I'll add a note for the 3 others.

<comment><USER3> For deterministic serialization (~canonicalization), you can use sort_keys=True or serialize OrderedDicts. For deseialization, you'd need object_pairs_hook=collections.OrderedDict.

Most current blockchains sign a binary representation with fixed length fields. In terms of JSON, JSON-LD is for graphs and it can be canonicalized. Blockcerts and Chainpoint are JSON-LD specs:

> Blockcerts uses the Verifiable Claims MerkleProof2017 signature format, > which is based on Chainpoint 2.0.

[https://github.com/blockchain-certificates/cert-verifier- js/...](https://github.com/blockchain-certificates/cert-verifier- js/blob/master/README.md#check-certificate-integrity)

<comment><USER4> FYI, dicts are now ordered by default as of Python 3.6.

<comment><USER5> That's an implementation detail, and shouldn't be relied upon. If you want an ordered dictionary, you should use collections.OrderedDict.

<comment><USER3> It's now the spec for 3.6+.

> #python news: @gvanrossum just pronounced that dicts are now guaranteed to > retain insertion order. This is the end of a long journey.

[https://twitter.com/raymondh/status/941709626545864704](https://twitter.com/raymondh/status/941709626545864704)

More here: [https://www.reddit.com/r/Python/comments/7jyluw/dict_knownor...](https://www.reddit.com/r/Python/comments/7jyluw/dict_knownordered_versus_ordereddict_an/)

OrderedDicts are backwards-compatible and are guaranteed to maintain order after deletion.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> For the last couple of months, there have been many educational, simple implementations that explains blockchain technology, I guess thanks to crypto bubble. I wish these were around when we were doing our senior design project on blockchains in 2014. Back then, I only could find basiccoin[0], which was purely minified to just fit in 1000 loc.

After that, I decided to re-implement everything from scratch. My foremost constraint was to write readable code so that anyone could read the codebase and have an idea of how blockchain works.

My current draft of implementation can be found on [https://github.com/halilozercan/halocoin](https://github.com/halilozercan/halocoin) , which currently lacks detailed README and documentation. However, you can still experiment with it by using API or CLI. I'm running a dedicated server to have an always online peer you can connect to.

[0]: [https://github.com/zack-bitcoin/basiccoin](https://github.com/zack- bitcoin/basiccoin)

Edit: a word

</comment><comment><USER3> Thanks! Simplest explanation I've seen.

Here's an nbviewer link (which, like base58, works on/over a phone): [https://nbviewer.jupyter.org/github/julienr/ipynb_playground...](https://nbviewer.jupyter.org/github/julienr/ipynb_playground/blob/master/bitcoin/dumbcoin/dumbcoin.ipynb)

Note that Bitcoin does two rounds of SHA256 rather than one round of MD5. There's also a "P2P DHT" (peer-to-peer distributed hash table) for storing and retrieving blocks from the blockchain; instead of traditional database multi- master replication and secured offline backups.

> ERROR:root:Invalid transaction signature, trying to spend someone else's > money ?

This could be more specific. Where would these types of error messages log to?

<comment><AUTHOR> Thanks for the precision regarding the hash.

Regarding the error, they are logged when a verify_block/transaction returns False, just to be a bit more explicit about what failed. In a real implementation, I guess you would throw exceptions instead (or use some Result pattern), but I tried and it cluttered the code quite a bit, so I went back to logging.

</comment></comment><comment><USER7> FYI: Great blockchain (from sratch) starter article. At the Awesome Blockchains page [1] I collect starter blockchains and articles (in Python, Ruby, JavaScript, etc.) the idea is the best way to learn about blockchains is to do-it-yoursef - build your own blockchains from scratch. Great example. Keep it up. Cheers. [1] [https://github.com/openblockchains/awesome- blockchains](https://github.com/openblockchains/awesome-blockchains)

<comment><AUTHOR> Thanks ! The awesome-blockchains is a great resource, thanks for sharing.

</comment></comment><comment><USER8> This is great. Just last weekend I did the same thing, coding a very basic blockchain in Python for educational purposes. You tackled wallets, which I didn't get to yet, so that was really helpful.

I'm still a little unsure around exactly how miners and nodes communicate with each other. Especially things like broadcasting transactions and new blocks. Any good resources for that?

<comment><AUTHOR> Thanks ! I've completely left out communication from this because it wouldn't fit in the notebook and I haven't researched it. Would also appreciate if anybody has good resources on it.

</comment></comment><comment><USER9> Very good writeup that shows all the steps.

Note it uses MD5 hash instead of SHA256 so not exactly bitcoin. I wonder how much more work would be to make the code fully implement bitcoin. Will it still be readable? Or Etherium? Would be great value for understanding even if Python would be inefficient to run in prod.

<comment><USER6> Fully implementing Bitcoin white paper would require moderate amount of work if you do not consider every little detail related to security of your client code. However, current Bitcoin protocol added many features such as scripting.

I think one can maintain code readability in a python implementation but documentation is the key here. Developer needs to clearly state the objective of each function.

For ethereum, you need one external element called: Ethereum Virtual Machine. Smart Contracts are basically byte code that runs on EVM. Without it, blockchain cannot function. So, ethereum development may require extra knowledge on top of blockchain technology.

<comment><USER10> I've been ignoring bitcoin for a while. Do the devs still maintain the official implementation is the only implementation possible since it contains quirks the spec doesn't specify?

<comment><USER11> Yup, though a group got fed up with that and forked to create Bitcoin Cash which has a spec and multiple teams and implementations. Much healthier situation.

</comment></comment></comment></comment><comment><USER12> nice walkthrough.

also, not sure why folks are nitpicking about minor things like security disclaimers, number of sha256 hashes, md5, etc. while ignoring nontrivial gaps (eg no merkle dags, one of the cornerstone concepts).

<comment><AUTHOR> Thanks.

You're right about Merkle tree. This is a whole section of the bitcoin paper and it's pretty important. But as far as I understand, it's "only" an optimization to save disk space, so it doesn't change the underlying logic.

</comment></comment><comment><USER13> Something from a few months back that's a bit closer to Bitcoin's actual implementation but at a similar level of readability: [https://github.com/jamesob/tinychain](https://github.com/jamesob/tinychain)

</comment><comment><USER14> Coll project. I think having educational * implementations in Python is great in general. Better then having just an article about it...

</comment><comment><USER15> So is there a non educational implementation of blockhain that someone could use/parametrize/configure? Something that is not educational but more industrial strength? What must someone do to convert an educational implementation to a serious one?

</comment><comment><USER16> Why is this all contained in one big json document? Am I that out of touch with modern coding??

<comment><USER17> What the author wrote is a IPython / Jupyter notebook [0], which is implemented as a JSON document [1]. The notebooks are pretty much markdown with runnable code blocks in between.

Jupyter notebooks are popular in the data science / Python communities to explain concepts, for examples see here [2].

[0] [https://jupyter.org/](https://jupyter.org/)

[1] [https://ipython.org/ipython- doc/3/notebook/nbformat.html](https://ipython.org/ipython- doc/3/notebook/nbformat.html)

[2] [https://github.com/jupyter/jupyter/wiki/A-gallery-of- interes...](https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting- Jupyter-Notebooks)

</comment></comment><comment><USER18> Educational implementation, brilliant. Now some startup will give it a name and make an ICO.</comment>


For experts who study coronaviruses, a grim vindication - <AUTHOR> https://undark.org/2020/06/08/for-experts-who-study-coronaviruses-a-grim-vindication/ <comment><USER2> Retrospectively you can justify anything. But the coronavirus outbreak happening now is not proof of the idea that the optimal thing to do in 2010 was to invest in coronavirus research- that could have still been the correct decision based off the probabilities of an outbreak. Just about every virus has a virologist convinced it's the next big one. In recent times next big ones have been the flu (kind of expected), HIV (basically out of nowhere), COVID (we could have done better, but if you'd asked me to bet I'd have bet on avian influenza/H5N1 since that's already dangerously close to becoming an outbreak and has been on radars for a while). Ig a super virulent hantavirus emerged, are those that studied those viruses noe "vindicates" as to pandemic threat? They infect humans and cause small outbreaks too.

<comment><USER3> See also Black Swans. If you call out 200 possible Black Swan events, and 1 comes true, people will call you a genius and ignore the 199 that didn't happen.

<comment><USER4> Pandemics are not black swans though. They occur at predictable intervals. Taleb explicitly says they're not black swans in his work.

<comment><USER5> The lockdowns though and their scale were totally black swans with no precedent

<comment><USER6> No precedent within living memory is not the same as no precedent.

Aside from 1918, the quarantine of entire cities and counties has been a common tactic to control plagues from bubonic to yellow fever. There are even reports from the Black Death of some Italian cities delivering food to peasants to encourage them to stay home.

<comment><USER7> Not to mention the draconian quarantine of merchant vessels entering/leaving ports.

30+ days mandatory quarantine wasn't unusual.

The word Quarantine traces it's roots back to quarantino (40 days) and those laws where passed all over the place from (what we know) the 14th Century.

<comment><USER6> With the expectation that if the ship is infected, _everyone on it will die_ , and no medical help will be given. Pretty brutal by modern standards.

<comment><USER8> It's not like they had a lot of medical help to provide in those days anyway.

<comment><USER7> Leeches.

Headache to much blood, leeches.

Stomach ache, too much blood to the stomach, leeches.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> The comments here are weirdly anti-science. There've been plenty of discussions about coronaviruses being a potential threat over the years. Given the proximity of bats to major population centres in China, I don't see how anybody could say "Well, it's so unlikely that research is unnecessary". All I see here is modern economic systems and scientific institutions failing because there isn't an immediate benefit, yet again, despite there being clear signs of a threat.

</comment><comment><USER10> Others have pointed out that other threats may have seemed just as likely, and that hindsight may be essential to pick out this one.

Now that we have hindsight about _that_ , maybe the lesson is that it's worth it to find the money to research the hell out of every top-20 or top-200 pandemic threats. Spray-and-pray.

Another pandemic will come. With luck, it will be another century from now. With bad luck, it will be next year. We must be better prepared.

</comment><comment><USER11> People are very apt to justify or condemn a decision based off of the result and not based off of the data available at the time the decision was made. Only one of these helps us make better decisions going forward.

</comment><comment><USER12> It almost certainly went like this:

        Scientist: "Boss, it's only time for a disaster to happen"

        Policymaker: "Will it happen now?"

        Scientist: "No, but it will happen"

        Policymaker: "OK, then, remind me when it happens"

<comment><USER13> Scientist: "So we'll do nothing until it does?"

Policymaker: "No, but rest assured we'll blame you when it does happen"

<comment><USER12> Or one of these: "we did not know", "we did not have enough data to make a decision", "thanks to all the heroes at the frontlines", "we are doing a great job", "it's the previous guy's fault".

</comment></comment></comment><comment><USER14> Actually I think focusing on understanding the human immune system would be just as important. Know the immune system and how it really works and you can prepare therapeutic defenses against new viruses because you understand what they do to the body and counteract their effect or diminish it.

I would like to see a Manhattan project level funded research program on the human immune system.

</comment><comment><USER15> I think the fear of a terror virus was so great that a virus that didn't have such a bad quality was mentally turned into a virus that has this bad quality.

</comment><comment><USER16> Does nobody question the premise that Sars-Cov-19 is actually a big threat? At least the current incarnation seems rather tame. The panic over it however is rather real.

<comment><USER17> I'll give you an honest answer, but well, it's obvious. Yes, it's a big threat, it's clear if you pay attention. It's killed more than 100k people, a lot more than an annual flue. It's a horrible death with many people not being able to be around their loved ones. There are lots more deaths not counted as covid-19, because they didn't get tested after death. If we look at total deaths vs normal years we are undercounting.

How many sr citizen homes do we need to wipe out 1/3 the population in a month or two before its a serious issue? Mortality rate in the us for people who have it tested via test is 5.7% - [https://coronavirus.jhu.edu/data/mortality](https://coronavirus.jhu.edu/data/mortality).

<comment><USER16> Heinsberg study suggests a mortality rate of about 0.36%. This is high, but not "a big threat". Given that with 0.36% and 15% infection spread in the general population (like flu) you look at ca 162k deaths in the US.

It is not even close 5.7% mortality. If it would be that lethal you would look already at over one million deaths.

Sweden is a good example of a country without a lot of counter measures and we see that it will end in the realm of 0.36% lethality (5,4k deaths). [https://en.wikipedia.org/wiki/COVID-19_pandemic_in_Sweden](https://en.wikipedia.org/wiki/COVID-19_pandemic_in_Sweden)

<comment><USER13> Sweden regrets their choices [https://www.npr.org/sections/coronavirus-live- updates/2020/0...](https://www.npr.org/sections/coronavirus-live- updates/2020/06/03/868567924/swedens-coronavirus-response-chief-acknowledges- potential-for-improvement)

<comment><USER16> That's not exactly what the article is saying tho. Also it doesn't change the 0.36% mortality rate and I might add the high age median of around 80. So we will likely see a lower average mortality afterwards.

</comment></comment></comment></comment></comment><comment><USER18> Remember, a large enough group of monkeys with keyboards will produce Shakespeare given enough time.

Or a broken clock is right twice a day.

<comment><USER19> I never hear this sentiment on HN when it comes to writing code. Only the other, less-noble job classes.

<comment><USER20> I definitely understood the parent comment differently than you did.

My read of it is that they are criticizing those predicting low probability events, and then cherrypicking the predictions that turned out correct as misunderstood predictive geniuses.

A similar event in tech is the analysis of a potential AI singularity event, which comes up plenty often. We'll only be able to tell who is right in retrospect, and plenty of folks call each other quacks over that.</comment></comment></comment>


Competing in forgotten markets (2012) - <AUTHOR> https://www.cooper.com/journal/2012/7/competing-in-forgotten-markets <comment><USER2> This article would be greatly improved by some case studies, illustrating how prevous 800lb gorillas had been beaten, and how their moats turned out so much shallower than they seemed.

The closest he comes to examples are Microsoft Office (admittedly, few competitors, but a _massive_ moat, and when he wrote in 2012 already mobilising in the face of a big challenge from Google), Flickr (already being killed by the social networking startups he disparages), or Salesforce (competing CRM products are _everywhere_ ).

I'd love to have my mind changed with fleshed-out examples, but without them this reads like a banal expression of the conventional wisdom of the time (incumbents are vulnerable! Disrupt disrupt disrupt!).

Perhaps that's particularly obvious because the conventional wisdom has shifted. Today, the big 5 tech companies are deeply entrenched, and we've watched them each see off a couple of generations of upstarts, while remaining awake and engaged in fierce competition with each other. So an argument like this needs a bit more evidence to be convincing.

<comment><USER3> There is Tableau displacing the graphics capabilities of Excel.

<comment><USER4> Those are hardly competitors.

Like comparing Microsoft Word and Adobe InDesign.

<comment><USER3> I must have misunderstood the OP. I thought it was about launching things like InDesign to displace established market dominators like Word by providing a better tool.</comment></comment></comment></comment>


Content focused design: type edition - <AUTHOR> http://blog.getprismatic.com/blog/2012/4/18/content-focused-design-type-edition.html

<comment><USER2> > We found that what we liked best in a Müller-Brockmann book or on the screen > in photoshop was not what we liked best on real data. Photoshop type > rendering is pretty poor, which is another reason going straight from print > to code worked well for us.

Really good call to omit Photoshop altogether from design endeavors like this. It's a waste of time copy/pasting actual data into your comp, whenever you want to change part of your design, you have to repeat it manually with all the other elements on the page, the fonts render poorly...

We lately try to go from sketch to simple HTML mockups. Having actual data readily available while designing is such an eye-opener. Thanks to web inspector, we can tweak the styles and see the changes get reflected in the entire page. Sometimes when we want to play with the layout, we take a screen grab, cut and move things around in Fireworks.

Nicholas Felton, about the Facebook timeline design: "You can come into a meeting with a very beautiful comp and it's like, 'Oh yes, we should do it that way,'. But you're never going to know if you can do it that way until you pump in the real data and live with it for days or weeks".

I don't understand how Photoshop is still considered a web design tool. Unless designing a marketing site with no content, it hinders good design more than it facilitates.

</comment><comment><USER3> Some serious attention to detail. Most people would have just used Helvetica, a closely related decedent of Akzidenz-Grotesk, and called it a day.

<comment><USER4> If anybody else is curious, here's a discussion on the history and differences of A-G and Helvetica (plus Univers and Arial, both closely related):

[http://www.freddesign.co.uk/2010/04/archive/the- differences-...](http://www.freddesign.co.uk/2010/04/archive/the-differences- between-akzidenz-univers-helvetica-and-arial/)

</comment></comment><comment><USER5> Seems to me a perfect example of "Parkinson's Law of Triviality" <http://en.wikipedia.org/wiki/Parkinsons_Law_of_Triviality>

I'm not saying that details aren't important. But I think there are more important problems for them to figure out now like "how are we going to determine what people are interested in by mining Tweets and Facebook posts. These information could be totally fallacious."

<comment><USER6> The higher level product design problems you're talking about are super important, and we'll write articles about that soon. We're really into interaction design.

We're not figuring these problems out now. Our user research started over a year ago, and we've iterated with many different versions of the product ever since. Our engagement numbers are fantastic.

However, being smart about product design and optimizing engagement does not preclude the attention to detail we demonstrate in this post on type.

The role of type in a content focused design is just a worthy topic to post on, and there's no more to read into it than that.

<comment><USER5> I don't want to sound like an asshole but:

1\. The homepage really doesn't prove the attention to detail thing. It can be improved a lot. By the time someone wrote this blog post, he could have fixed that. (I really liked reading the post, do not get me wrong.)

2\. Aesthetics is important. But would it really be less appealing if it was plain Arial/Helvetica? Would you bet your money on it by A/B testing? I wouldn't.

These discussions end always in: design is important versus code is important. But that is completely not my point.

My point is that it is often, not very wise to spend disproportionately time to trivial considerations. I don't know your "proportions" so I may have no value judgment about that.

<comment><USER7> You're trying to refute the importance of the design through assertive statements like number 2 above, and yes, you are making the point that design is not important by calling the typography a "trivial consideration."

The fact that you don't understand why it's important to do typography well, and think that it's okay to just use Arial, doesn't mean that it is a trivial matter.

That's the kind of thinking that led to the look of Windows 3.1, and I would argue that while Windows might have been the winner at the cash register, it was a lesser product.

I applaud the Prismatic team for focusing on quality. MVPs have their place, but eventually you have to stop counting beans and think about making something great. That's hardly trivial.

</comment></comment></comment></comment><comment><USER8> Somewhat unrelated — I'm not sure why 'request an invite' bounces me to an OAuth page. Perhaps it needs to be clearer what's going on when I enter my email.

<comment><USER6> If you scroll down, you should see a bunch of info about how Prismatic works and why you are signing up w/ Twitter...and some testimonials from the community.

<comment><USER8> Thanks!</comment></comment></comment>


India's Leading Export: CEOs - <AUTHOR> http://www.time.com/time/magazine/article/0,9171,2084441,00.html

<comment><USER2> I think the article draw a rather long bow.

The bottom line is these people speak English and are perceived to be able to bridge the gap between the East and West.

<comment><USER3> It spends a lot of time talking about the Indian's ability to cut through red tape, compared to the Chinese use of "connections", but only brings up "English" twice, and not as the decisive factor. I think it really plays down the importance of English skills.

I'd expect Brazilians to also do quite well, as they tend to have pretty good English.

</comment></comment><comment><USER4> Since there are a billion plus Indians, the statistics say that you are bound to get a few very smart people from among them.

<comment><USER5> Well, if you look at India's performance in the Olympics (<http://en.wikipedia.org/wiki/India_at_the_Olympics>), thats not necessarily true.

<comment><USER6> I don't think it is quite the right comparison. I think most Indians who end up being CEO (or senior executives) in companies have had some sort of post graduate education abroad, or they have work experience starting in a multi national corporation in India.

For excellence in sports, particularly at the olympic level, you need training facilities, budgets and infrastructure in the country. You will find that India is sorely looking in these!

I do not see what the ethnicity of these people has to do with their success. I think more credit should be due to the organisations who hired and supported them up the career ladder.

<comment> johnx123-up Some Indians complain highhandedness of Sikhs and Malayalees. Is it true? (Anyone from India, please?)

<comment><USER6> No, not really true at all. The Sikhs and Malyalees are rather large communities, with large diasporas as well. I think "highhandedness" is too much of a generalisation (?) for such a large and diverse group of people!

</comment></comment></comment></comment></comment><comment> johnx123-up OT: From where these "fortune" companies take big projects? I have seen many Indian freelancers bid as low as $50 for 1-week worth projects. (We have used <http://www.cssilize.com/> that charges as low as $35)

<comment><USER7> They go to a few big outsourcing suppliers: Infosys, Tata, etc. These do work roughly equivalent (in character, at any rate) to the consulting arms of large American business process/tech companies, such as an IBM, Oracle, or what have you.

Fortune 500 companies are not in the market for $50 a week labor from individuals. (They may well be hiring it, somewhere down the food chain, but it will be balled up with 800 similarly situated individuals for a $XX million a year contract.)

<comment> johnx123-up If you have fair amount of knowledge, can you please elaborate on this? What makes these large American companies to pay in millions when they can hire freelancers in few dollars? Any lobby involved?

<comment><USER7> Let's say I'm a major American bank and I want a complete payroll system done, for internal use. This is going to cost me a couple million on the low side.

Why don't I do it with a $50 a week freelancer?

1) I don't trust him, at all. If he could implement payroll systems, why isn't he charging millions of dollars? He's probably copy/pasting "Yes no problem sir I will implement your system to the specified requirements" to 30 jobs a day and looking for a sucker.

2) Who is going to manage him? Me? If I have to manage him, he doesn't cost $50 a week, he costs ~$8,050 a week, because I'm the VP of a major bank unit. Talking to poor people is always a bad use of my time, because it competes with talking to rich people. (This is somewhat exaggerated but not false.)

3) Payroll systems are not a one-man job. After you get to team sizes of 20+, it really helps to have a system for recruiting/managing/etc them, so that you don't have to. I mean, at 20+, someone is statistically going to be getting married or quitting or dying every year. Do I want to deal with that? No. Let their boss deal with it.

4) If I pay an Indian freelancer $50 a week to make my payroll system, and the payroll system fails to ship on-time, I will lose my job because _I did something which was freaking insane_. There are things which, in American business, are insane, and there are things which are Known To Be Not Insane. Paying large, established technology consultancies millions of dollars is Known To Be Not Insane. Even if the project fails, it is not your fault, it is their fault. If the $50 a week Indian turns out to not be God's gift to programming, hiring him was _definitely_ your fault.

It gets more complicated, but this hits some of the high notes.

<comment><USER8> I think point (2) is the most important of those.

When the Fortune 500 outsources to one of the bigger outsourcing firms like those you mentioned, they're outsourcing the whole _process_ of developing software from requirements gathering to testing and the final output is not just working software, but a full trail of documentation for accountability.

You're not getting that from rent-a-coder.

</comment></comment></comment></comment></comment><comment><USER9> As a turbaned Sikh, it's encouraging to see Ajay Banga as the CEO of MasterCard. That being said I'd really like some elaboration on what they mean when they say Indian CEOs show a level of business ethics not seen in the west. It's based off a study done by Haygroup but they don't provide a link to the study or how it was carried out.

EDIT: <http://www.haygroup.com/ww/Downloads/Details.aspx?ID=1187>

This links to a white paper that I think is the one referred to in the article but you have to sign up to get it.

</comment><comment><USER10> Wrong generalization. How many fortune 500 CEOs are from India? I can count on my fingers (correct me if I'm wrong)

P.S. Part of my ethnicity is Indian..

<comment><USER11> How many of the top "Indian Companies" have foreigners as CEOs? I can count on my fingers (correct me if I'm wrong).

P.S.: It depends on a big load of factors!

<comment><USER10> How many Indian companies are in fortune 500 list? I can count on my fingers :)

<comment><USER12> Cool down.

</comment></comment></comment></comment><comment><USER13> India has also given people like Rajat Gupta (ex-Mckinsey Director) and others involved in the insider trading case.

</comment><comment><USER14> >> Indian CEOs show a level of business ethics not seen in the west

I doubt it...

</comment><comment><USER15> Indians are self obsessed with such things. Time to move beyond this silly rhetoric.

</comment><comment><USER16> Indians among most corrupt while doing business abroad [http://business.rediff.com/report/2009/sep/24/indians- among-...](http://business.rediff.com/report/2009/sep/24/indians-among-most- corrupt-while-doing-business-abroad.htm)

</comment><comment><USER17> _jugaad_ ~=hustle

<comment><USER18> i thought jugaad was a hack.. not a native hindi speaker though. It's a word that has exactly the same +ve and -ve connotations of a hack.</comment></comment>


How Dolt, a SQL database with Git-like features, shares storage across commits - <AUTHOR> https://www.dolthub.com/blog/2020-05-13-dolt-commit-graph-and-structural-sharing/ <comment><AUTHOR> We blogged about how Dolt shares storage across versions of the database as it changes across commits.</comment>


Android ecosystem of pre-installed apps is a privacy and security mess - <AUTHOR> https://www.zdnet.com/article/android-ecosystem-of-pre-installed-apps-is-a-privacy-and-security-mess/ <comment><AUTHOR> "An Analysis of Pre-installed Android Software", Julien Gamba, Mohammed Rashed, Abbas Razaghpanah,Juan Tapiador and Narseo Vallina-Rodriguez.

Preprint: [https://haystack.mobi/papers/preinstalledAndroidSW_preprint....](https://haystack.mobi/papers/preinstalledAndroidSW_preprint.pdf)

Are there any tools for anyone to test their own phones?</comment>


Coronavirus: UK in Lockdown - <AUTHOR> https://www.bbc.com/news/uk-52012432 <comment><USER2> [https://news.ycombinator.com/item?id=22668609](https://news.ycombinator.com/item?id=22668609)

</comment><comment><USER3> Find it interesting that this has been up for an hour and currently has only one comment. I guess the UK lockdown just isn't that spectacular.

</comment><comment><USER4> Necessary it seems. I wonder whether mask wearing will become more prevalent in the west after this crisis blows over</comment>


The Retail Industry - <AUTHOR>

Did about $30B in sales this year, and it continues to grow at 20%+ YOY.<p>Is there a compelling reason NOT to go into online retailing? <comment><USER2> Hmmm... You're number $30B actually seems really low. A quick Google shows this from the census bureau:

<http://www.census.gov/mrts/www/data/html/06Q3.html>

|Total retail sales for the third quarter of 2006 were estimated at $991.7 billion, an increase of 0.7 percent (X0.3%) from the second quarter of 2006.

so, assuming that sales are close to $900 billion per quarter, I think that we can safely say that retail sales probably do business in the 2-4 _trillions_ of dollars per year.

<comment><USER3> I think he meant 'online retail'. Actual retail isn't growing at 20%.

</comment></comment><comment><USER4> Is there a compelling reason NOT to breathe?

I know lots of online retailing millionaires. Is it easy? No. Is competition fierce? Of course. Are margins slim? Usually. But if you have passion for an idea, a market, a good plan, and are willing to work your butt off, then there are fantastic opportunities.

(Aside: You won't get a whole lot of response from people making their fortunes in on-line retailing in December - many of them are working 20 hour days this month.)

I have often thought about starting something, but I'd rather hack. (I think that anyone can retail, but few can hack - I'm not so sure how empowering this thinking is.)

Things you'd better consider before taking the plunge:

\- How will you find customers? Search engines, email blasts, catalogs, list buying, renting, or sharing, advertising...

\- How will you fulfill orders? Your own garage, rented space, dropshipping from your vendors,...

\- What capital will you require and where will you get it? (This may be the biggest barrier vs. hacking)

\- How much volume will you have to do to break even? (Better be right about this or you're dead in a hurry)

\- What people will you require and how will you manage them?

\- What systems will you require and where will you get them? (Needless to say, there is great opportunity for competitive advantage here.)

\- What makes buying from you so much better than anyone else? (Maybe the most important question.)

\- There are hundreds of other things to consider, but you get the idea...

People have started with a small idea are parlayed it into hundreds of thousands (and even millions) of dollars per year in less than a few years. The case studies are almost endless. Google a few and see how they did it. Or watch Donny Deutch's show "The Big Idea" on cable TV.

If you decide to do something like this (not the best time of year now since everyone will be tapped in a few weeks), find your niche and go for it. Best wishes.

</comment><comment><USER5> I think the main problem is that because margins are so low in online retail, you have to run a large and efficient business to make any money - seems like it would be difficult to start out of your garage and offer the same prices that amazon does.

<comment><USER4> Small and efficient can work very well if you have a niche and know what you're doing. I have several clients that do exactly this and kick butt in the marketplace. And, ironically, they all sell through Amazon with better prices and service. (One of my hottest product/services is Amazon integration for small retailers. They take 15%, but the orders just keep flowing in...)

</comment></comment><comment><USER6> Not really, but the first bubble crushed a lot of companies that thought online retailing was a totally distinct business to normal retailing.

<comment><USER7> Not to mention competition with eBay.

<comment><USER4> Why compete? Use their plumbing to get rich. Tens of thousands already have.</comment></comment></comment>


Obamacare downtime because of poor coding - <AUTHOR> http://swampland.time.com/2013/10/24/traffic-didnt-crash-the-obamacare-site-alone-bad-coding-did-too/

<comment><USER2> " _"We have worked with the insures and the 'alpha teams' we jointly established made up of insurers' technology experts and CMS technology experts, to iron out the kinks," said Press Secretary Jay Carney in an emailed statement...._ "

Anyone out there ever heard of "alpha teams" in this context?

<comment><USER3> They've been using this term, as well as "A-team" to describe the best people the various agencies/contractors have.</comment></comment>


What Helps New Ph.D.s Land Jobs in Academia? A Passport  - <AUTHOR> http://online.wsj.com/article/SB124536653296629273.html <comment><USER2> See "Career Guide for Engineers and Computer Scientists" by Philip Greenspun at

<http://philip.greenspun.com/careers/>

Also read "Women in Science" by Philip Greenspun at

<http://philip.greenspun.com/careers/women-in-science>

The latter isn't limited to women's careers; in it Greenspun discusses working in science with an advanced degree.

</comment><comment><USER3> There are a couple interesting things about this article but it is a bit too short and doesn't say anything about the situation for PhDs in the science, which is not as extreme.

<comment><USER4> Isn't the situation actually worse for PhDs in science? I.e. not only can't you get a job in the USA because of foreign competition, you can't get a job overseas either (because the grad students can just go home)?

<comment><USER3> Well, in Computer Science, I'm not seeing that at all really. I see graduate students finishing their PhDs and getting good jobs and the departments I'm familiar with have been hiring. Though, many universities are experiencing financial difficulties, some even cutting class and really scrounging for funds.

<comment><USER5> God I hope so. Although it'll be quite a few years before I finish/start my doctorate.

<comment><USER3> I think you'll be fine. The main thing is to choose your research area/field carefully. If you choose one that is very crowded then you won't have as many people banging down your down as if you were one of only a couple people in the field (believe me, there are _many_ such problems).</comment></comment></comment></comment></comment>


Your time is up, publishers. Book piracy is about to arrive on a massive scale - <AUTHOR> http://blogs.telegraph.co.uk/technology/adrianhon/100005867/your-time-is-up-publishers-book-piracy-is-about-to-arrive-on-a-massive-scale/?utm_source=feedburner&utm_medium=feed <comment><USER2> >(I was also wrong about scanning and OCRing being the main way of pirating books – turns out it was people cracking the DRM of eBooks that publishers had helpfully formatted and distributed themselves!)

interesting. I wonder how much worse you make the pirated copy if you release your book on paper only? But that's a losing proposition for authors, as we get a much higher percentage of the e-book sale than of the physical book sale. I think more than half my last royalty cheque was from ebook sales even though physical book sales dwarf e-book sales in my case (and at this point, the publisher is giving away the e-book when you buy the published book direct.)

</comment><comment><USER3> the other possibility might be that book publishers marry themselves to apple and or amazon, and use their tight controls over content distribution. although, it might end up eliminating some fair-use rights, but something like that has already been played out before.

ipad/kindle etc point a way to bring back the copyright controls into the architecture of how people read books. i think lawrence-lessig talked about this in the "code and other laws of cyberspace". building tight copyright controls into a closed device is much simpler than a general purpose computer. sufficiently motivated folks can crack the ipad controls, but it is an open question if it can be managed while still letting ipad access the various stores that provide the content.</comment>


Show HN: Minimalist Stack Overflow - <AUTHOR> https://chrome.google.com/webstore/detail/minimalist-stack-overflow/hellcneecepjkpoflpdbbeijjkjklepk <comment><USER2> It has been a very long time since I even looked at any of the other links or widgets other than the answers.

I know for a fact that I will get used to the minimalist SO and would never want to go back.

Thanks for this.</comment>


Ask HN: Thoughts on i2p2 and Syndie anonymous networking/p2p/messaging? - <AUTHOR>

With all the focus on wire tapping, and new laws on data retention taking effect in Norway (already implemented in parts of the EU) - I went looking for alternatives for anonymous communication and file sharing -- and came across i2p[1] and Syndie[2] -- both of which looks promising.<p>Do any HNers have thoughts or experience with the technology? Any papers substantiating (or refuting) the usefulness? Anyone that have experience using the software?<p>[1] http://www.i2p2.de/ [2] http://syndie.i2p2.de/ <comment><AUTHOR> ... Or indeed any other suggestions (in addition to Tor, of course).</comment>


Etch a circuit board with kitchen supplies - <AUTHOR> https://www.instructables.com/id/Make-a-Circuit-Board-With-Household-Goods/ <comment><USER2> When I was in third grade, back around 1959, they pulled me out of class and asked me if I would like to go to Mrs. Spencer's Workshop for part of each day. This was a special class for bored and restless kids where we could work on projects of our own.

I started out drawing maps of freeway interchanges. A new freeway had just come through town (this was a very new thing at the time) and I was fascinated by the interchanges. I made sketches of all the ones between Eugene and Portland, and then I looked for something new to do.

I had been playing with electrical circuits for a while, so naturally I wanted to make a printed circuit board for a science fair project.

I didn't have one of those fancy phenolic sheets with copper on one side, but I figured I could just use a sheet of copper and put electrical tape on both sides to act as resist for the traces, and then mount the whole thing on a wooden board when done.

It would be a circuit, on a board, etched like a real printed circuit. So I thought that counted as a printed circuit board.

I asked Mrs. Spencer if she could get me a copper sheet and some electrical tape, along with a tank of nitric acid. And she did!

I taped up the sheet, dunked it in the nitric acid, and watched the unprotected parts dissolve away. And then I pulled the remaining circuit out of the acid, rinsed it off, peeled off the tape, and mounted it on my board.

Of course we didn't need eye protection or anything fancy like that back in those days.

And the circuit worked the first time! It may have been the first and last circuit or program where I had such good luck.

It was the most awesomest day at school ever!

<comment><USER3> I once did a science project in the school lab that dealt with sulfuric acid in an ehrlenmeyer flask. I completed the experiment, and went home. Only then I noticed that the whole front of my shirt had huge holes in it.

I was a lot more careful with acid after that.

</comment></comment><comment><USER4> This kind of stuff is cool from a educational perspective but with services like OSHPark I've lost motivation to make diy circuit boards. The batch services are just so cheap and fast now days.

<comment><USER5> Wow these services are getting cheap. That's really awesome. Thanks for sharing that.

<comment><USER6> Even cheaper (both senses of the word) are Chinese shops like jlcpcb and allpcb.

<comment><USER7> Strange Parts[1] made a great factory tour video of the JLC facility in China for anyone that interested in such things:

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

[1] [https://strangeparts.com/](https://strangeparts.com/)

<comment><USER8> Scotty is doing a good job of catching everyone up on what is going on in China. Chinese manufacturers have been putting out 10x10x10 boards for 50 RMB ($7 USD) for many years now. Rush order (24 hours)? Another 50 RMB. Yellow solder mask? Also another 50 RMB. Once you start talking about 4 layer, flex, rgba solder mask or other customization the difference is even greater.

</comment></comment></comment></comment></comment><comment><USER9> When I around 12 years old I attempted to etch my first circuit board. I took my copper clad board, placed it in a pie tin and then proceeded to pour in the etching acid. Within seconds, the acid reacted violently with tin and dissolved through the bottom of the pan and spilled all over the table saw and garage floor where I was working. Let's just say my dad was not a happy camper when I showed him my handiwork!

<comment><USER10> What acid did you use, when I etched my first board in 1969, I used Ferric chloride (that stuff stains everything!) and an aluminum pie plate, it worked fine, no reactions at all, other than slowly etching my copper circuit board.

<comment><USER9> I believe it was ferric chloride. The table saw and garage foor were permanently stained a brown rust color.

</comment></comment></comment><comment><USER11> If you're new to making circuit boards, I highly recommend giving KiCad a try, for drawing your schematic and board layout. It's open source, and while there are some rough edges, it seems to be built on a good foundation and there's been lots of good work being done on it lately. The learning curve isn't too steep, as these things go, but you're not likely to be limited it anytime soon, if ever.

[http://kicad-pcb.org/](http://kicad-pcb.org/)

<comment><USER12> I use KiCAD when I am forced to. Of the two open source EDA packages that I am aware of, KiCAD certainly has an easier learning curve than gEDA. That said, I started with gEDA so I have surmounted the learning and libraries problems sufficiently for my needs. My beef with KiCAD is that it is weak sauce, I find it missing a number of the features that I take for granted with gEDA. I don't use KiCAD for personal projects, the limitations frustrate me. OTOH Somebody just starting out and doing simple boards would probably find KiCAD more approachable than gEDA.

<comment><USER13> I too dragged myself up the seemingly insurmountable learning curve that was gEDA about a decade ago and used it exclusively for many years. I poked around in KiCad every now and then and didn't think much of it either.

Since the changes that CERN made, KiCad is a completely new tool. It is now my tool of choice, and unless gEDA gets a similarly drastic revamp, I'm probably never going back.

</comment></comment></comment><comment><USER14> The iron-on toner transfer thing has been around since laser printers came out. It doesn't work very well. Note the mention of needing a few tries to get it right. "Touch up" with a conductive ink pen and X-acto knife is often required. The resolution of this process is not that good. There also tend to be registration problems, because laser printer roller feeds are not precision devices. If you're doing modern surface mount components, it may not be good enough. There also tend to be registration problems, because laser printer roller feeds are not precision devices. You don't get plated through holes. So through-board connections have to be made by soldering in little wires. There are special rivets and tools available for this.

Other than as a curiosity, or for very, very simple boards for large components, this is more trouble than it's worth. Quick-turn one-off boards are so cheap now.

</comment><comment><USER15> If you want to make your first PCB for the simplest of projects this is overkill.

Instead:

\+ Get a single sided copper board and draw your design with a marker pen

\+ Etch it in ferric chloride in a plastic takeaway tub

\+ Drill holes

If it is too hard to draw with marker pen, then it is time to get the boards made for you from one of the links in this thread. The method in this article just looks frustrating.

<comment><USER16> Or you can just buy a roll of copper tape and not have to deal with acids at all.

</comment></comment><comment><USER17> The stuff you use for etching your own boards tend to be pretty nasty. Enough to burn holes in clothes and give you a rash if you're careless. Like other said, it's more economical to order boards through services like OSHPark and Seeed. If you want to make your own board for educational purposes or super quick turnaround (<24 hours) I think you're better off milling it. More of a hassle but much safer. Get a cheap CNC like a 3020 or something.

</comment><comment><USER18> The PCB tutorials by Chuck Adams(K7QO) on YT are pretty good and go over a unique PCB style that he calls MUPPET. Zero thru-hole mounting, but uses thru- hole parts (and SMD sometimes). His tutorials also go over creating the print transfer using a small lamination machine rather than a hot clothes iron. I recommend checking out the series.

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

</comment><comment><USER19> I totally understand the hobbiest aspect here, but... I just paid $15 for 3x 4-layer boards that will be delivered to me in a week. IDK, cool, but I'd spend more than $15 making 2-layer with way worse tolerances.

<comment><USER20> People don't really appreciate what a miracle the quick-turn electronics industry is. You can upload a Gerber file and get boards back in 24 hours. 2 layers, 4 layers, 6 layers whatever. Tiny little holes all over the board. Boards two feet square. If I order a huge box of stuff from Digi-key right now I'll have it on my desk at 8am tomorrow. Or I can drop-ship it to the PCB place and get stuffed boards, inspected and reworked, in a couple days. It's incredible, and all this has been up and running for at least 20 years.

<comment><USER11> I 100% agree that these services are incredible, but I think you're downplaying the changes in the last few years a bit much, considering the tooling improvements and plummeting prices.

As an example: last week at work, we had a situation where some product designer types and some engineers were having a hard time thrashing out aspects of a particular thing we've been talking about. It literally took me one working day and ~$300USD, to go from an email thread, to an order of custom PCBs and parts to make 10 physical widgets, which will be in our hands this week. In the meantime, I can nut out the firmware on a dev board from the pile of such things in my desk drawer, with free tools, easy-to-get docs, etc. That dev board costs about the same as two or three pints at the local pub.

I think in 1998, an engineer at my level would've spent an equal or greater amount of time on making a document and illustrations to explain the concept and tradeoffs that go in to it, then meetings to talk over that document, and possibly still no concrete conclusion. Instead, we get a small pile of working prototypes to fuss with and iterate on - if we go in this direction then we're already a substantial step toward the real product. And, our main office is in California, the factory is in China, and I'm in a small city in New Zealand.

Sure, this was something that could be done back then, but only if you were in the right place, and had the relevant parts pretty well figured out, and it would've cost a fair bit more money.

<comment><USER21> Spot on all points there.

Back in 98 the company I was working for was paying three salaries for EDA software licenses and $2-3k for a 48 hour turnaround on a couple of eurocards.

</comment></comment></comment></comment><comment><USER22> I still have one of the first circuit boards I made, sometime around 1982. I plugged my soldering iron into a Variac to run it at a lower temperature, then used it to draw with beeswax onto a piece of bare board, correcting my mistakes with a knife.

Today I just use a quick turn service, or some form of "dead bug" breadboarding.

<comment><USER10> Cool! So do I, from 1969, in my high school electronics class and it still works too.

It's for a variable audio oscillator that rises and is re-set by a micro switch.

I tuned it with a precision trim pot, to sound "like" a then new, electronic Police Siren, it was a big hit at school with all the guys.

Unfortunately, I used the case from my first Transistor Radio, which was an xmas present in 1962, a beautiful red and creme, Jupiter, 6 transistor radio, I regret cannibalizing it for the case, to this day.

Cream and white one here: [https://www.radiomuseum.org/r/jupiter_6_transistor.html](https://www.radiomuseum.org/r/jupiter_6_transistor.html)

</comment></comment><comment><USER23> Sticker backer paper is a good idea- I have also had good luck using shiny wrapping paper.

</comment><comment><USER24> Ok, now let's automate this!</comment>


Ask HN: What is the most hacker-friendly bank? - <AUTHOR>

Guys,
For awhile now, I've been crafting some software at home to keep track of my family's spending. I've tried Mint, Quicken, etc in the past, and none of them do it in exactly the way I'd like. They're either unreliable in connecting to my bank (Mint) or have an unfriendly user interface (Quicken). Personally, I'm after daily spending reports which are emailed out, a database of past transactions I can query easily, etc, etc.
Problem is, my current bank makes it a bit difficult to do this reliably. I manage to get my transactions today using Sikuli to log in to the account and download an OFX file, which is great. However, the OFX file itself often truncates the description of the transaction in such a way that you can't even tell who the money was paid to. It's pretty random in this way...for some vendors it prepends their address in the transaction description, for others, all it puts is their address. This may be the fault of the debit card/credit card processors themselves, not sure. Regardless, it is frustrating.
Plus, it shouldn't have to be this way. I'd really like to have a bank which:
- Provides some sort of API to get access to transactions, or at least makes it very easy to download transactions in an automated fashion - Reliably marks transactions which go to a particular vendor
Any of you know a bank that does this, or does similar things to make a hacker's life easier?
Thanks in advance. <comment><USER2> Probably BankSimple, but it hasn't launched yet. <https://banksimple.com/>

<comment><AUTHOR> Yeah....that's a problem ;-)</comment></comment>


Do AI/automation threaten you? - <AUTHOR> With automation becoming more and more prevalent these days, some people fear about automation and AI replacing us. I guess in this sense developers are safe but does it threaten you? Why or why not? <comment><USER2> There are many "jobs" or tasks that can be automated away as they are tedium nonsense tasks that interfere with the work people are doing or trying to do.

I have spent much time in the last few decades automating such tasks out of existence. Many times at the behest of those who were doing these tasks so that they could get back to doing their real jobs.

From my perspective, the problem that arises is where "management" are sold an idea that automation can do more than it really can.

As far as AI is concerned, this has been very much hyped up and exaggerated over the decades. What we have today is far less than the "promise" of the technology from way back in the sixties and seventies. Certain kinds of tasks currently being done by human intelligence could be replaced by the highly primitive AI technologies available to us. But one would hope that these systems would be reviewed continuously by human intelligence. Otherwise, we can expect disaster to occur on a regular basis as these system fail due to all sorts of "buggy" software and hardware and unforeseen error conditions.

</comment><comment> lle-bout AI is mostly designed as an aid to the human and not the reverse.

<comment><AUTHOR> I agree, but in other industries, there are people that say that AI will be replacing humans in the near future. At least I think they mean when AI becomes smarter. Somehow, I'm not we'll see an AGI or ASI in our lifetime. One that is capable of "replacing" human labor completely.

<comment> lle-bout We're technologically very far from that.</comment></comment></comment>