- Start providing a rollup-based build
- Fix an issue with calling protocol methods from within a protocol implementation, it would call the current implementation, instead of dispatching through the protocol.
- Add
reactive:cursor
- form-2 components in
piglet:web/ui
- make sure identifiers with a trailing
?
have a correct.-name
field
- docstring support, and first batch of docstrings
- new modules
reactive
reactive primitives: cell, formulaweb/ui
declarative reactive UI layercbor
reimplement CBOR codec in Piglet directly, with support for identifiers (Sym/QSym/Keyword/QName)
- new
piglet:lang
built-ins*data-readers*
*print-max-depth*
bit-and
bit-or
bit-shift-left
bit-shift-right
bit-xor
box
(replacesreference
)declare
distinct
parse-identifier
some?
transpose
vary-meta
- function versions of built-ins/operators (for use in higher order functions)
- Special forms
while
loop
/recur
try
/catch
/finally
as->
string:trim
- Implement
Lookup
(index access) andMutableAssociative
(conj!
/assoc!
) for Array/TypedArray/ArrayBuffer - Special number syntax:
0x...
(hex) and<base>r<number>
(radix) - Arity checking (emits a warning, we don't have multi-arity functions yet so this is still needed)
- Using statements within binary expressions
- Make built-in datastructures more well-behaved in JS land
toJSON
supportnodejs.util.inspect.custom
handlers
- Fix handling of special symbols
&
andjs:...
in syntax quote - Fix printing of
ArrayBuffer
and TypedArray - Handle multiple keys in
dissoc
- Line number tracking improvements
- Associative destructuring (keys/syms/props/strs)
- Syntax for regex:
%r/pattern/modifiers
(choose your own delimiters) - Free-spacing mode for regex with the
x
modifier:%r"... whitespace-and-comments..."x
- %q(...) (strings) / %w[...] (words)
binding
macro(var ...)
/#'
special form- string API: conversions to/from dromedary case
- stirng API: starts-with? ends-with? includes?
- PDP Bookmarklet (see getting started docs)
- Fixed map over iterators
- re-find / re-seq: return the string match rather than an array if there are no capturing group
- Fix walk over sets
- Hash codes are now cached in a weakmap, rather than on the object using a Symbol (because we can't set a property on frozen objects)
- Give frozen js objects value-based hashes, other objects get identity (incrementing) hashes
*verbosity*
is now a var rather than a compiler setting- When using one or more
-v
/--verbose
flag, only up the verbosity after the piglet core has loaded
- string module: upcase, downcase, subs, capitalize, join, split, {kebap,camel,snake}->{kebap,camel,snake}
- regex syntax: /foo/imgs
- dev-server: deal with arrays in exports
- dev-server: deal with missing package.json
- move join/split to string module
- Provide more bang versions (
assoc!
,dissoc!
,update-in!
) that mutate - Implement hashable for Function, RegExp, Boolean, BigInt, Array, Symbol, ...
- Support Ctrl-D in the REPL
- dev-server: handle wildcards in "exports" in node modules package.json
- dev-server: add doctype to index.html
- dev-server: create a stub package.pig if missing
- API: set?, assoc!, dissoc!, special-form?, update!, update-in!, assoc-in!
- Syntax-quote: improve handling of symbols
- JS interop docs update
- Fix regression: empty lets are allowed
- Change in policy: emitting undefined is allowed
- Fix multi-arg (> 2) binary operators
- Analyze forms inside set literals (allow computed values)
- Make sure
for
returns a sequence/list (not a vector/array) - dev-server: don't die if node_modules is missing
- Drop the
oset
/oget
/okeys
/oassoc
/... functions - Instead make regular
get
,assoc
etc work with JS arrays/objects - Mak
type
also lookup the constructor on functions (for Keyword etc) - DOM API: rename query to query-one (vs query-all)
bin/piglet
tweaks
This is a pretty big release, some highlights:
- dev-server for much easier onramp when doing webdev
- source maps support (in the browser, if the source-map library is present)
- add syntax-quote (backtick)
- compile directly to JS operators (unary and binary, e.g. +, and, not) if possible, while falling back to the function version, e.g. when used in higher order functions
- added
reduced
for short-circuiting reductions - significant performance improvements
- add sets (
#{}
) - makes sets and dicts callable
- much improved sequential destructuring
- support unicode codepoints in string (
"\u{1234}"
), including higher-plain ones - add --eval / -e flag to piglet script
- Nodejs 17 support (before we required at least 18)
- Add completion support to pdp-client.el (see also the counterpart of this in pdp.el)
- Make TypedArray (e.g. Uint8Buffer) and ArrayBuffer seqable, and make them print nicely
- toJSON support in collections, so you can call JSON.stringify on them
- DOM wrapper API
- Allow a bare symbol as an import
- Specifying a package id is optional (will use URI derived from package location)
- Interop improvements: keyword lookup for plain JS objects, ->pig/->js lazy nested conversions (still lots of thinking and improving to do around interop)
- Lots of additional core API: ->js ->pig apropos apropos boolean? constantly defmethod defmulti defonce doto drop empty? ffirst fnil fqn frequencies get-in hash-code hash-combine identifier? juxt keep max merge min not= object? oget okeys oset ovals rand-int rand-nth reference repeatedly reset! run! sort take type-name undefined? vector vector?
load-package
as shorthand for(.load_package *compiler* ...)
- More getting started docs on how to use in the browser
- [browser] only resolve relative JS imports, leave the others to be handled by the browser (i.e. by an
importmap
)
- [browser] resolve piglet:lang relative to the location that browser/main.mjs was loaded from
- This enables loading Piglet from a CDN
bin/piglet
convenience wrapper- "Getting Started" doc
- pdp-client
- add the resolve-meta operation, useful for "jump-to-definition"
- Core API
- split / join
- spit
- re-find / re-seq
- -> / ->> / cond->
- piglet:dom namespace
- convenience wrappers around W3C DOM
- Piglet forms to HTMLElement rendering
- QName: retain suffix/prefix info when expanding from PrefixName
- useful for XML namespace handling
- Default context: add SVG xml namespace
- Async versions of
reduce
andfor
:(for ^:async [...] ...)
-> can use(await)
in the body, and returns a promise of a sequence - Move piglet-mode/pdp.el to a separate
piglet-emacs
repo
- Import of js packages with an '@' in their name
- Allow destructuring in doseq/for
- Multi-arg boolean operators (e.g.
(< 1 2 3)
)- compile to
1 < 2 && 2 <3
instead of1 < 2 < 3
- compile to
- Make imports of node_modules relative to the importing package
- Make
*current-context*
a regular dict, rather than aContext
wrapper
Significantly improved module system. First version to use full URI/QSym identifiers.
Initial alpha releases.