Martin Kuball | 1 Jan 12:32
Picon

error running VMMaker-dtl.111

Hello and happy new year to everyone.

Yesterday I upgraded VMMaker to dtl.111 (from 3.8b6). Generating the entire 
code gives mit the following error:

CCodeGeneratorGlobalStructure(Object)>>doesNotUnderstand: 
#emitCCodeOn:doInlining:doAssertions:
CCodeGeneratorGlobalStructure>>emitCCodeOn:doInlining:doAssertions:
CCodeGeneratorGlobalStructure(CCodeGenerator)>>storeCodeOnFile:doInlining:doAssertions:
CCodeGeneratorGlobalStructure(CCodeGenerator)>>storeCodeOnFile:doInlining:
UnixVMMaker(VMMaker)>>generateInterpreterFile
UnixVMMaker(VMMaker)>>generateMainVM
UnixVMMaker(VMMaker)>>generateEntire
[] in VMMakerTool>>generateAll {[vmMaker generateEntire]}
BlockContext>>on:do:' 'VMMakerTool>>generateAll
[] in SimpleButtonMorph>>doButtonAction {[target perform: actionSelector 
withArguments: arguments]}
BlockContext>>ensure:
CursorWithMask(Cursor)>>showWhile:
SimpleButtonMorph>>doButtonAction

The Debugger has a line saying: "tpr 10/29/2002 14:00 · C code generator · 
1 implementor · only in change set VMMaker-tpr.58  · "

Thanks for your help.

Frank Shearar | 1 Jan 13:49
Picon
Favicon

A big word of thanks!

THANK YOU to the clever, clever people who have worked on Squeak over these
many years!

I had an image hang on me last night, such that it rendered just fine, but
wouldn't accept user input. I thought I'd lost about 8 hours of work. It was
very late, so I left the image alone, in the hopes that it was just my
sleep-addled mind playing tricks.

In the morning, the image was still non-responsive, so I regretfully gave up
and shut it down without saving. And then I thought, hang on a minute,
what's the timestamp of the changes file? And I saw that it was just a few
minutes before my troubles started. So I restarted Squeak, opened a
FileList, and selected the changes file. I saw a "recent changes" button,
and clicked it. It asked me how far back I wanted to see the changes, and
there I could see back to the last time I'd saved the image. All I needed to
do was simply select all the "method:" items, and all the code I'd thought
lost was restored! (And then I neatly undid the very last change, so I
wouldn't repeat the story!)

So, thanks to the many people who've put thought and care into Squeak over
the years, I didn't lose those hours of work after all!

frank

David T. Lewis | 1 Jan 19:34
Picon
Favicon

Re: error running VMMaker-dtl.111

On Thu, Jan 01, 2009 at 12:32:43PM +0100, Martin Kuball wrote:
> Hello and happy new year to everyone.
> 
> Yesterday I upgraded VMMaker to dtl.111 (from 3.8b6). Generating the entire 
> code gives mit the following error:
> 
> CCodeGeneratorGlobalStructure(Object)>>doesNotUnderstand: 
> #emitCCodeOn:doInlining:doAssertions:
> CCodeGeneratorGlobalStructure>>emitCCodeOn:doInlining:doAssertions:
> CCodeGeneratorGlobalStructure(CCodeGenerator)>>storeCodeOnFile:doInlining:doAssertions:
> CCodeGeneratorGlobalStructure(CCodeGenerator)>>storeCodeOnFile:doInlining:
> UnixVMMaker(VMMaker)>>generateInterpreterFile
> UnixVMMaker(VMMaker)>>generateMainVM
> UnixVMMaker(VMMaker)>>generateEntire
> [] in VMMakerTool>>generateAll {[vmMaker generateEntire]}
> BlockContext>>on:do:' 'VMMakerTool>>generateAll
> [] in SimpleButtonMorph>>doButtonAction {[target perform: actionSelector 
> withArguments: arguments]}
> BlockContext>>ensure:
> CursorWithMask(Cursor)>>showWhile:
> SimpleButtonMorph>>doButtonAction
> 
> The Debugger has a line saying: "tpr 10/29/2002 14:00 ? C code generator ? 
> 1 implementor ? only in change set VMMaker-tpr.58  ? "
>

Martin,

My apologies, this is an error that I introduced in VMMaker-dtl.111. The
missing method was incorrectly moved to SlangBrowser-dtl.1, which is also
(Continue reading)

Martin Kuball | 3 Jan 16:25
Picon

keyboard char events and unicode

Hi!

some time ago the unix (and mac) VMs where changed to provide a ucs4 code 
in the keyboard event structure. No I'm wondering how do I use this 
information? The basic 3.10 image does not seem to do it. So is there cs 
or package I can file in?

Martin

Ramiro Diaz Trepat | 4 Jan 14:36
Gravatar

Balloon3D

Hi all,
I was thinking of including some 3D charts on a little quantitative finance framework I am working on in my spare time.  I don't want to achieve any avant garde 3D things, something that resembles what spreadsheets do would be fine.
I found the Balloon3D framework, that seems to be really fabulous.   Although I had a bit of trouble installing and running some of the examples.
I have no previous experience whatsoever in 3D graphics, so my questions are: 
- What are the best sources to learn about Balloon3D? 
- Maybe some other pointers to learn the general basics of 3D graphics.  But again, I don't want to become an expert on this matter, I would like to know enough to work well with the existing tools.

Thanks !


r


Ross Boylan | 4 Jan 20:59
Picon
Gravatar

Re: Balloon3D

On Sun, 2009-01-04 at 13:36 +0000, Ramiro Diaz Trepat wrote:
> Hi all,
> I was thinking of including some 3D charts on a little quantitative
> finance framework I am working on in my spare time.  I don't want to
> achieve any avant garde 3D things, something that resembles what
> spreadsheets do would be fine.
> I found the Balloon3D framework, that seems to be really fabulous. 
When I asked about 3D, Karl Ramberg said he wasn't sure Balloon3D worked
in images > 3.8.  So before you go too far, you might want to check if
it works.  If it doesn't, you could either try an older image or try to
get it working with the current one.

I've been trying to use Croquet for 3D, but haven't had much luck so
far.  The problems may be specific  to my system, and almost certainly
are specific to Unix.

Ross Boylan

Séverin Lemaignan | 4 Jan 23:54
Picon
Gravatar

Re: Re: Linux and ttyUSB0

Hello everyone,

A couple of months later, I'm eventually working on getting the
SerialPort plugin to work for arbitrary nodes name under Linux (and
thus MacOS).

A quick summary of the issue, to refresh memories: today, you can open
a serial port in Squeak with "SerialPort new openPort:portNum.". Eg,
for portNum = 1, it would map to COM1 under Windows and /dev/ttyS1
under Linux.
That's fine, except that recent Linux kernels don't mount most serial
devices on /dev/ttySxx, but on more specific nodes, like /dev/ttyACMxx
for modems, /dev/ttyUSBxx for certain USB->COM converters, etc.

To circumvent it, I modified the Serial Port plugin to accept either
port numbers or arbitrary paths. I still have some cleaning to do, but
the plugin itself (sqUnixSerial.c) basically works.
But I have some troubles to get it to work from Squeak. I modified
SqueakPlugin.c to introduce new primitive calls (plus their
corresponding "exports" declaration), namely:
EXPORT(sqInt) primitiveSerialPortCloseByName(void);
EXPORT(sqInt) primitiveSerialPortOpenByName(void);
EXPORT(sqInt) primitiveSerialPortReadByName(void);
EXPORT(sqInt) primitiveSerialPortWriteByName(void);

For each of them, I need to get the port name. I did like that
(copy-pasted from another plugin):

        int spName;
        char * spNameIndex;

        spName = interpreterProxy->stackValue(0);
        interpreterProxy->success(interpreterProxy->isBytes(spName));
        spNameIndex = interpreterProxy->firstIndexableField(spName);

But I probably do something wrong since if I call the primitive
"primSerialPortOpenByName" with "/dev/ttyACM0" as port name from
Squeak, the plugin code in sqUnixSerial.c receives a different string
("/dev/ttyACM0_��@�w@�w"), thus failing to open the serial port.

Does someone knows how to correctly transmit a string argument to a plugin?

I attach to the mail my working versions of sqUnixSerial.c,
SerialPlugin.c, SerialPlugin.h. If needed, I can send as well some
test code for sqUnixSerial.c.

And by the way, happy new year to everybody!

Séverin

2008/6/18 David T. Lewis <lewis <at> mail.msen.com>:
> On Wed, Jun 18, 2008 at 04:10:39AM +0100, S??verin Lemaignan wrote:
>> Thanks, Dave, for the answer.
>>
>> > A slightly more difficult change would be to add an optional primitive for
>> > Unix/Linux that sets the serialPortBaseName string. That would let you control
>> > it from Squeak, and would not require any changes to the existing primitives.
>>
>> That's actually probably what I'll try to do. Stupid question, but
>> where can I fetch the sqUnixSerial.c file (and it's MacOS
>> counterpart)?
>
> Severin,
>
> The sqUnixSerial.c file is part of the external support code (as opposed
> to the parts that are distributed in the VMMaker package). The external
> support code is maintained in a Subversion repository at http://squeakvm.org
> and you will also find it at the various VM home pages. If you are working
> with Linux for example, just grab one of Ian's distributions on
> http://squeakvm.org/unix/.
>
> The sqUnixSerial.c file is in platforms/unix/plugins/SerialPlugin.
> The corresponding support code for other platforms is in e.g.
> platforms/Mac OS/plugins/serialPlugin.
>
> I don't know enough about Mac OS to give any guidance there, but the
> support code for SerialPlugin looks like it might be for some older
> version of Mac OS. I understand that on OS X you can actually use
> a plugin from the unix sources, but I'm afraid I don't know the details.
>
> Dave
>
>
>
Attachment (sqUnixSerial.c): text/x-csrc, 12 KiB
Attachment (SerialPlugin.c): text/x-csrc, 11 KiB
Attachment (SerialPlugin.h): text/x-chdr, 898 bytes

David T. Lewis | 5 Jan 00:46
Picon
Favicon

Re: Re: Linux and ttyUSB0

On Sun, Jan 04, 2009 at 11:54:22PM +0100, S??verin Lemaignan wrote:
> 
> For each of them, I need to get the port name. I did like that
> (copy-pasted from another plugin):
> 
>         int spName;
>         char * spNameIndex;
> 
> 
>         spName = interpreterProxy->stackValue(0);
>         interpreterProxy->success(interpreterProxy->isBytes(spName));
>         spNameIndex = interpreterProxy->firstIndexableField(spName);
> 
> But I probably do something wrong since if I call the primitive
> "primSerialPortOpenByName" with "/dev/ttyACM0" as port name from
> Squeak, the plugin code in sqUnixSerial.c receives a different string
> ("/dev/ttyACM0_??????@???w@???w"), thus failing to open the serial port.
> 
> Does someone knows how to correctly transmit a string argument to a plugin?
> 

S??verin,

The trick here is that C expects strings to be null-terminated, and the Squeak
string that you pass to the primitive does not have the trailing null.

In general, you will want to copy the Squeak string contents into a freshly
allocated char[] array of size one greater than the string length. There
are a number of ways you can do this, but to give some examples you can
look in OSProcessPlugin (available on SqueakSource in project OSProcessPlugin).
The methods #transientCStringFromString: and #cStringFromString: provide
two ways to do the conversion. As an example, here is a primitive from
UnixOSProcessPlugin after it has been converted from Slang to C:

/*	Call chdir(2) to change current working directory to the specified path string. Answer
	nil for success, or errno on failure. */

EXPORT(sqInt) primitiveChdir(void) {
    extern int errno;
    char * path;
    sqInt aString;
    sqInt len;
    char *cString;
    char *stringPtr;
    sqInt newString;

	/* begin transientCStringFromString: */
	aString = interpreterProxy->stackObjectValue(0);
	len = interpreterProxy->sizeOfSTArrayFromCPrimitive(interpreterProxy->arrayValueOf(aString));
	interpreterProxy->pushRemappableOop(aString);
	newString =
interpreterProxy->instantiateClassindexableSize(interpreterProxy->classString(), len + 1);
	stringPtr = interpreterProxy->arrayValueOf(interpreterProxy->popRemappableOop());
	cString = interpreterProxy->arrayValueOf(newString);
	(char *)strncpy(cString, stringPtr, len);
	cString[len] = 0;
	path = cString;
	if (chdir(path)) {
		interpreterProxy->pop(2);
		interpreterProxy->push(interpreterProxy->nilObject());
	} else {
		interpreterProxy->pop(2);
		interpreterProxy->pushInteger(errno);
	}
}

> And by the way, happy new year to everybody!

And to you as well!

- Dave

nicolas cellier | 5 Jan 00:49

[ANN] Number comparison, hash, NaN, Point, and other partially ordered sets

Happy new year everyone.
After VWNC recent discussion about comparing Point and Number, I tried 
to make a review of my previous work concerning all these minor (but 
annoying) comparison bugs.

I think I now have an acceptable and consistent solution.
This is spreaded across several mantis bug reports:

http://bugs.squeak.org/view.php?id=3374
http://bugs.squeak.org/view.php?id=6719
http://bugs.squeak.org/view.php?id=7259
http://bugs.squeak.org/view.php?id=7260

It should also solve:

http://bugs.squeak.org/view.php?id=3360
http://bugs.squeak.org/view.php?id=6601
(I took andrew solution from the last one)

Comments, code critics, flames, etc... are welcome

Nicolas

Séverin Lemaignan | 5 Jan 01:23
Picon
Gravatar

Re: Re: Linux and ttyUSB0

Thanks Dave, it works. ...its...hum... not straighforward! :)

I'll finnish to debug and clean the code tomorrow, and I hope to be
able to quickly release a patch.

What's the procedure to get the patch reviewed and possibly included
in the trunk (including the OLPC Etoys branch)?

Bye,
Séverin

On Mon, Jan 5, 2009 at 00:46, David T. Lewis <lewis <at> mail.msen.com> wrote:
> On Sun, Jan 04, 2009 at 11:54:22PM +0100, S??verin Lemaignan wrote:
>>
>> For each of them, I need to get the port name. I did like that
>> (copy-pasted from another plugin):
>>
>>         int spName;
>>         char * spNameIndex;
>>
>>
>>         spName = interpreterProxy->stackValue(0);
>>         interpreterProxy->success(interpreterProxy->isBytes(spName));
>>         spNameIndex = interpreterProxy->firstIndexableField(spName);
>>
>> But I probably do something wrong since if I call the primitive
>> "primSerialPortOpenByName" with "/dev/ttyACM0" as port name from
>> Squeak, the plugin code in sqUnixSerial.c receives a different string
>> ("/dev/ttyACM0_??????  @???w @???w "), thus failing to open the serial port.
>>
>> Does someone knows how to correctly transmit a string argument to a plugin?
>>
>
> S??verin,
>
> The trick here is that C expects strings to be null-terminated, and the Squeak
> string that you pass to the primitive does not have the trailing null.
>
> In general, you will want to copy the Squeak string contents into a freshly
> allocated char[] array of size one greater than the string length. There
> are a number of ways you can do this, but to give some examples you can
> look in OSProcessPlugin (available on SqueakSource in project OSProcessPlugin).
> The methods #transientCStringFromString: and #cStringFromString: provide
> two ways to do the conversion. As an example, here is a primitive from
> UnixOSProcessPlugin after it has been converted from Slang to C:
>
> /*      Call chdir(2) to change current working directory to the specified path string. Answer
>        nil for success, or errno on failure. */
>
> EXPORT(sqInt) primitiveChdir(void) {
>    extern int errno;
>    char * path;
>    sqInt aString;
>    sqInt len;
>    char *cString;
>    char *stringPtr;
>    sqInt newString;
>
>        /* begin transientCStringFromString: */
>        aString = interpreterProxy->stackObjectValue(0);
>        len = interpreterProxy->sizeOfSTArrayFromCPrimitive(interpreterProxy->arrayValueOf(aString));
>        interpreterProxy->pushRemappableOop(aString);
>        newString =
interpreterProxy->instantiateClassindexableSize(interpreterProxy->classString(), len + 1);
>        stringPtr = interpreterProxy->arrayValueOf(interpreterProxy->popRemappableOop());
>        cString = interpreterProxy->arrayValueOf(newString);
>        (char *)strncpy(cString, stringPtr, len);
>        cString[len] = 0;
>        path = cString;
>        if (chdir(path)) {
>                interpreterProxy->pop(2);
>                interpreterProxy->push(interpreterProxy->nilObject());
>        } else {
>                interpreterProxy->pop(2);
>                interpreterProxy->pushInteger(errno);
>        }
> }
>
>
>> And by the way, happy new year to everybody!
>
> And to you as well!
>
> - Dave
>
>
>


Gmane