Skip to content

Releases: skx/yal

v0.8.0

25 Sep 17:44
@skx skx
Compare
Choose a tag to compare
  • Added try and catch.
    • These are demonstrated by the sample code in try.lisp.
  • Rewrote argument handling to allow variadic arguments for macros.
    • Using this (cond) became possible to implement correctly.
    • Moved (cond) from being implemented in golang, to being a Lisp macro.
  • Added new macros (when), (if2), etc.
  • Added more test-cases.
  • Added (count) as an alias to (length)
    • Useful for Mal compatibility.
  • Added (strlen).
  • Added (ms), similar to (now) but with smaller units.

v0.7.0

23 Sep 13:53
@skx skx
Compare
Choose a tag to compare

New Features

This release of yal adds support for macros to the lisp interpreter, which makes us more standard and significantly more useful.

Using the macro-support our standard library of functions implemented in pure lisp has been extended to add while, repeat, and more.

The main example file, test.lisp has been updated to include some additional examples, but there is a dedicated file mtest.lisp which I used to test macro behaviour.

Minor Changes

  • Test coverage has slipped to 99.4% for our eval-package, but all other packages remain at 100%.
  • The chr and ord functions have been added.

v0.6.0

04 Aug 02:37
@skx skx
Compare
Choose a tag to compare
  • Added keys to return the (sorted) list of keys present in a hash.
    • (set! foo {:name "Steve" :location "Helsinki"})
    • (keys) -> (:location :name)
    • Added a hash.lisp showing various uses of the hash-facilities.
  • Added a recursion limit to the interpreter when running test-cases.
    • This won't hit in normal circumstances, but it stops a whole class of bogus issues from being found when running fuzz-tests.
  • Added (match "regexp" ARG)
    • Returns nil when there is no match.
    • Returns on list on a successful match, with any capture group values.
  • (and ..) and (or ..) were implemented in Lisp rather than in our golang core.
    • The less we implement in golang the better because a) it proves we're useful, and b) it allows changes to be made more easily by end-users.

v0.5.0

01 Aug 05:29
@skx skx
63668f0
Compare
Choose a tag to compare
  • Added support for reading command-line arguments.
    • When invoked via the shebang line.
    • See args.lisp for an example.
  • Added type-validation to function parameters.
  • Added new primitive to read environmental variables.
    • (getenv "PATH")
  • Symbols prefixed with : are literals
    • (print (list :foo "foo" :bar "bar"))
  • Added support for hashes using the { and } deliminators.
    • (set! foo {:name "Steve" :location "Helsinki"})
  • Added new primitive (env)
    • Return a list of hashes, with :name + :value keys for each value in the environment.
    • See dynamic.lisp for an example of using this.
  • Added get for retrieving a value from a hash, by name.
    • (set! foo {:name "Steve" :location "Helsinki"})
    • (get foo :name)
  • Added set for updating a value in a hash, by name.
    • (set! foo {:name "Steve" :location "Helsinki"})
    • (set foo :name "Bobby Tables")

v0.4.0

16 Jul 08:35
@skx skx
a0aeb76
Compare
Choose a tag to compare

This release is primarily focused upon testing and correctness:

  • We have 100% test-coverage of all our internal packages.
  • I've added support for the fuzz-testing which is available since v1.18 of the go release.

As a consequence of adding the test-coverage, and fuzzing the project for multiple hours, many many bugs and issues have been found and resolved - most of these were related to testing argument lengths for various sequences, and type-checks for functions. (e.g. (car 3) is an example of something that is obviously not supposed to work.)

New features introduced in this release:

  • # is added for exponent operations, and sqrt was provided in the standard library to use it.
  • inc and dec were embarrassingly implemented the wrong way round. Fixed now.
  • Added length to the standard library to return the number of items in a list.
  • Division by zero is caught explicitly.
  • The new sequence (error "This is wrong") was added, to allow user-driven termination of execution.
  • The ability to set a context.Context to the interpreter was added, which is useful to prevent DoS attacks against user-supplied scripts which never terminate.
  • ">" and "=" were rewritten in Lisp.
  • The ability to add optional arguments to functions was added, via the "&" prefix.

Here's what an optional argument looks like:

(define foo (lambda (a &b &c)
	(print "A:%s B:%s C:%s\n", a b c)))

(foo 1 2 3)
(foo 1 2 )
(foo 1 )

v0.3.0

11 Jul 05:15
@skx skx
Compare
Choose a tag to compare

Some new primitives were added:

  • The string functions join & split were added
  • The logic functions and & or were added.

The primitive type will now return a different value for functions implemented in lisp and golang:

  • procedure(lisp)
    • For a user-written function.
  • procedure(golang)
    • For a core function, written in golang.

In addition to those changes some of the primitives were updated to better test their arguments - both the number of arguments required, and the type of those arguments.

Finally I've added a simple variant of the cond macro, implemented in golang, which is hardwired unless/until we implement proper macros.

v0.2.0

10 Jul 07:41
@skx skx
Compare
Choose a tag to compare

This is our initial release, which contains a working lisp interpreter:

  • Variadic support for most math functions.
  • Standard library containing a bunch of common/expected functions implemented in 100% lisp
    • map, reduce, apply, etc.
  • List primitives, as you'd expect
    • append, car, cdr, cons, list, etc.
  • Useful helper methods such as print, reverse, sort, etc.

Our built-in functions are either written in lisp, or golang: