Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Lisp Vs. Python

Name: Anonymous 2012-11-27 21:29

I am looking to learn another programming language, I am a bit of a newbie but I know C, Java, and C++ rather well and am looking to expand.

I am interested in AI so I am considering Lisp.
But I also hear python is on the rise so I am considering that.

Which should I choose and why?

Name: Anonymous 2012-11-27 21:31

Python is basically a better Lisp. Most academic AI research is done in Python, so I think that'd be a better language to learn if you really want to do AI.

Name: Anonymous 2012-11-27 21:32

Picking a programming language for its popularity is something only enterprise code monkeys would do.

Lisp is pretty interesting and almost orgasmic to learn (if you're an autistic fuck). Python is pretty good for ``quick niggerings''.

Name: Anonymous 2012-11-27 21:32

>>2
Everything about this post is wrong. Please disregard it. Thank you for your time.

Name: Anonymous 2012-11-27 21:34

>>4 explain?

Name: Anonymous 2012-11-27 21:35

Python is basically a better Lisp. Most academic AI research is done in Python
You helped him!

Name: Anonymous 2012-11-27 21:39

I am interested in AI so I am considering Lisp.
Have you considered, gee, I dunno, math?

Name: Anonymous 2012-11-27 21:40

I am pre uni ATM so I expect to learn a bunch of math there,

however a baseline that can be applied to AI is what I am going for now

Name: Anonymous 2012-11-27 21:40

>>5
You have no idea what you're getting yourself into. Lisp is not a programming language, it's an idea. Lisp is the idea that a computer program is a list of symbols. Superficially, that may just sound like another description of a representation of a computer program, but really, it is the only way of representing a computer program.  Program quoting is a primitive feature, because code and data are all one fluid format.

A program is just a list, and the first element is a function.

With Lisp, anything is possible.

Name: Anonymous 2012-11-27 21:41

>>9 cryptic and deep

go on?

Name: Anonymous 2012-11-27 21:44

G-gosh, >>9.... Does this mean Lisp is the language of the sefirot??

Name: Anonymous 2012-11-27 21:45

>>10
With other languages, you have to concern yourself with things like data structures and algorithms. Lisp isn't about data structures or algorithms, it's about conjuring the spirits of computers with your spells.

Want to transpose a matrix?

SIM SALABIM!
(apply map list n)

Name: Anonymous 2012-11-27 21:47

SIM SALABIM!
As-Salamu Alakyum Allah Boom, Ahmed!

Name: Anonymous 2012-11-27 21:48

Lisp is the idea that a computer program is a list of symbols.
No, Lisp is the idea that a list of symbols needs a jumbled mess of toenails in it. If you don't have a foot fetish, check out Factor, Joy, Cat, or Forth instead.

Name: Anonymous 2012-11-27 21:49

>>11
Yid Yid Kosher Shalom aleikhem, Shlomo!

Name: Anonymous 2012-11-27 21:49

It seems people are rather polar on Lisp

Name: Anonymous 2012-11-27 21:50

POLARIZE MY ANUS

Name: Anonymous 2012-11-27 21:54

>>17

It'd be a shame if thats how this thread ended...

Name: Anonymous 2012-11-27 21:57

>>18
Well, fucking shame it is.
POLARIZE MY ANUS

Name: Anonymous 2012-11-27 22:16

(polarize my-anus)

Name: Anonymous 2012-11-27 22:28

Lisp and Haskell if you actually want to expand your knowledge of programming languages.

I wouldn't know for AI, my knowledge is sort of rudimentary. I think the actual theory would trump the language here. So the answer here is ``a book''.

If you want to get into that Machine Learning thing that's all the rage, you'll need to learn statistics, and maybe some signal processing, first. Ironically, most applications here seem to be computer-intensive and geared towards number-crunching, so your knowledge of C-derivatives would serve you well.

Name: Anonymous 2012-11-27 22:43

- Everything you write will be open source. No FASLs, DLLs or EXEs. Developer may want to have control over the level of access to prevent exposure of internal implementation, as it may contain proprietary code or because strict interface/implementation decomposition is required. Python third-party library licensing is overly complex. Licenses like MIT allow you to create derived works as long as you maintain attrubution; GNU GPL, or other 'viral' licenses don't allow derived works without inheriting the same license. To inherit the benefits of an open source culture you also inherit the complexities of the licensing hell.
- Installation mentality, Python has inherited the idea that libraries should be installed, so it infact is designed to work inside unix package management, which basically contains a fair amount of baggage (library version issues) and reduced portability. Of course it must be possible to package libraries with your application, but its not conventional and can be hard to deploy as a desktop app due to cross platform issues, language version, etc. Open Source projects generally don't care about Windows, most open source developers use Linux because "Windows sucks".
- Probably the biggest practical problem with Python is that there's no well-defined API that doesn't change. This make life easier for Guido and tough on everybody else. That's the real cause of Python's "version hell".
- Global Interpreter Lock (GIL) is a significant barrier to concurrency. Due to signaling with a CPU-bound thread, it can cause a slowdown even on single processor. Reason for employing GIL in Python is to easy the integration of C/C++ libraries. Additionally, CPython interpreter code is not thread-safe, so the only way other threads can do useful work is if they are in some C/C++ routine, which must be thread-safe.
- Python (like most other scripting languages) does not require variables to be declared, as (let (x 123) ...) in Lisp or int x = 123 in C/C++. This means that Python can't even detect a trivial typo - it will produce a program, which will continue working for hours until it reaches the typo - THEN go boom and you lost all unsaved data. Local and global scopes are unintuitive. Having variables leak after a for-loop can definitely be confusing. Worse, binding of loop indices can be very confusing; e.g. "for a in list: result.append(lambda: fcn(a))" probably won't do what you think it would. Why nonlocal/global/auto-local scope nonsense?
- Python has a faulty package system. Type time.sleep=4 instead of time.sleep(4) and you just destroyed the system-wide sleep function with a trivial typo. Now consider accidentally assigning some method to time.sleep, and you won't even get a runtime error - just very hard to trace behavior. And sleep is only one example, it's just as easy to override ANYTHING.
- Crippled support for functional programming. Python's lambda is limited to a single expression and doesn't allow conditionals. Python makes a distinction between expressions and statements, and does not automatically return the last expressions, thus crippling lambdas even more. Assignments are not expressions. Most useful high-order functions were deprecated in Python 3.0 and have to be imported from functools. No continuations or even tail call optimization: "I don't like reading code that was written by someone trying to use tail recursion." --Guido
- Python's syntax, based on SETL language and mathematical Set Theory, is non-uniform, hard to understand and parse, compared to simpler languages, like Lisp, Smalltalk, Nial and Factor. Instead of usual "fold" and "map" functions, Python uses "set comprehension" syntax, which has overhelmingly large collection of underlying linguistic and notational conventions, each with it's own variable binding semantics. This, in effect, makes Python look like an overengineered toy for math geeks. Good luck discerning [f(z) for y in x for z in gen(y) if pred(z)] from [f(z) if pred(z) for z in gen(y) for y in x]. In addition, you will enjoy cryptic expressions like z(*z(*m.i())[::-1]).
- Forced Indentation of Code (aka "off-side" rule) impedes using CLI, automatically generating Python code and moving around large code blocks. Editing Python code requires special editors (forget about Word/Notepad), that expand tabs into spaces, while sharing code through a web post or email will most likely break indentation. Absence of block-terminator is so utterly confusing, that you'll find yourself ending blocks with #endif anyway. It's painful to deal with other things that need indenting, such as large SQL queries, or HTML when you're using things like mod_python.
- Python hides logical connectives in a pile of other symbols: try seeing "and" in  "if y > 0 or new_width > width and new_height > height or x < 0".
- Python indulges messy horizontal code (> 80 chars per line), where in Lisp one would use "let" to break computaion into manageable pieces. Get used to stuff like self.convertId([(name, uidutil.getId(obj)) for name, obj in container.items() if IContainer.isInstance(obj)])
- Quite quirky: triple-quoted strings seem like a syntax-decision from a David Lynch movie, and double-underscores, like __init__, seem appropriate in C, but not in a language that provides list comprehensions. There are better ways to mark certain features as internal or special than just calling it __feature__. self everywhere can make you feel like OO was bolted on, even though it wasn't.
- Python has too many confusing non-orthogonal features: references can't be used as hash keys; expressions in default arguments are calculated when the function is defined, not when it’s called. Why have both dictionaries and objects? Why have both types and duck-typing? Why is there ":" in the syntax if it almost always has a newline after it? The Python language reference devotes a whole sub-chapter to "Emulating container types", "Emulating callable Objects", "Emulating numeric types", "Emulating sequences" etc. -- only because arrays, sequences etc. are "special" in Python. Subtle data types (list and tuple, bytes and bytearray) will make you wonder "Do I need the mutable type here?", while Clojure and Haskell manage to do with only immutable data.
- Python's GC uses naive reference counting, which is slow and doesn't handle circular references, meaning you have to expect subtle memory leaks and can't easily use arbitrary graphs as your data. In effect Python complicates even simple tasks, like keeping directory tree with symlinks.
- Patterns and anti-patterns are signs of deficiencies inherent in the language.  In Python, concatenating strings in a loop is considered an anti-pattern merely because the popular implementation is incapable of producing good code in such a case. The intractability or impossibility of static analysis in Python makes such optimizations difficult or impossible.
- Problems with arithmetic: no Numerical Tower (nor even rational/complex numbers), meaning 1/2 would produce 0, instead of 0.5, leading to subtle and dangerous errors.
- Poor UTF support and unicode string handling is somewhat awkward.
- No outstanding feature, that makes the language, like the brevity of APL or macros of Lisp. Python doesn’t really give us anything that wasn’t there long ago in Lisp and Smalltalk.

Name: Anonymous 2012-11-27 23:07


no legalise abortions

Name: Anonymous 2012-11-27 23:51

The best thing you can do is study mathematics. You'll find most conceptual things there anyway.

Name: Anonymous 2012-11-28 1:19

>>22
Someday I'll scavenge /prog/ to collect these.

Name: Anonymous 2012-11-28 1:48

>>25
Someday, you'll scavenge my anus.

Name: Anonymous 2012-11-28 5:51

>>26
been there, done that

Name: Anonymous 2012-11-28 9:16

I like LISP conceptually but the reality is what I can do in a minute with FIOC takes ten to implement in LISP

Name: Anonymous 2012-11-28 9:28

>>28
Sounds like you're not doing the right things.

Name: Anonymous 2012-11-28 9:42

If Lisp was good enough for the Sussman, it is as hell good enough for me!

Name: Anonymous 2012-11-28 9:49

The only significant LISP products you see are that yahoo webstore Paul Graham is still banging on about decades later, and whatever that shitty ticket store was. MIT gave up on it too, they now teach with Python.

Name: Anonymous 2012-11-28 10:15

Year of Lisp on the desktop

Name: Anonymous 2012-11-28 10:46

Symta (LISP-based language):

Grammar = split “|” «sentence    = (noun_phrase verb_phrase)
                    |noun_phrase = (Article Noun)
                    |verb_phrase = (Verb noun_phrase)
                    |Article     = the a
                    |Noun        = man ball woman table
                    |Verb        = hit took saw liked»
generate P:xs?=mapc r P; P:rewrites=P,pick,r; P=P
rewrites Category = Grammar|c:[@_ [(Category) “=” @RHS] @_] RHS


Python:

from random import choice

def Dict(**args): return args

grammar = Dict(
        S = [['NP','VP']],
        NP = [['Art', 'N']],
        VP = [['V', 'NP']],
        Art = ['the', 'a'],
        N = ['man', 'ball', 'woman', 'table'],
        V = ['hit', 'took', 'saw', 'liked']
        )

def generate(phrase):
    "Generate a random sentence or phrase"
    if isinstance(phrase, list):
        return mappend(generate, phrase)
    elif phrase in grammar:
        return generate(choice(grammar[phrase]))
    else: return [phrase]
   
def generate_tree(phrase):
    """Generate a random sentence or phrase,
     with a complete parse tree."""
    if isinstance(phrase, list):
        return map(generate_tree, phrase)
    elif phrase in grammar:
        return [phrase] + generate_tree(choice(grammar[phrase]))
    else: return [phrase]

def mappend(fn, list):
    "Append the results of calling fn on each element of list."
    return reduce(lambda x,y: x+y, map(fn, list))

>>> generate('S')
['the', 'man', 'saw', 'the', 'table']

>>> ' '.join(generate('S'))
'the man saw the table'

Name: Anonymous 2012-11-28 11:04

Please don't learn LISP.
I don't like it when newfags try to eat into my job market

Name: Anonymous 2012-11-28 11:26

>>34
That's a real problem when the market is tiny as fuck

Name: Anonymous 2012-11-28 12:18

>>35
It's better this way. You get paid more because it's considered exotic.
Same goes for periods COBOL and FORTRAN. I'm glad even thr universities now helps to scare off newfags from it.

Name: Anonymous 2012-11-28 12:31

>>33
Symta is amazing.

Name: Anonymous 2012-11-28 12:36

Please don't learn Symta.
I don't like it when newfags try to eat into my job market

Name: Anonymous 2012-11-28 13:18

Please don't learn Ruby.
I don't like fags.

Name: Anonymous 2012-11-28 13:21

>>36 I was in town for Thanksgiving, and my father is going back to work to pay for a summer home, and he has had offers up to 85/hr, for writing COBOL.

The problem is that the system is so unorganized, they can't pay anybody to port it to something more capable, they're trapped in a pile of shit, and my father was smart enough to take advantage of the situation.

Name: Anonymous 2012-11-28 13:38

>>31
Hacker New, the Mecca of Silicon Valley, is written in Lisp.

Name: Anonymous 2012-11-28 13:42

Please don't learn Python.
I don't like it when newfags indent their code.

Name: Anonymous 2012-11-28 13:57

>>41
That's what this fundamentalist sect wants you to believe Ahmed.

Name: Anonymous 2012-11-28 14:04

                    ()---()                       ()---()
                ,___( ^_^ )___,               ,___( ^.^ )___,
               (____       ____)*HUGS'N'HUGS*(____  _ _  ____)
                    ( H*B )                       ((#' ))
                  _./ .-. \._                   _./ `.' \._
        Python   (___/   \___)                 (___/   \___)   Lisp

Name: Anonymous 2012-11-28 15:00

SIM SALA BIM!

Name: Anonymous 2012-11-28 16:50

Salam!

Name: Anonymous 2012-11-28 18:28

>>22
I expected this to be a shitpost, but it was actually VIP QUALITY!

Name: Anonymous 2012-11-28 18:37

>>47
Now, paste it every time Python is mentioned.

Name: Anonymous 2012-11-28 19:01

>>47
Are you new here?

Name: Anonymous 2012-11-28 19:37

>>49
So what, imbecile?

Name: Anonymous 2012-11-28 19:40

>>50
New people usually come from /g/, and that's not an indicator of good posting quality.

I'm worried about it because people like you usually shit up the place.

Name: Anonymous 2012-11-28 19:41

( ͡° ̮ʖ ͡°)

Name: Anonymous 2012-11-28 19:42

╚═( ಠ_ಠ )═╝
╚═(███)═╝
╚═(███)═╝
.╚═(███)═╝
..╚═(███)═╝
…╚═(███)═╝
…╚═(███)═╝
..╚═(███)═╝
.╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
.╚═(███)═╝
..╚═(███)═╝
…╚═(███)═╝
…╚═(███)═╝
..╚═(███)═╝
.╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
.╚═(███)═╝
..╚═(███)═╝
…╚═(███)═╝
…╚═(███)═╝
..╚═(███)═╝
.╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
.╚═(███)═╝
..╚═(███)═╝
…╚═(███)═╝
…╚═(███)═╝
..╚═(███)═╝
.╚═(███)═╝
╚═(███)═╝
╚═(███)═╝
.╚═(███)═╝
..╚═(███)═╝
…╚═(███)═╝
…╚═(███)═╝
…..╚(███)╝
……╚(██)╝
………(█)
……….*

Name: Anonymous 2012-11-28 19:44

>>51
I'm not >>47, faggot. I have never been to /g/ and I don't give a shit about shopping stories from fat first-world children.

Name: Anonymous 2012-11-28 19:47

Really, this is too bad that we don't have post count, date of inscription and karma in our profiles.

Name: Anonymous 2012-11-28 19:49

>>54
Why would you defend a shitposter then? Why would you age your post when you don't have anything to contribute?

You are new here.

Name: Anonymous 2012-11-28 19:52

>>55
``lol ur a redditor XD le mfw when le 2012 /prog/ is shit rofl XD le meme old glasses face'' sure is going to make you less annoying.

Name: Anonymous 2012-11-28 20:15

Hey, I know.

I am going to tell my story on /b/ and /g/, how I come from http://dis.4chan.org/prog/ and how I was told to go ``back'' on their boards. I will ask them politely and convincingly to come here and testify that they don't know who the fuck I am.

>>56
I saw how >>47 made a faux-pas by revealing he never read the Python kopipe. I tried to give him a gentle hint in >>48 but I knew that the imbeciles will still post some arrogant shit in the sole purpose of convincing themselves that they are old ``oldfags'' in the known.

Karma, post count and date of inscription, you can't do without that, western scum.

Name: Anonymous 2012-11-28 20:22

there's no reason to not use javascript nowadays

Name: Anonymous 2012-11-28 20:24

>>58
Your hint was subtler (and probably more intelligent) than mine. You're right, I think I overdid it, but the sudden influx of /g/ users is worrying (and annoying) me. I mean, even the past influx of /b/ users were moderately better than this.

Anyway, sorry if I was being a faggot. Carry on, good sir.

Name: Anonymous 2012-11-28 20:44

>>60
No, it looks like it has been this way for a long time.

Name: Anonymous 2012-11-28 20:48

>>61
What do you mean? /g/ only ``got interested'' in this board since they put the link there, if that's what you mean.

Name: Anonymous 2012-11-28 21:56

>>59
truth

Name: Anonymous 2012-11-28 22:05

>>59,63
Different people, none of them is the Javashit kike, they don't come from /g/.

Name: Anonymous 2012-11-28 22:08

>>59,63,64
back to /z/, please.

Name: Anonymous 2012-11-28 22:09

>>65
Why the fuck did you lump me with the /g/ kike? Are you a kike?

Name: Anonymous 2012-11-28 22:12

>>66
You defended him, so you must be him.

Name: Anonymous 2012-11-28 22:19

>>67
Where the fuck did I defend him, fagshit? And what kind of flawed logic is thaIHBT

Name: Anonymous 2012-11-28 22:32

>>68
Different people, none of them is the Javashit kike, they don't come from /g/.

Name: Anonymous 2012-11-29 18:10

>>41
le reddit was also written in Lisp, but because it exceeded a dozen hits an hour (unlike hackerjews) they had to reimplement it in Python. I think that tells the whole story.

Name: Anonymous 2012-11-29 18:11

>>69
Oh. Your sarcasm detector is brokeIHBT again

Name: Anonymous 2012-11-29 18:19

>>70
but because it exceeded a dozen hits an hour (unlike hackerjews) they had to reimplement it in Python
I don't get it. You mean they did it for performance? I hope not.

Name: Anonymous 2012-11-30 10:14

>>72
Yes

Don't change these.
Name: Email:
Entire Thread Thread List