Repository navigation
Releases
Releases · AlfonsoCampodonico/homebrew-limen
Limen 0.9.0
The compiler written in Limen runs the tools, and programs run native by default.
Breaking:
limen runandlimen testbuild and run native code by default.--nativeis still accepted;--interpruns the old interpreter for this release only, with a note on stderr. With no C compiler,runhands the program tolimen eval.test --coveragestill runs interpreted.limen capslists only the program's own functions.--alladds the standard library and dependencies, and compiler-generated names are never printed.kube.watchreturns akube.Watchwith the status, the lastresourceVersionit saw and a message, so a resume loop needs noShared. AnERRORevent inside the stream, such as a 410, ends the watch with its code.
The self-hosted compiler:
limenhandscheck,caps,build,fmt,doc,mcp,search,addandindex entrytolimen-compiler, the compiler written in Limen and shipped beside it as one generated C file. Each gives the same output as the OCaml one, compared on every file in the repository and the book.LIMEN_COMPILER=ocamlkeeps them inlimen.- The self-hosted compiler fetches git dependencies and keeps
limen.lock. - A repeated
limen runstarts at once: the development build is kept and run where it is.
Language and library:
()works as a pattern:Ok(()),Some(()),((), n).Result.ok()andResult.err()give anOption.- The http server writes one line to stderr when a handler panics, with the method, path and panic message, and still answers 500.
Faster:
- A function borrows the arguments it never consumes, so calls skip a retain and a release for each one. The compiler checks itself about 9% faster.
- The self-hosted checker no longer copies its state.
Limen 0.8.16
List: pop, truncate and binary search.
xs.pop()takes the last item off a list in O(1), or givesNonewhen it is empty.xs.truncate(n)keeps the firstnitems in place. It panics on a negativenor one past the length, asBytes.truncatedoes.xs.binary_search(x)finds an item in a sorted list in O(log n), andxs.partition_point(p)gives the first index wherepstops holding, for insertion points and searches by key.
Limen 0.8.15
Collections: a heap, a deque and a set.
collectionsis a new std module, pure.Heapis a priority queue:heap()pops the smallest first,heap_by(less)takes any order (|a, b| a > b, or a struct field), andheap_of(xs)builds one in O(n);pushandpoptake O(log n).Dequeis a ring buffer with O(1)push_back,push_front,pop_front,pop_backandget(i).Setkeeps insertion order, withadd,remove,contains,union,intersect,differenceandis_subset.- The interpreter changes a list held in a struct field in place: reading another field, assigning one, or calling a by-value method (
h.is_empty()) no longer copies the list, so a loop over a struct that holds a list is linear again (128,000 pushes: 73 s before, 0.1 s now).
Limen 0.8.14
gRPC streaming, and a gRPC server.
grpcstreams both ways:client.open(path)gives agrpc.Streamthat sends withsendandclose_send, reads withrecvuntilNone, and reportsheaders()andtrailers(), which covers client, server and bidirectional streaming.open_within(clock, ms, path)sets a deadline, and running out of time isDeadlineExceeded.grpcserves: agrpc.Methodpairs a path with a function that gets aServerCalltorecvandsendon, andgrpc.unary(path, f)covers the common case.serve_connandserve_foreveranswer UNIMPLEMENTED for a path no method has, and 415 for requests that aren't gRPC; a handler that panics resets its stream and the server carries on.Err(grpc.fail(code, message))ends a call with that status. The module now needslistenas well asnetandclock.- Messages over 4 MB (
grpc.max_message()) are refused withResourceExhausted, and compressed ones withUnimplemented. http2.Exchangeis the stream underneath:client.open(method, path, headers)sends a body in pieces and reads the response as it arrives.- Fixed: the http2 server test failed now and then on arm64, waiting too little for a flood of requests.
Limen 0.8.13
Faster startup on macOS, and Kubernetes manifests as YAML.
- On macOS a program no longer compiles its sandbox profile at every start: the compiled profile is kept in the user's cache directory and used only when the macOS build and the profile's text match exactly, so the restrictions are the same. Startup drops by about 5 ms, and
pipelinenow runs as fast as the C version. Every profile denies writing to the cache and renaming the directories above it, so no sandboxed program can plant a weaker profile for another. Linux is unchanged. yaml.encodeof thek8stypes writes the manifest a person would:Nonefields left out,@keynames,IntOrStringas25%or1.- The
k8spackage now takes limen-k8s v0.2.0, which addspolicy/v1andautoscaling/v2. - Fixed: the test suite stopped at start on inputs written with the old
as "key"syntax, and the http2 server test depended on the order frames arrived in.
Limen 0.8.12
A package index by default, and the old key syntax gone.
limen searchandlimen add NAMEuse the hosted index at github.com/AlfonsoCampodonico/limen-index whenLIMEN_INDEXis unset;LIMEN_INDEXstill overrides it. Both say on stderr which index they read. The index starts withk8s, and its README says how to publish a package.- Breaking:
field: T as "key"is an error now, with a fix that writes itfield: T @key("key").limen fmt --writestill rewrites old code. - One script cuts a release:
dev/release/release.sh VERSIONbuilds every platform, writesSHA256SUMS, checks the macOS binary, publishes and bumps the Homebrew formula.--dry-runstops before publishing.
Limen 0.8.11
An HTTP/2 server, raw strings, and more of protobuf.
http2serves as well as calls:serve_conn,serve_foreverandserve_callsrun each request in a task of its own, over TLS (h2) or plain TCP with prior knowledge.serve_callsreads and writes aCallas it goes, trailers included, which is what a gRPC server needs.http2.server(clock)holds the limits: idle time, one wait on the client, requests at once, body size. Malformed frames, oversized header blocks and floods of resets end the connection with GOAWAY. The module now needslistenas well asnetandclock. Server push, priorities and h2c upgrade are not supported.- Raw strings: a string between backticks is its bytes as they are, with no escapes and no interpolation, and may span lines:
`{"type":"BOOKMARK"}`.limen fmtkeeps them as written. protobuf:@field(n, kind)writes a number assint,fixed,sfixedorfloat, and aoneofis anOptionof an enum whose variants each carry one value and a number.@encodeand@decodework on types with type parameters:@encode fn items[T](x: Box[T]) -> List[T]converts everyBox[T], and a type may hold itself through one.- The sandbox operator and the
k8sgenerator moved to their own repositories, limen-sandbox-operator and limen-k8s. - Fixed:
limen test --nativeandlimen run --nativebuilt at a fixed name in the temporary directory, so a directory left there made the link fail. Each run now builds in a new one.
Limen 0.8.10
Field and variant attributes after the type, and kube requests that cannot touch the wrong object.
@key,@fieldand@deprecatedgo after a field's type or after a variant, on its line:ttl_minutes: Int @key("ttlMinutes"). Before the name still compiles;limen fmtmoves them.kube:create(path, manager, body)gets a 409 when the name is taken, anddelete(path, uid: Some(id))deletes only the object with that uid.examples/sandbox_operator.lmn: an operator that gives out temporary namespaces with a quota.- Fixed:
limen fmt,docand hover gave fields that share a name the first one's key and attributes.
Limen 0.8.9
mut parameters everywhere, custom conversions, protobuf, HTTP/2 and gRPC clients, signed integers, and Bytes that change in place.
mutparameters work in interface methods (and so ondynvalues), function types, closures and foreign functions, wheremut x: Tis passed asT *.@encodeand@decodeon twopubfunctions give a type its own form injson,yaml,sqlandprotobuf. A misdeclared pair is E0129.@field(n)numbers a struct field or an enum variant, andprotobuf.encodeandprotobuf.decoderead and write proto3.sint,fixed,floatandoneofare not there yet.- HTTP/2 client:
hpack,http2, and ALPN withnet.offering(protocols),listen.offering(protocols)andconn.protocol(). grpc: a client for unary calls, with deadlines andgrpc.Status. No streaming yet.Int8,Int16andInt32, withInt64as another name forInt. json, yaml, sql and protobuf convert every fixed-size integer type.Bytesin amutplace change in place:b[i] = x,push,push_all,truncate,clear,reserve,bytes_of, and fixed-size integer reads and writes at an offset. A foreignmut b: Bytesis a buffer C can fill.- Printing a line costs what it does in C:
bench/linestakes about half the time. - Breaking: in a foreign block
Int32is the realInt32type; writen.to_int32()andr.to_int(). - Breaking: int-or-string fields in
k8sarek8s.IntOrString; writek8s.Int(80)ork8s.Str("25%")wherejson.Int(80)was. - Fixed: two fields with the same name and an
as "key"each crashed the checker. E0124 now also sees the key of a repeated field. - Fixed: in the interpreter, a pointer C hands back into a string it was lent stays valid.
Limen 0.8.8
Attributes, a faster scheduler, and more Kubernetes types.
- Attributes:
@and a name before an item, a struct field or an enum variant. The set is closed and defined by the compiler: an unknown name is E0125 and names the closest known one, a misplaced attribute is E0126, a repeated one E0127, and wrong arguments E0128. There are two to start with:@key("k")on a struct field gives its key injson,yamlandsql:@key("resourceVersion") resource_version: Option[Str]. The oldresource_version: Option[Str] as "resourceVersion"still works, with warning W0004 and a fix that rewrites it;limen fmtrewrites it too. It goes away at 1.0. Thek8spackage and its generator now use@key.@deprecated("msg")on a function, method, type, field or variant. A use from another file is warning W0003, "loadis deprecated: use load_all", once per written use. Uses inside the declaring file are not reported, so a module can keep using what it retires.
limen fmt,limen docand hover print attributes, and a doc comment above an attribute line still belongs to the item.- Tasks are cheaper to start and switch. Each worker's run queue is a lock-free ring, the fiber a worker readies runs next on that worker, idle workers look for work for a moment before sleeping, and a task's stack is mapped only when it first runs, with finished stacks kept for reuse. Tasks that print nothing are freed when they finish instead of when their group ends.
- Fixed: a fiber that resumed on another thread after a wait could use the previous thread's thread-locals, because the C compiler may compute their address once per function. Runtime code now reaches them through calls that are never inlined.
k8shas the batch, networking, rbac and apiextensions types:Job,CronJob,Ingress,NetworkPolicy,Role,ClusterRole, their bindings andCustomResourceDefinition, with their paths.unicode.same_ignoring_caseis Unicode's canonical caseless match: it decomposes again after folding, soᾠwith an acute accent matches its folded form.- The language server no longer crashes when you hover a name defined in another module.