LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-28-2009, 07:26 PM   #1
Romanus81
Member
 
Registered: Feb 2008
Posts: 201

Rep: Reputation: 31
Beginner programming language for writing a cross-platform Graphical app?


Hello,
I've been using linux for awhile and am fairly proficient at bash scripting, and would like to move on to something more advanced. I have the summer pretty much free, so I thought it would be a good time to learn to do actual coding.
I have an idea for the program I want to make. I am majoring in Classical Greek Philology (language), and I want to create a program that works in such a way that a student in type in a word, it's definition, dictionary forms, the line it appeared it, etc. and then it creates an index of words for review, kind of like a personal dictionary, which the program can then format and export in a printable format (.pdf, .txt, .doc, etc.)

The language I need would have to be
1) Cross platform, so that I can distribute it to all the windows users.
2) Have a GUI
3) Have the ability to incorperate beta code, i.e. a way to type in Greek using an English keyboard. So that a = alpha, b = beta, q = theta, you can see it in action at typegreek.com The program that website uses is written in javascript, under a creative-commons license. So if either the program could be written in javascript, or incorporate it, it would be really helpful.
 
Old 06-28-2009, 09:31 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Java seems a fairly reasonable choice. It can easily do a cross-platform GUI application, and a lot of people recommend it as a first language now anyway (my understanding is that most computer science courses now focus on Java for beginners now as well).
 
Old 06-28-2009, 09:33 PM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
I would suggest that you look at the database component of open office (open base). Whilst this is not a programming language as such your requirement appear to be more towards a database than a programming language. I have to admit that I've not looked at it for quite some time but they were working on a front end similar to MS Access how well that has developed I'm not sure.

I would suggest that this approach will help you to develop an understanding of databases and the structure that your program will require, along with the ability to fairly quickly solve points 1) and 2). Your third point I'm not so certain how easy it will be to achieve but I think that can be done within the open base framework (it supports a version of BASIC)
 
Old 06-29-2009, 12:42 AM   #4
psisquare
Member
 
Registered: Sep 2004
Location: Germany
Distribution: Gentoo
Posts: 164

Rep: Reputation: 31
You may want to have a look at Qt (www.qtsoftware.com). While not actually a language, it provides many of the features you're requesting to several languages (C++ natively; Ruby, Python, Java and others via bindings):

* It's cross-platform (Linux, Windows, Mac OS and others).

* Makes building modern GUIs pretty easy (either by hand-writing code or by using the graphical ui designer).

* Fully Unicode-enabled, so incorporating greek text is easy. Translating latin to greek letters should be feasible by intercepting key events.

* Includes a JavaScript interpreter (more precisely: it has its own ECMA script derivative called Qt Script). If you really want to try re-using code from typegreek.com (which may not be the easiest solution), there should be a way; if not via Qt Script, then probably by using the built-in web browser component Webkit (which supports JavaScript and can be used for building a WYSIWYG style editor, there's a demo for that somewhere).

* Include support for export to PDF (TXT should be easy in any case). If you really need DOC export, you probably want to figure out a way of reusing the functionality of OpenOffice or KOffice (no matter what language/framework you end up choosing).

Also features very good documentation, many demos and lots of (open source) applications using it.

It's worth noting that the above should also be possible with Java/Swing/additional libraries or C/Gtk/related libraries. I'll leave it to people more familiar with those to advertise them.

As for the language, while C++ is certainly not the worst choice as a first language for "actual coding", it has a few gotchas (memory management, different string handling (char*/std::string/QString) in different libraries, compilation and linking to libraries on different platforms). For a self-contained application, using an IDE can mitigate those problems; but if you intend to use libraries (other than Qt, wich has its own IDE and glue code for others), you may want to look for a scripting language (Ruby, Python, Perl, Falcon, Lua...) which has either a native library or bindings to a library with the extra functions you need.

Hope that helps you with the decision, and good look for your application.
 
Old 06-29-2009, 04:26 AM   #5
yvesvanbelle
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: Debian, Ubuntu, Mandriva
Posts: 67

Rep: Reputation: 15
I also would suggest JAVA. It has everything you need and is backed by the biggest IT firms in the business (IBM, Oracle, Google, Sun, Amazon). This way you know that what you learn will be arround for a long while.
 
Old 06-29-2009, 06:36 AM   #6
legends2k
LQ Newbie
 
Registered: Oct 2007
Posts: 8

Rep: Reputation: 0
Since you say you want something light, I would suggest you to use Python with cross-platform widget toolkit like GTK+ or QT, which will make your app. cross-platform. Also scripting is a bit easier to learn than to learn a compiled language like C or Java. If you are fine with C with GTK+ or QT then go ahead, it will sure be the fastest next to Assembly For a desktop application, I would surely advice against using Java due to it's performance.

You can check out Artha ~ An English thesaurus, which is written in C using GTK+ widgets and see how it performs.

Last edited by legends2k; 06-29-2009 at 06:40 AM. Reason: Added additional info
 
Old 06-29-2009, 06:43 AM   #7
mejustme
LQ Newbie
 
Registered: Dec 2007
Posts: 5

Rep: Reputation: 0
You can also try Python, it's easier than C++, and you write less code than in Java.
For GUI I recommend QT. There is an excellent book that explains almost everything you need to know about python+QT, and it's also for beginners. Here is the link to it's web page: http://www.qtrac.eu/pyqtbook.html. It has examples and exercises for each chapter(with solutions).
 
Old 06-29-2009, 07:22 AM   #8
thomas.hedden
Member
 
Registered: May 2006
Location: Carlisle, MA
Distribution: Ubuntu, Fedora
Posts: 58

Rep: Reputation: 15
3) Have the ability ... to type in Greek using an English keyboard.
At least some Linux distributions have this capability already.
I am using an (old) version of SuSE Linux, and have set up my
system so that there is an icon on the taskbar that shows what
the current input language is. Each time I click on it, the input
language cycles through all the input languages that I have
enabled (French, German, Russian, etc.). I have not looked at
Greek, since I don't know it, but I would be highly surprised
if it were not among the available input languages.
So, I would suggest dropping this requirement from your search
for a programming language and handle that requirement on the
operating system level. Look in your system's configuration
system, which may be called "control center", or something
like that. The appropriate settings may be in a section having
to do with the keyboard or in a separate section concerning
"international settings", or something like that.
The only other thing you have to be sure of is that whatever
system you use to store your data have the ability to handle
Greek. I would strongly advise storing everything in Unicode,
if possible.
The only special requirement on the programming language that
I can see is that it be able to handle Unicode data. This can
be an issue with languages like C/C++, where you might need
to use the right datatype declaration, however my impression
is that today many higher-level programming/scripting languages
have this capability built in.
P.S. You should consider just using web forms with a web browser
for everything except the database. I think that they can easily
do everything you want.
Good luck,
Tom
 
Old 06-29-2009, 08:15 AM   #9
merlinblack
LQ Newbie
 
Registered: Dec 2007
Location: Sydney, Australia
Distribution: Ubuntu, Ubuntu Server, Linux From Scratch, Fedora, Mac OSX, and Windows sometimes.
Posts: 20

Rep: Reputation: 1
Smile

As professional programmer, with several programming languages, not to mention dialects floating around in my head, I would suggest Python to learn first. You can try stuff out immediately with the interpreter, which accelerates learning the language. Skills in python will carry over to other languages as well.

There are a number of cross platform GUI libraries for Python, my personal favourite being wxPython, which is a binding to the C++ wxWidgets. Handy if you move on to C++. There are plenty of other cross platform GUI libraries to choose from too, including GTK and QT.

Also Python 2.6 and onwards handle unicode strings very well, so characters with accents and other things can be handled easily.

There is a wealth of modules for python, and no doubt there will be one to write pdf files or whatever you want files, and also any database you might want to use. I would look at Sqlite. It should fit with what you want to do. That or just save all your definitions etc, as text files, in some format (XML?).

Good luck and have fun!
Nigel
 
Old 06-29-2009, 08:38 AM   #10
legine
LQ Newbie
 
Registered: Apr 2008
Posts: 10

Rep: Reputation: 0
If you decide to use C/C++ as Language, then I recommend wxWidgets as base Library.
wxWidgest provides you with a multiplattform GUI, Basic Classes for handling Documents and text. Basic Html decoders for easy, fast aproaches. All sorts of datatypes like hashes, Lists and other STLs.

I have another cool Framework for Java in mind you could use. You write your Application, and the Framework handles the GUI. Really cool stuff just forgot the name. Ill post it when I found the article in my paper archive.

Of Course you can also use python (very easy to learn Object Orientated Language) or perl (perl will give you fast results, and it is quite mighty on text operations by nature). I personally would again prefer wxWigets bindings over QT. But thats more personal taste I guess. (that would be wxpython or wxperl.)

IMHO it doesnt matter much what Language you start in. The Concepts are always similar. Only focus on one Language if you really want to enter deep into that Language. I.E. if you want a job within Java then go java. Else look what you think is most convenient or easy to grasp to you.

Have Fun and GL.
 
Old 06-29-2009, 11:19 AM   #11
nowonmai
Member
 
Registered: Jun 2003
Posts: 481

Rep: Reputation: 48
I would recommend Python also. As a starter language it offers much, being easy to write more than just 'hello world' style programs, while also offering great potential in terms of power (it's used a lot by google for in-house stuff).
I would also recommend looking at Java, particularly if you are interested in a career as a programmer... but try Python first... for your own sake.
 
Old 06-29-2009, 11:29 AM   #12
Romanus81
Member
 
Registered: Feb 2008
Posts: 201

Original Poster
Rep: Reputation: 31
Thanks for the suggestions, I've heard a lot about python in the past, and have always wanted to try it. My only concern is that I want to be able to package the entire app in a zip archive or something so that my friends in Windows will be able to use it. As in, I don't want to have to provide an 12 step installation guide to all my friends who don't use linux. Would I be able to have my classmates simply unzip the program + files and begin using the app?

psisquare, Would Qt just be the graphical front-end, then? Or could, theoretically, the entire app be written in Qt? And would I be able to hand my friends an easily installable application or exe?

Last edited by Romanus81; 06-29-2009 at 11:46 AM.
 
Old 06-29-2009, 11:40 AM   #13
dennis123123
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by legine View Post
If you decide to use C/C++ as Language, then I recommend wxWidgets as base Library.
What he said, wxWidgets and C/C++.

Java is bloated and slow, Python I still classify as a scripting language.
 
Old 06-29-2009, 12:33 PM   #14
lanbarnes
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
Also look at Tcl/Tk

Cross platform, easy graphics, internationalization, plentiful libraries and interfaces. I find it elegant.
 
Old 06-29-2009, 12:36 PM   #15
psisquare
Member
 
Registered: Sep 2004
Location: Germany
Distribution: Gentoo
Posts: 164

Rep: Reputation: 31
Quote:
Originally Posted by Romanus81 View Post
psisquare, Would Qt just be the graphical front-end, then? Or could, theoretically, the entire app be written in Qt? And would I be able to hand my friends an easily installable application or exe?
Again, Qt is not a language, so your app wouldn't be written "in" Qt but "using" Qt. However, it can be used for more than just the front-end, since it provides container classes, portable filesystem access, configuration management, XML read/write, a build system and more. I think this is best expressed by saying that Qt is an application development framework. While an application technically isn't written "in" Qt, it's entirely conceivable to write a complex application which uses no other libraries besides Qt's.

The answer to your last question depends on the language you choose. For C++, you'll have to compile your application on a Windows system. The result is an .exe, which you'll have to pass on together with the (Qt) libs it uses. You can simply zip those files, which means your friends will have to extract the archive somewhere and run the application from there. It's also not hard to produce a setup routine, for instance using the Nullsoft system (http://nsis.sourceforge.net). That's the solution I'm most familiar with.

For Python, I vaguely remember that there's a tool for wrapping the interpreter, an application and all of its dependencies into one executable. Unfortunately, I've forgotten what it's called. Maybe someone else here knows.

Other scripting languages will most likely require all users of your applications to install the complete runtime environment (including GUI libs and their bindings). This can be automated by a setup routine, but will probably be more complicated than distributing binaries (i.e., .exe plus libraries).

Java applications can be bundled into .jar files containing the application and libraries it uses. However, users will need to install a Java runtime environment. Again, this could be wrapped by a custom setup routine which also puts the .jar somewhere and creates a menu entry.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross Platform Programming Ace Blackwell Programming 17 01-26-2009 09:51 AM
Simple Cross-Platform programming language? Romanus81 Programming 13 04-07-2008 07:57 PM
Cross-platform programming drbongo Programming 3 07-28-2007 10:09 PM
Cross-Platform Programming JMJ_coder Programming 7 03-11-2007 12:59 PM
cross platform calendar app? Face1 Linux - Software 1 08-01-2006 04:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration