Skip to content

vylsaz/bqn-kernel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bqn-kernel

a jupyter kernel for BQN

Binder

build

Require: libcbqn on this commit or newer.

(For now:)

git clone https://github.com/vylsaz/bqn-kernel.git
cd bqn-kernel

For Windows, copy cbqn.dll and cbqn.lib to the current folder.

For Linux, make sure the dynamic linker knows where libcbqn.so is.

Then run:

cargo run

(add --features v6 if you are using jupyter notebook classic)

Finally, copy the ./bqn/ folder to one of the folders listed here.

quirks

kernel

The kernel cannot be interrupted.

system values

  • •Exit doesn't work.
  • •Out, •Show and •GetLine work.
  • •platform.environment will report "jupyter".
  • •jupyter:
    • GetInput: 𝕩 is prompt
    • GetPassword: 𝕩 is prompt
    • HTML: displays html (𝕩)
    • Text: displays text (𝕩)
    • Clear: clears the display
    • Image: displays image (𝕩 of rank 2 or 3, 0.0-1.0 float values)
    • Audio: displays sound (𝕩 of rank 1 or 2, ¯1.0-1.0 float values) with sample rate of 𝕨 or audioFreq
    • audioFreq: 44100

cell magic

Start a cell with ) to use magic. They need to be on their own lines.

Don't print the final result

)r

Use a REPL function for the cell

)use Func

Func needs to be able to accept a (multiline) string as input and output a value. Func also needs to be able to evaluate "•fmt".

Display the final result as an image

)image

Calls •jupyter.Image on the final result

Display the final result as an audio

)audio

Calls •jupyter.Audio on the final result

todo

  • running on docker
  • running on actual machine
  • support for jupyter classic
    • basic syntax highlighting
    • input method
  • support for jupyter lab
  • Rewrite It In BQN™

maybe (big MAYBE)

  • plots
  • image
  • audio
  • widgets

About

a jupyter kernel for BQN

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published