
Eagle: Tcl interpreter implemented in CLR - blacksqr
https://eagle.to/
======
mistachkin
Author of Eagle here, happy to answer any questions people might have.

~~~
crudbug
What was the problem you faced for this solution ?

~~~
616c
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](http://antirez.com/articoli/tclmisunderstood.html)

[https://github.com/antirez/jim](https://github.com/antirez/jim)

~~~
networked
Though the contents of
[https://github.com/antirez/jim](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](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](https://tcl.wiki/9497). I particularly recommend
[https://tcl.wiki/Picol](https://tcl.wiki/Picol), the tiny predecessor to Jim
Tcl, and [https://tcl.wiki/Sugar](https://tcl.wiki/Sugar), a macro system for
Tcl 8.4+. Disclosure: I maintain a somewhat larger fork of the former.

~~~
auxym
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.

------
sblom
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.

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

------
616c
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!

~~~
mistachkin
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.

~~~
616c
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](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.

~~~
mistachkin
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.

------
systems
now imagine writing tcl commands in f#

------
criddell
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?

~~~
mistachkin
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.

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

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

~~~
mistachkin
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.

