<commit_before>
<!-- This file is the project homepage at github.com/google/skylark -->

# Skylark in Go

This is the home of the _Skylark in Go_ project.
Skylark in Go is an interpreter for Skylark, implemented in Go.

Skylark is a dialect of Python intended for use as a configuration language.
Like Python, it is an untyped dynamic language with high-level data
types, first-class functions with lexical scope, and garbage collection.
Unlike CPython, independent Skylark threads execute in parallel, so
Skylark workloads scale well on parallel machines.
Skylark is a small and simple language with a familiar and highly
readable syntax. You can use it as an expressive notation for
structured data, defining functions to eliminate repetition, or you
can use it to add scripting capabilities to an existing application.

A Skylark interpreter is typically embedded within a larger
application, and the application may define additional domain-specific
functions and data types beyond those provided by the core language.
For example, Skylark was originally developed for the
[Bazel build tool](https://bazel.build).
Bazel uses Skylark as the notation both for its BUILD files (like
Makefiles, these declare the executables, libraries, and tests in a
directory) and for [its macro
language](https://docs.bazel.build/versions/master/skylark/language.html),
through which Bazel is extended with custom logic to support new
languages and compilers.


## Documentation

* Language definition: [doc/spec.md](doc/spec.md)

* About the Go implementation: [doc/impl.md](doc/impl.md)

* API documentation: [godoc.org/github.com/google/skylark](https://godoc.org/github.com/google/skylark)

* Mailing list: [skylark-go](https://groups.google.com/forum/#!forum/skylark-go)

* Issue tracker: [https://github.com/google/skylark/issues](https://github.com/google/skylark/issues)

* Travis CI: ![Travis CI](https://travis-ci.org/google/skylark.svg) [https://travis-ci.org/google/skylark](https://travis-ci.org/google/skylark)

### Getting started

Build the code:

```shell
$ go get github.com/google/skylark
$ go build github.com/google/skylark/cmd/skylark
```

Run the interpreter:

```
$ cat coins.sky
coins = {
  'dime': 10,
  'nickel': 5,
  'penny': 1,
  'quarter': 25,
}
print('By name:\t' + ', '.join(sorted(coins.keys())))
print('By value:\t' + ', '.join(sorted(coins.keys(), key=coins.get)))

$ ./skylark -lambda coins.sky
By name:	dime, nickel, penny, quarter
By value:	penny, nickel, dime, quarter
```

Interact with the read-eval-print loop (REPL):

```
$ ./skylark
>>> def fibonacci(n):
...    res = list(range(n))
...    for i in res[2:]:
...        res[i] = res[i-2] + res[i-1]
...    return res
...
>>> fibonacci(10)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
>>>
```

### Contributing

We welcome submissions but please let us know what you're working on
if you want to change or add to the Skylark repository.

Before undertaking to write something new for the Skylark project,
please file an issue or claim an existing issue.<commit_msg>README: -lambda flag no longer needed by example<commit_after>
<!-- This file is the project homepage at github.com/google/skylark -->

# Skylark in Go

This is the home of the _Skylark in Go_ project.
Skylark in Go is an interpreter for Skylark, implemented in Go.

Skylark is a dialect of Python intended for use as a configuration language.
Like Python, it is an untyped dynamic language with high-level data
types, first-class functions with lexical scope, and garbage collection.
Unlike CPython, independent Skylark threads execute in parallel, so
Skylark workloads scale well on parallel machines.
Skylark is a small and simple language with a familiar and highly
readable syntax. You can use it as an expressive notation for
structured data, defining functions to eliminate repetition, or you
can use it to add scripting capabilities to an existing application.

A Skylark interpreter is typically embedded within a larger
application, and the application may define additional domain-specific
functions and data types beyond those provided by the core language.
For example, Skylark was originally developed for the
[Bazel build tool](https://bazel.build).
Bazel uses Skylark as the notation both for its BUILD files (like
Makefiles, these declare the executables, libraries, and tests in a
directory) and for [its macro
language](https://docs.bazel.build/versions/master/skylark/language.html),
through which Bazel is extended with custom logic to support new
languages and compilers.


## Documentation

* Language definition: [doc/spec.md](doc/spec.md)

* About the Go implementation: [doc/impl.md](doc/impl.md)

* API documentation: [godoc.org/github.com/google/skylark](https://godoc.org/github.com/google/skylark)

* Mailing list: [skylark-go](https://groups.google.com/forum/#!forum/skylark-go)

* Issue tracker: [https://github.com/google/skylark/issues](https://github.com/google/skylark/issues)

* Travis CI: ![Travis CI](https://travis-ci.org/google/skylark.svg) [https://travis-ci.org/google/skylark](https://travis-ci.org/google/skylark)

### Getting started

Build the code:

```shell
$ go get github.com/google/skylark
$ go build github.com/google/skylark/cmd/skylark
```

Run the interpreter:

```
$ cat coins.sky
coins = {
  'dime': 10,
  'nickel': 5,
  'penny': 1,
  'quarter': 25,
}
print('By name:\t' + ', '.join(sorted(coins.keys())))
print('By value:\t' + ', '.join(sorted(coins.keys(), key=coins.get)))

$ ./skylark coins.sky
By name:	dime, nickel, penny, quarter
By value:	penny, nickel, dime, quarter
```

Interact with the read-eval-print loop (REPL):

```
$ ./skylark
>>> def fibonacci(n):
...    res = list(range(n))
...    for i in res[2:]:
...        res[i] = res[i-2] + res[i-1]
...    return res
...
>>> fibonacci(10)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
>>>
```

### Contributing

We welcome submissions but please let us know what you're working on
if you want to change or add to the Skylark repository.

Before undertaking to write something new for the Skylark project,
please file an issue or claim an existing issue.
{'fraction_non_alphanumeric': 0.11734777613655013, 'fraction_numerical': 0.007877892663712457, 'mean_word_length': 4.2945264986967855, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1105806', 'n_tokens_mistral': 1998, 'n_tokens_neox': 1885, 'n_words': 707}