Subspace – A simple WireGuard VPN server GUI - <AUTHOR> https://github.com/subspacecommunity/subspace <comment><USER2> Ah, this is a fork, NOT the original. I came across the original subspace long time ago when switching from strongSwan (IPsec based VPN) to WireGuard for my own good. There has been no development work for the original project in a while.

If you are looking for user friendly web UI for quickly building a VPN for remote access (encrypting traffic / data path between the device and Internet), with easy client management (scan the QR code for client profile thingy) try

\- wg-access-server [1]

\- wg-gen-web [2]

\- wg-ui [3]

They all work well in a containerized fashion, all created around the same time when WireGuard was merged into Linux kernel mainline ;-)

Simple script worked better for my remote access use case for now, for use cases at scale I'd seriously take Tailscale into account (100 clients for personal - free account).

[1]: [https://github.com/Place1/wg-access- server](https://github.com/Place1/wg-access-server)

[2]: [https://github.com/vx3r/wg-gen-web](https://github.com/vx3r/wg-gen-web)

[3]: [https://github.com/EmbarkStudios/wg- ui](https://github.com/EmbarkStudios/wg-ui)

<comment><USER3> Pretty sure this is a fork because the original has arbitrary user limits due to it wanting to be a commericial product. Que hundreds of forks with the user limits removed.

<comment><USER4> 'Cue' not 'Que' \- just in case you want to use the word in more formal circumstances.

<comment><USER5> Que?

</comment></comment></comment></comment><comment><USER6> Is there anybody interested in building or using a service that routes static public IPs to self-hosted servers, over WireGuard? I made a prototype a week ago, here's the homepage:

[https://hoppy.network](https://hoppy.network)

I realized that I didn't want to ever deal with port-forwarding, NAT, or dynamic DNS and decided to create this. Message me if you want a signup link.

<comment><USER7> I tried your service and it just works™, which is great. But a couple of points:

1) I saw that you're basically using one OVH box per IP. How do you plan to ever monetize this then?

What prevents a user from creating their own VPN instance on their own box and port forwarding from there? Granted this process is somewhat involved, but the kind of user who needs to do this is likely to be somewhat technically inclined anyway. (Some ideas: negotiate long-term deals for IP addresses and try to map > 1 IP per box / remove the static IP guarantee and keep a rotating pool of addresses – _public_ IPs are more valuable than _static_ IPs anyway IMO and you can integrate dynamic DNS into your service)

2) How do I know that you're not sniffing my traffic? Granted that most traffic being encrypted these days is a thing, but still I think it's a genuine concern.

3) I live in Asia, so latency was off-the-charts for me. (On the order of 500ms). But this problem could easily be solved by introducing servers in more locations.

<comment><USER6> 1) I have monetization figured out. That's as much as I'll say for now.

2) that's a hard question, mainly because if I was using this service I would ask the same thing. Personally, I think a strong mission statement, privacy policy, and maybe a warrant canary would be good enough. At least with a strong privacy statement, I would be legally bound to never sell/peek at your data which is loads better than current ISPs.

I can't do much better than promise I wouldn't.

3) Did the Chicago server fare any better?

Also, thank you for the comments! I really appreciate them.

<comment><USER7> 1) That's nice to know. Best of luck!

I think two tiers with a cheaper roaming IP + dynamic DNS plan and a more expensive static IP plan would be smart. But that's for you to decide.

3) Only the Canada server was available when I signed up ~2 weeks ago unfortunately. I'll take a look again.

</comment></comment></comment></comment><comment><USER8> Let's be clear here. Subspace is and always will foremost be a fantastic massive online game from the late 90s. See wikipedia for more info. Slight disappointment that it wasn't related.

<comment><USER9> I had no notion about the Subspace game and as time passes my parcel of the population will only grow relative to people who do know the Subspace game.

It's not fair nor feasible to reserve names permanently.

<comment><USER8> It's cool - I'm having fun with nostalgia.

<comment><USER10> fwiw, the Continuum client is available even on Steam and some zones, like Trench Wars and Extreme Games still have full lobbies.

I got back into Extreme Games (30-flag CTF) for 6 months last year. Good times all over again.

</comment></comment></comment></comment><comment><USER11> Anyone else thought of 'Subspace', the pioneering internet multiplayer space shooter from the 90's that was in many ways ahead of it's time? Great times were had.

[https://en.wikipedia.org/wiki/SubSpace_(video_game)](https://en.wikipedia.org/wiki/SubSpace_\(video_game\))

<comment><USER12> No, I had a nastier association :)

<comment> reading-at-work Surprised I had to scroll this far to find this - same here!

</comment></comment></comment><comment><USER13> Shameless plug time: those interested in subspace might want to check out a project of mine: dsnet [https://github.com/naggie/dsnet/](https://github.com/naggie/dsnet/)

dsnet is a simple wiregard management command that manages key generation and IP allocation, generating config files. I'm using it for a few networks at the moment.

I recently tried to add decent documentation and a blog post in the hope that it's useful to someone. I should so a Show HN really.

Here's the blog post: [https://callanbryant.co.uk/blog/how-to-set-up-a- wireguard-vp...](https://callanbryant.co.uk/blog/how-to-set-up-a-wireguard- vpn-in-minutes-with-dsnet/)

<comment><USER14> This looks very interesting, thanks.

Side note, any particular reason for having `user-select: none` set on your blog? That seems somewhat counterproductive for a blog with code examples...

<comment><USER13> > This looks very interesting, thanks.

I'm glad you like it.

> Side note, any particular reason for having `user-select: none` set on your > blog? That seems somewhat counterproductive for a blog with code examples...

Ah -- that's not intentional. Thanks for letting me know, I've pushed a fix!

I developed the hugo theme for something else where it made sense (a portal) then converted it for use with my blog and missed that.

</comment></comment></comment><comment><USER15> I don't mind the wg-quick command line interface but I must say that the #1 thing that bothers me with wg is that the private keys are stored directly in the config. That means that every time I add a new users the keys are plainly readable on my screen.

Is there a simple way to work around this issue? Can I include the keys from a 3rd party file for instance? I guess I could always just pre-process the config file to generate the final one from multiple sources.

<comment><USER16> PostUp should do what you want. [https://wiki.archlinux.org/index.php/WireGuard#Store_private...](https://wiki.archlinux.org/index.php/WireGuard#Store_private_keys_in_encrypted_form)

I have it grabbing a key from AWS Secret Manager, haven't had a problem with that.

<comment><USER17> In case others got confused by this thread (I thought for a minute "how do you know which private key goes with which peer", is PostUp per peer, etc)... There is only one private key per interface on the server (or anywhere for that matter) and all the other peers are public keys.

I might be the only one who confused myself :)

<comment><USER15> Right, my use of the plural was confusing. It's just that in general when you add a client you end up editing both the client and the server config, so both keys end up being disclosed on the screen.

</comment></comment></comment></comment><comment><USER18> I giggled at this project name.

Seriously. This is cool. CLI rules all, but man, sometimes it's nice to use a GUI.

<comment><USER19> In my early Linux days I remember Subspace Continuum a 2d MMO space ship battle game. I did suck at it, but it was massively interesting.

</comment></comment><comment><USER20> Interesting. I wonder if it re-creates the connection each time you login.

The biggest issue I have with Wireguard is that it's not set up for Roadwarriors. If you have an endpoint with a dynamic IP address (like your home router), but you give wireguard a DNS name, it doesn't store the DNS name. It only stores the resolved IP address.

The official solution is a script they have in their contrib repo that you stick in cron and it scans for changes and resets the endpoint if your DNS changes.

Wireguard also can't bind to a specific adapter on a multi adapter server. Since it doesn't respond with anything with unauthenticated packets, the official solution is that is shouldn't matter. Just iptables on everything and only accept packets on the adapter you want public.

The problem is, the egress packets will just go over the default adapter, so now you have incoming and outgoing packets taking different routes.

Overall thought, I like wireguard way more than OpenVPN. They still need to fix those and other issues though.

<comment><USER21> I setup Wireguard using Algo on a home server I kept behind a home router with no problems. It was definitely a dynamic IP because Comcast doesn't provide static IPs for residential connections.

Am I misunderstanding the limitation you're claiming?

<comment><USER22> > _It was definitely a dynamic IP because Comcast doesn 't provide static IPs > for residential connections._

In my experience, Comcast IPs aren't contractually static, but they very rarely change. Months or years of having the same IP doesn't seem to be uncommon.

<comment><USER23> I've had the same IP address with Comcast for 5+ years. That includes moving to a different city and multiple different modems. Only thing that has stayed consistent is my router.

</comment></comment></comment></comment><comment><USER24> Not sure following is related to the post, but it might help a few like me who are still using High Sierra (macos), and can't use the official WireGuard GUI client (becuase it targets newer versions of macos).

You might want to check WireGuardStatusBar - [https://github.com/aequitas/macos-menubar- wireguard](https://github.com/aequitas/macos-menubar-wireguard)

I like it over wg-quick (which requires sudo, and prompts for password all the time). The WireGuardStatusBar uses a privileged helper, so you only need to authorize it once and use it all the time.

Cheers.

</comment><comment><USER25> Cool, the slick SSO feature means this may be a good choice if I want to set something up that I won't have to support until the day I die.

I like how many choices there are for off-the-shelf configuration generators.

</comment><comment><USER26> Anyone who uses wireguard UI on Mac? I tried downloading it from app store, with error " unable to download to Macintosh HD "

I am only one version behind the latest Mac, so what could be the problem?

</comment><comment><USER27> Could anyone refer to a definite guide to what Wireguard is, what painpoint it solves and effective applications of it?

What kind of magic can I use it for to pipe data around securely in my AWS fortress?

<comment><USER28> It's pretty clearly stated on the landing page of their website: [https://www.wireguard.com/](https://www.wireguard.com/)

\- simplicity

\- sound crypto

\- minimal attack surface

\- high performance

\- well defined

</comment></comment><comment><USER29> Kudos! Nice work, I hope this helps with the adoption of WireGuard

</comment><comment><USER30> Best video game ever.

</comment><comment><USER31> What's the deal with the fork?

<comment><AUTHOR> The original project [1] hasn't seen any commits in a year.

[1] [https://github.com/subspacecloud/subspace](https://github.com/subspacecloud/subspace)

<comment><USER32> Great news this was forked. It was pretty clear the previous project was not really a project but a code dump (still: thank you to the original devs for sharing this with the world!), and so I refrained from using it. Really great this has become a more open project with continued development!</comment></comment></comment>


Reverse Proxy for Google Drive - <AUTHOR> https://github.com/stewartmcgown/drive-proxy <comment><AUTHOR> A project I've been working on. Allows you to serve Google Drive files through a reverse proxy, works on serverless + serverful hosts!</comment>


Nuclide: An open-source IDE for React Native - <AUTHOR> http://nuclide.io/ <comment><USER2> So where's the download? Where's the source? I don't want to have to join a Facebook group for updates.

<comment><USER3> pretty much this. got excited and then I need a FB account...

<comment><USER4> Facebook to the right, Stallman to the left. When I write code, I use tools written by Stallman. When I communicate with friends and family, I use Facebook. There is no contradiction here: they are both useful, and useful is the yardstick by which reality judges memes.

<comment><USER5> He is not talking about anything remotely related to what you are talking about. He just wants to avoid having to register to yet another site.

</comment></comment></comment></comment><comment><USER6> I find this a bit ironic that Nuclide is an IDE designed to support React and React-Native, built on top of Atom - Atom itself just ripped out their React implementation in favor of direct DOM manipulation. Don't get me wrong, I'm a huge React proponent and likely will give this a whirl - but it is ironic, no?

<comment><USER7> Use the right tool for the right job. By your logic, you should never write an assembler in anything but assembly language.

<comment><USER8> I don't think it is quite like that. Assembler was needed to bootstrap the effort.

</comment></comment></comment><comment><USER9> What about the right tool for the job ? Why not use qt instead of web techs for a Gui ? I love Atom , but Atom is Slow, you can't open big files with it and frankly has all sorts of limitations due to web techs.

When will devs stop this madness? even if you are addicted to javascript, use an native GUI, qt supports javascript, or you are doing a disservice to potential users.

</comment><comment><USER10> I'm unsure how something that is unreleased can be "backed by an active community".

<comment><USER11> Because its built on Atom, which comes with an active community... I guess.

</comment></comment><comment><USER12> I don't understand the marketing here. What distinguishes a _unified_ IDE from an IDE?

<comment><USER13> I guess all modern IDEs can be considered unified at this point, but the idea is that all the tools and integrations are part of it - including the build process, typechecker, etc.

Before you would have to run all these in the background + have your IDE open (ie. Sublime Text).

Of course Sublime Text has plugins itself now too, but you get the idea.

<comment><USER14> I don't get the idea. And Im not sure when Sublime Text became considered an IDE, if anything it is anti-IDE. An IDE classically has tools and integrations, well, integrated. E.g. Visual Studio or Eclipse.

<comment><USER15> Sublime Text has a really robust plugin architecture, similar to Visual Studio's extension capabilities. Whenever I'm working on a project, I basically install whatever plugins I need into Sublime Text to give me full "IDE-like" capability specific to that stack. Be it debuggers, integrated compilers, REPLs, version control systems, etc.

I like Sublime Text because at it's default, it's just a text editor, and then _I_ turn it into the IDE that fits my flow and current technology requirements. It becomes an IDE completely customized for my project.

</comment></comment></comment></comment><comment><USER16> Why is this on top of HN with no downloads.

<comment><USER17> Because even if it turns out to be vaporware it demonstrates the community's desire to see tooling developed for React Native.

</comment></comment><comment><USER18> I'm so excited for this: an IDE with first-class support for Hack? Yes please! My only reservation is the last time I used Atom, it was pretty slow, what's it like nowadays?

<comment><USER19> Slow compared to ST, but usable, and some buggy behavior at times, but mostly usable (I use it for JS and Rails dev across numerous projects)

<comment><USER20> Slow and buggy text editing!

<comment><USER19> text editing is mostly ok for me: biggest bug is the full screen bug on OSX (it'll create a modal on the wrong full screen, but when you switch, the modal disappears, but still blocks the UI - only solution is hard kill, meaning you lose progress if the modal was a Save dialog)

</comment></comment></comment></comment><comment><USER21> > atom

nope, been there done that.

It's cumbersome and laggy, which is a major pitfall for me, I like the responsiveness of sublime text.

<comment><USER22> I agree, I wish Sublime was an open-source editor so that custom editors can be built on top of it.

<comment><USER23> You might be interested in LimeText [http://limetext.org/](http://limetext.org/)

<comment><USER21> I'll give this a shot, perhaps make a blog post about my perceptions on all three

</comment></comment></comment></comment><comment><USER24> Where's the download?

<comment><USER25> Not released yet; will be out later this year.

<comment> pre-jr-dev Later this year? WOW. The long nose of hype building :(

<comment><USER26> You'd prefer _next_ year?

</comment></comment></comment></comment><comment><USER27> React + Atom have unfortunately similar logos.

<comment><USER28> The Atom logo looks like React got Java pregnant.

</comment></comment><comment><USER29> fb employees, do you really use this IDE?

<comment><USER30> Not a Facebook engineer. However, I was at F8. I spoke with a couple of engineers, and when they were showing me something on their laptops, they were using Atom.

From what was said at the presentation, this IDE is just a collection of plugins, so I'm guessing you can pick and choose the ones you like.

</comment></comment><comment><USER31> I've been using Atom + Flow + autocomplete-plus + ide-flow + jsx plugin + linters and eventually it really works for Javascript development. From Facebook Group[1] Nuclide "built as a suite of packages on top of GitHub's Atom editor.", would be great if installing Nuclide would be as easy as `apm install nuclide`.

[1] [https://www.facebook.com/groups/nuclide/permalink/8347920765...](https://www.facebook.com/groups/nuclide/permalink/834792076590311/)

</comment><comment><USER32> Is this by Facebook? The site implies it is, but it's not clear.

<comment><USER33> Yes, it says "Facebook Open Source" at the bottom of the site.

<comment><USER32> True, but that page lists Facebook's projects, but not Nuclide. Nuclide is also not on the Facebook Github.

<comment><USER34> I think it's because they didn't launch it yet, probably it's a private repo.

</comment></comment></comment></comment><comment><USER14> How is this open-source? Right now this is appears to be no-source.

<comment><USER35> If the code exists and is derived from Atom, it's MIT licensed. Being pedantic, they don't need to release it in the open for it to be open source - everyone who has access to the code may choose to release it, but it's not mandatory.

<comment><USER14> MIT is not copyleft so not even pedantry will save it. I.e. under MIT they can ship a binary blob and they only need to include the MIT license and a notice.

<comment><USER35> copyleft != open source. They don't even need to publish a binary blob, they can use the code internally. Yet the original project is still considered FLOSS.

<comment><USER14> I don't think that is a definition of open-source that is widely recognized or useful. If Microsoft uses MIT license software in the next version of Windows, is Windows considered open source? No.

</comment></comment></comment></comment></comment><comment><USER36> I hope one of Facebook contributions will be a React native implementation of Atom.

</comment><comment><USER37> I see all these tools are being built on top of Ace but Ace itself doesn't get much love. There are many issues in Ace that needs to be fixed but almost no company is putting resources on it.

<comment><USER38> Sorry, where does it say it's built on Ace? The copy says Atom is the code editing component.

<comment><USER37> Atom is built on Ace

<comment><USER39> I don't think Atom is built on Ace. They had their own system which was powered by React before switching to hand crafted DOM manipulation. Also, Atom's written in Coffeescript and Ace is ordinary JS.

<comment><USER37> If you look at editor API it's very similar to Ace.

[https://atom.io/docs/api/v0.188.0/TextEditor](https://atom.io/docs/api/v0.188.0/TextEditor)

I think they started with Ace but then drifted the code a lot.

</comment></comment></comment></comment></comment><comment><USER40> I'm interested in how they suggest using Buck here, I was under the impression it was just for Java projects.

</comment><comment><USER41> This is all nice and all, but most applications use multiple paradigms, so why focus on just one of them?

</comment><comment><USER42> That's a lot of `padding-top`. Almost looks like the vertical height is misaligned.

</comment><comment><USER43> Now that is a sexy landing page

</comment><comment><USER44> All talk, no download available? Talk about PR wHoREs!

</comment><comment><USER45> That was fast.

</comment><comment><USER46> such a dramatic page; thought they solved fusion not made yet another ide

<comment><USER47> for all the people waiting for an IDE with proper Hack support I'd say this is fairly dramatic

</comment></comment><comment><USER48> You're typing text into a box. Please concentrate on typing the correct text into the box rather than caring which (basically identical) method of typing said text into said box you are using.

People have been typing text into boxes for about 50 years now.

<comment><USER49> I don't know about you, but tooling has always been and will alway be an important aspect in development. Better tools can yield better products.

And no, this isn't just typing text into a box.</comment></comment>


Tell HN: Paid News Websites Should Become Free for Coronavirus Updates - <AUTHOR> Just a thought, but I think NYTimes, Washington Post, WSJ, Medium, etc. should be freely accessible to everyone, esp. if they're covering a piece on COVID-19 updates, precautions, tips, etc. <comment><USER2> I believe this has already started for coronavirus stories/updates.

"Publishers from The Atlantic and The Philadelphia Inquirer to The New York Times, The Wall Street Journal and Bloomberg News have each made coronavirus coverage available to non-subscribers."

Source: [https://www.adweek.com/digital/major-publishers-take-down- pa...](https://www.adweek.com/digital/major-publishers-take-down-paywalls-for- coronavirus-coverage/)</comment>


Show HN: React+D3.js, an ebook that teaches you dataviz with React - <AUTHOR> https://leanpub.com/reactd3js

<comment><USER2> This looks interesting. Too bad the sample chapter doesn't show any code or examples of what to expect from the book.

Having a chapter titled JSX makes me believe React is used to actually render the HTML rather than D3. Is this assumption correct?

<comment><AUTHOR> Yes, this assumption is correct. React is used to render SVG.</comment></comment>


Ask HN: Can you implement classic card games without getting sued? - <AUTHOR> Hi, I have a question. Can you (re-)implement classic card games like "uno" change the look of the deck of cards and use the same rules and host this game online without getting copy right claimed etc?
What about other games like "Rummy"?
Can you use the same images for the deck of cards like poker?
Does anyone know about if this is legal or not?
The idea would be to create an online platform where players can play against each other on a server both, mobile users and online users.
Thank you, Prince <comment><USER2> Copyright Law Does Not Protect Structure and Game Play of Card Games

[https://www.gamasutra.com/view/news/273935/Texas_court_affir...](https://www.gamasutra.com/view/news/273935/Texas_court_affirms_game_mechanics_not_protected_under_copyright_law.php)

</comment><comment><USER3> Rules are protected by copyright. You definitely cannot copy Uno, but there are many games (like Texas hold'em poker) that are not anyone's property.

See also: Scrabulous, an early Facebook game that was sued for being too similar to Scrabble.</comment>


How should I monetize my 3D printer design? - <AUTHOR> I'm 16 years old and recently finished building a 3D printer from scratch. It's not revolutionary, but is quite good for the price range. I built it for 400USD. How can I make some money or profit somehow through this? My time is limited slightly by school but that's not much if an issue. You can email me directly at firstname.lastname@example.com <comment><USER2> Just because you don't think it's revolutionary, doesn't meet it might not _sound_ revolutionary to someone else. Try getting some press from some news outlets that report "Young scientist builds new 3D printer technology in basement."

Tie this to a small online presence where you offer to print items for others (especially with sites focusing on youth education), and then you can describe yourself as a "Young scientist turned entrepreneur."

Take the articles/blog mentions about you received and get some funding from non-profits / local governments / big businesses that want to be associated with youth and entrepreneurship. Use that money to continue to work on your device and business.

Even if you don't wind up with anything revolutionary, you'll be able to write one heck of a college admissions essay, look great for future job prospects and have a pretty good business network. You could also take my advice, bundle it up into an ebook with your personal experiences and sell that too.

<comment><AUTHOR> Thanks. I was thinking about setting up a booth at our local community college's Tech Fest (a child oriented tech fair) to draw attention and poll to see who would want one.

</comment></comment><comment><USER3> Kickstarter as a project to build and produce it perhaps? You could just Kickstart it to make a working prototype and release the plans to backers instead of becoming a 3d printer manufacturer. Perhaps higher levels could be sent the necessary parts to construct their own.

</comment><comment><USER4> I suggest you create a blog then populate it with your own content and experiences. Remember to use good SEO.

Then either sell things you make with it or sell it itself.</comment>


Patreon loses lawsuit with Owen Benjamin fans - <AUTHOR> https://nationalfile.com/patreon-loses-lawsuit-with-owen-benjamin-fans-likely-to-pay-millions-in-arbitration-and-legal-fees/ <comment><USER2> > Patreon's terms included language that allowed any users of the platform to > litigate their case individually under California's JAMS arbitration scheme.

Regardless of the merits ([https://en.wikipedia.org/wiki/Owen_Benjamin#Views](https://en.wikipedia.org/wiki/Owen_Benjamin#Views)) of the comedian in question, I'm enjoying watching arbitration - intended to fuck over users - come back to bite companies in the ass.

DoorDash learned this the hard way, too. [https://www.vox.com/2020/2/12/21133486/doordash- workers-10-m...](https://www.vox.com/2020/2/12/21133486/doordash- workers-10-million-forced-arbitration-class-action-supreme-court-backfired)

> Under Judge William Alsup's order in Abernathy v. DoorDash, DoorDash must > arbitrate over 5,000 individual disputes with various workers who claim that > they were misclassified as independent contractors, when they should be > treated as employees. It also must pay a $1,900 fee for each of these > individual arbitration proceedings.

<comment><USER3> William Alsup is a name that seems to come up frequently in tech litigation, and I'm rarely disappointed with his opinions.

He was the one who learned Java in order judge to Google v. Oracle case better.

Fun fact: his middle name is Haskell.

<comment><USER4> He has been programming for decades actually [https://www.theverge.com/2017/10/19/16503076/oracle-vs- googl...](https://www.theverge.com/2017/10/19/16503076/oracle-vs-google-judge- william-alsup-interview-waymo-uber)

</comment></comment></comment><comment><USER5> I just saw this on a YouTube news clip last night. ONE YouTuber was banned form Patreon and he encouraged his followers who had been supporting him on Patreon to file a "tortious interference" lawsuit which asserts breach of contract against Patreon. In letting this go forward the judge also asserted that Patreon's change in their terms of service on January 1 _does not apply_ to complaints about actions which give rise to legal claims prior to that date.

In short: Patreon has to front $10,000 in legal fees per arbitration claim. The source of the suit is only about 100 people but if a sizable portion of the supporters of some of the larger names who have been banned from Patreon file suit as well then Patreon could be facing the requirement to put aside hundreds of millions of dollars to pre-fund arbitration cases... which could, theoretically, force them to file for bankruptcy and/or cease operation.

The above-mentioned news clip: [https://www.youtube.com/watch?v=GHzEJ6ESRY8](https://www.youtube.com/watch?v=GHzEJ6ESRY8)

</comment><comment><USER6> It's sad that Patreon is paying a price for kicking an abusive person off their platform, but forced arbitration needs to die, and I hope cases like these end the practice entirely.

<comment><USER7> Patreon would have been fine if they hadn't cancelled a comedian for having political views that they don't like. Pretty much every comedian has said things that others find offensive.

The Patreon arbitration is the beginning of the revolt against cancel culture and the censorship of conservative voices on various platforms.

<comment><USER8> When you say "political views they don't like", it sounds like he wanted more or less taxes, more or less regulation, more or less public transit.

Let's be clear, he's a holocaust denier, and that's not just an unpopular "political view".

He has every right to say it to whoever will listen, but private companies should not be forced to amplify that shit.

<comment><USER9> > he's a holocaust denier

From what little I've seen, Owen Benjamin rejects that description of himself, so I'd be interested to hear why you think he is.

Worth noting that outlets that reported him as a "holocaust denier" also claimed that he would definitely lose this lawsuit, which was clearly false. Not only did Patreon lose, but the judge went so far as to point out that the cases they cited undermined their own case.

> He has every right to say it to whoever will listen, but private companies > should not be forced to amplify that shit.

Private companies have an obligation to honor their Terms of Service, which Owen did not violate, and why he and his fans filed for arbitration in the first place.

</comment></comment></comment></comment><comment><USER10> I hope that we see more situations like this. Providers need to stop moralizing IMHO and it would be nice to see this severely affect their bottom line or even put Patreon out of business.

<comment><USER11> He's actively directing harassment of anyone who gets in his way. Deciding not to be part of that is not moralizing, it's very practical and might actually be self-defense.

</comment></comment><comment><USER12> Unrelated; this site runs ads literally between each sentence. smh

<comment><USER2> It's a grifty conspiracy theory site; the ads are its primary purpose for existing: [https://mediabiasfactcheck.com/national- file/](https://mediabiasfactcheck.com/national-file/)

</comment></comment><comment><USER13> How did their lawyers screw this up so badly?

<comment><USER14> Any site with a binding arbitration clause is vulnerable to the same sort of attack.

California shouldn't have ~ banned class action lawsuits.</comment></comment>


Ask HN: How to Raise Money for Advocacy to Get a Pro-Sanders Congress - <AUTHOR> So, I just started a 527 advocacy group and I'm sort of in the 'validation' aspect - can I get people around this, can I get donations, can I pay the bills and do this full-time.
I'm wondering what other's are doing, or have done to get campaign donations for grassroots causes like this.
There's a fire in this country behind Bernie Sander's whether you see it or not, people are fed up, and want a TRUE revolution. Getting him elected is great and all, but getting him AND a pro-bernie congress elected would be WAY better.
It's the only way we'll get corruption out of politics, my advocacy's main mission: Find and Vet candidates that are against income inequality essentially, in races where there is NO running candidate reach out to the locals to find someone who will step up and take on that role.
We plan on offering technical assistance, campaign assistance, and advice on how to get the ball rolling and compete with the incumbent who may be running. <comment><USER2> If you want to fight corruption, the best traction I've seen so far is Mayday PAC. It's not going that well. It might be helpful for you to read what they've tried and learned so far.</comment>


Why you should learn F# - <AUTHOR> https://dusted.codes/why-you-should-learn-fsharp <comment><USER2> F# is 3 big things to me:

Safer threading with immutability

Safer programming with null-safety

Safer logic with precise domain modeling

The precise domain modeling is the real paradigm shift.

The whole point of static typing is to inform the compiler about your intent so that it can provide guarantees about correctness. F# makes it easy to define lots of small types that precisely model state so that you can give more responsibility to the compiler to verify your program.

I cannot overstate how important this is to maintaining correct software overtime. If you guard your touches with non F# code, you need far fewer unit tests and probably even less runtime checks because you already know if the types are right, so is the logic. And when you need to write unit tests, the functional style makes your tests very easy to write.

I have personally struggled with domain complexity in C# that i was able to model precisely in F# and have it work perfectly on the first try.

<comment><USER3> >I have personally struggled with domain complexity in C# that i was able to model precisely in F# and have it work perfectly on the first try.

If you're willing to provide a (simplified) example I would be very interested.

<comment><USER4> We found it quite nice for properties of objects that appear over time. Think things like Order that might or might not have delivery details. In C# you are making classes with nullable delivery timestamps, delivery person, etc. And one or two properties isn't that bad but it gets a little onerous when you start to have constraints like "these four properties are either all null or all populated". In F# it is trivial to set up a new constructor for Delivery that includes all of these properties. There is no unspoken agreement about that, you can set it in the model.

<comment><USER5> Why do you struggle with this in C#, especially given that you are familiar with the F# style? I don't know C#, but in Java I'd write this as:

        public class Order {
          final Optional<DeliveryDetails> delivery;

          public Order(Optional<DeliveryDetails> delivery) {
            this.delivery = delivery;
          }
        }

        public class DeliveryDetails {
          final long deliveryTimeMs;
          ...
          public DeliveryDetails (long deliveryTimeMs,...) {
            this.deliveryTimeMs = deliveryTimeMs;
            ...
          }
        }

My IDE writes most of these lines for me. I believe C# will have similar or more succinct constrcuts.

<comment><USER6> The ide maybe will write a small part of it, but you'll have to keep reading it forever. And obviously it is modelled wrong because it is possible to have a Delivered order without delivery details, there is nothing that enforces it. Compare it with how I would write it in f#:

        type OrderId = OrderId of string
        type DeliveryTime = DeliveryTime of long
        type DeliveryDetails = { deliveryTime: DeliveryTime...}
        type Order = { id: OrderId ...}
        type DeliveredOrder = { id: OrderId, deliveryDetails: DeliveryDetails...}

Probably it is even better to define delivery time using the unit of measures and specifying it as ms. What is the difference in this way? That an order cannot ever have DeliveryDetails, while a DeliveredOrder _must_ have DeliveryDetails. As a bonus you can't just pass any string as an order id (for example a description) but you need to pass an actual order id. the same is true for the deliveryTime with the adddd advantage that you won't be able to perform operations on it with a different unit of measure. In java or c# you would kill yourself if you try to do something similar and moreover you won't have all the constraints specified here and the immutability automatically enforced.

<comment><USER7> What's the difference between this and having an Order class and a DeliveredOrder extends Order class in C#?

<comment><USER8> they said "an order cannot ever have DeliveryDetails"

so, if in a nominative subtyping situation like you suggest, a DeliveredOrder is-a Order, and so we can see that some subset of Orders CAN have DeliveryDetails. any method receiving an Order could receive a DeliveredOrder.

<comment><USER3> > any method receiving an Order could receive a DeliveredOrder.

This seems reasonable, if not outright desirable.

<comment><USER6> No, most of the time is wrong. If you have a DeliveredOrder you want to make sure that is not delivered again, so the delivery function should accept only an Order, not a DeliveredOrder. If in some different system you need a domain object that is both an Order and a DeliveredOrder than in F# you simply use an union type:

        type Order = UndeliveredOrder of UndeliveredOrder | DeliveredOrder of DeliveredOrder

And in this way you can write a function that accepts both an UndeliveredOrder and a DeliveredOrder.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> Hey folks,

Glad to see Dustin's good post get some visibility here :)

If anyone is interested in learning F#, there are some resources available:

F# docs index (has multiple guides for specific editors and a comprehensive overview of the language): [https://docs.microsoft.com/dotnet/fsharp/](https://docs.microsoft.com/dotnet/fsharp/)

F# on JavaScript with Fable: [https://fable.io/docs/](https://fable.io/docs/)

More F# in the browser with WebSharper: [https://try.websharper.com/](https://try.websharper.com/)

F# on Azure Notebooks (a hosted Jupyter notebook service that's free): [https://notebooks.azure.com/Microsoft/projects/2018-Intro- FS...](https://notebooks.azure.com/Microsoft/projects/2018-Intro- FSharp/html/Introduction%20to%20FSharp.ipynb)

And of course, the now legendary (at least among the F# community), F# for Fun and Profit: [https://fsharpforfunandprofit.com/](https://fsharpforfunandprofit.com/)

<comment><USER10> Great thing about this article is that it treats C# with respect, even as it lambasts it :) Good examples real world situations, no exaggerations. FSharp For Fun and Profit often uses straw-man implementations of C# to compare against, which I think does harm to the argument.

</comment></comment><comment><USER11> The only thing I don't like is the DI story presented here and many other F# guides. Having gone down that rabbit hole and using F# in production for 5 years now, I have gone back to classes and interfaces in almost all cases.

Functions as DI mechanism suffers from a few things. First, it's hard to search for implementations. They could be defined anywhere. With interfaces, the implementations are a hot key away. Second, functions only replace single- function interfaces. Even with a purist view of ISP, there are still plenty of occasions where a service would expect to call multiple functions on a contained service. Passing all those in as multiple parameters gets unwieldy in real world scenarios. Third, F# has no way to inject a dependency into a whole module, so you have to go function by function. Injection into classes is much easier to manage this way. Finally since none of the services or interfaces are named, they don't work with IoC containers.

The good side is that there is nothing in F# preventing you from using classes and interfaces in your design. Unsurprisingly this is my preferred way to go about it.

I kinda wish the function based DI wasn't brought up so much and so early. It's a big mental leap that I think turns off some people coming from other languages. And for limited benefit. Or negative benefit in plenty of cases.

<comment><USER12> It sounds like your (more or less) just using classes for just namespacing functions and allowing bundles of functions to get brought in?

<comment><USER13> I've definitely structured f# modules that way. The module exposes one function that "injects" the dependency into multiple other functions, and then returns them as a blob.

I'm not sure if that's "the fsharp way" (i suspect it isn't) and maybe I'll look back on it some day and cringe, but it's working pretty well for some of my (admittedly small) side projects I'm tinkering with right now.

<comment><USER11> Yes, that's what I do too. "Service" modules contain all the functions, with all dependencies explicitly passed into them, and at the bottom of the module is an interface with the dependencies assumed injected and a factory function that takes all the dependencies and returns an object with that interface.

In general I use a suave functional styled api on the top, OO-style SOA in the middle, and mostly functional style at the bottom layer, something of an FP- OOP-FP sandwich. I jokingly call it sandwich oriented programming.

</comment></comment></comment></comment><comment><USER14> I have a seasonal project that spins up around this time every year. Last year, I chose F# for a (relatively small) component of the project and I was not disappointed. I don't have access to the customer's systems, and usually with Python there's a bit of back and forth where I have to fix bugs that only customer is able to trigger. My F# program worked flawlessly the first time and has caused no complaints. I'm excited about writing more F# this year.

</comment><comment><USER15> A gripe about F# on MacOs - how to install it, count the ways - 6.

[https://fsharp.org/use/mac/](https://fsharp.org/use/mac/)

Don't I need Mono, wait, shouldn't I be using .NET? Oh I will probably install it one way, only to discover I should have installed it another.

I find the .NET and Mono differences confusing.

So this is a barrier to entry to consider.

That said, this free book is kind of nice introduction:

[https://www.oreilly.com/programming/free/analyzing- visualizi...](https://www.oreilly.com/programming/free/analyzing-visualizing- data-f-sharp.csp)

<comment><USER16> brew install fsharp or similar worked fine for me.

<comment><USER17> Did you get fsi with that? That was the one thing that made me eventually install Mono.

</comment></comment></comment><comment><USER18> I don't know F#, but I do know C#, and it feels like the author is trying to make C# look more difficult/verbose than it needs to be to make F# look better. Here is an alternative version of the "Everything is a function" section's IPasswordPolicy thing: [https://ideone.com/3Savt9](https://ideone.com/3Savt9) I even went a little overboard with the function that takes a list of functions and returns a single composed function -- I could've also written a one-off that uses "&&" like the F# version: bool isValidCustom(pw) { return f1(pw) && f2(pw) && ...; } Am I missing something? Why did the author make the C# version so complex??

<comment><USER2> Well you're right of course. But my only thought here is that Dustin's code looks like idiomatic C#, but yours does not.

You can do function composition in C# but I've virtually (heh) never seen it. Classes and Interfaces are the default abstractions in C# land even if there are other available.

</comment></comment><comment><USER19> I've been diving into f# in 2018. I came from c# world, and it really made me a better developer. Really recommend the language. Think it has a great balance between functional programming and OO if it is really needed. I really do think it's easier to write better .net programs with f# then c#. Think this article point out some great stuff.

That said, it's quite hard to actually get to use it in production at the places I've worked. My college's are scared of it (that is pretty reasonable, considering c# is a good stable language and my team is confident that what we develop will make the customers happy).

One thing that makes me hesitant to really try to get this adopted in my company is the tooling. My experience hasn't been great. It works, but it has been pretty unreliable. Some documentation was more focused on the "pre dotnet core" era of f#. I know i've been spoiled, but stuff like debugging, tooling and refactor tools can't touch Visual Studio.

There are some decent options, Jetbrains Rider and VS Code are a couple of them.

Small things, like creating a record type while typing is inconvenient.

type Customer = { Id: int; Name: string; Age : int; }

While typing an instance of the record

let c1 : Customer = {Id = 1;

gives you a bunch of compiler warnings, I know I'm not done, Compiler knows there are more properties. But without looking at the record type it's hard to see what order things are.

I'm not sure if this is just OCaml thing, but C kind of languages are better at predicting what you want to create. It's weird that with the very predictable Hindley–Milner type system it can't provide the developer with good information.

I know it's a small thing, but when working with large projects, I don't want to look everything up, I have the compiler have my back.

I'll really think Microsoft should help the Fsharp Foundation more, seeing what an amazing language f# is. But it really could use some more love from MS. Perhaps they should help the community be more confident that they can solve the business problems they run into. I hope Microsoft would say: "Hey this is how you create The Boring Line Of Business App, with all the bells and whistles you normally need". From how to deal with Dependencies in large projects (No, a couple of (amazing) conference video's of Mark Seemann do not give me enough confident that after 6 months of development it still is manageable)

Until the Tooling is done, I just keep enjoying the language and learn how to become a better developer with it.

<comment><USER20> "That said, it's quite hard to actually get to use it in production at the places I've worked. My college's are scared of it (that is pretty reasonable, considering c# is a good stable language and my team is confident that what we develop will make the customers happy)."

That's my problem too. I would like to give F# a go but at work it seems close to impossible to implement. Most people don't see the need and if there is a problem it will be blamed on F#. It's hard to win there if management doesn't fully support it.

</comment></comment><comment><USER21> I've previously used Ocaml at my last job and use Scala at my current one, it's interesting that F# (just judging from this blog post) looks more similar to Ocaml than to Scala - like they've more aggressively pulled out syntax and embraced partial application etc.

I'd always assumed F# was to C# what Scala is to Java - and I think that probably does represent their design goals, so I wonder what the different considerations were that led to them being relatively quite far apart.

<comment><USER22> F# is the evolution of ML.NET developed at Microsoft Research.

<comment><USER23> Is that right? I know they have a machine learning library called ML.NET ... but it seems weird to me that they'd recycle the name.

<comment><USER15> ML (Meta Language) vs ML (Machine Learning). It is confusing.

When I hear ML, I think the language (cause I am "old"), but it is usually the process (Machine Learning) cause that is what is hot.

[https://en.wikipedia.org/wiki/ML_%28programming_language%29](https://en.wikipedia.org/wiki/ML_%28programming_language%29)

<comment><USER23> Right - I'm pretty familiar with Ocaml so the distinction is pretty clear on my end. I'm just a bit suspicious of this one thing in the comment I replied to.

</comment></comment></comment></comment></comment><comment><USER24> "No matter if you are already a functional developer from a different community (Haskell, Clojure, Scala, etc.) or you are a complete newbie to functional programming (like I was 3 years ago) I think F# can equally impress you" -> "For this task and for the rest of this blog post I'll be comparing F# with C# in order to show some of the benefits."

F# is neat, and I see why it's useful if you have a big .NET program already, but for anyone else I don't see why I'd pick it over a more mature (and less Microsoft-centric) functional language like OCaml, SML, or Erlang.

Does F# have any unique features that other functional languages lack, or is .NET integration its killer feature?

<comment><USER9> .NET integration is probably the biggest killer feature, because that unlocks official support for most important platforms that you'll need to use. Using AWS or Azure or GCP because your business is moving stuff to a butt provider? You have access to fully-supported SDKs maintained by teams who do that stuff for a living. And so on. .NET also has a spectacular standard library, and with .NET Core, runs _very_ well in any environemnt.

But from a language standpoint, here are three unique features

* Type Providers, which let you generate types based on a data source, and tie compilation to the use of that data being correct

* Active Patterns, which are similar to Haskell's View Patterns, and let you tie some arbitrary functionality that ultimately returns an Option into a pattern for neat pattern matching

* Computation Expressions, which let you express, compose, sequence, etc. monadic and monoidal computations in a convenient syntax that's super easy for newcomers to grok. There is also an RFC and WIP implementation that expands these to support applicative constructs

There's more (Units of Measure, universal quantification via Interfaces, etc.) but these three tend to be something people like a lot.

<comment><USER25> Thanks, I completely missed to talk about type providers, active patterns and unit of measure, but then the post was already so long lol. I think I'll add other good blog posts which cover all these topics to my final notes!

</comment></comment></comment><comment><USER26> Regarding F#'s real world usage, today I came across an end-to-end F# stack, SAFE stack.[0] It looks very intriguing and I would be interested to know if anyone here has experience with it and has thoughts on it.

[0][https://safe-stack.github.io/docs/intro/](https://safe- stack.github.io/docs/intro/)

<comment><USER27> Yep, almost all of my side stuff and an ever-increasing proportion of my work stuff is in SAFE. It's actually built on Dustin's Giraffe library, which itself is built on top of Asp.Net Core. Cross platform, great ergonomics due to Giraffe, and I get to share client side/server side domain models, validations, etc due to the shared F# heritage.

</comment></comment><comment><USER28> That "famous slide" really rings true for me. F# allowed me to forget (or at least not worry about) a TON of OO design patterns. Data goes in, transformation happens, data comes out.

I do like that F# is very practical about OO though.[0] I feel that the language often strikes a balance of programming paradigms that enables me to be very productive.

[0] [https://eiriktsarpalis.wordpress.com/2017/03/20/why-oo- matte...](https://eiriktsarpalis.wordpress.com/2017/03/20/why-oo-matters- in-f/)

</comment><comment><USER29> I really wish Unity3D would relinquish control of my Visual Studio Solution files and have a much nicer path to including its libraries as a dependency manually so I could start using some of the other languages in the CLR ecosystem.

I've managed to get it to work before by very carefully searching for the DLLs in the Unity install directory and compiling my own DLLs into a Plugins folder in my Unity project, but it's very brittle. It's not obvious which set of DLLs to import (there are lots of different versions of each, for various rhyme platforms), and I upgrade new Unity versions frequently, so the location is a moving target. And Heaven help you if you want to depend on something that is only released as a script bundle in a Unity Package (like every VR SDK out there right now). And given how Unity's braindead YAML metafile system works, you're pretty sure to break your component references in your scenes and prefabs with even the most minor of rearchitecturings.

Unity having its own build pipeline is a huge impediment. It all but forces you to write custom scripts that do some of the most basic things, as if we live in the Node hellscape of Gulp/Grunt/Webpack. And none of it is documented well enough to get it right without hours of ping-pong with test runs.

</comment><comment><USER30> Now release a native F# variant with rustup/cargo like tooling and a REPL and I'm sold.

<comment><USER31> Cargo[1]. REPL[2].

[1]: [https://ardalis.com/how-to-add-a-nuget-package-using- dotnet-...](https://ardalis.com/how-to-add-a-nuget-package-using-dotnet-add) [2]: [https://docs.microsoft.com/en- us/dotnet/fsharp/tutorials/fsh...](https://docs.microsoft.com/en- us/dotnet/fsharp/tutorials/fsharp-interactive/)

<comment><USER9> Note: the REPL doesn't _quite_ work fully cross-platform with .NET Core yet. But the work is ongoing and something we're (fairly) close to releasing. When it's done, you can simply "reference a package" in a script or interactive session, and it will resolve whatever that dependency graph is and let you use it as if you were editing source code in a project in an IDE.

<comment><USER32> I care about this a lot. All my respects for the efforts in that direction.

</comment></comment></comment></comment><comment><USER33> Like I mentioned in another thread > Been learning F# the last two months. Wanted to learn Ocaml first. But F# is the sweet spot, beautiful functional syntax . Can leverage the now open .Net Ecosystem + pretty fast for doing financial stuff that I wanna do.

</comment><comment><USER34> Honest question: As someone who does web development and is looking to learn a new programming language in 2018, would you recommend F# over Elixir (and why)?

<comment><USER35> This has been previously mentioned but F# gets all of the goodies that come with being a .NET language. Elixir comes from Ruby land and thus has a framework called Phoenix(?) which also has its fans.

The big difference is that F# is a statically typed functional language, while Elixir is a dynamically typed functional language. Comparison of static vs dynamic types -> [https://hackernoon.com/statically-typed-vs-dynamically- typed...](https://hackernoon.com/statically-typed-vs-dynamically-typed- languages-e4778e1ca55)

I personally opted for F# because of the domain modelling tools and the offloading of various caveats and edge cases onto the compiler's stack rather than the meatspace stack, but Elixir has many fans for a good reason no doubt, but I'll defer to someone with more experience working with it to weigh in.

<comment><USER36> Did you mean to say Elixir comes from Ruby? Surely you mean Erlang?

<comment><USER37> I think the poster got Crystal and Elixir confused. I do sometimes tbh

</comment></comment></comment></comment><comment><USER38> Honestly I was super psyched to get into F# after finishing Dan Grossman's programming languages class, but I abandoned it pretty quickly because setup was so difficult on my Mac.

1) Multiple versions of .Net available (.Net Core, Mono...) and different tutorials and documentation would apply only to one or the other. 2) I went with .Net Core because the community seemed to have decided on that, but there is no easy way to do a cross-platform GUI in F# using .Net Core. 3) I just couldn't find find a simple tutorial taking me from beginner to intermediate using a cross-platform toolchain and development environment. I stumbled around with Visual Studio Code for a while, ran into some compatibility issues with hundreds of lines of errors messages...

I'm sure it would have been fantastic if I had had an F# person help me get set up and started, but the setup curve was too steep to be enjoyable (actually, setting up is never enjoyable. I just want to get to the good part of coding stuff!).

</comment><comment><USER39> F# seems like such an amazing language every time I look at it — a modern version of OCaml, with a clean syntax, some novel ideas, and fewer legacy warts.

However, I wish that it had, like OCaml, a native AOT compiler that didn't come with the baggage of the .NET runtime. Some people might consider this a benefit, not baggage, of course. But it's the same reason I'm put off by Scala.

From what I understand, to even run a compiled F# program you have to have Mono installed? It does look like you can get AOT compilation with Mono [1], but the limitations (e.g. no generics, apparently) seem too onerous.

[1] [https://www.mono-project.com/docs/advanced/aot/](https://www.mono- project.com/docs/advanced/aot/)

<comment><USER40> After being deeply burned by the .NET framework, I consider OCaml significantly superior to F# just because it doesn't depend on .NET or Microsoft.

And yes, somehow the OCaml guys have managed to implement generics and AOT compilation to optimized machine code long before the .NET framework existed, but now this is something "truly hard" on .NET.

<comment><USER39> My problem with OCaml that while the semantics are top notch, everything else is stuck in the past.

The syntax is quirky, there's a bunch of legacy baggage (does anyone use the OO stuff?), there's no SMP support (though I know this is being worked on), the toolchain feels antiquated (the REPL still, to this day, doesn't come with Readline support built in; rlwrap is required!), etc. Not to mention the lack of modern libraries, frameworks, package management, etc.

Reason and BuckleScript are nice, though. Reason cleans up a lot of my complaints, while still not being quite as elegant as F#. But there's this sense that nobody really wants to make any groundbreaking effort here; there doesn't seem to be any push to make Reason a first-class, new syntax for OCaml, so it's stuck being a web-oriented veener for new users, while old "industrial" users like Jane Street are content to continue with their thing.

<comment><USER41> Example of OCaml's object system in use by the creator of OCaml: [https://github.com/xavierleroy/cryptokit/blob/master/src/cry...](https://github.com/xavierleroy/cryptokit/blob/master/src/cryptokit.ml)

OCaml's object and class systems are excellent; I prefer them to just about anything else. They rarely get used for the simple reason that algebraic types, functors, and first-class modules are better suited to modeling almost any kind of domain logic.

Also, I like OCaml's extremely simple and direct syntax. I'm fine with F#'s implicit `in`, though it requires whitespace-sensitivity. I think ReasonML went in the wrong direction, cluttering it up with curly braces and ubiquitous tuple-like syntax for function arguments.

OCaml actually has excellent tooling — among the best — and some (but not many) great libraries. What it lacks most is great documentation...

<comment><USER42> >OCaml actually has excellent tooling — among the best

I don't think even the core OCaml devs would claim this. Rust (and Java and Microsoft) toolchains are examples of excellent tooling. OCaml, not so much.

That said, the tooling situation today in OCaml is much better than it was a few years ago, which is real progress.

<comment><USER41> Yes and no. OCaml already has one of the fastest production compilers in the world, acceptable error messages (better than Haskell's, anyway), a great REPL (utop), a high-quality and well-documented build system (dune), a powerful package manager (opam), and a very good language server for IDE integration (merlin).

What it's sorely missing right now is higher quality documentation output. Currently, it's hard to navigate the generated documentation (e.g., no search bar), it's not held in a centralized online location, and it doesn't do a great job dealing with complex module/functor hierarchies (especially in the presence of destructive substitution).

Unfortunately, much of what I described above doesn't come out of the box. To fix this, the OCaml community is seeking to emulate Rust's cargo tool via the development of the ocaml-platform: [http://ocamllabs.io/doc/platform.html](http://ocamllabs.io/doc/platform.html)

An aside: I didn't know Java had good tooling. I know it recently gained a good REPL. But what is the official package manager, and where is the centralized repository for packages?

<comment><USER39> I believe Maven is Java's package manager these days.

</comment></comment></comment></comment></comment></comment></comment><comment><USER43> (no/less functional) C --> Java --> C# --> Scala --> F# ---> Haskell (more/all functional) \- form a talk by Martin Odersky

<comment><USER44> Do you know which talk this is discussed? I'm interested in watch his stuff.

</comment></comment><comment><USER45> Do HN users have any F# references, books, or guides they recommend? I've always been intrigued by F# but haven't found a good project / use case for it, but I suspect that's because I need to know more about it first.

<comment><USER19> I've really enjoyed

[https://www.manning.com/books/get-programming-with-f- sharp](https://www.manning.com/books/get-programming-with-f-sharp)

Think it gives a good overview of the language and it's easy to read. Considering that after a day of working I'm not that sharp anymore it was a good read for me.

Also mentioned in the article, but Scott Wlaschin book really show the strengths of the language. Most of his stuff is great actually, but his website (FSharp for fun and profit) is not the most coherent read, I love using it as reference. I also recommend his conference talks, it has quite a bit wide range of topics.

[https://pragprog.com/book/swdddf/domain-modeling-made- functi...](https://pragprog.com/book/swdddf/domain-modeling-made-functional)

There are also few courses on pluralsight, but cannot remember which ones I really enjoyed.

<comment><USER45> > Considering that after a day of working I'm not that sharp anymore it was a > good read for me.

That's a great consideration you made, and I'm in the same boat. I'll check it out thanks!

</comment></comment></comment><comment><USER46> If you want to get paid to learn F#, my team is hiring at Jet/WalmartLabs. If you want to learn more, email me at email@example.com.

<comment><USER47> Has the culture improved since the acquisition? Last time I interviewed there I was treated like dirt.

<comment><USER46> I'm genuinely sorry that you had a bad interview experience, feel free to email me more details so that I can make sure the feedback is routed to the right people.

Over several years now, I've been very happy with the engineering quality and culture; I feel lucky to work with the people here.

</comment></comment></comment><comment><USER48> While I really like the concept of functional programming and F# is definitely on my list of practical useful languages to learn, this article is clearly written by someone who doesn't know C# very well.

Take the "To hell with interfaces" example.

      public interface ISortAlgorithm
      {
        List<int> Sort(List<int> values);
      }

      public class QuickSort : ISortAlgorithm
      {
        public List<int> Sort(List<int> values)
        {
            // Do QuickSort
            return values;
        }
      }

      public class MergeSort : ISortAlgorithm
      {
        public List<int> Sort(List<int> values)
        {
            // Do MergeSort
            return values;
        }
      }

      public void DoSomething(ISortAlgorithm sortAlgorithm,
      List<int> values)
      {
        var sorted = sortAlgorithm.Sort(values);
      }

      public void Main()
      {
        var values = new List<int> { 9, 1, 5, 7 };
        DoSomething(new QuickSort(), values);
      }

No, no, no, no, nope.

      public static class MergeSort
      {
        public static List<int> Sort(List<int> values)
        {
            // Do MergeSort
            return values;
        }
      }

      public void DoSomething(Func<List<int>, List<int>>
      sortAlgorithm, List<int> values)
      {
        var sorted = sortAlgorithm(values);
      }

      public void Main()
      {
        var values = new List<int> { 9, 1, 5, 7 };
        DoSomething(QuickSort.Sort, values);
      }

No interface necessary.

Or immutability:

      "public struct Customer
      {
        public string Name { get; }
        public string Address { get; }

        public Customer(string name, string address)
        {
            Name = name;
            Address = address;
        }
      }

So far so good, but unless someone knows C# very well one could have easily gotten this wrong."

Really?? This is beginner stuff.

I 100% agree that null sucks, functions should not need to be in classes and immutability is great, but this kind of strawman doesn't help his point.

<comment><USER25> Your sort solution limits which algorithms can be used, because you can't pass in a Func which might need an additional parameter anymore.

This is why most C# developers would use an interface for this. With an interface you add extra parameters or dependencies to the constructor of the concrete implementation. If this example wasn't sort algorithms but password hashing algorithms this would be clear.

So yeah.. it proves my point... writing good C# is not that easy, requires a lot of experience and mistakes before someone knows how to write SOLID code in C#. Thanks for helping my point!

<comment><USER2> Just to be clear, you are arguing the superiority of partial application/currying here right?

Because your F# example is the same except it's trading Func<List<int>, List<int> for (int list -> int list)

<comment><USER10> Technically its passing 'a list -> 'a list, and only becoming an int array because thats the final input value. The fsharp functions are closer to the C# functions Func<List<IComparable>, List<IComparable>>

<comment><USER2> Or to be even more pedantic it's

Func<T[], T[]> where T : IComparable<T>

But maybe all of that is just stronger arguments for F#'s inferred typing...

<comment><USER10> Or to be even mooooooore pedantic the fsharp functions would probably be written to be seq<'a> -> seq<'a>, so that would be Func<IEnumerable<T>, IEnumerable<T>> where T : IComparable<T> :)

</comment></comment></comment></comment></comment></comment><comment><USER49> There's a thread every few months about 'Why You Should Learn X', and I feel overwhelmed by it. I liked the one about Rust and got into the Rust boat. Now I have no time and energy to learn F#. That's both frustrating and debilitating. Personal Opinions.

</comment><comment><USER50> I heard F# supports this newish thing called dependent typing which allows the type checker to not only check for type correctness but logic correctness as well.

I've never worked with dependent typing but is it true? Does the F# really take away the need for all unit testing on a project?

<comment><USER51> F# does not support dependent typing. And in general, because it has to interop smoothly with .NET code written in C# and VB.NET, F# is not nearly as hardcore on functional purity as something like Haskell or Agda, and correspondingly cannot guarantee as much safety through its type system.

It is a wonderfully pragmatic language though and does guide the user towards more reliable software patterns than C# does. It sort of bridges the gap to be something you can actually use in production today, whereas the dependently typed languages are still in the realm of experimentation and toy projects for now.

</comment></comment><comment><USER52> No, if you are a functional developer from haskell, you will not be impressed by F#. Why add silly things like this to your sales pitch if F# is your first functional language, and you're still pretty new to it?

</comment><comment><USER53> There are a lot of claims about why F# is better and not much data to back them up. I'd really like to learn F#, but are there proven benefits to code quality / shipped defects / etc? For example, looking for research like: [https://quorumlanguage.com/evidence.html](https://quorumlanguage.com/evidence.html)

</comment><comment><USER54> I don't touch anything that runs on CLR or a JVM: waiting for the world to compile is unacceptable. For functional programming, I'll just continue learning ANSI common Lisp which compiles straight to machine code, thank you very much.

<comment><USER55> Any reason in particular why it's "unacceptable"?

<comment><USER54> It's slow and bloated. For someone who grew up coding intros and cracking protections in machine code on C=64 and the Amiga, such bloat simply won't fly. It's an abomination. I hate wasting my life away waiting for slow software.

<comment><USER36> If it makes you feel better, the JVM and dotnet communities agree and have been working on strategies to reduce the bloat a lot. They also offer a ton of other resources to help tune things to your liking.

I'm sure you can hand write a piece of C or Common Lisp that is very fast. But I'm sure you would also acknowledge that people that are good at JVM/Dotnet could probably write a pretty fast piece of code in them as well. So at a certain point you have to start weighing other things, like productivity, safety, tooling, libraries, etc.

I find if I really dislike something, I try learning it, and at the end I find that I may not prefer it, but I always learn something from the experience. Think of it as an exercise in sharpening your debate arguments against proponents of these platforms.

<comment><USER54> I had a semester of Java and AWT programming at the university. The professor was really good. My final project got a good grade. But after it was over, I knew I'd never touch Java again: any language where I needed to instantiate three different objects just to output a single message to the screen is crap.

Available libraries or lack thereof were never criteria by which I judge a language. Chalk that one up to competing against other coders on the scene. If someone disasembled one's intro code and found that one were using pieces of someone else's code, one instantaneously lost face and would never be able to live it down. It was plagiarism. 35 years later those same people still get derided and laughed at. It's considered extremely lame, because it means one wasn't capable of writing one's own routines. This is elitist in the extreme and those are the stakes for making it to the elite programming circle that is the scene. I'm perfectly fine with that, under the motto "it's lonely at the top". And that's as it should be. IT doesn't need more programmers producing so much bloated garbage; it needs the best programmers producing small, light and fast software that's a joy to use to its users.

So for me, having been tempered by such an elitist, competitive environment, library availability is never important. I understand that open source is different and I understand the advantage of not duplicating code, so if it's already been written and if it is good, clean code I'll use it, but I've no qualms about rolling my own.

I would never allow for library availability to influence my choice of a programming language: the language must stand on its own, including how easy it is for the system administrator to install and upgrade my application during its software managent lifecycle.

As programmers we should never make it easy or convenient for ourselves at the expense of complicating users' life or wasting their time. Never ever is that excusable.

<comment><USER51> This point of view seems to have a lot to do with programming as craft, and very little to do with programming as engineering.

Nothing wrong with that, but most developers are more concerned with the latter. Writing your own (compression routines|HTML parser|stepper motor driver|user interface controls|game engine) that's fast, cleanly designed, and bug-free is an act of craftsmanship. But if it takes a week and working around the quirks of one off the shelf takes an hour, and the resulting program meets the same requirements either way, it's the wrong engineering choice.

<comment><USER54> "But if it takes a week and working around the quirks of one off the shelf takes an hour, and the resulting program meets the same requirements either way, it's the wrong engineering choice."

(Un)fortunately, that's not how the world works: it never takes an hour to get the work done even with the off of the shelf solution, and software which gets put together this way usually ends up needing to be babysat and the long term costs to maintaining it are exorbitant. Curiously, the quality of the software ends up being extremely poor not because of using readily available components, but because of the mentality of the people springing for such solutions.

And somehow I have the impression that you and I have different defintions of "engineer": a programmer is not and never had been one. An engineer (which is what I do) gathers requirements, writes a technical specification based on those requirements, designs the software architecture which meets the specifications put forth, proceeds writing said software using scientific theories and principles (the actual process of engineering) and finally writes comprehensive documentation for that software.

</comment></comment></comment></comment></comment></comment></comment><comment><USER56> Someone I interviewed some years back did their interview in F#. I didn't know F# and tried to make that abundantly clear to them, but they persisted nonetheless. I had messed around with O'Caml back in college and so at least had a passing familiarity with functional language concepts, but I really had no idea if what the candidate produced could be considered quality production code. That didn't help their chances of getting the job.

<comment><USER57> Maybe they want to do F# in their job, in which case they successfully filtered you out. Although it might have been smarter for them to ask about F# in an earlier round, or pre interview.</comment></comment>


Facebook donates 720k medical masks, 1.5M gloves - <AUTHOR> https://www.sfchronicle.com/business/article/Facebook-donates-720-000-medical-masks-1-5-15148473.php <comment><USER2> The thing is, money is not in short supply, access to gear is. So how did they get access? Is the question.

Edit: I missed the answer due to not being able to read the full article, I withdraw the question, unfortunately, I cannot delete it.

<comment><USER3> Here's the answer to that question, from the second paragraph of the linked article:

> Facebook officials said they bought the masks for their offices' emergency > disaster kits following wildfires in California.</comment></comment>


Islamic Libertarianism in the Quran - <AUTHOR> http://darwinianconservatism.blogspot.com/2016/01/islamic-libertarianism-in-quran.html <comment><USER2> There's of course an alternative explanation for the libertarianism experienced at the start of the islamic conquests.

The first few centuries the explanation was simply : there were no muslims the vast majority of the region talked about. The islamic golden age was Christians, mostly under a fractured and declining Christian government (a theocracy in some respects even), Persians and Hindus. VERY few muslims. Therefore there is a case to be made that islam simply spread during a golden age of Christian civilization, during a golden age of the Eastern Roman Empire mostly.

In the later centuries, when the situation was already deteriorating dramatically and even then that was still true. Vast, vast majorities of non- muslims, with a small muslim elite running the government, but all economic activity in Christian/Hindu (and some cases Jewish) hands. When the regions hit a little over 10% muslim population the situation became untenable and everything collapsed, never to improve until the oil.

Even today, when you count workers, Saudi Arabia does not have a muslim- majority economy (note that they have unemployment of >70% when you discount immigrants). In fact, it may not even have a muslim-majority population, depending on what numbers you believe.

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

</comment><comment><USER3> I think the author is making a mistake by characterising all libertarian islamic thought as being 'Murjiite'. The Murjiites were a specific historical religious and political movement and we really don't know all that much about what they believed and how they put that into practice. Furthermore since a Murjiite assassinated Ali, calling modern Muslims Murjiites associates them with that act in a way that's wholly counterproductive. Other than that I enjoyed the article and found much to agree with.

<comment><USER4> Kharijite assassinated Ali.</comment></comment>


The enormous debt burden in the US will cause a recession - <AUTHOR> http://www.businessinsider.com/enormous-debt-burden-in-the-us-will-cause-a-recession-2017-8 <comment><USER2> It seems like we dodged a bullet for the most part in 07/08, though I know lots of people suffered, but it seems like it could have been far worse. But it does seem like the problems have been swept under the carpet with QE etc. When will the chickens come home to roost?</comment>


Chinese rocket Long March-5 carrier launch fails after liftoff - <AUTHOR> http://www.cnn.com/2017/07/02/asia/china-rocket-launch/index.html <comment><USER2> It's not a blow, it's natural for a rocket's first flights. Check out Ariane 5 performance in its first 14 flights and remember that last week we had Ariane 5 80 consecutive flight without an issue. It takes time to iron out rocket problems.

</comment><comment><USER3> That's a blow to their space program... but I thought Twitter was blocked in China, how come Xinhua gets to use it? And why, it's not like other middle country people can access Twitter.</comment>


Sleep Debt - <AUTHOR> http://www.howsleepworks.com/need_debt.html <comment><USER2> I tend to go to bed around 11pm each night and awake at 7am (even on the weekends as I have young kids) and I still feel like I am lacking sleep and I am often tried during the day. This I know is direct a result of my (poor) quality of sleep. I often wake up in the middle of the night and have trouble getting back to sleep. I have tried a few things to address this: sleep apnoea tests, having coffee cut off at 2pm, I run redshift on my laptop (light balancer). I don't smoke or drink and I am not over weight.

I feel I still have a ton of sleep debt from my two children. Prior to having kids I never felt tired and could have really long deep sleeps. My wife then had our first and then second daughter and its not to often I have had a night of sleep without someone waking up the family at 3am in the night. They are getting better now (3 & 7 years old), but my sleep is not recovering with them maturing in their own ability to sleep all night.

I often joke to my wife I would like to be hospitalised for two weeks and put on a large dosage of Morphine coupled with a food drip and just crash for two weeks.

I do need to get on top of this though, as it really can interfere with my work (programmer). I feel tired a lot. I work from home, and I quite often pull out the futon in my home office and crash for 30 minutes in the afternoon.

<comment><USER3> I spent a few years oncall overnight at a company with very high pager load, and my sleep seems irreparably damaged in the same way. I wake up in the night and can't get back to sleep, and I almost always wake up well before my alarm (after 6-7 hours), even though I still feel tired and remain tired through the day.

I think there's something here, but I haven't figured out what or how to fix it.

Things I've found that have helped:

A thorough eyemask and good earplugs reduce the awakenings and help me sleep in a bit longer.

An air conditioner that runs into the morning to keep it cool - I think the air temperature warming after the sun comes up starts to trigger wakefulness?

Cutting out sugar and caffeine after 6pm, which helps getting to sleep a little.

<comment><USER4> Any recommendations on an air conditioner that would work when it's below freezing outside, but too hot inside?

<comment><USER5> If you don't have control over the heating being on, a cracked window goes a long way. My (very, very dated) dorm my freshman year ran the heat 24/7, often up to 85 degrees. Cracking a window kept it a pleasant 72 degrees. Wasteful? Absolutely. But worked with the constraints given.

<comment><USER4> Sadly it's hard to get a precise temperature this way when it's 30F oitside. Waking up cold isn't much better than waking up hot.

<comment><USER6> This is _Hacker_ News though. A thermostatically controlled actuator, or similar, will fix that up.

<comment><USER4> Yes, but I also value my time.

It's a possible project, but you would need to not only have something that opened and closed, you would need a fan system to drive the air, and you would need to have it be thermally insulated when closed, and unless you have a very conservative cooling algorithm you would probably want a heating system to deal with the room getting too cold because the room itself is not thermally sealed.

It ends up being a DIY air conditioner/heater, which I'd rather just buy.

<comment><USER7> I think you're thinking a little too big. All I think that is really being suggested is an automatic window cracker/closer.

If the goal is just to maintain a temperature I don't think you need to go to most of the lengths you mentioned. You have a window that is currently adequately insulated when shut. This is intended for maintenance so no need for a fan to speed things up. However the room is getting too hot now will suffice to heat it back up if needed, but again being slow means it shouldn't overshoot badly either.

It still may not be worth your time, but if just cracking a window would be sufficient cooling for most of the year it could be.

<comment><USER8> A moment's thought leads me to think you could use something like this: (temp- controlled plug bar, basically) [http://www.homebrewtalk.com/showthread.php?t=536763](http://www.homebrewtalk.com/showthread.php?t=536763) Attached to a motor /servo (depending on your window) that will turn on or off at a given temperature. Have a switch on the window which cuts off/enables the power when the window is open or closed at the desired max/min.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> The amount of highlighted words in the article irks me. Why not only highlight a word when it's first introduced?

</comment><comment><USER10> That accident density distribution chart needs to be normalized for road traffic and perhaps normalized for drunk/buzzed driving if we are to use it to say anything about sleep deprivation influence on accidents.

<comment><USER11> I'm pretty sure it's normalized in some way already. Traffic sure ain't several times more intensive during the night [1]. Having said that, they sorely need some proper units on that Y axis.

[1] Obligatory Australia joke: Maybe it's because they have night and day swapped? Oh wait, that was summer and winter.</comment></comment>