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.
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];