Skip to content
/ karyon Public

Programming language research

License

Notifications You must be signed in to change notification settings

marciof/karyon

Repository files navigation

Introduction

Karyon is a free/libre open source (FLOSS) programming language for interactive use, scripting, and building small to large programs, that aims to be simple, powerful, and practical.

It includes a well-defined specification, a platform-agnostic implementation core, and an interpreter for various operating systems and environments.

Structure

Source code layout:

  • interpreter/: Implementation of the language specification. Components:
    • core/: Embeddable library with the host-independent core of the implementation and host-dependent hooks.
    • native/: Embeddable library and standalone executable to run natively (eg. on a Linux, Windows, or MacOS host).
    • x86-32/: Multiboot executable to run on an Intel x86 32-bit host.
  • language/: Language specification.
  • stdlib/: Standard library for the interpreter.
  • tools/: Helper scripts for building and testing.

Dependencies

Component dependencies are listed in the sub-sections below. The compatibility section lists supported operating systems and environments.

These are the rest of the dependencies for build targets shared across different components:

  • lint-documentation

    • Python 3
    • requirements.lint-commonmark-links.txt (for pip)
    • internet access for validating links
  • lint-sources-python

    • Python 3
    • requirements.lint-sources-python.txt (for pip)

Core

Build dependencies:

Native

Build dependencies:

Runtime dependencies:

x86-32

Build dependencies:

If cross-compiling on a 64-bit host:

  • libc 32-bit dev headers
    • Ubuntu: $ apt install gcc-multilib

Runtime dependencies:

  • (TODO list x86-32 runtime dependencies)

Compatibility

Operating System

Supported operating systems:

  • Linux
  • macOS
  • Windows

Build Tool

Supported build tools:

Compiler

Supported compilers:

Assembler

Supported assemblers:

Librarian

Supported librarians:

Linker

(TODO list supported linkers)

Building

After installing or building the required dependencies for a given component, then run a supported build tool on the all build target.

For example, to build and run the native executable on Linux:

interpreter/core/$ make all
interpreter/native/$ make all
interpreter/native/$ ./karyon

For example, to build and run (under a VM) the x86-32 executable on Linux:

interpreter/core/$ make all
interpreter/x86-32/$ make all
interpreter/x86-32/$ ./vm.sh karyon-x86-32

Development

To continuously and automatically build on source code changes and get immediate feedback, use the dev build target. It uses watchexec to monitor changes, and builds the all build target.

For example, to do development on and build the native executable on Linux using GCC, start with watching the core build:

interpreter/core/$ make dev CCNAME=gcc

And then separately watching the native build:

interpreter/native/$ make dev CCNAME=gcc