Hacker Newsnew | past | comments | ask | show | jobs | submit | more phpnode's commentslogin

Reason is a language, bucklescript is an alternative backend for ocaml which generates JavaScript. You write reason, you don't write bucklescript


okay, then what's the difference between ocaml and reason? :)


I spoke quite a bit about ReasonML during 2016, hopefully this should cover a lot of what Reason is, how it relates to OCaml, and how it's different: https://www.youtube.com/watch?v=8LCmLQ1-YqQ

Happy to answer any questions I didn't get to in the talk as well!


Reason is a js like syntax for ocaml, semantically they're identical. Similar to coffeescript and JavaScript, except ocaml has really good support for this kind of stuff


So what you're saying is I could write a JavaScript-esque program and compile it to OCaml using Reason, and then compile it to true JavaScript using Bucklescript?


Yes exactly, although you can avoid the middle step and go straight from reason to js because of the way bucklescript plugs into the ocaml compiler


Why would one prefer reason to ocaml? (Honest question)


You might find this page from the Reason website useful: https://facebook.github.io/reason/mlCompared.html

It replaces a lot of the idiosyncratic bits of OCaml's syntax with things that feel more appropriate if you're comfortable with other modern languages.

A quick example is tuple types. OCaml declares tuple types as int * int, which makes total sense if you know that tuples are a product type. However, you actually create tuples using commas. Reason throws away the connection to theory and uses the same syntax for types (int, int) and creating values of that type (3, 7).


Reason's syntax is a little cleaner and it's easier to get up and running with.


It is much more like JavaScript than ocaml and so you get a familiar language but one which benefits from all the cool things that ocaml can do.


Another n00b question: What are "all the cool things that ocaml can do"?

I only saw rather simple typing examples, which didn't seem much different from what TypeScript can do.

On the other hand I read often that ocaml doesn't have runtime errors, which I certainly get with TypeScript.


This is a good overview I think, although it doesn't get into specifics: https://realworldocaml.org/v1/en/html/prologue.html#why-ocam...

Of course the rest of the book is a great read too if you're so inclined.


OCaml does have exceptions at runtime (eg if you try to take the maximum of an empty list), but generally your programmes won't have type errors at runtime.


They don't want to send down the entire message history every time you switch to a particular conversation window, they want to be able to store as much of that locally as is possible/sensible so that the user doesn't have to wait for a network round trip and it still mostly works offline. They would like to store these messages in IndexedDB but they would like to encrypt them first.


Browsers have had HTTP caches for decades. But yeah, IndexedDB is nice too.


HTTP caches are great for their intended use case, but when used like this they have a lot of limitations.

You can't rely on them existing, having space, or keeping your data for any real amount of time. You can't process the data before it hits the cache, you can't clear them easily, and they are iffy at best when offline.


> You can't rely on them existing, having space, or keeping your data for any real amount of time

In other words, a cache.


Yes, but a cache with zero reliability isn't very useful.

If I do an expensive operation, then need to use its result later, I can't rely on the HTTP cache as the browser may never have cached it in the first place, or may have evicted it by the time I go to use it. So using that unreliable cache can actually make things worse in the sense of more data usage, more power usage, more battery usage, and more memory usage.

For a real world example, say I wanted to pre-fetch a bunch of data on page-load, then in a later page I want to use the cache to be able to quickly get that information and use it without any latency. If I had some control over the HTTP cache, I could do this.

But as it stands right now, I can try to make a GET request on the page load, but when the user clicks the button to see the result on a later page, it's a crapshoot on whether or not the HTTP cache will still have it, leading to the user having to wait sometimes, and not other times, duplicated requests, and a lot more data usage.

With localstorage, IndexedDB, WebSQL, etc... I have that control. I can know that the information is going to stay there until I need it so I don't need to worry about my caching making things worse.


This is a chat application, the primary transport is WebSockets, not HTTP.


Why is that particular use case solved better with blockchain than e.g. incrementing a counter in an actual database?


again, the use case I made up is not important. And to argue the use case would be missing the point.

However, for argument's sake. People can counterfeit drivers licenses, or passports. Good luck trying to counterfeit something on the blockchain.

Edit: to expand on this, think of a poor country who doesn't have their technology up to par as a 1st world country. To build the infrastructure to even have that government database is costly versus using an already existing infrastructure to do most of the heavy lifting.


> again, the use case I made up is not important. And to argue the use case would be missing the point.

This is precisely the point. Blockchains are met with negativity because enthusiasts keep trying to evangelize their merits without having anything to show for it. If blockchains have uses besides cryptocurrencies, point to a practical example or build something and Show HN, but the incessant proselytizing of blockchain vaporware is tiring and makes non-enthusiasts roll their eyes whenever the topic comes up.

> However, for argument's sake. People can counterfeit drivers licenses, or passports. Good luck trying to counterfeit something on the blockchain.

This is another example of how blockchain enthusiasts commonly misunderstand how their technology interacts with the real world. Creating a counterfeit driver's license or passport has nothing to do with computer systems. Today's counterfeiters don't hack into a mutable database and modify identification records, they simply create a physical passport or ID that looks authentic enough to fool a human being who doesn't exist on a blockchain.

The blockchain phenomenon is akin to when a star-eyed developer writes a 10 page blog post about their FPS-RPG-RTS-MMO hybrid with a physics and chemistry simulation system that offers unlimited possibilities! Except the project usually fails after debuting a few misleading demos, and if the project ever escapes the alpha phase, the reality is hugely underwhelming and not at all resembling anything close to what was advertised. That is the blockchain in a nutshell.


>The blockchain phenomenon is akin to when a star-eyed developer writes a 10 page blog post about their FPS-RPG-RTS-MMO hybrid with a physics and chemistry simulation system that offers unlimited possibilities! Except the project usually fails after debuting a few misleading demos, and if the project ever escapes the alpha phase, the reality is hugely underwhelming and not at all resembling anything close to what was advertised. That is the blockchain in a nutshell.

I'm actually surprised nobody's brought blockchains to Star Citizen yet.


> At most, the dream of ad-funded websites might be dead. (I wish!)

What you are wishing for is a world in which access to things like Google Search which we take utterly for granted now are forced to become paid services. What are the implications of that, particularly for the world's poorest?


> a world in which access to things like Google Search which we take utterly for granted now are forced to become paid services. What are the implications of that, particularly for the world's poorest?

hmmm so Google will stop being a de facto monopoly while ad networks crumble? Maybe free and/or open search will start flourishing again because finally there is incentive to write readable HTML for all crawlers instead of only returning scannable results when they detect the (highly peculiar) GoogleBot.

Maybe we'll get search engines again that do proper ranking (I hear actual pagerank was not a bad idea), or ones that do a proper AND-search of your keywords instead of trying second-guess you. Maybe they'll even return more than the top 1000 results. Search engines aren't that hard if you don't try to be as big as Google immediately and they just try to be good at that things they're good for.

Walled silos of user-supplied data will fall apart because it's no longer a viable strategy to special-case GoogleBot access to get your locked data appear in the results any way.

Google can no longer afford to arbitrarily overlook tactics which are against their TOS, as long as the player is big enough.

All the while, small business can still advertise if they want, easily enough by making a deal with other businesses (perhaps through a middle-man) and self-hosting the banner, click-through link to the other. Maybe some self-hosted analytics. And because in this hypothetical dream-world the craziness of these huge 3rd party ad-networks is gone, this will actually work, it'll pay, people will click.

Ads will therefore become much less shady as they are currently perceived (like, merely deceitful, not as a proper possible danger to your computer, your data and identity). Hopefully this will change the public idea of what ads can and should be in such a way that these ridiculous 3rd party ad networks with their "accidental" malicious code and ubiquitous tracking will never get a foothold again.

There might also be some downsides, though.


How much does it cost Google Search to support an extra user on the margin? I don't really know, but I'd wager much less than $1/year - because it's very implausible that the extra ad revenue it gets today from an extra user is more than that.

(The world's poorest people are a really bad target audience for ads - they have very little discretionary income!)

Meanwhile, the cost of Internet access for the poorest people is at least an order of magnitude bigger, maybe two orders of magnitude (since the cost to Google probably is much less than $1). Also, poor people's main or only Internet access is often via smartphones, and mobile data costs much more per GB than landline ISPs.

On the margin, some people who can afford Internet access today would not be able to also afford (as many) paid services. I'm willing to pay this price, in exchange for everyone who could afford access and services (including most of the poor people who can do so now) getting much better and more varied service and much less surveillance. Also, a paid model would enable people who publish blogs and other sites, and various services.

Finally, if you treat Internet or Web access and services as very important and maybe a human right, then governments should provide it or subsidize access or regulate prices. Absent that, for-profit corporations paid by users would be much better than the same corporations paid by advertisers.


Using 8.8.8.8 gives google even more insight into your internet habits, even if you're using e.g. firefox on a webpage that includes no google assets at all (no web fonts, no google analytics etc), google will still know you've been there. Whether that matters to you or not depends on you.


> We don't correlate or combine information from our temporary or permanent logs with any personal information that you have provided Google for other services.

https://developers.google.com/speed/public-dns/privacy


I have no idea what goes on in google. That said, even if they don't correlate with "personal information that you have provided," you as an IP address are still identifiable as that IP address, and correlatable with yourself, for as long as that IP lasts for you.

Which means Google could cause ads to follow you around, for example. Again, I don't know what all they actually do or don't do with their DNS logs, but the quoted "promise" doesn't promise anonymity, just separation of you as a known Google user from you as a semi-anonymous but specific DNS user.

I'm reminded of the early days of the Snowden revelations, when the NSA was saying "it's just metadata."


They do not log the user's IP address. It says so on the page I linked.


That doesn't mean much. They could still correlate and combine information with any anonymized (or rather, what they consider anonymized) personal info. The fact that they even mention that they have permanent logs is quite unsettling.

I would think they'd just dump the data from all of their services into your advertising profile. They won't store your name and such, but they have to have a way of linking this anonymous profile to your google account or something. I doubt that google simply deletes all advertising profile data if you just happen to clear your cookies.


Yeah; and they don't share anything with intelligence agencies either.


/s


Yet.

Remember when they said they don't combine data from different properties?


what's a good alternative?


OpenDNS supports DNSCrypt.

208.67.222.222

Although they've been bought by Cisco recently.

You could also just run your own local caching resolver that hits the real root nameservers for lookup.


Running a real, public DNS server is a highly skilled, full time job. I wouldn't touch it with a barge pole and I (roughly) know how to do it.


Running "apt-get install unbound" on your laptop/desktop gives you a local caching recursive resolver which performs dnssec validation.

Doesn't sound like a full time job to me.


But then, unbound is not a "real, public DNS server".


It is not no. chillydawg made the mistake of conflating the two things. Running a, "real, public DNS server" is not required in order to do DNS lookups without using somebody elses recursive resolver.


Not public, probably just a local server for personal use.


It doesn't have to be public.



I like the idea behind OpenNIC and tried it for a few months, but found it less reliable than I wanted it to be.


Why is it ok to scald patients in third world countries? What if the quirks lead to misdiagnosis etc? If there was a way to produce this technology safely and cheaply people would be doing so


My point was that it might be better to accept a risk of scalding if it saves lives. A really cheap ultrasound could have all sorts of bad attributes -- and still be worth it to the people who are using it. It could make an incredible positive difference in people's lives. There is no universal set of standards. It varies a lot depending on particular circumstances.


If risk of scalding means the price can be reduced to a point to where every ambulance or high-speed paramedic car can have one, then it is worth it. If it means that every back-water third-world doctor can have one, great. Sometimes knowing if a patient has internal bleeding, and where, is worth the risk.


Don't forget to balance that advantage with the risks and harms of over testing.


Some memory allocators use them for tracking free blocks because insertions/removals are cheap and they're good at best-fit style searches.


This DPR is not the original DPR and as far as anyone knows never invoked hitmen, but he didn't last long.


He's talking about the Silk Road marketplace - https://en.wikipedia.org/wiki/Silk_Road_(marketplace)


Silk Road 2.0, Not Ross Ulbricht's but a different Dread Pirate Roberts


Thanks, so it sounds like the SpaceX pitch was just the client wanting to build up a really cool cover story while he worked on(?) Silk Road in secret. Right?


Presumably yes, and the datapoints being visualised would have presumably been transactions. The admin in question would have been Blake Benthall, not Ross Ulbricht who'd already been caught by then.


I'm from the UK and have never heard this word, and I can't think of any similar words with racist connotations.

It's also a very anglo-centric viewpoint, why shouldn't the inhabitants of Gogland[0] have some software named after their homeland?

[0] https://en.wikipedia.org/wiki/Gogland


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: