• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: This may be a bit of a twisted idea...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: This may be a bit of a twisted idea...


  • Subject: Re: This may be a bit of a twisted idea...
  • From: Christopher Lloyd <email@hidden>
  • Date: Mon, 02 Jul 2001 16:06:30 -0400

At 12:54 AM 7/2/2001 -0700, you wrote:
So, I'm poking around in NSMethodSignature, NSInvocation, and other arcane stuff in the Foundation kit and it occurs to me that interpreting Obj-C method calls (a'la' Perl's "eval" operator) is quite feasible.
What I have in mind doesn't achieve the full power of the C language, but if I were to take a page from SmallTalk and implement -ifTrue:, -ifFalse: and loops that use NSEnumerators, then I've got Turing-complete scripting in Obj-C, don't I?

Comments?

Entirely possible. I wrote an ObjC-subset scripting language for Yrrid's LOF product. It has a bytecode compiler, virtual machine, can be called from ObjC, call into ObjC and supports a decent set of ObjC and C'isms (for a scripting language). I use NSInvocation to do the cross-talking, works well. I don't support C structs and pointers (well, except for objects), so that saves a lot of headaches.

Someday I hope to split it out and generalize it so it's not stuck in the land of mainframe middleware, but right now I've got too much else to do!

Hope this helps (or provides some inspiration :),
Chris


  • Follow-Ups:
    • Re: This may be a bit of a twisted idea...
      • From: Rob Rix <email@hidden>
References: 
 >This may be a bit of a twisted idea... (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Some in-depth Obj-C runtime questions.
  • Next by Date: Re: [OT] Best 3D format for Cocoa apps
  • Previous by thread: Re: This may be a bit of a twisted idea...
  • Next by thread: Re: This may be a bit of a twisted idea...
  • Index(es):
    • Date
    • Thread