Skip to content

Commit

Permalink
js/wasm support, renamings, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWhiting committed Feb 19, 2024
1 parent b223aa4 commit 7705130
Show file tree
Hide file tree
Showing 31 changed files with 762 additions and 807 deletions.
6 changes: 4 additions & 2 deletions lib/std/async.kk
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ import std/num/ddouble // for C# backend
import std/time/duration
import std/os/null
import std/core/unsafe
pub import std/os/uv
pub import std/os/event-loop
// We utilize some timer functions from it's header file.
pub import std/time/timer
pub import std/num/ddouble
pub import std/num/float64

extern import
c file "async/async-inline.h"
js file "async/async-inline.js"
cs file "async/async-inline.cs"
// js is just using primitives

// A type alias for asynchronous operations that can raise exceptions non-deterministically.
// This is common for almost all `:async` operations since `cancel` and `timeout` can
Expand Down
6 changes: 3 additions & 3 deletions lib/std/async/async-inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ static kk_box_t kk_unit_closure(kk_function_t _fself, kk_context_t* _ctx) {
}


kk_unit_t kk_clear_timeout(kk_box_t t, kk_context_t* _ctx) {
kk_std_time_timer__timer timer = kk_std_time_timer__timer_unbox(t, KK_OWNED, _ctx);
kk_std_os_uv_close(kk_std_os_uv__new_UvHandle(timer.internal, _ctx), kk_new_unit_closure(_ctx), _ctx);
kk_unit_t kk_clear_timeout(kk_box_t boxed_timer, kk_context_t* _ctx) {
kk_std_time_timer__timer timer = kk_std_time_timer__timer_unbox(boxed_timer, KK_OWNED, _ctx);
kk_std_os_event_dash_loop_close(kk_std_os_event_dash_loop__new_Uv_handle(timer.internal, _ctx), kk_new_unit_closure(_ctx), _ctx);
return kk_Unit;
}

Expand Down
231 changes: 0 additions & 231 deletions lib/std/async/async-inline.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/std/core/inline/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export function _int64_clamp_uint32(x) {
}

export function _int64_imul( x, y ) {
const z = x*y; BigInt.as
const z = x*y; BigInt.asUintN(64,z);
const lo = BigInt.asUintN(64,z);
const hi = z >> 64n;
return $std_core_types.Tuple2(hi,lo);
Expand Down
Loading

0 comments on commit 7705130

Please sign in to comment.