📜 ⬆️ ⬇️

Atom: the new code editor from Github

image From the translator: Yesterday several dozens of repositories were published on Gitkhab without an official announcement, the contents of which indicated that the Githab team had long been developing a new text editor for programmers and was ready to present it to the public. A few hours later, the official site of the atom.io editor was launched , where you can now request an invite for beta testing, familiarize yourself with the documentation and plug-ins for the editor. This article is a translation of the first two posts from the Atom project blog dedicated to the concept and architecture of the editor.

Introducing Atom


Today, we are happy to launch the public beta version of Atom, a new text editor that is not only easy to use, but also provides great freedom of modification.

Sublime and TextMate offer convenience, but only limited extensibility. On the other hand, Vim and Emacs have tremendous flexibility, but are difficult to master and require the study of specific scripting languages ​​for modifications.
')
We think we can do better. Our goal is an uncompromising combination of convenience and customizability: an editor that a schoolchild can just figure out who has just begun to learn programming, but at the same time a tool that will not restrict an experienced hacker.

Since we began to use Atom already in the process of working on it, what at first was just an experiment, turned into an essential necessity for us. This is just the beginning, and a lot more needs to be done to fully embody our editor's vision. But the main goal is achieved. Outside, Atom is a modern text editor that meets user expectations. And under the hood - a system that asks for modifications and extensions.

In the coming weeks, we will send invitations to beta testers, and now we have published more than 80 libraries and packages that are used in the editor. We have opened many of the APIs that are needed to write powerful extensions, but since this is a beta version, they can still change based on feedback from you. We will try to make them as carefully as possible, while actively modifying the editor.

We are waiting for your feedback, packages and patches. Let's do it together!

Nucleus of an atom


The web has its flaws, but two decades of development have turned it into an incredibly flexible and powerful platform. Therefore, when we decided to write a text editor, which we ourselves would love to expand and modify, the choice of technology was obvious. But first we had to get rid of several restrictions that constrain us.

Native web

Browsers are well suited for browsing the web, but writing code is a specific activity that requires special tools. More importantly, the browser severely restricts access to local computer resources for security reasons, and for us a text editor that cannot properly write a file or run a local subprocess was completely unacceptable.

Therefore, Atom is not a regular web application. This is a specialized version of the Chromium browser, redesigned to be primarily a text editor, not a web browser. Each Atom window is a separate local web page.

All APIs that are available to any Node.js application are available for the JavaScript code running in each window. This hybrid solution creates unique opportunities for development.

Since all work happens locally, there is no need to worry about resource loading, script concatenation, and asynchronous module loading. If you need some code, just require at the beginning of the file. System Node.js modules without problems allows you to break the system into small well focused packages.

JavaScript with C ++

Interacting with native code is also very simple. For example, we wrote a wrapper around the Oniguruma regular expression engine to maintain compatibility with TextMate. In the browser, we would have to deal with NaCl or Esprima . Integration with Node greatly simplified the task.

In addition to the Node.js API, we also use the native browser dialog box APIs, the main and context menus, window size controls, and so on.

Web technologies: all the best

Another big plus of working on Atom was that we always guaranteed to work with the latest version of Chromium. This means that we were not bothered with cross-browser compatibility issues. We could use all the innovations of web technologies today.

For example, the layout of the workspace and editor panels uses flexbox . This is not an established standard, but despite the fact that it changed during the work, we were happy that we can already work with it.

We are confident in the future of the platform on which Atom is built, because web technologies are developed through the joint efforts of the whole industry. Native technologies come and go, and the web is getting better and more common every year. We will be happy to use all its features.

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


All Articles