Live data from Hacker News

Re: Moving from PHP to Go and Back Again

blog.breakthru.solutions

231–240 of 281 posts

Re: Re: Moving from PHP to Go and Back Again

#231

Earlier quoted context omitted.

> So once you add a load balancer and several PHP servers, you need to use a network mount for most of your files, which has a big impact on IO performance. That depends if you set up cachefilesd correctly. Many people think it's enough to do the NFS mount and that's it, but it's not - NFS's mount parameters have a big impact on performance, and having cachefilesd enabled can make performance go through the roof, esp…

I’ve given up on NFS entirely and just use one of the big 3 cloud file storage services. Out of 8 downtime events, 5 were related to NFS mounts.

Hmm. I don't trust any external CDN, to be honest. No matter which one you choose, you lock yourself dead into the vendor - should it decide to kick you off for whatever reason you're toast, but especially I'm afraid of doing a tiny mistake in AWS leading to accidental disclosure of private data.

Such "hacks" have hit too many too big firms for me.

Out of interest, what issues have you had with NFS mounts? I run a fleet of virtual servers with their disks on an NFS-mounted NAS share and backed by cachefilesd, never had a problem with that setup.

Re: Re: Moving from PHP to Go and Back Again

#233
post #81

Earlier quoted context omitted.

Completely false, there are several research OSes with kernel level GC. I suggest reading Project Oberon source code, it’s freely available.

I can't speak for the parent but he did say "cannot really". I would assume due to that he's aware you can write a research project in it. At one point, I thought Windows was to move to .Net even and MS backed out in the end. Back to Go, for anyone else reading this thread and wondering what Rob Pike thinks it is, evidence of them removing "systems programming" off their website is here. He explicitly states that he…

> I thought Windows was to move to .Net even and MS backed out in the end.

If you bother to read Joe Duffy's postmortems, and talks he has made about Midori, you will get it had nothing to do with technical issues, rather internal political wars at Microsoft.

Also Microsoft did not fully backed out, the outcome of Singularity became the MDIL compiler for .NET on Windows 8.x.

Midori influenced async/await, TPL, .NET Native used in UWP and the new low level language features on C# 7.x.

> If the creator of a language says it's not a systems programming language, I'm not sure how it can be argued by outsiders that it is.

I don't have Go in much high regard, but it certainly can be used for systems programming, and is being used as such today, regardless of what the anti-GC systems language crowd thinks.

"G.E.R.T : Golang Embedded Run-Time"

https://github.com/ycoroneos/G.E.R.T

"Fuchsia TCP/IP stack", all network requests go through it.

https://groups.google.com/d/msg/golang-dev/2xuYHcP0Fdc/tKb1P...

https://fuchsia.googlesource.com/netstack/

"Fuchsia disk management utilities for file systems"

https://fuchsia.googlesource.com/thinfs/

Re: Re: Moving from PHP to Go and Back Again

#234

Earlier quoted context omitted.

How is restarting a go-based server harder than restarting a PHP-based server?

You'll need the go process to complete all ongoing requests before restarting it. Whether that be RPC, HTTP, WS, etc. And this is behind a load balancer, so did you just go offline, or are you doing this one at a time? With PHP, you don't have to restart php-fpm or modapache. Just git-pull or FTP the new files in and the next HTTP request will automatically user the new version. Zero downtime. Honestly though, I expe…

How do you deal with changes to multiple files at the same time? What if a subset of users see updated file A but not file B?

You don't have such things in other languages simply because they have not been initially created as glorified templating engines. More importantly: for example, Django in debugging mode allows you to swap templates on the fly, so is with the executable code. Except nobody does it because that's considered ridiculous.

Re: Re: Moving from PHP to Go and Back Again

#235

Perhaps it's characteristic of all language discussions, but Go articles seem to generate an extremely polarized set of comments. My other favored languages (Common Lisp, Nim, Rust, Smalltalk) tend to do the same thing, but in Go's case the passion seems so... misguided. In my opinion, Go is just such a bland-in-a-good-way language. And I enjoy writing it, for the record. Came back to it after a while not writing it…

When "bland" means "prone to copy-paste boilerplate", its starts to sound less relaxing. It sounds more like tedious search-replace and looking for not making a typo when adapting the boilerplate to the next similar-but-sightly-different use case. It turns a developer back into a coder.

What Go takes away is mostly tools of abstraction. Some of them are removed for a reasonably good reason (hard to implement in 1.x). Well, people end up with codegen tools that replace not only templates and generics but also the C preprocessor.

Re: Re: Moving from PHP to Go and Back Again

#236
post #80

Earlier quoted context omitted.

Since Xerox PARC, UK Royal Navy, DEC, HP Labs, ETHZ, Microsoft Research have implemented full stack OSes in GC enabled systems programming languages. At ETHZ Oberon workstations were used during a couple of years by several users across the department. Most of those attempts failed due to losing the political and financial wars of bringing them into the wider market, not because of lack of features.

> At ETHZ Oberon workstations were used during a couple of years by several users across the department. The way you say that, it sounds pretty unimpressive. Say, 2 years and 10 users, plus or minus one order of magnitude. That's not enough to tell anything. Was it going to be portable to other hardware? Was it going to be maintainable? Was it going to be comparable in performance? The answers are all "no data". The…

Native Oberon was the very first version, then there was EthOS, and Oberon System 3 with the graphical Gadgets framework.

In the meantime a new version of Oberon was re-done with Oberon-2, whose method declarations influenced how Go method declarations are done.

By this time there was a spin into a Swiss startup that designed Component Pascal, an Oberon-2 derivative, with a RAD development environment targeted mostly at Mac OS and Windows users.

The researchers at ETHZ created Blue Bottle OS, also known as A2, using Active Oberon. Yet another Oberon evolution, that had support for co-routines in async/await style, and probably one of the first environments with a multi-threaded compiler.

It was good enough to support applications like video playing, BeOS wasn't the only one doing it in the mid-90's.

If you want pictures, there are plenty of them here,

https://goo.gl/Rce7A2

Oberon was used until early 2000s to teach systems programming at ETHZ, and many department computers used them as their main workstations.

Including file servers implemented in Oberon for distributing work across workstations, and an early version of applets concept called Juice.

ftp://ftp.cis.upenn.edu/pub/cis700/public_html/papers/Franz97b.pdf

Graz University had their own variant of Oberon, with Hanspeter Mössenböck leading some of the development efforts. This same department is nowadays heavily involved with Graal research together with Oracle Labs.

http://www.ssw.uni-linz.ac.at/General/Staff/HM/Publications/...

http://ssw.jku.at/Research/Projects/JVM/Graal.html

The Ulm university in Germany also implemented their own Oberon variant, including native versions running on top of several UNIXes and Windows.

Mostly broken links nowadays,

http://www.mathematik.uni-ulm.de/oberon/ulm.html

Niklaus Wirth later in 2013 redid the original Project Oberon, with an updated variant named Oberon-07 and targeting an FPGA instead.

http://www.projectoberon.com/

So no, I am not idolizing a past and there was a little more there than just a plain text editor.

Sometimes the Wikipedia is not the best source.

Re: Re: Moving from PHP to Go and Back Again

#237
post #22

Go is not OOP in any shape or form, no matter what “they” try to tell you. Go is imperative language with procedural style of writing code. Yes, you have objects and you can attach methods to them, similarly to Ruby where everything is an object, but that’s basically it. Never, ever, try to repeat yourself in Go. You will crash and burn. When it comes to Go, spaghetti code is what you want to write. This was really f…

If I had to point at one thing Go did exactly right, I'd choose the "OOP" bit. Inheritance is an anti-pattern. Interfaces is the way to go.

Maybe the only thing I'd add is a compiler warning when an object which does not declare itself as interface X but complies to it is used as interface X. (Typeclasses would be even better, but it opens the can of worms which is the support of generics.)

Re: Re: Moving from PHP to Go and Back Again

#238
post #190

Some background. I actually wrote a semi-popular book on PHP (published by a major publisher) and have contributed to the core project. And I have spoken at many PHP conferences. Perhaps tellingly, PHP is rarely my first choice anymore. Which I think it a great language (contrary to many opinions) I just find other languages a better choice. Today my language usage looks like this: - Web services / APIs: Node.js [1]…

in latest nodejs there is no a single place to catch exceptions in promise chain, which is very inconvenient.

That doesn't make sense. That's one of the purposes of promises. The only escape hatch is to throw asynchronously which you just don't do.

Re: Re: Moving from PHP to Go and Back Again

#239
post #127

I know this is about the weakest critique possible, but currently using Go, I know my next project won't be in it, simply for the impossibility to put an opening curly brace on its own line. Other languages that don't require semicolons at the end of a line have it, and even if they didn't, I'd rather have to put semicolons manually.. Go is "opinionated" I guess, but so am I. Whatever their target audience is, I'm no…

This is brilliant satire because I can’t tell if it is truly satire or if it’s not.

Leaning towards “satire” based on your last sentence.

Let us all know if I was right.

Re: Re: Moving from PHP to Go and Back Again

#240
post #233

Earlier quoted context omitted.

I can't speak for the parent but he did say "cannot really". I would assume due to that he's aware you can write a research project in it. At one point, I thought Windows was to move to .Net even and MS backed out in the end. Back to Go, for anyone else reading this thread and wondering what Rob Pike thinks it is, evidence of them removing "systems programming" off their website is here. He explicitly states that he…

> I thought Windows was to move to .Net even and MS backed out in the end. If you bother to read Joe Duffy's postmortems, and talks he has made about Midori, you will get it had nothing to do with technical issues, rather internal political wars at Microsoft. Also Microsoft did not fully backed out, the outcome of Singularity became the MDIL compiler for .NET on Windows 8.x. Midori influenced async/await, TPL, .NET N…

In that case it sounds like you have a bone to pick with Rob Pike over Go. I suppose you can find him on Twitter if you want to settle your feud. I'd suggest to not bother when I have him on tape contradicting you.

I did read Joe's blog, years ago. Your takeaway there also leaves you with a bone to pick with Microsoft, if it's just politics then you should be able to find someone in management at Microsoft to set straight. It'd be a real shame if there were no performance issues and it was shutdown due to politics alone.

Post reply on HN