If you could choose a server side language, what would it be?

Cogman

Lifer
Sep 19, 2000
10,286
145
106
I'm making a personal toy project that needs a backend. I would like to learn some new/fun tech to power the backend. (At work I use Java 6).

The needs.

I'm going with postgres for the DB, so it will have to have binding for that. I'm running it on linux, so, sorry C# :( .

I don't care if the language is new, unstable, or crazy. I can switch it out and do the backend in something else. Most of the code will likely be "Take request, convert grab data from db, respond with Json." Also, I'll need to serve up static files.

So here are the languages I'm currently considering. Go, C++, Rust, Java, Scala, Groovy?, Haskell, OCaml, D, Python, Ruby, Javascript?, or some Lisp.

I think I could use any, they all seem pretty interesting. Which would/do you find most enjoyable for this?

This webservice is going to likely have 1 or 2 users on it ever. So it doesn't necessarily need to be able to handle high loads.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Right now for me it's python 95% of the time, and java the other 5%. I'm not actually a huge python fan, in terms of it being elegant or the right language for large, complex projects. But it's great as a glue language to wire together services on the back end, and as long as you're keeping the modules tightly focused and the functions minimal you can take advantage of quite powerful set processing syntax and tons of very mature libraries.

I should note that I use python 2.7.5. Haven't even tried 3 yet.
 

Net

Golden Member
Aug 30, 2003
1,592
3
81
i'd pick python because its my opinion that there's a greater demand for that (outside of java)
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
Scala/Haswell/Lisp all have the greatest potential to open you up to other paradigms of programming and style. Scala has the advantage it runs on the VM which will mean you can write in a very Java like way and adopt Scalaisms slowly as you learn them.
 

GregGreen

Golden Member
Dec 5, 2000
1,687
4
81
I'd probably go with Go, but something like this would be super easy with Ruby/Sinatra or Node.js/Express. Python/Flask wouldn't be a bad way to go, but in my limited experiences with pip, I'm didn't like it.
 

Red Squirrel

No Lifer
May 24, 2003
70,592
13,806
126
www.anyf.ca
I've always been curious to use C++ for web. I don't know what would be the best way to run it though, there is cgi-bin but that is super old school and I don't know if there's any downfalls to that. I remember coding a counter for my website way back in the day using C++ in a cgi-bin and a flat file, before I learned php. It worked, but obviously was ridiculously overkill, but I did not know any better. :p

That said for any kind of backend I typically do use C++ then php for the "front end". Ex: for my hvac control system the back end is written in C++ and does most of the work such as communicating with the relay controller and temp sensors. The front end is a php web page that talks with the C++ back end via mysql. Bbasically just edits values and such in a table for communication, kinda rudimentry but this is just little bits of data like what I want the temp to be set to.
 
Last edited:

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I'd probably go with Go, but something like this would be super easy with Ruby/Sinatra or Node.js/Express. Python/Flask wouldn't be a bad way to go, but in my limited experiences with pip, I'm didn't like it.

Yeah the situation with the different setup tools is a little bit of a mess. In practice I find pip does everything I need 99.9% of the time.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
If I was being practical I'd go with Java/Tomcat since that's what our Amazon cloud server developers use, while (when not doing desktop C++) I maintain old PHP code on our hosted servers.

If not that, maybe C# for Azure servers. But that's me, not answering what the OP should do.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
I would use Ruby with Rack to handle your http layer.

I could. I've had a little experience with RoR and sinatra. This would probably be best served as a sinatra app as on the frontend I'm doing a single page app (using dart). RoR would be overkill as I'm not actually going to have any separate views.

My only gripe about ruby is the fact that it is dynamically type, and I personally love statically typed languages.

Right now for me it's python 95% of the time, and java the other 5%. I'm not actually a huge python fan, in terms of it being elegant or the right language for large, complex projects. But it's great as a glue language to wire together services on the back end, and as long as you're keeping the modules tightly focused and the functions minimal you can take advantage of quite powerful set processing syntax and tons of very mature libraries.

I should note that I use python 2.7.5. Haven't even tried 3 yet.

Certainly an option. I imagine python would serve me well for this.

Scala/Haswell/Lisp all have the greatest potential to open you up to other paradigms of programming and style. Scala has the advantage it runs on the VM which will mean you can write in a very Java like way and adopt Scalaisms slowly as you learn them.

I've been think about these languages just because I'm curious to see what the fuss is about. I hear claims made about the safety of functional languages and I'm curious to see if they come out.

I don't know how "fun" it will be. Last time I gave haskell a try I got frustrated with the poor documentation and everyone telling me that every piece of example code out there is bad. That, and there was a lot of voodoo in those symbols. Not that there isn't a lot in say C++ or perl, just that I'm not used to the haskellisms.

Scala, though, sounds like it would be fun. I just worry that I would using Scala like I do java. Which may defeat the purpose of this little venture :) (Oh look, I made something in scala that looks like a java application written to a slower compiler).
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
He said 'fun/new' technology. LAMP is not that.

Yup. Standard LAMP is certainly not fun (I'm happy to see nobody has mentioned Php on Apache. Maybe things have gotten better but last time I did that It was a real PITA.

I'd probably go with Go, but something like this would be super easy with Ruby/Sinatra or Node.js/Express. Python/Flask wouldn't be a bad way to go, but in my limited experiences with pip, I'm didn't like it.

I'm interested in Go. It might be a fun language to learn. With how minimal Go is on features it would be interesting to see how hard it is to get something like this up (Though it looks like Go has pretty good support for doing http servers). I could do it in Ruby, Javascript, or Python, I just have a preference for statically typed languages. I like getting those wonderful compiler error to let me know I did something horribly horribly wrong :).

I've always been curious to use C++ for web. I don't know what would be the best way to run it though, there is cgi-bin but that is super old school and I don't know if there's any downfalls to that. I remember coding a counter for my website way back in the day using C++ in a cgi-bin and a flat file, before I learned php. It worked, but obviously was ridiculously overkill, but I did not know any better. :p

That said for any kind of backend I typically do use C++ then php for the "front end". Ex: for my hvac control system the back end is written in C++ and does most of the work such as communicating with the relay controller and temp sensors. The front end is a php web page that talks with the C++ back end via mysql. Bbasically just edits values and such in a table for communication, kinda rudimentry but this is just little bits of data like what I want the temp to be set to.

I'm pretty curious about C++ as well. I know it would likely be a lot of code to get something basic out, but it may be fun just because it will allow me to prematurely optimize the hell out of this server :). It would also give me a chance to play around with the C++11 features (I haven't had much call to use C++ for a while).
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
If I was being practical I'd go with Java/Tomcat since that's what our Amazon cloud server developers use, while (when not doing desktop C++) I maintain old PHP code on our hosted servers.

If not that, maybe C# for Azure servers. But that's me, not answering what the OP should do.

Yeah. Too much experience with Java to want to do it here. I'm sure I could churn out something quickly doing a Java tomcat server. I just don't want to because I deal with one at work.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,697
4,658
75
JavaScript

It does seem like a lot of people are pushing Node.JS lately. I haven't tried it yet.

Me, I tend to do personal projects in PHP. I don't know why exactly, except that I find it simpler not to have to conform to some framework.
 

Sequences

Member
Nov 27, 2012
124
0
76
Write your own web service using java 7/8. If learning is what you want, implementing your own web service while using some of the newer features expands what you already know about Java.

Give yourself some requirements once you have something going - improve performance, better memory management, lower heap size, etc etc. Of course its not going to be anywhere close to what you could get off the shelf, but it'd be a great learning opportunity.
 

purbeast0

No Lifer
Sep 13, 2001
53,639
6,522
126
i've been doing groovy professionally the past 2 or so years and i really like it. it's like shorthand java. i still have to look up a lot of "groovyisms" for the syntax and stuff just because i do a lot of front end too so i'm not always focused on the backend. but i'd definitely go with groovy.

EDIT:

or i would use javascript and experiment with node.js cause i've heard good things about it. it would be nice to have both front and backend in javascript with a mongodb.
 
Last edited:

Schmide

Diamond Member
Mar 7, 2002
5,745
1,036
126
If you go node. Take a look at AngularJS. I found it to have a bit of a learning curve but very flexible and surprisingly very good at handling multiple events and timers. I like the way it works by extending the html parsing as well.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
If you go node. Take a look at AngularJS. I found it to have a bit of a learning curve but very flexible and surprisingly very good at handling multiple events and timers. I like the way it works by extending the html parsing as well.

We adopted it on the web/mobile front-end for our latest application. I didn't do any of the work on that piece, but the guy who did really loves it. The results so far are excellent.
 

purbeast0

No Lifer
Sep 13, 2001
53,639
6,522
126
If you go node. Take a look at AngularJS. I found it to have a bit of a learning curve but very flexible and surprisingly very good at handling multiple events and timers. I like the way it works by extending the html parsing as well.

been using angular professionally for about a year now and it took me about 2-3 months to get comfortable with it. now i feel it's really powerful. you can do a lot with it very easily once you get the whole picture down.
 

Aldon

Senior member
Nov 21, 2013
449
0
0
Haven't made any servlets yet, but looking forward into doing so. Usually I'll stick with the "ordinary" combination of jQuery, CSS3 and PHP. I suppose it's not so easy to do with servlets, or is it?
 

beginner99

Diamond Member
Jun 2, 2009
5,318
1,763
136
Just because I wanted to try ti myself but haven't gotten to it yet. Scala with lift framework would be my suggestion.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
So right now, I'm going with plain old Java 8 to try and get something done quick. I figured I'm already doing something new with dart + angular dart on the front end.

Once I get something done right I'll probably branch out. I'm thinking of either giving scala or go a shot.
 

sao123

Lifer
May 27, 2002
12,653
205
106
I'm making a personal toy project that needs a backend. I would like to learn some new/fun tech to power the backend. (At work I use Java 6).

The needs.

I'm going with postgres for the DB, so it will have to have binding for that. I'm running it on linux, so, sorry C# :( .

I don't care if the language is new, unstable, or crazy. I can switch it out and do the backend in something else. Most of the code will likely be "Take request, convert grab data from db, respond with Json." Also, I'll need to serve up static files.

So here are the languages I'm currently considering. Go, C++, Rust, Java, Scala, Groovy?, Haskell, OCaml, D, Python, Ruby, Javascript?, or some Lisp.

I think I could use any, they all seem pretty interesting. Which would/do you find most enjoyable for this?

This webservice is going to likely have 1 or 2 users on it ever. So it doesn't necessarily need to be able to handle high loads.

Doesn't Mono support C# on Linux?
C# is still my favorite server side language.