+
Skip to content

metal-ci/tcl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metal::tcl

METAL_TCL_PACKAGE(GetStarted, "1.0", mod)
{
  metal::tcl::create_command(mod, "hello")
    .add_function(
        +[](boost::core::string_view name)
        {
          std::cout << "Hello " << name << "!" << std::endl;
        });
}
load ./libgetstarted[info sharedlibextension]

hello [lindex $argv 1]

This C++17 library makes it easy to extend tcl with C++ or vice versa. It requires boost and TCL.

Read the docs here.

Why TCL?

Tcl is a unique combination of a full script language with a command language. You can execute other programs with tclsh, like this:

g++ hello_world.cpp

while at the same time load and execute arbitrary C or C++ code, e.g.:

load ./libbuildhelpers[info sharedlibextension]

g++ [list-sources]

where list-sources is a command defined in C++.

Since tcl can be embedded in C++ as well, it is also a great starting point for interactive console applications; and because of the syntax it can be used to create DSLs that do not look and feel like Tcl. redis and sqlite started out that way.

License

Distributed under the Boost Software License, Version 1.0.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载