5 ms·
Tcl: one of the slowest languages https://github.com/trizen/language-benchmarks https://github.com/trizen/language-benchmarks
by jhallenworld 7y ago
Tcl: one of the slowest languages
https://github.com/trizen/language-benchmarks https://github.com/trizen/language-benchmarks
- bbmario 7y agowtf luajit is a monster
- steveklabnik 7y agoIt really is. Mike Pall is... beyond words. https://web.archive.org/web/20170102051538/http://article.gmane.org/gmane.comp.lang.lua.general/75426 https://web.archive.org/web/20170102051538/http://article.gm... (Discussed on HN: https://news.ycombinator.com/item?id=2588696 https://news.ycombinator.com/item?id=2588696)
- chaorace 7y agoI think it's cheating a bit to compare JIT vs runtime script evaluation. I'd be more interested to see LuaJIT performance measured against something more comparable, like JS running on V8.
- tomnipotent 7y agoProbably why it's so popular in games as a scripting engine (going back to 2003).
- est 7y ago> in games as a scripting engine (going back to 2003) you are think of lua, luajit is a different beast. http://luajit.org/changes.html http://luajit.org/changes.html LuaJIT 1.0.3 — 2005-09-08 This is the first public release of LuaJIT.
- tomnipotent 7y agoDidn't realize they had the Python/PyPy thing going on. Thanks for the info!
- stjohnswarts 7y agoI thought it was dead/dying though? No future plans to add new features, especially sense the creator said he was done with it...
- forinti 7y agoBut it's the fastest way to put together a GUI.
- criddell 7y agoDoes Tcl deal with platform-specific GUI elements, or does it restrict you to a lowest common denominator set of widgets? Are there different dialog layout controllers? For example, in Swing there's BoxLayout, CardLayout, SpringLayout, etc...
- pwg 7y agoYou get both native and custom GUI elements with modern Tk. And yes, there are plural "layout controllers" (Tk calls them "geometry managers").
- fooblitzky 7y agoI believe they are referring to the Tk GUI toolkit, which is intended for use from Tcl and really nice to work with. It is full featured and has plenty of widgets and layout controllers. You can find out all about Tk here: https://tkdocs.com/ https://tkdocs.com/ It is really fast and easy to create GUIs using Tcl/Tk, e.g. here is a Tcl script to create a paint-like program in less than 50 lines: https://pastebin.com/6qibnQcJ https://pastebin.com/6qibnQcJ The main downside is that the look and feel is not native, and a bit dated. There are some efforts to update the look, but it's not as slick as Gtk etc.
- jhallenworld 7y agoWhat about tkinter for Python?
- nrclark 7y agoI dunno if you were going for irony or not with that!
- ThomasBHickey 7y agoI always thought Java should have just used Tk rather than developing AWT, which never worked very well.
- haolez 7y agoTcl is really nice to work with. It’s a weird mix between a programming language and a command line interface. If you’ve never touched it, I recommend you to do so if you are curious :)
- igouy 7y agoMaybe Tcl does recursion poorly — those all seem to be tiny recursive functions. Maybe there was something Tcl did well? https://web.archive.org/web/20060924085254/http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=all https://web.archive.org/web/20060924085254/http://shootout.a...
- databasher 7y agoTCL had an amazing architecture for someone who was working in C. In C, you'd (1) create an instance of a TCL interpreter, (2) register your C functions with the TCL interpreter, and then (3) load scripts into the TCL interpreter. You'd do all your fast stuff in your C code, and just use the TCL for stitching together the high-level logic.
- pinopinopino 7y agoThis, it is really easy to embed the tcl interpreter. Far easier than perl and python, even easier than lua.
- lanstin 7y agoEspecially the commands were invoked command_name(argv, argc) and the thing was just like a CS 101 C program. Dead simple, and as they mentioned just used to orchestrate the fast stuff. You shouldn't make a command block a long time, but you could grab a handle to the output destination and set it up to stream output there from the C.
- mhd 7y agoTcl: No significant difference to Python or Perl It matters even less for Tcl, as it's supposed to tie pieces written in more performant languages together. See "Ousterhout's dichotomy"[1]. Sadly that also moved it closer to something like Rexx (or Lua these days), and thus no proper module/package community ever arose in time. [1]: https://en.wikipedia.org/wiki/Ousterhout%27s_dichotomy https://en.wikipedia.org/wiki/Ousterhout%27s_dichotomy
- jhallenworld 7y agoMaybe true, but there are fast math extensions: https://realpython.com/numpy-tensorflow-performance/ https://realpython.com/numpy-tensorflow-performance/
- ori_b 7y agoYes. Those work by tying python to pieces written in a more performant language.
- mhd 7y agoAnd Perl has PDL. Not aware of anything for Tcl beyond math::statistics, but I think it waned in popularity way before the ML bubble started inflating. But in my experience, the strategy for Tcl is the inverse of Python when it comes to domming/subbing with your "partner language". You _extend_ python, you _embed_ Tcl. At least in the areas where Tcl still survives. It lost long ago against the P-languages, but still faces Lua rather bravely in the enterprise/engineering sector.
- deaps 7y agoA pretty good read on tcl - and why the F5 devices use tcl for their iRules (2012, Updated two years ago). https://devcentral.f5.com/s/articles/irules-concepts-tcl-the-how-and-why https://devcentral.f5.com/s/articles/irules-concepts-tcl-the...