
TKE: Modern Tcl/Tk-based text editor - blacksqr
http://tke.sourceforge.net/index.html
======
SwellJoe
I remember when I used to cringe that an application was built with Tcl/Tk
because it would be very slow and need quite a bit more memory than a similar
application written in C or C++. But, today, I suspect this editor is an order
of magnitude faster and an order of magnitude smaller than Atom or VSCode
(this is purely speculation, of course...but, I feel like it's a reasonable
hunch, based on my experience with Tcl/Tk in the past).

~~~
mhd
Not like C/C++ applications go easy on memory these days, either. When GUI
libraries include CSS and JavaScript interpreters, suddenly MFC and Motif look
less bloaty…

Never mind Java editors/IDE, which are pretty much standard these days.

~~~
Longhanks
The only "standard" full-fledged IDEs I can think of that are Java are
IntelliJ and Eclipse. Visual Studio (WPF), Xcode (Cocoa), Qt Creator (Qt),
KDevelop (KDE Frameworks/Qt), GTK Builder (GTK) are all built with their
platform's native toolkit.

Concerning text editors, I think that field is split between Electron-based,
Sublime and terminal-based editors. I can't picture users writing in Java
editors in 2018.

~~~
adl
Pycharm, Webstorm, Goland and Intellij, are some of the most used IDEs, all
Java based.

~~~
laumars
That's a little disingenuous because they're all JetBrains IDEs and thus are
just variations of IntelliJ

------
Anonymous4C54D6
So, Hackernews, here is what I want you to do. Create a website with "solve
this with your editor" challenges where everybody can upload screencasts and
compete. :)

An obvious metric would be /time to completion/ but I would also be interested
to see /can be done with mouse only while drinking coffee/ or in general /can
be done one-handed/, /can be done left handed/ (so the mouse is free) or maybe
/keystrokes+clicks/ instead of general timing because it takes the typing
speed out of it. Some metric that measures how many shortcuts you have to
memorize would be great, too.

Now somebody go and do it! :)

~~~
boomlinde
There is a very large margin between time I spend considering the solution to
a problem and the time I then spend writing it, so my main consideration with
an editor is ergonomics. For example, if I can do a change without moving my
hands off the home row in 20 seconds, that's better than a 5 second change
that involves alternating between the keyboard and the mouse.

~~~
joppy
So you spend a long time considering a change, and then you care about a 15
second difference in the time it takes to apply that change?

~~~
sophacles
I think you should reread the GP, what you're responding to is the opposite of
what was said :)

------
rauhl
Back when I was a macOS user (back when we just called it System 7 …) I
discovered Alpha: an extensible editor written in TCL. It was pretty amazing,
and was what first opened my eyes to what could be done with a scriptable
editor.

Oddly enough, it still exists:
[https://alphacocoa.sourceforge.io/](https://alphacocoa.sourceforge.io/) (last
updated 16 days ago!).

I’m a heavy emacs user nowadays, but there’ll always be a soft spot in my
heart for Alpha.

~~~
sephware
There seems to be a lot of influence between editors which to me is the most
interesting part of all of this. Just looking at TKE's screenshots, it
resembles VS Code to a not-insignificant degree, and VS Code and Atom both
seem to have been inspired graphically by Light Table, and all of these as
well as Alpha have a programmability that's heavily inspired by Emacs,
although Alpha's GUI is closer to TextMate which was influenced by BB Edit,
and the history of editors is something I'd love to see someone with more
knowledge of the history do a more comprehensive write-up of it.

------
rijoja
I never really got how Multi-Cursor / Multi selection became such a big deal.
It really never happens to me that I have to write the same thing on N-lines,
and when that happens VIM ninja works just as well.

~~~
akashakya
Multiple-cursor is useful when you want to edit lines which have non-trivial
edits or doesn't have a common string to use find-replace. simple example

    
    
       foo_bar -> fooBar
       bar_baz -> barBaz
    

Sometimes even this doesn't cut it and have to use mighty Emacs macros. (I'm
sure something similar exits for VIM)

~~~
deviantfero
please correct me if I'm wrong, but wouldn't

:'<,'>s/_b/B/

work in this case?

~~~
akashakya
With multiple cursors you are seeing the changes as you are editing. and you
have all of the normal editing shortcuts at your disposal. Example, if you
made a mistake while typing just hit undo.

~~~
bhaak
I would rather add the c option in cases where I'm not 100% sure what I'm
doing.

So in this case :'<,'>s/_b/B/c

That let's you step through every change and if something's wrong you can
press ESC and u to undo only the last change.

It depends on the actual problem of course, but multicursor edits also get
unwieldy if you're editing more than 2 or 3 lines.

What about if the lines are beyond the visible screen?

~~~
akashakya
Yes, no silver bullet. But most of my use case I find a generic pattern so I
don't check the individual edits. Anything more complex I'll switch to macros.

Btw, I meant undo like global undo which will let you undo the last keypress
for _all_ of the cursors. In your case, you meant undo for a particular
instance of change I guess.

Also, let's say there is different character after _

    
    
      foo_bar -> fooBar
      baz_car -> bazCar
      some_thing -> someThing 
    

Maybe you can do this with regex. but for a new user, he has to look it up.
With multiple-cursors, you don't even have to think about it.

However, you can use a macro.

------
gigatexal
Missing DYLD library on my Mac won’t let it run. Bug filed -
[https://sourceforge.net/p/tke/tickets/55/](https://sourceforge.net/p/tke/tickets/55/)

~~~
gigatexal
Fixed after installing TK from activestate.

------
fithisux
Disclaimer: Do not want to start a flamewar and I will continue to use TCL/TK
for the forthcoming years.

It is a really pitty that Tcl does not suppport a Lispy alternative interface
to the language. I used many times Tcl/TK which saved the day repeatedly. I
would like to have a really nice CL or Scheme interface to all TCL/TK goodies
or support alternative syntax like JS or JVM languages.

Once there was a Scipad. What happened with that project?

~~~
sanxiyn
IIRC, LTK provides a comprehensive binding to Tk for Common Lisp.

~~~
alxlaz
I'm here to second LTK :-). It's a while since I last used it (2012, 2013, I
think?) but it was, and I'm sure it still is, a very good library. It's easy
to get started with, easy to work with, easy to debug.

------
zinid
So I tried to install it and got fancy error:

$ ./install.tcl

...skipped...

Copying data to lib/tke/data... done.

Copying doc to lib/tke/doc... done.

Copying lib to lib/tke/lib... error!

    
    
      error copying "lib" to "lib/tke/lib": "lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/...skipped.../tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/lib/tke/doc/md/TKE Developer Guide/Plugin Development/Safe (Untrusted) Interpreter Description.md": file name too long

~~~
tyingq
That looks like what you would get if you asked it to install in the same
directory you downloaded it to.

It would try to copy lib/ into itself, resulting in your
"lib/tke/lib/tke/lib/tke/..." mess.

Like:

    
    
      $ mkdir lib
      $ mkdir lib/tke
      $ tclsh
      % file copy lib lib/tke/lib
      error copying "lib" to "lib/tke/lib": "lib/tke/lib/tke/[cut off long string here]": file name too long
    

Specify a root directory other than the current directory and it should work.

I wonder if tcl should disallow copying a directory into itself.

Edit: I opened a bug report for tcl:
[https://core.tcl.tk/tcl/tktview/82049f96f841214bb8cee18e1bf8...](https://core.tcl.tk/tcl/tktview/82049f96f841214bb8cee18e1bf8f84aa25ed9aa)

------
pkz
Why is this hosted on Sourceforge? Looks fishy. Is it a bitcoin miner?

~~~
mehrdadn
SourceForge has not been fishy for a while now.

~~~
unixhero
It's a little hard to forget.

~~~
mehrdadn
I mean, it's your loss. There's great software there.

------
int_19h
This appears to be non-high-DPI-aware on Windows (on Win10, the OS pixel-
scales it on a 4K display). Is it possible to fix, or a fundamental Tk
limitation?

~~~
ernst_klim
>or a fundamental Tk limitation?

This.

~~~
opencl
[https://wiki.tcl-lang.org/page/tk+scaling](https://wiki.tcl-
lang.org/page/tk+scaling)

Tk has perfectly good DPI scaling.

~~~
int_19h
But is it capable of automatically applying whatever the current OS
configuration is?

------
pablo1
What about the "Native Vim Support" listed on the homepage? I can't find any
more info on that. Has anyone tried it?

~~~
deevus
I tried some basic motions and the editor crashed

~~~
phase1geo
Could you elaborate on this? I use TKE in Vim mode every day and haven't run
into issues with supported Vim motions. What motions did you try doing? Tcl/Tk
is usually pretty difficult to crash.

~~~
deevus
I tried it again just now.

1\. Opened TKE

2\. Changed to insert mode

3\. Typed some random characters

4\. Pressed ESC

5\. Press b

TKE crashed

I'm on Windows 10, recently fresh install.

~~~
phase1geo
Never mind. I get the same problem with the version that comes with the
bundled version of TKE. I appreciate the information!

~~~
deevus
Happy to help

------
__michaelg
I read 'Modem' instead of 'Modern' and it still made sense.

------
mhd
Doesn't seem to package Tcl/Tk (despite things being one of its strong
points), so make sure your local system has a recent enough version.

~~~
fithisux
Undrowish is your friend?

------
progfix
The german localisation is so so bad. If you speak german and you need a laugh
please install it.

The document view is called "Ms. Pacman" Hahah :D

~~~
phase1geo
TKE uses some automation to attempt to provide translations (as if you haven't
already guessed). If you have some time, fixing the translation file would be
greatly appreciated!

------
dsego
I don't trust SourceForge.

------
gaius
Back in the day my editor of choice on classic MacOS was called Alpha, also
extensible in Tcl. Can’t find any version of it for OSX. I’ll take this one
for a spin later!

But... sourceforge? Really?!

~~~
hawski
There should be a bot or a separate feature on HN which would add a FAQ
section automatically based on a title, a domain and maybe if we are wild on
contents. So when something is hosted on Source Forge this link could be
presented: [https://arstechnica.com/information-
technology/2016/06/under...](https://arstechnica.com/information-
technology/2016/06/under-new-management-sourceforge-moves-to-put-badness-in-
past/)

~~~
bhaak
I find it surprising how merciless some people are in remembering this issue
with Sourceforge.

Considering how loved Microsoft is these days when it was a much worse player
in the past, likely even set back personal computing a decade, and all their
anticompetetive actions.

I chalk it up as some kind of disappointment by expecting better of SF than
others.

------
Ice_cream_suit
"The Free Software Foundation recently released an "Ethical Repository
Criteria" list, and it gave SourceForge a failing grade"

Just saying...

~~~
OskarS
According to GNU's page on this, GitHub also got a failing grade: [0]

Are you making this same comment every time someone posts a project on GitHub?

[0]: [https://www.gnu.org/software/repo-criteria-
evaluation.html](https://www.gnu.org/software/repo-criteria-evaluation.html)

------
myspy
Wow, long time not seen Tcl/Tk. I came in touch with it and I can't find
anything nice to say about Tcl. So a round of applause to you for building an
editor with it.

