1 year, 2 months agoFrom the translator. Allow to submit on court of a habrasoobshchestvo transfer parts of documentation on the browser Servo engine. This engine is developed by community Mozilla in the Rust language, and is, perhaps, the biggest active project in this language. In this document it is told about architecture of the engine as developers use Rust together with C ++ and what difficulties they faced when developing. The original is available in project wiki on github.
It is very surface overview of architecture Servo. Servo remains a prototype, and some parts of architecture are not presented in the code form yet. Some important aspects of system were not in detail considered yet.
1 year, 2 months ago
2015 was considerable year for Rust: we released version 1.0, stabilized the majority of elements of language and a heap of libraries, considerably grew up as community, and also release 1.0), but it will be super-important year for Rust in which there will be many fascinating things. In this article I will tell that as I think, has to occur. It is not an official position and not the promise of the Rust developers.
Before we talk about the future, here several digits for last year:
It is the last article from a cycle about work with lines and memory in Rust from Herman Radtke which I transport. Me it seemed to the most useful, and initially I wanted to begin transfer with it, but then it seemed to me that other articles in a series are necessary too, for creation of a context and introduction to simpler, but very important, the language moments without which this article loses the usefulness. We learned how to create function which accepts String or &str;(English) as argument. Now I want to show you how to create function which returns String or &str;. Still I want to discuss why it can be necessary for us.
1 year, 2 months ago This post is devoted to all those who is confused by need to use to_string(), to force programs to be compiled. And I hope to shed a little light on a question of why in Rust two line types String and &str;.
Article — one of a series of the posts telling about use of some useful library types and the related idioms of Rust on the example of line data types. Information undoubtedly useful both for the beginning programmers on Rust, and for those that already managed to try a little this language, but yet not absolutely accustomed with rich library of types. The original post contains several inaccuracies and typographical errors in a code which I tried to correct in translation process, however in general the described approaches and motivation correct, suitable under concept "the best the practician", and therefore deserve attention. In my last post we spoke about use much &str; as preferable type for the functions accepting line arguments. Closer to the end of a post we discussed when it is better to use String, and when &str; in structures (struct). Though I think that in general council is good, but in certain cases use &str; instead of String not optimum. For such cases we need other strategy.
Procedural macroes — one of the most expected Rust features. At the moment it is possible to write procedural macroes only under the unstable version of the compiler though there are several containers, like syntex, allowing to do a limited kodogeneration within the stable compiler. However it especially does not facilitate a situation as the interface to AST remains unstable, and though authors of syntex try to go in step with night assemblies, sometimes there are feyla because of changes in structure of AST. In it the blog a post one of participants of core team — Nick Cameron — shared the vision of the future of procedural macroes. Though the post is complete of technical details on compiler interiors, it seemed to me that to a habrasoobshchestvo can be interesting to glance a little behind the scenes of development of Rust.
Framework for procedural macroes
In this post I will tell how, in my opinion, procedural macroes have to look. I already told about syntax in other post and when we publish API for procedural macroes, I will write a post and about it. I already described a number of changes in system of macroes so here I in something will repeat (partly contradicting last post), but I will disclose more details.
1 year, 3 months ago The publication of the source code of the swift language became a reason for writing of article — it became interesting to me to get acquainted with it closer. At once similarity of syntax with other young programming language under the name rust was evident, besides behind similar syntactic constructions also the similar scope of these languages was browsed. Both languages have strong static typification with a local output of types, both are compiled directly in machine code. Both those and other languages absorbed in themselves many acceptances from the world of functional programming. And swift and rust have means for start of the code written on C that allows to write without effort wrappers over a huge number of libraries. Both languages are considered as replacement to the existing system C, C languages ++, ObjectiveC. So in them the general and what differs?
Hi everyone! Since recent time I began to learn the fine Rust language. For myself I see practical application of this language in embedding to places of a code, critical on performance (at least, until "ripening" and an obrastaniye by libraries and frameworks).
For fixing of theoretical skills I decided to make the small project which essence is as follows: the dynamic library on Rust implements the simplified option of Algorithm of shingl and by means of FFI allows to connect its (library). To all whom interestingly I ask under kat.
1 year, 4 months ago
As well as many programming languages, Rust urges the developer to process by a certain method errors. In general, there are two general approaches of error handling: by means of exceptions and through returned values. And Rust prefers returned values.
In this article we intend to state in detail work with errors in Rust. Moreover, we will try to plunge over and over again into error handling from the different parties so in the end you will have a sure practical idea of how all this meets together.
In naive implementation error handling in Rust can look verbose and irritating. We will consider the main stumbling blocks, and also we will show how to make error handling laconic and convenient, using standard library.
Now we will consider actually processors of requests to API and we will rewrite the previous, terrible code. And in general, it is the last article from a cycle therefore here will be refactoring, style, macroes and all - all. It is the longest part.