0

Title may be kind of confusing. Let me explain with an example. If someone wants to make native and precise Windows applications, and wants to look and seem professional and wants to use official tools. They most likely need to learn high language, C# would suffice, they also need native C# to program compiler, which would be Microsoft Visual Studio. The answer to this question, in case of Windows would be "You need program called MS Visual Studio and you need to learn C#.".

That's what I want to do with Linux. I want to create native and precise Linux application. I do know that I could create C++, Python, Java application. But I would be able to do same on Windows, but I won't be able to natively run C# application on Linux, here's the point, is there some way to create an actual Linux application? I know that typical Linux's programming/(coding?) language is Bash, but that's more for the terminal.

Is there maybe couple of names you could suggest me, so I can Google and start learning making applications with CLI/GUI, natively for Linux?

7
Contributors
34
Replies
194
Views
2 Years
Discussion Span
Last Post by iamthwee
Featured Replies
  • The history of the unix system is tightly bound to the history of the C programming language, so I would say that a genuine linux application is written in C, with the help of the GNU tools. However, C is a little bit outdated, so I think C++ can be … Read More

  • 1

    The Linux kernel is written in C as are many of the system utilities, though python is becomeing very popular. Most large-scale programs are written in C++ or Java. I prefer C++ myself since it is much more efficient and flexible than Java (my opinion). If you want to write … Read More

  • Windows is programmed in C and C++. Its native APIs (win32) are in C. Most professional Windows software is written in C++ (like Visual Studio, MS Office, Adobe products, etc..). I don't understand what you mean by saying that you need C# to write native applications for Windows. C# is … Read More

  • Almost every Linux system corresponds to your needs. I use a Fedora Remix (chapeau.org), and it has the compilers, workbenches, languages (python2 python3, C, C++ compilers and more. It all included. C# is coming to Linux. Microsoft is doing the port to it. Javascript is probably more widely used than … Read More

  • 2

    >C# is coming to Linux. Microsoft is doing the port to it. Still doesn't make it any more appealing to use! ;) If you're looking long term, I think the future of cross platform frontend GUI apps will some bundle of html + css + javascript. I've said it before, … Read More

1

The history of the unix system is tightly bound to the history of the C programming language, so I would say that a genuine linux application is written in C, with the help of the GNU tools.

However, C is a little bit outdated, so I think C++ can be tolerated.

There is nothing in linux that plays the role of the .net framework in windows, so that most modern languages but microsoft's languages can be considered native in linux. For example a python program is very linuxish. It is sustained by libraries written in C and it gives you a complete access to CLI and GUI libraries.

Edited by Gribouillis

Votes + Comments
"For example a Python program is very Linuxish" - noted.
1

The Linux kernel is written in C as are many of the system utilities, though python is becomeing very popular. Most large-scale programs are written in C++ or Java. I prefer C++ myself since it is much more efficient and flexible than Java (my opinion). If you want to write a GUI application, it is best to use one of the high-level API libraries available, such as Qt (a C++ library). Qt is also widely used to write Windows applications. It is very cross-platform compatible.

Votes + Comments
flexibility!
1

Windows is programmed in C and C++. Its native APIs (win32) are in C. Most professional Windows software is written in C++ (like Visual Studio, MS Office, Adobe products, etc..). I don't understand what you mean by saying that you need C# to write native applications for Windows. C# is the primary language for writing native .NET applications, i.e., it targets .NET, not Windows. If there is any meaning to the term "native application", .NET applications are anything but.

One thing that is true though is that Windows offers a much more limited practical set of options when it comes to writing applications. In Windows, you can either use C, C++, C# or Java, or one of two dozen dead / failed languages that Microsoft has tried to promote over the years. I guess this has the advantage of being easier to choose, since there is less of a choice. Is that what you mean?

On any platform, writing GUI applications that have a native "feel" to them is mostly a matter of using the right GUI library / toolbox. Most platforms have a GUI library that is most native, and it is often the library used by the OS's graphic elements too (e.g., its start menus and configuration panels). On Windows, that used to be Win32 API in the early days, then it became MFC for a long time, and now it's WinForms. In Linux, things a bit more diverse because it depends mostly on the desktop environment used, the main ones are Gnome and KDE, which favor GTK+ and Qt, respectively. There are some cross-platform GUI libraries that manage to allow you to create very native-looking applications for all platforms (it basically translates to the native GUI library, or tries to respect its conventional "look"). The best library in that department is Qt, which is amazingly versatile and good-looking on all platforms (including smartphone apps).

As far as languages go, Linux is very diverse in terms of support for languages, but it does have its "culturally" favorite languages. Most of the core Linux code, including the Linux kernel and the GNU tools (like bash, diff, GCC, etc.), are written in C, in part because these are very low-level things and in part because they date back to the 80s and early 90s. Then, an incredibly vast amount of the Linux software ecosystem is populated by C++ applications and libraries. And then, there is a growing population of Python code, mostly in the higher-level "glue" between the vast ecosystem of C/C++ libraries and back-end tools. Java is really not that common, in fact, I had Linux installed for years, using it every day, and I never even had Java installed at all because none of the applications or tools I had used Java beyond what can be done with GCJ (and I had a lot of stuff installed). Technically-speaking, C# can also be used through Mono, but I can't really see the point of that (the only reason to ever use C# is to please your master and overlord, the Microsoft Corporation).

Bash is not really a programming language, it's a script interpreter. It is very prevalent in Linux because it is usually the interpreter used for the Linux terminal (the command-line interface). Anything you do in the terminal is a kind of "single line bash script", and you can, of course, write longer bash scripts in files. Bash is sort of this high-level scripting language that any good "power-user" of Linux knows pretty well, but it's mostly used for automating simple and repetitive tasks or creating a script that invokes multiple command-line programs in a sequence (like when doing audio-video encoding, for example). In other words, it's not "real" programming, it's scripting.

As far as choosing a language that is appropriate for writing applications in Linux. Well, just take your pick. Linux, and more generally, all Unix-like systems, is the primary platform of all programming languages that exist, except for those that Microsoft exclusively markets (of which C# is the only one that is the least bit relevant). You can use C, C++, D, Objective-C, Python, Perl, Ruby, Go, Rust, Fortran, Ada, etc... Linux supports everything.

Votes + Comments
Another one of those, #mustreadbymike2k
0

I would not recommend to choose Objective-C. It is a very nice language but AFAIK, most of the existing programs and tools use cocoa which is an Apple library. You could be frustrated not to be able to use these tools.

0

Is kind of relevant, but not fully answering.

I guess it depends on your motives. Personally, I stay well away from java and dotnet. It's too horrible to contemplate writing gui apps in.

Let's be frank, you would only go native if you're writing some big enterprise GUI or some 3D app that needs to be fast. Only 5% would ever need to write something like this.

For your day to day end tasks, yes I found 'shoes' perfect. As I said the apps are native, not look native, they are, something QT tries but doesn't always get right. The syntax is easy, ridiculously easy and most importantly, it doesn't have the drag and bloat of a framework, or needing a framework/virtual machine to run, which in itself where lots of exploits have been found.

For me it is, the win/win solution for a cross platform GUI toolkit without all the cons.

Something you can get up to speed in writing a simple interface for your chosen linux distro.

Edited by iamthwee

1

Almost every Linux system corresponds to your needs. I use a Fedora Remix (chapeau.org), and it has the compilers, workbenches, languages (python2 python3, C, C++ compilers and more.

It all included.
C# is coming to Linux. Microsoft is doing the port to it. Javascript is probably more widely used than c#.

Here is a link to Chapeau Linux, http://chapeaulinux.org/
I use it and it has all that you require

2

C# is coming to Linux. Microsoft is doing the port to it.

Still doesn't make it any more appealing to use! ;)

If you're looking long term, I think the future of cross platform frontend GUI apps will some bundle of html + css + javascript.

I've said it before, although my predictions are way ahead of its time, but generic low performance GUI frontend apps will eventually all be built using the web standards. Not least because, building a UX this way lends itself to be responsive, meaning the UX will shrink and grow depending on if you're using a desktop or mobile app.

This is why I'm keeping a close eye on google go, I think future apps will be written in go (backend) and a html+css+js front end will be packed into a go-bindata.

E.g

https://github.com/satran/edi

This is why all this talk about QT, win32, cocoa etc will all be redundant, unless you're writing an enterprise app like word, or photoshop. Only the elite will ever do something like this. I think the QT and win32/winforms and cocoa skillsets will become redundant.

I wouldn't bother even trying to learn it.

Edited by iamthwee

Votes + Comments
"Still doesn't make it any more appealing to use! ;)" *shots fired*!
0

something QT tries but doesn't always get right. The syntax is easy, ridiculously easy and most importantly, it doesn't have the drag and bloat of a framework,

Then what's the fun if it's so ridiculously easy? I don't want to be like zombie sitting behind my screen typing code, I'd love to use my brain. Mike (if I may speak by his first (true?) name) recommended learning C++ and understanding OpenGL when it came to game development, he also said that Linux goes well with C++, so I think I'll stuck with C++, since you actually need to use brain and can't write the code "like that".

Only the elite will ever do something like this. I think the QT and win32/winforms and cocoa skillsets will become redundant. I wouldn't bother even trying to learn it.

Yea, I noticed QT needs to be paid for. I'd also like to find something that is free, I don't need all the fancy pre-made functions and methods. Just like creating responsive website with login, all you need is Apache (free) and knowledge of HTML, CSS, PHP. To create this and learn more things, all you need is open mind and spare time. I don't really like to pay for things because then, you need to pay, to create a program that will be shared for free. I don't really require a framework, just a interpreter or compiler... I, don't know how to explain this, I don't want super-mega-advanced hyper-framework which can find last number of Pi or divide by zero and is used by gigantic companies every day. Just a normal program, that would take script from my files and together with GPU/HDD/CPU/RAM will turn this into working Assembly and that I will see the result on the screen that it actually works.

1

Qt is free. It's true that they have some professional tools that you have to pay for. But you don't really need those tools to work with Qt (in fact, I wouldn't recommend them). Technically, all you need is to install the libraries and have some C++ compiler of your choice. To create the GUIs, it's easiest if you use one of Qt's free tools, like Qt Creator or Qt Developer. Just look at the "Community" download page, which refers to the open-source (and free) side of Qt. Most Linux distributions have packages for Qt libraries and most of its free development tools, so, you should look there first.

Also, Qt is dual-licensed. What this means is that you can use Qt for free as long as you don't modify any of it (only use it) or don't redistribute it (those are the terms of the LGPL license). If you want to modify or redistribute it, then you can pay a licensing fee to Qt for doing that.

1

Actually, you can modify it for personal use, but may have to pay a license fee if you want to redistribute it (sell it) with your changes - or at least get permission. I believe that is part of the LGPL lincense. At least that was my understanding when I worked for Nokia when it still owned Qt.

Anyway, I would have to look at the current licensing documents to know exactly what the restrictions are. Typically, LGPL licenses allow you to modify and redistribute code provided you provide proper attribution and a means to obtain the modified source code.

0

If someone wrote perfect code when it comes to sacurity (which is quite impossible). Can Qt somehow make the program unsafe? Is Qt to be trusted when for example you handle sensitive data? Can somehow Qt be cracked in such manner, that instead of exeucting the code, it will write it? Or the entire program will just turn code into Assembly?

Edited by RikTelner

0

Believe it or not security breeches can occur on any operating system. For example I could compile a binary that deletes important files on a linux system, yes you would need to run it as root to cause an issue but if I told you the program was legit you might be convinced to type in your root password ->dumb but it can happen.

In that way that's the only real reason where security can be an issue. Just like java or python relies on the security of their virtual machine, this is where most hackers focus their attention on. One reason I feel java and dotnet apps have had their time, much like flash, it will soon become an obsolete technology.

How the program handle sensitive data is dependant on the programmer. For example I could write an app that store passwords as plain text in the database. That's a security issue whether it is written in QT, shoes, on linux, mac or windows. It's largely irrelevant.

0

How the program handle sensitive data is dependant on the programmer. For example I could write an app that store passwords as plain text in the database. That's a security issue whether it is written in QT, shoes, on linux, mac or windows. It's largely irrelevant.

Yes, but what if I stored (using Python and Qt) a password with AES256 (I believe it can do that) in the program itself, and made absolutely sure it is properly encoded, is there possbility Qt will somehow release the password without receiving proper trigger? Lemme ask another way, is Qt hackable in such manner it would make my program vulnerable (more than the actual program is RIGHT NOW), that someone would make Qt display values I want to have hidden? (from white hat perspective)

Edited by RikTelner

0

is there possbility Qt will somehow release the password without receiving proper trigger?

No. If you do your job correctly, passwords should never appear as plain text anywhere except at the point where the user enters it. Basically, you have an edit box where the password is entered. That edit box should take the password, immediately get a hash from it and then scramble the memory of the edit box. Then, to validate the password, you only check that the salted hash code matches the salted hash you have stored somewhere.

When it comes to hacking desktop applications, the technniques used mostly involve different forms of code injection. In other words, it's not so much about getting a password revealed, but rather about getting some piece of code executed with a high enough privilege level (e.g., root, admin, etc.). There are basically three forms of that.

First, you can spoof a dynamic library, such as DLL injection or shims, to which Qt is somewhat vulnerable too, like any other widely used library. The way to protect oneself from this is to control the distribution of the library, something that Linux and Mac does very well through secure and verified software repositories, while Windows has always struggled enormously with this problem.

Second, you can overwrite the code of a loaded program to do things like replace it with your own code, remove it (like removing a password / license check), or pretty much anything you can get away with without being detected. Native applications used to be vulnerable to this but are not anymore due things like ASLR and address space segmentation. Managed applications, like JVM or .NET applications, are very vulnerable to this because some of their features (like run-time reflection) are easy to exploit, and bytecode is a lot easier to rewrite and very hard to obfuscate beyond the limited and totally insufficient obfuscation techniques like those used in .NET.

The third typical technique is to inject code through script interpreters built into applications. For example, many of MS Office applications provide features where you can achieve custom behavior (like a very fancy calculation in Excel) by using some general scripting language like javascript. Those scripting systems are often far from being air-tight, that is, they contain loop-holes through which code can be executed with an unusually high privilege or in a user-space that it shouldn't execute in, which is called an "exploit". Large commercial applications, especially those from Microsoft, are especially vulnerable to this because they try to serve a large user-base and be commercially attractive by adding lots of hastily-developed custom scripting features that are full of security holes. Pretty much anything that runs html + css + javascript natively is a conveyor-belt for hacks and exploits.

As far as I know, Qt does have some features for running things like javascript to render GUI elements, but you can easily just stay away from them. And one thing's for sure, Qt is among the least scripting-heavy libraries for GUIs, which makes it inherently more secure than most.

0

So basically,

Qt can only mess my program, if I mess up the creation of GUI (input field) or the program itself, and program is vulnerable to data "leakage" when I mess up.

Just like,

HTML/SQL can only mess my website, if I mess up the <input> or PHP query parsing, and website's database is vulnerable to data "leakage" when I mess up.

Can I see it that way?

Edited by RikTelner

0

Passwords should be hashed, and not encrypted. A hashed password can't be unhashed. An encrypted password can be decrypted.
In the security world AES is a government approved encryption algorithm, because: it is easily hackable, it is fast, :being fast governments have the means to perform multiple tests using test encryption keys. The American NSA knows how to crack AES.

If you really need to encrypt passwords, choose a combination of two different encryption algorithms and use cypher block chaining between them.

0

But, that's not remotely the answer. I don't ask "how do I encrypt my password?", I ask "can I compare A to B?".

0

I did some Googling here and there, and people don't recommend Python for creation of programs that use GUI, they recommend it as background applications for servers (I know why, Python is optimized like: MAN IT'S OPTIMIZED), crunches numbers before my processor does :P .

So I think I'll learn Python only for creation of server-side application which will handle any type of request from internet, if I will ever need one, I'll learn Python though.

There is a sentence in this topic, which, let me quote it:

For example a python program is very linuxish.

Is there any other programming language that is Linuxish and would be good for Linux to write program with GUI with?

Some more Googling:

Amongst others, GCC provides compilers for Ada, C, C++, Go and Fortran. Many programming languages have a cross-platform reference implementation that supports Linux, for example PHP, Perl, Ruby, Python, Java, Go, Rust and Haskell.

C and C++, another type of language, that in my opinion prefer CLI batch execution in place of GUI application development.

PHP, is more for server-side website scripting, not for standable "executable" for Linux.

Java, has lots of bugs here and there. Very often whenever I'm on web I see "Java XYZ has been found to be vulnerable" and safety of your development kinda depends on daily checks of updates, and then there might be some functions missing or functions that you need to replace. Also Java applications don't always work, they do quite often, but not always, on every hardware/"software".

Haskell looks like brother of Python, which is quite low-level (not low quality, but down-to-steel) and is optimized for logic. Which is then communicating directly to processor in Assembly and won't really work great when it comes to creating a GUI application. Rust seems to be the same.

Perl looks like a good shot (though complicated) and Ada seems like fun to learn.

Fortran seems to be good for creating an operating system, rather than creating Linux GUI application.

Ruby looks to me complicated, complicated is fun, but it might be too complicated to keep up with straight mind and logic of the program.

Edited by RikTelner

1

You'll need some time and more googling to get a correct picture of all these languages. For example fortran's domain is not OS programming but engineering and numerical analysis.

Wikipedia has a long list of programming languages https://en.wikipedia.org/wiki/List_of_programming_languages : you cannot reasonably learn all of them :)

The choice of the programming language is partly independent from the choice of the gui toolkit. For example you can code QT4 guis in many languages https://en.wikipedia.org/wiki/List_of_language_bindings_for_Qt_4 The same hold for Tcl/Tk or wxwidgets.

Edited by Gribouillis

0

you can code QT4 guis in many languages https://en.wikipedia.org/wiki/List_of_language_bindings_for_Qt_4 The same hold for Tcl/Tk or wxwidgets.

Wait... it says PHP 5... you can't possibly mean, that if I install Qt Community Edition I can actually create an executable for Linux and actually being able to manage the GUI, system files, system status and all other optionalities by PHP, without client having Apache2 installed.

There's also name of C# in there, would Qt be able to make executable for Linux? Working executable from C# source-code?

@edit - Apparently I'm too stupid for Qt as well. As soon as I choose for application with GUI, it gave me like, couple files, headers and C++ files, I went to "Design", added text on top of "GUI" "I'm gonna type something here" decided to run it, just for "lulz" (fun/joke) and I already got two errors:

:-1: error: collect2: error: ld returned 1 exit status

:-1: error: cannot find -lGL

...if I can't even start application properly how am I gonna resolve tons of bugs I'll make in my life-time? Oh man.

Edited by RikTelner

1

Why not try D ? It was originally a language for windows because its creator Walter Bright wrote the first DMD compiler for windows, but it now works on various platforms including linux, and there are QT bindings http://www.dsource.org/projects/qtd . D is a very attractive language.

Edited by Gribouillis

0

Some of your research is wrong. If anything people use python for the front end more than the backend.

You can create reasonable GUI apps easily in python or ruby shoes. I'd opt for shoes as it is easier. Have you tried it. I have a beginner's tutorial if you follow my instructions in the 'shoes' thread.

...if I can't even start application properly how am I gonna resolve tons of bugs I'll make in my life-time?

I had a feeling you'd say that. Give it up, it's not worth the effort investing your time in GUI apps.

Edited by iamthwee

0

I had a feeling you'd say that. Give it up, it's not worth the effort investing your time in GUI apps.

One failure is not a reason to totally abandom programming hobby.

Why not try D ?

Looks like more advanced version of C#. Will surely look into that. But first, I need to manage to get Qt to work, then I'll install add-ons here and there.

Edited by RikTelner

0

One failure is not a reason to totally abandom programming hobby.

Yeah but we've been waiting patiently for over a week for a screenshot of your first linux GUI app in QT.

I'll be watching this thread to see how long it takes you ;)

1

:-1: error: cannot find -lGL

This error means that you don't have OpenGL installed on your computer. You should install the libGL packages (under Ubuntu, they are libgl1-mesa-dev, libglu1-mesa-dev and libglew-dev).

0

Yeah but we've been waiting patiently for over a week for a screenshot of your first linux GUI app in QT.

First of all, if it's supposed to be funny, it's not. It feels like you're sarcastic and it's not quite nice, especially when I'm beginner to make fun of my failures, instead maybe point me in the right direction, that would help. If you're here intentionally spreading unpleasant comments, while pretending to be nice, just don't.

I'll be watching this thread to see how long it takes you ;)

Your "post-cessor" already gave me answer.

This error means that you don't have OpenGL installed on your computer. You should install the libGL packages (under Ubuntu, they are libgl1-mesa-dev, libglu1-mesa-dev and libglew-dev).

Thank you. Error says -IGL, what does "I" stand for? And why does basic GUI need OpenGL? Isn't OpenGL kind of engine that needs to actually render stuff? Why is it required for such a basic GUI?

@edit:

XXXXX@XXXXX-Linux:~$ sudo apt-get install libgl1-mesa-dev
[sudo] password for XXXXX: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
                        Depends: libcheese7 (>= 3.0.1) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
XXXXX@XXXXX-Linux:~$ sudo apt-get install libcheese-gtk32
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libcheese-gtk32
XXXXX@XXXXX-Linux:~$ 

I tried installing it, but it requires "libcheese-gtk23", which can't be installed because it can't be found, I'll do more Googling, I'll just drop it here in case this is known scenario.

@edit - Trying:
sudo apt-get install xserver-xorg-dev-lts-utopic mesa-common-dev-lts-utopic libxatracker-dev-lts-utopic libopenvg1-mesa-dev-lts-utopic libgles2-mesa-dev-lts-utopic libgles1-mesa-dev-lts-utopic libgl1-mesa-dev-lts-utopic libgbm-dev-lts-utopic libegl1-mesa-dev-lts-utopic

@edit:
Oh my God:

The following packages have unmet dependencies:
 libcheese-gtk23 : Depends: libcogl15 (>= 1.15.8) but it is not going to be installed
 libcheese7 : Depends: libclutter-gst-2.0-0 (>= 0.10.0) but it is not going to be installed
 libclutter-1.0-0 : Depends: libcogl-pango15 (>= 1.15.8) but it is not going to be installed
                    Depends: libcogl15 (>= 1.15.8) but it is not going to be installed
 libclutter-gtk-1.0-0 : Depends: libcogl15 (>= 1.15.8) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Is there not an option called "install this apt, and if it needs dependency, install it as well, and if it needs dependency install it as well, and if it needs dependency install it as well, and if it needz dependency install it as well, and if it needz dependency install it as well, and if it needs dependency, install it as well?"
As for now, I'll just keep installing these dependencies...

@edit - Going on research, BRB.

@edit - I went searching for how to resolve these packaging dependecies resolve didn't met my "problem" (deleting inodes is not a good idea since this is newly installed OS on seperate partition I highly doubt that I can't install program that creates own files but I can create couple text files of 1.5GB using Python. So I went for external MesaLib download from Intel site (which is the creator of my GPU (integrated)), I got a .zip with some files in there, after going for ./configure.sh it said:

checking for EXPAT... no
checking expat.h usability... no
checking expat.h presence... no
checking for expat.h... no
configure: error: Expat headers required for DRI not found

But still looking.

Edited by RikTelner

1

The OpenGL packages might have different names on your Linux distribution (I gave the names for Ubuntu). You should use your software center (or equivalent) and search for "OpenGL" and install the "dev" packages that seem to be the main OpenGL (gl, glew, glu) library packages.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.