ufko.org

I just dove deeper into Tcl.


"While other languages are about how the application does it, Tcl is about what the application does."


What fascinates me about Tcl is its perfect overlap between code, command, and human language. I you want, a command call reads like a line from a literary novel. Full English, smooth, logical, and still completely executable in Tcl.

# Simple definition with fully grammatical English
proc alter {"the" "table" t "and" "rename" "the" "column" m "to" n} {
  set sql "alter table $t rename column $m to $n"
  puts $sql
}

# Nice error message
alter the table x and column c1 to c2
# Error: wrong # args: should be "alter the table t and rename the column m to n"

# Readable call
alter the table x and rename the column c1 to c2

Tcl speaks to both humans and machines. Do this in your language :)


Github - Tcl related:

Wiki pages I created:

List of my functions I'm using or testing in wapp-fork:

These functions, in my opinion, make the code more readable and simpler.

  all?
  arraylist
  assoc
  boolean?
  cmd?
  count
  datetime
  dbg
  dir?
  double?
  empty?
  ends?
  even?
  false?
  fappend
  file?
  filter
  first
  flatten
  fread
  fread?
  fwrite
  fwrite?
  global?
  if2
  int?
  key
  kv
  last
  list?
  listjson
  lookup
  lower
  ltrim
  markdown
  member?
  number?
  odd?
  parray
  parse
  randhex
  range
  reduce
  reject
  replace
  rest
  rtrim
  seek
  setl
  setm
  slice
  sql
  sqlcli
  sqlget
  sqlone
  sqlserver
  sqlset
  starts?
  static
  stats
  test
  timestamp
  trap
  trim
  true?
  upper
  var?
  vibe
  zero?