5 ms·
TclForth: Forth to Tcl transpiler
- sigjuice 10y agoCompiler. Like clang or gcc - a program that converts from one language to another. $ cat hello.c #include <stdio.h> int main(void) { printf("hello world\n"); return 42; } $ cc -O3 -S hello.c -o - .section __TEXT,__text,regular,pure_instructions .macosx_version_min 10, 12 .globl _main .align 4, 0x90 _main: ## @main .cfi_startproc ## BB#0: pushq %rbp Ltmp0: .cfi_def_cfa_offset 16 Ltmp1: .cfi_offset %rbp, -16 movq %rsp, %rbp Ltmp2: .cfi_def_cfa_register %rbp leaq L_str(%rip), %rdi callq _puts movl $42, %eax popq %rbp retq .cfi_endproc .section __TEXT,__cstring,cstring_literals L_str: ## @str .asciz "hello world" .subsections_via_symbols
- sedatk 10y agoassembly source is the byproduct of compilers not their output.
- smcl 10y agoGenerally speaking compiler will take C/C++/Go/whatever and produce assembly as output. The Assembler will produce take this output .asm/.s and produce some form of binary. The Linker will take these binaries and produce an executable you can run. Note this is oversimplified (and in some cases wrong) but the general point is that when you call a "compiler" you're generally calling a high-level utility that ties a number of separate components together.
- srean 10y agoFully agree. Not sure why you are being downvoted. The word 'transpiler' annoys me a great deal because we already had a word in frequent use for that.
- sigjuice 10y agoThe project README doesn't use this word either. The Forth source code is compiled to Tcl procedures for execution in the Tcl run time system.
- cjhanks 10y agoThis is a fantastic endeavor in masturbatory software. Converting from one of the more obscure (though surprisingly useful) languages to an equally obscure target. There may only be a handful of people on Earth who know both Forth an TCL well enough to be sure this program works.
- progman 10y agoForth solely based on Tcl/Tk - nice idea! This allows me to write GUI scripts without having to deal with the TCL syntax, and without being dependent on bindings to other languages. This is the KISS principle in action! However, there are two little bugs (in Linux). 1) "Help / tclForth Guide" causes an error message because an URL cannot be executed as a script. You should take reference to the BROWSER environment variable. This should also work in OSX. 2) When I start the chess GUI there also appears an empty window named "chess.tcl". Is it possible to keep this window close? You should mention on your homepage that the tcl scripts should be started with "wish", or you should add the following two lines at the top of the tcl scripts: #!/bin/sh exec wish "$0" ${1+"$@"} By the way, how can I handle command line arguments?
- t1amat 10y agoNeat project and potentially worth playing with. Appears to be abandoned though, sadly.