1C:Enterprise programming language

From HandWiki

1C:Enterprise script is a high-level programming language created by 1C company. It is a fourth-generation programming language[1] allowing to quickly design and customize business applications as part of the rapid application development platform 1C:Enterprise.

1C:Enterprise script is an object-based (but not object-oriented) language with dynamic typing.[2][3]

1C:Enterprise script was designed as a programming language intended for coding of business algorithms. 1C:Enterprise script is a part of 1C:Enterprise technological platform  which implements Metadata-Driven Application Design and Development[4] approach that allows usage of low-code (low-code paradigm).[5]

1C:Enterprise script supports objects. There is number of integrated object types (Catalogs, Documents, Business Processes etc.) that implement pre-defined functionality.[6] Developers inherit their objects from integrated object types but further inheritance (from developers’ objects) is not supported.

A similar approach to inheritance is used in prototype-based programming.

1C:Enterprise script has much in common with other programming languages, such as JavaScript or Python, but it is not a replica of any of these languages.[3]

Examples of programming languages syntax

Language Name Example of syntax
1C:Enterprise script Procedure HelloWorld()

               Message("Hello World");

EndProcedure

JavaScript <script language = 'javascript'>

  document.write("Hello World");

</script>

Java class HelloWorld {

   public static void main(String[] args) {

      System.out.println("Hello World!");

   }

}

C# using System;

class Program

{

public static void Main(string[] args)

{

Console.WriteLine("Hello, world!");

}

}

Python 3.x print("Hello, world!")
SQL CREATE TABLE message (text char(15));

INSERT INTO message (text) VALUES ('Hello, World!');

SELECT text FROM message;

DROP TABLE message;

Visual Basic .NET Imports System

Public Module modmain

Sub Main()

Console.WriteLine ("Hello World using Visual Basic!")

End Sub

End Module

ABAP PROGRAM zhello_world.

START-OF-SELECTION.

   WRITE 'Hello, World!'.

APEX @isTest

private class HelloWorldTest {

@isTest static void hello() {

HelloWorld hello_world = new HelloWorld();

String result = hello_world.hello();

}

}

Developers create applied solutions based on 1C:Enterprise mostly in a built-in visual editor with an ability to add functionality written in 1C:Enterprise script. This includes the creation of objects and specifying their properties, presentation forms, objects’ interrelations, and so on.

1C:Enterprise script usually only required for describing special, nonstandard behavior of applied solution objects and custom data processing algorithms (say, tax calculation).[7]

1C:Enterprise script language is intended for describing business logic, and 1C:Enterprise script module calls are event-driven. Modules are executed when specific events occur in the applied solution.[8][7]

Development environment

Development in 1C:Enterprise script can be done either in Designer ( proprietary development environment) or in 1C:Enterprise Development Tools[9] (development environment based on the open Eclipse platform). Both tools support debugging, profiling, intellisense, syntax highlighting, code refactoring tools etc.

There is syntax highlighting support for 1C:Enterprise script source code implemented on GitHub.[10][11]

Language features

1C:Enterprise script modules are compiled into bytecode that is executed by 1C:Enterprise virtual machine.[3] There are implementations of 1C:Enterprise virtual machine for different OS (Windows, Linux, macOS) and for browsers (implemented in JavaScript).[5]

Application's code can be executed on the server-side as well as on client-side.[5]

Weak typing: a variable type is defined by the stored value and can change over time.[3]


References

  1. "Fourth-generation programming language (4GL)". https://en.wikipedia.org/wiki/Fourth-generation_programming_language. 
  2. "1C:Enterprise script". https://1c-dn.com/1c_enterprise/1c_enterprise_script/. 
  3. 3.0 3.1 3.2 3.3 "Встроенный язык программирования 1С:Предприятие" (in ru), Википедия, 2018-07-18, https://ru.wikipedia.org/w/index.php?title=%D0%92%D1%81%D1%82%D1%80%D0%BE%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9_%D1%8F%D0%B7%D1%8B%D0%BA_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F_1%D0%A1:%D0%9F%D1%80%D0%B5%D0%B4%D0%BF%D1%80%D0%B8%D1%8F%D1%82%D0%B8%D0%B5&oldid=94045054, retrieved 2019-04-29 
  4. Archiveddocs. "Metadata-Driven Application Design and Development" (in en-us). https://docs.microsoft.com/en-us/previous-versions/aa480019(v%3dmsdn.10). 
  5. 5.0 5.1 5.2 "What do you know about 1C?". https://1c-dn.com/blogs/techblog/what-do-you-know-about-1c/. 
  6. "1C:Enterprise 8.3. Developer Guide. Chapter 1. Concept of the System | 1C:Enterprise" (in en-US). https://yellow-erp.com/page/guides/dev/concept-of-the-system/. 
  7. 7.0 7.1 "1C:Enterprise 8.3. Developer Guide. Chapter 27. Debugging and Testing of Application Solutions | 1C:Enterprise" (in en-US). https://yellow-erp.com/page/guides/dev/debugging-and-testing-of-application-solutions/. 
  8. "1C:Enterprise 8.3. Developer Guide. Chapter 4. 1C:Enterprise Script | 1C:Enterprise" (in en-US). https://yellow-erp.com/page/guides/dev/1c-enterprise-script/. 
  9. "1C:Enterprise Development Tools". https://1c-dn.com/library/1c_enterprise_development_tools/. 
  10. Syntax definition rules for 1C:Enterprise 8 in TextMate format: 1c-syntax/1c-syntax, 1c-syntax, 2019-03-13, https://github.com/1c-syntax/1c-syntax, retrieved 2019-04-29 
  11. Syntax definition rules for 1C:Enterprise 8 in VSC: 1c-syntax/vsc-language-1c-bsl, 1c-syntax, 2019-03-28, https://github.com/1c-syntax/vsc-language-1c-bsl, retrieved 2019-04-29