🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.tcl
Article #20

Re: Experiment: inline bytecode for [lrange] with variable indices (written by Claude)

#20
From: Olivier
Date: Thu, 08 Oct 2026 08:23
41 lines
2750 bytes
et99 <et99@rocketship1.me> posted:

> On 10/7/2026 12:25 PM, Olivier wrote:
> > 
> > et99 <et99@rocketship1.me> posted:
> > 
> >> Hi all:
> >>
> >> This experiment started as a side effect of a tool Claude and
> >> I wrote to scan every proc in every package of a Magicsplat install,
> >> looking for bytecode problems.
> >>
> >> Eric
> >>
> > 
> > Is your work something similar to Donal Fellows ("Optimizing Tcl Bytecode") ?
> > I mean by supplying Donal Fellow's recommendations to Claude, it could
> > improve something in Tcl speed, at least in the range of functionalities you have explored ?
> > 
> > In fact I don't know if his work has been applied or not.
> > 
> > Olivier.
> 
> Hi Olivier:
> 
> Short answer: kinda, I'm aware of Donal's peephole work in the core, and the assemble documentation has a section on it. But I imagine he's also working on other optimizations. My own scanning is a different thing, though. It's read-only analysis of compiled bytecode, not an optimizer.
> 
> Next I looked for commands that were heavily used but not inlined, and found lrange. Since Claude can now build Tcl in his sandbox and test his own code, I asked him to inline it. He did, and he used validation tools I'd never heard of.
> 
> I'm having tons of fun with this. It may be my $20 a month level that makes it work so well, but it beats a cable subscription. :)
> 
> -eric

This is the question I had in mind but dare not to ask. 20 $ to analyze
20 000 procedures, it is not expensive but there is probably some dumping
at the moment. Improving code with AI under the look of experimented programmers
can be a good thing once we really know the actual cost for it.
Thanks for having report your work, it is very interesting.

Olivier.
Technical Details
Message-ID: <1791447817-1108@newsgrouper.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail
References: <11a46mp$2f14b$1@dont-email.me> <1791401131-1108@newsgrouper.org> <11a77uh$3gpfh$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!newsgrouper.org!.POSTED!not-for-mail
From: Olivier <user1108@newsgrouper.org.invalid>
Newsgroups: comp.lang.tcl
Subject: Re: Experiment: inline bytecode for [lrange] with variable indices (written by Claude)
References: <11a46mp$2f14b$1@dont-email.me> <1791401131-1108@newsgrouper.org> <11a77uh$3gpfh$1@dont-email.me>
Date: Thu, 08 Oct 2026 08:23:37 GMT
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <1791447817-1108@newsgrouper.org>
Injection-Info: newsgrouper.org; mail-complaints-to="newsgrouper@yahoo.com"; posting-account=user1108
Injection-Date: Thu, 08 Oct 2026 08:23:37 GMT
User-Agent: Newsgrouper/0.9.0
Organization: tcltk@vivaldi.net