Submission declined on 8 December 2024 by Ktkvtsh (talk).
Where to get help
How to improve a draft
You can also browse Wikipedia:Featured articles and Wikipedia:Good articles to find examples of Wikipedia's best writing on topics similar to your proposed article. Improving your odds of a speedy review To improve your odds of a faster review, tag your draft with relevant WikiProject tags using the button below. This will let reviewers know a new draft has been submitted in their area of interest. For instance, if you wrote about a female astronomer, you would want to add the Biography, Astronomy, and Women scientists tags. Editor resources
|
Paradigm | scripting, procedural (imperative) |
---|---|
First appeared | 2015 |
Typing discipline | Dynamic |
OS | Cross-platform |
Filename extensions | .star |
Website | github |
Major implementations | |
starlark-go, starlark-rust, | |
Influenced by | |
Python |
Starlark is a lightweight, high-level, programming language designed for embedded use in applications. It uses a subset of the Python syntax.[1]
History
editStarlark was released in 2015 as part of Bazel under the name Skylark[2]. This first implementation was written in Java. In 2018, the language was renamed Starlark[3].
In 2017, a new implementation of Starlark in Go was announced.[4]
In 2021, Meta announced an implementation of Starlark written in Rust[5], to be used for the Buck build system[6][7].
Popularity
editIn addition to the Bazel and Buck build systems, Starlark is used by dozens of projects[8], including Isopod[9], and skycfg[10].
On GitHub, Starlark is among the top 50 languages based on the developer activity.[11][12]
Syntax
editSimilar to Python syntax, Starlark syntax relies on indentation to delimit blocks.
Statements and control flow
editStarlark's statements include:
- The
=
statement to assign a value to a variable - The augmented assignment statements to modify a variable
- The
if
statement to execute conditionally a block of code (withelse
orelif
) - The
for
statement to iterate over an iterable object - The
def
statement to define a function - The
break
statement to exit a loop - The
continue
statement to skip the rest of the current iteration and continues with the next - The
pass
statement, serving as a NOP, syntactically needed to create an empty code block - The
return
statement to return a value from a function. - The
load
statement, which replaces Pythonimport
, to import a value from another module.
Unlike Python, Starlark statements don't include: while
, try
, raise
, class
, with
, del
, assert
, yield
, import
, match
and case
.
Freezing
editTo ensure thread safety and support parallel computing, Starlark has a feature called freezing. At the end of the evaluation of a module, all values become immutable. So the values that can be accessed from multiple threads can no longer be modified. This removes the risk of race conditions.[13]
See also
editReferences
edit- ^ "starlark/spec.md at master · bazelbuild/starlark". GitHub.
- ^ "A glimpse of the design of Skylark". blog.bazel.build.
- ^ "Starlark". blog.bazel.build.
- ^ Donovan, Alan (18 November 2017). A Go implementation of the Skylark Configuration Language. GothamGo 2017 – via YouTube.
- ^ Mitchell, Neil (8 April 2021). "The Rust Starlark library".
- ^ "Meta open-sources 'significantly faster' build system". InfoWorld.
- ^ "5 Things you didn't know about Buck2". 23 October 2023.
- ^ "Starlark Programming Language". starlark-lang.org.
- ^ Xu, Charles; Ilyevskiy, Dmitry (2019). Isopod: An expressive DSL for Kubernetes configuration. Proceedings of the ACM Symposium on Cloud Computing.
- ^ Norton, Peter (2019). "Other Faces of Python" (PDF). login Usenix Mag. 44 (2).
- ^ "Global Metrics: Programming Languages". Innovation Graph. GitHub.
- ^ https://tjpalmer.github.io/languish/
- ^ "starlark/spec.md at master · bazelbuild/starlark". GitHub.
- in-depth (not just passing mentions about the subject)
- reliable
- secondary
- independent of the subject
Make sure you add references that meet these criteria before resubmitting. Learn about mistakes to avoid when addressing this issue. If no additional references exist, the subject is not suitable for Wikipedia.