
The depth and breadth of Python - fogus
http://neopythonic.blogspot.com/2011/06/depth-and-breadth-of-python.html
======
akwjhcaplf
We've disassembled and decompiled the "obfuscated" bytecode, and we have to
say that a few of their constructs are _very_ interesting. The custom memory
allocator is very nifty, and along with a few other things gleaned from their
binaries has proven very useful and educational to take apart and discover.

~~~
evangineer
When I read the article, I wasn't very convinced the obfuscated Python
bytecode couldn't be decompiled. There have been Python bytecode decompilers
around for years.

------
sriramk
I have to admit, that life does sound awesome.

If any of the Dropbox folks are around, why not wxPython everywhere? Why the
switch to the PyObjc?

~~~
nuclear_eclipse
IIRC, I read somewhere that wxPython didn't get completely native looking UI
elements, or didn't support some of the native OSX UI paradigms that they
wanted to use. Their goal was to get 100% native UI and UX on each platform,
and the only way to do that on OSX was with PyObjc.

~~~
evangineer
Cocoa support in wxPython is coming along but isn't 100% there yet:

[http://groups.google.com/group/wxpython-
users/browse_thread/...](http://groups.google.com/group/wxpython-
users/browse_thread/thread/85fb9c4262633d80)

------
thurn
Has there been any research done on programming language readability for non-
programmers? I think that that would be extremely interesting.

~~~
irahul
Interesting for sure but what purpose would it serve?

Programming languages are meant for programmers. A survey of non-programmers
on programming would be something on the lines of non-math people on math
symbols.

~~~
_delirium
I've heard an argument that Python, of the widely used languages, comes
closest to being "executable pseudocode", simultaneously actually code and yet
readable as an informal algorithm description. It'd be interesting to know if
that were true.

~~~
derleth
If there's one thing I've learned from studying programming languages, it's
that human minds are extremely diverse, especially when it comes to designing
notations.

For some programmers, their 'executable pseudocode' language is Haskell, or
Forth, or maybe even the assembly language of some specific piece of hardware.
Some people might naturally think in COBOL.

Also, the problem domain can dictate some of the shape of the language:
Something that's built out of a mathematical expression is almost always going
to be expressed most compactly as that expression in standard mathematical
notation, with something like APL coming close to being the 'executable
pseudocode' form of that program. That said, there are almost always many ways
to solve the same problem.

~~~
andrewflnr
I haven't actually programmed in Haskell, but once I started reading about it,
my pseudo-code started to look like it, especially type declarations and
inline conditionals. Other times, I use more Python-y (won't say Pythonic)
syntax.

So even in one person, it can vary.

------
Sukotto
Would someone please explain what he means by "pattern matching" in this
context?

~~~
adamtulinius
Pattern matching is the process of defining multiple functions with the same
number of arguments, where the arguments decide which function to execute.

E.g.: foo(0) -> 1; foo(n) -> foo(n) * foo(n-1).

calls to foo(0) would execute the first function, while all other calls would
execute the 2nd. Note that it is often necessary to define the functions in
order of most specific first.

A similar concept in Erlang is guards, where an expression can be evaluated
instead of simple pattern matching.

foo(n) where n == 0 -> 1; foo(n) -> foo(n) * foo(n-1).

Might have screwed up on the Erlang notation in that example though.

~~~
adamtulinius
This is why you don't write code before your morning shot of caffeine
(unending recursive function calls). Meh.

------
sigil
So if there are changes I'd like to see in Python, I should lobby Guido in
person?

Yes I know, Python has a fairly decentralized control structure and a nice
open process in the form of PEPs. There was just something about this post
that made me a bit uncomfortable...scratching phantom itches from old,
somewhat exotic languages...

~~~
js2
<http://en.wikipedia.org/wiki/Benevolent_Dictator_For_Life> ?

------
endlessvoid94
Pattern matching in python sounds like a GREAT idea.

~~~
almost
That would be incredible, I really miss pattern matching when writing Python
code. Fitting it into the existing style of syntax and the language semantics
is a problem though.

Pattern matching in list comprehensions would be awesome too. List
comprehensions are very cool in Python but they're so much cooler in Haskell
:)

------
Apocryphon
I was just reading a bunch of older articles from 2009 lamenting MIT changing
their intro course from Scheme to Python. I wonder if this sort of article
would have been helpful in that debate.

~~~
Legion
I doubt it. The debate wasn't an indictment of Python, but rather resistance
to the idea of replacing SICP (of which Scheme use was simply an
implementation detail) with _anything_ else.

------
cpeterso
I love Python as a language, but I am frustrated by its dynamic typing. I'm
surprised there has been more research into static type inference for Python
(and JavaScript). Google App Engine's Python libraries implement manual type
checking of API parameters (with _typeof_ and exception raising) to make the
APIs harder to misuse.

The Boo programming language is heavy influenced by Python, but includes
static typing and type inference. Unfortunately, Boo requires the .NET
Runtime.

------
jbellis
Too bad -- I guess dropbox isn't doing anything to get efficient
what's-changed notifications from the OS, then (since the only platform-
specific code is the UI). Because those hooks are not at all cross-platform.

/probably obvious to all you actual dropbox users

~~~
dhouston
UI isn't the only platform-specific thing in the code; we have a bunch of
(non-Python) native code on each platform to monitor filesystem changes.

~~~
mikle
Totally unrelated request - you posted your YC application a few years ago,
but the link 404s. If this is intentional, you can forget it, but if not, I'd
really would like to see it,

Link in question is: <http://files.dropbox.com/u/2/app.html>

Original submission: <http://news.ycombinator.com/item?id=801503>

Thanks in advance! Dropbox is really an amazing product, even to techies.

------
DrJ
Funny, I remember Prof. Hilfinger going off on about style during a lecture
for a course using Java.

