by _ph_ · 10y ago · 0 comments
Go it easy to learn, as its a moderately sized language, but it has just enough abstractions, that your programs are not held back by the lack of those, without opening the traps too "powerful" languages bring with themselves, namely complexety.
On top of all, the whole infrastructure is very well thought out and a pleasure to use. A very fast compiler which produces static executables, a good module system without header files, a rich standard library, many things. There are quite a few quirks, especially for the beginner, but the more I gain insight, the more I agree with the choices made - with some I don't, but the agree to disagree ratio is surprisingly high. And most of them don't get into the way of writing good programs, which is what counts.
Wirth's work also includes languages with GC. :)
Check Active Oberon:
http://www.ocp.inf.ethz.ch/wiki/Documentation/Language
Component Pascal is a Oberon-2 derivative but Wirth hasn't collaborated much there:
http://www.oberon.ch/blackbox.html
They made the very last version available for free. It was a kind of Delphi like, with the Oberon ideas of full stack OS.
www.pas.rochester.edu/~skulski/Presentations/BB_Class.pdf
> It brings back the virtues of the Wirth computer language family back into modern times, as with strict type checking and the module system.
Strict type checking? Have you used any other languages besides C? Go's type system is a joke.
Like literally, it's a joke. If you get a bunch of people who know about types languages in a room discussing types, "What about Go?" is guaranteed to get a laugh.
Go is a much bigger problem in our industry than the tone of my post.
> I have never claimed that Go has the most advanced type system.
You claimed it had "strict type checking", when it has the least strict type system of any statically-typed language in common usage except C.
> But indeed, compared to C/C++ which still are the most commonly used languages in industry, it has a strict type system.
With template types, you can definitely get more strict type-checking out of C++ than out of Go.
So basically, Go has a more modern type system than C. And that's arguably not true. None of which disproves what I said: I said, "people who like Go only like it because they have no idea what has happened in programming languages for the last few decades."
> And it gets work done.
You can make that claim about any language. The question is, does it get work done as efficiently as other languages? And the answer is pretty clearly no.
In other languages you can compose errors just as regular values, which allows you to handle the errors at the place where you have all the information to deal with it.
Not only that, the types represent the structure of the computation you ran.
For example, your type is Future[Option[List[Person]]] and just by looking at the return types of the things you called, you can tell exactly _where_ an issue occurred and how to handle it:
Your value is a Success(None)? -> The method inside your asynchronous computation that returned Option[List] failed!
Just to note, Future[Option[List[Person]]] is not some made-up example, it could be a real-world query against the database–for instance "do we know the friends of user X"?
- Future – we run it async
- Option – we might not know it
- List – his friends
This let's us very neatly tell apart things like - Failure – "the database response from the database timed out"
- Success(None) – "we have no idea about user X' friends"
- Success(Some(Nil)) – "X has no friends"
- Success(Some(List(...))) – "here are X' friends"
(And the compiler will make sure that you handle all possibilities)In Go the closest pattern would likely be to extract the string from the error value and compare it to error strings you recognize. An alternative would be to define a special single-purpose data type specially for each type including all combinators, as Go would not be able to express any commonality between Future[Option[List[Person]]] and Future[Option[List[Pet]]]. You would need to define 4 new data types and all operations anew.
And of course, there is always the question of the environment. The Go universe has tons of libraries, actively developed.
Static executables by default is something that Go is famously good at, but I'm pretty sure Haskell can do this as well without so much pain and with a type system many times stronger than Go's.
Not really, multi-paradigm.
> and at least Go has reflection.
Go is introspective.
Lisp has both introspection (e.g. find-class allows to look at existing classes) and intercession (e.g. ensure-class creates/modifies a class at runtime).
Yeah, that's probably a better way to describe it; it certainly ain't Haskell. But Go really doesn't want you even to use things like map and filter.