add OpenWatcom makefile to build Win32 CoolEdit plugin.

# OpenWatcom makefile to build CoolEdit plugin 'cool_wv4.flt' for Win32

LIBNAME = cool_wv4

DLLFILE = $(LIBNAME).flt
LNKFILE = $(LIBNAME).lnk

CC = wcc386
RC = wrc

WAVPACK_LIB = wavpack.lib

CFLAGS = -bt=nt -d0 -zq -bm -5s -fp5 -fpi87 -sg -oeatxh -ei
#CFLAGS+= -j
# warnings:
CFLAGS+= -wx
# newer OpenWatcom versions enable W303 by default:
CFLAGS+= -wcd=303
# include paths:
CFLAGS+= -I"$(%WATCOM)/h/nt" -I"$(%WATCOM)/h"
CFLAGS+= -I"../include"
# to build a dll:
CFLAGS+= -bd
RCFLAGS = -q -r -bt=nt -I"$(%WATCOM)/h/nt"

SRCS = cool_wv4.c
RCSRCS = wavpack.rc

.extensions:
.extensions: .lib .flt .obj .res .c .rc

OBJS = $(SRCS:.c=.obj)
RCOBJS= $(RCSRCS:.rc=.res)

all: $(DLLFILE)

$(DLLFILE): $(OBJS) $(RCOBJS) $(LNKFILE)
  @echo * Link: $@
  wlink @$(LNKFILE)

$(LNKFILE):
  @%create $@
  @%append $@ SYSTEM nt_dll INITINSTANCE TERMINSTANCE
  @%append $@ NAME $(DLLFILE)
  @for %i in ($(OBJS)) do @%append $@ FILE %i
  @%append $@ OPTION QUIET
  @%append $@ OPTION RESOURCE=$(RCOBJS)
  @%append $@ LIB $(WAVPACK_LIB)
  @%append $@ export 'QueryCoolFilter'='_QueryCoolFilter@4'
  @%append $@ export 'FilterUnderstandsFormat'='_FilterUnderstandsFormat@4'
  @%append $@ export 'GetSuggestedSampleType'='_GetSuggestedSampleType@12'
  @%append $@ export 'OpenFilterInput'='_OpenFilterInput@24'
  @%append $@ export 'FilterGetFileSize'='_FilterGetFileSize@4'
  @%append $@ export 'ReadFilterInput'='_ReadFilterInput@12'
  @%append $@ export 'CloseFilterInput'='_CloseFilterInput@4'
  @%append $@ export 'FilterOptions'='_FilterOptions@4'
  @%append $@ export 'FilterOptionsString'='_FilterOptionsString@8'
  @%append $@ export 'OpenFilterOutput'='_OpenFilterOutput@28'
  @%append $@ export 'CloseFilterOutput'='_CloseFilterOutput@4'
  @%append $@ export 'WriteFilterOutput'='_WriteFilterOutput@12'
  @%append $@ export 'FilterGetOptions'='_FilterGetOptions@24'
  @%append $@ export 'FilterWriteSpecialData'='_FilterWriteSpecialData@20'
  @%append $@ export 'FilterGetFirstSpecialData'='_FilterGetFirstSpecialData@8'
  @%append $@ export 'FilterGetNextSpecialData'='_FilterGetNextSpecialData@8'
  @%append $@ OPTION MAP=$*
  @%append $@ OPTION ELIMINATE
  @%append $@ OPTION SHOWDEAD

.c.obj:
  $(CC) $(CFLAGS) -Fo=$^@ $<
.rc.res:
  $(RC) $(RCFLAGS) -Fo=$^@ $<

clean: .SYMBOLIC
  @if exist *.obj rm *.obj
  @if exist *.res rm *.res
  @if exist *.err rm *.err
  @if exist $(LNKFILE) rm $(LNKFILE)

distclean: .SYMBOLIC clean
  @if exist $(DLLFILE) rm $(DLLFILE)
  @if exist *.map rm *.map

error: pathspec 'audition/Makefile.wat' did not match any file(s) known to git


updated math

updated math

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/eyamil/wasm-utils.git/'


first run

first run

;; -*- mode: scheme -*-
;; This is the hard crust of Wat code around the JS core defined in `wat.js`.

(def Boolean (mktag))
(def boolean-tagger (tagger Boolean))
(def #t (boolean-tagger #void))
(def #f (boolean-tagger #void))

error: pathspec 'crust.wat' did not match any file(s) known to git


Goroutines and one-element blocking channels

;; -*- scheme -*-

(defmodule fibers (new-channel channel-send channel-receive go)

  (def fiber-prompt 'fiber-prompt)

  (defprototype Channel Object
    (buffer
     full
     senders
     receivers))

  (def (new-channel)
    (new Channel #null #f (array) (array)))

  (def (channel-send (ch Channel) msg)
    (label done
      (loop
        (label retry
          (if (.full ch)
              (begin
                (take-subcont fiber-prompt k
                  (~push (.senders ch) k))
                (retry))
              (begin
                (set (.buffer ch) msg)
                (set (.full ch) #t)
                (if (> (.length (.receivers ch)) 0)
                    (let ((receiver (~shift (.receivers ch))))
                      (schedule-fiber receiver))
                    (begin
                      (take-subcont fiber-prompt k
                        (~push (.senders ch) k))
                      (done)))))))))

  (def (channel-receive (ch Channel))
    (label done
      (loop
        (label retry
          (if (.full ch)
              (begin
                (let ((msg (.buffer ch))
                      (sender (~shift (.senders ch))))
                  (set (.buffer ch) #null)
                  (set (.full ch) #f)
                  (schedule-fiber sender)
                  (done msg)))
              (begin
                (take-subcont fiber-prompt k
                  (~push (.receivers ch) k))
                (retry)))))))

  (def (schedule-fiber k)
    (def (callback . #ignore)
      (push-prompt fiber-prompt
        (push-subcont k)))
    ($setTimeout (js-callback callback) 0))

  (def (go fun)
    (push-prompt fiber-prompt
      (fun)))

)

(import fibers (new-channel channel-send channel-receive go))

(def (pinger ch)
  (loop
    (channel-send ch "ping")))

(def (printer ch)
  (loop
    (log (channel-receive ch))))

(let ((ch (new-channel)))
  (go (lambda () (pinger ch)))
  (go (lambda () (printer ch))))

error: pathspec 'modules/fibers.wat' did not match any file(s) known to git


Updating working files

Updating working files


Create simple.wat

Create simple.wat

;; msimple.wat => msimple.wasm
;; msimple.wast => msimple.wasm
;; 使用 s-expr, 手动组装 WebAssembly Module
(module
  (func $getYear (import "imports" "getYear") (param i32))
  (func (export "printYear")
    ;; 写死 const
    i32.const 2022
    call $getYear
  )
)

error: pathspec 'webassembly/imports-exports/simple.wat' did not match any file(s) known to git