Commit Graph

45 Commits

Author SHA1 Message Date
Jen Basch
9427387019 Add release notes for 0.30 (#1261)
Co-authored-by: Dan Chao <dan.chao@apple.com>
2025-10-30 10:09:35 -07:00
Daniel Chao
99020bb79d Add support for HTTP rewrites (#1062)
This adds a new configuration option for the HTTP client to replace URI prefixes when making outbound calls.

Follows the design of https://github.com/apple/pkl-evolution/pull/17
2025-07-16 15:53:31 -07:00
Daniel Chao
e9320557b7 Introduces Bytes class (#1019)
This introduces a new `Bytes` standard library class, for working with
binary data.

* Add Bytes class to the standard library
* Change CLI to eval `output.bytes`
* Change code generators to map Bytes to respective underlying type
* Add subscript and concat operator support
* Add binary encoding for Bytes
* Add PCF and Plist rendering for Bytes

Co-authored-by: Kushal Pisavadia <kushi.p@gmail.com>
2025-06-11 16:23:55 -07:00
Sitaktif
919d63e51a docs: fixed referenced property in "fixed" section (#1065) 2025-05-08 15:52:40 +02:00
Daniel Chao
cf889246fd Add release notes for 0.28 (#978)
Co-authored-by: Islon Scherer <islonscherer@gmail.com>
2025-02-26 07:52:21 -08:00
Daniel Chao
fcce5c7e11 Replace dead links to ANTLR parser grammar (#973) 2025-02-21 08:26:49 -08:00
Michael Case
350b71a634 Fix incorrect glob example (#956)
Correct glob docs and use realistic file extensions.
2025-02-14 13:31:04 -08:00
Daniel Chao
28df90527b Add docs for various keywords (#955) 2025-02-14 13:30:22 -08:00
Josh B
f56b1bb84f Test and document supercalls using the same method/property name (#943) 2025-02-12 21:10:37 -08:00
Islon Scherer
b526902bf0 Replace ANTLR with hand-rolled parser (#917)
Co-authored-by: Kushal Pisavadia <kushi.p@gmail.com>
Co-authored-by: Daniel Chao <daniel.h.chao@gmail.com>
2025-02-12 18:11:00 +01:00
Daniel Chao
7c3f8ad261 Improve documentation about Set/Map ordering (#944)
The language reference and stdlib are both slightly incorrect;
maps and sets are ordered when iterated on, but unordered in terms of
equality.
2025-02-12 06:43:51 -08:00
Vic
75bd21420b Document where to find all keywords (#892) 2025-01-21 13:03:43 -08:00
Josh Soref
d9c65d484a Fix spelling errors (#846)
Also: change checksums due to filename and content changes, and fix language snippet test output to produce correct error messages
2024-12-23 12:49:56 -08:00
Daniel Chao
6fd82a5bb8 Clarify terminology on renderer converters (#860) 2024-12-20 10:36:51 -08:00
Josh B
666f8c3939 Implement SPICE-0009 External Readers (#660)
This adds a new feature, which allows Pkl to read resources and modules from external processes.

Follows the design laid out in SPICE-0009.

Also, this moves most of the messaging API into pkl-core
2024-10-28 18:22:14 -07:00
Daniel Chao
ce25cb8ef0 Add analyze imports libs (SPICE-0001) (#695)
This adds a new feature to build a dependency graph of Pkl programs, following the SPICE outlined in https://github.com/apple/pkl-evolution/pull/2.

It adds:
* CLI command `pkl analyze imports`
* Java API `org.pkl.core.Analyzer`
* Pkl stdlib module `pkl:analyze`
* pkl-gradle extension `analyze`

In addition, it also changes the Gradle plugin such that `transitiveModules` is by default computed from the import graph.
2024-10-23 14:36:57 -07:00
Jens Teglhus Møller
9b5c5a5c98 Fix error in spread documentation (#704) 2024-10-17 07:16:53 -07:00
Daniel Chao
2add291375 Fix formatting of let expressions (#702) 2024-10-17 07:02:24 -07:00
Philip K.F. Hölzenspies
421711be10 Improve let-expression examples (#680) (#699)
Because I did not understand what a `Let Expression` should be and the example code was more confusing as explanatory, I changed the format of the examples a little bit and changed the result.

- It should be clear that the example is just one code-line
- I tried out the example (`pkl eval...`) and get a little bit different result

Co-authored-by: ManuW <ManuW@users.noreply.github.com>
2024-10-16 13:10:48 +01:00
Josh B
7001a42149 [docs] Add documentation for new keyword (#624) 2024-08-29 15:25:14 -07:00
Josh B
e5b7e046d9 [docs] Improve searchability of "Methods" section (#625) 2024-08-19 15:54:46 -07:00
Josh B
a9c4963a4a [docs] Document the class-as-a-function pattern (#614) 2024-08-15 17:06:56 -07:00
Josh B
bbdc45656c [docs] Document hidden equality/hashing behavior (#618)
* [docs] Document `hidden` equality/hashing behavior

* Update docs/modules/language-reference/pages/index.adoc

---------

Co-authored-by: Daniel Chao <daniel.h.chao@gmail.com>
2024-08-13 09:56:15 +02:00
Josh B
c445770261 [docs] Add mention of "optional" to nullably types section (#613) 2024-08-07 12:18:50 -07:00
Alan Scherger
4a7f90157a Documentation fix: const cannot be assigned/amended (#485) 2024-06-14 10:10:41 -07:00
Daniel Chao
a4c0a271b4 Require references from typealiases to be const (#516)
This adds a language change that requires references from typealiases
to the enclosing module to be `const`.

This is required because typealiases are not late-bound.

Rationale is laid out in SPICE-0007.

Also:
* Update documentation to reflect new rules.
* Fix `Project.pkl`; mark method `const` to not break said rule.
2024-06-10 09:01:05 -07:00
Daniel Chao
8ec06e631f Add support for Windows (#492)
This adds support for Windows.
The in-language path separator is still `/`, to ensure Pkl programs are cross-platform.

Log lines are written using CRLF endings on Windows.
Modules that are combined with `--module-output-separator` uses LF endings to ensure
consistent rendering across platforms.

`jpkl` does not work on Windows as a direct executable.
However, it can work with `java -jar jpkl`.

Additional details:

* Adjust git settings for Windows
* Add native executable for pkl cli
* Add jdk17 windows Gradle check in CI
* Adjust CI test reports to be staged within Gradle rather than by shell script.
* Fix: encode more characters that are not safe Windows paths
* Skip running tests involving symbolic links on Windows (these require administrator privileges to run).
* Introduce custom implementation of `IoUtils.relativize`
* Allow Gradle to initialize ExecutableJar `Property` values
* Add Gradle flag to enable remote JVM debugging

Co-authored-by: Philip K.F. Hölzenspies <holzensp@gmail.com>
2024-05-28 15:56:20 -07:00
translatenix
5de90d5868 Improve method.isConst() checks in InvokeMethodVirtualNode
- Check `method.isConst()` every time a method is resolved
  instead of once per node instance (`isConstChecked`).
  Given that `needsConst` only happens in very specific circumstances,
  I'm not entirely sure if every resolved method needs to be checked.
  However, it's a cleaner solution in any case, and `method.isConst()`
  is a fast check that also never happens on the `evalCached` fast path.
- Do not check for const-ness of `FunctionN.apply` methods.
  This check seems unnecessary and would always fail if triggered.
  (According to `base.pkl`, none of the `FunctionN.apply` methods is const.)
- Remove unnecessary Truffle boundaries for modifier checks,
  which are just bitwise operations.
- Improve const/import docs.
2024-04-19 15:35:57 -07:00
Phillip
ccf95d2af1 Correct spelling and grammar issues in Language Reference (#435)
Changes include:
1. Spelling correction addressing #401
2. Grammer and punctuation corrections.
3. Rephrasing of some harder-to-read sentences. Most are simple one or two-word additions to make reading less jarring.
4. Changed hyphenation occurrences that included &ndash; rather than a regular hyphen-dash.
2024-04-17 16:44:19 -07:00
Lily Ballard
889e64586a Fix member links custom link text examples in language reference (#427) 2024-04-12 13:35:08 -07:00
translatenix
3bd91b92ee Fix "amends declaration vs. expression" mistakes in language reference 2024-04-03 19:06:54 +01:00
d4wae89d498
3fb1f03780 Fix missing closing quotes in Local dependencies #298 (#299)
Fix missing closing quotes in 'Local Dependencies' section of index.adoc to ensure syntax correctness.
2024-03-07 10:42:10 -08:00
Daniel Chao
4f3858aaaf Docs fix: Container is not a type, add more types (#282)
Adjusts documentation to remove legacy `Container` type,
and add the rest of the generic types in the stdlib.
2024-03-04 07:49:44 -08:00
Daniel Chao
b0161a4777 Add specification for language binding API (#257)
This adds documentation for how the language bindings works, for those that wish to create their own bindings.
2024-02-28 08:10:16 -08:00
Zack McCauley
8f130d8d49 Fix multiple output example code (#205) 2024-02-22 10:28:23 +01:00
Islon Scherer
c652bbe5cd fix typo in doc for Listing default (#224) 2024-02-21 18:56:11 +01:00
Lily Ballard
bbb4d828a0 Update Reserved keywords list in the Language Reference (#171)
`const` is not reserved, it has a meaning already. And `match` is not a keyword at all.
2024-02-19 13:37:47 +01:00
Philip K.F. Hölzenspies
b3fb5dced6 Apply suggestions from code review 2024-02-13 16:57:12 +00:00
Hoxell
99717c61af Pigeon -> dodo 2024-02-13 16:57:12 +00:00
Daniel Chao
97f4193c15 Fix more links (#104)
This fixes more documentation links that are producing 404's.
2024-02-08 15:20:02 -08:00
Ricardo Pinheiro
20adac9919 Update Hidden Properties documentation (#91) 2024-02-07 21:15:53 -08:00
kelvine
9bc7ada4ae fixed typo on transiti[ti]on 2024-02-07 20:09:57 +00:00
Lily Ballard
bb3e3929ac Fix missing pkl eval subcommand in documentation examples 2024-02-07 20:04:41 +00:00
Dimitris Apostolou
80aff3afad Fix typos 2024-02-04 18:55:08 +02:00
Peter Niederwieser
ecad035dca Initial commit 2024-02-01 14:00:22 -08:00