📜 ⬆️ ⬇️

Atlas - a new word in web programming


Today, continuing the topic of posts related to Cappuccino , I present to you Atlas , the application development environment for Cappuccino.

Let me remind you that Cappuccino is a Cocoa-like framework for writing web applications in the Objective-J language (Objective-C like JavaScript Superset), more here .

Atlas activists have been waiting for a long time, and now, today, public registration of beta testers is open, and you can lift the veil over the future of web solutions based on Cappuccino.


')
Literally from the first window it becomes clear - Atlas itself is written in Cappuccino. But the general mechanism is much more interesting. First of all, the native application is launched (for now Atlas is available only under OSX, the Windows version will be somewhere in a month), which performs, with reservations, the role of SSB (Site-Specific Browser). So, all Cappuccino windows turn into native ones, the same happens with the menu bar. Also in the background, a Narwhal JS -based web server is launched, which performs the same Objective-J, but already outside the context of the web browser (WebKit SSB), and can access the user's file system to read and write files. Jack is working on top of Narwhal, on the basis of which WebDAV is implemented, through which the Atlas client part already gains access to the files.

But enough about the internal implementation, go directly to the IDE. Atlas has a built-in source editor:



Perhaps the only plus is that it is written in Cappuccino and potentially interestingly made inside. Font size can not be changed, as well as the color theme. Okay, the font can not be reduced, but there is not even autoindent! In general, the code can be edited, but for now Cappuccino is only for poppy, it is easier to use Xcode or TextMate.



The interface editor doesn’t look like Interface Builder, but it has several significant advantages. First, it modifies the cib file directly, and you can avoid the long compilation of xib to cib. Secondly, it is really WYSIWYG, in converted xib files the size and position are often strolled.

It’s quite simple to use the editor, in the class implementation file, local variables should be declared with keyword @outlet, and the usual IBAction should be used for actions:

(at this stage, it turned out that copy-paste only works within Atlas ...)

@implementation AppController : CPObject<br/>
{ <br/>
@outlet CPWindow theWindow; //this "outlet" is connected automatically by the Cib <br/>
@outlet CPTextField userField;<br/>
@outlet CPTextField greetLabel;<br/>
} <br/>
<br/>
- ( IBAction ) onGreet : ( id ) sender<br/>
{ <br/>
var user = [ CPString<br/>
stringWithFormat : @ "Hello, %@! Atlas greets you!" ,<br/>
[ userField stringValue ] ] ;<br/>
[ greetLabel setStringValue : s ] ;<br/>
}


After that, the outlets appear in the interface editor and can be assigned by dragging an object onto an object while holding opt (alt).

The created interface can be immediately, without departing from the checkout, and test.

And finally: Atlas allows you to compile not just a web application, but also a native application for OSX (the same as Atlas itself). Thus, the creation of mixed desktop / web applications is potentially simplified (both, and the server can be based on common code).

Is it worth spending $ 20 on a beta? Only if you are seriously ready to start writing something big on Cappuccino here and now. Glitches are more than enough, there are many nuances in the work. But the ability to opt out of Interface Builder is very appealing.

Source: https://habr.com/ru/post/75390/


All Articles