Web devel backend project

Have a project in mind to try to learn Golang then a friend a mind floated the idea of Haskell. Recently got into it and says that's great and now I'm intrested. Which should I learn first? Golang or Haskell? Not only for web development, but in general use cases

Attached: 1551900758620.jpg (550x850, 125K)

Other urls found in this thread:

github.com/bakape/meguca
youtube.com/watch?v=DM2hEBwEWPc
cs.cornell.edu/courses/cs3110/2018fa/schedule.html
reasonml.github.io/
twitter.com/SFWRedditVideos

golang, for sure

Neither.

I want to FUCK that robot.

Haskell

>posting the inferior /co/-miku
As for your question, I'd say that everything but prolog is fine for serving webpages.

Attached: 125356_p0.jpg (600x827, 79K)

I'd say web backend stuff is golang for sure.
Other than that, Haskell is pretty neat and I would certainly recommend learning it. Your friend probably is in the stage where it's a new thing and everything about it is great.

Golang, is really nice for backend stuff.

I would learn elixir instead of Haskel for backend servers.

Piggybacking here
I wanted to make a chan backend like vichan, tinychan, etc, in golang
What would I need to know?

Thanks Miku

basic frontend stuff:
html css wasm
basic backend stuff:
authentication, a simple framework (I use rust's Rocket) , database handling (I guess a nosql thing would be ok) and some way to efficiently store, retrieve and cleanup images.

goodluck user, don't let people stop you

Thanks I'll get started on learning those subjects

Use a real SQL database, noSQL is soiboi shit

haskell with yesod for backend, elm or purescript for frontend.

github.com/bakape/meguca great place to start

> Build dependencies
> Go >=1.11 (for building server)
> Node.js >=5.0 (for building client)
*rolls eyes*

You got a better idea then, shitty?

>golang
Golang is probably the easiest language there is to learn, you can just get Kernighan's book either on libgen.io or buy it and learn it in one weekend.
However it is a pile of boilerplate. This means a ton of very tedious error handling however for just 'web backend' it's probably all you need, and libraries exist for everything like authentication, dbms plugins, tons of network libraries for manipulating responses and shit. If you go this route you will have to do a lot of testing to make sure your shit isn't going to explode from security problems.
>haskell
Haskell is a purely functional language, so will be extreme of the extreme tedious to do any kind of I/O, which is exaclty what a web backend will be doing, depending on whatever idea you have. However piles of testing and error handling are not needed because if it compiles, it will likely run without error you just need to identify the corner cases where lazy eval could fuck up business logic (not program logic). Depending on what you are doing, you can do more rapid prototyping ie: MVPs (min viable product) in Haskell because it's functional. It is also much easier to break up a program into little parallel processes using Haskell.

Personally what I do is write the entire user facing end in OCaml using bucklescript (reasonML) which compiles to pajeet script. The server side, or your API that faces the network and powers the client end, is then simple to implement because that can all be done in OCaml too so write once, deploy everywhere. What makes this better than the above Golang/Haskell solution is the wacky abstractions you can in ML family languages to allow rapid prototyping, specifically the modules. In most languages, libraries are treated just as 'import this code'. In ML style languages it's completely different so as a single developer you can create some pretty gigantic things by yourself, and they're guaranteed to work if it compiles

Attached: hqdefault.jpg (480x360, 9K)

php

Monads give you a nice way to work with IO, monad transformers allow you to save a lot of boilerplate, also separating the IO from pure functions makes testing extremely easy.

what is Ocaml used for? the things you are describing is really interesting and could be usefull for me, I want to read more on this, can you please direct me somewhere to read about what you do

Since I'm here shilling away, I will recommend you look at Discord Chat's github, because there's some interesting golang stuff in there like how they have a service that automatically compresses images and shit that are uploaded by users in chat. Hugo is also a good project to look at, it generates static html so you don't have to use AIDS ridden Node.js which will require constant maint and updating if you go the Node.js route.
There is plenty of 'dynamic' hacks you can do to make a static site look and act dynamic and the massive drop in complexity will be a godsend for adding features to whatever you're doing.

However you should also give this talk a view sometime, since it can apply basically to any language youtube.com/watch?v=DM2hEBwEWPc though it focuses on ML (OCaml) the advice works for anything, like how to make errors more visible without writing boilerplate (proper use of exception handling). How to write interfaces, and why you should always write interfaces. How to make illegal states impossible to happen, and most importantly how to write stuff so somebody can read it, including yourself many years later when you've totally forgotten what you did or why.

For Haskell/functional languages, you should look at pattern matching and use it for everything once you learn it's superpowers. There's a book floating around called Purely Functional Data Structures. If you try to implement any of those data structures without pattern matching and immutable variables it will be extremely difficult. However with those features, it's dead, dead simple to write a highly complex tree structure that self balances and how you can optimize said structures to be O(1) access, all of which would be impossible if trying this in Golang. So tl;dr if using Haskell, look into this book to see it's true power.

Attached: shilling.png (220x220, 96K)

OCaml is just an implemention of ML, there's many ML implementations. I use it for everything but you could also use Haskell for everything if you wanted including generating static html or compiling to javascript. I learned from CS 3110 and by reading 'Real World OCaml' the new development version cs.cornell.edu/courses/cs3110/2018fa/schedule.html

This is 'reasonML' it's just new syntax on top of the OCaml compiler with some extra libraries reasonml.github.io/

>elixir
Although Erlang/Elixir (and Phoenix webserver) is pretty awesome the only problem with going this route is if something goes wrong, you are now digging into highly complex C libraries and some are a total mess. If you write your backend from the ground up instead, you'll know exactly what you need to do to fix anything that goes wrong but if you're not trying to recreate WhatsApp you can build pretty robust software in Elixir/Erlang that can handle a million connections on a single FreeBSD box instead of being hosed by Jeff Bezos or other cloud providers like Heroku or Digital Ocean that just want to fleece you of money when a $40/mth colocated box can do what would cost $20k/mth in AWS

Haskell and elm for frontend