LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Closed Thread
  Search this Thread
Old 08-25-2012, 06:52 PM   #1
Mercury305
Member
 
Registered: Jul 2012
Location: Rockville, MD
Distribution: CrunchBang / Ubuntu
Posts: 540

Rep: Reputation: Disabled
Python and Lisp


This may appear OT in a Slackware forum. However I wanted to post this here to get some ideas from Slackware users. I have been studying a lot of computer science lately at home. Reading and what not in the last few weeks. I really am taking this seriously and quite focused. I seem to talk to very brilliant people on LQ and in this slackware forum so wanted some ideas. I was researching some programming languages and thought of starting out with Python at first but later grew quite attracted to Lisp as well. Anyone in here with experience of these languages and if it would be ok for me to start Lisp first before Python? I love the interaction between Computers and Humans in Lisp and am quite attracted to it. Especially from reading some things from Peter Norvig about it. I also noticed some great libraries for Slackware for Lisp as well. Anyways just wanted some feedback. Thanks
 
Old 08-25-2012, 07:06 PM   #2
abrinister
Member
 
Registered: Dec 2010
Location: Boston, MA, USA
Distribution: Arch Linux
Posts: 460

Rep: Reputation: 38
Lisp is a pretty good beginner language. Python is too though. Both are scripting languages so they are much easier than, say, C. I'm going to learn Lisp when I go back to school in September in a Programming class. I've heard great things about it. There's a derivitive of Lisp called Racket. They also provide an IDE for it. There's a slackbuild for it here.

The Python interpreter comes with Slackware. The Python website provides a massive tutorial on the language. Here is Python 2.7 and 3.0.

Alex Brinister
 
Old 08-25-2012, 08:47 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Learning LISP first will make you a better Python programmer.
 
1 members found this post helpful.
Old 08-25-2012, 08:52 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Ummm.....nitpicker here....

I think of Python as an interpreted language---I think there's a subtle difference between that and "scripting". To me, the latter implies automating tasks in the native dialect of the shell. BASH, for example, with no real math capability, could hardly qualify as a real programming language. Python, OTOH, has all the bells and whistles.
 
Old 08-25-2012, 08:53 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by dugan View Post
Learning LISP first will make you a better Python programmer.
What is your basis for that?
 
Old 08-25-2012, 09:38 PM   #6
ttk
Senior Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware64
Posts: 1,038
Blog Entries: 27

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by pixellany View Post
What is your basis for that?
He's right. Python incorporates many syntactical features from LISP and other functional programming languages (like lambdas), and sometimes there's no better way to get it to perform decently than to use them.

For instance, these are both ways to do the same thing in Python (populate a list from passing the values in another list through a function).

example #1:
Code:
some_list = list()
for v in another_list:
    some_list.append(f(v))
example #2:
Code:
some_list = list(f(v) for v in another_list)
If you're like me and you learned C first, example #1 will seem more natural. Example #2 is considered more "pythonically correct", though, and runs a lot faster (about 50% faster on my hardware, using python 2.6.4). Learning LISP first will help make such syntax more intuitive to you.
 
Old 08-26-2012, 03:06 AM   #7
Mark Pettit
Member
 
Registered: Dec 2008
Location: Cape Town, South Africa
Distribution: Slackware 15.0
Posts: 619

Rep: Reputation: 299Reputation: 299Reputation: 299
Speaking as a Python freak, I have to say that once you learn and use Python, all other languages just lose their appeal. If this is your first language, then Python is definitely the way to go. However, LISP is a great language, and learning it will influence the way you think about programming. And it will improve any coding you do (unless you code in COBOL, in which case you're doomed). Look up 'Paul Graham' - he's a smart fellow with lots to say about LISP, Python, and other nice geekie stuff.
 
1 members found this post helpful.
Old 08-26-2012, 05:38 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Thanks for the enlightenment on commonality between LISP and Python. I have started to learn Python (----several times... ), but never looked at LISP.

Without knowing any better, perhaps i should have suggested that--if you want to learn Python--you should learn Python.
 
Old 08-26-2012, 07:15 AM   #9
Mercury305
Member
 
Registered: Jul 2012
Location: Rockville, MD
Distribution: CrunchBang / Ubuntu
Posts: 540

Original Poster
Rep: Reputation: Disabled
According to Peter Norvig Python is a dialect of Lisp and Lisp has many dialects. I am thinking Python may be a better language to learn 1st but quite attracted to Lisp as well.
PS If I wanted to learn a scripting language it would be shell scripting. But Python and Lisp is a whole lot more then that. and yes, it could be used for scripting as well which is very cool.

Last edited by Mercury305; 08-26-2012 at 07:30 AM.
 
Old 08-26-2012, 07:23 AM   #10
Mercury305
Member
 
Registered: Jul 2012
Location: Rockville, MD
Distribution: CrunchBang / Ubuntu
Posts: 540

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ttk View Post
He's right. Python incorporates many syntactical features from LISP and other functional programming languages (like lambdas), and sometimes there's no better way to get it to perform decently than to use them.

For instance, these are both ways to do the same thing in Python (populate a list from passing the values in another list through a function).

example #1:
Code:
some_list = list()
for v in another_list:
    some_list.append(f(v))
example #2:
Code:
some_list = list(f(v) for v in another_list)
If you're like me and you learned C first, example #1 will seem more natural. Example #2 is considered more "pythonically correct", though, and runs a lot faster (about 50% faster on my hardware, using python 2.6.4). Learning LISP first will help make such syntax more intuitive to you.
Thanks I will be starting a biweekly course studying the MIT Book: Structure and Interpretations of Computer Programming (SICP)
with slashdot.org contributers. It uses Lisp in that book.
I will be around people that have contributed to Slackware too. I'm pretty excited.

Last edited by Mercury305; 08-26-2012 at 07:27 AM.
 
Old 08-26-2012, 07:26 AM   #11
Mercury305
Member
 
Registered: Jul 2012
Location: Rockville, MD
Distribution: CrunchBang / Ubuntu
Posts: 540

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dugan View Post
Learning LISP first will make you a better Python programmer.
Thats great as I am starting with Lisp. Even though most people say learning python first is best that I listened to. But I agree with what you say.
 
Old 08-26-2012, 07:36 AM   #12
Mercury305
Member
 
Registered: Jul 2012
Location: Rockville, MD
Distribution: CrunchBang / Ubuntu
Posts: 540

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Mark Pettit View Post
Speaking as a Python freak, I have to say that once you learn and use Python, all other languages just lose their appeal. If this is your first language, then Python is definitely the way to go. However, LISP is a great language, and learning it will influence the way you think about programming. And it will improve any coding you do (unless you code in COBOL, in which case you're doomed). Look up 'Paul Graham' - he's a smart fellow with lots to say about LISP, Python, and other nice geekie stuff.
thanks ill take your advice
 
Old 08-26-2012, 09:41 AM   #13
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
I love Python for it simplicity and elegance. Lack of curly braces and semicolons seem to be strange at first, but once you start coding in Python you won't miss them. In fact, the extra typing required for curly braces and semicolons will irritate you.

Very practical programming language for a wide variety of uses (except low-level systems programming of course).
 
Old 08-26-2012, 10:22 AM   #14
qweasd
Member
 
Registered: May 2010
Posts: 621

Rep: Reputation: Disabled
LISP (along with C, if anyone cares) is my favorite programming language. It makes me sound clever. If you'd like to learn Common Lisp in particular--my favorite dialect--here's a nice book I found most useful as a tutorial.

I don't know whether it matters that much which language is your first. I wish I learned LISP or C or some kind of Assembly first, but instead (iirc) it was MSX BASIC (which is a language AND an OS) on one of these. I feel like I obtained most of my skill while studying C and LISP, but I never felt handicapped by BASIC. It was fun
 
Old 08-26-2012, 12:13 PM   #15
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by pixellany View Post
What is your basis for that?
The functional programming techniques that you master with LISP are very much applicable to Python (and to Javascript), and they result in very elegant Python code when used.

There's also the fact that the SICP takes you further and deeper than any Python book would.

Last edited by dugan; 08-26-2012 at 12:16 PM.
 
  


Closed Thread



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
LXer: Lisp Coding Bounty (get a copy of Land of Lisp) LXer Syndicated Linux News 0 10-23-2011 06:41 PM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
Lisp, Ruby, or python nesrail Programming 20 01-27-2009 02:49 AM
LISP or COMON LISP Compiler for Debian carspidey Programming 3 04-19-2006 07:46 AM
Lisp, emacs-lisp aizkorri Programming 1 09-04-2002 06:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:00 PM.

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