展示HN:Feather – 一种全新的Tcl重新实现(WASM, Go)
Show HN: Feather – a fresh Tcl reimplementation (WASM, Go)

原始链接: https://www.feather-lang.dev

## 羽毛:一种轻量级脚本语言 羽毛是一种新的脚本语言,专为嵌入现有应用程序中的**简短、交互式程序**而设计。它擅长提供**运行时控制和定制**,允许诸如浏览器内游乐场、动态配置、开发者控制台和用户脚本等功能——本质上为您的软件提供了一个“类似Bash”的控制面板。 然而,羽毛**并非用于大规模编程**。它有意缺乏默认I/O或打包系统等功能,优先考虑简洁性,并依赖**宿主应用程序**提供性能和核心功能(内存管理、I/O等)。 如果您需要一种健壮、高性能的嵌入式语言,建议使用**Lua**。当您需要轻量级的“粘合剂”将您的应用程序连接到动态用户交互或运行时调整时,羽毛才能发挥优势,利用宿主语言现有的能力,而不是重新发明它们。目前,它支持嵌入到**Ruby**和**Python**以外的语言中,因为后两者已经提供了足够的可动态性。

## 羽毛:一种新的Tcl实现 开发者dhamidi推出了羽毛(Feather),一种全新的、从头开始实现的Tcl脚本语言,旨在易于嵌入到现代应用程序中。与传统的Tcl不同,羽毛有意省略了I/O、OOP和协程等特性,以简化集成并增强安全性——仅暴露必要的功能。 该项目旨在为AI代理提供更快的反馈循环,并允许在应用程序内进行脚本编写,从而实现“可塑软件”。一个关键优势是其小的WASM构建尺寸(约190kb),使其适用于Web、Node.js、移动和桌面环境。 另一位开发者smj-edison分享了他们自己专注于多线程的Tcl重新实现,强调了引用计数和内存管理的挑战。评论中也指出,之前有一个同名的项目。Dhamidi设想未来软件将普遍可脚本化,类似于Emacs和Nvim,AI代理处理复杂的任务。
相关文章

原文

Interactive Playground

Try Feather directly in your browser - powered by WebAssembly

What Feather is a good fit for

Feather is built for short, interactive programs:

  • Give agents access to your program - like Chrome DevTools, but for your application
  • Configure servers at runtime - hot-reload configuration without restarts
  • Quake-style consoles - add developer consoles to games and applications
  • Configuration file format - use a real programming language for config
  • User customization - let users script and extend your software

Just like Bash and zsh let you drive a Unix system, Feather lets you drive your application in the same spirit.

When to use something else

Feather is not suited for programming in the large.

Features that support this are omitted intentionally:

No I/O by default: Feather cannot communicate with the outside world, until you explicitly provide facilities for doing so.

No packaging/import system: if your Feather program grows large, you need to decide whether you move this logic to the host, or provide the means of structuring code, like sourcing scripts from somewhere yourself.

Performance will never be the top priority: Feather is there to let you elegantly call code in your probably already optimized host application. A Feather script becoming slow is a sign that you need to move logic to the host application.

If you need large scale, performant programming in an embeddable programming language, you are looking for Lua.

Feather is lightweight glue

Feather is designed to be embedded into a host language.

The core implementation provides the language semantics, but all memory allocations, I/O, Unicode and floating point operations are provided by the host.

Chances are that if you are embedding a scripting language in 2025, your host language already has an implementation of everything and duplicating Unicode tables or getting two event loops to play nice with each other is more trouble than it's worth.

Feather provides libraries for using Feather directly in your programming language.

Supported Platforms

Intentionally not supported Platforms

Ruby

Ruby can already be programmed at runtime in Ruby.

The introduction of Boxes in Ruby 4, and mruby cover all possible use cases.

Python

Python is already dynamic and untrusted user code can be executed in WASM-based Python interpreters.

联系我们 contact @ memedata.com