Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Jevmem – automatic project memory for Claude Code, built on Jev (github.com/avinash-jetwani)
    9comments
  2. Platform-Independent SIMD in Go (go.dev)
    70comments
  3. Git-bug: Distributed, offline-first bug tracker embedded in Git (github.com/git-bug)
    46comments
  4. First Principles Thinking (sunilsadasivan.com)
    24comments
  5. Classified Estimates Show the NSA Is Paying Billions to Test AI Models (washingtonsun.com)
    30comments
  6. Pentium II at 600Mhz with Voodoo 3 Emulated on 86Box with M6 Mac Mini (nyaa.sh)
    85comments
  7. Ink and Switch Interactive Homepage (inkandswitch.com)
    19comments
  8. U.S. appeals court upholds designation of Anthropic as supply chain risk (cnbc.com)
    10comments
  9. F-Droid 2.0 (f-droid.org)
    396comments
  10. Dutch governments builds alternative for Microsoft based on NixOS (dawo.community)
    444comments
  11. Allow Carriers on Planes (jefftk.com)
    144comments
  12. Factorio that you can touch (factorio.com)
    9comments
  13. Gravity Seems Holographic. What Does That Mean for Reality? (quantamagazine.org)
    9comments
  14. Boards of Casio (ambionix.com)
    18comments
  15. Show HN: Make cursed fonts like Times New Bastard (mitpit.com)
    115comments
  16. Amiga Screens: A Primer (datagubbe.se)
    13comments
  17. CVE-2025-13032: Entering and Breaking the Avast Antivirus Sandbox Part 2 (safateam.com)
    23comments
  18. Show HN: Whiteboard (YC W26) – An open-source IDE for thoughtful software design (github.com/devdotfast)
    126comments
  19. Special Projects (2016) (openai.com)
    36comments
  20. Why is the liver so weirdly regenerative? (dynomight.substack.com)
    257comments
  21. The Test (tante.cc)
    24comments
  22. Microsoft Abandons Personal AI Chatbot Race with Copilot Reboot (bloomberg.com)
    22comments
  23. 2DWillNeverDie (2dwillneverdie.com)
    73comments
  24. Rails World 2026 Opening Keynote [video] (youtube.com)
    428comments
  25. Toyota is taking the Corolla electric (electrek.co)
    719comments
  26. Opus 5.5 is good at explainer videos (launchvideo.io)
    197comments
  27. Fearless SIMD v1.0 (linebender.org)
    47comments
  28. My weird new hobby: Wandering around Tokyo on Google Maps (ahmedhossamdev.com)
    171comments
  29. Two-tier encryption in the UK (macanorak.com)
    442comments
  30. Using LLMs to trace alchemical knowledge and decode 17th century letters (resobscura.substack.com)
    35comments

Eagle: Tcl interpreter implemented in CLR

80 pointsby 10y agoeagle.to
33 comments
10y agoHN ↗

I've always found Tcl interesting-yet-strange, but any language that lands on the CLR gets bonus points, especially if the interop design for calling into the .NET base class libraries is clean.

10y agoHN ↗

This brings back memories of writing Tcl for AOLServer after listening to Phil Greenspun rave about it.

10y agoHN ↗

Author of Eagle here, happy to answer any questions people might have.

10y agoHN ↗

What was the problem you faced for this solution ?

10y agoHN ↗

That there was no Tcl implementation for the CLR?

Can we not just build cool things? Sorry, I could not help myself.

Fun fact: antirez of Redis fame started with an interest in Tcl, and he has written about it. He wrote his own minimalist Tcl implementation in C, despite the original being an exemplary C project (or so I have heard the Tcl codebase is still sometimes used, despite reservation about the resulting language here, as a very clean and easy learning object for teaching language/interpreter design) and I doubt none of his experiences or lessons learned bled into the uber-success that Redis now is, right?

http://antirez.com/articoli/tclmisunderstood.html

https://github.com/antirez/jim

10y agoHN ↗

Though the contents of https://github.com/antirez/jim dates from 2009, Jim Tcl is actively maintained. You'll find the official GitHub mirror at https://github.com/msteveb/jimtcl.

Edit: If this subthread got you interested, antirez's other Tcl projects are worth checking out. They are listed on his page on the Tcler's wiki: https://tcl.wiki/9497. I particularly recommend https://tcl.wiki/Picol, the tiny predecessor to Jim Tcl, and https://tcl.wiki/Sugar, a macro system for Tcl 8.4+. Disclosure: I maintain a somewhat larger fork of the former.

10y agoHN ↗

Jim Tcl sounds really awesome. I use tcl quite a bit as the embedded scripting language in a CAE app. Things like OO with garbage collection and closures/functional primitives are probably what I miss the most from Tcl.

10y agoHN ↗

The original impetus for the project was to create a simple, self-contained Tcl interpreter in managed code.

10y agoHN ↗

Why does the copyright go from 2007-2012? Is the project still active? Lots of users?

10y agoHN ↗

It's quite active. The most recent release was October 1st (one week ago).

Updating the copyright date is not super important, due to how the copyright laws are written; however, I'll probably update it again eventually.

10y agoHN ↗

Cool. I have a special place in my heart for scripting languages due to their extreme productivity boost for shorter programs. How much faster does this run using .NET?

10y agoHN ↗

How much faster does what run? In terms of raw performance, Eagle is not faster than Tcl (i.e. since it's an interpreter running on a virtual machine rather than C code running much closer to the hardware).

10y agoHN ↗

My misunderstanding. I thought the TCL code was transpiled to .NET IL which then got JIT'd or something like that. I thought that's what IronPython did and guessed you did something similar.

10y agoHN ↗

I actually thought about doing this; however, I realized given the (lack of) type system in Tcl, the potential performance gains would be minimal. Also, this sort of dynamic compilation can lead to memory consumption issues that are very hard to address (i.e. due to being unable to unload the dynamically generated assemblies from the AppDomain). Additionally, it would limit the portability of the library, since some platforms do not permit JIT compilation (e.g. iOS).

10y agoHN ↗

What are some of your favorite reference materials for a compiler or interpreter writer interested in targeting the CLR?

10y agoHN ↗

Here are a few in no particular order:

1. Expert .NET 2.0 IL Assembler (ISBN 1590596463)

2. Advanced Windows Debugging (ISBN 0321374460)

3. Advanced .NET Debugging (ISBN 0321578899)

4. .NET Framework reference source code (https://referencesource.microsoft.com/)

5. CoreCLR source code (https://github.com/dotnet/coreclr)

6. MSDN documentation (it's not perfect, but it's not all bad)

Before CoreCLR was open source, I had to rely on Shared Source Common Language Infrastructure (https://en.wikipedia.org/wiki/Shared_Source_Common_Language_...).

10y agoHN ↗

Thanks! I just recently bought John Gough's Compiling for the .Net CLR but haven't had time to look into it. Open source resources like his Component Pascal compiler, and Eagle, seem like they'll be pretty important tools for learning this stuff.

10y agoHN ↗

Oh, man. It has been a long time since I messed with Tcl.

I haven't dug into the code yet, but I'm assuming "interpreter" means no DLR shenanigans or other platform-limiting stuff? (DLR-based scripting languages are no bueno on iOS, since you can't generate bytecode at runtime.)

10y agoHN ↗

Correct, Eagle does NOT use the DLR. In theory, it should be possible to port it to iOS.

There are a couple platform-specific portions of code; however, they are all optional and can be easily disabled at compile-time. Also, checks are performed at runtime prior to calling into those platform-specific portions of code.

The full test suite is routinely run on both Windows and Linux platforms (using Mono).

10y agoHN ↗

This sounds real rad. I'm gonna give this a look soon. Thanks!

10y agoHN ↗

Does eagle still use libtcl.so/.shlib/.dylib/.dll ? Or is it an entirely new implementation. I know at one point you could use libtcl.

10y agoHN ↗

It is an entirely new implementation.

However, to make things more confusing, it also permits dynamically loading native Tcl libraries and interacting with them, on both Windows and Unix. Of course, this feature is actually optional at compile-time because it requires using P/Invoke.

10y agoHN ↗

A few questions:

- Can you do Starkits!? With .NET and the CLR, pre-Core (since I see this goes back to 2012), that would be interesting?

- Can you run Fossil on this?

- How does type ellision work (or rather how do you handle moving between CLR/.NET primitives into a very different or minimalist Tcl type system)?

Thanks for the cool work. Sorry so many questions but that is what popped into my head!

10y agoHN ↗

Yes, Eagle supports completely self-contained deployment scenarios, including any application scripts you may need. You can end up with a single EXE, if needed.

Also, Eagle runs quite well on Mono, on both Mac OS X and Linux.

I'm not sure what you mean by "Can you run Fossil on this" since Fossil itself is written in C. However, Eagle can certainly be used with Fossil via its Tcl integration support. The Garuda package (part of Eagle) is used to load the CLR and Eagle from native Tcl.

Eagle "knows" about all the .NET primitive types, including generics, nullable value types, ByRef, multi-dimensional and nested arrays, and all delegate types. The "core marshaller" handles all translations between these types and strings. Everything is handled with full fidelity.

10y agoHN ↗

Sorry, that was dumb, re Fossil. I was tired and know the Sqlite/Fossil community are tight with the Tcl community (since the Fossil scripting language was once Tcl, and now I believe a derivative of Tcl now, called TH1), so I got confused with lack of coffee and just waking up.

https://www.fossil-scm.org/index.html/doc/trunk/www/th1.md

The type situation is cool. I know little of CLR and .NET, but will definitely check out this code. This sounds wonderful, good on you and your community! Perhaps I will play.

10y agoHN ↗

Actually, it's not dumb at all. Eagle uses Fossil as its source repository. Further, there are several other Eagle related projects that use Fossil quite extensively, including the new Package Repository Server.

10y agoHN ↗

How about Tk? Is it or will it be implemented?

10y agoHN ↗

It's not currently implemented; however, it could be implemented as a wrapper around WinForms (either in C# or Eagle).

Alternatively, it is possible to dynamically load and use Tcl/Tk from Eagle, including bidirectional communication with WinForms and/or WPF. This makes porting Tk applications or portions thereof relatively straightforward.

10y agoHN ↗

Is Tcl still used very often? The last time I looked, it was often used as a scripting language embedded into other programs, much like Lua. Is that still true?

10y agoHN ↗

Yes, it's still used in a variety of industries; however, given its nature, these uses are not always known.

For example, several prominent hardware companies embed Tcl in their firmware: Cisco, F5 Networks, and TiVo.

While it's true that Tcl was primarily intended to be used as an embedded scripting language, it can also be used for stand-alone application development. Also, the Tk toolkit may be used to create reasonable, cross-platform user interfaces.

10y agoHN ↗

Its very widely used in EDA. Companies like Cadence, Synopsys, Mentor etc. This software is used to design the chips in cell phones etc.