

# Getting started with programming runtimes
<a name="language-runtimes"></a>

AL2 provides different versions of certain language runtimes. We work with upstream projects, such as PHP, that support multiple versions at the same time. To find information about how to install and manage these name-versioned packages, use the `yum` command to search and install these packages. For more information, see [Package repository](ec2.md#package-repository).

The following topics describe how each language runtime functions in AL2.

**Topics**
+ [C, C\$1\$1, and Fortran in AL2](c-cplusplus.md)
+ [Go in AL2](go.md)
+ [Java in AL2](java.md)
+ [Perl in AL2](perl.md)
+ [PHP in AL2](php.md)
+ [Python in AL2](python.md)
+ [Rust in AL2](rust.md)

# C, C\$1\$1, and Fortran in AL2
<a name="c-cplusplus"></a>

AL2 includes both the GNU Compiler Collection (GCC) and the Clang frontend for LLVM.

The major version of GCC will remain constant throughout the lifetime of AL2. Bug and security fixes might be backported to the major version of GCC that ships in AL2.

 By default, AL2 includes version 7.3 of GCC which builds almost all packages. The `gcc10` package makes GCC 10 available to a limited extent, but we don't recommend using GCC 10 to build packages. 

 The default compiler flags that build AL2 RPMs include some optimization and hardening flags. We recommend that you include some optimization and hardening flags if you are building your own code with GCC. 

 The default compiler and optimization flags in AL2023 improve upon what is present in AL2. 

# Go in AL2
<a name="go"></a>

 You might want to build your own code written in [https://go.dev/](https://go.dev/) on Amazon Linux using a toolchain provided with AL2. 

 The Go toolchain will be updated throughout the life of AL2. This might be in response to any CVE in the toolchain we ship, or as a prerequisite of addressing a CVE in another package. 

 Go is a relatively fast moving programming language. There might be a situation where existing applications written in Go have to adapt to new versions of the Go toolchain. For more information about Go, see [Go 1 and the Future of Go Programs](https://go.dev/doc/go1compat).

 Although AL2 will incorporate new versions of the Go toolchain during its life, this will not be in lockstep with the upstream Go releases. Therefore, using the Go toolchain provided in AL2 might not be suitable if you want to build Go code using cutting-edge features of the Go language and standard library. 

 During the lifetime of AL2, earlier package versions are not removed from the repositories. If an earlier Go toolchain is required, you can choose to forgo bug and security fixes of newer Go toolchains and install an earlier version from the repositories using the same mechanisms available for any RPM. 

 If you want to build your own Go code on AL2 you can use the Go toolchain included in AL2 with the knowledge that this toolchain might move forward through the lifetime of AL2. 

# Java in AL2
<a name="java"></a>

 AL2 provides several versions of [Amazon Corretto](https://aws.amazon.com/corretto/) to support Java based workloads, as well as some OpenJDK versions. We recommend that you migrate to [Amazon Corretto](https://aws.amazon.com/corretto/) in preparation for migrating to AL2023. 

 Corretto is a build of the Open Java Development Kit (OpenJDK) with long-term support from Amazon. Corretto is certified using the Java Technical Compatibility Kit (TCK) to ensure it meets the Java SE standard and is available on Linux, Windows, and macOS. 

 An [Amazon Corretto](https://aws.amazon.com/corretto/) package is available for each of Corretto 1.8.0, Corretto 11, and Corretto 17. 

 Each Corretto version in AL2 is supported for the same period of time as the Corretto version is, or until the end of life of AL2, whichever is sooner. For more information, see the [Amazon Corretto FAQs](https://aws.amazon.com/corretto/faqs). 

# Perl in AL2
<a name="perl"></a>

AL2 provides version 5.16 of the [https://www.perl.org/](https://www.perl.org/) programming language.

## Perl modules in AL2
<a name="perl-modules"></a>

Various Perl modules are packaged as RPMs in AL2. Although there are many Perl modules available as RPMs, Amazon Linux does not try to package every possible Perl module. Modules packaged as RPMs might be relied upon by other operating system RPM packages, so Amazon Linux will prioritize ensuring they are security patched over pure feature updates. 

AL2 also includes `CPAN` so that Perl developers can use the idiomatic package manager for Perl modules.

# PHP in AL2
<a name="php"></a>

 AL2 currently provides two fully supported versions of the [https://www.php.net/](https://www.php.net/) programming language as part of [AL2 Extras Library](al2-extras.md). Each PHP version is supported for the same time frame as upstream PHP as listed under deprecated date in [List of Amazon Linux 2 Extras](al2-extras-list.md).

For information about how to use AL2 Extras to install application and software updates on your instances, see [AL2 Extras Library](al2-extras.md).

 To assist migration to AL2023, both PHP 8.1 and 8.2 are available on AL2 and AL2023. 

**Note**  
 AL2 includes PHP 7.1, 7.2, 7.3, and 7.4 in `amazon-linux-extras`. All of these Extras are EOL and are not guaranteed to get any additional security updates.   
 To find out when each version of PHP is deprecated in AL2, see the [List of Amazon Linux 2 Extras](al2-extras-list.md). 

## Migrating from earlier PHP 8.x versions
<a name="php-migration"></a>

 The upstream PHP community put together [ comprehensive migration documentation for moving to PHP 8.2 from PHP 8.1](https://www.php.net/migration82). Documentation also exists for [migrating from PHP 8.0 to 8.1](https://www.php.net/migration81). 

 AL2 includes PHP 8.0, 8.1, and 8.2 in `amazon-linux-extras` that enables an efficient upgrade path to AL2023. To find out when each version of PHP is deprecated in AL2, see the [List of Amazon Linux 2 Extras](al2-extras-list.md).

## Migrating from PHP 7.x versions
<a name="php-migration-7x"></a>

 The upstream PHP community put together [ comprehensive migration documentation for moving to PHP 8.0 from PHP 7.4](https://www.php.net/migration80). Combined with the documentation referenced in the previous section on migrating to PHP 8.1, and PHP 8.2, you have all of the steps needed to migrate your PHP based application to modern PHP. 

The [https://www.php.net/](https://www.php.net/) project maintains a list and schedule of [supported versions](https://www.php.net/supported-versions.php), along with a list of [unsupported branches](https://www.php.net/eol.php).

**Note**  
 When AL2023 was released, all 7.x and 5.x versions of [https://www.php.net/](https://www.php.net/) were not supported by the [https://www.php.net/](https://www.php.net/) community, and were not included as options in AL2023. 

# Python in AL2
<a name="python"></a>

 AL2 provides support and security patches for Python 2.7 until June 2026, as part of our long-term support commitment for AL2 core packages. This support extends beyond the upstream Python community declaration of Python 2.7 EOL of January 2020. 

**Note**  
 AL2023 completely removed Python 2.7. Any components requiring Python are now written to work with Python 3. 

 AL2 uses the `yum` package manager that has a hard dependency on Python 2.7. In AL2023, the `dnf` package manager has migrated to Python 3, and no longer requires Python 2.7. AL2023 has completely moved to Python 3. We recommend that you complete your migration to Python 3. 

# Rust in AL2
<a name="rust"></a>

 You might want to build your own code written in [https://www.rust-lang.org/](https://www.rust-lang.org/) on AL2 using a toolchain provided with AL2. 

 The Rust toolchain will be updated throughout the life of AL2. This might be in response to a CVE in the toolchain we ship, or as prerequisite for a CVE update in another package. 

 [https://www.rust-lang.org/](https://www.rust-lang.org/) is a relatively fast moving language, with new releases at approximately a six-week cadence. The new releases might add new language or standard library features. Although AL2 will incorporate new versions of the Rust toolchain during its life, this will not be in lockstep with the upstream Rust releases. Therefore, using the Rust toolchain provided in AL2 might not be suitable if you want to build Rust code using cutting-edge features of the Rust language. 

 During the lifetime of AL2, previous package versions are not removed from the repositories. If a previous Rust toolchain is required, you can choose to forgo bug and security fixes of newer  Rust toolchains and install a previous version from the repositories using the same processes available for any RPM. 

 To build your own Rust code on AL2, use the Rust toolchain included in AL2 with the knowledge that this toolchain might move forward throughout the lifetime of AL2. 