Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tcl switched to a bytecode compiler with version 8.0 about 20 years ago, which delivered significant speedups in execution.


Yes, but I thought that was a JIT compiler. For all practical purposes, still an interpreter model from the user perspective.

Does it allow for ahead of time compilation to bytecode? With build-time reporting of errors in the source code?


If you mean the wikipedia definition of compiling source code to machine code at runtime, then no. The Tcl interpreter contains a bytecode virtual machine, more along the Java model.

Source code is converted to bytecode on the procedure level, not the program level, so there's no program-wide checks for consistency. It's done at runtime.

There are some officially unsupported tools built in to the interpreter that let you dump bytecode of compiled procedures and reload it. You'd have to roll your own dumping and loading scripts if you wanted to deliver an entire program using those tools.


There is an AOT Tcl-to LLVM IR compiler in development.

https://wiki.tcl-lang.org/page/tclquadcode




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: