Серверные сценарии что это

From Wikipedia, the free encyclopedia

From Wikipedia, the free encyclopedia

Languages used in server side scripting.

Server-side scripting is a technique used in web development which involves employing scripts on a web server which produces a response customized for each user’s (client’s) request to the website. The alternative is for the web server itself to deliver a static web page. Scripts can be written in any of a number of server-side scripting languages that are available (see below). Server-side scripting is distinguished from client-side scripting where embedded scripts, such as JavaScript, are run client-side in a web browser, but both techniques are often used together.

Server-side scripting is often used to provide a customized interface for the user. These scripts may assemble client characteristics for use in customizing the response based on those characteristics, the user’s requirements, access rights, etc. Server-side scripting also enables the website owner to hide the source code that generates the interface, whereas, with client-side scripting, the user has access to all the code received by the client. A downside to the use of server-side scripting is that the client needs to make further requests over the network to the server in order to show new information to the user via the web browser. These requests can slow down the experience for the user, place more load on the server, and prevent the use of the application when the user is disconnected from the server.

When the server serves data in a commonly used manner, for example, according to the HTTP or FTP protocols, users may have their choice of a number of client programs (most modern web browsers can request and receive data using both of those protocols). In the case of more specialized applications, programmers may write their own server, client, and communications protocol, that can only be used with one another.

Programs that run on a user’s local computer without ever sending or receiving data over a network are not considered clients, and so the operations of such programs would not be considered client-side operations.

History[edit]

Netscape introduced an implementation of JavaScript for server-side scripting with Netscape Enterprise Server, first released in December, 1994 (soon after releasing JavaScript for browsers).[1][2]

Server-side scripting was later used in early 1995 by Fred DuFrense while developing the first website for Boston, MA television station WCVB. The technology is described in US patent 5835712. The patent was issued in 1998 and is now owned by Open Invention Network (OIN). In 2010 OIN named Fred DuFresne a «Distinguished Inventor» for his work on server-side scripting.

Explanation[edit]

In the earlier days of the web, server-side scripting was almost exclusively performed by using a combination of C programs, Perl scripts, and shell scripts using the Common Gateway Interface (CGI). Those scripts were executed by the operating system, and the results were served back by the webserver. Many modern web servers can directly execute on-line scripting languages such as ASP, JSP, Perl, PHP and Ruby either by the web server itself or via extension modules (e.g. mod_perl or mod_php) to the webserver. For example, WebDNA includes its own embedded database system. Either form of scripting (i.e., CGI or direct execution) can be used to build up complex multi-page sites, but direct execution usually results in less overhead because of the lower number of calls to external interpreters.

Dynamic websites sometimes use custom web application servers, such as Glassfish, Plack and Python’s «Base HTTP Server» library, although some may not consider this to be server-side scripting. When using dynamic web-based scripting techniques, developers must have a keen understanding of the logical, temporal, and physical separation between the client and the server. For a user’s action to trigger the execution of server-side code, for example, a developer working with classic ASP must explicitly cause the user’s browser to make a request back to the webserver.

Server-side scripts are completely processed by the servers instead of clients. When clients request a page containing server-side scripts, the application server processes the scripts and returns an HTML page to the client.

Server-side rendering[edit]

In the beginning of the web content was generated purely on the back end. After the big adoption of front end single-page applications, a new approach was introduced to generate the HTML using the client application, but on the back end. Examples of frameworks that use SSR are Next.js, Nuxt.js and Nest.js. They use React.js, Vue.js, and Angular, respectively, to generate the content of the server.

Server-side generation[edit]

Another similar to SSR technique of generating content for a website is using Server-side generation. This technique use application that create static html pages and then those files are send to the server. File generation can happen on completely different computer for example using continuous delivery. Example of SSG tools are Jekyll, Gatsby or Eleventy. Those sites are often hosted on Netlify or GitHub pages. GitHub also supports Jekyll projects where it automatically build the site when changes are added to git.

Languages[edit]

There are a number of server-side scripting languages available, including:

  • ActiveVFP (*.avfp)
  • ASP (*.asp)
  • ASP.NET Web Forms (*.aspx)
  • ASP.NET Web Pages (*.cshtml, *.vbhtml)
  • ColdFusion Markup Language (*.cfm)
  • Go (*.go)
  • Google Apps Script (*.gs)
  • Hack (*.php)
  • Haskell (*.hs) (example: Yesod)
  • Java (*.jsp, *.do) via JavaServer Pages
  • JavaScript using Server-side JavaScript (*.ssjs, *.js) (example: Node.js)
  • Lasso (*.lasso)
  • Lua (*.lp *.op *.lua)
  • Parser (*.p)
  • Perl via the CGI.pm module (*.cgi, *.ipl, *.pl)
  • PHP (*.php, *.php3, *.php4, *.phtml)
  • Python (*.py) (examples: Pyramid, Flask, Django)
  • R (*.rhtml)
  • Ruby (*.rb, *.rbw) (example: Ruby on Rails)
  • Tcl (*.tcl)
  • WebDNA (*.dna,*.tpl)
  • Progress WebSpeed (*.r,*.w)

See also[edit]

  • Client-side scripting
  • Content management system (CMS)
  • Edge Side Includes
  • JSP
  • Node.js
  • Next.js
  • Outline of web design and web development
  • Perl/Plack
  • PHP
  • Server Side Includes (SSI)
  • Web development

References[edit]

  1. ^ «Server-Side JavaScript Guide». Netscape Communications Corporation. 1998. Retrieved 2012-04-25.
  2. ^ Mike Morgan (1996). «Using Netscape™ LiveWire™, Special Edition». Que.

External links[edit]

  • Server-side scripting at Curlie;

From Wikipedia, the free encyclopedia

Languages used in server side scripting.

Server-side scripting is a technique used in web development which involves employing scripts on a web server which produces a response customized for each user’s (client’s) request to the website. The alternative is for the web server itself to deliver a static web page. Scripts can be written in any of a number of server-side scripting languages that are available (see below). Server-side scripting is distinguished from client-side scripting where embedded scripts, such as JavaScript, are run client-side in a web browser, but both techniques are often used together.

Server-side scripting is often used to provide a customized interface for the user. These scripts may assemble client characteristics for use in customizing the response based on those characteristics, the user’s requirements, access rights, etc. Server-side scripting also enables the website owner to hide the source code that generates the interface, whereas, with client-side scripting, the user has access to all the code received by the client. A downside to the use of server-side scripting is that the client needs to make further requests over the network to the server in order to show new information to the user via the web browser. These requests can slow down the experience for the user, place more load on the server, and prevent the use of the application when the user is disconnected from the server.

When the server serves data in a commonly used manner, for example, according to the HTTP or FTP protocols, users may have their choice of a number of client programs (most modern web browsers can request and receive data using both of those protocols). In the case of more specialized applications, programmers may write their own server, client, and communications protocol, that can only be used with one another.

Programs that run on a user’s local computer without ever sending or receiving data over a network are not considered clients, and so the operations of such programs would not be considered client-side operations.

History[edit]

Netscape introduced an implementation of JavaScript for server-side scripting with Netscape Enterprise Server, first released in December, 1994 (soon after releasing JavaScript for browsers).[1][2]

Server-side scripting was later used in early 1995 by Fred DuFrense while developing the first website for Boston, MA television station WCVB. The technology is described in US patent 5835712. The patent was issued in 1998 and is now owned by Open Invention Network (OIN). In 2010 OIN named Fred DuFresne a «Distinguished Inventor» for his work on server-side scripting.

Explanation[edit]

In the earlier days of the web, server-side scripting was almost exclusively performed by using a combination of C programs, Perl scripts, and shell scripts using the Common Gateway Interface (CGI). Those scripts were executed by the operating system, and the results were served back by the webserver. Many modern web servers can directly execute on-line scripting languages such as ASP, JSP, Perl, PHP and Ruby either by the web server itself or via extension modules (e.g. mod_perl or mod_php) to the webserver. For example, WebDNA includes its own embedded database system. Either form of scripting (i.e., CGI or direct execution) can be used to build up complex multi-page sites, but direct execution usually results in less overhead because of the lower number of calls to external interpreters.

Dynamic websites sometimes use custom web application servers, such as Glassfish, Plack and Python’s «Base HTTP Server» library, although some may not consider this to be server-side scripting. When using dynamic web-based scripting techniques, developers must have a keen understanding of the logical, temporal, and physical separation between the client and the server. For a user’s action to trigger the execution of server-side code, for example, a developer working with classic ASP must explicitly cause the user’s browser to make a request back to the webserver.

Server-side scripts are completely processed by the servers instead of clients. When clients request a page containing server-side scripts, the application server processes the scripts and returns an HTML page to the client.

Server-side rendering[edit]

In the beginning of the web content was generated purely on the back end. After the big adoption of front end single-page applications, a new approach was introduced to generate the HTML using the client application, but on the back end. Examples of frameworks that use SSR are Next.js, Nuxt.js and Nest.js. They use React.js, Vue.js, and Angular, respectively, to generate the content of the server.

Server-side generation[edit]

Another similar to SSR technique of generating content for a website is using Server-side generation. This technique use application that create static html pages and then those files are send to the server. File generation can happen on completely different computer for example using continuous delivery. Example of SSG tools are Jekyll, Gatsby or Eleventy. Those sites are often hosted on Netlify or GitHub pages. GitHub also supports Jekyll projects where it automatically build the site when changes are added to git.

Languages[edit]

There are a number of server-side scripting languages available, including:

  • ActiveVFP (*.avfp)
  • ASP (*.asp)
  • ASP.NET Web Forms (*.aspx)
  • ASP.NET Web Pages (*.cshtml, *.vbhtml)
  • ColdFusion Markup Language (*.cfm)
  • Go (*.go)
  • Google Apps Script (*.gs)
  • Hack (*.php)
  • Haskell (*.hs) (example: Yesod)
  • Java (*.jsp, *.do) via JavaServer Pages
  • JavaScript using Server-side JavaScript (*.ssjs, *.js) (example: Node.js)
  • Lasso (*.lasso)
  • Lua (*.lp *.op *.lua)
  • Parser (*.p)
  • Perl via the CGI.pm module (*.cgi, *.ipl, *.pl)
  • PHP (*.php, *.php3, *.php4, *.phtml)
  • Python (*.py) (examples: Pyramid, Flask, Django)
  • R (*.rhtml)
  • Ruby (*.rb, *.rbw) (example: Ruby on Rails)
  • Tcl (*.tcl)
  • WebDNA (*.dna,*.tpl)
  • Progress WebSpeed (*.r,*.w)

See also[edit]

  • Client-side scripting
  • Content management system (CMS)
  • Edge Side Includes
  • JSP
  • Node.js
  • Next.js
  • Outline of web design and web development
  • Perl/Plack
  • PHP
  • Server Side Includes (SSI)
  • Web development

References[edit]

  1. ^ «Server-Side JavaScript Guide». Netscape Communications Corporation. 1998. Retrieved 2012-04-25.
  2. ^ Mike Morgan (1996). «Using Netscape™ LiveWire™, Special Edition». Que.

External links[edit]

  • Server-side scripting at Curlie;

На чтение 5 мин Просмотров 1.6к. Опубликовано 10.09.2020

Язык сценариев

Язык сценариев — это язык программирования, который интерпретируется, то есть переводится в машинный код при запуске кода, а не заранее. Языки сценариев часто используются для коротких сценариев над полными компьютерными программами. JavaScript, Python и Ruby — всё это примеры языков сценариев.

Вы можете быть удивлены, узнав, что за всю историю компьютеров было изобретено более 700 языков программирования . Это не так много, как у нас есть 6900 человеческих языков, но выучить любой новый язык — нелёгкое дело.

Язык сценариев (также известный как сценарии или сценарий) чётко определяется как серия команд, которые могут выполняться без необходимости компиляции . Хотя все языки сценариев являются языками программирования, не все языки программирования являются языками сценариев. PHP, Perl и Python — распространённые примеры языков сценариев.

Языки сценариев используют программу, известную как интерпретатор, для перевода команд и напрямую интерпретируются из исходного кода, не требуя этапа компиляции . Другие языки программирования, с другой стороны, могут потребовать от компилятора преобразования команд в машинный код, прежде чем он сможет выполнить эти команды.

Хотя важно знать разницу между интерпретируемыми и компилируемыми языками программирования, передовое оборудование и методы кодирования начинают делать различие несколько устаревшим.

Содержание

  1. Интерпретируемые и компилируемые языки программирования
  2. Серверные сценарии против клиентских сценариев
  3. Примеры языков сценариев на стороне сервера
  4. Примеры языков сценариев на стороне клиента
  5. Приложения языков сценариев
  6. Плюсы и минусы языков сценариев
  7. Плюсы
  8. Минусы
  9. Вывод

Интерпретируемые и компилируемые языки программирования

Интерпретируемый язык программирования — это язык, разработанный для непосредственного выполнения исходного кода без необходимости компилировать программу в инструкции на машинном языке. Интерпретатор выполнит программу, переведя операторы в серию из одной или нескольких подпрограмм, прежде чем окончательно переведёт их на другой язык, такой как машинный код.

В компилируемых языках программирования программа компилятора переводит код, написанный на языке программирования высокого уровня, на язык более низкого уровня, чтобы программа могла выполняться. Программы C или Java обычно должны быть сначала скомпилированы для запуска. Два хорошо известных компилятора — это Eclipse для Java и gcc для C и C ++.

Самый простой способ понять, как работает компилятор, — это подумать о различных операционных системах. Например, программы Windows скомпилированы для работы на платформах Windows и поэтому несовместимы с Mac.

Серверные сценарии против клиентских сценариев

Есть два типа языков сценариев: на стороне сервера и на стороне клиента. Единственное существенное различие между ними состоит в том, что для обработки первого требуется сервер.

Языки сценариев на стороне сервера работают на веб-сервере. Когда клиент отправляет запрос, сервер отвечает, отправляя контент через HTTP. Напротив, языки сценариев на стороне клиента работают на стороне клиента — в их веб-браузерах.

Преимущество клиентских скриптов состоит в том, что они могут снизить нагрузку на сервер, позволяя веб-страницам загружаться быстрее. Принимая во внимание, что одно из значительных преимуществ серверных сценариев состоит в том, что они недоступны для просмотра публике, как клиентские сценарии.

Пытаясь решить, в каком направлении двигаться над проектом, имейте в виду, что сценарии на стороне клиента больше ориентированы на пользовательский интерфейс и функциональность. И наоборот, сценарии на стороне сервера ориентированы на более быструю обработку, доступ к данным и устранение ошибок.

Примеры языков сценариев на стороне сервера

Ниже приведены примеры языков сценариев на стороне сервера.

Язык Комментарии
PHP Самый популярный серверный язык, используемый в интернете.
ASP.NET Фреймворк веб-приложений, разработанный Microsoft.
Node.js Может работать на множестве платформ, включая Windows, Linux, Unix, Mac и т. Д.
Java Используется во всём, от Bluetooth в автомобильной стереосистеме до приложений НАСА.
Ruby Динамический. Особое внимание уделяется простоте.
Perl Немного мэшапа между C, сценарием оболочки, AWK и sed.
Python Отлично подходит для обучения новичков. Использует более короткий код.

Примеры языков сценариев на стороне клиента

Ниже приведены примеры языков сценариев на стороне клиента.

Язык Комментарии
HTML Основа веб-разработки.
CSS Улучшает внешний вид и графику на страницах в вашем веб-браузере.
JavaScript Хотя обычно на стороне клиента, иногда может использоваться и на стороне сервера.

Приложения языков сценариев

Языки сценариев используются во многих областях, как в интернете, так и за его пределами. Помимо серверных и клиентских приложений, в системном администрировании могут использоваться языки сценариев. Примерами скриптов, используемых в системном администрировании, являются Shell, Perl и Python.

Языки сценариев также используются во многих играх и мультимедиа. Например, в модах Minecraft используется Java, чтобы пользователи могли создавать собственные миры и предметы в игре. Кроме того, Second Life , Trainz и Wesnoth позволяют пользователям создавать расширения для игр.

Подобно расширениям, используемым в играх, расширения в других программах, таких как расширения браузера Google Chrome, все запускаются с использованием языков сценариев.

Плюсы и минусы языков сценариев

Плюсы

Использование языков сценариев даёт много преимуществ перед другими языками программирования. Они с открытым исходным кодом. Это позволяет пользователям со всего мира присоединиться к процессу улучшения. Другие плюсы включают:

  • Не требует компиляции, хотя иногда это необходимо.
  • Легко переносить между операционными системами.
  • Языки сценариев делают веб-страницы удобными.
  • Легче учиться и писать.
  • Скрипты можно использовать в качестве прототипа программ, что позволяет сэкономить время на тестовых проектах.

Минусы

У использования языков сценариев не так много минусов. Один из минусов заключается в том, что некоторые компании не хотят, чтобы сценарии читали всё, поэтому они используют сценарии на стороне сервера, чтобы не публиковать их. Кроме того, установка программы-интерпретатора может быть проблемой. Наконец, иногда скрипты работают медленнее, чем программы.

Вывод

Изучение языка сценариев — самый простой способ погрузиться в мир программирования. Существует множество ресурсов, которые помогут вам попробовать каждый из них, пока вы не найдёте тот, который вам подходит. Просто не забывайте делать это медленно, проявлять терпение и стремиться начинать с небольших проектов, а не с больших. Вы быстро найдёте свою нишу.

Понравилась статья? Поделить с друзьями:
  • Яркие поздравления с днем рождения подруге
  • Серверные сценарии php примеры
  • Юморные поздравления с днем рождения женщине чтоб ржала до упада в стихах
  • Яркие поздравления с днем рождения девушке
  • Серверные сценарии cgi определение назначение ключевые особенности