Go

>no generics

>no higher-order functions (map, fold etc.)

Wtf was Google thinking?

Other urls found in this thread:

youtube.com/watch?v=rFejpH_tAHM&t=797s
en.wikipedia.org/wiki/Renée_French
blog.golang.org/generate
twitter.com/SFWRedditGifs

>Wtf was Google thinking?
Go was meant to be simple so that retards can write in Go so Google can spend less time, effort and money tutoring interns.

It's literally a dumbed down C for pajeets and CS grad retards who don't know how to code.
The fact that it allows pointers but no pointer arithmetic should make that very clear.

>The fact that it allows pointers but no pointer arithmetic should make that very clear.
Wait are you serious? What the fuck?

>>no higher-order functions (map, fold etc.)

Oddly specific criticism of a programming language.

Perfect for all the CS cucks!
Now CS is even easier than a humanities degree!

>Now CS is even easier than a humanities degree

True, unless you minor in math.

I think it makes perfect sense for large companies to use languages like Go. You want your employees to be as fungible as possible, and to do that you need to prevent people from writing clever code.
For small companies is the exact opposite: you want to exploit your programmer time to the fullest, being as fast and clever as you can. The goal there is not to produce maintainable software, but to produce something that just works and then get acquired.

But generics is easy and has existed since the 1970s.

this, it's even simpler than fullblown OOP/ as easy as interfaces

>>no generics
make your own template engine, its not hard, no one will use it because its not needed

>>no higher-order functions (map, fold etc.)
Go has high order functions which you can pass to methods and a range keyword that will iterate though arrays and slices, having an actual function called map and fold is just unnecessary syntactic sugar

>not needed
>unnecessary

Might as well program in assembly because all the modern tools languages provided just aren't necessary or needed and if you ever do need it implement it yourself :^)

>no higher-order functions

but at least functions are first class objects - that's actually handsome.

You are Google-tier material, my dude.

:)

made by old fucks for junior brainlets, what would we expect?

I seen probably hundreds of thousand lines of corporate Java and much of it was pure suck. I've seen people citing design patterns writing Java interface coupling model and frontend methods (when I saw this I rejected the offer).

Go can suck to. But the sucker will probably suck less, because from day one they are forced to gofmt and to check errors and to write small interfaces.

If you ask me. If you are not able to expel the weak shitty programmers from entering the tech job market - then at least tie their fucking hands and prevent them from doing to much damage.

Actually a smart move that I welcome, because I am also shitty programmer - who is still working to become better.

>REEEEEEE IT'S NOT C SO I CAN'T LIKE IT
>Sup Forums

C doesn't have either of those things, retard

>>no higher-order functions (map, fold etc.)

Actually, you can write them yourself, Go has first class functions.

...Oh wait, no generics. I hope you like specializing map and fold for every type.

C has macros, which at least lets you emulate generics to some degree.

You can have preprocessor macros in every language.

Luckily they thought ahead about this and added a super high tech built in syntax construct that allows you to iterate over a collection while bringing in outside scope in the enclosing block so you can supply your own accumulator values and other needed state without the need to lean on rudimentary and overly-specific FP utility functions.

But if that's too ivory tower for you, you can head back to LISP garbage.

>using a compile time feature to replicate a runtime feature

generics aren't a runtime feature

*rewrite
Go is this "typescript incarnate" where some retard comes up with a language Y that is basically language X but using other terms and syntax.

So now you have this hype ass new language which is again just language X sugarcoated. So what do you do? Of course, you start rewriting your entire codebase into language Y.

Fast forward a year, oh boy, it's language Z which is again just language X double coated.

>"typescript incarnate"

If you're going to make that comparison at least use something that fits what you're describing, like coffeescript. Adding a static type system to javascript isn't syntactical polish and it serves a practical need.

ah it is coffeescript indeed. sorry, I meant that one.

(but there was some other language on top of CoffeeScript IIRC, or between CS/JS...can't recall though sadly.)

I think the same is true of Pascal, but Pascal at least has some redeeming qualities.

You mean like cmp and jmp in assembly? Sounds useful.

Why bother writing something stateless like 3*(x+5) - 2 instead of something stateful like
mov edi, dword ptr [rbp - 4]
add edi, 5
imul edi, edi, 3
sub edi, 3
mov dword ptr [rbp - 8], edi

C doesn't have those either, but they are trivial to implement.

To pass by reference?

Golang was designed around being fast, easy to write, and very scalable.
Which it accomplishes pretty well. People just say "It I wanted concurrency I'd use scala!" which, sure, Scala is probably more robust, but nobody knows Scala. Go is about as easy to read as well-written Python. You can just sit down and start writing it.

ITT: samefag

Go just makes bad programmers feel inadequate.

Parametric polymorphism is not a "runtime feature".
Do you even know what catamorphisms and homomorphisms are??? Jesus...

>go
>requiring the semblance of skill
it's pretty much on the level of python

DUDE GENERICS LMAO

Python is _much_ more expressive than Go will ever be. It lets you write things as generic as the Y-combinors, while Go can't even implement a generic map.

Yeah... enjoy your stateful, unsafe, unsound, difficult to optimize and parallelize, shitty piece of code.

Yeah who needs to write programs when you can just spend most of your time fighting the language? C++ is the best.

the real world is stateful
stay in your functional safe space

This. Who needs "generics" when you have ANSI C and M4?

what are the uses of pointer arithmetic anyway

Numbers don't exists in the "real world" either, that didn't stop us to create such an useful abstraction. The concept of "state" can be encoded with monads, letting us manipulate them in a safe and pure way.

Looking cool.

So do you think of (x+y)/(z+1) as:
tmp1 = x + y
tmp2 = z + 1
tmp3 = tmp1/tmp2
return tmp3
?

Wouldn't it be great, if you could avoid naming intermediate state, and not bother with the intermediate steps so that your program fit in a single line?

Then use a language that does include every dubious feature including the kitchen sink, you moaning retard.

>m-muh extremely specific feature requirements that have little use outside of my mental masturbation
You're a proper fucking spastic if you think you can't write Y-combinators in Go. You've never tried though because (a) you've never used Go and (b) Y-combinators have no use whatsoever.

It allows for the compact expression of some things, often allowing you to do away with an index variable.

e.g. say you're writing an image file in C.
*buf++ = r * 0xFF;
*buf++ = g * 0xFF;
*buf++ = b * 0xFF;
*buf++ = a * 0xFF;


Doesn't that look pro?

Pointer arithmetic let you create highly efficient data types, although formal verification can be undecidable.

i think of it as
x y + z 1 + /

>(a) you've never used Go
LOL? Good luck trying to implement a sound polyvariadic Y combinator in your shitty language.
>(b) Y-combinators have no use whatsoever.
The fix-point combinator is actually extremely useful, specially when you write in pointfree style. Otherwise why do you think that good programming languages implement the "fix" function? because computer scientists are stupid? hahaha!

dude esoteric haskeller bullshit lmao

>> *buf++
This is undefined behaviour afaik.

*buf++ is far worse than just buf[0]. Use the syntax they gave you, my man. This shit is bonkers.

so this is the power of people crying over lack of generics...

You can't expect armchair language theorists to actually produce something useful

>jumping to one video
>on purpose mis interpreting the video
10 cents has been deposited into your account

>no generics
what is interface
>no higher order functions
does he need to spoon feed you fucking everything ?
youtube.com/watch?v=rFejpH_tAHM&t=797s

also slow as fuck

>needing this kind of shit
people like you is why software is shit these days

faster than hasklel

(You)

designing a language that doesn't take me 5 days to understand.
There is a reason functional language's are extremely rarely used in actual production.

scheme is simple as shit

it takes less than 5 days to make your own shitty scheme interpreter

Retards writing in a language without these sorts of higher-level features is bound to lead to pajeet-level software.

That's why D is the future. Python-level ease by default, with the option to turn it all off and go unsafe.

>dead language is the future

C# has those. And it's pajeet-level.

>Rob Pike chose a stupid looking cartoon that any kid could draw to represent his new language
Literally code monkey tier.

the Go mascot was designed by Rob Pike's wife Renee French who is a professional childrens book illustrator
en.wikipedia.org/wiki/Renée_French

He actually uses the mascot as an example in the posted video of how simple things can be very expressive.

I thought Google only hires people who already know how to program.

It's one thing to shit out some quick code that "works" and another to write robust maintainable programs.

Go would have disapeared by now, another forgotten meme language. .. except for one thing: Docker is written on Go.

You can do anything with sed/awk if you care enough.

Like return ((x + y) / (z + 1))?

>buf[0]
>brainlets that can't C
That code increments what buf points to after each assignment. Shit like this is what makes C great.

They wanted to create a language with the CSP pattern for java codemonkeys.

And they succeed.

Go is not has pretty has Haskell, Clojure, Elixir or Scala but it get's the job done and is easy to get into if you come from OOP languages.

>haskell
>beautiful
you date fat obese chicks don't you

See, you preferred the option that had no local state or intermediate variables! So why not be consistent, and eliminate index variables in the cases of map/filter/fold?

When you have maps and folds that can operate on iterators/generators/sequences, C-style for loops are very rarely necessary, even in languages that were originally built around them like C# where people often just use Linq instead.

Introduce lots of bugs into your software. Not even static analysis tools can catch all them

she is not that fat...

I once looked up the discussion about map/fold on the official golang mailing list (because of course they use a mailing list).

One of the maintainers literally and unironically made the argument that "what, are the kids of today too lazy to write a foreach loop?".

> comp sci majors
> know how to program

why won't this meme die

They usually know how to program.

Keep in mind not every place in the world is an US diploma mill.

>foreach loop
Are they?

Yeah, docker is big, huge. It's all over the server world.

Post sample code.

What the fuck are generics.

C++ templates

Buzzword, please tell me what it does.

>The fact that it allows pointers but no pointer arithmetic should make that very clear.
The "unsafe" package allows for it, cgo allows for it.

Haskell is beautiful, no denial.

Go has a code generation tool that can accomplish the same.
blog.golang.org/generate

In Go they're called "interfaces" and they're easier to work with.

Python example:
def foo(x):
return ("pair", x,x)


This function will work in the same way for values of EVERY type you feed into it, whether they are integers, lists, strings, or whatever you want to feed into it. In python's case this is because of dynamic typing. Statically typed language can also do this, but to do that they need generics. In that case, you would write something like:

fn foo(x : AType) -> (str,AType,AType) {
return ("pair",x,x);
}


Go lets you do this only in some very specific cases. You can't write a function that does the same thing as this one-liner Python function:

def map_fun(fun,val_list):
return [foo(val) for val in val_list]

>implying I can't do this in C with unions

Typo in last function, should be:
def map_fun(fun,val_list):
return [fun(val) for val in val_list]

Unions in C are completely orthogonal to generics. And no, you can't implement either of the two functions lists here with just unions, if you want it to work on any possible type you feed into it. You need some way to generate a function for each type you feed into it, with no performance penalty compared to creating a separate function with that specific type as input.

You can implement similar functionality in C with some workarounds that don't exist in Go however, though typically you pay a cost in performance that you wouldn't have paid in C++ or Rust.

>what is interface
Not a compile time feature.

>>no higher-order functions (map, fold etc.)
wat? So there's no function pointers or lambdas?

>muh nerics

there's both; he's a mongoloid