News for hackers. Stuff that matters.

What is the best typed language for back end web development?

After programming the backend for my current project in a non-typed language I never want to go that route again.

I think actually that the frontend project with all of its thousand of files and components is easier to handle just because typescript helps me so much.

( 15 comments | 7 points | on HN )
Re:What is the best typed language for back end web developm... by fgonzag on Thursday September 23, 2021 @12:27PM (#28631411)
Unpopular opinion but... most of them are more than good enough. .net with C#, java (though I'd probably use kotlin), typescript, and go are the most popular ones and they will all do whatever you need with pretty great performance if written correctly.

I'd do a simple CRUD app in all 4 of them and see which one I liked best from tooling to language design.

Re:What is the best typed language for back end web developm... by _benj on Wednesday September 22, 2021 @07:17PM (#28623281)
If you are familiar with it TypeScript could be a good choice.

Language preferences are very personal but I personally like Golang. It's kind of like a "batteries included" language and deploying Go, which is copying a binary to a server is awesome!

Re:What is the best typed language for back end web developm... by maattdd on Thursday September 23, 2021 @04:10AM (#28626496)
It's true if you don't have any other files such as HTML templates or CSS or whatever; which is fairly rare (don't even get my started on stuff like Packer which embed binary content inside the binary executable...).

Nowadays, deploying any project should just be one docker build . away whatever the language.

Re:What is the best typed language for back end web developm... by henhouse on Saturday September 25, 2021 @10:45AM (#28653580)
Is the embedding necessarily a bad thing? I run a site entirely using Go templates and packr to embed the site’s files and it only adds a few MB. Latest version of Go has a built-in way to embed files now through a comment syntax.
Re:What is the best typed language for back end web developm... by ttymck on Thursday September 23, 2021 @04:26PM (#28634834)
If you're serious about using the type system to encode business logic, improve resiliency, and reduce runtime errors: scala is really a great choice. Beware "type astronauts", FP purism, etc. and you'll be able to go very fast. You get access to the whole JVM ecosystem.

Rust is great but more clunky. I'm under the impression F# is a viable alternative.

Re:What is the best typed language for back end web developm... by simantel on Wednesday September 22, 2021 @06:51PM (#28623061)
If you're familiar with TypeScript, you could use it on the back-end as well, with Node and a build step or with Deno.
Re:What is the best typed language for back end web developm... by tofukid on Thursday September 23, 2021 @03:52AM (#28626386)
I enjoy using Haskell, because of the type-safety, referential transparency, and stability of interfaces. I use Twain for HTTP server and routing + blaze-html for HTML + Selda for interfacing with SQL. I’ve built my last few projects this way (listed in my profile).
Re:What is the best typed language for back end web developm... by maattdd on Thursday September 23, 2021 @04:12AM (#28626508)
I like Crystal for this, the standard library has support for the most common stuff (HTTP server, JSON/XML parsing, logging, templating), installing additional packages is easy and the build step also.

Nice bonus: the resulting app is native and fast.

Re:What is the best typed language for back end web developm... by JaggerJo on Friday September 24, 2021 @08:26AM (#28641409)
We have great success with F# (both backend and frontend).

Can’t recommend it enough.

Re:What is the best typed language for back end web developm... by approxim8ion on Friday September 24, 2021 @02:51PM (#28646384)
I've been using TypeScript and quite like it.
Re:What is the best typed language for back end web developm... by k0t0n0 on Thursday September 23, 2021 @03:14PM (#28633840)
C# or java, if you are Node developer try TypeScript
Re:What is the best typed language for back end web developm... by aristofun on Thursday September 23, 2021 @02:40PM (#28633318)
TypeScript is an amazing beast on backend as well
Re:What is the best typed language for back end web developm... by zkr on Thursday September 23, 2021 @02:39AM (#28625864)
Java + Spring
Re:What is the best typed language for back end web developm... by Darmody on Friday September 24, 2021 @06:24AM (#28640591)
PHP

declare(strict_types=1);

Re:What is the best typed language for back end web developm... by epimetheus2 on Thursday September 23, 2021 @11:14AM (#28630357)
Scala3