4 ms·
Author of Eagle here, happy to answer any questions people might have.
by mistachkin 10y ago
Author of Eagle here, happy to answer any questions people might have.
- crudbug 10y agoWhat was the problem you faced for this solution ?
- 616c 10y agoThat 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 10y agoThough 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 10y agoJim 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.
- mistachkin 10y agoThe original impetus for the project was to create a simple, self-contained Tcl interpreter in managed code.
- smegel 10y agoThat's a what, not a why.
- throwaway7645 10y agoWhy does the copyright go from 2007-2012? Is the project still active? Lots of users?
- mistachkin 10y agoIt'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.
- throwaway7645 10y agoCool. 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?
- mistachkin 10y agoHow 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).
- throwaway7645 10y agoMy 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.
- mistachkin 10y agoI 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).
- justin66 10y agoWhat are some of your favorite reference materials for a compiler or interpreter writer interested in targeting the CLR?
- mistachkin 10y agoHere 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/ https://referencesource.microsoft.com/) 5. CoreCLR source code (https://github.com/dotnet/coreclr 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_Infrastructure https://en.wikipedia.org/wiki/Shared_Source_Common_Language_...).
- justin66 10y agoThanks! 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.
- eropple 10y agoOh, 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.)
- mistachkin 10y agoCorrect, 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).
- eropple 10y agoThis sounds real rad. I'm gonna give this a look soon. Thanks!
- rkeene2 10y agoDoes eagle still use libtcl.so/.shlib/.dylib/.dll ? Or is it an entirely new implementation. I know at one point you could use libtcl.
- mistachkin 10y agoIt 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.