A TCP/IP Stack and Web Server In BASIC
A writes "Back in the day, a BASIC interpreter was standard on every home computer system and everyone had to know at least a little BASIC to be able to use their computer. But who would have thought that you could write some serious networking code in BASIC over 20 years later? Just a few days ago, Lee Davison released the BASIC source code for his 6502-based Ethernet web server. The web server runs under his EhBASIC interpreter on the 1 MHz 6502 CPU and is able to blast out web pages at an amazing speed of 20-35 seconds per page!" Sure, it's not really practical, but I give it cool points.
Can the code really be called BASIC? It looks more like tons of in-line assembly code, wrapped in a few ifs and loops.
Since the code seems to be mostly direct memory access, CALL, and USR, wouldn't it have made more sense simply to write it in assembly language?
You can use a BASIC dialect that has a built-in assembler and so still get suitably old-school source code.
-- Ed Avis ed@membled.com
someone will come up with a shell script webserver.
I'd like to see how this benchmarks on a 1Ghz modern processor or better. ANyone planning on setting this up and benchmarking it BEFORE posting it on slashdot?
Yes, actually. Look in your ports collection. A real quick grep turned this up:
y abasic/
$ ls | grep basic
bwbasic/
gnomebasic/
pbasic/
wxbasic/
No matter where you go... there you are.
inline-assembler
definable functions
re-entrant procedures
http://www.bbcbasic.com/
Sophie Wilson did a great job and did anyone at school in the UK who was interested in computing the biggest favour of all - she gave us the gift of learning structured programming from day 0
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
Why can't everyone just agree that BASIC is dead, should stay dead and preferably staked through the heart? I personally can't see any use at all for BASIC.
I'd probably agree with you on that one.... but it's interesting to note that many of the commonly-criticized features of Basic were the result of memory-kludges and featuritis, that the original designers of Basic did not approve of at all (according to their book 'Back to Basic').
Unfortunately, I don't have the book to hand to check out the details, but here's a link to it anyway.
"Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
unlike the others I wrote mine from scratch in response to the post
sadly I posted a slightly wrong version
here's the one that works
http://www.proweb.co.uk/~matt/rc/webserver.rc
it's only a toy, of course.
http://server/../../../../../../etc/passwd
will get you the passwd file
There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
... for stuff like this. The annual Totally worthless, 100% hack value, too-much-geek-time-to-spare prize. And the 6502 BASIC TCP/IP stack-based web server should be the first winner.
It's worth mentioning that, for the C64/128 at least, you could actually have variable names longer than two characters but only the first two characters would be recognized. All the rest were ignored. By way of example, here's a made up code sample. Since my C128 is currently in the closet, I can't guarentee this example's accuracy. Some other pedant may wish to.
Example
10 LET FROGS = 16
20 LET FRAGGLE = 12
30 LET FRANCE = FROLLIC * FROBNITZ
40 PRINT FROGS
Output: 144
Furry cows moo and decompress.
I use it in conjunction with .NET and ANSI C. Check out their company history for some background then take a look at the delicious capabilities of their Windows and Console compilers.
They also have a kick-ass DOS Compiler that has put dinner on my table for years. As we know, many people are still using DOS and DOS-mode apps every day.
When looking at PowerBASIC you have to get rid of any preconcieved notions of BASIC or how it has been implimented in the past. PowerBASIC is a dream to use, has a huge community, and compilers smaller and faster than most ANSI C programs I've seen. Also, check out their partial client list - you'll be in good company.
No, I do not work for them. I am a loyal customer and a geek that loves cool stuff. PB delivers.
--- Gary McClellan