What Jon Stewart Said, I Say Too. A lot
|
|
Comments (85)
65 earlier comments in the full thread.
I did gus, sorry to paint everyone with the same broad brush. OK everyone who has special eyeballs like me, don't read my last two comments!
Quoting:Building pointless restrictions into the syntax of a language does nothing but add to the distractions.
Go tell ISO! They have all kind of 'pointless restrictions' for technical drawings. And you know why? Because if not, all drawings are different to such a degree that they are more difficult to understand. If you ever saw American or European technical drawings, you might know what I'm talking about.
And you know why they have these silly restrictions - called Standards? Because it's easier for people to (learn to) read drawings if they're all the same!
So if indentation in Perl is not standardized, it's actually harder to learn (reading those) than if you'd add 'silly restrictions'.
@tuxchick:
I genuinely do not see what you see unless I ramp my fonts up to ridiculously large size (like 48pt). But I appreciate the fact that "it works for me" isn't good enough. Does any of the code I posted need to be broken up further? I'll be happy to do so if necessary.
Otherwise I'm done posting in this thread. It's apparent that reason is not prevailing. :(
I genuinely do not see what you see unless I ramp my fonts up to ridiculously large size (like 48pt). But I appreciate the fact that "it works for me" isn't good enough. Does any of the code I posted need to be broken up further? I'll be happy to do so if necessary.
Otherwise I'm done posting in this thread. It's apparent that reason is not prevailing. :(
I like Forth. Forth is the most consistent programming language there is. You read it from left to right. Every whitespace terminates a token. A name can be composed of all the rest.
People love languages, because "they do so many things for them". Forth is tiny and simple. Forth does nothing. You maintain your symbol table. You manage your stacks. Those who are unable to balance their occasional malloc() and free() calls can't cope without garbage collection, because they have a habit of treating their storage resources like a student tends to do his dorm - the electronic equivalent of Mum and Dad so to say. This kind of people will love Forth, because their have to balance both the return and the data stack - not alone between function calls, but also with each and every branch and loop instruction. The slightest imbalance will cause a devastating crash and tear down your entire system.
Still, Forth programs are extremely small. Most subroutines can be written in the space of a C prototype and are consequently one line long. Forth doesn't dictate any format. You can indent Forth code any way you like (there are so-called "long" forms and "short" forms, but these are just uninteresting conventions nobody actually follows). Most Forth compilers don't even care whether you feed them Mac, DOS, Unix ASCII or even blockfiles (chunks of diskspace, 1K long, unformatted).
Forth has no type checking, since there are no types to check. Forth has one single datatype: the WORD. A WORD can be (depending on the processor) 16, 32 or 64 bits. Forth has no parameters or function prototypes as well, which really cuts down the code size. There are complete line-editors, OO-extensions and full blown floating point add-ons in 1K of source. But there is a dark side. C allows you to shoot yourself in the foot, Forth will blow your head clean off.
Consequently, Forth is the language of choice of elite programmers (e.g. NASA). Most Forth programmers write their own compiler, preferably a compiler that can compile the compiler and little else. There is a ANSI standard for Forth, but most programmers don't follow it, instead they provide a convenient interface to a non-existent ANS Forth compiler with their programs, so you can't run it anywhere, but on the compiler it was originally written for. Or you can adapt the program so it runs on yours. Since Forth is so terse and comments (although there are many ways to define them) so rare, it usually takes less effort to rewrite the entire thing. That's why Forth is such a rich language. There are so many incarnations of "Hello world" and "99 bottles of beer" to choose from!
The rest of the world may have lengthy discussions about which language is best: Python or Perl, both multi megabyte monsters that will take the breath out of the best processors available to mankind and turn them to the equivalent of a 50-year long smoking asthmatic obese old man.
Yes, my dear children, garbage collection, heap bashing, type- and range checking do not come for free.
People love languages, because "they do so many things for them". Forth is tiny and simple. Forth does nothing. You maintain your symbol table. You manage your stacks. Those who are unable to balance their occasional malloc() and free() calls can't cope without garbage collection, because they have a habit of treating their storage resources like a student tends to do his dorm - the electronic equivalent of Mum and Dad so to say. This kind of people will love Forth, because their have to balance both the return and the data stack - not alone between function calls, but also with each and every branch and loop instruction. The slightest imbalance will cause a devastating crash and tear down your entire system.
Still, Forth programs are extremely small. Most subroutines can be written in the space of a C prototype and are consequently one line long. Forth doesn't dictate any format. You can indent Forth code any way you like (there are so-called "long" forms and "short" forms, but these are just uninteresting conventions nobody actually follows). Most Forth compilers don't even care whether you feed them Mac, DOS, Unix ASCII or even blockfiles (chunks of diskspace, 1K long, unformatted).
Forth has no type checking, since there are no types to check. Forth has one single datatype: the WORD. A WORD can be (depending on the processor) 16, 32 or 64 bits. Forth has no parameters or function prototypes as well, which really cuts down the code size. There are complete line-editors, OO-extensions and full blown floating point add-ons in 1K of source. But there is a dark side. C allows you to shoot yourself in the foot, Forth will blow your head clean off.
Consequently, Forth is the language of choice of elite programmers (e.g. NASA). Most Forth programmers write their own compiler, preferably a compiler that can compile the compiler and little else. There is a ANSI standard for Forth, but most programmers don't follow it, instead they provide a convenient interface to a non-existent ANS Forth compiler with their programs, so you can't run it anywhere, but on the compiler it was originally written for. Or you can adapt the program so it runs on yours. Since Forth is so terse and comments (although there are many ways to define them) so rare, it usually takes less effort to rewrite the entire thing. That's why Forth is such a rich language. There are so many incarnations of "Hello world" and "99 bottles of beer" to choose from!
The rest of the world may have lengthy discussions about which language is best: Python or Perl, both multi megabyte monsters that will take the breath out of the best processors available to mankind and turn them to the equivalent of a 50-year long smoking asthmatic obese old man.
Yes, my dear children, garbage collection, heap bashing, type- and range checking do not come for free.
Ladies and gentlemen, I believe we have a winner.
mrider, I might have been wrong. LXer has a funny thing with too-long lines; it does something to make the comments column narrower than the comments, so the right sides of sentences get cut off. But now I'm looking at it and it's fine, so maybe it was already fixed and I had my browser window too narrow. But I know I wasn't delusional, gus3 saw it too! (OK shared delusion.) It's a good thread, not much new for me but always entertaining when coder geeks argue languages. Just don't say "Visual Studio" and it's all good.
Aha! Now I see the problem with too-long lines in the comments-- you have to expand the window way wide. When there are not too-long lines you can make a nice narrow browser window, and the lines in the comments wrap. But they don't wrap when there are long code lines in the comments.
Alternate temporary "fix" in Firefox: Press Ctrl-KeyPadMinus to shrink font.
And no, tc, you weren't wrong, and you weren't hallucinating.
Beez, if it's RPN you want, go whole hog:
And no, tc, you weren't wrong, and you weren't hallucinating.
Beez, if it's RPN you want, go whole hog:
/TimesNewRoman 48 selectfont 609 1293 moveto (Go Postscript!) show showpage
Believe it or not Forth was the first language I ever programmed in commercially, I also wrote a simple Forth based OS in 8 bit Z80 for the Sinclair ZX Spectrum when i was a teen, ahh the glory days of a mispent youth when i should of really been out partying and gettin laid :)
Quoting:Python or Perl, both multi megabyte monsters that will take the breath out of the best processors available to mankind and turn them to the equivalent of a 50-year long smoking asthmatic obese old man.
That reminds me of Greenspun's Tenth Rule:
"Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."
On one occasion someone claimed during a conference speech that Python is the new Lisp. Upon hearing that, some elderly man with gray hair stood up and asked: "can Python programs modify themselves?". The speaker answered: "No, John, they can't." The rest was silence. [This was John McCarthy himself, inventor of Lisp, and I remind you that Lisp was invented in 1958.]
(I'd like to find the source of that story, to correct any errors I obviously made, but I'm out of time right now.)
@Koriel
I had an org* when my first, non-trivial Forth program worked. ;-)
@jezuch: Great story. I've dabbled with Lisp a bit. It's a fantastic language that can do amazing thing. Unfortunately it's very hard to wrap your head around it. They say that to really understand Lisp is like some sort of epiphany that has a lot of consequences on any coding you will do thereafter. I haven't had that yet. Sadly. I'm still looking for some small programming task that I can use Lisp for, so that I can really use it instead of just following tutorials.
@ Sander_Marechal
LISP: Lots of Irritating, Superfluous Parentheses. ;-)
Without kidding: in Forth circles LISP is considered to be the prefix brother of Forth. Just as mind boggling. Personally, as a Configuration Manager I have to deal with lists, endless lists, each and every working hour of the day, so I'm glad I can do without them when I'm programming for fun! BTW, adding basic lists functionality is trivial in Forth, e.g.:
: cons ( k v - a ) swap 2 cells allocate throw tuck ! tuck cell+ ! ; : car! ( v a - ) ! ; : cdr! ( v a - ) cell+ ! ; : car@ ( a - v ) @ ; : cdr@ ( a - v ) cell+ @ ; : cons0 ( - a ) 0 0 cons ;
The reverse is true as well: http://webhome.csc.uvic.ca/~djohnson/parser.html
Without kidding: in Forth circles LISP is considered to be the prefix brother of Forth. Just as mind boggling. Personally, as a Configuration Manager I have to deal with lists, endless lists, each and every working hour of the day, so I'm glad I can do without them when I'm programming for fun! BTW, adding basic lists functionality is trivial in Forth, e.g.:
: cons ( k v - a ) swap 2 cells allocate throw tuck ! tuck cell+ ! ; : car! ( v a - ) ! ; : cdr! ( v a - ) cell+ ! ; : car@ ( a - v ) @ ; : cdr@ ( a - v ) cell+ @ ; : cons0 ( - a ) 0 0 cons ;
The reverse is true as well: http://webhome.csc.uvic.ca/~djohnson/parser.html
Quoting:Unfortunately it's very hard to wrap your head around it.
I wonder how much that is only because we're conditioned to think in imperative languages. When I learned about functional programming I felt like it was like I always wanted to do my programs (OK, maybe not immediately). The thing is that I learned it after lots and lots and lots of BASIC, Pascal, C, Java, assembler and stuff like this while nobody told me there's an entire parallel universe just aroud the corner. They were hiding the truth from me!!! I think this one-sidedness is a great tragedy of CS education. You need both (to see that functional style is better ;) )
And because functional prgramming only now starts to break through to the mainstream, I can't do it at work (although we were discussing trying out Scala some time ago). But I do it anyway - a p*ss-poor attempt in Java, anyway. I use a lot of nested function calls and my variables are no variables at all (they don't change once they're assigned, like in a SSA (Static Single Assignment) form).
PS: That only a genius like McCarthy can understand functional programming, is a lie - perpetrated by drones that fear change. Very much like with Linux and Windows. PPS: I very much like Haskell and would like to recommend it too! PPPS: Sorry for the rant.
Lisp was an eye-opener for me, but not in the way commonly touted. Lisp was what finally got me to understand the Turing-equivalence theorem: a problem solvable on one Turing-complete machine, is solvable on any Turing-complete machine. A lesser theorem is that "any iterative procedure has a recursive equivalent, and vice-versa."
http://gus3.typepad.com/i_am_therefore_i_think/2010/02/my-fi...
http://gus3.typepad.com/i_am_therefore_i_think/2010/02/my-fi...
Quoting:a problem solvable on one Turing-complete machine, is solvable on any Turing-complete machine. A lesser theorem is that "any iterative procedure has a recursive equivalent, and vice-versa."Ah, hearing all these computer sciencey things gives me a lump in my throat, just remembering the good old days back in college....
@herzeleid:
I can only wish they had taught me these things in my CompSci courses.
But discovering them for myself brings both amazement and memorability.
I can only wish they had taught me these things in my CompSci courses.
But discovering them for myself brings both amazement and memorability.
I have always *loved* This Groklaw article: An explanation of computational theory for lawyers: http://www.groklaw.net/article.php?story=20091111151305785&q...
You can pretty much see how the math directly maps to Lisp S-expressions, thereby showing that all computer programs are math. Brilliant!
You can pretty much see how the math directly maps to Lisp S-expressions, thereby showing that all computer programs are math. Brilliant!
I always like browsing this one: http://www.dmoz.org/Computers/Programming/Languages/
Plenty of resources over there, but I'm not sure how up to date it is nowadays. In the pre-Wikipedia-era it was the best source, however.
Plenty of resources over there, but I'm not sure how up to date it is nowadays. In the pre-Wikipedia-era it was the best source, however.
The Roots of Lisp: http://www.paulgraham.com/rootsoflisp.html
Read the whole thing from the beginning, so when you get to the surprise, you'll understand it. It's easy to find; it's titled "The Surprise".
Read the whole thing from the beginning, so when you get to the surprise, you'll understand it. It's easy to find; it's titled "The Surprise".
Post a comment
A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.
Your message:Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help
Sign up and post (it is free) or Log in and post
