A survey of attacks against Intel x86 over last 10 years (2015) [pdf] - <AUTHOR> https://blog.invisiblethings.org/papers/2015/x86_harmful.pdf <comment><USER2> Words are not enough to express my deep and profound disgust of all those morons abusing "... considered harmful". It's somewhat ok, if it was brought up years ago and counts as legacy. But for any new abuse all I find are the words of Honeybunny [https://genius.com/Tim-roth-pumpkin-and-honey-bunny- annotate...](https://genius.com/Tim-roth-pumpkin-and-honey-bunny-annotated)

</comment><comment><USER3> x86 has had a good run. But it's time for it to go.

I'm hopeful for RISC-V.

<comment><USER4> I'm putting my bets on Mill winning the race eventually.

Not only Mill, Microsoft has been working on a VLIW too (yes I know, not exactly VLIW, it's close enough).

IMO these ISA's are the future, compilers and programming languages are nowadays smart enough to be able to figure out how to handle VLIW compilation (plus having learned from Itanium's failures).

<comment><USER5> No they really cannot. Many of the optimizations CPU do on the fly are akin to JIT recompilers. (in microcode and schedule side) These cannot be effectively done ahead of time yet, at least not without an instruction accurate profiling.

Not to mention VLIW wastes CPU instruction cache for instructions that aren't ran.

It is no accident that CPUs and compilers gravitated towards RISC.

<comment><USER4> Well, no, point of VLIW is that instead of doing it like a JIT recompiler you do it like a slow recompiler. This is almost always possible and can be done ahead of time. Proof: The CPU itself does it under time constraint, a compiler should be capable of the same minus time constraint.

VLIW also doesn't really waste instruction cache if your compiler is being smart and aligns branches to an instruction word, though you still blow the pipeline on a branch if you miss but atleast in Microsofts case they include a way for the compiler to include a prediction which it is arguably in a better position to make. This goes double if you use profiling-guided optimization. If the claims of the Mill guys are true then even the "wasted CPU instruction cache" doesn't hurt performance.

CPUs and compilers are gravitating towards lots of things. x86 and ARM aren't the only instruction set. VLIW is healthy and very alive on a lot of DSPs. There are Russian CPUs that use VLIWs in active use. AMD GPUs used VLIW for a while (and some variants still do). You can even get VLIW-based Microcontrollers for cheap.

IMO compilers and CPUs may gravitate towards RISC in the shortterm as it is more similar to CISC in terms of complexity. VLIW needs compilers to be smart and languages to be smart too for optimal use. Rust for example would be capable of really taking advantage of VLIW but LLVM doesn't support that complexity (yet, though there is some work).

In the long term, so my prediction, VLIW will dominate by nature of being simpler, faster and more efficient.

<comment><USER6> Your proof is flawed. The CPU has access to the complete current program state, and also complete knowledge of its own hardware. A static compiler has neither. Therefore, it's not at all clear that a compiler can do whatever the CPU can do.

Example: the best order to run a sequence of instructions could depend on which inputs happen to be in the L1 cache at the time. This could differ from one execution to the next. There's no way for a static compiler to get this right.

<comment><USER4> You don't need access to the full current program state, most of OOE can be done with simple graph coloring and the knowledge of the number of registers. A static compiler will know the number of registers available as well as several other hardware intrinsic features (after all it has to use them).

On a VLIW a lot more features would be necessarily exposed and the compiler will have to take advantage of them.

Your example can be optimized by a compiler trivially by optimizing for cache- locality, something compilers already do. It simply means that if you access memory address X and your code accesses this code elsewhere, the compiler will try to keep those two closer together.

Making a simple prediction about cache contents is trivial for compilers and as mentioned, already happens. You can use graphs to build up dependencies on memory and then reduce the distance between connected node points in the execution path. Since this is VLIW and we might be able to tell the CPU which branch is likely we can even not do this in favor of optimizing the happy path better.

A modern optimizer is a very complex beast, it can certainly know some things about the state of the program during runtime and it will make some assumptions about it (enable -O3 if you want to test). Most certainly it is able to optimize your example in atleast a minimal fashion on more aggressive settings.

The CPU pipeline to my knowledge does not optimize by L1 cache as checking contents of the L1 cache is still rather expensive and the lookahead in the command queue is usually limited to a few hundred instructions. Hitting L1 is still a magnitude slower than hitting a register and very expensive to do for every memory access instruction. The pipeline tends to favor using branch predictors and register dependencies, which is simpler and faster, as well as some historical data about previous code run.

</comment></comment></comment></comment></comment></comment><comment><USER7> Previous discussion from 3 years ago: [https://news.ycombinator.com/item?id=10458318](https://news.ycombinator.com/item?id=10458318) (169 comments)

</comment><comment><USER8> An oldie, but a goodie.

So much quality software out there that is either open source, or written in a VM language, or both that it boggles the mind as to why we are still munching on this particular shit sandwich.

But what do I know?

</comment><comment><USER9> Be courteous and add a (2015) to the title.

</comment><comment><USER10> [PDF] (2015) - Probably better without the URL hash.

Still relevant..

</comment><comment><USER11> ...if I have to endure one more abuse of the "considered harmful" idiom, I'm going to puke.

<comment><USER12> Puking is considered harmful.</comment></comment>


The other joshkerr's are out of luck (recycling usernames) - <AUTHOR> http://joshkerr.com/4197/the-other-joshkerrs-are-out-of-luck

<comment><AUTHOR> Funny thing is that I tried to register "joshkerr" as my username on Hacker News but it was already registered. I've been successful on most other networks, but there is someone on this one that beat me to it. Figures, hackers and all.</comment>


Blackberry to give $10,000 incentive to build apps(with conditions) - <AUTHOR> http://crackberry.com/certified-quality-apps-coming-blackberry-app-world-along-10000-incentive-build-them

<comment><USER2> Screw this, just make it easy to setup up your damn SDK. I tried twice, once earlier this year when it was supposed to be easy, and no luck.

I got Android dev working and Xcode (which was too easy!). I have done J2ME dev in the old days. Come on RIM< get your act together.

<comment><USER3> I had similar difficulty with their SDK in early 2010, back when BB was still a force in the market. Nothing makes developing more fun then you're entire IDE crashing, closing, and deleting all non-saved data. Getting it setup wasn't too bad (it still had some quirks), keeping it running was a bloody hassle.

</comment></comment><comment><USER4> They say the app has to generate at least $1000 on its own which means this is meaningless for free apps.

<comment><USER5> So publish an app for $100 and pay 10 friends to buy it? You'd still profit $9,000.

<comment><USER6> Who knows 10 people who have a Blackberry?

If I was in school, out of work or otherwise had a lot of free time on my hands I might take a stab at it. It would be low risk. There probably isn't much competition out there so it would be easy to get noticed if you're quick to market. Maybe you could scrape together $1000 in sales. I can't help but think it will lead to quick and dirty, low quality apps and sloppy ports, if anything at all.

For anyone who has to make a more difficult choice about how to spend their time I can't see how this platform is even remotely appealing. The handsets are crap. The OS is old and busted. You can't even depend on consistent input methods between handsets. There's absolutely no buzz around anything RIM does these days. The only time I ever see them mentioned in the news it's another story about layoffs, how far they've fallen or both.

WP7 looks much more appealing than this. There are some slick looking phones, a mostly nice looking OS and I've actually seen them out in the wild. Still, even WP7 is a distant third place behind iOS and Android.

RIM would be irresponsible not to try this. They have to at least show a willingness to try to stay in business. They desperately need developers and they still have some cash. I can't think of a better way to entice developers. Unfortunately, this is too little too late. The time for this was back when Blackberry App World was first released.

<comment><USER5> _"Who knows 10 people who have a Blackberry?"_

Touche.

<comment><USER6> At first, my intent was to be snarky, but it's really the truth. I can't remember the last time I saw someone using a Blackberry. My last friend with one got rid of hers months ago. She was the only person I knew with one for quite a while. I had one several years ago and loved it, but they haven't improved much since then and everyone else has.

</comment></comment></comment></comment></comment><comment><USER7> I was recently working in an agency on a blackberry promotional project and while i was a good 8-9 degrees of abstraction away from RIM (which in itself created problems) it was quite clear they're WAY behind other phone companies and are frantically trying to claw back some ground but finding it hard because certain "partners" are now refusing to get involved with Blackberry projects.

I really think Blackberry's days are numbered no matter how much money they throw at the problem.

<comment><USER8> > it was quite clear they're WAY behind other phone companies

Could you expand on that? I don't know much about RIM, would be interesting to learn why are they taking to so long to catch up.

<comment> excuse-me When they were the darling of corporate email they weren't interested in having outside developers.

Then when the iPhone came out they made a half-hearted effort to attract devs but there was no app store and to sign up you had to jump through the sort of hoops that a supplier of space shuttle avionics to Nasa would expect.

Then just when they had the sign up and an app store working they made an announcement something like - "it's all going to change with our wonderful new OS but we can't say at the moment how you will program it or if your old apps will be compatible" - at which point most devs looked at their market share and compared it with the number of customers on iPhone and Android and uninstalled the SDK.

</comment></comment></comment><comment><USER8> Also note that blackberry is offering tools to easily repackage Android apps to their new OS. [1] Together with the $10k combo, this is a very interesting proposal that me and my co-founder are seriously considering and studying it.

Has anyone here used the android to blackberry tools and could share your experience with it?

[1] <https://bdsc.webapps.blackberry.com/android/>

<comment><USER9> I have attempted to port my app ([https://play.google.com/store/apps/details?id=com.sjwindsurf...](https://play.google.com/store/apps/details?id=com.sjwindsurf.android.windfreakfree)) using eclipse back when the Playbook had just come out, RIM were offering a Playbook to anyone who submitted an application to App World. I was very busy at the time, but attempted to port my app across (WindFreak), as it was supposed to be quick and painless. It basically didn't work at all.

It would get to the loading stage in the virtual Playbook, and crash every time, no real way of debugging it (not that I could find). It might have been due to the complexity of my app, and at the time there was no list of compatible functionality. I gave up after wasting 1 day on this. It might be easier to accomplish now.

</comment></comment><comment><USER10> I've only heard terrible things from other people about BlackBerry dev. Specifically, that there were numerous issues porting. Does anyone have any experience to the contrary? What is the BlackBerry user base like at this point anyway?

<comment><USER11> I ported my SDL/C++ DJ app DJPad from HP TouchPad to Android, and then to PlayBook. It took less than a week to do the port and on the first day of sales, it outsold 2 months of Android sales in a single day and continues to outsell Android by about 2 to 1.

Without any press it did about $300+/day for the first 3-4 days, then drifted down to about $30/day where it is still selling at that rate a month and a half later.

I also got a free PlayBook out of the deal as it was during a "write a new app for BlackBerry and we ship you a free PlayBook" offer.

</comment></comment><comment><USER12> Seems more like just a nice bonus for people who were already planning to release a moderately successful commercial app for Blackberry. And RIM doesn't care about people creating free or ad-supported apps?

<comment><USER8> I don't think it's a matter of they not caring. But how would they support it without giving room for fraud? Their certificate only goes so far, the $1k limit just sounds like an easy way to make sure that the app is indeed reasonably good and has a real market. If they tried to support free apps, it would be much harder for them to make sure.

<comment><USER12> By making the threshold $1000 or 1000 downloads (or 5000 downloads, whatever)?

Really, they should be reaching out to developers who already have successful apps on other platforms and convincing them to port. But maybe that's happening also behind the scenes.

</comment></comment></comment><comment><USER13> The new cascades sdk is awesome, and is available for mac, win and linux !

<comment><USER14> What's the workflow like?

2 years ago I abandoned BlackBerry because of the soul crushing edit/test cycle.

Testing code changes required pushing the new code up to the BB JVM, which required rebooting the emulator.

It ... took ... forever ...

<comment><USER13> yea, i know. it is completely new, not related to BB java. QT like development and c++. The simulator is a vmware image like playbook dev.

</comment></comment></comment><comment><USER15> It's desperate but it's also the right move. If I were them I'd give devs 100% or revenue from apps too. Anything to get market share at this point.</comment>


Self driving cars, Ford probably in panic mode - <AUTHOR> http://www.cnbc.com/2017/05/23/ford-panicking-self-driving-cars-because-alphabet-google-is-way-ahead.html <comment><USER2> While their argument probably still stands it seems they should have mentioned Ford's recent investment of $1 billion USD over 5 yrs in the self-driving car startup Argo [1]. I haven't been able to really dig up any details on how far along Argo is though.

[1] [https://media.ford.com/content/fordmedia/fna/us/en/news/2017...](https://media.ford.com/content/fordmedia/fna/us/en/news/2017/02/10/ford- invests-in-argo-ai-new-artificial-intelligence-company.html)

</comment><comment><USER3> BMW: 638 miles driven, 638 miles/disengagement

That's weird.

<comment><AUTHOR> Good catch. There must be some typo. Doesn't this mean there's a zero error rate. Seems practically impossible, at least with the current tech.

<comment><USER4> Or a single error in 638 miles.

Elsewhere in the article "disengagement" is defined as "a human driver has to take over", seemingly excluding natural stops.

> But what's even more significant is how much farther Waymo cars can go > before a human driver has to take over. For Waymo, one of these so-called > disengagements happened, on average, every 5,127 miles.

</comment></comment></comment><comment><USER5> The data they are basing these arguments on seems rather suspect. Wouldn't Ford be doing the bulk of it's testing in Michigan?

Surely the data Tesla is collecting from it's production cars on the road also counts for something too.

<comment><USER6> And actually Ford is investing in Argo in Pittsburgh, which is a very new self-driving car startup.</comment></comment>


The Shallows: What the Internet is Doing to Our Brains - <AUTHOR> http://jseliger.com/2010/06/28/the-shallows-what-the-internet-is-doing-to-our-brains-nicholar-carr/ <comment><USER2> The problem seems to be a little different than stated.

I like this quote from Jorge Luis Borges:

 _"Writing long books is a laborious and impoverishing act of foolishness: expanding in five hundred pages an idea that could be perfectly explained in a few minutes. A better procedure is to pretend that those books already exist and to offer a summary, a commentary."_

Perhaps one of the consequences of this shallowness is that we become more concise in our communication. This isn't necessarily a bad thing. In fact today many books today have a pretty simple premise and waste hundreds of pages giving examples just to fill out the premise.

The truth probably is that most of the world have always been shallow in their understanding of any subject, it's just more obvious today.

But what many people perhaps lack in depth they will gain in diverse knowledge which itself is a kind of depth.

Quite a few breakthroughs have been made by connecting two seemingly unrelated areas to create new meaning.

To me it seems like an evolutionary necessity.

That doesn't mean that we don't need experts or that there wont be any, just that expertise will manifest itself differently.

</comment><comment><USER3>
      >  (I've now distracted you and you're probably less
      > likely to finish this post than you would be otherwise;
      > if I offered you $20 for repeating the penultimate
      > sentence in the comments section, I'd probably get no
      > takers)

Tripping over the word penultimate, brought me to an interesting train of thought. Distraction is not necessarily a bad thing when we are reading.

One of the reasons that we are told to read a lot is to increase our vocabulary. But how is that supposed to happen? We're supposed to come across a word that we don't know in a book, and then look it up in the dictionary. Isn't this the ultimate form of distraction? Unless you read next to a dictionary, you have to put your book/newspaper/magazine down, go find your dictionary, look up the word, and reapply that new knowledge to the content again.

Not only that, when we read content, aren't we supposed to be inspired by it (at least sometimes)? I was inspired by this small revelation to drop reading the essay/blog post and come back to HN to post this comment. The article triggered a small epiphany in me that inspired me to create/share information. Isn't this a good thing?

<comment><USER4> I've never heard it said that we read merely to increase our vocabulary. That may be a happy side effect, but it's certainly not a fundamental justification.

I think most people read 1) to educate themselves and 2) for pleasure.

On learning new words: my wife and I keep a set of flash cards on which we write words we don't know. We don't always look up the definition immediately, but eventually we do and write it down and then we review the words later until we can remember it's definition.

<comment><AUTHOR> _I think most people read 1) to educate themselves and 2) for pleasure._ This describes me, although I probably read for 2) more than 1). Some people also read to appear intelligent, or so they have unusual things to lord over others, which might be a component of 1).

 _We don't always look up the definition immediately, but eventually we do and write it down and then we review the words later until we can remember it's definition._

Wow: that's far more discipline than I have. If I find a word I don't know, I usually look it up and write it in the margins of the book (if it belongs to me). It took about six repetitions of looking up the word "candid" when I was a teenager for it to sink in.

One nice thing about looking things up is that eventually the words stick and you no longer have to look up very many, unless they're technical.

</comment></comment></comment><comment><USER5> I largely agree with the author and I don't buy into the idea that online reading is destroying our attention span, rewiring our neurons or will kill the long form. What's changed is the ability of poor writers to fill the channel. We now have more of a challenge to sift through the junk but good writers and good editors will always be in demand and will find a way to be read.

We need to put a stop to the drivel about the death of this or that form of culture or art - if it can't rise through the spam it doesn't deserve to survive.</comment>


Walkmod – an open source tool to apply code conventions - <AUTHOR> http://www.walkmod.com

<comment><USER2> free & open source tool. Give it a try!</comment>


Uh Oh, Internet: Basic Mobile Video Will be YouTube-Only With MetroPCS Plans - <AUTHOR> http://www.readwriteweb.com/archives/uh_oh_internet_basic_mobile_video_will_be_youtube-.php <comment><USER2> Blocking sites because they're "not on the service plan" is likely to be much more acceptable in western countries than explicit censorship, as in Iran or China. It's authoritarianism dressed up as commercialism. In the post- Wikileaks era my bet is that governments will either encourage, or at least not do anything to hinder, the erection of walled gardens which make it more difficult for the average internet user to get access to unauthorised sources of content. The next decade could see a return to the Compuserve-like internet services which existed in the 1990s.

<comment><USER3> Oh come on, do you _really_ think that governments are so shook up over WikiLeaks that they might encourage ISPs to turn the internet into a series of walled gardens? For that matter, do you really think that they're that evil? Obviously they're not happy about WikiLeaks, and I'm not saying that governments or ISPs are perfect, but some perspective is badly needed here.

What you've written screams hyperbole and is veering dangerously into conspiracy theory territory. Net neutrality is a real issue, but it's got nothing to do with WikiLeaks. Governments aren't as dastardly or hell-bent on destroying your freedoms as you (and many others on HN) seem to think. It's actually quite disconcerting that so many on HN think this way -- hackers (in the good sense) could have a lot of influence on the future of democratic nations, but this kind of anti-government slant has the ability to really hurt our credibility and keep us on the sidelines.

<comment><USER4> Despite your sneers, the governments of the World, and especially the U.S. government, have shown a strong bias towards information control, and walled gardens are controllable. The Internet as a whole is not. Wikileaks is merely a small example of governmental distaste for informational freedom/transparency.

<comment><USER5> If you seriously think the US government is doing than most "governments of the World" to control information, you need to be better informed.

</comment></comment></comment></comment><comment><USER6> This is actually huge news as it marks the beginning of what many of us feared and destroys future entrpeneurship. I have no idea why the FCC decided mobile Internet should allow these practices.

<comment><USER7> There is competition in mobile internet, whereas for non-mobile many people only have one or two realistic choices. That could be why mobile gets less regulation.

<comment><USER8> Sprint usb type mobile broadband plan: $59.99/mo for 5 gigs on 2 year contract.

Verizon usb type mobile broadband plan: $50/mo for 5 gigs on 2 year contract

AT&T usb type mobile broadband plan: $60/mo for 5 gigs on 2 year contract

T-mobile usb type mobile broadband plan: $39.99 for 5 gigs no contract

So yeah, it seems rather unlikely that any cartel like cooperation on tiering would evolve in this market.

(EDIT: Updates, thanks for the pointers. I was cribbing from a dodgy web page it seems <http://mobile-broadband-services-review.toptenreviews.com/> )

<comment><USER7> That's misleading in a couple ways.

First, you have omitted other providers whose prices are not similar to those above. Clear, for example.

Second, competition is about more than just price. It is also about features and restrictions. The provider that this thread is about is offering a lower priced plan WITHOUT a contract, but with restrictions on what you can do with it.

(EDIT: continuing, as I thought of another significant factor)

Another problem is that you are looking at mobile USB internet access plans, rather than mobile phone access plans. Most users don't have a strong opinion (or any opinion at all) on which particular dongle is hanging off their laptop. Hence, given several mobile USB internet providers offering similar level of service (e.g., 5 GB/month) and similar terms and conditions (2 year contract), the _expected_ result in a competitive market is for them to all charge about the same price.

Of course, in a non-competitive market dominated by a cartel, the expected result is ALSO for them to all charge the same price.

Net (no pun intended) result: your examples provide no evidence one way or the other on the question of competitiveness in mobile internet.

<comment><USER8> I wasn't trying to provide a comprehensive mobile services price comparison, I simply chose a service I knew to have comparable terms across the 4 national carriers that own their own towers. MetroPCS and Clear both provide significantly different services being online only in certain metros.

I had skipped handset service because when fully loaded they have service tiers that make it difficult to do direct comparisons, probably intentionally. However:

AT&T unlimited voice: $69.99/mo

Verizon unlimited voice: $69.99/mo

T-mobile unlimited voice: $59.99/mo

Sprint 900 minutes (max): $59.99/mo

and:

AT&T ala carte SMS: $0.20 per

Verizon ala carte SMS: $0.20 per

T-mobile ala carte SMS: $0.20 per

Sprint ala carte SMS: $0.20 per

Considering the radically different cost basis of the two programs it's hard to believe there isn't some de-facto price coordination going on.

</comment></comment></comment></comment></comment><comment><USER9> I really wouldn't mind this at all if it weren't being sold as _Internet_ access.

Mobile YouTube? Fine. Mobile Facebook? Great. If it's a walled garden, call it that and discount it accordingly. But once you have "Internet" and _"more Internet,"_ something's gone terribly wrong.

<comment><USER10> Indeed, at some point filtering and traffic shaping crosses over into false advertising if the output doesn't go by some other name than "internet service". It would be like paring down a luxury car until it is little different from a golf cart, and trying to sell it as a Lexus.

</comment></comment><comment><USER11> I'm more stunned by the price: I pay 20€ for unlimited and unrestricted data access with a double SIM (one mobile broadband, other for phone). _And_ they want to charge more for other video access?

<comment><USER12> Mobile data seems very expensive in the US compared to Europe, but the States seem to be cheaper in most other areas: e.g. Petrol/Gasoline - $3 per gallon in the States, over $8 per gallon in the UK now.

<comment> Tuna-Fish Most of Europe taxes gasoline very heavily to encourage alternatives and discourage use.

Here in Finland, roughly 75% of the price of gas at the pump is tax. Or in other words, we have a 300% gas tax.

</comment></comment></comment><comment><USER13> We're going to be the crotchety old men and women calling carrier tech support in just a few decades:

 _"Back in my day, you didn't need some big corporation's_ permission _to look at pictures of naked folks on the internet…"_

</comment><comment><USER14> And so it begins. The only way this won't run rampant is an immediate consumer backlash.

<comment><USER15> They already solved that problem. Backlash-ing costs you $250.

<comment><USER16> Is that the cost of an early termination fee?

<comment><USER17> No. It's $350 for an "advanced device". So, backlash costs a great deal more than you think.

</comment></comment></comment></comment><comment><USER18> Remember the leaked slides for differently priced mobile services that leaked out a few weeks ago? [http://blog.grouptexting.com/wp- content/uploads/2010/12/dip....](http://blog.grouptexting.com/wp- content/uploads/2010/12/dip.jpg)

That seemed like a worst case scenario that we might expect down the road...not within days of the FCC giving mobile broadband a pass on net neutrality. Hopefully this move backfires and forces the FCC to revisit their ruling ([http://gigaom.com/2010/12/28/who-wins-and-loses-under-the- fc...](http://gigaom.com/2010/12/28/who-wins-and-loses-under-the-fccs-net- neutrality-rules/))

</comment><comment><USER17> Mobile broadband is becoming mainstream. Congress & FCC really screwed this up at the worst possible time for consumers.

</comment><comment><USER19> Well that really sucks.

I wonder how they'll be implementing it, and how plausible it will be for other video sites to make themselves unblockable.

<comment><USER20> > I wonder how they'll be implementing it, and how plausible it will be for > other video sites to make themselves unblockable.

Yes, I'd like some information on this as well. Will it be possible to circumvent their block using encryption? The article says only the videos themselves will be blocked, not the websites.

<comment><USER21> It will almost certainly be possible for technical folks like us to bypass their filters but that will still exclude about 99% of their customers. That 99% will probably grudgingly pay the few dollars more and complain about phone companies screwing them again.

<comment><USER20> If they complain loud enough, it might be possible to get them to reverse their stance. From my POV, the problem is that only technical people are complaining, and no one else cares.

I'm guessing that people will respond the same way most people in China do to censorship - with relative apathy. They have better things to do than worry about whether the internet is censored or not.

</comment></comment></comment></comment><comment><USER22> This needs to be stopped. Wireless will increasingly become consumers primary Internet connection. If this becomes standard practice for wireless providers, freedom to access what content the user chooses will be effectively destroyed.

</comment><comment><USER23> Has anyone actually located where MetroPCS makes sets these rules? I have not been able to find them in the TOS

<comment><USER24> here: [http://www.metropcs.com/presscenter/newsreleasedetails.aspx?...](http://www.metropcs.com/presscenter/newsreleasedetails.aspx?id=1) "The $40 service plan offers unlimited talk, text, 4G Web browsing with unlimited YouTube access."

<comment><USER25> How does that limit video to Youtube only? You sure this isn't just a marketing phrase? Is there concrete proof that other video players will not work?

</comment></comment></comment><comment><USER26> It seems to me that lowering phone prices[0] -- making subsidies, and thus long-term contracts, uninteresting to consumers -- and LTE compatibility across networks will create a more competitive market, lowering prices and forcing these tactics out the door.

Obviously, the carriers will do everything in their power to prevent the commoditization of their networks but am I crazy in thinking that's at least a path we are inevitably moving on?

[0] [http://www.avc.com/a_vc/2010/12/the-smartphone- explosion.htm...](http://www.avc.com/a_vc/2010/12/the-smartphone- explosion.html)

<comment><USER27> _lowering phone prices making subsidies uninteresting to consumers_

I doubt it; irrational consumers will still choose "free with contract" instead of $100.

 _LTE compatibility across networks_

I doubt this too due to frequency incompatibility.

<comment><USER28> > _I doubt [LTE compatibility] too due to frequency incompatibility._

Are you sure? AT&T and Verizon both have frequencies in the 700 MHz range; I'm sure they don't have the exact same frequencies, but I'd bet that the same hardware can support them. At least, it's more likely than having one phone that can support, say, 1700 and 1900 MHz.

Last I heard, the lurking problem with LTE compatibility was that nobody had agreed on how to do _voice_ over LTE. We might wind up with a situation where you can roam from AT&T to Verizon (it's all IP), but you can't take an AT&T phone and activate it for Verizon.

</comment></comment></comment><comment><USER29> If Google would like to make a big stance for Net Neutrality, they could block connections from them. But I think that would be a big issue by itself.

</comment><comment><USER30> They have Android smartphones... I'm very much wondering how this service will ever be able to work between the plentiful applications, including third- browsers (plus Flash support on 2.2). I imagine that the power user, at least, will have no trouble getting around it; the block won't be total either way.

<comment><USER31> OS has nothing to do with what ISP can block. The only thing someone maybe able to do is run all their connections through a proxy or private vpn.

<comment><USER30> It said the site would load but the video would not in the original article, which was part of where I was coming from. Plus, features like Opera Turbo inside of Opera Mobile, for instance, would make such proxies transparent to the user.

</comment></comment></comment><comment><USER32> How is this scary new development? The budget option of proprietary bundled services has always existed, with the upsell being the unfettered internet. Youtube and facebook are not "the internet", but proprietary services that have been developed upon it. Surprise surprise, network providers used to bundling services look for a lowest common denominator for their base product line. That these services happen to deliver over IP is of little consequence.

However, don't think that I'm advocating for walled gardens - the important part is to keep innovating and creating a wide demand for _The Internet_ at large so that carriers are unable to presume that most customers only want bundled discrete services in the first place (thereby pushing competition on generic bandwidth. bittorrent+RC4 has done wonders for wired net neutrality).

</comment><comment><USER33> hmm, I'd better find those America Online CDs....

</comment><comment><USER34> Facebook Fee: $.95

Youtube Surcharge: $1.53

blogging package: $.25

Roaming charge (non approved sites): $5.21

Wikileaks download penalty: $10.00

Destroying net neutrality, killing what made the Internet great in the first place: priceless.

<comment><USER35> Potential cost to the establishment of forcing all the hackers onto darknets: who knows?

<comment><USER36> The ssh and vpn charges will predictably be outrageous and seriously curtail the popularity of darknets. Similarly with any alternatives that are centralized by service or protocol. It'd be an awfully tall technological order to create a distributed Tor-style traffic relay to the darknets.

Or are you suggesting pirate wireless carriers?

That said, if such a too-difficult-to-effectively-filter Tor-style relay came into being, that certainly would be a Big Deal.

<comment><USER35> <http://www.i2p2.de/>

If they start banning the protocol from routers, we can tunnel it through other protocols. You can push anything you want through an HTTPS link. Good luck banning that protocol.

Or we can do the wireless-mesh thing. There are a lot of people working on mesh-based peer to peer routing layers and DNS. Wish I could remember what the projects were called...

<comment><USER36> I've always liked the idea of wireless mesh networks. [1] But it would limit exposure to ideas, code and data by physical distances. Even expanding out Bacon-style along the social graph as people move about, it would be a huge step back for unfiltered communication. [2]

[1] It's a rather romanticized attachment, that originally hinged on people one-day realizing that having all your data primarily on other people's computers probably isn't a great idea.

[2] Though that, too, triggers appealingly romanticized notions of 'place', 'dialect' and 'local culture'. Which is to say: it would all make for great cyberpunk fiction atmosphere; I'm just pretty sure it'd still suck compared to the current state of affairs.

<comment><USER35> _> physical distances_

I imagine we can just bounce VHF off the sky or something. People solve harder problems every day.

Also, never underestimate the bandwidth of a hard disk in the mail :)</comment></comment></comment></comment></comment></comment>


Show HN: I built this website in 10 hours - <AUTHOR> http://localfoodtrivia.appgrounds.com/

<comment><USER2> Add "Show HN" to the title. Looks like this _is_ a "Show HN", so you might as well make your submission stand out on [https://news.ycombinator.com/newest](https://news.ycombinator.com/newest).

Edit: I like the idea. A couple suggestions for improvements:

— Add a document title. Display the city and the restaurant in the title.

— Show some sort of a notification when a city isn't found (otherwise people might think your application is broken when Yelp doesn't support their city).

</comment><comment><USER3>
      #mainblock { text-shadow: 1px 1px 3px #000; }

Before and after: [https://mediacru.sh/1a4491899f11](https://mediacru.sh/1a4491899f11)

</comment><comment><USER4> The page is basically unreadable because of the white text on the light image, but I actually stopped cold when I saw an "i.e." where an "e.g." should have been. If you can't get that right then I have to assume you don't care about details (code, design, output...) or you just don't know any better.

</comment><comment><USER5> > Show HN: I built this website in 10 hours

... and it shows. What an overwhelmingly sloppy, poorly executed site. I took the first few questions of a quiz about Chicago; rather than having me "explore" the city's culinary offerings, it just blasted me with a bunch of questions I couldn't possibly answer about a restaurant I've never heard of before. A number of the questions were unanswerable (all of the questions had duplicate answers), and all of its knowledge about local restaurants is obviously pulled sloppily from Yelp's API (it offered such scintillating questions as "which Yelp review corresponds to this restaurant you've never heard of?" and "which picture, pulled from Yelp, is of a dish served at this restaurant you've never heard of?").

The idea is neat but this website is awful.

<comment><USER6> The above comment is really harsh, discouraging, and rude. But I agree with most of it.

I don't think you should brag about how little time you spent on anything. Nor should it be used as an excuse for a half-baked product.

There is a nugget of a good idea in there somewhere. I think it might be worth another 10 hours to really find the goodness here and then spend the time to build something people will actually love.

</comment></comment><comment><USER7> sweet site dude but pleaz o pleaz change the background, i can't see the white text on the light gray back ground.

</comment><comment><USER8> the design is meh,but I can definitely forgive that. how did you get the data in that amoount of time?</comment>


World's first 'invisible' tower - <AUTHOR> http://edition.cnn.com/2013/09/12/travel/seoul-invisible-skyscraper-tower-infinity/index.html?eref=edition <comment><USER2> Looks cool, lets just hope they don't allow planes and helicopters in Seoul</comment>


Clocking a 6502 simulator to 15GHz - <AUTHOR> https://scarybeastsecurity.blogspot.com/2020/04/clocking-6502-to-15ghz.html <comment><USER2> I was told by Leonard Tramiel (who was my manager at Atari for a while) that the world record for a production 6502 was 25Mhz. This was demonstrated one Friday evening, some time after the beer fridge had been opened in one of the labs.

I don't know if they applied any kind of external cooling, or what the benchmark was. Probably it was "keep cranking up the clock until pins stop wiggling or smoke comes out." Not very scientific, but quite entertaining.

<comment><USER3> "until pins stop wiggling"?

<comment><USER4> The pins don't physically wiggle. "pins wiggling" is a common metaphor for "the voltage level on a pin is changing".

As a signal driver is toggled at increasing frequencies ('cranking up the clock'), the signal amplitude (voltage difference between the 'high' and 'low' period) starts to drop. At a high enough frequency, the signal will be indistinguishable from noise and 'stops wiggling'.

<comment><USER5> > At a high enough frequency, the signal will be indistinguishable from noise > and 'stops wiggling'.

It's not that the signal will be indistinguishable from noise, but that the CPU will stop working correctly, so its outputs will stop toggling (or will toggle in unexpected ways).

</comment></comment></comment></comment><comment><USER6> It's an interesting article, but...

Better title: Clocking a 6502 Simulator to 15 GHz. There are multiple efforts to recreate the physical 6502 CPU on modern hardware, this is not one of them and should not be confused with that.

<comment><USER7> I was a bit confused and expected to see some elaborate liquid cooling nonsense to get the poor chip up to 15 GHz.

</comment></comment><comment><USER8> I realize I'm late to the party, but I've really been enjoying Ben Eater's series on building a simple computer with a 6502.

[https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXN...](https://www.youtube.com/playlist?list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH)

<comment><USER9> Yes, it's awesome.

</comment></comment><comment><USER10> After stumbling on Ben Eaters "Hello world from scratch" [1] I went out and bought the cpu some parts and breadboards. The chip is only a few dollars. It is highly recommended if you want to dive down into computers and digital logic on first principles. Also great fun to get a break from all the screens and layers upon layers of software that I have to deal with daily.

1\. [https://youtu.be/LnzuMJLZRdU](https://youtu.be/LnzuMJLZRdU)

<comment><USER11> Kind of plugging my own project here, but I too am a software developer that found great joy from breaking away from all the layers of abstraction and working directly with the hardware. I created a portable game system with the 6502:

[http://www.dodolabs.io/](http://www.dodolabs.io/)

<comment><USER10> This is awesome!

</comment></comment></comment><comment><USER12> For more "very fast simple CPU" architecture, see _50,000,000,000 Instructions Per Second: Design and Implementation of a 256-Core BrainFuck Computer_ : [https://people.csail.mit.edu/wjun/papers/sigtbd16.pdf](https://people.csail.mit.edu/wjun/papers/sigtbd16.pdf)

</comment><comment><USER13> Huh... I hadn't considered it before, but Bender's brain _could_ actually be a 6502, just being run at an insanely high clock speed. A few petahertz should be able to handle the AI involved, no?

Planck time is like 10^-43 seconds, so there's lots of room to divvy up a second for more processing power given advanced technologies...

<comment><USER14> If the hardware is advanced enough to do that, the AI software is similarly advanced, and a basic 6502 can produce a Bender like AI without breaking a sweat!

<comment><USER15> More advanced software would with all likelihood require significant calculations, rendering a basic 6502 useless.

<comment><USER13> Yeah... Maybe we'd need to bump up the clock to exahertz to make up for the loss of precision and constant memory access. The top super computer is already at 148 petaflops, so we'd need some more headroom for general AI.

Of course, petaherz (10^15 cycles per second) is _already_ the speed at which an electron circles around a hydrogen atom, so we may not be able to use electricity any more...

</comment></comment></comment></comment><comment><USER16> It would be interesting to compare this project to simply converting 6502 assembly into LLVM IR, and letting clangs optimization passes work their magic.

Obviously self modifying code would be hard to handle, but every other case ought to work, and the auto-vectorization ought to do amazing things to some loop-heavy code.

<comment><USER17> a 6502 backend for LLVM has been attempted a couple times[1][2], but the fact that the 6502 only has three registers imposes severe limitations w.r.t. LLVM's calling conventions.

[1] [https://github.com/c64scene-ar/llvm-6502](https://github.com/c64scene- ar/llvm-6502)

[2] [https://github.com/beholdnec/llvm-m6502](https://github.com/beholdnec/llvm-m6502)

<comment><USER18> Other way around - the idea is to create an LLVM _frontend_ for 6502 machine code, and then transpile that code to run on a modern CPU architecture.

<comment><USER19> That sounds like an interesting project!

You would probably want to add some tricks directly there, maybe register renaming (I don't know if LLVM does "variable renaming", let's put it this way)

</comment></comment></comment></comment><comment><USER20> GeOS would have been much more responsive...

</comment><comment><USER21> To solve the FF page wrapping problem, I wonder if it would work to double-map each 6502 page to x64 host pages side by side. I assume the word read at FF would straddle the two mapped pages effectively reading the second byte at 00. You'd have to map to host page boundaries of course and probably offset all reads/writes to the end of the host page at $3F00.

</comment><comment><USER22> I believe VMware without hardware support for virtualisation also falls back to "binary translation" and similarly gets tripped by SMC - I don't recall the details right now but one of the ways to detect it was to modify an instruction in an obscure way that the developers had forgotten about.

</comment><comment><USER23> I want to see a 6502-alike clocked to 15GHz with an exotic semiconductor such as GaAs, InP, SiGe, etc.

<comment><USER24> Probably wouldn't be able to see it with current fabrication technologies and historic transistor counts.

<comment><USER23> Exotic materials, other than maybe SiGe use fabrication techniques less advanced than Si, and the transistor counts are much less.

The department of defense funded an SBIR grant in the late 1990s to produce an InP based microprocessor, given the limits of the time it would have been closer to a 6502 than a Pentium. There has not been word of such a thing since which leads me to conclude that the topic is classified.

The worst limitation a 6502-era chip has is that it has no instruction cache so instruction reads are fighting with data for memory bandwidth. You might even consider a Harvard architecture where the instructions go on a different bus. Without an I-Cache there is no point in pipelining, but there is a lot of pressure to implement CISCy instructions such as the string copy operation from the 8086 line.

The other issue is that there is no DRAM replacement with exotic materials, and all the difficulties with interconnect latency get a lot worse than they already are. It's more clear how to make SRAM, so having somewhere between 64K to 1Mbytes of SRAM on die seems likely for an exotic material CPU.

Of course, armchair CPU designers are more likely to make progress with transition triggered architectures and FPGAs in 2020.

</comment></comment></comment><comment><USER25> The Mega65 runs a 6502 at 50Mhz compatible with the Commodore 65 plus C64 mode. [http://mega65.org](http://mega65.org)

</comment><comment><USER26> Now someone needs to write an x86 emulator in 6502 asm and boot windows.

</comment><comment><USER27> I'm not 100% sure where the 15 GHz equivalent speed calculation comes from.

<comment><USER6> The author showed it at the end of the article. It's the "effective speed" reported by some benchmark programs (including calling subroutines, running for loops, iterating on a string, etc). These are simple and trivial programs and can be highly optimized in a simulator on modern x86_64. Real-world programs, like games, is slower, as acknowledged in the article.

<comment><AUTHOR> A lot of BBC BASIC programs, doing real work (e.g. Mandelbrot drawing etc.), should have a shot at 10GHz. Games are slower because they are hammering hardware registers external to the JIT (sound, graphics, keyboard polling, timing, etc.)

My laptop is an ancient 5th gen i5 with 2 keys having fallen off, so games are down in the 2GHz - 3GHz range for me. (Perhaps the missing keys make all the difference.)

<comment><USER28> I understand that some people look suspiciously at the 15GHz mark, specially considering this was run in a 4.5GHz processor. What I understand is that this benchmarks are comparing how long it would've taken on a stock 1Mhz 6502, and calculate the "clock speed" obtained as a ratio. So if I'm getting my result 10,000 times faster than a standard 6502, it means I'm at 10GHz.

I also understand that this is possible because the emulator is running on a superscalar processor. Not sure if multicore has anything to do here (the post specifically mentions the high performance of the single-core case for the processor used). Still, considering that processors back in the 6502 era had just one execution port, and superscalars this day have a lot (I think 8? I really lost track of what's usual these days), then the figure makes sense all right, and without involving any kind of multithreading.

Kudos to the authors of the emulator for having a super-optimized system that can effectively and efficiently emulate its target!

<comment><AUTHOR> I like the framing here, that of seeing this as a showcase of modern superscalar improvements. And yes, it's about single core performance only.

What is particularly interesting to me is how thoroughly superscalar "wins". Because of complexities with 6502 -> x64 mapping, and handling self-modifying code in particular, some of the most common 6502 instructions explode to multiple x64 instructions. Despite that huge extra instruction load, the translation still manages to run at much greater speed than a 1:1 instruction ratio.

Modern processors do not run on electrons. They run on unicorn tears and magic.

<comment><USER29> Note that there is also a speedup from dynamic optimization.

</comment></comment></comment></comment></comment></comment><comment><USER30> X86 ... not x64

<comment><USER31> The architecture never had a good name. AMD originally called it "x86-64" (but not AFAIK "AMD64", even though lots of other people did), but "x86_64" is most common in the open source world (I guess because the underscore makes it legal as a C symbol). "x64" is what Sun and Microsoft decided to use. Intel has called it "ia32e", "EM64T" and "Intel 64" at various times.

I think this article gets a pass.</comment></comment>


JsonLogic – Build complex rules, serialize them as JSON - <AUTHOR> http://jsonlogic.com/operations.html <comment><USER3> Adding computation to a data description language is always a bad idea. I've seen this done with XML. XSLT is a great example of why this sucks. This has been done with JSON before anyway. Here are several examples:

[https://github.com/json-schema/json- schema/wiki/switch-(v5-p...](https://github.com/json-schema/json- schema/wiki/switch-\(v5-proposal\)) [http://www.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/jso...](http://www.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/json/src/tpc/db2z_jsonlogicaloperators.html) [https://www.npmjs.com/package/lib-jsl](https://www.npmjs.com/package/lib-jsl) [http://jsonnet.org/language/design.html](http://jsonnet.org/language/design.html)

<comment> keithb- Okay, first of all, the current fascination with JSON is not fundamentally different from the previous fascination with XML. The only thing that anyone can agree on is that JSON is easy to parse just like its predecessor. This is why XSLT came into existence: firstly, it was easy to parse, secondly, ..., thirdly, profit (i.e. reuse, generalization, performance, etc. etc. etc.).

On the other hand, this language is bananas because the programmer is writing the AST and that is what a parser is supposed to do for him/her. Manually coding the AST is like harvesting an acre of corn by hand. If you can find a more inefficient method, then by all means use it.

And just for good measure, XML is not a "data description language", it is a type system; probably the most complex type system I've ever seen and it wasn't a bad idea, it was simply more complex than any application would ever need.

I don't dislike XML, and I think it will continue to live just like Haskell because every generation will come to understand that its extreme faith in generalization has little practical use just about the same time that a new generation first discovers it. So while one is dying to simplify, the other is dying to espouse the existential core of computer science.

<comment><USER4> > XML is not a "data description language", it is a type system

XML means "eXtensible Markup Language" \- so pretty much exactly a description of the data it contains. Granted, you can mark up a bit of data with a type, but you can mark it up with anything else as well.

I've even seen entire programming languages built upon XML.

<comment><USER5> I actually don't think that would be all bad if you in addition paired some parsers and serializers for other formats in your standard library.

That could actually be a really fun language: "you can write this in Haskell- syntax, Python-syntax, or C-syntax, we don't care, just make sure that you enclose it in the corresponding

        <parse-as lang="c">
        // ...
        </parse-as>

and then `myprogram.c.x` will get compiled to `myprogram.x` which is a standard XML file, which you can then edit with `x-to-py myprogram.x >myprogram.py.x && vim myprogram.py.x` and have a field day of it."

Sort of like the PL equivalent of Lennon's _Imagine_.

<comment><USER4> It was moderately more complicated that this, as it represented the actual program tree structure within XML. Imagine lisp with XML tags in place of parentheses.

</comment></comment></comment></comment></comment><comment><USER6> For some reason this reminds me of [http://thedailywtf.com/articles/the-inner- json-effect](http://thedailywtf.com/articles/the-inner-json-effect)

</comment><comment><USER7> I see a lot of folks who are a lot smarter than me crapping on this, but I think it could be really useful. I've thought about the problem before of how to share complex rules between front-end and back-end safely, and came up with a UI for it:

[https://dabernathy89.github.io/vue-query- builder/](https://dabernathy89.github.io/vue-query-builder/)

I honestly didn't put too much thought into the actual structure of the JSON, so I wonder if there is someway I can now integrate JsonLogic into the query builder.

Good work!

<comment><USER8> I would suggest that, at first glance, your structure is actually preferable for most applications where this would be useful. The real advantage of a DSL is when it provides a concise way to solve a specific problem domain. The OP just provides a verbose way to describe a general problem domain, without any benefit of regularization.

Your schema, on the other hand, uses explicit node names and types, which should make automated analysis much simpler and less error-prone. The few changes I'd suggest are mostly just cosmetic: standardizing the schema (the type radio seems to imply the operator equals), renaming properties (why selectedOperator when just operator will do?), and maybe compressing levels where appropriate, for instance the query-builder-group could itself have the logicalOperator property.

<comment><USER7> that makes sense - and thanks for the feedback!

</comment></comment></comment><comment><USER9> So, a JSON AST. The whole point of programming languages is to give you something better than an AST to work with. Code is already data and we have functions for evaluating/compiling/interpreting said data natively/in-vms/in- interpreters.

</comment><comment><USER10> Reminds me of the early 00s where everyone and their son were making unmaintainable DSLs in XML

<comment><USER11> People still make them. Because, you know, "everyone can use them" and they are "simple". In reality, only software developers are able to do anything with such a crap DSL and it takes a lot more effort and workarounds to get anything done vs a sane programming language.

<comment><USER12> Even if only the developers can use a DSL, that doesn't not mean DSLs don't have a place as a solution and that a generic programming language is always preferable.

In complex enough domains DSLs can be key to tackle that complexity and they can take many forms.

</comment></comment></comment><comment><USER13> Two thoughts on this:

(1) We have a similar sort of "expression language" at my job; in our case, the value it provides is ready access to the pseudo-AST we parse it into. We transform that AST at runtime (along with subexpression results) into a human- friendly error message like "Total Amount must be less than $X when Blah Mumble is under Y". The downside is that that "configuration" data now behaves more like code but doesn't have any of the tooling of the host language: we've had to add specific code to provide a stacktrace-equivalent hint about where expression evaluation failed.

(2) The bummer design decision in JsonLogic, IMO, is the leakage of the JS equality operator into what _could_ have been a language-agnostic description. That's going to be nasty to implement elsewhere.

</comment><comment><USER14> There are use cases for rule-based logic like this stored outside of application code and JSON is a very easy format regardless of warts.

The amount of salt in here from 1) Gross JSON! 2) why did you implement an AST?! is astounding.

</comment><comment><USER15> Is there a security statement about this? I don't immediately see any dangerous operations, but code sharing should always be suspect. If this catches on, it won't be long before someone asks for something that would open vulnerabilities.

All that being said, this is a really interesting approach and having a language for shared, declarative logic is often useful.

<comment><USER16> If you're building an extensible platform of some kind, maybe, but otherwise I'd use a build system.

</comment></comment><comment><USER17> Jelly, anyone? [https://en.wikipedia.org/wiki/Apache_Jelly](https://en.wikipedia.org/wiki/Apache_Jelly)

<comment><USER18> Lisp anyone?

</comment></comment><comment><USER19> Looking over the examples, I thought of MongoDB's aggregation pipeline. You pass in a similar tree of JSON-only logic to perform more complex database operations/transformations. In Mongo's case, the idea is to have direct access to "native" calls, skipping Javascript execution altogether.

</comment><comment><USER20> These mini-languages almost always become really painful to work with. If I find myself needing to implement some sort of configurable shared thing more complex than a table of regular expressions I just jump straight to the endgame and embed lua or a lisp.

I think the target audience of JsonLogic is sharing code on the frontend/backend. I think these days javascript is common for that. A tiny lisp would be suitable as well.

There's a special place in hell reserved for people who make me edit ad-hoc turing complete configuration languages embedded in json or xml.

</comment><comment><USER21> I believe that eventually software development may move in general to structured serializations rather than plain text. The main thing holding that back is just that programming is defined by cryptic colored text and they are afraid they won't look technical enough if they don't stick to that. I am a programmer myself btw and of course I use text editors.

<comment><USER22> Source code _is_ a structured serialization. And it also happens to be plain text.

Edit: or were you referring to data rather than logic?

<comment><USER23> If data can be code, code can be data too. There are people who hated react for mixing view with logic.

<comment><USER24> Possibly another example of the common mistake of web developers - <USER2> "don't put _business_ logic in views" to "don't put _logic_ in views". That leads to invention of the silly things called "template languages", which desperately try (and fail) to avoid being programming languages, and they create a mess because they manually glue HTML (which is a _tree_ ) from dumb strings.

</comment></comment></comment></comment><comment><USER25> Pretty cool. Coincidentally I just spent the last couple days implementing configurable JSON-serialized rules in our app. The bigger part of the challenge for us was coming up with a human-friendly UI for defining the rules.

<comment><USER26> Been considering the same problem here - how to allow some sort of user- defined rules/ logic flow? The UI is indeed more difficult to (well) do than the data representation of said rules. Anything you can share?

<comment><USER27> It's funny this discussion comes up now, since I've been working on this exact same problem for an odd week on and off now. Building the syntax, interpreter, serializer/deserializer took a day. Writing the JS to render it? Still working on it. (largely hindered by my being a backend eng masquerading as a terribly incompetent frontend web dev)

My approach however was to treat it as a literal syntax tree. we can represent trees reasonably well graphically, and if you connect the blocks sensibly you can make the visualization even flow well enough. Things start to decay past certain levels of depth; and I've addressed that with modularity. A tree can be "named" and become a single node within another tree. (yes yes rewriting programming languages badly or something).

Thus far the biggest problems I've had with this approach have been primarily just learning the words I need to use to search for the right concepts in web- UX space; I've actually been pretty damn happy with the view.

Tech wise, just a grid, jquery, bootstrap.

</comment></comment></comment><comment><USER28> When you're building a serverless framework with the goal of direct client access to managed infrastructure without writing server side code, rules languages like this are an awesome tool to have. You need to: authenticate users, authorize their actions, validate schema, ensure referential integrity, and perform business logic checks.

Most (if not all) BaaS platforms have something like this:

\- Firebase: Database Rules ([https://firebase.google.com/docs/database/security/](https://firebase.google.com/docs/database/security/)), Storage Rules ([https://firebase.google.com/docs/storage/security/](https://firebase.google.com/docs/storage/security/))

\- Parse: Roles and ACLs ([https://parseplatform.github.io//docs/js/guide/#roles](https://parseplatform.github.io//docs/js/guide/#roles))

\- Horizon: [http://horizon.io/docs/permissions/](http://horizon.io/docs/permissions/)

\- Couchbase Mobile: [http://developer.couchbase.com/documentation/mobile/1.3/deve...](http://developer.couchbase.com/documentation/mobile/1.3/develop/guides/sync- gateway/authorizing-users/index.html)

\- Deepstream: [https://deepstream.io/docs/server/valve- permissions/](https://deepstream.io/docs/server/valve-permissions/)

When used for AuthN/Z, most seem to align with Role Based Access Control (RBAC), while others go for Attribute Based Access Control (ABAC). The former is generally easier to reason about and build, while the latter is more powerful though harder to build and explain.

Most IaaS IAM systems (like those in AWS [[http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_po...](http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html)], GCP [[https://cloud.google.com/compute/docs/access/iam]](https://cloud.google.com/compute/docs/access/iam\])) are RBAC, while BaaS solutions seem to trend to ABAC for schema validation + business logic.

Kubernetes also has a cool way of doing this: [http://kubernetes.io/docs/admin/authorization/](http://kubernetes.io/docs/admin/authorization/)

Disclosure: I work on this at Firebase

<comment><USER29> is something like this applicable for complex math formula as well. For example if you were building a web based financial spreadsheet.

</comment></comment><comment><USER30> Please not another DSL. We already have a way to express logic; it's called code.

If you want to make a different programming language that's fine. Data is code.

Maybe what you really want is a finite state machine? [http://machina- js.org/](http://machina-js.org/)

<comment><USER31> I recently implemented a DSL for an environment that I wrote for a fairly niche purpose, accompanied with a graphical application to build "programs" in that DSL, because my users are non programmers that need to express domain specific logic.

It has saved us hundreds if not thousands of man hours on something mission critical to the company, all while empowering the end users, giving my programmers more latitude to operate, and separating nicely the generic environment from the specifics that are irrelevant to it.

There are many ways to solve a problem, and the right one is highly context dependent. Dismissing something just on the basis of "we already have a way to express logic; it's called code" seems very narrow minded and not like the best way to produce solid engineering work.

I can also highly recommend Fowler's "Domain Specific Languages" book, which gives me the backing to say that I am far from alone in having success with that approach.

[http://martinfowler.com/bliki/DomainSpecificLanguage.html](http://martinfowler.com/bliki/DomainSpecificLanguage.html)

<comment><USER32> A DSL is fine, encouraged even, for solving specific problems. JsonLogic however seems like a general tool looking for a job, but I maybe I just haven't seen its usecase yet.

It looks as a way to move business rules entirely to the backend, but still have the frontend executing them. I can see the value in that if you desperately need to reduce the load on your backend.

<comment><USER33> Javascript is the way we execute the same rules on the front/back.

<comment><USER34> Or any language that runs in the backend and compiles to JS for the frontend. Rxample: if you have a Rails backend you might consider to use Opal for the code shared between the server and the browser. This JSON logic would be there.

</comment></comment></comment></comment></comment><comment><USER35> ElasticSearch new Painless scripting language is a secure lava-like DSL language which is a superset to just logic. Although it seems to be jvm opinionated.

[https://www.elastic.co/guide/en/elasticsearch/reference/mast...](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules- scripting-painless.html)

</comment><comment><USER36> Ambitious developer discovers abstract syntax trees expressed as JSON, film at 11.

<comment><USER37> But what if the code was just the same as the data. The code could process other code as if it were just data.

What would THAT language be like?

<comment><USER3> It's called Lisp.

<comment><USER38> Lisp -> Scheme -> Javascript -> JSON -> Lisp

Yep, it's come full circle!

<comment><USER39> [https://github.com/kanaka/miniMAL](https://github.com/kanaka/miniMAL)

</comment></comment></comment></comment></comment><comment><USER40> We built a system, where user can construct complex search criteria and submitted for result. We were passing the criteria using a custom dsl (lot of coding in front-end to construct and parsing logic in back-end).

This will be a perfect match for those kind of cases.

</comment><comment><USER41> I don't understand... Why just dont get all the complex logic from server/client, generate a .js with it and use in server/send to client? Why JSON? JSON is not designed for this.

</comment><comment><USER42> One use case might be the backend of a logic engine a la Drools. I imagine that needs a well defined, serializable subset of a full programming language.

</comment><comment><USER43> I've seen similar XML based approaches for expressing configurable business rules but never any as JSON. Love it

</comment><comment><USER44> [https://en.wikipedia.org/wiki/Business_Process_Modeling_Lang...](https://en.wikipedia.org/wiki/Business_Process_Modeling_Language)

[http://bpmn.io/](http://bpmn.io/)

</comment><comment><USER45> Here to say JSON is not a good place to encode logic because JSON doesn't allow comments, and whenever you are encoding logic, you are going to have to clarify that $conterintuitive_rule is needed because $stakeholder decided $such_and_such.

OK, I'm done shitting all over what's probably a perfectly cromulent library now…

</comment><comment><USER46> As a strictly experimental project, i applaud this effort and i hope the author learned a lot about building a library. The web presentation is above average as far as library projects go.

As the library itself, i would't touch this with a 100 foot pole. Serializing logic shatters encapsulation as well as cohesion, both cornerstone object oriented principles. Also, when you serialize logic, you leave yourself handicapped to fix code bugs, as your code bugs are now data bugs by definition. Imagine solving an off-by-one style error in persisted JSON logic. Your choices would be regex (shiver) or a script to parse all json blocks and modify accordingly? Yikes.

As an experiment, this is quite nice. Perhaps too nice. Given the quality of presentation, i feel bad for the shops that decide to adopt this into production usage.

<comment><USER47> As soon as you begin accepting user data, all your code bugs, even those as simple as forgetting to collect some metadata you might need later, are data bugs. And to the specific point about serializing logic being considered harmful, I'm sure [https://www.periscopedata.com/](https://www.periscopedata.com/) would beg to differ!

Seriously, though, there's nothing wrong with using this for a presentation layer. Define a group of user-selectable client-side filters in a JSON constants document, which will have a much smaller "error surface" than defining custom filter functions. Just because it looks like JSON doesn't mean it necessarily needs to be serialized.

That said, there are a number of inefficiencies in the implementation. Certainly not production ready, but a great effort.

</comment></comment><comment><USER48> As others have said, this is code.

In my experience, folks writing code come to need a VCS ("oops, didn't mean to change that"), a debugger ("why did it do that?"), a test environment ("what happens if I change that"), and perhaps an audit trail ("who changed that?").

Set against that, the effort required to parse expressions is trivial.

<comment><USER49> > Set against that, the effort required to parse expressions is trivial.

Especially s-expressions.

</comment></comment><comment><USER29> has anyone built a system where complex math had to be made part of the system... yet had to be user editable?

would something like this help?

</comment><comment><USER50> Greenspun's tenth rule in action.

<comment><USER51> Greenspun's tenth rule meets Atwood's law?

</comment></comment><comment><USER52> interesting - but why would i use jsonlogic instead of javascript ?

<comment><USER26> Allowing user-defined rules comes to mind. AFAIK `eval()`-ing user input is can't be done in a safe way. Probably OK on browser but not on the server.

<comment><USER53> I don't see why a language like JS couldn't be used for evaluating rules when sandboxed. Looks like there's a project that does just that: [https://developers.google.com/caja/](https://developers.google.com/caja/)

</comment></comment></comment><comment><USER54> The only thing that comes to mind is a poor man's Clojure(Script)

</comment><comment><USER55> why suddenly everybody is talking abt this when nobody noticed it when it was post 2 months back?

</comment><comment><USER56> Made me think of [http://thedailywtf.com/articles/the-inner-json- effect](http://thedailywtf.com/articles/the-inner-json-effect)

</comment><comment><USER37> Reminds me of [https://www.elastic.co/guide/en/elasticsearch/reference/curr...](https://www.elastic.co/guide/en/elasticsearch/reference/current/query- dsl-and-query.html)</comment>


First US Covid-19 patient recovered just one day after Remdesivir antiviral - <AUTHOR> https://doi.org/10.1056/NEJMoa2001191 <comment><USER2> Did an experimental drug help a U.S. coronavirus patient?

[https://www.sciencemag.org/news/2020/03/did-experimental- dru...](https://www.sciencemag.org/news/2020/03/did-experimental-drug-help-us- coronavirus-patient)

As the coronavirus spreads, a drug that once raised the world's hopes is given a second shot

[https://www.statnews.com/2020/03/16/remdesivir-surges- ahead-...](https://www.statnews.com/2020/03/16/remdesivir-surges-ahead- against-coronavirus/)

</comment><comment><AUTHOR> Why aren't we using that drug anywhere else and just having people die?

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

<comment><USER3> Sometimes the cure can be worse than the disease. What if there can be long term side effects? Now you have at least two problems...

<comment><AUTHOR> Well you aren't wrong but if the person is at death's door and this has been used in several cases already for other viruses (and China is rushing it on 1000 people?!) why not?

<comment><USER4> Doctors _are_ using it. From a story published last week:

> While awaiting these results, doctors in the US, China and Italy are already > using remdesivir on a compassionate basis to treat small numbers of patients > with severe Covid-19.

[https://www.theguardian.com/world/2020/mar/10/hopes-rise- ove...](https://www.theguardian.com/world/2020/mar/10/hopes-rise-over- experimental-drugs-effectiveness-against-coronavirus)

<comment><USER5> > on a compassionate basis

Is this medical speak? What do they mean by that.

<comment><USER6> Something like "Some threshold of official approval/proven safety has not been met, but we'll break the rule this time and give it to them anyway since they're very sick and we don't have any other options."</comment></comment></comment></comment></comment></comment>


Ask HN: Become a PHP expert - <AUTHOR> I know that PHP isn't the most popular language here, and it's not my ideal choice, but assuming that I need to become an expert PHP developer, what are some good resources I can read to accomplish that? I'm concerned with application structure, PHP gotchas, security, everything needed to deploy a quality PHP application. Any thoughts or suggestions? <comment><USER2> This is an excellent resource for modern PHP development: [http://www.phptherightway.com](http://www.phptherightway.com)

<comment><AUTHOR> This looks like a good resource, thanks!

</comment></comment><comment><USER3> The most important aspect of becoming a PHP expert is navigating through a safe path in a land of a million pitfalls.

This means, you should not try to push the language yourself in anyway. Do the most straightforward, traditional things. Use a well tested framework (if you are doing web). Something like Symfony would do. Don't make your own 'deep' abstractions. The language is not strong enough to support them without a million unit tests to go with it.

Then you should have awareness of the most prominent of the Php pitfalls. /r/lolphp is a good resource for that. Go through the posts and read anything with more than a dozen upvotes.

Then, regarding security and other general topics, don't count on the Php community to answer your questions. I mean, don't take your questions to /r/php but /r/askprogramming or some general forums.

Trust only extreamly popular libraries that have in in use for long time. For example, Symfony components.

Two things you might want to take a look into is specifically Dependency Injection and the Composer dependency manager and how autoloading classes based on their fully qualified name (\Vendor\Package\Classname)

</comment><comment><USER4> I would recommend laracasts[1]. I have learned tons of solid PHP principles, code structuring techniques...

1\. [https://laracasts.com](https://laracasts.com)

<comment><AUTHOR> Thank you

</comment></comment><comment><USER5> "Learning PHP", fresh off the press, is quite useful as a first PHP overview in my opinion. It's aimed at PHP beginners with some prior programming experience.

<comment><USER6> Do you have the link? Lots of books with that title.

</comment></comment><comment><USER7> There's a number of excellent resources suggested in this post by others already so I wont repeat them.

One unique thing about becoming a PHP expert is the contempt you'll occasionally run into from others in the technology world.

Remember engineers get paid to solve problems for the business and success has very little to do with what the current flavour of "cool" is.

</comment><comment><USER8> Laracasts.com

</comment><comment><USER9> Learn Python...

<comment><AUTHOR> I know Python but I am going to be required to work on some PHP projects. Thanks for the advice though, I guess.</comment></comment>


How Goldman Sachs Became a Tech-Investing Powerhouse - <AUTHOR> http://www.bloomberg.com/news/features/2015-07-28/how-goldman-sachs-became-a-tech-investing-powerhouse <comment><USER3> My take is that this is a reaction to companies staying private longer, and its not very surprising that GS is taking the lead in wall street as they are usually on the ball.

Having said that, all they are doing is providing the same Investment banking services to companies that they always have, just now, they are offering it to private companies.

Think of it as a cover your ass approach, if companies decide not to go public, GS still gets a piece of the action, and if they do go public then its an easy pick for GS to lead their public IPO's as both sides already know each other.

They are also trying to lead the charge in allowing people to invest in private companies through investment vehicles that look similar to funds( ie pooled capital that they raise and invest for share holders).

With companies staying private for so long some people, and I'm starting to become one, now think that the day of the publicly traded growth company are coming to an end and that companies will go public once they have matured into value stocks.

This is evidenced by the markets are loosing patience with companies like Groupon, Zinga, Yelp and my personal whipping boy Twitter. Come on twitter, get your act together, you wont' be around much longer if you continue on like this.

<comment><USER4> > They are also trying to lead the charge in allowing people to invest in > private companies through investment vehicles that look similar to funds( ie > pooled capital that they raise and invest for share holders).

I was just reading in another thread about how a new hypothetical tech crash wouldn't be as bad as the dot com crash for precisely the reason that all these new, 'over-valued' companies are private rather than public. In this context, isn't this kind of investment vehicle dangerous?

(I don't pretend to understand this kind of thing and would be glad to be made a little wiser.)

<comment><USER5> Almost! People are worried about another tech bubble bursting because of things like overvaluation of companies and the frequency of unicorns (private companies valued over $1bn) appearing on the scene (which gives perhaps an illusion that VCs are funding left, right and center).

But you could say that the huge growth we're seeing in investment in tech now is different to 15 years ago because:

\- most VCs are funding significant amounts of their capital in later-stage startups and companies that have shown a lot of promise ("private IPOs"), rather than the other way around

\- there are more startups now than 15 years ago but the same (or lower) amount of total capital invested, whereas before a smaller number of startups were funded from a huge pot

\- generally tech companies nowadays, even those unicorns a few years old, have solid financials and managed to turn a profit. This wasn't entirely the case 15 years ago.

There was a Andreessen Horowitz presentation on this very topic going around a few weeks back - it's worth a read if I can dig it up (or you could be relentlessly resourceful ;)).

<comment><USER6> You do realize that one of the classic signs of a bubble is people explaining "...this time it's different".

<comment><USER5> Haha. It's difficult to say for sure but those are just the main contrast points. Things could very well turn out badly.

</comment></comment></comment></comment></comment><comment><USER7> Goldman Sachs is a complex place, with lots of competing interests inside. I see a few things going on here...

1 - Goldman Sachs wants to be able to offer it's investors access to tech companies. This used to be access to IPOs, and now it's access to pre-IPO.

2 - Goldman Sachs is trading for their own position too.

3 - Goldman Sachs is an IT company at heart. Their IT department is bigger than their Fixed Income department. They write their own databases and programming languages from scratch. (I'm not saying whether this is a good idea or not.) They want to be attached to the bleeding edge of Silicon Valley technology, and money is their way in.

None of this is nefarious or evil.

<comment><USER8> The one thing I remember about Goldman Sachs is that they have their own collections library for Java.

<comment><USER9> They do, and it's pretty cool: [https://github.com/goldmansachs/gs- collections](https://github.com/goldmansachs/gs-collections)

<comment><USER10> I can confirm it's awesomeness and high performance!

</comment></comment></comment></comment><comment><USER11> This is a logical progression. The Wall Street and Silicon Valley cultures are converging.

A significant part of what made a company like Goldman Sachs competitive on Wall Street used to be primarily about "Who you know" (as opposed to "What you know" or "What you can do"). That's changed over the last few decades as the financial markets became less about relationships and more about technology (although relationships still reign in certain areas). Since the dot-com bubble burst, more and more people have been crossing back and forth between investment banks (or hedge funds) and startups. It started with engineers because technology is key to both types of companies, and now it's shifting to financiers because pre-IPO "startups" need those relationships.

Silicon Valley used to be the exact opposite of Wall Street (i.e. totally about "What you know" or "What you can do") but over the last decade, it has been evolving towards a "Who you know"-ocracy. It's no longer enough to have a great product/technology - you need to build your network and get the warm intro, so successful entrepreneurs no longer automatically reject the value of "Who you know", and they're now comfortable exploiting a financiers' connections and relationships to help grow their company by raising money privately.

<comment><USER12> _Silicon Valley used to be the exact opposite of Wall Street (i.e. totally about "What you know" or "What you can do") but over the last decade, it has been evolving towards a "Who you know"-ocracy._

I respectfully think this is unlikely to be a true reflection of reality. Testable proposition: you survey 50 partners with investing authority at an arbitrary sampling of top Valley VC firm in 1998 and in 2015. Do you believe that the 1998 vintage will include more partners who either a) have ever had an operational role at a technology company other than a VC firm or b) could successfully pass FizzBuzz?

My understanding is that one of the worst-kept secrets in Silicon Valley is that a VC and a banker are distinguishable in exactly one way: bankers don't wear khaki. They come from the same social backgrounds. They study the same things at the same schools. They have strikingly similar career arcs. Their core skill set is identical: convincing wealthy people and institutions to overpay them for financial services.

The newfangled Silicon Valley innovation is that there might _actually_ be a technologist in the room when the adults are talking about money these days.

<comment><AUTHOR> Many of the best VCs are easily distinguishable from Wall St bankers in another critical way: they're _very_ competent when it comes to technology. Understanding it, seeing where it's going, and knowing where it has been. They also often have a very different background vs bankers: degrees in engineering and computer science.

See: Marc Andreessen, Ben Horowitz, Peter Thiel, Doug Leone, Vinod Khosla, Paul Graham, Bill Gurley, Jenny Lee, John Doerr, and countless other examples - these people get technology in a way your typical banker never will.

<comment><USER13> That's certainly the mythology behind Valley venture capital, but we needn't stipulate that it's true for Patrick's argument to remain plausible.

Certainly, it seems like an extraordinarily implausible claim that VC in 1998 was _better_ than it is now. I raised mid-7 figures, institutionally, in '99\. VC in '99 was atrocious.

</comment></comment></comment></comment><comment><USER14> Why does Goldman Sachs still exist? Shouldn't they be in prison or something? How do they still have customers after they were so proud of screwing their own customers?

<comment><USER15> I feel you. For those who don't, here are a few relevant readings:

[http://www.rollingstone.com/politics/news/the-great- american...](http://www.rollingstone.com/politics/news/the-great-american- bubble-machine-20100405)

[http://economistsview.typepad.com/economistsview/2009/10/how...](http://economistsview.typepad.com/economistsview/2009/10/how- paulson-gave-goldman-the-lehman-headsup.html)

That said, it's not Goldman's fault as much as it is the US gov's fault... It's failure to regulate that financial industry is humongous.

<comment><USER16> We should not forget about GS, Greece and the EU....

</comment></comment></comment><comment><USER17> How to become a tech investing powerhouse: start by being an investing powerhouse. Seems like it was theirs to lose. And they nearly have several times.

</comment><comment><USER18> I'm surprised and impressed that they were in Uber's B round. It isn't uncommon for firms to invest in late stages of huge successes so they can list the firm as an investment; but B round is actually taking risk.

<comment><USER19> Same. At the point they invested IIRC Uber was only doing 12m/year. Very impressive investment.

</comment></comment><comment><USER20> Can anyone explain what's going on in that chart at the Uber b round [0]? It states their valuation at 50m and says Goldman invested 37m - how would that ever happen? Also Angellist says that round was 32m and Goldman were 1 of 4 parties in it. [1]

[0] [http://assets.bwbx.io/images/irAfvE0DI.rE/v1/488x-1.jpg](http://assets.bwbx.io/images/irAfvE0DI.rE/v1/488x-1.jpg) [1] [https://angel.co/uber](https://angel.co/uber)

<comment><USER21> It could be debt.

<comment><USER20> I really don't know much about these things so you might well be right - <USER2> it's labelled an equity deal and they explicitly point out that the series e was debt.

Also would it be typical to do 30m+in debt for a 50m company (typical is probably the wrong word given Ubers trajectory)?</comment></comment></comment>