Skip to content

Thayorns/eoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,514 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EOLANG Command Line Tool-Kit

EO principles respected here We recommend IntelliJ IDEA

grunt node-current PDD status codecov Hits-of-Code License Release

This is a command-line tool-kit for EO programming languages, allowing you to compile EO programs, test, dataize, and check for errors.

First, you install npm and Java SE.

Then, you install eolang package, using npm:

npm install -g eolang@0.35.1

You can also use Homebrew (on macOS):

brew tap objectionary/eoc https://github.com/objectionary/eoc
brew install objectionary/eoc/eolang@0.35.1

Or install it via Nix flakes:

nix run github:objectionary/eoc
You can also include EOLANG in your own flake
{
  inputs = {
    eoc.url = "github:objectionary/eoc";
    nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
  };

  outputs = { self, nixpkgs, eoc, ... }: {
    nixConfigurations.<hostname> = nixpkgs.lib.nixosSystem {
      modules = [
        {
          nixpkgs.config.packageOverrides = pkgs: {
            eoc = eoc.packages.${system}.default;
          };
        }
      ];
    }
  };
}

After that, select one of the methods for installing the package:

#configuration.nix (Global)
{
  environment.systemPackages = with pkgs; [
    eoc
  ];
}
#configuration.nix (For user)
{
  users.users.<your-user-name>.packages = with pkgs; [
    eoc
  ];
}
#home.nix (For home-manager)
{
  home.packages = with pkgs; [
    eoc
  ];
}

Then, you write a simple EO program in hello.eo file in the current directory:

# My first object in EO!
[args] > hello
  io.stdout > @
    "Hello, world!\n"

Then, you run it:

eoc --easy dataize hello

That's it.

Commands

You can also do many other things with eoc commands (the flow is explained in this blog post):

  • audit Inspect all packages and report their status
  • foreign Inspect and print the list of foreign objects
  • clean Delete all temporary files
  • register Register all visible EO source files
  • parse Parse EO files into XMIR
  • assemble Parse EO files into XMIR and join them with required dependencies
  • print Generate EO files from XMIR files
  • lint Lint XMIR files and fail if any issues inside
  • resolve Resolve all the dependencies required for compilation
  • transpile Convert EO files into target language
  • compile Compile target language sources into binaries
  • link Link together all binaries into a single executable binary
  • dataize Run the single executable binary and dataize an object
  • test Run all visible unit tests
  • docs Generate documentation from XMIR files
  • generate_comments Generate documentation with LLM
  • jeo:disassemble Disassemble .class files to .xmir files
  • jeo:assemble Assemble .xmir files to .class files
  • latex Generate LaTeX files from EO sources
  • normalize Normalize EO files using phi-calculus normalization via phino
  • fmt Format EO files in the source directory

This command line toolkit simply integrates other tools available in the @objectionary GitHub organization.

Linting

There are two ways to work with linting. The --easy option enables linting but ignores warnings, while the --blind option completely disables linting.

How to Test

To execute the project tests, use the following command:

npx grunt

This command will run all the testing steps, including tests, linting, coverage, and more. If you only need to run the tests, use:

npm test

To run a specific test based on its description, use the following command:

npm test -- --grep="<test-description>"

For example, to run a test with the description "formats EO files according to expected patterns," execute:

npm test -- --grep="formats EO files according to expected patterns"

You can also run a specific test file using npx grunt:

npx grunt --file=test/commands/test_fmt.js

How to Contribute

First, run npm install. Make your changes, run tests and then make a pull request.

About

Command-line toolkit for parsing, compiling, transpiling, optimizing, linking, dataizing, and running EOLANG programs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 95.1%
  • Ruby 1.9%
  • Nix 1.6%
  • XSLT 1.4%