i = 0
x = 0
for( i, 0, 10000, x = x + 1 )
gives me:
0 [main] io 1600 open_stackdumpfile: Dumping stack trace to
io.exe.stackdump
Segmentation fault (core dumped)
[~/Io] gcc -v
gcc version 2.95.3-5 (cygwin special)
It works with 1000 iterations though :) Is it somehow creating 10000
block objects on the stack??
Mike
I know MacOS/NeXTstep uses NSDictionary, but then C++ uses map.
Whatever it is, it would be nice to be consistent. I kind of like
the short ones: map, set, list, bag.
OrderedCollection, LinkedList, Dictionary. Well, to me Dictionary is
no more descriptive - when I think dictionary I think words.
AssociativeArray is a little long and probably still doesn't help
portray the class. Hash is very 'programmer' languageish. Just
thinking, what about 'Index'? From dictionary.com:
"Something that serves to guide, point out, or otherwise facilitate
reference"
employees = Index clone
employees do_( block( employee,
write( employee name )
)
Just an idea. :)
Mike
--- In iolanguage@y..., Steve Dekorte <steve@d...> wrote:
>
> On Monday, May 6, 2002, at 01:29 AM, Steve Dekorte wrote:
> > Yes, I'd like to support that. Btw, do you know which languages
use the
> > term "Map" instead of "Dictionary"? I do like that it's short. I
think
> > Java uses "Dictionary" and "HashTable".
>
> After sending this, I looked it up and Java also has several "Map"
> interfaces related to Dictionary/HashTable. Maybe Map wouldn't be
so
> unfamiliar? Does anyone else has an opinion on this?
>
> Your preferred term?:
> Hash
> HashTable
> Dictionary
> Map
> Other?
>
> Cheers,
> Steve
On Friday 10 May 2002 02:50 pm, Steve Dekorte wrote:
> > Then front end
> > parsers and visual programming tools can just save their results in
> > that format.
>
> For visual programming tools, there's also the C API to
> manipulating/inspecting message trees and primitives.
But using a pickle format, a user of the visual tool could load a
program that someone else wrote in text and vice versa. Or some other
tool.
Of course, we might want the notion of having a comment attached to
objects.
-Chuck
Can you from the daily releases that I'm unemployed? :-)
Beta Release 2002 05 14
=======================
- added Date and File primitives
- Number random now returns value between 0.0 and 1.0
- Random method added
- Updated all errors to proper exceptions
- updated error callback to include exception name
Cheers,
Steve
This release fixes a bunch of bugs and makes some performance
improvements - particularly with numbers, which are now copied by value
instead of reference.
Also, I've started writing the test programs from "The Great Computer
Language Shootout" in Io to test performance, functionality and
completeness. I've only finished a handful of tests but so far it's
looking like Io currently performs ~50% faster than Python, Perl and
Ruby.
Beta Release 2002 05 13
===================
- fixed gc bugs
- now unmarks retained values
- bug w/ symbol strings
- exception stack now marked on gc cycle
- stack retained values now properly released on exceptions
- numbers now copied by value instead of reference
- new Number methods for "inline" operations
- re-added Number ++ and added +=, -=, etc
- Number memory now recycled
- inlined(w/macro) CFunction activation
- List
- added ==, reverseForeach, at_put_, random, randomize methods
- foreach now takes an extra index argument
- added String asNumber method
- fixed bug with parsing operators w/no args
Cheers,
Steve
On Thursday, May 9, 2002, at 04:38 AM, Chuck Esterbrook wrote:
> Since Io code is always a data structure/object graph, how about we
> come up with a "pickle"/"archiver" format for Io?
Great idea. I'm putting it on the to-do list. All the primitives should
be able to archive themselves.
I'd also like Io to be able to save a system "image" like LISP and
Smalltalk systems. (though Io won't force the user to start from a
system image)
> Then front end
> parsers and visual programming tools can just save their results in
> that format.
For visual programming tools, there's also the C API to
manipulating/inspecting message trees and primitives.
Steve
On Wednesday 08 May 2002 05:43 am, Steve Dekorte wrote:
> On Wednesday, May 8, 2002, at 05:33 AM, Jesse Grosjean wrote:
> > But is at:put:(1, 2) better then atPut(1, 2), i'm not sure.
> > Personally i prefer the smalltalk style at:1 put:2, but I guess
> > that looks strange to a lot of people.
>
> I like Smalltalk style too. I just didn't see how to implement it
> without a complex parser and I didn't want to get bogged down with
> parser work or bloat the implementation too much.
>
> In case anyone is interested in writing a smalltalk style syntax mod
> - all the compiler code is in the IoMessage.c in the sections labeled
> "compiler". That section is a bit crusty at the moment though.
Since Io code is always a data structure/object graph, how about we
come up with a "pickle"/"archiver" format for Io? Then front end
parsers and visual programming tools can just save their results in
that format.
Let's face it, we'll be playing with syntax and visual formats forever.
But an archived format can be stabilized pretty well and the core Io
code insulated from the other changes.
http://www.python.org/doc/current/lib/module-pickle.html
-Chuck
http://www.dekorte.com/software/c/io/Io-2002-05-08-2.tgz
Beta Release 2002 05 08 #2
==========================
- made Message into a primitive
- added Block argumentNames and message methods
- added Object hasSlot(), removeSlot() methods
- slots can hold Nil values now
- fixed exception name and compare problems
- fixed gc problem with messages
Cheers,
Steve
On Wednesday, May 8, 2002, at 05:33 AM, Jesse Grosjean wrote:
> But is at:put:(1, 2) better then atPut(1, 2), i'm not sure. Personally i
> prefer the smalltalk style at:1 put:2, but I guess that looks strange to
> a lot of people.
I like Smalltalk style too. I just didn't see how to implement it
without a complex parser and I didn't want to get bogged down with
parser work or bloat the implementation too much.
In case anyone is interested in writing a smalltalk style syntax mod -
all the compiler code is in the IoMessage.c in the sections labeled
"compiler". That section is a bit crusty at the moment though.
Steve
Yeah I at least would have better understood the colons instead of
underscores. When i see underscores it means private method or multi
word method to me, not multi arg method.
But is at:put:(1, 2) better then atPut(1, 2), i'm not sure. Personally i
prefer the smalltalk style at:1 put:2, but I guess that looks strange to
a lot of people.
Jesse
On Wednesday, May 8, 2002, at 08:12 AM, Steve Dekorte wrote:
>
> On Wednesday, May 8, 2002, at 05:04 AM, Jesse Grosjean wrote:
>> Quick question here, in you Io examples some of the method names end
>> with '_' and some don't. What is the '_' supposed to mean?
>
> Chuck asked the same thing. I've been meaning to put something in the
> manual about it.
>
> They're meant to act like colons do in Smalltalk.
>
> In Io:
>
> map at_put_(1, 2)
>
> would be:
>
> map at:1 put:2
>
> in Smalltalk.
>
> I guess I could just use colons(?) would:
>
> map at:put:(1, 2)
>
> have been more recognizable?
>
> I'm also not sure if this is a good naming convention. I like it because
> it gives more info about what the args mean and how many there should
> be. But I know it can be confusing for people not used to it.
>
> Steve
>
>
>
>
> To unsubscribe from this group, send an email to:
> iolanguage-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
On Wednesday, May 8, 2002, at 05:04 AM, Jesse Grosjean wrote:
> Quick question here, in you Io examples some of the method names end
> with '_' and some don't. What is the '_' supposed to mean?
Chuck asked the same thing. I've been meaning to put something in the
manual about it.
They're meant to act like colons do in Smalltalk.
In Io:
map at_put_(1, 2)
would be:
map at:1 put:2
in Smalltalk.
I guess I could just use colons(?) would:
map at:put:(1, 2)
have been more recognizable?
I'm also not sure if this is a good naming convention. I like it because
it gives more info about what the args mean and how many there should
be. But I know it can be confusing for people not used to it.
Steve
On Wednesday, May 8, 2002, at 04:42 AM, Jesse Grosjean wrote:
> I think you need to update the make file to refer to IoMap.o instead of
> IoHash.o. At least for me it would not finish compiling until i did so.
> Ok now time to play with it for a bit.
Hey Jesse,
Thanks for the bug report - I use an IDE and sometimes forget to test
the Makfile.
I just put up a new release that fixes that.
Steve
Quick question here, in you Io examples some of the method names end
with '_' and some don't. What is the '_' supposed to mean?
Thanks,
Jesse
On Tuesday, May 7, 2002, at 11:03 PM, Steve Dekorte wrote:
>
> http://www.dekorte.com/Software/C/Io/Io-2002-05-07.tgz
>
> Beta Release 2002 05 07
> =============================
> - added exceptions, break, continue, and returns
> - added Object exit and slotNames methods
> - changed "Hash" name to "Map"
> - fixed forward method - default implementation raises exception
> - removed Block code_ method
> - removed Number ++ method
> - removed extra print form CLI
>
> As always, I'd appreciate any comments, suggestion and bug reports.
>
> Cheers,
> Steve
>
>
>
>
> To unsubscribe from this group, send an email to:
> iolanguage-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
I think you need to update the make file to refer to IoMap.o instead of
IoHash.o. At least for me it would not finish compiling until i did so.
Ok now time to play with it for a bit.
Jesse
On Tuesday, May 7, 2002, at 11:03 PM, Steve Dekorte wrote:
>
> http://www.dekorte.com/Software/C/Io/Io-2002-05-07.tgz
>
> Beta Release 2002 05 07
> =============================
> - added exceptions, break, continue, and returns
> - added Object exit and slotNames methods
> - changed "Hash" name to "Map"
> - fixed forward method - default implementation raises exception
> - removed Block code_ method
> - removed Number ++ method
> - removed extra print form CLI
>
> As always, I'd appreciate any comments, suggestion and bug reports.
>
> Cheers,
> Steve
>
>
>
>
> To unsubscribe from this group, send an email to:
> iolanguage-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
On Monday, May 6, 2002, at 11:35 AM, Chuck Esterbrook wrote:
> That URL didn't work for me, but this one does:
> http://www.dekorte.com/Software/C/Io/Io.tgz
Thanks for the correction and feedback!
Good stuff.
Cheers,
Steve
PS. Got break, continue and returns working today. The implementation
adds a small performance hit to messages (two C conditions) but it's
much faster than using setjmp.
On Monday 06 May 2002 03:21 am, Steve Dekorte wrote:
> http://www.dekorte.com/software/Io/Io.tgz
That URL didn't work for me, but this one does:
http://www.dekorte.com/Software/C/Io/Io.tgz
The extra methods and command line args are nice additions, Steve.
This is my own personal running wish list for Io:
Misc
----
*** Mark the Io.tgz package with a date or version number:
Io-20020307.tgz or Io-0.2.tgz
*** "make test" should run an Io test suite.
*** At the io> prompt, typing "hi" gives a blank line:
Io>hi
It seems that unknown variables give Nil:
Io>hi type
Error: Nil does not respond to method: 'type'
I think they should raise some kind of exception instead.
*** "5 type" should return an actual Number type, rather than <String
0x805a3e8 "Number">.
*** "foo type" should return NilType in the same way that Python's
type(None) returns NoneType. Instead it complains: Error: Nil does not
respond to method: 'type'
*** I would rather not have the extra blank line in between the prompt
and the result. It makes the result visually "stick" to the next prompt
item:
------
Io>1
<Number 0x805ada0 1>
Io>2
<Number 0x805ae28 2>
Io>
------
*** List methods:
print -- print a list
random -- return a random element from the list
*** At the interative prompt "print" prints out the Lobby contents
twice. Perhaps because print returns self?
*** Cloning Object feels as bit strange as the resulting object has
members like "Number", "block", "while", "version", etc. Try "dog =
Object clone" at the the prompt for example.
Lexing and parsing
------------------
**** Single quotes should also be accepted for strings:
------
Io>"a"
<String 0x8059100 "a">
Io>'a'
Io>
------
**** Normal infix expressions with parens whereever you want and
operator precedence of * and / for example.
*** Comments don't work at the interactive prompt (very minor):
Io>5 # asdf
Error: Number does not respond to method: '#'
Io>5 // asdf
Error: Number does not respond to method: '//'
Numerics
--------
*** Have separate types for Int and Float. Number would be the
supertype.
*** 3 / 4 for float division (already there) and 3 // 4 for int
division (=0).
*** Add modulus operator %
Statements and language features
--------------------------------
*** Missing statement: return
*** Missing statement: break
*** Missing statement: continue
*** Missing: exceptions
http://www.dekorte.com/software/Io/Io.tgz
Release 2002 05 06 - Beta 2.1
===========================
Added features:
- support for command line arguments
(they're put in List in "commandLineArguments" slot of Lobby)
- List methods: foreach, sortBy_, do_, swapIndex_withIndex_, reverse
- Hash methods: do_, foreach, keys, values
Fixed bugs:
- enumerating normal Hash
On Monday 06 May 2002 01:33 am, Steve Dekorte wrote:
> On Monday, May 6, 2002, at 01:29 AM, Steve Dekorte wrote:
> > Yes, I'd like to support that. Btw, do you know which languages use
> > the term "Map" instead of "Dictionary"? I do like that it's short.
> > I think Java uses "Dictionary" and "HashTable".
>
> After sending this, I looked it up and Java also has several "Map"
> interfaces related to Dictionary/HashTable. Maybe Map wouldn't be so
> unfamiliar? Does anyone else has an opinion on this?
>
> Your preferred term?:
> Hash
> HashTable
> Dictionary
> Map
> Other?
I just wanted to add to this that we have List and according to an
earlier conversation you approved of a Set. I think Map fits nicely in
this context:
"The three container classes are List, Map and Set."
-Chuck
On Monday, May 6, 2002, at 01:29 AM, Steve Dekorte wrote:
> Yes, I'd like to support that. Btw, do you know which languages use the
> term "Map" instead of "Dictionary"? I do like that it's short. I think
> Java uses "Dictionary" and "HashTable".
After sending this, I looked it up and Java also has several "Map"
interfaces related to Dictionary/HashTable. Maybe Map wouldn't be so
unfamiliar? Does anyone else has an opinion on this?
Your preferred term?:
Hash
HashTable
Dictionary
Map
Other?
Cheers,
Steve
On Monday 06 May 2002 01:29 am, Steve Dekorte wrote:
> Yes, I'd like to support that. Btw, do you know which languages use
> the term "Map" instead of "Dictionary"? I do like that it's short. I
> think Java uses "Dictionary" and "HashTable".
I first saw it with NSMapTable in Obj-C for NeXTSTEP.
And the infamous Standard Template Library (STL) for C++ uses the term
"Map".
And I also got it from the usual explanation for dictionaries:
"they map keys to values"
And my experimental language, Eye. ;-)
> >> Btw, I figured out how to cleanly implement returns, break, and
> >> continue last night. I just need to do some performance tests on
> >> setjmp() to see what the trade-offs would be.
> >
> > Makes sense. I use exceptions in Python for Eye, which are often
> > done in C via setjmp(). In fact, I think NeXT Obj-C used setjmp for
> > exception implementation.
>
> Unfortunately, setjmp is very slow on PPC(I'm running OSX). I'm going
> to have to think about other ways to implement break, continue, and
> return. I think setjmp should be ok for exceptions though.
Well, if you think speed is important now...
-Chuck
On Friday, May 3, 2002, at 07:49 PM, Chuck Esterbrook wrote:
>>> Does Io have supertypes?
>>
>> What's that?
>
> In Eye, each type has a reference to its supertype so that types can
> inherit the methods of their super type. For example, a Block inherits
> from List. It just overrides execute() to behave differently.
I see. There's no implemented examples of supertypes at the moment, but
you could write one easily enough by overriding a primitive's "perform"
function.
>> obj parent clone
>>
>> Makes a new instance of the same proto-"type" as the parent. (Unless
>> it's a primative)
>>
>> Is that sufficient?
>>
>> If not maybe adding a "proto" method would be in order.
>
> So "5 parent" would give Number?
Nope, numbers are primitives, but "myDog parent" would return the Dog
proto. But I could add a proto method to all the primitives that would
return themselves, except in the case of the Object primitive which
would return "self parent". That general feature seems like a good idea.
>>> I like choice 1 the best because it's quick to say and type. Also
>>> the word always comes up. Q: What's a dictionary? A: A data
>>> structure and object container that _maps_ keys to values.
>>
>> Good points. However Python, Smalltalk and (Apple's) Objective-C all
>> use the name "Dictionary" and I'd like to keep things reasonably
>> familiar.
>
> In that case, infix operators like * and / need higher level precedence.
Yes, I'd like to support that. Btw, do you know which languages use the
term "Map" instead of "Dictionary"? I do like that it's short. I think
Java uses "Dictionary" and "HashTable".
>> Btw, I figured out how to cleanly implement returns, break, and
>> continue last night. I just need to do some performance tests on
>> setjmp() to see what the trade-offs would be.
>
> Makes sense. I use exceptions in Python for Eye, which are often done
> in C via setjmp(). In fact, I think NeXT Obj-C used setjmp for
> exception implementation.
Unfortunately, setjmp is very slow on PPC(I'm running OSX). I'm going to
have to think about other ways to implement break, continue, and return.
I think setjmp should be ok for exceptions though.
Steve
Hey guys,
I just put up a new release. The big change is a new syntax for
assignment and operators.
See http://www.dekorte.com/Software/C/Io/Account.io for an example. The
docs have also been updated.
Release 2002 05 02 (beta 2)
Added features:
- new operator syntax: a = b instead of a =(b), 1 + 2 instead of 1 +(2)
- string append accepts strings or numbers
- added string ".." method for appending strings
- block code is escaped for printing
- added block "code" and "code_" methods for inspecting and changing a
blocks code
- an unrecognized message to nil raises an error
- string methods now return new strings
Fixed bugs:
- enumerating index 0 in PHash.
- wrong context for evaluating arguments in Object_setSlot and
Object_getSlot
Next:
- stack traces, more error info
- implementation docs
- returns, breaks, continue
I'd really appreciate any comments, suggestions, bug reports, etc.
Cheers,
Steve
Begin forwarded message:
> From: "Jim Mathies" <jim@...>
> Date: Sat Mar 30, 2002 07:08:22 AM US/Pacific
> To: "Steve Dekorte" <steve@...>
> Subject: Re: new Io release
>
> Hey,
>
> Some suggestions:
>
> If your going for pure ansi c, but you expect people to use the code
> in c++ projects, put the
>
> #ifdef __cplusplus
> extern "C" {
> #endif
> ...
> #ifdef __cplusplus
> }
> #endif
>
> in your headers. Something I did with Cpw that I learned from looking at
> the FreeType lib is to create a central .h that all headers include
> first,
> and in that
> do all your platform specific #ifdef'ing. Plus you can create a nice
> startheader/
> endheader for the extern stuff. Check out:
> http://www.mathies.com/cpw/srctohtml/cpw_config.h.html
>
> One other thing I noticed was that I had to move the ./base/ code into
> the root dir because the files that included base/*.h's didn't address
> these
> files directly. e.g. #include "List.h" vs. #include"base/List.h"....
.
> Regards,
> Jim
Begin forwarded message:
> From: Jecel Assumpcao Jr <jecel@...>
> Date: Thu Apr 18, 2002 08:57:49 AM US/Pacific
> To: Steve Dekorte <steve@...>
> Subject: Re: blocks
> ...
>>> Shouldn't that be for(i, 1, 10, get("myBlock")) ?
>>
>> for() actually just grabs the message tree of the 4th argument and
>> executes it. This is kind of nice for performance reasons(no need to
>> create a locals object). And you can still use a block with args if
>> you like:
>>
>> Io>myBlock=(block(a, a print))
>> Io>for(i, 1, 10, myBlock(i))
>> 12345678910
>
> Right!
>
>> Now here's something neat:
>>
>> Io>for(a, 1, 10, myBlock)
>> 12345678910
>>
>> The block's locals delegate to the caller's locals so it still finds
>> "a". That is, as long as there is an "a" to be found:
>>
>> Io>a=(Nil)
>> Io>for(i, 1, 10, myBlock)
>> Io>
>>
>> Even if it's way up in the Lobby:
>>
>> Io>Lobby a=("foo ")
>> Io>for(i, 1, 10, myBlock)
>> foo foo foo foo foo foo foo foo foo foo
>
> Yes, the joys of dynamic scoping. As I mentioned, a lot of Lisps and
> Logos (including my own Self derived NeoLogo) are like this. The
> "accidental variable capture" (imagine that "for" was defined in Io and
> had a local "a"...) problem is more serious in theory than in practice.
>
>>> Ok, this seems like dynamic scoping as in Logo or early Lisps. What
>>> happens if "for" also defines an "i" slot? Shouldn't "i" be quoted
>>> somehow to be passed as the first argument to "for"?
>>
>> Well, this is were Io is a bit unusual - arguments aren't evaluated
>> by the sender, the receiver asks the message for them. So in the case
>> of the "for" CFunction, instead of asking the message for the
>> evaluated value of the first argument, I grab the first arguments
>> message tree and get the first message's method symbol and create a
>> slot in locals with the same name. So the message i is never
>> evaluated.
>
> Very reasonable. This has been a tradition since Lisp's "special forms"
> and was also extensively used in early (-72 and -74) Smalltalks.
>
>> I did this purely to give the for() a more conventional looking
>> syntax, which is good. It's also a bit faster as it avoids the method
>> call that would return the string name of the argument. The bad part
>> is that there is no way (currently) to implement the same function
>> within Io itself, as there would be if for() took a string for the
>> first argument. Maybe I should use the string argument instead?
>
> That would be too awkward and isn't worth it just for consistency's
> sake. You could copy for Lisp and have a "sblock" method that would
> create blocks that take their arguments raw (like Lisp can define an
> EXPR or an FEXPR in Lisp itself):
>
> for=(sblock(v,start,end,code,(makeSlot(v,eval(start));
> while(slotValue(v)<eval(end),
> (eval(code);
> makeSlot(v,slotValue(v)+1))))))
>
> I am not sure about the "eval(code)" thing, but it would be something
> along these lines. And this should be refactored so that "eval(end)" is
> executed only once and its value saved in a local variable.
>
> Good luck!
> -- Jecel
>
Begin forwarded message:
> From: Steve Dekorte <steve@...>
> Date: Wed Apr 17, 2002 12:31:52 PM US/Pacific
> To: Jecel Assumpcao Jr <jecel@...>
> Subject: Re: blocks (was: impression of Io)
> ...
>>> Also, I should mention that you can still do Smalltalk like things
>>> with them:
>>>
>>> Io>myBlock=(block(i print))
>>> Io>for(i, 1, 10, myBlock)
>>> 12345678910
>>
>> Shouldn't that be for(i, 1, 10, get("myBlock")) ?
>
> for() actually just grabs the message tree of the 4th argument and
> executes it. This is kind of nice for performance reasons(no need to
> create a locals object). And you can still use a block with args if you
> like:
>
> Io>myBlock=(block(a, a print))
> Io>for(i, 1, 10, myBlock(i))
> 12345678910
>
> Now here's something neat:
>
> Io>for(a, 1, 10, myBlock)
> 12345678910
>
> The block's locals delegate to the caller's locals so it still finds
> "a".
> That is, as long as there is an "a" to be found:
>
> Io>a=(Nil)
> Io>for(i, 1, 10, myBlock)
> Io>
>
> Even if it's way up in the Lobby:
>
> Io>Lobby a=("foo ")
> Io>for(i, 1, 10, myBlock)
> foo foo foo foo foo foo foo foo foo foo
>
>>> "i" will be inherited from the calling block since the block locals
>>> object get's it's parent slot set to the locals of the caller.
>>
>> Ok, this seems like dynamic scoping as in Logo or early Lisps. What
>> happens if "for" also defines an "i" slot? Shouldn't "i" be quoted
>> somehow to be passed as the first argument to "for"?
>
> Well, this is were Io is a bit unusual - arguments aren't evaluated by
> the sender, the receiver asks the message for them. So in the case of
> the "for" CFunction, instead of asking the message for the evaluated
> value of the first argument, I grab the first arguments message tree
> and get the first message's method symbol and create a slot in locals
> with the same name. So the message i is never evaluated.
>
> I did this purely to give the for() a more conventional looking syntax,
> which is good. It's also a bit faster as it avoids the method call that
> would return the string name of the argument. The bad part is that
> there is no way (currently) to implement the same function within Io
> itself, as there would be if for() took a string for the first
> argument. Maybe I should use the string argument instead?
>
>>> Another example:
>>>
>>> Io>test=(block(b, for(i, 1, 10, b)))
>>> Io>test(block(i print))
>>> 12345678910
>>
>> I see that the object created by block(i print) becomes the value of
>> the "b" local slot in the "test" method, but doesn't it get invoked
>> automatically as the arguments of "for" are evaluated? I would have
>> guessed that we would have to write something like
>>
>> test=(block(b, for("i", 1, 10, get("b"))))
>
> I hope the "i" discussion above explains this.
>
>> When I get a chance to try it I might make some actually useful
>> comments...
>>
>> Best regards,
>> -- Jecel
>> P.S.: I don't know if you got the message I sent on Sunday (saying I
>> couldn't get to your site - it bounced back since the mailer couldn't
>> reach it either) but I have added a link to Io in the Self swiki
>> http://www.merlintec.com:8080/Self/
>
> Great, thanks,
> Steve
>
Begin forwarded message:
> From: Steve Dekorte <steve@...>
> Date: Tue Apr 16, 2002 03:48:52 PM US/Pacific
> To: Jecel Assumpcao Jr <jecel@...>
> Subject: Re: impression of Io
>
>
> On Tuesday, April 16, 2002, at 12:38 PM, Jecel Assumpcao Jr wrote:
>> I was able to access your web site yesterday and really liked your
>> description of Io. I don't have time to try it out right now, so was
>> unable to figure out how you deal with blocks. It seems that you have
>> no lexical scoping and that storing one in a slot makes it behave
>> exactly as a method. So how do you fetch a block instead of executing
>> it?
>
> There's a "get" method on the base Object. Example:
>
> Dog bark=(block("woof!" print)) // define a method
>
> Dog bark // call a method
>
> myBlock = Dog get("bark") // get the value of a slot without activating
> it and set the locals slot "myBlock" to it.
>
> (I should probably rename "get" to "getSlot" to avoid method name
> collisions.)
> Now the thing to remember is that myBlock is a slot itself. So if you
> wanted to, say, pass the block as an argument you can't do:
>
> otherObject set("bark", mySlot)
>
> since that would activate mySlot. You need to do:
>
> otherObject set("bark", get("mySlot"))
>
> which get's the value of mySlot from the locals(the default target)
> without activating it.
>
> Thanks for taking a look at it. I'd appreciate any more comments you
> might have.
>
> Steve
>
On Wednesday, April 24, 2002, at 08:41 AM, jgrosjean wrote:
> I'm the one who just posted some questions to the yahoo Io group. You
> mention in the manual that you got good feedback from...
>
> Thanks to Jim Mathies, Jack Herrington and Jecel Assumpcao Jr for their
> valuable feedback. ...
>
> Do you think that feedback could be made public? I think reading what
> other people say might help me understand the issues involved better.
Jesse,
I'll post some of that feedback in the next few messages to the list.
Cheers,
Steve
On Wednesday, April 24, 2002, at 08:16 AM, jgrosjean wrote:
> This language looks really neat. I've got it up and running, and am
> now starting to look through the sources... I very much appreciate
> the object oriented c style, though i'm still not a c programmer so
> the source code reading is going a little slow.
>
> Anyway I have a few quick questions about the features of the
> language, i'm not clear on the following terms. If their are other
> recommended sources on learning about any of this stuff please direct
> me there:
>
> stackless - i generally know about stack based implementations, but
> what does stackless mean, how does it work?
As I understand it, to say a scripting language is "stackless" is to
say it uses the C stack instead of it's own. For instance, when Io calls
a method it doesn't keep track of where it needs to return to - the C
stack does.
> modifiable message trees instead of bytecodes - I know about
> bytecodes, what is/and benifits of a modifiable message tree?
To be honest, one of the main reasons I implemented it that way because
it seemed simplest and easiest for me to understand. :-) Another reason
is that I've been interested in creating a *fully* visual programming
system and one of the things that involves is graphical editing of
"code". That's a pain to do if you need to have the UI to parse and
compose text code. With message trees, it can just directly edit the
structure of the "code" - the set of messages/instructions that define a
block.
> decompilable blocks - If nothing is compiled into bytecodes what does
> this mean?
It means you can ask the top message "object" of a message tree to walk
the tree to produce a human readable textual code representation of
itself. Io doesn't keep the source code around. That reminds me, I need
to add a method on the Block primitive that allows you to ask a block
for it's source code.
> multi-state support - ?
This is for applications where people want to run more than one copy of
Io in the same process. Usually this would be in multi-threaded systems
where different threads might have different instances of Io running. To
do this, I'll need to add a Io State variable to all of Io's C functions
and move the globals into State.
> Replace static primitive methods with tag methods - I'm not really
> clean on the general concept of tags and how they are used in the
> implementation... Yeah I've got the source code in front of me, but c
> doesn't fit in my brain very well. So where can i find out more about
> using tags to implement a language?
What I call tags are basically a a list of C function pointers. The Tag
data structure defined in Tag.h is used for this:
typedef struct
{
TagFreeCallback *freeCallback;
TagMarkCallback *markCallback;
TagPerformCallback *performCallback;
TagNameCallback *nameCallback;
PHash *methods;
} Tag;
Every value is a primitive of some sort - a String, List, Objects, etc.
And the data structure for each primitive begins with a "marked" and
"tag" variable. Example::
typedef struct
{
unsigned char marked;
Tag *tag;
ByteArray *byteArray;
} UString;
The marked is for gargabe collection purposes and the tag is a reference
the primitive's tag datastructure. The tag is used to figure out which C
function to call for a given operation on a value. For example, when the
garbage collector decides to free the UString, it ends up looking in the
UString's tag and finds the freeCallback function pointer and calls it.
This function pointer is set to UString_free. The freeCallback in a tag
for a different primitive would would be set to a different C function.
This makes it easier for people to externally add new primitives.
> And last of all can anyone point me to any other mini oo language
> implementations. I've found Io and Little Smalltalk, are there any
> other mini oo systems out there that i should know about?
Take a look at Cel: http://www.redwoodsoft.com/cel/ It's a pure OO
language, with a stack and bytecode compiled. My friend Dru wrote this
and our discussions about it are part of what inspired me to write Io.
Some other languages are Lua, JavaScript and Python though none of then
are pure OO languages and Python and JavaScript aren't so small.
Ruby is supposed to be a pure OO langauge, but I haven't taken a good
look at it. It seemed to be a bit heavy(like Python), from what I
remember.
Steve
This language looks really neat. I've got it up and running, and am
now starting to look through the sources... I very much appreciate
the object oriented c style, though i'm still not a c programmer so
the source code reading is going a little slow.
Anyway I have a few quick questions about the features of the
language, i'm not clear on the following terms. If their are other
recommended sources on learning about any of this stuff please direct
me there:
stackless - i generally know about stack based implementations, but
what does stackless mean, how does it work?
modifiable message trees instead of bytecodes - I know about
bytecodes, what is/and benifits of a modifiable message tree?
decompilable blocks - If nothing is compiled into bytecodes what does
this mean?
multi-state support - ?
Replace static primitive methods with tag methods - I'm not really
clean on the general concept of tags and how they are used in the
implementation... Yeah I've got the source code in front of me, but c
doesn't fit in my brain very well. So where can i find out more about
using tags to implement a language?
And last of all can anyone point me to any other mini oo language
implementations. I've found Io and Little Smalltalk, are there any
other mini oo systems out there that i should know about?
Thanks,
jesse