Hi,
I've seen several online articles about writing Domain Specific Languages in Ruby. All the articles mention that the idea of DSLs comes largely from Lisp and Smalltalk. I've found descriptions on writing DSLs in Lisp--but I can't seem to find any good references for Smalltalk.
Does anyone have any helpful pointers? If I'm going to follow the Ruby model, then I need to be able to execute arbitrary strings as code (which Compiler evaluate: and related functions seems to handle). I also need to be able to add new methods to classes/ instances at runtime--which I haven't found.
Any help would be greatly appreciated.
-Rich-
Is there anyone who has the power to rename packages on squeaksource?
many thanks in advance
Keith
___________________________________________________________ All New Yahoo! Mail Tired of Vi@gr@! come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html
2006/8/14, Keith Hodges keith_hodges@yahoo.co.uk:
Is there anyone who has the power to rename packages on squeaksource?
Packages or projects?
Philippe
Philippe Marschall wrote:
2006/8/14, Keith Hodges keith_hodges@yahoo.co.uk:
Is there anyone who has the power to rename packages on squeaksource?
Packages or projects?
Philippe
Sorry I meant to say projects!
Keith
___________________________________________________________ Yahoo! Messenger - with free PC-PC calling and photo sharing. http://uk.messenger.yahoo.com
Here is a blog entry of mine about using the Refactoring Browsers code to generate classes for me:
http://wilkes.blogspot.com/2005/12/simple-code-generation-in-smalltalk.html
The Behavior>>compile: method will add a new method onto a class.
For instance methods: MyClass compile: 'someAttribute ^ someAttribute'
For class methods: MyClass class compile: 'aClassMethod "Do some stuff"'
On 8/14/06, Rich Warren rwmlist@gmail.com wrote:
Hi,
I've seen several online articles about writing Domain Specific Languages in Ruby. All the articles mention that the idea of DSLs comes largely from Lisp and Smalltalk. I've found descriptions on writing DSLs in Lisp--but I can't seem to find any good references for Smalltalk.
Does anyone have any helpful pointers? If I'm going to follow the Ruby model, then I need to be able to execute arbitrary strings as code (which Compiler evaluate: and related functions seems to handle). I also need to be able to add new methods to classes/ instances at runtime--which I haven't found.
Any help would be greatly appreciated.
-Rich-
Great! Thanks. That should let me bootstrap the things I need.
Does anyone know of any general references to writing interpreters/ DSLs/Metaprogramming in SmallTalk?
-Rich-
On Aug 14, 2006, at 6:55 AM, Wilkes Joiner wrote:
Here is a blog entry of mine about using the Refactoring Browsers code to generate classes for me:
http://wilkes.blogspot.com/2005/12/simple-code-generation-in- smalltalk.html
The Behavior>>compile: method will add a new method onto a class.
For instance methods: MyClass compile: 'someAttribute ^ someAttribute'
For class methods: MyClass class compile: 'aClassMethod "Do some stuff"'
On 8/14/06, Rich Warren rwmlist@gmail.com wrote:
Hi,
I've seen several online articles about writing Domain Specific Languages in Ruby. All the articles mention that the idea of DSLs comes largely from Lisp and Smalltalk. I've found descriptions on writing DSLs in Lisp--but I can't seem to find any good references for Smalltalk.
Does anyone have any helpful pointers? If I'm going to follow the Ruby model, then I need to be able to execute arbitrary strings as code (which Compiler evaluate: and related functions seems to handle). I also need to be able to add new methods to classes/ instances at runtime--which I haven't found.
Any help would be greatly appreciated.
-Rich-
On 8/14/06, Rich Warren rwmlist@gmail.com wrote:
Great! Thanks. That should let me bootstrap the things I need.
Does anyone know of any general references to writing interpreters/ DSLs/Metaprogramming in SmallTalk?
Writing interpreters is so easy in Smalltalk that people don't even talk about how to do it. See the "Interpreter" pattern in "Design Patterns". This was my attempt to explain it, though we did it in a language independent way. Basically, you just build a class hierarchy. In fact, I bet that most of the time Smalltalkers use the Interpreter pattern, they don't think of what they write as an interpreter. This means that they don't think of the class hierarchy as a grammar or the tree of objects as an abstract syntax tree. They don't think of the instance creation methods as their parser, even if they work hard to make the syntax natural.
Smalltalkers usually don't use the phrase "DSL", but instead talk about frameworks for a particular domain. Also, look at http://adaptiveobjectmodel.com for some papers on DSL that are either in Smalltalk or are similar to ones that are. Again, the papers usually don't mention the phrase "DSL".
-Ralph Johnson
In my tests, I've noticed that Behavior>>compile: actually changes the image. Is there any way to make less-permanent changes (e.g. just changing a single instance)?
-Rich-
On Aug 14, 2006, at 6:55 AM, Wilkes Joiner wrote:
Here is a blog entry of mine about using the Refactoring Browsers code to generate classes for me:
http://wilkes.blogspot.com/2005/12/simple-code-generation-in- smalltalk.html
The Behavior>>compile: method will add a new method onto a class.
For instance methods: MyClass compile: 'someAttribute ^ someAttribute'
For class methods: MyClass class compile: 'aClassMethod "Do some stuff"'
On 8/14/06, Rich Warren rwmlist@gmail.com wrote:
Hi,
I've seen several online articles about writing Domain Specific Languages in Ruby. All the articles mention that the idea of DSLs comes largely from Lisp and Smalltalk. I've found descriptions on writing DSLs in Lisp--but I can't seem to find any good references for Smalltalk.
Does anyone have any helpful pointers? If I'm going to follow the Ruby model, then I need to be able to execute arbitrary strings as code (which Compiler evaluate: and related functions seems to handle). I also need to be able to add new methods to classes/ instances at runtime--which I haven't found.
Any help would be greatly appreciated.
-Rich-
There is another approach available in Smalltalk that is not available in many other languages. The syntax of Smalltalk as is allows for a pretty good DSL to be built out of simple classes and blocks with good selector naming. You really do not need to dynamically add code to the system to get a DSL when the syntax for Smalltalk is so flexible and has good readability. You can certainly do "modeling" and generate the code from some other representation. But, then you lose all the value of the Smalltalk tools. If the user wants to model orders just create an Order class and let them go to town with Orderish methods and blocks. Then they can use the best debugger on the planet (that actually works when you want to change the source, etc). You can even persist in-flight execution and many other things that other environments do not support, letting that DSL support more than just in-memory execution. Integrating database accesses and distributed communications is not a barrier.
Michael
-----Original Message----- From: squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org] On Behalf Of Rich Warren Sent: Wednesday, August 16, 2006 6:56 PM To: The general-purpose Squeak developers list Subject: Re: Info on Smalltalk DSLs or Metaprogramming...
In my tests, I've noticed that Behavior>>compile: actually changes the image. Is there any way to make less-permanent changes (e.g. just changing a single instance)?
-Rich-
On Aug 14, 2006, at 6:55 AM, Wilkes Joiner wrote:
Here is a blog entry of mine about using the Refactoring Browsers code to generate classes for me:
http://wilkes.blogspot.com/2005/12/simple-code-generation-in- smalltalk.html
The Behavior>>compile: method will add a new method onto a class.
For instance methods: MyClass compile: 'someAttribute ^ someAttribute'
For class methods: MyClass class compile: 'aClassMethod "Do some stuff"'
On 8/14/06, Rich Warren rwmlist@gmail.com wrote:
Hi,
I've seen several online articles about writing Domain Specific Languages in Ruby. All the articles mention that the idea of DSLs comes largely from Lisp and Smalltalk. I've found descriptions on writing DSLs in Lisp--but I can't seem to find any good references for Smalltalk.
Does anyone have any helpful pointers? If I'm going to follow the Ruby model, then I need to be able to execute arbitrary strings as code (which Compiler evaluate: and related functions seems to handle). I also need to be able to add new methods to classes/ instances at runtime--which I haven't found.
Any help would be greatly appreciated.
-Rich-
It may not be necessary (probably isn't). It may not even be wise. But I'm still curious--how far can I stretch the boundaries?
The specific project I'm working on is an AI research project as part of my Ph.D. Ideally I would like to have a configuration text file that (with an easily-human-readable syntax) configures the system for each trial--one line per trial.
Why not just code it all in smalltalk? I want non-programmers to be able to look at the configuration file, and look at the data and easily understand the initial conditions for a specific run and how it correlates with the resulting data. Having the configuration file as a separate artifact will greatly help--but only if I can make it easy to read (basically code that doesn't look like code).
I'd like to create a mini-language for the config file whose syntax basically consists of objects, selectors and operators. I'm still feeling out the infrastructure's requirements--and I'm trying to decide whether to implement everything in Smalltalk or Ruby. I have good examples for implementing a DSL in Ruby. I think I can port most of the ideas easily enough to Smalltalk, but some of the more complicated examples do make changes to classes at runtime (I'm not sure I'll need that--but I'm also not sure I won't).
So far,they're still running fairly neck-and-neck. In most ways, they're both excellent approaches. Here's my thoughts:
Ruby:
I know Ruby better.
All my DSL examples are in Ruby.
For DSL's, Ruby's syntax seems slightly more flexible than Smalltalk (or maybe I just know how to abuse it more).
From my research so far, Ruby as better support for distributed objects (especially Rinda). This might be important if we need to move the code over to the cluster.
Ruby can more-easily create actual child processes, which might let me plow through the data faster on a dual-core machine (though, I believe this might lock it into only running on Unix boxes).
I have better Ruby reference books.
I have good instructions for creating charts/graphs directly in Ruby.
Smalltalk:
It would be a good excuse to get more proficient in Smalltalk.
I prefer working in the Smalltalk environments.
Creating a cross-platform GUI will be easier in Squeak.
While getting multiple processes is a pain (as far as I know, I'd need to run multiple instances of squeak), I can save and quit squeak while the application is running. When I launch squeak, it will start up again exactly where it left off. This may actually be the killer feature. I can run the experiments on my laptop overnight. Even if they don't finish by morning, I can shut things down and take the laptop with me to class--without losing any data.
I'm sure there are a lot of other cool reasons to pick Smalltalk that I just don't know about, because I'm still kind of low on the learning curve.
-Rich-
On Aug 16, 2006, at 10:26 PM, Michael Latta wrote:
There is another approach available in Smalltalk that is not available in many other languages. The syntax of Smalltalk as is allows for a pretty good DSL to be built out of simple classes and blocks with good selector naming. You really do not need to dynamically add code to the system to get a DSL when the syntax for Smalltalk is so flexible and has good readability. You can certainly do "modeling" and generate the code from some other representation. But, then you lose all the value of the Smalltalk tools. If the user wants to model orders just create an Order class and let them go to town with Orderish methods and blocks. Then they can use the best debugger on the planet (that actually works when you want to change the source, etc). You can even persist in-flight execution and many other things that other environments do not support, letting that DSL support more than just in-memory execution. Integrating database accesses and distributed communications is not a barrier.
Michael
-----Original Message----- From: squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org] On Behalf Of Rich Warren Sent: Wednesday, August 16, 2006 6:56 PM To: The general-purpose Squeak developers list Subject: Re: Info on Smalltalk DSLs or Metaprogramming...
In my tests, I've noticed that Behavior>>compile: actually changes the image. Is there any way to make less-permanent changes (e.g. just changing a single instance)?
-Rich-
On Aug 14, 2006, at 6:55 AM, Wilkes Joiner wrote:
Here is a blog entry of mine about using the Refactoring Browsers code to generate classes for me:
http://wilkes.blogspot.com/2005/12/simple-code-generation-in- smalltalk.html
The Behavior>>compile: method will add a new method onto a class.
For instance methods: MyClass compile: 'someAttribute ^ someAttribute'
For class methods: MyClass class compile: 'aClassMethod "Do some stuff"'
On 8/14/06, Rich Warren rwmlist@gmail.com wrote:
Hi,
I've seen several online articles about writing Domain Specific Languages in Ruby. All the articles mention that the idea of DSLs comes largely from Lisp and Smalltalk. I've found descriptions on writing DSLs in Lisp--but I can't seem to find any good references for Smalltalk.
Does anyone have any helpful pointers? If I'm going to follow the Ruby model, then I need to be able to execute arbitrary strings as code (which Compiler evaluate: and related functions seems to handle). I also need to be able to add new methods to classes/ instances at runtime--which I haven't found.
Any help would be greatly appreciated.
-Rich-
On Wed, Aug 16, 2006 at 11:36:33PM -1000, Rich Warren wrote:
Ruby can more-easily create actual child processes, which might let me plow through the data faster on a dual-core machine (though, I believe this might lock it into only running on Unix boxes).
Given that you are expecting to run on a unix box anyway, you can do this quite easily in Squeak, see OSProcess and CommandShell on SqueakMap. If you want to run multiple Squeak images on multiple CPUs, look at #forkSqueak.
But I would be very surprised if you need this in practice. You can manipulate really large amounts of data directly in Squeak, and you'll be amazed how fast it can be. Once you load your data into Squeak, everything is in memory, and Squeak itself is quite fast.
Not so obvious is that when you load your data into well designed objects, you actually can use a lot less memory than you might have expected (no need for multiple copies of the same pieces of data as often is the case in practice with file-based or database oriented applications). The end result is that you often end up realizing that you don't need a database after all, once it's in a Squeak image that you can save at will, that's all you need. You can crunch a lot of data all in one image with no need to fuss with child processes, and no need to worry about exchanging data between the processes or saving results to files.
When brings us back to your DLS question. Michael Latta's advice is very good: Try implementing your language as classes and methods that read well and make sense to people. you can read the source code for this in from a configuration file if you want. If that turns out not to be sufficient for your needs, you can implement any language syntax you like using SmaCC (parser generator like lex/yacc for Smalltalk). SmaCC is on SqueakMap also.
Dave
On Aug 17, 2006, at 12:52 AM, David T. Lewis wrote:
On Wed, Aug 16, 2006 at 11:36:33PM -1000, Rich Warren wrote:
Ruby can more-easily create actual child processes, which might let me plow through the data faster on a dual-core machine (though, I believe this might lock it into only running on Unix boxes).
Given that you are expecting to run on a unix box anyway, you can do this quite easily in Squeak, see OSProcess and CommandShell on SqueakMap. If you want to run multiple Squeak images on multiple CPUs, look at #forkSqueak.
Aha. Again, it's the low on the learning curve curse. I guess I shouldn't be surprised. Both use the same basic threading model. I should have suspected a similar OS process forking abilities.
But I would be very surprised if you need this in practice. You can manipulate really large amounts of data directly in Squeak, and you'll be amazed how fast it can be. Once you load your data into Squeak, everything is in memory, and Squeak itself is quite fast.
You're probably right, given that using both cores will give me a 2x boost, max (and that's being overly optimistic). So the speed boost you mention might largely compensate. Struggling to get it running on both cores feels like trying to eek out more speed by implementing it in highly profiled and optimized (and therefor non-portable) c code and assembly. I don't need to go down that road.
I do have a few machines on my home network whose idle cycles I could borrow. That's where something like Rinda becomes more attractive. And, if I work out the bugs in my home network, then I could run it on the school's 32-processor cluster. Doing that should give me an order of magnitude boost in speed--which could make a big difference, depending on how many simulations we want to run (I'm guessing at least in the mid- to high- 100s), and how long each simulation will take.
Regarding the DSL itself, I am currently planning on trying to implement it using just classes and methods. Using the config file approach, I'll read in a line at a time, and evaluate each line. But I'll check out SmaCC, just in case I need the extra power.
Thanks,
-Rich-
Here is some recent experience in Java that has relevance to the multi-core discussion:
1) My system has 8 logical processors (4 cores with HyperThreading). 2) My first attempt a making a set of tasks concurrent got about a -10% improvement. With good profilers and several days of work I got that down to a 2X speedup (using 8 cores). Individual parts of the process are getting 100% scalability, and others are still single threaded (which is very common).
While it is tempting to think that multiple cores means one application will run faster, in practice it is much harder to make happen, and FAR FAR harder to debug due to the unpredictability of it.
You mention that you will be running multiple simulations. Running each simulation in a separate image is far more likely to produce good scalability. You can easily use various methods to move control objects from one image to another to coordinate the simulations and migrate data from one image to another at the beginning of a simulation. I would pursue that approach much more than trying to get 2 cores to run faster. 2 cores is useful for multi-processing, but almost useless for multi-tasking as you generally want a thread to supervise the other threads, which drops you back down to 1 task oriented core.
Michael
-----Original Message----- From: squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev- bounces@lists.squeakfoundation.org] On Behalf Of Rich Warren Sent: Thursday, August 17, 2006 4:52 AM To: The general-purpose Squeak developers list Subject: Re: Info on Smalltalk DSLs or Metaprogramming...
On Aug 17, 2006, at 12:52 AM, David T. Lewis wrote:
On Wed, Aug 16, 2006 at 11:36:33PM -1000, Rich Warren wrote:
Ruby can more-easily create actual child processes, which might let me plow through the data faster on a dual-core machine (though, I believe this might lock it into only running on Unix boxes).
Given that you are expecting to run on a unix box anyway, you can do this quite easily in Squeak, see OSProcess and CommandShell on SqueakMap. If you want to run multiple Squeak images on multiple CPUs, look at #forkSqueak.
Aha. Again, it's the low on the learning curve curse. I guess I shouldn't be surprised. Both use the same basic threading model. I should have suspected a similar OS process forking abilities.
But I would be very surprised if you need this in practice. You can manipulate really large amounts of data directly in Squeak, and you'll be amazed how fast it can be. Once you load your data into Squeak, everything is in memory, and Squeak itself is quite fast.
You're probably right, given that using both cores will give me a 2x boost, max (and that's being overly optimistic). So the speed boost you mention might largely compensate. Struggling to get it running on both cores feels like trying to eek out more speed by implementing it in highly profiled and optimized (and therefor non-portable) c code and assembly. I don't need to go down that road.
I do have a few machines on my home network whose idle cycles I could borrow. That's where something like Rinda becomes more attractive. And, if I work out the bugs in my home network, then I could run it on the school's 32-processor cluster. Doing that should give me an order of magnitude boost in speed--which could make a big difference, depending on how many simulations we want to run (I'm guessing at least in the mid- to high- 100s), and how long each simulation will take.
Regarding the DSL itself, I am currently planning on trying to implement it using just classes and methods. Using the config file approach, I'll read in a line at a time, and evaluate each line. But I'll check out SmaCC, just in case I need the extra power.
Thanks,
-Rich-
On Aug 17, 2006, at 7:37 AM, Michael Latta wrote:
You mention that you will be running multiple simulations. Running each simulation in a separate image is far more likely to produce good scalability. You can easily use various methods to move control objects from one image to another to coordinate the simulations and migrate data from one image to another at the beginning of a simulation. I would pursue that approach much more than trying to get 2 cores to run faster.
This is really the approach I was looking at. I'd have a master controller that maintained a pool of available simulations. Slave processes would request a simulation, process it, then asynchronously return the results. The master would be idle most of the time, so the slaves should be able to grab most of the available CPU power (especially if I can place them on separate machines or across a cluster).
I'm not sure how to do distributed processing in squeak though. I'd rather not deal with it at the socket level (though that would be possible). rST looks promising, but I'm a little concerned about its stability (the wiki page says "Testers are needed!" which makes me pause).
The difficulty in finding a good way to do distributed processing surprises me. I thought distributed processing was supposed to be one of Smalltalk's fortes. Which probably means I'm just missing something obvious again.
-Rich-
+ 1
this is why we often do not launch a metacompiler such as Smacc for simple languages. We often use class and selector the parsing, debugging, storage is free. Even the refactoring. Especially during a PhD I would work at that level and in 10 years when your language will be the mainstream language for trial you create a real compiler. This is at least the advice I gave to some friends of mine when they started to open Yacc/lex even before understanding deeply what they wanted to express.
Stef
On 17 août 06, at 12:52, David T. Lewis wrote:
When brings us back to your DLS question. Michael Latta's advice is very good: Try implementing your language as classes and methods that read well and make sense to people. you can read the source code for this in from a configuration file if you want. If that turns out not to be sufficient for your needs, you can implement any language syntax you like using SmaCC (parser generator like lex/yacc for Smalltalk). SmaCC is on SqueakMap also.
Hi rich
I would suggest to consider doing that in Smalltalk using the smalltalk syntax as a try and report the problems you get because the syntax of Smalltalk was made for kids and it is uniform and simple.
Can you give an example of what you want to express?
Trial name: 'FirstTrial' resultIn: 'Not so good'
Stef
All my DSL examples are in Ruby.
For DSL's, Ruby's syntax seems slightly more flexible than Smalltalk (or maybe I just know how to abuse it more).
Might I suggest that Smalltalk itself, isn't so much a language, as it is a notation for creating DSL's. Smalltalk for example, models predicate logic, with simple objects and blocks, no special keywords such as if/unless/do/while are necessary. Ruby can't do this, and requires special syntax in the language, due to its inability to pass multiple blocks and its lack of Smalltalk style keyword selectors. I'm curious where you see Ruby's syntax being more flexible?
On Aug 17, 2006, at 6:44 AM, Ramon Leon wrote:
All my DSL examples are in Ruby.
For DSL's, Ruby's syntax seems slightly more flexible than Smalltalk (or maybe I just know how to abuse it more).
Might I suggest that Smalltalk itself, isn't so much a language, as it is a notation for creating DSL's. Smalltalk for example, models predicate logic, with simple objects and blocks, no special keywords such as if/unless/do/while are necessary. Ruby can't do this, and requires special syntax in the language, due to its inability to pass multiple blocks and its lack of Smalltalk style keyword selectors. I'm curious where you see Ruby's syntax being more flexible?
Before I get too far into this, let me again point out that my sense that Ruby handles DSLs (as I am currently thinking about them) possibly better than Smalltalk may simply be because I am more familiar with Ruby syntax than Smalltalk. And because I have several good examples that give clear examples of different methods for building Ruby classes/methods/etc. to support DSLs.
So, please, please, please. If anyone knows of any good examples that show how to do these things in Smalltalk, please let me know. That might give me a better handle on how to approach this in Smalltalk, and might just win me over.
First off, I'm talking exclusively about using internal DSLs here. That is, I will be using the natural features of a general purpose language. I'm not talking about building a full-fledged parser/ interpreter. However, I do want to be able to read in and interpret arbitrary text files at runtime.
I think the approach should be similar in both the Ruby and Smalltalk case. Take a line of text. Evaluate it as code in a context so that the individual words in the line get interpreted as objects/messages/ methods/arguments/whatever.
If this is the case, then I can see a few places where Ruby would be simpler. For example, if you're executing text as code within an object, you don't need 'self' when referencing methods. As a result, most Ruby DSLs execute inside objects--I suspect Smalltalk DSLs don't do this.
To me, this seems to imply that in Smalltalk, the first word on each line will typically be a class, followed immediately by either a class method or a constructor. Ruby DSLs can do this as well, but they can also start immediately with a method call on the containing class. That, potentially, gives Ruby a considerable bit of extra flexibility.
Second, in Ruby methods that take arguments do not need to end in a colon. This can help keep the DSL syntax clean, particularly for single-argument methods. Ruby methods can also have default values set for the parameters (which I don't believe is available in Smalltalk), and if the final parameter is a hash, you can use the simplified hash syntax.
On the smalltalk side, I suspect cascading and the separate selector for each argument could produce highly readable DSL syntax--but I'd really like to see a few demo examples to get an idea of how it all fits together.
There may also be ways of doing things in Smalltalk syntax that could make DSLs easier--things that I don't know, or that I'm just not thinking about. For example, I don't see how avoiding if/unless/do/ while really gains anything (especially since 'if' is arguably more human readable than 'ifTrue:'). I also don't see a big gain in passing single blocks vs. multiple blocks. I doubt I'd use blocks in the DSL directly anyway (or 'if' for that matter)--since the block syntax is a bit ugly in both languages--and I can't imagine it being necessary.
Really, I'll probably be implementing something very simple--so it's probably a wash.
It looks like I'll need to set the following information:
Run name, ID, number of agents, target function, max error, visualization on/off, verbose on/off
In Ruby this could be done as follows (calls the new_run method and passes in a hash):
new_run name => 'my name', id => 0, agent_count => 200, target => 30sphere ,error => 1e-10, visualize => true
Since we are passing a hash into the new_run method, these arguments can be in any order. They can also be omitted (the target object presumably sets a default for anything not present).
The same thing in smalltalk would look like this (note, they can be in almost any order--'name:' is a constructor and must come first-- the others can be in any order and can be dropped):
TrialRun name: 'my name'; id: 0; agentCount: 200; target: 30sphere; error: 1e-10; visualize: true
or, for a prettier option (but one that sacrifices flexibility)
TrialRun name: 'my name' id: 0 agentCount: 200 target: 30sphere error: 1e-10 visualize: true verbose: false
None of them are really as readable as I would like, but any would do. The last one is the most readable, but if the number of optional flags started to grow--it would quickly become a real pain.
-Rich-
Of course, the best ideas always come after I hit the send button.
It dawned on me that I could always preprocess the incoming string on either platform. A relatively trivial amount of code means I could write the (now case insensitive) DSL as:
name: my name, id: 0, number of agents: 200, target function: 30sphere, maximum error: 1e-10, visualize
And have it converted into a simple format for either platform:
new_run :name => 'my name', :id => 0, :number_of_agents => 200, :target_function => :30sphere , :error => 1e-10, :visualize => true
or
TrialRun new; name: 'my name'; id: 0; numberOfAgents: 200; targetFunction: #30sphere; error: 1e-10; visualize: true
Then evaluate the string.
Of course, this is moving a big step towards the full parser/ interpreter approach. Well, maybe not that big a step, given the limited scope of the DSL, but a step.
-Rich-
On Aug 18, 2006, at 12:35 AM, Rich Warren wrote:
It looks like I'll need to set the following information:
Run name, ID, number of agents, target function, max error, visualization on/off, verbose on/off
In Ruby this could be done as follows (calls the new_run method and passes in a hash):
new_run name => 'my name', id => 0, agent_count => 200, target => 30sphere ,error => 1e-10, visualize => true
Since we are passing a hash into the new_run method, these arguments can be in any order. They can also be omitted (the target object presumably sets a default for anything not present).
The same thing in smalltalk would look like this (note, they can be in almost any order--'name:' is a constructor and must come first-- the others can be in any order and can be dropped):
TrialRun name: 'my name'; id: 0; agentCount: 200; target: 30sphere; error: 1e-10; visualize: true
or, for a prettier option (but one that sacrifices flexibility)
TrialRun name: 'my name' id: 0 agentCount: 200 target: 30sphere error: 1e-10 visualize: true verbose: false
None of them are really as readable as I would like, but any would do. The last one is the most readable, but if the number of optional flags started to grow--it would quickly become a real pain.
-Rich-
-----Original Message----- From: squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org] On Behalf Of Rich Warren Sent: Friday, August 18, 2006 4:35 AM To: The general-purpose Squeak developers list Subject: Re: Info on Smalltalk DSLs or Metaprogramming...
Of course, the best ideas always come after I hit the send button.
It dawned on me that I could always preprocess the incoming string on either platform. A relatively trivial amount of code means I could write the (now case insensitive) DSL as:
name: my name, id: 0, number of agents: 200, target function: 30sphere, maximum error: 1e-10, visualize
And have it converted into a simple format for either platform:
TrialRun new; name: 'my name'; id: 0; numberOfAgents: 200; targetFunction: #30sphere; error: 1e-10; visualize: true
Seems to me the difference between
name: my name, id: 0, number of agents: 200, target function: 30sphere, maximum error: 1e-10, visualize
And this
TrialRun name: 'my name'; id: 0; numberOfAgents: 200; targetFunction: #30sphere; error: 1e-10; visualize: true
Are so trivial, why bother with the parsing step at all, just use direct Smalltalk syntax, if kids can learn Smalltalk, so can users of a DSL. As far as samples of DSL's go, I use one daily in the Seaside framework for generating html http://www.seaside.st/Documentation/GeneratingHTML/, and another http://scriptaculous.seasidehosting.st/, for generating JavaScript. Both I think are good examples of embedded DSL's in Smalltalk in daily use.
On Aug 18, 2006, at 6:28 AM, Ramon Leon wrote:
Seems to me the difference between
name: my name, id: 0, number of agents: 200, target function: 30sphere, maximum error: 1e-10, visualize
And this
TrialRun name: 'my name'; id: 0; numberOfAgents: 200; targetFunction: #30sphere; error: 1e-10; visualize: true
Are so trivial, why bother with the parsing step at all, just use direct Smalltalk syntax, if kids can learn Smalltalk, so can users of a DSL. As far as samples of DSL's go, I use one daily in the Seaside framework for generating html http://www.seaside.st/Documentation/ GeneratingHTML/, and another http://scriptaculous.seasidehosting.st/, for generating JavaScript. Both I think are good examples of embedded DSL's in Smalltalk in daily use.
First, thank you so much for the samples. I'll look at them as soon as I have time.
As far as justifying the parsing step, my main motivation is to have a config file that non-programmers can easily read. I don't want them to have to learn anything (or as little as possible). I would like it to be simple to write or change by hand too--so they can script their own series of trials--but that's a secondary consideration. For the actual trial runs, I'll undoubtedly create a large config file automatically, in order to ensure a thorough coverage of the possible permutations.
But non-programmer readability is the reason I'd love to have multi- word selectors (instead of things_like_this or thingsLikeThis), and the reason I'd like to avoid strange punctuation (like => or the Smalltalk semicolons, or syntax to indicate that something is a string or symbol). And, finally, I'd like to get rid of any unnecessary words (new_run and TrialRun new)--unless I have different types of runs, it's just uninformative boilerplate.
Also, the parsed version could easily be case insensitive, allowing me to switch to something like this (if I thought it added clarity):
NAME: my name, ID: 0, NUMBER OF AGENTS: 200, TARGET FUNCTION: 30Sphere, MAXIMUM ERROR: 1e-10, visualize
Or if I was just varying one parameter, and wanted to highlight it, I could use all caps for just that selector.
But it's only worth it if it's simple to implement. Case insensitivity is trivial. As is stripping off leading (or trailing) boilerplate. Replacing 'number of agents' with 'numberOfAgents' is also trivial, as is switching from commas to semicolons.
The only slightly tricky part is automatically adding quotes to strings and # to symbols--so I may just leave that out.
-Rich-
Rich I would suggest you to read the paper on aconcagua and unit published at OOPSLA and ESUG last year by hernan Wilkinson. They should that extending in a clever way numbers they have a really natural way of expressing units and time. For example, imagine that 1 st, April is a valid Smalltalk expression returning a date.
Then I think that you should pay attention about the assumption tthat you have regarding the syntax your readers can understand. For example I'm skeptical that : is bad for argument. But you will tell us.
Stef
On 18 août 06, at 22:19, Rich Warren wrote:
On Aug 18, 2006, at 6:28 AM, Ramon Leon wrote:
Seems to me the difference between
name: my name, id: 0, number of agents: 200, target function: 30sphere, maximum error: 1e-10, visualize
And this
TrialRun name: 'my name'; id: 0; numberOfAgents: 200; targetFunction: #30sphere; error: 1e-10; visualize: true
Are so trivial, why bother with the parsing step at all, just use direct Smalltalk syntax, if kids can learn Smalltalk, so can users of a DSL. As far as samples of DSL's go, I use one daily in the Seaside framework for generating html http://www.seaside.st/Documentation/ GeneratingHTML/, and another http://scriptaculous.seasidehosting.st/, for generating JavaScript. Both I think are good examples of embedded DSL's in Smalltalk in daily use.
First, thank you so much for the samples. I'll look at them as soon as I have time.
As far as justifying the parsing step, my main motivation is to have a config file that non-programmers can easily read. I don't want them to have to learn anything (or as little as possible). I would like it to be simple to write or change by hand too--so they can script their own series of trials--but that's a secondary consideration. For the actual trial runs, I'll undoubtedly create a large config file automatically, in order to ensure a thorough coverage of the possible permutations.
But non-programmer readability is the reason I'd love to have multi- word selectors (instead of things_like_this or thingsLikeThis), and the reason I'd like to avoid strange punctuation (like => or the Smalltalk semicolons, or syntax to indicate that something is a string or symbol). And, finally, I'd like to get rid of any unnecessary words (new_run and TrialRun new)--unless I have different types of runs, it's just uninformative boilerplate.
Also, the parsed version could easily be case insensitive, allowing me to switch to something like this (if I thought it added clarity):
NAME: my name, ID: 0, NUMBER OF AGENTS: 200, TARGET FUNCTION: 30Sphere, MAXIMUM ERROR: 1e-10, visualize
Or if I was just varying one parameter, and wanted to highlight it, I could use all caps for just that selector.
But it's only worth it if it's simple to implement. Case insensitivity is trivial. As is stripping off leading (or trailing) boilerplate. Replacing 'number of agents' with 'numberOfAgents' is also trivial, as is switching from commas to semicolons.
The only slightly tricky part is automatically adding quotes to strings and # to symbols--so I may just leave that out.
-Rich-
On Aug 19, 2006, at 12:51 AM, stéphane ducasse wrote:
Rich I would suggest you to read the paper on aconcagua and unit published at OOPSLA and ESUG last year by hernan Wilkinson.
Thanks, I'll look for this.
Then I think that you should pay attention about the assumption tthat you have regarding the syntax your readers can understand. For example I'm skeptical that : is bad for argument. But you will tell us.
I never meant to imply that colons were bad. In fact, my "ideal" syntax would use them. What I meant is, forcing you to use colons at the end of methods makes Smalltalk a little less flexible. There are some cases where, it seems to me, the colons would be intrusive. Particularly in methods that take a single argument.
Let's take the totally hypothetical situation. Say you wanted to interpret the words "See spot run".
In Ruby, "See" could be an object, "spot" a method and "run" a local variable.
As far as I know, you couldn't interpret the same thing directly in Smalltalk. You would need to write "See spot: run", which is where the colons become a problem.
Of course, there are other cases where the colon would come in handy.
Having thought about both languages a lot over the last few days, I'm pretty sure of the following:
1) Regardless of which language you use, there will be DSL elements that appear awkward or clunky (provided you do no string processing).
2) Some things will always be easier to write in the other language.
-Rich-
In Ruby, "See" could be an object, "spot" a method and "run" a local variable.
As far as I know, you couldn't interpret the same thing directly in Smalltalk. You would need to write "See spot: run", which is where the colons become a problem.
Of course, there are other cases where the colon would come in handy.
Having thought about both languages a lot over the last few days, I'm pretty sure of the following:
- Regardless of which language you use, there will be DSL elements
that appear awkward or clunky (provided you do no string processing).
- Some things will always be easier to write in the other language.
-Rich-
Ruby might allow parens to be optional allowing run to be sent to spot, however, it'd look more like...
See.spot run
Hardly any better than
See spot: run
Besides, you could always setup spot as a member of see, then...
See spot run
Is perfectly valid Smalltalk, just like Ruby's...
See.spot.run
However you work it, I think the Smalltalk will come up with a more natural English looking syntax due to it using spaces where ruby would use periods and it using periods as a statement separator.
See spot run. Spot go home. Spot wag tail.
Is a perfectly valid Smalltalk statement, can Ruby do that?
On Aug 20, 2006, at 7:20 AM, Ramon Leon wrote:
In Ruby, "See" could be an object, "spot" a method and "run" a local variable. As far as I know, you couldn't interpret the same thing directly in Smalltalk. You would need to write "See spot: run", which is where the colons become a problem. Of course, there are other cases where the colon would come in handy. Having thought about both languages a lot over the last few days, I'm pretty sure of the following:
- Regardless of which language you use, there will be DSL
elements that appear awkward or clunky (provided you do no string processing). 2) Some things will always be easier to write in the other language. -Rich-
Ruby might allow parens to be optional allowing run to be sent to spot, however, it'd look more like...
See.spot run
You're right. I got confused skipping from one language to the other (and, as I previously mentioned, most Ruby DSLs are based on method calls within a class, not method calls on a class). Typically this would be done as chained method calls
see(spot(run)) => see spot run
Hardly any better than
See spot: run
Besides, you could always setup spot as a member of see, then...
See spot run
Of course. This is another valid way of chaining--only running the other way (#run is sent to the value returned by #spot.
However you work it, I think the Smalltalk will come up with a more natural English looking syntax due to it using spaces where ruby would use periods and it using periods as a statement separator.
See spot run. Spot go home. Spot wag tail.
Is a perfectly valid Smalltalk statement, can Ruby do that?
As I tried to say before, my main point really, I think it depends on what you're familiar with. The more I look at both of them, the more I see good points (and annoying points) about both.
Basically you have to design the DSL around either language. And I really don't see anything in either that's a big win over the other.
Smalltalk's period can be nice, if you can design around it. It's better than Ruby's semicolon--but Ruby also lets you use line breaks-- which can lead to very nice multi-line constructions.
Smalltalk works better for multi-parameter methods--Ruby for single parameter.
Smalltalk's insistence on self for method calls within a class require you to have a class object (which often means an additional item you need to plan around--or one more item to use, depending on how you look at things).
Smalltalk's continuations are nice, but since Ruby lets you make your calls within a class, you can do the same thing with multiple calls.
Ruby's literal hashes are not great from a non-geek legibility viewpoint, but if you're making a DSL for coders, they're brilliant.
Overall, I don't see enough of a difference to really argue over.
-Rich-
On Aug 22, 2006, at 2:36 AM, Bert Freudenberg wrote:
Rich Warren schrieb:
Ruby's literal hashes are not great from a non-geek legibility viewpoint, but if you're making a DSL for coders, they're brilliant.
Aren't Smalltalk dictionaries equally legible?
{ 'one' -> 1. 'two' -> 2. 'foo' -> 42. } as: Dictionary
- Bert -
I'd argue Ruby (can be) a little more streamlined. If it's the last parameter, you don't need any brackets. And it doesn't need the as: Dictionary call.
However, thanks. I didn't know about this idiom, and I'll be sure to use it a lot.
-Rich-
Am 22.08.2006 um 21:22 schrieb Rich Warren:
On Aug 22, 2006, at 2:36 AM, Bert Freudenberg wrote:
Rich Warren schrieb:
Ruby's literal hashes are not great from a non-geek legibility viewpoint, but if you're making a DSL for coders, they're brilliant.
Aren't Smalltalk dictionaries equally legible?
{ 'one' -> 1. 'two' -> 2. 'foo' -> 42. } as: Dictionary
- Bert -
I'd argue Ruby (can be) a little more streamlined. If it's the last parameter, you don't need any brackets. And it doesn't need the as: Dictionary call.
well, if you insist on getting rid of the brackets in your DSL, this is legal Smalltalk:
'one' -> 1, 'two' -> 2, 'foo' -> 42
Challenge: make that expression answer the dictionary as above
Solution: attached, but try yourself first ;)
- Bert -
Wow, Ralph Johnson mentioned this thread on his blog (http:// www.cincomsmalltalk.com/userblogs/ralph/blogView? showComments=true&entry=3334257004).
Seems a bit odd, being called "The Ruby guy". Sure, I use Ruby. Sometimes. I also use lisp, smalltalk, objective c, java and (when forced) c++. Of them, Ruby and Smalltalk are probably my current favorites (unless I'm doing a GUI application for the Mac, then Objective C is probably the top). Unfortunately, I'm usually forced to work in Java, lots and lots of Java. If anything, I'm an unwilling Java guy.
Ralph also seems to have misunderstood what I was trying to say. I don't want to start a fight or anything, but I thought others might also have missed my point (or the larger point might have gotten lost when I started answering specific questions). I'd like to clear things up, since I think DSLs can be a very useful tool, and are well worth learning. I hope others might find them useful.
"...it took a little work to figure out what he meant. Part of the problem was that Smalltalkers make DSLs of a certain type so effortlessly that they just call it "programming"."
Part of the problem is different people seem to have different interpretations of what a DSL is. In some definitions, any significantly complicated project becomes a DSL (or at least any well- written project). After all, we create functions, methods, objects, etc. that clearly and simply express the domain. In this sense, programming Smalltalk is very much like writing a DSL (though I think the trend is even more pronounced in Lisp). However, I don't think this definition is particularly useful.
When I spoke about DSLs, I was particularly talking about reading in and evaluating text files. The simplest example is a configuration file. Several of the online examples also follow this guideline. Admittedly, this is more useful for languages like Java (and, ironically much more difficult to create), since it lets you change an applications behavior without recompiling. There are still some clear benefits for Ruby and Smalltalk. Rails, for example, makes great use of DSLs.
You could argue that, for Smalltalk, the idea of a DSL is a bit strange, since it involves moving some of the code outside the image. Especially in Squeak, since (as far as I know) you have to leave the squeak environment to edit arbitrary text files.
"The Ruby guy wanted a little more, he wanted a certain syntax."
I'm not entirely sure what this means. I think he means I wanted a specific, non-smalltalk syntax. That's not really true. I'll probably implement my DSL using a pure smalltalk syntax (or smalltalk with minimal text processing). It's close enough for me. However, someone did ask what my ideal syntax would be--and so the thread went off on that tangent.
In general, yes. The advice to utilize Smalltalk syntax directly is good. That is what I had planned to do from the start. Originally I was trying to find examples of how others had used Smalltalk syntax to do this sort of parsing. I was hoping to learn a few tricks and tips by looking at other implementations.
"However, creating good languages is not easy, and few people can do it. I think that is the limiting factor in DSLs."
This is definitely true if you're trying to create a Turing Complete language for general programming. However, most DSLs are not Turing Complete. They are small, focused, little things. They do one thing, and they do it as simply and cleanly as possible. As a result, they are not typically very hard to write.
Here's an example of what I'm talking about. I'm about to implement a neural net. I'll be experimenting with many different sizes and topographies. This is an excellent opportunity for a DSL. I could create several net-building scripts that are then loaded and interpreted by the main application. Then, if someone wanted a different topography, they could just write and load their own build script. I could even build an object to automatically write out build script permutations. The scripts themselves act as both source code and log.
-Rich-
Hello group,
I have been reading through the mail list archives and I thought I would share my thoughts as an outsider (at the moment) to the smalltalk community. I appoligize in advance for the size of this email. :)
Computers were not my initial profession, so I came in from a learn-as-you go situation. But I have been in IT over 10 years now and think I have a pretty good idea of a possible silver bullet when I see one. :) Smalltalk seems to be the perfect development environment and what's more; it deserves to be used more then the languages that are used right now.
Before I was an effienciency/static typing junky, but smalltalk has made me rethink the typing at least. :) After all, how many errors *has* that really caught for me compared to all the times code didn't compile because the compiler was confused about something that should work.
Smalltalk even showed me that self generating code could be a good thing. When I first heard of, and thought about the possibilities of this years ago in Perl I cringed. But the reason I cringed was simple: Assembly, C/C++, Perl, Java, everyone else really have two distinct modes: Design mode (where your code is layed out and how) and runtime mode (what it actually looks like as a running system). Self modifying code in this situation is a scary thing because it pushes those two modes even further apart then they were to begin with (which is often pretty far). But smalltalk opened this door for me because it doesn't have that problem. The design and runtime modes are almost the same thing. If I impliment a "doesnotunderstand:" that builds any messages it recieves, let it run for a few days and then come back, the system will have made my methods for me. Then I can take that method out if I want. Amazing. But it's ok, since the source code and the running system are almost one and the same this practice doesn't cloud my view of what the running system looks like.
As I have been looking through the programming languages out there (have been between jobs, so I decided to brush up on my programming a bit) you can't help but see lisp. I know lisp people hate to hear it, but lisp seems like the best of research languages. It seems like every advance in languages came from lisp at one point or another. But it feels like smalltalk has taken the advances and made them usable by the normal man. And smalltalk did the right thing taking the real ideas, not a castrated version of the idea. The exception mechanism for example (see C++, Java, et al), smalltalk has method resumes, restarts, everything.
Perl is the classic case of a sense of loyalty taken too far. A man saves your life (and perl did save us. We were programming CGI in C before it came along and woke everyone up) but as time goes by he has asked to move in with you (perl decided cgi and sys admin wasn't enough, it wants to develop all your apps!) and one day you dont see him anywhere but cloths are all over the floor, perl and your wife are no where to be seen and there is some uncomfortable noise comming from upstairs. But he saved your life right?
Perl is a disgusting hack from top to bottom. It is a filesystem based language like the rest, but even having a source of more then one file is a hack. "Why do I need a 1; at the end of my file again? Oh right, someone somewhere might want their file to execute code when it gets included and in perl TIMTOWTDI! Since they might, we all must? What was that you said about 'simple things simple, hard things...'?".
Ruby is of course appealing because it has something like the smalltalk syntax. But in the end it is a script language and to get where it needs to be to be the best it needs to, well, be what smalltalk is right now.
What about Java? Well you can build anything you want with turds and glue. You can build a big boat, you can build a huge castle, but what do you have at the end? A big smelly pile of crap. That is what Java is in my mind. If the universe is "turtles all the way down", smalltalk is "objects all the way down" and Perl is "hacks all the way down" then Java is surely "inconsistancy all the way down". And just as perl has shown, a million monkeys typing on a million keyboard wont reproduce the works of Shakespeare, and it also wont turn a big pile of crap into a Ferrari. But it might be able to build something to get you to work if you can bear the smell.
So what went wrong? You have the right idea, why isn't everyone here already?
Reading through the list, a few things struck me:
First, Luckas and Andreas fighting over extending functionality vs. backward compatibiltiy. Well, I wouldn't presume to take sides in such an argument, but there are a couple of important points we must always keep in mind: backward compatibility is a noble cause. No one wants to work where they syntax of the language can change before you can even get your program that used the "old" syntax finished. But on the other hand, backward compatibility is an open paracute on your back.
In Estonia in the early 90's it was not uncommon to not have running water. Only about 50% of the population had a phone line. But in 2004 Estonia became the most technologically advanced nation in all of EU, maybe the world. It has the largest % of cell phone users, the government was completley paperless! How did they come so far so fast? Simple: no backward compatibility what-so-ever. No one screamming "Wait! I'm still using windows 3.1, we can't make that change!" No open paracute's on anyones back.
So what is the right answer between Luckas and Andreas? I don't know, but when we talk about backward compatibility, while we dont want to break things just to say we did, we also can't get in a situation that takes 15 years to dig out of. In some cases backward compatibility is the 100% right answer, but in my mind the backward compatibility side has 1 default mark against it. If it is indeed the right answer, then it should be able to overcome this easily, and perhaps this particular argument is just such a case.
Scripting. Do we need it? Well Java doesn't have it. C++ doesn't have it. And those are the two most popular languages afaik. But both of those have huge business backing them. The languages that do *not* have this kind of backing, but are sucessfull are all script languages, or can run in script mode.
How hard would it bee to just make an image that looks a little different then the default image, it expects arguments set up the way they are with typical #! setups? And any syntax chosen needs to look as close as possible to what smalltalk is now. No new strange constructs that are totally different inside the image, no meta-programming as a rule. It needs to look like it does in the browser.
Tim is right, this would be a step back. Smalltalk has a much better environment if you just use the image. But what is more important at this point: being right, or getting a bigger base for the language? I know which one I would pick. I know it's frustrating having the solution and having to stuff it down peoples throats, but if hair dryer companies can put those stupid labels on hair dryers, can't we give a scripting option?
And hey, when a squeakscript user says "By the way, have you guys got any kind of debugger?" Out pops the smalltalk salesman complete with a huge grin and a cheasy suit saying "Why sure! Just run this" and presto, when they see they can change code in the debugger and it just resumes from there, most of them are going to become converts. But first you have to drag them kicking and screaming somehow.
I'm sure the Howard Aiken quote is familiar to all smalltalkers: "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats."
What smalltalk also needs is a killer app. Maybe seaside will be that killer app if the inferier language crowd doesn't steal it first.
But no matter how you get them here, it wouldnt matter one bit today because they wont stay. Why? Because smalltalk documentation is like a ghost town. When I found whysmalltalk.com (shows up #4 if you google "smalltalk tutorial") I was excited about all the examples and tutorials. After 90% of the links pointed nowhere I started doing searches on the net to find out if I was simply too late, maybe smalltalk was dead already. And your own squeak site isn't much better. Nothing screams "no one lives here anymore" like dead links. And the more dead links the loader the scream.
One thing I think I disagree with stéphane about (not sure I understand his point exactly) is the releases. If a squeak version is released in the forest and no one is there to see it, will anyone care? Fixing bugs are important if that's what you mean by release. New features to help support those killer aps are important. But if you don't have any documentation anywhere no one will stay. I stayed because I was determined to fix this gap in my knowledge and learn this language, dead or not.
And dont go down the road that "smalltalk is simple so the code documents itself". The code NEVER documents itself, that is a cop-out and a bold face lie. If you don't want to document then for God's sake, hand it off to someone who will. Not every single method ever of course, but anything the API user uses directly should be documented.
And it needs to be consistant too. I'm a "digger", if it is there I will find it. But most people aren't. If your solution is "well go to the class side, there is maybe some method there that documents the class" then you don't have a solution. "Documentation is always on the class side in the 'documentation' protocol (and here is how you find that)" would be much better.
You have a very friendly mail list, the best I've ever seen to be honest. But that doesn't overcome documentation. People are not trained to look on mailing lists for documentation. When thinking about users you have to think Homer Simpson. You can scream "look in the news groups" on every page and he will say "Thanks, what is the link to/program that shows the documentation?".
I hope someone somewhere finds something I said useful. :)
Hi J J,
you seem to already know all the best kept secrets in and around Smalltalk and Squeak, you're not really an outsider :)
Thanks for sharing your thoughts.
/Klaus
J J wrote:
Java is surely "inconsistancy all the way down".
ROFL
I'm sure the Howard Aiken quote is familiar to all smalltalkers: "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats."
Yup, and we Smalltalkers usually are way to polite to do this ;-)
What smalltalk also needs is a killer app. Maybe seaside will be that killer app if the inferier language crowd doesn't steal it first.
Seaside is certainly the killer app in the website application area demonstrating a viable alternative to scripting.
Another one could be Sophie (OK, I'm one of the developers ;-) ).
I hope someone somewhere finds something I said useful. :)
Thank you, thank you, thank you :-)
Michael
When I first saw squeak 2 years ago, I just gave up immediatly and started with vw... Then I decided to use seaside and the vw port was just starting so I choose to use squeak and I don't regret it now that I'm used to it... and for me 3.9 is more appealing than the previous version which is cool (Thanks all)!
I don't think mainstream anymore ;)
What smalltalk also needs is a killer app. Maybe seaside will be that killer app if the inferier language crowd doesn't steal it first.
Seaside is certainly the killer app in the website application area demonstrating a viable alternative to scripting.
Actually, I find it's even a bit more (than just web site application), a kind of showcase of the power of the whole stuff :) ... it's an entry points to squeak and also a real alternative GUI (multiplatform etc...).
Indeed, I think it would be really cool to have a web2.0 IDE (just for outsider to start to familiarize)... a bit like here: http://mmm.seasidehosting.st/seaside/liveWeb (not working now...) with a cool live browser (like the class browser of scriptaculous). I'm sure such an app would call people's attention to squeak ! And once you're in, you're addicted :)
Cédrick
Thanks. :) I will go out and look at Sophie. I don't recall hearing about it yet.
And I certainly plan on writing some code once I figure out what is needed. Network Management has traditionally been my space so I had planned on making an SNMP client library if one doesn't exist already. I see telnet already had some packages.
From: Michael Rueger m.rueger@acm.org Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Wed, 30 Aug 2006 11:29:43 +0200
J J wrote:
Java is surely "inconsistancy all the way down".
ROFL
I'm sure the Howard Aiken quote is familiar to all smalltalkers: "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats."
Yup, and we Smalltalkers usually are way to polite to do this ;-)
What smalltalk also needs is a killer app. Maybe seaside will be that killer app if the inferier language crowd doesn't steal it first.
Seaside is certainly the killer app in the website application area demonstrating a viable alternative to scripting.
Another one could be Sophie (OK, I'm one of the developers ;-) ).
I hope someone somewhere finds something I said useful. :)
Thank you, thank you, thank you :-)
Michael
"J J" azreal1977@hotmail.com writes:
Scripting. Do we need it? Well Java doesn't have it. C++ doesn't have it. And those are the two most popular languages afaik. But both of those have huge business backing them. The languages that do *not* have this kind of backing, but are sucessfull are all script languages, or can run in script mode.
How hard would it bee to just make an image that looks a little different then the default image, it expects arguments set up the way they are with typical #! setups? And any syntax chosen needs to look as close as possible to what smalltalk is now. No new strange constructs that are totally different inside the image, no meta-programming as a rule. It needs to look like it does in the browser.
Tim is right, this would be a step back. Smalltalk has a much better environment if you just use the image.
For bigger programs, clearly yes. For small programs, though, it can be much more convenient to use a script file. A file-sized chunk of code is an excellent unit of code exchange. Good tools make this unit of code exchange nice to work with.
There are a lot of things that a script-running program can make easier. For example:
1. Compilation/Loading. You do not have to deal with when to run the compiler and/or load the code into the running system. The script runner does whatever is needed to make your code run.
2. Dependencies. If your program needs external libraries, at worst you put a declaration at the top of your file.
3. Integration with other tools. Any tool that can work with text files can work with script files. CVS, SVN, and pretty much any decent version control system has a convenient way to handle text files. You can even embed script files into programs in other languages. Try these things with an image -- it's possible but takes some work.
-Lex
PS -- If your operating system is Squeak, then yes you can just "do it" to run your code. But for the sake of argument, let's suppose that you are using some backwards non-Squeak operating system that does not use Smalltalk for its system language.
And there are plenty ways of doing scripting in squeak. For instance the simpler way is to fire up a Squeak server and send it the content of a text file (network cat o nc can be used to do it in a snap) on a pre-defined port. This is totally unsafe, but pretty fast to do. My 5 cents (yes I am coming richer!)
On 30 Aug 2006 14:10:53 +0200, Lex Spoon lex@cc.gatech.edu wrote:
"J J" azreal1977@hotmail.com writes:
Scripting. Do we need it? Well Java doesn't have it. C++ doesn't have it. And those are the two most popular languages afaik. But both
[...]
For bigger programs, clearly yes. For small programs, though, it can be much more convenient to use a script file. A file-sized chunk of code is an excellent unit of code exchange. Good tools make this unit of code exchange nice to work with.
There are a lot of things that a script-running program can make easier. For example:
- Compilation/Loading. You do not have to deal with when to run the
compiler and/or load the code into the running system. The script runner does whatever is needed to make your code run.
- Dependencies. If your program needs external libraries, at worst
you put a declaration at the top of your file.
- Integration with other tools. Any tool that can work with text
files can work with script files. CVS, SVN, and pretty much any decent version control system has a convenient way to handle text files. You can even embed script files into programs in other languages. Try these things with an image -- it's possible but takes some work.
-Lex
PS -- If your operating system is Squeak, then yes you can just "do it" to run your code. But for the sake of argument, let's suppose that you are using some backwards non-Squeak operating system that does not use Smalltalk for its system language.
"Giovanni Giorgi" daitangio@gmail.com writes:
And there are plenty ways of doing scripting in squeak. For instance the simpler way is to fire up a Squeak server and send it the content of a text file (network cat o nc can be used to do it in a snap) on a pre-defined port. This is totally unsafe, but pretty fast to do. My 5 cents (yes I am coming richer!)
Try it, and you will find that there are a lot of details you have to worry about. Where is the image and VM you use for running the scripts? How do you access stdin and stdout? How do you define methods and classes? Where does the output go when there is a syntax error or runtime error in your script?
These are all simple issues, but there are a lot of them.
-Lex
STX has a simple script processing client app. as part of their package. rdoit I think it was called.
Keith
Try it, and you will find that there are a lot of details you have to worry about. Where is the image and VM you use for running the scripts? How do you access stdin and stdout? How do you define methods and classes? Where does the output go when there is a syntax error or runtime error in your script?
These are all simple issues, but there are a lot of them.
-Lex
___________________________________________________________ The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
Well if you can read it on a port you can read it in a "boot" time of the image, no?
What *does* the image do with arguments it gets on the command line? Would it be possible to add a -s switch to give control over to some kind of script class subsystem? And I don't think the image would have to be scaled down much if at all. The image isn't that big right? And any modern OS will cache it after the first use anyway.
From: "Giovanni Giorgi" daitangio@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: why scripting (was: Thoughts from an outsider) Date: Thu, 31 Aug 2006 16:56:00 +0200
And there are plenty ways of doing scripting in squeak. For instance the simpler way is to fire up a Squeak server and send it the content of a text file (network cat o nc can be used to do it in a snap) on a pre-defined port. This is totally unsafe, but pretty fast to do. My 5 cents (yes I am coming richer!)
On 30 Aug 2006 14:10:53 +0200, Lex Spoon lex@cc.gatech.edu wrote:
"J J" azreal1977@hotmail.com writes:
Scripting. Do we need it? Well Java doesn't have it. C++ doesn't have it. And those are the two most popular languages afaik. But both
[...]
For bigger programs, clearly yes. For small programs, though, it can be much more convenient to use a script file. A file-sized chunk of code is an excellent unit of code exchange. Good tools make this unit of code exchange nice to work with.
There are a lot of things that a script-running program can make easier. For example:
- Compilation/Loading. You do not have to deal with when to run the
compiler and/or load the code into the running system. The script runner does whatever is needed to make your code run.
- Dependencies. If your program needs external libraries, at worst
you put a declaration at the top of your file.
- Integration with other tools. Any tool that can work with text
files can work with script files. CVS, SVN, and pretty much any decent version control system has a convenient way to handle text files. You can even embed script files into programs in other languages. Try these things with an image -- it's possible but takes some work.
-Lex
PS -- If your operating system is Squeak, then yes you can just "do it" to run your code. But for the sake of argument, let's suppose that you are using some backwards non-Squeak operating system that does not use Smalltalk for its system language.
-- Software Architect http://www.objectsroot.com/ Software is nothing
"J J" azreal1977@hotmail.com writes:
What *does* the image do with arguments it gets on the command line? Would it be possible to add a -s switch to give control over to some kind of script class subsystem?
For the standard image, see:
http://minnow.cc.gatech.edu/squeak/425
Keep in mind, though, that you can certainly have a scripting-specific image, and such an image can do things however you like.
And I don't think the image would have to be scaled down much if at all. The image isn't that big right? And any modern OS will cache it after the first use anyway.
This is one of the last things I would worry about. There are loads of little practical problems with writing scripts, and these are more important than the startup overhead.
To start with:
1. How do you access stdout and stdin?
2. What happens if there is a syntax error or an uncaught exception?
-Lex
"J" == J J azreal1977@hotmail.com writes:
J> Perl is the classic case of a sense of loyalty taken too far.
Your opinion of Perl is interesting, and not uncommon. But if you haven't seen what we're doing with Perl6, you might be missing something.
The object system of Perl6 (and necessarily of the Parrot VM below it) borrows a significant amount from Smalltalk and Self. The designers are fans. The formal introspection and malleability of Perl6 will rival Smalltalk, and that's a Good Thing. The Parrot VM design is quite nice, and will allow a CLR-style interoperability amongst many languages. I'm hoping someone will port Squeak to it, in fact.
One thing to keep in mind (considering VHS vs Beta, Windows vs Unix), is that a "successful" item isn't necessarily the "best" item: it merely has to be "good enough". In that case, we can compare the number of applications today running Perl vs running Smalltalk, and we see that Perl is "successful", and Smalltalk a "failure", by that measure.
Personally, I had discovered Smalltalk in 1981, running on a Magnolia at Tek where I had essentially unlimited access for two months. And I've been disappointed in nearly everything else ever since, and especially mad that Steve Jobs took only the surface features of ST80 for the Mac, leaving the elegant underpinnings as a discardable novelty. I still rave about how in 1981, I could get a full source-code stacktrace of the running application just by pressing a key, but that the backtrace was *live*, allowing full inspection/edit and *continue*, some thing that still doesn't exist today. In 1981. On a 1 MHz processor.
But I had to make a living, so the theoretically cool gets tossed aside, and the practical takes over. I still dabble with Squeak, but I make my living with Perl.
Maybe a future version of Squeak will be deemed "practical" enough to shake the "smalltalk is slow" or "smalltalk is weird" syndrome to rival Perl6 (et. seq.). That'd be great.
But I'm not holding my breath, or betting my company on it. :)
But no matter how you get them here, it wouldnt matter one bit today because they wont stay. Why? Because smalltalk documentation is like a ghost town. When I found whysmalltalk.com (shows up #4 if you google "smalltalk tutorial") I was excited about all the examples and tutorials. After 90% of the links pointed nowhere I started doing searches on the net to find out if I was simply too late, maybe smalltalk was dead already. And your own squeak site isn't much better. Nothing screams "no one lives here anymore" like dead links. And the more dead links the loader the scream.
And dont go down the road that "smalltalk is simple so the code documents itself". The code NEVER documents itself, that is a cop-out and a bold face lie. If you don't want to document then for God's sake, hand it off to someone who will. Not every single method ever of course, but anything the API user uses directly should be documented.
And it needs to be consistant too. I'm a "digger", if it is there I will find it. But most people aren't. If your solution is "well go to the class side, there is maybe some method there that documents the class" then you don't have a solution. "Documentation is always on the class side in the 'documentation' protocol (and here is how you find that)" would be much better.
You have a very friendly mail list, the best I've ever seen to be honest. But that doesn't overcome documentation. People are not trained to look on mailing lists for documentation. When thinking about users you have to think Homer Simpson. You can scream "look in the news groups" on every page and he will say "Thanks, what is the link to/program that shows the documentation?".
I hope someone somewhere finds something I said useful. :)
Great post, but one comment. I used to feel the same way, until I realized sample code is the best documentation there is, and alt + n on any method pulls up every reference to that method in the image providing me with plenty of examples of that method in use. The browsers and code have become THE documentation to me at this point and I rarely find I need, or want, anything more than that. I don't think it's a cop out or a lie to say the code is self documenting, it's simply a point of view one comes to hold after working in Smalltalk long enough.
Great post, but one comment. I used to feel the same way, until I realized sample code is the best documentation there is, and alt + n on any method pulls up every reference to that method in the image providing me with plenty of examples of that method in use. The browsers and code have
become
THE documentation to me at this point and I rarely find I need, or want, anything more than that. I don't think it's a cop out or a lie to say the code is self documenting, it's simply a point of view one comes to hold after working in Smalltalk long enough.
I do agree completely, even though i m working in smalltalk from few months. And regardlessly Smalltalk code in Squeak image is really much more readable than most languages libraries.
I seem to be off the list at the moment or missing messages so I missed the first post apparently.
The fact is, no matter how obvious the language is there are patterns we use. Sure in some instanses the method can be obvious enough to be understood. But there are plenty of OO patterns that are not obvious if you have not seen them before and sometimes even if you have. You may be able to read from the code what it is doing, but you are going to be thinking "why in the world is he doing this?".
Also, if you work with a pretty complicated subsystem (i.e. uses lots of underlying objects to get work done) do you really find it a good solution to dig through class after class after class just to find out what an interface (i.e. what the subsystem end users use) method does? And even if you do, someone new to the language isn't.
And must every usage of a new subsystem be a trip through every method in that system? Can't I just get a list of what the useful methods are and how to use them?
I appreciate the simplicity of the language, but it is because of this reason one must guard against the false feeling of "self documenting code". You don't have to document every method ever, but ANY interface to the subsystem should be documented some how and any method over a certain number of lines should be documented.
Even if you coded right in pure english, I still wouldn't know *why* you did it the way you did, and therefor I wouldn't know *why* I shouldn't just change it.
From: "Hiren Thacker" hithacker@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Wed, 30 Aug 2006 23:17:20 +0530
Great post, but one comment. I used to feel the same way, until I realized sample code is the best documentation there is, and alt + n on any method pulls up every reference to that method in the image providing me with plenty of examples of that method in use. The browsers and code have
become
THE documentation to me at this point and I rarely find I need, or want, anything more than that. I don't think it's a cop out or a lie to say the code is self documenting, it's simply a point of view one comes to hold after working in Smalltalk long enough.
I do agree completely, even though i m working in smalltalk from few months. And regardlessly Smalltalk code in Squeak image is really much more readable than most languages libraries.
-- Hiren J.Thacker(www.jroller.com/page/daredevihttp://www.jroller.com/page/daredevil l)
[sorry for very bad english :D]
The fact is, no matter how obvious the language is there are patterns we use. Sure in some instanses the method can be obvious enough to be understood. But there are plenty of OO patterns that are not obvious if you have not seen them before and sometimes even if you have. You may be able to read from the code what it is doing, but you are going to be thinking "why in the world is he doing this?".
Also, if you work with a pretty complicated subsystem (i.e. uses lots of underlying objects to get work done) do you really find it a good solution to dig through class after class after class just to find out what an interface (i.e. what the subsystem end users use) method does? And even if you do, someone new to the language isn't.
This is the difference between using a framework and using an API, Smalltalkers like frameworks, which by their very nature, require you to understand how they work. You make it sound like digging through classes is hard, it's just a couple keystrokes, browse here, browse, there, check out a few examples, bam, ok, makes sense now. I not only find digging through classes a good solution, I find it's the only one I've ever found that works. Documents lie, code doesn't. I consider understanding how something works, a prerequisite to using it well. And frankly, I can bounce around the code, in a far more organized and faster manner than I could through some document.
And must every usage of a new subsystem be a trip through every method in that system? Can't I just get a list of what the useful methods are and how to use them?
If you have a task to perform, you should be able to just browser class names to see who might do that, it's a simple task to quickly check a class for it's responsibilities. Well designed frameworks make this a breeze. As I said earlier, getting a list of the useful methods and how to use them, is only a hotkey or two away.
I appreciate the simplicity of the language, but it is because of this reason one must guard against the false feeling of "self documenting code". You don't have to document every method ever, but ANY interface to the subsystem should be documented some how and any method over a certain number of lines should be documented.
Even if you coded right in pure English, I still wouldn't know *why* you did it the way you did, and therefore I wouldn't know *why* I shouldn't just change it.
Self documenting code is not a false feeling, it's a point of view. Smalltalkers in general don't write long methods, so that's not an issue. I find class and method comments, totally sufficient for me to grok how a system works, a quick look at the hierarchy browser, couple of samples of those classes in use, and away I go. I usually find when something is done weird, there is a comment explaining why it was done that way right there in the code, as it should be.
I appreciate that some people want more documentation, that's a valid point of view, but let's not insist that those of us who think the many browsers, classes, categories, method categories, and class and method comments are sufficient documentation are somehow foolish, we're not. Some people need instructions on how to assemble things, others just look at the parts, tinker a bit, and figure it out, Smalltalk is wonderful for those in the latter camp. I'll take being able to look directly at the class over looking at a document any day of the week, it's the best documentation there is as far as I'm concerned.
I'm not trying to say you're a fool. It is great that this method works for you. But do you want smalltalk to be for people who tinker or do you want a larger user base? Larger user base buys you more bodies to write code so things get done faster, new killer apps get made. It also buys you more testers and potential bug fixers.
I just don't find "code is the documentation" acceptable at a professional level. Open software tried to say that in the beginning and they were shot down (any that wanted to make money anyway). If you want to play around, take your watch apart to see how it tells time, ok. But if my company has millions of dollars riding on your software there had better be some documentation.
Do really think it would be ok to deliver a product to a customer and say "well, the code is all there, dig around and you should be able to figure out how it works in no time"?
From: "Ramon Leon" ramon.leon@allresnet.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "'The general-purpose Squeak developers list'"squeak-dev@lists.squeakfoundation.org Subject: RE: Thoughts from an outsider Date: Wed, 30 Aug 2006 11:35:42 -0700
The fact is, no matter how obvious the language is there are patterns we use. Sure in some instanses the method can be obvious enough to be understood. But there are plenty of OO patterns that are not obvious if you have not seen them before and sometimes even if you have. You may be able to read from the code what it is doing, but you are going to be thinking "why in the world is he doing this?".
Also, if you work with a pretty complicated subsystem (i.e. uses lots of underlying objects to get work done) do you really find it a good solution to dig through class after class after class just to find out what an interface (i.e. what the subsystem end users use) method does? And even if you do, someone new to the language isn't.
This is the difference between using a framework and using an API, Smalltalkers like frameworks, which by their very nature, require you to understand how they work. You make it sound like digging through classes is hard, it's just a couple keystrokes, browse here, browse, there, check out a few examples, bam, ok, makes sense now. I not only find digging through classes a good solution, I find it's the only one I've ever found that works. Documents lie, code doesn't. I consider understanding how something works, a prerequisite to using it well. And frankly, I can bounce around the code, in a far more organized and faster manner than I could through some document.
And must every usage of a new subsystem be a trip through every method in that system? Can't I just get a list of what the useful methods are and how to use them?
If you have a task to perform, you should be able to just browser class names to see who might do that, it's a simple task to quickly check a class for it's responsibilities. Well designed frameworks make this a breeze. As I said earlier, getting a list of the useful methods and how to use them, is only a hotkey or two away.
I appreciate the simplicity of the language, but it is because of this reason one must guard against the false feeling of "self documenting code". You don't have to document every method ever, but ANY interface to the subsystem should be documented some how and any method over a certain number of lines should be documented.
Even if you coded right in pure English, I still wouldn't know *why* you did it the way you did, and therefore I wouldn't know *why* I shouldn't just change it.
Self documenting code is not a false feeling, it's a point of view. Smalltalkers in general don't write long methods, so that's not an issue. I find class and method comments, totally sufficient for me to grok how a system works, a quick look at the hierarchy browser, couple of samples of those classes in use, and away I go. I usually find when something is done weird, there is a comment explaining why it was done that way right there in the code, as it should be.
I appreciate that some people want more documentation, that's a valid point of view, but let's not insist that those of us who think the many browsers, classes, categories, method categories, and class and method comments are sufficient documentation are somehow foolish, we're not. Some people need instructions on how to assemble things, others just look at the parts, tinker a bit, and figure it out, Smalltalk is wonderful for those in the latter camp. I'll take being able to look directly at the class over looking at a document any day of the week, it's the best documentation there is as far as I'm concerned.
I'm not trying to say you're a fool. It is great that this method works for you. But do you want Smalltalk to be for people who tinker or do you want a larger user base? Larger user base buys you more bodies to write code so things get done faster, new killer apps get made. It also buys you more testers and potential bug fixers.
I don't measure success by the number of people using Smalltalk. Personally, I want Smalltalk to be for people who grok Smalltalk, not for people who want to make it more popular by making it more like everything else. Smalltalk rocks precisely because it's not like everything else, and that includes what is considered programmer documentation. Self documenting code is a style, one smalltalkers prefer, that and some unit tests, are the best documents there are.
I just don't find "code is the documentation" acceptable at a professional level. Open software tried to say that in the
Ok, maybe you don't, but many others do. There's lot's of stuff being done out there in Smalltalk land with little or no "formal" documentation. Documentation the way you define it, simply isn't necessary for success, maybe it's necessary for mass accpetance, but acceptance and success are different things. Smalltalk is already successful, and growing more so every day.
But if my company has millions of dollars riding on your software there had better be some documentation.
That's an opinion, not a fact, but there's plenty of code out there running on Squeak, and very little if any formal documentation. Success depends on people, not paperwork. You'd be trusting millions of dollars to a person, or a team of people, not some papers.
Do really think it would be ok to deliver a product to a customer and say "well, the code is all there, dig around and you should be able to figure out how it works in no time"?
I thought we were talking about documenting code for programmers, not user documents for products. Was I mistaken?
From: "Ramon Leon" ramon.leon@allresnet.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "'The general-purpose Squeak developers list'"squeak-dev@lists.squeakfoundation.org Subject: RE: Thoughts from an outsider Date: Wed, 30 Aug 2006 12:19:52 -0700
I don't measure success by the number of people using Smalltalk. Personally, I want Smalltalk to be for people who grok Smalltalk, not for people who want to make it more popular by making it more like everything else. Smalltalk rocks precisely because it's not like everything else, and that includes what is considered programmer documentation. Self documenting code is a style, one smalltalkers prefer, that and some unit tests, are the best documents there are.
I don't want smalltalk to be like everything else. But I do want language choice where I work, and that doesn't happen if the language doesn't have a very big user base. I don't think actually documenting your work will turn smalltalk instantly into Java.
I just don't find "code is the documentation" acceptable at a professional level. Open software tried to say that in the
Ok, maybe you don't, but many others do. There's lot's of stuff being done out there in Smalltalk land with little or no "formal" documentation. Documentation the way you define it, simply isn't necessary for success, maybe it's necessary for mass accpetance, but acceptance and success are different things. Smalltalk is already successful, and growing more so every day.
Well I certainly hope it gets more sucessful every day. It certainly deserves it IMO.
But if my company has millions of dollars riding on your software there had better be some documentation.
That's an opinion, not a fact, but there's plenty of code out there running on Squeak, and very little if any formal documentation. Success depends on people, not paperwork. You'd be trusting millions of dollars to a person, or a team of people, not some papers.
Yes, but that isn't the issue. The issue is what if you guys leave? If we have nice, up to date documentation of the system the team I have to get to replace you doesn't have to take as long figuring out the system.
Do really think it would be ok to deliver a product to a customer and say "well, the code is all there, dig around and you should be able to figure out how it works in no time"?
I thought we were talking about documenting code for programmers, not user documents for products. Was I mistaken?
No you weren't, but I see the two things as close to equivalant. If you wouldn't give software to end users with no documentation, how could you consider it ok if your end users happen to be programmers? I mean, in the case of a subsystem you are delivering an API, but I want to understand what it does without having to basically read the entire code.
I relize smalltalk code writers write small methods, and that is good for the system. But it takes me more time if I have to look up how a method works because the first method (or 3) wont actually be doing the work.
My single counter point. The code almost never explains how or why something was deleted /out/ of the code because it was Bad.
Don't assume everything in past versions is everything the programmer wrote in that method. Much of what the programmer learned was something he tried/failed and threw away, but which a new user might try /again/ because it was NOT in the code already. All the convenient searching shortcuts begin to fail if you need to find out how code has changed over time as one tries to understand it or how not to redo something bad.
The code also rarely tells you that the code which you may "understand" actually has code smell, is a /bad/ example, or is an archaic style of programming. Java may be inconsistent, but so is the Squeak class library... all the way down.
Sometimes you can't see the forest for the trees.
Cheers, Darius [|] Powered and Empowered by Smalltalk
Yes, the version system right as part of the IDE is amazing and powerful. Perhaps the issue we are having is that you are thinking of someone wanting to change the subsystem, and I am (mostly) thinking of people using the subsystem. I have identified that "X" will do what I want, now I have it downloaded, what do I do with it? Unit tests can give me examples but that isn't very formal, you know? :)
(I relize I also mentioned lines of any code over a certain amount, but I can and have been flexable on that point with people I work with).
From: "Darius Clarke" socinian@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Wed, 30 Aug 2006 13:04:19 -0700
My single counter point. The code almost never explains how or why something was deleted /out/ of the code because it was Bad.
Don't assume everything in past versions is everything the programmer wrote in that method. Much of what the programmer learned was something he tried/failed and threw away, but which a new user might try /again/ because it was NOT in the code already. All the convenient searching shortcuts begin to fail if you need to find out how code has changed over time as one tries to understand it or how not to redo something bad.
The code also rarely tells you that the code which you may "understand" actually has code smell, is a /bad/ example, or is an archaic style of programming. Java may be inconsistent, but so is the Squeak class library... all the way down.
Sometimes you can't see the forest for the trees.
Cheers, Darius [|] Powered and Empowered by Smalltalk
On 8/30/06, J J azreal1977@hotmail.com wrote:
I have it downloaded, what do I do with it? Unit tests can give me examples but that isn't very formal, you know? :)
Yes it is, and IMHO it's even one of the most formal ways to give examples since they actually run (and if they don't you know who to blame :)
Granted, it would be better if some tests were actually written with a documentation intent and categorized as such (e.g. describing the first layer of the code with realistic scenarios, not debugging or ensuring very basic functionality actually works).
J J puso en su mail :
Do really think it would be ok to deliver a product to a customer and say "well, the code is all there, dig around and you should be able to figure out how it works in no time"?
When you find such customer ? If the system works, customer never wish know what code you are using, if not, well, one hundred nice write manuals do not save you :)
Edgar
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
No, I meant they application consisted of the user having to figure out to send a MyApplication show. :) It was meant to be an extreme example of "just read the code".
From: "Lic. Edgar J. De Cleene" edgardec2001@yahoo.com.ar Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: squeakdev squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Wed, 30 Aug 2006 17:12:45 -0300
J J puso en su mail :
Do really think it would be ok to deliver a product to a customer and say "well, the code is all there, dig around and you should be able to figure out how it works in no time"?
When you find such customer ? If the system works, customer never wish know what code you are using, if not, well, one hundred nice write manuals do not save you :)
Edgar
Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
J J puso en su mail :
No, I meant they application consisted of the user having to figure out to send a MyApplication show. :) It was meant to be an extreme example of "just read the code".
Ok.
As person trying to teach Squeak and spread word in Spanish world, sure I understand you.
And do all what I could, writing some tutorials.
One problem is what Squeak changes so quickly what many becomes obsolete between versions.
Another one is Squeak is a software equivalent of Swiss Army knife.
You have the several spin-offs or forks, like Croquet, Tweak, Sophie, etc.
And so different needs as educational, web development, new object programming ideas, etc.
But all this opens the chance of write "Learn Squeak in ten days", sell many copies and become rich and famous :)
Edgar
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
Even if you coded right in pure English, I still wouldn't know *why* you did it the way you did, and therefore I wouldn't know *why* I shouldn't just change it.
actually many seniour Squeakers r thr always on #squeak at irc.freenode.netor asking on mailing-list also get very quick reply usually.So i think we can ask, to author or anyone who knows, about *why* you did it the way you did usually.
On 8/30/06, Hiren Thacker hithacker@gmail.com wrote:
actually many seniour Squeakers r thr always on #squeak at irc.freenode.net or asking on mailing-list also get very quick reply usually.So i think we can ask, to author or anyone who knows, about *why* you did it the way you did usually.
There are three possible responses when someone makes a complaint: you can address it, you can argue that it's invalid, or you can attack the complainer. I suppose I'm happy that everyone's doing the second rather than the third, but I'd rather we were doing the first.
J J is entirely correct. There needs to be more documentation. Smalltalk is extremely readable, and experienced developers can generally figure out fairly quickly how something works through the Message Finder, Senders Of/Implementers Of, etc., but that ignores the fact that I shouldn't have to do that. What takes me and everyone else an hour each of spelunking through the bowels of the class hierarchy would've taken the original designer about thirty minutes to summarize in a few paragraphs. Those paragraphs should focus on both what and why, and the interplay between those. Even if that documentation is slightly inaccurate, if it at least gives me an insight into the mind of the original developer, my code exploration can be faster, more focused, and more rewarding.
To take a specific example because I know about it, we routinely get questions on the Seaside list about the difference between the legacy renderer and the newer canvas renderer, because there is no real documentation about what problem canvas was trying to solve, how it goes about solving it, what the abstraction is that allows pluggable renderers, whether the user might want ever to write his own renderer, why canvas is still not the default renderer even though nearly all the libraries require it, or half a dozen other small points. You can answer the how and what by googling the mailing list (if you're lucky enough to use the right terms) or by plowing through the voluminous source code and test suites. Even if you do both, though, you still might miss very basic facts that are basically undocumented if you don't happen to hit just the right email message or look at just the right method in your search. (Either #text: or #with: must be the last message sent, for example, or unexpected things happen.) Meanwhile, if you want the why of canvas, you really need to find a single email from Avi from I-don't-know-how-long ago where he announces that a nascent WAHtmlCanvas will be included in an upcoming Seaside 2.5 alpha release and explains in terms that are perfectly clear to Seaside 2.3 hackers why the newer library will be better. The chance of a new user finding that email, let alone truly understanding and internalizing its meaning without already knowing Seaside, is very low.
This problem is obviously not unique to Seaside; thanks to the Seaside FAQ and walkthroughs, Seaside is actually in much better shape than some other packages. I'm harping on it because I'm familiar with it. The problem runs throughout many libraries both in the core of Squeak and in the full image.
Hiren proposes you simply email the list whenever you have a why. That's a waste of everyone's time. The developer has to explain more than once, while users who subscribe to the list have to either preemptively save and categorize important emails or else try to remember enough words from the email that they can google their way to it--and frequently, they give up and ask again anyway. New users, meanwhile, are too scared to ask questions on squeak-dev, which is where you'd have to ask if you really wanted the original coder to respond with a because instead of a more experienced user to respond with a how-to.
Communities that tell their users to RTFM find themselves alone very quickly. We're telling ours to RTFSC. There has got to be a compromise better than that.
--Benjamin
Thanks Benjamin, I was starting to get worried. :)
But the case of seaside is a great example. The guys doing that are pretty busy writing code and contributing to the community. If they don't want to stop and write some doc I can understand, but how do other communities handle this? Can we give the documentation task to someone else? It wont be as efficient as if the original developer wrote it, but it would get done at least.
This could be something new users (like myself even) could do to help the community, learn the systems better and contribute before they are ready to start releasing code.
From: "Benjamin Pollack" benjamin.pollack@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Wed, 30 Aug 2006 16:11:15 -0400
On 8/30/06, Hiren Thacker hithacker@gmail.com wrote:
actually many seniour Squeakers r thr always on #squeak at irc.freenode.net or asking on mailing-list also get very quick reply usually.So i think we can ask, to author or anyone who knows, about *why* you did it the way you did usually.
There are three possible responses when someone makes a complaint: you can address it, you can argue that it's invalid, or you can attack the complainer. I suppose I'm happy that everyone's doing the second rather than the third, but I'd rather we were doing the first.
J J is entirely correct. There needs to be more documentation. Smalltalk is extremely readable, and experienced developers can generally figure out fairly quickly how something works through the Message Finder, Senders Of/Implementers Of, etc., but that ignores the fact that I shouldn't have to do that. What takes me and everyone else an hour each of spelunking through the bowels of the class hierarchy would've taken the original designer about thirty minutes to summarize in a few paragraphs. Those paragraphs should focus on both what and why, and the interplay between those. Even if that documentation is slightly inaccurate, if it at least gives me an insight into the mind of the original developer, my code exploration can be faster, more focused, and more rewarding.
To take a specific example because I know about it, we routinely get questions on the Seaside list about the difference between the legacy renderer and the newer canvas renderer, because there is no real documentation about what problem canvas was trying to solve, how it goes about solving it, what the abstraction is that allows pluggable renderers, whether the user might want ever to write his own renderer, why canvas is still not the default renderer even though nearly all the libraries require it, or half a dozen other small points. You can answer the how and what by googling the mailing list (if you're lucky enough to use the right terms) or by plowing through the voluminous source code and test suites. Even if you do both, though, you still might miss very basic facts that are basically undocumented if you don't happen to hit just the right email message or look at just the right method in your search. (Either #text: or #with: must be the last message sent, for example, or unexpected things happen.) Meanwhile, if you want the why of canvas, you really need to find a single email from Avi from I-don't-know-how-long ago where he announces that a nascent WAHtmlCanvas will be included in an upcoming Seaside 2.5 alpha release and explains in terms that are perfectly clear to Seaside 2.3 hackers why the newer library will be better. The chance of a new user finding that email, let alone truly understanding and internalizing its meaning without already knowing Seaside, is very low.
This problem is obviously not unique to Seaside; thanks to the Seaside FAQ and walkthroughs, Seaside is actually in much better shape than some other packages. I'm harping on it because I'm familiar with it. The problem runs throughout many libraries both in the core of Squeak and in the full image.
Hiren proposes you simply email the list whenever you have a why. That's a waste of everyone's time. The developer has to explain more than once, while users who subscribe to the list have to either preemptively save and categorize important emails or else try to remember enough words from the email that they can google their way to it--and frequently, they give up and ask again anyway. New users, meanwhile, are too scared to ask questions on squeak-dev, which is where you'd have to ask if you really wanted the original coder to respond with a because instead of a more experienced user to respond with a how-to.
Communities that tell their users to RTFM find themselves alone very quickly. We're telling ours to RTFSC. There has got to be a compromise better than that.
--Benjamin
On 8/31/06, Benjamin Pollack benjamin.pollack@gmail.com wrote:
On 8/30/06, Hiren Thacker hithacker@gmail.com wrote:
Even if you coded right in pure English, I still wouldn't know *why* you did it the way you did, and therefore I wouldn't know *why* I shouldn't just change it.
actually many seniour Squeakers r thr always on #squeak at irc.freenode.netor asking on mailing-list also get very quick reply
usually.So i think we can ask, to author or anyone who knows, about *why* you did it the way you did usually.
Hiren proposes you simply email the list whenever you have a why. That's a waste of everyone's time. The developer has to explain more than once, while users who subscribe to the list have to either preemptively save and categorize important emails or else try to remember enough words from the email that they can google their way to it--and frequently, they give up and ask again anyway. New users, meanwhile, are too scared to ask questions on squeak-dev, which is where you'd have to ask if you really wanted the original coder to respond with a because instead of a more experienced user to respond with a how-to.
Benjamin, I think you are taking my english in wrong context.I think JJ was talking about "Design level Whys" if you read his that post, which i replied."Design level Whys" are not important for everyone using it.You should try to solve your doubts first by excersing own mind, its not necessary to ask for whenever u have a why.
Regards, Hiren Hiren
I was talking about all why's (and hows). If you ever hope to hand off your project to someone else those design level why's are going to have to be there. If you want the average person to use it those how's are going to have to be there and some why's as well because they may want to use your classes slightly different then you originally envisioned.
From: "Hiren Thacker" hithacker@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Thu, 31 Aug 2006 02:03:54 +0530
On 8/31/06, Benjamin Pollack benjamin.pollack@gmail.com wrote:
On 8/30/06, Hiren Thacker hithacker@gmail.com wrote:
Even if you coded right in pure English, I still wouldn't know *why* you did it the way you did, and therefore I wouldn't know *why* I shouldn't just change it.
actually many seniour Squeakers r thr always on #squeak at irc.freenode.netor asking on mailing-list also get very quick reply
usually.So i think we can ask, to author or anyone who knows, about *why* you did it the way you did usually.
Hiren proposes you simply email the list whenever you have a why. That's a waste of everyone's time. The developer has to explain more than once, while users who subscribe to the list have to either preemptively save and categorize important emails or else try to remember enough words from the email that they can google their way to it--and frequently, they give up and ask again anyway. New users, meanwhile, are too scared to ask questions on squeak-dev, which is where you'd have to ask if you really wanted the original coder to respond with a because instead of a more experienced user to respond with a how-to.
Benjamin, I think you are taking my english in wrong context.I think JJ was talking about "Design level Whys" if you read his that post, which i replied."Design level Whys" are not important for everyone using it.You should try to solve your doubts first by excersing own mind, its not necessary to ask for whenever u have a why.
Regards, Hiren Hiren
agree :)
BTW its Rich Warren who says
On Aug 30, 2006, at 8:35 AM, Ramon Leon wrote:
I agree that Smalltalk has excellent tools for sifting through the source code. However, this can be a barrier to entry for newcomers. We need a constant supply of new blood, otherwise Smalltalk will wither and die.
not Ramon Leon
On 9/2/06, J J azreal1977@hotmail.com wrote:
I was talking about all why's (and hows). If you ever hope to hand off your project to someone else those design level why's are going to have to be there. If you want the average person to use it those how's are going to have to be there and some why's as well because they may want to use your classes slightly different then you originally envisioned.
From: "Hiren Thacker" hithacker@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Thu, 31 Aug 2006 02:03:54 +0530
On 8/31/06, Benjamin Pollack benjamin.pollack@gmail.com wrote:
On 8/30/06, Hiren Thacker hithacker@gmail.com wrote:
Even if you coded right in pure English, I still wouldn't know *why* you did it the way you did, and therefore I wouldn't know *why* I shouldn't just change it.
actually many seniour Squeakers r thr always on #squeak at irc.freenode.netor asking on mailing-list also get very quick reply
usually.So i think we can ask, to author or anyone who knows, about *why* you did it the way you did usually.
Hiren proposes you simply email the list whenever you have a why. That's
a
waste of everyone's time. The developer has to explain more than once, while users who subscribe to the list have to either preemptively save and categorize important emails or else try to remember enough words from
the
email that they can google their way to it--and frequently, they give up and ask again anyway. New users, meanwhile, are too scared to ask questions
on
squeak-dev, which is where you'd have to ask if you really wanted the original coder to respond with a because instead of a more experienced user to respond with a how-to.
Benjamin, I think you are taking my english in wrong context.I think JJ was talking about "Design level Whys" if you read his that post, which i replied."Design level Whys" are not important for everyone using it.You should try to
solve
your doubts first by excersing own mind, its not necessary to ask for whenever u have a why.
Regards, Hiren Hiren
On Aug 30, 2006, at 8:35 AM, Ramon Leon wrote:
This is the difference between using a framework and using an API, Smalltalkers like frameworks, which by their very nature, require you to understand how they work. You make it sound like digging through classes is hard, it's just a couple keystrokes, browse here, browse, there, check out a few examples, bam, ok, makes sense now. I not only find digging through classes a good solution, I find it's the only one I've ever found that works. Documents lie, code doesn't. I consider understanding how something works, a prerequisite to using it well. And frankly, I can bounce around the code, in a far more organized and faster manner than I could through some document.
I agree that Smalltalk has excellent tools for sifting through the source code. However, this can be a barrier to entry for newcomers. We need a constant supply of new blood, otherwise Smalltalk will wither and die.
In general I'm ok just browsing the source code, but I do get upset when someone doesn't even bother to add a class comment. I mean, really. How long does it take to add two or three sentences? A few sentences, that's all I'm asking. A handful of words can save me so much time.
Sometimes, when I'm working with a new framework, it can be hard to find the door in. Once I find the door, I'm golden. Maybe there are tricks to moving through the source code that I don't know (hey, maybe they should be documented somewhere). But, it really frustrates me when I can't even find the door.
I think there are a couple of other barriers to Squeak in particular. I think the user interface is a huge one. Let's just say, the UI for 3.8 seems a bit...how should I say it...aesthetically challenged. 3.9 looks like it will be a big step forward, but it's still not great.
There's also a pretty serious learning curve before you can even use the interface. I'm sure halos have driven away more than one potential user. They seem so foreign at first.
Also, I hate being isolated from the rest of my desktop. I'm a mac user. I like my mac. I like my mac apps. I wish Smalltalk could be part of that environment. Visual Works gets a few points here. At least it looks like a native interface (Though, the UI doesn't behave in a consistently native manner--which can actually be more annoying sometimes. And it doesn't run on intel macs yet.).
When I started learning Smalltalk, I originally tried squeak, moved to VisualWorks because of the UI issues, then moved back to squeak to get access to newer versions of SeaSide. Once I made it over the initial learning curve, I discovered that I really like squeak (except for being isolated from the rest of my desktop--I still don't like that). I've heard at least one other person on this list describe similar experiences. I wonder how common it is? I wonder how many people we lose, because they just don't make it far enough?
-Rich-
Rich Warren puso en su mail :
I like my mac. I like my mac apps.
Well, Mac in the beginning was a lot different to other common green screens at the time.
Taking to masses only a part of Smalltalk (as was pointed in this same thread).
Now all use some of this concepts.
I wish Smalltalk could be part of that environment.
For Mac exist F-Script, if you still don't have, go for it. And you could have some more Smalltalk way to deal with the system.
For Squeak, you could program for having any look and function as you wish.
Jim Benson do his Zurgle a long time ago....maybe is time someone look at his job and resurrect ?
And it doesn't run on intel macs yet.).
Apple should use the same processor as X 360 Microsof game console. Opening the possibility to hackers to copy most of system for running in cheap clones is a mistake (IMHO) Most world people are too poor to buy a Mac and not for buy a decent clone
Edgar
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
On Aug 31, 2006, at 3:10 AM, Lic. Edgar J. De Cleene wrote:
Rich Warren puso en su mail :
I like my mac. I like my mac apps.
I wish Smalltalk could be part of that environment.
For Mac exist F-Script, if you still don't have, go for it. And you could have some more Smalltalk way to deal with the system.
For Squeak, you could program for having any look and function as you wish.
Jim Benson do his Zurgle a long time ago....maybe is time someone look at his job and resurrect ?
There is also the Objective-C bridge.
-Todd Blanchard
Todd Blanchard puso en su mail :
There is also the Objective-C bridge.
-Todd Blanchard
Todd:
What is the last info , some for read, some for try about the Objective-C bridge ?
Thanks
Edgar
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
Hi
In general I'm ok just browsing the source code, but I do get upset when someone doesn't even bother to add a class comment. I mean, really. How long does it take to add two or three sentences? A few sentences, that's all I'm asking. A handful of words can save me so much time.
Sometimes, when I'm working with a new framework, it can be hard to find the door in. Once I find the door, I'm golden. Maybe there are tricks to moving through the source code that I don't know (hey, maybe they should be documented somewhere). But, it really frustrates me when I can't even find the door.
we can browse tests too ! which is useful... actually I think test code of a class should be "displayed" or at least accessible directly from the browser. Me, I just added test classes related to a class in the comment pane of OB so that it can be accessible with cmd+b.
I also waiting to see Services Romain are doing because I think that could really enhance ergonomy.
but I agree that just minimum class comments would be cool. But I imagine programmer dislike to do that ;) Maybe we could have a team of commentors ? :) (??)
I think there are a couple of other barriers to Squeak in particular. I think the user interface is a huge one. Let's just say, the UI for 3.8 seems a bit...how should I say it...aesthetically challenged. 3.9 looks like it will be a big step forward, but it's still not great.
agree... except I really like 3.9... but I guess I'm used to the smalltalk environment now so...
Also, I hate being isolated from the rest of my desktop. I'm a mac user. I like my mac. I like my mac apps. I wish Smalltalk could be part of that environment. Visual Works gets a few points here. At least it looks like a native interface (Though, the UI doesn't behave in a consistently native manner--which can actually be more annoying sometimes. And it doesn't run on intel macs yet.).
I felt the same first, but now I like the one big windows containing all my squeak windows (now that I can manage them). wxWidget will probably go in the direction you want (I don't know for mac).
When I started learning Smalltalk, I originally tried squeak, moved to VisualWorks because of the UI issues, then moved back to squeak to get access to newer versions of SeaSide.
same ;) and to get access to open source too ! Actually, I tried recently VW again but this time I prefered the look and feel of squeak (3.9)
Once I made it over the initial learning curve, I discovered that I really like squeak (except for being isolated from the rest of my desktop--I still don't like that). I've heard at least one other person on this list describe similar experiences. I wonder how common it is?
this is really common !
First of all, this is important to have a developper image I think, because an "education" version may look too much as a toy for "serious" people (and programming is serious :) ). And maybe derive a newcomer developer image configured in a way it makes all a bit more accessible (one browser, some tutorial inside, monticello configured...). I'm using the DEVInstaller class Torsten sent...
After we might need good tutorials to use the environment. I said that already, but it took me a long time to really understand how to browse the code (senders, implementors, halting, writing code in the debuger, using the debuger, inspecting, exploring, cleaning and preparing the image, understanding what is an image !)... During this long learning curve, I was quite often discoraged when developing because I was stuck really often and really quickly ! Hopefully it's kind magic and addicting. I just love the syntax and the dynamic behavior ;)
Now it's a bit better, I still get stucked but I can solve problem even if it takes time... but as a langage said to be for kids, well hitting the walls made me think programing was just not for me. Just to say that good programmers will be at ease relatively quickly... but for people doing that for leisure it's hard ! Php makes people feels programmers, squeak (and smalltalk) just make you realize you're not really one ;)
Cédrick
On 8/31/06, Rich Warren rwmlist@gmail.com wrote:
I think there are a couple of other barriers to Squeak in particular. I think the user interface is a huge one. Let's just say, the UI for 3.8 seems a bit...how should I say it...aesthetically challenged. 3.9 looks like it will be a big step forward, but it's still not great.
There's also a pretty serious learning curve before you can even use the interface. I'm sure halos have driven away more than one potential user. They seem so foreign at first.
Not all thinks this way(may be little but still are there), so you can not generalize that conclusion.
I seriously had one day learning curve with Squeak UI (obviously it differs from person to person) (i came from Java Swing background). I found Squeak UI more *initiative and usable*. Personally i don't agree that halos are scary. I think user aesthetics is personal issue.
Just my 0.002 Rupees
I agree that Smalltalk has excellent tools for sifting through the source code. However, this can be a barrier to entry for newcomers. We need a constant supply of new blood, otherwise Smalltalk will wither and die.
Idea's don't die, Smalltalk's been around 30+ years, it's not going anywhere.
In general I'm ok just browsing the source code, but I do get upset when someone doesn't even bother to add a class comment. I mean, really. How long does it take to add two or three sentences? A few sentences, that's all I'm asking. A handful of words can save me so much time.
Ditto!
Sometimes, when I'm working with a new framework, it can be hard to find the door in. Once I find the door, I'm golden.
Ditto!
I think there are a couple of other barriers to Squeak in particular. I think the user interface is a huge one. Let's just say, the UI for 3.8 seems a bit...how should I say it...aesthetically challenged. 3.9 looks like it will be a big step forward, but it's still not great.
Easily fixed...
* load LookEnhancements * change SystemWindow borderWidth to 2 * On windows platforms load WindowsNativeFonts * Preferences windows roundedWindowCorners to false * Preferences menus roundedMenuCorners to false * load eCompletion * load Shout4 * hide unused flaps, delete annoying mouse and goofy trashcan * set a nice background graphic (I use mac blue panther graphic)
You're left with a nice professional looking environment with no trace of Squeaks default silliness, windows that look and act decent, including minimizing and maximizing when you double click the title bar, nice intellisense, auto completion and code coloring.
Also, I hate being isolated from the rest of my desktop. I'm a mac user. I like my mac. I like my mac apps. I wish Smalltalk could be part of that environment. Visual Works
I sympathize here, I both love and hate that squeak's its own little world. I've adjusted by dedicating one monitor to squeak, and one to windows, but I do wish someone would solve this problem. I don't mind squeak having it's own windowing system, it's nice to be able to work on a Mac, a pc, and a Linux box all in the same environment, but it'd be nicer if a morph floated over the native desktop.
On 31/08/06, Ramon Leon ramon.leon@allresnet.com wrote:
- load LookEnhancements
- change SystemWindow borderWidth to 2
- On windows platforms load WindowsNativeFonts
- Preferences windows roundedWindowCorners to false
- Preferences menus roundedMenuCorners to false
- load eCompletion
- load Shout4
- hide unused flaps, delete annoying mouse and goofy trashcan
- set a nice background graphic (I use mac blue panther graphic)
Thanks for this list.
Call me stupid, but I can't figure out what to do to "change SystemWindow borderWidth to 2". Can you give me a hint?
Also, is there a way to get rid of the shading of background windows - rather just shade the title bar or something?
Thanks, Steve
Thanks for this list.
Call me stupid, but I can't figure out what to do to "change SystemWindow borderWidth to 2". Can you give me a hint?
Literally, I meant, go there and edit the code, from 4 to 2. The default borders are far too fat and make squeak look silly.
Also, is there a way to get rid of the shading of background windows - rather just shade the title bar or something?
Thanks, Steve
Not sure what you mean here.
Sometimes I forget what it's like to be a newbie, too, but sheesh! :-) (pardon me if you're not so new, Stephen, I haven't been reading squeak-dev extremely closely)
In case "edit the code" wasn't enough of a hint, here's how I figured it out:
- browse to SystemWindow - with the 'inst var defs...' menu item, find all of the places that the 'borderWidth' instance variable is set - hmm, #borderInitialize looks promising, so browse to it - see that the initial value is defined by #defaultBorderWidth - override the implementation of #defaultBorderWidth, and you're done! - open a browser to test it out
Rats! It didn't work. OK, let's debug...
- inspect the result of 'SystemWindow new' in a workspace. Yep, borderWidth didn't change. Why not? - highlight the expression again and choose the 'debug it' menu item - step into the expression and see that the first message sent is #hasPrototype. Sounds suspicious! - select 'self' in the lower-left debugger pane, and choose 'inst var defs...' from the menu to see who defines 'prototype' - there's a prototype message; let's clear the prototype with: 'SystemWindow prototype: nil'
Now it will surely work! But it doesn't. To make a medium-length story short, SystemWindow>>initialize stomps on the value that had been properly set by the superclass.
I suppose that this is because I didn't load LookEnhancements first; otherwise, the above would probably work. But I don't care enough to try. BTW, this is in a Croquet image that's basically 3.8 as far as Morphic is concerned.
Anyway, I guess I've shown that it's not completely trivial. Even if I had loaded LookEnhancements first, it seems likely that the prototype problem would have arisen. Hopefully someone learned something about Squeak debugging.
Cheers, Josh
On Aug 31, 2006, at 7:33 PM, Ramon Leon wrote:
Thanks for this list.
Call me stupid, but I can't figure out what to do to "change SystemWindow borderWidth to 2". Can you give me a hint?
Literally, I meant, go there and edit the code, from 4 to 2. The default borders are far too fat and make squeak look silly.
Also, is there a way to get rid of the shading of background windows - rather just shade the title bar or something?
Thanks, Steve
Not sure what you mean here.
Sometimes I forget what it's like to be a newbie, too, but sheesh! :-) (pardon me if you're not so new, Stephen, I haven't been reading squeak-dev extremely closely)
In case "edit the code" wasn't enough of a hint, here's how I figured it out:
- browse to SystemWindow
- with the 'inst var defs...' menu item, find all of the
places that the 'borderWidth' instance variable is set
- hmm, #borderInitialize looks promising, so browse to it
- see that the initial value is defined by #defaultBorderWidth
- override the implementation of #defaultBorderWidth, and you're done!
- open a browser to test it out
Rats! It didn't work. OK, let's debug...
- inspect the result of 'SystemWindow new' in a workspace.
Yep, borderWidth didn't change. Why not?
- highlight the expression again and choose the 'debug it' menu item
- step into the expression and see that the first message
sent is #hasPrototype. Sounds suspicious!
- select 'self' in the lower-left debugger pane, and choose
'inst var defs...' from the menu to see who defines 'prototype'
- there's a prototype message; let's clear the prototype with:
'SystemWindow prototype: nil'
Now it will surely work! But it doesn't. To make a medium-length story short, SystemWindow>>initialize stomps on the value that had been properly set by the superclass.
I suppose that this is because I didn't load LookEnhancements first; otherwise, the above would probably work. But I don't care enough to try. BTW, this is in a Croquet image that's basically 3.8 as far as Morphic is concerned.
Anyway, I guess I've shown that it's not completely trivial. Even if I had loaded LookEnhancements first, it seems likely that the prototype problem would have arisen. Hopefully someone learned something about Squeak debugging.
Cheers, Josh
Wow, I didn't realize I was so unclear, my bad. First, load LookEnhancements, then go to SystemWindow, there is an accessor on the class side called borderWidth, edit it, change it to 4.
On Aug 31, 2006, at 5:44 AM, Ramon Leon wrote:
Idea's don't die, Smalltalk's been around 30+ years, it's not going anywhere.
Ideas may not die, but communities do. A vibrant community needs a constant inflow of new people.
Also, just because something has survived this far doesn't mean it will continue to survive into the future.
-Rich-
From: "Ramon Leon" ramon.leon@allresnet.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "'The general-purpose Squeak developers list'"squeak-dev@lists.squeakfoundation.org Subject: RE: Thoughts from an outsider Date: Thu, 31 Aug 2006 08:44:06 -0700
Idea's don't die, Smalltalk's been around 30+ years, it's not going anywhere.
But it needs to go somewhere. To the head of the pack where it can improve our profession. Software engineering is joked out by other engineering professions because of how bad so much of the engineered software behaves. I think smalltalk becoming one of the prominant languages goes a long way to address that.
Easily fixed...
- load LookEnhancements
- change SystemWindow borderWidth to 2
- On windows platforms load WindowsNativeFonts
- Preferences windows roundedWindowCorners to false
- Preferences menus roundedMenuCorners to false
- load eCompletion
- load Shout4
- hide unused flaps, delete annoying mouse and goofy trashcan
- set a nice background graphic (I use mac blue panther graphic)
You're left with a nice professional looking environment with no trace of Squeaks default silliness, windows that look and act decent, including minimizing and maximizing when you double click the title bar, nice intellisense, auto completion and code coloring.
Thanks for that. Is there a way to turn those changes into a squeakmap package like they did with the "seaside installer" and "pier" packages? Or would it be possible to turn into a theme somehow?
Also, after I did all those things the debugger doesn't highlight code right anymore. I can't tell exactly what code is running because the highlight is in the wrong place.
Has anyone else seen this?
Hi J J, ----- Original Message ----- From: "J J" azreal1977@hotmail.com To: squeak-dev@lists.squeakfoundation.org Sent: Saturday, September 02, 2006 11:56 AM Subject: RE: Thoughts from an outsider
..snip...
Also, after I did all those things the debugger doesn't highlight code right anymore. I can't tell exactly what code is running because the highlight is in the wrong place.
Has anyone else seen this?
Yes. It is a known bug in Shout. The latest version on SqueakSource fixes this, but hasn't been released onto SqueakMap yet. You can get it from here...
http://www.squeaksource.com/shout/Shout.3.15-tween.65.mcz
Note that this version is intended for the current 3.9, so if you are using 3.8, then it is best to stick to the old SqueakMap version. You can also 'fix' the debugger problem by disabling (i.e. unselecting) both of these Preferences - syntaxHighlightingAsYouTypeAnsiAssignment, syntaxHighlightingAsYouTypeLeftArrowAssignment
Cheers, Andy
Ok, great thanks. Where are people getting 3.9 from? Is it pretty stable? I mean lots of things don't seem to work on 3.8 anyway (e.g. the balloon3d fish tutorial) so it doesn't have to be perfect.
Also, any idea when it will be officially released?
Thanks again
From: "Andrew Tween" amtween@hotmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Sat, 2 Sep 2006 12:39:17 +0100
Hi J J, ----- Original Message ----- From: "J J" azreal1977@hotmail.com To: squeak-dev@lists.squeakfoundation.org Sent: Saturday, September 02, 2006 11:56 AM Subject: RE: Thoughts from an outsider
..snip...
Also, after I did all those things the debugger doesn't highlight code
right
anymore. I can't tell exactly what code is running because the
highlight
is in the wrong place.
Has anyone else seen this?
Yes. It is a known bug in Shout. The latest version on SqueakSource fixes this, but hasn't been released onto SqueakMap yet. You can get it from here...
http://www.squeaksource.com/shout/Shout.3.15-tween.65.mcz
Note that this version is intended for the current 3.9, so if you are using 3.8, then it is best to stick to the old SqueakMap version. You can also 'fix' the debugger problem by disabling (i.e. unselecting) both of these Preferences
- syntaxHighlightingAsYouTypeAnsiAssignment, syntaxHighlightingAsYouTypeLeftArrowAssignment
Cheers, Andy
Ok, great thanks. Where are people getting 3.9 from? Is it pretty stable? I mean lots of things don't seem to work on 3.8 anyway (e.g. the balloon3d fish tutorial) so it doesn't have to be perfect.
I get mine from http://ftp.squeak.org/ To get the latest, look in the 3.9 folder and download Squeak3.9g-7055.zip.
Cheers, Andy
Also, any idea when it will be officially released?
Thanks again
From: "Andrew Tween" amtween@hotmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Sat, 2 Sep 2006 12:39:17 +0100
Hi J J, ----- Original Message ----- From: "J J" azreal1977@hotmail.com To: squeak-dev@lists.squeakfoundation.org Sent: Saturday, September 02, 2006 11:56 AM Subject: RE: Thoughts from an outsider
..snip...
Also, after I did all those things the debugger doesn't highlight code
right
anymore. I can't tell exactly what code is running because the
highlight
is in the wrong place.
Has anyone else seen this?
Yes. It is a known bug in Shout. The latest version on SqueakSource fixes this, but hasn't been released onto SqueakMap yet. You can get it from here...
http://www.squeaksource.com/shout/Shout.3.15-tween.65.mcz
Note that this version is intended for the current 3.9, so if you are using 3.8, then it is best to stick to the old SqueakMap version. You can also 'fix' the debugger problem by disabling (i.e. unselecting) both of these Preferences
- syntaxHighlightingAsYouTypeAnsiAssignment, syntaxHighlightingAsYouTypeLeftArrowAssignment
Cheers, Andy
On Aug 31, 2006, at 2:35 AM, Rich Warren wrote:
Also, I hate being isolated from the rest of my desktop. I'm a mac user. I like my mac. I like my mac apps. I wish Smalltalk could be part of that environment. Visual Works gets a few points here. At least it looks like a native interface (Though, the UI doesn't behave in a consistently native manner--which can actually be more annoying sometimes. And it doesn't run on intel macs yet.).
FScript (mentioned already) & Ambrai Smalltalk http://www.ambrai.com/ are two nice smalltalk frameworks for interacting & constructing apps using the cocoa framework. Fscript is the scripting variant & Ambrai is closer to a full-featured smalltalk.
Eric
On Aug 31, 2006, at 5:52 AM, Eric Winger wrote:
On Aug 31, 2006, at 2:35 AM, Rich Warren wrote:
Also, I hate being isolated from the rest of my desktop. I'm a mac user. I like my mac. I like my mac apps. I wish Smalltalk could be part of that environment. Visual Works gets a few points here. At least it looks like a native interface (Though, the UI doesn't behave in a consistently native manner--which can actually be more annoying sometimes. And it doesn't run on intel macs yet.).
FScript (mentioned already) & Ambrai Smalltalk http:// www.ambrai.com/ are two nice smalltalk frameworks for interacting & constructing apps using the cocoa framework. Fscript is the scripting variant & Ambrai is closer to a full-featured smalltalk.
Eric
I use FScript--but mostly I use it as a developer's tool. I haven't really figured out how to use it to write code yet (other than executing simple things from the workspace). Still, it's great for poking around, especially when trying to examine existing apps.
Ambrai looks nice. Of course, it's a beta trial release, and I didn't see anything on the site about how much the actual release would cost (or if there would be a personal version for open source development).
However, both of these are Mac-only. While I use a mac, often I have to write code that can be executed on PCs. That leaves me with VisualWorks and Squeak. I like the fact that Squeak is open source.
The biggest UI problem I have is the fact that Squeak's private window really mucks with my regular work flow. Typically I use Expose a lot--it lets me move effortlessly from window to window (I know, a lot of people don't like Expose--my wife can't stand it. But it really works for me). I can move between apps very quickly. I can also move between all the windows of a single application.
There would be a very big efficiency gain if I could manage my Squeak windows the same way I manage my other Mac windows.
I think this can be generalized to all UI interactions. The more the UI for Squeak resembles the underlying UI of the host OS, the more efficient you can be. You can have a UI that is enhanced above and beyond the host OS--as long as it follows the same behaviors as the underlying OS, users can leverage their existing knowledge and skills while working in Squeak.
-Rich-
On 31-Aug-06, at 4:45 PM, Rich Warren wrote:
The biggest UI problem I have is the fact that Squeak's private window really mucks with my regular work flow. Typically I use Expose a lot--it lets me move effortlessly from window to window (I know, a lot of people don't like Expose--my wife can't stand it. But it really works for me). I can move between apps very quickly. I can also move between all the windows of a single application.
There would be a very big efficiency gain if I could manage my Squeak windows the same way I manage my other Mac windows.
There are at least two ways you could achieve this: a) wxSqueak b) Ariethfa Ffenestri
wxSqueak uses the wx-whatever libraries as the platform layer and so should work on any platform with wx support. Which isn't every platform, but quite a few. Ffenestri (it's Welsh for 'platform windows') provides a relatively simple and very low-level interface to ... platform windows. You can/ could open arbitrary host os windows and then draw in them with whatever means you like. When developing it we tested with several sets of connection to the image but it is essentially a case of you get a window object and you bitblt to it.
I think this can be generalized to all UI interactions. The more the UI for Squeak resembles the underlying UI of the host OS, the more efficient you can be. You can have a UI that is enhanced above and beyond the host OS--as long as it follows the same behaviors as the underlying OS, users can leverage their existing knowledge and skills while working in Squeak.
Now that I don't think I can agree with entirely. Yes, for ordinary usage using host style is beneficial. For enhanced UI designs I'm going to assert (because I'm a big bossy noisy person with no mild opinions) that you really need to almost forget whatever your host OS does because they are *all* crap. Every one of them. All of them have some good points, and all of them have many more bad. Don't get me started on menubars. Really. If it were possible to write down the most suitable curses about menubars in the original pictograms, the baked clay would melt.
Anyway, try wxSqueak if you want a substantially platform-like experience and consider Ffenestri if you want to have a chance to make something compatible(ish) but to your own taste.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Satisfaction Guaranteed: We'll send you another copy if it fails.
On Aug 31, 2006, at 2:45 PM, tim Rowledge wrote:
Now that I don't think I can agree with entirely. Yes, for ordinary usage using host style is beneficial. For enhanced UI designs I'm going to assert (because I'm a big bossy noisy person with no mild opinions) that you really need to almost forget whatever your host OS does because they are *all* crap. Every one of them. All of them have some good points, and all of them have many more bad. Don't get me started on menubars. Really. If it were possible to write down the most suitable curses about menubars in the original pictograms, the baked clay would melt.
True enough. But at least I've come to terms with the Mac UI. I know how to use it efficiently.
So, why should I trade one bad UI (which I happen to know how to use) for another (which I don't know how to use). To use both interfaces, I'm forced to become proficient in two different systems--and I'm forced to mentally jump back and forth between the two systems as I work. That just doesn't seem like a good use of anyone's brain-cycles.
I'll check out wxSqueak. I've only heard about it in relation to the upcoming 3.9 release, can it run on 3.8 too?
-Rich-
Rich Warren puso en su mail :
The biggest UI problem I have is the fact that Squeak's private window really mucks with my regular work flow. Typically I use Expose a lot--it lets me move effortlessly from window to window (I know, a lot of people don't like Expose--my wife can't stand it. But it really works for me). I can move between apps very quickly. I can also move between all the windows of a single application.
There would be a very big efficiency gain if I could manage my Squeak windows the same way I manage my other Mac windows.
As I say, you could have any UI . Someone did a Expose like in Squeak, a long ago, but I don't remember who. Or use John Mac AppleScript hooks for raise real Mac UI elements or use Mac Services or use Unix under the hood power.
Edgar
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
On Aug 31, 2006, at 11:07 PM, Lic. Edgar J. De Cleene wrote:
Rich Warren puso en su mail :
The biggest UI problem I have is the fact that Squeak's private window really mucks with my regular work flow. Typically I use Expose a lot--it lets me move effortlessly from window to window (I know, a lot of people don't like Expose--my wife can't stand it. But it really works for me). I can move between apps very quickly. I can also move between all the windows of a single application.
There would be a very big efficiency gain if I could manage my Squeak windows the same way I manage my other Mac windows.
As I say, you could have any UI . Someone did a Expose like in Squeak, a long ago, but I don't remember who. Or use John Mac AppleScript hooks for raise real Mac UI elements or use Mac Services or use Unix under the hood power.
Edgar
While it's true that I can reprogram the Squeak UI however I wish, that isn't a trivial process. And it's not really a satisfying answer to the problem.
Remember, I'm talking about barriers to entry. Things that might make a newbie look at Squeak, but turn away. The user interface (as provided) is (for many people) a barrier to entry. Most of us get over it, but it's still a barrier.
-Rich-
Rich Warren puso en su mail :
Remember, I'm talking about barriers to entry. Things that might make a newbie look at Squeak, but turn away. The user interface (as provided) is (for many people) a barrier to entry. Most of us get over it, but it's still a barrier
If things do not change , progress do not happen.
Myself argue against Traits, a long ago, as having Traits cause breaks with older Squeak and introduce several collateral things , unneeded for normal projects (IMHO)
My solution is continuing develop SqueakLight, a hand made image what now do what I wish.
But at the same time , I continue studying, and now try to help the process leaded by Pavel for in a future have a more modular Squeak what starting from a unix like console (kernel.image) , could grow to any "app" , loading what was needed from Web.
You should lobby for a "New Squeak UI" group. Take a look to clever work of wonder people working on Sophie, and help for things like Rome finish the travel and could be used by mortals in 3.9 (or 3.10)
Edgar
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
From: "Lic. Edgar J. De Cleene" edgardec2001@yahoo.com.ar Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: squeakdev squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Fri, 01 Sep 2006 06:55:25 -0300
Myself argue against Traits, a long ago, as having Traits cause breaks with older Squeak and introduce several collateral things , unneeded for normal projects (IMHO)
I agree that traits wont come up normally. But as soon as you get into big complicated heiarchies traits are probably going to be a better fit. Not only that, I have seen a lot of people ask for protocols to be actual queriable objects. That seems to be about what traits are afaik.
Many things smalltalk has are just better versions of what everyone else has. I think things like this are what everyone will be trying to steal tommorow when they finally arrive where smalltalk was years ago and see what the problems are.
On Sat, 02 Sep 2006 13:41:52 +0200, J J wrote:
I agree that traits wont come up normally. But as soon as you get into big complicated heiarchies traits are probably going to be a better fit. Not only that, I have seen a lot of people ask for protocols to be actual queriable objects. That seems to be about what traits are afaik.
... besides that software composition with traits no longer needs to follow the hierachical (subclassing) path ...
Many things smalltalk has are just better versions of what everyone else has. I think things like this are what everyone will be trying to steal tommorow when they finally arrive where smalltalk was years ago and see what the problems are.
Refreshing :)
/Klaus
J J puso en su mail :
I agree that traits wont come up normally. But as soon as you get into big complicated heiarchies traits are probably going to be a better fit. Not only that, I have seen a lot of people ask for protocols to be actual queriable objects. That seems to be about what traits are afaik.
Many things smalltalk has are just better versions of what everyone else has. I think things like this are what everyone will be trying to steal tommorow when they finally arrive where smalltalk was years ago and see what the problems are.
Yes, I agree and apologize by any headaches caused to wise Squeakers who take the big trouble on his shoulders and give the community this new (for me) way of think objects.
The point of my mail was what if you don't take risk and stay doing the same, no progress is possible. And what is better do something what complaining :=)
Edgar
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
Sorry for being away the last few days (work related). I didn't intend to throw grenade in and then just leave. :)
To start off I decided to address this point first:
On Aug 30, 2006, at 8:35 AM, Ramon Leon wrote:
I agree that Smalltalk has excellent tools for sifting through the source code. However, this can be a barrier to entry for newcomers. We need a constant supply of new blood, otherwise Smalltalk will wither and die.
Or maybe just tread water when it should be leading the pack. These two possibilities are pretty much equivalant in my mind.
Also, I hate being isolated from the rest of my desktop. I'm a mac user. I like my mac. I like my mac apps. I wish Smalltalk could be part of that environment. Visual Works gets a few points here. At least it looks like a native interface (Though, the UI doesn't behave in a consistently native manner--which can actually be more annoying sometimes. And it doesn't run on intel macs yet.).
You points on the environment look are certainly valid (though I don't mind it personally). As far as isolation from the rest of the desktop, let's look at how everyone else does it.
In Java, C++, Ruby, Python, et. al. how does one build an application? 1. Determine what your application consists of (or what you think it does) 2. Identify what code has already been written in this area (and hopefully us squeakmap like app to download/install it) 3. Forevermore remember to import/#include/re/whatever to get the code you want visable to your system 4. Develop the code (glue together the components, try new components, etc) 5. Package it up and deliver it to the customer.
Now many times you wont identify what you need in step 2, you will see some *possibilities*. You may have to try out several of them to see what will work. When you change one implimentation for another you have to remember to go and remove all the references to the previous component.
How does smalltalk do it? The same as above, just remove step 3. The cost is that step 5 gets more complicated.
Stated another way; the approach used by other languages is start writing one or more files that may use one or more files to build up your application. The smalltalk approach is to build the application from *within* the application you are writing. For every new app you write the image *is* effectively this new app until you deploy it. At which point it becomes the next app you will wright and so on.
Smalltalk is the only one to get it right IMO. When someone sets out to build a car, airplane, building or whatever they build the peices they need and make schematics to describe the different components. Once a built component is used in a product it is gone and must be rebuilt for the next product. Not so with digital media. Once we have the component we have it from then on, no more component assembly required. Manufacturing companies have spent lots of money developing special assembly lines to get as close as they can to what we have for free.
Conventional programming languages have this also, but the components are laying somewhere in a huge garage, you have to go dig all over for them. In smalltalk you just say "Hammer hitNail" and it is magically in your hand, unless you never went and got one in the first place. But once you get it you have it.
When you build the smalltalk application you get all your classes working right, save the image, then do step 5: remove everything you are not using. This seems right to me, it is consistant with the concept of garbage collection: it is faster over all to do cleanup all at once instead of every time you change something (e.g. removing import statements for components that turned out not to work for you). And it can all be done programatically, as opposed to the by hand method required with other approaches. So if something doesn't get taken out that you thought should have you can go find out why. More bug protection.
Now, after you deploy the application you start your image up and guess what, the application you just deployed is still there. So now when you make a new application it is really simple to refactor the common parts together. I did this with some of my programs in Borland C++ builder. It worked, but it was much more complicated then just making a few new classes and doing a little refactory.
In fact, *every* application that you or anyone else has written is available in your image. Including applications for debugging, playing MPEG's and everything else. But that is ok because these applications will help you build the next application you are working on (well, some will help more then others. :) and it can be automatically removed before you deploy.
If the image feels isolated from the rest of the desktop it is because you have never been able to do this before. :)
On Sep 1, 2006, at 11:15 PM, J J wrote:
Also, I hate being isolated from the rest of my desktop. I'm a mac user. I like my mac. I like my mac apps. I wish Smalltalk could be part of that environment. Visual Works gets a few points here. At least it looks like a native interface (Though, the UI doesn't behave in a consistently native manner--which can actually be more annoying sometimes. And it doesn't run on intel macs yet.).
You points on the environment look are certainly valid (though I don't mind it personally). As far as isolation from the rest of the desktop, let's look at how everyone else does it.
In Java, C++, Ruby, Python, et. al. how does one build an application?
- Determine what your application consists of (or what you think
it does) 2. Identify what code has already been written in this area (and hopefully us squeakmap like app to download/install it) 3. Forevermore remember to import/#include/re/whatever to get the code you want visable to your system 4. Develop the code (glue together the components, try new components, etc) 5. Package it up and deliver it to the customer.
<much snipped>
I'm not sure what this has to do with isolation from the rest of the desktop. Let me be clear, I wasn't talking about developing/coding issues, I was talking about using the UI.
While I'm coding, I inevitably need to check my e-mail, browse web pages, whatever (as research, of course--I'm not just playing around). I want to use those (and other tools) on my mac. Having the Squeak UI isolated from my OS UI makes rapid shuffling between browser windows and native OS tools more difficult than is absolutely necessary (at least for the way I typically work).
Also, having a separate UI means I need to learn two UIs. I have to constantly shift between the UIs. I have to maintain separate mental lists of efficiency tips for each UI. I have to remember which keystrokes go with which environment. Again, more work than is strictly necessary.
-Rich-
From: Rich Warren rwmlist@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Sat, 2 Sep 2006 21:25:18 -1000
I'm not sure what this has to do with isolation from the rest of the desktop. Let me be clear, I wasn't talking about developing/coding issues, I was talking about using the UI.
While I'm coding, I inevitably need to check my e-mail, browse web pages, whatever (as research, of course--I'm not just playing around). I want to use those (and other tools) on my mac. Having the Squeak UI isolated from my OS UI makes rapid shuffling between browser windows and native OS tools more difficult than is absolutely necessary (at least for the way I typically work).
Also, having a separate UI means I need to learn two UIs. I have to constantly shift between the UIs. I have to maintain separate mental lists of efficiency tips for each UI. I have to remember which keystrokes go with which environment. Again, more work than is strictly necessary.
-Rich-
Well what I meant was working in a smalltalk environment is like developing your next app from within the app you are building. So I think you would feel the same isolation if you could develop from inside of your web browser for example.
But as far as wishing the tools that exist in the image behaved like your normal GUI, can something be done with themes? Is anyone looking into making themes or something like that be set up in such a way that I could set them to "Mac" and now my image behaves like a mac or "WinXP" and now it behaves like XP?
On Sep 4, 2006, at 12:13 AM, J J wrote:
From: Rich Warren rwmlist@gmail.com Reply-To: The general-purpose Squeak developers list<squeak- dev@lists.squeakfoundation.org> To: The general-purpose Squeak developers list<squeak- dev@lists.squeakfoundation.org> Subject: Re: Thoughts from an outsider Date: Sat, 2 Sep 2006 21:25:18 -1000
I'm not sure what this has to do with isolation from the rest of the desktop. Let me be clear, I wasn't talking about developing/ coding issues, I was talking about using the UI.
While I'm coding, I inevitably need to check my e-mail, browse web pages, whatever (as research, of course--I'm not just playing around). I want to use those (and other tools) on my mac. Having the Squeak UI isolated from my OS UI makes rapid shuffling between browser windows and native OS tools more difficult than is absolutely necessary (at least for the way I typically work).
Also, having a separate UI means I need to learn two UIs. I have to constantly shift between the UIs. I have to maintain separate mental lists of efficiency tips for each UI. I have to remember which keystrokes go with which environment. Again, more work than is strictly necessary.
-Rich-
Well what I meant was working in a smalltalk environment is like developing your next app from within the app you are building. So I think you would feel the same isolation if you could develop from inside of your web browser for example.
No. My web browser is integrated into my desktop environment, so I can rapidly switch between programs. This lets me leverage any tool on my system in a tightly integrated way. I actually have done some seaside development from inside my web browser, and I didn't feel the same sense of isolation from the desktop (though I have a certain amount of isolation from the squeak environment in those cases).
I really don't see how development styles relates to the issue of feeling isolated from the OS. They seem like completely different issues in my mind. One of the things I love about Smalltalk is the way applications are built. When I do strictly Mac work, I'll often use FScript as a support tool, since it helps me capture a similar feeling.
Or, to put it another way, when I develop in VisualWorks (on my old mac, it still doesn't run on my new mac, which makes me sad), I don't feel as isolated from my OS. A little bit, since the UI doesn't function in a 100% native manner. In Ambri Smalltalk, I don't feel isolated at all. In all three cases (Squeak, Visualworks, and Ambri), I am using the same style and techniques to develop the code. Squeak is the only one which makes me feel isolated from my desktop .
What I have been trying to describe is strictly a Squeak UI issue. It has nothing to do with Smalltalk in general.
Just to bring this full circle. Now that I've been using Squeak for a while, I've grown used to it's UI. I find that using QuickSilver, I can still pop out of a full-screen Squeak session with just a few keystrokes, check the email message that relates to the problem at hand, do a little web research on the topic, then slip right back into Squeak. But this involved bending my normal workflow around Squeak (where, ideally, Squeak would just slip transparently into my regular workflow). Even if Visualworks was running on intel macs, I would probably keep coding in Squeak. However, the UI was a real barrier to entry, and it can drive off new users (which was my original point).
-Rich-
From: Rich Warren rwmlist@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Mon, 4 Sep 2006 19:44:44 -1000
Just to bring this full circle. Now that I've been using Squeak for a while, I've grown used to it's UI. I find that using QuickSilver, I can still pop out of a full-screen Squeak session with just a few keystrokes, check the email message that relates to the problem at hand, do a little web research on the topic, then slip right back into Squeak. But this involved bending my normal workflow around Squeak (where, ideally, Squeak would just slip transparently into my regular workflow). Even if Visualworks was running on intel macs, I would probably keep coding in Squeak. However, the UI was a real barrier to entry, and it can drive off new users (which was my original point).
-Rich-
Well then, I reassert my previous question: Is it possible for someone to do something with themes? Is there a way to have "WinXP" theme, "Mac" theme, "Smalltalk-80" and "Squeak" themes that change everything to behave how one would expect in those environments? And maybe by default the theme is selected based on the platform?
On 4-Sep-06, at 10:44 PM, Rich Warren wrote:
Just to bring this full circle. Now that I've been using Squeak for a while, I've grown used to it's UI. I find that using QuickSilver, I can still pop out of a full-screen Squeak session with just a few keystrokes,
I don't understand why you would choose to use Squeak fullscreen if you want to feel connected with your OS; it seems like a strategy almost guaranteed to make the worst of squeaks' use of a single window. I don't think I've used fullscreen form since 1989 - and before then it was simply impossible to do otherwise because my OS simply didn't have other windows!
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim For every action, there is an equal and opposite criticism.
On Sep 5, 2006, at 5:21 AM, tim Rowledge wrote:
On 4-Sep-06, at 10:44 PM, Rich Warren wrote:
Just to bring this full circle. Now that I've been using Squeak for a while, I've grown used to it's UI. I find that using QuickSilver, I can still pop out of a full-screen Squeak session with just a few keystrokes,
I don't understand why you would choose to use Squeak fullscreen if you want to feel connected with your OS; it seems like a strategy almost guaranteed to make the worst of squeaks' use of a single window. I don't think I've used fullscreen form since 1989 - and before then it was simply impossible to do otherwise because my OS simply didn't have other windows!
Space for more windows. Space for organizing windows. There's never enough space.
I've gotten lazy on my mac desktop. I can have dozens of windows open and because of the way I work (a combination of Quicksilver and Expose) I can dance between them with ease.
When working in Squeak, I like to have as similar a setup as possible. I often have two or three browsers open (all on different parts of code). I will have at least one workspace and a transcript-- at a minimum. Other windows rapidly accumulate.
It's not as easy to shuffle between windows, so I like to lay them out so they are as visible as possible (or so it's easy to bring the desired window to the foreground with a single mouse click).
Quicksilver and Expose make this a partial solution. I can still jump from Squeak to my desktop and back with ease. What I can't do is place a small browser window over a near-full screen safari window, so I could reference information from a web page while I code without having to move anything.
-Rich-
(Just to be clear to everyone who has already commented on possible solutions for this, I'm not ignoring you, I'm just trying to answer the question at hand.)
Communities that tell their users to RTFM find themselves alone very quickly. We're telling ours to RTFSC. There has got to be a compromise better than that.
--Benjamin
I never said documentation was bad, I was simply responding to the invalid accusation that the Smalltalk style of self documenting code is wrong, or that we're copping out or lying made by JJ below...
And dont go down the road that "smalltalk is simple so the code documents itself". The code NEVER documents itself, that is a cop-out and a bold face lie.
And...
I appreciate the simplicity of the language, but it is because of this reason one must guard against the false feeling of "self documenting code".
Saying we could use more documentation, is quite different than saying our practices are wrong, or we are lying, or fooling ourselves with false feeling of "self documenting code".
Documents mostly don't exist because there's no one writing them, this is after all an open source community and the people in the know are too busy writing code.
The entire community, I'm sure, is open to accepting any documentation anyone feels like writing, including JJ. But in a fast moving development effort, like Squeak, Seaside, and many other projects I'm sure, there's always going to be a lack of documentation, that's just life.
This isn't some big commercial framework where you can point a finger and say hey, you should have written more documents. Those kind of documents will naturally evolve as the frameworks settle down and start being used more, but don't insult the authors of such frameworks by calling them liars, seriously, be grateful those guys are writing cool stuff for us to use, worry about documents later.
On 30-Aug-06, at 1:34 PM, Ramon Leon wrote:
Communities that tell their users to RTFM find themselves alone very quickly. We're telling ours to RTFSC. There has got to be a compromise better than that.
--Benjamin
I never said documentation was bad, I was simply responding to the invalid accusation that the Smalltalk style of self documenting code is wrong, or that we're copping out or lying made by JJ below...
And dont go down the road that "smalltalk is simple so the code documents itself". The code NEVER documents itself, that is a cop-out and a bold face lie.
Well I have bit of experience in Smalltalk and I find myself substantially in agreement with JJ here. Sure, senders and implementors are fabulous tools to have but they offer nothing to help understand what is likely to happen with exceptions and very little for Tweak signals etc. No amount of staring at source code will tell you what the author might have *wanted* the code to do, nor what misbegotten changes somebody made after misunderstanding the intent of the code at a later point. Source code tells you what *actually* happens, not what is *meant* to happen. Anybody that tries to tell you that the code does exactly what it it supposed to is almost certainly lying.
Comments in methods ought to offer some help in decoding the expectations for the method as a whole, or for parts of the method. Class comments ought to offer a somewhat higher level view of what the class is supposed to do and the limitations it is known to have. Other forms of comments and documentation are needed to give later authors some hope of being able to use, maintain and improve the system. You need tutorial type documentation to offer newcomers to a part of the system a chance of getting some sense of the system before they can even begin to understand the actual code.
Adele Goldberg expressed it once as "if the code isn't documented, it doesn't exist" since without reasonable doc there is no way to count the code as usable in the long term. I tend to add the corollary clause "and if it doesn't exist, what did we pay you for?"
Another old friend of mine has also coined the rather nice idea of "program the document, don't document the program" to cover a concept of merging doc and code in the tools so that you can write spec, explanation, commentary, examples and limitations mixed in with executable code. It's not hugely different to some aspects of the late Jef Raskin's idea of The Humane Interface (see http:// www.raskincenter.org) and it wouldn't be too awful implemented as a nice document editor that has a style for 'source code' that actually means source code rather than just using a fixed pitch font. Hmm, now where might we find a document editor with intimate associations with a compiler?
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim A)bort, R)etry or S)elf-destruct?
On 8/31/06, tim Rowledge tim@rowledge.org wrote:
Another old friend of mine has also coined the rather nice idea of "program the document, don't document the program" to cover a concept of merging doc and code in the tools so that you can write spec, explanation, commentary, examples and limitations mixed in with executable code.
Sure, literate programming is a nice idea but even if there is the wonderful example of TeX to support it I'm not sure it's agile enough in it's current form to be smalltalker-compliant :-) The 3 big programs written and published in literate style that I can think of are counter examples IMHO because they were written by one (or very few) people and are not meant to evolve very much if at all: TeX and metafont were frozen by D.E.K long ago, and pbrt is published more as teaching material than as a competitive renderer (http://pbrt.org). However I'd really like to be convinced that it can actually work for fast-moving and widely collaborative projects.
What would a documentation debugger look like ?
late Jef Raskin's idea of The Humane Interface (see http:// www.raskincenter.org) and it wouldn't be too awful implemented as a nice document editor that has a style for 'source code' that actually means source code rather than just using a fixed pitch font. Hmm, now
A mix of a smalltalk browser and a wiki ?
where might we find a document editor with intimate associations with a compiler?
emacs :D
Damien Pollet schrieb:
On 8/31/06, tim Rowledge tim@rowledge.org wrote:
Another old friend of mine has also coined the rather nice idea of "program the document, don't document the program" to cover a concept of merging doc and code in the tools so that you can write spec, explanation, commentary, examples and limitations mixed in with executable code.
Sure, literate programming is a nice idea but even if there is the wonderful example of TeX to support it I'm not sure it's agile enough in it's current form to be smalltalker-compliant :-)
A long time ago, when I re-implemented a big chunk of TeX in VisualWorks to create a WYSIWYG TeX editor (WysiTeX), we tried to do something like literate programming in Smalltalk. My idea was that a Smalltalk literate program could not possibly have the form of a linear book, since Smalltalk programs are essentially not linear, so we tried to create a hyperlinked documentation (using a collaborative hypertext editor also written in VisualWorks). I was not really satisfied with the result - it did not have the close linkage to the code, and I don't think that an outsider would have been able to grok our code with the help of this doc bettern than without it.
That said, I still feel that something like that would be needed. Since working with Objectory a number of years ago, I became enamoured with the idea of traceability - having explicit links between analysis, design and code. Objectory was a little too waterfallish, an agile tool would probably have to look a bit different, but still I think that a really good development environment should be able to keep all this information in one place, allowing me to create and follow links, to store document files, drawings, diagrams as well as runtime, building and test code in one place, with version history all over the place, too.
I know that such a system would not help me much in writing better method comments (that's still a matter of discipline which I'm a bit lacking) but it would probably allow me to create overview documents which allow others to get into the code much more easily.
Cheers, Hans-Martin
Hi Hans-Martin,
I am very interested in having code as (integrated) part of a document. The following describes minimally what I want from a document+with+code, a "... two-phased approach that continuously synchronizes between a data modeling view and a view on an object-oriented implementation". There we see
- a domain analysis view, represented by a data modeling diagram - implementation objects, related to OO programs at code-time - population objects, derived from the former, containing actual data for running
Found at - http://prog.vub.ac.be/progsite/Person.php?rdid=25070
I wouldn't care if this where called literate programming or so, as long as round-trip engineering allowed me to put comments anywhere I want :)
/Klaus
On Thu, 31 Aug 2006 07:41:16 +0200, Hans-Martin Mosner hmm@heeg.de wrote:
A long time ago, when I re-implemented a big chunk of TeX in VisualWorks to create a WYSIWYG TeX editor (WysiTeX), we tried to do something like literate programming in Smalltalk. My idea was that a Smalltalk literate program could not possibly have the form of a linear book, since Smalltalk programs are essentially not linear, so we tried to create a hyperlinked documentation (using a collaborative hypertext editor also written in VisualWorks). I was not really satisfied with the result - it did not have the close linkage to the code, and I don't think that an outsider would have been able to grok our code with the help of this doc bettern than without it.
That said, I still feel that something like that would be needed. Since working with Objectory a number of years ago, I became enamoured with the idea of traceability - having explicit links between analysis, design and code. Objectory was a little too waterfallish, an agile tool would probably have to look a bit different, but still I think that a really good development environment should be able to keep all this information in one place, allowing me to create and follow links, to store document files, drawings, diagrams as well as runtime, building and test code in one place, with version history all over the place, too.
I know that such a system would not help me much in writing better method comments (that's still a matter of discipline which I'm a bit lacking) but it would probably allow me to create overview documents which allow others to get into the code much more easily.
Cheers, Hans-Martin
Literate programming (the program as a textbook) looks very interesting, but it didn't work for me because it is based on a fundamental misunderstanding: A textbook teaches a stable and well understood subject. A program is neither. (But it will be interesting to study simon's ref. to darcs.)
In the early eighties, a colleague and I did a substantial development job using literate programming. The program itself was a success, but literate programming was a flop.
We started from a very powerful multimedia authoring tool. We added three new media: Smalltalk class and method definitions + workspaces.
We could print the document with its embedded code; we could compile the document and even run tests that were specified in the document. The project was to develop the OS-like core of a family of applications. It is still alive more than 20 years later.
Literate programming worked beautifully for many months. We wrote a textbook describing our program, including descriptions of why we did things in a special way and why some tempting optimizations were very dangerous. We were doing pair programming and found that we were very motivated to write down what we were doing while we were doing it. The next day was too late.
But after more than a hundred pages of literate programming, we found that we needed to do some refactoring. But that would require a rewrite of several chapters in our book. We just couldn't do it. The program changes were fairly small, the book changes substantial. Even the main chapters had to be rearranged. We ended up with adding appendixes with overrides on previously written stuff. A total mess. (We even wrote an OOPSLA paper reporting it: T. Reenskaug and A. L. Skaar. An environment for literate smalltalk programming. ACM SIGPLAN Notices, 24(10):337--345, October 1989.)
Don Knuth dreamt about a program that was like a textbook. He even wrote one. But in general, the analogy doesn't hold. A textbook is written over a well known theme. The substance is stable, the presentation is new. A program is not stable in this sense; its substance is a moving target. So the textbook metaphor simply does not apply. Has anybody tried to modify Knuth's original program?
Cheers --Trygve
At 10:19 31.08.2006, Klaus wrote:
Hi Hans-Martin,
I am very interested in having code as (integrated) part of a document. The following describes minimally what I want from a document+with+code, a "... two-phased approach that continuously synchronizes between a data modeling view and a view on an object-oriented implementation". There we see
- a domain analysis view, represented by a data modeling diagram
- implementation objects, related to OO programs at code-time
- population objects, derived from the former, containing actual data for
running
Found at
I wouldn't care if this where called literate programming or so, as long as round-trip engineering allowed me to put comments anywhere I want :)
/Klaus
On Thu, 31 Aug 2006 07:41:16 +0200, Hans-Martin Mosner hmm@heeg.de wrote:
A long time ago, when I re-implemented a big chunk of TeX in VisualWorks to create a WYSIWYG TeX editor (WysiTeX), we tried to do something like literate programming in Smalltalk. My idea was that a Smalltalk literate program could not possibly have the form of a linear book, since Smalltalk programs are essentially not linear, so we tried to create a hyperlinked documentation (using a collaborative hypertext editor also written in VisualWorks). I was not really satisfied with the result - it did not have the close linkage to the code, and I don't think that an outsider would have been able to grok our code with the help of this doc bettern than without it.
That said, I still feel that something like that would be needed. Since working with Objectory a number of years ago, I became enamoured with the idea of traceability - having explicit links between analysis, design and code. Objectory was a little too waterfallish, an agile tool would probably have to look a bit different, but still I think that a really good development environment should be able to keep all this information in one place, allowing me to create and follow links, to store document files, drawings, diagrams as well as runtime, building and test code in one place, with version history all over the place, too.
I know that such a system would not help me much in writing better method comments (that's still a matter of discipline which I'm a bit lacking) but it would probably allow me to create overview documents which allow others to get into the code much more easily.
Cheers, Hans-Martin
On Fri, 01 Sep 2006 14:06:47 +0200, Trygve Reenskaug wrote: ...[many good words cut]...
But after more than a hundred pages of literate programming, we found that we needed to do some refactoring. But that would require a rewrite of several chapters in our book. We just couldn't do it. The program changes were fairly small, the book changes substantial. Even the main chapters had to be rearranged. We ended up with adding appendixes with overrides on previously written stuff. A total mess. (We even wrote an OOPSLA paper reporting it: T. Reenskaug and A. L. Skaar. An environment for literate smalltalk programming. ACM SIGPLAN Notices, 24(10):337--345, October 1989.)
If you set "classic documentation" := "your doc book approach" then I cannot see any difference to what's up nowadays: the doc is always the first *or* the next component which is outdated.
/Klaus
At 14:45 02.09.2006, Klaus wrote:
If you set "classic documentation" := "your doc book approach" then I cannot see any difference to what's up nowadays: the doc is always the first *or* the next component which is outdated.
/Klaus
Of course not. I am talking about literate programming as proposed by Don Knuth. Classic documentation is different.
Cheers --Trygve
Perhaps a javadoc type tool could be written that generates documentation from the code itself? I'm not sure I understood your first example perfectly, but it sounded like a javadoc type system might have solved the problem. That is; yes if I have to go through methods clicking links I would probably get confused, but if it generated web pages that correspond to the methods and classes maybe it could work?
I mean as a first cut. Of course at some point it would be nice to install a squeak app that generates UML diagrams of the running system, lets you make code from there if you want, get any kind of documented output you want. But I think the javadoc thing could be done really quick.
From: Hans-Martin Mosner hmm@heeg.de Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Thu, 31 Aug 2006 07:41:16 +0200
Damien Pollet schrieb:
On 8/31/06, tim Rowledge tim@rowledge.org wrote:
Another old friend of mine has also coined the rather nice idea of "program the document, don't document the program" to cover a concept of merging doc and code in the tools so that you can write spec, explanation, commentary, examples and limitations mixed in with executable code.
Sure, literate programming is a nice idea but even if there is the wonderful example of TeX to support it I'm not sure it's agile enough in it's current form to be smalltalker-compliant :-)
A long time ago, when I re-implemented a big chunk of TeX in VisualWorks to create a WYSIWYG TeX editor (WysiTeX), we tried to do something like literate programming in Smalltalk. My idea was that a Smalltalk literate program could not possibly have the form of a linear book, since Smalltalk programs are essentially not linear, so we tried to create a hyperlinked documentation (using a collaborative hypertext editor also written in VisualWorks). I was not really satisfied with the result - it did not have the close linkage to the code, and I don't think that an outsider would have been able to grok our code with the help of this doc bettern than without it.
That said, I still feel that something like that would be needed. Since working with Objectory a number of years ago, I became enamoured with the idea of traceability - having explicit links between analysis, design and code. Objectory was a little too waterfallish, an agile tool would probably have to look a bit different, but still I think that a really good development environment should be able to keep all this information in one place, allowing me to create and follow links, to store document files, drawings, diagrams as well as runtime, building and test code in one place, with version history all over the place, too.
I know that such a system would not help me much in writing better method comments (that's still a matter of discipline which I'm a bit lacking) but it would probably allow me to create overview documents which allow others to get into the code much more easily.
Cheers, Hans-Martin
On 9/2/06, J J azreal1977@hotmail.com wrote:
Perhaps a javadoc type tool could be written that generates documentation from the code itself?
<SNIP>
Something like Dandelion? http://www.mars.dti.ne.jp/~umejava/smalltalk/stClasses/dandelion/
Chris
I must say, this sounds promissing I think. I don't know how you guys are finding this stuff. :)
The last update seems to be from 2004, is this a project without an owner atm?
From: "Chris Barham" cbarham@pobox.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Sat, 2 Sep 2006 20:24:38 +1000
On 9/2/06, J J azreal1977@hotmail.com wrote:
Perhaps a javadoc type tool could be written that generates documentation from the code itself?
<SNIP>
Something like Dandelion? http://www.mars.dti.ne.jp/~umejava/smalltalk/stClasses/dandelion/
Chris
Am 02.09.2006 um 12:30 schrieb J J:
I must say, this sounds promissing I think. I don't know how you guys are finding this stuff. :)
Well, some of us are around for ages and can still remember stuff ;)
The last update seems to be from 2004, is this a project without an owner atm?
Masashi Umezawa is still around AFAIK, but like most Japanese developers he is not active on squeak-dev. You might want to drop him a mail.
http://www.mars.dti.ne.jp/~umejava/smalltalk/stClasses/dandelion/
- Bert -
Hi,
Sorry for the late reply. I was disconnected from the net for a while. (long trip to Prague (ESUG)).
I think Dandelion is in a sort of stable state. Although I have a few things that I would like to add, the priority is not so high for me. (But if there are real demands, I would do the action).
What I'm thinking are:
- The new release should be a MCZ based SAR file - Support of analysis of MCZ packages - Embed auto generated class graphs in html output - Add code metrics analysis and CSV output
2006/9/3, Bert Freudenberg bert@freudenbergs.de:
Am 02.09.2006 um 12:30 schrieb J J:
I must say, this sounds promissing I think. I don't know how you guys are finding this stuff. :)
Well, some of us are around for ages and can still remember stuff ;)
The last update seems to be from 2004, is this a project without an owner atm?
Masashi Umezawa is still around AFAIK, but like most Japanese developers he is not active on squeak-dev. You might want to drop him a mail.
http://www.mars.dti.ne.jp/~umejava/smalltalk/stClasses/dandelion/
Well I hope you had a great trip! Those things you suggest sound good to me. And thanks for your contributions. :)
From: "Masashi UMEZAWA" masashi.umezawa@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "The general-purpose Squeak developers list"squeak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Wed, 6 Sep 2006 16:54:10 +0900
Hi,
Sorry for the late reply. I was disconnected from the net for a while. (long trip to Prague (ESUG)).
I think Dandelion is in a sort of stable state. Although I have a few things that I would like to add, the priority is not so high for me. (But if there are real demands, I would do the action).
What I'm thinking are:
- The new release should be a MCZ based SAR file
- Support of analysis of MCZ packages
- Embed auto generated class graphs in html output
- Add code metrics analysis and CSV output
2006/9/3, Bert Freudenberg bert@freudenbergs.de:
Am 02.09.2006 um 12:30 schrieb J J:
I must say, this sounds promissing I think. I don't know how you guys are finding this stuff. :)
Well, some of us are around for ages and can still remember stuff ;)
The last update seems to be from 2004, is this a project without an owner atm?
Masashi Umezawa is still around AFAIK, but like most Japanese developers he is not active on squeak-dev. You might want to drop him a mail.
http://www.mars.dti.ne.jp/~umejava/smalltalk/stClasses/dandelion/
-- [:masashi | ^umezawa]
J J wrote:
Perhaps a javadoc type tool could be written that generates documentation from the code itself? I'm not sure I understood your first example perfectly, but it sounded like a javadoc type system might have solved the problem. That is; yes if I have to go
We have had this sitting around basically unused for way too long:
http://source.impara.de/squeakdoc
It generates DocBook XML that then can be either used in a wiki like system as the one we set up at http://squeakdoc.impara.de/external/
and/or converted to e.g. HTML.
Hmm, just realizing the only doc we have is in German... Will translate the main things...soon?...
Michael
Am 02.09.2006 um 14:00 schrieb Michael Rueger:
J J wrote:
Perhaps a javadoc type tool could be written that generates documentation from the code itself? I'm not sure I understood your first example perfectly, but it sounded like a javadoc type system might have solved the problem. That is; yes if I have to go
We have had this sitting around basically unused for way too long:
http://source.impara.de/squeakdoc
It generates DocBook XML that then can be either used in a wiki like system as the one we set up at http://squeakdoc.impara.de/external/
and/or converted to e.g. HTML.
Hmm, just realizing the only doc we have is in German... Will translate the main things...soon?...
Actually, the Squeak Doc documentation itself (in Books - Test Category) is in english.
- Bert -
Hi mickael
This is cool that you release the cool stuff you have been doing and few have been seen. Impara deserves a broader attention form the community (and clients :)) but for that people need to know that you are cool and excellent!
Stef
On 2 sept. 06, at 14:00, Michael Rueger wrote:
J J wrote:
Perhaps a javadoc type tool could be written that generates documentation from the code itself? I'm not sure I understood your first example perfectly, but it sounded like a javadoc type system might have solved the problem. That is; yes if I have to go
We have had this sitting around basically unused for way too long:
http://source.impara.de/squeakdoc
It generates DocBook XML that then can be either used in a wiki like system as the one we set up at http://squeakdoc.impara.de/external/
and/or converted to e.g. HTML.
Hmm, just realizing the only doc we have is in German... Will translate the main things...soon?...
Michael
Let me point out two recent literate programming successes -
1. darcs. The (haskell) code and (latex) manual are intermingled and maintained as a single unit to very good effect. See the manual at http://darcs.net .
2. ruby. http://www.ruby-doc.org/core and http://www.ruby-doc.org/stdlib present current, accessible API docs and also higher level docs with very little fuss. These are generated from extensive code comments, READMEs, etc. (Many other languages do this but less effectively.)
Cheers, -Simon
PS I really like this thread.
present current, accessible API docs and also higher level docs with very little fuss. These are generated from extensive code comments, READMEs, etc. (Many other languages do this but less effectively.)
I can't help but point out how much Ruby's doc's are just imitations of a Smalltalk class browser. How exactly is this better than class and method comments in Smalltalk directly? How is dandelion better than a real browser either? If you can generate the docs from the code, of what additional value is the doc?
On 4-Sep-06, at 7:06 PM, Ramon Leon wrote:
If you can generate the docs from the code, of what additional value is the doc?
Modulo the quality of the comments in the code that are being used, it's the presentation that can make the difference. A form of browser that can gather linked comments from methods and classes and present them in a neatly intelligible form is surely an improvement over scattered snippets?
But don't forget that crucial first clause above about the quality of the source material.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Useful random insult:- Always loses battles of wits because he's unarmed.
Modulo the quality of the comments in the code that are being used, it's the presentation that can make the difference. A form of browser that can gather linked comments from methods and classes and present them in a neatly intelligible form is surely an improvement over scattered snippets?
Is not the standard Smalltalk browser such a browser? How would some other browser, using the same data, be able to somehow present the information better than the Smalltalk browser? If such a great feature existed, wouldn't we simply add it to the existing Smalltalk browser?
But don't forget that crucial first clause above about the quality of the source material.
tim
Agreed, well commented code, when and where a comment adds value to what the code already says. Often there is value in "no comment". As someone earlier said, no one reads a 1000 page document. ;)
Ramon Leon ramonleon@cox.net writes:
Modulo the quality of the comments in the code that are being used, it's the presentation that can make the difference. A form of browser that can gather linked comments from methods and classes and present them in a neatly intelligible form is surely an improvement over scattered snippets?
Is not the standard Smalltalk browser such a browser? How would some other browser, using the same data, be able to somehow present the information better than the Smalltalk browser? If such a great feature existed, wouldn't we simply add it to the existing Smalltalk browser?
It is, Ramon. The Smalltalk browser, specialized to its task, is way better than a generic web browser. Furthermore, the Smalltalk browser is *integrated*, meaning you can flip seamlessly between browsing, executing, coding, and debugging. The Squeak debugger can put you into the Squeak browser, and the Squeak browser can execute things for you (and IMHO it could profitably do more of that....)
Ruby and Java, having no such browser, must use a generic tool (HTML) and their integration cannot be as nice. Smalltalk is way ahead of its time with its code browsing.
Incidentally, I would not be complacent -- there is always room to add new or better browsing views to Squeak. It would be worth looking through the output from the various FooDoc programs and checking that Squeak includes analogous views for all of them that matter.
Also, it is well worth looking at the hyper-linking within the browser. It would be better if the context menus of Squeak were actually context-sensitive to what has been highlighted, so that you can offer good browsing choices. Instead of "inst var defs" and then select the variable, it should be possible to highlight the variable and then "defs of THIS inst var" is on the context menu.
To get ideas about this, just check out Eclipse....
-Lex
What I saw from dandelion that looked interesting was the ability to export directly to a UML tool. Then you would have the ability to see the links between the classes visually. At least that's how it looked to me.
From: Ramon Leon ramonleon@cox.net Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: literate programming examples (Re: Thoughts from an outsider) Date: Mon, 04 Sep 2006 19:06:24 -0700
present current, accessible API docs and also higher level docs with very little fuss. These are generated from extensive code comments, READMEs, etc. (Many other languages do this but less effectively.)
I can't help but point out how much Ruby's doc's are just imitations of a Smalltalk class browser. How exactly is this better than class and method comments in Smalltalk directly? How is dandelion better than a real browser either? If you can generate the docs from the code, of what additional value is the doc?
Hi,
From the author's point of view, Dandelion is basically a tool for generating
inter-operable meta models in various formats. HTML output was actually just an sample, though I added some frills.
For just browsing Smalltalk code, I think SystemBrowser is better.
The advantage of Dandelion is abstraction. For example, it stores analyzed code info in a repository. The analyzed data is independent of the current code and it can be retrieved later for further analysis.
2006/9/5, Ramon Leon ramonleon@cox.net:
present current, accessible API docs and also higher level docs with very little fuss. These are generated from extensive code comments, READMEs, etc. (Many other languages do this but less effectively.)
I can't help but point out how much Ruby's doc's are just imitations of a Smalltalk class browser. How exactly is this better than class and method comments in Smalltalk directly? How is dandelion better than a real browser either? If you can generate the docs from the code, of what additional value is the doc?
The advantage of Dandelion is abstraction. For example, it stores analyzed code info in a repository. The analyzed data is independent of the current code and it can be retrieved later for further analysis. [:masashi | ^umezawa]
That's not abstraction, that's duplication.
And what about UML diagrams? Isn't that just duplication too? I mean all it is is a different view of what the code says right?
Look, despite my strong feelings about so called "self documenting code" I am laying off. If you want to work that way fine, but shouldn't you extend my "side" the same honor of not trying to impose your way on people who want some kind of documentation that is meaningful for us?
From: "Ramon Leon" ramon.leon@allresnet.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "'The general-purpose Squeak developers list'"squeak-dev@lists.squeakfoundation.org Subject: RE: literate programming examples (Re: Thoughts from an outsider) Date: Wed, 6 Sep 2006 08:02:22 -0700
The advantage of Dandelion is abstraction. For example, it stores analyzed code info in a repository. The analyzed data is independent of the current code and it can be retrieved later for further analysis. [:masashi | ^umezawa]
That's not abstraction, that's duplication.
And what about UML diagrams? Isn't that just duplication too? I mean all it is is a different view of what the code says right?
UML diagrams would be a different view of the code, they can add value, they let you see the system in a different way. I didn't criticize this.
Look, despite my strong feelings about so called "self documenting code" I am laying off. If you want to work that way fine, but shouldn't you extend my "side" the same honor of not trying to impose your way on people who want some kind of documentation that is meaningful for us?
I wasn't. I was calling dandelion duplication because it's only showing what the existing class browsers already show, it doesn't add significant value, other than possibly allowing non programmers to read the programmer comments, which I'll admin, could be of value to someone, it's very much like javadoc.
Hi,
The nice thing about duplication is that the duplicated info is independent of the current code. The analyzed data can be used for historical analysis (how the code grows- for example).
That's not abstraction, that's duplication.
On 8/30/06, tim Rowledge tim@rowledge.org wrote:
where might we find a document editor with intimate associations with a compiler?
Sophie!
On Aug 30, 2006, at 15:38 , tim Rowledge wrote:
And dont go down the road that "smalltalk is simple so the code documents itself". The code NEVER documents itself, that is a cop-out and a bold face lie.
Well I have bit of experience in Smalltalk and I find myself substantially in agreement with JJ here. Sure, senders and implementors are fabulous tools to have but they offer nothing to help understand what is likely to happen with exceptions and very little for Tweak signals etc.
That is because the code at that point is not "straightforward", that is, it doesn't directly reflect what is going on because it is actually implementing a different architectural style (in some sense a different language) using what is available in OO/Smalltalk.
No amount of staring at source code will tell you what the author might have *wanted* the code to do, nor what misbegotten changes somebody made after misunderstanding the intent of the code at a later point. Source code tells you what *actually* happens, not what is *meant* to happen. Anybody that tries to tell you that the code does exactly what it it supposed to is almost certainly lying.
I have found that a combination of TDD-style unit tests and "intention revealing" programming style works really, really well at documenting what I *meeant* to happen. Which is kind of funny because it doesn't require any new technology, just technique.
However, it turns out that there are things this combination doesn't cover, and those tend to be the above case of indirectly programming in a different style/language using our current mechanisms. So it appears to be a good indicator of when you need to start twiddling with the language itself.
Adele Goldberg expressed it once as "if the code isn't documented, it doesn't exist" since without reasonable doc there is no way to count the code as usable in the long term. I tend to add the corollary clause "and if it doesn't exist, what did we pay you for?"
Funky. At the last OOPSLA there was a very similar definition of "legacy code": code that doesn't have tests. I thought that was really great. If it doesn't have tests, I can't understand it, and can't evolve it safely. I would also claim that, despite the fact that I like the fuzziness of natural language, unit tests are better to have than comments, because whereas comments tend to always be out of sync with the actual code, we have a simple way of ensuring that the unit tests and the code do not diverge.
Another old friend of mine has also coined the rather nice idea of "program the document, don't document the program"
Essentially very similar to TDD...write the spec/tests/doc, then code it up. The nice thing about tests is that they can tell you when you're done.
That said, it would be interesting if it is possible and/or useful to integrate these notions, maybe similar to what was done in the PIE system: first write documents describing fuzzily what you want, the possibly replace/augment with tests. Only when either one or both are available add code to make it do what the doc/tests say. I guess you could even have some sort of automatic linkup such that it only makes sense to add code in response to one of these documentation/test nodes.
Marcel
I understand what you're saying, but tests still don't remove the need for documentation. When I did the pier/seaside install I ran the tester for fun. Something failed. Without documentation how do I tell if the code is broken or the test is old? Something is obviously wrong, but what? The test tells me what someone wanted at one time, but either they don't want it anymore or someone broke some code, or maybe I really did catch a problem.
And I don't see this about "code is never in sync with documentation". Why? You know when you change code right? So let someone know so they can update the doc. And sure if your documentation is specific like "we chose to loop through the collection" then that could be a problem because low level implimentation details change the most.
But "writeAllObjectsToFile" is always going to basically do the same thing as long as it exists.
From: Marcel Weiher marcel@metaobject.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Thu, 31 Aug 2006 15:11:52 -0700
On Aug 30, 2006, at 15:38 , tim Rowledge wrote:
And dont go down the road that "smalltalk is simple so the code documents itself". The code NEVER documents itself, that is a cop-out and a bold face lie.
Well I have bit of experience in Smalltalk and I find myself substantially in agreement with JJ here. Sure, senders and implementors are fabulous tools to have but they offer nothing to help understand what is likely to happen with exceptions and very little for Tweak signals etc.
That is because the code at that point is not "straightforward", that is, it doesn't directly reflect what is going on because it is actually implementing a different architectural style (in some sense a different language) using what is available in OO/Smalltalk.
No amount of staring at source code will tell you what the author might have *wanted* the code to do, nor what misbegotten changes somebody made after misunderstanding the intent of the code at a later point. Source code tells you what *actually* happens, not what is *meant* to happen. Anybody that tries to tell you that the code does exactly what it it supposed to is almost certainly lying.
I have found that a combination of TDD-style unit tests and "intention revealing" programming style works really, really well at documenting what I *meeant* to happen. Which is kind of funny because it doesn't require any new technology, just technique.
However, it turns out that there are things this combination doesn't cover, and those tend to be the above case of indirectly programming in a different style/language using our current mechanisms. So it appears to be a good indicator of when you need to start twiddling with the language itself.
Adele Goldberg expressed it once as "if the code isn't documented, it doesn't exist" since without reasonable doc there is no way to count the code as usable in the long term. I tend to add the corollary clause "and if it doesn't exist, what did we pay you for?"
Funky. At the last OOPSLA there was a very similar definition of "legacy code": code that doesn't have tests. I thought that was really great. If it doesn't have tests, I can't understand it, and can't evolve it safely. I would also claim that, despite the fact that I like the fuzziness of natural language, unit tests are better to have than comments, because whereas comments tend to always be out of sync with the actual code, we have a simple way of ensuring that the unit tests and the code do not diverge.
Another old friend of mine has also coined the rather nice idea of "program the document, don't document the program"
Essentially very similar to TDD...write the spec/tests/doc, then code it up. The nice thing about tests is that they can tell you when you're done.
That said, it would be interesting if it is possible and/or useful to integrate these notions, maybe similar to what was done in the PIE system: first write documents describing fuzzily what you want, the possibly replace/augment with tests. Only when either one or both are available add code to make it do what the doc/tests say. I guess you could even have some sort of automatic linkup such that it only makes sense to add code in response to one of these documentation/test nodes.
Marcel
Thanks Tim. I think the heat here is because if my comments are taken personally it looks like I am calling volunteers lazy. That is not the case. Someone is lazy when they are not willing to do what they are responsible for (i.e. what they are paid to do or what the life/happiness of people they are responsible for depend on them to do). If someone doesn't want to document code that they wrote and gave away for free, that doesn't make them lazy or negative in any way.
But the documentation needs to get done. So if the author doesn't want to thats ok, it's not bad. But we can start a documentation project, get people who do want to do it and get this done. But the worst thing is when people trying to do this project don't get the help they need because everyone thinks it isn't necassary because "the code documents itself".
From: tim Rowledge tim@rowledge.org Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Wed, 30 Aug 2006 15:38:40 -0700
On 30-Aug-06, at 1:34 PM, Ramon Leon wrote:
Communities that tell their users to RTFM find themselves alone very quickly. We're telling ours to RTFSC. There has got to be a compromise better than that.
--Benjamin
I never said documentation was bad, I was simply responding to the invalid accusation that the Smalltalk style of self documenting code is wrong, or that we're copping out or lying made by JJ below...
And dont go down the road that "smalltalk is simple so the code documents itself". The code NEVER documents itself, that is a cop-out and a bold face lie.
Well I have bit of experience in Smalltalk and I find myself substantially in agreement with JJ here. Sure, senders and implementors are fabulous tools to have but they offer nothing to help understand what is likely to happen with exceptions and very little for Tweak signals etc. No amount of staring at source code will tell you what the author might have *wanted* the code to do, nor what misbegotten changes somebody made after misunderstanding the intent of the code at a later point. Source code tells you what *actually* happens, not what is *meant* to happen. Anybody that tries to tell you that the code does exactly what it it supposed to is almost certainly lying.
Comments in methods ought to offer some help in decoding the expectations for the method as a whole, or for parts of the method. Class comments ought to offer a somewhat higher level view of what the class is supposed to do and the limitations it is known to have. Other forms of comments and documentation are needed to give later authors some hope of being able to use, maintain and improve the system. You need tutorial type documentation to offer newcomers to a part of the system a chance of getting some sense of the system before they can even begin to understand the actual code.
Adele Goldberg expressed it once as "if the code isn't documented, it doesn't exist" since without reasonable doc there is no way to count the code as usable in the long term. I tend to add the corollary clause "and if it doesn't exist, what did we pay you for?"
Another old friend of mine has also coined the rather nice idea of "program the document, don't document the program" to cover a concept of merging doc and code in the tools so that you can write spec, explanation, commentary, examples and limitations mixed in with executable code. It's not hugely different to some aspects of the late Jef Raskin's idea of The Humane Interface (see http:// www.raskincenter.org) and it wouldn't be too awful implemented as a nice document editor that has a style for 'source code' that actually means source code rather than just using a fixed pitch font. Hmm, now where might we find a document editor with intimate associations with a compiler?
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim A)bort, R)etry or S)elf-destruct?
From: "Ramon Leon" ramon.leon@allresnet.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "'The general-purpose Squeak developers list'"squeak-dev@lists.squeakfoundation.org Subject: RE: Thoughts from an outsider Date: Wed, 30 Aug 2006 13:34:07 -0700
I never said documentation was bad, I was simply responding to the invalid accusation that the Smalltalk style of self documenting code is wrong, or that we're copping out or lying made by JJ below...
It isn't the "Smalltalk style". In the early days of open source taking off on the internet everyone thought their code was "self documenting". And that includes C and Perl programmers!
And as I will address below, you are taking my comments to personally.
Saying we could use more documentation, is quite different than saying our practices are wrong, or we are lying, or fooling ourselves with false feeling of "self documenting code".
Documents mostly don't exist because there's no one writing them, this is after all an open source community and the people in the know are too busy writing code.
The entire community, I'm sure, is open to accepting any documentation anyone feels like writing, including JJ. But in a fast moving development effort, like Squeak, Seaside, and many other projects I'm sure, there's always going to be a lack of documentation, that's just life.
This isn't some big commercial framework where you can point a finger and say hey, you should have written more documents. Those kind of documents will naturally evolve as the frameworks settle down and start being used more, but don't insult the authors of such frameworks by calling them liars, seriously, be grateful those guys are writing cool stuff for us to use, worry about documents later.
You take what I said too personally. I'm not calling *you*, or Luckas or any of the great developers here liars. I am attacking this rediculous concept of "self documenting code". It became popular with the free software crowd early on, but when free software companies desided to start making money, or when project leaders wanted to hand off the project they relized the invalidity of the concept.
And good, smart people adopted this idea early on. Everyone was saying it, and, after all, does anyone *like* writing documentation? I would personally rather be designing or coding. This is the danger of the concept. We don't want to document anyway, so this is a way for us to even believe we are right in not doing it.
I did use strong language agaisnt the concept, but not as strong as some other people much more important then myself in much more public forums. I figured some people would take it personal and get offended (I actually thought a lot more would) and I wouldn't want that, but sometimes it takes strong wording to make someone notice that something is wrong.
Anyway, sorry for offending you. I am very greatful for all the work you and everyone else has done.
It isn't the "Smalltalk style". In the early days of open source taking
I disagree, I think it is the Smalltalk style, maybe I'm wrong, but that's my opinion.
off on the internet everyone thought their code was "self documenting". And
that
includes C and Perl programmers!
You take what I said too personally. I'm not calling *you*, or Luckas or any of the great developers here liars. I am attacking this ridiculous concept of "self documenting code". It became popular with the free software crowd
That you are attacking anything, is what bothered me. You've used strong insulting language from the start, not against me personally, I take none of this personally, but against the self documenting style. You may not prefer this style, but many do, as we've developed a mistrust of documents not directly linked to code.
I did use strong language against the concept, but not as strong as some other people much more important then myself in much more public forums. I
You place great value on documents, OK, great, but not everyone does, no need to use such strong language. You can approach the subject of more documentation without being insulting to those who disagree with you. Rather than arguing "for" documentation, you seem to be arguing "against" less documentation, rather like a creationist arguing "against" evolution rather than "for" creationism.
figured some people would take it personal and get offended (I actually thought a lot more would) and I wouldn't want that, but sometimes it takes strong
wording
to make someone notice that something is wrong.
Anyway, sorry for offending you. I am very greatful for all the work you and everyone else has done.
Again, I'm not offended, my skin is much thicker than this, I'm simply disagreeing with how you approached the subject.
From: Ramon Leon ramonleon@cox.net Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Mon, 04 Sep 2006 19:40:15 -0700
That you are attacking anything, is what bothered me. You've used strong insulting language from the start, not against me personally, I take none of this personally, but against the self documenting style. You may not prefer this style, but many do, as we've developed a mistrust of documents not directly linked to code.
This cancerous, destructive idea of "self documenting code" is a big barrior to people new to the language, and I would be willing to bet that is the main reason it isn't taking off faster.
I can tell you I have done various projects in various languages to get a feel for it, and never before have I felt like I could do so much so fast, and yet not been able to do very much at all. Why? Because the state of documentation right now is almost impenetrable. Anything I do, I feel like it is probably already there in some system that I don't know about and have no way to find out about.
The main documentation right now, as far as I can tell, seems to be the mailing list.
"self documenting code" as a source of documentation is simply not valid. I am pretty surprised that such an obvious statement has so much resistance.
If source code is the documentation then the bar for becomming productive in the language is the amount of time it takes you to absorb the entire Smalltalk class heirarchy from the browser. And if you download a new system, then you have to read through every line of source code from that system. And that isn't enough, simply reading the code isn't enough. You have to wrap your brain around *why* it does what it does. Otherwise any change you do is probably not going to be helpful.
As an example, I downloaded 3.8 from the web site and started trying to run a cool 3d example I saw on one of the tutorials. Everything worked fine until I tried to bring up a viewer for my fish so I can make it move and stuff. It brought up a debugger because the "costume" message wasn't understood.
I took your advice and went all around trying to understand the code. In the end it looks like maybe the "WonderlandActor" class might have been a subclass of Morph at some point and isn't anymore. Maybe it changed to a composite patern. So I tried to see if there was a reference to something I could forward the message too. But I didn't see any morph's in his instance variables, so at this point what?
All I can do is post a message on a mailing list. I don't know who changed what or why, I don't know how it was suppost to work and I have no clue where I would look for some kind of documentation.
I spent at least an hour tracking through this and came up empty handed. That is bad enough for playing around, but in business that would mean not using what ever component it was and writing our own from scratch. And if we have to write everything from scrath then we are not getting the efficiencey from the language.
You place great value on documents, OK, great, but not everyone does, no need to use such strong language. You can approach the subject of more documentation without being insulting to those who disagree with you. Rather than arguing "for" documentation, you seem to be arguing "against" less documentation, rather like a creationist arguing "against" evolution rather than "for" creationism.
The arguments "for" documentation are obvious and I (and others) have stated them.
Smalltalk has some good momentum right now because of what various folks have done with Seaside and the subsystems based on it (Pier and co.). But momentum doesn't mean anything unless you can sucessfully turn it into something else before you lose it.
All the other languages will steal everything you have. Anything good, revolutionary, etc. will be recreated in those languages and then they don't feel the need for smalltalk anymore. It happened with Steve Jobs in the beginning, it happened with Java when it started and it will happen with Seaside eventually.
And I am not just throwing out insults, I intend to help fix the problem. But first the problem must be identified and acknoledged (no one will work to fix something they feel is not broken), then possible solutions have to be explored.
J J wrote:
This cancerous, destructive idea of "self documenting code" is a big barrior to people new to the language, and I would be willing to bet that is the main reason it isn't taking off faster.
+100
I can tell you I have done various projects in various languages to get a feel for it, and never before have I felt like I could do so much so fast, and yet not been able to do very much at all. Why? Because the state of documentation right now is almost impenetrable. Anything I do, I feel like it is probably already there in some system that I don't know about and have no way to find out about.
The main documentation right now, as far as I can tell, seems to be the mailing list.
"self documenting code" as a source of documentation is simply not valid. I am pretty surprised that such an obvious statement has so much resistance.
If source code is the documentation then the bar for becomming productive in the language is the amount of time it takes you to absorb the entire Smalltalk class heirarchy from the browser. And if you download a new system, then you have to read through every line of source code from that system. And that isn't enough, simply reading the code isn't enough. You have to wrap your brain around *why* it does what it does. Otherwise any change you do is probably not going to be helpful.
Any system that has not been documented may as well have not been written at all, and I said that on the seaside list years ago.
I myself looked at seaside right from the beginning and was never able to get my head around it. Actually it is not that difficult, but because of lack of documentation, I lost 2 years of possible using seaside. And on numerous occasions I have dropped using squeak for exactly the same reason. I might have spent 5 more years in the squeak camp if there were any documentation for morphic, but as yet I still cant get anything basic working to the standard that I would like.
Keith
___________________________________________________________ Try the all-new Yahoo! Mail. "The New Version is radically easier to use" The Wall Street Journal http://uk.docs.yahoo.com/nowyoucan.html
I myself looked at seaside right from the beginning and was never able to get my head around it. Actually it is not that difficult, but because of lack of documentation, I lost 2 years of possible using seaside. And on numerous occasions I have dropped using squeak for exactly the same reason. I might have spent 5 more years in the squeak camp if there were any documentation for morphic, but as yet I still cant get anything basic working to the standard that I would like.
But you can also help writing class comments or writing tests on what you learn. There is no magic and "you should write documentation" it does not work. I would love to have better documentation for Squeak but
From: stéphane ducasse ducasse@iam.unibe.ch Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Thoughts from an outsider Date: Tue, 5 Sep 2006 16:25:26 +0200
I myself looked at seaside right from the beginning and was never able to get my head around it. Actually it is not that difficult, but because of lack of documentation, I lost 2 years of possible using seaside. And on numerous occasions I have dropped using squeak for exactly the same reason. I might have spent 5 more years in the squeak camp if there were any documentation for morphic, but as yet I still cant get anything basic working to the standard that I would like.
But you can also help writing class comments or writing tests on what you learn. There is no magic and "you should write documentation" it does not work. I would love to have better documentation for Squeak but
Well, I was wondering if you guys had any kind of documentation team or project, but I guess if there was someone would have spoken up by now.
So is anyone interested in starting such a team? I will contribute what I can in my spare time. I know no one *wants* to write documentation, but it will be a good way to learn the systems.
So what we will need will is: 1) A main web site to host it on (can we use squeak.org for this? how does one get started adding documentation there?) 2) Some kind of reference manaul like this: http://caml.inria.fr/pub/docs/manual-ocaml/index.html (does something close exist already? I have been through many 'getting started guide's but most actually said 'not complete' before you got into the more compliated subjects like meta programming and meta classes) 3) A list of projects to document. I don't even know what is out there that people need to get work done. It seems to be so all over the place at the moment. 4) We are going to need some people that just sit on the various mailing lists and sumarize what is going on. If I am writing the documentation on Pier or Seaside, those things are moving targets. If I try to sit on the list and make changes for every announcement I wont ever release anything. So we need a person or persons to sit on the list and provide me or who ever is doing the documentation with a weekly or monthly, or whatever works, summary of what changes have happened so we can control it more.
And maybe someone else can think of more things. As a first cut I don't want to try to make UML diagrams or anything like that. Just getting some nice reference manuals out there in a central place that new people can find it will be a good first cut.
See what Simon have on http://joyful.com/JoyfulSystems.
Also exists http://www.xs4all.nl/~maartens/ , look for Squeak
The principal site, something unorganized , is http://minnow.cc.gatech.edu/squeak/
Also exists a great number of specialized sites with his own "community"
When you have "Squeak for dummies" or "Learn Squeak in ten days" book what lets you meet the beautiful ladies Fame and Fortune, send notice to this list. :=)
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
I relize there is a possibility to write a book on all this and maybe get rich, but I would rather write the book for free, make smalltalk more well known/lucrative and then write 10 books to get rich off of. :)
From: "Lic. Edgar J. De Cleene" edgardec2001@yahoo.com.ar Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: squeakdev squeak-dev@lists.squeakfoundation.org Subject: Re: Documentation project (was: Thoughts from an outsider) Date: Tue, 05 Sep 2006 16:41:47 -0300
See what Simon have on http://joyful.com/JoyfulSystems.
Also exists http://www.xs4all.nl/~maartens/ , look for Squeak
The principal site, something unorganized , is http://minnow.cc.gatech.edu/squeak/
Also exists a great number of specialized sites with his own "community"
When you have "Squeak for dummies" or "Learn Squeak in ten days" book what lets you meet the beautiful ladies Fame and Fortune, send notice to this list. :=)
Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
On 5-Sep-06, at 1:06 PM, J J wrote:
I relize there is a possibility to write a book on all this and maybe get rich, but I would rather write the book for free, make smalltalk more well known/ lucrative and then write 10 books to get rich off of. :)
We-ell, writing a book on squeak doesn't seem to be a particularly good way to get rich. Been there (at least in part, a group of us collaboratively wrote the 'nu-blu' book) got the $200 cheque.... I had much more success getting rich writing Smalltalk than writing about Smalltalk.
The key problem with any sort of traditional doc for a system like Squeak is that by the time you have written the outline it is so out of date that you have no chance of ever catching up. This is why I'd like to see some sort of image based doc-tool; at least it would have some hope of being up to date. I *don't* think that merely aggregating class and method comments is anywhere near enough. Nor do I know exactly what *would* be enough, sadly. I am pretty sure that it needs to combine a way of presenting the raison d'être of the code, the reasoning behind the design, the known limits and tradeoffs and invariants expected and the tests, examples, demos and even the method and class commentary.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: HSJ: Hop, Skip and Jump
From: tim Rowledge tim@rowledge.org Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Documentation project (was: Thoughts from an outsider) Date: Tue, 5 Sep 2006 13:20:18 -0700
The key problem with any sort of traditional doc for a system like Squeak is that by the time you have written the outline it is so out of date that you have no chance of ever catching up. This is why I'd like to see some sort of image based doc-tool; at least it would have some hope of being up to date. I *don't* think that merely aggregating class and method comments is anywhere near enough. Nor do I know exactly what *would* be enough, sadly. I am pretty sure that it needs to combine a way of presenting the raison d'être of the code, the reasoning behind the design, the known limits and tradeoffs and invariants expected and the tests, examples, demos and even the method and class commentary.
I know that is true for some of the projects, but all of squeak? It seems to me like squeak, while moving, is stable.
And I think smalltalk should do to everyone else what they have done to smalltalk for so long. We should steal vigorously from them. :) There are lots of great documents out there on many other languages. I plan to use those documents as a template of what works and what people expect. So that way I don't have to come up with the outline from scratch, and that traditionally is what takes me the most time. :)
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: HSJ: Hop, Skip and Jump
Oh, and thank you for the leads, I will look into it first thing in the morning.
Any more information out there? And anyone else interested in helping write this stuff? People new to smalltalk would be the best for this probably, since this lets us make a very big contribution fairly quickly.
From: "Lic. Edgar J. De Cleene" edgardec2001@yahoo.com.ar Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: squeakdev squeak-dev@lists.squeakfoundation.org Subject: Re: Documentation project (was: Thoughts from an outsider) Date: Tue, 05 Sep 2006 16:41:47 -0300
See what Simon have on http://joyful.com/JoyfulSystems.
Also exists http://www.xs4all.nl/~maartens/ , look for Squeak
The principal site, something unorganized , is http://minnow.cc.gatech.edu/squeak/
Also exists a great number of specialized sites with his own "community"
When you have "Squeak for dummies" or "Learn Squeak in ten days" book what lets you meet the beautiful ladies Fame and Fortune, send notice to this list. :=)
Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
J J puso en su mail :
People new to smalltalk would be the best for this probably, since this lets us make a very big contribution fairly quickly.
If you could find a Spanish speaking person , (a child is better), we have some begginners info and site in: http://ar.groups.yahoo.com/group/squeakRos/ (Group) http://wiki.gnulinex.org/squeakros (Swiki in Spain) http://ar.geocities.com/edgardec2001/Welcome.html (Beginners tutorials , most in Spanish) ftp://elpelotero@201-212-99-13.cab.prima.net.ar/ password: elpelotero (on approximate 09:00 to 20:00 GMT, dig and take what you like, at your own risk)
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
I intend to learn spanish some day. But let me get german down first. :)
And I want to get all the documentation centralized in one place so everyone can find it. It would be great if a spanish speaker went to squeak and they just automatically see all those spanish documents by default. But of course they need to be on the main site too for all the multi-lingual people.
From: "Lic. Edgar J. De Cleene" edgardec2001@yahoo.com.ar Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: squeakdev squeak-dev@lists.squeakfoundation.org Subject: Re: Documentation project (was: Thoughts from an outsider) Date: Tue, 05 Sep 2006 20:36:17 -0300
J J puso en su mail :
People new to smalltalk would be the best for this probably, since this lets us make a very big contribution fairly quickly.
If you could find a Spanish speaking person , (a child is better), we have some begginners info and site in: http://ar.groups.yahoo.com/group/squeakRos/ (Group) http://wiki.gnulinex.org/squeakros (Swiki in Spain) http://ar.geocities.com/edgardec2001/Welcome.html (Beginners tutorials , most in Spanish) ftp://elpelotero@201-212-99-13.cab.prima.net.ar/ password: elpelotero (on approximate 09:00 to 20:00 GMT, dig and take what you like, at your own risk)
Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
J J puso en su mail :
I intend to learn spanish some day. But let me get german down first. :)
Ich kann keine Deutsche, but could learn if have time :=)
And I want to get all the documentation centralized in one place so everyone can find it. It would be great if a spanish speaker went to squeak and they just automatically see all those spanish documents by default. But of course they need to be on the main site too for all the multi-lingual people.
And what is that site ? I could use any web space as I build my SqueakLight images and still don't could have it in a 24/24 place somewhere.
The centralized site now is minnow, on that site all people could put tutorials, news, etc. But regular swiki have some little troubles
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
Ich kann kein Deutsch, aber ich könnte es lernen, wenn ich Zeit habe. :) I think thats it anyway. Should be easy for you, the grammer is like a programming language spec. :)
I am thinking squeak.org is the place to set up shop. But no one answered me yet how to get started and I haven't had time to dig yet but that is what I am thinking at the moment.
From: "Lic. Edgar J. De Cleene" edgardec2001@yahoo.com.ar Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: squeakdev squeak-dev@lists.squeakfoundation.org Subject: Re: Dokumentation Project (was: Thoughts from an outsider) Date: Wed, 06 Sep 2006 07:05:13 -0300
J J puso en su mail :
I intend to learn spanish some day. But let me get german down first.
:)
Ich kann keine Deutsche, but could learn if have time :=)
And I want to get all the documentation centralized in one place so
everyone
can find it. It would be great if a spanish speaker went to squeak and
they
just automatically see all those spanish documents by default. But of course they need to be on the main site too for all the multi-lingual people.
And what is that site ? I could use any web space as I build my SqueakLight images and still don't could have it in a 24/24 place somewhere.
The centralized site now is minnow, on that site all people could put tutorials, news, etc. But regular swiki have some little troubles
Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
Klaus,
I don't seem to be able to send you emails from here. But I wanted to say thanks. And you brought up a good point:
We will also need documentation reviewers to make sure the doc we write is correct and promoting best practices. It looks like I have one volenteer. Anyone else? :)
From: "J J" azreal1977@hotmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: squeak-dev@lists.squeakfoundation.org Subject: Re: Documentation project (was: Thoughts from an outsider) Date: Tue, 05 Sep 2006 20:21:56 +0000
Oh, and thank you for the leads, I will look into it first thing in the morning.
Any more information out there? And anyone else interested in helping write this stuff? People new to smalltalk would be the best for this probably, since this lets us make a very big contribution fairly quickly.
From: "Lic. Edgar J. De Cleene" edgardec2001@yahoo.com.ar Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: squeakdev squeak-dev@lists.squeakfoundation.org Subject: Re: Documentation project (was: Thoughts from an outsider) Date: Tue, 05 Sep 2006 16:41:47 -0300
See what Simon have on http://joyful.com/JoyfulSystems.
Also exists http://www.xs4all.nl/~maartens/ , look for Squeak
The principal site, something unorganized , is http://minnow.cc.gatech.edu/squeak/
Also exists a great number of specialized sites with his own "community"
When you have "Squeak for dummies" or "Learn Squeak in ten days" book what lets you meet the beautiful ladies Fame and Fortune, send notice to this list. :=)
Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
On Wed, 06 Sep 2006 08:57:02 +0200, J J wrote:
Klaus,
I don't seem to be able to send you emails from here. But I wanted to say thanks. And you brought up a good point:
We will also need documentation reviewers to make sure the doc we write is correct and promoting best practices. It looks like I have one volenteer. Anyone else? :)
Perhaps this lady wants to be employed for a documentation project
- http://sophieproject.org/intro.pdf
/Klaus
Klaus D. Witzel puso en su mail :
Perhaps this lady wants to be employed for a documentation project
/Klaus
Congratulations by outstanding work, but...
That opera singer lady (67,8 Mb) should be accessible to all.
And the most important, all wizards working on it should finish and continue transfer vital technology breakups to "rest of us" , as Mac add say a long time ago.
Regards
Edgar
__________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
This cancerous, destructive idea of "self documenting code" is a big barrior to people new to the language, and I would be willing to bet that is the main reason it isn't taking off faster.
Dude, seriously, chill with the negative language, it isn't cancerous, stop insulting the other side. You can ask for more docs without being insulting.
I can tell you I have done various projects in various languages to get a feel for it, and never before have I felt like I could do so much so fast, and yet not been able to do very much at all. Why? Because the state of documentation right now is almost impenetrable. Anything I do, I feel like it is probably already there in some system that I don't know about and have no way to find out about.
OK, I get it, you aren't comfortable with Smalltalk as a self documenting system. There are other places to get info, try the Swiki http://minnow.cc.gatech.edu/Squeak, or any of the various mailing lists.
The main documentation right now, as far as I can tell, seems to be the mailing list.
"self documenting code" as a source of documentation is simply not valid. I am pretty surprised that such an obvious statement has so much resistance.
It is valid, you just don't like it, or don't get it. OK, just because it doesn't work well for you doesn't mean it doesn't work well for others. As far as I'm concerned Squeak is the best documented system I've ever seen, because I read the Class Name, methods names, browse example code, read the unit tests, ask a question or two on a mailing list if I'm stuck, and away I go. I find it far easier to learn how to do something new in squeak than in say .Net, or Ruby, where I don't have easy access to the code directly from the development environment.
If source code is the documentation then the bar for becomming productive in the language is the amount of time it takes you to absorb the entire Smalltalk class heirarchy from the browser. And if you download a new system, then you have to read through every line of source code from that system. And that isn't enough, simply reading the code isn't enough. You have to wrap your brain around *why* it does what it does. Otherwise any change you do is probably not going to be helpful.
Yes, you have to grasp the basics of the Smalltalk class hierarchy, once, but once you get it, you'll get very productive very fast. It's not like you have to do this for each program.
As an example, I downloaded 3.8 from the web site and started trying to run a cool 3d example I saw on one of the tutorials. Everything worked fine until I tried to bring up a viewer for my fish so I can make it move and stuff. It brought up a debugger because the "costume" message wasn't understood.
I took your advice and went all around trying to understand the code. In the end it looks like maybe the "WonderlandActor" class might have been a subclass of Morph at some point and isn't anymore. Maybe it changed to a composite patern. So I tried to see if there was a reference to something I could forward the message too. But I didn't see any morph's in his instance variables, so at this point what?
All I can do is post a message on a mailing list. I don't know who changed what or why, I don't know how it was suppost to work and I have no clue where I would look for some kind of documentation.
Yes, this happens, but documentation won't help this, this is more likely you bumping into a bug, all this code is so Alpha this happens all the time. Yes it's frustrating, but this is the kind of thing the mailing lists are for. Buggy code isn't exactly newbie friendly, I do sympathize.
I spent at least an hour tracking through this and came up empty handed. That is bad enough for playing around, but in business that would mean not using what ever component it was and writing our own from scratch. And if we have to write everything from scrath then we are not getting the efficiency from the language.
In business, I doubt you'd be using Morphic, Morphic is an experimental system, hardly anything I'd be writing biz apps with. Squeak's main use for biz system's, I'd think, would be web apps, where Seaside is useful. For desktop apps, Squeak isn't what you need, Visual Works or Dolphin would be more appropriate.
Smalltalk has some good momentum right now because of what various folks have done with Seaside and the subsystems based on it (Pier and co.). But momentum doesn't mean anything unless you can sucessfully turn it into something else before you lose it.
All the other languages will steal everything you have.
Great, as Ruby has shown, stealing from Smalltalk works, and makes everyone's life easier, and brings more interest to the Smalltalk community. I'm not worried about Smalltalk's future, it looks quite solid to me, it was good enough to hook me in a very short time, I'm sure it'll be the same for many others.
Anything good, revolutionary, etc. will be recreated in those languages and then they don't feel the need for Smalltalk anymore. It happened with Steve Jobs in the beginning, it happened with Java when it started and it will happen with Seaside eventually.
And I am not just throwing out insults, I intend to help fix the problem. But first the problem must be identified and acknowledged (no one will work to fix something they feel is not broken), then possible solutions have to be explored.
Great, I'd rather see people contributing, you don't need to convince everyone that something is broke, you simply need to get like minded people to help your cause. You could probably do this better by not using negative language (cancer, lying, fooling ourselves) and insulting those who disagree.
From: "Ramon Leon" ramon.leon@allresnet.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "'The general-purpose Squeak developers list'"squeak-dev@lists.squeakfoundation.org Subject: RE: Thoughts from an outsider Date: Tue, 5 Sep 2006 09:27:48 -0700
Great, I'd rather see people contributing, you don't need to convince everyone that something is broke, you simply need to get like minded people to help your cause. You could probably do this better by not using negative language (cancer, lying, fooling ourselves) and insulting those who disagree.
I have been insulting false ideas, not people. It seems to me that you have been the one bringing out the "well Im sure it's not friendly to newbies", and "you just dont get it".
Anyway, this is a pointless discussion. I appologize to the list for carrying it on so long.
Source code in smalltalk, just as in the free software world does document exactly what is happening. But that is all. It is certainly not what the vast majority of developers and users are looking for when they want documentation.
Hi!
Rich Warren rwmlist@gmail.com wrote: [SNIP]
You could argue that, for Smalltalk, the idea of a DSL is a bit strange, since it involves moving some of the code outside the image. Especially in Squeak, since (as far as I know) you have to leave the squeak environment to edit arbitrary text files.
No, you do not need to leave Squeak for that. Filelist and friends edits files. But writing Smalltalk code in a file from within Squeak is definitely an odd way of doing it, unless you have a specific goal doing that.
"The Ruby guy wanted a little more, he wanted a certain syntax."
I'm not entirely sure what this means. I think he means I wanted a specific, non-smalltalk syntax. That's not really true. I'll probably implement my DSL using a pure smalltalk syntax (or smalltalk with minimal text processing). It's close enough for me. However, someone did ask what my ideal syntax would be--and so the thread went off on that tangent.
In general, yes. The advice to utilize Smalltalk syntax directly is good. That is what I had planned to do from the start. Originally I was trying to find examples of how others had used Smalltalk syntax to do this sort of parsing. I was hoping to learn a few tricks and tips by looking at other implementations.
Eh, "utilize Smalltalk syntax" (and not actually *use* the available Compiler) seems less useful. I mean, if you want Smalltalk syntax - why not use *Smalltalk* and not just the syntax? Use the Compiler that we already have and that is battle proven etc.
"However, creating good languages is not easy, and few people can do it. I think that is the limiting factor in DSLs."
This is definitely true if you're trying to create a Turing Complete language for general programming. However, most DSLs are not Turing Complete. They are small, focused, little things. They do one thing, and they do it as simply and cleanly as possible. As a result, they are not typically very hard to write.
Here's an example of what I'm talking about. I'm about to implement a neural net. I'll be experimenting with many different sizes and topographies. This is an excellent opportunity for a DSL. I could create several net-building scripts that are then loaded and interpreted by the main application. Then, if someone wanted a different topography, they could just write and load their own build script. I could even build an object to automatically write out build script permutations. The scripts themselves act as both source code and log.
And if *I* would do it I would just use Smalltalk. :) IMHO specific DSLs tend to get outgrown. They look simple from the beginning, and then you bang your head against the roof. And the effort to create them often (IMHO) does not pay off that much compared to "just use Smalltalk" (or Lisp etc).
In Gjallar we use Smalltalk as the "DSL" for defining the workflow graph for example, it looks simple enough for most readers AND we can easily do special things when we need to. And no time spent writing a custom, half buggy parser. :)
Thing is - it is fun to make languages and I think DSLs often are created just because it is fun to do it. Or you simply don't have a language where the parser/compiler is so readily available. I mean:
Compiler evaluate: '3+4'
regards, Göran
On Aug 29, 2006, at 10:34 PM, goran@krampe.se wrote:
But writing Smalltalk code in a file from within Squeak is definitely an odd way of doing it, unless you have a specific goal doing that.
You're not writing Smalltalk code in an external file, you're writing DSL code (text that happens to be interpreted and parsed as Smalltalk code). It's a subtile difference, but I think an important one.
And you might not write any code at all. You could be passing messages as strings between remote agents. You could be automatically parsing Unix log files. You might be scanning a text document for tags which will be automatically replaced with computer-generated content (for example, putting actual source code into an article about computer programming at the last minute, so you don't have to worry about copying-pasting and keeping things in sync as you edit both files).
Eh, "utilize Smalltalk syntax" (and not actually *use* the available Compiler) seems less useful. I mean, if you want Smalltalk syntax - why not use *Smalltalk* and not just the syntax? Use the Compiler that we already have and that is battle proven etc.
I'm not sure why I'm having so much trouble expressing myself on this.
Of course I'd use the compiler.
Compiler evaluate: 'some text from file'.
This is exactly what I'm talking about (and why people recommended using smalltalk syntax directly as opposed to creating my own syntax and building a parser).
Here's an example of what I'm talking about. I'm about to implement a neural net. I'll be experimenting with many different sizes and topographies. This is an excellent opportunity for a DSL. I could create several net-building scripts that are then loaded and interpreted by the main application. Then, if someone wanted a different topography, they could just write and load their own build script. I could even build an object to automatically write out build script permutations. The scripts themselves act as both source code and log.
And if *I* would do it I would just use Smalltalk. :) IMHO specific DSLs tend to get outgrown. They look simple from the beginning, and then you bang your head against the roof. And the effort to create them often (IMHO) does not pay off that much compared to "just use Smalltalk" (or Lisp etc).
That is certainly a valid option.
For something like this, planning a DSL can be a really helpful experiment. Even if I end up implementing it directly, I end up with a set of classes/methods that are cleaner and easier to use.
Also, who might use the DSL. If the end-users might want to modify the code, then it may be better as a DSL (unless the end-users are smalltalk programmers).
And DSLs can often serve dual purposes. A single source file might generate both code and documentation (or in my example, function as both executable code and as a log file). You can gain a lot by having a single, authoritative copy of the important information (provided you back up that copy, of course).
But, if you're not going to get anything out of it, just implement it directly.
In Gjallar we use Smalltalk as the "DSL" for defining the workflow graph for example, it looks simple enough for most readers AND we can easily do special things when we need to. And no time spent writing a custom, half buggy parser. :)
Again, I'm not talking about making a full parser. Maybe some light preprocessing of the input (maybe), but you should use Smalltalk for the heavy lifting, where possible.
Thing is - it is fun to make languages and I think DSLs often are created just because it is fun to do it. Or you simply don't have a language where the parser/compiler is so readily available. I mean:
Compiler evaluate: '3+4'
I really think we're talking about the same thing, just using different words. '3+4' is too trivial to be a DSL, but this could work:
run: 'name' trainingSet: 'training file name' testSet: 'test file name'
And, with the right classes (and preprocessing) it could be parsed and interpreted directly as code.
e.g.: Compiler evaluate: 'myClass ', lineFromFile.
There's no half-buggy complier. Smalltalk does (almost) all the work. And yet, this is exactly the type of DSL I have been talking about.
I hope I'm starting to make more sense.
-Rich-
Part of the problem is different people seem to have different interpretations of what a DSL is. In some definitions, any significantly complicated project becomes a DSL (or at least any well- written project).
This is the definition I think most of us have. We should be more explicit and call them embedded DSL.
Lispers write DSL's with macro's, bending lisp to the problem domain, but it's still valid Lisp. Smalltalker's write DSL's with blocks and Objects, also bending the language to the problem domain, but it's still valid Smalltalk. There's value in making a distinction between a DSL, and an embedded DSL, Lispers and Smalltalkers generally mean embedded DSL when they say DSL. They're talking about extending the language, as is, without changing it's syntax.
When I spoke about DSLs, I was particularly talking about reading in and evaluating text files.
I don't think that is a good definition of a DSL. Files are orthogonal to the issue of DSL or not DSL. You seemed hell bent on using a syntax that wasn't valid Smalltalk, and I understood you pretty much as Ralph did, and wondered, why? Yes, this is building a DSL, but it's building a custom DSL that requires parsing. While a valid approach, it's certainly not the easiest or most practical solution, which is all the Smalltalkers were getting at. Even if you did want to build a custom DSL, the practical approach would be to prototype it as an embedded DSL first, get it working, and then decide after that, if a custom syntax would be useful. Just my $.02
Though, sometimes part or all of a syntax of a language comes from other software applications or hardware devices that also represent the domain or work in the domain, which in turn, might be file bound.
It's the "make the text user readable/editable" that gives me pause. Having had a course in Linguistics, I know that the meanings we apply to these symbols are greatly subject to various interpretations and misinterpretations, especially when we begin to cross cultures and cross into non-roman native speakers... just as the same is true with body language across cultures. Quick, what's the most user recognizable body gesture for agile style updates? Or, letting someone know their performance has a social bug, that that they have a bug on them?
Your chosen language will make your users dependant on whatever device and software generates and manipulates that text. One syntax & use of white space might be better for manipulation by VI editors, another for eMacs editors, and another for Slickedit or something custom built, etc.
In reality any GUI is really a domain specific language but is almost never treated as such. It's just not a text language; it's a gesture language with a syntax and vocabulary of gestures and shapes.
My money would bet that the best use of time would be spent first learning what interface tools and applications the domain user must use, wants to use, likes to use, is open to your suggestions to distribute and use, and then make the domain language leverage the strengths of those tools in matching and manipulating the various aspects and features of the domain itself. If you have the opportunity to make or require a certain tool, then rather than find the *lowest* common denominator for all tools, you mould the interface to the domain. You can then customize the interface tool to match the various types of users ... graphical visual learners, auditory learners, kinesthetic learners, sequential learners, vector learners, "systems theory" learners, as well as text learners.
Regarding text, as an old, wise programmer once told me, "Nobody reads a 1,000 page report." Every interface and language (spoken or otherwise) is all about collapsing/folding/labeling the data for convenient transportation, manipulating, storage/remembering, and retrieval. Text alone just doesn't scale.
Cheers, Darius [|] Powered and Empowered by Smalltalk
On Aug 30, 2006, at 9:40 AM, Darius Clarke wrote:
Though, sometimes part or all of a syntax of a language comes from other software applications or hardware devices that also represent the domain or work in the domain, which in turn, might be file bound.
It's the "make the text user readable/editable" that gives me pause. Having had a course in Linguistics, I know that the meanings we apply to these symbols are greatly subject to various interpretations and misinterpretations, especially when we begin to cross cultures and cross into non-roman native speakers... just as the same is true with body language across cultures. Quick, what's the most user recognizable body gesture for agile style updates? Or, letting someone know their performance has a social bug, that that they have a bug on them?
It seems like you're taking what was originally a very simple idea and blowing it up to ridiculous proportions.
You're right. It is never possible to make any communication completely unambiguous. However, that doesn't mean we shouldn't try to make things as easy as reasonably possible on others.
To be sure, I wasn't talking about communicating with aliens from Mungus Prime. I wasn't even talking about cross cultural communication. I know the primary audience personally. It's a small group, and only one of them (other than me) is a programmer.
When I said I wanted to make the syntax easy to read, I simply meant that I wanted to avoid strange constructs and non-standard punctuation that is not part of English grammar. Words "like_this" or "likeThis" definitely fall into that category. I also want to remove any unnecessary words or punctuation. Boil it down to the simplest syntax that will do the job.
Again, I'm planning on running a large number of experiments on a computer model--each experiment will have different parameters and initial conditions. This will generate a lot of data. I want non- coding scientists to be able to look at the configuration file and understand that, "Oh, the data from run 16 was created using configuration XYZ". That's all. It doesn't need to be perfectly understandable. It just needs to be as readable as reasonably possible.
-Rich-
Hi Rich!
Trying to give concrete useful (possibly) advice, here are a few things:
- In Gjallar we have Q2Console and Q2CodeHolder that enable "silent" running of Squeak code and tries hard to do autocorrections etc as the live Squeak env does. There are quite a number of messages that needs to be handled in order to cover all bases, like autoadding local varnames not declared etc. etc.
- A useful pattern is to use blocks for "scripts" like: '[:customer :invoive | ', script, ']' and then call it with the arguments and explain to the user that he should use "customer" and "invoice" to refer to those (or whatever) objects in the script. This way you get a more clearly defined scope instead of just running the script "inside" a given domain object (and thus expose all instvars etc).
Then of course there are tons of nifty things you can do with actually building classes dynamically etc. :) And another trick is to subclass Parser and friends and hook into for example the logic for binding variables and so on. In my Namespaces implementation on SM there is a bit of such code that deals with resolving globals for example.
regards, Göran
Nice. I didn't see Gjallar on the squeak projects page or on the seaside site. Where are you advertised? :)
Also, do you think those two classes you mentioned could be used to make a squeak script front end? I mean, would it be possible to change some classes of how the image acts on start up to give arguments to classes like those and try to run them?
Thanks, J J
From: goran@krampe.se Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Info on Smalltalk DSLs or Metaprogramming... Date: Thu, 31 Aug 2006 11:06:40 +0200
Hi Rich!
Trying to give concrete useful (possibly) advice, here are a few things:
- In Gjallar we have Q2Console and Q2CodeHolder that enable "silent"
running of Squeak code and tries hard to do autocorrections etc as the live Squeak env does. There are quite a number of messages that needs to be handled in order to cover all bases, like autoadding local varnames not declared etc. etc.
- A useful pattern is to use blocks for "scripts" like: '[:customer
:invoive | ', script, ']' and then call it with the arguments and explain to the user that he should use "customer" and "invoice" to refer to those (or whatever) objects in the script. This way you get a more clearly defined scope instead of just running the script "inside" a given domain object (and thus expose all instvars etc).
Then of course there are tons of nifty things you can do with actually building classes dynamically etc. :) And another trick is to subclass Parser and friends and hook into for example the logic for binding variables and so on. In my Namespaces implementation on SM there is a bit of such code that deals with resolving globals for example.
regards, Göran
Hi!
"J J" azreal1977@hotmail.com wrote:
Nice. I didn't see Gjallar on the squeak projects page or on the seaside site. Where are you advertised? :)
Gjallar is an inhouse developed issue tracker that has recently been open sourced by the customer. I work as a consultant. The current web site is here:
http://swiki.krampe.se/gjallar
We haven't had time to "advertise" it yet. But it has been announced on squeak-dev a little while back.
The current release is strictly "developers only".
Also, do you think those two classes you mentioned could be used to make a squeak script front end? I mean, would it be possible to change some classes of how the image acts on start up to give arguments to classes like those and try to run them?
Possible indeed, rather simple I think - but I am not sure what is actually needed.
The basic mechanism of executing scripts using command line arguments is already present in the image and in the VM. I use it to "jump start" images on headless machines for example. Like a small script that fires up Seaside, sets some settings etc. It is a bit awkward to specify the file as a *correct* file URL, but it works.
But granted I am unsure how the current mechanism deals with syntax errors, undeclared vars, etc. Not sure what feedback you get - if any. :) So yes, that might be worth looking at - unless someone else has already done it. It is not the first time this "scriptability" thing has popped up.
And almost all other issues that have been extensively discussed the last few weeks on Squeak-dev have also been discussed on numerous occasions for the last 10 years. Yup, I am not kidding. And I am not trying to dissuade you all from pursuing these discussions by all means - but you might want to do some digging in archives. There is a LOT to be found there.
For example - the problem and ideas around documentation and a documentation team is a really well known "issue" in the Squeak community. There have been numerous attempts, numerous ideas (one example from me even called the Magic Book), numerous failures and also numerous small successes.
And if you search the Swiki you could find for example: http://minnow.cc.gatech.edu/squeak/3004 http://minnow.cc.gatech.edu/squeak/2997
Hmmm, but I really intended to talk about this in another post, sorry.
regards, Göran
Thanks very much for your honest response (i.e. not holding anything back).
(comments below)
Possible indeed, rather simple I think - but I am not sure what is actually needed.
The basic mechanism of executing scripts using command line arguments is already present in the image and in the VM. I use it to "jump start" images on headless machines for example. Like a small script that fires up Seaside, sets some settings etc. It is a bit awkward to specify the file as a *correct* file URL, but it works.
But granted I am unsure how the current mechanism deals with syntax errors, undeclared vars, etc. Not sure what feedback you get - if any. :) So yes, that might be worth looking at - unless someone else has already done it. It is not the first time this "scriptability" thing has popped up.
Well, I haven't noticed anyone saying they have done it yet (have seen different solutions on different platforms, but not something for squeak yet).
And almost all other issues that have been extensively discussed the last few weeks on Squeak-dev have also been discussed on numerous occasions for the last 10 years. Yup, I am not kidding. And I am not trying to dissuade you all from pursuing these discussions by all means
- but you might want to do some digging in archives. There is a LOT to
be found there.
I am not surprised at all. I know you guys have been working hard for the whole time. But maybe today something will be different to make it work. Or maybe the approach this time can be different enough to work.
For example - the problem and ideas around documentation and a documentation team is a really well known "issue" in the Squeak community. There have been numerous attempts, numerous ideas (one example from me even called the Magic Book), numerous failures and also numerous small successes.
But how many of these have not worked because the scope was too big? I used to work with a guy in america who was a great programmer and a very bright man. But if you wanted a project from him it was going to take months or years. Requirements always change and he just wouldn't release anything that didn't do everything the customer wanted. For a constantly changing definition of "everything".
I think if the initial try is modest, just a quick cut to get us better then we are right now, and then move from there it would have a chance.
But I just really think this *has* to get fixed if smalltalk is to go where it belongs.
Where does smalltalk get the next generation of developers? College? Unfortunatly no. College has the same financial responsibilities as everyone else. The companies that donate money to them want people who know <insert fad language>, not some language they don't know. The studends want to learn <insert fad language> because most are there to get good paying jobs. To get college to start teaching more smalltalk, more companies have to use it. *Lots* more companies then are using it right now.
Kids? I appreciate the work that has gone on in this area for sure. But this isn't how smalltalk is going to get the next generation of developers. These kids will play with it, enjoy it, then grow up, go to college and if they even do some CS related degree they are going to be learning <insert fad language> because (a) that's what's taught and (b) that's what pays.
The place smalltalk gets it's new developers is the place everyone gets them: mostly from the existing base of developers. But if you want to get people from the existing base then they have to see that this language is going to help them get their work done.
This is why so many people switched from Perl to Ruby and Python. It was a familiar world but without all the badness of the world they currently lived in.
I am not saying smalltalk needs to turn into java, certainly not. But there need to be some things that java people recognize. Like documentation in a form they expect. And maybe a simple script interface for people comming from that side of the house.
I relize it has been tried before. But I think it has to be tried again until it works. :)
The place smalltalk gets it's new developers is the place everyone gets them: mostly from the existing base of developers. But if you want to get
True
people from the existing base then they have to see that this language is going to help them get their work done.
And they are, Squeak is growing well.
This is why so many people switched from Perl to Ruby and Python. It was a familiar world but without all the badness of the world they currently lived in.
And Ruby draws attention to Smalltalk, since it's heavily influenced by Smalltalk.
I am not saying smalltalk needs to turn into java, certainly not. But there need to be some things that java people recognize. Like documentation in a form they expect. And maybe a simple script interface for people comming from that side of the house.
Nah, the Java developers are running in droves to Ruby, great, it'll acclimate them to Smalltalk, Ruby is after all Smalltalk lite. You can't be a Ruby programmer, and not hear of Smalltalk, it's only natural to check it out.
I relize it has been tried before. But I think it has to be tried again until it works. :)
You assume it isn't working now, but it is, Seaside's bringing many a new developer to Smalltalk, myself included. Watch the lists, there's plenty of new developers popping up all the time.
From: "Ramon Leon" ramon.leon@allresnet.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: "'The general-purpose Squeak developers list'"squeak-dev@lists.squeakfoundation.org Subject: RE: Info on Smalltalk DSLs or Metaprogramming... Date: Wed, 6 Sep 2006 14:12:29 -0700
I relize it has been tried before. But I think it has to be tried again until it works. :)
You assume it isn't working now, but it is, Seaside's bringing many a new developer to Smalltalk, myself included. Watch the lists, there's plenty of new developers popping up all the time.
Maybe. Or maybe this is momentum which will fade in time if it isn't turned into something else. Seaside is bringing them here, that is 100% right. But how many are looking around at all the cool things in the 3.8 image but can't get anything to work and can't find documentation to do anything?
At some point the other languages will have seaside completely duplicated. If you haven't gotten a permanent increase in body count by the time that happens then your chance is over until the Avi, Luckas and co. come up with the next killer app.
Maybe. Or maybe this is momentum which will fade in time if it isn't turned into something else. Seaside is bringing them here, that is 100% right. But how many are looking around at all the cool things in the 3.8 image but can't get anything to work and can't find documentation to do anything?
I prefer to be an optimist, I've been studying and learning Smalltalk for about 3 years now, and I've seen nothing but growth in the community. I have no reason to fear that will change.
At some point the other languages will have seaside completely duplicated.
Not likely, if it were so easy to do, Smalltalk wouldn't have been chosen as the implementation language. I believe Ruby was Avi's initial choice, but he ran into problems with it's continuations (I could be wrong). And most languages don't even have continuations, they aren't suitable to do this.
If you haven't gotten a permanent increase in body count by the time that happens then your chance is over until the Avi, Lukas and co. come up with the next killer app.
Smalltalk has nothing to fear from other languages, seriously, they can't be everything Smalltalk is without becoming Smalltalk, and none of them are even close at the moment. Smalltalk is much more than just a language, it's an environment, something those other languages haven't figured out yet, Lisp excluded.
On Sep 6, 2006, at 3:14 PM, Ramon Leon wrote:
Maybe. Or maybe this is momentum which will fade in time if it isn't turned into something else. Seaside is bringing them here, that is 100% right. But how many are looking around at all the cool things in the 3.8 image but can't get anything to work and can't find documentation to do anything?
I prefer to be an optimist, I've been studying and learning Smalltalk for about 3 years now, and I've seen nothing but growth in the community. I have no reason to fear that will change.
At some point the other languages will have seaside completely duplicated.
Not likely, if it were so easy to do, Smalltalk wouldn't have been chosen as the implementation language. I believe Ruby was Avi's initial choice, but he ran into problems with it's continuations (I could be wrong).
I wrote something about that history here: http://smallthought.com/avi/?p=4
Seaside itself could probably be duplicated on another platform (especially on Ruby), but then, you wouldn't have Smalltalk - and to a large degree I see Seaside as a (good) way to write web applications in Smalltalk, not Smalltalk as a way to support Seaside.
Avi
Not sure why I missed Ramon's email, but I will respond to both below.
From: Avi Bryant avi.bryant@gmail.com Reply-To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org To: The general-purpose Squeak developers listsqueak-dev@lists.squeakfoundation.org Subject: Re: Info on Smalltalk DSLs or Metaprogramming... Date: Wed, 6 Sep 2006 15:21:41 -0700
On Sep 6, 2006, at 3:14 PM, Ramon Leon wrote:
I prefer to be an optimist, I've been studying and learning Smalltalk for about 3 years now, and I've seen nothing but growth in the community. I have no reason to fear that will change.
M.C. Hammer was an optimist too, he had been sucessful for a few years, and he had seen nothing but growth in his bank account. He had no reason to fear that it would change. But it did.
Not likely, if it were so easy to do, Smalltalk wouldn't have been chosen as the implementation language. I believe Ruby was Avi's initial choice, but he ran into problems with it's continuations (I could be wrong).
I didn't say it was going to be easy to do. But it can and will be done. It's being worked on right now.
I wrote something about that history here: http://smallthought.com/avi/?p=4
Seaside itself could probably be duplicated on another platform (especially on Ruby), but then, you wouldn't have Smalltalk - and to a large degree I see Seaside as a (good) way to write web applications in Smalltalk, not Smalltalk as a way to support Seaside.
Avi
Thanks for that Avi.
I think Ramon is overlooking the general populations dislike of change. When ever someone sees seaside, and gets what is really cool about it, the first thing 99% of them will do is look to see if something like that exists (or is being worked on) in their favorite language. If it is, most of them wont look any further.
I'm an optimist too, when my bases are covered. But if major bases are *not* covered then any cofidence in sucess is not optimism. It's naiveness.
On Aug 30, 2006, at 7:39 AM, Ramon Leon wrote:
Part of the problem is different people seem to have different interpretations of what a DSL is. In some definitions, any significantly complicated project becomes a DSL (or at least any well- written project).
This is the definition I think most of us have. We should be more explicit and call them embedded DSL.
As I understand it, the term embedded DSL already refers to DSLs that are created by bending the syntax of an existing language--basically making a new language from building blocks of an old language. The other sort (external DSL) is where you use yaCC or smaCC or something similar to build actual parsers/compilers.
Based on these definitions, I have always been talking about creating an embedded DSL. Yes, people keep recommending that I create an embedded DSL. Yes, this is good advice. Yes, this is what I plan on doing. For some reason, I keep getting replies that suggest that I'm resisting this advice, and that I'm bounding off to create a full parser. I'm a little bit confused by this.
Originally I had asked if anyone had samples or tutorials on creating embedded DSLs using Smalltalk. I've built them in Ruby and Lisp. Especially in Ruby, there are some useful tricks in manipulating (some might say abusing) the language to provide a desired syntax for your DSL. I was hoping to pick up similar tricks for Smalltalk.
I think the discussion got off track because people asked me a few questions (What would your ideal syntax be? Why do you think ruby syntax might be better for DSLs?) and I tried to answer them. I probably should have changed the subject line or something. So, when answering a question, I might have said, "I'd like to be able to do something like XYZ", but that didn't mean I wanted to go out and actually implement XYZ. I was simply answering a hypothetical question.
I'm still interested in an embedded DSL.
However, I'm not convinced that simply altering an existing language so it is closer to the domain should count as a DSL. Some people count it--but to me it seems like that's just programming. C's functions, OOPs objects and Lisp's macros all serve the same basic function--they allow you to define additions to the language to more- closely model your domain. Where do we draw the line between programming and DSLs?
When I spoke about DSLs, I was particularly talking about reading in and evaluating text files.
I don't think that is a good definition of a DSL. Files are orthogonal to the issue of DSL or not DSL.
I don't think I meant for this to become a universal definition of DSLs. Rather, I think I was trying to explain what I had meant by DSL in my earlier posts.
Still, to return to my previous question, where do we draw the line? For me (and this is strictly a personal definition, don't feel obligated to adopt it), a DSL must be able to interpret code that was not part of the original application (support files that ship with the application, like configuration files, are OK). I'm talking about raw strings that have not been previously compiled. A DSL evaluates these strings on the fly.
The code in question could come from a file, could be entered interactively at the command line, or could be sent across the network. It really doesn't matter where it comes from. The important thing is, in some way the code is external to the executable.
Why do I like this definition? For me, there are very practical reasons. Creating a system to evaluate external strings is more complicated than simply writing an object or macro. There are the obvious IO issues. More importantly, you need to decide whether you're looking at each line as a separate command, or whether you're dealing with the entire string as a single chunk. Strings can be interpreted as new objects and method calls, as method calls on a given object inside your code, or as numerous other possible variations.
Also, this definition seems to match closely with the discussion on "Domain Languages" in the Pragmatic Programmer book--which has been my initial source for all things DSL.
You seemed hell bent on using a syntax that wasn't valid Smalltalk, and I understood you pretty much as Ralph did, and wondered, why? Yes, this is building a DSL, but it's building a custom DSL that requires parsing.
I don't think I'm hell-bent on anything. I'm sorry if I gave you that impression.
I also don't think I ever suggested anything that would required a parser (except possibly as an answer to a "what would your ideal syntax be?" style question). Some of my suggestions did use trivial pre-processing of the text. But, no. I don't want to mess with parsers at this stage--probably never for this project.
While a valid approach, it's certainly not the easiest or most practical solution, which is all the Smalltalkers were getting at. Even if you did want to build a custom DSL, the practical approach would be to prototype it as an embedded DSL first, get it working, and then decide after that, if a custom syntax would be useful. Just my $.02
I agree with this. I've agreed with it every time it has come up (though I may not have commented on it directly--human nature, I guess. I tend to comment on things I disagree with). Still, this has been, is and will continue to be my plan.
Sorry to repeat myself, but I feel like I've tried to say this before--somehow the idea keeps getting lost under the cushions. Again, I think this is largely my fault--I should have separated the tangential conversations (e.g. the differences between Ruby and Smalltalk syntax as applied to DSLs in general) from the main point (what are the best practices for developing an embedded DSL to process externally provided strings in Smalltalk?).
I'll try to be clearer in the future.
-Rich-
As I understand it, the term embedded DSL already refers to DSLs that are created by bending the syntax of an existing language--basically making a new language from building blocks of an old language. The other sort (external DSL) is where you use yaCC or smaCC or something similar to build actual parsers/compilers.
Agreed.
Based on these definitions, I have always been talking about creating an embedded DSL. Yes, people keep recommending that I create an embedded DSL. Yes, this is good advice. Yes, this is what I plan on doing. For some reason, I keep getting replies that suggest that I'm resisting this advice, and that I'm bounding off to create a full parser. I'm a little bit confused by this.
Well, sorry if I misunderstood you, my apologies. It's just that with the talk about not liking : for arguments, or not wanting a receiver, and not wanting to quote strings and such, I was led to believe you didn't want an embedded DSL, that you wanted to parse your own special syntax.
I think the discussion got off track because people asked me a few questions (What would your ideal syntax be? Why do you think ruby syntax might be better for DSL's?) and I tried to answer them. I probably should have changed the subject line or something. So, when answering a question, I might have said, "I'd like to be able to do something like XYZ", but that didn't mean I wanted to go out and actually implement XYZ. I was simply answering a hypothetical question.
Ah!
I'm still interested in an embedded DSL. However, I'm not convinced that simply altering an existing language so it is closer to the domain should count as a DSL.
That's the very definition of DSL.
Some people count it--but to me it seems like that's just programming. C's functions, OOPs objects and Lisp's macros all serve the same basic function--they allow you to define additions to the language to more- closely model your domain. Where do we draw the line between programming and DSLs?
When I read the code, do I see C, or do I see lot's of stuff related to the problem domain. If reading Lisp, do I see lot's of cons, car, cdr, map, filter, or do I see something more domain specific. Some people program "in" the language, some people program "on" the language. It's all just programming, doing a DSL is just a style.
When I spoke about DSL's, I was particularly talking about
reading in
and evaluating text files.
I would consider that an interpreter, and an external DSL, not an embedded DSL, unless the text needed no preprocessing to evaluate. If you have to pre-process it first, it's an interpreter, and an external DSL.
Still, to return to my previous question, where do we draw the line? For me (and this is strictly a personal definition, don't feel obligated to adopt it), a DSL must be able to interpret code that was not part of the original application (support files that ship with the application, like configuration files, are OK). I'm talking about raw strings that have not been previously compiled. A DSL evaluates these strings on the fly.
Hmm, I think an interpreter evaluates strings on the fly, a DSL is just a description of the possible syntax, and is orthogonal to evaluation.
The code in question could come from a file, could be entered interactively at the command line, or could be sent across the network. It really doesn't matter where it comes from. The important thing is, in some way the code is external to the executable.
Again, I don't see this at all related to being a DSL. I could do this with the syntax of any language that supported some kind of eval function. Being a DSL is about syntax, not about where the code comes from.
Why do I like this definition? For me, there are very practical reasons. Creating a system to evaluate external strings is more complicated than simply writing an object or macro. There are the obvious IO issues. More importantly, you need to decide whether you're looking at each line as a separate command, or whether you're dealing with the entire string as a single chunk. Strings can be interpreted as new objects and method calls, as method calls on a given object inside your code, or as numerous other possible variations.
It seems your definition of DSL == my definition of interpreter, no wonder I misunderstand you so much.
Also, this definition seems to match closely with the discussion on "Domain Languages" in the Pragmatic Programmer book--which has been my initial source for all things DSL.
Unfortunately, I loaned my copy out and it seems to have disappeared. :(
Sorry to repeat myself, but I feel like I've tried to say this before--somehow the idea keeps getting lost under the cushions. Again, I think this is largely my fault--I should have separated the tangential conversations (e.g. the differences between Ruby and Smalltalk syntax as applied to DSL's in general) from the main point (what are the best practices for developing an embedded DSL to process externally provided strings in Smalltalk?).
I'll try to be clearer in the future.
-Rich-
No problem, happy to continue the discussion, I find it fascinating.
On Aug 31, 2006, at 6:08 AM, Ramon Leon wrote:
As I understand it, the term embedded DSL already refers to DSLs that are created by bending the syntax of an existing language--basically making a new language from building blocks of an old language. The other sort (external DSL) is where you use yaCC or smaCC or something similar to build actual parsers/compilers.
Agreed.
Just to argue with myself, I took another look at the Martin Fowler article (http://www.martinfowler.com/bliki/ DomainSpecificLanguage.html), where I first saw the embedded/external distinction. I thought it was crystal clear--but on reading it again, I'm not sure.
Does the embedded/external distinction just capture the no-parser/ parser division? Or is embedded DSL intended to mean something more like Paul Graham's Bottom-up programming (http://www.paulgraham.com/ progbot.html)? I had always assumed it was the no-parser/parser split. But the description is ambiguous. If this technique must be given a name, I prefer the name bottom-up programming.
I'm still interested in an embedded DSL. However, I'm not convinced that simply altering an existing language so it is closer to the domain should count as a DSL.
That's the very definition of DSL.
I don't like that definition. In my mind, simply moving a language closer to the problem domain is just basic software engineering (maybe that says a lot about my views on software engineering--and probably explains why I like Lisp/Ruby/Smalltalk so much).
Moving closer to the domain is necessary for a DSL, but it isn't sufficient.
Having thought about it more, here's the crux of the issue for me. To be a DSL it must be (first and foremost) a language in its own right. You must be able to distinguish it from the host GPL (general programming language). The DSL may not have a name, but it must be nameable. You must be able to point to a chunk of code and say, "This is written in BlahBlah".
Let's say programming fundamentalists capture me and force me to write applications in C. To survive such harsh conditions, I write an excellent library, RichBrillanceDSL. Now, I write the rest of the application using this library. To me, this doesn't count as a DSL. I'm not writing in RichBrillianceDSL, I'm still writing in C using RichBrillianceDSL.
On the other hand, if I'm making a Rails web page, and I write an RJS template, RJS is a domain specific language. It is clearly separate from the Ruby code used in the application's controller. The file has its own extension and everything.
To really pick at semantic nits, you shouldn't call bottom-up programming a DSL. Even though it's been highly tuned for a given domain, it is still (by definition) a general purpose language. The language is still turing complete, and you can still use it to solve any general problem (or at least any problem solvable with a GPL).
Of course, I think banishing all turing-complete languages from the ranks of DSLs is a bit of an over-reaction (after all, it may be possible to misuse an embedded DSL to execute arbitrary code--even if that wasn't the original intention), but I do think DSLs need the general sense of limited usefulness. A DSL should be highly focused. It should only be good at one thing.
The Pragmatic Programmer book has an interesting example:
They recommend creating a mini-language for the sole purpose of communicating with the client. Originally, this language will not be executable. It is just a simple way for the client to express their requirements.
However, once the specifications are in place, you could go the next step and turn the specifications into executable code.
That's very different from the bottom-up approach.
-Rich-
Does the embedded/external distinction just capture the no-parser/ parser division? Or is embedded DSL intended to mean something more like Paul Graham's Bottom-up programming (http://www.paulgraham.com/ progbot.html)? I had always assumed it was the no-parser/parser split. But the description is ambiguous. If this technique must be given a name, I prefer the name bottom-up programming.
I consider bottom up programming, and embedded DSL's the same thing.
I'm still interested in an embedded DSL. However, I'm not convinced that simply altering an
existing language
so it is closer to the domain should count as a DSL.
That's the very definition of DSL.
I don't like that definition. In my mind, simply moving a language closer to the problem domain is just basic software engineering (maybe that says a lot about my views on software engineering--and probably explains why I like Lisp/Ruby/Smalltalk so much).
It's not just basic software engineering, because most languages can't be moved closer to the problem domain. It's likely you like Lisp/Ruby/Smalltalk exactly because they can be, but that's why they're special. They can be used to build DSL's.
When I program in Csharp, VB, or Java, I find myself writing a lot of loops, many of them looking very similar, because these languages offer me no clean way to stop writing the same loops over and over. Yet in Lisp, Smalltalk, or Ruby, you do something a few times, get tired of doing it, extend the language with a new operator, and program with it.
If I add a bunch of stuff that makes the language really good at generating html, say a macro...
(html (:html (:head (:title "My Document")) (:body (:h1 "My Document") (:prin1 (get-universal-time)))))
Or abuse blocks for the same purpose...
SomeObject>>renderContentOn: html html head: [html title:'My Document']; body: [html heading: 'My Document'; text: DateAndTime now]
It is most certainly a DSL. It may also still be valid Lisp or Smalltalk, and still capable of being used as general programming language, but it's not being used that way. I can't do this in most languages. Most languages allow you to build libraries and api's, but not DSL's. I consider them embedded DSL's because they are still syntactically valid in their native languages and require no additional parsing.
Moving closer to the domain is necessary for a DSL, but it isn't sufficient.
Having thought about it more, here's the crux of the issue for me. To be a DSL it must be (first and foremost) a language in its own right. You must be able to distinguish it from the host GPL (general programming language). The DSL may not have a name, but it must be nameable. You must be able to point to a chunk of code and say, "This is written in BlahBlah".
Agreed, and even with embedded DSL's, you can generally do that.
Let's say programming fundamentalists capture me and force me to write applications in C. To survive such harsh conditions, I write an excellent library, RichBrillanceDSL. Now, I write the rest of the application using this library. To me, this doesn't count as a DSL. I'm not writing in RichBrillianceDSL, I'm still writing in C using RichBrillianceDSL.
Because it'll still look like C, a library by definition is not a DSL, you aren't extending C. However, if you did it with compiler macro's, I'd say it was a DSL.
On the other hand, if I'm making a Rails web page, and I write an RJS template, RJS is a domain specific language. It is clearly separate from the Ruby code used in the application's controller. The file has its own extension and everything.
That makes little difference from my point of view, files are orthogonal to the issue. But, you point being that the DSL is somehow separate from the main use of the language, ok, I get that, and in Smalltalk when using a DSL, they are generally also in separate methods from ordinary Smalltalk code. So there's a place to point and say "hey, that's written in So and So".
To really pick at semantic nits, you shouldn't call bottom-up programming a DSL. Even though it's been highly tuned for a given domain, it is still (by definition) a general purpose language. The language is still Turing complete, and you can still use it to solve any general problem (or at least any problem solvable with a GPL).
I disagree, as would most Lispers and Smalltalkers I imagine. Bottom up programming, where you enhance the language, I think has always been considered a DSL by those respective communities.
Of course, I think banishing all Turing-complete languages from the ranks of DSLs is a bit of an over-reaction (after all, it may be possible to misuse an embedded DSL to execute arbitrary code--even if that wasn't the original intention), but I do think DSLs need the general sense of limited usefulness. A DSL should be highly focused. It should only be good at one thing.
I think how a DSL "is" used, says more about it than how it "could" be used. Sure, embedded DSL's are still fully capable of doing everything the host language does, but I don't think that disqualifies them when they aren't used that way.
The Pragmatic Programmer book has an interesting example:
They recommend creating a mini-language for the sole purpose of communicating with the client. Originally, this language will not be executable. It is just a simple way for the client to express their requirements.
However, once the specifications are in place, you could go the next step and turn the specifications into executable code.
That's very different from the bottom-up approach.
-Rich-
As Fowler pointed out, they come from a Unix tradition of "little languages", they're mostly doing external DSL's, not internal or embedded DSL's. It's a different style, but not the only one.
On Sep 1, 2006, at 6:16 AM, Ramon Leon wrote:
Does the embedded/external distinction just capture the no-parser/ parser division? Or is embedded DSL intended to mean something more like Paul Graham's Bottom-up programming (http://www.paulgraham.com/ progbot.html)? I had always assumed it was the no-parser/parser split. But the description is ambiguous. If this technique must be given a name, I prefer the name bottom-up programming.
I consider bottom up programming, and embedded DSL's the same thing.
A lot of people do. However, I think there's a real benifit in distinguishing between the following:
a) DSL as Bottom-Up Programming using language features b) DSL as Bottom-up Programming using a full parser (and probably pre- processor) c) DSL to interpret external strings using features of the host language d) DSL to interpret external strings using a full parser.
The ability to process external strings (most often stored in files) is not entirely external to the DSL issue since:
a) The techniques used for bottom-up programming and for interpreting external strings can be significantly different.
b) bottom-up programming lets developers write code that is cleaner and easier to maintain. processing external strings can be used as a tool for developers; however, they are often used to allow end users to modify an application's behavior without opening and modifying the application directly.
Unfortunately, the term DSL seems to be used for all the above (and more), which really muddies any discussion. I see a fundamental difference (both in technique and in motivation) between bottom-up DSLs and interpreter DSLs. I wish common usage of the terms reflected that difference.
I'm still interested in an embedded DSL. However, I'm not convinced that simply altering an
existing language
so it is closer to the domain should count as a DSL.
That's the very definition of DSL.
I don't like that definition. In my mind, simply moving a language closer to the problem domain is just basic software engineering (maybe that says a lot about my views on software engineering--and probably explains why I like Lisp/Ruby/Smalltalk so much).
It's not just basic software engineering, because most languages can't be moved closer to the problem domain. It's likely you like Lisp/Ruby/Smalltalk exactly because they can be, but that's why they're special. They can be used to build DSL's.
When I program in Csharp, VB, or Java, I find myself writing a lot of loops, many of them looking very similar, because these languages offer me no clean way to stop writing the same loops over and over. Yet in Lisp, Smalltalk, or Ruby, you do something a few times, get tired of doing it, extend the language with a new operator, and program with it.
If I add a bunch of stuff that makes the language really good at generating html, say a macro...
(html (:html (:head (:title "My Document")) (:body (:h1 "My Document") (:prin1 (get-universal-time)))))
Or abuse blocks for the same purpose...
SomeObject>>renderContentOn: html html head: [html title:'My Document']; body: [html heading: 'My Document'; text: DateAndTime now]
We may have to agree to disagree. I just don't see this. Or at least, I don't see it the same way. The code snippets above are (to my eye) still Lisp and Smalltalk respectively.
It is possible to move any language closer to the domain. Admittedly, it is easier in some languages than in others. But, moving the language closer to the domain is still (to my eye) a basic part of software engineering, regardless of the language. It's just a matter of degrees.
Take C. There are two reasons we might define a function in C. First, we might want to capture and generalize a bit of code so that we can reuse it. Second, we might want to capture and label a bit of code to make reading the source code easier (even if we only use the function once). These are not mutually exclusive. The intersection (generalizing a bit of code for reuse AND to make the source easier to read) seems to be firmly in the realm of bottom-up programming.
Here's a Java html example (imagine your page is a subclass of an html class--you override content() to set the page's content.)
public void content(){
header( title("My Document));
body( heading("My Document), text( currentDateAndTime()) ); }
This seems as good as the Lisp/Smalltalk examples. Admittedly a C implementation would be much messier (we're limited to functions, structs, global variables and macros), but it still could be done.
html();
header(); title("My Document"); closeHeader();
body(); heading("My Document"); text(currentDateAndTime(); closeBody();
closeHtml();
Hmm. That's actually not too bad.
Admittedly, there are very few well written libraries for Java/C/etc. But that doesn't mean it can't (or shouldn't) be done.
-Rich-
I'm headed out the door, so I'll respond to the rest later, but..
Here's a Java html example (imagine your page is a subclass of an html class--you override content() to set the page's content.)
public void content(){
header( title("My Document));
body( heading("My Document), text( currentDateAndTime()) ); }
This seems as good as the Lisp/Smalltalk examples. Admittedly a C implementation would be much messier (we're limited to functions, structs, global variables and macros), but it still could be done.
While I'd consider this an embedded DSL, it's certainly not as good, because the question arises what can go in a body? How many args does body take, nesting function calls like that won't be able to represent the same hierarchical structure that html can represent, Lisp and Smalltalk can get around this with anonymous functions, I'm not sure this can.
html();
header(); title("My Document"); closeHeader();
body(); heading("My Document"); text(currentDateAndTime(); closeBody();
closeHtml();
Hmm. That's actually not too bad.
Admittedly, there are very few well written libraries for Java/C/etc. But that doesn't mean it can't (or shouldn't) be done.
-Rich-
And this is what you'd have to resort too, and also this actually is how it's actually done in .Net, open a tag, close a tag, exactly the thing I was saying made these languages bad at DSL's, they can't represent the semantics of html with their native syntax, they're missing anonymous functions. Ruby/Lisp/Smalltalk have a huge advantage here, they could express the html in a hierarchical fashion, building a nice usable DSL, which I think neither of these two are.
On Sep 1, 2006, at 1:09 PM, Ramon Leon wrote:
I'm headed out the door, so I'll respond to the rest later, but..
Here's a Java html example (imagine your page is a subclass of an html class--you override content() to set the page's content.)
public void content(){
header( title("My Document));
body( heading("My Document), text( currentDateAndTime()) ); }
This seems as good as the Lisp/Smalltalk examples. Admittedly a C implementation would be much messier (we're limited to functions, structs, global variables and macros), but it still could be done.
While I'd consider this an embedded DSL, it's certainly not as good, because the question arises what can go in a body? How many args does body take, nesting function calls like that won't be able to represent the same hierarchical structure that html can represent, Lisp and Smalltalk can get around this with anonymous functions, I'm not sure this can.
As an example, Body can take a variable number of Tag objects. Java methods can be defined to accept variable numbers of parameters, so this isn't a problem. Tag objects can also be nested inside other tags (allowing us to express complete html hierarchies). Alternatively, all tags (including body) could accept any objects-- and internally it calls toString() on the object. This would let you pass in a mixture of Tag objects and literal strings.
Given that, I don't see any difference between my nested calls in Java and your nested calls in Smalltalk.
While I fully admit that it's easier and cleaner to do bottom-up programming in dynamic languages, it is still possible (to some degree) to use these techniques in any language.
Any time you create a function, class or whatever, you are bringing the language closer to the problem domain. There's no distinguishable line between bottom-up programming and simply creating well- engineered classes and functions. Anyone can look at both ends of the spectrum and see that they look different--but that ignores how quickly things blur in the middle.
On the other hand, there is a sharp line between interpreted DSLs and regular programming. That's one of the reasons I prefer to use the term DSL strictly for interpreted DSLs. The term (when used that way) has a clear meaning.
-Rich-
As an example, Body can take a variable number of Tag objects. Java methods can be defined to accept variable numbers of parameters, so this isn't a problem. Tag objects can also be nested inside other tags (allowing us to express complete html hierarchies). Alternatively, all tags (including body) could accept any objects-- and internally it calls toString() on the object. This would let you pass in a mixture of Tag objects and literal strings.
True, that would seem to work, but only with the addition saying all setters return "this", so properties of those objects can be set in every possible combination, inline, equivalent to Smalltalk's ; operator. I've done this in the past, it's ugly, and non idiomatic, and confuses other programmers. It works surprisingly well, once accustomed to it, but feels like you're working very much against the language. I embedded SQL into csharp using this technique, mostly for the experience of doing so.
Given that, I don't see any difference between my nested calls in Java and your nested calls in Smalltalk.
I do, the Smalltalk ones are closures that pick up variables from the surrounding environment automatically, the Java one would require manually passing all such variables, or the introduction of some ugly inner classes and all the relevant hacks to make them work.
While I fully admit that it's easier and cleaner to do bottom-up programming in dynamic languages, it is still possible (to some degree) to use these techniques in any language.
Agree, but it's the difficulty in doing so, that separates languages that you'd want to build a DSL in from those you wouldn't.
Any time you create a function, class or whatever, you are bringing the language closer to the problem domain. There's no distinguishable line between bottom-up programming and simply creating well- engineered classes and functions. Anyone can look at both ends of the spectrum and see that they look different--but that ignores how quickly things blur in the middle.
I think there is, I don't think it's difficult to see DSL's as a style, and it's easy to see that style in other people's code. You either write in the language, or on it. While it's possible to do a mixture of both, I think most people pick one or the other. I see it as similar to the API vs framework thing, people tend to like one or the other.
On the other hand, there is a sharp line between interpreted DSLs and regular programming. That's one of the reasons I prefer to use the term DSL strictly for interpreted DSLs. The term (when used that way) has a clear meaning.
-Rich-
I fail to see that line, whether code is interpreted or not, imho is orthogonal to the issue of whether or not that code is a DSL. I find your linking of these concepts, odd, maybe it's me, but they simply aren't related.
On Sep 4, 2006, at 4:28 PM, Ramon Leon wrote:
As an example, Body can take a variable number of Tag objects. Java methods can be defined to accept variable numbers of parameters, so this isn't a problem. Tag objects can also be nested inside other tags (allowing us to express complete html hierarchies). Alternatively, all tags (including body) could accept any objects-- and internally it calls toString() on the object. This would let you pass in a mixture of Tag objects and literal strings.
True, that would seem to work, but only with the addition saying all setters return "this", so properties of those objects can be set in every possible combination, inline, equivalent to Smalltalk's ; operator. I've done this in the past, it's ugly, and non idiomatic, and confuses other programmers. It works surprisingly well, once accustomed to it, but feels like you're working very much against the language. I embedded SQL into csharp using this technique, mostly for the experience of doing so.t as similar to the API vs framework thing, people tend to like one or the other.
Um, it doesn't need to be that difficult. Java basically treats variable length arguments as a collection. You could simply iterate over the arguments and add each one (in order) to the tag object.
The original example I gave didn't use any setters--not in the conventional sense. For example, body() could simply call toString() on anything passed in, concatenating the string from multiple arguments. It could then append "<body>" to the front and "</body>" to the end. Then it would append the whole string to the current document.
Alternatively, each tag could keep its contents as a list of subtags and raw string, and everything only get converted to strings (with the relevant tags added) at the end.
It would still be uglier than Smalltalk, but it could be a very simple solution. Of course, I'd still prefer to do this in either Smalltalk, Ruby or Lisp.
On the other hand, there is a sharp line between interpreted DSLs and regular programming. That's one of the reasons I prefer to use the term DSL strictly for interpreted DSLs. The term (when used that way) has a clear meaning. -Rich-
I fail to see that line, whether code is interpreted or not, imho is orthogonal to the issue of whether or not that code is a DSL. I find your linking of these concepts, odd, maybe it's me, but they simply aren't related.
OK, clearly you think the issue of interpreted/non-interpreted is orthogonal to the issue of DSL/non-DSL. I don't think we're going to agree on this, so let's set it aside for now. For the following discussion, assume everything is a DSL unless explicitly stated otherwise.
In other words, let's discuss the difference between bottom-up embedded DSLs and interpreted embedded DSLs.
For me all Bottom-up DSL and regular, non-DSL code lie on a continuum. You can clearly point to either end and say "This is a DLS" or "This isn't", but most code lies somewhere in the middle. And, the middle gets muddy.
There's a quote I've seen many times (with slightly different wording). "Any sufficiently complex project becomes a DSL". This is exactly the type of blurring I'm referring to, and it results in a general loss of meaning. If everything becomes a DSL, then the term DSL has no meaning.
On the other hand, interpreted DSL and non-interpreted code is not a continuum. There is a clear line between the two cases. Something is either designed to interpret external strings, or it isn't. There's no ambiguity.
Secondly, interpreted DSLs require different techniques than bottom- up DSLs. As far as I know, C, C++ and Java cannot natively evaluate arbitrary strings the way Ruby and Smalltalk can. In those languages, you cannot even write code to interpret external strings without building a parser of some sort (thus creating an external DSL). Even in Smalltalk and Ruby, evaluating strings requires (at minimum) an additional method call. More importantly, you have to decide what context you are evaluating the string in.
There are also other decisions that need to be made when building an interpreting DS that don't have to be made (or cannot be made) when simply building a bottom-up DSL. For example, how do you handle EOL symbols? Most Ruby DSLs interpret a line at a time, treating each line as a separate command. On the other hand, you could interpret the whole text as a chunk and treat EOLs just like any other white space.
As you can see, even if you're just repurposing the host language, building an interpreting DSL requires an additional layer of tricks, tips and techniques that are not required for bottom-up DSLs.
Finally, there's the underlying reason behind why you're using the technique. Bottom-up DSLs are simply a tool for developers. Interpreting DSLS can also simplify the development task for developers; however, they also give end-users tools to change the application's behavior after it has been deployed. So, interpreted DSLs can solve a much broader range of problems than bottom-up DSLs.
All of this (unambiguous meaning, clearly different set of techniques, and broader range of intentions) are reasons why I prefer to limit the term DSL to interpreted DSLs. To my mind, there seems to be obvious ambiguity between what is a bottom-up DSL and what isn't (as exemplified by the "every significantly complex..." quote). Bottom-up DSLs don't require any specialized techniques--you're simply creating useful methods, classes and operators. And Bottom-up DSLS are simply another type of source code--they don't add any additional value outside development (here I'm including maintenance and testing--basically everything that's done in-house).
Bottom line is, my definition would make DSLs more obviously different from other, more mundane programming techniques.
-Rich-
The original example I gave didn't use any setters--not in the conventional sense. For example, body() could simply call toString() on anything passed in, concatenating the string from multiple arguments. It could then append "<body>" to the front and "</body>" to the end. Then it would append the whole string to the current document.
I was talking about attributes to the tag, ie..
<body style="bla;" class="bla" borderwidth="0">
To be able to set attributes on tags, you need setters that return self and you need functions that return tag objects
html(body(h1("Hello")).style("bla").class("Bla"))
html(body(h1("Hello")).style("bla"))
On the other hand, interpreted DSL and non-interpreted code is not a continuum. There is a clear line between the two cases. Something is either designed to interpret external strings, or it isn't. There's no ambiguity. Secondly, interpreted DSLs require different techniques than bottom- up DSLs. As far as I know, C, C++ and Java cannot natively evaluate arbitrary strings the way Ruby and Smalltalk can. In those languages, you cannot even write code to interpret external strings without building a parser of some sort (thus creating an external DSL). Even in Smalltalk and Ruby, evaluating strings requires (at minimum) an additional method call. More importantly, you have to decide what context you are evaluating the string in.
There are also other decisions that need to be made when building an interpreting DS that don't have to be made (or cannot be made) when simply building a bottom-up DSL. For example, how do you handle EOL symbols? Most Ruby DSLs interpret a line at a time, treating each line as a separate command. On the other hand, you could interpret the whole text as a chunk and treat EOLs just like any other white space.
As you can see, even if you're just repurposing the host language, building an interpreting DSL requires an additional layer of tricks, tips and techniques that are not required for bottom-up DSLs.
Finally, there's the underlying reason behind why you're using the technique. Bottom-up DSLs are simply a tool for developers. Interpreting DSLS can also simplify the development task for developers; however, they also give end-users tools to change the application's behavior after it has been deployed. So, interpreted DSLs can solve a much broader range of problems than bottom-up DSLs.
All of this (unambiguous meaning, clearly different set of techniques, and broader range of intentions) are reasons why I prefer to limit the term DSL to interpreted DSLs. To my mind, there seems to be obvious ambiguity between what is a bottom-up DSL and what isn't (as exemplified by the "every significantly complex..." quote). Bottom-up DSLs don't require any specialized techniques--you're simply creating useful methods, classes and operators. And Bottom-up DSLS are simply another type of source code--they don't add any additional value outside development (here I'm including maintenance and testing--basically everything that's done in-house).
Bottom line is, my definition would make DSLs more obviously different from other, more mundane programming techniques.
-Rich-
I understand you reasoning, I appreciate the discussion, it's always good to see how others think, I just don't agree on your redefinition of the word, and will have to invoke Laynes Law.
I don't see much further to discuss, you want to call a language a DSL. We disagree on fundamental definitions. You want DSL to hinge on interpretation or not, it's not a position I can agree with. IMHO, you should drop the DS, and just call what you're talking about a language. Yes, likely a domain specific language, but I'm simply not going to agree on making everything that's not interpreted "not" a DSL. Then entire Lisp and Smalltalk community have been calling their style of programming building DSL's for far too long to suddenly change the definition and exclude them because you feel it's too ambiguous.
I did enjoy the discussion, I just don't see where it can go from here.
- Ramon Leon
On Sep 5, 2006, at 6:51 AM, Ramon Leon wrote:
I understand you reasoning, I appreciate the discussion, it's always good to see how others think, I just don't agree on your redefinition of the word, and will have to invoke Laynes Law.
Here's the thing (then I'll shut up, I promise), I don't think I'm redefining the term. Almost all the information I originally read about DSLs discussed them from an interpreting, internal DSL standpoint. I think there are a large number of people who use DSL this way. A lot of people use it the other way. Some are sloppy in their usage. All of this leads to a great amount of miscommunication.
For example, most of the Ruby DSL stuff on the web is about interpreting external files (or at least, most of what I've found).
I actually haven't found any authoritative references that use DSL for either Smalltalk or Lisp in the way you describe. The authoritative piece on programming lisp (from OnLisp) that describes using these techniques refers to them as 'bottom-up programming', not DSL. Don't get me wrong, I'd love to be proven wrong here (heck, I'd love to see any decent descriptions of using lisp or Smalltalk for writing DSLs, for any possible value of DSL).
I'm fine excepting your definition of DSL. However, I still think there should be a way to describe the more specific, interpreted case. There's a lot of value in looking at the interpreted case as a separate technique. And that's hard to do if you say DSL and everyone just makes their own assumptions.
-Rich-
I don't see much further to discuss, you want to call a language a DSL. We disagree on fundamental definitions. You want DSL to hinge on interpretation or not, it's not a position I can agree with. IMHO, you should drop the DS, and just call what you're talking about a language. Yes, likely a domain specific language, but I'm simply not going to agree on making everything that's not interpreted "not" a DSL. Then entire Lisp and Smalltalk community have been calling their style of programming building DSL's for far too long to suddenly change the definition and exclude them because you feel it's too ambiguous.
I did enjoy the discussion, I just don't see where it can go from here.
- Ramon Leon
I'm fine excepting your definition of DSL. However, I still think there should be a way to describe the more specific, interpreted case. There's a lot of value in looking at the interpreted case as a separate technique. And that's hard to do if you say DSL and everyone just makes their own assumptions.
-Rich-
What's wrong with simply saying interpreted DSL?
On Sep 7, 2006, at 5:13 AM, Ramon Leon wrote:
I'm fine excepting your definition of DSL. However, I still think there should be a way to describe the more specific, interpreted case. There's a lot of value in looking at the interpreted case as a separate technique. And that's hard to do if you say DSL and everyone just makes their own assumptions.
-Rich-
What's wrong with simply saying interpreted DSL?
Nothing, except we pretty much invented the term here. And no one else is using it.
It's not really a problem I expect us to solve. I just wanted to explore the miscommunication, so I could understand it better.
Hello Rich,
RW> Here's an example of what I'm talking about. I'm about to implement a RW> neural net. I'll be experimenting with many different sizes and RW> topographies. This is an excellent opportunity for a DSL. I could
I'm in the process of implementing neural networks too. I'd like to share thoughts (here or off list). This would force me to write down something:-)
I got stalled due to business demands but hope to find time to put something on SM some time. From this thread I guess that you should try the squeak binding to the fann library (fast artificial neural networks).
Didn't try myself but sounds promising.
The most interesting of my own experiments is a self organising feature map to cluster the information for a subsequent net. Maybe because I made a graphic trainer, I'm easily impressed by graphics :-))
Cheers,
Herbert mailto:herbertkoenig@gmx.net
Hi,
I don't really know anything about FANN. I was planning on just implementing my own (they're not that hard). I'm torn because FANN might save time, but it would also make the code less portable (I'd need to have the FANN library installed on any computer that planned on running the code).
Portability is probably more important than speed at this point, so I may just implement my own.
The project I'm working on is actually an aLife simulation. The neural nets would only be a small portion (the brains of the agents). I like the idea of using them, since the weights can be learned genetically (over several generations) as well as modified within a single generation (using reinforcement learning).
-Rich-
On Sep 2, 2006, at 9:41 PM, Herbert König wrote:
Hello Rich,
RW> Here's an example of what I'm talking about. I'm about to implement a RW> neural net. I'll be experimenting with many different sizes and RW> topographies. This is an excellent opportunity for a DSL. I could
I'm in the process of implementing neural networks too. I'd like to share thoughts (here or off list). This would force me to write down something:-)
I got stalled due to business demands but hope to find time to put something on SM some time. From this thread I guess that you should try the squeak binding to the fann library (fast artificial neural networks).
Didn't try myself but sounds promising.
The most interesting of my own experiments is a self organising feature map to cluster the information for a subsequent net. Maybe because I made a graphic trainer, I'm easily impressed by graphics :-))
Cheers,
Herbert mailto:herbertkoenig@gmx.net
Hi Rich,
Am 04.09.2006 um 06:55 schrieb Rich Warren:
Hi,
I don't really know anything about FANN. I was planning on just implementing my own (they're not that hard). I'm torn because FANN might save time, but it would also make the code less portable (I'd need to have the FANN library installed on any computer that planned on running the code).
What's about SNNS (http://www-ra.informatik.uni-tuebingen.de/SNNS/) ? It has an C API.....
Portability is probably more important than speed at this point, so I may just implement my own.
The project I'm working on is actually an aLife simulation. The neural nets would only be a small portion (the brains of the agents). I like the idea of using them, since the weights can be learned genetically (over several generations) as well as modified within a single generation (using reinforcement learning).
Could you tell more about this project :-))) ?
Regards
Hans
-Rich-
On Sep 2, 2006, at 9:41 PM, Herbert König wrote:
Hello Rich,
RW> Here's an example of what I'm talking about. I'm about to implement a RW> neural net. I'll be experimenting with many different sizes and RW> topographies. This is an excellent opportunity for a DSL. I could
I'm in the process of implementing neural networks too. I'd like to share thoughts (here or off list). This would force me to write down something:-)
I got stalled due to business demands but hope to find time to put something on SM some time. From this thread I guess that you should try the squeak binding to the fann library (fast artificial neural networks).
Didn't try myself but sounds promising.
The most interesting of my own experiments is a self organising feature map to cluster the information for a subsequent net. Maybe because I made a graphic trainer, I'm easily impressed by graphics :-))
Cheers,
Herbert mailto:herbertkoenig@gmx.net
Hello Rich,
RW> I don't really know anything about FANN. I was planning on just RW> implementing my own (they're not that hard). I'm torn because FANN
no they aren't, so I ended up doing my own too.
RW> Portability is probably more important than speed at this point, so I RW> may just implement my own.
There is a Squeak implementation of a two layered perceptron with backpropagation learning by Luciano Notarfrancesco, I decided against it for it was too slow. Much better Smalltalk and OO though.
I needed speed in computing the outputs and FloatArray is fast in #* and #sum.
RW> The project I'm working on is actually an aLife simulation. The
I'll take a look, when I'm online again.
RW> neural nets would only be a small portion (the brains of the agents). RW> I like the idea of using them, since the weights can be learned RW> genetically (over several generations) as well as modified within a RW> single generation (using reinforcement learning).
This (reinforcement learning) is said to be slow. What number of inputs and how many neurons would such a brain have? How many agents?
With 500 epochs of 400 samples training of a single Perceptron of 64 hidden and 16 output neurons took over an hour on a 1.8GHz Pentium M. It had 140 inputs.
Do you have any pointers on how to use genetic algorithms on neural nets? More practical, I'm an EE not a CS person :-)
Cheers,
Herbert mailto:herbertkoenig@gmx.net
On Sep 4, 2006, at 10:44 AM, Herbert König wrote:
This (reinforcement learning) is said to be slow. What number of inputs and how many neurons would such a brain have? How many agents?
Regarding reinforcement learning, I've seen this complaint form other EE people, and I never really understood it. Perhaps you could give me an example. In my opinion, it really depends. I believe the "no free lunch" principle shows that all learning systems are identical when averaged over all possible problems--so efficiency really depends on the specific problem.
Reinforcement learning has a number of advantages: it can work very well on systems where you receive intermitted rewards or punishments-- especially if the rewards only come after a series of actions (for example, games). Reinforcement learning can also continue after the agent/software has been deployed, allowing it to continue to update its behavior in the real world.
Also, for many domains, learning speed isn't much of an issue. You train the system, save the trained state, then run it from the trained state. The training should be a one-time cost.
As for the details on my project, I don't know. I'm still in the planning stages (and pouring through a lot of biology/evolution papers right now).
With 500 epochs of 400 samples training of a single Perceptron of 64 hidden and 16 output neurons took over an hour on a 1.8GHz Pentium M. It had 140 inputs.
I've worked on projects where we have trained the system for several days. Again, this is a one-time cost. If I put in a month of coding time, a few days of training (which can run over the weekend) doesn't seem that much. Many ML techniques can take a long time to train, but the end results can be very fast in use.
Do you have any pointers on how to use genetic algorithms on neural nets? More practical, I'm an EE not a CS person :-)
Not off hand (though I always recommend searching on http:// citeseer.ist.psu.edu/). If you're just trying to train the weights, you can just read the bits into an array and use that as your genome. If you want to evolve both the weights and the size/topography, you need more sophisticated methods. I know some people have worked on different ways to encode neural nets (basically compressing the layout/weight information, much the way our DNA compresses all the information needed to build a human body). I can't find the reference in my notes right now, however.
-Rich-
Hello Rich,
This (reinforcement learning) is said to be slow. What number of inputs and how many neurons would such a brain have? How many agents?
RW> Regarding reinforcement learning, I've seen this complaint form other RW> EE people, and I never really understood it. Perhaps you could give RW> me an example. In my opinion, it really depends.
regarding slowness, I'm an absolute beginner on neural nets and only read about how much rounds of training it needs. Currently I'm in the stage of: "Is my data representation suitable for processing by a (which type of?) neural net?"
Going through: training the net -> evaluate network performance -> change data representation or network topology ..... feels slow in absolute terms.
And a single layer perceptron behind a self organizing feature map trains much faster than a multilayer network (only a few of the nodes are trained) with comparable results (in my special case).
As soon as I know that a training will yield the "best possible" result, I will be cool if a computer needs to run a weekend to train a network.
On the other hand, soon after I reach that state, the subject will get boring :-))
RW> Not off hand (though I always recommend searching on http:// RW> citeseer.ist.psu.edu/). If you're just trying to train the weights, RW> you can just read the bits into an array and use that as your genome. RW> If you want to evolve both the weights and the size/topography, you RW> need more sophisticated methods. I know some people have worked on RW> different ways to encode neural nets (basically compressing the RW> layout/weight information, much the way our DNA compresses all the RW> information needed to build a human body). I can't find the RW> reference in my notes right now, however.
Thanks!
Herbert mailto:herbertkoenig@gmx.net
On Sep 6, 2006, at 11:40 PM, Herbert König wrote:
Hello Rich,
This (reinforcement learning) is said to be slow. What number of inputs and how many neurons would such a brain have? How many agents?
RW> Regarding reinforcement learning, I've seen this complaint form other RW> EE people, and I never really understood it. Perhaps you could give RW> me an example. In my opinion, it really depends.
regarding slowness, I'm an absolute beginner on neural nets and only read about how much rounds of training it needs. Currently I'm in the stage of: "Is my data representation suitable for processing by a (which type of?) neural net?"
I was actually asking about reinforcement learning. I've heard other EE people complain about reinforcement learning, saying it was too slow. However, I've used it to good effect on a few projects. It makes me wonder if they're using it for the wrong purpose, but I never got a chance to ask anyone for details (or rather, the one time I did ask, the EE professor just scoffed at me and said "they're just to slow!" without explaining anything).
Reinforcement learning can, however, be really fussy when it comes to training neural nets. Some of the early research showed great results training neural nets, but the researchers were already experts at implementing neural nets for the given domain, so they knew how to represent the data effectively. I think the issue here has been the neural nets, not the reinforcement learning.
Neural nets are really fussy. You have to grey-code all incoming numerical data. There's no good a priori way to determine how many nodes or levels you should have. It's hard to know how much you should train it, since they are subject to overfitting. Experimentally trying to determine these settings can take a lot of time (alter...train...test...iterate).
That's one of the reasons I'm interested in trying out genetic algorithms for building neural nets. If it's possible to have neural nets that automatically grow to reasonably fit the problem space, then that would be a big help.
So far, however, I've only played with static neural nets, training them using either backpropogation or reinforcement learning.
-Rich-
Hey,
I hate to say this, but I may be moving my project to Repast (http:// repast.sourceforge.net/). It's in Java (ARGGG!), but it looks like a well-designed agent simulation framework. I don't know if this would be something you're interested in or not. It's supposed to have various learning algorithms and neural nets and the like already built in. Also has built-in graphing and logging capabilities.
It looks like a good way to bootstrap my project (an evolutionary AI/ Alife project), with a minimum of effort. Also, it's been used for a number of ALife research projects--which will help make my project more acceptable in the eyes of the biologists I eventually need to convince.
I'm still doing some of the early prototyping in Squeak, however. If I get anything that looks nice, I'll try to post it in a public way (don't really know how to do that yet--but I'm sure someone on this list can point me to the correct HowTo's).
-Rich-
On Sep 6, 2006, at 11:40 PM, Herbert König wrote:
Hello Rich,
This (reinforcement learning) is said to be slow. What number of inputs and how many neurons would such a brain have? How many agents?
RW> Regarding reinforcement learning, I've seen this complaint form other RW> EE people, and I never really understood it. Perhaps you could give RW> me an example. In my opinion, it really depends.
regarding slowness, I'm an absolute beginner on neural nets and only read about how much rounds of training it needs. Currently I'm in the stage of: "Is my data representation suitable for processing by a (which type of?) neural net?"
Going through: training the net -> evaluate network performance -> change data representation or network topology ..... feels slow in absolute terms.
And a single layer perceptron behind a self organizing feature map trains much faster than a multilayer network (only a few of the nodes are trained) with comparable results (in my special case).
As soon as I know that a training will yield the "best possible" result, I will be cool if a computer needs to run a weekend to train a network.
On the other hand, soon after I reach that state, the subject will get boring :-))
RW> Not off hand (though I always recommend searching on http:// RW> citeseer.ist.psu.edu/). If you're just trying to train the weights, RW> you can just read the bits into an array and use that as your genome. RW> If you want to evolve both the weights and the size/topography, you RW> need more sophisticated methods. I know some people have worked on RW> different ways to encode neural nets (basically compressing the RW> layout/weight information, much the way our DNA compresses all the RW> information needed to build a human body). I can't find the RW> reference in my notes right now, however.
Thanks!
Herbert mailto:herbertkoenig@gmx.net
Hello Rich,
RW> I hate to say this, but I may be moving my project to Repast (http:// RW> repast.sourceforge.net/). It's in Java (ARGGG!), but it looks like a RW> well-designed agent simulation framework. I don't know if this would I'll know after I took a deeper look. They seem to have a lot of documentation and maybe I can steal an idea or two :-))
Thanks!
Herbert mailto:herbertkoenig@gmx.net
On 8/18/06, Rich Warren rwmlist@gmail.com wrote:
In Ruby this could be done as follows (calls the new_run method and passes in a hash):
new_run name => 'my name', id => 0, agent_count => 200, target => 30sphere ,error => 1e-10, visualize => true
In fact, this could be Smalltalk, too. new_run, id, agent_count, etc would be instance variables and => and , would be messages. 30sphere is not a legal Smalltalk id but you could use 30 sphere or sphere30. Comma would be a funny message that took a "setter specification" and returned a setter, and => would be a message to a setter that set the appropriate variable. It would be a pretty complicated solution, though.
The same thing in smalltalk would look like this (note, they can be in almost any order--'name:' is a constructor and must come first-- the others can be in any order and can be dropped):
TrialRun name: 'my name'; id: 0; agentCount: 200; target: 30sphere; error: 1e-10; visualize: true
This would work.
or, for a prettier option (but one that sacrifices flexibility)
TrialRun name: 'my name' id: 0 agentCount: 200 target: 30sphere error: 1e-10 visualize: true verbose: false
This would work, too. You could also implement doesNotUnderstand: to implement optional parameters so you would get back all the flexibility you want.
None of them are really as readable as I would like, but any would do. The last one is the most readable, but if the number of optional flags started to grow--it would quickly become a real pain.
How would you like it? Invent a syntax, and we'll see if we can turn it into Smalltalk.
squeak-dev@lists.squeakfoundation.org