So I was thinking about picking up some toy-language some day. I'm used to the real stuff (think C and friends), and the non-practical stuff (like LISP/SICP, although I'm certainly no expert on that - hard to become one, since you can't do anything useful), but I can see how these scripting-language-in-asteroids things can be attractive.
So, since Python 3 was released recently, I took a look.
What the fuck, man? This isn't "revolutionary" at all, it's a 10-times-slower C with a arguably prettier syntax.
It's missing CRITICAL features like coroutines (when you have a fork called "stackless Python", you know you're in trouble). Threading is pure shit - the GLOBAL INTERPRETER LOCK literally ruins any of the language's future prospects.
They first think I take a look at, basic types, starts showing serious trouble. And I quote: Floating point numbers are implemented using double
in C—all bets on their precision are off unless you
happen to know the machine you are working with.
That's great. An interpreted non-deterministic language. And even though it doesn't offer anything resembling a guarantee about the results of a FP computation, it goes ahead and picks up the slow type, just in case it ran too fast otherwise.
Immediately below I see: pow(x, y) x to the power y
x ** y x to the power y
Oh, I see. This must be a great example of that "there should be one—and preferably only one—obvious way to do it ".
The sad thing is that I'm starting to fear it's amongst the best toy-but-remotely-useful languages.
It's missing CRITICAL features like coroutines
True. PEP 342 may or may not help.
That's great. An interpreted non-deterministic language.
Doesn't matter outside ivory towers. If you know you absolutely need a certain precision, you know how to get it.
Oh, I see. This must be a great example of that "there should be one—and preferably only one—obvious way to do it ".
That's actually one of the most obvious deviations. I don't know the reasoning behind it, but I guess there is some.
The sad thing is that I'm starting to fear it's amongst the best toy-but-remotely-useful languages.
Sadly, it is. Not only `amongst the', but `the', all things considered.
>>1 I can tell you are serious because of the BBCODE
Name:
Anonymous2008-12-05 21:43
>>1
What it lacks in speed it makes up for it's built in library's. Just press F1.
Name:
Anonymous2008-12-06 8:14
In many cases, programmer time is more expensive than computer time. Python is intended for cases such as these.
For the majority of my projects, Python's syntax and libraries are a great asset. Doing the same shit in C would be just a needless use of programmer time.
Name:
Anonymous2008-12-06 13:13
Ruby is the answer.
Name:
Anonymous2008-12-06 13:20
Too bad Ruby is slow as fuck.
Name:
Anonymous2008-12-06 13:53
In many cases, anal rape is more important than getting shit done. Python is intended for cases such as these.
>>12
Which of the VMs the languages are implemented on are we talking about here?
Name:
Anonymous2008-12-06 14:27
You stupid fucks. If you really need that kind of speed you don't use scripting languages in the first place. If you're absolutely sure you need to, you rewrite the speed-critical portions of your application in a lower level language and integrate it with the rest of your app, the majority of which is a higher level language. You use the right tool for the job. This has been common knowledge amongst engineers and programmers for decades that shouldn't even need to be stated. What the fuck did that unquestionable guru say about premature optimization being the root of all evil? I believe it was Knuth.
Having said that, integrating Python and C is a pain in the ass in comparison to say, Lua and C.
Name:
Anonymous2008-12-06 14:29
>>14 Having said that, integrating Python and C is a pain in the ass in comparison to say, Lua and C.
Or Java and C
Name:
Anonymous2008-12-06 14:31
>>14 Yes, but LUA is slowest computer programing language. In existence.
80% of the posters on this board would be better off if they read all of this before ever deciding to post here again: http://c2.com/cgi/wiki?WelcomeVisitors Almost every node in here
Code Complete
The Pragmatic Programmer
Programming Pearls
Refactoring
Beautiful Code
How to Solve It
Mathematics and Plausible Reasoning
get your ass to a good uni library or a good usenet subscription and alt.binaries.e-books.technical
>>21 Beautiful Code
I was reading this book at my library. It has a blue paperback cover with seagulls on it :')
I posted the regex example on /prog/ and was flamed.
Name:
Anonymous2008-12-06 16:54
>>23 I posted the regex example on /prog/ and was flamed.
Well, what did you expect?
int ventrilo3_hdr_udp(int type, u8 *buff, u8 *pck);
int ventrilo3_send_udp(int sd, u32 key, u32 ip, u16 port, u8 *data, int len);
int ventrilo3_recv_udp(int sd, ventrilo3_auth_t *vauth, u8 *data, int maxsz, int *handshake_num);
int getbe(u8 *data, u32 *ret, int bits);
int putbe(u8 *data, u32 num, int bits);
int v3timeout(int sock, int secs);
void ventrilo3_algo_scramble(ventrilo_key_ctx *ctx, u8 *v3key) {
int i,
keylen;
u8 *key;
int ventrilo3_handshake(u32 ip, u16 port, u8 *handshake, int *handshake_num, u8 *handshake_key) {
struct linger ling = {1,1};
int sd;
int i,
len;
u8 sbuff[V3HBUFFSZ],
rbuff[V3HBUFFSZ];
int ventrilo3_recv_udp(int sd, ventrilo3_auth_t *vauth, u8 *data, int maxsz, int *handshake_num) {
struct sockaddr_in peer;
u32 key;
int len,
i,
psz;
u8 tmp[4];