jade-lang 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae124aca6294ee2cc9d2ed1cb7cf05c7224aaa429277b8e3c883f4735e11aa9b
4
- data.tar.gz: 35e00d927319976b642638959808b586214c08bf084135197099d88270d776c6
3
+ metadata.gz: 1e4552bf1ca2e4a8214da4dff385246f52151d7b827d3305171639694e4ee4a5
4
+ data.tar.gz: 9a1bbdcb02eafa6a62b37547a6ba8b2b73784908c0ceb5e8e7486691244f1da7
5
5
  SHA512:
6
- metadata.gz: 57bc05a0cbabfa09e033aa3c6627fcbefdf08b436b8ec20c4fe6a6d9e702f51c4f9a39ad783530896f1cc640a97fe649da79c00a43c30c82478747ec00f98017
7
- data.tar.gz: db704c4e1c98eef3d9fd5a0df63539a3128e2c8f08976004691b281967f8f3621fd5e6969313d53df2c17b55195a4f8b0d27d69fc33001973428a0ab86b561d4
6
+ metadata.gz: 6a3a989e2ddea89618c0abb919e032953b244dbc8217617d009e7f55f62ba43b01bd9c033a4e0984770bfc3f81c75fc40f2f07aa99d43b3e164e13186b196bef
7
+ data.tar.gz: bc7bfa312c8f42e70359ec9a9fdb6a67cfbcee12c8376195c7c4a36f626cd3840c3d6a0fdcd634147a61aa204776e9a0c99aeed587b92ab98d3d60dc4ace0f26
data/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.1]
10
+
11
+ ### Fixed
12
+
13
+ - Generated constructors no longer use Ruby's `Method#curry`, which corrupts
14
+ the heap under GC compaction (an intermittent near-null SIGSEGV,
15
+ "try to mark T_NONE object") when an auto-derived record decoder builds a
16
+ constructor once and calls it on every decode. Construction now goes through
17
+ a GC-safe `Jade::Runtime.curry` (plain procs + an array). Surfaced as a
18
+ segfault decoding records with non-specializable fields (e.g. `Calendar.Date`)
19
+ at volume.
20
+
9
21
  ## [0.1.0]
10
22
 
11
23
  Initial release.
@@ -19,5 +31,6 @@ Initial release.
19
31
  - `jade` CLI dispatcher: `fmt`, `lsp`, `q`.
20
32
  - Language server and headless query interface for editor/agent tooling.
21
33
 
22
- [Unreleased]: https://github.com/agustinrhcp/jade/compare/v0.1.0...HEAD
34
+ [Unreleased]: https://github.com/agustinrhcp/jade/compare/v0.1.1...HEAD
35
+ [0.1.1]: https://github.com/agustinrhcp/jade/compare/v0.1.0...v0.1.1
23
36
  [0.1.0]: https://github.com/agustinrhcp/jade/releases/tag/v0.1.0
@@ -48,10 +48,10 @@ module Jade
48
48
  "Jade::Runtime.intr(#{name.inspect})"
49
49
 
50
50
  in [:struct_constructor, qualified_name, arity]
51
- "#{to_qualified(qualified_name)}.method(:[]).curry(#{arity})"
51
+ "Jade::Runtime.curry(#{to_qualified(qualified_name)}.method(:[]), #{arity})"
52
52
 
53
53
  in [:anon_record_constructor, keys]
54
- "#{data_define(keys)}.method(:[]).curry(#{keys.size})"
54
+ "Jade::Runtime.curry(#{data_define(keys)}.method(:[]), #{keys.size})"
55
55
 
56
56
  in [:list, exprs]
57
57
  exprs
data/lib/jade/runtime.rb CHANGED
@@ -95,6 +95,25 @@ module Jade
95
95
  INTRINSICS[name] || fail("Intrinsic #{name} does not exist")
96
96
  end
97
97
 
98
+ # Hand-rolled currying for generated constructors. Ruby's Method#curry
99
+ # corrupts the heap under GC compaction (the GC marks a T_NONE object
100
+ # while a curried call is in flight) when a curried proc is built once
101
+ # and called repeatedly — which is exactly the decoder applicative path
102
+ # (Decode.succeed(Ctor.curry(n)) threaded through Decode.and_map). Plain
103
+ # procs accumulating into an Array are GC-safe.
104
+ def curry(fn, arity)
105
+ return fn if arity <= 1
106
+
107
+ build = ->(acc) {
108
+ ->(*xs) {
109
+ (acc + xs).then do |args|
110
+ args.length >= arity ? fn.call(*args) : build.call(args)
111
+ end
112
+ }
113
+ }
114
+ build.call([])
115
+ end
116
+
98
117
  def register(name, &block)
99
118
  INTRINSICS[name] = block
100
119
  end
data/lib/jade/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jade
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jade-lang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Cornu
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-06-14 00:00:00.000000000 Z
10
+ date: 2026-06-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64