Tcl

1 program Added 2025-10-22T09:39:56Z Model: anthropic/claude-3.5-sonnetTemp: 0.4 Evidence Report issue View issues
Aliases: Tool Command Language, tcl/tk
Provenance: commit 4cf6713e54 · authored 2025-10-22T11:39:56+02:00 · model anthropic/claude-3.5-sonnet

Sources mentioning this language

8 sources · pl_id: pl/tcl
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q5288

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: event-driven · functional · imperative · object-oriented
Typingdynamic typing, everything is a string
Designed byTcl Core Team · John Ousterhout
First appeared1988
Influenced byAWK · Lisp
LicenseBSD -style
Implemented inC · Tcl
Homepagehttps://www.tcl-lang.org

Extensions claimed by this language

9 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.tbcwikidataprimary2.7K files
.tcllinguistprimary1.9M files
.tclpygmentsprimary1.9M files
.tclwikidataprimary1.9M files
.adplinguistsecondary52.1K files
.rvtpygmentssecondary10.3K files
.sdclinguistsecondary68.5K files
.tmlinguistsecondary60.6K files
.xdclinguistsecondary240.7K files

Related languages

Tcl/Tk (0.69)CCL (0.45)NCAR Command Language (0.41)DCL (0.41)Jacl (0.40)

LLM-contributed programs

Simple Calculator

Provenance: commit 4cf6713e54 · authored 2025-10-22T11:39:56+02:00 · model anthropic/claude-3.5-sonnet · Temp 0.4
code.tcl · license: BSD-style · added: 2025-10-22T09:39:56Z
#!/usr/bin/env tclsh
package require Tk

wm title . Calculator

set font {Arial 14}
set value 0
set op ""
set newnum 1

grid [entry .e -textvariable value -justify right \
    -font $font] -row 0 -column 0 -columnspan 4 -sticky nsew

foreach row {1 2 3 4} {
    grid rowconfigure . $row -weight 1
}
foreach col {0 1 2 3} {
    grid columnconfigure . $col -weight 1
}

proc click {s} {
    global value newnum op
    if {$s in {0 1 2 3 4 5 6 7 8 9 .}} {
        if {$newnum} {
            set value $s
            set newnum 0
        } else {
            append value $s
        }
    } elseif {$s in {+ - * /}} {
        set op $s
        set newnum 1
    } elseif {$s eq "="} {
        set value [expr $value]
        set newnum 1
    } elseif {$s eq "C"} {
        set value 0
        set newnum 1
    }
}

foreach {row col txt} {
    1 0 7  1 1 8  1 2 9  1 3 /
    2 0 4  2 1 5  2 2 6  2 3 *
    3 0 1  3 1 2  3 2 3  3 3 -
    4 0 0  4 1 .  4 2 =  4 3 +
} {
    grid [button .$row$col -text $txt -command [list click $txt] \
        -font $font] -row $row -column $col -sticky nsew
}

grid [button .c -text C -command {click C} -font $font] \
    -row 5 -column 0 -columnspan 4 -sticky nsew

Real programs from Software Heritage

2 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
PmodOLED_ooc.xdc · 680 B · ext .xdc · seen 38× in SWH
via fallback
swh:1:cnt:b2005fc5c6d42a9fc23bcea738c710e70eaa095c;origin=https://github.com/suisuisi/FPGA_Library;anchor=swh:1:rev:d95b04432091b7498f2233ee55743a022f64c7ad;path=/ThreePart/digilent_ip/ip/Pmods/PmodOLED_v1_0/src/PmodOLED_ooc.xdc
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
################################################################################

# This XDC is used only for OOC mode of synthesis, implementation
# This constraints file contains default clock frequencies to be used during
# out-of-context flows such as OOC Synthesis and Hierarchical Designs.
# This constraints file is not used in normal top-down synthesis (default flow
# of Vivado)
################################################################################
create_clock -name ext_spi_clk -period 10 [get_ports ext_spi_clk]
create_clock -name s_axi_aclk -period 10 [get_ports s_axi_aclk]

################################################################################
elf32tilegx_be.xdc · 8097 B · ext .xdc · seen 24× in SWH
via fallback
swh:1:cnt:9ae7bee9a3b48816f3c978ed6af17aa9de1c4efc;origin=https://github.com/MinimalOS/arm-linux-androideabi-4.9;anchor=swh:1:rev:70f01eba6b3bcfc8825ceffa01244f5f85908559;path=/arm-linux-androideabi/lib/ldscripts/elf32tilegx_be.xdc
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
/* Script for -pie -z combreloc: position independent executable, combine & sort relocs */
OUTPUT_FORMAT("elf32-tilegx-be", "elf32-tilegx-be",
	      "elf32-tilegx-le")
OUTPUT_ARCH(tilegx)
ENTRY(_start)
SECTIONS
{
  /* Read-only sections, merged into text segment: */
  PROVIDE (__executable_start = 0); . = 0 + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.gnu.build-id : { *(.note.gnu.build-id) }
  .hash           : { *(.hash) }
  .gnu.hash       : { *(.gnu.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .gnu.version    : { *(.gnu.version) }
  .gnu.version_d  : { *(.gnu.version_d) }
  .gnu.version_r  : { *(.gnu.version_r) }
  .rela.dyn       :
    {
      *(.rela.init)
      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
      *(.rela.fini)
      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
      *(.rela.ctors)
      *(.rela.dtors)
      *(.rela.got)
      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
      PROVIDE_HIDDEN (__rel_iplt_start = .);
      PROVIDE_HIDDEN (__rel_iplt_end = .);
      PROVIDE_HIDDEN (__rela_iplt_start = .);
      *(.rela.iplt)
      PROVIDE_HIDDEN (__rela_iplt_end = .);
    }
  .rela.plt       :
    {
      *(.rela.plt)
    }
  .init           :
  {
    KEEP (*(SORT_NONE(.init)))
  } =0
  .plt            : { *(.plt) }
  .iplt           : { *(.iplt) }
  .text           :
  {
    *(.text.unlikely .text.*_unlikely .text.unlikely.*)
    *(.text.exit .text.exit.*)
    *(.text.startup .text.startup.*)
    *(.text.hot .text.hot.*)
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
  } =0
  .fini           :
  {
    KEEP (*(SORT_NONE(.fini)))
  } =0
  PROVIDE (__etext = .);
  PROVIDE (_etext = .);
  PROVIDE (etext = .);
  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
  .rodata1        : { *(.rodata1) }
  .eh_frame_hdr : { *(.eh_frame_hdr) }
  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table
  .gcc_except_table.*) }
  /* These sections are generated by the Sun/Oracle C++ compiler.  */
  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges
  .exception_ranges*) }
  /* Adjust the address for the data segment.  For 32 bits we want to align
  at exactly a page boundary to make life easier for apriori. */
  . = ALIGN (CONSTANT (MAXPAGESIZE)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  /* Exception handling  */
  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
  /* Thread Local Storage sections  */
  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
  /* Ensure the __preinit_array_start label is properly aligned.  We
     could instead move the label definition inside the section, but
     the linker would then create the section even if it turns out to
     be empty, which isn't pretty.  */
  . = ALIGN(64);
  PROVIDE_HIDDEN (__preinit_array_start = .);
  .preinit_array     :
  {
    KEEP (*(.preinit_array))
  }
  PROVIDE_HIDDEN (__preinit_array_end = .);
  PROVIDE_HIDDEN (__init_array_start = .);
  .init_array     :
  {
    KEEP (*crtbegin*.o(.init_array))
    KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
    KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .ctors))
  }
  PROVIDE_HIDDEN (__init_array_end = .);
  PROVIDE_HIDDEN (__fini_array_start = .);
  .fini_array     :
  {
    KEEP (*crtbegin*.o(.fini_array))
    KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
    KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin*.o *crtend.o *crtend*.o ) .dtors))
  }
  PROVIDE_HIDDEN (__fini_array_end = .);
  .ctors          :
  {
    /* gcc uses crtbegin.o to find the start of
       the constructors, so we make sure it is
       first.  Because this is a wildcard, it
       doesn't matter if the user does not
       actually link against crtbegin.o; the
       linker won't look for a file to match a
       wildcard.  The wildcard also means that it
       doesn't matter which directory crtbegin.o
       is in.  */
    KEEP (*crtbegin.o(.ctors))
    KEEP (*crtbegin*.o(.ctors))
    /* We don't want to include the .ctor section from
       the crtend.o file until after the sorted ctors.
       The .ctor section from the crtend file contains the
       end of ctors marker and it must be last */
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend*.o ) .ctors))
    KEEP (*(SORT(.ctors.*)))
    KEEP (*(.ctors))
  }
  .dtors          :
  {
    KEEP (*crtbegin.o(.dtors))
    KEEP (*crtbegin*.o(.dtors))
    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend*.o ) .dtors))
    KEEP (*(SORT(.dtors.*)))
    KEEP (*(.dtors))
  }
  .jcr            : { KEEP (*(.jcr)) }
  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) }
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got) *(.igot) }
  . = DATA_SEGMENT_RELRO_END (SIZEOF (.got.plt) >= 8 ? 8 : 0, .);
  .got.plt        : { *(.got.plt)  *(.igot.plt) }
  .data           :
  {
    *(.data .data.* .gnu.linkonce.d.*)
    SORT(CONSTRUCTORS)
  }
  .data1          : { *(.data1) }
  _edata = .; PROVIDE (edata = .);
  . = .;
  __bss_start = .;
  .bss            :
  {
   *(.dynbss)
   *(.bss .bss.* .gnu.linkonce.b.*)
   *(COMMON)
   /* Align here to ensure that the .bss section occupies space up to
      _end.  Align after .bss to ensure correct alignment even if the
      .bss section disappears because there are no input sections.  */
   . = ALIGN(64);
  }
  . = ALIGN(64);
  . = SEGMENT_START("ldata-segment", .);
  . = ALIGN(64);
  _end = .;
  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
  PROVIDE (end = .);
  . = DATA_SEGMENT_END (.);
  /* Stabs debugging sections.  */
  .stab          0 : { *(.stab) }
  .stabstr       0 : { *(.stabstr) }
  .stab.excl     0 : { *(.stab.excl) }
  .stab.exclstr  0 : { *(.stab.exclstr) }
  .stab.index    0 : { *(.stab.index) }
  .stab.indexstr 0 : { *(.stab.indexstr) }
  .comment       0 : { *(.comment) }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section so we begin them at 0.  */
  /* DWARF 1 */
  .debug          0 : { *(.debug) }
  .line           0 : { *(.line) }
  /* GNU DWARF 1 extensions */
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
  .debug_sfnames  0 : { *(.debug_sfnames) }
  /* DWARF 1.1 and DWARF 2 */
  .debug_aranges  0 : { *(.debug_aranges) }
  .debug_pubnames 0 : { *(.debug_pubnames) }
  /* DWARF 2 */
  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
  .debug_abbrev   0 : { *(.debug_abbrev) }
  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  .debug_frame    0 : { *(.debug_frame) }
  .debug_str      0 : { *(.debug_str) }
  .debug_loc      0 : { *(.debug_loc) }
  .debug_macinfo  0 : { *(.debug_macinfo) }
  /* SGI/MIPS DWARF 2 extensions */
  .debug_weaknames 0 : { *(.debug_weaknames) }
  .debug_funcnames 0 : { *(.debug_funcnames) }
  .debug_typenames 0 : { *(.debug_typenames) }
  .debug_varnames  0 : { *(.debug_varnames) }
  /* DWARF 3 */
  .debug_pubtypes 0 : { *(.debug_pubtypes) }
  .debug_ranges   0 : { *(.debug_ranges) }
  /* DWARF Extension.  */
  .debug_macro    0 : { *(.debug_macro) }
  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  /* TILE architecture interrupt vector areas */
  .intrpt0 0xfc000000 : { KEEP(*(.intrpt0)) }
  .intrpt1 0xfd000000 : { KEEP(*(.intrpt1)) }
  .intrpt2 0xfe000000 : { KEEP(*(.intrpt2)) }
  .intrpt3 0xff000000 : { KEEP(*(.intrpt3)) }
  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.mdebug.*) }
}

Contribute — propose a file extension

Tell us where to find evidence about Tcl (mapped to pl/tcl). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Tcl/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← TC Tcl/Tk →