Язык Go для С++ программистов

google golang developers team, “Go For C++ Programmers”, public translation into Russian from English More about this translation.

See also 28 similar translations

Translate into another language.

Participants

Kroxy1156 points
d8857 points
lrozenblyum821 points
And others...
Join Translated.by to translate! If you already have a Translated.by account, please sign in.
If you do not want to register an account, you can sign in with OpenID.
Pages: ← previous Ctrl next next untranslated
1 2 3 4 5 6 7 8 9

Go For C++ Programmers

Язык Go для С++ программистов

History of edits (Latest: Kroxy 1 year, 4 months ago) §

— кстати, чей-то вольный первод - http://netsago.org/ru/docs/1/16/ d8

Go is a systems programming language intended to be a general-purpose systems language, like C++. These are some notes on Go for experienced C++ programmers. This document discusses the differences between Go and C++, and says little to nothing about the similarities.

Go это системный язык программирования, предназначенный быть языком общего назначения подобно С++ . Этот документ - несколько заметок для опытных программистов на С++. Будут обсуждаться различия между Go и C++, и практически ничего не говорится о схожих свойствах.

History of edits (Latest: d8 1 year, 7 months ago) §

For a more general introduction to Go, see the Go tutorial and Effective Go.

Для общего введения в Go посмотрите пример использования Go и Effective Go.

History of edits (Latest: d8 1 year, 7 months ago) §

For a detailed description of the Go language, see the Go spec.

Для детального описания языка Go обратитесь к спецификации Go.

History of edits (Latest: d8 1 year, 7 months ago) §

Conceptual Differences

Концептуальные различия

History of edits (Latest: zyrg 1 year, 7 months ago) §

Go does not have classes with constructors or destructors. Instead of class methods, a class inheritance hierarchy, and virtual functions, Go provides interfaces, which arediscussed in more detail below. Interfaces are also used where C++ uses templates.

В Go нет классов с конструкторами или деструкторами. Вместо методов классов, наследования и виртуальных функций в Go используются интерфейсы, которые будут рассмотрены далее. Также интерфейсы используются вместо шаблонов С++.

History of edits (Latest: d8 1 year, 7 months ago) §

Go uses garbage collection. It is not necessary (or possible) to release memory explicitly. The garbage collection is (intended to be) incremental and highly efficient on modern processors.

Go использует автоматическую сборку мусора. Нет необходимости (возможности) освобождать память вручную. Сборка мусора инкрементальная и оптимизирована на современных процессорах.

History of edits (Latest: d8 1 year, 7 months ago) §

Go has pointers but not pointer arithmetic. You cannot use a pointer variable to walk through the bytes of a string.

В Go есть указатели, но нет арифметики с указателями. Использование указателей для прохода по массиву символов строки запрещено.

History of edits (Latest: lrozenblyum 1 year, 4 months ago) §

Arrays in Go are first class values. When an array is used as a function parameter, the function receives a copy of the array, not a pointer to it. However, in practice functions often use slices for parameters; slices hold pointers to underlying arrays. Slices are discussed further below.

Массивы в Go передаются по значению. При передаче в функцию массива передаётся его копия, а не указатель. На практике функции часто используют срезы для параметров, срезы хранят ссылки на исходные массивы. Срезы будут рассмотрены далее.

History of edits (Latest: d8 1 year, 7 months ago) §

Strings are provided by the language. They may not be changed once they have been created.

Строки встроены в язык. После создания их нельзя изменять.

History of edits (Latest: d8 1 year, 7 months ago) §

Hash tables are provided by the language. They are called maps.

Хеш-таблицы также встроены в язык и называются картами.

History of edits (Latest: d8 1 year, 7 months ago) §

Separate threads of execution, and communication channels between them, are provided by the language. This is discussed further below.

Также в язык встроено распараллеливание потоков исполнения и каналы общения между ними. Они будут рассмотрены далее.

History of edits (Latest: d8 1 year, 7 months ago) §

Certain types (maps and channels, described further below) are passed by reference, not by value. That is, passing a map to a function does not copy the map, and if the function changes the map the change will be seen by the caller. In C++ terms, one can think of these as being reference types.

Некоторые типы (карты и каналы) передаются по ссылке, а не по значению. То есть, если в функцию передать карту и изменить её в ней, то изменится и исходный объект. В терминах С++ они являются "ссылочными" типами.

History of edits (Latest: d8 1 year, 7 months ago) §

Go does not use header files. Instead, each source file is part of a defined package. When a package defines an object (type, constant, variable, function) with a name starting with an upper case letter, that object is visible to any other file which imports that package.

В Go не используются хедер-файлы. Каждый исходный файл находится в некотором пакете. Определения обьектов (типов, констант, переменных, функций), начинающиеся с заглавной буквы, становятся видны во всех файлах, импортирующих данный пакет.

History of edits (Latest: d8 1 year, 7 months ago) §
Pages: ← previous Ctrl next next untranslated
1 2 3 4 5 6 7 8 9

License: Creative Commons Attribution 3.0 License.