Show HN: ML From Scratch – free online textbook - <AUTHOR> https://dafriedman97.github.io/mlbook/content/introduction.html <comment><AUTHOR> I'm linking to a free online book I just finished called Machine Learning from Scratch. The book aims to cover the complete, technical, "under the hood" details that other ML textbooks don't. To do that, it shows all the mathematical steps to derive common algorithms and demonstrates how to fit each one from scratch in Python (using just numpy).

You might like this book if you are interested in ML and like to really understand what's going on behind the algorithms. Personally, when learning about these algorithms I would understand them intuitively but not feel comfortable constructing them myself. Even if you totally grasp the algorithms, seeing them derived from scratch is a great way to better understand the comparative advantages between competing models.

The code and math are pretty simple, so there should be a low barrier to entry.

I'm hoping to make the book somewhat of a breathing document, so if you have any edits, questions, or suggestions, I'm all ears. You can reach me at email@example.com. Thanks a lot!

<comment><USER3> Nice work!

Can we flag edits on github somewhere?

I found a typo at line 60 of [https://dafriedman97.github.io/mlbook/content/conventions_no...](https://dafriedman97.github.io/mlbook/content/conventions_notation.html), where your second "is written as $$" is missing the empty line before the "$$".

<comment><AUTHOR> Thanks for the catch! Ugh those pesky $$s. Changed it now.

Looks like you found the repository. Do you think it would be enough to raise an issue there? (at [https://github.com/dafriedman97/mlbook](https://github.com/dafriedman97/mlbook))? I'll look into linking directly from the book to the repo.

Thanks!

<comment><USER3> Added the issue.

Yes, I did find the repo. Hesitated adding the issue right away because the source files have ".md.txt" and ".html", but not the original ".md" files for me to fix them directly.

<comment><AUTHOR> Yeah the book was built with JupyterBook. It's an awesome tool but I lose track of what it does to the .md files when creating the website.

</comment></comment></comment></comment></comment><comment><USER4> Excellent! Very kind of you to do this. Are you accepting comments? If not, ignore the following. :)

As someone who learned how to program from trial and error via tutorials on the internet (some of the people who are going to read your book are people like me), I just have one comment:

Try not leaning on libraries in your tutorials.

I know it sounds insane to suggest you not use numpy in any kind of ML tutorial, but libraries like numpy used to make my new programmer's eyes glaze over. The fact that those imports are black boxes and can do literally anything used to make my noob mind overload. And I'd develop a blind spot for them. Before I could read code that exploited numpy's power, I had to work with numpy for a while to gain an intuition for it. New people don't have that. This isn't just towards numpy, but for all libraries in tutorials. If it's at all possible (I know it's not always possible in a reasonable way), make a super simple example of what you're going to use the library to do before you replace it with the library.

As mentioned elsewhere in this thread, Sentdex is actually really good at teaching new developers. I think this is because he often starts without numpy. For example in NNFS videos, he starts with just lists. He gets to numpy eventually, but knowing what he replaced with numpy helps make things more clear.

Just a thought.

<comment><AUTHOR> Thanks so much for your feedback. Definitely open to comments!

I agree 100% that any use of packages can be intimidating for newbies. I experimented at first with creating the models without using numpy and I thought that it actually made it less clear rather than more clear. It's obviously a tradeoff--you see where everything comes from (rather than np.mysterious_function()) but you take 5 lines of code to do the same thing that a single numpy command could accomplish. I felt in the end that it distracted from the real purpose of the code, which is to demonstrate how the model works.

Do you think a compromise would be to add a section to the appendix introducing numpy? Introducing arrays, random instantiation, stuff like that? Otherwise I might consider adding a no-numpy version in the future.

Thanks so much for your feedback!

<comment><USER5> I think there is a balance to be struck. You should totally use numpy for the arrays and basic math applications. But say on the first example you use `self.X.T` what does `.T` even do? Not asking you to go into all the details, just more comments saying this transposes the array, see numpy docs <link>. It will ease people into the library if they are unfamiliar with it. You do have some good ones like `column of ones` already, but more of those kinds of things.

I would also avoid using pandas if at all possible. Its just another thing people have to learn if they are unfamiliar.

<comment><AUTHOR> I definitely agree. I should add more comments explaining what things like .T does--it's not that it's hard to grasp, but it might turn away newbies. Thanks for the suggestion!

Pandas is only used in the "code" sections, which use packages like scikit- learn anyway

</comment></comment></comment></comment><comment><USER6> Skimming the sections on linear models, I was surprised not to see a discussion of model fit, beyond just plotting predicted values against observed ones. Basic predictive models like linear and logistic regression are simple to construct mechanically. It's a substantially more involved task to quantify their degree of fit and, better yet, prove that the methods are optimal and unbiased (in a statistical sense).

<comment><AUTHOR> I agree though I saw that as outside the scope of this book. I tried to be clear in the introduction that the book is a "user manual" of sorts that simply shows how to construct models, rather than how to decide between them, what the benefits of each are, etc. That information is certainly important but I felt it had been covered more than adequately by books like Elements of Statistical Learning

</comment></comment><comment><USER7> That's a really cool initiative, but I think we disagree on the term "from scratch". Taking a look at the source code, I see you're using sklearn - <USER2> is a great tool - but, from scratch, at least for me, implies writing your own code (logistic and linear regression, adaline, perceptron, mlp, knn, kmeans...) I mean, that's how I learned it. But again, congratulations on the initiative.

<comment><AUTHOR> Perhaps I should have been clearer, but the "code" section within each chapter is not "from scratch". The "construction" section is "from scratch" in that it only uses numpy (not scikit learn). The scikit-learn part is just so new users can see how these could be fit in practice.

<comment><USER5> I went straight to the "code" section. Didn't know there was stuff in the "construction" section too. I would definitely consider not using sklearn for anything other than data sets. You already defined them, why not use them? Or rename the "code" section. I expected that to be the final code as you build it. Maybe show the usage of both side by side, as a way to ease people into sklearn. But the "code" section should totally be focused on what you made.

<comment><AUTHOR> That's sensible. Maybe change construction to code and code to application? Or keep construction but rename code? I'll have to brainstorm. I definitely don't want people missing the construction section so this is great feedback. Thanks!

<comment><USER5> I like the sound of Application at least. Or 'In practice'?And Construction does make sense when I think about it more. Not sure I can think of a better name at least.

<comment><AUTHOR> My hesitance with "Application" is that sounds like I'm going to use some interesting dataset or do some cool project (and this is essentially using iris to build basic models). How about "code" becomes "implementation"?

</comment></comment></comment></comment></comment></comment><comment><USER8> Feedback for the authors: I had a really hard time finding the "graph_boundaries" code (I eventually saw the "Click to show" button on the right)

I love the source code included, very handy for the future!

<comment><AUTHOR> Thanks for the helpful feedback. I wanted to put emphasis on the graphs so I chose to hide the code but maybe it's not worth the cuteness of the "click to show". Changing that now.

</comment></comment><comment><USER9> Great resource! I've been looking for something with complete derivations all in one place. I've been looking for a while but haven't been able to find something like this. Thanks for sharing

</comment><comment><USER10> First thing I thought of when I read the title was sentdex's nnfs.io (neural networks from scratch.) I don't have time to look at this in full right now, are there any major differences between the these? From my quick glance over this looks like it's heavy on the math notation and when it gets to the code it's already getting to complex (for someone who doesn't know python) to read.

<comment><AUTHOR> The approach to this book is very similar to nnfs.io (a similar focus on deriving models from the bare bones). The biggest difference is that his focuses on deep learning while mine covers a) a wider range of models and b) more introductory methods (linear regression, logistic regression, naive bayes, etc.)

It is definitely heavy on the math notation. Since the purpose of the book is to provide mathematical derivations, it's impossible to do that without lots of notation. That's why I added the notation and conventions page (right after the table of contents). If you do get a chance to look through it and see any notation in particular that is difficult to follow, please let me know and I'll update that page.

As for the code, knowing Python is a loose pre-requisite, but familiarity with object oriented programming in general should be enough to at least follow along. Most of the code does one of two things: 1) manipulates data represented as vectors/matrices or 2) creates/manipulates the objects themselves. But I should work on making the commenting clearer so it's apparent what each step does, even for someone less comfortable with Python.

Thanks so much for your feedback!

<comment><USER10> Thanks for the summary, the object oriented stuff is fine in my mind. The trouble with the code comes from things like the numpy functions. I have experience in matrices for what's used in computer graphics, but some of numpys functions are conflicting with what I understand those constructs to do. I don't know maybe it's the lack of any type information that makes this hard for me, I can't just look at the something I know and figure out what is going on from there, I have to go through each function one by one to make sure I know what it actually returns.

Either way, good luck with the book. I've considered doing knowledge dumps myself for game/game engine oriented information but I don't even know where I would start with that.

<comment><AUTHOR> Thanks for the feedback. Sounds like you're not alone in your thoughts on numpy. I'll brainstorm better solutions--maybe explaining each numpy function in a side note or adding a numpy overview to the appendix. It just makes things so much easier so I am hesitant to go numpy-less.

Getting started was definitely the hardest part. I put the book together with JupyterBook ([https://jupyterbook.org/intro.html](https://jupyterbook.org/intro.html)), which I would highly recommend! Really neat tool and a helpful community.

</comment></comment></comment></comment><comment><USER11> Nice work. Seems like it focuses on machine learning stuff that's not deep learning. Maybe you could add a section on collaborative filtering.

</comment><comment><USER12> I read the title and was somehow was expecting a guide on compiler design implementing some flavor of the the ML language such as Standard ML.

<comment><USER13> Yeah, I was excited too. Of all the naming conflicts in our industry, this is one that frequently bites me.

</comment></comment><comment><USER14> This looks fantastic! As a bit of a selfish question, have you considered also offering a downloadable epub of this book? I've been trying to keep my long- form digital reading to my eReader, for the sake of not looking at LCDs _all_ day, but that makes web ebooks a bit of a pain due to e-ink not liking scrolling very much.

<comment><AUTHOR> You can now find a pdf version of the book at [https://github.com/dafriedman97/mlbook/blob/master/book.pdf](https://github.com/dafriedman97/mlbook/blob/master/book.pdf). JupyterBook is still working on the PDF creation, so this doesn't have any of the images unfortunately. That said, most of them aren't too important (until the neural net chapter, where they get a little more important)

</comment></comment><comment><USER15> Just did a quick scan and looks pretty good! Would it be possible to add an option for exporting the raw code (maybe broken down by chapter/section) separate from the notebooks? Ideally this would run self-contained without relying on state buildup in the notebooks.

<comment><AUTHOR> Good call! I'll work on that ASAP

</comment></comment><comment><USER16> This book is awesome! How does this compare to Introduction to Statistical Learning or Elements of Statistical Learning? Other than the addition of code?

<comment><AUTHOR> Thanks so much! I would say two major differences: 1, as you mention, it codes each method up from scratch in Python readers can really see each step the method uses. 2, it is focused on the derivations of these methods, rather than their intuition, applications, etc.

</comment></comment><comment><USER17> Looking through the topics, a useful addition would be SVMs.

<comment><AUTHOR> Agreed. That's #1 on my list right now.

</comment></comment><comment><USER18> Unfortunate this appears next to the post about deep learning jobs collapsing on the front page</comment>


AWS Organizations: Centrally Manage Multiple AWS Accounts - <AUTHOR> https://aws.amazon.com/blogs/security/announcing-aws-organizations-centrally-manage-multiple-aws-accounts/ <comment><USER2> I'm always amazed at how quickly Amazon pushes out new, useful features. I don't know if it's on their radar, but I think one of the most important things they could incorporate is the concept of a "project" within their console / apis.

I'm not saying it's not possible to do similar things within the constructs already provided, but if I'm involved in 10 different projects (or managing them) maybe I want to be able to "toggle" between projects. This way (a) I can simply assign / unassign a person to/from a project without needing to worry about permissions at a different level. If I'm a lead programmer on a project I should simply have "project-level" permissions. (b) when I "toggle" to a project I immediately see project-related resources ONLY. No more need to scroll through 10's or maybe 100's of unrelated resources just to get to what I'm looking for.

<comment><USER3> I use one IAM User per project per engineer, all tied to a root account. Since my IAM roles are project specific, the console shows only the resources relevant to the project that the IAM User is allowed to see.

For quick switching between projects on the Console, I use a Chrome user session per project and have them loaded up. [Chrome session is the little icon on the top right corner of browser that has your name on it]

It will indeed will be a cool Console feature to handle multiple IAM User sessions with a drop down toggle like the Region switch.

</comment></comment><comment><USER4> This is excellent, I'm going to use this to separate production from test environments using separate accounts.

Using VPCs, security groups, IAMs, tags, etc. is great, but those are all constructs you have to take care to implement correctly yourself within your deploy scripts. One slip-up and you could accidentally expose environments to each other, or worse make a mistake that deletes or reconfigures resources in an environment you didn't intend to. Or an errant process in a test environment could unexpectedly gobble up too many resources, resulting in production being throttled.

So separate accounts is the safest isolation approach, but historically there have been drawbacks (this blog post discusses some[1]), like billing is more expensive (due how AWS charges for usage and you won't be sharing reserved instances anymore) and I wasn't sure how to handle things that need to be cross-environment, like Route53 (DNS). Looking forward to trying this out!

[1]: [https://charity.wtf/2016/03/23/aws-networking- environments-a...](https://charity.wtf/2016/03/23/aws-networking-environments- and-you/)

</comment><comment><USER5> I have seen numerous companies get burned because they were sharing a single login on AWS. This is a welcome improvement toward practically managing such an important resource for many teams.

<comment><USER6> IAM was already built into AWS, so that's sort of their own fault for not utilizing that feature. Unless you mean this in a different way, but using a single login was not needed in the past. This is a little different. Sorry, but it's true.

<comment><USER7> I wholeheartedly agree. IAM has been readily available to provision individual users on the AWS accounts for quite some time now. Sharing access to the root account is a bad practice.

Ideally, the root account should have MFA enabled, all root access keys should be deleted, and individual users should have their own usernames provisioned via IAM with the principle of least privilege applied.

<comment><USER8> Except if you need to use AWS services such as AWIS which requires root account access keys...

</comment></comment></comment></comment><comment><USER9> Happy to have this as the existing workarounds were less than ideal... (e.g. [https://segment.com/blog/rebuilding-our- infrastructure/#sepa...](https://segment.com/blog/rebuilding-our- infrastructure/#separate-aws-accounts))

</comment><comment><USER10> Nice feature and I know larger companies would love it, but I personally would like to have better grouping ability of assets within the _one_ AWS account. For instance, we have a bunch of servers for one web app, two or three for other apps, a few apps with single servers etc.

Not just EC2 here, I am talking about RDS, Elastic Beanstalk, Route 53, CloudFront, DynamoDB, the works. Would be nice if we could define 'stacks' for each web app and have the on one neat console to work with.

(I know there is the concept of 'Resource Groups', but that relies on tagging assets, and I don't believe tagging extends across all the AWS assets at this stage? I would love for someone to correct me on my assumptions.)

<comment><USER11> I think CloudFormation [[https://aws.amazon.com/cloudformation/](https://aws.amazon.com/cloudformation/)] might be what you're looking for, they even use the term "stack".

At first blush it might seem to have a high learning curve given the verbosity of the syntax to define a stack, but with the launch YAML support, the syntax has become more succinct. Once you use it, you'll wonder how you ever lived without it.

The product page doesn't do it justice, but in short, CloudFormation allows you to:

\- Describe the AWS resources you need in a single file (YAML or JSON), this would be your "stack".

\- View all the resources provisioned based on your code in a single UI grouped under the "stack" in the CloudFormation console.

\- Manage changes to your resources as different versions of the code file, meaning if you update a resource's properties in code, it'll know and update the already provisioned resource.

\- You can delete an entire "stack" and be certain that all associated resources are also destroyed.

\- When I used it, the coverage of types of resources you can code for was wide and they're continuously adding more.

I recommend trying it out by setting up a simple S3 hosted website using this template [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuid...](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-s3.html#scenario-s3-bucket- website-customdomain)

If you're trying to remain cloud-agnostic, then I suggest you also checkout HashiCorp's Terraform [[https://www.terraform.io/](https://www.terraform.io/)]. Think of Terraform as a scripting language that compiles into AWS CloudFormation or any other cloud provider.

<comment><USER10> Thanks for the heads up on CloudFormation. I've just poked around and realise the our Elastic Beanstalk instances all create a stack in there automatically. Seems pretty useful, and I will investigate a little more to see if we can integrate other AWS assets like S3 buckets, RDS servers etc. into each stack for better management.

<comment><USER12> Save yourself the pain of CloudFormation and check out Terraform.

</comment></comment></comment></comment><comment><USER13> This will be incredibly useful for an agency like scenario. Wish I had access to this 2 years ago!

<comment><USER14> I am in a agency like scenario where all the clients have their own AWS infrastructures (sometimes multiple) and I have to juggle between those all the time. What I really would want is an account picker for myself: the default console login page is terrible and it's barely manageable with LastPass. Switching between incognito windows only goes so far too.

<comment><USER15> Maybe the new containers feature in Firefox Nightly can be useful for you :)

<comment><USER14> Hey, that sounds pretty great! Thanks!

</comment></comment></comment></comment><comment><USER16> A (lonely?) example of AWS playing catchup to GCP.

<comment><USER17> Don't forget S3-IA after we released Nearline. Also all those sudden price drops (particularly [1] the day after [2], and just last week the Glacier one [3] after Coldline [4]).

Everyone wins (or at least consumers of Cloud services) from this competition. So I'm glad to hear it!

Disclosure: I work on Google Cloud.

[1] [https://aws.amazon.com/blogs/aws/aws-price- reduction-42-ec2-...](https://aws.amazon.com/blogs/aws/aws-price- reduction-42-ec2-s3-rds-elasticache-and-elastic-mapreduce/)

[2] [https://cloudplatform.googleblog.com/2014/03/google-cloud- pl...](https://cloudplatform.googleblog.com/2014/03/google-cloud-platform- live-blending-iaas-and-paas-moores-law-for-the-cloud.html)

[3] [https://aws.amazon.com/blogs/aws/category/amazon- glacier/](https://aws.amazon.com/blogs/aws/category/amazon-glacier/)

[4] [https://cloudplatform.googleblog.com/2016/10/introducing- Col...](https://cloudplatform.googleblog.com/2016/10/introducing-Coldline-and- a-unified-platform-for-data-storage.html)

<comment><USER18> > Disclosure: I work on Google Cloud.

I think our big clue was when you said "after we released Nearline". ;)

<comment><USER17> I know you're just joking, but I have honestly considered moving the Disclosure line to the top. Besides, maybe folks in Search and Ads can take pride in Cloud, too ;).

<comment><USER19> I appreciated the disclosure...I admit I just didn't even know what Nearline is!

<comment><USER20> My first thought was the mainframe tape robot: [https://www.youtube.com/watch?v=RU8wASddKig](https://www.youtube.com/watch?v=RU8wASddKig).

</comment></comment></comment></comment></comment></comment><comment><USER21> Can an OU easily be transferred to another Organization down the road? For example, if I put a client's data in their own S3/OU within our AWS account, then they want to assume ownership of that later, can the OU be transferred to their account without much hassle?

</comment><comment><USER22> There's really only a small set of use cases that should actually benefit from this. The vast majority of organizations simply need to use IAM users, which many don't.

<comment><USER23> Really large organizations will appreciate this, IAM is not sufficient. Many account limits impact larger orgs, and having to ensure each accounts policies are set right is a trust exercise. It's much nicer to have policy trickle down from the org account (most have the consolidated billing master acct already).

</comment></comment><comment><USER24> This is big. So many people were asking for this.

</comment><comment><USER25> I hope this means that if you want to change your "root" account, this will basically allow that and the new organization account will take over all those responsibilities for the sub accounts.

</comment><comment><USER26> This is also big as a lot of account limits are on a per account basis.

<comment><USER27> Yeah, I was considering building something that would require more than 50 (100?) S3 buckets. The thought of trying to do it by managing a bunch of independent accounts didn't appeal. I was also wary of infringing some policy by doing that.

For what it's worth, it turns out that GCP doesn't have per account bucket limits.

<comment><USER28> Isn't the limit on the number of S3 buckets simply a "send us an email and we'll change it" limit?

<comment><USER29> This was AFAIK one the few hard limits, however this changed in 2015 [https://aws.amazon.com/about-aws/whats- new/2015/08/amazon-s3...](https://aws.amazon.com/about-aws/whats- new/2015/08/amazon-s3-introduces-new-usability-enhancements/) where you could request to get more buckets

</comment></comment></comment></comment><comment><USER6> Can anyone tell me the difference between this and Azure's RBAC? Just reading this, they seem to be the same or very similar.

<comment><USER30> Azure RBAC is about controlling access to resources inside an Azure subscription. Subscriptions in Azure can be broken out into Resource Groups which are commonly used for units of deployment. RBAC would restrict a login to a specific set of resource groups and actions (i.e. modify, don't delete).

Azure has a similar account structure for enterprise customers. They get an root level enrollment and then have the flexibility to divide into "departments" and "accounts." Subscriptions live under accounts. Administrators and viewers can be assigned at any level and cost reporting is built into the enterprise portal. Policies cascade from higher levels down into accounts and subscriptions. Policies as JSON files that can control things like restricting regions, services, etc.

Disclaimer: I work for Microsoft and Azure is my focus.

</comment></comment><comment><USER31> Would it also allow you to delete subaccounts? We've been giving developer accounts to employees, but when they leave the company we have to ask them for the root credentials so we can deactivate that account...

<comment><USER32> Why are you giving away root credentials when IAM users and policies are available?

<comment><USER31> It's for the personal AWS accounts of the employees that leave (the sub accounts in consolidated billing). Not the root credentials for our main account.

</comment></comment></comment><comment><USER33> FINALLY! =)

[https://24.media.tumblr.com/426ebe2f8bf2499cac61a0710fb0c43d...](https://24.media.tumblr.com/426ebe2f8bf2499cac61a0710fb0c43d/tumblr_n3jwddkzyk1smcbm7o1_250.gif)

(Don't even care about all the downvotes I'll get for posting Gif on HN as if it were Reddit).

<comment><USER34> Did she glue her fingers together?

</comment></comment><comment><USER35> As usual: better stay away from Amazon!

</comment><comment><USER36> thank the maker!!</comment>


On bad reviews and customers and Ego - <AUTHOR> http://log.maniacalrage.net/post/98510137/a-little-over-a-week-and-a-half-ago-google <comment><USER2> Quote:

User: _Oh, I'm supposed to read all the other support requests marked this problem is resolved? Sorry. It's still not resolved for me._

Author: _Apparently they didn't understand that "solved" was a relative term. Yes, sure, it's not solved for you right now, but my resolution was pretty clear—it's solved in the version Apple is looking at. JUST HOLD TIGHT. I thought this was enough. But no._

Me: when you design an app that depends on the availability of third-party network resources make sure you design for graceful handling for the downtime of those resources. And if you don't then somebody else will do it instead of you.

</comment><comment><USER3> I released an Android app today with similar results. Lots of people giving 5 star, glowing reviews when it works and lots of people giving 1 star, nonsense complaints. And as with the iPhone, there's no way for the developer to respond or clear up misinformation.

</comment><comment><USER4> This is why I use and support as many open-source technologies and apps as I possibly can. Not a great way for anyone to make money, however.

<comment><USER5> While I'm all for supporting and using open source software, I don't quite get how doing that has anything to do with this story. Or are you talking about the Apple-controlled nature of the AppStore?

<comment><USER4> Yeah, the closed nature of the app store and of the device itself.</comment></comment></comment>


What Are the Best Coding Bootcamps in NYC? - <AUTHOR> https://www.switchup.org/locations/nyc-coding-bootcamp <comment><AUTHOR> SwitchUp collected thousands of reviews to analyze the top coding bootcamps in NYC.</comment>


Growth hacking is still bullshit - <AUTHOR> https://medium.com/startup-foundation-stories/2016-is-almost-over-and-growth-hacking-is-still-bullshit-7c164ee4f247#.h5edo8mh1 <comment><USER2> While I do agree that in the example article mentioned all those were definitely Basic Marketing 101, I actually believe that "growth hacking" is real and is more of trying new things that no one has done before. These strategies/tactics are unique and different to every business depending on several factors such as type of business, target market, location, etc. These are also time sensitive and have a life cycle, meaning what worked 5 years ago will likely not work today.

It's a constantly shifting landscape with new unique opportunities appearing everywhere, you just need to find them and when you find something showing any promise, you gotta EXECUTE. And expect to fail (waste your time) often. When it happens, you shrug it off, learn from it, and look for another "hack".

Also, keep in mind that when someone finds and establishes a real "growth hack" that works wonders for their business, it will be a gold mine and they will 100% NOT be sharing it with anyone. They will try and milk it as long as they can. Once it's milked dry, that's when the "gurus" come out and share them (for money AKA paid courses, or blog views), literally at the end of the life cycle when it's not worth keeping a secret anymore.</comment>


Don't Panic About Rare Earth Elements - <AUTHOR> https://www.scientificamerican.com/article/dont-panic-about-rare-earth-elements/ <comment><USER2> The metals might not be rare (I am absolutely certain some of them are) but getting a permit to mine them here will be. I would guess that industry and government will get it done with some excercise of emergency powers.</comment>


Propositions as Types - <AUTHOR> https://youtu.be/IOiZatlZtGU?t=1678 <comment><USER2> The youtu.be domain is autokilled. Try resubmitting using the youtube.com version of the link.</comment>


Hurl - <AUTHOR> http://hurl.r09.railsrumble.com/ <comment><USER2> Thanks for the comments everyone! The main idea here is that you can share Hurl URLs which others can modify and play with.

For example I can give you this URL: <http://hurl.me/ufsmb1>

And you can change 'json' to 'xml' to see what changes.

Hurl was inspired by sharing curl input and output over pastebins. We should probably make this more clear.

</comment><comment><USER3> Easter egg: try entering the site's URL.

</comment><comment><USER4> Very, very cool.. and I love the name.

That said, I regularly test APIs using actual usernames and passwords via HTTP Basic Auth. It will be a cold day in hell before I toss my credentials in cleartext into a web form. :-)

I really like the syntax-highlighted, pretty-printed JSON output, though. Really handy.

<comment><USER2> We plan to open source Hurl so you can run it somewhere if you want (for auth reasons).

<comment><USER5> This is what I love to hear (now to get those Twiddlr kids to let me run a local instance...).

</comment></comment></comment><comment><USER6> A similar app, but as native OS X app (useful for localhost requests) <http://ditchnet.org/httpclient/>

<comment><USER2> HTTPClient is great and was a big influence on Hurl (for instance we auto- complete headers just like HTTPClient does).

<comment><USER7> I can't seem to get Hurl to send application/json content. Any ideas?

A few minutes later: everything seems to give the error:

Cannot allocate memory - fork(2)

<comment><USER2> Yeah you guys crashed it :P

I'm workin' on bringing it back up.

</comment></comment></comment></comment><comment><USER8> It's ok, but Firebug covers this pretty well already.

<comment><USER2> I commented about this further down but the main idea is you can share Hurls which others can modify and play with, e.g. <http://hurl.me/ufsmb1>

</comment></comment><comment><USER9> After doing some tests, it appears that gzip doesn't work.

</comment><comment><USER10> I use <http://code.google.com/p/rest-client/>. But cool site none-the-less.

</comment><comment><USER11> Why don't we make something like socket2http_get

        http://example.com/tcp?address=example.com:80&send=GET+/+HTTP/1.1%0D%0AHOST:+example.com%0D%0A%0D%0A

Oh wait... did I just re-invented HTTP 1.1 Connect?

</comment><comment><USER12> I'll stick with HTTP Client for OS X, handles everything I need it for!

</comment><comment><USER13> Cool site, but I would lose the fluorescent dots filling each margin.

</comment><comment><USER14> Very slick, but it really needs a JSON pretty printer in addition to the XML one. Most JSON services just send one huge line, which is exactly how Hurl displays it.

<comment><USER2> Can you give me an example URL? Sounds like a bug.

We do pretty print JSON: <http://hurl.me/ufsmb1>

<comment><USER14> [http://hurl.it/hurls/7249f0ef9428c30c52e8e739eace1ba365fa24c...](http://hurl.it/hurls/7249f0ef9428c30c52e8e739eace1ba365fa24ce/321c6c417c5501fc3be4ae6f3bd7069d110359f0)

Ah, I assume you are relying on the MIME type to be application/json, which is far from universal. A heuristic JSON detector shouldn't be hard.

</comment></comment></comment><comment><USER15> Why no way to enter a raw POST body instead of key-value pairs? Could've been seriously useful for some web services.

<comment><USER2> Coming soon.

</comment></comment><comment><USER16> This is seriously news? I could write this app in 10 lines of code, or am I missing something important?

<comment><USER17> Yes, perhaps you are. First, watch the video: <http://vimeo.com/6238577>

Second, realize that this was developed from start to finish in 48 hours, by some not untalented people... they seem to have put a lot of thought into it, and the details really show.

Third, saying you could do anything nontrivial in "10 lines of code" reminds me of this guy <http://news.ycombinator.com/item?id=678501>

<comment><USER18> _First, watch the video?_

Doesn't that seem to emphasize the guy's point? It seems like a neat if simplistic little tool and if you have to watch a video to tell how it's something more...

<comment><USER2> Yeah, it does.

Sounds like we should change this:

      Hurl makes HTTP requests.
      Enter a URL, set some headers, then view the response.
      Perfect for APIs.

To something like this:

      Hurl makes HTTP requests.
      Enter a URL, set some headers, get a response, then share it with others.
      Perfect for demoing and debugging APIs.

</comment></comment></comment></comment><comment><USER19> Love the unicorn puking a rainbow on their 404 error page.

<comment><USER20> Thanks! Me too.</comment></comment>


Starting a club with a startup mindset - <AUTHOR>

Hey everyone, So, me and another friend are trying to start a club at our university centered around the startup culture, which for us is to go from idea to a working product. Our school has a decent amount of tech students and business students, but we find that they don't collaborate enough together. We're trying to focus on having a club where students can pitch their ideas, find other members who might want to work on some ideas, or just generally work around people trying to get projects started. This can create a great way to pass around skills, as well as getting useful critiques on direction, business plans, and tech knowledge.<p>Unfortunately, we're having trouble on how to structure such a club. So I'm wondering how you would structure such a club? <comment><USER2> 1- Invite students that you think might be interested 2- Explain the idea of your club as stated here 3- After members sign up to your club, real work begins 4- Every 2 weeks you'd have each one of the club go up and suggest an idea and people would vote for it 5- Ideas with most votes then would state what kind of specialized people they need and create their group 6- two weeks later they finish their project and do the something again 7- Eventually people would start recognizing others who work well with them and when that happens they would form their own groups after they finish school and you would have helped create a business</comment>


Why the future doesn't need us. By Bill Joy [2000] - <AUTHOR> http://www.wired.com/wired/archive/8.04/joy_pr.html <comment><USER2> I never understood the gray goo problem. Isn't life, evolution's best attempt at gray goo? Developed over the past few billion years? How could we invent something that replicates faster and more efficiently than life does?

Even it's ultimately possible, I can't imagine it would happen by accident. It would certainly require a lot of deliberate effort, and 1000s of new technologies.

<comment><USER3> What gave you the idea that evolution designs optimal solutions? This is like saying a Boeing 747 can't fly because eagles are the upper bound on flight speed.

<comment><USER4> A Boeing can't reproduce, and cannot heal itself.

(edit: I mean to say that there are processes that evolution has evolved that have eluded us and may continue to elude us indefinitely)

</comment></comment></comment><comment><USER5> we can never recreate consciousness, we can only approximate it ... ones and zeros will never be able to compete with true spirit.

<comment><USER6> So what about analog computers?</comment></comment>


A New Golden Age for Computer Architecture - <AUTHOR> https://cacm.acm.org/magazines/2019/2/234352-a-new-golden-age-for-computer-architecture/fulltext <comment><USER2> > Today, 99% of 32-bit and 64-bit processors are RISC

> Concluding this historical review, we can say the marketplace settled the > RISC-CISC debate; CISC won the later stages of the PC era, but RISC is > winning the post-PC era

It is clear that his assessment is right, but isn't the 99% number too high ? Servers, laptops and desktops still run x86 and they are CISC ( unless you are counting x86 as RISC based on microcode )

> Many researchers assume they must stop short because fabricating chips is > unaffordable. When designs are small, they are surprisingly inexpensive.

> High-level, domain-specific languages and architectures, freeing architects > from the chains of proprietary instruction sets, along with demand from the > public for improved security, will usher in a new golden age for computer > architects. Aided by open source ecosystems, agilely developed chips will > convincingly demonstrate advances and thereby accelerate commercial > adoption.

It will be interesting if manufacturing also gets open sourced. There already seems to be a project attempting this : [http://libresilicon.com/](http://libresilicon.com/)

<comment><USER3> I assume they're counting them as RISC cores plus microcode that makes them compatible with older x86 CISC designs. Modern x86 is RISC under the covers by any meaningful definition-/and also shares pretty much all the problems.

<comment><USER4> I don't know why this gets thrown around but it's completely wrong. RISC and CISC are about instruction set architecture. As soon as you have crossed the decoder boundary you are deep into micro architecture territory where the ISA is completely irrelevant because you can use the same techniques regardless of whether you have RISC or CISC.

Now if one would take what you said at face value then it would actually imply that RISC as an ISA is completely irrelevant because it is possible to achieve the same benefits or even beat it despite CISC having the inefficiency of hard to decode instructions and the high cost of a conversion step in the micro architecture. One suddenly realizes that this battle of ISAs is completely futile and the secret sauce is in the micro architecture which is completely divorced from the ISA.

Here are some examples: ARM makes slow ARM chips. Apple makes fast ARM chips. AMD made slow x86 chips in the past but now adopted a faster micro architecture. Intel made Itanium but the chips didn't have any sort of dynamic scheduling so they couldn't deliver the promised performance gains.

<comment><USER5> Well, both Hennessy and Patterson have perpetuated the micro code and RISC myth, presumably because it suits the "RISC world domination" narrative.

</comment></comment></comment></comment><comment><USER6> I remember being excited about The Machine [1] from HP:

"The Machine will be a complete replacement for current computer system architectures. There will be a new operating system, a new type of memory (memristors), and super-fast buses/peripheral interconnects (photonics)."

"HP says it will commercialize The Machine within a few years, "or fall on its face trying.""

It seems later happened...

[1] [https://www.extremetech.com/extreme/184165-hp-bets-it-all- on...](https://www.extremetech.com/extreme/184165-hp-bets-it-all-on-the- machine-a-new-computer-architecture-based-on-memristors-and-silicon-photonics)

<comment><USER7> Later always happens.

<comment><USER6> Sorry for the typo :)

</comment></comment></comment><comment><USER8> I think back to the old Cat Stevens song "I Want To Live In A Wigwam", except now I think maybe one day I'd like to live in a Faraday cage.

Computers, like guns, drugs, and any other invention of man are not inherently evil. All these things can be used for good or evil. Unfortunately, the fly in the ointment is human nature. With the convergence of cheaper but increased computing power and the monetization of personal information, I fear what the future holds. I hope I'm wrong, but it looks to me that humanity is doomed to forever live in a state total surveillance and control. We're seeing it happening already. Just the other day I saw an article that said that Sweden is going to tax people on the miles they drive. The very next day I saw another article saying Los Angeles is planning to do the same thing.

Sigh... I'm glad I'm old.

<comment><USER9> Every country already taxes people on the miles they drive, as every country has a fuel tax.

<comment><USER8> The difference is pay at the pump or pay via what your car's embedded GPS is reporting. GPS also allows them to know when and where you were speeding, and since Sweden went cashless, they can simply deduct the fines from your bank account. Compliance is irrelevant.

If having a GPS device on your person becomes law, then avoiding the tax by riding a bicycle, walking, riding a horse etc is defeated.

<comment><USER9> Could you link through to the article you read this in, because I live in Sweden, own a car, and have not heard or seen anything about this.

</comment></comment></comment></comment><comment><USER10> I'm trying to think of what are some neat computer architectures out there.

Chuck Moore's "Green Arrays" is kinda cool and so is the Parallela board.

<comment><USER11> Transputer. Hardware multitasking and link-communication and a very compact instruction set.

[https://en.wikipedia.org/wiki/Transputer](https://en.wikipedia.org/wiki/Transputer)

[https://en.wikipedia.org/wiki/XCore_Architecture](https://en.wikipedia.org/wiki/XCore_Architecture)

SOAR (Smalltalk On A RISC), though the conclusion there was mostly that a plain old RISC will do. I wonder if that is still true today.

Rekursiv OO computer [https://en.wikipedia.org/wiki/Rekursiv](https://en.wikipedia.org/wiki/Rekursiv)

NEC dataflow processor. [https://books.google.de/books?id=qRrlBwAAQBAJ&pg=PA152&lpg=P...](https://books.google.de/books?id=qRrlBwAAQBAJ&pg=PA152&lpg=PA152&dq=NEC+7281&source=bl&ots=eI51Z6P4Ao&sig=ACfU3U0sFs_dluKsnjoORUk5RHGVX1UytQ&hl=en&sa=X&ved=2ahUKEwiDm8mv2ZLgAhUN3qQKHQHgBqQQ6AEwCXoECAIQAQ#v=onepage&q=NEC%207281&f=false)

<comment><USER10> Never heard of SOAR. It would be pretty sweet though to have a powerful & multi-core chip running a Smalltalk OS that could do something with all the cores. I'd also like to see kOS from Arthur Whitney if he ever finishes it, although I'd never be able to afford any of their products.

<comment><USER11> [https://www2.eecs.berkeley.edu/Pubs/TechRpts/1986/CSD-86-287...](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1986/CSD-86-287.pdf)

[https://www.deepdyve.com/lp/association-for-computing- machin...](https://www.deepdyve.com/lp/association-for-computing- machinery/soar-smalltalk-without-bytecodes-dMyiYUWgIr)

[http://digitalassets.lib.berkeley.edu/techreports/ucb/text/E...](http://digitalassets.lib.berkeley.edu/techreports/ucb/text/ERL-85-48.pdf)

Looking at the results, they say that hardware tag-checking for integer arithmetic and register windows for fast method calls were the two most important features of the design, nearly doubling performance.

I wonder if that still holds today, with the memory wall so dominant that CPUs tend to be stalled quite a bit (therefore enough time to do tag checking in software).

<comment><USER12> Nowadays the thinking seems to be that register windows were a mistake (e.g. in SPARC), and newer designs such as RISC-V or Aarch64 don't do it.

</comment></comment></comment></comment></comment><comment><USER13> > _As the architects of the Motorola 68000 and iAPX-432 both learned, the > marketplace is rarely patient._

I hope this won't mean the Mill has no chance of success, or at least influencing the industry for the better. Every video seems to introduce interesting new ideas, or new takes on old ideas[0].

[https://millcomputing.com/](https://millcomputing.com/)

</comment><comment><USER14> I'd hardly call this a "Golden Age", precisely because of the shortcomings mentioned in the article. Regardless of how you may re-architect a processor you will still end up hitting CMOS limitations in time.

To contrast my _fantasy_ for "Golden Age" would be multiple viable replacements for CMOS that were actively being used in a variety of processors.

<comment><USER15> What specifically is "wrong" with CMOS? Not small enough for you yet? :)

<comment><USER16> Reaching "the end of Moore's Law" is a super big deal, and I still don't understand why people aren't worried about it more in general.

It will cause a crash in the entire tech industry, which will throw the global economy into a depression.

<comment><USER17> How will reaching the end of Moore's law cause a crash like this?

Do you mean that future requirements will outstrip capacity? I don't think this has been true for some time, we run a lot more systems and tend to scale horizontally; doubling compute power every n period isn't a hard requirement imo.

<comment><USER4> If we ever have an industrial revolution or massive productivity gains again it will most likely involve autonomous machines for things like farming, construction, delivery, transport, etc. All of these things depend on increases in power efficiency or performance. It is possible that we are one or two "doublings" away from achieving this in a mobile package and then suddenly moore's law stops.

For example Tesla is betting on conventional cameras and tries to overcome their shortcomings with computationally intensive machine vision. Tesla's custom chips allows them to have more processing power which means they can install more high resolution cameras and other sensors.

</comment></comment></comment></comment></comment><comment><USER18> Interesting article with a lot of great historical context. I think a significant part of the tl;dr is that the end of Dennard Scaling and trouble with Moore's law may mean that the best architecture will finally win out, rather than just the one with the best semiconductor design team behind it.

I'm a bit skeptical of the promise of DSAs, though it does seem we're already going that way. Curious what others think on that point.

<comment><USER14> I agree, my concern is where do DSAs go in a few generations? How many efficiency/performance gains can be had before hitting the same limits hampering general purpose processors today?

<comment><USER19> A DSA is only going to be an order of magnitude or two more performant than a general computer on any given process node. They'll certainly slow down at the same time general purpose CPUs slow down. The thing is it makes more sense to design and include them in a world where transistors are potentially getting cheaper without getting better because a finite amount of engineering effort will be stretched across a longer timeframe.

<comment><USER13> Does that also imply a potential _power savings_ of an order of magnitude or two? Because then it becomes a lot more obvious that the demand for them will be there in mobile phones and laptops at least.

<comment><USER19> Yes, it does. And that's a big part of the push for dedicated co-processors that we've seen in SoCs.

</comment></comment></comment></comment></comment><comment><USER20> Reading this, I had a flash of a question:

RISC makes a lot of sense given compilers and many other possible optimizations?

However, there are increasing trends to put functions right into silicon too. Those frequently replace many instructions.

Will ML tech somehow make better sense of those things, and CISC in general?

</comment><comment><USER21> >Using parallel loops running on many cores yields a factor of approximately 7.

That depends on the number of cores.

</comment><comment><USER22> It really is a fascinating time to be alive and aware.

The power of computing is redefining civilization, humanity.

</comment><comment><USER23> I am getting application error while opening the link. Anybody facing the same issue?

</comment><comment><USER24> Alot of what they suggest seem to be better solved in the domain of compilers and microcode translation on the fly.

<comment><USER9> – As announced by Intel on the launch of the new Itanium architecture.

<comment><USER25> oh snap

<comment><USER24> _Slow clap_</comment></comment></comment></comment>


TypeScript vs. Haxe - <AUTHOR> http://blog.onthewings.net/2015/08/05/typescript-vs-haxe/ <comment><USER3> _Of course, the ES6 block scoped let declaration is also supported by TypeScript. But it is kind of a pity that TypeScript has to maintain the old scoping strategy of var and goes to support let instead of "fixing" var declaration directly like Haxe…_

This quote fits the spirit of the article well, in missing the most important point about TypeScript: the driving principle of TypeScript is, and always has been, to resemble JavaScript as closely as possible. The point is to be a superset of JavaScript. How would you do that if you start changing the semantics of existing constructs?

It's just one quote, but the rest of the article carries the same smell. Telling omission: the comparison between the compiled versions of the presented code snippets. TypeScript code emission tries to resemble the original JS. How does Haxe hold up?

I do not doubt for a second that Haxe, as a language, is better than TypeScript. I don't know it, but it's not a hard task. Almost any language is better than TypeScript. The only one that isn't, in fact, is JavaScript.

Being a good language was never the point of TypeScript. Just being better than JS, while resembling it so much that nobody in their right mind could make a compelling argument against it, but in favor of JS.

EDIT: larsiusprime makes a good point, which I would have noticed had I actually read the conclusion instead of stopping half-way through: the author already addresses this.

<comment><AUTHOR> The article fully acknowledges this:

"However, at the core, TypeScript and Haxe have different design philosophies. TypeScript is a superset of JS. It means it cannot modify the existing JS syntax and semantics. It adds a static type system and some new constructs (e.g. "proper" class/interface). It is not interested in optimizing the program in any way. Haxe looks like JS, but is more similar to other popular compiled languages like Java/C# regarding to semantics, the use of types, code organization, and optimizations. It also brings in a lot of advanced functional programming concepts.

Which is the better compile-to-JS language? It depends. Existing JS developers will favor TypeScript as they are more similar in many ways. They can utilize their existing skills immediately."

EDIT:

As for how Haxe holds up on generated JS code, you can see for yourself online right here:

[http://try.haxe.org/](http://try.haxe.org/)

<comment><USER4> Playing around with that site, I think that the parent had a good point in bringing up what the output would look like. The output of Haxe is compiler output. Variables are renamed and in some cases elided. If Haxe wasn't working out for a team, they could not easily convert to javascript, as their generated code would be illegible.

Typescript on the other hand produces the ES5 that I would have written if I wasn't using Typescript. Variable names are kept, nothing is elided. You can even ask Typescript to translate code with type errors and it happily compiles.

</comment></comment></comment><comment><USER5> I love Haxe so much. I have been using it as a blazing-fast replacement for Gulp. I have < 10ms build times for large js libraries, where Gulp would take a second or 2. I like to do alt-tab F5 really fast after I save and thanks to Haxe I don't have to wait a second :).

I wrote a lot of features that I used to need in gulp (+ plugins) in Haxe, which is a great way of learning to use it, and a great way to find out how nice it is to have type safety.

Also, the language allows a simple JS / AS dev like me to build multithreaded apps that carry extremly heavy weights.

<comment><USER6> Could you share more information about writing gulp (+plugins) in Haxe?

I can't wait to learn it.

</comment></comment><comment><USER7> I wrote a tiny bit of Haxe some time ago as an attempt to learn the language: [https://github.com/piotrklibert/dirlist/blob/master/Main.hx](https://github.com/piotrklibert/dirlist/blob/master/Main.hx) \- it's a part of my larger series of blog posts, I just didn't write the one about Haxe yet (I have Nim and OCaml covered already).

As a language Haxe has some interesting features (although when compared with the other languages I chose (Nim, OCaml, Dylan, C++, Racket, Tcl...) they look fairly normal). There's an overview of Haxe features here: [http://haxe.org/documentation/introduction/language- features...](http://haxe.org/documentation/introduction/language- features.html)

Haxe is a really good language. It's dynamic, reflective language with static type system with local type inference. It supports GADTs and pattern matching, along with the usual exhaustiveness checks. It allows for adding methods to a class from outside (a `using` keyword). It has hygienic macros similar to those of Dylan, Elixir or Sweet.js. It's type system gives you control over variance of types, which is really nice (OCaml and Scala do this too).

I think Haxe is a pretty solid language which works well for general purpose apps (from command line utilities to games) and it excels at multi-platform development. This includes backend and frontend development in web dev - <USER2> Haxe you not only can share your code between platforms (browser and node), but you also have a choice of compile target, so you can compile the same set of functions to JavaScript or Flash on the frontend and to C++ or PHP on the backend. And you can easilly switch from one target to another, for example I used the default neko target in development (blazing fast compilation) and C++ target for running on the remote server.

</comment><comment><USER8> As a JS-y type dev, Typescript still looks better than Haxe to me. _But_ then when you go the Haxe web site and discover its compilation targets (JS, C++, C#, Java, Python) you see the real utility.

IMO Haxe is something very, very different to Typescript, and is a lot more powerful.

<comment><USER9> Seems like TypeScript is better suited for building web applications (backend and front-end) but HaXe has OpenFL that makes it amazing for games.

<comment><AUTHOR> OpenFL is just one of the many Haxe frameworks, to be sure.

For instance, Haxe is great for web applications too -- one of it's chief draws is that you can share the same code on the front end and the back end, but target whichever language is best for that. JS on the front, PHP/NodeJS/Neko/Etc/ on the back.

UFront is just one great example: [http://ufront.net/](http://ufront.net/)

As for other multimedia frameworks, here's my best attempt at an exhaustive list:

OpenFL - [http://www.openfl.org](http://www.openfl.org)

SnowKit - [http://snowkit.org/](http://snowkit.org/)

Kha - [http://tech.ktxsoftware.com/](http://tech.ktxsoftware.com/)

NME - [https://github.com/haxenme/nme](https://github.com/haxenme/nme)

Flambe - [http://getflambe.com/](http://getflambe.com/)

HEAPS - [https://github.com/ncannasse/heaps](https://github.com/ncannasse/heaps)

And things built on top of those:

HaxeFlixel - [http://haxeflixel.com/](http://haxeflixel.com/)

HaxePunk - [http://haxepunk.com/](http://haxepunk.com/)

Luxe Engine - [http://luxeengine.com/docs/](http://luxeengine.com/docs/)

Away3D - [https://github.com/away3d/away3d-core- openfl](https://github.com/away3d/away3d-core-openfl)

HaxeUI - [http://haxeui.org/](http://haxeui.org/)

KhaPunk - [https://bitbucket.org/stalei/khapunk](https://bitbucket.org/stalei/khapunk)

</comment></comment></comment><comment><USER10> The lack of comparison regarding the tooling is very unfortunate. A nicely designed language is always slick but that doesn't drastically alter how productive I can be with a language (at least within the range of difference between TS and Haxe).

The differences explored in the article are borderline 'religious' reasons.

Why Typescript? Simple: VSCode. One of the things that Microsoft does best is IDEs/editors and the Typescript experience in VSCode (and VIM and what-have- you) is no exception.

<comment><USER11> atom-typescript is awesome too

</comment></comment><comment><USER12> How has this escaped popular notice for so long?

EDIT: How has Haxe as a language escaped popular notice for so long?

<comment><USER13> At the risk of sounding like a JavaScript interviewer, define "this". The article was posted today, so I doubt that's what you're referring to.

EDIT: My guess would be that it was originally too focused in its use case as an ActionScript replacement for Flash. In current times, I would say that it has made the same mistake that everything other than TypeScript has: It tries to "fix" JavaScript / ECMAScript. That means learning yet another slightly- different thing, and also porting if it's not a new project. TypeScript has picked up a lot of momentum by taking the superset approach, allowing progressive enhancement of existing codebases. Just start throwing your JavaScript into the TypeScript compiler and you're done.

<comment><AUTHOR> Are you sure it isn't also the fact that it's historically had a tiny community of open source hackers and TypeScript has all the momentum of MS behind it?

<comment><USER13> I'm sure that also plays into it. Though DefinitelyTyped was started by someone who AFAIK is unaffiliated with MS, and I would say that is pretty critical to its success.

I should have specified that the above is the reason I would choose TypeScript over Haxe now. There's a lot of times when I will prototype a project in vanilla JavaScript, then set up the TypeScript build infrastructure and start enhancing.

</comment></comment></comment></comment><comment><USER14> I also wish more things in JS were expressions - having var statements as expressions in particular would help a lot with arrow functions.

Algebraic data types (and pattern matching) are definitely features that should be present in every language - the difference of modeling things without and with them is like night and day.

TypeScript's type system is indeed more forgiving, but mostly because the language is designed for migrating existing JS codebases to it. You can then tighten the grip significantly by adding `--noImplicitAny`. The most unfortunate TS unsoundness issue at the moment is that null/undefined are acceptable values for all types - I really wish they'd fix that...

What are the options for JS FFI in Haxe? Is there something less awkward to use (perhaps a more user friendly FFI library) than [http://old.haxe.org/doc/advanced/magic#javascript- magic](http://old.haxe.org/doc/advanced/magic#javascript-magic) ?

-

Side note: automatic semicolon insertion was not a huge mistake, and Douglas Crockford saying it was doesn't make it so. If you follow 2 simple rules, you wont need any semicolons:

1) Dont put a new line between `return`/`throw`, and the returned/thrown expression (newlines inside the expression are fine)

2) Prepend `;` to a line starting with `(`

Crockford had a minifier bug related to #2 and solved someone else's problem with #1 then declared a rule to always use semicolons (which doesn't even help with #1)

<comment><USER15> Here's the rules you need to follow if you use semicolons:

1) Use a semicolon.

2) There is no rule 2.

EDIT: This may seem flippant but the point is that humans make mistakes and the more rules you have to obey, the more mistakes they will make. Especially beginners.

ASI (automatic semicolon insertion) and double-equals (weak comparison vs triple-equals strict comparison) aren't bad because they don't work, they are bad because they allow for unnecessary mistakes in return for a minimal reduction of characters you need to type.

Despite all the rationalizations, the primary reason some programmers prefer to rely on ASI is purely aesthetics. That's okay, but there's no point in trying to construct artificial arguments to defend that preference.

If a future version of the language somehow manages to eliminate the need for those rules, I'll be the last person to tell you to stick to your semicolons. Until then, it's still a voluntary handicap.

<comment><USER14> Even if you use semicolons, you still need the extra rule about return/throw statements. Otherwise the following will surprise you:

      return
      {
        property: value
      };

(Whats the value returned? Its `undefined`)

Therefore, "Use a semicolon" is insufficient. Or rather, its about as sufficient as "Don't start a line with (".

Which means that the rule(s) for using semicolons are no more complex than the rules for not using them.

This is precisely why "follow these simple rules" is not enough. I believe that us programmers would really benefit if we stopped following and perpetuating best practices without understanding (and explaining) the reasons behind them very throughly.

If you want less cognitive overload, use a language with less warts, or a language with a type system. Lint-like rules that don't come with a reason are useless and result in a false sense of security

</comment></comment></comment><comment><USER16> The article does a good job of comparing the two. Here's an example TodoMVC in Haxe for a better understanding of what front-end development looks like: [https://github.com/explorigin/todomvc- haxe](https://github.com/explorigin/todomvc-haxe)

(full-disclosure...my project)

</comment><comment><AUTHOR> We killed the server!

Mirror here: [https://github.com/andyli/blog/blob/master/content/posts/201...](https://github.com/andyli/blog/blob/master/content/posts/2015/2015-08-05_typescript- vs-haxe.md)

EDIT: Looks like it's back up.

</comment><comment><USER17> Haxe doesn't have decorators doesn't it? Wonder if it's on their roadmap...

<comment><USER18> Do you mean python decorator? It can be emulated with "metadata" and "macros" in Haxe.

metadata: [http://haxe.org/manual/lf-metadata.html](http://haxe.org/manual/lf- metadata.html)

macros: [http://haxe.org/manual/macro.html](http://haxe.org/manual/macro.html)

</comment></comment><comment><USER19> The article shortchanged Haxe a little by omitting mention of its vast, varied, and flexible runtime library.

</comment><comment><USER20> I've had my eye on Haxe for a long time, and the language has a lot of features that I like - it's cross-paradigm: primarily OO, but good support for functional programming; plus, macros are amazing and can extend the language to do whatever you want.

The project that made me see its potential was "Haxe-WavPack-Decoder", an audio decoder for the WavPack file format. It targets Neko, C++, C#, Java and Javascript. Imagine using Haxe to write reference implementations for file formats (or anything, really), then spitting out implementations for any other target language, so you could include it in a project using any runtime of your choosing.

The problems I see are:

* The language itself is not a high-level wrapper for each platform/target, so you still need to write different code for each platform. (OpenFL/Lime does a great job at handling this for you for games)

* The compiled output might have surprising runtime characteristics. For example, I tried writing an audio rendering app where I targeted C++, and had a naive two-dimensional array (a Vector of Vectors of Floats). When I tried retrieving an inner array, it would attempt to cast the array and its entire contents. This happened _every time_ the array was accessed, and it was accessed multiple times per second. When I flattened the arrays to a single array and used a calculated index, it reduced the processing time from ~30mins to ~5mins.

* You can't necessarily make use of each target language's strengths. For example, I think the Java target does not support annotations.

* If you want to make use of platform libs/tech, you'll need to define externs for each lib. (There's some efforts to use a TypeScript->Haxe converter to convert all of the DefinitelyTyped definitions to externs, so the JS target is looking promising.)

* It seems like a lot of developers come from a Flash/ActionScript background, so there's lots of ports of AS libs with documentation that just says "See the AS lib documentation". This is not helpful for general developers.

* Due to having so many use-cases, it's very hard to share knowledge for "Haxe" \- are you looking for info on Haxe for games on desktop, or Haxe for games on HTML5, or Haxe for webapps on PHP, or Haxe for webapps on NodeJS...? This is a tribute to its versatility, but it means the developer mindshare gets splintered into separate tribes.

* Due to targeting other languages, you kind of have to be an expert in that language/platform already, which means you need to translate from the target language to Haxe in your head.

* Since macros can extend the language to do anything else, libraries will splinter based on capabilities and implementations of those capabilities. Some libraries might use an "Optional" macro, some might use "Maybe", and they'll do roughly the same thing but be incompatible.

* I believe libraries written in Haxe can only be distributed as source code, limiting commercial investment in developing libs. (Although, JS also has this problem but doesn't seem to suffered.)

* Still has nulls. :( It does make some efforts to make developers treat nullable values differently, but it seems inconsistent (and probably dependent on target).</comment>


OpenEdge – Extend cloud computing, data and service to edge devices - <AUTHOR> https://github.com/baidu/openedge <comment><USER2> Serious question: can someone describe to me or point me to a blog post about what 'edge' computing can do? I am having a hard time understanding what the difference is between it and 'normal' cloud infra where end-clients call to a central cloud service. In other words, what is the architectural difference between Snapchat, where many end devices have a thick-client connection to a central service, and 'edge' computing?

<comment><USER3> You request static assets from a CDN and your request hits a "lambda" function on the edge. It inspects your user agent and decides to send you mobile- optimized assets.

It's largely about latencies. Doing certain request(and response!) processing closer to the client, along with potential data locality benefits, you can get responses back faster and more efficiently.

</comment></comment><comment><USER4> I was about to implement 'Edge Servers' for my MMO game system. However, in that context, those have commonly been other cloud instances running somewhere like AWS, which act as an intermediary to the client. My own 'Edge Servers' would maintain Websocket and WebRTC connections, and perhaps authoritatively implement a 'Player State' state machine. They would have a security function somewhat like a firewall ro reduce attack surface, though they wouldn't replace a firewall, but rather work in conjunction with one and behind one.

The OpenEdge seems to be more of a traditional 'Edge' server for static assets, but combined with a lambda. I wonder if this concept could be extended for something like my 'Edge Servers' which require more stateful operation? Can stateful cloud assets be given more advantageous network placement, like other 'Edge' servers?

</comment><comment><USER5> Hopefully it drowns out google results for OpenEdge ABL, formerly known as Progress. Awful 4GL programming language/database (don't ask me how I know).

<comment><USER6> I hope not, Google is the only reliable way to find what I'm looking for in their docs

<comment> yjftsjthsd-h Can you just use `site:` or whatever to narrow it down, if you're explicitly using Google to search a known target site (e.g. official docs)?

</comment></comment></comment><comment><USER7> This is a joke. Go to Balena.io and never look back. Really well thought edge platform. And yes it's OSS too.</comment>


How to Redesign - <AUTHOR> http://www.attackofdesign.com/how-to-redesign/

<comment><USER2> I ran into a problem not dissimilar to this when doing freelance programming on a hacked together VBA project for score tabulation. I would recommend a redesign in at least VB.net (as he wrote some custom VB libraries that he was hesitant to rewrite).

In the end, even after I showed a spreadsheet of my billable hours spent fixing ten year old bugs, he'd rather have me work a hundred hours on a familiar task then risk losing the interface, and userbase he accumulated over the years.

But hey, in the end, he was the one writing the checks, right?</comment>


UPDATE: $140K #ePlug DE-Centralized Crowdfund Launch Feb 17th #meshnet #Bitcoin - <AUTHOR> https://twitter.com/kenCode_de/status/565186437281099776 <comment><AUTHOR> The Blockchain Operating System (BOS) and crypto-income has been expanded a bit this week too. Details will be listed on the crowdfunding page on the 17th.</comment>


Young & Stupid: How I Made 2.5 Million - <AUTHOR> http://www.andrewfashion.com/2009/12/05/how-i-made-2-5-million/

<comment><USER2> This is by far the dumbest thing I've ever seen here.

I don't think I believe any of this, other than that he wants to make money off of the internet because everyone wants to make money off of the internet. For one, he claims to be writing a book, despite having an apparent 5th grade reading level. I hope he spent about $100k of that $2.5 million on a ghost writer before he lost it. Also I'd bet he's telling the truth about being a high school dropout.

For another, he claims to be running bemodel.com, but that site does nothing but display stock photos.

I also find it hard to believe that anyone who would point out "The Secret" (and not the book version either, but the movie based on it) as their inspiration could ever scale a website to enough traffic to make $100k+/mo. I'm skeptical he could even spell PHP let alone use it.

I have to say, it's VERY tempting for me to buy his ebook about making women chase me. That has to be a non-stop laugh riot.

<comment><USER3> My experience with "The Secret" involves attending a New Year's Party with my brother several years ago where we stayed up all night playing drums with a group of people. When the morning came, and we all got up to go home one guy said to us "I have this movie that you have to watch" and proceeded to lift up his shirt and remove from his pants a DVD.

We realized that he had to have been keeping this in his pants all night, and as my brother and I made our way to the car I told him "you realize that we have to see what that is the moment we get home".

Upon arrival back at my brother's apartment, we proceeded to watch the movie, and were mystified that someone had tried to compile an hour and half video around the idea of "positive thinking"; much less that someone had thought enough of it to carry it around in their pants to impart to strangers at a party.

<comment><USER4> Don't underestimate the ability the promise of simple answers to life's problems has over people desperate for said answers. I know people who buy the Law of Attraction nonsense hook line and sinker. Of course, these people also believe in that personal sovereignty nonsense, and that every country in the world except Switzerland is run by the Rothschild family, who are also apparently multi-trillionaires...

<comment><USER3> I once got into an argument with someone about whether The Law of Attraction abided by the Law of Conservation of Mass; because if it did, than it didn't seem any different than stealing.

<comment><USER4> It's just hokey nonsense. All you have to do is nod your head and pretend you don't think they're totally bonkers.

</comment></comment></comment></comment></comment><comment><USER5> There is so much I could write, but this sounds exactly like many lottery winner stories. The 30k blown in Vegas part, especially.

My personal philosophy is that you've got to get yourself correctly life- balanced. Adding money just amplifies your current habits. So if you're working 24x7 with no life balance, adding a lot of money will just amplify that out-of-control nature.

What's sad to me is that there was nobody in this guys life who could act as a mentor and provide advice.

<comment><USER6> 35k of 2mil is 1.75%. Not an unreasonable amount to throw away on entertainment. Money is not an end itself. At some point you gotta spend it or why bother getting it in the first place.

All the expensive cars are much more of an issue. Fun is fun, "status" is a total waste.

<comment><USER7> Spending 1.75% of your income on entertainment is fine -- in fact, it's pretty miserly.

Spending 1.75% of your total net wealth on entertainment, in one go, though, is dumb. Maybe it was multiple trips, but still, Las Vegas is a very easy, and very unsatisfying, way to spend large sums of cash. The only worse item on the list is $20K in strip clubs.

 _All the expensive cars are much more of an issue. Fun is fun, "status" is a total waste._

Cars aren't fun? Maybe you don't enjoy driving, but I sure as hell do. If I had a $2.5 million windfall I'd be buying some fancy cars too.

</comment></comment></comment><comment><USER8> Google Cache:

[http://webcache.googleusercontent.com/search?q=cache:6D9e6fs...](http://webcache.googleusercontent.com/search?q=cache:6D9e6fs0_rMJ:www.andrewfashion.com/2009/12/05/how- i-made-2-5-million/+http://www.andrewfashion.com/2009/12/05/how-i- made-2-5-million/&hl=en&client=firefox-a&gl=us&strip=1)

</comment><comment><AUTHOR> In his mixergy interview, Andrew Fashion shared his story in great detail about his rise and fall. With respect to the 301 redirect, I asked Andrew to ask him if he 301'd old urls to new ones. Andrew Fashion's response was that he didn't know at the time about 301 redirects and that after he launched his new site he deleted his local copy of the old site. When his traffic plummeted he couldn't go back.

<comment><USER9> I'm not sure whether to respond to that with "How stupid can you be?" or "I find that very difficult to believe."

</comment></comment><comment><USER10> I cringe every time he writes "could of" instead of "could have".

<comment><USER3> I cringed about twice every sentence; his writing style is terrible.

Which isn't to say the message isn't useful to people (although I nearly spit out my soda upon seeing him go on about The Secret).

It sounds like he has a good sense for churning out websites which are useful to people though, so kudos to him (and hopefully he can pull another one out and actually hold onto the money this time).

<comment><USER11> Yeah the writing was terrible, no doubt about that. I definitely feel there was a great lesson there in his simplicity of execution - he saw people using myspace sites so he built one. The massively introspective and precious process of coming up with "ideas" that I can't help be a little obsessed with seems ridiculous compared with just seeing and doing.

<comment><USER3> While that's true, he seems to reiterate over and over that his aim from the beginning was just to "make money"; which while I have nothing against (I'm certainly not a socialist), I think is detrimental to actually creating something worthwhile.

Reading the post reminds me of a lot of kids I grew up with who were basically hustlers; they just wanted to be rich and would try anything they could think of (usually some combination of managing musicians, selling drugs, or stealing cars) to attain it.

In retrospect, I don't think any of them ended up being rich.

This kid did though, so what do I know.

<comment><USER11> Well myspace profile tools whilst not exactly a long lasting boons to society were pretty useful to people. It's not content scraping or otherwise just gaming the system. I won't post what the article makes this guy sound like to me, seems unfair after I've said I found it informative :)

<comment><USER3> I feel like I got a good impression from the picture he posted (which had the added bonus of letting me know that I charge more for a portrait shoot than Michael Vincent...which is odd because he's a much better photographer than I am)

;)

<comment><USER11> Can imagine how much you'd want to charge to do a portrait of that guy? You'd have to use an exponential representation just to write it efficiently.

</comment></comment></comment></comment></comment></comment></comment><comment><USER12> The author met the prerequisite for getting lucky, which is several tens of thousands of hours of failure and iteration. Sure, if he were more mature, or wrote more coherently than a fifth grader, or had any kind of formal training whatsoever, MAYBE he could've done better, kept his site going, created DuckDuckGo, etc.

But those things are all secondary. He, unlike 99% of anyone who attempts anything, put in those 10K, 20K, 30K hours, and through those countless iterations made his own luck.

</comment><comment><USER13> I read this guy's story a year ago, and thought it was interesting. He worked really really hard at something, without any particular skill or talent, and made a bunch of money!

A year ago, he was launching a social network for models: [http://www.andrewfashion.com/2010/08/16/whats-been-going- on-...](http://www.andrewfashion.com/2010/08/16/whats-been-going-on-bemodel- and-more/)

Now he's leveraging his antics to get in with the HN crowd. He doesn't write great, he doesn't have any real insight to things, and yet he's on the front page of HN and will probably make some $ out of all of this. He'll probably land 2 or 3 more articles, establish himself in the community, and then launch bemodel with a HN/Reddit post that will get lots of free traffic.

I dunno? On some levels I think he's a twit, and on other levels he seems like a savant

So what's the moral?

<comment><USER14> Don't read too much into it?

</comment></comment><comment><USER15> As PG might say, the primary killer of start-ups is the start-ups themselves, not any other competing force.

</comment><comment><USER16> His story proves that anyone can be successful on the internet. And that it's better to be lucky than good.

<comment><USER6> Anyone who is ADHD, clinically obsessive, and does nothing but chase success.

<comment><USER17> And is good at fudging details.

Make $100,000/month = Make $100/month.

Buying a $420,000 house = Live in mom's house

Buy a brand new BMW = Buy a 1982 Volvo.

Write a post saying how you made tons of money and blew it = Please buy my book - this Volvo isn't getting any newer

<comment><USER18> It looks legit. Here's the mixergy interview with the guy <http://mixergy.com/andrew-fashion/>

and here is the second post with screen caps of his earnings with his publisher id in the top right corner (for google) [http://www.andrewfashion.com/2009/12/04/young-stupid-how- i-l...](http://www.andrewfashion.com/2009/12/04/young-stupid-how-i-lost-my- millions/)

</comment></comment></comment></comment><comment><USER19> This is amazing. A good friend of mine was the dot com 1.0 version of this guy. He even had the same BMWs! It's eerie how similar the stories are...

</comment><comment><USER20> There is a Mixergy interview with this guy: <http://mixergy.com/andrew- fashion/>

</comment><comment><USER21> He makes a huge deal about how he killed MySpaceSupport.com by rewiring the URLs, etc and how this eliminated all his revenue, permanently, so that he sold it off in 2008. I'm sure it was a major factor, but I think the changes in the economy, the popularity and demographics of MySpace, and the rise of more popular social networks may have also mattered.

<comment><USER5> It's not clear whether he just made the basic mistake of not 301 redirecting the old Urls, or was it that he did but still lost places anyway? Perhaps there is more too it than just a new set of Urls (in terms of search engine rankings)

</comment></comment><comment><USER4> If I had 2.5 million spare extra dollars, I would probably use it to live the way I live now, without having to work ever again.

<comment><USER7> Are you currently unemployed?

If not, what would you do with the extra hours every day?

To me, $2.5 million sounds like a pretty good start towards a comfortable retirement, but I'd want to supplement it with another couple of million before I really declared myself ready to never work again.

<comment><USER4> I am unemployed yes -- I live very cheaply and spend my time maybe 1/3 hanging out with friends, 1/3 hanging out by myself (aka video games/reading this web site), and 1/3 working on whichever personal project I'm interested in for the time being.

I actually did the calculations yesterday and figured out that on my current budget, even adding in an extra 50% to cover random things I might need or want, I would only need 1.4 million dollars to live this way until I'm 100 years old...

</comment></comment></comment><comment><USER22> I couldn't manage to get past the second or third "him and me". When I got to the "dropped out of high school" part, it all made sense.</comment>


Offer HN: I will work for free in SF/NYC/Remote this coming week - <AUTHOR>

I'm rebuilding my life and trying to shake things up by working with new people and products. I'm available next week, monday thru friday to work on whatever projects you need help with.<p>- I'm not a developer, I'm a marketing product manager.<p>- Have 7+ years experience marketing b2b, b2c, some b2d<p>- Touched pretty much everything in marketing land. Some have called me a growth hacker or full stack marketer. I've odne strategy, product launches, content marketing, sem, seo, newsletters, marketing audits, ad networks, optimization, analytics, a/b testing, growth, communications, pr, branding, voice/tone, etc).<p>- Pm for both web and mobile applications<p>- Want to work with product lovers and interesting people<p>- No catch 22's.  Just me working hard on your project as I transition to my next thing<p>Please email me some quick details about your project and what you need help with. If I can help out, I will =) <comment><USER2> Sent you a note too, check out the email from Sydney. :)

</comment><comment><USER3> Have sent you a note :)</comment>


Long term web application solution? - <AUTHOR>

It's been a few years but I'm looking to get back into the game and work on a web application. The trouble I'm having is that I need to make it semi-scalable (naturally, as a start-up I don't want to focus on this too greatly) but am also looking for something CHEAP.
It would seem like a cloud solution like Azure, Google App Engine or something else would be optimal but I've also heard it can cost much higher than something traditional.
Nowadays, where should one invest the time and energy when working on a new web application? <comment><USER2> just create the app first and scale later. but if you have to, make sure to abstract your db layer so that reads/writes are separate. and placing CDN and implementing caching will help scaling your app a long way.

<comment><AUTHOR> This is what I plan on doing for the most part; I just want to make sure whatever framework / storage solution I go with can at least scale somewhat should I experience anykind of success.

I'm not looking for nor expecting to create a web application as popular as, say, reddit or anything even a quarter of that; just to make a decision as to the direction to go and then worry about further optimization later.

</comment></comment><comment><USER3> I would suggest Google App Engine. There are plenty of ways to optimize the costs and you can do it after (if) your traffic increases.</comment>


The USAF has built and flown a full-scale prototype of its future fighter jet - <AUTHOR> https://www.defensenews.com/breaking-news/2020/09/15/the-us-air-force-has-built-and-flown-a-mysterious-full-scale-prototype-of-its-future-fighter-jet/ <comment><USER2> It better not have a human in the cockpit, or else it would be more useful to set taxpayer money on fire instead.</comment>