∞ Day - Origyn Motoko Gift 3 - Kusanagi -or- What have you done to my beautiful language?

Good suggestion! I’ve published an npm package.

Quickstart guide:

npm install --location=global kusanagi
kusanagi < input.ku > output.mo
1 Like

Okay, but does @quint use this tool?

AFAIK, he uses Motoko.

I don’t think he knows about it until he reads this comment. It’s been in the skunkworks for a bit.

1 Like

By the way, here’s a (brand new) Motoko compiler NPM package in case it’s helpful for further developing and testing this project:

3 Likes

I wanted to share a quick shell script that @DanielXMoore whipped up to make compiles quick and easy while writing kusanagi. Long term we can get it to output errors to the Problems tab in vs code, but this will help in the meantime.:

#!/bin/bash
set -euo pipefail

SRC_DIR="./src_ku"
DEST_DIR="./src"

for KU in `find $SRC_DIR -type f -name "*.ku"`; do
  FILE="${KU#$SRC_DIR}"
  NAME="${FILE%.ku}"

  MO="$DEST_DIR$NAME.mo"

  SUB_DIR=`dirname $MO`
  mkdir -p "$SUB_DIR"

  echo "Transpiling $KU > $MO"
  kusanagi < "$KU" > "$MO"
done

I’ve added a script to my npm

"scripts": {
        "kusanagi": " watch 'bash kusanagi.sh' ./src_ku"
    },
1 Like

I just wanted to fire this thread back up as @DanielXMoore has received a dfinity grant to move this along and keep improving kusanagi.

I’ve been building some with it and if you like python style syntax and motoko then you might find that you like it too. Motoko just slides right in as valid Kusanagi so it is super easy to get started! Add issues at the github.

4 Likes