Code Monkey home page Code Monkey logo

cbqn's Introduction

A BQN implementation in C

CBQN-specific documentation โ€ข source code overview

Running

  1. make
    • make CC=gcc if you don't have clang installed
    • make PIE="" on ARM CPUs (incl. Android & M1)
    • gmake on BSDs
    • make clean if anything goes bad and you want a clean slate
    • make [...]; sudo make install to install into /usr/local/bin/bqn; sudo make uninstall to uninstall
  2. ./BQN somefile.bqn to execute a file, or rlwrap ./BQN for a REPL

Configuration options

  • some-other-bqn-implementation ./genRuntime path/to/mlochbaum/BQN can be used to avoid pulling precompiled bytecode with git from remotes/origin/bytecode.
    This creates the dummy file src/gen/customRuntime, which will disable automated bytecode retrieval, leading to the bytecode going out-of-sync whenever it needs updating.
    make clean-runtime (which is included in make clean) can be used to reset this to the default state.
  • Different build types:
    • make o3 - -O3, the default build
    • make o3n - -O3 -march=native
    • make o3g - -g -O3
    • make debug - unoptimized debug build
    • make debug1 - debug build without parallel compilation. Useful if everything errors, and you don't want error messages of multiple threads to be written at the same time.
    • make heapverify - verify that refcounting is done correctly
    • make o3n-singeli - a Singeli build, currently only for x86-64 CPUs supporting AVX2
    • make t=some_custom_type f='-O3 -DSOME_MACRO=whatever -some_other_cc_flag' c - custom build
      Macros that you may want to define are listed in src/h.h.
      The some_custom_type is used as the key for caching/incremental compilation, so make sure to make t=some_custom_type clean if you want to change the flags without changing the t= value!!
    • make single-(o3|o3g|debug|c) - compile everything as a single translation unit. Slower for optimized builds, but may allow some more optimizations
    • ... and more; see makefile
  • A specific build type can be cleaned with make t=some_type clean
  • Tests can be run with ./BQN path/to/mlochbaum/BQN/test/this.bqn (add -noerr if using make heapverify).
  • Test precompiled expression: some-other-bqn-impl ./precompiled.bqn path/to/mlochbaum/BQN "$PATH" '2+2'
  • Some implementation docs

License

Any file without an explicit copyright message is copyright (c) 2021 dzaima, GNU GPLv3 - see LICENSE

cbqn's People

Contributors

andersontorres avatar andreypopp avatar charlesrocket avatar dzaima avatar jshholland avatar mlochbaum avatar selaere avatar sternenseemann avatar yiyus avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.