···24372437 "You can not set a runtime for Erlang. Did you mean to target JavaScript?"
24382438 .into(),
24392439 ),
24402440+ Target::Wasm => Some(
24412441+ "You can not set a runtime for Wasm. Did you mean to target JavaScript?"
24422442+ .into(),
24432443+ ),
24402444 };
2441244524422446 vec![Diagnostic {
···7272pub mod build;
7373pub mod codegen;
7474pub mod config;
7575-pub mod cranelift;
7575+pub mod wasm;
7676pub mod dependency;
7777pub mod diagnostic;
7878pub mod docs;
···237237 /// - `uses_javascript_externals: true` the function is using JavaScript
238238 /// external code.
239239 uses_javascript_externals: bool,
240240- /// Set to `true` if the const/function is defined using Cranelift external
241241- /// code. That means that the function will use Cranelift code through FFI when
242242- /// compiled for the Cranelift target.
243243- uses_cranelift_externals: bool,
240240+ /// Set to `true` if the const/function is defined using Wasm external
241241+ /// code. That means that the function will use Wasm code through FFI when
242242+ /// compiled for the Wasm target.
243243+ uses_wasm_externals: bool,
244244 /// Whether the function can be called on the Erlang target, either due to a
245245 /// pure Gleam implementation or an implementation that uses some Erlang
246246 /// externals.
···249249 /// to a pure Gleam implementation or an implementation that uses some
250250 /// JavaScript externals.
251251 can_run_on_javascript: bool,
252252- /// Whether the function can be called on the Cranelift target, either due to a
253253- /// pure Gleam implementation or an implementation that uses some Cranelift
252252+ /// Whether the function can be called on the Wasm target, either due to a
253253+ /// pure Gleam implementation or an implementation that uses some Wasm
254254 /// externals.
255255- can_run_on_cranelift: bool,
255255+ can_run_on_wasm: bool,
256256}
257257258258impl ImplementationsInterface {
···270270 gleam,
271271 uses_erlang_externals,
272272 uses_javascript_externals,
273273- uses_cranelift_externals,
273273+ uses_wasm_externals,
274274 can_run_on_erlang,
275275 can_run_on_javascript,
276276- can_run_on_cranelift,
276276+ can_run_on_wasm,
277277 } = implementations;
278278279279 ImplementationsInterface {
280280 gleam: *gleam,
281281 uses_erlang_externals: *uses_erlang_externals,
282282 uses_javascript_externals: *uses_javascript_externals,
283283- uses_cranelift_externals: *uses_cranelift_externals,
283283+ uses_wasm_externals: *uses_wasm_externals,
284284 can_run_on_erlang: *can_run_on_erlang,
285285 can_run_on_javascript: *can_run_on_javascript,
286286- can_run_on_cranelift: *can_run_on_cranelift,
286286+ can_run_on_wasm: *can_run_on_wasm,
287287 }
288288 }
289289}
···11-#include <stdio.h>
22-33-unsigned long long fib(unsigned long long n) {
44- if (n==0)return 0;
55- if (n==1)return 1;
66- return fib(n-1)+fib(n-2);
77-}
88-99-int main(void) {
1010- printf("%lld\n", fib(40));
1111-}
···11-#include <stdio.h>
22-33-unsigned long long M17project_cranelift_4main_A0a_RI();
44-55-int main() {
66- unsigned long long outcome = M17project_cranelift_4main_A0a_RI();
77- printf("%lld\n", outcome);
88-}