Skip to content
chandlerkent edited this page Aug 12, 2010 · 2 revisions
  • What is Objective-J?
    • Objective-J is a programming language extension to JavaScript, inspired by the Objective-C language.
    • It is a strict super-set of JavaScript, which means all existing JavaScript code will also work in Objective-J.
    • Objective-J compiles to plain JavaScript for running in web browsers and server-side JavaScript environments.
    • It adds several key features which JavaScript lacks, including:
      • true classical inheritance
      • dynamic message dispatching (facilitating features like forwardInvocation / method_missing)
      • relative and library file imports
  • What is Cappuccino?
    • Cappuccino is a web application framework written in Objective-J, designed for building rich client-side web applications.
    • TODO: elaborate on features, etc.
  • Do I have to perform a manual compilation step before running Objective-J applications?
    • No, the Objective-J compiler is written in JavaScript, and is automatically run on Objective-J code in the browser at runtime. This allows developers to continue with their familiar “edit, save, refresh” workflow.
  • So does Objective-J have to compile my code every time I load the application?
    • No, you can perform the compilation once before deployment using the tools, eliminating any startup time caused by the compilation step.
  • How can I perform cross-domain HTTP requests in Cappuccino?
    • Due to same origin policy restrictions in web browsers it is typically not possibly to perform a request to a server on a different domain, port, or protocol (http vs. https). There are some workarounds, such as using JSONP or Flash.
  • How can I perform synchronous HTTP requests in Cappuccino?
    • You shouldn’t. Due to the single-threaded nature of JavaScript in web browsers you can’t perform a synchronous HTTP request without hanging the browser’s user interface for the duration of the request, which is a very bad thing to do.
    • That said, if you have a very good reason, you are probably looking for:
      [CPURLConnection sendSynchronousRequest:[CPURLRequest requestWithURL:aURL] returningResponse:nil];