LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Which programming languages run natively in which linux distributions? (https://www.linuxquestions.org/questions/programming-9/which-programming-languages-run-natively-in-which-linux-distributions-729564/)

post_erasmus 05-30-2009 05:55 PM

Which programming languages run natively in which linux distributions?
 
Forgive me if this question displays volumes of ignorance, but which programming languages can/do run natively in linux/the various linux distributions?

I'm not exactly new to programming, but all of my work so far has been done in .NET and Java environments, and as such, has involved using Windows native-running programs or programs that run in the JRE.

If this is a stupid question, please help me to ask a better one.

archShade 05-30-2009 07:23 PM

If you want to continue to using .NET then you should check out mono It doesn't have all the functionality of MS .NET but its getting better.

JRE runs pretty well with no real issues.

however these are probably the two worst supported languages in *nix.

Python is great scripting language(IMHO).

The traditional C/C++ are still really good as long as you compile for a Linux box. You lose some stuff from windows (e.g. winforms) but there are lots of alternative (gtk/QT), this can mean that applications can't be cross compiled easily.

Also check out Perl, Ruby, TCL and Bash scripting.

Really it's hard to give advice without knowing what you want to do. and what experience you have. I'm assuming you've had experience with Java and C# but ultimately you need to find a language that suits you and the task at hand.

pixellany 05-30-2009 08:04 PM

From a different angle:

"Programming languages running natively on Linux" has no significance. What counts is the software that is produced. If a program is compiled in the appropriate Linux environment (header files, libraries, etc.), then it will run "natively".

Next---for the most part, Linux is Linux. There are nuances, but most things should work on most distros.

I'm not a programmer, but my impression is that all the major languages (compilers or interpreters, as applicable) are available for Linux.

graemef 05-30-2009 08:11 PM

Most versions of Linux come with or can install easily gcc which is the GNU compiler collection, which provides a compiler for C, C++, Objective-C, Fortran, Java, and Ada.
Then there are the scripting languages that are available, bash (or a variant) is available from the command-line and is typically useful for a variety of system administrative tasks. Of the generic scripting languages, Perl, PHP Python, Ruby... the list goes on, ever on...

If there is a specific language that you are interested in there is probably someone on this forum who could help you install it.

paulsm4 05-30-2009 09:34 PM

Hi -

I understand that you're not asking "Which language is 'best'?" (I'm very glad!)

I believe your question is more "which languages have platform dependencies?" A fair question - but the answer is still "It depends".

IMO, Java is an *excellent* choice for cross-platform portability.

If you need graphics or a GUI, for example, the combination of C/C++ and a "portable" library like SDL, Qt or GTK+ might solve the problem (and with Java, you wouldn't even have that particular problem in the first place).

Languages like C/C++, Ruby, Python, Erlang, Fortran, etc etc are all cross-platform as far as the language itself ... but you might quickly start running into problems depending on the library you need.

If you have special requirements for your problem domain (if, for example, you need good parallelization), then perhaps the *domain* might weigh more in your choice of language than the platform.

'Hope that helps .. at least a bit!

PS:
Don't forget, virtually *any* real application written in *any* programming language for *any* platform requires dynamic runtime support of some kind. Even a console-mode C application might fail if your particular version of Windows doesn't happen to have the correct version of MSVCRTLXX.dll installed. Conversely, installing an entire Java JRE or .Net runtime isn't necessarily that big a problem for most users under most circumstances (who generally expect to need a CD and/or an Internet connection to install anything). So everything is relative ... and the answer to your original question remains "It depends..."

post_erasmus 05-31-2009 09:57 AM

First off, thanks to all for the thought out, and incrementally varied responses.

Pixellany: you're right, uncompiled programs don't run natively. What I was trying to get at was what languages could be reasonably compiled and run on linux without requiring additional runtimes, (such as the JRE). Thanks for the refocusing, there.

From what I'm reading, it sounds like C++ (which along with, C#, Java, VB, and python make up my known languages) is the route to go. Though problem domain, as paulsm mentioned, is also a big part of the decision. I just didn't really want to drop a requirements doc summary on you guys. That said (and since archShade asked, sort of) . . .

I have to take a program which was written in vb.net, quick-and-dirt-ily thrown at linux via an early version of mono (exact version i should get early this week), and has been run (and needs to continue to run) from a specific hardware rig (specs and hardware arriving early this week) using puppy linux and convert that program into something that runs natively on a linux distro and loads from startup. The app itself receives bytes and byte arrays from a specified set of TCP/IP locations and performs operations based on that received data, some timers, and a slew of xml configuration files. Then, after it "works", I need to begin tinkering with optimization with respect to the processor. And sandwich OS and application onto a 2 to (at most) 8 gig flash drive.

I think that this is a bit too robust for a scripting language to handle efficiently, but again, I've never programmed for linux (or much with scripting languages at all) before, so I'm more than willing to be wrong. Based on the comments you all have provided and my hopes for an object-oriented language with, perhaps, some extant libraries for handling xml and tcp/ip, I'm thinking C++ is probably the way to go, though I think I could manage straight C if it would make that big a difference in performance. Having read the IDE thread and down some downloading and playing, I was figuring on using Netbeans, Eclipse, or Ajunta. If you guys have any further suggestions on language or IDE, I would appreciate them.

While I'm rambling, is there a trustworthy place to get linux-compiled libraries for C++, C, etc., or would I be wiser (and able) to be making use of some of .lib files that show up in package managers?

paulsm4 05-31-2009 12:15 PM

Hi, again -

1. Cool - it sounds like you're on the right track!

2. For whatever it's worth, I'd *strongly* encourage you to keep Java under consideration. It sounds like it might well be a close fit for your skill set and the problem domain, and I think you might be surprised how *good* performance will actually be in the "real world".

Conversely, C++ is a complex beast. It's unfortunately all-too-easy to do the *wrong* thing in C++ ... and not even realize it. Until much, much too late.

As far as an OO language to quickly get up-to-speed on: I honestly believe Java, C# and Python are all much, much easier, safer and, IMO "cleaner". And all are equally (IMHO) capable of "industrial-strength" performance and reliability.

3. Using your distro's package manager is absolutely the best way to go. Whatever you wind up doing, there are always inevitable dependency, version and environment issues ... and your distro's package manager is almost certain to make the "better choice".

As a fallback, you should definitely install your distro's kernel headers, gcc, standard C headers and the build tools. So you'll also be prepared to build anything from source that you might need to.

'Hope that helps...-
... and please - Have fun!

Your .. PSM

post_erasmus 05-31-2009 12:30 PM

Quote:

Originally Posted by paulsm4 (Post 3558246)
For whatever it's worth, I'd *strongly* encourage you to keep Java under consideration. It sounds like it might well be a close fit for your skill set and the problem domain, and I think you might be surprised how *good* performance will actually be in the "real world".

To be honest I love Java, and I might try to throw together a performance test or two to see if I can convince the client to let me do this in Java, but as most of the reason for the app re-write/update is a desire to get more data through the processor using all the old hardware, I don't know how mutable they'll be.

Quote:

Using your distro's package manager is absolutely the best way to go. Whatever you wind up doing, there are always inevitable dependency, version and environment issues ... and your distro's package manager is almost certain to make the "better choice".
As a fallback, you should definitely install your distro's kernel headers, gcc, standard C headers and the build tools. So you'll also be prepared to build anything from source that you might need to.
I will do exactly this. Thank you again for all your help and advice.

Postscript:
Quote:

As far as an OO language to quickly get up-to-speed on: I honestly believe Java, C# and Python are all much, much easier, safer and, IMO "cleaner". And all are equally (IMHO) capable of "industrial-strength" performance and reliability.
Is Python really that robust? I've played with a bit, but predominantly in light-weight, very simple ways, because I sort of assumed it was best used in a little bit of bash script or in a python-compatible cgi gateway.

Sergei Steshenko 06-01-2009 03:39 AM

Quote:

Originally Posted by post_erasmus (Post 3558256)
To be honest I love Java, and I might try to throw together a performance test or two to see if I can convince the client to let me do this in Java, but as most of the reason for the app re-write/update is a desire to get more data through the processor using all the old hardware, I don't know how mutable they'll be.


I will do exactly this. Thank you again for all your help and advice.

Postscript:

Is Python really that robust? I've played with a bit, but predominantly in light-weight, very simple ways, because I sort of assumed it was best used in a little bit of bash script or in a python-compatible cgi gateway.

Perl, for example, runs both under Windows and Linux, and if you choose your programming style to be cross-platform, the program will just run without any transformation.

Probably the same is true WRT Python, though I personally dislike the language.

ActiveState provides precompiled Perl/Python/TCL (and some more) packages for various OSes, including Linux and Windows.

Su-Shee 06-01-2009 07:29 AM

With obeying some rules and a portion of common sense, more or less each and every contemporary programming language I've encountered over the last decade runs on Linux, Windows and Mac as long as the programming language itself is supported under this system and I'm not trying to use something very native to the platform. Of course, something involving Mac's Cocoa does not run under Linux' X11.

Mostly, it's about endianess, handling of operating system specific things like "/" versus "\", GUI systems and some networking details as far as the average application is concerned.

So, choose what you like and know and if it's Java so be it and if you like C#/.NET, it's Mono as already mentioned.

But: The predominant programming language under Linux is still C (and partially C++) and many supporting libraries you might want to use are only available in C even though Linux has a very strong culture of binding and wrapping everything into all kinds of other programming languages. And while there's much Java-based projects out there running under Linux (IBM's Apache stuff for example), it's not the language of choice, if you're starting to develop KDE or Gnome applications. (I personally don't even have Java - I never need it and as C#/.NET is only coming with Mono which is too much involved with Gnome for my taste, I also don't have Mono installed on my Linux.) It really depends on your application you're going to develop.

If you don't care for platform-independence you can pretty much use at least a couple of dozens programming languages of all kinds supported under Linux no matter how exotic.

And yes, Python and Perl are stable and robust - it's not that they were invented just yesterday. :)

sundialsvcs 06-01-2009 08:14 PM

The gcc compiler suite, as previously noted, supports several languages and generates native machine code for each.

Honestly, I can't think of any language that isn't supported under Unix/Linux. . .

bigearsbilly 06-03-2009 06:45 PM

Quote:

Originally Posted by sundialsvcs (Post 3559724)

Honestly, I can't think of any language that isn't supported under Unix/Linux. . .

visual basic! C# (whatever that is)
(thank god)

there are a million other languages,
mostly better than
java.lang.outOfMemoryError

(I reckon)

archShade 06-04-2009 06:33 AM

Quote:

visual basic! C# (whatever that is)
C# is supported under Linux + Mono isn't exactley same as C# + .NET but very similar


All times are GMT -5. The time now is 03:57 AM.