Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Add "Language Influences" page #11198

Merged
merged 1 commit into from
Apr 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ within the Ethereum state.

Solidity is a `curly-bracket language <https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Curly-bracket_languages>`_.
It is influenced by C++, Python and JavaScript, and is designed to target the Ethereum Virtual Machine (EVM).
You can find more details about which languages Solidity has been inspired by in
the :doc:`language influences <language-influences>` section.

Solidity is statically typed, supports inheritance, libraries and complex
user-defined types among other features.
@@ -157,3 +159,4 @@ Contents
bugs.rst
contributing.rst
brand-guide.rst
language-influences.rst
25 changes: 25 additions & 0 deletions docs/language-influences.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
###################
Language Influences
###################

Solidity is a `curly-bracket language <https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Curly-bracket_languages>`_
that has been influenced and inspired by several well-known programming languages.

Solidity is most profoundly influenced by C++, but also borrowed concepts from languages like
Python, JavaScript, and others.

franzihei marked this conversation as resolved.
Show resolved Hide resolved
The influence from C++ can be seen in the syntax for variable declarations, for loops, the concept
of overloading functions, implicit and explicit type conversions and many other details.

In the early days of the language, Solidity used to be partly influenced by JavaScript.
This was due to function-level scoping of variables and the use of the keyword ``var``.
The JavaScript influence was reduced starting from version 0.4.0.
Now, the main remaining similarity to JavaScript is that functions are defined using the keyword
``function``. Solidity also supports import syntax and semantics that
are similar to those available in JavaScript. Besides those points, Solidity looks like
most other curly-bracket languages and has no major JavaScript influence anymore.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence comes as we are desperately trying to avoid any association with javascript :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think we still have to close the narrative somehow since we start the section with "it used to be influenced" etc.


Another influence to Solidity was Python. Solidity's modifiers were added trying to model
Python's decorators with a much more restricted functionality. Furthermore, multiple inheritance, C3 linearization,
and the ``super`` keyword are taken from Python as well as the general assignment and copy semantics of value
and reference types.