Search the web
Sign In
New User? Sign Up
self-interest · Self Programming Language
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Webserver in Self   Message List  
Reply | Forward Message #1991 of 2146 |
[self-interest] Re: Webserver in Self

Russell,

> I hacked up a small and extremely simple webserver based on the socketServer
code. The
> transporter code goes in applications/. I'm not sure if I can attach it to an
email so I've put
> it up on the web at:
http://russell-allen.com/self/downloads/files/webserver.self

I don't think an attachment would have been a problem, but Yahoo
probably wouldn't have saved it in the archives (at least not for very
long) and that can be frustrating to people who later find these
messages.

> I'd appreciate it if anyone has a change to try to file it in and possibly
comment on how
> 'selfish' it is in style.

Your use of C-like variable names (one letter) is certainly very Selfish
:-)

I didn't try to code, but it looks good. The only think I thought a bit
strange was your use of 'deadCopy' for creating new files and sockets.
But that might be the proper way to do it. Your use of a privacy
"parent" is a very good idea.

> - although I worked out how to write out a module from the materials, I had
more trouble
> reading it in again. I eventually found a note on Jecel's site with the magic
incantation
> (bootstrap read: 'webserver' From: 'applications'); I couldn't find a suitable
way to do it
> from morphic.

It used to be easier. Before the transporter we just called _RunScript
(or something like that) directly on the string with the file name. Now
that we have the transporter it would be a good idea to have some kind
of GUI. That would probably be something like the File Browser in
Smalltalk.

> - I was pleasantly suprised how nice Self morphic was for *writing* code (the
word isn't
> quite right - it felt more like construction than writing)
> - On the other hand, the inspectors were hard to *read* code with. My
continual question
> was "What methods does a string understand anyway?" and "How do I open a
file?"; it was
> hard to answer this without opening millions of inspectors all over my nice
nebraskan
> plain (plane?).

There are some search tools but they are harder to use at first than
senders/implementors in Smalltalk. Searching manually through all the
parents takes up a lot of screen space, as you said, but at least it is
easy to do.

> - I kept on writing stuff like "method: a = (|| a print )" and getting an
error because I
> needed a space between the bars.

That, and the various uses of ".", would be nice to fix.

> - syntax differences from Smalltalk I haven't yet internalised: the use of
capital letters in
> message names, block notation; I kept writing: "[:k | k print]", slots between
the bars; I
> kept writing "| var1 var2 | code"

When I wrote my first real application in Self 4.0, I didn't notice that
the snapshot I was using included Mario's Smalltalk stuff. So I kept
writting ifTrue:False: instead of ifTrue:IfFalse: but it worked! When I
moved the code to a newer Self all these Smalltalkisms broke down and I
had to rewrite it.

> - it was most frustrating that the inspectors for arrays/lists/dictionaries
showed the
> normal slots and not a more useful view of what was actually in the collection

For small lists you can look at their name to quickly see what is in
them. Dictionaries are the worst case, specially since they are based on
parallel arrays instead of sets of associations like in Smalltalk. So
noting which value goes with which key can be complicated.

> PS: I've just noticed that the Transporter has declared my code to be (c) Sun
and Stanford,
> which it obviously isn't. Is there a way to change this?

It should be easy to fix this. The transporter sends the 'copyright'
message to the module it is saving and normally all modules have that
data slot set to the string you noticed by virtual of being clone of the
init module. So you might want to inspect your module object and edit
its string.

-- Jecel



Mon May 19, 2008 11:28 pm

jeceljr
Offline Offline
Send Email Send Email

Forward
Message #1991 of 2146 |
Expand Messages Author Sort by Date

Hi anyone who is listening :) I have been a lurker on this list for a very long time (under another email address) and I vaguely remember some mention of a web...
russell.allen23
Offline Send Email
May 13, 2008
3:10 pm

Russell, ... I don't remember any web server code. Squeak has several and it would be easy to borrow one, but depending on your needs it is probably not worth ...
Jecel Assumpcao Jr
jeceljr
Offline Send Email
May 14, 2008
10:34 pm

Hi Jecel, ... I guess that means that Self has all the necessary socket primitives etc? Could you share your web server code to give me some help in where to...
russell.allen23
Offline Send Email
May 15, 2008
12:39 am

Russell, ... Sorry, but it was trivial enough that I didn't bother saving it. I was exploring the various socket APIs in Self (I had never looked at them ...
Jecel Assumpcao Jr
jeceljr
Offline Send Email
May 16, 2008
11:28 pm

... I've just made 4.3, 4.2, and 4.1 available for download from (what I suppose is now) Self's new home on SourceForge: http://self.sourceforge.net (Thanks to...
Adam Spitz
adspitz
Offline Send Email
May 17, 2008
3:18 am

... It just occurred to me that perhaps you were thinking of the web *browser* that Dave wrote. I don't recall if it was part of a release....
mwolczko2
Offline Send Email
May 17, 2008
7:03 pm

Hi everyone, Thanks for your help. I hacked up a small and extremely simple webserver based on the socketServer code. The transporter code goes in...
russell.allen23
Offline Send Email
May 18, 2008
8:55 am

Russell, ... I don't think an attachment would have been a problem, but Yahoo probably wouldn't have saved it in the archives (at least not for very long) and...
Jecel Assumpcao Jr
jeceljr
Offline Send Email
May 19, 2008
11:33 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help