We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

1bitatatime

From Esolang
Jump to navigation Jump to search

1bitatatime was made by Benjamin F. Berger in 2026. It is a fork of Nandcode. It explores the absolute limits of computational minimalism by emulating logic gates. The language is evaluated sequentially line-by-line. The runtime enforces a strict 64-bit virtual hardware environment mapped entirely within a single physical CPU register, requiring zero RAM allocation overhead during active execution layers. Every program in 1bitatatime runs in O(N) time and O(1) space. All lines following a # are treated as comments.

1bitatatime
Designed by Benjamin F. Berger
Appeared in 2026
Computational class Not Turing Complete
Major implementations Repository

Keywords

  • in: declares variables as inputs at the top of the file.
  • out: declares variables as outputs at the bottom of the file.
  • = assigns a value to a variable.
  • !& or nand evaluates bitwise nand logic: !(A & B).
  • !| or nor evaluates bitwise nor logic: !(A | B).
  • !^ or nxor evaluates bitwise nxor logic: !(A ^ B).
  • ! or not evaluates bitwise not logic: !A.
  • | or or evaluates bitwise or logic: A | B.
  • & or and evaluates bitwise and logic: A & B.
  • ^ or xor evaluates bitwise xor logic: A ^ B.

Note unary operators must come after their operands, e.g. `x = x !`, not `x = ! x`

Constants

true and 1 are interchangable.

false and 0 are interchangable.

Constraints

Everything runs inside a single 64-bit register in the CPU.

Bits 0 and 1 in the virtual ram are reserved for the language.

A maximum of 62 variables can be declared in total.

Examples

Swap values x and y

in: x y
temp = x
x = y
y = temp
out: x y

example: full adder [examples/swap.1bit examples/fadder.1bit])

in: a b cin
sum1 = a ^ b
sum = sum1 ^ cin
carry1 = a & b
carry2 = sum1 & cin
cout = carry1 | carry2
out: sum cout

Errors

Fatal Errors

error [1b001]: no arguments given

  • cause: 1bit compiler run with no source filepath
  • fix: pass a valid source as a argument for nand compiler

error [1b002]: gcc not installed

  • cause: path to gcc compiler could not be found
  • fix: ensure gcc is installed by running gcc --version in the folder you intend to compile from

error [1b003]: gcc failed to compile

  • cause: 1bit compiler successfully created the intermediate c code, but gcc could not compile it
  • fix: raise an issue on the repo

error [1b101]: not enough inputs

  • cause: not enough inputs passed into compiled binary
  • fix: pass the correct number of inputs into the compiled program, specified by the number of variables after in:, on the first line of your program

error [1b102]: code must end with out:

  • cause: out: keyword not present in your program
  • fix: add out: to the last line of your program

error [1b103]: source empty

  • cause: pass empty source file to 1bit compiler
  • cause: pass source file that does not contain in:
  • fix: ensure your program is not empty and contains in: at the start of your program

error [1b201]: out of memory

  • cause: exceed 62 assignable variable limit
  • fix: try to recycle your variables by resetting their values with myVariable = 0

error [1b202]: variable undefined

  • cause: using an undefined variable as an operand
  • fix: define variables before using them as operands

Non-Fatal Errors (Warnings)

warn [1b401]: source does not end in .1bit

  • cause: source file does not end in .1bit
  • fix: rename your source file to end in .1bit

warn [1b402]: program contains no inputs

  • cause: no variables declared as inputs in the in: block of your program
  • fix: declare inputs in the in: block of your program

warn [1b403]: program contains no outputs

  • cause: no variables declared as outputs in the out: block of your program
  • fix: declare outputs in the out block of your program