Forum Moderators: bakedjake

Message Too Old, No Replies

Which Language to Learn on Linux

Want to spend a little time on somthing other than PHP

         

Nick_W

8:00 am on Jun 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

I want to spend a little time learning a new language. Ideally I'd like to learn somthing that will let me build and experiment with applications on my Desktop. So, not neccesarily a 'web' language.

C++? -------- is that the one or what?

Thanks

Nick

jaski

8:24 am on Jun 21, 2003 (gmt 0)

10+ Year Member



Python looks very promising to me.

outrun

8:30 am on Jun 21, 2003 (gmt 0)

10+ Year Member



Id go C and C++, it helps you on other platforms as well, Borland is trying hard to promote Kylix which is RAD (Rapid Application Development) for Linux but you can make cross compatible desktop applications (Linux and Windows), which uses C/C++ and delphi. Then there is of course Tcl/Tk which is popular for GUI programmers on linux.

Hope I have confused you. :)

regards,
Mark

Nick_W

8:37 am on Jun 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks guys,

yeah, the pull of Python is strong. Heading more at C though so a question on that: You mention C/C++ .. do you mean I have to learn both one after the other?

Nick

Duckula

8:37 am on Jun 21, 2003 (gmt 0)

10+ Year Member



Ask yourself WHY.

Each language has its own field. If you wanted to practice lambda calculus you'd choose LISP, for example.

C++ is great for GUI programming, and hard to do correctly. Python is easy to learn and the best choice for rapid development, and bad to save memory. Tk is a toolkit, not a language; Tcl is said to be not very efficient, but I haven't tested it.

Duckula

8:41 am on Jun 21, 2003 (gmt 0)

10+ Year Member



About C/C++, they're very different when you know them well. Knowing C helps to learn C++ because almost everything valid in C is valid in C++; but the correct way to program C++ is learning it over from the beginning.

As I said, C++ is better for GUI and another componentized programming, while C is way better for low level hacks, possibly with embedded assembly, where performance and excessive full control is useful.

Nick_W

8:48 am on Jun 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I've switched tack entirely!

Kylix or Python I think. I really like the look of Kylix, has anyone any experience of it?

Nick

outrun

9:01 am on Jun 21, 2003 (gmt 0)

10+ Year Member



If you have used Borland products before, Kylix is really nice to use, although I after I put Redhat 7.3 on my machine it wont install or work at all, you can get the open version for free on the website to get you started, but first check if it supports your distro.

regards,
Mark

digi_mind

9:05 am on Jun 21, 2003 (gmt 0)

10+ Year Member



c++ and qt ... both come with red hat.

Nick_W

9:07 am on Jun 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just will not give THAT much info to anyone, even if I do want to download a FREE product. Borland can kiss my arse ;)

Python looks really neat. Very like PHP at first glance.....

Why would one use Python though? WHat is it best for?

Many thanks for all the great input guys!

Nick

Duckula

9:17 am on Jun 21, 2003 (gmt 0)

10+ Year Member



Why would one use Python though?

Small, non performance critical applications.

Its lowdowns are a somewhat high memory usage and bad performance where a memory array has to be traversed.

For its advantages, it is very powerful yet easy to use. Absolutely no danger involved, the worst thing I have done with it is taking all the memory and having it killed by the kernel. And I tried hard. It is very easy to integrate with C code, so it's possible to write modules for the most expensive functions.

The best popular example of an application developed on Python is the p2p tool bittorrent; very useful and fairly complex.

cminblues

9:18 am on Jun 21, 2003 (gmt 0)

10+ Year Member



I agree at all with Duckula about diffs between C and C++ and Python's C integration.

I'd add Perl, which is great not only to elaborate text.
I mean: if you're interested in network apps, using regex ['regular expressions', that comes with Perl]
is a powerful way to create custom, quick, [also relatively low-level->socket, if you want..] non-GUI client things :)

[and there's a lot of Perl docs-examples, on the net]

jaski

9:33 am on Jun 21, 2003 (gmt 0)

10+ Year Member



Why would one use Python though?

Python is cool.. of course IMHO ;)

..and I have heard they use it a lot at google

Nick_W

9:43 am on Jun 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep, python it is! ;)

How do I run scripts?

$>python script.pyt

Nick

Duckula

9:46 am on Jun 21, 2003 (gmt 0)

10+ Year Member



If emacs is not too barroque for you, get the python-mode and you'll run the script with Ctrl-c-c on a separate frame.

Nick_W

9:49 am on Jun 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm a Vim guy Duckula ;)

I just meant that once a script is wrtten, how is it executed? How does the PC know it's a python script?

Nick

Duckula

9:52 am on Jun 21, 2003 (gmt 0)

10+ Year Member



ok, I don't know too much about Vim but everything possible on emacs is possible there too, just look a bit.

Yes, run it from the prompt that way or place the shebang at the top and use it as an executable.

#!/usr/bin/python
import math
print math.sqrt(2)

etc... <added: 'chmod u+x test.py' of course...>

Nick_W

9:57 am on Jun 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Got it!

Thanks alot everyone, shame I gotta run now just when I discover a new toy, but duty calls.....

Cheers

Nick

tobyink

12:46 pm on Jun 21, 2003 (gmt 0)

10+ Year Member



Perl. Not only is it useful on the web, but it is entirely possible to write full-featured GUI applications in Perl (e.g. Mandrake's admin config utilities).

berli

2:43 am on Jun 22, 2003 (gmt 0)

10+ Year Member



Perl seems to be waning in popular, thanks to its reputation as a read-only language. I've starting learning it myself, but may end up on php. I have friends who rave about python.

Both friends and family who have used Tcl/Tk are unanimous in their disdain, indeed, utter hatred for it. Apparently, using "tickle" is a hair-pulling, teeth-grinding experience, although in some cases it's the only package that will do. :(

dingman

5:44 am on Jun 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've looked at the source code for a few Tcl/Tk programs, and even minimally edited one. (I used to use a desktopish program years and years ago that was written in Tcl and had config files that were straight Tcl sourced by the main program.) I've never seen so many deeply nested brackets. Apparently, Tcl is a language that consists entirely of lists of lists to arbitrary depth. (ot - Does that make it like Lisp?)

I've also used Tk with Perl, and while I doubt it's the windowing toolkit I'd use today, it wasn't bad.

What I have on the shelf right now to learn is a Python book, and I'm looking forward to it. I'm also starting to write some non-web stuff in PHP instead of Perl, and liking it better. It at least feels like my PHP code has a better chance of being legible a year from now than my Perl does. I haven't tried php-gtk yet, though. I just don't seem to do much gui programming, unless you count server-side web apps.

marcs

5:55 am on Jun 22, 2003 (gmt 0)

10+ Year Member



C for me. Used to write 680x0 assembly code and moved to C from there.

Most *nix code is C so that comes in handy in case you want to add features to or fix open source software.

bird

12:44 pm on Jun 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I see you have already made up your mind, but let's add a little support anyway... ;)

I can definitively recommend Python, and have done so many times [webmasterworld.com] already. Python can be used for pretty much everything, including hardcore number crunching if you use the numeric extensions [pfdubois.com].

You can plug into a variety of GUI modules very easily, most of which (except MFC) are cross-platform.

Other than with Perl, there's no danger to lose your overview in large and very large applications (the original E-Groups [now Yahoo groups] system was writting almost completely in Python). I am selling an application that consists (among other things) of 35k lines of Python code, all of which I have written myself, and I don't have any kind of CS degree.

About 98% of all application code is not performance critical, so that using a bytecode interpreted language like Python will not result in any noticeable slowdown. And once you have identified the few dozen lines of code that act as a bottleneck, it's almost trivial to recode those in C.

Memory consumption of a typical Python application is roughly 10% of what Java would require for the same functionality, which means it's not a factor on todays hardware (unless you're thinking about embedded systems).

Python is very easy to write, and even easier to read. I immediately get a headache when looking at Perl code for more than a minute (even *good* Perl code), but I can understand what most Python code does at first glance. Remember that when you program, most of the time you're reading and thinking, the actual coding is the smallest part of the job.

Python is also the language of Zope [zope.org], the coolest and most powerful web application server framework in existence.

I'm a Vim guy

Vim can be programmed directly in Python.

How does the PC know it's a python script?

By the *.py (resp. *.py[wco]) file name extension on Windows.
By the hashbang line on unix.

dingman

4:47 pm on Jun 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Remember that when you program, most of the time you're reading and thinking, the actual coding is the smallest part of the job.

:) Always an important thing to remember.

berli

12:07 am on Jun 26, 2003 (gmt 0)

10+ Year Member



Other than with Perl, there's no danger to lose your overview in large and very large applications (the original E-Groups [now Yahoo groups] system was writting almost completely in Python). I am selling an application that consists (among other things) of 35k lines of Python code, all of which I have written myself, and I don't have any kind of CS degree.

About 98% of all application code is not performance critical, so that using a bytecode interpreted language like Python will not result in any noticeable slowdown. And once you have identified the few dozen lines of code that act as a bottleneck, it's almost trivial to recode those in C.

Interesting. That wouldn't happen to be Yahoo!Group's buggy and slow web application, would it?


<ducking and running>

dingman

6:10 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't know about slow, but I wonder whether "buggy" isn't a manefestation of their anti-bot paranoia. A year or so ago I cobbled together a bot to copy all the messages out of an unlisted members-only group(*) I was a member of, and you wouldn't believe how many things they check to decide if you're a real person or not. Despite that, though, the inconsistencies in how their software behaved were much more of an impediment to processing than the assorted things that caused the entire page to be replaced with "shouldn't you be somewhere else?" (**).

* All the members of the group knew what I was doing and wanted it done.
** No, I shouldn't. I'm a member of the group, I have permission to read these posts. If I wish to do it with wget and a perl script that politely waits between requests, what's the difference? I identified myself as someone who is allowed to fetch this data, and I'm fetching it now.

SlowMove

6:34 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I really like the look of Kylix, has anyone any experience of it?

Kylix is Borland's object pascal for Linux. Never used it, but I did use Borland's object pascal for Windows, Delphi. A great product, but it's just no match for C/C++. More libraries, better documentation, etc.

dingman

6:36 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



(object pascal!= Oberon)?

bird

6:54 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oberon is the fourth generation in the family: Algol, Pascal, Modula-2, and Oberon. All of those have been invented by Niklaus Wirth primarily for research purposes (actually, I think Algol already existed, but he based the others on it).

Object Pascal is a variation of Pascal that Wirth didn't have any input on. This means that it is similar in Syntax to the other family members, but distincively different anyway.

Btw: Oberon isn't just a language. There's also an Oberon System, which is a complete OS for some custom hardware. Emulators of that system are also available for other OSes. It's really worth to have a look at that. Wirth is an extremely creative mind, and has invented many concepts in computing that will unfortunately never make it to the mainstream.

The genius of the Oberon System is in the "interclick". This means that you hold down one mouse button, and then click another one at the same time. Sounds strange at first, but gets easy after a few tries. With a three-button mouse, you get 8 actions that can be triggered this way, which is a very powerful way to operate a computer, once you're used to it.

dingman

7:53 pm on Jun 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm, I didn't know there were non-Wirth versions of Pascal.

Btw: Oberon isn't just a language. There's also an Oberon System, which is a complete OS for some custom hardware.

Does it come as a stand-alone language you can write programs in for other OSes? Part of the reason I've never played with it is that all I knew about was the full system.

Emulators of that system are also available for other OSes.

Any of those other OSes relevant to this forum? It's been a long time since I've used Pascal, but it was my first language (unless you count English and BASIC) and everything I know suggests I'd like the rest of the family. I'm not sure how practical they are, since I'm not in a research setting (or rather the research going on around me has nothing to do with either of my fields), but it might be fun to play with anyway.
This 46 message thread spans 2 pages: 46