百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

t2b

> 编程语言
开源

一种强大的文本宏命令语言,用于构建二进制文件。

378 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一种强大的文本宏命令语言,用于构建二进制文件。

t2b

A wicked-powerful text macro language for building binary files. Supports comments, looping, Unicode, variables, conditionals, macros and recursion.

TLDR; Check out example/.

Pre-built binaries are available for Win64 and MacOS64.

Usage

bash
$ t2b  here
$ t2b # Read directly from stdin

t2b always writes to stdout. To output to a file, simply use a greater-than sign (>).

Language

Newlines are solely for the sake of readability; all whitespace is the same.

…

Why?

The need for such a program arose when I was working on writing a simple VM. Manually hex-editing files for an ever changing bytecode spec is tedious, error-prone, and most of all - sucky.

Now there's a lightweight way to do just that.

Supported Commands

  • u8...u64 - Emit unsigned integer
  • i8...i64 - Emit signed integer
  • f - Emit float
  • d - Emit double
  • hex - Toggle hex mode on/off (defaults to OFF)
  • str - Write a string
  • strl - Write a string AND newline
  • endl - Write a newline
  • not Boolean NOT a char
  • if endif Execute `` if == 1
  • get - Fetch the global variable named expr
  • set - Assign the global variable named expr1 to expr2
  • = - Compare two values, return 0 or 1
  • times endtimes - Execute times. i is always set to the current iteration's index.
  • macro begin endmacro - Declare a custom macro named ``.
  • return - End termination of the current macro. Exits the script if not in a macro.
  • size - Return the size of an item
  • len - Equivalent to C strlen

What's next?

It's now feasible to write a machine code compiler in shell. Hooray. Not sure why you would ever do that to yourself, though.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++command-linemacrosprogramming-languaget2b

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言