Live data from Hacker News

Someday we will all program in Python

davidbau.com

71–80 of 80 posts

Re: Someday we will all program in Python

#71
post #64
post #56

Earlier quoted context omitted.

In that case wouldn't you write some components in C and glue it all together with something like ruby?

Sure, that sounds reasonable. But you've still chosen C to talk to the hardware.

If you're using ruby or python you're ultimately using C anyway, right ;)

Re: Someday we will all program in Python

#72
post #70

Earlier quoted context omitted.

I'm not a Clojure expert, so I can't directly address that, but from the little that I know of Clojure though, I think you can do that by binding a function to a var, and then changing the binding of the var. (Can any Clojure experts exlaborate?) Regardless, every Lisp that I am able to comment on (newLISP, elisp, Scheme, CL) can do that easily, so I doubt that Clojure would have difficulty with this.

It does have difficulty with this, check the mailing list. Just because something using s-expressions doesn't mean you can override functions in a namespace. http://groups.google.com/group/clojure/browse_thread/thread/... ;

Thanks for that interesting thread! I do know though that newLISP can do this easily with a simple 'set' call.

Re: Someday we will all program in Python

#73
post #36

The only reason to write in a language like C or Java today (over Python) is speed. And there are a very limited number of applications that require that sort of speed. There's no question that Linux should be written in a low level language, or a high-performance chess bot. But I'm incredulous when I see anyone write a website in even the relatively high-level Java. So, the author is right that we're getting more Py…

"There's no question that Linux should be written in a low level language" In the early days, the fact Unix was written in C was quite remarkable. At that time, OSs were written in hand-optimized assembly language. I see no reason to stay with C-level languages (C was once called high-level) if we can make compilers that translate them into machine code that's faster than hand-optimized assembly. Smalltalk/80 and the…

Cannot edit, but I left the link to the presentation out: http://fisl.vidanerd.com/palestra/30

Re: Someday we will all program in Python

#74

Earlier quoted context omitted.

The only reason to write in a language like C or Java today (over Python) is speed. And there are a very limited number of applications that require that sort of speed You probably mean a very limited number of web app frontend code. That may be true. But I think you underestimate what is being done with software. With a language that is 200 times slower than C or Java you can't do any data analysis, graphics or imag…

Can we at least all agree that no one should be writing anything in a shell scripting language any longer? I'd be happy with just winning that battle.

Why are you against shell scripting languages ?

Re: Someday we will all program in Python

#75
post #66
post #62

Earlier quoted context omitted.

Oh, come on, folks. It's a perfectly reasonable comment -- Lisp is powerful and expressive, but it is not an intuitive language for beginners.

Perhaps it seems that way to you because you are more familiar with Algol syntax than Lisp syntax, or because you have gone on to learn the more advanced Lisp features. But Scheme syntax and semantics, for example, are arguably at least as simple as that of an Algol language. Scheme has been used successfully as a first programming language in high school computer science courses: http://www.teach-scheme.org/

You're making a bad assumption about my skill and preferences, and trying to use it as an argument. That's a logical fallacy. My argument doesn't depend on my personal experience: Algol-derived languages resemble English, and are therefore easier for new programmers to learn.

While I am sure that some high school courses may start with Scheme, it's certainly not a common beginner's language. I'm sure if I searched hard enough, I could find a high school class learning assembly -- but that doesn't make assembly a good beginner's language, either.

Re: Someday we will all program in Python

#76
post #74

Earlier quoted context omitted.

Can we at least all agree that no one should be writing anything in a shell scripting language any longer? I'd be happy with just winning that battle.

Why are you against shell scripting languages ?

Because I have seen the horrors that they wreak in a production system where they are responsible for mission critical logic.

The horror. The horror.

Re: Someday we will all program in Python

#77
post #74

Earlier quoted context omitted.

Why are you against shell scripting languages ?

Because I have seen the horrors that they wreak in a production system where they are responsible for mission critical logic. The horror. The horror.

Could you give examples of it ? You could also write horrible python or ruby code.

Re: Someday we will all program in Python

#78

The only reason to write in a language like C or Java today (over Python) is speed. And there are a very limited number of applications that require that sort of speed. There's no question that Linux should be written in a low level language, or a high-performance chess bot. But I'm incredulous when I see anyone write a website in even the relatively high-level Java. So, the author is right that we're getting more Py…

You seem to completely ignore the fact that there are environments where speed does not matter, but memory is constrained. In those environments even Java is prohibited and C/C++ or even assembly is a way to go, because in these languages you have direct control over memory allocation.

Re: Someday we will all program in Python

#79
post #77

Earlier quoted context omitted.

Because I have seen the horrors that they wreak in a production system where they are responsible for mission critical logic. The horror. The horror.

Could you give examples of it ? You could also write horrible python or ruby code.

I don't feel comfortable posting code from my employer here, sorry. But let me address your counter-argument on its own: Saying you can write bad Ruby or Python is a turing tarpit argument. You can write bad code in any language, but I've seen a lot more bad shell script code than I've seen bad Python. Add to that that shell scripting languages are very irregular and I can't see why anyone would use a shell script for something that they actually relied on that was more complicated than invoking a few commands in sequence.

Re: Someday we will all program in Python

#80
post #75
post #66

Earlier quoted context omitted.

Perhaps it seems that way to you because you are more familiar with Algol syntax than Lisp syntax, or because you have gone on to learn the more advanced Lisp features. But Scheme syntax and semantics, for example, are arguably at least as simple as that of an Algol language. Scheme has been used successfully as a first programming language in high school computer science courses: http://www.teach-scheme.org/

You're making a bad assumption about my skill and preferences, and trying to use it as an argument. That's a logical fallacy. My argument doesn't depend on my personal experience: Algol-derived languages resemble English, and are therefore easier for new programmers to learn. While I am sure that some high school courses may start with Scheme, it's certainly not a common beginner's language. I'm sure if I searched ha…

Yes, ALGOL-derived languages contain English words, and chunks of code can be read as English if you imagine the right words being inserted, but the same is true of Scheme code, and to about the same extent. In fact, it's true of most programming languages. The languages that it is most true of -- languages like Ada, Cobol, Inform, etc. -- are not notable as good beginners' languages.

Here, for example, is typical C code, right out of K&R:

  for (count = 0; count 
To read this in English, you need to fabricate a lot of words, like this: "Repeat for several times, first initializing count to zero, as long as count is less than MAX and, after each step, taking count and adding one to it: call the printf function with the arguments...". How is that exercise any worse for the equivalent PLT Scheme code?

  (for ([count (in-range 0 MAX)])
    (display (format "\narr[~a] = ~a." count (vector-ref arr count))))
An English translation of C's "while" statement is easier; the "switch" statement is harder; a C function declaration is nearly impossible without sounding awkward. Yes, actual ALGOL would be easier translate to English than C, but there are even less people starting with ALGOL than with your hypothetical assembler -- which suggests that the real reason people start with the languages they do is primarily because the languages are popular, not because of the degree of similarity to English.
Post reply on HN