[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Suitability of Lua as a First Programming Language?
- From: "John Hind" <john.hind@...>
- Date: Wed, 23 Sep 2009 11:24:46 +0100
I agree that Forth is very efficient and I believe its philosophy has heavily influenced the design of virtual machines and "byte-code" intermediate systems. However the cost of this efficiency is to make the programmer think like a (very simplistic) computer while the purpose of a programming language is surely to produce computer code from an input language suited to human beings? I have done a lot of programming in assembly language particularly for microcontrollers and to be frank, I would choose assembly over Forth any day of the week and assembly has no runtime overhead at all! Hell, I'd even choose writing the machine code directly in hex!
I was also very impressed at first by the elegance, efficiency and minimalism of Forth, but quickly fell out of love when I actually had to do something non-trivial with it. I suspect its enthusiasts have never tried to deliver anything requiring more than a page of code or anything requiring long-term maintenance.
Lua makes a good teaching language because it uses the same conceptual framework as the vast majority of other "mainstream" languages out there while being minimalist, regular and flexible. Forth is certainly very minimalist, but its very difference makes it a poor choice as a grounding for training working programmers.
> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-
> bounces@bazar2.conectiva.com.br] On Behalf Of David Given
> Sent: 23 September 2009 11:12
> To: Lua list
> Subject: Re: Suitability of Lua as a First Programming Language?
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Enrico Colombini wrote:
> [...]
> > I'd correct that to "hard to learn and get used to".
> > Lua has a very smooth access ramp. Forth hasn't.
>
> Indeed --- a lot of Forth's much vaunted maintainability and
> readability
> (yes, really!) is that if you don't have absolute discipline with
> documentation and design, you end up shooting your own foot off with a
> nuclear hand grenade. The only programs that ever work are the
> maintainable and readable ones.
>
> That said, it's apparently incredibly effective if you *do* have that
> degree of discipline. (It's also the only language I know where you can
> fit an entire development shell, including compiler, in 6kB of machine
> code.)
>
> In addition, it *is* a fantastic teaching language --- not for teaching
> programming, but for teaching language and compiler design. I'd
> encourage anyone with an interest in the subject to go and design a
> Forth threaded interpreter for your favourite architecture. It is a
> thing of beauty, and utterly unlike any other modern language today. I
> wasn't kidding when I said that learning Forth taught me how to write
> C;
> you will suddenly realise that that everything you've ever learnt is
> merely one way of doing things, and there are many others, all equally
> valid...
>
> - --
> ┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
> │
> │ "People who think they know everything really annoy those of us who
> │ know we don't." --- Bjarne Stroustrup
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iD8DBQFKufRaf9E0noFvlzgRAuT4AJ0YmsovVfvl/ucykjqMWyEkGBWRcACdGmSA
> HUsbF4KFYLhTWFhfN7OGphU=
> =2TPN
> -----END PGP SIGNATURE-----