Releases: thesephist/oak
Oak 0.3!
Oak v0.3 is a fairly incremental release, as Oak is becoming more stable and dependable for my day-to-day work. There are a few fixes to the standard library and some new APIs, but no big breaking changes or shifts in direction.
The headline feature of Oak v0.3 is oak pack
, which lets you create binaries that can be distributed as standalone executables from an Oak program.
Oak := { versions: ['0.1', '0.2'] }
Oak.versions << '0.3'
Standard library additions
std.(is, constantly, exclude, separate, fromEntries )
in the standard'std'
modulestd.(aloop, serial, parallel)
for iterating asynchronously in sequence or parallelhttp.query(Encode, Decode)
for safely encoding and decoding percent-encoded data
Improvements
oak pack
for producing standalone executable binaries with Oak — covered in more depth in this blog___runtime_proc
built-in function when running natively, to inspect process details, e.g.{ exe: '/Users/thesephist/go/bin/oak', pid: 94801 }
Fixes
- Oak strings can now contain any binary data, including those that may be invalid UTF-8
- Fix interpreter crashes while parsing certain broken string literals
- Fix interpreter crashes when taking a modulus of a number by 0
- Fix bugs that may result in strings rendered incorrectly when compiling to JavaScript (
e87baf5
and3e22e5d
) - Ensure
libpath.resolve
returns a clean path - The
datetime
standard library no longer uses an explicitmillis
millisecond property when parsing timestamps, instead using fractional seconds. The same change also ensures that timestamps returned bydatetime.format
only show up to 3 decimal-places of seconds.
Oak 0.2!
There's been a huge wave of improvements, fixes, and additions since v0.1 less than two months ago. The highlights include a static site generation system for the Oak website, expanded standard library modules, a much-improved and optimized Oak-to-JavaScript compiler, a built-in syntax highlighter, and oak eval
/ oak pipe
commands.
std := import('std')
Oak := { version: '0.1' }
Oak |> std.merge({ version: '0.2' })
Standard library additions
std.(take, takeLast)
in the standard'std'
modulestd.stdin
to read all of standard input in the'std'
modulestd.loop
can now return meaningful values from within the loopstr.trimStart
andstr.trimEnd
now have forms with optional second argument, which will trim all whitespace to match the behavior ofstr.trim
sqrt, hypot, scale, bearing, orient, prod, clamp
in the standard'math'
module- Statistics functions
mean, median, stddev
in the standard'math'
module t.approx
for comparing floating-point values in the'test'
modulefmt.format
now also accepts format string variables that key into objects, rather than integer-index into the argument list. This means expressions likefmt.format('{{ name }}: {{ age }}, userProfile)
work.
Improvements
- Boolean combinators
&
and|
now short-circuit in Oak oak cat
for syntax highlighting Oak files in the command lineoak eval
andoak pipe
for evaluating Oak code from the UNIX command line- The
try()
built-in function for interoperability with JavaScript's checked exceptions - Many rounds of optimizations went into the
oak build --web
compiler, including a few passes focused on bundle size. - The
oak
binary can now evaluate Oak code from standard input. - The router in the
'http'
module now accepts any HTTP header, including OPTIONS, HEAD, and others. - The standard testing module
'test'
how usesdebug.inspect
to pretty-print outputs of failing tests for more readable test results. - Tokens from
syntax.Tokenizer
now contain their byte offset position in the source file, in addition to line and column numbers. - The
input()
built-in function now reads from a single global buffer, and is capable of reading large files from standard input.
Fixes
- Fixed infinite recursion from circular imports in bundles generated by
oak build
. - Deleting keys with
o.key := _
now always works in JavaScript contexts. str.(lower, upper)
are more idiomatic and faster.str.(upper?, lower?, digit?, space?, startsWith?, endsWith?)
are faster.- Fix malformed format strings crashing
fmt.format
. - Guard against XSS vulnerabilities in the
'md'
standard library module. oak build --web
now uses the JavaScript null coalescing operator??
for safer and smaller bundles.- Fix some parser crashes caused by malformed Oak syntax input.
- Improve error messages from
syntax.Parser
to always include the syntax error position. - The
req()
built-in function now correctly returns an error event instead of crashing if the HTTP connection fails to establish.
oaklang.org is live!
The Oak website has gotten to a point where I can officially say it's not "incomplete". There's still not much documentation on the site about the language or the standard libraries, but there is:
- A directory of syntax-highlighted standard library source files
- A blog with stories and deep-dives about Oak and Oak-based projects
- A "highlight proxy" for syntax-highlighting Oak files on the web
Oak release!
This is the first release of the Oak language and Oak CLI, which includes not only the interpreter, but also a code formatter, a bundler, and an Oak-to-JavaScript compiler. 🌳
std := import('std')
std.println('Hello, World!')
Although the full language and standard library are implemented and tested in both the interpreter and the compiler, the language and the standard library may yet change in unexpected ways as I further exercise them in my day to day work. There may also be un-tested edge cases in both that merit further changes in semantics for those edge cases. Note, also, that there's... basically no documentation yet on the language or the stdlib, so if you want to venture forth and try Oak, you'll have to read the standard library to see both how to use Oak, and how the standard library works.
Nonetheless, Oak from this release can run and compile any of the samples in this repository or Oak codebases elsewhere on GitHub as of today!