Re: a relational database done in forth would r0ck
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: a relational database done in forth would r0ck         

Group: comp.lang.forth · Group Profile
Author: John Passaniti
Date: Aug 24, 2008 18:23

gavino wrote:
> http://www.firebirdsql.org/index.php?id=about-firebird&nosb=1
> something like this
> but substitute c/c++ for forth

You were impressed with the performance of Bernd's web server, but you
apparently didn't get the point.

The performance of Bernd's web server comes not from being coded in
Forth, but because he took a different approach. Web servers like
Apache are general-purpose; they support everything from simple web
sites serving static content to insanely sophisticated applications
spread across multiple servers. There is a *lot* of infrastructure
there to support that range, and if you need some of those features,
you're glad it's there. But if you don't, then it's bloat.

Bernd's web server takes a different approach. He doesn't need a
generic web server like Apache. He had a specific problem (or specific
class of problems) he wanted to solve and his web server implemented
just what he needed and nothing more.

So it's the approach and not the language that provides the performance
you admire. And that performance comes from implementing only what is
needed. Of course, the question of what is needed is relative.

And that applies to databases as well. If someone was to recode a
generic SQL-based relational database system like Firebird in Forth, it
would be unreasonable to expect much if any of a performance increase.
On the other hand if you designed a database system that was specific to
the problem you were trying to solve, then you would expect potentially
huge increases in performance. And you would expect them largely
regardless of the language you chose.

You've written elsewhere that you've gotten some books on Forth.
Great... now here's something I strongly suggest you do as part of your
learning. There are three steps:

1) Take some non-trivial code you've written in some other language and
code it taking the _same_ approach using Forth. You may see some slight
performance improvement, but it won't be much if anything.

2) Now, take that same non-trivial code and now write it using a
different technique. Focus on doing just what is needed, coding
everything to be specific to the problem you're solving. Do this in
Forth. You're going to see a dramatic performance improvement.

3) Finally, take the Forth code you just wrote-- the code that does just
what is needed and is specific to the problem being solved-- and code it
in pretty much any other language you're familiar with. What you will
find is that the same dramatic performance improvement you saw with
Forth will also be seen with the other language.

I'm not telling you that there is no value to Forth. Forth is a great
language. But your messages seem to consistently confuse where the
performance you admire is coming from. It isn't from Forth. It's from
programming with a mindset towards writing code to solve specific
problems instead of general ones.
no comments
diggit! del.icio.us! reddit!