[Vm-dev] Cog: A question about: setInterruptCheckChain()

Andreas Raab andreas.raab at gmx.de
Thu Sep 30 08:57:21 UTC 2010

On 9/30/2010 1:43 AM, Igor Stasenko wrote:
>> But now you're complaining about the integration APIs (with which I agree).
>> But there is stuff we can do to make this easier, *much* easier. If you've
>> ever looked at how Python deals with this stuff you'll get an idea about how
>> easy that can be - no slang, no VMMaker, no build files other than what is
>> already in Visual Studio. In effect, we should be providing a squeak.h and a
>> squeak.lib and the primitives should look like this:
>> #include<windows.h>
>> #include<wincred.h>
>> #include "squeak.h"
>> /* Read a credential from the Windows credential store */
>> OOP primitiveCredRead(VM *vm, OOP rcvr, OOP args) {
>>         Credentials *cred;
>>         char *target;
>>         vm->parseArgs(1, "%s",&target);
>>         if(!CredRead(targetName, CRED_TYPE_GENERIC, 0,&cred)) return
>> vm->fail();
>>         return vm->stringWithLength(cred->CredentialBlobSize+1,
>> cred->CredentialBlob);
>> }
>> Voila, done.
> Yep. Been there , did that :)
> I had implemented own automatic code generator which generated
> bindings for my abandoned smalltalk interpreter.
> I used SWIG C++ compiler by writing own plugin to it.
> So, what is stopping us from either use SWIG, or write own C/C++
> parser/compiler for automatic
> generation of external library bindings?

Someone needs to do it :-)

>>> No objections here. Shit happens. And its really don't matters where:
>>> either in language/FFI or in C. You still have to fix that.
>> It's not so much that shit happens but rather that your sarcastic comment is
>> *completely* wrong and (I think) goes to show how little exposure to the
>> resulting problems you (and pretty much everybody else arguing for that kind
>> of stuff) really have.
> Oh, please. I worked more than 2 years on single big C++ project, in
> Visual Studio.
> STL, templates, threads, 10 minutes of compilation time, incredibly
> hard to move ahead,
> incredibly hard to reproduce errors (since after 'fix' you were always
> had to restart program and
> repeat all steps which may possibly triggered bug). I am sick of C, really sick.
> If it would be so easy to develop in C, then no one (including me)
> would even look into smalltalk direction.

This isn't my claim. My claim is that for *platform integration tasks* C 
is superior. Not for general software development. But for a plugin that 
reads and writes the windows credential store, for a plugin that reads 
and writes the Apple keychain, for a plugin that interfaces with 
sockets, for a plugin that deals with platform windows, C/C++/C#/ObjC 
are the better choices.

   - Andreas

More information about the Vm-dev mailing list