Live data from Hacker News

Ask HN: How do you decide for a backend language?

news.ycombinator.com

81–90 of 96 posts

Re: Ask HN: How do you decide for a backend language?

#81
As some others have stated, if the problem domain is well understood, choose a new language you have an interest in learning. If it is not, it is better to stick with a language you already know. If you add a new technology to a problem domain you do not understand, there is a higher probability that you will create errors and headaches for yourself.

Re: Ask HN: How do you decide for a backend language?

#82
post #21

I have a personal rule, which I've shared on here before and people seem to think has some merit: If a project is innovative in a business sense, then choose a boring technology. If it is boring in a business sense, then choose an interesting technology.

Don't you think that in some cases the innovative technology is what enables the innovative business?

I hesitate to give examples because every time I call out something as innovative, people are going to say "Are you kidding? Alan Kay was doing that in the 1700s! Charles Babbage invented object oriented functional noSQL whatevers!"

Re: Ask HN: How do you decide for a backend language?

#84
post #21

I have a personal rule, which I've shared on here before and people seem to think has some merit: If a project is innovative in a business sense, then choose a boring technology. If it is boring in a business sense, then choose an interesting technology.

Don't you think that in some cases the innovative technology is what enables the innovative business? I hesitate to give examples because every time I call out something as innovative, people are going to say "Are you kidding? Alan Kay was doing that in the 1700s! Charles Babbage invented object oriented functional noSQL whatevers!"

That would be an exception to the rule, sure, but bear in mind that if you're trying to innovate in both technology and business at the same time, that's a bigger leap than just one or the other, so the risks are going to be higher and it will probably take longer to get right. In other words, by all means do a project like that - but don't try to do it on a tight schedule.

Re: Ask HN: How do you decide for a backend language?

#85
First revel in the fact that you actually get to choose :-) most programmers just get to play with a choice someone else made.

First of all, are you going to be the product owner, or is this a consulting gig you're gonna walk away from? If the latter, chose what allow you do get the job done for the least amount of hours. As your reputation grows for getting the job done in few hours (cheap) you can increase your hourly rates. You don't need to read on. Also, if you're sure that no bottle neck is going happen. Meaning that the user will always get a response in less then 0.3 second, some thing. use whatever will get the job done fastest. In which case you should be looking at what components (like Databases, search engines, etc) are out there that allow you to get the job done fastest. Then choose you poison according to those sub systems. There is an argument for easy maintainability, in which case it comes down to how you tend to debug. I tend to use debuggers a lot, and that leaves be with Java from the languages I know from your list.

You need to identify the bottle neck your application is going to have. You're rarely going to be wrong. I tend to operate with 5 bottle necks: CPU Memory Disk Network IPC

CPU: Easy, won't happen. It requires that you've avoided a memory bottleneck, meaning that you've figured out how to feed the CPU with data. There are only three languages where this is really possible, C, C++, and Fortran.

Memory: Unusual for a backend project, but possible. Solving it requires that you lay out your data the right way in memory, and you're again basically back to C, C++, and (to a lesser degree) Fortran. Anything with a new operator and garbage collector tend to be bad. If possible try finding an existing piece of software to do the job for you, but it's rare.

For disk and network bottle necks, programming languages don't matter.

If disk bound you need to try picking a sub system that do proper caching for you, like a SQL, NoSQL, or other system. Your design choice here will be on what you base your language decision.

Since you say backend, I'm assuming that you're on a web or mobile app frontend. In all likely hood, this is the bottle neck you're going to face. You should be concerning yourself with the frontend to backend interactions, not programing languages. Web frameworks and proper use of AJAX are more important. Worrying about languages is like worrying about getting a Ford model T, a Pinto, or a F-150 for a indy 500 or formula 1 race. You've asked the wrong question.

IPC! Strictly not a bottle neck, but a problem that occur a lot. Remember that a IPC call take about 1 000 000 times longer than a method or function call within a program. You have to assume 40ms latency from the frontend to backend. Calling web services, database requests within you backend if you spread it over multiple servers have a 1-10ms latency. You can assume 5-10ms in practice. Trying to keep a response time for a user interaction below 0.3s, i.e 300ms you should realize that you have a tight budget for IPC calls. A backend operation that involves 1000 DB requests is just not going to get done in 300ms. If you know that your DB operations will be the bottle neck, avoid ORM's like hibernate. You're going to be spending your time making DB procedure and optimizing SQL. If you're going to have a lot of business logic, chosing a language that don't lend itself to writing large programs may run you into trouble. It's tend you to keep programs short and use IPC to call the business logic. As a result I tend to stick to Java. Well, have been doing a lot of C and C++ stuff earlier in my career, so I tend to be a little biased. On the otherhand, have been wringing a lot of frontend logic in Javascript as well, and detest the language.

Hope this helps.

Re: Ask HN: How do you decide for a backend language?

#86
post #77
post #21

I have a personal rule, which I've shared on here before and people seem to think has some merit: If a project is innovative in a business sense, then choose a boring technology. If it is boring in a business sense, then choose an interesting technology.

And if it's innovative in a technical sense, then choose innovative technology. If it's merely innovative in a business sense, then it doesn't matter what you choose.

> If it's merely innovative in a business sense, then it doesn't matter what you choose.

The point is focus. Pick one and innovate it extremely well.

Re: Ask HN: How do you decide for a backend language?

#88
post #58

I can propose another one: ActionScript 3 see: https://github.com/Corsaair/redtamarin So yeah I'm the author of this project and while when I started it, it was mainly for fun "let's run AS3 on the command-line", couple of years ago I started to force myself to use it more and more server-side in the spirit of "eat your own dog food", and quite happy with it for my own side projects. Now, as any other dev I also work…

RedTamarin does look like a great project, and I'm impressed by how much effort you've clearly put into it. I was just curious, what are your thoughts about Haxe? It's not quite the same as AS3, but it is meant to be fairly similar. https://en.wikipedia.org/wiki/Haxe https://haxe.org/

thank you :)

you got almost the answer here "It's not quite the same as AS3"

Haxe focus on transpilation/cross-compilation with its own language 'Haxe' and its own compiler, libraries, VM, etc.

The closest to Redtamarin would be the NekoVM http://nekovm.org

I would say it is a different approach, Redtamarin focus on AS3 the language but also on the AVM2 and by extension the reuse of the Flex SDK (for the compiler) and other tooling that already exists (like Flash Builder IDE).

And so when you compare Haxe/NekoVM to AS3/AVM2 the difference mainly shine in how you write programs and libraries.

Redtamarin approach is to provide a "C API" for low-level function and other syscall, so dev can write "as fast as if they were writing AS3 as usual", they only need to learn a new API and the subtleties of system programming.

You could find the same kind of differences with CrossBdrige https://github.com/adobe-flash/crossbridge

Both NekoVM and CrossBridge focus (in their own way) on the reuse of C/C++ libraries, e.g. if you need zlib you can reuse it, but then it forces you to compile native stuff.

Redtamarin almost opposite approach is to provide a kind of C standard library (POSIX like even) in the context of AS3/AVM2, which allow you to port or write the AS3 code to do native stuff in a cross-platform way, but you can not reuse external native libs like zlib.

See for example this getaddrinfo sample code ported from C to AS3 https://twitter.com/zwetan/status/752202410521726976

The logic for that is let's say you need popen2.popen2() from Python, you can implement it in AS3 reusing C functions like popen(), pipe(), fork(), dup2(), close(), etc.

Except for fork(), the AS3 code will work under Linux / Mac OS X.

You could say that Redtamarin is a lot of hard work to add small native C functions call, so dev can easily write AS3 programs for command-line and server-side.

Another example, you can take JS (ECMAScript, ECMA-262) code, compile it and run it with the redshell, I did it with the TypeScript compiler, I just needed to implement ChakraHost, the detail is here https://discuss.as3lang.org/t/the-case-when-you-dont-want-no...

So to come back to Haxe/NekoVM, I'm not so sure you could either implement popen2.popen2() with just the system libraries available or if you could just compile/run TSC sources with Haxe/NekoVM unless making a big rewrite of the whole thing.

Many people probably think that AS3 is dead because "flash is dead", but AS3 is also ES4 and so fully compatible with ECMA-262, being able to reuse IDE with just a little swap of playerglobal.swc with redtamarin.swc and instantly have syntax completion to write server-side program, publishing documentation with tools like asdoc, etc.

All those things are the reason why Redtamarin focus on AS3 the language, and why it is very different than Haxe and/or NekoVM.

Re: Ask HN: How do you decide for a backend language?

#89
post #88

Earlier quoted context omitted.

RedTamarin does look like a great project, and I'm impressed by how much effort you've clearly put into it. I was just curious, what are your thoughts about Haxe? It's not quite the same as AS3, but it is meant to be fairly similar. https://en.wikipedia.org/wiki/Haxe https://haxe.org/

thank you :) you got almost the answer here "It's not quite the same as AS3" Haxe focus on transpilation/cross-compilation with its own language 'Haxe' and its own compiler, libraries, VM, etc. The closest to Redtamarin would be the NekoVM http://nekovm.org I would say it is a different approach, Redtamarin focus on AS3 the language but also on the AVM2 and by extension the reuse of the Flex SDK (for the compiler) an…

Thank you for taking the time to write a detailed answer!

Re: Ask HN: How do you decide for a backend language?

#90
post #22

This is like asking a group of artisans what is the best kind of timber to make furniture out of, I'm afraid.

> This is like asking a group of artisans what is the best kind of timber to make furniture out of, I'm afraid.

I agree. I thought I had left this sort of topic behind at Quora.

Post reply on HN