GSET
Core Concepts

Configuration

gset.conf — keyword aliases, compiler overrides, and run pipelines.

GSET reads configuration from three locations, first match wins:

  1. ./gset.conf in the current working directory
  2. $HOME/.gset.conf
  3. /etc/gset.conf

The file is a flat key=value list. Comments start with #.

Keyword aliases

Control the spelling of print per target:

# global keywords
keywords.print=say

# per-target overrides
ext.py.keywords.print=puts
ext.js.keywords.print=log

With keywords.print=say, say "hi" in your source transpiles to print("hi") (Python), console.log("hi") (JavaScript), fmt.Println("hi") (Go).

Verified: keyword aliases are applied by both gset run and gset transpile — the keyword map feeds every emitter. say/shout work.

Compiler overrides

Change how each target runs. Each compiler block has four keys:

compiler.python.command=python3
compiler.python.args=-u
compiler.python.wrapper=

compiler.java.command=javac
compiler.java.args=Main.java
compiler.java.run=javac Main.java && java Main && rm Main.class
compiler.java.wrapper=

Precedence:

SettingMeaningDefault
compiler.<lang>.commandexecutableGetCompilers() defaults (python3, node, go, javac, ruby)
compiler.<lang>.argsstatic argstarget-specific
compiler.<lang>.runfull shell pipelineset only for Java
compiler.<lang>.wrapperextra wrapper linesempty

If command is empty in config, the built-in default is retained (merging, not replacing).

The gset.conf included with the repo

The shipped gset.conf registers print aliases (say, println, print, shout, log, echo, puts) for .py, .js, .java, .go, .rb and lists keyword sections for future targets.

CWD dependence

Because gset.conf is resolved from the current working directory, running gset from a different directory changes keywords and compilers. Verify your config is in effect:

ls gset.conf        # your config present?
gset transpile hello.gset --target js | head -3

If say stops mapping, you're likely not in the directory holding gset.conf.

File-header keywords (parsed, not yet applied)

A leading key=value block inside a .gset file (e.g. a custom print= mapping in the file header) is parsed by config/config.go, but not yet applied to transpilation — the header is a planned feature. Set aliases via gset.conf for now.

On this page